diff --git a/README.md b/README.md index d21e7e7f..1ef3fe8b 100644 --- a/README.md +++ b/README.md @@ -28,30 +28,19 @@ You can use OpenCommit by simply running it via the CLI like this `oco`. 2 secon npm install -g opencommit ``` - Alternatively run it via `npx opencommit` or `bunx opencommit` - - MacOS may ask to run the command with `sudo` when installing a package globally. - -2. Get your API key from [OpenAI](https://platform.openai.com/account/api-keys). Make sure that you add your payment details, so the API works. +2. Get your API key from [OpenAI](https://platform.openai.com/account/api-keys) or other supported LLM providers (we support them all). Make sure that you add your OpenAI payment details to your account, so the API works. 3. Set the key to OpenCommit config: ```sh - oco config set OCO_OPENAI_API_KEY= + oco config set OCO_API_KEY= ``` Your API key is stored locally in the `~/.opencommit` config file. ## Usage -You can call OpenCommit directly to generate a commit message for your staged changes: - -```sh -git add -opencommit -``` - -You can also use the `oco` shortcut: +You can call OpenCommit with `oco` command to generate a commit message for your staged changes: ```sh git add @@ -70,22 +59,17 @@ You can also run it with local model through ollama: ```sh git add -oco config set OCO_AI_PROVIDER='ollama' +oco config set OCO_AI_PROVIDER='ollama' OCO_MODEL='llama3:8b' ``` -If you want to use a model other than mistral (default), you can do so by setting the `OCO_AI_PROVIDER` environment variable as follows: - -```sh -oco config set OCO_AI_PROVIDER='ollama' -oco config set OCO_MODEL='llama3:8b' -``` +Default model is `mistral`. If you have ollama that is set up in docker/ on another machine with GPUs (not locally), you can change the default endpoint url. -You can do so by setting the `OCO_OLLAMA_API_URL` environment variable as follows: +You can do so by setting the `OCO_API_URL` environment variable as follows: ```sh -oco config set OCO_OLLAMA_API_URL='http://192.168.1.10:11434/api/chat' +oco config set OCO_API_URL='http://192.168.1.10:11434/api/chat' ``` where 192.168.1.10 is example of endpoint URL, where you have ollama set up. @@ -122,10 +106,11 @@ Create a `.env` file and add OpenCommit config variables there like this: ```env ... -OCO_OPENAI_API_KEY= +OCO_AI_PROVIDER= +OCO_API_KEY= // or other LLM provider API token +OCO_API_URL= OCO_TOKENS_MAX_INPUT= OCO_TOKENS_MAX_OUTPUT= -OCO_OPENAI_BASE_PATH= OCO_DESCRIPTION= OCO_EMOJI= OCO_MODEL= @@ -133,11 +118,9 @@ OCO_LANGUAGE= OCO_MESSAGE_TEMPLATE_PLACEHOLDER= OCO_PROMPT_MODULE= OCO_ONE_LINE_COMMIT= -OCO_AI_PROVIDER= -... ``` -This are not all the config options, but you get the point. +Global configs are same as local configs, but they are stored in the global `~/.opencommit` config file and set with `oco config set` command, e.g. `oco config set OCO_MODEL=gpt-4o`. ### Global config for all repos @@ -189,26 +172,26 @@ or for as a cheaper option: oco config set OCO_MODEL=gpt-3.5-turbo ``` -### Switch to Azure OpenAI +### Switch to other LLM providers with a custom URL By default OpenCommit uses [OpenAI](https://openai.com). -You could switch to [Azure OpenAI Service](https://learn.microsoft.com/azure/cognitive-services/openai/)🚀 +You could switch to [Azure OpenAI Service](https://learn.microsoft.com/azure/cognitive-services/openai/) or Flowise or Ollama. ```sh -opencommit config set OCO_AI_PROVIDER=azure -``` +oco config set OCO_AI_PROVIDER=azure OCO_API_KEY= OCO_API_URL= -Of course need to set 'OCO_OPENAI_API_KEY'. And also need to set the -'OPENAI_BASE_PATH' for the endpoint and set the deployment name to -'model'. +oco config set OCO_AI_PROVIDER=flowise OCO_API_KEY= OCO_API_URL= + +oco config set OCO_AI_PROVIDER=ollama OCO_API_KEY= OCO_API_URL= +``` ### Locale configuration To globally specify the language used to generate commit messages: ```sh -# de, German ,Deutsch +# de, German, Deutsch oco config set OCO_LANGUAGE=de oco config set OCO_LANGUAGE=German oco config set OCO_LANGUAGE=Deutsch @@ -224,12 +207,14 @@ All available languages are currently listed in the [i18n](https://github.com/di ### Push to git (gonna be deprecated) -A prompt to ushing to git is on by default but if you would like to turn it off just use: +A prompt for pushing to git is on by default but if you would like to turn it off just use: ```sh oco config set OCO_GITPUSH=false ``` +and it will exit right after commit is confirmed without asking if you would like to push to remote. + ### Switch to `@commitlint` OpenCommit allows you to choose the prompt module used to generate commit messages. By default, OpenCommit uses its conventional-commit message generator. However, you can switch to using the `@commitlint` prompt module if you prefer. This option lets you generate commit messages in respect with the local config. @@ -404,7 +389,7 @@ jobs: # set openAI api key in repo actions secrets, # for openAI keys go to: https://platform.openai.com/account/api-keys # for repo secret go to: /settings/secrets/actions - OCO_OPENAI_API_KEY: ${{ secrets.OCO_OPENAI_API_KEY }} + OCO_API_KEY: ${{ secrets.OCO_API_KEY }} # customization OCO_TOKENS_MAX_INPUT: 4096 diff --git a/out/cli.cjs b/out/cli.cjs index 171d7a43..b83e77a2 100755 --- a/out/cli.cjs +++ b/out/cli.cjs @@ -54,12 +54,12 @@ var require_src = __commonJS({ ret += `${CSI}${y6}B`; return ret; }, - up: (count2 = 1) => `${CSI}${count2}A`, - down: (count2 = 1) => `${CSI}${count2}B`, - forward: (count2 = 1) => `${CSI}${count2}C`, - backward: (count2 = 1) => `${CSI}${count2}D`, - nextLine: (count2 = 1) => `${CSI}E`.repeat(count2), - prevLine: (count2 = 1) => `${CSI}F`.repeat(count2), + up: (count = 1) => `${CSI}${count}A`, + down: (count = 1) => `${CSI}${count}B`, + forward: (count = 1) => `${CSI}${count}C`, + backward: (count = 1) => `${CSI}${count}D`, + nextLine: (count = 1) => `${CSI}E`.repeat(count), + prevLine: (count = 1) => `${CSI}F`.repeat(count), left: `${CSI}G`, hide: `${CSI}?25l`, show: `${CSI}?25h`, @@ -67,21 +67,21 @@ var require_src = __commonJS({ restore: `${ESC}8` }; var scroll = { - up: (count2 = 1) => `${CSI}S`.repeat(count2), - down: (count2 = 1) => `${CSI}T`.repeat(count2) + up: (count = 1) => `${CSI}S`.repeat(count), + down: (count = 1) => `${CSI}T`.repeat(count) }; var erase = { screen: `${CSI}2J`, - up: (count2 = 1) => `${CSI}1J`.repeat(count2), - down: (count2 = 1) => `${CSI}J`.repeat(count2), + up: (count = 1) => `${CSI}1J`.repeat(count), + down: (count = 1) => `${CSI}J`.repeat(count), line: `${CSI}2K`, lineEnd: `${CSI}K`, lineStart: `${CSI}1K`, - lines(count2) { + lines(count) { let clear = ""; - for (let i4 = 0; i4 < count2; i4++) - clear += this.line + (i4 < count2 - 1 ? cursor.up() : ""); - if (count2) + for (let i3 = 0; i3 < count; i3++) + clear += this.line + (i3 < count - 1 ? cursor.up() : ""); + if (count) clear += cursor.left; return clear; } @@ -93,8 +93,8 @@ var require_src = __commonJS({ // node_modules/picocolors/picocolors.js var require_picocolors = __commonJS({ "node_modules/picocolors/picocolors.js"(exports, module2) { - var tty4 = require("tty"); - var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty4.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env); + var tty2 = require("tty"); + var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty2.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env); var formatter = (open, close, replace = open) => (input) => { let string = "" + input; let index = string.indexOf(close, open.length); @@ -144,8 +144,8 @@ var require_windows = __commonJS({ "node_modules/isexe/windows.js"(exports, module2) { module2.exports = isexe; isexe.sync = sync; - var fs6 = require("fs"); - function checkPathExt(path7, options) { + var fs7 = require("fs"); + function checkPathExt(path5, options) { var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT; if (!pathext) { return true; @@ -154,27 +154,27 @@ var require_windows = __commonJS({ if (pathext.indexOf("") !== -1) { return true; } - for (var i4 = 0; i4 < pathext.length; i4++) { - var p4 = pathext[i4].toLowerCase(); - if (p4 && path7.substr(-p4.length).toLowerCase() === p4) { + for (var i3 = 0; i3 < pathext.length; i3++) { + var p4 = pathext[i3].toLowerCase(); + if (p4 && path5.substr(-p4.length).toLowerCase() === p4) { return true; } } return false; } - function checkStat(stat, path7, options) { + function checkStat(stat, path5, options) { if (!stat.isSymbolicLink() && !stat.isFile()) { return false; } - return checkPathExt(path7, options); + return checkPathExt(path5, options); } - function isexe(path7, options, cb) { - fs6.stat(path7, function(er2, stat) { - cb(er2, er2 ? false : checkStat(stat, path7, options)); + function isexe(path5, options, cb) { + fs7.stat(path5, function(er2, stat) { + cb(er2, er2 ? false : checkStat(stat, path5, options)); }); } - function sync(path7, options) { - return checkStat(fs6.statSync(path7), path7, options); + function sync(path5, options) { + return checkStat(fs7.statSync(path5), path5, options); } } }); @@ -184,14 +184,14 @@ var require_mode = __commonJS({ "node_modules/isexe/mode.js"(exports, module2) { module2.exports = isexe; isexe.sync = sync; - var fs6 = require("fs"); - function isexe(path7, options, cb) { - fs6.stat(path7, function(er2, stat) { + var fs7 = require("fs"); + function isexe(path5, options, cb) { + fs7.stat(path5, function(er2, stat) { cb(er2, er2 ? false : checkStat(stat, options)); }); } - function sync(path7, options) { - return checkStat(fs6.statSync(path7), options); + function sync(path5, options) { + return checkStat(fs7.statSync(path5), options); } function checkStat(stat, options) { return stat.isFile() && checkMode(stat, options); @@ -202,11 +202,11 @@ var require_mode = __commonJS({ var gid = stat.gid; var myUid = options.uid !== void 0 ? options.uid : process.getuid && process.getuid(); var myGid = options.gid !== void 0 ? options.gid : process.getgid && process.getgid(); - var u4 = parseInt("100", 8); + var u3 = parseInt("100", 8); var g4 = parseInt("010", 8); - var o4 = parseInt("001", 8); - var ug = u4 | g4; - var ret = mod & o4 || mod & g4 && gid === myGid || mod & u4 && uid === myUid || mod & ug && myUid === 0; + var o3 = parseInt("001", 8); + var ug = u3 | g4; + var ret = mod & o3 || mod & g4 && gid === myGid || mod & u3 && uid === myUid || mod & ug && myUid === 0; return ret; } } @@ -215,7 +215,7 @@ var require_mode = __commonJS({ // node_modules/isexe/index.js var require_isexe = __commonJS({ "node_modules/isexe/index.js"(exports, module2) { - var fs6 = require("fs"); + var fs7 = require("fs"); var core; if (process.platform === "win32" || global.TESTING_WINDOWS) { core = require_windows(); @@ -224,7 +224,7 @@ var require_isexe = __commonJS({ } module2.exports = isexe; isexe.sync = sync; - function isexe(path7, options, cb) { + function isexe(path5, options, cb) { if (typeof options === "function") { cb = options; options = {}; @@ -234,7 +234,7 @@ var require_isexe = __commonJS({ throw new TypeError("callback not provided"); } return new Promise(function(resolve, reject) { - isexe(path7, options || {}, function(er2, is) { + isexe(path5, options || {}, function(er2, is) { if (er2) { reject(er2); } else { @@ -243,7 +243,7 @@ var require_isexe = __commonJS({ }); }); } - core(path7, options || {}, function(er2, is) { + core(path5, options || {}, function(er2, is) { if (er2) { if (er2.code === "EACCES" || options && options.ignoreErrors) { er2 = null; @@ -253,9 +253,9 @@ var require_isexe = __commonJS({ cb(er2, is); }); } - function sync(path7, options) { + function sync(path5, options) { try { - return core.sync(path7, options || {}); + return core.sync(path5, options || {}); } catch (er2) { if (options && options.ignoreErrors || er2.code === "EACCES") { return false; @@ -271,7 +271,7 @@ var require_isexe = __commonJS({ var require_which = __commonJS({ "node_modules/which/which.js"(exports, module2) { var isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys"; - var path7 = require("path"); + var path5 = require("path"); var COLON = isWindows ? ";" : ":"; var isexe = require_isexe(); var getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" }); @@ -302,18 +302,18 @@ var require_which = __commonJS({ opt = {}; const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); const found = []; - const step = (i4) => new Promise((resolve, reject) => { - if (i4 === pathEnv.length) + const step = (i3) => new Promise((resolve, reject) => { + if (i3 === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd)); - const ppRaw = pathEnv[i4]; + const ppRaw = pathEnv[i3]; const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; - const pCmd = path7.join(pathPart, cmd); + const pCmd = path5.join(pathPart, cmd); const p4 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; - resolve(subStep(p4, i4, 0)); + resolve(subStep(p4, i3, 0)); }); - const subStep = (p4, i4, ii) => new Promise((resolve, reject) => { + const subStep = (p4, i3, ii) => new Promise((resolve, reject) => { if (ii === pathExt.length) - return resolve(step(i4 + 1)); + return resolve(step(i3 + 1)); const ext = pathExt[ii]; isexe(p4 + ext, { pathExt: pathExtExe }, (er2, is) => { if (!er2 && is) { @@ -322,7 +322,7 @@ var require_which = __commonJS({ else return resolve(p4 + ext); } - return resolve(subStep(p4, i4, ii + 1)); + return resolve(subStep(p4, i3, ii + 1)); }); }); return cb ? step(0).then((res) => cb(null, res), cb) : step(0); @@ -331,10 +331,10 @@ var require_which = __commonJS({ opt = opt || {}; const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt); const found = []; - for (let i4 = 0; i4 < pathEnv.length; i4++) { - const ppRaw = pathEnv[i4]; + for (let i3 = 0; i3 < pathEnv.length; i3++) { + const ppRaw = pathEnv[i3]; const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw; - const pCmd = path7.join(pathPart, cmd); + const pCmd = path5.join(pathPart, cmd); const p4 = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd; for (let j4 = 0; j4 < pathExt.length; j4++) { const cur = p4 + pathExt[j4]; @@ -367,8 +367,8 @@ var require_path_key = __commonJS({ "use strict"; var pathKey2 = (options = {}) => { const environment = options.env || process.env; - const platform2 = options.platform || process.platform; - if (platform2 !== "win32") { + const platform = options.platform || process.platform; + if (platform !== "win32") { return "PATH"; } return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path"; @@ -382,7 +382,7 @@ var require_path_key = __commonJS({ var require_resolveCommand = __commonJS({ "node_modules/cross-spawn/lib/util/resolveCommand.js"(exports, module2) { "use strict"; - var path7 = require("path"); + var path5 = require("path"); var which = require_which(); var getPathKey = require_path_key(); function resolveCommandAttempt(parsed, withoutPathExt) { @@ -400,7 +400,7 @@ var require_resolveCommand = __commonJS({ try { resolved = which.sync(parsed.command, { path: env2[getPathKey({ env: env2 })], - pathExt: withoutPathExt ? path7.delimiter : void 0 + pathExt: withoutPathExt ? path5.delimiter : void 0 }); } catch (e3) { } finally { @@ -409,7 +409,7 @@ var require_resolveCommand = __commonJS({ } } if (resolved) { - resolved = path7.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved); + resolved = path5.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved); } return resolved; } @@ -463,8 +463,8 @@ var require_shebang_command = __commonJS({ if (!match) { return null; } - const [path7, argument] = match[0].replace(/#! ?/, "").split(" "); - const binary = path7.split("/").pop(); + const [path5, argument] = match[0].replace(/#! ?/, "").split(" "); + const binary = path5.split("/").pop(); if (binary === "env") { return argument; } @@ -477,16 +477,16 @@ var require_shebang_command = __commonJS({ var require_readShebang = __commonJS({ "node_modules/cross-spawn/lib/util/readShebang.js"(exports, module2) { "use strict"; - var fs6 = require("fs"); + var fs7 = require("fs"); var shebangCommand = require_shebang_command(); function readShebang(command) { const size = 150; const buffer = Buffer.alloc(size); let fd; try { - fd = fs6.openSync(command, "r"); - fs6.readSync(fd, buffer, 0, size, 0); - fs6.closeSync(fd); + fd = fs7.openSync(command, "r"); + fs7.readSync(fd, buffer, 0, size, 0); + fs7.closeSync(fd); } catch (e3) { } return shebangCommand(buffer.toString()); @@ -499,9 +499,9 @@ var require_readShebang = __commonJS({ var require_parse = __commonJS({ "node_modules/cross-spawn/lib/parse.js"(exports, module2) { "use strict"; - var path7 = require("path"); + var path5 = require("path"); var resolveCommand = require_resolveCommand(); - var escape = require_escape(); + var escape2 = require_escape(); var readShebang = require_readShebang(); var isWin = process.platform === "win32"; var isExecutableRegExp = /\.(?:com|exe)$/i; @@ -524,9 +524,9 @@ var require_parse = __commonJS({ const needsShell = !isExecutableRegExp.test(commandFile); if (parsed.options.forceShell || needsShell) { const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile); - parsed.command = path7.normalize(parsed.command); - parsed.command = escape.command(parsed.command); - parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars)); + parsed.command = path5.normalize(parsed.command); + parsed.command = escape2.command(parsed.command); + parsed.args = parsed.args.map((arg) => escape2.argument(arg, needsDoubleEscapeMetaChars)); const shellCommand = [parsed.command].concat(parsed.args).join(" "); parsed.args = ["/d", "/s", "/c", `"${shellCommand}"`]; parsed.command = process.env.comspec || "cmd.exe"; @@ -614,26 +614,358 @@ var require_cross_spawn = __commonJS({ var cp = require("child_process"); var parse = require_parse(); var enoent = require_enoent(); - function spawn2(command, args, options) { + function spawn(command, args, options) { const parsed = parse(command, args, options); const spawned = cp.spawn(parsed.command, parsed.args, parsed.options); enoent.hookChildProcess(spawned, parsed); return spawned; } - function spawnSync2(command, args, options) { + function spawnSync(command, args, options) { const parsed = parse(command, args, options); const result = cp.spawnSync(parsed.command, parsed.args, parsed.options); result.error = result.error || enoent.verifyENOENTSync(result.status, parsed); return result; } - module2.exports = spawn2; - module2.exports.spawn = spawn2; - module2.exports.sync = spawnSync2; + module2.exports = spawn; + module2.exports.spawn = spawn; + module2.exports.sync = spawnSync; module2.exports._parse = parse; module2.exports._enoent = enoent; } }); +// node_modules/signal-exit/signals.js +var require_signals = __commonJS({ + "node_modules/signal-exit/signals.js"(exports, module2) { + module2.exports = [ + "SIGABRT", + "SIGALRM", + "SIGHUP", + "SIGINT", + "SIGTERM" + ]; + if (process.platform !== "win32") { + module2.exports.push( + "SIGVTALRM", + "SIGXCPU", + "SIGXFSZ", + "SIGUSR2", + "SIGTRAP", + "SIGSYS", + "SIGQUIT", + "SIGIOT" + ); + } + if (process.platform === "linux") { + module2.exports.push( + "SIGIO", + "SIGPOLL", + "SIGPWR", + "SIGSTKFLT", + "SIGUNUSED" + ); + } + } +}); + +// node_modules/signal-exit/index.js +var require_signal_exit = __commonJS({ + "node_modules/signal-exit/index.js"(exports, module2) { + var process9 = global.process; + var processOk = function(process10) { + return process10 && typeof process10 === "object" && typeof process10.removeListener === "function" && typeof process10.emit === "function" && typeof process10.reallyExit === "function" && typeof process10.listeners === "function" && typeof process10.kill === "function" && typeof process10.pid === "number" && typeof process10.on === "function"; + }; + if (!processOk(process9)) { + module2.exports = function() { + return function() { + }; + }; + } else { + assert = require("assert"); + signals = require_signals(); + isWin = /^win/i.test(process9.platform); + EE = require("events"); + if (typeof EE !== "function") { + EE = EE.EventEmitter; + } + if (process9.__signal_exit_emitter__) { + emitter = process9.__signal_exit_emitter__; + } else { + emitter = process9.__signal_exit_emitter__ = new EE(); + emitter.count = 0; + emitter.emitted = {}; + } + if (!emitter.infinite) { + emitter.setMaxListeners(Infinity); + emitter.infinite = true; + } + module2.exports = function(cb, opts) { + if (!processOk(global.process)) { + return function() { + }; + } + assert.equal(typeof cb, "function", "a callback must be provided for exit handler"); + if (loaded === false) { + load(); + } + var ev = "exit"; + if (opts && opts.alwaysLast) { + ev = "afterexit"; + } + var remove = function() { + emitter.removeListener(ev, cb); + if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) { + unload(); + } + }; + emitter.on(ev, cb); + return remove; + }; + unload = function unload2() { + if (!loaded || !processOk(global.process)) { + return; + } + loaded = false; + signals.forEach(function(sig) { + try { + process9.removeListener(sig, sigListeners[sig]); + } catch (er2) { + } + }); + process9.emit = originalProcessEmit; + process9.reallyExit = originalProcessReallyExit; + emitter.count -= 1; + }; + module2.exports.unload = unload; + emit = function emit2(event, code, signal) { + if (emitter.emitted[event]) { + return; + } + emitter.emitted[event] = true; + emitter.emit(event, code, signal); + }; + sigListeners = {}; + signals.forEach(function(sig) { + sigListeners[sig] = function listener() { + if (!processOk(global.process)) { + return; + } + var listeners = process9.listeners(sig); + if (listeners.length === emitter.count) { + unload(); + emit("exit", null, sig); + emit("afterexit", null, sig); + if (isWin && sig === "SIGHUP") { + sig = "SIGINT"; + } + process9.kill(process9.pid, sig); + } + }; + }); + module2.exports.signals = function() { + return signals; + }; + loaded = false; + load = function load2() { + if (loaded || !processOk(global.process)) { + return; + } + loaded = true; + emitter.count += 1; + signals = signals.filter(function(sig) { + try { + process9.on(sig, sigListeners[sig]); + return true; + } catch (er2) { + return false; + } + }); + process9.emit = processEmit; + process9.reallyExit = processReallyExit; + }; + module2.exports.load = load; + originalProcessReallyExit = process9.reallyExit; + processReallyExit = function processReallyExit2(code) { + if (!processOk(global.process)) { + return; + } + process9.exitCode = code || 0; + emit("exit", process9.exitCode, null); + emit("afterexit", process9.exitCode, null); + originalProcessReallyExit.call(process9, process9.exitCode); + }; + originalProcessEmit = process9.emit; + processEmit = function processEmit2(ev, arg) { + if (ev === "exit" && processOk(global.process)) { + if (arg !== void 0) { + process9.exitCode = arg; + } + var ret = originalProcessEmit.apply(this, arguments); + emit("exit", process9.exitCode, null); + emit("afterexit", process9.exitCode, null); + return ret; + } else { + return originalProcessEmit.apply(this, arguments); + } + }; + } + var assert; + var signals; + var isWin; + var EE; + var emitter; + var unload; + var emit; + var sigListeners; + var loaded; + var load; + var originalProcessReallyExit; + var processReallyExit; + var originalProcessEmit; + var processEmit; + } +}); + +// node_modules/get-stream/buffer-stream.js +var require_buffer_stream = __commonJS({ + "node_modules/get-stream/buffer-stream.js"(exports, module2) { + "use strict"; + var { PassThrough: PassThroughStream } = require("stream"); + module2.exports = (options) => { + options = { ...options }; + const { array } = options; + let { encoding } = options; + const isBuffer2 = encoding === "buffer"; + let objectMode = false; + if (array) { + objectMode = !(encoding || isBuffer2); + } else { + encoding = encoding || "utf8"; + } + if (isBuffer2) { + encoding = null; + } + const stream4 = new PassThroughStream({ objectMode }); + if (encoding) { + stream4.setEncoding(encoding); + } + let length = 0; + const chunks = []; + stream4.on("data", (chunk) => { + chunks.push(chunk); + if (objectMode) { + length = chunks.length; + } else { + length += chunk.length; + } + }); + stream4.getBufferedValue = () => { + if (array) { + return chunks; + } + return isBuffer2 ? Buffer.concat(chunks, length) : chunks.join(""); + }; + stream4.getBufferedLength = () => length; + return stream4; + }; + } +}); + +// node_modules/get-stream/index.js +var require_get_stream = __commonJS({ + "node_modules/get-stream/index.js"(exports, module2) { + "use strict"; + var { constants: BufferConstants } = require("buffer"); + var stream4 = require("stream"); + var { promisify } = require("util"); + var bufferStream = require_buffer_stream(); + var streamPipelinePromisified = promisify(stream4.pipeline); + var MaxBufferError = class extends Error { + constructor() { + super("maxBuffer exceeded"); + this.name = "MaxBufferError"; + } + }; + async function getStream3(inputStream, options) { + if (!inputStream) { + throw new Error("Expected a stream"); + } + options = { + maxBuffer: Infinity, + ...options + }; + const { maxBuffer } = options; + const stream5 = bufferStream(options); + await new Promise((resolve, reject) => { + const rejectPromise = (error) => { + if (error && stream5.getBufferedLength() <= BufferConstants.MAX_LENGTH) { + error.bufferedData = stream5.getBufferedValue(); + } + reject(error); + }; + (async () => { + try { + await streamPipelinePromisified(inputStream, stream5); + resolve(); + } catch (error) { + rejectPromise(error); + } + })(); + stream5.on("data", () => { + if (stream5.getBufferedLength() > maxBuffer) { + rejectPromise(new MaxBufferError()); + } + }); + }); + return stream5.getBufferedValue(); + } + module2.exports = getStream3; + module2.exports.buffer = (stream5, options) => getStream3(stream5, { ...options, encoding: "buffer" }); + module2.exports.array = (stream5, options) => getStream3(stream5, { ...options, array: true }); + module2.exports.MaxBufferError = MaxBufferError; + } +}); + +// node_modules/merge-stream/index.js +var require_merge_stream = __commonJS({ + "node_modules/merge-stream/index.js"(exports, module2) { + "use strict"; + var { PassThrough } = require("stream"); + module2.exports = function() { + var sources = []; + var output = new PassThrough({ objectMode: true }); + output.setMaxListeners(0); + output.add = add; + output.isEmpty = isEmpty; + output.on("unpipe", remove); + Array.prototype.slice.call(arguments).forEach(add); + return output; + function add(source) { + if (Array.isArray(source)) { + source.forEach(add); + return this; + } + sources.push(source); + source.once("end", remove.bind(null, source)); + source.once("error", output.emit.bind(output, "error")); + source.pipe(output, { end: false }); + return this; + } + function isEmpty() { + return sources.length == 0; + } + function remove(source) { + sources = sources.filter(function(it2) { + return it2 !== source; + }); + if (!sources.length && output.readable) { + output.end(); + } + } + }; + } +}); + // node_modules/dotenv/package.json var require_package = __commonJS({ "node_modules/dotenv/package.json"(exports, module2) { @@ -708,9 +1040,9 @@ var require_package = __commonJS({ // node_modules/dotenv/lib/main.js var require_main = __commonJS({ "node_modules/dotenv/lib/main.js"(exports, module2) { - var fs6 = require("fs"); - var path7 = require("path"); - var os3 = require("os"); + var fs7 = require("fs"); + var path5 = require("path"); + var os4 = require("os"); var crypto2 = require("crypto"); var packageJson = require_package(); var version = packageJson.version; @@ -745,14 +1077,14 @@ var require_main = __commonJS({ const keys = _dotenvKey(options).split(","); const length = keys.length; let decrypted; - for (let i4 = 0; i4 < length; i4++) { + for (let i3 = 0; i3 < length; i3++) { try { - const key = keys[i4].trim(); + const key = keys[i3].trim(); const attrs = _instructions(result, key); decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key); break; } catch (error) { - if (i4 + 1 >= length) { + if (i3 + 1 >= length) { throw error; } } @@ -815,7 +1147,7 @@ var require_main = __commonJS({ if (options && options.path && options.path.length > 0) { if (Array.isArray(options.path)) { for (const filepath of options.path) { - if (fs6.existsSync(filepath)) { + if (fs7.existsSync(filepath)) { possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`; } } @@ -823,15 +1155,15 @@ var require_main = __commonJS({ possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`; } } else { - possibleVaultPath = path7.resolve(process.cwd(), ".env.vault"); + possibleVaultPath = path5.resolve(process.cwd(), ".env.vault"); } - if (fs6.existsSync(possibleVaultPath)) { + if (fs7.existsSync(possibleVaultPath)) { return possibleVaultPath; } return null; } function _resolveHome(envPath) { - return envPath[0] === "~" ? path7.join(os3.homedir(), envPath.slice(1)) : envPath; + return envPath[0] === "~" ? path5.join(os4.homedir(), envPath.slice(1)) : envPath; } function _configVault(options) { _log("Loading env from encrypted .env.vault"); @@ -844,7 +1176,7 @@ var require_main = __commonJS({ return { parsed }; } function configDotenv(options) { - const dotenvPath = path7.resolve(process.cwd(), ".env"); + const dotenvPath = path5.resolve(process.cwd(), ".env"); let encoding = "utf8"; const debug3 = Boolean(options && options.debug); if (options && options.encoding) { @@ -867,13 +1199,13 @@ var require_main = __commonJS({ } let lastError; const parsedAll = {}; - for (const path8 of optionPaths) { + for (const path6 of optionPaths) { try { - const parsed = DotenvModule.parse(fs6.readFileSync(path8, { encoding })); + const parsed = DotenvModule.parse(fs7.readFileSync(path6, { encoding })); DotenvModule.populate(parsedAll, parsed, options); } catch (e3) { if (debug3) { - _debug(`Failed to load ${path8} ${e3.message}`); + _debug(`Failed to load ${path6} ${e3.message}`); } lastError = e3; } @@ -1116,21 +1448,21 @@ var require_ini = __commonJS({ } else { let esc = false; let unesc = ""; - for (let i4 = 0, l3 = val.length; i4 < l3; i4++) { - const c5 = val.charAt(i4); + for (let i3 = 0, l3 = val.length; i3 < l3; i3++) { + const c3 = val.charAt(i3); if (esc) { - if ("\\;#".indexOf(c5) !== -1) { - unesc += c5; + if ("\\;#".indexOf(c3) !== -1) { + unesc += c3; } else { - unesc += "\\" + c5; + unesc += "\\" + c3; } esc = false; - } else if (";#".indexOf(c5) !== -1) { + } else if (";#".indexOf(c3) !== -1) { break; - } else if (c5 === "\\") { + } else if (c3 === "\\") { esc = true; } else { - unesc += c5; + unesc += c3; } } if (esc) { @@ -1254,9 +1586,9 @@ var require_lib = __commonJS({ }; conversions["ByteString"] = function(V6, opts) { const x5 = String(V6); - let c5 = void 0; - for (let i4 = 0; (c5 = x5.codePointAt(i4)) !== void 0; ++i4) { - if (c5 > 255) { + let c3 = void 0; + for (let i3 = 0; (c3 = x5.codePointAt(i3)) !== void 0; ++i3) { + if (c3 > 255) { throw new TypeError("Argument is not a valid bytestring"); } } @@ -1264,24 +1596,24 @@ var require_lib = __commonJS({ }; conversions["USVString"] = function(V6) { const S6 = String(V6); - const n3 = S6.length; + const n2 = S6.length; const U7 = []; - for (let i4 = 0; i4 < n3; ++i4) { - const c5 = S6.charCodeAt(i4); - if (c5 < 55296 || c5 > 57343) { - U7.push(String.fromCodePoint(c5)); - } else if (56320 <= c5 && c5 <= 57343) { + for (let i3 = 0; i3 < n2; ++i3) { + const c3 = S6.charCodeAt(i3); + if (c3 < 55296 || c3 > 57343) { + U7.push(String.fromCodePoint(c3)); + } else if (56320 <= c3 && c3 <= 57343) { U7.push(String.fromCodePoint(65533)); } else { - if (i4 === n3 - 1) { + if (i3 === n2 - 1) { U7.push(String.fromCodePoint(65533)); } else { - const d7 = S6.charCodeAt(i4 + 1); + const d7 = S6.charCodeAt(i3 + 1); if (56320 <= d7 && d7 <= 57343) { - const a5 = c5 & 1023; + const a4 = c3 & 1023; const b7 = d7 & 1023; - U7.push(String.fromCodePoint((2 << 15) + (2 << 9) * a5 + b7)); - ++i4; + U7.push(String.fromCodePoint((2 << 15) + (2 << 9) * a4 + b7)); + ++i3; } else { U7.push(String.fromCodePoint(65533)); } @@ -1314,8 +1646,8 @@ var require_utils = __commonJS({ "use strict"; module2.exports.mixin = function mixin(target, source) { const keys = Object.getOwnPropertyNames(source); - for (let i4 = 0; i4 < keys.length; ++i4) { - Object.defineProperty(target, keys[i4], Object.getOwnPropertyDescriptor(source, keys[i4])); + for (let i3 = 0; i3 < keys.length; ++i3) { + Object.defineProperty(target, keys[i3], Object.getOwnPropertyDescriptor(source, keys[i3])); } }; module2.exports.wrapperSymbol = Symbol("wrapper"); @@ -1375,8 +1707,8 @@ var require_tr46 = __commonJS({ var hasError = false; var processed = ""; var len = countSymbols(domain_name); - for (var i4 = 0; i4 < len; ++i4) { - var codePoint = domain_name.codePointAt(i4); + for (var i3 = 0; i3 < len; ++i3) { + var codePoint = domain_name.codePointAt(i3); var status = findStatus(codePoint); switch (status[1]) { case "disallowed": @@ -1430,8 +1762,8 @@ var require_tr46 = __commonJS({ error = true; } var len = countSymbols(label); - for (var i4 = 0; i4 < len; ++i4) { - var status = findStatus(label.codePointAt(i4)); + for (var i3 = 0; i3 < len; ++i3) { + var status = findStatus(label.codePointAt(i3)); if (processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== "valid" || processing === PROCESSING_OPTIONS.NONTRANSITIONAL && status[1] !== "valid" && status[1] !== "deviation") { error = true; break; @@ -1446,10 +1778,10 @@ var require_tr46 = __commonJS({ var result = mapChars(domain_name, useSTD3, processing_option); result.string = normalize(result.string); var labels = result.string.split("."); - for (var i4 = 0; i4 < labels.length; ++i4) { + for (var i3 = 0; i3 < labels.length; ++i3) { try { - var validation = validateLabel(labels[i4]); - labels[i4] = validation.label; + var validation = validateLabel(labels[i3]); + labels[i3] = validation.label; result.error = result.error || validation.error; } catch (e3) { result.error = true; @@ -1476,7 +1808,7 @@ var require_tr46 = __commonJS({ if (total.length > 253 || total.length === 0) { result.error = true; } - for (var i4 = 0; i4 < labels.length; ++i4) { + for (var i3 = 0; i3 < labels.length; ++i3) { if (labels.length > 63 || labels.length === 0) { result.error = true; break; @@ -1518,20 +1850,20 @@ var require_url_state_machine = __commonJS({ return punycode.ucs2.decode(str2).length; } function at2(input, idx) { - const c5 = input[idx]; - return isNaN(c5) ? void 0 : String.fromCodePoint(c5); + const c3 = input[idx]; + return isNaN(c3) ? void 0 : String.fromCodePoint(c3); } - function isASCIIDigit(c5) { - return c5 >= 48 && c5 <= 57; + function isASCIIDigit(c3) { + return c3 >= 48 && c3 <= 57; } - function isASCIIAlpha(c5) { - return c5 >= 65 && c5 <= 90 || c5 >= 97 && c5 <= 122; + function isASCIIAlpha(c3) { + return c3 >= 65 && c3 <= 90 || c3 >= 97 && c3 <= 122; } - function isASCIIAlphanumeric(c5) { - return isASCIIAlpha(c5) || isASCIIDigit(c5); + function isASCIIAlphanumeric(c3) { + return isASCIIAlpha(c3) || isASCIIDigit(c3); } - function isASCIIHex(c5) { - return isASCIIDigit(c5) || c5 >= 65 && c5 <= 70 || c5 >= 97 && c5 <= 102; + function isASCIIHex(c3) { + return isASCIIDigit(c3) || c3 >= 65 && c3 <= 70 || c3 >= 97 && c3 <= 102; } function isSingleDot(buffer) { return buffer === "." || buffer.toLowerCase() === "%2e"; @@ -1564,50 +1896,50 @@ var require_url_state_machine = __commonJS({ function defaultPort(scheme) { return specialSchemes[scheme]; } - function percentEncode(c5) { - let hex = c5.toString(16).toUpperCase(); + function percentEncode(c3) { + let hex = c3.toString(16).toUpperCase(); if (hex.length === 1) { hex = "0" + hex; } return "%" + hex; } - function utf8PercentEncode(c5) { - const buf = new Buffer(c5); + function utf8PercentEncode(c3) { + const buf = new Buffer(c3); let str2 = ""; - for (let i4 = 0; i4 < buf.length; ++i4) { - str2 += percentEncode(buf[i4]); + for (let i3 = 0; i3 < buf.length; ++i3) { + str2 += percentEncode(buf[i3]); } return str2; } function utf8PercentDecode(str2) { const input = new Buffer(str2); const output = []; - for (let i4 = 0; i4 < input.length; ++i4) { - if (input[i4] !== 37) { - output.push(input[i4]); - } else if (input[i4] === 37 && isASCIIHex(input[i4 + 1]) && isASCIIHex(input[i4 + 2])) { - output.push(parseInt(input.slice(i4 + 1, i4 + 3).toString(), 16)); - i4 += 2; + for (let i3 = 0; i3 < input.length; ++i3) { + if (input[i3] !== 37) { + output.push(input[i3]); + } else if (input[i3] === 37 && isASCIIHex(input[i3 + 1]) && isASCIIHex(input[i3 + 2])) { + output.push(parseInt(input.slice(i3 + 1, i3 + 3).toString(), 16)); + i3 += 2; } else { - output.push(input[i4]); + output.push(input[i3]); } } return new Buffer(output).toString(); } - function isC0ControlPercentEncode(c5) { - return c5 <= 31 || c5 > 126; + function isC0ControlPercentEncode(c3) { + return c3 <= 31 || c3 > 126; } var extraPathPercentEncodeSet = /* @__PURE__ */ new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]); - function isPathPercentEncode(c5) { - return isC0ControlPercentEncode(c5) || extraPathPercentEncodeSet.has(c5); + function isPathPercentEncode(c3) { + return isC0ControlPercentEncode(c3) || extraPathPercentEncodeSet.has(c3); } var extraUserinfoPercentEncodeSet = /* @__PURE__ */ new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); - function isUserinfoPercentEncode(c5) { - return isPathPercentEncode(c5) || extraUserinfoPercentEncodeSet.has(c5); + function isUserinfoPercentEncode(c3) { + return isPathPercentEncode(c3) || extraUserinfoPercentEncodeSet.has(c3); } - function percentEncodeChar(c5, encodeSetPredicate) { - const cStr = String.fromCodePoint(c5); - if (encodeSetPredicate(c5)) { + function percentEncodeChar(c3, encodeSetPredicate) { + const cStr = String.fromCodePoint(c3); + if (encodeSetPredicate(c3)) { return utf8PercentEncode(cStr); } return cStr; @@ -1645,14 +1977,14 @@ var require_url_state_machine = __commonJS({ if (part === "") { return input; } - const n3 = parseIPv4Number(part); - if (n3 === failure) { + const n2 = parseIPv4Number(part); + if (n2 === failure) { return input; } - numbers.push(n3); + numbers.push(n2); } - for (let i4 = 0; i4 < numbers.length - 1; ++i4) { - if (numbers[i4] > 255) { + for (let i3 = 0; i3 < numbers.length - 1; ++i3) { + if (numbers[i3] > 255) { return failure; } } @@ -1661,21 +1993,21 @@ var require_url_state_machine = __commonJS({ } let ipv4 = numbers.pop(); let counter = 0; - for (const n3 of numbers) { - ipv4 += n3 * Math.pow(256, 3 - counter); + for (const n2 of numbers) { + ipv4 += n2 * Math.pow(256, 3 - counter); ++counter; } return ipv4; } function serializeIPv4(address) { let output = ""; - let n3 = address; - for (let i4 = 1; i4 <= 4; ++i4) { - output = String(n3 % 256) + output; - if (i4 !== 4) { + let n2 = address; + for (let i3 = 1; i3 <= 4; ++i3) { + output = String(n2 % 256) + output; + if (i3 !== 4) { output = "." + output; } - n3 = Math.floor(n3 / 256); + n2 = Math.floor(n2 / 256); } return output; } @@ -1838,8 +2170,8 @@ var require_url_state_machine = __commonJS({ } let output = ""; const decoded = punycode.ucs2.decode(input); - for (let i4 = 0; i4 < decoded.length; ++i4) { - output += percentEncodeChar(decoded[i4], isC0ControlPercentEncode); + for (let i3 = 0; i3 < decoded.length; ++i3) { + output += percentEncodeChar(decoded[i3], isC0ControlPercentEncode); } return output; } @@ -1848,8 +2180,8 @@ var require_url_state_machine = __commonJS({ let maxLen = 1; let currStart = null; let currLen = 0; - for (let i4 = 0; i4 < arr.length; ++i4) { - if (arr[i4] !== 0) { + for (let i3 = 0; i3 < arr.length; ++i3) { + if (arr[i3] !== 0) { if (currLen > maxLen) { maxIdx = currStart; maxLen = currLen; @@ -1858,7 +2190,7 @@ var require_url_state_machine = __commonJS({ currLen = 0; } else { if (currStart === null) { - currStart = i4; + currStart = i3; } ++currLen; } @@ -1888,14 +2220,14 @@ var require_url_state_machine = __commonJS({ return url2.replace(/\u0009|\u000A|\u000D/g, ""); } function shortenPath(url2) { - const path7 = url2.path; - if (path7.length === 0) { + const path5 = url2.path; + if (path5.length === 0) { return; } - if (url2.scheme === "file" && path7.length === 1 && isNormalizedWindowsDriveLetter(path7[0])) { + if (url2.scheme === "file" && path5.length === 1 && isNormalizedWindowsDriveLetter(path5[0])) { return; } - path7.pop(); + path5.pop(); } function includesCredentials(url2) { return url2.username !== "" || url2.password !== ""; @@ -1945,9 +2277,9 @@ var require_url_state_machine = __commonJS({ this.passwordTokenSeenFlag = false; this.input = punycode.ucs2.decode(this.input); for (; this.pointer <= this.input.length; ++this.pointer) { - const c5 = this.input[this.pointer]; - const cStr = isNaN(c5) ? void 0 : String.fromCodePoint(c5); - const ret = this["parse " + this.state](c5, cStr); + const c3 = this.input[this.pointer]; + const cStr = isNaN(c3) ? void 0 : String.fromCodePoint(c3); + const ret = this["parse " + this.state](c3, cStr); if (!ret) { break; } else if (ret === failure) { @@ -1956,8 +2288,8 @@ var require_url_state_machine = __commonJS({ } } } - URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c5, cStr) { - if (isASCIIAlpha(c5)) { + URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c3, cStr) { + if (isASCIIAlpha(c3)) { this.buffer += cStr.toLowerCase(); this.state = "scheme"; } else if (!this.stateOverride) { @@ -1969,10 +2301,10 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse scheme"] = function parseScheme(c5, cStr) { - if (isASCIIAlphanumeric(c5) || c5 === 43 || c5 === 45 || c5 === 46) { + URLStateMachine.prototype["parse scheme"] = function parseScheme(c3, cStr) { + if (isASCIIAlphanumeric(c3) || c3 === 43 || c3 === 45 || c3 === 46) { this.buffer += cStr.toLowerCase(); - } else if (c5 === 58) { + } else if (c3 === 58) { if (this.stateOverride) { if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { return false; @@ -2019,10 +2351,10 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c5) { - if (this.base === null || this.base.cannotBeABaseURL && c5 !== 35) { + URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c3) { + if (this.base === null || this.base.cannotBeABaseURL && c3 !== 35) { return failure; - } else if (this.base.cannotBeABaseURL && c5 === 35) { + } else if (this.base.cannotBeABaseURL && c3 === 35) { this.url.scheme = this.base.scheme; this.url.path = this.base.path.slice(); this.url.query = this.base.query; @@ -2038,8 +2370,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c5) { - if (c5 === 47 && this.input[this.pointer + 1] === 47) { + URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c3) { + if (c3 === 47 && this.input[this.pointer + 1] === 47) { this.state = "special authority ignore slashes"; ++this.pointer; } else { @@ -2049,8 +2381,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c5) { - if (c5 === 47) { + URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c3) { + if (c3 === 47) { this.state = "authority"; } else { this.state = "path"; @@ -2058,18 +2390,18 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse relative"] = function parseRelative(c5) { + URLStateMachine.prototype["parse relative"] = function parseRelative(c3) { this.url.scheme = this.base.scheme; - if (isNaN(c5)) { + if (isNaN(c3)) { this.url.username = this.base.username; this.url.password = this.base.password; this.url.host = this.base.host; this.url.port = this.base.port; this.url.path = this.base.path.slice(); this.url.query = this.base.query; - } else if (c5 === 47) { + } else if (c3 === 47) { this.state = "relative slash"; - } else if (c5 === 63) { + } else if (c3 === 63) { this.url.username = this.base.username; this.url.password = this.base.password; this.url.host = this.base.host; @@ -2077,7 +2409,7 @@ var require_url_state_machine = __commonJS({ this.url.path = this.base.path.slice(); this.url.query = ""; this.state = "query"; - } else if (c5 === 35) { + } else if (c3 === 35) { this.url.username = this.base.username; this.url.password = this.base.password; this.url.host = this.base.host; @@ -2086,7 +2418,7 @@ var require_url_state_machine = __commonJS({ this.url.query = this.base.query; this.url.fragment = ""; this.state = "fragment"; - } else if (isSpecial(this.url) && c5 === 92) { + } else if (isSpecial(this.url) && c3 === 92) { this.parseError = true; this.state = "relative slash"; } else { @@ -2100,13 +2432,13 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c5) { - if (isSpecial(this.url) && (c5 === 47 || c5 === 92)) { - if (c5 === 92) { + URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c3) { + if (isSpecial(this.url) && (c3 === 47 || c3 === 92)) { + if (c3 === 92) { this.parseError = true; } this.state = "special authority ignore slashes"; - } else if (c5 === 47) { + } else if (c3 === 47) { this.state = "authority"; } else { this.url.username = this.base.username; @@ -2118,8 +2450,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c5) { - if (c5 === 47 && this.input[this.pointer + 1] === 47) { + URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c3) { + if (c3 === 47 && this.input[this.pointer + 1] === 47) { this.state = "special authority ignore slashes"; ++this.pointer; } else { @@ -2129,8 +2461,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c5) { - if (c5 !== 47 && c5 !== 92) { + URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c3) { + if (c3 !== 47 && c3 !== 92) { this.state = "authority"; --this.pointer; } else { @@ -2138,8 +2470,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse authority"] = function parseAuthority(c5, cStr) { - if (c5 === 64) { + URLStateMachine.prototype["parse authority"] = function parseAuthority(c3, cStr) { + if (c3 === 64) { this.parseError = true; if (this.atFlag) { this.buffer = "%40" + this.buffer; @@ -2160,7 +2492,7 @@ var require_url_state_machine = __commonJS({ } } this.buffer = ""; - } else if (isNaN(c5) || c5 === 47 || c5 === 63 || c5 === 35 || isSpecial(this.url) && c5 === 92) { + } else if (isNaN(c3) || c3 === 47 || c3 === 63 || c3 === 35 || isSpecial(this.url) && c3 === 92) { if (this.atFlag && this.buffer === "") { this.parseError = true; return failure; @@ -2173,11 +2505,11 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c5, cStr) { + URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c3, cStr) { if (this.stateOverride && this.url.scheme === "file") { --this.pointer; this.state = "file host"; - } else if (c5 === 58 && !this.arrFlag) { + } else if (c3 === 58 && !this.arrFlag) { if (this.buffer === "") { this.parseError = true; return failure; @@ -2192,7 +2524,7 @@ var require_url_state_machine = __commonJS({ if (this.stateOverride === "hostname") { return false; } - } else if (isNaN(c5) || c5 === 47 || c5 === 63 || c5 === 35 || isSpecial(this.url) && c5 === 92) { + } else if (isNaN(c3) || c3 === 47 || c3 === 63 || c3 === 35 || isSpecial(this.url) && c3 === 92) { --this.pointer; if (isSpecial(this.url) && this.buffer === "") { this.parseError = true; @@ -2212,19 +2544,19 @@ var require_url_state_machine = __commonJS({ return false; } } else { - if (c5 === 91) { + if (c3 === 91) { this.arrFlag = true; - } else if (c5 === 93) { + } else if (c3 === 93) { this.arrFlag = false; } this.buffer += cStr; } return true; }; - URLStateMachine.prototype["parse port"] = function parsePort(c5, cStr) { - if (isASCIIDigit(c5)) { + URLStateMachine.prototype["parse port"] = function parsePort(c3, cStr) { + if (isASCIIDigit(c3)) { this.buffer += cStr; - } else if (isNaN(c5) || c5 === 47 || c5 === 63 || c5 === 35 || isSpecial(this.url) && c5 === 92 || this.stateOverride) { + } else if (isNaN(c3) || c3 === 47 || c3 === 63 || c3 === 35 || isSpecial(this.url) && c3 === 92 || this.stateOverride) { if (this.buffer !== "") { const port = parseInt(this.buffer); if (port > Math.pow(2, 16) - 1) { @@ -2246,31 +2578,31 @@ var require_url_state_machine = __commonJS({ return true; }; var fileOtherwiseCodePoints = /* @__PURE__ */ new Set([47, 92, 63, 35]); - URLStateMachine.prototype["parse file"] = function parseFile(c5) { + URLStateMachine.prototype["parse file"] = function parseFile(c3) { this.url.scheme = "file"; - if (c5 === 47 || c5 === 92) { - if (c5 === 92) { + if (c3 === 47 || c3 === 92) { + if (c3 === 92) { this.parseError = true; } this.state = "file slash"; } else if (this.base !== null && this.base.scheme === "file") { - if (isNaN(c5)) { + if (isNaN(c3)) { this.url.host = this.base.host; this.url.path = this.base.path.slice(); this.url.query = this.base.query; - } else if (c5 === 63) { + } else if (c3 === 63) { this.url.host = this.base.host; this.url.path = this.base.path.slice(); this.url.query = ""; this.state = "query"; - } else if (c5 === 35) { + } else if (c3 === 35) { this.url.host = this.base.host; this.url.path = this.base.path.slice(); this.url.query = this.base.query; this.url.fragment = ""; this.state = "fragment"; } else { - if (this.input.length - this.pointer - 1 === 0 || !isWindowsDriveLetterCodePoints(c5, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) { + if (this.input.length - this.pointer - 1 === 0 || !isWindowsDriveLetterCodePoints(c3, this.input[this.pointer + 1]) || this.input.length - this.pointer - 1 >= 2 && !fileOtherwiseCodePoints.has(this.input[this.pointer + 2])) { this.url.host = this.base.host; this.url.path = this.base.path.slice(); shortenPath(this.url); @@ -2286,9 +2618,9 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c5) { - if (c5 === 47 || c5 === 92) { - if (c5 === 92) { + URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c3) { + if (c3 === 47 || c3 === 92) { + if (c3 === 92) { this.parseError = true; } this.state = "file host"; @@ -2305,8 +2637,8 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse file host"] = function parseFileHost(c5, cStr) { - if (isNaN(c5) || c5 === 47 || c5 === 92 || c5 === 63 || c5 === 35) { + URLStateMachine.prototype["parse file host"] = function parseFileHost(c3, cStr) { + if (isNaN(c3) || c3 === 47 || c3 === 92 || c3 === 63 || c3 === 35) { --this.pointer; if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { this.parseError = true; @@ -2337,40 +2669,40 @@ var require_url_state_machine = __commonJS({ } return true; }; - URLStateMachine.prototype["parse path start"] = function parsePathStart(c5) { + URLStateMachine.prototype["parse path start"] = function parsePathStart(c3) { if (isSpecial(this.url)) { - if (c5 === 92) { + if (c3 === 92) { this.parseError = true; } this.state = "path"; - if (c5 !== 47 && c5 !== 92) { + if (c3 !== 47 && c3 !== 92) { --this.pointer; } - } else if (!this.stateOverride && c5 === 63) { + } else if (!this.stateOverride && c3 === 63) { this.url.query = ""; this.state = "query"; - } else if (!this.stateOverride && c5 === 35) { + } else if (!this.stateOverride && c3 === 35) { this.url.fragment = ""; this.state = "fragment"; - } else if (c5 !== void 0) { + } else if (c3 !== void 0) { this.state = "path"; - if (c5 !== 47) { + if (c3 !== 47) { --this.pointer; } } return true; }; - URLStateMachine.prototype["parse path"] = function parsePath(c5) { - if (isNaN(c5) || c5 === 47 || isSpecial(this.url) && c5 === 92 || !this.stateOverride && (c5 === 63 || c5 === 35)) { - if (isSpecial(this.url) && c5 === 92) { + URLStateMachine.prototype["parse path"] = function parsePath(c3) { + if (isNaN(c3) || c3 === 47 || isSpecial(this.url) && c3 === 92 || !this.stateOverride && (c3 === 63 || c3 === 35)) { + if (isSpecial(this.url) && c3 === 92) { this.parseError = true; } if (isDoubleDot(this.buffer)) { shortenPath(this.url); - if (c5 !== 47 && !(isSpecial(this.url) && c5 === 92)) { + if (c3 !== 47 && !(isSpecial(this.url) && c3 === 92)) { this.url.path.push(""); } - } else if (isSingleDot(this.buffer) && c5 !== 47 && !(isSpecial(this.url) && c5 === 92)) { + } else if (isSingleDot(this.buffer) && c3 !== 47 && !(isSpecial(this.url) && c3 === 92)) { this.url.path.push(""); } else if (!isSingleDot(this.buffer)) { if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { @@ -2383,83 +2715,83 @@ var require_url_state_machine = __commonJS({ this.url.path.push(this.buffer); } this.buffer = ""; - if (this.url.scheme === "file" && (c5 === void 0 || c5 === 63 || c5 === 35)) { + if (this.url.scheme === "file" && (c3 === void 0 || c3 === 63 || c3 === 35)) { while (this.url.path.length > 1 && this.url.path[0] === "") { this.parseError = true; this.url.path.shift(); } } - if (c5 === 63) { + if (c3 === 63) { this.url.query = ""; this.state = "query"; } - if (c5 === 35) { + if (c3 === 35) { this.url.fragment = ""; this.state = "fragment"; } } else { - if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + if (c3 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } - this.buffer += percentEncodeChar(c5, isPathPercentEncode); + this.buffer += percentEncodeChar(c3, isPathPercentEncode); } return true; }; - URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c5) { - if (c5 === 63) { + URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c3) { + if (c3 === 63) { this.url.query = ""; this.state = "query"; - } else if (c5 === 35) { + } else if (c3 === 35) { this.url.fragment = ""; this.state = "fragment"; } else { - if (!isNaN(c5) && c5 !== 37) { + if (!isNaN(c3) && c3 !== 37) { this.parseError = true; } - if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + if (c3 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } - if (!isNaN(c5)) { - this.url.path[0] = this.url.path[0] + percentEncodeChar(c5, isC0ControlPercentEncode); + if (!isNaN(c3)) { + this.url.path[0] = this.url.path[0] + percentEncodeChar(c3, isC0ControlPercentEncode); } } return true; }; - URLStateMachine.prototype["parse query"] = function parseQuery(c5, cStr) { - if (isNaN(c5) || !this.stateOverride && c5 === 35) { + URLStateMachine.prototype["parse query"] = function parseQuery(c3, cStr) { + if (isNaN(c3) || !this.stateOverride && c3 === 35) { if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { this.encodingOverride = "utf-8"; } const buffer = new Buffer(this.buffer); - for (let i4 = 0; i4 < buffer.length; ++i4) { - if (buffer[i4] < 33 || buffer[i4] > 126 || buffer[i4] === 34 || buffer[i4] === 35 || buffer[i4] === 60 || buffer[i4] === 62) { - this.url.query += percentEncode(buffer[i4]); + for (let i3 = 0; i3 < buffer.length; ++i3) { + if (buffer[i3] < 33 || buffer[i3] > 126 || buffer[i3] === 34 || buffer[i3] === 35 || buffer[i3] === 60 || buffer[i3] === 62) { + this.url.query += percentEncode(buffer[i3]); } else { - this.url.query += String.fromCodePoint(buffer[i4]); + this.url.query += String.fromCodePoint(buffer[i3]); } } this.buffer = ""; - if (c5 === 35) { + if (c3 === 35) { this.url.fragment = ""; this.state = "fragment"; } } else { - if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + if (c3 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } this.buffer += cStr; } return true; }; - URLStateMachine.prototype["parse fragment"] = function parseFragment(c5) { - if (isNaN(c5)) { - } else if (c5 === 0) { + URLStateMachine.prototype["parse fragment"] = function parseFragment(c3) { + if (isNaN(c3)) { + } else if (c3 === 0) { this.parseError = true; } else { - if (c5 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { + if (c3 === 37 && (!isASCIIHex(this.input[this.pointer + 1]) || !isASCIIHex(this.input[this.pointer + 2]))) { this.parseError = true; } - this.url.fragment += percentEncodeChar(c5, isC0ControlPercentEncode); + this.url.fragment += percentEncodeChar(c3, isC0ControlPercentEncode); } return true; }; @@ -2543,15 +2875,15 @@ var require_url_state_machine = __commonJS({ module2.exports.setTheUsername = function(url2, username) { url2.username = ""; const decoded = punycode.ucs2.decode(username); - for (let i4 = 0; i4 < decoded.length; ++i4) { - url2.username += percentEncodeChar(decoded[i4], isUserinfoPercentEncode); + for (let i3 = 0; i3 < decoded.length; ++i3) { + url2.username += percentEncodeChar(decoded[i3], isUserinfoPercentEncode); } }; module2.exports.setThePassword = function(url2, password) { url2.password = ""; const decoded = punycode.ucs2.decode(password); - for (let i4 = 0; i4 < decoded.length; ++i4) { - url2.password += percentEncodeChar(decoded[i4], isUserinfoPercentEncode); + for (let i3 = 0; i3 < decoded.length; ++i3) { + url2.password += percentEncodeChar(decoded[i3], isUserinfoPercentEncode); } }; module2.exports.serializeHost = serializeHost; @@ -2741,8 +3073,8 @@ var require_URL = __commonJS({ throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); } const args = []; - for (let i4 = 0; i4 < arguments.length && i4 < 2; ++i4) { - args[i4] = arguments[i4]; + for (let i3 = 0; i3 < arguments.length && i3 < 2; ++i3) { + args[i3] = arguments[i3]; } args[0] = conversions["USVString"](args[0]); if (args[1] !== void 0) { @@ -2755,8 +3087,8 @@ var require_URL = __commonJS({ throw new TypeError("Illegal invocation"); } const args = []; - for (let i4 = 0; i4 < arguments.length && i4 < 0; ++i4) { - args[i4] = arguments[i4]; + for (let i3 = 0; i3 < arguments.length && i3 < 0; ++i3) { + args[i3] = arguments[i3]; } return this[impl].toJSON.apply(this[impl], args); }; @@ -2938,7 +3270,7 @@ var require_lib2 = __commonJS({ var whatwgUrl = _interopDefault(require_public_api()); var https3 = _interopDefault(require("https")); var zlib3 = _interopDefault(require("zlib")); - var Readable8 = Stream3.Readable; + var Readable5 = Stream3.Readable; var BUFFER = Symbol("buffer"); var TYPE = Symbol("type"); var Blob5 = class { @@ -2949,10 +3281,10 @@ var require_lib2 = __commonJS({ const buffers = []; let size = 0; if (blobParts) { - const a5 = blobParts; - const length = Number(a5.length); - for (let i4 = 0; i4 < length; i4++) { - const element = a5[i4]; + const a4 = blobParts; + const length = Number(a4.length); + for (let i3 = 0; i3 < length; i3++) { + const element = a4[i3]; let buffer; if (element instanceof Buffer) { buffer = element; @@ -2990,12 +3322,12 @@ var require_lib2 = __commonJS({ return Promise.resolve(ab); } stream() { - const readable2 = new Readable8(); - readable2._read = function() { + const readable = new Readable5(); + readable._read = function() { }; - readable2.push(this[BUFFER]); - readable2.push(null); - return readable2; + readable.push(this[BUFFER]); + readable.push(null); + return readable; } toString() { return "[object Blob]"; @@ -3056,7 +3388,7 @@ var require_lib2 = __commonJS({ } catch (e3) { } var INTERNALS = Symbol("Body internals"); - var PassThrough2 = Stream3.PassThrough; + var PassThrough = Stream3.PassThrough; function Body(body) { var _this = this; var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$size = _ref.size; @@ -3279,8 +3611,8 @@ var require_lib2 = __commonJS({ throw new Error("cannot clone body after it is used"); } if (body instanceof Stream3 && typeof body.getBoundary !== "function") { - p1 = new PassThrough2(); - p22 = new PassThrough2(); + p1 = new PassThrough(); + p22 = new PassThrough(); body.pipe(p1); body.pipe(p22); instance[INTERNALS].body = p1; @@ -3423,13 +3755,13 @@ var require_lib2 = __commonJS({ forEach(callback) { let thisArg = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0; let pairs = getHeaders2(this); - let i4 = 0; - while (i4 < pairs.length) { - var _pairs$i = pairs[i4]; + let i3 = 0; + while (i3 < pairs.length) { + var _pairs$i = pairs[i3]; const name = _pairs$i[0], value = _pairs$i[1]; callback.call(thisArg, value, name, this); pairs = getHeaders2(this); - i4++; + i3++; } } set(name, value) { @@ -4064,28 +4396,28 @@ function t() { function r2(e3) { return "object" == typeof e3 && null !== e3 || "function" == typeof e3; } -function n2(e3, t2) { +function n(e3, t2) { try { Object.defineProperty(e3, "name", { value: t2, configurable: true }); } catch (e4) { } } -function u3(e3) { - return new a4(e3); +function u2(e3) { + return new a3(e3); } -function c4(e3) { +function c2(e3) { return l2(e3); } function d6(e3) { return s(e3); } function f3(e3, t2, r3) { - return i3.call(e3, t2, r3); + return i2.call(e3, t2, r3); } function b6(e3, t2, r3) { - f3(f3(e3, t2, r3), void 0, o3); + f3(f3(e3, t2, r3), void 0, o2); } -function h4(e3, t2) { +function h3(e3, t2) { b6(e3, t2); } function _6(e3, t2) { @@ -4095,7 +4427,7 @@ function p3(e3, t2, r3) { return f3(e3, t2, r3); } function m4(e3) { - f3(e3, void 0, o3); + f3(e3, void 0, o2); } function g3(e3, t2, r3) { if ("function" != typeof e3) @@ -4104,7 +4436,7 @@ function g3(e3, t2, r3) { } function w6(e3, t2, r3) { try { - return c4(g3(e3, t2, r3)); + return c2(g3(e3, t2, r3)); } catch (e4) { return d6(e4); } @@ -4127,7 +4459,7 @@ function k6(e3) { return new TypeError("Cannot " + e3 + " a stream using a released reader"); } function O4(e3) { - e3._closedPromise = u3((t2, r3) => { + e3._closedPromise = u2((t2, r3) => { e3._closedPromise_resolve = t2, e3._closedPromise_reject = r3; }); } @@ -4171,14 +4503,14 @@ function Q4(e3) { } function N5(e3, t2) { const r3 = Number.MAX_SAFE_INTEGER; - let o4 = Number(e3); - if (o4 = Q4(o4), !z5(o4)) + let o3 = Number(e3); + if (o3 = Q4(o3), !z5(o3)) throw new TypeError(`${t2} is not a finite number`); - if (o4 = function(e4) { + if (o3 = function(e4) { return Q4(L6(e4)); - }(o4), o4 < 0 || o4 > r3) + }(o3), o3 < 0 || o3 > r3) throw new TypeError(`${t2} is outside the accepted range of 0 to ${r3}, inclusive`); - return z5(o4) && 0 !== o4 ? o4 : 0; + return z5(o3) && 0 !== o3 ? o3 : 0; } function H4(e3) { if (!r2(e3)) @@ -4210,8 +4542,8 @@ function U6(e3, t2) { e3._reader._readRequests.push(t2); } function G5(e3, t2, r3) { - const o4 = e3._reader._readRequests.shift(); - r3 ? o4._closeSteps() : o4._chunkSteps(t2); + const o3 = e3._reader._readRequests.shift(); + r3 ? o3._closeSteps() : o3._chunkSteps(t2); } function X4(e3) { return e3._reader._readRequests.length; @@ -4246,15 +4578,15 @@ function oe(e3) { function ne(e3) { return new TypeError(`ReadableStreamAsyncIterator.${e3} can only be used on a ReadableSteamAsyncIterator`); } -function ie2(e3, t2, r3, o4, n3) { - new Uint8Array(e3).set(new Uint8Array(r3, o4, n3), t2); +function ie2(e3, t2, r3, o3, n2) { + new Uint8Array(e3).set(new Uint8Array(r3, o3, n2), t2); } function le2(e3) { const t2 = function(e4, t3, r3) { if (e4.slice) return e4.slice(t3, r3); - const o4 = r3 - t3, n3 = new ArrayBuffer(o4); - return ie2(n3, 0, e4, t3, o4), n3; + const o3 = r3 - t3, n2 = new ArrayBuffer(o3); + return ie2(n2, 0, e4, t3, o3), n2; }(e3.buffer, e3.byteOffset, e3.byteOffset + e3.byteLength); return new Uint8Array(t2); } @@ -4263,9 +4595,9 @@ function se(e3) { return e3._queueTotalSize -= t2.size, e3._queueTotalSize < 0 && (e3._queueTotalSize = 0), t2.value; } function ue2(e3, t2, r3) { - if ("number" != typeof (o4 = r3) || ae2(o4) || o4 < 0 || r3 === 1 / 0) + if ("number" != typeof (o3 = r3) || ae2(o3) || o3 < 0 || r3 === 1 / 0) throw new RangeError("Size must be a finite, non-NaN, non-negative number."); - var o4; + var o3; e3._queue.push({ value: t2, size: r3 }), e3._queueTotalSize += r3; } function ce2(e3) { @@ -4307,39 +4639,39 @@ function he(e3) { function _e(e3, t2) { let r3 = false; "closed" === e3._state && (r3 = true); - const o4 = pe(t2); - "default" === t2.readerType ? G5(e3, o4, r3) : function(e4, t3, r4) { - const o5 = e4._reader._readIntoRequests.shift(); - r4 ? o5._closeSteps(t3) : o5._chunkSteps(t3); - }(e3, o4, r3); + const o3 = pe(t2); + "default" === t2.readerType ? G5(e3, o3, r3) : function(e4, t3, r4) { + const o4 = e4._reader._readIntoRequests.shift(); + r4 ? o4._closeSteps(t3) : o4._chunkSteps(t3); + }(e3, o3, r3); } function pe(e3) { const t2 = e3.bytesFilled, r3 = e3.elementSize; return new e3.viewConstructor(e3.buffer, e3.byteOffset, t2 / r3); } -function me(e3, t2, r3, o4) { - e3._queue.push({ buffer: t2, byteOffset: r3, byteLength: o4 }), e3._queueTotalSize += o4; +function me(e3, t2, r3, o3) { + e3._queue.push({ buffer: t2, byteOffset: r3, byteLength: o3 }), e3._queueTotalSize += o3; } -function ye(e3, t2, r3, o4) { - let n3; +function ye(e3, t2, r3, o3) { + let n2; try { - n3 = t2.slice(r3, r3 + o4); + n2 = t2.slice(r3, r3 + o3); } catch (t3) { throw Pe(e3, t3), t3; } - me(e3, n3, 0, o4); + me(e3, n2, 0, o3); } function ge(e3, t2) { t2.bytesFilled > 0 && ye(e3, t2.buffer, t2.byteOffset, t2.bytesFilled), Ce(e3); } function we(e3, t2) { - const r3 = t2.elementSize, o4 = t2.bytesFilled - t2.bytesFilled % r3, n3 = Math.min(e3._queueTotalSize, t2.byteLength - t2.bytesFilled), a5 = t2.bytesFilled + n3, i4 = a5 - a5 % r3; - let l3 = n3, s2 = false; - i4 > o4 && (l3 = i4 - t2.bytesFilled, s2 = true); - const u4 = e3._queue; + const r3 = t2.elementSize, o3 = t2.bytesFilled - t2.bytesFilled % r3, n2 = Math.min(e3._queueTotalSize, t2.byteLength - t2.bytesFilled), a4 = t2.bytesFilled + n2, i3 = a4 - a4 % r3; + let l3 = n2, s2 = false; + i3 > o3 && (l3 = i3 - t2.bytesFilled, s2 = true); + const u3 = e3._queue; for (; l3 > 0; ) { - const r4 = u4.peek(), o5 = Math.min(l3, r4.byteLength), n4 = t2.byteOffset + t2.bytesFilled; - ie2(t2.buffer, n4, r4.buffer, r4.byteOffset, o5), r4.byteLength === o5 ? u4.shift() : (r4.byteOffset += o5, r4.byteLength -= o5), e3._queueTotalSize -= o5, Se(e3, o5, t2), l3 -= o5; + const r4 = u3.peek(), o4 = Math.min(l3, r4.byteLength), n3 = t2.byteOffset + t2.bytesFilled; + ie2(t2.buffer, n3, r4.buffer, r4.byteOffset, o4), r4.byteLength === o4 ? u3.shift() : (r4.byteOffset += o4, r4.byteLength -= o4), e3._queueTotalSize -= o4, Se(e3, o4, t2), l3 -= o4; } return s2; } @@ -4375,12 +4707,12 @@ function qe(e3, t2) { if (r4.bytesFilled < r4.elementSize) return; Ce(e4); - const o4 = r4.bytesFilled % r4.elementSize; - if (o4 > 0) { + const o3 = r4.bytesFilled % r4.elementSize; + if (o3 > 0) { const t4 = r4.byteOffset + r4.bytesFilled; - ye(e4, r4.buffer, t4 - o4, o4); + ye(e4, r4.buffer, t4 - o3, o3); } - r4.bytesFilled -= o4, _e(e4._controlledReadableByteStream, r4), Te(e4); + r4.bytesFilled -= o3, _e(e4._controlledReadableByteStream, r4), Te(e4); }(e3, t2, r3), be(e3); } function Ce(e3) { @@ -4396,24 +4728,24 @@ function Pe(e3, t2) { function We(e3, t2) { const r3 = e3._queue.shift(); e3._queueTotalSize -= r3.byteLength, ve(e3); - const o4 = new Uint8Array(r3.buffer, r3.byteOffset, r3.byteLength); - t2._chunkSteps(o4); + const o3 = new Uint8Array(r3.buffer, r3.byteOffset, r3.byteLength); + t2._chunkSteps(o3); } function ke(e3) { const t2 = e3._controlledReadableByteStream._state; return "errored" === t2 ? null : "closed" === t2 ? 0 : e3._strategyHWM - e3._queueTotalSize; } function Oe(e3, t2, r3) { - const o4 = Object.create(ReadableByteStreamController.prototype); - let n3, a5, i4; - n3 = void 0 !== t2.start ? () => t2.start(o4) : () => { - }, a5 = void 0 !== t2.pull ? () => t2.pull(o4) : () => c4(void 0), i4 = void 0 !== t2.cancel ? (e4) => t2.cancel(e4) : () => c4(void 0); + const o3 = Object.create(ReadableByteStreamController.prototype); + let n2, a4, i3; + n2 = void 0 !== t2.start ? () => t2.start(o3) : () => { + }, a4 = void 0 !== t2.pull ? () => t2.pull(o3) : () => c2(void 0), i3 = void 0 !== t2.cancel ? (e4) => t2.cancel(e4) : () => c2(void 0); const l3 = t2.autoAllocateChunkSize; if (0 === l3) throw new TypeError("autoAllocateChunkSize must be greater than 0"); - !function(e4, t3, r4, o5, n4, a6, i5) { - t3._controlledReadableByteStream = e4, t3._pullAgain = false, t3._pulling = false, t3._byobRequest = null, t3._queue = t3._queueTotalSize = void 0, ce2(t3), t3._closeRequested = false, t3._started = false, t3._strategyHWM = a6, t3._pullAlgorithm = o5, t3._cancelAlgorithm = n4, t3._autoAllocateChunkSize = i5, t3._pendingPullIntos = new S5(), e4._readableStreamController = t3, b6(c4(r4()), () => (t3._started = true, be(t3), null), (e5) => (Pe(t3, e5), null)); - }(e3, o4, n3, a5, i4, r3, l3); + !function(e4, t3, r4, o4, n3, a5, i4) { + t3._controlledReadableByteStream = e4, t3._pullAgain = false, t3._pulling = false, t3._byobRequest = null, t3._queue = t3._queueTotalSize = void 0, ce2(t3), t3._closeRequested = false, t3._started = false, t3._strategyHWM = a5, t3._pullAlgorithm = o4, t3._cancelAlgorithm = n3, t3._autoAllocateChunkSize = i4, t3._pendingPullIntos = new S5(), e4._readableStreamController = t3, b6(c2(r4()), () => (t3._started = true, be(t3), null), (e5) => (Pe(t3, e5), null)); + }(e3, o3, n2, a4, i3, r3, l3); } function Be(e3) { return new TypeError(`ReadableStreamBYOBRequest.prototype.${e3} can only be used on a ReadableStreamBYOBRequest`); @@ -4457,8 +4789,8 @@ function Me(e3) { } function Ye(e3, t2) { F4(e3, t2); - const r3 = null == e3 ? void 0 : e3.highWaterMark, o4 = null == e3 ? void 0 : e3.size; - return { highWaterMark: void 0 === r3 ? void 0 : Y2(r3), size: void 0 === o4 ? void 0 : Qe(o4, `${t2} has member 'size' that`) }; + const r3 = null == e3 ? void 0 : e3.highWaterMark, o3 = null == e3 ? void 0 : e3.size; + return { highWaterMark: void 0 === r3 ? void 0 : Y2(r3), size: void 0 === o3 ? void 0 : Qe(o3, `${t2} has member 'size' that`) }; } function Qe(e3, t2) { return I4(e3, t2), (t3) => Y2(e3(t3)); @@ -4473,7 +4805,7 @@ function xe(e3, t2, r3) { return I4(e3, r3), (r4) => g3(e3, t2, [r4]); } function Ve(e3, t2, r3) { - return I4(e3, r3), (r4, o4) => w6(e3, t2, [r4, o4]); + return I4(e3, r3), (r4, o3) => w6(e3, t2, [r4, o3]); } function Ge(e3) { return !!r2(e3) && (!!Object.prototype.hasOwnProperty.call(e3, "_writableStreamController") && e3 instanceof WritableStream); @@ -4484,30 +4816,30 @@ function Xe(e3) { function Je(e3, t2) { var r3; if ("closed" === e3._state || "errored" === e3._state) - return c4(void 0); + return c2(void 0); e3._writableStreamController._abortReason = t2, null === (r3 = e3._writableStreamController._abortController) || void 0 === r3 || r3.abort(t2); - const o4 = e3._state; - if ("closed" === o4 || "errored" === o4) - return c4(void 0); + const o3 = e3._state; + if ("closed" === o3 || "errored" === o3) + return c2(void 0); if (void 0 !== e3._pendingAbortRequest) return e3._pendingAbortRequest._promise; - let n3 = false; - "erroring" === o4 && (n3 = true, t2 = void 0); - const a5 = u3((r4, o5) => { - e3._pendingAbortRequest = { _promise: void 0, _resolve: r4, _reject: o5, _reason: t2, _wasAlreadyErroring: n3 }; + let n2 = false; + "erroring" === o3 && (n2 = true, t2 = void 0); + const a4 = u2((r4, o4) => { + e3._pendingAbortRequest = { _promise: void 0, _resolve: r4, _reject: o4, _reason: t2, _wasAlreadyErroring: n2 }; }); - return e3._pendingAbortRequest._promise = a5, n3 || et(e3, t2), a5; + return e3._pendingAbortRequest._promise = a4, n2 || et(e3, t2), a4; } function Ke(e3) { const t2 = e3._state; if ("closed" === t2 || "errored" === t2) return d6(new TypeError(`The stream (in ${t2} state) is not in the writable state and cannot be closed`)); - const r3 = u3((t3, r4) => { - const o5 = { _resolve: t3, _reject: r4 }; - e3._closeRequest = o5; - }), o4 = e3._writer; - var n3; - return void 0 !== o4 && e3._backpressure && "writable" === t2 && Et(o4), ue2(n3 = e3._writableStreamController, lt, 0), dt(n3), r3; + const r3 = u2((t3, r4) => { + const o4 = { _resolve: t3, _reject: r4 }; + e3._closeRequest = o4; + }), o3 = e3._writer; + var n2; + return void 0 !== o3 && e3._backpressure && "writable" === t2 && Et(o3), ue2(n2 = e3._writableStreamController, lt, 0), dt(n2), r3; } function Ze(e3, t2) { "writable" !== e3._state ? tt(e3) : et(e3, t2); @@ -4515,8 +4847,8 @@ function Ze(e3, t2) { function et(e3, t2) { const r3 = e3._writableStreamController; e3._state = "erroring", e3._storedError = t2; - const o4 = e3._writer; - void 0 !== o4 && it(o4, t2), !function(e4) { + const o3 = e3._writer; + void 0 !== o3 && it(o3, t2), !function(e4) { if (void 0 === e4._inFlightWriteRequest && void 0 === e4._inFlightCloseRequest) return false; return true; @@ -4632,7 +4964,7 @@ function yt(e3) { return new TypeError("Cannot " + e3 + " a stream using a released writer"); } function gt(e3) { - e3._closedPromise = u3((t2, r3) => { + e3._closedPromise = u2((t2, r3) => { e3._closedPromise_resolve = t2, e3._closedPromise_reject = r3, e3._closedPromiseState = "pending"; }); } @@ -4646,7 +4978,7 @@ function vt(e3) { void 0 !== e3._closedPromise_resolve && (e3._closedPromise_resolve(void 0), e3._closedPromise_resolve = void 0, e3._closedPromise_reject = void 0, e3._closedPromiseState = "resolved"); } function Rt(e3) { - e3._readyPromise = u3((t2, r3) => { + e3._readyPromise = u2((t2, r3) => { e3._readyPromise_resolve = t2, e3._readyPromise_reject = r3; }), e3._readyPromiseState = "pending"; } @@ -4662,43 +4994,43 @@ function Ct(e3, t2) { function Et(e3) { void 0 !== e3._readyPromise_resolve && (e3._readyPromise_resolve(void 0), e3._readyPromise_resolve = void 0, e3._readyPromise_reject = void 0, e3._readyPromiseState = "fulfilled"); } -function kt(e3, t2, r3, o4, n3, a5) { - const i4 = e3.getReader(), l3 = t2.getWriter(); +function kt(e3, t2, r3, o3, n2, a4) { + const i3 = e3.getReader(), l3 = t2.getWriter(); Vt(e3) && (e3._disturbed = true); let s2, _7, g4, w7 = false, S6 = false, v5 = "readable", R7 = "writable", T6 = false, q6 = false; - const C5 = u3((e4) => { + const C5 = u2((e4) => { g4 = e4; }); let E4 = Promise.resolve(void 0); - return u3((P4, W6) => { + return u2((P4, W6) => { let k7; function O5() { if (w7) return; - const e4 = u3((e5, t3) => { - !function r4(o5) { - o5 ? e5() : f3(function() { + const e4 = u2((e5, t3) => { + !function r4(o4) { + o4 ? e5() : f3(function() { if (w7) - return c4(true); - return f3(l3.ready, () => f3(i4.read(), (e6) => !!e6.done || (E4 = l3.write(e6.value), m4(E4), false))); + return c2(true); + return f3(l3.ready, () => f3(i3.read(), (e6) => !!e6.done || (E4 = l3.write(e6.value), m4(E4), false))); }(), r4, t3); }(false); }); m4(e4); } function B3() { - return v5 = "closed", r3 ? L7() : z6(() => (Ge(t2) && (T6 = rt(t2), R7 = t2._state), T6 || "closed" === R7 ? c4(void 0) : "erroring" === R7 || "errored" === R7 ? d6(_7) : (T6 = true, l3.close())), false, void 0), null; + return v5 = "closed", r3 ? L7() : z6(() => (Ge(t2) && (T6 = rt(t2), R7 = t2._state), T6 || "closed" === R7 ? c2(void 0) : "erroring" === R7 || "errored" === R7 ? d6(_7) : (T6 = true, l3.close())), false, void 0), null; } function A5(e4) { - return w7 || (v5 = "errored", s2 = e4, o4 ? L7(true, e4) : z6(() => l3.abort(e4), true, e4)), null; + return w7 || (v5 = "errored", s2 = e4, o3 ? L7(true, e4) : z6(() => l3.abort(e4), true, e4)), null; } function j4(e4) { - return S6 || (R7 = "errored", _7 = e4, n3 ? L7(true, e4) : z6(() => i4.cancel(e4), true, e4)), null; + return S6 || (R7 = "errored", _7 = e4, n2 ? L7(true, e4) : z6(() => i3.cancel(e4), true, e4)), null; } - if (void 0 !== a5 && (k7 = () => { - const e4 = void 0 !== a5.reason ? a5.reason : new Wt("Aborted", "AbortError"), t3 = []; - o4 || t3.push(() => "writable" === R7 ? l3.abort(e4) : c4(void 0)), n3 || t3.push(() => "readable" === v5 ? i4.cancel(e4) : c4(void 0)), z6(() => Promise.all(t3.map((e5) => e5())), true, e4); - }, a5.aborted ? k7() : a5.addEventListener("abort", k7)), Vt(e3) && (v5 = e3._state, s2 = e3._storedError), Ge(t2) && (R7 = t2._state, _7 = t2._storedError, T6 = rt(t2)), Vt(e3) && Ge(t2) && (q6 = true, g4()), "errored" === v5) + if (void 0 !== a4 && (k7 = () => { + const e4 = void 0 !== a4.reason ? a4.reason : new Wt("Aborted", "AbortError"), t3 = []; + o3 || t3.push(() => "writable" === R7 ? l3.abort(e4) : c2(void 0)), n2 || t3.push(() => "readable" === v5 ? i3.cancel(e4) : c2(void 0)), z6(() => Promise.all(t3.map((e5) => e5())), true, e4); + }, a4.aborted ? k7() : a4.addEventListener("abort", k7)), Vt(e3) && (v5 = e3._state, s2 = e3._storedError), Ge(t2) && (R7 = t2._state, _7 = t2._storedError, T6 = rt(t2)), Vt(e3) && Ge(t2) && (q6 = true, g4()), "errored" === v5) A5(s2); else if ("erroring" === R7 || "errored" === R7) j4(_7); @@ -4706,30 +5038,30 @@ function kt(e3, t2, r3, o4, n3, a5) { B3(); else if (T6 || "closed" === R7) { const e4 = new TypeError("the destination writable stream closed before all data could be piped to it"); - n3 ? L7(true, e4) : z6(() => i4.cancel(e4), true, e4); + n2 ? L7(true, e4) : z6(() => i3.cancel(e4), true, e4); } function z6(e4, t3, r4) { - function o5() { - return "writable" !== R7 || T6 ? n4() : h4(function() { + function o4() { + return "writable" !== R7 || T6 ? n3() : h3(function() { let e5; - return c4(function t4() { + return c2(function t4() { if (e5 !== E4) return e5 = E4, p3(E4, t4, t4); }()); - }(), n4), null; + }(), n3), null; } - function n4() { + function n3() { return e4 ? b6(e4(), () => F5(t3, r4), (e5) => F5(true, e5)) : F5(t3, r4), null; } - w7 || (w7 = true, q6 ? o5() : h4(C5, o5)); + w7 || (w7 = true, q6 ? o4() : h3(C5, o4)); } function L7(e4, t3) { z6(void 0, e4, t3); } function F5(e4, t3) { - return S6 = true, l3.releaseLock(), i4.releaseLock(), void 0 !== a5 && a5.removeEventListener("abort", k7), e4 ? W6(t3) : P4(void 0), null; + return S6 = true, l3.releaseLock(), i3.releaseLock(), void 0 !== a4 && a4.removeEventListener("abort", k7), e4 ? W6(t3) : P4(void 0), null; } - w7 || (b6(i4.closed, B3, A5), b6(l3.closed, function() { + w7 || (b6(i3.closed, B3, A5), b6(l3.closed, function() { return S6 || (R7 = "closed"), null; }, j4)), q6 ? O5() : y5(() => { q6 = true, g4(), O5(); @@ -4744,124 +5076,124 @@ function Ot(e3, t2) { return false; } }(e3) ? function(e4) { - let t3, r3, o4, n3, a5, i4 = e4.getReader(), l3 = false, s2 = false, d7 = false, f4 = false, h5 = false, p4 = false; - const m5 = u3((e5) => { - a5 = e5; + let t3, r3, o3, n2, a4, i3 = e4.getReader(), l3 = false, s2 = false, d7 = false, f4 = false, h4 = false, p4 = false; + const m5 = u2((e5) => { + a4 = e5; }); function y6(e5) { - _6(e5.closed, (t4) => (e5 !== i4 || (o4.error(t4), n3.error(t4), h5 && p4 || a5(void 0)), null)); + _6(e5.closed, (t4) => (e5 !== i3 || (o3.error(t4), n2.error(t4), h4 && p4 || a4(void 0)), null)); } function g4() { - l3 && (i4.releaseLock(), i4 = e4.getReader(), y6(i4), l3 = false), b6(i4.read(), (e5) => { + l3 && (i3.releaseLock(), i3 = e4.getReader(), y6(i3), l3 = false), b6(i3.read(), (e5) => { var t4, r4; if (d7 = false, f4 = false, e5.done) - return h5 || o4.close(), p4 || n3.close(), null === (t4 = o4.byobRequest) || void 0 === t4 || t4.respond(0), null === (r4 = n3.byobRequest) || void 0 === r4 || r4.respond(0), h5 && p4 || a5(void 0), null; - const l4 = e5.value, u4 = l4; - let c5 = l4; - if (!h5 && !p4) + return h4 || o3.close(), p4 || n2.close(), null === (t4 = o3.byobRequest) || void 0 === t4 || t4.respond(0), null === (r4 = n2.byobRequest) || void 0 === r4 || r4.respond(0), h4 && p4 || a4(void 0), null; + const l4 = e5.value, u3 = l4; + let c3 = l4; + if (!h4 && !p4) try { - c5 = le2(l4); + c3 = le2(l4); } catch (e6) { - return o4.error(e6), n3.error(e6), a5(i4.cancel(e6)), null; + return o3.error(e6), n2.error(e6), a4(i3.cancel(e6)), null; } - return h5 || o4.enqueue(u4), p4 || n3.enqueue(c5), s2 = false, d7 ? S6() : f4 && v5(), null; + return h4 || o3.enqueue(u3), p4 || n2.enqueue(c3), s2 = false, d7 ? S6() : f4 && v5(), null; }, () => (s2 = false, null)); } function w7(t4, r4) { - l3 || (i4.releaseLock(), i4 = e4.getReader({ mode: "byob" }), y6(i4), l3 = true); - const u4 = r4 ? n3 : o4, c5 = r4 ? o4 : n3; - b6(i4.read(t4), (e5) => { + l3 || (i3.releaseLock(), i3 = e4.getReader({ mode: "byob" }), y6(i3), l3 = true); + const u3 = r4 ? n2 : o3, c3 = r4 ? o3 : n2; + b6(i3.read(t4), (e5) => { var t5; d7 = false, f4 = false; - const o5 = r4 ? p4 : h5, n4 = r4 ? h5 : p4; + const o4 = r4 ? p4 : h4, n3 = r4 ? h4 : p4; if (e5.done) { - o5 || u4.close(), n4 || c5.close(); + o4 || u3.close(), n3 || c3.close(); const r5 = e5.value; - return void 0 !== r5 && (o5 || u4.byobRequest.respondWithNewView(r5), n4 || null === (t5 = c5.byobRequest) || void 0 === t5 || t5.respond(0)), o5 && n4 || a5(void 0), null; + return void 0 !== r5 && (o4 || u3.byobRequest.respondWithNewView(r5), n3 || null === (t5 = c3.byobRequest) || void 0 === t5 || t5.respond(0)), o4 && n3 || a4(void 0), null; } const l4 = e5.value; - if (n4) - o5 || u4.byobRequest.respondWithNewView(l4); + if (n3) + o4 || u3.byobRequest.respondWithNewView(l4); else { let e6; try { e6 = le2(l4); } catch (e7) { - return u4.error(e7), c5.error(e7), a5(i4.cancel(e7)), null; + return u3.error(e7), c3.error(e7), a4(i3.cancel(e7)), null; } - o5 || u4.byobRequest.respondWithNewView(l4), c5.enqueue(e6); + o4 || u3.byobRequest.respondWithNewView(l4), c3.enqueue(e6); } return s2 = false, d7 ? S6() : f4 && v5(), null; }, () => (s2 = false, null)); } function S6() { if (s2) - return d7 = true, c4(void 0); + return d7 = true, c2(void 0); s2 = true; - const e5 = o4.byobRequest; - return null === e5 ? g4() : w7(e5.view, false), c4(void 0); + const e5 = o3.byobRequest; + return null === e5 ? g4() : w7(e5.view, false), c2(void 0); } function v5() { if (s2) - return f4 = true, c4(void 0); + return f4 = true, c2(void 0); s2 = true; - const e5 = n3.byobRequest; - return null === e5 ? g4() : w7(e5.view, true), c4(void 0); + const e5 = n2.byobRequest; + return null === e5 ? g4() : w7(e5.view, true), c2(void 0); } function R7(e5) { - if (h5 = true, t3 = e5, p4) { - const e6 = [t3, r3], o5 = i4.cancel(e6); - a5(o5); + if (h4 = true, t3 = e5, p4) { + const e6 = [t3, r3], o4 = i3.cancel(e6); + a4(o4); } return m5; } function T6(e5) { - if (p4 = true, r3 = e5, h5) { - const e6 = [t3, r3], o5 = i4.cancel(e6); - a5(o5); + if (p4 = true, r3 = e5, h4) { + const e6 = [t3, r3], o4 = i3.cancel(e6); + a4(o4); } return m5; } const q6 = new ReadableStream3({ type: "bytes", start(e5) { - o4 = e5; + o3 = e5; }, pull: S6, cancel: R7 }), C5 = new ReadableStream3({ type: "bytes", start(e5) { - n3 = e5; + n2 = e5; }, pull: v5, cancel: T6 }); - return y6(i4), [q6, C5]; + return y6(i3), [q6, C5]; }(e3) : function(e4, t3) { const r3 = e4.getReader(); - let o4, n3, a5, i4, l3, s2 = false, d7 = false, f4 = false, h5 = false; - const p4 = u3((e5) => { + let o3, n2, a4, i3, l3, s2 = false, d7 = false, f4 = false, h4 = false; + const p4 = u2((e5) => { l3 = e5; }); function m5() { - return s2 ? (d7 = true, c4(void 0)) : (s2 = true, b6(r3.read(), (e5) => { + return s2 ? (d7 = true, c2(void 0)) : (s2 = true, b6(r3.read(), (e5) => { if (d7 = false, e5.done) - return f4 || a5.close(), h5 || i4.close(), f4 && h5 || l3(void 0), null; - const t4 = e5.value, r4 = t4, o5 = t4; - return f4 || a5.enqueue(r4), h5 || i4.enqueue(o5), s2 = false, d7 && m5(), null; - }, () => (s2 = false, null)), c4(void 0)); + return f4 || a4.close(), h4 || i3.close(), f4 && h4 || l3(void 0), null; + const t4 = e5.value, r4 = t4, o4 = t4; + return f4 || a4.enqueue(r4), h4 || i3.enqueue(o4), s2 = false, d7 && m5(), null; + }, () => (s2 = false, null)), c2(void 0)); } function y6(e5) { - if (f4 = true, o4 = e5, h5) { - const e6 = [o4, n3], t4 = r3.cancel(e6); + if (f4 = true, o3 = e5, h4) { + const e6 = [o3, n2], t4 = r3.cancel(e6); l3(t4); } return p4; } function g4(e5) { - if (h5 = true, n3 = e5, f4) { - const e6 = [o4, n3], t4 = r3.cancel(e6); + if (h4 = true, n2 = e5, f4) { + const e6 = [o3, n2], t4 = r3.cancel(e6); l3(t4); } return p4; } const w7 = new ReadableStream3({ start(e5) { - a5 = e5; + a4 = e5; }, pull: m5, cancel: y6 }), S6 = new ReadableStream3({ start(e5) { - i4 = e5; + i3 = e5; }, pull: m5, cancel: g4 }); - return _6(r3.closed, (e5) => (a5.error(e5), i4.error(e5), f4 && h5 || l3(void 0), null)), [w7, S6]; + return _6(r3.closed, (e5) => (a4.error(e5), i3.error(e5), f4 && h4 || l3(void 0), null)), [w7, S6]; }(e3); } function Bt(e3) { @@ -4901,13 +5233,13 @@ function Lt(e3) { function Ft(e3) { return !e3._closeRequested && "readable" === e3._controlledReadableStream._state; } -function It(e3, t2, r3, o4) { - const n3 = Object.create(ReadableStreamDefaultController.prototype); - let a5, i4, l3; - a5 = void 0 !== t2.start ? () => t2.start(n3) : () => { - }, i4 = void 0 !== t2.pull ? () => t2.pull(n3) : () => c4(void 0), l3 = void 0 !== t2.cancel ? (e4) => t2.cancel(e4) : () => c4(void 0), function(e4, t3, r4, o5, n4, a6, i5) { - t3._controlledReadableStream = e4, t3._queue = void 0, t3._queueTotalSize = void 0, ce2(t3), t3._started = false, t3._closeRequested = false, t3._pullAgain = false, t3._pulling = false, t3._strategySizeAlgorithm = i5, t3._strategyHWM = a6, t3._pullAlgorithm = o5, t3._cancelAlgorithm = n4, e4._readableStreamController = t3, b6(c4(r4()), () => (t3._started = true, At(t3), null), (e5) => (zt(t3, e5), null)); - }(e3, n3, a5, i4, l3, r3, o4); +function It(e3, t2, r3, o3) { + const n2 = Object.create(ReadableStreamDefaultController.prototype); + let a4, i3, l3; + a4 = void 0 !== t2.start ? () => t2.start(n2) : () => { + }, i3 = void 0 !== t2.pull ? () => t2.pull(n2) : () => c2(void 0), l3 = void 0 !== t2.cancel ? (e4) => t2.cancel(e4) : () => c2(void 0), function(e4, t3, r4, o4, n3, a5, i4) { + t3._controlledReadableStream = e4, t3._queue = void 0, t3._queueTotalSize = void 0, ce2(t3), t3._started = false, t3._closeRequested = false, t3._pullAgain = false, t3._pulling = false, t3._strategySizeAlgorithm = i4, t3._strategyHWM = a5, t3._pullAlgorithm = o4, t3._cancelAlgorithm = n3, e4._readableStreamController = t3, b6(c2(r4()), () => (t3._started = true, At(t3), null), (e5) => (zt(t3, e5), null)); + }(e3, n2, a4, i3, l3, r3, o3); } function Dt(e3) { return new TypeError(`ReadableStreamDefaultController.prototype.${e3} can only be used on a ReadableStreamDefaultController`); @@ -4933,8 +5265,8 @@ function Nt(e3, t2) { } function Ht(e3, t2) { F4(e3, t2); - const r3 = null == e3 ? void 0 : e3.preventAbort, o4 = null == e3 ? void 0 : e3.preventCancel, n3 = null == e3 ? void 0 : e3.preventClose, a5 = null == e3 ? void 0 : e3.signal; - return void 0 !== a5 && function(e4, t3) { + const r3 = null == e3 ? void 0 : e3.preventAbort, o3 = null == e3 ? void 0 : e3.preventCancel, n2 = null == e3 ? void 0 : e3.preventClose, a4 = null == e3 ? void 0 : e3.signal; + return void 0 !== a4 && function(e4, t3) { if (!function(e5) { if ("object" != typeof e5 || null === e5) return false; @@ -4945,7 +5277,7 @@ function Ht(e3, t2) { } }(e4)) throw new TypeError(`${t3} is not an AbortSignal.`); - }(a5, `${t2} has member 'signal' that`), { preventAbort: Boolean(r3), preventCancel: Boolean(o4), preventClose: Boolean(n3), signal: a5 }; + }(a4, `${t2} has member 'signal' that`), { preventAbort: Boolean(r3), preventCancel: Boolean(o3), preventClose: Boolean(n2), signal: a4 }; } function xt(e3, t2) { F4(e3, t2); @@ -4954,11 +5286,11 @@ function xt(e3, t2) { if (!H4(e4)) throw new TypeError(`${t3} is not a ReadableStream.`); }(r3, `${t2} has member 'readable' that`); - const o4 = null == e3 ? void 0 : e3.writable; - return M4(o4, "writable", "ReadableWritablePair"), function(e4, t3) { + const o3 = null == e3 ? void 0 : e3.writable; + return M4(o3, "writable", "ReadableWritablePair"), function(e4, t3) { if (!x4(e4)) throw new TypeError(`${t3} is not a WritableStream.`); - }(o4, `${t2} has member 'writable' that`), { readable: r3, writable: o4 }; + }(o3, `${t2} has member 'writable' that`), { readable: r3, writable: o3 }; } function Vt(e3) { return !!r2(e3) && (!!Object.prototype.hasOwnProperty.call(e3, "_readableStreamController") && e3 instanceof ReadableStream3); @@ -4968,14 +5300,14 @@ function Ut(e3) { } function Gt(e3, r3) { if (e3._disturbed = true, "closed" === e3._state) - return c4(void 0); + return c2(void 0); if ("errored" === e3._state) return d6(e3._storedError); Xt(e3); - const o4 = e3._reader; - if (void 0 !== o4 && Fe(o4)) { - const e4 = o4._readIntoRequests; - o4._readIntoRequests = new S5(), e4.forEach((e5) => { + const o3 = e3._reader; + if (void 0 !== o3 && Fe(o3)) { + const e4 = o3._readIntoRequests; + o3._readIntoRequests = new S5(), e4.forEach((e5) => { e5._closeSteps(void 0); }); } @@ -5014,7 +5346,7 @@ function nr(e3) { return new TypeError(`CountQueuingStrategy.prototype.${e3} can only be used on a CountQueuingStrategy`); } function ar(e3) { - return !!r2(e3) && (!!Object.prototype.hasOwnProperty.call(e3, "_countQueuingStrategyHighWaterMark") && e3 instanceof CountQueuingStrategy2); + return !!r2(e3) && (!!Object.prototype.hasOwnProperty.call(e3, "_countQueuingStrategyHighWaterMark") && e3 instanceof CountQueuingStrategy); } function ir(e3, t2, r3) { return I4(e3, r3), (r4) => w6(e3, t2, [r4]); @@ -5023,7 +5355,7 @@ function lr(e3, t2, r3) { return I4(e3, r3), (r4) => g3(e3, t2, [r4]); } function sr(e3, t2, r3) { - return I4(e3, r3), (r4, o4) => w6(e3, t2, [r4, o4]); + return I4(e3, r3), (r4, o3) => w6(e3, t2, [r4, o3]); } function ur(e3) { return !!r2(e3) && (!!Object.prototype.hasOwnProperty.call(e3, "_transformStreamController") && e3 instanceof TransformStream2); @@ -5038,7 +5370,7 @@ function dr(e3, t2) { }(e3, t2), e3._backpressure && fr(e3, false); } function fr(e3, t2) { - void 0 !== e3._backpressureChangePromise && e3._backpressureChangePromise_resolve(), e3._backpressureChangePromise = u3((t3) => { + void 0 !== e3._backpressureChangePromise && e3._backpressureChangePromise_resolve(), e3._backpressureChangePromise = u2((t3) => { e3._backpressureChangePromise_resolve = t3; }), e3._backpressure = t2; } @@ -5064,7 +5396,7 @@ function _r(e3, t2) { } catch (e4) { throw dr(r3, e4), r3._readableStoredError; } - const o4 = function(e4) { + const o3 = function(e4) { return !function(e5) { if (!gr(e5)) return false; @@ -5075,7 +5407,7 @@ function _r(e3, t2) { return false; }(e4); }(r3); - o4 !== r3._backpressure && fr(r3, true); + o3 !== r3._backpressure && fr(r3, true); } function pr(e3, t2) { return p3(e3._transformAlgorithm(t2), void 0, (t3) => { @@ -5114,20 +5446,20 @@ function qr(e3) { function Cr(e3) { "erroring" === e3._writableState && qr(e3); } -var e2, o3, a4, i3, l2, s, y5, S5, v4, R6, T5, q5, C4, z5, L6, ReadableStreamDefaultReader, te, re2, ae2, ReadableStreamBYOBRequest, ReadableByteStreamController, ReadableStreamBYOBReader, Ue, WritableStream, WritableStreamDefaultWriter, lt, WritableStreamDefaultController, Pt, Wt, ReadableStreamDefaultController, ReadableStream3, er, ByteLengthQueuingStrategy, or, CountQueuingStrategy2, TransformStream2, TransformStreamDefaultController; +var e2, o2, a3, i2, l2, s, y5, S5, v4, R6, T5, q5, C4, z5, L6, ReadableStreamDefaultReader, te, re2, ae2, ReadableStreamBYOBRequest, ReadableByteStreamController, ReadableStreamBYOBReader, Ue, WritableStream, WritableStreamDefaultWriter, lt, WritableStreamDefaultController, Pt, Wt, ReadableStreamDefaultController, ReadableStream3, er, ByteLengthQueuingStrategy, or, CountQueuingStrategy, TransformStream2, TransformStreamDefaultController; var init_ponyfill = __esm({ "node_modules/formdata-node/node_modules/web-streams-polyfill/dist/ponyfill.mjs"() { e2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? Symbol : (e3) => `Symbol(${e3})`; - o3 = t; - a4 = Promise; - i3 = Promise.prototype.then; - l2 = Promise.resolve.bind(a4); - s = Promise.reject.bind(a4); + o2 = t; + a3 = Promise; + i2 = Promise.prototype.then; + l2 = Promise.resolve.bind(a3); + s = Promise.reject.bind(a3); y5 = (e3) => { if ("function" == typeof queueMicrotask) y5 = queueMicrotask; else { - const e4 = c4(void 0); + const e4 = c2(void 0); y5 = (t2) => f3(e4, t2); } return y5(e3); @@ -5148,14 +5480,14 @@ var init_ponyfill = __esm({ const e3 = this._front; let t2 = e3; const r3 = this._cursor; - let o4 = r3 + 1; - const n3 = e3._elements, a5 = n3[r3]; - return 16384 === o4 && (t2 = e3._next, o4 = 0), --this._size, this._cursor = o4, e3 !== t2 && (this._front = t2), n3[r3] = void 0, a5; + let o3 = r3 + 1; + const n2 = e3._elements, a4 = n2[r3]; + return 16384 === o3 && (t2 = e3._next, o3 = 0), --this._size, this._cursor = o3, e3 !== t2 && (this._front = t2), n2[r3] = void 0, a4; } forEach(e3) { - let t2 = this._cursor, r3 = this._front, o4 = r3._elements; - for (; !(t2 === o4.length && void 0 === r3._next || t2 === o4.length && (r3 = r3._next, o4 = r3._elements, t2 = 0, 0 === o4.length)); ) - e3(o4[t2]), ++t2; + let t2 = this._cursor, r3 = this._front, o3 = r3._elements; + for (; !(t2 === o3.length && void 0 === r3._next || t2 === o3.length && (r3 = r3._next, o3 = r3._elements, t2 = 0, 0 === o3.length)); ) + e3(o3[t2]), ++t2; } peek() { const e3 = this._front, t2 = this._cursor; @@ -5191,8 +5523,8 @@ var init_ponyfill = __esm({ if (void 0 === this._ownerReadableStream) return d6(k6("read from")); let e3, t2; - const r3 = u3((r4, o4) => { - e3 = r4, t2 = o4; + const r3 = u2((r4, o3) => { + e3 = r4, t2 = o3; }); return function(e4, t3) { const r4 = e4._ownerReadableStream; @@ -5209,7 +5541,7 @@ var init_ponyfill = __esm({ }(this); } }; - Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n2(ReadableStreamDefaultReader.prototype.cancel, "cancel"), n2(ReadableStreamDefaultReader.prototype.read, "read"), n2(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, e2.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true }); + Object.defineProperties(ReadableStreamDefaultReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n(ReadableStreamDefaultReader.prototype.cancel, "cancel"), n(ReadableStreamDefaultReader.prototype.read, "read"), n(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamDefaultReader.prototype, e2.toStringTag, { value: "ReadableStreamDefaultReader", configurable: true }); te = class { constructor(e3, t2) { this._ongoingPromise = void 0, this._isFinished = false, this._reader = e3, this._preventCancel = t2; @@ -5245,7 +5577,7 @@ var init_ponyfill = __esm({ const r3 = t2.cancel(e3); return t2.releaseLock(), p3(r3, () => ({ value: e3, done: true })); } - return t2.releaseLock(), c4({ value: e3, done: true }); + return t2.releaseLock(), c2({ value: e3, done: true }); } }; re2 = { next() { @@ -5307,12 +5639,12 @@ var init_ponyfill = __esm({ throw new RangeError("The buffer of view has different capacity than byobRequest"); if (r3.bytesFilled + t2.byteLength > r3.byteLength) throw new RangeError("The region specified by view is larger than byobRequest"); - const o4 = t2.byteLength; - r3.buffer = t2.buffer, qe(e4, o4); + const o3 = t2.byteLength; + r3.buffer = t2.buffer, qe(e4, o3); }(this._associatedReadableByteStreamController, e3); } }; - Object.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), n2(ReadableStreamBYOBRequest.prototype.respond, "respond"), n2(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamBYOBRequest.prototype, e2.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true }); + Object.defineProperties(ReadableStreamBYOBRequest.prototype, { respond: { enumerable: true }, respondWithNewView: { enumerable: true }, view: { enumerable: true } }), n(ReadableStreamBYOBRequest.prototype.respond, "respond"), n(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamBYOBRequest.prototype, e2.toStringTag, { value: "ReadableStreamBYOBRequest", configurable: true }); ReadableByteStreamController = class { constructor() { throw new TypeError("Illegal constructor"); @@ -5322,10 +5654,10 @@ var init_ponyfill = __esm({ throw Ae("byobRequest"); return function(e3) { if (null === e3._byobRequest && e3._pendingPullIntos.length > 0) { - const t2 = e3._pendingPullIntos.peek(), r3 = new Uint8Array(t2.buffer, t2.byteOffset + t2.bytesFilled, t2.byteLength - t2.bytesFilled), o4 = Object.create(ReadableStreamBYOBRequest.prototype); + const t2 = e3._pendingPullIntos.peek(), r3 = new Uint8Array(t2.buffer, t2.byteOffset + t2.bytesFilled, t2.byteLength - t2.bytesFilled), o3 = Object.create(ReadableStreamBYOBRequest.prototype); !function(e4, t3, r4) { e4._associatedReadableByteStreamController = t3, e4._view = r4; - }(o4, e3, r3), e3._byobRequest = o4; + }(o3, e3, r3), e3._byobRequest = o3; } return e3._byobRequest; }(this); @@ -5376,7 +5708,7 @@ var init_ponyfill = __esm({ const r3 = e4._controlledReadableByteStream; if (e4._closeRequested || "readable" !== r3._state) return; - const o4 = t3.buffer, n3 = t3.byteOffset, a5 = t3.byteLength, i4 = o4; + const o3 = t3.buffer, n2 = t3.byteOffset, a4 = t3.byteLength, i3 = o3; if (e4._pendingPullIntos.length > 0) { const t4 = e4._pendingPullIntos.peek(); t4.buffer, 0, Re(e4), t4.buffer = t4.buffer, "none" === t4.readerType && ge(e4, t4); @@ -5390,13 +5722,13 @@ var init_ponyfill = __esm({ We(e5, t4._readRequests.shift()); } }(e4), 0 === X4(r3)) - me(e4, i4, n3, a5); + me(e4, i3, n2, a4); else { e4._pendingPullIntos.length > 0 && Ce(e4); - G5(r3, new Uint8Array(i4, n3, a5), false); + G5(r3, new Uint8Array(i3, n2, a4), false); } else - Le(r3) ? (me(e4, i4, n3, a5), Te(e4)) : me(e4, i4, n3, a5); + Le(r3) ? (me(e4, i3, n2, a4), Te(e4)) : me(e4, i3, n2, a4); be(e4); }(this, e3); } @@ -5422,8 +5754,8 @@ var init_ponyfill = __esm({ } catch (t4) { return void e3._errorSteps(t4); } - const o4 = { buffer: t3, bufferByteLength: r3, byteOffset: 0, byteLength: r3, bytesFilled: 0, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" }; - this._pendingPullIntos.push(o4); + const o3 = { buffer: t3, bufferByteLength: r3, byteOffset: 0, byteLength: r3, bytesFilled: 0, elementSize: 1, viewConstructor: Uint8Array, readerType: "default" }; + this._pendingPullIntos.push(o3); } U6(t2, e3), be(this); } @@ -5434,7 +5766,7 @@ var init_ponyfill = __esm({ } } }; - Object.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), n2(ReadableByteStreamController.prototype.close, "close"), n2(ReadableByteStreamController.prototype.enqueue, "enqueue"), n2(ReadableByteStreamController.prototype.error, "error"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableByteStreamController.prototype, e2.toStringTag, { value: "ReadableByteStreamController", configurable: true }); + Object.defineProperties(ReadableByteStreamController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, byobRequest: { enumerable: true }, desiredSize: { enumerable: true } }), n(ReadableByteStreamController.prototype.close, "close"), n(ReadableByteStreamController.prototype.enqueue, "enqueue"), n(ReadableByteStreamController.prototype.error, "error"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableByteStreamController.prototype, e2.toStringTag, { value: "ReadableByteStreamController", configurable: true }); ReadableStreamBYOBReader = class { constructor(e3) { if ($5(e3, 1, "ReadableStreamBYOBReader"), V5(e3, "First parameter"), Ut(e3)) @@ -5461,19 +5793,19 @@ var init_ponyfill = __esm({ if (e3.buffer, void 0 === this._ownerReadableStream) return d6(k6("read from")); let t2, r3; - const o4 = u3((e4, o5) => { - t2 = e4, r3 = o5; + const o3 = u2((e4, o4) => { + t2 = e4, r3 = o4; }); return function(e4, t3, r4) { - const o5 = e4._ownerReadableStream; - o5._disturbed = true, "errored" === o5._state ? r4._errorSteps(o5._storedError) : function(e5, t4, r5) { - const o6 = e5._controlledReadableByteStream; - let n3 = 1; - t4.constructor !== DataView && (n3 = t4.constructor.BYTES_PER_ELEMENT); - const a5 = t4.constructor, i4 = t4.buffer, l3 = { buffer: i4, bufferByteLength: i4.byteLength, byteOffset: t4.byteOffset, byteLength: t4.byteLength, bytesFilled: 0, elementSize: n3, viewConstructor: a5, readerType: "byob" }; + const o4 = e4._ownerReadableStream; + o4._disturbed = true, "errored" === o4._state ? r4._errorSteps(o4._storedError) : function(e5, t4, r5) { + const o5 = e5._controlledReadableByteStream; + let n2 = 1; + t4.constructor !== DataView && (n2 = t4.constructor.BYTES_PER_ELEMENT); + const a4 = t4.constructor, i3 = t4.buffer, l3 = { buffer: i3, bufferByteLength: i3.byteLength, byteOffset: t4.byteOffset, byteLength: t4.byteLength, bytesFilled: 0, elementSize: n2, viewConstructor: a4, readerType: "byob" }; if (e5._pendingPullIntos.length > 0) - return e5._pendingPullIntos.push(l3), void je(o6, r5); - if ("closed" !== o6._state) { + return e5._pendingPullIntos.push(l3), void je(o5, r5); + if ("closed" !== o5._state) { if (e5._queueTotalSize > 0) { if (we(e5, l3)) { const t5 = pe(l3); @@ -5484,13 +5816,13 @@ var init_ponyfill = __esm({ return Pe(e5, t5), void r5._errorSteps(t5); } } - e5._pendingPullIntos.push(l3), je(o6, r5), be(e5); + e5._pendingPullIntos.push(l3), je(o5, r5), be(e5); } else { - const e6 = new a5(l3.buffer, l3.byteOffset, 0); + const e6 = new a4(l3.buffer, l3.byteOffset, 0); r5._closeSteps(e6); } - }(o5._readableStreamController, t3, r4); - }(this, e3, { _chunkSteps: (e4) => t2({ value: e4, done: false }), _closeSteps: (e4) => t2({ value: e4, done: true }), _errorSteps: (e4) => r3(e4) }), o4; + }(o4._readableStreamController, t3, r4); + }(this, e3, { _chunkSteps: (e4) => t2({ value: e4, done: false }), _closeSteps: (e4) => t2({ value: e4, done: true }), _errorSteps: (e4) => r3(e4) }), o3; } releaseLock() { if (!Fe(this)) @@ -5502,40 +5834,40 @@ var init_ponyfill = __esm({ }(this); } }; - Object.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n2(ReadableStreamBYOBReader.prototype.cancel, "cancel"), n2(ReadableStreamBYOBReader.prototype.read, "read"), n2(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamBYOBReader.prototype, e2.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true }); + Object.defineProperties(ReadableStreamBYOBReader.prototype, { cancel: { enumerable: true }, read: { enumerable: true }, releaseLock: { enumerable: true }, closed: { enumerable: true } }), n(ReadableStreamBYOBReader.prototype.cancel, "cancel"), n(ReadableStreamBYOBReader.prototype.read, "read"), n(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamBYOBReader.prototype, e2.toStringTag, { value: "ReadableStreamBYOBReader", configurable: true }); Ue = "function" == typeof AbortController; WritableStream = class { constructor(e3 = {}, t2 = {}) { void 0 === e3 ? e3 = null : D4(e3, "First parameter"); - const r3 = Ye(t2, "Second parameter"), o4 = function(e4, t3) { + const r3 = Ye(t2, "Second parameter"), o3 = function(e4, t3) { F4(e4, t3); - const r4 = null == e4 ? void 0 : e4.abort, o5 = null == e4 ? void 0 : e4.close, n4 = null == e4 ? void 0 : e4.start, a6 = null == e4 ? void 0 : e4.type, i4 = null == e4 ? void 0 : e4.write; - return { abort: void 0 === r4 ? void 0 : Ne(r4, e4, `${t3} has member 'abort' that`), close: void 0 === o5 ? void 0 : He(o5, e4, `${t3} has member 'close' that`), start: void 0 === n4 ? void 0 : xe(n4, e4, `${t3} has member 'start' that`), write: void 0 === i4 ? void 0 : Ve(i4, e4, `${t3} has member 'write' that`), type: a6 }; + const r4 = null == e4 ? void 0 : e4.abort, o4 = null == e4 ? void 0 : e4.close, n3 = null == e4 ? void 0 : e4.start, a5 = null == e4 ? void 0 : e4.type, i3 = null == e4 ? void 0 : e4.write; + return { abort: void 0 === r4 ? void 0 : Ne(r4, e4, `${t3} has member 'abort' that`), close: void 0 === o4 ? void 0 : He(o4, e4, `${t3} has member 'close' that`), start: void 0 === n3 ? void 0 : xe(n3, e4, `${t3} has member 'start' that`), write: void 0 === i3 ? void 0 : Ve(i3, e4, `${t3} has member 'write' that`), type: a5 }; }(e3, "First parameter"); - var n3; - (n3 = this)._state = "writable", n3._storedError = void 0, n3._writer = void 0, n3._writableStreamController = void 0, n3._writeRequests = new S5(), n3._inFlightWriteRequest = void 0, n3._closeRequest = void 0, n3._inFlightCloseRequest = void 0, n3._pendingAbortRequest = void 0, n3._backpressure = false; - if (void 0 !== o4.type) + var n2; + (n2 = this)._state = "writable", n2._storedError = void 0, n2._writer = void 0, n2._writableStreamController = void 0, n2._writeRequests = new S5(), n2._inFlightWriteRequest = void 0, n2._closeRequest = void 0, n2._inFlightCloseRequest = void 0, n2._pendingAbortRequest = void 0, n2._backpressure = false; + if (void 0 !== o3.type) throw new RangeError("Invalid type is specified"); - const a5 = Me(r3); - !function(e4, t3, r4, o5) { - const n4 = Object.create(WritableStreamDefaultController.prototype); - let a6, i4, l3, s2; - a6 = void 0 !== t3.start ? () => t3.start(n4) : () => { + const a4 = Me(r3); + !function(e4, t3, r4, o4) { + const n3 = Object.create(WritableStreamDefaultController.prototype); + let a5, i3, l3, s2; + a5 = void 0 !== t3.start ? () => t3.start(n3) : () => { }; - i4 = void 0 !== t3.write ? (e5) => t3.write(e5, n4) : () => c4(void 0); - l3 = void 0 !== t3.close ? () => t3.close() : () => c4(void 0); - s2 = void 0 !== t3.abort ? (e5) => t3.abort(e5) : () => c4(void 0); - !function(e5, t4, r5, o6, n5, a7, i5, l4) { + i3 = void 0 !== t3.write ? (e5) => t3.write(e5, n3) : () => c2(void 0); + l3 = void 0 !== t3.close ? () => t3.close() : () => c2(void 0); + s2 = void 0 !== t3.abort ? (e5) => t3.abort(e5) : () => c2(void 0); + !function(e5, t4, r5, o5, n4, a6, i4, l4) { t4._controlledWritableStream = e5, e5._writableStreamController = t4, t4._queue = void 0, t4._queueTotalSize = void 0, ce2(t4), t4._abortReason = void 0, t4._abortController = function() { if (Ue) return new AbortController(); - }(), t4._started = false, t4._strategySizeAlgorithm = l4, t4._strategyHWM = i5, t4._writeAlgorithm = o6, t4._closeAlgorithm = n5, t4._abortAlgorithm = a7; + }(), t4._started = false, t4._strategySizeAlgorithm = l4, t4._strategyHWM = i4, t4._writeAlgorithm = o5, t4._closeAlgorithm = n4, t4._abortAlgorithm = a6; const s3 = bt(t4); nt(e5, s3); - const u4 = r5(); - b6(c4(u4), () => (t4._started = true, dt(t4), null), (r6) => (t4._started = true, Ze(e5, r6), null)); - }(e4, n4, a6, i4, l3, s2, r4, o5); - }(this, o4, $e(r3, 1), a5); + const u3 = r5(); + b6(c2(u3), () => (t4._started = true, dt(t4), null), (r6) => (t4._started = true, Ze(e5, r6), null)); + }(e4, n3, a5, i3, l3, s2, r4, o4); + }(this, o3, $e(r3, 1), a4); } get locked() { if (!Ge(this)) @@ -5554,7 +5886,7 @@ var init_ponyfill = __esm({ return new WritableStreamDefaultWriter(this); } }; - Object.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), n2(WritableStream.prototype.abort, "abort"), n2(WritableStream.prototype.close, "close"), n2(WritableStream.prototype.getWriter, "getWriter"), "symbol" == typeof e2.toStringTag && Object.defineProperty(WritableStream.prototype, e2.toStringTag, { value: "WritableStream", configurable: true }); + Object.defineProperties(WritableStream.prototype, { abort: { enumerable: true }, close: { enumerable: true }, getWriter: { enumerable: true }, locked: { enumerable: true } }), n(WritableStream.prototype.abort, "abort"), n(WritableStream.prototype.close, "close"), n(WritableStream.prototype.getWriter, "getWriter"), "symbol" == typeof e2.toStringTag && Object.defineProperty(WritableStream.prototype, e2.toStringTag, { value: "WritableStream", configurable: true }); WritableStreamDefaultWriter = class { constructor(e3) { if ($5(e3, 1, "WritableStreamDefaultWriter"), function(e4, t3) { @@ -5621,26 +5953,26 @@ var init_ponyfill = __esm({ } write(e3) { return at(this) ? void 0 === this._ownerWritableStream ? d6(yt("write to")) : function(e4, t2) { - const r3 = e4._ownerWritableStream, o4 = r3._writableStreamController, n3 = function(e5, t3) { + const r3 = e4._ownerWritableStream, o3 = r3._writableStreamController, n2 = function(e5, t3) { try { return e5._strategySizeAlgorithm(t3); } catch (t4) { return ft(e5, t4), 1; } - }(o4, t2); + }(o3, t2); if (r3 !== e4._ownerWritableStream) return d6(yt("write to")); - const a5 = r3._state; - if ("errored" === a5) + const a4 = r3._state; + if ("errored" === a4) return d6(r3._storedError); - if (rt(r3) || "closed" === a5) + if (rt(r3) || "closed" === a4) return d6(new TypeError("The stream is closing or closed and cannot be written to")); - if ("erroring" === a5) + if ("erroring" === a4) return d6(r3._storedError); - const i4 = function(e5) { - return u3((t3, r4) => { - const o5 = { _resolve: t3, _reject: r4 }; - e5._writeRequests.push(o5); + const i3 = function(e5) { + return u2((t3, r4) => { + const o4 = { _resolve: t3, _reject: r4 }; + e5._writeRequests.push(o4); }); }(r3); return function(e5, t3, r4) { @@ -5649,16 +5981,16 @@ var init_ponyfill = __esm({ } catch (t4) { return void ft(e5, t4); } - const o5 = e5._controlledWritableStream; - if (!rt(o5) && "writable" === o5._state) { - nt(o5, bt(e5)); + const o4 = e5._controlledWritableStream; + if (!rt(o4) && "writable" === o4._state) { + nt(o4, bt(e5)); } dt(e5); - }(o4, t2, n3), i4; + }(o3, t2, n2), i3; }(this, e3) : d6(mt("write")); } }; - Object.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), n2(WritableStreamDefaultWriter.prototype.abort, "abort"), n2(WritableStreamDefaultWriter.prototype.close, "close"), n2(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"), n2(WritableStreamDefaultWriter.prototype.write, "write"), "symbol" == typeof e2.toStringTag && Object.defineProperty(WritableStreamDefaultWriter.prototype, e2.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true }); + Object.defineProperties(WritableStreamDefaultWriter.prototype, { abort: { enumerable: true }, close: { enumerable: true }, releaseLock: { enumerable: true }, write: { enumerable: true }, closed: { enumerable: true }, desiredSize: { enumerable: true }, ready: { enumerable: true } }), n(WritableStreamDefaultWriter.prototype.abort, "abort"), n(WritableStreamDefaultWriter.prototype.close, "close"), n(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock"), n(WritableStreamDefaultWriter.prototype.write, "write"), "symbol" == typeof e2.toStringTag && Object.defineProperty(WritableStreamDefaultWriter.prototype, e2.toStringTag, { value: "WritableStreamDefaultWriter", configurable: true }); lt = {}; WritableStreamDefaultController = class { constructor() { @@ -5774,23 +6106,23 @@ var init_ponyfill = __esm({ [C4]() { } }; - Object.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), n2(ReadableStreamDefaultController.prototype.close, "close"), n2(ReadableStreamDefaultController.prototype.enqueue, "enqueue"), n2(ReadableStreamDefaultController.prototype.error, "error"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamDefaultController.prototype, e2.toStringTag, { value: "ReadableStreamDefaultController", configurable: true }); + Object.defineProperties(ReadableStreamDefaultController.prototype, { close: { enumerable: true }, enqueue: { enumerable: true }, error: { enumerable: true }, desiredSize: { enumerable: true } }), n(ReadableStreamDefaultController.prototype.close, "close"), n(ReadableStreamDefaultController.prototype.enqueue, "enqueue"), n(ReadableStreamDefaultController.prototype.error, "error"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStreamDefaultController.prototype, e2.toStringTag, { value: "ReadableStreamDefaultController", configurable: true }); ReadableStream3 = class { constructor(e3 = {}, t2 = {}) { void 0 === e3 ? e3 = null : D4(e3, "First parameter"); - const r3 = Ye(t2, "Second parameter"), o4 = function(e4, t3) { + const r3 = Ye(t2, "Second parameter"), o3 = function(e4, t3) { F4(e4, t3); - const r4 = e4, o5 = null == r4 ? void 0 : r4.autoAllocateChunkSize, n4 = null == r4 ? void 0 : r4.cancel, a5 = null == r4 ? void 0 : r4.pull, i4 = null == r4 ? void 0 : r4.start, l3 = null == r4 ? void 0 : r4.type; - return { autoAllocateChunkSize: void 0 === o5 ? void 0 : N5(o5, `${t3} has member 'autoAllocateChunkSize' that`), cancel: void 0 === n4 ? void 0 : $t(n4, r4, `${t3} has member 'cancel' that`), pull: void 0 === a5 ? void 0 : Mt(a5, r4, `${t3} has member 'pull' that`), start: void 0 === i4 ? void 0 : Yt(i4, r4, `${t3} has member 'start' that`), type: void 0 === l3 ? void 0 : Qt(l3, `${t3} has member 'type' that`) }; + const r4 = e4, o4 = null == r4 ? void 0 : r4.autoAllocateChunkSize, n3 = null == r4 ? void 0 : r4.cancel, a4 = null == r4 ? void 0 : r4.pull, i3 = null == r4 ? void 0 : r4.start, l3 = null == r4 ? void 0 : r4.type; + return { autoAllocateChunkSize: void 0 === o4 ? void 0 : N5(o4, `${t3} has member 'autoAllocateChunkSize' that`), cancel: void 0 === n3 ? void 0 : $t(n3, r4, `${t3} has member 'cancel' that`), pull: void 0 === a4 ? void 0 : Mt(a4, r4, `${t3} has member 'pull' that`), start: void 0 === i3 ? void 0 : Yt(i3, r4, `${t3} has member 'start' that`), type: void 0 === l3 ? void 0 : Qt(l3, `${t3} has member 'type' that`) }; }(e3, "First parameter"); - var n3; - if ((n3 = this)._state = "readable", n3._reader = void 0, n3._storedError = void 0, n3._disturbed = false, "bytes" === o4.type) { + var n2; + if ((n2 = this)._state = "readable", n2._reader = void 0, n2._storedError = void 0, n2._disturbed = false, "bytes" === o3.type) { if (void 0 !== r3.size) throw new RangeError("The strategy for a byte stream cannot have a size function"); - Oe(this, o4, $e(r3, 0)); + Oe(this, o3, $e(r3, 0)); } else { const e4 = Me(r3); - It(this, o4, $e(r3, 1), e4); + It(this, o3, $e(r3, 1), e4); } } get locked() { @@ -5816,12 +6148,12 @@ var init_ponyfill = __esm({ if (!H4(this)) throw Kt("pipeThrough"); $5(e3, 1, "pipeThrough"); - const r3 = xt(e3, "First parameter"), o4 = Ht(t2, "Second parameter"); + const r3 = xt(e3, "First parameter"), o3 = Ht(t2, "Second parameter"); if (this.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream"); if (r3.writable.locked) throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream"); - return m4(kt(this, r3.writable, o4.preventClose, o4.preventAbort, o4.preventCancel, o4.signal)), r3.readable; + return m4(kt(this, r3.writable, o3.preventClose, o3.preventAbort, o3.preventCancel, o3.signal)), r3.readable; } pipeTo(e3, t2 = {}) { if (!H4(this)) @@ -5849,8 +6181,8 @@ var init_ponyfill = __esm({ if (!H4(this)) throw Kt("values"); return function(e4, t2) { - const r3 = e4.getReader(), o4 = new te(r3, t2), n3 = Object.create(re2); - return n3._asyncIteratorImpl = o4, n3; + const r3 = e4.getReader(), o3 = new te(r3, t2), n2 = Object.create(re2); + return n2._asyncIteratorImpl = o3, n2; }(this, function(e4, t2) { F4(e4, t2); const r3 = null == e4 ? void 0 : e4.preventCancel; @@ -5858,9 +6190,9 @@ var init_ponyfill = __esm({ }(e3, "First parameter").preventCancel); } }; - Object.defineProperties(ReadableStream3.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), n2(ReadableStream3.prototype.cancel, "cancel"), n2(ReadableStream3.prototype.getReader, "getReader"), n2(ReadableStream3.prototype.pipeThrough, "pipeThrough"), n2(ReadableStream3.prototype.pipeTo, "pipeTo"), n2(ReadableStream3.prototype.tee, "tee"), n2(ReadableStream3.prototype.values, "values"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStream3.prototype, e2.toStringTag, { value: "ReadableStream", configurable: true }), "symbol" == typeof e2.asyncIterator && Object.defineProperty(ReadableStream3.prototype, e2.asyncIterator, { value: ReadableStream3.prototype.values, writable: true, configurable: true }); + Object.defineProperties(ReadableStream3.prototype, { cancel: { enumerable: true }, getReader: { enumerable: true }, pipeThrough: { enumerable: true }, pipeTo: { enumerable: true }, tee: { enumerable: true }, values: { enumerable: true }, locked: { enumerable: true } }), n(ReadableStream3.prototype.cancel, "cancel"), n(ReadableStream3.prototype.getReader, "getReader"), n(ReadableStream3.prototype.pipeThrough, "pipeThrough"), n(ReadableStream3.prototype.pipeTo, "pipeTo"), n(ReadableStream3.prototype.tee, "tee"), n(ReadableStream3.prototype.values, "values"), "symbol" == typeof e2.toStringTag && Object.defineProperty(ReadableStream3.prototype, e2.toStringTag, { value: "ReadableStream", configurable: true }), "symbol" == typeof e2.asyncIterator && Object.defineProperty(ReadableStream3.prototype, e2.asyncIterator, { value: ReadableStream3.prototype.values, writable: true, configurable: true }); er = (e3) => e3.byteLength; - n2(er, "size"); + n(er, "size"); ByteLengthQueuingStrategy = class { constructor(e3) { $5(e3, 1, "ByteLengthQueuingStrategy"), e3 = Zt(e3, "First parameter"), this._byteLengthQueuingStrategyHighWaterMark = e3.highWaterMark; @@ -5878,8 +6210,8 @@ var init_ponyfill = __esm({ }; Object.defineProperties(ByteLengthQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof e2.toStringTag && Object.defineProperty(ByteLengthQueuingStrategy.prototype, e2.toStringTag, { value: "ByteLengthQueuingStrategy", configurable: true }); or = () => 1; - n2(or, "size"); - CountQueuingStrategy2 = class { + n(or, "size"); + CountQueuingStrategy = class { constructor(e3) { $5(e3, 1, "CountQueuingStrategy"), e3 = Zt(e3, "First parameter"), this._countQueuingStrategyHighWaterMark = e3.highWaterMark; } @@ -5894,23 +6226,23 @@ var init_ponyfill = __esm({ return or; } }; - Object.defineProperties(CountQueuingStrategy2.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof e2.toStringTag && Object.defineProperty(CountQueuingStrategy2.prototype, e2.toStringTag, { value: "CountQueuingStrategy", configurable: true }); + Object.defineProperties(CountQueuingStrategy.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }), "symbol" == typeof e2.toStringTag && Object.defineProperty(CountQueuingStrategy.prototype, e2.toStringTag, { value: "CountQueuingStrategy", configurable: true }); TransformStream2 = class { constructor(e3 = {}, t2 = {}, r3 = {}) { void 0 === e3 && (e3 = null); - const o4 = Ye(t2, "Second parameter"), n3 = Ye(r3, "Third parameter"), a5 = function(e4, t3) { + const o3 = Ye(t2, "Second parameter"), n2 = Ye(r3, "Third parameter"), a4 = function(e4, t3) { F4(e4, t3); - const r4 = null == e4 ? void 0 : e4.flush, o5 = null == e4 ? void 0 : e4.readableType, n4 = null == e4 ? void 0 : e4.start, a6 = null == e4 ? void 0 : e4.transform, i5 = null == e4 ? void 0 : e4.writableType; - return { flush: void 0 === r4 ? void 0 : ir(r4, e4, `${t3} has member 'flush' that`), readableType: o5, start: void 0 === n4 ? void 0 : lr(n4, e4, `${t3} has member 'start' that`), transform: void 0 === a6 ? void 0 : sr(a6, e4, `${t3} has member 'transform' that`), writableType: i5 }; + const r4 = null == e4 ? void 0 : e4.flush, o4 = null == e4 ? void 0 : e4.readableType, n3 = null == e4 ? void 0 : e4.start, a5 = null == e4 ? void 0 : e4.transform, i4 = null == e4 ? void 0 : e4.writableType; + return { flush: void 0 === r4 ? void 0 : ir(r4, e4, `${t3} has member 'flush' that`), readableType: o4, start: void 0 === n3 ? void 0 : lr(n3, e4, `${t3} has member 'start' that`), transform: void 0 === a5 ? void 0 : sr(a5, e4, `${t3} has member 'transform' that`), writableType: i4 }; }(e3, "First parameter"); - if (void 0 !== a5.readableType) + if (void 0 !== a4.readableType) throw new RangeError("Invalid readableType specified"); - if (void 0 !== a5.writableType) + if (void 0 !== a4.writableType) throw new RangeError("Invalid writableType specified"); - const i4 = $e(n3, 0), l3 = Me(n3), s2 = $e(o4, 1), f4 = Me(o4); + const i3 = $e(n2, 0), l3 = Me(n2), s2 = $e(o3, 1), f4 = Me(o3); let b7; - !function(e4, t3, r4, o5, n4, a6) { - function i5() { + !function(e4, t3, r4, o4, n3, a5) { + function i4() { return t3; } function l4(t4) { @@ -5928,10 +6260,10 @@ var init_ponyfill = __esm({ } function s3(t4) { return function(e5, t5) { - return cr(e5, t5), c4(void 0); + return cr(e5, t5), c2(void 0); }(e4, t4); } - function u4() { + function u3() { return function(e5) { const t4 = e5._transformStreamController, r5 = t4._flushAlgorithm(); return hr(t4), p3(r5, () => { @@ -5949,9 +6281,9 @@ var init_ponyfill = __esm({ }(e4); } function f5(t4) { - return dr(e4, t4), c4(void 0); + return dr(e4, t4), c2(void 0); } - e4._writableState = "writable", e4._writableStoredError = void 0, e4._writableHasInFlightOperation = false, e4._writableStarted = false, e4._writable = function(e5, t4, r5, o6, n5, a7, i6) { + e4._writableState = "writable", e4._writableStoredError = void 0, e4._writableHasInFlightOperation = false, e4._writableStarted = false, e4._writable = function(e5, t4, r5, o5, n4, a6, i5) { return new WritableStream({ start(r6) { e5._writableController = r6; try { @@ -5974,7 +6306,7 @@ var init_ponyfill = __esm({ }(e5, t6), t6; })), close: () => (function(e6) { e6._writableHasInFlightOperation = true; - }(e5), p3(o6(), () => (function(e6) { + }(e5), p3(o5(), () => (function(e6) { e6._writableHasInFlightOperation = false; "erroring" === e6._writableState && (e6._writableStoredError = void 0); e6._writableState = "closed"; @@ -5982,31 +6314,31 @@ var init_ponyfill = __esm({ throw function(e6, t6) { e6._writableHasInFlightOperation = false, e6._writableState, Rr(e6, t6); }(e5, t5), t5; - })), abort: (t5) => (e5._writableState = "errored", e5._writableStoredError = t5, n5(t5)) }, { highWaterMark: a7, size: i6 }); - }(e4, i5, l4, u4, s3, r4, o5), e4._readableState = "readable", e4._readableStoredError = void 0, e4._readableCloseRequested = false, e4._readablePulling = false, e4._readable = function(e5, t4, r5, o6, n5, a7) { + })), abort: (t5) => (e5._writableState = "errored", e5._writableStoredError = t5, n4(t5)) }, { highWaterMark: a6, size: i5 }); + }(e4, i4, l4, u3, s3, r4, o4), e4._readableState = "readable", e4._readableStoredError = void 0, e4._readableCloseRequested = false, e4._readablePulling = false, e4._readable = function(e5, t4, r5, o5, n4, a6) { return new ReadableStream3({ start: (r6) => (e5._readableController = r6, t4().catch((t5) => { Sr(e5, t5); })), pull: () => (e5._readablePulling = true, r5().catch((t5) => { Sr(e5, t5); - })), cancel: (t5) => (e5._readableState = "closed", o6(t5)) }, { highWaterMark: n5, size: a7 }); - }(e4, i5, d7, f5, n4, a6), e4._backpressure = void 0, e4._backpressureChangePromise = void 0, e4._backpressureChangePromise_resolve = void 0, fr(e4, true), e4._transformStreamController = void 0; - }(this, u3((e4) => { + })), cancel: (t5) => (e5._readableState = "closed", o5(t5)) }, { highWaterMark: n4, size: a6 }); + }(e4, i4, d7, f5, n3, a5), e4._backpressure = void 0, e4._backpressureChangePromise = void 0, e4._backpressureChangePromise_resolve = void 0, fr(e4, true), e4._transformStreamController = void 0; + }(this, u2((e4) => { b7 = e4; - }), s2, f4, i4, l3), function(e4, t3) { + }), s2, f4, i3, l3), function(e4, t3) { const r4 = Object.create(TransformStreamDefaultController.prototype); - let o5, n4; - o5 = void 0 !== t3.transform ? (e5) => t3.transform(e5, r4) : (e5) => { + let o4, n3; + o4 = void 0 !== t3.transform ? (e5) => t3.transform(e5, r4) : (e5) => { try { - return _r(r4, e5), c4(void 0); + return _r(r4, e5), c2(void 0); } catch (e6) { return d6(e6); } }; - n4 = void 0 !== t3.flush ? () => t3.flush(r4) : () => c4(void 0); - !function(e5, t4, r5, o6) { - t4._controlledTransformStream = e5, e5._transformStreamController = t4, t4._transformAlgorithm = r5, t4._flushAlgorithm = o6; - }(e4, r4, o5, n4); - }(this, a5), void 0 !== a5.start ? b7(a5.start(this._transformStreamController)) : b7(void 0); + n3 = void 0 !== t3.flush ? () => t3.flush(r4) : () => c2(void 0); + !function(e5, t4, r5, o5) { + t4._controlledTransformStream = e5, e5._transformStreamController = t4, t4._transformAlgorithm = r5, t4._flushAlgorithm = o5; + }(e4, r4, o4, n3); + }(this, a4), void 0 !== a4.start ? b7(a4.start(this._transformStreamController)) : b7(void 0); } get readable() { if (!ur(this)) @@ -6051,7 +6383,7 @@ var init_ponyfill = __esm({ }(this); } }; - Object.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), n2(TransformStreamDefaultController.prototype.enqueue, "enqueue"), n2(TransformStreamDefaultController.prototype.error, "error"), n2(TransformStreamDefaultController.prototype.terminate, "terminate"), "symbol" == typeof e2.toStringTag && Object.defineProperty(TransformStreamDefaultController.prototype, e2.toStringTag, { value: "TransformStreamDefaultController", configurable: true }); + Object.defineProperties(TransformStreamDefaultController.prototype, { enqueue: { enumerable: true }, error: { enumerable: true }, terminate: { enumerable: true }, desiredSize: { enumerable: true } }), n(TransformStreamDefaultController.prototype.enqueue, "enqueue"), n(TransformStreamDefaultController.prototype.error, "error"), n(TransformStreamDefaultController.prototype.terminate, "terminate"), "symbol" == typeof e2.toStringTag && Object.defineProperty(TransformStreamDefaultController.prototype, e2.toStringTag, { value: "TransformStreamDefaultController", configurable: true }); } }); @@ -6321,8 +6653,8 @@ var require_ms = __commonJS({ "node_modules/ms/index.js"(exports, module2) { var s2 = 1e3; var m5 = s2 * 60; - var h5 = m5 * 60; - var d7 = h5 * 24; + var h4 = m5 * 60; + var d7 = h4 * 24; var w7 = d7 * 7; var y6 = d7 * 365.25; module2.exports = function(val, options) { @@ -6348,7 +6680,7 @@ var require_ms = __commonJS({ if (!match) { return; } - var n3 = parseFloat(match[1]); + var n2 = parseFloat(match[1]); var type2 = (match[2] || "ms").toLowerCase(); switch (type2) { case "years": @@ -6356,39 +6688,39 @@ var require_ms = __commonJS({ case "yrs": case "yr": case "y": - return n3 * y6; + return n2 * y6; case "weeks": case "week": case "w": - return n3 * w7; + return n2 * w7; case "days": case "day": case "d": - return n3 * d7; + return n2 * d7; case "hours": case "hour": case "hrs": case "hr": case "h": - return n3 * h5; + return n2 * h4; case "minutes": case "minute": case "mins": case "min": case "m": - return n3 * m5; + return n2 * m5; case "seconds": case "second": case "secs": case "sec": case "s": - return n3 * s2; + return n2 * s2; case "milliseconds": case "millisecond": case "msecs": case "msec": case "ms": - return n3; + return n2; default: return void 0; } @@ -6398,8 +6730,8 @@ var require_ms = __commonJS({ if (msAbs >= d7) { return Math.round(ms / d7) + "d"; } - if (msAbs >= h5) { - return Math.round(ms / h5) + "h"; + if (msAbs >= h4) { + return Math.round(ms / h4) + "h"; } if (msAbs >= m5) { return Math.round(ms / m5) + "m"; @@ -6414,8 +6746,8 @@ var require_ms = __commonJS({ if (msAbs >= d7) { return plural(ms, msAbs, d7, "day"); } - if (msAbs >= h5) { - return plural(ms, msAbs, h5, "hour"); + if (msAbs >= h4) { + return plural(ms, msAbs, h4, "hour"); } if (msAbs >= m5) { return plural(ms, msAbs, m5, "minute"); @@ -6425,9 +6757,9 @@ var require_ms = __commonJS({ } return ms + " ms"; } - function plural(ms, msAbs, n3, name) { - var isPlural = msAbs >= n3 * 1.5; - return Math.round(ms / n3) + " " + name + (isPlural ? "s" : ""); + function plural(ms, msAbs, n2, name) { + var isPlural = msAbs >= n2 * 1.5; + return Math.round(ms / n2) + " " + name + (isPlural ? "s" : ""); } } }); @@ -6673,9 +7005,9 @@ var require_agent = __commonJS({ errorSocketCount: this.errorSocketCount, timeoutSocketCount: this.timeoutSocketCount, requestCount: this.requestCount, - freeSockets: inspect5(this.freeSockets), - sockets: inspect5(this.sockets), - requests: inspect5(this.requests) + freeSockets: inspect3(this.freeSockets), + sockets: inspect3(this.sockets), + requests: inspect3(this.requests) }; } }; @@ -6789,7 +7121,7 @@ var require_agent = __commonJS({ socket.on("agentRemove", onRemove); } module2.exports = Agent3; - function inspect5(obj) { + function inspect3(obj) { const res = {}; for (const key in obj) { res[key] = obj[key].length; @@ -6902,8 +7234,8 @@ var require_event_target_shim = __commonJS({ }); Object.defineProperty(this, "isTrusted", { value: false, enumerable: true }); const keys = Object.keys(event); - for (let i4 = 0; i4 < keys.length; ++i4) { - const key = keys[i4]; + for (let i3 = 0; i3 < keys.length; ++i3) { + const key = keys[i3]; if (!(key in this)) { Object.defineProperty(this, key, defineRedirectDescriptor(key)); } @@ -7043,8 +7375,8 @@ var require_event_target_shim = __commonJS({ CustomEvent.prototype = Object.create(BaseEvent.prototype, { constructor: { value: CustomEvent, configurable: true, writable: true } }); - for (let i4 = 0; i4 < keys.length; ++i4) { - const key = keys[i4]; + for (let i3 = 0; i3 < keys.length; ++i3) { + const key = keys[i3]; if (!(key in BaseEvent.prototype)) { const descriptor = Object.getOwnPropertyDescriptor(proto2, key); const isFunc = typeof descriptor.value === "function"; @@ -7088,7 +7420,7 @@ var require_event_target_shim = __commonJS({ var CAPTURE = 1; var BUBBLE = 2; var ATTRIBUTE = 3; - function isObject4(x5) { + function isObject3(x5) { return x5 !== null && typeof x5 === "object"; } function getListeners(eventTarget) { @@ -7114,7 +7446,7 @@ var require_event_target_shim = __commonJS({ return null; }, set(listener) { - if (typeof listener !== "function" && !isObject4(listener)) { + if (typeof listener !== "function" && !isObject3(listener)) { listener = null; } const listeners = getListeners(this); @@ -7171,8 +7503,8 @@ var require_event_target_shim = __commonJS({ writable: true } }); - for (let i4 = 0; i4 < eventNames.length; ++i4) { - defineEventAttribute(CustomEventTarget.prototype, eventNames[i4]); + for (let i3 = 0; i3 < eventNames.length; ++i3) { + defineEventAttribute(CustomEventTarget.prototype, eventNames[i3]); } return CustomEventTarget; } @@ -7186,8 +7518,8 @@ var require_event_target_shim = __commonJS({ } if (arguments.length > 0) { const types = new Array(arguments.length); - for (let i4 = 0; i4 < arguments.length; ++i4) { - types[i4] = arguments[i4]; + for (let i3 = 0; i3 < arguments.length; ++i3) { + types[i3] = arguments[i3]; } return defineCustomEventTarget(types); } @@ -7198,11 +7530,11 @@ var require_event_target_shim = __commonJS({ if (listener == null) { return; } - if (typeof listener !== "function" && !isObject4(listener)) { + if (typeof listener !== "function" && !isObject3(listener)) { throw new TypeError("'listener' should be a function or an object."); } const listeners = getListeners(this); - const optionsIsObj = isObject4(options); + const optionsIsObj = isObject3(options); const capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; const newNode = { @@ -7232,7 +7564,7 @@ var require_event_target_shim = __commonJS({ return; } const listeners = getListeners(this); - const capture = isObject4(options) ? Boolean(options.capture) : Boolean(options); + const capture = isObject3(options) ? Boolean(options.capture) : Boolean(options); const listenerType = capture ? CAPTURE : BUBBLE; let prev = null; let node = listeners.get(eventName); @@ -7330,11 +7662,11 @@ var require_abort_controller = __commonJS({ throw new TypeError("AbortSignal cannot be constructed directly"); } get aborted() { - const aborted2 = abortedFlags.get(this); - if (typeof aborted2 !== "boolean") { + const aborted = abortedFlags.get(this); + if (typeof aborted !== "boolean") { throw new TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this === null ? "null" : typeof this}`); } - return aborted2; + return aborted; } }; eventTargetShim.defineEventAttribute(AbortSignal.prototype, "abort"); @@ -7363,7 +7695,7 @@ var require_abort_controller = __commonJS({ } var AbortController2 = class { constructor() { - signals2.set(this, createAbortSignal()); + signals.set(this, createAbortSignal()); } get signal() { return getSignal(this); @@ -7372,9 +7704,9 @@ var require_abort_controller = __commonJS({ abortSignal(getSignal(this)); } }; - var signals2 = /* @__PURE__ */ new WeakMap(); + var signals = /* @__PURE__ */ new WeakMap(); function getSignal(controller) { - const signal = signals2.get(controller); + const signal = signals.get(controller); if (signal == null) { throw new TypeError(`Expected 'this' to be an 'AbortController' object, but got ${controller === null ? "null" : typeof controller}`); } @@ -7402,17 +7734,17 @@ var require_abort_controller = __commonJS({ // node_modules/web-streams-polyfill/dist/ponyfill.es2018.js var require_ponyfill_es2018 = __commonJS({ "node_modules/web-streams-polyfill/dist/ponyfill.es2018.js"(exports, module2) { - (function(global3, factory) { - typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global3 = typeof globalThis !== "undefined" ? globalThis : global3 || self, factory(global3.WebStreamsPolyfill = {})); + (function(global2, factory) { + typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.WebStreamsPolyfill = {})); })(exports, function(exports2) { "use strict"; - function noop4() { + function noop2() { return void 0; } function typeIsObject(x5) { return typeof x5 === "object" && x5 !== null || typeof x5 === "function"; } - const rethrowAssertionErrorRejection = noop4; + const rethrowAssertionErrorRejection = noop2; function setFunctionName(fn, name) { try { Object.defineProperty(fn, "name", { @@ -7526,20 +7858,20 @@ var require_ponyfill_es2018 = __commonJS({ return element; } forEach(callback) { - let i4 = this._cursor; + let i3 = this._cursor; let node = this._front; let elements = node._elements; - while (i4 !== elements.length || node._next !== void 0) { - if (i4 === elements.length) { + while (i3 !== elements.length || node._next !== void 0) { + if (i3 === elements.length) { node = node._next; elements = node._elements; - i4 = 0; + i3 = 0; if (elements.length === 0) { break; } } - callback(elements[i4]); - ++i4; + callback(elements[i3]); + ++i3; } } peek() { @@ -7635,11 +7967,11 @@ var require_ponyfill_es2018 = __commonJS({ throw new TypeError(`${context} is not a function.`); } } - function isObject4(x5) { + function isObject3(x5) { return typeof x5 === "object" && x5 !== null || typeof x5 === "function"; } function assertObject(x5, context) { - if (!isObject4(x5)) { + if (!isObject3(x5)) { throw new TypeError(`${context} is not an object.`); } } @@ -7928,8 +8260,8 @@ var require_ponyfill_es2018 = __commonJS({ function CreateArrayFromList(elements) { return elements.slice(); } - function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n3) { - new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n3), destOffset); + function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n2) { + new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n2), destOffset); } let TransferArrayBuffer = (O5) => { if (typeof O5.transfer === "function") { @@ -9885,7 +10217,7 @@ var require_ponyfill_es2018 = __commonJS({ return newPromise((resolveRead, rejectRead) => { ReadableStreamDefaultReaderRead(reader, { _chunkSteps: (chunk) => { - currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), void 0, noop4); + currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, chunk), void 0, noop2); resolveRead(false); }, _closeSteps: () => resolveRead(true), @@ -10552,7 +10884,7 @@ var require_ponyfill_es2018 = __commonJS({ function ReadableStreamFromIterable(asyncIterable) { let stream4; const iteratorRecord = GetIterator(asyncIterable, "async"); - const startAlgorithm = noop4; + const startAlgorithm = noop2; function pullAlgorithm() { let nextResult; try { @@ -10604,7 +10936,7 @@ var require_ponyfill_es2018 = __commonJS({ } function ReadableStreamFromDefaultReader(reader) { let stream4; - const startAlgorithm = noop4; + const startAlgorithm = noop2; function pullAlgorithm() { let readPromise; try { @@ -10697,13 +11029,13 @@ var require_ponyfill_es2018 = __commonJS({ } function convertReadableWritablePair(pair, context) { assertDictionary(pair, context); - const readable2 = pair === null || pair === void 0 ? void 0 : pair.readable; - assertRequiredField(readable2, "readable", "ReadableWritablePair"); - assertReadableStream(readable2, `${context} has member 'readable' that`); - const writable2 = pair === null || pair === void 0 ? void 0 : pair.writable; - assertRequiredField(writable2, "writable", "ReadableWritablePair"); - assertWritableStream(writable2, `${context} has member 'writable' that`); - return { readable: readable2, writable: writable2 }; + const readable = pair === null || pair === void 0 ? void 0 : pair.readable; + assertRequiredField(readable, "readable", "ReadableWritablePair"); + assertReadableStream(readable, `${context} has member 'readable' that`); + const writable = pair === null || pair === void 0 ? void 0 : pair.writable; + assertRequiredField(writable, "writable", "ReadableWritablePair"); + assertWritableStream(writable, `${context} has member 'writable' that`); + return { readable, writable }; } class ReadableStream7 { constructor(rawUnderlyingSource = {}, rawStrategy = {}) { @@ -10897,7 +11229,7 @@ var require_ponyfill_es2018 = __commonJS({ }); } const sourceCancelPromise = stream4._readableStreamController[CancelSteps](reason); - return transformPromiseWith(sourceCancelPromise, noop4); + return transformPromiseWith(sourceCancelPromise, noop2); } function ReadableStreamClose(stream4) { stream4._state = "closed"; @@ -10988,7 +11320,7 @@ var require_ponyfill_es2018 = __commonJS({ return 1; }; setFunctionName(countSizeFunction, "size"); - class CountQueuingStrategy3 { + class CountQueuingStrategy2 { constructor(options) { assertRequiredArgument(options, 1, "CountQueuingStrategy"); options = convertQueuingStrategyInit(options, "First parameter"); @@ -11007,12 +11339,12 @@ var require_ponyfill_es2018 = __commonJS({ return countSizeFunction; } } - Object.defineProperties(CountQueuingStrategy3.prototype, { + Object.defineProperties(CountQueuingStrategy2.prototype, { highWaterMark: { enumerable: true }, size: { enumerable: true } }); if (typeof Symbol.toStringTag === "symbol") { - Object.defineProperty(CountQueuingStrategy3.prototype, Symbol.toStringTag, { + Object.defineProperty(CountQueuingStrategy2.prototype, Symbol.toStringTag, { value: "CountQueuingStrategy", configurable: true }); @@ -11027,7 +11359,7 @@ var require_ponyfill_es2018 = __commonJS({ if (!Object.prototype.hasOwnProperty.call(x5, "_countQueuingStrategyHighWaterMark")) { return false; } - return x5 instanceof CountQueuingStrategy3; + return x5 instanceof CountQueuingStrategy2; } function convertTransformer(original, context) { assertDictionary(original, context); @@ -11311,10 +11643,10 @@ var require_ponyfill_es2018 = __commonJS({ if (stream4._backpressure) { const backpressureChangePromise = stream4._backpressureChangePromise; return transformPromiseWith(backpressureChangePromise, () => { - const writable2 = stream4._writable; - const state2 = writable2._state; + const writable = stream4._writable; + const state2 = writable._state; if (state2 === "erroring") { - throw writable2._storedError; + throw writable._storedError; } return TransformStreamDefaultControllerPerformTransform(controller, chunk); }); @@ -11326,7 +11658,7 @@ var require_ponyfill_es2018 = __commonJS({ if (controller._finishPromise !== void 0) { return controller._finishPromise; } - const readable2 = stream4._readable; + const readable = stream4._readable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; @@ -11334,15 +11666,15 @@ var require_ponyfill_es2018 = __commonJS({ const cancelPromise = controller._cancelAlgorithm(reason); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(cancelPromise, () => { - if (readable2._state === "errored") { - defaultControllerFinishPromiseReject(controller, readable2._storedError); + if (readable._state === "errored") { + defaultControllerFinishPromiseReject(controller, readable._storedError); } else { - ReadableStreamDefaultControllerError(readable2._readableStreamController, reason); + ReadableStreamDefaultControllerError(readable._readableStreamController, reason); defaultControllerFinishPromiseResolve(controller); } return null; }, (r3) => { - ReadableStreamDefaultControllerError(readable2._readableStreamController, r3); + ReadableStreamDefaultControllerError(readable._readableStreamController, r3); defaultControllerFinishPromiseReject(controller, r3); return null; }); @@ -11353,7 +11685,7 @@ var require_ponyfill_es2018 = __commonJS({ if (controller._finishPromise !== void 0) { return controller._finishPromise; } - const readable2 = stream4._readable; + const readable = stream4._readable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; @@ -11361,15 +11693,15 @@ var require_ponyfill_es2018 = __commonJS({ const flushPromise = controller._flushAlgorithm(); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(flushPromise, () => { - if (readable2._state === "errored") { - defaultControllerFinishPromiseReject(controller, readable2._storedError); + if (readable._state === "errored") { + defaultControllerFinishPromiseReject(controller, readable._storedError); } else { - ReadableStreamDefaultControllerClose(readable2._readableStreamController); + ReadableStreamDefaultControllerClose(readable._readableStreamController); defaultControllerFinishPromiseResolve(controller); } return null; }, (r3) => { - ReadableStreamDefaultControllerError(readable2._readableStreamController, r3); + ReadableStreamDefaultControllerError(readable._readableStreamController, r3); defaultControllerFinishPromiseReject(controller, r3); return null; }); @@ -11384,7 +11716,7 @@ var require_ponyfill_es2018 = __commonJS({ if (controller._finishPromise !== void 0) { return controller._finishPromise; } - const writable2 = stream4._writable; + const writable = stream4._writable; controller._finishPromise = newPromise((resolve, reject) => { controller._finishPromise_resolve = resolve; controller._finishPromise_reject = reject; @@ -11392,16 +11724,16 @@ var require_ponyfill_es2018 = __commonJS({ const cancelPromise = controller._cancelAlgorithm(reason); TransformStreamDefaultControllerClearAlgorithms(controller); uponPromise(cancelPromise, () => { - if (writable2._state === "errored") { - defaultControllerFinishPromiseReject(controller, writable2._storedError); + if (writable._state === "errored") { + defaultControllerFinishPromiseReject(controller, writable._storedError); } else { - WritableStreamDefaultControllerErrorIfNeeded(writable2._writableStreamController, reason); + WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason); TransformStreamUnblockWrite(stream4); defaultControllerFinishPromiseResolve(controller); } return null; }, (r3) => { - WritableStreamDefaultControllerErrorIfNeeded(writable2._writableStreamController, r3); + WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r3); TransformStreamUnblockWrite(stream4); defaultControllerFinishPromiseReject(controller, r3); return null; @@ -11432,7 +11764,7 @@ var require_ponyfill_es2018 = __commonJS({ return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`); } exports2.ByteLengthQueuingStrategy = ByteLengthQueuingStrategy2; - exports2.CountQueuingStrategy = CountQueuingStrategy3; + exports2.CountQueuingStrategy = CountQueuingStrategy2; exports2.ReadableByteStreamController = ReadableByteStreamController2; exports2.ReadableStream = ReadableStream7; exports2.ReadableStreamBYOBReader = ReadableStreamBYOBReader2; @@ -11464,7 +11796,7 @@ var require_node_domexception = __commonJS({ }); // node_modules/formdata-node/lib/esm/isPlainObject.js -function isPlainObject3(value) { +function isPlainObject2(value) { if (getType2(value) !== "object") { return false; } @@ -11479,7 +11811,7 @@ var getType2, isPlainObject_default2; var init_isPlainObject = __esm({ "node_modules/formdata-node/lib/esm/isPlainObject.js"() { getType2 = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); - isPlainObject_default2 = isPlainObject3; + isPlainObject_default2 = isPlainObject2; } }); @@ -11490,14 +11822,14 @@ __export(fileFromPath_exports, { fileFromPathSync: () => fileFromPathSync, isFile: () => isFile }); -function createFileFromPath(path7, { mtimeMs, size }, filenameOrOptions, options = {}) { +function createFileFromPath(path5, { mtimeMs, size }, filenameOrOptions, options = {}) { let filename; if (isPlainObject_default2(filenameOrOptions)) { [options, filename] = [filenameOrOptions, void 0]; } else { filename = filenameOrOptions; } - const file = new FileFromPath({ path: path7, size, lastModified: mtimeMs }); + const file = new FileFromPath({ path: path5, size, lastModified: mtimeMs }); if (!filename) { filename = file.name; } @@ -11506,13 +11838,13 @@ function createFileFromPath(path7, { mtimeMs, size }, filenameOrOptions, options lastModified: file.lastModified }); } -function fileFromPathSync(path7, filenameOrOptions, options = {}) { - const stats = (0, import_fs2.statSync)(path7); - return createFileFromPath(path7, stats, filenameOrOptions, options); +function fileFromPathSync(path5, filenameOrOptions, options = {}) { + const stats = (0, import_fs2.statSync)(path5); + return createFileFromPath(path5, stats, filenameOrOptions, options); } -async function fileFromPath2(path7, filenameOrOptions, options) { - const stats = await import_fs2.promises.stat(path7); - return createFileFromPath(path7, stats, filenameOrOptions, options); +async function fileFromPath2(path5, filenameOrOptions, options) { + const stats = await import_fs2.promises.stat(path5); + return createFileFromPath(path5, stats, filenameOrOptions, options); } var import_fs2, import_path2, import_node_domexception, __classPrivateFieldSet4, __classPrivateFieldGet5, _FileFromPath_path, _FileFromPath_start, MESSAGE, FileFromPath; var init_fileFromPath = __esm({ @@ -11749,8 +12081,8 @@ var require_combined_stream = __commonJS({ this._pipeNext(stream4); return; } - var getStream2 = stream4; - getStream2(function(stream5) { + var getStream3 = stream4; + getStream3(function(stream5) { var isStreamLike = CombinedStream.isStreamLike(stream5); if (isStreamLike) { stream5.on("data", this._checkDataSize.bind(this)); @@ -20427,11 +20759,11 @@ var require_mime_types = __commonJS({ } return exts[0]; } - function lookup(path7) { - if (!path7 || typeof path7 !== "string") { + function lookup(path5) { + if (!path5 || typeof path5 !== "string") { return false; } - var extension2 = extname("x." + path7).toLowerCase().substr(1); + var extension2 = extname("x." + path5).toLowerCase().substr(1); if (!extension2) { return false; } @@ -20446,8 +20778,8 @@ var require_mime_types = __commonJS({ return; } extensions[type2] = exts; - for (var i4 = 0; i4 < exts.length; i4++) { - var extension2 = exts[i4]; + for (var i3 = 0; i3 < exts.length; i3++) { + var extension2 = exts[i3]; if (types[extension2]) { var from = preference.indexOf(db[types[extension2]].source); var to = preference.indexOf(mime.source); @@ -20562,8 +20894,8 @@ var require_state = __commonJS({ size: isNamedList ? Object.keys(list).length : list.length }; if (sortMethod) { - initState.keyedList.sort(isNamedList ? sortMethod : function(a5, b7) { - return sortMethod(list[a5], list[b7]); + initState.keyedList.sort(isNamedList ? sortMethod : function(a4, b7) { + return sortMethod(list[a4], list[b7]); }); } return initState; @@ -20640,11 +20972,11 @@ var require_serialOrdered = __commonJS({ }); return terminator.bind(state2, callback); } - function ascending(a5, b7) { - return a5 < b7 ? -1 : a5 > b7 ? 1 : 0; + function ascending(a4, b7) { + return a4 < b7 ? -1 : a4 > b7 ? 1 : 0; } - function descending(a5, b7) { - return -1 * ascending(a5, b7); + function descending(a4, b7) { + return -1 * ascending(a4, b7); } } }); @@ -20688,11 +21020,11 @@ var require_form_data = __commonJS({ "node_modules/form-data/lib/form_data.js"(exports, module2) { var CombinedStream = require_combined_stream(); var util3 = require("util"); - var path7 = require("path"); + var path5 = require("path"); var http3 = require("http"); var https3 = require("https"); var parseUrl = require("url").parse; - var fs6 = require("fs"); + var fs7 = require("fs"); var Stream3 = require("stream").Stream; var mime = require_mime_types(); var asynckit = require_asynckit(); @@ -20757,7 +21089,7 @@ var require_form_data = __commonJS({ if (value.end != void 0 && value.end != Infinity && value.start != void 0) { callback(null, value.end + 1 - (value.start ? value.start : 0)); } else { - fs6.stat(value.path, function(err, stat) { + fs7.stat(value.path, function(err, stat) { var fileSize; if (err) { callback(err); @@ -20813,11 +21145,11 @@ var require_form_data = __commonJS({ FormData6.prototype._getContentDisposition = function(value, options) { var filename, contentDisposition; if (typeof options.filepath === "string") { - filename = path7.normalize(options.filepath).replace(/\\/g, "/"); + filename = path5.normalize(options.filepath).replace(/\\/g, "/"); } else if (options.filename || value.name || value.path) { - filename = path7.basename(options.filename || value.name || value.path); + filename = path5.basename(options.filename || value.name || value.path); } else if (value.readable && value.hasOwnProperty("httpVersion")) { - filename = path7.basename(value.client._httpMessage.path || ""); + filename = path5.basename(value.client._httpMessage.path || ""); } if (filename) { contentDisposition = 'filename="' + filename + '"'; @@ -20880,14 +21212,14 @@ var require_form_data = __commonJS({ FormData6.prototype.getBuffer = function() { var dataBuffer = new Buffer.alloc(0); var boundary = this.getBoundary(); - for (var i4 = 0, len = this._streams.length; i4 < len; i4++) { - if (typeof this._streams[i4] !== "function") { - if (Buffer.isBuffer(this._streams[i4])) { - dataBuffer = Buffer.concat([dataBuffer, this._streams[i4]]); + for (var i3 = 0, len = this._streams.length; i3 < len; i3++) { + if (typeof this._streams[i3] !== "function") { + if (Buffer.isBuffer(this._streams[i3])) { + dataBuffer = Buffer.concat([dataBuffer, this._streams[i3]]); } else { - dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i4])]); + dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i3])]); } - if (typeof this._streams[i4] !== "string" || this._streams[i4].substring(2, boundary.length + 2) !== boundary) { + if (typeof this._streams[i3] !== "string" || this._streams[i3].substring(2, boundary.length + 2) !== boundary) { dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData6.LINE_BREAK)]); } } @@ -20896,7 +21228,7 @@ var require_form_data = __commonJS({ }; FormData6.prototype._generateBoundary = function() { var boundary = "--------------------------"; - for (var i4 = 0; i4 < 24; i4++) { + for (var i3 = 0; i3 < 24; i3++) { boundary += Math.floor(Math.random() * 10).toString(16); } this._boundary = boundary; @@ -21086,8 +21418,8 @@ var require_common = __commonJS({ createDebug.formatters = {}; function selectColor(namespace) { let hash = 0; - for (let i4 = 0; i4 < namespace.length; i4++) { - hash = (hash << 5) - hash + namespace.charCodeAt(i4); + for (let i3 = 0; i3 < namespace.length; i3++) { + hash = (hash << 5) - hash + namespace.charCodeAt(i3); hash |= 0; } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; @@ -21114,12 +21446,12 @@ var require_common = __commonJS({ args.unshift("%O"); } let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format2) => { + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { if (match === "%%") { return "%"; } index++; - const formatter = createDebug.formatters[format2]; + const formatter = createDebug.formatters[format]; if (typeof formatter === "function") { const val = args[index]; match = formatter.call(self2, val); @@ -21169,14 +21501,14 @@ var require_common = __commonJS({ createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; - let i4; + let i3; const split = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/); const len = split.length; - for (i4 = 0; i4 < len; i4++) { - if (!split[i4]) { + for (i3 = 0; i3 < len; i3++) { + if (!split[i3]) { continue; } - namespaces = split[i4].replace(/\*/g, ".*?"); + namespaces = split[i3].replace(/\*/g, ".*?"); if (namespaces[0] === "-") { createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$")); } else { @@ -21196,15 +21528,15 @@ var require_common = __commonJS({ if (name[name.length - 1] === "*") { return true; } - let i4; + let i3; let len; - for (i4 = 0, len = createDebug.skips.length; i4 < len; i4++) { - if (createDebug.skips[i4].test(name)) { + for (i3 = 0, len = createDebug.skips.length; i3 < len; i3++) { + if (createDebug.skips[i3].test(name)) { return false; } } - for (i4 = 0, len = createDebug.names.length; i4 < len; i4++) { - if (createDebug.names[i4].test(name)) { + for (i3 = 0, len = createDebug.names.length; i3 < len; i3++) { + if (createDebug.names[i3].test(name)) { return true; } } @@ -21234,7 +21566,7 @@ var require_browser = __commonJS({ "node_modules/debug/src/browser.js"(exports, module2) { exports.formatArgs = formatArgs; exports.save = save; - exports.load = load2; + exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = (() => { @@ -21338,8 +21670,8 @@ var require_browser = __commonJS({ if (!this.useColors) { return; } - const c5 = "color: " + this.color; - args.splice(1, 0, c5, "color: inherit"); + const c3 = "color: " + this.color; + args.splice(1, 0, c3, "color: inherit"); let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, (match) => { @@ -21351,7 +21683,7 @@ var require_browser = __commonJS({ lastC = index; } }); - args.splice(lastC, 0, c5); + args.splice(lastC, 0, c3); } exports.log = console.debug || console.log || (() => { }); @@ -21365,7 +21697,7 @@ var require_browser = __commonJS({ } catch (error) { } } - function load2() { + function load() { let r3; try { r3 = exports.storage.getItem("debug"); @@ -21411,8 +21743,8 @@ var require_has_flag = __commonJS({ var require_supports_color = __commonJS({ "node_modules/supports-color/index.js"(exports, module2) { "use strict"; - var os3 = require("os"); - var tty4 = require("tty"); + var os4 = require("os"); + var tty2 = require("tty"); var hasFlag2 = require_has_flag(); var { env: env2 } = process; var forceColor; @@ -21459,7 +21791,7 @@ var require_supports_color = __commonJS({ return min; } if (process.platform === "win32") { - const osRelease = os3.release().split("."); + const osRelease = os4.release().split("."); if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { return Number(osRelease[2]) >= 14931 ? 3 : 2; } @@ -21503,8 +21835,8 @@ var require_supports_color = __commonJS({ } module2.exports = { supportsColor: getSupportLevel, - stdout: translateLevel2(supportsColor2(true, tty4.isatty(1))), - stderr: translateLevel2(supportsColor2(true, tty4.isatty(2))) + stdout: translateLevel2(supportsColor2(true, tty2.isatty(1))), + stderr: translateLevel2(supportsColor2(true, tty2.isatty(2))) }; } }); @@ -21512,13 +21844,13 @@ var require_supports_color = __commonJS({ // node_modules/debug/src/node.js var require_node = __commonJS({ "node_modules/debug/src/node.js"(exports, module2) { - var tty4 = require("tty"); + var tty2 = require("tty"); var util3 = require("util"); exports.init = init; exports.log = log2; exports.formatArgs = formatArgs; exports.save = save; - exports.load = load2; + exports.load = load; exports.useColors = useColors; exports.destroy = util3.deprecate( () => { @@ -21630,13 +21962,13 @@ var require_node = __commonJS({ return obj; }, {}); function useColors() { - return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty4.isatty(process.stderr.fd); + return "colors" in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty2.isatty(process.stderr.fd); } function formatArgs(args) { const { namespace: name, useColors: useColors2 } = this; if (useColors2) { - const c5 = this.color; - const colorCode = "\x1B[3" + (c5 < 8 ? c5 : "8;5;" + c5); + const c3 = this.color; + const colorCode = "\x1B[3" + (c3 < 8 ? c3 : "8;5;" + c3); const prefix = ` ${colorCode};1m${name} \x1B[0m`; args[0] = prefix + args[0].split("\n").join("\n" + prefix); args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m"); @@ -21660,14 +21992,14 @@ var require_node = __commonJS({ delete process.env.DEBUG; } } - function load2() { + function load() { return process.env.DEBUG; } function init(debug3) { debug3.inspectOpts = {}; const keys = Object.keys(exports.inspectOpts); - for (let i4 = 0; i4 < keys.length; i4++) { - debug3.inspectOpts[keys[i4]] = exports.inspectOpts[keys[i4]]; + for (let i3 = 0; i3 < keys.length; i3++) { + debug3.inspectOpts[keys[i3]] = exports.inspectOpts[keys[i3]]; } } module2.exports = require_common()(exports); @@ -21721,7 +22053,7 @@ var require_follow_redirects = __commonJS({ var URL2 = url2.URL; var http3 = require("http"); var https3 = require("https"); - var Writable4 = require("stream").Writable; + var Writable = require("stream").Writable; var assert = require("assert"); var debug3 = require_debug(); var useNativeURL = false; @@ -21772,9 +22104,9 @@ var require_follow_redirects = __commonJS({ "ERR_STREAM_WRITE_AFTER_END", "write after end" ); - var destroy2 = Writable4.prototype.destroy || noop4; + var destroy2 = Writable.prototype.destroy || noop2; function RedirectableRequest(options, responseCallback) { - Writable4.call(this); + Writable.call(this); this._sanitizeOptions(options); this._options = options; this._ended = false; @@ -21796,7 +22128,7 @@ var require_follow_redirects = __commonJS({ }; this._performRequest(); } - RedirectableRequest.prototype = Object.create(Writable4.prototype); + RedirectableRequest.prototype = Object.create(Writable.prototype); RedirectableRequest.prototype.abort = function() { destroyRequest(this._currentRequest); this._currentRequest.abort(); @@ -21916,8 +22248,8 @@ var require_follow_redirects = __commonJS({ "setNoDelay", "setSocketKeepAlive" ].forEach(function(method) { - RedirectableRequest.prototype[method] = function(a5, b7) { - return this._currentRequest[method](a5, b7); + RedirectableRequest.prototype[method] = function(a4, b7) { + return this._currentRequest[method](a4, b7); }; }); ["aborted", "connection", "socket"].forEach(function(property) { @@ -21964,15 +22296,15 @@ var require_follow_redirects = __commonJS({ } this._currentUrl = /^\//.test(this._options.path) ? url2.format(this._options) : this._options.path; if (this._isRedirect) { - var i4 = 0; + var i3 = 0; var self2 = this; var buffers = this._requestBodyBuffers; (function writeNext(error) { if (request3 === self2._currentRequest) { if (error) { self2.emit("error", error); - } else if (i4 < buffers.length) { - var buffer = buffers[i4++]; + } else if (i3 < buffers.length) { + var buffer = buffers[i3++]; if (!request3.finished) { request3.write(buffer.data, buffer.encoding, writeNext); } @@ -22092,7 +22424,7 @@ var require_follow_redirects = __commonJS({ }); return exports2; } - function noop4() { + function noop2() { } function parseUrl(input) { var parsed; @@ -22166,7 +22498,7 @@ var require_follow_redirects = __commonJS({ for (var event of events) { request3.removeListener(event, eventHandlers[event]); } - request3.on("error", noop4); + request3.on("error", noop2); request3.destroy(error); } function isSubdomain(subdomain, domain) { @@ -22516,13 +22848,13 @@ var require_tiktoken = __commonJS({ var wasm = require_tiktoken_bg(); var imports = {}; imports["./tiktoken_bg.js"] = wasm; - var path7 = require("path"); - var fs6 = require("fs"); - var candidates = __dirname.split(path7.sep).reduce((memo, _7, index, array) => { - const prefix = array.slice(0, index + 1).join(path7.sep) + path7.sep; - if (!prefix.includes("node_modules" + path7.sep)) { + var path5 = require("path"); + var fs7 = require("fs"); + var candidates = __dirname.split(path5.sep).reduce((memo, _7, index, array) => { + const prefix = array.slice(0, index + 1).join(path5.sep) + path5.sep; + if (!prefix.includes("node_modules" + path5.sep)) { memo.unshift( - path7.join( + path5.join( prefix, "node_modules", "tiktoken", @@ -22533,11 +22865,11 @@ var require_tiktoken = __commonJS({ } return memo; }, []); - candidates.unshift(path7.join(__dirname, "./tiktoken_bg.wasm")); + candidates.unshift(path5.join(__dirname, "./tiktoken_bg.wasm")); var bytes = null; for (const candidate of candidates) { try { - bytes = fs6.readFileSync(candidate); + bytes = fs7.readFileSync(candidate); break; } catch { } @@ -22626,8 +22958,8 @@ var require_tslib = __commonJS({ d7.prototype = b7 === null ? Object.create(b7) : (__.prototype = b7.prototype, new __()); }; __assign2 = Object.assign || function(t2) { - for (var s2, i4 = 1, n3 = arguments.length; i4 < n3; i4++) { - s2 = arguments[i4]; + for (var s2, i3 = 1, n2 = arguments.length; i3 < n2; i3++) { + s2 = arguments[i3]; for (var p4 in s2) if (Object.prototype.hasOwnProperty.call(s2, p4)) t2[p4] = s2[p4]; @@ -22640,21 +22972,21 @@ var require_tslib = __commonJS({ if (Object.prototype.hasOwnProperty.call(s2, p4) && e3.indexOf(p4) < 0) t2[p4] = s2[p4]; if (s2 != null && typeof Object.getOwnPropertySymbols === "function") - for (var i4 = 0, p4 = Object.getOwnPropertySymbols(s2); i4 < p4.length; i4++) { - if (e3.indexOf(p4[i4]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p4[i4])) - t2[p4[i4]] = s2[p4[i4]]; + for (var i3 = 0, p4 = Object.getOwnPropertySymbols(s2); i3 < p4.length; i3++) { + if (e3.indexOf(p4[i3]) < 0 && Object.prototype.propertyIsEnumerable.call(s2, p4[i3])) + t2[p4[i3]] = s2[p4[i3]]; } return t2; }; __decorate2 = function(decorators, target, key, desc) { - var c5 = arguments.length, r3 = c5 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; + var c3 = arguments.length, r3 = c3 < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d7; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r3 = Reflect.decorate(decorators, target, key, desc); else - for (var i4 = decorators.length - 1; i4 >= 0; i4--) - if (d7 = decorators[i4]) - r3 = (c5 < 3 ? d7(r3) : c5 > 3 ? d7(target, key, r3) : d7(target, key)) || r3; - return c5 > 3 && r3 && Object.defineProperty(target, key, r3), r3; + for (var i3 = decorators.length - 1; i3 >= 0; i3--) + if (d7 = decorators[i3]) + r3 = (c3 < 3 ? d7(r3) : c3 > 3 ? d7(target, key, r3) : d7(target, key)) || r3; + return c3 > 3 && r3 && Object.defineProperty(target, key, r3), r3; }; __param2 = function(paramIndex, decorator) { return function(target, key) { @@ -22671,7 +23003,7 @@ var require_tslib = __commonJS({ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _7, done = false; - for (var i4 = decorators.length - 1; i4 >= 0; i4--) { + for (var i3 = decorators.length - 1; i3 >= 0; i3--) { var context = {}; for (var p4 in contextIn) context[p4] = p4 === "access" ? {} : contextIn[p4]; @@ -22682,7 +23014,7 @@ var require_tslib = __commonJS({ throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f4 || null)); }; - var result = (0, decorators[i4])(kind3 === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); + var result = (0, decorators[i3])(kind3 === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind3 === "accessor") { if (result === void 0) continue; @@ -22707,8 +23039,8 @@ var require_tslib = __commonJS({ }; __runInitializers2 = function(thisArg, initializers, value) { var useValue = arguments.length > 2; - for (var i4 = 0; i4 < initializers.length; i4++) { - value = useValue ? initializers[i4].call(thisArg, value) : initializers[i4].call(thisArg); + for (var i3 = 0; i3 < initializers.length; i3++) { + value = useValue ? initializers[i3].call(thisArg, value) : initializers[i3].call(thisArg); } return useValue ? value : void 0; }; @@ -22760,9 +23092,9 @@ var require_tslib = __commonJS({ return g4 = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g4[Symbol.iterator] = function() { return this; }), g4; - function verb(n3) { + function verb(n2) { return function(v5) { - return step([n3, v5]); + return step([n2, v5]); }; } function step(op) { @@ -22827,12 +23159,12 @@ var require_tslib = __commonJS({ return { value: op[0] ? op[1] : void 0, done: true }; } }; - __exportStar2 = function(m5, o4) { + __exportStar2 = function(m5, o3) { for (var p4 in m5) - if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(o4, p4)) - __createBinding2(o4, m5, p4); + if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(o3, p4)) + __createBinding2(o3, m5, p4); }; - __createBinding2 = Object.create ? function(o4, m5, k7, k22) { + __createBinding2 = Object.create ? function(o3, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -22841,40 +23173,40 @@ var require_tslib = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o4, k22, desc); - } : function(o4, m5, k7, k22) { + Object.defineProperty(o3, k22, desc); + } : function(o3, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o4[k22] = m5[k7]; + o3[k22] = m5[k7]; }; - __values2 = function(o4) { - var s2 = typeof Symbol === "function" && Symbol.iterator, m5 = s2 && o4[s2], i4 = 0; + __values2 = function(o3) { + var s2 = typeof Symbol === "function" && Symbol.iterator, m5 = s2 && o3[s2], i3 = 0; if (m5) - return m5.call(o4); - if (o4 && typeof o4.length === "number") + return m5.call(o3); + if (o3 && typeof o3.length === "number") return { next: function() { - if (o4 && i4 >= o4.length) - o4 = void 0; - return { value: o4 && o4[i4++], done: !o4 }; + if (o3 && i3 >= o3.length) + o3 = void 0; + return { value: o3 && o3[i3++], done: !o3 }; } }; throw new TypeError(s2 ? "Object is not iterable." : "Symbol.iterator is not defined."); }; - __read2 = function(o4, n3) { - var m5 = typeof Symbol === "function" && o4[Symbol.iterator]; + __read2 = function(o3, n2) { + var m5 = typeof Symbol === "function" && o3[Symbol.iterator]; if (!m5) - return o4; - var i4 = m5.call(o4), r3, ar2 = [], e3; + return o3; + var i3 = m5.call(o3), r3, ar2 = [], e3; try { - while ((n3 === void 0 || n3-- > 0) && !(r3 = i4.next()).done) + while ((n2 === void 0 || n2-- > 0) && !(r3 = i3.next()).done) ar2.push(r3.value); } catch (error) { e3 = { error }; } finally { try { - if (r3 && !r3.done && (m5 = i4["return"])) - m5.call(i4); + if (r3 && !r3.done && (m5 = i3["return"])) + m5.call(i3); } finally { if (e3) throw e3.error; @@ -22883,25 +23215,25 @@ var require_tslib = __commonJS({ return ar2; }; __spread2 = function() { - for (var ar2 = [], i4 = 0; i4 < arguments.length; i4++) - ar2 = ar2.concat(__read2(arguments[i4])); + for (var ar2 = [], i3 = 0; i3 < arguments.length; i3++) + ar2 = ar2.concat(__read2(arguments[i3])); return ar2; }; __spreadArrays2 = function() { - for (var s2 = 0, i4 = 0, il = arguments.length; i4 < il; i4++) - s2 += arguments[i4].length; - for (var r3 = Array(s2), k7 = 0, i4 = 0; i4 < il; i4++) - for (var a5 = arguments[i4], j4 = 0, jl = a5.length; j4 < jl; j4++, k7++) - r3[k7] = a5[j4]; + for (var s2 = 0, i3 = 0, il = arguments.length; i3 < il; i3++) + s2 += arguments[i3].length; + for (var r3 = Array(s2), k7 = 0, i3 = 0; i3 < il; i3++) + for (var a4 = arguments[i3], j4 = 0, jl = a4.length; j4 < jl; j4++, k7++) + r3[k7] = a4[j4]; return r3; }; __spreadArray2 = function(to, from, pack) { if (pack || arguments.length === 2) - for (var i4 = 0, l3 = from.length, ar2; i4 < l3; i4++) { - if (ar2 || !(i4 in from)) { + for (var i3 = 0, l3 = from.length, ar2; i3 < l3; i3++) { + if (ar2 || !(i3 in from)) { if (!ar2) - ar2 = Array.prototype.slice.call(from, 0, i4); - ar2[i4] = from[i4]; + ar2 = Array.prototype.slice.call(from, 0, i3); + ar2[i3] = from[i3]; } } return to.concat(ar2 || Array.prototype.slice.call(from)); @@ -22912,21 +23244,21 @@ var require_tslib = __commonJS({ __asyncGenerator3 = function(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g4 = generator.apply(thisArg, _arguments || []), i4, q6 = []; - return i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { + var g4 = generator.apply(thisArg, _arguments || []), i3, q6 = []; + return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() { return this; - }, i4; - function verb(n3) { - if (g4[n3]) - i4[n3] = function(v5) { - return new Promise(function(a5, b7) { - q6.push([n3, v5, a5, b7]) > 1 || resume(n3, v5); + }, i3; + function verb(n2) { + if (g4[n2]) + i3[n2] = function(v5) { + return new Promise(function(a4, b7) { + q6.push([n2, v5, a4, b7]) > 1 || resume(n2, v5); }); }; } - function resume(n3, v5) { + function resume(n2, v5) { try { - step(g4[n3](v5)); + step(g4[n2](v5)); } catch (e3) { settle2(q6[0][3], e3); } @@ -22945,30 +23277,30 @@ var require_tslib = __commonJS({ resume(q6[0][0], q6[0][1]); } }; - __asyncDelegator2 = function(o4) { - var i4, p4; - return i4 = {}, verb("next"), verb("throw", function(e3) { + __asyncDelegator2 = function(o3) { + var i3, p4; + return i3 = {}, verb("next"), verb("throw", function(e3) { throw e3; - }), verb("return"), i4[Symbol.iterator] = function() { + }), verb("return"), i3[Symbol.iterator] = function() { return this; - }, i4; - function verb(n3, f4) { - i4[n3] = o4[n3] ? function(v5) { - return (p4 = !p4) ? { value: __await3(o4[n3](v5)), done: false } : f4 ? f4(v5) : v5; + }, i3; + function verb(n2, f4) { + i3[n2] = o3[n2] ? function(v5) { + return (p4 = !p4) ? { value: __await3(o3[n2](v5)), done: false } : f4 ? f4(v5) : v5; } : f4; } }; - __asyncValues2 = function(o4) { + __asyncValues2 = function(o3) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m5 = o4[Symbol.asyncIterator], i4; - return m5 ? m5.call(o4) : (o4 = typeof __values2 === "function" ? __values2(o4) : o4[Symbol.iterator](), i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { + var m5 = o3[Symbol.asyncIterator], i3; + return m5 ? m5.call(o3) : (o3 = typeof __values2 === "function" ? __values2(o3) : o3[Symbol.iterator](), i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() { return this; - }, i4); - function verb(n3) { - i4[n3] = o4[n3] && function(v5) { + }, i3); + function verb(n2) { + i3[n2] = o3[n2] && function(v5) { return new Promise(function(resolve, reject) { - v5 = o4[n3](v5), settle2(resolve, reject, v5.done, v5.value); + v5 = o3[n2](v5), settle2(resolve, reject, v5.done, v5.value); }); }; } @@ -22986,10 +23318,10 @@ var require_tslib = __commonJS({ } return cooked; }; - var __setModuleDefault = Object.create ? function(o4, v5) { - Object.defineProperty(o4, "default", { enumerable: true, value: v5 }); - } : function(o4, v5) { - o4["default"] = v5; + var __setModuleDefault = Object.create ? function(o3, v5) { + Object.defineProperty(o3, "default", { enumerable: true, value: v5 }); + } : function(o3, v5) { + o3["default"] = v5; }; __importStar2 = function(mod) { if (mod && mod.__esModule) @@ -23117,7 +23449,7 @@ var require_tslib = __commonJS({ var require_helpers = __commonJS({ "node_modules/agent-base/dist/helpers.js"(exports) { "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o4, m5, k7, k22) { + var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -23126,16 +23458,16 @@ var require_helpers = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o4, k22, desc); - } : function(o4, m5, k7, k22) { + Object.defineProperty(o3, k22, desc); + } : function(o3, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o4[k22] = m5[k7]; + o3[k22] = m5[k7]; }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v5) { - Object.defineProperty(o4, "default", { enumerable: true, value: v5 }); - } : function(o4, v5) { - o4["default"] = v5; + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o3, v5) { + Object.defineProperty(o3, "default", { enumerable: true, value: v5 }); + } : function(o3, v5) { + o3["default"] = v5; }); var __importStar2 = exports && exports.__importStar || function(mod) { if (mod && mod.__esModule) @@ -23192,7 +23524,7 @@ var require_helpers = __commonJS({ var require_dist = __commonJS({ "node_modules/agent-base/dist/index.js"(exports) { "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o4, m5, k7, k22) { + var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -23201,16 +23533,16 @@ var require_dist = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o4, k22, desc); - } : function(o4, m5, k7, k22) { + Object.defineProperty(o3, k22, desc); + } : function(o3, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o4[k22] = m5[k7]; + o3[k22] = m5[k7]; }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v5) { - Object.defineProperty(o4, "default", { enumerable: true, value: v5 }); - } : function(o4, v5) { - o4["default"] = v5; + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o3, v5) { + Object.defineProperty(o3, "default", { enumerable: true, value: v5 }); + } : function(o3, v5) { + o3["default"] = v5; }); var __importStar2 = exports && exports.__importStar || function(mod) { if (mod && mod.__esModule) @@ -23436,7 +23768,7 @@ var require_parse_proxy_response = __commonJS({ var require_dist2 = __commonJS({ "node_modules/https-proxy-agent/dist/index.js"(exports) { "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o4, m5, k7, k22) { + var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -23445,16 +23777,16 @@ var require_dist2 = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o4, k22, desc); - } : function(o4, m5, k7, k22) { + Object.defineProperty(o3, k22, desc); + } : function(o3, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o4[k22] = m5[k7]; + o3[k22] = m5[k7]; }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v5) { - Object.defineProperty(o4, "default", { enumerable: true, value: v5 }); - } : function(o4, v5) { - o4["default"] = v5; + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o3, v5) { + Object.defineProperty(o3, "default", { enumerable: true, value: v5 }); + } : function(o3, v5) { + o3["default"] = v5; }); var __importStar2 = exports && exports.__importStar || function(mod) { if (mod && mod.__esModule) @@ -23583,7 +23915,7 @@ var require_dist2 = __commonJS({ var require_dist3 = __commonJS({ "node_modules/http-proxy-agent/dist/index.js"(exports) { "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o4, m5, k7, k22) { + var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) { if (k22 === void 0) k22 = k7; var desc = Object.getOwnPropertyDescriptor(m5, k7); @@ -23592,16 +23924,16 @@ var require_dist3 = __commonJS({ return m5[k7]; } }; } - Object.defineProperty(o4, k22, desc); - } : function(o4, m5, k7, k22) { + Object.defineProperty(o3, k22, desc); + } : function(o3, m5, k7, k22) { if (k22 === void 0) k22 = k7; - o4[k22] = m5[k7]; + o3[k22] = m5[k7]; }); - var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o4, v5) { - Object.defineProperty(o4, "default", { enumerable: true, value: v5 }); - } : function(o4, v5) { - o4["default"] = v5; + var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? function(o3, v5) { + Object.defineProperty(o3, "default", { enumerable: true, value: v5 }); + } : function(o3, v5) { + o3["default"] = v5; }); var __importStar2 = exports && exports.__importStar || function(mod) { if (mod && mod.__esModule) @@ -23726,8992 +24058,5584 @@ var require_state2 = __commonJS({ } }); -// node_modules/@commitlint/types/lib/ensure.js -var require_ensure = __commonJS({ - "node_modules/@commitlint/types/lib/ensure.js"(exports) { +// node_modules/es-errors/index.js +var require_es_errors = __commonJS({ + "node_modules/es-errors/index.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); + module2.exports = Error; } }); -// node_modules/@commitlint/types/lib/format.js -var require_format = __commonJS({ - "node_modules/@commitlint/types/lib/format.js"(exports) { +// node_modules/es-errors/eval.js +var require_eval = __commonJS({ + "node_modules/es-errors/eval.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); + module2.exports = EvalError; } }); -// node_modules/@commitlint/types/lib/is-ignored.js -var require_is_ignored = __commonJS({ - "node_modules/@commitlint/types/lib/is-ignored.js"(exports) { +// node_modules/es-errors/range.js +var require_range = __commonJS({ + "node_modules/es-errors/range.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); + module2.exports = RangeError; } }); -// node_modules/@commitlint/types/lib/lint.js -var require_lint = __commonJS({ - "node_modules/@commitlint/types/lib/lint.js"(exports) { +// node_modules/es-errors/ref.js +var require_ref = __commonJS({ + "node_modules/es-errors/ref.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); + module2.exports = ReferenceError; } }); -// node_modules/@commitlint/types/lib/load.js -var require_load = __commonJS({ - "node_modules/@commitlint/types/lib/load.js"(exports) { +// node_modules/es-errors/syntax.js +var require_syntax = __commonJS({ + "node_modules/es-errors/syntax.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); + module2.exports = SyntaxError; } }); -// node_modules/@commitlint/types/lib/parse.js -var require_parse2 = __commonJS({ - "node_modules/@commitlint/types/lib/parse.js"(exports) { +// node_modules/es-errors/type.js +var require_type = __commonJS({ + "node_modules/es-errors/type.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); + module2.exports = TypeError; } }); -// node_modules/@commitlint/types/lib/prompt.js -var require_prompt = __commonJS({ - "node_modules/@commitlint/types/lib/prompt.js"(exports) { +// node_modules/es-errors/uri.js +var require_uri = __commonJS({ + "node_modules/es-errors/uri.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); + module2.exports = URIError; } }); -// node_modules/@commitlint/types/lib/rules.js -var require_rules = __commonJS({ - "node_modules/@commitlint/types/lib/rules.js"(exports) { +// node_modules/has-symbols/shams.js +var require_shams = __commonJS({ + "node_modules/has-symbols/shams.js"(exports, module2) { "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.RuleConfigQuality = exports.RuleConfigSeverity = void 0; - var RuleConfigSeverity2; - (function(RuleConfigSeverity3) { - RuleConfigSeverity3[RuleConfigSeverity3["Disabled"] = 0] = "Disabled"; - RuleConfigSeverity3[RuleConfigSeverity3["Warning"] = 1] = "Warning"; - RuleConfigSeverity3[RuleConfigSeverity3["Error"] = 2] = "Error"; - })(RuleConfigSeverity2 || (exports.RuleConfigSeverity = RuleConfigSeverity2 = {})); - var RuleConfigQuality; - (function(RuleConfigQuality2) { - RuleConfigQuality2[RuleConfigQuality2["User"] = 0] = "User"; - RuleConfigQuality2[RuleConfigQuality2["Qualified"] = 1] = "Qualified"; - })(RuleConfigQuality || (exports.RuleConfigQuality = RuleConfigQuality = {})); + module2.exports = function hasSymbols() { + if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { + return false; + } + if (typeof Symbol.iterator === "symbol") { + return true; + } + var obj = {}; + var sym = Symbol("test"); + var symObj = Object(sym); + if (typeof sym === "string") { + return false; + } + if (Object.prototype.toString.call(sym) !== "[object Symbol]") { + return false; + } + if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { + return false; + } + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { + return false; + } + if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { + return false; + } + if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { + return false; + } + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { + return false; + } + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { + return false; + } + if (typeof Object.getOwnPropertyDescriptor === "function") { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { + return false; + } + } + return true; + }; } }); -// node_modules/@commitlint/types/lib/index.js -var require_lib3 = __commonJS({ - "node_modules/@commitlint/types/lib/index.js"(exports) { +// node_modules/has-symbols/index.js +var require_has_symbols = __commonJS({ + "node_modules/has-symbols/index.js"(exports, module2) { "use strict"; - var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o4, m5, k7, k22) { - if (k22 === void 0) - k22 = k7; - var desc = Object.getOwnPropertyDescriptor(m5, k7); - if (!desc || ("get" in desc ? !m5.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { - return m5[k7]; - } }; + var origSymbol = typeof Symbol !== "undefined" && Symbol; + var hasSymbolSham = require_shams(); + module2.exports = function hasNativeSymbols() { + if (typeof origSymbol !== "function") { + return false; } - Object.defineProperty(o4, k22, desc); - } : function(o4, m5, k7, k22) { - if (k22 === void 0) - k22 = k7; - o4[k22] = m5[k7]; - }); - var __exportStar2 = exports && exports.__exportStar || function(m5, exports2) { - for (var p4 in m5) - if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p4)) - __createBinding2(exports2, m5, p4); + if (typeof Symbol !== "function") { + return false; + } + if (typeof origSymbol("foo") !== "symbol") { + return false; + } + if (typeof Symbol("bar") !== "symbol") { + return false; + } + return hasSymbolSham(); }; - Object.defineProperty(exports, "__esModule", { value: true }); - __exportStar2(require_ensure(), exports); - __exportStar2(require_format(), exports); - __exportStar2(require_is_ignored(), exports); - __exportStar2(require_lint(), exports); - __exportStar2(require_load(), exports); - __exportStar2(require_parse2(), exports); - __exportStar2(require_prompt(), exports); - __exportStar2(require_rules(), exports); } }); -// node_modules/ignore/index.js -var require_ignore = __commonJS({ - "node_modules/ignore/index.js"(exports, module2) { - function makeArray(subject) { - return Array.isArray(subject) ? subject : [subject]; - } - var EMPTY = ""; - var SPACE = " "; - var ESCAPE = "\\"; - var REGEX_TEST_BLANK_LINE = /^\s+$/; - var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; - var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; - var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; - var REGEX_SPLITALL_CRLF = /\r?\n/g; - var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; - var SLASH = "/"; - var TMP_KEY_IGNORE = "node-ignore"; - if (typeof Symbol !== "undefined") { - TMP_KEY_IGNORE = Symbol.for("node-ignore"); - } - var KEY_IGNORE = TMP_KEY_IGNORE; - var define2 = (object, key, value) => Object.defineProperty(object, key, { value }); - var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; - var RETURN_FALSE = () => false; - var sanitizeRange = (range) => range.replace( - REGEX_REGEXP_RANGE, - (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY - ); - var cleanRangeBackSlash = (slashes) => { - const { length } = slashes; - return slashes.slice(0, length - length % 2); +// node_modules/has-proto/index.js +var require_has_proto = __commonJS({ + "node_modules/has-proto/index.js"(exports, module2) { + "use strict"; + var test2 = { + __proto__: null, + foo: {} }; - var REPLACERS = [ - [ - /^\uFEFF/, - () => EMPTY - ], - [ - /\\?\s+$/, - (match) => match.indexOf("\\") === 0 ? SPACE : EMPTY - ], - [ - /\\\s/g, - () => SPACE - ], - [ - /[\\$.|*+(){^]/g, - (match) => `\\${match}` - ], - [ - /(?!\\)\?/g, - () => "[^/]" - ], - [ - /^\//, - () => "^" - ], - [ - /\//g, - () => "\\/" - ], - [ - /^\^*\\\*\\\*\\\//, - () => "^(?:.*\\/)?" - ], - [ - /^(?=[^^])/, - function startingReplacer() { - return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^"; - } - ], - [ - /\\\/\\\*\\\*(?=\\\/|$)/g, - (_7, index, str2) => index + 6 < str2.length ? "(?:\\/[^\\/]+)*" : "\\/.+" - ], - [ - /(^|[^\\]+)(\\\*)+(?=.+)/g, - (_7, p1, p22) => { - const unescaped = p22.replace(/\\\*/g, "[^\\/]*"); - return p1 + unescaped; - } - ], - [ - /\\\\\\(?=[$.|*+(){^])/g, - () => ESCAPE - ], - [ - /\\\\/g, - () => ESCAPE - ], - [ - /(\\)?\[([^\]/]*?)(\\*)($|\])/g, - (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]" - ], - [ - /(?:[^*])$/, - (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)` - ], - [ - /(\^|\\\/)?\\\*$/, - (_7, p1) => { - const prefix = p1 ? `${p1}[^/]+` : "[^/]*"; - return `${prefix}(?=$|\\/$)`; - } - ] - ]; - var regexCache = /* @__PURE__ */ Object.create(null); - var makeRegex = (pattern, ignoreCase) => { - let source = regexCache[pattern]; - if (!source) { - source = REPLACERS.reduce( - (prev, current) => prev.replace(current[0], current[1].bind(pattern)), - pattern - ); - regexCache[pattern] = source; - } - return ignoreCase ? new RegExp(source, "i") : new RegExp(source); + var $Object = Object; + module2.exports = function hasProto() { + return { __proto__: test2 }.foo === test2.foo && !(test2 instanceof $Object); }; - var isString2 = (subject) => typeof subject === "string"; - var checkPattern = (pattern) => pattern && isString2(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0; - var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF); - var IgnoreRule = class { - constructor(origin2, pattern, negative, regex) { - this.origin = origin2; - this.pattern = pattern; - this.negative = negative; - this.regex = regex; + } +}); + +// node_modules/function-bind/implementation.js +var require_implementation = __commonJS({ + "node_modules/function-bind/implementation.js"(exports, module2) { + "use strict"; + var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; + var toStr = Object.prototype.toString; + var max = Math.max; + var funcType = "[object Function]"; + var concatty = function concatty2(a4, b7) { + var arr = []; + for (var i3 = 0; i3 < a4.length; i3 += 1) { + arr[i3] = a4[i3]; + } + for (var j4 = 0; j4 < b7.length; j4 += 1) { + arr[j4 + a4.length] = b7[j4]; } + return arr; }; - var createRule = (pattern, ignoreCase) => { - const origin2 = pattern; - let negative = false; - if (pattern.indexOf("!") === 0) { - negative = true; - pattern = pattern.substr(1); + var slicy = function slicy2(arrLike, offset) { + var arr = []; + for (var i3 = offset || 0, j4 = 0; i3 < arrLike.length; i3 += 1, j4 += 1) { + arr[j4] = arrLike[i3]; } - pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#"); - const regex = makeRegex(pattern, ignoreCase); - return new IgnoreRule( - origin2, - pattern, - negative, - regex - ); + return arr; }; - var throwError = (message, Ctor) => { - throw new Ctor(message); + var joiny = function(arr, joiner) { + var str2 = ""; + for (var i3 = 0; i3 < arr.length; i3 += 1) { + str2 += arr[i3]; + if (i3 + 1 < arr.length) { + str2 += joiner; + } + } + return str2; }; - var checkPath = (path7, originalPath, doThrow) => { - if (!isString2(path7)) { - return doThrow( - `path must be a string, but got \`${originalPath}\``, - TypeError + module2.exports = function bind2(that) { + var target = this; + if (typeof target !== "function" || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); + var bound; + var binder = function() { + if (this instanceof bound) { + var result = target.apply( + this, + concatty(args, arguments) + ); + if (Object(result) === result) { + return result; + } + return this; + } + return target.apply( + that, + concatty(args, arguments) ); + }; + var boundLength = max(0, target.length - args.length); + var boundArgs = []; + for (var i3 = 0; i3 < boundLength; i3++) { + boundArgs[i3] = "$" + i3; + } + bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); + if (target.prototype) { + var Empty = function Empty2() { + }; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; } - if (!path7) { - return doThrow(`path must not be empty`, TypeError); - } - if (checkPath.isNotRelative(path7)) { - const r3 = "`path.relative()`d"; - return doThrow( - `path should be a ${r3} string, but got "${originalPath}"`, - RangeError - ); + return bound; + }; + } +}); + +// node_modules/function-bind/index.js +var require_function_bind = __commonJS({ + "node_modules/function-bind/index.js"(exports, module2) { + "use strict"; + var implementation = require_implementation(); + module2.exports = Function.prototype.bind || implementation; + } +}); + +// node_modules/hasown/index.js +var require_hasown = __commonJS({ + "node_modules/hasown/index.js"(exports, module2) { + "use strict"; + var call = Function.prototype.call; + var $hasOwn = Object.prototype.hasOwnProperty; + var bind2 = require_function_bind(); + module2.exports = bind2.call(call, $hasOwn); + } +}); + +// node_modules/get-intrinsic/index.js +var require_get_intrinsic = __commonJS({ + "node_modules/get-intrinsic/index.js"(exports, module2) { + "use strict"; + var undefined2; + var $Error = require_es_errors(); + var $EvalError = require_eval(); + var $RangeError = require_range(); + var $ReferenceError = require_ref(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type(); + var $URIError = require_uri(); + var $Function = Function; + var getEvalledConstructor = function(expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); + } catch (e3) { } - return true; }; - var isNotRelative = (path7) => REGEX_TEST_INVALID_PATH.test(path7); - checkPath.isNotRelative = isNotRelative; - checkPath.convert = (p4) => p4; - var Ignore2 = class { - constructor({ - ignorecase = true, - ignoreCase = ignorecase, - allowRelativePaths = false - } = {}) { - define2(this, KEY_IGNORE, true); - this._rules = []; - this._ignoreCase = ignoreCase; - this._allowRelativePaths = allowRelativePaths; - this._initCache(); + var $gOPD = Object.getOwnPropertyDescriptor; + if ($gOPD) { + try { + $gOPD({}, ""); + } catch (e3) { + $gOPD = null; } - _initCache() { - this._ignoreCache = /* @__PURE__ */ Object.create(null); - this._testCache = /* @__PURE__ */ Object.create(null); + } + var throwTypeError = function() { + throw new $TypeError(); + }; + var ThrowTypeError = $gOPD ? function() { + try { + arguments.callee; + return throwTypeError; + } catch (calleeThrows) { + try { + return $gOPD(arguments, "callee").get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }() : throwTypeError; + var hasSymbols = require_has_symbols()(); + var hasProto = require_has_proto()(); + var getProto = Object.getPrototypeOf || (hasProto ? function(x5) { + return x5.__proto__; + } : null); + var needsEval = {}; + var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); + var INTRINSICS = { + __proto__: null, + "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, + "%Array%": Array, + "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, + "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, + "%AsyncFromSyncIteratorPrototype%": undefined2, + "%AsyncFunction%": needsEval, + "%AsyncGenerator%": needsEval, + "%AsyncGeneratorFunction%": needsEval, + "%AsyncIteratorPrototype%": needsEval, + "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, + "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, + "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, + "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, + "%Boolean%": Boolean, + "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, + "%Date%": Date, + "%decodeURI%": decodeURI, + "%decodeURIComponent%": decodeURIComponent, + "%encodeURI%": encodeURI, + "%encodeURIComponent%": encodeURIComponent, + "%Error%": $Error, + "%eval%": eval, + "%EvalError%": $EvalError, + "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, + "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, + "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, + "%Function%": $Function, + "%GeneratorFunction%": needsEval, + "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, + "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, + "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, + "%isFinite%": isFinite, + "%isNaN%": isNaN, + "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, + "%JSON%": typeof JSON === "object" ? JSON : undefined2, + "%Map%": typeof Map === "undefined" ? undefined2 : Map, + "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), + "%Math%": Math, + "%Number%": Number, + "%Object%": Object, + "%parseFloat%": parseFloat, + "%parseInt%": parseInt, + "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, + "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, + "%RangeError%": $RangeError, + "%ReferenceError%": $ReferenceError, + "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, + "%RegExp%": RegExp, + "%Set%": typeof Set === "undefined" ? undefined2 : Set, + "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), + "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, + "%String%": String, + "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, + "%Symbol%": hasSymbols ? Symbol : undefined2, + "%SyntaxError%": $SyntaxError, + "%ThrowTypeError%": ThrowTypeError, + "%TypedArray%": TypedArray, + "%TypeError%": $TypeError, + "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, + "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, + "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, + "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, + "%URIError%": $URIError, + "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, + "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, + "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet + }; + if (getProto) { + try { + null.error; + } catch (e3) { + errorProto = getProto(getProto(e3)); + INTRINSICS["%Error.prototype%"] = errorProto; + } + } + var errorProto; + var doEval = function doEval2(name) { + var value; + if (name === "%AsyncFunction%") { + value = getEvalledConstructor("async function () {}"); + } else if (name === "%GeneratorFunction%") { + value = getEvalledConstructor("function* () {}"); + } else if (name === "%AsyncGeneratorFunction%") { + value = getEvalledConstructor("async function* () {}"); + } else if (name === "%AsyncGenerator%") { + var fn = doEval2("%AsyncGeneratorFunction%"); + if (fn) { + value = fn.prototype; + } + } else if (name === "%AsyncIteratorPrototype%") { + var gen = doEval2("%AsyncGenerator%"); + if (gen && getProto) { + value = getProto(gen.prototype); + } + } + INTRINSICS[name] = value; + return value; + }; + var LEGACY_ALIASES = { + __proto__: null, + "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], + "%ArrayPrototype%": ["Array", "prototype"], + "%ArrayProto_entries%": ["Array", "prototype", "entries"], + "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], + "%ArrayProto_keys%": ["Array", "prototype", "keys"], + "%ArrayProto_values%": ["Array", "prototype", "values"], + "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], + "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], + "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], + "%BooleanPrototype%": ["Boolean", "prototype"], + "%DataViewPrototype%": ["DataView", "prototype"], + "%DatePrototype%": ["Date", "prototype"], + "%ErrorPrototype%": ["Error", "prototype"], + "%EvalErrorPrototype%": ["EvalError", "prototype"], + "%Float32ArrayPrototype%": ["Float32Array", "prototype"], + "%Float64ArrayPrototype%": ["Float64Array", "prototype"], + "%FunctionPrototype%": ["Function", "prototype"], + "%Generator%": ["GeneratorFunction", "prototype"], + "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], + "%Int8ArrayPrototype%": ["Int8Array", "prototype"], + "%Int16ArrayPrototype%": ["Int16Array", "prototype"], + "%Int32ArrayPrototype%": ["Int32Array", "prototype"], + "%JSONParse%": ["JSON", "parse"], + "%JSONStringify%": ["JSON", "stringify"], + "%MapPrototype%": ["Map", "prototype"], + "%NumberPrototype%": ["Number", "prototype"], + "%ObjectPrototype%": ["Object", "prototype"], + "%ObjProto_toString%": ["Object", "prototype", "toString"], + "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], + "%PromisePrototype%": ["Promise", "prototype"], + "%PromiseProto_then%": ["Promise", "prototype", "then"], + "%Promise_all%": ["Promise", "all"], + "%Promise_reject%": ["Promise", "reject"], + "%Promise_resolve%": ["Promise", "resolve"], + "%RangeErrorPrototype%": ["RangeError", "prototype"], + "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], + "%RegExpPrototype%": ["RegExp", "prototype"], + "%SetPrototype%": ["Set", "prototype"], + "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], + "%StringPrototype%": ["String", "prototype"], + "%SymbolPrototype%": ["Symbol", "prototype"], + "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], + "%TypedArrayPrototype%": ["TypedArray", "prototype"], + "%TypeErrorPrototype%": ["TypeError", "prototype"], + "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], + "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], + "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], + "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], + "%URIErrorPrototype%": ["URIError", "prototype"], + "%WeakMapPrototype%": ["WeakMap", "prototype"], + "%WeakSetPrototype%": ["WeakSet", "prototype"] + }; + var bind2 = require_function_bind(); + var hasOwn3 = require_hasown(); + var $concat = bind2.call(Function.call, Array.prototype.concat); + var $spliceApply = bind2.call(Function.apply, Array.prototype.splice); + var $replace = bind2.call(Function.call, String.prototype.replace); + var $strSlice = bind2.call(Function.call, String.prototype.slice); + var $exec = bind2.call(Function.call, RegExp.prototype.exec); + var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; + var reEscapeChar = /\\(\\)?/g; + var stringToPath = function stringToPath2(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === "%" && last !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); + } else if (last === "%" && first !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); + } + var result = []; + $replace(string, rePropName, function(match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; + }); + return result; + }; + var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn3(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = "%" + alias[0] + "%"; } - _addPattern(pattern) { - if (pattern && pattern[KEY_IGNORE]) { - this._rules = this._rules.concat(pattern._rules); - this._added = true; - return; - } - if (checkPattern(pattern)) { - const rule = createRule(pattern, this._ignoreCase); - this._added = true; - this._rules.push(rule); + if (hasOwn3(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); } - } - add(pattern) { - this._added = false; - makeArray( - isString2(pattern) ? splitPattern(pattern) : pattern - ).forEach(this._addPattern, this); - if (this._added) { - this._initCache(); + if (typeof value === "undefined" && !allowMissing) { + throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); } - return this; - } - addPattern(pattern) { - return this.add(pattern); - } - _testOne(path7, checkUnignored) { - let ignored = false; - let unignored = false; - this._rules.forEach((rule) => { - const { negative } = rule; - if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { - return; - } - const matched = rule.regex.test(path7); - if (matched) { - ignored = !negative; - unignored = negative; - } - }); return { - ignored, - unignored + alias, + name: intrinsicName, + value }; } - _test(originalPath, cache, checkUnignored, slices) { - const path7 = originalPath && checkPath.convert(originalPath); - checkPath( - path7, - originalPath, - this._allowRelativePaths ? RETURN_FALSE : throwError - ); - return this._t(path7, cache, checkUnignored, slices); - } - _t(path7, cache, checkUnignored, slices) { - if (path7 in cache) { - return cache[path7]; - } - if (!slices) { - slices = path7.split(SLASH); - } - slices.pop(); - if (!slices.length) { - return cache[path7] = this._testOne(path7, checkUnignored); + throw new $SyntaxError("intrinsic " + name + " does not exist!"); + }; + module2.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== "string" || name.length === 0) { + throw new $TypeError("intrinsic name must be a non-empty string"); + } + if (arguments.length > 1 && typeof allowMissing !== "boolean") { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; + var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + for (var i3 = 1, isOwn = true; i3 < parts.length; i3 += 1) { + var part = parts[i3]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) { + throw new $SyntaxError("property names with quotes must have matching quotes"); + } + if (part === "constructor" || !isOwn) { + skipFurtherCaching = true; + } + intrinsicBaseName += "." + part; + intrinsicRealName = "%" + intrinsicBaseName + "%"; + if (hasOwn3(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); + } + return void 0; + } + if ($gOPD && i3 + 1 >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + if (isOwn && "get" in desc && !("originalValue" in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn3(value, part); + value = value[part]; + } + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } } - const parent = this._t( - slices.join(SLASH) + SLASH, - cache, - checkUnignored, - slices - ); - return cache[path7] = parent.ignored ? parent : this._testOne(path7, checkUnignored); - } - ignores(path7) { - return this._test(path7, this._ignoreCache, false).ignored; - } - createFilter() { - return (path7) => !this.ignores(path7); - } - filter(paths) { - return makeArray(paths).filter(this.createFilter()); - } - test(path7) { - return this._test(path7, this._testCache, true); } + return value; }; - var factory = (options) => new Ignore2(options); - var isPathValid = (path7) => checkPath(path7 && checkPath.convert(path7), path7, RETURN_FALSE); - factory.isPathValid = isPathValid; - factory.default = factory; - module2.exports = factory; - if (typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")) { - const makePosix = (str2) => /^\\\\\?\\/.test(str2) || /["<>|\u0000-\u001F]+/u.test(str2) ? str2 : str2.replace(/\\/g, "/"); - checkPath.convert = makePosix; - const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; - checkPath.isNotRelative = (path7) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path7) || isNotRelative(path7); + } +}); + +// node_modules/es-define-property/index.js +var require_es_define_property = __commonJS({ + "node_modules/es-define-property/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var $defineProperty = GetIntrinsic("%Object.defineProperty%", true) || false; + if ($defineProperty) { + try { + $defineProperty({}, "a", { value: 1 }); + } catch (e3) { + $defineProperty = false; + } } + module2.exports = $defineProperty; } }); -// node_modules/type-flag/dist/index.mjs -var V = "known-flag"; -var k = "unknown-flag"; -var C = "argument"; -var { stringify: h } = JSON; -var O = /\B([A-Z])/g; -var v = (t2) => t2.replace(O, "-$1").toLowerCase(); -var { hasOwnProperty: D } = Object.prototype; -var w = (t2, n3) => D.call(t2, n3); -var L = (t2) => Array.isArray(t2); -var b = (t2) => typeof t2 == "function" ? [t2, false] : L(t2) ? [t2[0], true] : b(t2.type); -var d = (t2, n3) => t2 === Boolean ? n3 !== "false" : n3; -var m = (t2, n3) => typeof n3 == "boolean" ? n3 : t2 === Number && n3 === "" ? Number.NaN : t2(n3); -var R = /[\s.:=]/; -var B = (t2) => { - const n3 = `Flag name ${h(t2)}`; - if (t2.length === 0) - throw new Error(`${n3} cannot be empty`); - if (t2.length === 1) - throw new Error(`${n3} must be longer than a character`); - const r3 = t2.match(R); - if (r3) - throw new Error(`${n3} cannot contain ${h(r3?.[0])}`); -}; -var K = (t2) => { - const n3 = {}, r3 = (e3, o4) => { - if (w(n3, e3)) - throw new Error(`Duplicate flags named ${h(e3)}`); - n3[e3] = o4; - }; - for (const e3 in t2) { - if (!w(t2, e3)) - continue; - B(e3); - const o4 = t2[e3], s2 = [[], ...b(o4), o4]; - r3(e3, s2); - const i4 = v(e3); - if (e3 !== i4 && r3(i4, s2), "alias" in o4 && typeof o4.alias == "string") { - const { alias: a5 } = o4, l3 = `Flag alias ${h(a5)} for flag ${h(e3)}`; - if (a5.length === 0) - throw new Error(`${l3} cannot be empty`); - if (a5.length > 1) - throw new Error(`${l3} must be a single character`); - r3(a5, s2); +// node_modules/gopd/index.js +var require_gopd = __commonJS({ + "node_modules/gopd/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); + if ($gOPD) { + try { + $gOPD([], "length"); + } catch (e3) { + $gOPD = null; + } } + module2.exports = $gOPD; } - return n3; -}; -var _ = (t2, n3) => { - const r3 = {}; - for (const e3 in t2) { - if (!w(t2, e3)) - continue; - const [o4, , s2, i4] = n3[e3]; - if (o4.length === 0 && "default" in i4) { - let { default: a5 } = i4; - typeof a5 == "function" && (a5 = a5()), r3[e3] = a5; - } else - r3[e3] = s2 ? o4 : o4.pop(); +}); + +// node_modules/define-data-property/index.js +var require_define_data_property = __commonJS({ + "node_modules/define-data-property/index.js"(exports, module2) { + "use strict"; + var $defineProperty = require_es_define_property(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type(); + var gopd = require_gopd(); + module2.exports = function defineDataProperty(obj, property, value) { + if (!obj || typeof obj !== "object" && typeof obj !== "function") { + throw new $TypeError("`obj` must be an object or a function`"); + } + if (typeof property !== "string" && typeof property !== "symbol") { + throw new $TypeError("`property` must be a string or a symbol`"); + } + if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) { + throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null"); + } + if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) { + throw new $TypeError("`nonWritable`, if provided, must be a boolean or null"); + } + if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) { + throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null"); + } + if (arguments.length > 6 && typeof arguments[6] !== "boolean") { + throw new $TypeError("`loose`, if provided, must be a boolean"); + } + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + var desc = !!gopd && gopd(obj, property); + if ($defineProperty) { + $defineProperty(obj, property, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) { + obj[property] = value; + } else { + throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); + } + }; } - return r3; -}; -var F = "--"; -var G = /[.:=]/; -var T = /^-{1,2}\w/; -var N = (t2) => { - if (!T.test(t2)) - return; - const n3 = !t2.startsWith(F); - let r3 = t2.slice(n3 ? 1 : 2), e3; - const o4 = r3.match(G); - if (o4) { - const { index: s2 } = o4; - e3 = r3.slice(s2 + 1), r3 = r3.slice(0, s2); +}); + +// node_modules/has-property-descriptors/index.js +var require_has_property_descriptors = __commonJS({ + "node_modules/has-property-descriptors/index.js"(exports, module2) { + "use strict"; + var $defineProperty = require_es_define_property(); + var hasPropertyDescriptors = function hasPropertyDescriptors2() { + return !!$defineProperty; + }; + hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + if (!$defineProperty) { + return null; + } + try { + return $defineProperty([], "length", { value: 1 }).length !== 1; + } catch (e3) { + return true; + } + }; + module2.exports = hasPropertyDescriptors; } - return [r3, e3, n3]; -}; -var $ = (t2, { onFlag: n3, onArgument: r3 }) => { - let e3; - const o4 = (s2, i4) => { - if (typeof e3 != "function") - return true; - e3(s2, i4), e3 = void 0; - }; - for (let s2 = 0; s2 < t2.length; s2 += 1) { - const i4 = t2[s2]; - if (i4 === F) { - o4(); - const l3 = t2.slice(s2 + 1); - r3?.(l3, [s2], true); - break; - } - const a5 = N(i4); - if (a5) { - if (o4(), !n3) - continue; - const [l3, f4, g4] = a5; - if (g4) - for (let c5 = 0; c5 < l3.length; c5 += 1) { - o4(); - const u4 = c5 === l3.length - 1; - e3 = n3(l3[c5], u4 ? f4 : void 0, [s2, c5 + 1, u4]); +}); + +// node_modules/set-function-length/index.js +var require_set_function_length = __commonJS({ + "node_modules/set-function-length/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var define2 = require_define_data_property(); + var hasDescriptors = require_has_property_descriptors()(); + var gOPD = require_gopd(); + var $TypeError = require_type(); + var $floor = GetIntrinsic("%Math.floor%"); + module2.exports = function setFunctionLength(fn, length) { + if (typeof fn !== "function") { + throw new $TypeError("`fn` is not a function"); + } + if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) { + throw new $TypeError("`length` must be a positive 32-bit integer"); + } + var loose = arguments.length > 2 && !!arguments[2]; + var functionLengthIsConfigurable = true; + var functionLengthIsWritable = true; + if ("length" in fn && gOPD) { + var desc = gOPD(fn, "length"); + if (desc && !desc.configurable) { + functionLengthIsConfigurable = false; + } + if (desc && !desc.writable) { + functionLengthIsWritable = false; + } + } + if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { + if (hasDescriptors) { + define2(fn, "length", length, true, true); + } else { + define2(fn, "length", length); } - else - e3 = n3(l3, f4, [s2]); - } else - o4(i4, [s2]) && r3?.([i4], [s2]); - } - o4(); -}; -var E = (t2, n3) => { - for (const [r3, e3, o4] of n3.reverse()) { - if (e3) { - const s2 = t2[r3]; - let i4 = s2.slice(0, e3); - if (o4 || (i4 += s2.slice(e3 + 1)), i4 !== "-") { - t2[r3] = i4; - continue; } - } - t2.splice(r3, 1); + return fn; + }; } -}; -var U = (t2, n3 = process.argv.slice(2), { ignore: r3 } = {}) => { - const e3 = [], o4 = K(t2), s2 = {}, i4 = []; - return i4[F] = [], $(n3, { onFlag(a5, l3, f4) { - const g4 = w(o4, a5); - if (!r3?.(g4 ? V : k, a5, l3)) { - if (g4) { - const [c5, u4] = o4[a5], y6 = d(u4, l3), p4 = (P4, A5) => { - e3.push(f4), A5 && e3.push(A5), c5.push(m(u4, P4 || "")); - }; - return y6 === void 0 ? p4 : p4(y6); - } - w(s2, a5) || (s2[a5] = []), s2[a5].push(l3 === void 0 ? true : l3), e3.push(f4); - } - }, onArgument(a5, l3, f4) { - r3?.(C, n3[l3[0]]) || (i4.push(...a5), f4 ? (i4[F] = a5, n3.splice(l3[0])) : e3.push(l3)); - } }), E(n3, e3), { flags: _(t2, o4), unknownFlags: s2, _: i4 }; -}; - -// node_modules/cleye/dist/index.mjs -var import_tty = __toESM(require("tty"), 1); - -// node_modules/terminal-columns/dist/index.mjs -var DD = Object.create; -var m2 = Object.defineProperty; -var uD = Object.defineProperties; -var FD = Object.getOwnPropertyDescriptor; -var CD = Object.getOwnPropertyDescriptors; -var tD = Object.getOwnPropertyNames; -var I = Object.getOwnPropertySymbols; -var ED = Object.getPrototypeOf; -var L2 = Object.prototype.hasOwnProperty; -var eD = Object.prototype.propertyIsEnumerable; -var W = (D5, F5, u4) => F5 in D5 ? m2(D5, F5, { enumerable: true, configurable: true, writable: true, value: u4 }) : D5[F5] = u4; -var p = (D5, F5) => { - for (var u4 in F5 || (F5 = {})) - L2.call(F5, u4) && W(D5, u4, F5[u4]); - if (I) - for (var u4 of I(F5)) - eD.call(F5, u4) && W(D5, u4, F5[u4]); - return D5; -}; -var c = (D5, F5) => uD(D5, CD(F5)); -var nD = (D5) => m2(D5, "__esModule", { value: true }); -var rD = (D5, F5) => () => (D5 && (F5 = D5(D5 = 0)), F5); -var iD = (D5, F5) => () => (F5 || D5((F5 = { exports: {} }).exports, F5), F5.exports); -var oD = (D5, F5, u4, C5) => { - if (F5 && typeof F5 == "object" || typeof F5 == "function") - for (let t2 of tD(F5)) - !L2.call(D5, t2) && (u4 || t2 !== "default") && m2(D5, t2, { get: () => F5[t2], enumerable: !(C5 = FD(F5, t2)) || C5.enumerable }); - return D5; -}; -var BD = (D5, F5) => oD(nD(m2(D5 != null ? DD(ED(D5)) : {}, "default", !F5 && D5 && D5.__esModule ? { get: () => D5.default, enumerable: true } : { value: D5, enumerable: true })), D5); -var i = rD(() => { }); -var $2 = iD((LD, N6) => { - "use strict"; - i(); - N6.exports = function() { - return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\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])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\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\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\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-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*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\u26A7\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-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\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[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; - }; + +// node_modules/call-bind/index.js +var require_call_bind = __commonJS({ + "node_modules/call-bind/index.js"(exports, module2) { + "use strict"; + var bind2 = require_function_bind(); + var GetIntrinsic = require_get_intrinsic(); + var setFunctionLength = require_set_function_length(); + var $TypeError = require_type(); + var $apply = GetIntrinsic("%Function.prototype.apply%"); + var $call = GetIntrinsic("%Function.prototype.call%"); + var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind2.call($call, $apply); + var $defineProperty = require_es_define_property(); + var $max = GetIntrinsic("%Math.max%"); + module2.exports = function callBind(originalFunction) { + if (typeof originalFunction !== "function") { + throw new $TypeError("a function is required"); + } + var func = $reflectApply(bind2, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); + }; + var applyBind = function applyBind2() { + return $reflectApply(bind2, $apply, arguments); + }; + if ($defineProperty) { + $defineProperty(module2.exports, "apply", { value: applyBind }); + } else { + module2.exports.apply = applyBind; + } + } }); -i(); -i(); -i(); -var v2 = (D5) => { - var u4, C5, t2; - let F5 = (u4 = process.stdout.columns) != null ? u4 : Number.POSITIVE_INFINITY; - return typeof D5 == "function" && (D5 = D5(F5)), D5 || (D5 = {}), Array.isArray(D5) ? { columns: D5, stdoutColumns: F5 } : { columns: (C5 = D5.columns) != null ? C5 : [], stdoutColumns: (t2 = D5.stdoutColumns) != null ? t2 : F5 }; -}; -i(); -i(); -i(); -i(); -i(); -function w2({ onlyFirst: D5 = false } = {}) { - let F5 = ["[\\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(F5, D5 ? void 0 : "g"); -} -function d2(D5) { - if (typeof D5 != "string") - throw new TypeError(`Expected a \`string\`, got \`${typeof D5}\``); - return D5.replace(w2(), ""); -} -i(); -function y(D5) { - return Number.isInteger(D5) ? D5 >= 4352 && (D5 <= 4447 || D5 === 9001 || D5 === 9002 || 11904 <= D5 && D5 <= 12871 && D5 !== 12351 || 12880 <= D5 && D5 <= 19903 || 19968 <= D5 && D5 <= 42182 || 43360 <= D5 && D5 <= 43388 || 44032 <= D5 && D5 <= 55203 || 63744 <= D5 && D5 <= 64255 || 65040 <= D5 && D5 <= 65049 || 65072 <= D5 && D5 <= 65131 || 65281 <= D5 && D5 <= 65376 || 65504 <= D5 && D5 <= 65510 || 110592 <= D5 && D5 <= 110593 || 127488 <= D5 && D5 <= 127569 || 131072 <= D5 && D5 <= 262141) : false; -} -var j = BD($2(), 1); -function g(D5) { - if (typeof D5 != "string" || D5.length === 0 || (D5 = d2(D5), D5.length === 0)) - return 0; - D5 = D5.replace((0, j.default)(), " "); - let F5 = 0; - for (let u4 = 0; u4 < D5.length; u4++) { - let C5 = D5.codePointAt(u4); - C5 <= 31 || C5 >= 127 && C5 <= 159 || C5 >= 768 && C5 <= 879 || (C5 > 65535 && u4++, F5 += y(C5) ? 2 : 1); + +// node_modules/call-bind/callBound.js +var require_callBound = __commonJS({ + "node_modules/call-bind/callBound.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var callBind = require_call_bind(); + var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf")); + module2.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) { + return callBind(intrinsic); + } + return intrinsic; + }; } - return F5; -} -var b2 = (D5) => Math.max(...D5.split(` -`).map(g)); -var k2 = (D5) => { - let F5 = []; - for (let u4 of D5) { - let { length: C5 } = u4, t2 = C5 - F5.length; - for (let E4 = 0; E4 < t2; E4 += 1) - F5.push(0); - for (let E4 = 0; E4 < C5; E4 += 1) { - let e3 = b2(u4[E4]); - e3 > F5[E4] && (F5[E4] = e3); - } +}); + +// node_modules/object-inspect/util.inspect.js +var require_util_inspect = __commonJS({ + "node_modules/object-inspect/util.inspect.js"(exports, module2) { + module2.exports = require("util").inspect; } - return F5; -}; -i(); -var _2 = /^\d+%$/; -var z = { width: "auto", align: "left", contentWidth: 0, paddingLeft: 0, paddingRight: 0, paddingTop: 0, paddingBottom: 0, horizontalPadding: 0, paddingLeftString: "", paddingRightString: "" }; -var sD = (D5, F5) => { - var C5; - let u4 = []; - for (let t2 = 0; t2 < D5.length; t2 += 1) { - let E4 = (C5 = F5[t2]) != null ? C5 : "auto"; - if (typeof E4 == "number" || E4 === "auto" || E4 === "content-width" || typeof E4 == "string" && _2.test(E4)) { - u4.push(c(p({}, z), { width: E4, contentWidth: D5[t2] })); - continue; +}); + +// node_modules/object-inspect/index.js +var require_object_inspect = __commonJS({ + "node_modules/object-inspect/index.js"(exports, module2) { + var hasMap = typeof Map === "function" && Map.prototype; + var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null; + var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null; + var mapForEach = hasMap && Map.prototype.forEach; + var hasSet = typeof Set === "function" && Set.prototype; + var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null; + var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null; + var setForEach = hasSet && Set.prototype.forEach; + var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype; + var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; + var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype; + var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; + var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype; + var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; + var booleanValueOf = Boolean.prototype.valueOf; + var objectToString = Object.prototype.toString; + var functionToString = Function.prototype.toString; + var $match = String.prototype.match; + var $slice = String.prototype.slice; + var $replace = String.prototype.replace; + var $toUpperCase = String.prototype.toUpperCase; + var $toLowerCase = String.prototype.toLowerCase; + var $test = RegExp.prototype.test; + var $concat = Array.prototype.concat; + var $join = Array.prototype.join; + var $arrSlice = Array.prototype.slice; + var $floor = Math.floor; + var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null; + var gOPS = Object.getOwnPropertySymbols; + var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null; + var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object"; + var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null; + var isEnumerable = Object.prototype.propertyIsEnumerable; + var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O5) { + return O5.__proto__; + } : null); + function addNumericSeparator(num, str2) { + if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str2)) { + return str2; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === "number") { + var int = num < 0 ? -$floor(-num) : $floor(num); + if (int !== num) { + var intStr = String(int); + var dec = $slice.call(str2, intStr.length + 1); + return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, ""); + } + } + return $replace.call(str2, sepRegex, "$&_"); + } + var utilInspect = require_util_inspect(); + var inspectCustom = utilInspect.custom; + var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; + module2.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + if (has(opts, "quoteStyle") && (opts.quoteStyle !== "single" && opts.quoteStyle !== "double")) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if (has(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has(opts, "customInspect") ? opts.customInspect : true; + if (typeof customInspect !== "boolean" && customInspect !== "symbol") { + throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); + } + if (has(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + var numericSeparator = opts.numericSeparator; + if (typeof obj === "undefined") { + return "undefined"; + } + if (obj === null) { + return "null"; + } + if (typeof obj === "boolean") { + return obj ? "true" : "false"; + } + if (typeof obj === "string") { + return inspectString(obj, opts); + } + if (typeof obj === "number") { + if (obj === 0) { + return Infinity / obj > 0 ? "0" : "-0"; + } + var str2 = String(obj); + return numericSeparator ? addNumericSeparator(obj, str2) : str2; + } + if (typeof obj === "bigint") { + var bigIntStr = String(obj) + "n"; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } + var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth; + if (typeof depth === "undefined") { + depth = 0; + } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") { + return isArray2(obj) ? "[Array]" : "[Object]"; + } + var indent = getIndent(opts, depth); + if (typeof seen === "undefined") { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return "[Circular]"; + } + function inspect3(value, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has(opts, "quoteStyle")) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value, newOpts, depth + 1, seen); + } + return inspect_(value, opts, depth + 1, seen); + } + if (typeof obj === "function" && !isRegExp2(obj)) { + var name = nameOf(obj); + var keys = arrObjKeys(obj, inspect3); + return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : ""); + } + if (isSymbol(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj); + return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s2 = "<" + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + for (var i3 = 0; i3 < attrs.length; i3++) { + s2 += " " + attrs[i3].name + "=" + wrapQuotes(quote(attrs[i3].value), "double", opts); + } + s2 += ">"; + if (obj.childNodes && obj.childNodes.length) { + s2 += "..."; + } + s2 += ""; + return s2; + } + if (isArray2(obj)) { + if (obj.length === 0) { + return "[]"; + } + var xs = arrObjKeys(obj, inspect3); + if (indent && !singleLineValues(xs)) { + return "[" + indentedJoin(xs, indent) + "]"; + } + return "[ " + $join.call(xs, ", ") + " ]"; + } + if (isError2(obj)) { + var parts = arrObjKeys(obj, inspect3); + if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) { + return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect3(obj.cause), parts), ", ") + " }"; + } + if (parts.length === 0) { + return "[" + String(obj) + "]"; + } + return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }"; + } + if (typeof obj === "object" && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) { + return utilInspect(obj, { depth: maxDepth - depth }); + } else if (customInspect !== "symbol" && typeof obj.inspect === "function") { + return obj.inspect(); + } + } + if (isMap(obj)) { + var mapParts = []; + if (mapForEach) { + mapForEach.call(obj, function(value, key) { + mapParts.push(inspect3(key, obj, true) + " => " + inspect3(value, obj)); + }); + } + return collectionOf("Map", mapSize.call(obj), mapParts, indent); + } + if (isSet(obj)) { + var setParts = []; + if (setForEach) { + setForEach.call(obj, function(value) { + setParts.push(inspect3(value, obj)); + }); + } + return collectionOf("Set", setSize.call(obj), setParts, indent); + } + if (isWeakMap(obj)) { + return weakCollectionOf("WeakMap"); + } + if (isWeakSet(obj)) { + return weakCollectionOf("WeakSet"); + } + if (isWeakRef(obj)) { + return weakCollectionOf("WeakRef"); + } + if (isNumber2(obj)) { + return markBoxed(inspect3(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect3(bigIntValueOf.call(obj))); + } + if (isBoolean2(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString2(obj)) { + return markBoxed(inspect3(String(obj))); + } + if (typeof window !== "undefined" && obj === window) { + return "{ [object Window] }"; + } + if (typeof globalThis !== "undefined" && obj === globalThis || typeof global !== "undefined" && obj === global) { + return "{ [object globalThis] }"; + } + if (!isDate2(obj) && !isRegExp2(obj)) { + var ys = arrObjKeys(obj, inspect3); + var isPlainObject4 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? "" : "null prototype"; + var stringTag = !isPlainObject4 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : ""; + var constructorTag = isPlainObject4 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : ""; + var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : ""); + if (ys.length === 0) { + return tag + "{}"; + } + if (indent) { + return tag + "{" + indentedJoin(ys, indent) + "}"; + } + return tag + "{ " + $join.call(ys, ", ") + " }"; + } + return String(obj); + }; + function wrapQuotes(s2, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'"; + return quoteChar + s2 + quoteChar; } - if (E4 && typeof E4 == "object") { - let e3 = c(p(p({}, z), E4), { contentWidth: D5[t2] }); - e3.horizontalPadding = e3.paddingLeft + e3.paddingRight, u4.push(e3); - continue; + function quote(s2) { + return $replace.call(String(s2), /"/g, """); } - throw new Error(`Invalid column width: ${JSON.stringify(E4)}`); - } - return u4; -}; -function aD(D5, F5) { - for (let u4 of D5) { - let { width: C5 } = u4; - if (C5 === "content-width" && (u4.width = u4.contentWidth), C5 === "auto") { - let n3 = Math.min(20, u4.contentWidth); - u4.width = n3, u4.autoOverflow = u4.contentWidth - n3; + function isArray2(obj) { + return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); } - if (typeof C5 == "string" && _2.test(C5)) { - let n3 = Number.parseFloat(C5.slice(0, -1)) / 100; - u4.width = Math.floor(F5 * n3) - (u4.paddingLeft + u4.paddingRight); + function isDate2(obj) { + return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); } - let { horizontalPadding: t2 } = u4, E4 = 1, e3 = E4 + t2; - if (e3 >= F5) { - let n3 = e3 - F5, o4 = Math.ceil(u4.paddingLeft / t2 * n3), B3 = n3 - o4; - u4.paddingLeft -= o4, u4.paddingRight -= B3, u4.horizontalPadding = u4.paddingLeft + u4.paddingRight; + function isRegExp2(obj) { + return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); } - u4.paddingLeftString = u4.paddingLeft ? " ".repeat(u4.paddingLeft) : "", u4.paddingRightString = u4.paddingRight ? " ".repeat(u4.paddingRight) : ""; - let r3 = F5 - u4.horizontalPadding; - u4.width = Math.max(Math.min(u4.width, r3), E4); - } -} -var G2 = () => Object.assign([], { columns: 0 }); -function lD(D5, F5) { - let u4 = [G2()], [C5] = u4; - for (let t2 of D5) { - let E4 = t2.width + t2.horizontalPadding; - C5.columns + E4 > F5 && (C5 = G2(), u4.push(C5)), C5.push(t2), C5.columns += E4; - } - for (let t2 of u4) { - let E4 = t2.reduce((s2, l3) => s2 + l3.width + l3.horizontalPadding, 0), e3 = F5 - E4; - if (e3 === 0) - continue; - let r3 = t2.filter((s2) => "autoOverflow" in s2), n3 = r3.filter((s2) => s2.autoOverflow > 0), o4 = n3.reduce((s2, l3) => s2 + l3.autoOverflow, 0), B3 = Math.min(o4, e3); - for (let s2 of n3) { - let l3 = Math.floor(s2.autoOverflow / o4 * B3); - s2.width += l3, e3 -= l3; + function isError2(obj) { + return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); } - let a5 = Math.floor(e3 / r3.length); - for (let s2 = 0; s2 < r3.length; s2 += 1) { - let l3 = r3[s2]; - s2 === r3.length - 1 ? l3.width += e3 : l3.width += a5, e3 -= a5; + function isString2(obj) { + return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); } - } - return u4; -} -function Z(D5, F5, u4) { - let C5 = sD(u4, F5); - return aD(C5, D5), lD(C5, D5); -} -i(); -i(); -i(); -var O2 = 10; -var U2 = (D5 = 0) => (F5) => `\x1B[${F5 + D5}m`; -var V2 = (D5 = 0) => (F5) => `\x1B[${38 + D5};5;${F5}m`; -var Y = (D5 = 0) => (F5, u4, C5) => `\x1B[${38 + D5};2;${F5};${u4};${C5}m`; -function AD() { - let D5 = /* @__PURE__ */ new Map(), F5 = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], 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], 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], bgBlackBright: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; - F5.color.gray = F5.color.blackBright, F5.bgColor.bgGray = F5.bgColor.bgBlackBright, F5.color.grey = F5.color.blackBright, F5.bgColor.bgGrey = F5.bgColor.bgBlackBright; - for (let [u4, C5] of Object.entries(F5)) { - for (let [t2, E4] of Object.entries(C5)) - F5[t2] = { open: `\x1B[${E4[0]}m`, close: `\x1B[${E4[1]}m` }, C5[t2] = F5[t2], D5.set(E4[0], E4[1]); - Object.defineProperty(F5, u4, { value: C5, enumerable: false }); - } - return Object.defineProperty(F5, "codes", { value: D5, enumerable: false }), F5.color.close = "\x1B[39m", F5.bgColor.close = "\x1B[49m", F5.color.ansi = U2(), F5.color.ansi256 = V2(), F5.color.ansi16m = Y(), F5.bgColor.ansi = U2(O2), F5.bgColor.ansi256 = V2(O2), F5.bgColor.ansi16m = Y(O2), Object.defineProperties(F5, { rgbToAnsi256: { value: (u4, C5, t2) => u4 === C5 && C5 === t2 ? u4 < 8 ? 16 : u4 > 248 ? 231 : Math.round((u4 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u4 / 255 * 5) + 6 * Math.round(C5 / 255 * 5) + Math.round(t2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u4) => { - let C5 = /(?[a-f\d]{6}|[a-f\d]{3})/i.exec(u4.toString(16)); - if (!C5) - return [0, 0, 0]; - let { colorString: t2 } = C5.groups; - t2.length === 3 && (t2 = t2.split("").map((e3) => e3 + e3).join("")); - let E4 = Number.parseInt(t2, 16); - return [E4 >> 16 & 255, E4 >> 8 & 255, E4 & 255]; - }, enumerable: false }, hexToAnsi256: { value: (u4) => F5.rgbToAnsi256(...F5.hexToRgb(u4)), enumerable: false }, ansi256ToAnsi: { value: (u4) => { - if (u4 < 8) - return 30 + u4; - if (u4 < 16) - return 90 + (u4 - 8); - let C5, t2, E4; - if (u4 >= 232) - C5 = ((u4 - 232) * 10 + 8) / 255, t2 = C5, E4 = C5; - else { - u4 -= 16; - let n3 = u4 % 36; - C5 = Math.floor(u4 / 36) / 5, t2 = Math.floor(n3 / 6) / 5, E4 = n3 % 6 / 5; + function isNumber2(obj) { + return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); } - let e3 = Math.max(C5, t2, E4) * 2; - if (e3 === 0) - return 30; - let r3 = 30 + (Math.round(E4) << 2 | Math.round(t2) << 1 | Math.round(C5)); - return e3 === 2 && (r3 += 60), r3; - }, enumerable: false }, rgbToAnsi: { value: (u4, C5, t2) => F5.ansi256ToAnsi(F5.rgbToAnsi256(u4, C5, t2)), enumerable: false }, hexToAnsi: { value: (u4) => F5.ansi256ToAnsi(F5.hexToAnsi256(u4)), enumerable: false } }), F5; -} -var fD = AD(); -var K2 = fD; -var x = /* @__PURE__ */ new Set(["\x1B", "\x9B"]); -var gD = 39; -var R2 = "\x07"; -var q = "["; -var pD = "]"; -var H = "m"; -var M = `${pD}8;;`; -var J = (D5) => `${x.values().next().value}${q}${D5}${H}`; -var Q = (D5) => `${x.values().next().value}${M}${D5}${R2}`; -var hD = (D5) => D5.split(" ").map((F5) => g(F5)); -var S = (D5, F5, u4) => { - let C5 = [...F5], t2 = false, E4 = false, e3 = g(d2(D5[D5.length - 1])); - for (let [r3, n3] of C5.entries()) { - let o4 = g(n3); - if (e3 + o4 <= u4 ? D5[D5.length - 1] += n3 : (D5.push(n3), e3 = 0), x.has(n3) && (t2 = true, E4 = C5.slice(r3 + 1).join("").startsWith(M)), t2) { - E4 ? n3 === R2 && (t2 = false, E4 = false) : n3 === H && (t2 = false); - continue; + function isBoolean2(obj) { + return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); } - e3 += o4, e3 === u4 && r3 < C5.length - 1 && (D5.push(""), e3 = 0); - } - !e3 && D5[D5.length - 1].length > 0 && D5.length > 1 && (D5[D5.length - 2] += D5.pop()); -}; -var cD = (D5) => { - let F5 = D5.split(" "), u4 = F5.length; - for (; u4 > 0 && !(g(F5[u4 - 1]) > 0); ) - u4--; - return u4 === F5.length ? D5 : F5.slice(0, u4).join(" ") + F5.slice(u4).join(""); -}; -var dD = (D5, F5, u4 = {}) => { - if (u4.trim !== false && D5.trim() === "") - return ""; - let C5 = "", t2, E4, e3 = hD(D5), r3 = [""]; - for (let [o4, B3] of D5.split(" ").entries()) { - u4.trim !== false && (r3[r3.length - 1] = r3[r3.length - 1].trimStart()); - let a5 = g(r3[r3.length - 1]); - if (o4 !== 0 && (a5 >= F5 && (u4.wordWrap === false || u4.trim === false) && (r3.push(""), a5 = 0), (a5 > 0 || u4.trim === false) && (r3[r3.length - 1] += " ", a5++)), u4.hard && e3[o4] > F5) { - let s2 = F5 - a5, l3 = 1 + Math.floor((e3[o4] - s2 - 1) / F5); - Math.floor((e3[o4] - 1) / F5) < l3 && r3.push(""), S(r3, B3, F5); - continue; + function isSymbol(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === "object" && obj instanceof Symbol; + } + if (typeof obj === "symbol") { + return true; + } + if (!obj || typeof obj !== "object" || !symToString) { + return false; + } + try { + symToString.call(obj); + return true; + } catch (e3) { + } + return false; } - if (a5 + e3[o4] > F5 && a5 > 0 && e3[o4] > 0) { - if (u4.wordWrap === false && a5 < F5) { - S(r3, B3, F5); - continue; + function isBigInt(obj) { + if (!obj || typeof obj !== "object" || !bigIntValueOf) { + return false; } - r3.push(""); + try { + bigIntValueOf.call(obj); + return true; + } catch (e3) { + } + return false; } - if (a5 + e3[o4] > F5 && u4.wordWrap === false) { - S(r3, B3, F5); - continue; + var hasOwn3 = Object.prototype.hasOwnProperty || function(key) { + return key in this; + }; + function has(obj, key) { + return hasOwn3.call(obj, key); } - r3[r3.length - 1] += B3; - } - u4.trim !== false && (r3 = r3.map((o4) => cD(o4))); - let n3 = [...r3.join(` -`)]; - for (let [o4, B3] of n3.entries()) { - if (C5 += B3, x.has(B3)) { - let { groups: s2 } = new RegExp(`(?:\\${q}(?\\d+)m|\\${M}(?.*)${R2})`).exec(n3.slice(o4).join("")) || { groups: {} }; - if (s2.code !== void 0) { - let l3 = Number.parseFloat(s2.code); - t2 = l3 === gD ? void 0 : l3; - } else - s2.uri !== void 0 && (E4 = s2.uri.length === 0 ? void 0 : s2.uri); + function toStr(obj) { + return objectToString.call(obj); } - let a5 = K2.codes.get(Number(t2)); - n3[o4 + 1] === ` -` ? (E4 && (C5 += Q("")), t2 && a5 && (C5 += J(a5))) : B3 === ` -` && (t2 && a5 && (C5 += J(t2)), E4 && (C5 += Q(E4))); - } - return C5; -}; -function T2(D5, F5, u4) { - return String(D5).normalize().replace(/\r\n/g, ` -`).split(` -`).map((C5) => dD(C5, F5, u4)).join(` -`); -} -var X = (D5) => Array.from({ length: D5 }).fill(""); -function P(D5, F5) { - let u4 = [], C5 = 0; - for (let t2 of D5) { - let E4 = 0, e3 = t2.map((n3) => { - var a5; - let o4 = (a5 = F5[C5]) != null ? a5 : ""; - C5 += 1, n3.preprocess && (o4 = n3.preprocess(o4)), b2(o4) > n3.width && (o4 = T2(o4, n3.width, { hard: true })); - let B3 = o4.split(` -`); - if (n3.postprocess) { - let { postprocess: s2 } = n3; - B3 = B3.map((l3, h5) => s2.call(n3, l3, h5)); + function nameOf(f4) { + if (f4.name) { + return f4.name; } - return n3.paddingTop && B3.unshift(...X(n3.paddingTop)), n3.paddingBottom && B3.push(...X(n3.paddingBottom)), B3.length > E4 && (E4 = B3.length), c(p({}, n3), { lines: B3 }); - }), r3 = []; - for (let n3 = 0; n3 < E4; n3 += 1) { - let o4 = e3.map((B3) => { - var h5; - let a5 = (h5 = B3.lines[n3]) != null ? h5 : "", s2 = Number.isFinite(B3.width) ? " ".repeat(B3.width - g(a5)) : "", l3 = B3.paddingLeftString; - return B3.align === "right" && (l3 += s2), l3 += a5, B3.align === "left" && (l3 += s2), l3 + B3.paddingRightString; - }).join(""); - r3.push(o4); - } - u4.push(r3.join(` -`)); - } - return u4.join(` -`); -} -function mD(D5, F5) { - if (!D5 || D5.length === 0) - return ""; - let u4 = k2(D5), C5 = u4.length; - if (C5 === 0) - return ""; - let { stdoutColumns: t2, columns: E4 } = v2(F5); - if (E4.length > C5) - throw new Error(`${E4.length} columns defined, but only ${C5} columns found`); - let e3 = Z(t2, E4, u4); - return D5.map((r3) => P(e3, r3)).join(` -`); -} -i(); -var bD = ["<", ">", "=", ">=", "<="]; -function xD(D5) { - if (!bD.includes(D5)) - throw new TypeError(`Invalid breakpoint operator: ${D5}`); -} -function wD(D5) { - let F5 = Object.keys(D5).map((u4) => { - let [C5, t2] = u4.split(" "); - xD(C5); - let E4 = Number.parseInt(t2, 10); - if (Number.isNaN(E4)) - throw new TypeError(`Invalid breakpoint value: ${t2}`); - let e3 = D5[u4]; - return { operator: C5, breakpoint: E4, value: e3 }; - }).sort((u4, C5) => C5.breakpoint - u4.breakpoint); - return (u4) => { - var C5; - return (C5 = F5.find(({ operator: t2, breakpoint: E4 }) => t2 === "=" && u4 === E4 || t2 === ">" && u4 > E4 || t2 === "<" && u4 < E4 || t2 === ">=" && u4 >= E4 || t2 === "<=" && u4 <= E4)) == null ? void 0 : C5.value; - }; -} - -// node_modules/cleye/dist/index.mjs -var S2 = (t2) => t2.replace(/[\W_]([a-z\d])?/gi, (e3, r3) => r3 ? r3.toUpperCase() : ""); -var q2 = (t2) => t2.replace(/\B([A-Z])/g, "-$1").toLowerCase(); -var I2 = { "> 80": [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }, { width: "auto" }], "> 40": [{ width: "auto", paddingLeft: 2, paddingRight: 8, preprocess: (t2) => t2.trim() }, { width: "100%", paddingLeft: 2, paddingBottom: 1 }], "> 0": { stdoutColumns: 1e3, columns: [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }, { width: "content-width" }] } }; -function D2(t2) { - let e3 = false; - return { type: "table", data: { tableData: Object.keys(t2).sort((a5, i4) => a5.localeCompare(i4)).map((a5) => { - const i4 = t2[a5], s2 = "alias" in i4; - return s2 && (e3 = true), { name: a5, flag: i4, flagFormatted: `--${q2(a5)}`, aliasesEnabled: e3, aliasFormatted: s2 ? `-${i4.alias}` : void 0 }; - }).map((a5) => (a5.aliasesEnabled = e3, [{ type: "flagName", data: a5 }, { type: "flagDescription", data: a5 }])), tableBreakpoints: I2 } }; -} -var A = (t2) => !t2 || (t2.version ?? (t2.help ? t2.help.version : void 0)); -var C2 = (t2) => { - const e3 = "parent" in t2 && t2.parent?.name; - return (e3 ? `${e3} ` : "") + t2.name; -}; -function R3(t2) { - const e3 = []; - t2.name && e3.push(C2(t2)); - const r3 = A(t2) ?? ("parent" in t2 && A(t2.parent)); - if (r3 && e3.push(`v${r3}`), e3.length !== 0) - return { id: "name", type: "text", data: `${e3.join(" ")} -` }; -} -function L3(t2) { - const { help: e3 } = t2; - if (!(!e3 || !e3.description)) - return { id: "description", type: "text", data: `${e3.description} -` }; -} -function T3(t2) { - const e3 = t2.help || {}; - if ("usage" in e3) - return e3.usage ? { id: "usage", type: "section", data: { title: "Usage:", body: Array.isArray(e3.usage) ? e3.usage.join(` -`) : e3.usage } } : void 0; - if (t2.name) { - const r3 = [], n3 = [C2(t2)]; - if (t2.flags && Object.keys(t2.flags).length > 0 && n3.push("[flags...]"), t2.parameters && t2.parameters.length > 0) { - const { parameters: a5 } = t2, i4 = a5.indexOf("--"), s2 = i4 > -1 && a5.slice(i4 + 1).some((o4) => o4.startsWith("<")); - n3.push(a5.map((o4) => o4 !== "--" ? o4 : s2 ? "--" : "[--]").join(" ")); + var m5 = $match.call(functionToString.call(f4), /^function\s*([\w$]+)/); + if (m5) { + return m5[1]; + } + return null; } - if (n3.length > 1 && r3.push(n3.join(" ")), "commands" in t2 && t2.commands?.length && r3.push(`${t2.name} `), r3.length > 0) - return { id: "usage", type: "section", data: { title: "Usage:", body: r3.join(` -`) } }; - } -} -function _3(t2) { - return !("commands" in t2) || !t2.commands?.length ? void 0 : { id: "commands", type: "section", data: { title: "Commands:", body: { type: "table", data: { tableData: t2.commands.map((n3) => [n3.options.name, n3.options.help ? n3.options.help.description : ""]), tableOptions: [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }] } }, indentBody: 0 } }; -} -function k3(t2) { - if (!(!t2.flags || Object.keys(t2.flags).length === 0)) - return { id: "flags", type: "section", data: { title: "Flags:", body: D2(t2.flags), indentBody: 0 } }; -} -function F2(t2) { - const { help: e3 } = t2; - if (!e3 || !e3.examples || e3.examples.length === 0) - return; - let { examples: r3 } = e3; - if (Array.isArray(r3) && (r3 = r3.join(` -`)), r3) - return { id: "examples", type: "section", data: { title: "Examples:", body: r3 } }; -} -function H2(t2) { - if (!("alias" in t2) || !t2.alias) - return; - const { alias: e3 } = t2; - return { id: "aliases", type: "section", data: { title: "Aliases:", body: Array.isArray(e3) ? e3.join(", ") : e3 } }; -} -var U3 = (t2) => [R3, L3, T3, _3, k3, F2, H2].map((e3) => e3(t2)).filter(Boolean); -var J2 = import_tty.default.WriteStream.prototype.hasColors(); -var M2 = class { - text(e3) { - return e3; - } - bold(e3) { - return J2 ? `\x1B[1m${e3}\x1B[22m` : e3.toLocaleUpperCase(); - } - indentText({ text: e3, spaces: r3 }) { - return e3.replace(/^/gm, " ".repeat(r3)); - } - heading(e3) { - return this.bold(e3); - } - section({ title: e3, body: r3, indentBody: n3 = 2 }) { - return `${(e3 ? `${this.heading(e3)} -` : "") + (r3 ? this.indentText({ text: this.render(r3), spaces: n3 }) : "")} -`; - } - table({ tableData: e3, tableOptions: r3, tableBreakpoints: n3 }) { - return mD(e3.map((a5) => a5.map((i4) => this.render(i4))), n3 ? wD(n3) : r3); - } - flagParameter(e3) { - return e3 === Boolean ? "" : e3 === String ? "" : e3 === Number ? "" : Array.isArray(e3) ? this.flagParameter(e3[0]) : ""; - } - flagOperator(e3) { - return " "; - } - flagName(e3) { - const { flag: r3, flagFormatted: n3, aliasesEnabled: a5, aliasFormatted: i4 } = e3; - let s2 = ""; - if (i4 ? s2 += `${i4}, ` : a5 && (s2 += " "), s2 += n3, "placeholder" in r3 && typeof r3.placeholder == "string") - s2 += `${this.flagOperator(e3)}${r3.placeholder}`; - else { - const o4 = this.flagParameter("type" in r3 ? r3.type : r3); - o4 && (s2 += `${this.flagOperator(e3)}${o4}`); + function indexOf(xs, x5) { + if (xs.indexOf) { + return xs.indexOf(x5); + } + for (var i3 = 0, l3 = xs.length; i3 < l3; i3++) { + if (xs[i3] === x5) { + return i3; + } + } + return -1; } - return s2; - } - flagDefault(e3) { - return JSON.stringify(e3); - } - flagDescription({ flag: e3 }) { - let r3 = "description" in e3 ? e3.description ?? "" : ""; - if ("default" in e3) { - let { default: n3 } = e3; - typeof n3 == "function" && (n3 = n3()), n3 && (r3 += ` (default: ${this.flagDefault(n3)})`); + function isMap(x5) { + if (!mapSize || !x5 || typeof x5 !== "object") { + return false; + } + try { + mapSize.call(x5); + try { + setSize.call(x5); + } catch (s2) { + return true; + } + return x5 instanceof Map; + } catch (e3) { + } + return false; } - return r3; - } - render(e3) { - if (typeof e3 == "string") - return e3; - if (Array.isArray(e3)) - return e3.map((r3) => this.render(r3)).join(` -`); - if ("type" in e3 && this[e3.type]) { - const r3 = this[e3.type]; - if (typeof r3 == "function") - return r3.call(this, e3.data); + function isWeakMap(x5) { + if (!weakMapHas || !x5 || typeof x5 !== "object") { + return false; + } + try { + weakMapHas.call(x5, weakMapHas); + try { + weakSetHas.call(x5, weakSetHas); + } catch (s2) { + return true; + } + return x5 instanceof WeakMap; + } catch (e3) { + } + return false; } - throw new Error(`Invalid node type: ${JSON.stringify(e3)}`); - } -}; -var y2 = /^[\w.-]+$/; -var { stringify: d3 } = JSON; -var V3 = /[|\\{}()[\]^$+*?.]/; -function w3(t2) { - const e3 = []; - let r3, n3; - for (const a5 of t2) { - if (n3) - throw new Error(`Invalid parameter: Spread parameter ${d3(n3)} must be last`); - const i4 = a5[0], s2 = a5[a5.length - 1]; - let o4; - if (i4 === "<" && s2 === ">" && (o4 = true, r3)) - throw new Error(`Invalid parameter: Required parameter ${d3(a5)} cannot come after optional parameter ${d3(r3)}`); - if (i4 === "[" && s2 === "]" && (o4 = false, r3 = a5), o4 === void 0) - throw new Error(`Invalid parameter: ${d3(a5)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`); - let l3 = a5.slice(1, -1); - const f4 = l3.slice(-3) === "..."; - f4 && (n3 = a5, l3 = l3.slice(0, -3)); - const p4 = l3.match(V3); - if (p4) - throw new Error(`Invalid parameter: ${d3(a5)}. Invalid character found ${d3(p4[0])}`); - e3.push({ name: l3, required: o4, spread: f4 }); - } - return e3; -} -function b3(t2, e3, r3, n3) { - for (let a5 = 0; a5 < e3.length; a5 += 1) { - const { name: i4, required: s2, spread: o4 } = e3[a5], l3 = S2(i4); - if (l3 in t2) - throw new Error(`Invalid parameter: ${d3(i4)} is used more than once.`); - const f4 = o4 ? r3.slice(a5) : r3[a5]; - if (o4 && (a5 = e3.length), s2 && (!f4 || o4 && f4.length === 0)) - return console.error(`Error: Missing required parameter ${d3(i4)} -`), n3(), process.exit(1); - t2[l3] = f4; - } -} -function W2(t2) { - return t2 === void 0 || t2 !== false; -} -function x2(t2, e3, r3, n3) { - const a5 = { ...e3.flags }, i4 = e3.version; - i4 && (a5.version = { type: Boolean, description: "Show version" }); - const { help: s2 } = e3, o4 = W2(s2); - o4 && !("help" in a5) && (a5.help = { type: Boolean, alias: "h", description: "Show help" }); - const l3 = U(a5, n3, { ignore: e3.ignoreArgv }), f4 = () => { - console.log(e3.version); - }; - if (i4 && l3.flags.version === true) - return f4(), process.exit(0); - const p4 = new M2(), O5 = o4 && s2?.render ? s2.render : (c5) => p4.render(c5), u4 = (c5) => { - const m5 = U3({ ...e3, ...c5 ? { help: c5 } : {}, flags: a5 }); - console.log(O5(m5, p4)); - }; - if (o4 && l3.flags.help === true) - return u4(), process.exit(0); - if (e3.parameters) { - let { parameters: c5 } = e3, m5 = l3._; - const g4 = c5.indexOf("--"), v5 = c5.slice(g4 + 1), h5 = /* @__PURE__ */ Object.create(null); - if (g4 > -1 && v5.length > 0) { - c5 = c5.slice(0, g4); - const E4 = l3._["--"]; - m5 = m5.slice(0, -E4.length || void 0), b3(h5, w3(c5), m5, u4), b3(h5, w3(v5), E4, u4); - } else - b3(h5, w3(c5), m5, u4); - Object.assign(l3._, h5); - } - const $6 = { ...l3, showVersion: f4, showHelp: u4 }; - return typeof r3 == "function" && r3($6), { command: t2, ...$6 }; -} -function z2(t2, e3) { - const r3 = /* @__PURE__ */ new Map(); - for (const n3 of e3) { - const a5 = [n3.options.name], { alias: i4 } = n3.options; - i4 && (Array.isArray(i4) ? a5.push(...i4) : a5.push(i4)); - for (const s2 of a5) { - if (r3.has(s2)) - throw new Error(`Duplicate command name found: ${d3(s2)}`); - r3.set(s2, n3); - } - } - return r3.get(t2); -} -function Z2(t2, e3, r3 = process.argv.slice(2)) { - if (!t2) - throw new Error("Options is required"); - if ("name" in t2 && (!t2.name || !y2.test(t2.name))) - throw new Error(`Invalid script name: ${d3(t2.name)}`); - const n3 = r3[0]; - if (t2.commands && y2.test(n3)) { - const a5 = z2(n3, t2.commands); - if (a5) - return x2(a5.options.name, { ...a5.options, parent: t2 }, a5.callback, r3.slice(1)); - } - return x2(void 0, t2, e3, r3); -} -function G3(t2, e3) { - if (!t2) - throw new Error("Command options are required"); - const { name: r3 } = t2; - if (t2.name === void 0) - throw new Error("Command name is required"); - if (!y2.test(r3)) - throw new Error(`Invalid command name ${JSON.stringify(r3)}. Command names must be one word.`); - return { options: t2, callback: e3 }; -} - -// package.json -var package_default = { - name: "opencommit", - version: "3.1.2", - description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}", - keywords: [ - "git", - "chatgpt", - "gpt", - "ai", - "openai", - "opencommit", - "aicommit", - "aicommits", - "gptcommit", - "commit", - "ollama" - ], - main: "cli.js", - bin: { - opencommit: "./out/cli.cjs", - oco: "./out/cli.cjs" - }, - repository: { - url: "https://github.com/di-sukharev/opencommit" - }, - type: "module", - author: "https://github.com/di-sukharev", - license: "MIT", - files: [ - "out/cli.cjs", - "out/tiktoken_bg.wasm" - ], - release: { - branches: [ - "master" - ] - }, - publishConfig: { - access: "public" - }, - scripts: { - watch: "npm run -S build -- --sourcemap --watch", - start: "node ./out/cli.cjs", - "ollama:start": "OCO_AI_PROVIDER='ollama' node ./out/cli.cjs", - dev: "ts-node ./src/cli.ts", - "dev:gemini": "OCO_AI_PROVIDER='gemini' ts-node ./src/cli.ts", - build: "rimraf out && node esbuild.config.js", - "build:push": "npm run build && git add . && git commit -m 'build' && git push", - deploy: "npm run build:push && git push --tags && npm publish --tag latest", - "deploy:patch": "npm version patch && npm run deploy", - lint: "eslint src --ext ts && tsc --noEmit", - format: "prettier --write src", - test: "node --no-warnings --experimental-vm-modules $( [ -f ./node_modules/.bin/jest ] && echo ./node_modules/.bin/jest || which jest ) test/unit", - "test:all": "npm run test:unit:docker && npm run test:e2e:docker", - "test:docker-build": "docker build -t oco-test -f test/Dockerfile .", - "test:unit": "NODE_OPTIONS=--experimental-vm-modules jest test/unit", - "test:unit:docker": "npm run test:docker-build && DOCKER_CONTENT_TRUST=0 docker run --rm oco-test npm run test:unit", - "test:e2e": "npm run test:e2e:setup && jest test/e2e", - "test:e2e:setup": "sh test/e2e/setup.sh", - "test:e2e:docker": "npm run test:docker-build && DOCKER_CONTENT_TRUST=0 docker run --rm oco-test npm run test:e2e" - }, - devDependencies: { - "@commitlint/types": "^17.4.4", - "@types/ini": "^1.3.31", - "@types/inquirer": "^9.0.3", - "@types/jest": "^29.5.12", - "@types/node": "^16.18.14", - "@typescript-eslint/eslint-plugin": "^5.45.0", - "@typescript-eslint/parser": "^5.45.0", - "cli-testing-library": "^2.0.2", - dotenv: "^16.0.3", - esbuild: "^0.15.18", - eslint: "^8.28.0", - jest: "^29.7.0", - prettier: "^2.8.4", - "ts-jest": "^29.1.2", - "ts-node": "^10.9.1", - typescript: "^4.9.3" - }, - dependencies: { - "@actions/core": "^1.10.0", - "@actions/exec": "^1.1.1", - "@actions/github": "^5.1.1", - "@anthropic-ai/sdk": "^0.19.2", - "@azure/openai": "^1.0.0-beta.12", - "@clack/prompts": "^0.6.1", - "@dqbd/tiktoken": "^1.0.2", - "@google/generative-ai": "^0.11.4", - "@octokit/webhooks-schemas": "^6.11.0", - "@octokit/webhooks-types": "^6.11.0", - ai: "^2.2.14", - axios: "^1.3.4", - chalk: "^5.2.0", - cleye: "^1.3.2", - crypto: "^1.0.1", - execa: "^7.0.0", - ignore: "^5.2.4", - ini: "^3.0.1", - inquirer: "^9.1.4", - openai: "^4.56.0" - } -}; - -// node_modules/@clack/core/dist/index.mjs -var import_sisteransi = __toESM(require_src(), 1); -var import_node_process = require("node:process"); -var f = __toESM(require("node:readline"), 1); -var import_node_readline = __toESM(require("node:readline"), 1); -var import_node_tty = require("node:tty"); -function q3({ onlyFirst: t2 = false } = {}) { - const u4 = ["[\\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(u4, t2 ? void 0 : "g"); -} -function S3(t2) { - if (typeof t2 != "string") - throw new TypeError(`Expected a \`string\`, got \`${typeof t2}\``); - return t2.replace(q3(), ""); -} -function j2(t2) { - return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2; -} -var M3 = { exports: {} }; -(function(t2) { - var u4 = {}; - t2.exports = u4, u4.eastAsianWidth = function(e3) { - var s2 = e3.charCodeAt(0), C5 = e3.length == 2 ? e3.charCodeAt(1) : 0, D5 = s2; - return 55296 <= s2 && s2 <= 56319 && 56320 <= C5 && C5 <= 57343 && (s2 &= 1023, C5 &= 1023, D5 = s2 << 10 | C5, D5 += 65536), D5 == 12288 || 65281 <= D5 && D5 <= 65376 || 65504 <= D5 && D5 <= 65510 ? "F" : D5 == 8361 || 65377 <= D5 && D5 <= 65470 || 65474 <= D5 && D5 <= 65479 || 65482 <= D5 && D5 <= 65487 || 65490 <= D5 && D5 <= 65495 || 65498 <= D5 && D5 <= 65500 || 65512 <= D5 && D5 <= 65518 ? "H" : 4352 <= D5 && D5 <= 4447 || 4515 <= D5 && D5 <= 4519 || 4602 <= D5 && D5 <= 4607 || 9001 <= D5 && D5 <= 9002 || 11904 <= D5 && D5 <= 11929 || 11931 <= D5 && D5 <= 12019 || 12032 <= D5 && D5 <= 12245 || 12272 <= D5 && D5 <= 12283 || 12289 <= D5 && D5 <= 12350 || 12353 <= D5 && D5 <= 12438 || 12441 <= D5 && D5 <= 12543 || 12549 <= D5 && D5 <= 12589 || 12593 <= D5 && D5 <= 12686 || 12688 <= D5 && D5 <= 12730 || 12736 <= D5 && D5 <= 12771 || 12784 <= D5 && D5 <= 12830 || 12832 <= D5 && D5 <= 12871 || 12880 <= D5 && D5 <= 13054 || 13056 <= D5 && D5 <= 19903 || 19968 <= D5 && D5 <= 42124 || 42128 <= D5 && D5 <= 42182 || 43360 <= D5 && D5 <= 43388 || 44032 <= D5 && D5 <= 55203 || 55216 <= D5 && D5 <= 55238 || 55243 <= D5 && D5 <= 55291 || 63744 <= D5 && D5 <= 64255 || 65040 <= D5 && D5 <= 65049 || 65072 <= D5 && D5 <= 65106 || 65108 <= D5 && D5 <= 65126 || 65128 <= D5 && D5 <= 65131 || 110592 <= D5 && D5 <= 110593 || 127488 <= D5 && D5 <= 127490 || 127504 <= D5 && D5 <= 127546 || 127552 <= D5 && D5 <= 127560 || 127568 <= D5 && D5 <= 127569 || 131072 <= D5 && D5 <= 194367 || 177984 <= D5 && D5 <= 196605 || 196608 <= D5 && D5 <= 262141 ? "W" : 32 <= D5 && D5 <= 126 || 162 <= D5 && D5 <= 163 || 165 <= D5 && D5 <= 166 || D5 == 172 || D5 == 175 || 10214 <= D5 && D5 <= 10221 || 10629 <= D5 && D5 <= 10630 ? "Na" : D5 == 161 || D5 == 164 || 167 <= D5 && D5 <= 168 || D5 == 170 || 173 <= D5 && D5 <= 174 || 176 <= D5 && D5 <= 180 || 182 <= D5 && D5 <= 186 || 188 <= D5 && D5 <= 191 || D5 == 198 || D5 == 208 || 215 <= D5 && D5 <= 216 || 222 <= D5 && D5 <= 225 || D5 == 230 || 232 <= D5 && D5 <= 234 || 236 <= D5 && D5 <= 237 || D5 == 240 || 242 <= D5 && D5 <= 243 || 247 <= D5 && D5 <= 250 || D5 == 252 || D5 == 254 || D5 == 257 || D5 == 273 || D5 == 275 || D5 == 283 || 294 <= D5 && D5 <= 295 || D5 == 299 || 305 <= D5 && D5 <= 307 || D5 == 312 || 319 <= D5 && D5 <= 322 || D5 == 324 || 328 <= D5 && D5 <= 331 || D5 == 333 || 338 <= D5 && D5 <= 339 || 358 <= D5 && D5 <= 359 || D5 == 363 || D5 == 462 || D5 == 464 || D5 == 466 || D5 == 468 || D5 == 470 || D5 == 472 || D5 == 474 || D5 == 476 || D5 == 593 || D5 == 609 || D5 == 708 || D5 == 711 || 713 <= D5 && D5 <= 715 || D5 == 717 || D5 == 720 || 728 <= D5 && D5 <= 731 || D5 == 733 || D5 == 735 || 768 <= D5 && D5 <= 879 || 913 <= D5 && D5 <= 929 || 931 <= D5 && D5 <= 937 || 945 <= D5 && D5 <= 961 || 963 <= D5 && D5 <= 969 || D5 == 1025 || 1040 <= D5 && D5 <= 1103 || D5 == 1105 || D5 == 8208 || 8211 <= D5 && D5 <= 8214 || 8216 <= D5 && D5 <= 8217 || 8220 <= D5 && D5 <= 8221 || 8224 <= D5 && D5 <= 8226 || 8228 <= D5 && D5 <= 8231 || D5 == 8240 || 8242 <= D5 && D5 <= 8243 || D5 == 8245 || D5 == 8251 || D5 == 8254 || D5 == 8308 || D5 == 8319 || 8321 <= D5 && D5 <= 8324 || D5 == 8364 || D5 == 8451 || D5 == 8453 || D5 == 8457 || D5 == 8467 || D5 == 8470 || 8481 <= D5 && D5 <= 8482 || D5 == 8486 || D5 == 8491 || 8531 <= D5 && D5 <= 8532 || 8539 <= D5 && D5 <= 8542 || 8544 <= D5 && D5 <= 8555 || 8560 <= D5 && D5 <= 8569 || D5 == 8585 || 8592 <= D5 && D5 <= 8601 || 8632 <= D5 && D5 <= 8633 || D5 == 8658 || D5 == 8660 || D5 == 8679 || D5 == 8704 || 8706 <= D5 && D5 <= 8707 || 8711 <= D5 && D5 <= 8712 || D5 == 8715 || D5 == 8719 || D5 == 8721 || D5 == 8725 || D5 == 8730 || 8733 <= D5 && D5 <= 8736 || D5 == 8739 || D5 == 8741 || 8743 <= D5 && D5 <= 8748 || D5 == 8750 || 8756 <= D5 && D5 <= 8759 || 8764 <= D5 && D5 <= 8765 || D5 == 8776 || D5 == 8780 || D5 == 8786 || 8800 <= D5 && D5 <= 8801 || 8804 <= D5 && D5 <= 8807 || 8810 <= D5 && D5 <= 8811 || 8814 <= D5 && D5 <= 8815 || 8834 <= D5 && D5 <= 8835 || 8838 <= D5 && D5 <= 8839 || D5 == 8853 || D5 == 8857 || D5 == 8869 || D5 == 8895 || D5 == 8978 || 9312 <= D5 && D5 <= 9449 || 9451 <= D5 && D5 <= 9547 || 9552 <= D5 && D5 <= 9587 || 9600 <= D5 && D5 <= 9615 || 9618 <= D5 && D5 <= 9621 || 9632 <= D5 && D5 <= 9633 || 9635 <= D5 && D5 <= 9641 || 9650 <= D5 && D5 <= 9651 || 9654 <= D5 && D5 <= 9655 || 9660 <= D5 && D5 <= 9661 || 9664 <= D5 && D5 <= 9665 || 9670 <= D5 && D5 <= 9672 || D5 == 9675 || 9678 <= D5 && D5 <= 9681 || 9698 <= D5 && D5 <= 9701 || D5 == 9711 || 9733 <= D5 && D5 <= 9734 || D5 == 9737 || 9742 <= D5 && D5 <= 9743 || 9748 <= D5 && D5 <= 9749 || D5 == 9756 || D5 == 9758 || D5 == 9792 || D5 == 9794 || 9824 <= D5 && D5 <= 9825 || 9827 <= D5 && D5 <= 9829 || 9831 <= D5 && D5 <= 9834 || 9836 <= D5 && D5 <= 9837 || D5 == 9839 || 9886 <= D5 && D5 <= 9887 || 9918 <= D5 && D5 <= 9919 || 9924 <= D5 && D5 <= 9933 || 9935 <= D5 && D5 <= 9953 || D5 == 9955 || 9960 <= D5 && D5 <= 9983 || D5 == 10045 || D5 == 10071 || 10102 <= D5 && D5 <= 10111 || 11093 <= D5 && D5 <= 11097 || 12872 <= D5 && D5 <= 12879 || 57344 <= D5 && D5 <= 63743 || 65024 <= D5 && D5 <= 65039 || D5 == 65533 || 127232 <= D5 && D5 <= 127242 || 127248 <= D5 && D5 <= 127277 || 127280 <= D5 && D5 <= 127337 || 127344 <= D5 && D5 <= 127386 || 917760 <= D5 && D5 <= 917999 || 983040 <= D5 && D5 <= 1048573 || 1048576 <= D5 && D5 <= 1114109 ? "A" : "N"; - }, u4.characterLength = function(e3) { - var s2 = this.eastAsianWidth(e3); - return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1; - }; - function F5(e3) { - return e3.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || []; - } - u4.length = function(e3) { - for (var s2 = F5(e3), C5 = 0, D5 = 0; D5 < s2.length; D5++) - C5 = C5 + this.characterLength(s2[D5]); - return C5; - }, u4.slice = function(e3, s2, C5) { - textLen = u4.length(e3), s2 = s2 || 0, C5 = C5 || 1, s2 < 0 && (s2 = textLen + s2), C5 < 0 && (C5 = textLen + C5); - for (var D5 = "", i4 = 0, n3 = F5(e3), E4 = 0; E4 < n3.length; E4++) { - var h5 = n3[E4], o4 = u4.length(h5); - if (i4 >= s2 - (o4 == 2 ? 1 : 0)) - if (i4 + o4 <= C5) - D5 += h5; - else - break; - i4 += o4; + function isWeakRef(x5) { + if (!weakRefDeref || !x5 || typeof x5 !== "object") { + return false; + } + try { + weakRefDeref.call(x5); + return true; + } catch (e3) { + } + return false; } - return D5; - }; -})(M3); -var J3 = M3.exports; -var Q2 = j2(J3); -var X2 = function() { - return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\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])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\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\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\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-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*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\u26A7\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-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\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[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; -}; -var DD2 = j2(X2); -function A2(t2, u4 = {}) { - if (typeof t2 != "string" || t2.length === 0 || (u4 = { ambiguousIsNarrow: true, ...u4 }, t2 = S3(t2), t2.length === 0)) - return 0; - t2 = t2.replace(DD2(), " "); - const F5 = u4.ambiguousIsNarrow ? 1 : 2; - let e3 = 0; - for (const s2 of t2) { - const C5 = s2.codePointAt(0); - if (C5 <= 31 || C5 >= 127 && C5 <= 159 || C5 >= 768 && C5 <= 879) - continue; - switch (Q2.eastAsianWidth(s2)) { - case "F": - case "W": - e3 += 2; - break; - case "A": - e3 += F5; - break; - default: - e3 += 1; + function isSet(x5) { + if (!setSize || !x5 || typeof x5 !== "object") { + return false; + } + try { + setSize.call(x5); + try { + mapSize.call(x5); + } catch (m5) { + return true; + } + return x5 instanceof Set; + } catch (e3) { + } + return false; } - } - return e3; -} -var m3 = 10; -var T4 = (t2 = 0) => (u4) => `\x1B[${u4 + t2}m`; -var P2 = (t2 = 0) => (u4) => `\x1B[${38 + t2};5;${u4}m`; -var W3 = (t2 = 0) => (u4, F5, e3) => `\x1B[${38 + t2};2;${u4};${F5};${e3}m`; -var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], 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], blackBright: [90, 39], gray: [90, 39], grey: [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], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; -Object.keys(r.modifier); -var uD2 = Object.keys(r.color); -var FD2 = Object.keys(r.bgColor); -[...uD2, ...FD2]; -function tD2() { - const t2 = /* @__PURE__ */ new Map(); - for (const [u4, F5] of Object.entries(r)) { - for (const [e3, s2] of Object.entries(F5)) - r[e3] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F5[e3] = r[e3], t2.set(s2[0], s2[1]); - Object.defineProperty(r, u4, { value: F5, enumerable: false }); - } - return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T4(), r.color.ansi256 = P2(), r.color.ansi16m = W3(), r.bgColor.ansi = T4(m3), r.bgColor.ansi256 = P2(m3), r.bgColor.ansi16m = W3(m3), Object.defineProperties(r, { rgbToAnsi256: { value: (u4, F5, e3) => u4 === F5 && F5 === e3 ? u4 < 8 ? 16 : u4 > 248 ? 231 : Math.round((u4 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u4 / 255 * 5) + 6 * Math.round(F5 / 255 * 5) + Math.round(e3 / 255 * 5), enumerable: false }, hexToRgb: { value: (u4) => { - const F5 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u4.toString(16)); - if (!F5) - return [0, 0, 0]; - let [e3] = F5; - e3.length === 3 && (e3 = [...e3].map((C5) => C5 + C5).join("")); - const s2 = Number.parseInt(e3, 16); - return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255]; - }, enumerable: false }, hexToAnsi256: { value: (u4) => r.rgbToAnsi256(...r.hexToRgb(u4)), enumerable: false }, ansi256ToAnsi: { value: (u4) => { - if (u4 < 8) - return 30 + u4; - if (u4 < 16) - return 90 + (u4 - 8); - let F5, e3, s2; - if (u4 >= 232) - F5 = ((u4 - 232) * 10 + 8) / 255, e3 = F5, s2 = F5; - else { - u4 -= 16; - const i4 = u4 % 36; - F5 = Math.floor(u4 / 36) / 5, e3 = Math.floor(i4 / 6) / 5, s2 = i4 % 6 / 5; + function isWeakSet(x5) { + if (!weakSetHas || !x5 || typeof x5 !== "object") { + return false; + } + try { + weakSetHas.call(x5, weakSetHas); + try { + weakMapHas.call(x5, weakMapHas); + } catch (s2) { + return true; + } + return x5 instanceof WeakSet; + } catch (e3) { + } + return false; } - const C5 = Math.max(F5, e3, s2) * 2; - if (C5 === 0) - return 30; - let D5 = 30 + (Math.round(s2) << 2 | Math.round(e3) << 1 | Math.round(F5)); - return C5 === 2 && (D5 += 60), D5; - }, enumerable: false }, rgbToAnsi: { value: (u4, F5, e3) => r.ansi256ToAnsi(r.rgbToAnsi256(u4, F5, e3)), enumerable: false }, hexToAnsi: { value: (u4) => r.ansi256ToAnsi(r.hexToAnsi256(u4)), enumerable: false } }), r; -} -var eD2 = tD2(); -var g2 = /* @__PURE__ */ new Set(["\x1B", "\x9B"]); -var sD2 = 39; -var b4 = "\x07"; -var O3 = "["; -var CD2 = "]"; -var I3 = "m"; -var w4 = `${CD2}8;;`; -var N3 = (t2) => `${g2.values().next().value}${O3}${t2}${I3}`; -var L4 = (t2) => `${g2.values().next().value}${w4}${t2}${b4}`; -var iD2 = (t2) => t2.split(" ").map((u4) => A2(u4)); -var y3 = (t2, u4, F5) => { - const e3 = [...u4]; - let s2 = false, C5 = false, D5 = A2(S3(t2[t2.length - 1])); - for (const [i4, n3] of e3.entries()) { - const E4 = A2(n3); - if (D5 + E4 <= F5 ? t2[t2.length - 1] += n3 : (t2.push(n3), D5 = 0), g2.has(n3) && (s2 = true, C5 = e3.slice(i4 + 1).join("").startsWith(w4)), s2) { - C5 ? n3 === b4 && (s2 = false, C5 = false) : n3 === I3 && (s2 = false); - continue; + function isElement(x5) { + if (!x5 || typeof x5 !== "object") { + return false; + } + if (typeof HTMLElement !== "undefined" && x5 instanceof HTMLElement) { + return true; + } + return typeof x5.nodeName === "string" && typeof x5.getAttribute === "function"; } - D5 += E4, D5 === F5 && i4 < e3.length - 1 && (t2.push(""), D5 = 0); - } - !D5 && t2[t2.length - 1].length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop()); -}; -var rD2 = (t2) => { - const u4 = t2.split(" "); - let F5 = u4.length; - for (; F5 > 0 && !(A2(u4[F5 - 1]) > 0); ) - F5--; - return F5 === u4.length ? t2 : u4.slice(0, F5).join(" ") + u4.slice(F5).join(""); -}; -var ED2 = (t2, u4, F5 = {}) => { - if (F5.trim !== false && t2.trim() === "") - return ""; - let e3 = "", s2, C5; - const D5 = iD2(t2); - let i4 = [""]; - for (const [E4, h5] of t2.split(" ").entries()) { - F5.trim !== false && (i4[i4.length - 1] = i4[i4.length - 1].trimStart()); - let o4 = A2(i4[i4.length - 1]); - if (E4 !== 0 && (o4 >= u4 && (F5.wordWrap === false || F5.trim === false) && (i4.push(""), o4 = 0), (o4 > 0 || F5.trim === false) && (i4[i4.length - 1] += " ", o4++)), F5.hard && D5[E4] > u4) { - const B3 = u4 - o4, p4 = 1 + Math.floor((D5[E4] - B3 - 1) / u4); - Math.floor((D5[E4] - 1) / u4) < p4 && i4.push(""), y3(i4, h5, u4); - continue; + function inspectString(str2, opts) { + if (str2.length > opts.maxStringLength) { + var remaining = str2.length - opts.maxStringLength; + var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : ""); + return inspectString($slice.call(str2, 0, opts.maxStringLength), opts) + trailer; + } + var s2 = $replace.call($replace.call(str2, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s2, "single", opts); } - if (o4 + D5[E4] > u4 && o4 > 0 && D5[E4] > 0) { - if (F5.wordWrap === false && o4 < u4) { - y3(i4, h5, u4); - continue; + function lowbyte(c3) { + var n2 = c3.charCodeAt(0); + var x5 = { + 8: "b", + 9: "t", + 10: "n", + 12: "f", + 13: "r" + }[n2]; + if (x5) { + return "\\" + x5; } - i4.push(""); + return "\\x" + (n2 < 16 ? "0" : "") + $toUpperCase.call(n2.toString(16)); } - if (o4 + D5[E4] > u4 && F5.wordWrap === false) { - y3(i4, h5, u4); - continue; + function markBoxed(str2) { + return "Object(" + str2 + ")"; } - i4[i4.length - 1] += h5; - } - F5.trim !== false && (i4 = i4.map((E4) => rD2(E4))); - const n3 = [...i4.join(` -`)]; - for (const [E4, h5] of n3.entries()) { - if (e3 += h5, g2.has(h5)) { - const { groups: B3 } = new RegExp(`(?:\\${O3}(?\\d+)m|\\${w4}(?.*)${b4})`).exec(n3.slice(E4).join("")) || { groups: {} }; - if (B3.code !== void 0) { - const p4 = Number.parseFloat(B3.code); - s2 = p4 === sD2 ? void 0 : p4; - } else - B3.uri !== void 0 && (C5 = B3.uri.length === 0 ? void 0 : B3.uri); + function weakCollectionOf(type2) { + return type2 + " { ? }"; } - const o4 = eD2.codes.get(Number(s2)); - n3[E4 + 1] === ` -` ? (C5 && (e3 += L4("")), s2 && o4 && (e3 += N3(o4))) : h5 === ` -` && (s2 && o4 && (e3 += N3(s2)), C5 && (e3 += L4(C5))); - } - return e3; -}; -function R4(t2, u4, F5) { - return String(t2).normalize().replace(/\r\n/g, ` -`).split(` -`).map((e3) => ED2(e3, u4, F5)).join(` -`); -} -var oD2 = Object.defineProperty; -var nD2 = (t2, u4, F5) => u4 in t2 ? oD2(t2, u4, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u4] = F5; -var a = (t2, u4, F5) => (nD2(t2, typeof u4 != "symbol" ? u4 + "" : u4, F5), F5); -function aD2(t2, u4) { - if (t2 === u4) - return; - const F5 = t2.split(` -`), e3 = u4.split(` -`), s2 = []; - for (let C5 = 0; C5 < Math.max(F5.length, e3.length); C5++) - F5[C5] !== e3[C5] && s2.push(C5); - return s2; -} -var V4 = Symbol("clack:cancel"); -function hD2(t2) { - return t2 === V4; -} -function v3(t2, u4) { - t2.isTTY && t2.setRawMode(u4); -} -var z3 = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]); -var lD2 = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]); -var x3 = class { - constructor({ render: u4, input: F5 = import_node_process.stdin, output: e3 = import_node_process.stdout, ...s2 }, C5 = true) { - a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u4.bind(this), this._track = C5, this.input = F5, this.output = e3; - } - prompt() { - const u4 = new import_node_tty.WriteStream(0); - return u4._write = (F5, e3, s2) => { - this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2(); - }, this.input.pipe(u4), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u4, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v3(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F5, e3) => { - this.once("submit", () => { - this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(this.value); - }), this.once("cancel", () => { - this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(V4); - }); - }); - } - on(u4, F5) { - const e3 = this.subscribers.get(u4) ?? []; - e3.push({ cb: F5 }), this.subscribers.set(u4, e3); - } - once(u4, F5) { - const e3 = this.subscribers.get(u4) ?? []; - e3.push({ cb: F5, once: true }), this.subscribers.set(u4, e3); - } - emit(u4, ...F5) { - const e3 = this.subscribers.get(u4) ?? [], s2 = []; - for (const C5 of e3) - C5.cb(...F5), C5.once && s2.push(() => e3.splice(e3.indexOf(C5), 1)); - for (const C5 of s2) - C5(); - } - unsubscribe() { - this.subscribers.clear(); - } - onKeypress(u4, F5) { - if (this.state === "error" && (this.state = "active"), F5?.name && !this._track && z3.has(F5.name) && this.emit("cursor", z3.get(F5.name)), F5?.name && lD2.has(F5.name) && this.emit("cursor", F5.name), u4 && (u4.toLowerCase() === "y" || u4.toLowerCase() === "n") && this.emit("confirm", u4.toLowerCase() === "y"), u4 === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u4 && this.emit("key", u4.toLowerCase()), F5?.name === "return") { - if (this.opts.validate) { - const e3 = this.opts.validate(this.value); - e3 && (this.error = e3, this.state = "error", this.rl.write(this.value)); + function collectionOf(type2, size, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", "); + return type2 + " (" + size + ") {" + joinedEntries + "}"; + } + function singleLineValues(xs) { + for (var i3 = 0; i3 < xs.length; i3++) { + if (indexOf(xs[i3], "\n") >= 0) { + return false; + } } - this.state !== "error" && (this.state = "submit"); + return true; } - u4 === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close(); - } - close() { - this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(` -`), v3(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe(); - } - restoreCursor() { - const u4 = R4(this._prevFrame, process.stdout.columns, { hard: true }).split(` -`).length - 1; - this.output.write(import_sisteransi.cursor.move(-999, u4 * -1)); - } - render() { - const u4 = R4(this._render(this) ?? "", process.stdout.columns, { hard: true }); - if (u4 !== this._prevFrame) { - if (this.state === "initial") - this.output.write(import_sisteransi.cursor.hide); - else { - const F5 = aD2(this._prevFrame, u4); - if (this.restoreCursor(), F5 && F5?.length === 1) { - const e3 = F5[0]; - this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.lines(1)); - const s2 = u4.split(` -`); - this.output.write(s2[e3]), this._prevFrame = u4, this.output.write(import_sisteransi.cursor.move(0, s2.length - e3 - 1)); - return; - } else if (F5 && F5?.length > 1) { - const e3 = F5[0]; - this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.down()); - const s2 = u4.split(` -`).slice(e3); - this.output.write(s2.join(` -`)), this._prevFrame = u4; - return; + function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === " ") { + baseIndent = " "; + } else if (typeof opts.indent === "number" && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), " "); + } else { + return null; + } + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; + } + function indentedJoin(xs, indent) { + if (xs.length === 0) { + return ""; + } + var lineJoiner = "\n" + indent.prev + indent.base; + return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev; + } + function arrObjKeys(obj, inspect3) { + var isArr = isArray2(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i3 = 0; i3 < obj.length; i3++) { + xs[i3] = has(obj, i3) ? inspect3(obj[i3], obj) : ""; + } + } + var syms = typeof gOPS === "function" ? gOPS(obj) : []; + var symMap; + if (hasShammedSymbols) { + symMap = {}; + for (var k7 = 0; k7 < syms.length; k7++) { + symMap["$" + syms[k7]] = syms[k7]; + } + } + for (var key in obj) { + if (!has(obj, key)) { + continue; + } + if (isArr && String(Number(key)) === key && key < obj.length) { + continue; + } + if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) { + continue; + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect3(key, obj) + ": " + inspect3(obj[key], obj)); + } else { + xs.push(key + ": " + inspect3(obj[key], obj)); + } + } + if (typeof gOPS === "function") { + for (var j4 = 0; j4 < syms.length; j4++) { + if (isEnumerable.call(obj, syms[j4])) { + xs.push("[" + inspect3(syms[j4]) + "]: " + inspect3(obj[syms[j4]], obj)); + } } - this.output.write(import_sisteransi.erase.down()); } - this.output.write(u4), this.state === "initial" && (this.state = "active"), this._prevFrame = u4; + return xs; } } -}; -var xD2 = class extends x3 { - get cursor() { - return this.value ? 0 : 1; - } - get _value() { - return this.cursor === 0; - } - constructor(u4) { - super(u4, false), this.value = !!u4.initialValue, this.on("value", () => { - this.value = this._value; - }), this.on("confirm", (F5) => { - this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F5, this.state = "submit", this.close(); - }), this.on("cursor", () => { - this.value = !this.value; - }); - } -}; -var pD2 = Object.defineProperty; -var fD2 = (t2, u4, F5) => u4 in t2 ? pD2(t2, u4, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u4] = F5; -var K3 = (t2, u4, F5) => (fD2(t2, typeof u4 != "symbol" ? u4 + "" : u4, F5), F5); -var gD2 = class extends x3 { - constructor(u4) { - super(u4, false), K3(this, "options"), K3(this, "cursor", 0), this.options = u4.options, this.value = [...u4.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F5 }) => F5 === u4.cursorAt), 0), this.on("key", (F5) => { - F5 === "a" && this.toggleAll(); - }), this.on("cursor", (F5) => { - switch (F5) { - case "left": - case "up": - this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1; - break; - case "down": - case "right": - this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1; - break; - case "space": - this.toggleValue(); - break; +}); + +// node_modules/side-channel/index.js +var require_side_channel = __commonJS({ + "node_modules/side-channel/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var callBound = require_callBound(); + var inspect3 = require_object_inspect(); + var $TypeError = require_type(); + var $WeakMap = GetIntrinsic("%WeakMap%", true); + var $Map = GetIntrinsic("%Map%", true); + var $weakMapGet = callBound("WeakMap.prototype.get", true); + var $weakMapSet = callBound("WeakMap.prototype.set", true); + var $weakMapHas = callBound("WeakMap.prototype.has", true); + var $mapGet = callBound("Map.prototype.get", true); + var $mapSet = callBound("Map.prototype.set", true); + var $mapHas = callBound("Map.prototype.has", true); + var listGetNode = function(list, key) { + var prev = list; + var curr; + for (; (curr = prev.next) !== null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + curr.next = list.next; + list.next = curr; + return curr; + } + } + }; + var listGet = function(objects, key) { + var node = listGetNode(objects, key); + return node && node.value; + }; + var listSet = function(objects, key, value) { + var node = listGetNode(objects, key); + if (node) { + node.value = value; + } else { + objects.next = { + key, + next: objects.next, + value + }; } - }); - } - get _value() { - return this.options[this.cursor].value; - } - toggleAll() { - const u4 = this.value.length === this.options.length; - this.value = u4 ? [] : this.options.map((F5) => F5.value); + }; + var listHas = function(objects, key) { + return !!listGetNode(objects, key); + }; + module2.exports = function getSideChannel() { + var $wm; + var $m; + var $o; + var channel = { + assert: function(key) { + if (!channel.has(key)) { + throw new $TypeError("Side channel does not contain " + inspect3(key)); + } + }, + get: function(key) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if ($wm) { + return $weakMapGet($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapGet($m, key); + } + } else { + if ($o) { + return listGet($o, key); + } + } + }, + has: function(key) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if ($wm) { + return $weakMapHas($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapHas($m, key); + } + } else { + if ($o) { + return listHas($o, key); + } + } + return false; + }, + set: function(key, value) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if (!$wm) { + $wm = new $WeakMap(); + } + $weakMapSet($wm, key, value); + } else if ($Map) { + if (!$m) { + $m = new $Map(); + } + $mapSet($m, key, value); + } else { + if (!$o) { + $o = { key: {}, next: null }; + } + listSet($o, key, value); + } + } + }; + return channel; + }; } - toggleValue() { - const u4 = this.value.includes(this._value); - this.value = u4 ? this.value.filter((F5) => F5 !== this._value) : [...this.value, this._value]; +}); + +// node_modules/qs/lib/formats.js +var require_formats = __commonJS({ + "node_modules/qs/lib/formats.js"(exports, module2) { + "use strict"; + var replace = String.prototype.replace; + var percentTwenties = /%20/g; + var Format = { + RFC1738: "RFC1738", + RFC3986: "RFC3986" + }; + module2.exports = { + "default": Format.RFC3986, + formatters: { + RFC1738: function(value) { + return replace.call(value, percentTwenties, "+"); + }, + RFC3986: function(value) { + return String(value); + } + }, + RFC1738: Format.RFC1738, + RFC3986: Format.RFC3986 + }; } -}; -var bD2 = Object.defineProperty; -var wD2 = (t2, u4, F5) => u4 in t2 ? bD2(t2, u4, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u4] = F5; -var Z3 = (t2, u4, F5) => (wD2(t2, typeof u4 != "symbol" ? u4 + "" : u4, F5), F5); -var yD = class extends x3 { - constructor(u4) { - super(u4, false), Z3(this, "options"), Z3(this, "cursor", 0), this.options = u4.options, this.cursor = this.options.findIndex(({ value: F5 }) => F5 === u4.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F5) => { - switch (F5) { - case "left": - case "up": - this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1; - break; - case "down": - case "right": - this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1; - break; +}); + +// node_modules/qs/lib/utils.js +var require_utils2 = __commonJS({ + "node_modules/qs/lib/utils.js"(exports, module2) { + "use strict"; + var formats = require_formats(); + var has = Object.prototype.hasOwnProperty; + var isArray2 = Array.isArray; + var hexTable = function() { + var array = []; + for (var i3 = 0; i3 < 256; ++i3) { + array.push("%" + ((i3 < 16 ? "0" : "") + i3.toString(16)).toUpperCase()); + } + return array; + }(); + var compactQueue = function compactQueue2(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + if (isArray2(obj)) { + var compacted = []; + for (var j4 = 0; j4 < obj.length; ++j4) { + if (typeof obj[j4] !== "undefined") { + compacted.push(obj[j4]); + } + } + item.obj[item.prop] = compacted; + } } - this.changeValue(); - }); - } - get _value() { - return this.options[this.cursor]; - } - changeValue() { - this.value = this._value.value; - } -}; -var PD = globalThis.process.platform.startsWith("win"); -function WD({ input: t2 = import_node_process.stdin, output: u4 = import_node_process.stdout, overwrite: F5 = true, hideCursor: e3 = true } = {}) { - const s2 = f.createInterface({ input: t2, output: u4, prompt: "", tabSize: 1 }); - f.emitKeypressEvents(t2, s2), t2.isTTY && t2.setRawMode(true); - const C5 = (D5, { name: i4 }) => { - if (String(D5) === "" && process.exit(0), !F5) - return; - let n3 = i4 === "return" ? 0 : -1, E4 = i4 === "return" ? -1 : 0; - f.moveCursor(u4, n3, E4, () => { - f.clearLine(u4, 1, () => { - t2.once("keypress", C5); - }); - }); - }; - return e3 && process.stdout.write(import_sisteransi.cursor.hide), t2.once("keypress", C5), () => { - t2.off("keypress", C5), e3 && process.stdout.write(import_sisteransi.cursor.show), t2.isTTY && !PD && t2.setRawMode(false), s2.terminal = false, s2.close(); - }; -} - -// node_modules/@clack/prompts/dist/index.mjs -var import_node_process2 = __toESM(require("node:process"), 1); -var import_picocolors = __toESM(require_picocolors(), 1); -var import_sisteransi2 = __toESM(require_src(), 1); -function N4() { - return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm"; -} -var p2 = N4(); -var u = (r3, n3) => p2 ? r3 : n3; -var W4 = u("\u25C6", "*"); -var D3 = u("\u25A0", "x"); -var F3 = u("\u25B2", "x"); -var f2 = u("\u25C7", "o"); -var L5 = u("\u250C", "T"); -var a2 = u("\u2502", "|"); -var o = u("\u2514", "\u2014"); -var w5 = u("\u25CF", ">"); -var S4 = u("\u25CB", " "); -var _5 = u("\u25FB", "[\u2022]"); -var y4 = u("\u25FC", "[+]"); -var A3 = u("\u25FB", "[ ]"); -var q4 = u("\u25AA", "\u2022"); -var R5 = u("\u2500", "-"); -var G4 = u("\u256E", "+"); -var H3 = u("\u251C", "+"); -var K4 = u("\u256F", "+"); -var U5 = u("\u25CF", "\u2022"); -var Z4 = u("\u25C6", "*"); -var z4 = u("\u25B2", "!"); -var X3 = u("\u25A0", "x"); -var h2 = (r3) => { - switch (r3) { - case "initial": - case "active": - return import_picocolors.default.cyan(W4); - case "cancel": - return import_picocolors.default.red(D3); - case "error": - return import_picocolors.default.yellow(F3); - case "submit": - return import_picocolors.default.green(f2); - } -}; -var Q3 = (r3) => { - const n3 = r3.active ?? "Yes", s2 = r3.inactive ?? "No"; - return new xD2({ active: n3, inactive: s2, initialValue: r3.initialValue ?? true, render() { - const t2 = `${import_picocolors.default.gray(a2)} -${h2(this.state)} ${r3.message} -`, i4 = this.value ? n3 : s2; - switch (this.state) { - case "submit": - return `${t2}${import_picocolors.default.gray(a2)} ${import_picocolors.default.dim(i4)}`; - case "cancel": - return `${t2}${import_picocolors.default.gray(a2)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(i4))} -${import_picocolors.default.gray(a2)}`; - default: - return `${t2}${import_picocolors.default.cyan(a2)} ${this.value ? `${import_picocolors.default.green(w5)} ${n3}` : `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(n3)}`} ${import_picocolors.default.dim("/")} ${this.value ? `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(s2)}` : `${import_picocolors.default.green(w5)} ${s2}`} -${import_picocolors.default.cyan(o)} -`; - } - } }).prompt(); -}; -var ee = (r3) => { - const n3 = (s2, t2) => { - const i4 = s2.label ?? String(s2.value); - return t2 === "active" ? `${import_picocolors.default.green(w5)} ${i4} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors.default.dim(i4)}` : t2 === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(i4))}` : `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(i4)}`; - }; - return new yD({ options: r3.options, initialValue: r3.initialValue, render() { - const s2 = `${import_picocolors.default.gray(a2)} -${h2(this.state)} ${r3.message} -`; - switch (this.state) { - case "submit": - return `${s2}${import_picocolors.default.gray(a2)} ${n3(this.options[this.cursor], "selected")}`; - case "cancel": - return `${s2}${import_picocolors.default.gray(a2)} ${n3(this.options[this.cursor], "cancelled")} -${import_picocolors.default.gray(a2)}`; - default: - return `${s2}${import_picocolors.default.cyan(a2)} ${this.options.map((t2, i4) => n3(t2, i4 === this.cursor ? "active" : "inactive")).join(` -${import_picocolors.default.cyan(a2)} `)} -${import_picocolors.default.cyan(o)} -`; - } - } }).prompt(); -}; -var re = (r3) => { - const n3 = (s2, t2) => { - const i4 = s2.label ?? String(s2.value); - return t2 === "active" ? `${import_picocolors.default.cyan(_5)} ${i4} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors.default.green(y4)} ${import_picocolors.default.dim(i4)}` : t2 === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(i4))}` : t2 === "active-selected" ? `${import_picocolors.default.green(y4)} ${i4} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "submitted" ? `${import_picocolors.default.dim(i4)}` : `${import_picocolors.default.dim(A3)} ${import_picocolors.default.dim(i4)}`; - }; - return new gD2({ options: r3.options, initialValues: r3.initialValues, required: r3.required ?? true, cursorAt: r3.cursorAt, validate(s2) { - if (this.required && s2.length === 0) - return `Please select at least one option. -${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`; - }, render() { - let s2 = `${import_picocolors.default.gray(a2)} -${h2(this.state)} ${r3.message} -`; - switch (this.state) { - case "submit": - return `${s2}${import_picocolors.default.gray(a2)} ${this.options.filter(({ value: t2 }) => this.value.includes(t2)).map((t2) => n3(t2, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none")}`; - case "cancel": { - const t2 = this.options.filter(({ value: i4 }) => this.value.includes(i4)).map((i4) => n3(i4, "cancelled")).join(import_picocolors.default.dim(", ")); - return `${s2}${import_picocolors.default.gray(a2)} ${t2.trim() ? `${t2} -${import_picocolors.default.gray(a2)}` : ""}`; + }; + var arrayToObject2 = function arrayToObject3(source, options) { + var obj = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + for (var i3 = 0; i3 < source.length; ++i3) { + if (typeof source[i3] !== "undefined") { + obj[i3] = source[i3]; + } } - case "error": { - const t2 = this.error.split(` -`).map((i4, c5) => c5 === 0 ? `${import_picocolors.default.yellow(o)} ${import_picocolors.default.yellow(i4)}` : ` ${i4}`).join(` -`); - return s2 + import_picocolors.default.yellow(a2) + " " + this.options.map((i4, c5) => { - const l3 = this.value.includes(i4.value), $6 = c5 === this.cursor; - return $6 && l3 ? n3(i4, "active-selected") : l3 ? n3(i4, "selected") : n3(i4, $6 ? "active" : "inactive"); - }).join(` -${import_picocolors.default.yellow(a2)} `) + ` -` + t2 + ` -`; + return obj; + }; + var merge2 = function merge3(target, source, options) { + if (!source) { + return target; } - default: - return `${s2}${import_picocolors.default.cyan(a2)} ${this.options.map((t2, i4) => { - const c5 = this.value.includes(t2.value), l3 = i4 === this.cursor; - return l3 && c5 ? n3(t2, "active-selected") : c5 ? n3(t2, "selected") : n3(t2, l3 ? "active" : "inactive"); - }).join(` -${import_picocolors.default.cyan(a2)} `)} -${import_picocolors.default.cyan(o)} -`; - } - } }).prompt(); -}; -var b5 = (r3) => r3.replace(ue(), ""); -var ie = (r3 = "", n3 = "") => { - const s2 = ` -${r3} -`.split(` -`), t2 = Math.max(s2.reduce((c5, l3) => (l3 = b5(l3), l3.length > c5 ? l3.length : c5), 0), b5(n3).length) + 2, i4 = s2.map((c5) => `${import_picocolors.default.gray(a2)} ${import_picocolors.default.dim(c5)}${" ".repeat(t2 - b5(c5).length)}${import_picocolors.default.gray(a2)}`).join(` -`); - process.stdout.write(`${import_picocolors.default.gray(a2)} -${import_picocolors.default.green(f2)} ${import_picocolors.default.reset(n3)} ${import_picocolors.default.gray(R5.repeat(Math.max(t2 - n3.length - 1, 1)) + G4)} -${i4} -${import_picocolors.default.gray(H3 + R5.repeat(t2 + 2) + K4)} -`); -}; -var ae = (r3 = "") => { - process.stdout.write(`${import_picocolors.default.gray(L5)} ${r3} -`); -}; -var ce = (r3 = "") => { - process.stdout.write(`${import_picocolors.default.gray(a2)} -${import_picocolors.default.gray(o)} ${r3} - -`); -}; -var C3 = p2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"]; -var le = () => { - let r3, n3; - const s2 = p2 ? 80 : 120; - return { start(t2 = "") { - t2 = t2.replace(/\.?\.?\.$/, ""), r3 = WD(), process.stdout.write(`${import_picocolors.default.gray(a2)} -${import_picocolors.default.magenta("\u25CB")} ${t2} -`); - let i4 = 0, c5 = 0; - n3 = setInterval(() => { - let l3 = C3[i4]; - process.stdout.write(import_sisteransi2.cursor.move(-999, -1)), process.stdout.write(`${import_picocolors.default.magenta(l3)} ${t2}${Math.floor(c5) >= 1 ? ".".repeat(Math.floor(c5)).slice(0, 3) : ""} -`), i4 = i4 === C3.length - 1 ? 0 : i4 + 1, c5 = c5 === C3.length ? 0 : c5 + 0.125; - }, s2); - }, stop(t2 = "") { - process.stdout.write(import_sisteransi2.cursor.move(-999, -2)), process.stdout.write(import_sisteransi2.erase.down(2)), clearInterval(n3), process.stdout.write(`${import_picocolors.default.gray(a2)} -${import_picocolors.default.green(f2)} ${t2} -`), r3(); - } }; -}; -function ue() { - const r3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"); - return new RegExp(r3, "g"); -} - -// node_modules/chalk/source/vendor/ansi-styles/index.js -var ANSI_BACKGROUND_OFFSET = 10; -var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; -var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; -var wrapAnsi16m = (offset = 0) => (red2, green2, blue2) => `\x1B[${38 + offset};2;${red2};${green2};${blue2}m`; -var styles = { - modifier: { - reset: [0, 0], - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - overline: [53, 55], - 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], - blackBright: [90, 39], - gray: [90, 39], - grey: [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], - bgBlackBright: [100, 49], - bgGray: [100, 49], - bgGrey: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] + if (typeof source !== "object") { + if (isArray2(target)) { + target.push(source); + } else if (target && typeof target === "object") { + if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } + return target; + } + if (!target || typeof target !== "object") { + return [target].concat(source); + } + var mergeTarget = target; + if (isArray2(target) && !isArray2(source)) { + mergeTarget = arrayToObject2(target, options); + } + if (isArray2(target) && isArray2(source)) { + source.forEach(function(item, i3) { + if (has.call(target, i3)) { + var targetItem = target[i3]; + if (targetItem && typeof targetItem === "object" && item && typeof item === "object") { + target[i3] = merge3(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i3] = item; + } + }); + return target; + } + return Object.keys(source).reduce(function(acc, key) { + var value = source[key]; + if (has.call(acc, key)) { + acc[key] = merge3(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); + }; + var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function(acc, key) { + acc[key] = source[key]; + return acc; + }, target); + }; + var decode = function(str2, decoder, charset) { + var strWithoutPlus = str2.replace(/\+/g, " "); + if (charset === "iso-8859-1") { + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + try { + return decodeURIComponent(strWithoutPlus); + } catch (e3) { + return strWithoutPlus; + } + }; + var limit = 1024; + var encode3 = function encode4(str2, defaultEncoder, charset, kind3, format) { + if (str2.length === 0) { + return str2; + } + var string = str2; + if (typeof str2 === "symbol") { + string = Symbol.prototype.toString.call(str2); + } else if (typeof str2 !== "string") { + string = String(str2); + } + if (charset === "iso-8859-1") { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) { + return "%26%23" + parseInt($0.slice(2), 16) + "%3B"; + }); + } + var out = ""; + for (var j4 = 0; j4 < string.length; j4 += limit) { + var segment = string.length >= limit ? string.slice(j4, j4 + limit) : string; + var arr = []; + for (var i3 = 0; i3 < segment.length; ++i3) { + var c3 = segment.charCodeAt(i3); + if (c3 === 45 || c3 === 46 || c3 === 95 || c3 === 126 || c3 >= 48 && c3 <= 57 || c3 >= 65 && c3 <= 90 || c3 >= 97 && c3 <= 122 || format === formats.RFC1738 && (c3 === 40 || c3 === 41)) { + arr[arr.length] = segment.charAt(i3); + continue; + } + if (c3 < 128) { + arr[arr.length] = hexTable[c3]; + continue; + } + if (c3 < 2048) { + arr[arr.length] = hexTable[192 | c3 >> 6] + hexTable[128 | c3 & 63]; + continue; + } + if (c3 < 55296 || c3 >= 57344) { + arr[arr.length] = hexTable[224 | c3 >> 12] + hexTable[128 | c3 >> 6 & 63] + hexTable[128 | c3 & 63]; + continue; + } + i3 += 1; + c3 = 65536 + ((c3 & 1023) << 10 | segment.charCodeAt(i3) & 1023); + arr[arr.length] = hexTable[240 | c3 >> 18] + hexTable[128 | c3 >> 12 & 63] + hexTable[128 | c3 >> 6 & 63] + hexTable[128 | c3 & 63]; + } + out += arr.join(""); + } + return out; + }; + var compact = function compact2(value) { + var queue = [{ obj: { o: value }, prop: "o" }]; + var refs = []; + for (var i3 = 0; i3 < queue.length; ++i3) { + var item = queue[i3]; + var obj = item.obj[item.prop]; + var keys = Object.keys(obj); + for (var j4 = 0; j4 < keys.length; ++j4) { + var key = keys[j4]; + var val = obj[key]; + if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) { + queue.push({ obj, prop: key }); + refs.push(val); + } + } + } + compactQueue(queue); + return value; + }; + var isRegExp2 = function isRegExp3(obj) { + return Object.prototype.toString.call(obj) === "[object RegExp]"; + }; + var isBuffer2 = function isBuffer3(obj) { + if (!obj || typeof obj !== "object") { + return false; + } + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); + }; + var combine = function combine2(a4, b7) { + return [].concat(a4, b7); + }; + var maybeMap = function maybeMap2(val, fn) { + if (isArray2(val)) { + var mapped = []; + for (var i3 = 0; i3 < val.length; i3 += 1) { + mapped.push(fn(val[i3])); + } + return mapped; + } + return fn(val); + }; + module2.exports = { + arrayToObject: arrayToObject2, + assign, + combine, + compact, + decode, + encode: encode3, + isBuffer: isBuffer2, + isRegExp: isRegExp2, + maybeMap, + merge: merge2 + }; } -}; -var modifierNames = Object.keys(styles.modifier); -var foregroundColorNames = Object.keys(styles.color); -var backgroundColorNames = Object.keys(styles.bgColor); -var colorNames = [...foregroundColorNames, ...backgroundColorNames]; -function assembleStyles() { - const codes = /* @__PURE__ */ new Map(); - 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` +}); + +// node_modules/qs/lib/stringify.js +var require_stringify = __commonJS({ + "node_modules/qs/lib/stringify.js"(exports, module2) { + "use strict"; + var getSideChannel = require_side_channel(); + var utils = require_utils2(); + var formats = require_formats(); + var has = Object.prototype.hasOwnProperty; + var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + "[]"; + }, + comma: "comma", + indices: function indices(prefix, key) { + return prefix + "[" + key + "]"; + }, + repeat: function repeat(prefix) { + return prefix; + } + }; + var isArray2 = Array.isArray; + var push = Array.prototype.push; + var pushToArray = function(arr, valueOrArray) { + push.apply(arr, isArray2(valueOrArray) ? valueOrArray : [valueOrArray]); + }; + var toISO = Date.prototype.toISOString; + var defaultFormat = formats["default"]; + var defaults2 = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: "indices", + charset: "utf-8", + charsetSentinel: false, + delimiter: "&", + encode: true, + encodeDotInKeys: false, + encoder: utils.encode, + encodeValuesOnly: false, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false + }; + var isNonNullishPrimitive = function isNonNullishPrimitive2(v5) { + return typeof v5 === "string" || typeof v5 === "number" || typeof v5 === "boolean" || typeof v5 === "symbol" || typeof v5 === "bigint"; + }; + var sentinel = {}; + var stringify2 = function stringify3(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter2, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { + var obj = object; + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) { + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== "undefined") { + if (pos === step) { + throw new RangeError("Cyclic object value"); + } else { + findFlag = true; + } + } + if (typeof tmpSc.get(sentinel) === "undefined") { + step = 0; + } + } + if (typeof filter2 === "function") { + obj = filter2(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === "comma" && isArray2(obj)) { + obj = utils.maybeMap(obj, function(value2) { + if (value2 instanceof Date) { + return serializeDate(value2); + } + return value2; + }); + } + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults2.encoder, charset, "key", format) : prefix; + } + obj = ""; + } + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults2.encoder, charset, "key", format); + return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults2.encoder, charset, "value", format))]; + } + return [formatter(prefix) + "=" + formatter(String(obj))]; + } + var values = []; + if (typeof obj === "undefined") { + return values; + } + var objKeys; + if (generateArrayPrefix === "comma" && isArray2(obj)) { + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } + objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }]; + } else if (isArray2(filter2)) { + objKeys = filter2; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix; + var adjustedPrefix = commaRoundTrip && isArray2(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix; + if (allowEmptyArrays && isArray2(obj) && obj.length === 0) { + return adjustedPrefix + "[]"; + } + for (var j4 = 0; j4 < objKeys.length; ++j4) { + var key = objKeys[j4]; + var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key]; + if (skipNulls && value === null) { + continue; + } + var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; + var keyPrefix = isArray2(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]"); + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify3( + value, + keyPrefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + generateArrayPrefix === "comma" && encodeValuesOnly && isArray2(obj) ? null : encoder, + filter2, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel + )); + } + return values; + }; + var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) { + if (!opts) { + return defaults2; + } + if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { + throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); + } + if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") { + throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); + } + if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") { + throw new TypeError("Encoder has to be a function."); + } + var charset = opts.charset || defaults2.charset; + if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { + throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); + } + var format = formats["default"]; + if (typeof opts.format !== "undefined") { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError("Unknown format option provided."); + } + format = opts.format; + } + var formatter = formats.formatters[format]; + var filter2 = defaults2.filter; + if (typeof opts.filter === "function" || isArray2(opts.filter)) { + filter2 = opts.filter; + } + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ("indices" in opts) { + arrayFormat = opts.indices ? "indices" : "repeat"; + } else { + arrayFormat = defaults2.arrayFormat; + } + if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { + throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); + } + var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; + return { + addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults2.addQueryPrefix, + allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, + arrayFormat, + charset, + charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, + commaRoundTrip: opts.commaRoundTrip, + delimiter: typeof opts.delimiter === "undefined" ? defaults2.delimiter : opts.delimiter, + encode: typeof opts.encode === "boolean" ? opts.encode : defaults2.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults2.encodeDotInKeys, + encoder: typeof opts.encoder === "function" ? opts.encoder : defaults2.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults2.encodeValuesOnly, + filter: filter2, + format, + formatter, + serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults2.serializeDate, + skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults2.skipNulls, + sort: typeof opts.sort === "function" ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling }; - group[styleName] = styles[styleName]; - codes.set(style[0], style[1]); - } - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); + }; + module2.exports = function(object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + var objKeys; + var filter2; + if (typeof options.filter === "function") { + filter2 = options.filter; + obj = filter2("", obj); + } else if (isArray2(options.filter)) { + filter2 = options.filter; + objKeys = filter2; + } + var keys = []; + if (typeof obj !== "object" || obj === null) { + return ""; + } + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip; + if (!objKeys) { + objKeys = Object.keys(obj); + } + if (options.sort) { + objKeys.sort(options.sort); + } + var sideChannel = getSideChannel(); + for (var i3 = 0; i3 < objKeys.length; ++i3) { + var key = objKeys[i3]; + if (options.skipNulls && obj[key] === null) { + continue; + } + pushToArray(keys, stringify2( + obj[key], + key, + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel + )); + } + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? "?" : ""; + if (options.charsetSentinel) { + if (options.charset === "iso-8859-1") { + prefix += "utf8=%26%2310003%3B&"; + } else { + prefix += "utf8=%E2%9C%93&"; + } + } + return joined.length > 0 ? prefix + joined : ""; + }; } - Object.defineProperty(styles, "codes", { - value: codes, - enumerable: false - }); - styles.color.close = "\x1B[39m"; - styles.bgColor.close = "\x1B[49m"; - styles.color.ansi = wrapAnsi16(); - styles.color.ansi256 = wrapAnsi256(); - styles.color.ansi16m = wrapAnsi16m(); - styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); - styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); - styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); - Object.defineProperties(styles, { - rgbToAnsi256: { - value(red2, green2, blue2) { - if (red2 === green2 && green2 === blue2) { - if (red2 < 8) { - return 16; - } - if (red2 > 248) { - return 231; +}); + +// node_modules/qs/lib/parse.js +var require_parse2 = __commonJS({ + "node_modules/qs/lib/parse.js"(exports, module2) { + "use strict"; + var utils = require_utils2(); + var has = Object.prototype.hasOwnProperty; + var isArray2 = Array.isArray; + var defaults2 = { + allowDots: false, + allowEmptyArrays: false, + allowPrototypes: false, + allowSparse: false, + arrayLimit: 20, + charset: "utf-8", + charsetSentinel: false, + comma: false, + decodeDotInKeys: false, + decoder: utils.decode, + delimiter: "&", + depth: 5, + duplicates: "combine", + ignoreQueryPrefix: false, + interpretNumericEntities: false, + parameterLimit: 1e3, + parseArrays: true, + plainObjects: false, + strictDepth: false, + strictNullHandling: false + }; + var interpretNumericEntities = function(str2) { + return str2.replace(/&#(\d+);/g, function($0, numberStr) { + return String.fromCharCode(parseInt(numberStr, 10)); + }); + }; + var parseArrayValue = function(val, options) { + if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) { + return val.split(","); + } + return val; + }; + var isoSentinel = "utf8=%26%2310003%3B"; + var charsetSentinel = "utf8=%E2%9C%93"; + var parseValues = function parseQueryStringValues(str2, options) { + var obj = { __proto__: null }; + var cleanStr = options.ignoreQueryPrefix ? str2.replace(/^\?/, "") : str2; + cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]"); + var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit; + var parts = cleanStr.split(options.delimiter, limit); + var skipIndex = -1; + var i3; + var charset = options.charset; + if (options.charsetSentinel) { + for (i3 = 0; i3 < parts.length; ++i3) { + if (parts[i3].indexOf("utf8=") === 0) { + if (parts[i3] === charsetSentinel) { + charset = "utf-8"; + } else if (parts[i3] === isoSentinel) { + charset = "iso-8859-1"; + } + skipIndex = i3; + i3 = parts.length; } - return Math.round((red2 - 8) / 247 * 24) + 232; } - return 16 + 36 * Math.round(red2 / 255 * 5) + 6 * Math.round(green2 / 255 * 5) + Math.round(blue2 / 255 * 5); - }, - enumerable: false - }, - hexToRgb: { - value(hex) { - const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); - if (!matches) { - return [0, 0, 0]; + } + for (i3 = 0; i3 < parts.length; ++i3) { + if (i3 === skipIndex) { + continue; } - let [colorString] = matches; - if (colorString.length === 3) { - colorString = [...colorString].map((character) => character + character).join(""); + var part = parts[i3]; + var bracketEqualsPos = part.indexOf("]="); + var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1; + var key, val; + if (pos === -1) { + key = options.decoder(part, defaults2.decoder, charset, "key"); + val = options.strictNullHandling ? null : ""; + } else { + key = options.decoder(part.slice(0, pos), defaults2.decoder, charset, "key"); + val = utils.maybeMap( + parseArrayValue(part.slice(pos + 1), options), + function(encodedVal) { + return options.decoder(encodedVal, defaults2.decoder, charset, "value"); + } + ); } - const integer = Number.parseInt(colorString, 16); - return [ - integer >> 16 & 255, - integer >> 8 & 255, - integer & 255 - ]; - }, - enumerable: false - }, - hexToAnsi256: { - value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), - enumerable: false - }, - ansi256ToAnsi: { - value(code) { - if (code < 8) { - return 30 + code; + if (val && options.interpretNumericEntities && charset === "iso-8859-1") { + val = interpretNumericEntities(val); } - if (code < 16) { - return 90 + (code - 8); + if (part.indexOf("[]=") > -1) { + val = isArray2(val) ? [val] : val; } - let red2; - let green2; - let blue2; - if (code >= 232) { - red2 = ((code - 232) * 10 + 8) / 255; - green2 = red2; - blue2 = red2; + var existing = has.call(obj, key); + if (existing && options.duplicates === "combine") { + obj[key] = utils.combine(obj[key], val); + } else if (!existing || options.duplicates === "last") { + obj[key] = val; + } + } + return obj; + }; + var parseObject = function(chain, val, options, valuesParsed) { + var leaf = valuesParsed ? val : parseArrayValue(val, options); + for (var i3 = chain.length - 1; i3 >= 0; --i3) { + var obj; + var root = chain[i3]; + if (root === "[]" && options.parseArrays) { + obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf); } else { - code -= 16; - const remainder = code % 36; - red2 = Math.floor(code / 36) / 5; - green2 = Math.floor(remainder / 6) / 5; - blue2 = remainder % 6 / 5; + obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root; + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot; + var index = parseInt(decodedRoot, 10); + if (!options.parseArrays && decodedRoot === "") { + obj = { 0: leaf }; + } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) { + obj = []; + obj[index] = leaf; + } else if (decodedRoot !== "__proto__") { + obj[decodedRoot] = leaf; + } } - const value = Math.max(red2, green2, blue2) * 2; - if (value === 0) { - return 30; + leaf = obj; + } + return leaf; + }; + var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey; + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + var segment = options.depth > 0 && brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + var keys = []; + if (parent) { + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } } - let result = 30 + (Math.round(blue2) << 2 | Math.round(green2) << 1 | Math.round(red2)); - if (value === 2) { - result += 60; + keys.push(parent); + } + var i3 = 0; + while (options.depth > 0 && (segment = child.exec(key)) !== null && i3 < options.depth) { + i3 += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } } - return result; - }, - enumerable: false - }, - rgbToAnsi: { - value: (red2, green2, blue2) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red2, green2, blue2)), - enumerable: false - }, - hexToAnsi: { - value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), - enumerable: false - } - }); - return styles; -} -var ansiStyles = assembleStyles(); -var ansi_styles_default = ansiStyles; - -// node_modules/chalk/source/vendor/supports-color/index.js -var import_node_process3 = __toESM(require("node:process"), 1); -var import_node_os = __toESM(require("node:os"), 1); -var import_node_tty2 = __toESM(require("node:tty"), 1); -function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process3.default.argv) { - const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; - const position = argv.indexOf(prefix + flag); - const terminatorPosition = argv.indexOf("--"); - return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); -} -var { env } = import_node_process3.default; -var flagForceColor; -if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { - flagForceColor = 0; -} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { - flagForceColor = 1; -} -function envForceColor() { - if ("FORCE_COLOR" in env) { - if (env.FORCE_COLOR === "true") { - return 1; - } - if (env.FORCE_COLOR === "false") { - return 0; - } - return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); + keys.push(segment[1]); + } + if (segment) { + if (options.strictDepth === true) { + throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true"); + } + keys.push("[" + key.slice(segment.index) + "]"); + } + return parseObject(keys, val, options, valuesParsed); + }; + var normalizeParseOptions = function normalizeParseOptions2(opts) { + if (!opts) { + return defaults2; + } + if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { + throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); + } + if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") { + throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided"); + } + if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") { + throw new TypeError("Decoder has to be a function."); + } + if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { + throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); + } + var charset = typeof opts.charset === "undefined" ? defaults2.charset : opts.charset; + var duplicates = typeof opts.duplicates === "undefined" ? defaults2.duplicates : opts.duplicates; + if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") { + throw new TypeError("The duplicates option must be either combine, first, or last"); + } + var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; + return { + allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, + allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults2.allowPrototypes, + allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults2.allowSparse, + arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults2.arrayLimit, + charset, + charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, + comma: typeof opts.comma === "boolean" ? opts.comma : defaults2.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults2.decodeDotInKeys, + decoder: typeof opts.decoder === "function" ? opts.decoder : defaults2.decoder, + delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults2.delimiter, + depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults2.depth, + duplicates, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults2.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults2.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults2.plainObjects, + strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults2.strictDepth, + strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling + }; + }; + module2.exports = function(str2, opts) { + var options = normalizeParseOptions(opts); + if (str2 === "" || str2 === null || typeof str2 === "undefined") { + return options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + } + var tempObj = typeof str2 === "string" ? parseValues(str2, options) : str2; + var obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + var keys = Object.keys(tempObj); + for (var i3 = 0; i3 < keys.length; ++i3) { + var key = keys[i3]; + var newObj = parseKeys(key, tempObj[key], options, typeof str2 === "string"); + obj = utils.merge(obj, newObj, options); + } + if (options.allowSparse === true) { + return obj; + } + return utils.compact(obj); + }; } -} -function translateLevel(level) { - if (level === 0) { - return false; +}); + +// node_modules/qs/lib/index.js +var require_lib3 = __commonJS({ + "node_modules/qs/lib/index.js"(exports, module2) { + "use strict"; + var stringify2 = require_stringify(); + var parse = require_parse2(); + var formats = require_formats(); + module2.exports = { + formats, + parse, + stringify: stringify2 + }; } - return { - level, - hasBasic: true, - has256: level >= 2, - has16m: level >= 3 - }; -} -function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { - const noFlagForceColor = envForceColor(); - if (noFlagForceColor !== void 0) { - flagForceColor = noFlagForceColor; - } - const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; - if (forceColor === 0) { - return 0; - } - if (sniffFlags) { - if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { - return 3; - } - if (hasFlag("color=256")) { - return 2; - } - } - if ("TF_BUILD" in env && "AGENT_NAME" in env) { - return 1; - } - if (haveStream && !streamIsTTY && forceColor === void 0) { - return 0; - } - const min = forceColor || 0; - if (env.TERM === "dumb") { - return min; - } - if (import_node_process3.default.platform === "win32") { - const osRelease = import_node_os.default.release().split("."); - if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { - return Number(osRelease[2]) >= 14931 ? 3 : 2; - } - return 1; - } - if ("CI" in env) { - if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) { - return 3; - } - if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { - return 1; - } - return min; - } - if ("TEAMCITY_VERSION" in env) { - return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; - } - if (env.COLORTERM === "truecolor") { - return 3; - } - if (env.TERM === "xterm-kitty") { - return 3; - } - if ("TERM_PROGRAM" in env) { - const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); - switch (env.TERM_PROGRAM) { - case "iTerm.app": { - return version >= 3 ? 3 : 2; - } - case "Apple_Terminal": { - return 2; - } - } - } - if (/-256(color)?$/i.test(env.TERM)) { - return 2; - } - if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { - return 1; - } - if ("COLORTERM" in env) { - return 1; - } - return min; -} -function createSupportsColor(stream4, options = {}) { - const level = _supportsColor(stream4, { - streamIsTTY: stream4 && stream4.isTTY, - ...options - }); - return translateLevel(level); -} -var supportsColor = { - stdout: createSupportsColor({ isTTY: import_node_tty2.default.isatty(1) }), - stderr: createSupportsColor({ isTTY: import_node_tty2.default.isatty(2) }) -}; -var supports_color_default = supportsColor; - -// node_modules/chalk/source/utilities.js -function stringReplaceAll(string, substring, replacer) { - let index = string.indexOf(substring); - if (index === -1) { - return string; - } - const substringLength = substring.length; - let endIndex = 0; - let returnValue = ""; - do { - returnValue += string.slice(endIndex, index) + substring + replacer; - endIndex = index + substringLength; - index = string.indexOf(substring, endIndex); - } while (index !== -1); - returnValue += string.slice(endIndex); - return returnValue; -} -function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) { - let endIndex = 0; - let returnValue = ""; - do { - const gotCR = string[index - 1] === "\r"; - returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix; - endIndex = index + 1; - index = string.indexOf("\n", endIndex); - } while (index !== -1); - returnValue += string.slice(endIndex); - return returnValue; -} - -// node_modules/chalk/source/index.js -var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default; -var GENERATOR = Symbol("GENERATOR"); -var STYLER = Symbol("STYLER"); -var IS_EMPTY = Symbol("IS_EMPTY"); -var levelMapping = [ - "ansi", - "ansi", - "ansi256", - "ansi16m" -]; -var styles2 = /* @__PURE__ */ Object.create(null); -var applyOptions = (object, options = {}) => { - if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { - throw new Error("The `level` option should be an integer from 0 to 3"); - } - const colorLevel = stdoutColor ? stdoutColor.level : 0; - object.level = options.level === void 0 ? colorLevel : options.level; -}; -var chalkFactory = (options) => { - const chalk2 = (...strings) => strings.join(" "); - applyOptions(chalk2, options); - Object.setPrototypeOf(chalk2, createChalk.prototype); - return chalk2; -}; -function createChalk(options) { - return chalkFactory(options); -} -Object.setPrototypeOf(createChalk.prototype, Function.prototype); -for (const [styleName, style] of Object.entries(ansi_styles_default)) { - styles2[styleName] = { - get() { - const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); - Object.defineProperty(this, styleName, { value: builder }); - return builder; - } - }; -} -styles2.visible = { - get() { - const builder = createBuilder(this, this[STYLER], true); - Object.defineProperty(this, "visible", { value: builder }); - return builder; - } -}; -var getModelAnsi = (model, level, type2, ...arguments_) => { - if (model === "rgb") { - if (level === "ansi16m") { - return ansi_styles_default[type2].ansi16m(...arguments_); - } - if (level === "ansi256") { - return ansi_styles_default[type2].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)); - } - return ansi_styles_default[type2].ansi(ansi_styles_default.rgbToAnsi(...arguments_)); - } - if (model === "hex") { - return getModelAnsi("rgb", level, type2, ...ansi_styles_default.hexToRgb(...arguments_)); - } - return ansi_styles_default[type2][model](...arguments_); -}; -var usedModels = ["rgb", "hex", "ansi256"]; -for (const model of usedModels) { - styles2[model] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]); - return createBuilder(this, styler, this[IS_EMPTY]); - }; - } - }; - const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); - styles2[bgModel] = { - get() { - const { level } = this; - return function(...arguments_) { - const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]); - return createBuilder(this, styler, this[IS_EMPTY]); - }; - } - }; -} -var proto = Object.defineProperties(() => { -}, { - ...styles2, - level: { - enumerable: true, - get() { - return this[GENERATOR].level; - }, - set(level) { - this[GENERATOR].level = level; - } +}); + +// node_modules/@commitlint/types/lib/ensure.js +var require_ensure = __commonJS({ + "node_modules/@commitlint/types/lib/ensure.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); } }); -var createStyler = (open, close, parent) => { - let openAll; - let closeAll; - if (parent === void 0) { - openAll = open; - closeAll = close; - } else { - openAll = parent.openAll + open; - closeAll = close + parent.closeAll; - } - return { - open, - close, - openAll, - closeAll, - parent - }; -}; -var createBuilder = (self2, _styler, _isEmpty) => { - const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); - Object.setPrototypeOf(builder, proto); - builder[GENERATOR] = self2; - builder[STYLER] = _styler; - builder[IS_EMPTY] = _isEmpty; - return builder; -}; -var applyStyle = (self2, string) => { - if (self2.level <= 0 || !string) { - return self2[IS_EMPTY] ? "" : string; - } - let styler = self2[STYLER]; - if (styler === void 0) { - return string; - } - const { openAll, closeAll } = styler; - if (string.includes("\x1B")) { - while (styler !== void 0) { - string = stringReplaceAll(string, styler.close, styler.open); - styler = styler.parent; - } - } - const lfIndex = string.indexOf("\n"); - if (lfIndex !== -1) { - string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); - } - return openAll + string + closeAll; -}; -Object.defineProperties(createChalk.prototype, styles2); -var chalk = createChalk(); -var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); -var source_default = chalk; - -// node_modules/is-plain-obj/index.js -function isPlainObject(value) { - if (typeof value !== "object" || value === null) { - return false; - } - const prototype3 = Object.getPrototypeOf(value); - return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(Symbol.toStringTag in value) && !(Symbol.iterator in value); -} -// node_modules/execa/lib/arguments/file-url.js -var import_node_url = require("node:url"); -var safeNormalizeFileUrl = (file, name) => { - const fileString = normalizeFileUrl(file); - if (typeof fileString !== "string") { - throw new TypeError(`${name} must be a string or a file URL: ${fileString}.`); +// node_modules/@commitlint/types/lib/format.js +var require_format = __commonJS({ + "node_modules/@commitlint/types/lib/format.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); } - return fileString; -}; -var normalizeFileUrl = (file) => file instanceof URL ? (0, import_node_url.fileURLToPath)(file) : file; +}); -// node_modules/execa/lib/methods/parameters.js -var normalizeParameters = (rawFile, rawArguments = [], rawOptions = {}) => { - const filePath = safeNormalizeFileUrl(rawFile, "First argument"); - const [commandArguments, options] = isPlainObject(rawArguments) ? [[], rawArguments] : [rawArguments, rawOptions]; - if (!Array.isArray(commandArguments)) { - throw new TypeError(`Second argument must be either an array of arguments or an options object: ${commandArguments}`); - } - if (commandArguments.some((commandArgument) => typeof commandArgument === "object" && commandArgument !== null)) { - throw new TypeError(`Second argument must be an array of strings: ${commandArguments}`); - } - const normalizedArguments = commandArguments.map(String); - const nullByteArgument = normalizedArguments.find((normalizedArgument) => normalizedArgument.includes("\0")); - if (nullByteArgument !== void 0) { - throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${nullByteArgument}`); - } - if (!isPlainObject(options)) { - throw new TypeError(`Last argument must be an options object: ${options}`); +// node_modules/@commitlint/types/lib/is-ignored.js +var require_is_ignored = __commonJS({ + "node_modules/@commitlint/types/lib/is-ignored.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); } - return [filePath, normalizedArguments, options]; -}; - -// node_modules/execa/lib/methods/template.js -var import_node_child_process = require("node:child_process"); +}); -// node_modules/execa/lib/utils/uint-array.js -var import_node_string_decoder = require("node:string_decoder"); -var { toString: objectToString } = Object.prototype; -var isArrayBuffer = (value) => objectToString.call(value) === "[object ArrayBuffer]"; -var isUint8Array = (value) => objectToString.call(value) === "[object Uint8Array]"; -var bufferToUint8Array = (buffer) => new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength); -var textEncoder = new TextEncoder(); -var stringToUint8Array = (string) => textEncoder.encode(string); -var textDecoder = new TextDecoder(); -var uint8ArrayToString = (uint8Array) => textDecoder.decode(uint8Array); -var joinToString = (uint8ArraysOrStrings, encoding) => { - const strings = uint8ArraysToStrings(uint8ArraysOrStrings, encoding); - return strings.join(""); -}; -var uint8ArraysToStrings = (uint8ArraysOrStrings, encoding) => { - if (encoding === "utf8" && uint8ArraysOrStrings.every((uint8ArrayOrString) => typeof uint8ArrayOrString === "string")) { - return uint8ArraysOrStrings; - } - const decoder = new import_node_string_decoder.StringDecoder(encoding); - const strings = uint8ArraysOrStrings.map((uint8ArrayOrString) => typeof uint8ArrayOrString === "string" ? stringToUint8Array(uint8ArrayOrString) : uint8ArrayOrString).map((uint8Array) => decoder.write(uint8Array)); - const finalString = decoder.end(); - return finalString === "" ? strings : [...strings, finalString]; -}; -var joinToUint8Array = (uint8ArraysOrStrings) => { - if (uint8ArraysOrStrings.length === 1 && isUint8Array(uint8ArraysOrStrings[0])) { - return uint8ArraysOrStrings[0]; - } - return concatUint8Arrays(stringsToUint8Arrays(uint8ArraysOrStrings)); -}; -var stringsToUint8Arrays = (uint8ArraysOrStrings) => uint8ArraysOrStrings.map((uint8ArrayOrString) => typeof uint8ArrayOrString === "string" ? stringToUint8Array(uint8ArrayOrString) : uint8ArrayOrString); -var concatUint8Arrays = (uint8Arrays) => { - const result = new Uint8Array(getJoinLength(uint8Arrays)); - let index = 0; - for (const uint8Array of uint8Arrays) { - result.set(uint8Array, index); - index += uint8Array.length; - } - return result; -}; -var getJoinLength = (uint8Arrays) => { - let joinLength = 0; - for (const uint8Array of uint8Arrays) { - joinLength += uint8Array.length; +// node_modules/@commitlint/types/lib/lint.js +var require_lint = __commonJS({ + "node_modules/@commitlint/types/lib/lint.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); } - return joinLength; -}; +}); -// node_modules/execa/lib/methods/template.js -var isTemplateString = (templates) => Array.isArray(templates) && Array.isArray(templates.raw); -var parseTemplates = (templates, expressions) => { - let tokens = []; - for (const [index, template] of templates.entries()) { - tokens = parseTemplate({ - templates, - expressions, - tokens, - index, - template - }); - } - if (tokens.length === 0) { - throw new TypeError("Template script must not be empty"); - } - const [file, ...commandArguments] = tokens; - return [file, commandArguments, {}]; -}; -var parseTemplate = ({ templates, expressions, tokens, index, template }) => { - if (template === void 0) { - throw new TypeError(`Invalid backslash sequence: ${templates.raw[index]}`); - } - const { nextTokens, leadingWhitespaces, trailingWhitespaces } = splitByWhitespaces(template, templates.raw[index]); - const newTokens = concatTokens(tokens, nextTokens, leadingWhitespaces); - if (index === expressions.length) { - return newTokens; - } - const expression = expressions[index]; - const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)]; - return concatTokens(newTokens, expressionTokens, trailingWhitespaces); -}; -var splitByWhitespaces = (template, rawTemplate) => { - if (rawTemplate.length === 0) { - return { nextTokens: [], leadingWhitespaces: false, trailingWhitespaces: false }; - } - const nextTokens = []; - let templateStart = 0; - const leadingWhitespaces = DELIMITERS.has(rawTemplate[0]); - for (let templateIndex = 0, rawIndex = 0; templateIndex < template.length; templateIndex += 1, rawIndex += 1) { - const rawCharacter = rawTemplate[rawIndex]; - if (DELIMITERS.has(rawCharacter)) { - if (templateStart !== templateIndex) { - nextTokens.push(template.slice(templateStart, templateIndex)); - } - templateStart = templateIndex + 1; - } else if (rawCharacter === "\\") { - const nextRawCharacter = rawTemplate[rawIndex + 1]; - if (nextRawCharacter === "u" && rawTemplate[rawIndex + 2] === "{") { - rawIndex = rawTemplate.indexOf("}", rawIndex + 3); - } else { - rawIndex += ESCAPE_LENGTH[nextRawCharacter] ?? 1; - } - } - } - const trailingWhitespaces = templateStart === template.length; - if (!trailingWhitespaces) { - nextTokens.push(template.slice(templateStart)); - } - return { nextTokens, leadingWhitespaces, trailingWhitespaces }; -}; -var DELIMITERS = /* @__PURE__ */ new Set([" ", " ", "\r", "\n"]); -var ESCAPE_LENGTH = { x: 3, u: 5 }; -var concatTokens = (tokens, nextTokens, isSeparated) => isSeparated || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [ - ...tokens.slice(0, -1), - `${tokens.at(-1)}${nextTokens[0]}`, - ...nextTokens.slice(1) -]; -var parseExpression = (expression) => { - const typeOfExpression = typeof expression; - if (typeOfExpression === "string") { - return expression; - } - if (typeOfExpression === "number") { - return String(expression); - } - if (isPlainObject(expression) && ("stdout" in expression || "isMaxBuffer" in expression)) { - return getSubprocessResult(expression); - } - if (expression instanceof import_node_child_process.ChildProcess || Object.prototype.toString.call(expression) === "[object Promise]") { - throw new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."); - } - throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`); -}; -var getSubprocessResult = ({ stdout }) => { - if (typeof stdout === "string") { - return stdout; - } - if (isUint8Array(stdout)) { - return uint8ArrayToString(stdout); - } - if (stdout === void 0) { - throw new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`); +// node_modules/@commitlint/types/lib/load.js +var require_load = __commonJS({ + "node_modules/@commitlint/types/lib/load.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); } - throw new TypeError(`Unexpected "${typeof stdout}" stdout in template expression`); -}; - -// node_modules/execa/lib/methods/main-sync.js -var import_node_child_process2 = require("node:child_process"); - -// node_modules/execa/lib/arguments/specific.js -var import_node_util = require("node:util"); - -// node_modules/execa/lib/utils/standard-stream.js -var import_node_process4 = __toESM(require("node:process"), 1); -var isStandardStream = (stream4) => STANDARD_STREAMS.includes(stream4); -var STANDARD_STREAMS = [import_node_process4.default.stdin, import_node_process4.default.stdout, import_node_process4.default.stderr]; -var STANDARD_STREAMS_ALIASES = ["stdin", "stdout", "stderr"]; -var getStreamName = (fdNumber) => STANDARD_STREAMS_ALIASES[fdNumber] ?? `stdio[${fdNumber}]`; +}); -// node_modules/execa/lib/arguments/specific.js -var normalizeFdSpecificOptions = (options) => { - const optionsCopy = { ...options }; - for (const optionName of FD_SPECIFIC_OPTIONS) { - optionsCopy[optionName] = normalizeFdSpecificOption(options, optionName); - } - return optionsCopy; -}; -var normalizeFdSpecificOption = (options, optionName) => { - const optionBaseArray = Array.from({ length: getStdioLength(options) + 1 }); - const optionArray = normalizeFdSpecificValue(options[optionName], optionBaseArray, optionName); - return addDefaultValue(optionArray, optionName); -}; -var getStdioLength = ({ stdio }) => Array.isArray(stdio) ? Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length) : STANDARD_STREAMS_ALIASES.length; -var normalizeFdSpecificValue = (optionValue, optionArray, optionName) => isPlainObject(optionValue) ? normalizeOptionObject(optionValue, optionArray, optionName) : optionArray.fill(optionValue); -var normalizeOptionObject = (optionValue, optionArray, optionName) => { - for (const fdName of Object.keys(optionValue).sort(compareFdName)) { - for (const fdNumber of parseFdName(fdName, optionName, optionArray)) { - optionArray[fdNumber] = optionValue[fdName]; - } - } - return optionArray; -}; -var compareFdName = (fdNameA, fdNameB) => getFdNameOrder(fdNameA) < getFdNameOrder(fdNameB) ? 1 : -1; -var getFdNameOrder = (fdName) => { - if (fdName === "stdout" || fdName === "stderr") { - return 0; - } - return fdName === "all" ? 2 : 1; -}; -var parseFdName = (fdName, optionName, optionArray) => { - if (fdName === "ipc") { - return [optionArray.length - 1]; - } - const fdNumber = parseFd(fdName); - if (fdNumber === void 0 || fdNumber === 0) { - throw new TypeError(`"${optionName}.${fdName}" is invalid. -It must be "${optionName}.stdout", "${optionName}.stderr", "${optionName}.all", "${optionName}.ipc", or "${optionName}.fd3", "${optionName}.fd4" (and so on).`); - } - if (fdNumber >= optionArray.length) { - throw new TypeError(`"${optionName}.${fdName}" is invalid: that file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`); - } - return fdNumber === "all" ? [1, 2] : [fdNumber]; -}; -var parseFd = (fdName) => { - if (fdName === "all") { - return fdName; - } - if (STANDARD_STREAMS_ALIASES.includes(fdName)) { - return STANDARD_STREAMS_ALIASES.indexOf(fdName); - } - const regexpResult = FD_REGEXP.exec(fdName); - if (regexpResult !== null) { - return Number(regexpResult[1]); +// node_modules/@commitlint/types/lib/parse.js +var require_parse3 = __commonJS({ + "node_modules/@commitlint/types/lib/parse.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); } -}; -var FD_REGEXP = /^fd(\d+)$/; -var addDefaultValue = (optionArray, optionName) => optionArray.map((optionValue) => optionValue === void 0 ? DEFAULT_OPTIONS[optionName] : optionValue); -var verboseDefault = (0, import_node_util.debuglog)("execa").enabled ? "full" : "none"; -var DEFAULT_OPTIONS = { - lines: false, - buffer: true, - maxBuffer: 1e3 * 1e3 * 100, - verbose: verboseDefault, - stripFinalNewline: true -}; -var FD_SPECIFIC_OPTIONS = ["lines", "buffer", "maxBuffer", "verbose", "stripFinalNewline"]; -var getFdSpecificValue = (optionArray, fdNumber) => fdNumber === "ipc" ? optionArray.at(-1) : optionArray[fdNumber]; - -// node_modules/execa/lib/verbose/values.js -var isVerbose = ({ verbose }, fdNumber) => getFdVerbose(verbose, fdNumber) !== "none"; -var isFullVerbose = ({ verbose }, fdNumber) => !["none", "short"].includes(getFdVerbose(verbose, fdNumber)); -var getVerboseFunction = ({ verbose }, fdNumber) => { - const fdVerbose = getFdVerbose(verbose, fdNumber); - return isVerboseFunction(fdVerbose) ? fdVerbose : void 0; -}; -var getFdVerbose = (verbose, fdNumber) => fdNumber === void 0 ? getFdGenericVerbose(verbose) : getFdSpecificValue(verbose, fdNumber); -var getFdGenericVerbose = (verbose) => verbose.find((fdVerbose) => isVerboseFunction(fdVerbose)) ?? VERBOSE_VALUES.findLast((fdVerbose) => verbose.includes(fdVerbose)); -var isVerboseFunction = (fdVerbose) => typeof fdVerbose === "function"; -var VERBOSE_VALUES = ["none", "short", "full"]; - -// node_modules/execa/lib/verbose/log.js -var import_node_fs = require("node:fs"); -var import_node_util3 = require("node:util"); +}); -// node_modules/execa/lib/arguments/escape.js -var import_node_process5 = require("node:process"); -var import_node_util2 = require("node:util"); -var joinCommand = (filePath, rawArguments) => { - const fileAndArguments = [filePath, ...rawArguments]; - const command = fileAndArguments.join(" "); - const escapedCommand = fileAndArguments.map((fileAndArgument) => quoteString(escapeControlCharacters(fileAndArgument))).join(" "); - return { command, escapedCommand }; -}; -var escapeLines = (lines) => (0, import_node_util2.stripVTControlCharacters)(lines).split("\n").map((line) => escapeControlCharacters(line)).join("\n"); -var escapeControlCharacters = (line) => line.replaceAll(SPECIAL_CHAR_REGEXP, (character) => escapeControlCharacter(character)); -var escapeControlCharacter = (character) => { - const commonEscape = COMMON_ESCAPES[character]; - if (commonEscape !== void 0) { - return commonEscape; - } - const codepoint = character.codePointAt(0); - const codepointHex = codepoint.toString(16); - return codepoint <= ASTRAL_START ? `\\u${codepointHex.padStart(4, "0")}` : `\\U${codepointHex}`; -}; -var getSpecialCharRegExp = () => { - try { - return new RegExp("\\p{Separator}|\\p{Other}", "gu"); - } catch { - return /[\s\u0000-\u001F\u007F-\u009F\u00AD]/g; - } -}; -var SPECIAL_CHAR_REGEXP = getSpecialCharRegExp(); -var COMMON_ESCAPES = { - " ": " ", - "\b": "\\b", - "\f": "\\f", - "\n": "\\n", - "\r": "\\r", - " ": "\\t" -}; -var ASTRAL_START = 65535; -var quoteString = (escapedArgument) => { - if (NO_ESCAPE_REGEXP.test(escapedArgument)) { - return escapedArgument; +// node_modules/@commitlint/types/lib/prompt.js +var require_prompt = __commonJS({ + "node_modules/@commitlint/types/lib/prompt.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); } - return import_node_process5.platform === "win32" ? `"${escapedArgument.replaceAll('"', '""')}"` : `'${escapedArgument.replaceAll("'", "'\\''")}'`; -}; -var NO_ESCAPE_REGEXP = /^[\w./-]+$/; +}); -// node_modules/execa/node_modules/is-unicode-supported/index.js -var import_node_process6 = __toESM(require("node:process"), 1); -function isUnicodeSupported() { - if (import_node_process6.default.platform !== "win32") { - return import_node_process6.default.env.TERM !== "linux"; - } - return Boolean(import_node_process6.default.env.WT_SESSION) || Boolean(import_node_process6.default.env.TERMINUS_SUBLIME) || import_node_process6.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process6.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process6.default.env.TERM_PROGRAM === "vscode" || import_node_process6.default.env.TERM === "xterm-256color" || import_node_process6.default.env.TERM === "alacritty" || import_node_process6.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm"; -} - -// node_modules/execa/node_modules/figures/index.js -var common = { - circleQuestionMark: "(?)", - questionMarkPrefix: "(?)", - square: "\u2588", - squareDarkShade: "\u2593", - squareMediumShade: "\u2592", - squareLightShade: "\u2591", - squareTop: "\u2580", - squareBottom: "\u2584", - squareLeft: "\u258C", - squareRight: "\u2590", - squareCenter: "\u25A0", - bullet: "\u25CF", - dot: "\u2024", - ellipsis: "\u2026", - pointerSmall: "\u203A", - triangleUp: "\u25B2", - triangleUpSmall: "\u25B4", - triangleDown: "\u25BC", - triangleDownSmall: "\u25BE", - triangleLeftSmall: "\u25C2", - triangleRightSmall: "\u25B8", - home: "\u2302", - heart: "\u2665", - musicNote: "\u266A", - musicNoteBeamed: "\u266B", - arrowUp: "\u2191", - arrowDown: "\u2193", - arrowLeft: "\u2190", - arrowRight: "\u2192", - arrowLeftRight: "\u2194", - arrowUpDown: "\u2195", - almostEqual: "\u2248", - notEqual: "\u2260", - lessOrEqual: "\u2264", - greaterOrEqual: "\u2265", - identical: "\u2261", - infinity: "\u221E", - subscriptZero: "\u2080", - subscriptOne: "\u2081", - subscriptTwo: "\u2082", - subscriptThree: "\u2083", - subscriptFour: "\u2084", - subscriptFive: "\u2085", - subscriptSix: "\u2086", - subscriptSeven: "\u2087", - subscriptEight: "\u2088", - subscriptNine: "\u2089", - oneHalf: "\xBD", - oneThird: "\u2153", - oneQuarter: "\xBC", - oneFifth: "\u2155", - oneSixth: "\u2159", - oneEighth: "\u215B", - twoThirds: "\u2154", - twoFifths: "\u2156", - threeQuarters: "\xBE", - threeFifths: "\u2157", - threeEighths: "\u215C", - fourFifths: "\u2158", - fiveSixths: "\u215A", - fiveEighths: "\u215D", - sevenEighths: "\u215E", - line: "\u2500", - lineBold: "\u2501", - lineDouble: "\u2550", - lineDashed0: "\u2504", - lineDashed1: "\u2505", - lineDashed2: "\u2508", - lineDashed3: "\u2509", - lineDashed4: "\u254C", - lineDashed5: "\u254D", - lineDashed6: "\u2574", - lineDashed7: "\u2576", - lineDashed8: "\u2578", - lineDashed9: "\u257A", - lineDashed10: "\u257C", - lineDashed11: "\u257E", - lineDashed12: "\u2212", - lineDashed13: "\u2013", - lineDashed14: "\u2010", - lineDashed15: "\u2043", - lineVertical: "\u2502", - lineVerticalBold: "\u2503", - lineVerticalDouble: "\u2551", - lineVerticalDashed0: "\u2506", - lineVerticalDashed1: "\u2507", - lineVerticalDashed2: "\u250A", - lineVerticalDashed3: "\u250B", - lineVerticalDashed4: "\u254E", - lineVerticalDashed5: "\u254F", - lineVerticalDashed6: "\u2575", - lineVerticalDashed7: "\u2577", - lineVerticalDashed8: "\u2579", - lineVerticalDashed9: "\u257B", - lineVerticalDashed10: "\u257D", - lineVerticalDashed11: "\u257F", - lineDownLeft: "\u2510", - lineDownLeftArc: "\u256E", - lineDownBoldLeftBold: "\u2513", - lineDownBoldLeft: "\u2512", - lineDownLeftBold: "\u2511", - lineDownDoubleLeftDouble: "\u2557", - lineDownDoubleLeft: "\u2556", - lineDownLeftDouble: "\u2555", - lineDownRight: "\u250C", - lineDownRightArc: "\u256D", - lineDownBoldRightBold: "\u250F", - lineDownBoldRight: "\u250E", - lineDownRightBold: "\u250D", - lineDownDoubleRightDouble: "\u2554", - lineDownDoubleRight: "\u2553", - lineDownRightDouble: "\u2552", - lineUpLeft: "\u2518", - lineUpLeftArc: "\u256F", - lineUpBoldLeftBold: "\u251B", - lineUpBoldLeft: "\u251A", - lineUpLeftBold: "\u2519", - lineUpDoubleLeftDouble: "\u255D", - lineUpDoubleLeft: "\u255C", - lineUpLeftDouble: "\u255B", - lineUpRight: "\u2514", - lineUpRightArc: "\u2570", - lineUpBoldRightBold: "\u2517", - lineUpBoldRight: "\u2516", - lineUpRightBold: "\u2515", - lineUpDoubleRightDouble: "\u255A", - lineUpDoubleRight: "\u2559", - lineUpRightDouble: "\u2558", - lineUpDownLeft: "\u2524", - lineUpBoldDownBoldLeftBold: "\u252B", - lineUpBoldDownBoldLeft: "\u2528", - lineUpDownLeftBold: "\u2525", - lineUpBoldDownLeftBold: "\u2529", - lineUpDownBoldLeftBold: "\u252A", - lineUpDownBoldLeft: "\u2527", - lineUpBoldDownLeft: "\u2526", - lineUpDoubleDownDoubleLeftDouble: "\u2563", - lineUpDoubleDownDoubleLeft: "\u2562", - lineUpDownLeftDouble: "\u2561", - lineUpDownRight: "\u251C", - lineUpBoldDownBoldRightBold: "\u2523", - lineUpBoldDownBoldRight: "\u2520", - lineUpDownRightBold: "\u251D", - lineUpBoldDownRightBold: "\u2521", - lineUpDownBoldRightBold: "\u2522", - lineUpDownBoldRight: "\u251F", - lineUpBoldDownRight: "\u251E", - lineUpDoubleDownDoubleRightDouble: "\u2560", - lineUpDoubleDownDoubleRight: "\u255F", - lineUpDownRightDouble: "\u255E", - lineDownLeftRight: "\u252C", - lineDownBoldLeftBoldRightBold: "\u2533", - lineDownLeftBoldRightBold: "\u252F", - lineDownBoldLeftRight: "\u2530", - lineDownBoldLeftBoldRight: "\u2531", - lineDownBoldLeftRightBold: "\u2532", - lineDownLeftRightBold: "\u252E", - lineDownLeftBoldRight: "\u252D", - lineDownDoubleLeftDoubleRightDouble: "\u2566", - lineDownDoubleLeftRight: "\u2565", - lineDownLeftDoubleRightDouble: "\u2564", - lineUpLeftRight: "\u2534", - lineUpBoldLeftBoldRightBold: "\u253B", - lineUpLeftBoldRightBold: "\u2537", - lineUpBoldLeftRight: "\u2538", - lineUpBoldLeftBoldRight: "\u2539", - lineUpBoldLeftRightBold: "\u253A", - lineUpLeftRightBold: "\u2536", - lineUpLeftBoldRight: "\u2535", - lineUpDoubleLeftDoubleRightDouble: "\u2569", - lineUpDoubleLeftRight: "\u2568", - lineUpLeftDoubleRightDouble: "\u2567", - lineUpDownLeftRight: "\u253C", - lineUpBoldDownBoldLeftBoldRightBold: "\u254B", - lineUpDownBoldLeftBoldRightBold: "\u2548", - lineUpBoldDownLeftBoldRightBold: "\u2547", - lineUpBoldDownBoldLeftRightBold: "\u254A", - lineUpBoldDownBoldLeftBoldRight: "\u2549", - lineUpBoldDownLeftRight: "\u2540", - lineUpDownBoldLeftRight: "\u2541", - lineUpDownLeftBoldRight: "\u253D", - lineUpDownLeftRightBold: "\u253E", - lineUpBoldDownBoldLeftRight: "\u2542", - lineUpDownLeftBoldRightBold: "\u253F", - lineUpBoldDownLeftBoldRight: "\u2543", - lineUpBoldDownLeftRightBold: "\u2544", - lineUpDownBoldLeftBoldRight: "\u2545", - lineUpDownBoldLeftRightBold: "\u2546", - lineUpDoubleDownDoubleLeftDoubleRightDouble: "\u256C", - lineUpDoubleDownDoubleLeftRight: "\u256B", - lineUpDownLeftDoubleRightDouble: "\u256A", - lineCross: "\u2573", - lineBackslash: "\u2572", - lineSlash: "\u2571" -}; -var specialMainSymbols = { - tick: "\u2714", - info: "\u2139", - warning: "\u26A0", - cross: "\u2718", - squareSmall: "\u25FB", - squareSmallFilled: "\u25FC", - circle: "\u25EF", - circleFilled: "\u25C9", - circleDotted: "\u25CC", - circleDouble: "\u25CE", - circleCircle: "\u24DE", - circleCross: "\u24E7", - circlePipe: "\u24BE", - radioOn: "\u25C9", - radioOff: "\u25EF", - checkboxOn: "\u2612", - checkboxOff: "\u2610", - checkboxCircleOn: "\u24E7", - checkboxCircleOff: "\u24BE", - pointer: "\u276F", - triangleUpOutline: "\u25B3", - triangleLeft: "\u25C0", - triangleRight: "\u25B6", - lozenge: "\u25C6", - lozengeOutline: "\u25C7", - hamburger: "\u2630", - smiley: "\u32E1", - mustache: "\u0DF4", - star: "\u2605", - play: "\u25B6", - nodejs: "\u2B22", - oneSeventh: "\u2150", - oneNinth: "\u2151", - oneTenth: "\u2152" -}; -var specialFallbackSymbols = { - tick: "\u221A", - info: "i", - warning: "\u203C", - cross: "\xD7", - squareSmall: "\u25A1", - squareSmallFilled: "\u25A0", - circle: "( )", - circleFilled: "(*)", - circleDotted: "( )", - circleDouble: "( )", - circleCircle: "(\u25CB)", - circleCross: "(\xD7)", - circlePipe: "(\u2502)", - radioOn: "(*)", - radioOff: "( )", - checkboxOn: "[\xD7]", - checkboxOff: "[ ]", - checkboxCircleOn: "(\xD7)", - checkboxCircleOff: "( )", - pointer: ">", - triangleUpOutline: "\u2206", - triangleLeft: "\u25C4", - triangleRight: "\u25BA", - lozenge: "\u2666", - lozengeOutline: "\u25CA", - hamburger: "\u2261", - smiley: "\u263A", - mustache: "\u250C\u2500\u2510", - star: "\u2736", - play: "\u25BA", - nodejs: "\u2666", - oneSeventh: "1/7", - oneNinth: "1/9", - oneTenth: "1/10" -}; -var mainSymbols = { ...common, ...specialMainSymbols }; -var fallbackSymbols = { ...common, ...specialFallbackSymbols }; -var shouldUseMain = isUnicodeSupported(); -var figures = shouldUseMain ? mainSymbols : fallbackSymbols; -var figures_default = figures; -var replacements = Object.entries(specialMainSymbols); - -// node_modules/yoctocolors/base.js -var import_node_tty3 = __toESM(require("node:tty"), 1); -var hasColors = import_node_tty3.default?.WriteStream?.prototype?.hasColors?.() ?? false; -var format = (open, close) => { - if (!hasColors) { - return (input) => input; - } - const openCode = `\x1B[${open}m`; - const closeCode = `\x1B[${close}m`; - return (input) => { - const string = input + ""; - let index = string.indexOf(closeCode); - if (index === -1) { - return openCode + string + closeCode; - } - let result = openCode; - let lastIndex = 0; - while (index !== -1) { - result += string.slice(lastIndex, index) + openCode; - lastIndex = index + closeCode.length; - index = string.indexOf(closeCode, lastIndex); - } - result += string.slice(lastIndex) + closeCode; - return result; - }; -}; -var reset = format(0, 0); -var bold = format(1, 22); -var dim = format(2, 22); -var italic = format(3, 23); -var underline = format(4, 24); -var overline = format(53, 55); -var inverse = format(7, 27); -var hidden = format(8, 28); -var strikethrough = format(9, 29); -var black = format(30, 39); -var red = format(31, 39); -var green = format(32, 39); -var yellow = format(33, 39); -var blue = format(34, 39); -var magenta = format(35, 39); -var cyan = format(36, 39); -var white = format(37, 39); -var gray = format(90, 39); -var bgBlack = format(40, 49); -var bgRed = format(41, 49); -var bgGreen = format(42, 49); -var bgYellow = format(43, 49); -var bgBlue = format(44, 49); -var bgMagenta = format(45, 49); -var bgCyan = format(46, 49); -var bgWhite = format(47, 49); -var bgGray = format(100, 49); -var redBright = format(91, 39); -var greenBright = format(92, 39); -var yellowBright = format(93, 39); -var blueBright = format(94, 39); -var magentaBright = format(95, 39); -var cyanBright = format(96, 39); -var whiteBright = format(97, 39); -var bgRedBright = format(101, 49); -var bgGreenBright = format(102, 49); -var bgYellowBright = format(103, 49); -var bgBlueBright = format(104, 49); -var bgMagentaBright = format(105, 49); -var bgCyanBright = format(106, 49); -var bgWhiteBright = format(107, 49); - -// node_modules/execa/lib/verbose/default.js -var defaultVerboseFunction = ({ - type: type2, - message, - timestamp, - piped, - commandId, - result: { failed = false } = {}, - options: { reject = true } -}) => { - const timestampString = serializeTimestamp(timestamp); - const icon = ICONS[type2]({ failed, reject, piped }); - const color = COLORS[type2]({ reject }); - return `${gray(`[${timestampString}]`)} ${gray(`[${commandId}]`)} ${color(icon)} ${color(message)}`; -}; -var serializeTimestamp = (timestamp) => `${padField(timestamp.getHours(), 2)}:${padField(timestamp.getMinutes(), 2)}:${padField(timestamp.getSeconds(), 2)}.${padField(timestamp.getMilliseconds(), 3)}`; -var padField = (field, padding) => String(field).padStart(padding, "0"); -var getFinalIcon = ({ failed, reject }) => { - if (!failed) { - return figures_default.tick; +// node_modules/@commitlint/types/lib/rules.js +var require_rules = __commonJS({ + "node_modules/@commitlint/types/lib/rules.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + exports.RuleConfigQuality = exports.RuleConfigSeverity = void 0; + var RuleConfigSeverity2; + (function(RuleConfigSeverity3) { + RuleConfigSeverity3[RuleConfigSeverity3["Disabled"] = 0] = "Disabled"; + RuleConfigSeverity3[RuleConfigSeverity3["Warning"] = 1] = "Warning"; + RuleConfigSeverity3[RuleConfigSeverity3["Error"] = 2] = "Error"; + })(RuleConfigSeverity2 || (exports.RuleConfigSeverity = RuleConfigSeverity2 = {})); + var RuleConfigQuality; + (function(RuleConfigQuality2) { + RuleConfigQuality2[RuleConfigQuality2["User"] = 0] = "User"; + RuleConfigQuality2[RuleConfigQuality2["Qualified"] = 1] = "Qualified"; + })(RuleConfigQuality || (exports.RuleConfigQuality = RuleConfigQuality = {})); } - return reject ? figures_default.cross : figures_default.warning; -}; -var ICONS = { - command: ({ piped }) => piped ? "|" : "$", - output: () => " ", - ipc: () => "*", - error: getFinalIcon, - duration: getFinalIcon -}; -var identity = (string) => string; -var COLORS = { - command: () => bold, - output: () => identity, - ipc: () => identity, - error: ({ reject }) => reject ? redBright : yellowBright, - duration: () => gray -}; +}); -// node_modules/execa/lib/verbose/custom.js -var applyVerboseOnLines = (printedLines, verboseInfo, fdNumber) => { - const verboseFunction = getVerboseFunction(verboseInfo, fdNumber); - return printedLines.map(({ verboseLine, verboseObject }) => applyVerboseFunction(verboseLine, verboseObject, verboseFunction)).filter((printedLine) => printedLine !== void 0).map((printedLine) => appendNewline(printedLine)).join(""); -}; -var applyVerboseFunction = (verboseLine, verboseObject, verboseFunction) => { - if (verboseFunction === void 0) { - return verboseLine; - } - const printedLine = verboseFunction(verboseLine, verboseObject); - if (typeof printedLine === "string") { - return printedLine; +// node_modules/@commitlint/types/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/@commitlint/types/lib/index.js"(exports) { + "use strict"; + var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m5, k7, k22) { + if (k22 === void 0) + k22 = k7; + var desc = Object.getOwnPropertyDescriptor(m5, k7); + if (!desc || ("get" in desc ? !m5.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { + return m5[k7]; + } }; + } + Object.defineProperty(o3, k22, desc); + } : function(o3, m5, k7, k22) { + if (k22 === void 0) + k22 = k7; + o3[k22] = m5[k7]; + }); + var __exportStar2 = exports && exports.__exportStar || function(m5, exports2) { + for (var p4 in m5) + if (p4 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p4)) + __createBinding2(exports2, m5, p4); + }; + Object.defineProperty(exports, "__esModule", { value: true }); + __exportStar2(require_ensure(), exports); + __exportStar2(require_format(), exports); + __exportStar2(require_is_ignored(), exports); + __exportStar2(require_lint(), exports); + __exportStar2(require_load(), exports); + __exportStar2(require_parse3(), exports); + __exportStar2(require_prompt(), exports); + __exportStar2(require_rules(), exports); } -}; -var appendNewline = (printedLine) => printedLine.endsWith("\n") ? printedLine : `${printedLine} -`; - -// node_modules/execa/lib/verbose/log.js -var verboseLog = ({ type: type2, verboseMessage, fdNumber, verboseInfo, result }) => { - const verboseObject = getVerboseObject({ type: type2, result, verboseInfo }); - const printedLines = getPrintedLines(verboseMessage, verboseObject); - const finalLines = applyVerboseOnLines(printedLines, verboseInfo, fdNumber); - (0, import_node_fs.writeFileSync)(STDERR_FD, finalLines); -}; -var getVerboseObject = ({ - type: type2, - result, - verboseInfo: { escapedCommand, commandId, rawOptions: { piped = false, ...options } } -}) => ({ - type: type2, - escapedCommand, - commandId: `${commandId}`, - timestamp: new Date(), - piped, - result, - options }); -var getPrintedLines = (verboseMessage, verboseObject) => verboseMessage.split("\n").map((message) => getPrintedLine({ ...verboseObject, message })); -var getPrintedLine = (verboseObject) => { - const verboseLine = defaultVerboseFunction(verboseObject); - return { verboseLine, verboseObject }; -}; -var STDERR_FD = 2; -var serializeVerboseMessage = (message) => { - const messageString = typeof message === "string" ? message : (0, import_node_util3.inspect)(message); - const escapedMessage = escapeLines(messageString); - return escapedMessage.replaceAll(" ", " ".repeat(TAB_SIZE)); -}; -var TAB_SIZE = 2; - -// node_modules/execa/lib/verbose/start.js -var logCommand = (escapedCommand, verboseInfo) => { - if (!isVerbose(verboseInfo)) { - return; - } - verboseLog({ - type: "command", - verboseMessage: escapedCommand, - verboseInfo - }); -}; -// node_modules/execa/lib/verbose/info.js -var getVerboseInfo = (verbose, escapedCommand, rawOptions) => { - validateVerbose(verbose); - const commandId = getCommandId(verbose); - return { - verbose, - escapedCommand, - commandId, - rawOptions - }; -}; -var getCommandId = (verbose) => isVerbose({ verbose }) ? COMMAND_ID++ : void 0; -var COMMAND_ID = 0n; -var validateVerbose = (verbose) => { - for (const fdVerbose of verbose) { - if (fdVerbose === false) { - throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`); - } - if (fdVerbose === true) { - throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`); +// node_modules/ignore/index.js +var require_ignore = __commonJS({ + "node_modules/ignore/index.js"(exports, module2) { + function makeArray(subject) { + return Array.isArray(subject) ? subject : [subject]; } - if (!VERBOSE_VALUES.includes(fdVerbose) && !isVerboseFunction(fdVerbose)) { - const allowedValues = VERBOSE_VALUES.map((allowedValue) => `'${allowedValue}'`).join(", "); - throw new TypeError(`The "verbose" option must not be ${fdVerbose}. Allowed values are: ${allowedValues} or a function.`); + var EMPTY = ""; + var SPACE = " "; + var ESCAPE = "\\"; + var REGEX_TEST_BLANK_LINE = /^\s+$/; + var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/; + var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/; + var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/; + var REGEX_SPLITALL_CRLF = /\r?\n/g; + var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/; + var SLASH = "/"; + var TMP_KEY_IGNORE = "node-ignore"; + if (typeof Symbol !== "undefined") { + TMP_KEY_IGNORE = Symbol.for("node-ignore"); } - } -}; - -// node_modules/execa/lib/return/duration.js -var import_node_process7 = require("node:process"); -var getStartTime = () => import_node_process7.hrtime.bigint(); -var getDurationMs = (startTime) => Number(import_node_process7.hrtime.bigint() - startTime) / 1e6; - -// node_modules/execa/lib/arguments/command.js -var handleCommand = (filePath, rawArguments, rawOptions) => { - const startTime = getStartTime(); - const { command, escapedCommand } = joinCommand(filePath, rawArguments); - const verbose = normalizeFdSpecificOption(rawOptions, "verbose"); - const verboseInfo = getVerboseInfo(verbose, escapedCommand, { ...rawOptions }); - logCommand(escapedCommand, verboseInfo); - return { - command, - escapedCommand, - startTime, - verboseInfo - }; -}; - -// node_modules/execa/lib/arguments/options.js -var import_node_path4 = __toESM(require("node:path"), 1); -var import_node_process11 = __toESM(require("node:process"), 1); -var import_cross_spawn = __toESM(require_cross_spawn(), 1); - -// node_modules/npm-run-path/index.js -var import_node_process8 = __toESM(require("node:process"), 1); -var import_node_path = __toESM(require("node:path"), 1); -var import_node_url2 = require("node:url"); - -// node_modules/npm-run-path/node_modules/path-key/index.js -function pathKey(options = {}) { - const { - env: env2 = process.env, - platform: platform2 = process.platform - } = options; - if (platform2 !== "win32") { - return "PATH"; - } - return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path"; -} - -// node_modules/npm-run-path/index.js -var npmRunPath = ({ - cwd = import_node_process8.default.cwd(), - path: pathOption = import_node_process8.default.env[pathKey()], - preferLocal = true, - execPath: execPath2 = import_node_process8.default.execPath, - addExecPath = true -} = {}) => { - const cwdString = cwd instanceof URL ? (0, import_node_url2.fileURLToPath)(cwd) : cwd; - const cwdPath = import_node_path.default.resolve(cwdString); - const result = []; - if (preferLocal) { - applyPreferLocal(result, cwdPath); - } - if (addExecPath) { - applyExecPath(result, execPath2, cwdPath); - } - return [...result, pathOption].join(import_node_path.default.delimiter); -}; -var applyPreferLocal = (result, cwdPath) => { - let previous; - while (previous !== cwdPath) { - result.push(import_node_path.default.join(cwdPath, "node_modules/.bin")); - previous = cwdPath; - cwdPath = import_node_path.default.resolve(cwdPath, ".."); - } -}; -var applyExecPath = (result, execPath2, cwdPath) => { - const execPathString = execPath2 instanceof URL ? (0, import_node_url2.fileURLToPath)(execPath2) : execPath2; - result.push(import_node_path.default.resolve(cwdPath, execPathString, "..")); -}; -var npmRunPathEnv = ({ env: env2 = import_node_process8.default.env, ...options } = {}) => { - env2 = { ...env2 }; - const pathName = pathKey({ env: env2 }); - options.path = env2[pathName]; - env2[pathName] = npmRunPath(options); - return env2; -}; - -// node_modules/execa/lib/terminate/kill.js -var import_promises = require("node:timers/promises"); - -// node_modules/execa/lib/return/final-error.js -var getFinalError = (originalError, message, isSync) => { - const ErrorClass = isSync ? ExecaSyncError : ExecaError; - const options = originalError instanceof DiscardedError ? {} : { cause: originalError }; - return new ErrorClass(message, options); -}; -var DiscardedError = class extends Error { -}; -var setErrorName = (ErrorClass, value) => { - Object.defineProperty(ErrorClass.prototype, "name", { - value, - writable: true, - enumerable: false, - configurable: true - }); - Object.defineProperty(ErrorClass.prototype, execaErrorSymbol, { - value: true, - writable: false, - enumerable: false, - configurable: false - }); -}; -var isExecaError = (error) => isErrorInstance(error) && execaErrorSymbol in error; -var execaErrorSymbol = Symbol("isExecaError"); -var isErrorInstance = (value) => Object.prototype.toString.call(value) === "[object Error]"; -var ExecaError = class extends Error { -}; -setErrorName(ExecaError, ExecaError.name); -var ExecaSyncError = class extends Error { -}; -setErrorName(ExecaSyncError, ExecaSyncError.name); - -// node_modules/execa/lib/terminate/signal.js -var import_node_os4 = require("node:os"); - -// node_modules/human-signals/build/src/main.js -var import_node_os3 = require("node:os"); - -// node_modules/human-signals/build/src/realtime.js -var getRealtimeSignals = () => { - const length = SIGRTMAX - SIGRTMIN + 1; - return Array.from({ length }, getRealtimeSignal); -}; -var getRealtimeSignal = (value, index) => ({ - name: `SIGRT${index + 1}`, - number: SIGRTMIN + index, - action: "terminate", - description: "Application-specific signal (realtime)", - standard: "posix" -}); -var SIGRTMIN = 34; -var SIGRTMAX = 64; - -// node_modules/human-signals/build/src/signals.js -var import_node_os2 = require("node:os"); - -// node_modules/human-signals/build/src/core.js -var SIGNALS = [ - { - name: "SIGHUP", - number: 1, - action: "terminate", - description: "Terminal closed", - standard: "posix" - }, - { - name: "SIGINT", - number: 2, - action: "terminate", - description: "User interruption with CTRL-C", - standard: "ansi" - }, - { - name: "SIGQUIT", - number: 3, - action: "core", - description: "User interruption with CTRL-\\", - standard: "posix" - }, - { - name: "SIGILL", - number: 4, - action: "core", - description: "Invalid machine instruction", - standard: "ansi" - }, - { - name: "SIGTRAP", - number: 5, - action: "core", - description: "Debugger breakpoint", - standard: "posix" - }, - { - name: "SIGABRT", - number: 6, - action: "core", - description: "Aborted", - standard: "ansi" - }, - { - name: "SIGIOT", - number: 6, - action: "core", - description: "Aborted", - standard: "bsd" - }, - { - name: "SIGBUS", - number: 7, - action: "core", - description: "Bus error due to misaligned, non-existing address or paging error", - standard: "bsd" - }, - { - name: "SIGEMT", - number: 7, - action: "terminate", - description: "Command should be emulated but is not implemented", - standard: "other" - }, - { - name: "SIGFPE", - number: 8, - action: "core", - description: "Floating point arithmetic error", - standard: "ansi" - }, - { - name: "SIGKILL", - number: 9, - action: "terminate", - description: "Forced termination", - standard: "posix", - forced: true - }, - { - name: "SIGUSR1", - number: 10, - action: "terminate", - description: "Application-specific signal", - standard: "posix" - }, - { - name: "SIGSEGV", - number: 11, - action: "core", - description: "Segmentation fault", - standard: "ansi" - }, - { - name: "SIGUSR2", - number: 12, - action: "terminate", - description: "Application-specific signal", - standard: "posix" - }, - { - name: "SIGPIPE", - number: 13, - action: "terminate", - description: "Broken pipe or socket", - standard: "posix" - }, - { - name: "SIGALRM", - number: 14, - action: "terminate", - description: "Timeout or timer", - standard: "posix" - }, - { - name: "SIGTERM", - number: 15, - action: "terminate", - description: "Termination", - standard: "ansi" - }, - { - name: "SIGSTKFLT", - number: 16, - action: "terminate", - description: "Stack is empty or overflowed", - standard: "other" - }, - { - name: "SIGCHLD", - number: 17, - action: "ignore", - description: "Child process terminated, paused or unpaused", - standard: "posix" - }, - { - name: "SIGCLD", - number: 17, - action: "ignore", - description: "Child process terminated, paused or unpaused", - standard: "other" - }, - { - name: "SIGCONT", - number: 18, - action: "unpause", - description: "Unpaused", - standard: "posix", - forced: true - }, - { - name: "SIGSTOP", - number: 19, - action: "pause", - description: "Paused", - standard: "posix", - forced: true - }, - { - name: "SIGTSTP", - number: 20, - action: "pause", - description: 'Paused using CTRL-Z or "suspend"', - standard: "posix" - }, - { - name: "SIGTTIN", - number: 21, - action: "pause", - description: "Background process cannot read terminal input", - standard: "posix" - }, - { - name: "SIGBREAK", - number: 21, - action: "terminate", - description: "User interruption with CTRL-BREAK", - standard: "other" - }, - { - name: "SIGTTOU", - number: 22, - action: "pause", - description: "Background process cannot write to terminal output", - standard: "posix" - }, - { - name: "SIGURG", - number: 23, - action: "ignore", - description: "Socket received out-of-band data", - standard: "bsd" - }, - { - name: "SIGXCPU", - number: 24, - action: "core", - description: "Process timed out", - standard: "bsd" - }, - { - name: "SIGXFSZ", - number: 25, - action: "core", - description: "File too big", - standard: "bsd" - }, - { - name: "SIGVTALRM", - number: 26, - action: "terminate", - description: "Timeout or timer", - standard: "bsd" - }, - { - name: "SIGPROF", - number: 27, - action: "terminate", - description: "Timeout or timer", - standard: "bsd" - }, - { - name: "SIGWINCH", - number: 28, - action: "ignore", - description: "Terminal window size changed", - standard: "bsd" - }, - { - name: "SIGIO", - number: 29, - action: "terminate", - description: "I/O is available", - standard: "other" - }, - { - name: "SIGPOLL", - number: 29, - action: "terminate", - description: "Watched event", - standard: "other" - }, - { - name: "SIGINFO", - number: 29, - action: "ignore", - description: "Request for process information", - standard: "other" - }, - { - name: "SIGPWR", - number: 30, - action: "terminate", - description: "Device running out of power", - standard: "systemv" - }, - { - name: "SIGSYS", - number: 31, - action: "core", - description: "Invalid system call", - standard: "other" - }, - { - name: "SIGUNUSED", - number: 31, - action: "terminate", - description: "Invalid system call", - standard: "other" - } -]; - -// node_modules/human-signals/build/src/signals.js -var getSignals = () => { - const realtimeSignals = getRealtimeSignals(); - const signals2 = [...SIGNALS, ...realtimeSignals].map(normalizeSignal); - return signals2; -}; -var normalizeSignal = ({ - name, - number: defaultNumber, - description, - action, - forced = false, - standard -}) => { - const { - signals: { [name]: constantSignal } - } = import_node_os2.constants; - const supported = constantSignal !== void 0; - const number = supported ? constantSignal : defaultNumber; - return { name, number, description, supported, action, forced, standard }; -}; - -// node_modules/human-signals/build/src/main.js -var getSignalsByName = () => { - const signals2 = getSignals(); - return Object.fromEntries(signals2.map(getSignalByName)); -}; -var getSignalByName = ({ - name, - number, - description, - supported, - action, - forced, - standard -}) => [name, { name, number, description, supported, action, forced, standard }]; -var signalsByName = getSignalsByName(); -var getSignalsByNumber = () => { - const signals2 = getSignals(); - const length = SIGRTMAX + 1; - const signalsA = Array.from( - { length }, - (value, number) => getSignalByNumber(number, signals2) - ); - return Object.assign({}, ...signalsA); -}; -var getSignalByNumber = (number, signals2) => { - const signal = findSignalByNumber(number, signals2); - if (signal === void 0) { - return {}; - } - const { name, description, supported, action, forced, standard } = signal; - return { - [number]: { - name, - number, - description, - supported, - action, - forced, - standard + var KEY_IGNORE = TMP_KEY_IGNORE; + var define2 = (object, key, value) => Object.defineProperty(object, key, { value }); + var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g; + var RETURN_FALSE = () => false; + var sanitizeRange = (range) => range.replace( + REGEX_REGEXP_RANGE, + (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY + ); + var cleanRangeBackSlash = (slashes) => { + const { length } = slashes; + return slashes.slice(0, length - length % 2); + }; + var REPLACERS = [ + [ + /^\uFEFF/, + () => EMPTY + ], + [ + /\\?\s+$/, + (match) => match.indexOf("\\") === 0 ? SPACE : EMPTY + ], + [ + /\\\s/g, + () => SPACE + ], + [ + /[\\$.|*+(){^]/g, + (match) => `\\${match}` + ], + [ + /(?!\\)\?/g, + () => "[^/]" + ], + [ + /^\//, + () => "^" + ], + [ + /\//g, + () => "\\/" + ], + [ + /^\^*\\\*\\\*\\\//, + () => "^(?:.*\\/)?" + ], + [ + /^(?=[^^])/, + function startingReplacer() { + return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^"; + } + ], + [ + /\\\/\\\*\\\*(?=\\\/|$)/g, + (_7, index, str2) => index + 6 < str2.length ? "(?:\\/[^\\/]+)*" : "\\/.+" + ], + [ + /(^|[^\\]+)(\\\*)+(?=.+)/g, + (_7, p1, p22) => { + const unescaped = p22.replace(/\\\*/g, "[^\\/]*"); + return p1 + unescaped; + } + ], + [ + /\\\\\\(?=[$.|*+(){^])/g, + () => ESCAPE + ], + [ + /\\\\/g, + () => ESCAPE + ], + [ + /(\\)?\[([^\]/]*?)(\\*)($|\])/g, + (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]" + ], + [ + /(?:[^*])$/, + (match) => /\/$/.test(match) ? `${match}$` : `${match}(?=$|\\/$)` + ], + [ + /(\^|\\\/)?\\\*$/, + (_7, p1) => { + const prefix = p1 ? `${p1}[^/]+` : "[^/]*"; + return `${prefix}(?=$|\\/$)`; + } + ] + ]; + var regexCache = /* @__PURE__ */ Object.create(null); + var makeRegex = (pattern, ignoreCase) => { + let source = regexCache[pattern]; + if (!source) { + source = REPLACERS.reduce( + (prev, current) => prev.replace(current[0], current[1].bind(pattern)), + pattern + ); + regexCache[pattern] = source; + } + return ignoreCase ? new RegExp(source, "i") : new RegExp(source); + }; + var isString2 = (subject) => typeof subject === "string"; + var checkPattern = (pattern) => pattern && isString2(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0; + var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF); + var IgnoreRule = class { + constructor(origin2, pattern, negative, regex) { + this.origin = origin2; + this.pattern = pattern; + this.negative = negative; + this.regex = regex; + } + }; + var createRule = (pattern, ignoreCase) => { + const origin2 = pattern; + let negative = false; + if (pattern.indexOf("!") === 0) { + negative = true; + pattern = pattern.substr(1); + } + pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#"); + const regex = makeRegex(pattern, ignoreCase); + return new IgnoreRule( + origin2, + pattern, + negative, + regex + ); + }; + var throwError = (message, Ctor) => { + throw new Ctor(message); + }; + var checkPath = (path5, originalPath, doThrow) => { + if (!isString2(path5)) { + return doThrow( + `path must be a string, but got \`${originalPath}\``, + TypeError + ); + } + if (!path5) { + return doThrow(`path must not be empty`, TypeError); + } + if (checkPath.isNotRelative(path5)) { + const r3 = "`path.relative()`d"; + return doThrow( + `path should be a ${r3} string, but got "${originalPath}"`, + RangeError + ); + } + return true; + }; + var isNotRelative = (path5) => REGEX_TEST_INVALID_PATH.test(path5); + checkPath.isNotRelative = isNotRelative; + checkPath.convert = (p4) => p4; + var Ignore2 = class { + constructor({ + ignorecase = true, + ignoreCase = ignorecase, + allowRelativePaths = false + } = {}) { + define2(this, KEY_IGNORE, true); + this._rules = []; + this._ignoreCase = ignoreCase; + this._allowRelativePaths = allowRelativePaths; + this._initCache(); + } + _initCache() { + this._ignoreCache = /* @__PURE__ */ Object.create(null); + this._testCache = /* @__PURE__ */ Object.create(null); + } + _addPattern(pattern) { + if (pattern && pattern[KEY_IGNORE]) { + this._rules = this._rules.concat(pattern._rules); + this._added = true; + return; + } + if (checkPattern(pattern)) { + const rule = createRule(pattern, this._ignoreCase); + this._added = true; + this._rules.push(rule); + } + } + add(pattern) { + this._added = false; + makeArray( + isString2(pattern) ? splitPattern(pattern) : pattern + ).forEach(this._addPattern, this); + if (this._added) { + this._initCache(); + } + return this; + } + addPattern(pattern) { + return this.add(pattern); + } + _testOne(path5, checkUnignored) { + let ignored = false; + let unignored = false; + this._rules.forEach((rule) => { + const { negative } = rule; + if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) { + return; + } + const matched = rule.regex.test(path5); + if (matched) { + ignored = !negative; + unignored = negative; + } + }); + return { + ignored, + unignored + }; + } + _test(originalPath, cache, checkUnignored, slices) { + const path5 = originalPath && checkPath.convert(originalPath); + checkPath( + path5, + originalPath, + this._allowRelativePaths ? RETURN_FALSE : throwError + ); + return this._t(path5, cache, checkUnignored, slices); + } + _t(path5, cache, checkUnignored, slices) { + if (path5 in cache) { + return cache[path5]; + } + if (!slices) { + slices = path5.split(SLASH); + } + slices.pop(); + if (!slices.length) { + return cache[path5] = this._testOne(path5, checkUnignored); + } + const parent = this._t( + slices.join(SLASH) + SLASH, + cache, + checkUnignored, + slices + ); + return cache[path5] = parent.ignored ? parent : this._testOne(path5, checkUnignored); + } + ignores(path5) { + return this._test(path5, this._ignoreCache, false).ignored; + } + createFilter() { + return (path5) => !this.ignores(path5); + } + filter(paths) { + return makeArray(paths).filter(this.createFilter()); + } + test(path5) { + return this._test(path5, this._testCache, true); + } + }; + var factory = (options) => new Ignore2(options); + var isPathValid = (path5) => checkPath(path5 && checkPath.convert(path5), path5, RETURN_FALSE); + factory.isPathValid = isPathValid; + factory.default = factory; + module2.exports = factory; + if (typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")) { + const makePosix = (str2) => /^\\\\\?\\/.test(str2) || /["<>|\u0000-\u001F]+/u.test(str2) ? str2 : str2.replace(/\\/g, "/"); + checkPath.convert = makePosix; + const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i; + checkPath.isNotRelative = (path5) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path5) || isNotRelative(path5); } - }; -}; -var findSignalByNumber = (number, signals2) => { - const signal = signals2.find(({ name }) => import_node_os3.constants.signals[name] === number); - if (signal !== void 0) { - return signal; - } - return signals2.find((signalA) => signalA.number === number); -}; -var signalsByNumber = getSignalsByNumber(); - -// node_modules/execa/lib/terminate/signal.js -var normalizeKillSignal = (killSignal) => { - const optionName = "option `killSignal`"; - if (killSignal === 0) { - throw new TypeError(`Invalid ${optionName}: 0 cannot be used.`); - } - return normalizeSignal2(killSignal, optionName); -}; -var normalizeSignalArgument = (signal) => signal === 0 ? signal : normalizeSignal2(signal, "`subprocess.kill()`'s argument"); -var normalizeSignal2 = (signalNameOrInteger, optionName) => { - if (Number.isInteger(signalNameOrInteger)) { - return normalizeSignalInteger(signalNameOrInteger, optionName); - } - if (typeof signalNameOrInteger === "string") { - return normalizeSignalName(signalNameOrInteger, optionName); - } - throw new TypeError(`Invalid ${optionName} ${String(signalNameOrInteger)}: it must be a string or an integer. -${getAvailableSignals()}`); -}; -var normalizeSignalInteger = (signalInteger, optionName) => { - if (signalsIntegerToName.has(signalInteger)) { - return signalsIntegerToName.get(signalInteger); - } - throw new TypeError(`Invalid ${optionName} ${signalInteger}: this signal integer does not exist. -${getAvailableSignals()}`); -}; -var getSignalsIntegerToName = () => new Map(Object.entries(import_node_os4.constants.signals).reverse().map(([signalName, signalInteger]) => [signalInteger, signalName])); -var signalsIntegerToName = getSignalsIntegerToName(); -var normalizeSignalName = (signalName, optionName) => { - if (signalName in import_node_os4.constants.signals) { - return signalName; - } - if (signalName.toUpperCase() in import_node_os4.constants.signals) { - throw new TypeError(`Invalid ${optionName} '${signalName}': please rename it to '${signalName.toUpperCase()}'.`); } - throw new TypeError(`Invalid ${optionName} '${signalName}': this signal name does not exist. -${getAvailableSignals()}`); -}; -var getAvailableSignals = () => `Available signal names: ${getAvailableSignalNames()}. -Available signal numbers: ${getAvailableSignalIntegers()}.`; -var getAvailableSignalNames = () => Object.keys(import_node_os4.constants.signals).sort().map((signalName) => `'${signalName}'`).join(", "); -var getAvailableSignalIntegers = () => [...new Set(Object.values(import_node_os4.constants.signals).sort((signalInteger, signalIntegerTwo) => signalInteger - signalIntegerTwo))].join(", "); -var getSignalDescription = (signal) => signalsByName[signal].description; +}); -// node_modules/execa/lib/terminate/kill.js -var normalizeForceKillAfterDelay = (forceKillAfterDelay) => { - if (forceKillAfterDelay === false) { - return forceKillAfterDelay; - } - if (forceKillAfterDelay === true) { - return DEFAULT_FORCE_KILL_TIMEOUT; - } - if (!Number.isFinite(forceKillAfterDelay) || forceKillAfterDelay < 0) { - throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${forceKillAfterDelay}\` (${typeof forceKillAfterDelay})`); - } - return forceKillAfterDelay; -}; -var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5; -var subprocessKill = ({ kill, options: { forceKillAfterDelay, killSignal }, onInternalError, context, controller }, signalOrError, errorArgument) => { - const { signal, error } = parseKillArguments(signalOrError, errorArgument, killSignal); - emitKillError(error, onInternalError); - const killResult = kill(signal); - setKillTimeout({ - kill, - signal, - forceKillAfterDelay, - killSignal, - killResult, - context, - controller - }); - return killResult; -}; -var parseKillArguments = (signalOrError, errorArgument, killSignal) => { - const [signal = killSignal, error] = isErrorInstance(signalOrError) ? [void 0, signalOrError] : [signalOrError, errorArgument]; - if (typeof signal !== "string" && !Number.isInteger(signal)) { - throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(signal)}`); - } - if (error !== void 0 && !isErrorInstance(error)) { - throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${error}`); - } - return { signal: normalizeSignalArgument(signal), error }; -}; -var emitKillError = (error, onInternalError) => { - if (error !== void 0) { - onInternalError.reject(error); - } -}; -var setKillTimeout = async ({ kill, signal, forceKillAfterDelay, killSignal, killResult, context, controller }) => { - if (signal === killSignal && killResult) { - killOnTimeout({ - kill, - forceKillAfterDelay, - context, - controllerSignal: controller.signal - }); - } +// node_modules/type-flag/dist/index.mjs +var V = "known-flag"; +var k = "unknown-flag"; +var C = "argument"; +var { stringify: h } = JSON; +var O = /\B([A-Z])/g; +var v = (t2) => t2.replace(O, "-$1").toLowerCase(); +var { hasOwnProperty: D } = Object.prototype; +var w = (t2, n2) => D.call(t2, n2); +var L = (t2) => Array.isArray(t2); +var b = (t2) => typeof t2 == "function" ? [t2, false] : L(t2) ? [t2[0], true] : b(t2.type); +var d = (t2, n2) => t2 === Boolean ? n2 !== "false" : n2; +var m = (t2, n2) => typeof n2 == "boolean" ? n2 : t2 === Number && n2 === "" ? Number.NaN : t2(n2); +var R = /[\s.:=]/; +var B = (t2) => { + const n2 = `Flag name ${h(t2)}`; + if (t2.length === 0) + throw new Error(`${n2} cannot be empty`); + if (t2.length === 1) + throw new Error(`${n2} must be longer than a character`); + const r3 = t2.match(R); + if (r3) + throw new Error(`${n2} cannot contain ${h(r3?.[0])}`); }; -var killOnTimeout = async ({ kill, forceKillAfterDelay, context, controllerSignal }) => { - if (forceKillAfterDelay === false) { - return; - } - try { - await (0, import_promises.setTimeout)(forceKillAfterDelay, void 0, { signal: controllerSignal }); - if (kill("SIGKILL")) { - context.isForcefullyTerminated ??= true; +var K = (t2) => { + const n2 = {}, r3 = (e3, o3) => { + if (w(n2, e3)) + throw new Error(`Duplicate flags named ${h(e3)}`); + n2[e3] = o3; + }; + for (const e3 in t2) { + if (!w(t2, e3)) + continue; + B(e3); + const o3 = t2[e3], s2 = [[], ...b(o3), o3]; + r3(e3, s2); + const i3 = v(e3); + if (e3 !== i3 && r3(i3, s2), "alias" in o3 && typeof o3.alias == "string") { + const { alias: a4 } = o3, l3 = `Flag alias ${h(a4)} for flag ${h(e3)}`; + if (a4.length === 0) + throw new Error(`${l3} cannot be empty`); + if (a4.length > 1) + throw new Error(`${l3} must be a single character`); + r3(a4, s2); } - } catch { - } -}; - -// node_modules/execa/lib/utils/abort-signal.js -var import_node_events = require("node:events"); -var onAbortedSignal = async (mainSignal, stopSignal) => { - if (!mainSignal.aborted) { - await (0, import_node_events.once)(mainSignal, "abort", { signal: stopSignal }); - } -}; - -// node_modules/execa/lib/terminate/cancel.js -var validateCancelSignal = ({ cancelSignal }) => { - if (cancelSignal !== void 0 && Object.prototype.toString.call(cancelSignal) !== "[object AbortSignal]") { - throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(cancelSignal)}`); - } -}; -var throwOnCancel = ({ subprocess, cancelSignal, gracefulCancel, context, controller }) => cancelSignal === void 0 || gracefulCancel ? [] : [terminateOnCancel(subprocess, cancelSignal, context, controller)]; -var terminateOnCancel = async (subprocess, cancelSignal, context, { signal }) => { - await onAbortedSignal(cancelSignal, signal); - context.terminationReason ??= "cancel"; - subprocess.kill(); - throw cancelSignal.reason; -}; - -// node_modules/execa/lib/ipc/graceful.js -var import_promises3 = require("node:timers/promises"); - -// node_modules/execa/lib/ipc/send.js -var import_node_util4 = require("node:util"); - -// node_modules/execa/lib/ipc/validation.js -var validateIpcMethod = ({ methodName, isSubprocess, ipc, isConnected: isConnected2 }) => { - validateIpcOption(methodName, isSubprocess, ipc); - validateConnection(methodName, isSubprocess, isConnected2); -}; -var validateIpcOption = (methodName, isSubprocess, ipc) => { - if (!ipc) { - throw new Error(`${getMethodName(methodName, isSubprocess)} can only be used if the \`ipc\` option is \`true\`.`); } + return n2; }; -var validateConnection = (methodName, isSubprocess, isConnected2) => { - if (!isConnected2) { - throw new Error(`${getMethodName(methodName, isSubprocess)} cannot be used: the ${getOtherProcessName(isSubprocess)} has already exited or disconnected.`); - } -}; -var throwOnEarlyDisconnect = (isSubprocess) => { - throw new Error(`${getMethodName("getOneMessage", isSubprocess)} could not complete: the ${getOtherProcessName(isSubprocess)} exited or disconnected.`); -}; -var throwOnStrictDeadlockError = (isSubprocess) => { - throw new Error(`${getMethodName("sendMessage", isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} is sending a message too, instead of listening to incoming messages. -This can be fixed by both sending a message and listening to incoming messages at the same time: - -const [receivedMessage] = await Promise.all([ - ${getMethodName("getOneMessage", isSubprocess)}, - ${getMethodName("sendMessage", isSubprocess, "message, {strict: true}")}, -]);`); -}; -var getStrictResponseError = (error, isSubprocess) => new Error(`${getMethodName("sendMessage", isSubprocess)} failed when sending an acknowledgment response to the ${getOtherProcessName(isSubprocess)}.`, { cause: error }); -var throwOnMissingStrict = (isSubprocess) => { - throw new Error(`${getMethodName("sendMessage", isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} is not listening to incoming messages.`); -}; -var throwOnStrictDisconnect = (isSubprocess) => { - throw new Error(`${getMethodName("sendMessage", isSubprocess)} failed: the ${getOtherProcessName(isSubprocess)} exited without listening to incoming messages.`); -}; -var getAbortDisconnectError = () => new Error(`\`cancelSignal\` aborted: the ${getOtherProcessName(true)} disconnected.`); -var throwOnMissingParent = () => { - throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option."); -}; -var handleEpipeError = ({ error, methodName, isSubprocess }) => { - if (error.code === "EPIPE") { - throw new Error(`${getMethodName(methodName, isSubprocess)} cannot be used: the ${getOtherProcessName(isSubprocess)} is disconnecting.`, { cause: error }); - } -}; -var handleSerializationError = ({ error, methodName, isSubprocess, message }) => { - if (isSerializationError(error)) { - throw new Error(`${getMethodName(methodName, isSubprocess)}'s argument type is invalid: the message cannot be serialized: ${String(message)}.`, { cause: error }); - } -}; -var isSerializationError = ({ code, message }) => SERIALIZATION_ERROR_CODES.has(code) || SERIALIZATION_ERROR_MESSAGES.some((serializationErrorMessage) => message.includes(serializationErrorMessage)); -var SERIALIZATION_ERROR_CODES = /* @__PURE__ */ new Set([ - "ERR_MISSING_ARGS", - "ERR_INVALID_ARG_TYPE" -]); -var SERIALIZATION_ERROR_MESSAGES = [ - "could not be cloned", - "circular structure", - "call stack size exceeded" -]; -var getMethodName = (methodName, isSubprocess, parameters = "") => methodName === "cancelSignal" ? "`cancelSignal`'s `controller.abort()`" : `${getNamespaceName(isSubprocess)}${methodName}(${parameters})`; -var getNamespaceName = (isSubprocess) => isSubprocess ? "" : "subprocess."; -var getOtherProcessName = (isSubprocess) => isSubprocess ? "parent process" : "subprocess"; -var disconnect = (anyProcess) => { - if (anyProcess.connected) { - anyProcess.disconnect(); - } -}; - -// node_modules/execa/lib/utils/deferred.js -var createDeferred = () => { - const methods = {}; - const promise = new Promise((resolve, reject) => { - Object.assign(methods, { resolve, reject }); - }); - return Object.assign(promise, methods); -}; - -// node_modules/execa/lib/arguments/fd-options.js -var getToStream = (destination, to = "stdin") => { - const isWritable = true; - const { options, fileDescriptors } = SUBPROCESS_OPTIONS.get(destination); - const fdNumber = getFdNumber(fileDescriptors, to, isWritable); - const destinationStream = destination.stdio[fdNumber]; - if (destinationStream === null) { - throw new TypeError(getInvalidStdioOptionMessage(fdNumber, to, options, isWritable)); - } - return destinationStream; -}; -var getFromStream = (source, from = "stdout") => { - const isWritable = false; - const { options, fileDescriptors } = SUBPROCESS_OPTIONS.get(source); - const fdNumber = getFdNumber(fileDescriptors, from, isWritable); - const sourceStream = fdNumber === "all" ? source.all : source.stdio[fdNumber]; - if (sourceStream === null || sourceStream === void 0) { - throw new TypeError(getInvalidStdioOptionMessage(fdNumber, from, options, isWritable)); - } - return sourceStream; -}; -var SUBPROCESS_OPTIONS = /* @__PURE__ */ new WeakMap(); -var getFdNumber = (fileDescriptors, fdName, isWritable) => { - const fdNumber = parseFdNumber(fdName, isWritable); - validateFdNumber(fdNumber, fdName, isWritable, fileDescriptors); - return fdNumber; -}; -var parseFdNumber = (fdName, isWritable) => { - const fdNumber = parseFd(fdName); - if (fdNumber !== void 0) { - return fdNumber; - } - const { validOptions, defaultValue } = isWritable ? { validOptions: '"stdin"', defaultValue: "stdin" } : { validOptions: '"stdout", "stderr", "all"', defaultValue: "stdout" }; - throw new TypeError(`"${getOptionName(isWritable)}" must not be "${fdName}". -It must be ${validOptions} or "fd3", "fd4" (and so on). -It is optional and defaults to "${defaultValue}".`); -}; -var validateFdNumber = (fdNumber, fdName, isWritable, fileDescriptors) => { - const fileDescriptor = fileDescriptors[getUsedDescriptor(fdNumber)]; - if (fileDescriptor === void 0) { - throw new TypeError(`"${getOptionName(isWritable)}" must not be ${fdName}. That file descriptor does not exist. -Please set the "stdio" option to ensure that file descriptor exists.`); - } - if (fileDescriptor.direction === "input" && !isWritable) { - throw new TypeError(`"${getOptionName(isWritable)}" must not be ${fdName}. It must be a readable stream, not writable.`); - } - if (fileDescriptor.direction !== "input" && isWritable) { - throw new TypeError(`"${getOptionName(isWritable)}" must not be ${fdName}. It must be a writable stream, not readable.`); - } -}; -var getInvalidStdioOptionMessage = (fdNumber, fdName, options, isWritable) => { - if (fdNumber === "all" && !options.all) { - return `The "all" option must be true to use "from: 'all'".`; - } - const { optionName, optionValue } = getInvalidStdioOption(fdNumber, options); - return `The "${optionName}: ${serializeOptionValue(optionValue)}" option is incompatible with using "${getOptionName(isWritable)}: ${serializeOptionValue(fdName)}". -Please set this option with "pipe" instead.`; -}; -var getInvalidStdioOption = (fdNumber, { stdin, stdout, stderr: stderr2, stdio }) => { - const usedDescriptor = getUsedDescriptor(fdNumber); - if (usedDescriptor === 0 && stdin !== void 0) { - return { optionName: "stdin", optionValue: stdin }; - } - if (usedDescriptor === 1 && stdout !== void 0) { - return { optionName: "stdout", optionValue: stdout }; - } - if (usedDescriptor === 2 && stderr2 !== void 0) { - return { optionName: "stderr", optionValue: stderr2 }; - } - return { optionName: `stdio[${usedDescriptor}]`, optionValue: stdio[usedDescriptor] }; -}; -var getUsedDescriptor = (fdNumber) => fdNumber === "all" ? 1 : fdNumber; -var getOptionName = (isWritable) => isWritable ? "to" : "from"; -var serializeOptionValue = (value) => { - if (typeof value === "string") { - return `'${value}'`; - } - return typeof value === "number" ? `${value}` : "Stream"; -}; - -// node_modules/execa/lib/ipc/strict.js -var import_node_events5 = require("node:events"); - -// node_modules/execa/lib/utils/max-listeners.js -var import_node_events2 = require("node:events"); -var incrementMaxListeners = (eventEmitter, maxListenersIncrement, signal) => { - const maxListeners = eventEmitter.getMaxListeners(); - if (maxListeners === 0 || maxListeners === Number.POSITIVE_INFINITY) { - return; - } - eventEmitter.setMaxListeners(maxListeners + maxListenersIncrement); - (0, import_node_events2.addAbortListener)(signal, () => { - eventEmitter.setMaxListeners(eventEmitter.getMaxListeners() - maxListenersIncrement); - }); -}; - -// node_modules/execa/lib/ipc/forward.js -var import_node_events4 = require("node:events"); - -// node_modules/execa/lib/ipc/incoming.js -var import_node_events3 = require("node:events"); -var import_promises2 = require("node:timers/promises"); - -// node_modules/execa/lib/ipc/reference.js -var addReference = (channel, reference) => { - if (reference) { - addReferenceCount(channel); - } -}; -var addReferenceCount = (channel) => { - channel.refCounted(); -}; -var removeReference = (channel, reference) => { - if (reference) { - removeReferenceCount(channel); - } -}; -var removeReferenceCount = (channel) => { - channel.unrefCounted(); -}; -var undoAddedReferences = (channel, isSubprocess) => { - if (isSubprocess) { - removeReferenceCount(channel); - removeReferenceCount(channel); - } -}; -var redoAddedReferences = (channel, isSubprocess) => { - if (isSubprocess) { - addReferenceCount(channel); - addReferenceCount(channel); +var _ = (t2, n2) => { + const r3 = {}; + for (const e3 in t2) { + if (!w(t2, e3)) + continue; + const [o3, , s2, i3] = n2[e3]; + if (o3.length === 0 && "default" in i3) { + let { default: a4 } = i3; + typeof a4 == "function" && (a4 = a4()), r3[e3] = a4; + } else + r3[e3] = s2 ? o3 : o3.pop(); } + return r3; }; - -// node_modules/execa/lib/ipc/incoming.js -var onMessage = async ({ anyProcess, channel, isSubprocess, ipcEmitter }, wrappedMessage) => { - if (handleStrictResponse(wrappedMessage) || handleAbort(wrappedMessage)) { - return; - } - if (!INCOMING_MESSAGES.has(anyProcess)) { - INCOMING_MESSAGES.set(anyProcess, []); - } - const incomingMessages = INCOMING_MESSAGES.get(anyProcess); - incomingMessages.push(wrappedMessage); - if (incomingMessages.length > 1) { +var F = "--"; +var G = /[.:=]/; +var T = /^-{1,2}\w/; +var N = (t2) => { + if (!T.test(t2)) return; + const n2 = !t2.startsWith(F); + let r3 = t2.slice(n2 ? 1 : 2), e3; + const o3 = r3.match(G); + if (o3) { + const { index: s2 } = o3; + e3 = r3.slice(s2 + 1), r3 = r3.slice(0, s2); } - while (incomingMessages.length > 0) { - await waitForOutgoingMessages(anyProcess, ipcEmitter, wrappedMessage); - await import_promises2.scheduler.yield(); - const message = await handleStrictRequest({ - wrappedMessage: incomingMessages[0], - anyProcess, - channel, - isSubprocess, - ipcEmitter - }); - incomingMessages.shift(); - ipcEmitter.emit("message", message); - ipcEmitter.emit("message:done"); - } -}; -var onDisconnect = async ({ anyProcess, channel, isSubprocess, ipcEmitter, boundOnMessage }) => { - abortOnDisconnect(); - const incomingMessages = INCOMING_MESSAGES.get(anyProcess); - while (incomingMessages?.length > 0) { - await (0, import_node_events3.once)(ipcEmitter, "message:done"); - } - anyProcess.removeListener("message", boundOnMessage); - redoAddedReferences(channel, isSubprocess); - ipcEmitter.connected = false; - ipcEmitter.emit("disconnect"); -}; -var INCOMING_MESSAGES = /* @__PURE__ */ new WeakMap(); - -// node_modules/execa/lib/ipc/forward.js -var getIpcEmitter = (anyProcess, channel, isSubprocess) => { - if (IPC_EMITTERS.has(anyProcess)) { - return IPC_EMITTERS.get(anyProcess); - } - const ipcEmitter = new import_node_events4.EventEmitter(); - ipcEmitter.connected = true; - IPC_EMITTERS.set(anyProcess, ipcEmitter); - forwardEvents({ - ipcEmitter, - anyProcess, - channel, - isSubprocess - }); - return ipcEmitter; -}; -var IPC_EMITTERS = /* @__PURE__ */ new WeakMap(); -var forwardEvents = ({ ipcEmitter, anyProcess, channel, isSubprocess }) => { - const boundOnMessage = onMessage.bind(void 0, { - anyProcess, - channel, - isSubprocess, - ipcEmitter - }); - anyProcess.on("message", boundOnMessage); - anyProcess.once("disconnect", onDisconnect.bind(void 0, { - anyProcess, - channel, - isSubprocess, - ipcEmitter, - boundOnMessage - })); - undoAddedReferences(channel, isSubprocess); + return [r3, e3, n2]; }; -var isConnected = (anyProcess) => { - const ipcEmitter = IPC_EMITTERS.get(anyProcess); - return ipcEmitter === void 0 ? anyProcess.channel !== null : ipcEmitter.connected; -}; - -// node_modules/execa/lib/ipc/strict.js -var handleSendStrict = ({ anyProcess, channel, isSubprocess, message, strict }) => { - if (!strict) { - return message; - } - const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess); - const hasListeners = hasMessageListeners(anyProcess, ipcEmitter); - return { - id: count++, - type: REQUEST_TYPE, - message, - hasListeners +var $ = (t2, { onFlag: n2, onArgument: r3 }) => { + let e3; + const o3 = (s2, i3) => { + if (typeof e3 != "function") + return true; + e3(s2, i3), e3 = void 0; }; -}; -var count = 0n; -var validateStrictDeadlock = (outgoingMessages, wrappedMessage) => { - if (wrappedMessage?.type !== REQUEST_TYPE || wrappedMessage.hasListeners) { - return; - } - for (const { id } of outgoingMessages) { - if (id !== void 0) { - STRICT_RESPONSES[id].resolve({ isDeadlock: true, hasListeners: false }); + for (let s2 = 0; s2 < t2.length; s2 += 1) { + const i3 = t2[s2]; + if (i3 === F) { + o3(); + const l3 = t2.slice(s2 + 1); + r3?.(l3, [s2], true); + break; } + const a4 = N(i3); + if (a4) { + if (o3(), !n2) + continue; + const [l3, f4, g4] = a4; + if (g4) + for (let c3 = 0; c3 < l3.length; c3 += 1) { + o3(); + const u3 = c3 === l3.length - 1; + e3 = n2(l3[c3], u3 ? f4 : void 0, [s2, c3 + 1, u3]); + } + else + e3 = n2(l3, f4, [s2]); + } else + o3(i3, [s2]) && r3?.([i3], [s2]); } + o3(); }; -var handleStrictRequest = async ({ wrappedMessage, anyProcess, channel, isSubprocess, ipcEmitter }) => { - if (wrappedMessage?.type !== REQUEST_TYPE || !anyProcess.connected) { - return wrappedMessage; - } - const { id, message } = wrappedMessage; - const response = { id, type: RESPONSE_TYPE, message: hasMessageListeners(anyProcess, ipcEmitter) }; - try { - await sendMessage({ - anyProcess, - channel, - isSubprocess, - ipc: true - }, response); - } catch (error) { - ipcEmitter.emit("strict:error", error); - } - return message; -}; -var handleStrictResponse = (wrappedMessage) => { - if (wrappedMessage?.type !== RESPONSE_TYPE) { - return false; - } - const { id, message: hasListeners } = wrappedMessage; - STRICT_RESPONSES[id]?.resolve({ isDeadlock: false, hasListeners }); - return true; -}; -var waitForStrictResponse = async (wrappedMessage, anyProcess, isSubprocess) => { - if (wrappedMessage?.type !== REQUEST_TYPE) { - return; - } - const deferred = createDeferred(); - STRICT_RESPONSES[wrappedMessage.id] = deferred; - const controller = new AbortController(); - try { - const { isDeadlock, hasListeners } = await Promise.race([ - deferred, - throwOnDisconnect(anyProcess, isSubprocess, controller) - ]); - if (isDeadlock) { - throwOnStrictDeadlockError(isSubprocess); - } - if (!hasListeners) { - throwOnMissingStrict(isSubprocess); +var E = (t2, n2) => { + for (const [r3, e3, o3] of n2.reverse()) { + if (e3) { + const s2 = t2[r3]; + let i3 = s2.slice(0, e3); + if (o3 || (i3 += s2.slice(e3 + 1)), i3 !== "-") { + t2[r3] = i3; + continue; + } } - } finally { - controller.abort(); - delete STRICT_RESPONSES[wrappedMessage.id]; - } -}; -var STRICT_RESPONSES = {}; -var throwOnDisconnect = async (anyProcess, isSubprocess, { signal }) => { - incrementMaxListeners(anyProcess, 1, signal); - await (0, import_node_events5.once)(anyProcess, "disconnect", { signal }); - throwOnStrictDisconnect(isSubprocess); -}; -var REQUEST_TYPE = "execa:ipc:request"; -var RESPONSE_TYPE = "execa:ipc:response"; - -// node_modules/execa/lib/ipc/outgoing.js -var startSendMessage = (anyProcess, wrappedMessage, strict) => { - if (!OUTGOING_MESSAGES.has(anyProcess)) { - OUTGOING_MESSAGES.set(anyProcess, /* @__PURE__ */ new Set()); - } - const outgoingMessages = OUTGOING_MESSAGES.get(anyProcess); - const onMessageSent = createDeferred(); - const id = strict ? wrappedMessage.id : void 0; - const outgoingMessage = { onMessageSent, id }; - outgoingMessages.add(outgoingMessage); - return { outgoingMessages, outgoingMessage }; -}; -var endSendMessage = ({ outgoingMessages, outgoingMessage }) => { - outgoingMessages.delete(outgoingMessage); - outgoingMessage.onMessageSent.resolve(); -}; -var waitForOutgoingMessages = async (anyProcess, ipcEmitter, wrappedMessage) => { - while (!hasMessageListeners(anyProcess, ipcEmitter) && OUTGOING_MESSAGES.get(anyProcess)?.size > 0) { - const outgoingMessages = [...OUTGOING_MESSAGES.get(anyProcess)]; - validateStrictDeadlock(outgoingMessages, wrappedMessage); - await Promise.all(outgoingMessages.map(({ onMessageSent }) => onMessageSent)); - } -}; -var OUTGOING_MESSAGES = /* @__PURE__ */ new WeakMap(); -var hasMessageListeners = (anyProcess, ipcEmitter) => ipcEmitter.listenerCount("message") > getMinListenerCount(anyProcess); -var getMinListenerCount = (anyProcess) => SUBPROCESS_OPTIONS.has(anyProcess) && !getFdSpecificValue(SUBPROCESS_OPTIONS.get(anyProcess).options.buffer, "ipc") ? 1 : 0; - -// node_modules/execa/lib/ipc/send.js -var sendMessage = ({ anyProcess, channel, isSubprocess, ipc }, message, { strict = false } = {}) => { - const methodName = "sendMessage"; - validateIpcMethod({ - methodName, - isSubprocess, - ipc, - isConnected: anyProcess.connected - }); - return sendMessageAsync({ - anyProcess, - channel, - methodName, - isSubprocess, - message, - strict - }); -}; -var sendMessageAsync = async ({ anyProcess, channel, methodName, isSubprocess, message, strict }) => { - const wrappedMessage = handleSendStrict({ - anyProcess, - channel, - isSubprocess, - message, - strict - }); - const outgoingMessagesState = startSendMessage(anyProcess, wrappedMessage, strict); - try { - await sendOneMessage({ - anyProcess, - methodName, - isSubprocess, - wrappedMessage, - message - }); - } catch (error) { - disconnect(anyProcess); - throw error; - } finally { - endSendMessage(outgoingMessagesState); - } -}; -var sendOneMessage = async ({ anyProcess, methodName, isSubprocess, wrappedMessage, message }) => { - const sendMethod = getSendMethod(anyProcess); - try { - await Promise.all([ - waitForStrictResponse(wrappedMessage, anyProcess, isSubprocess), - sendMethod(wrappedMessage) - ]); - } catch (error) { - handleEpipeError({ error, methodName, isSubprocess }); - handleSerializationError({ - error, - methodName, - isSubprocess, - message - }); - throw error; - } -}; -var getSendMethod = (anyProcess) => { - if (PROCESS_SEND_METHODS.has(anyProcess)) { - return PROCESS_SEND_METHODS.get(anyProcess); - } - const sendMethod = (0, import_node_util4.promisify)(anyProcess.send.bind(anyProcess)); - PROCESS_SEND_METHODS.set(anyProcess, sendMethod); - return sendMethod; -}; -var PROCESS_SEND_METHODS = /* @__PURE__ */ new WeakMap(); - -// node_modules/execa/lib/ipc/graceful.js -var sendAbort = (subprocess, message) => { - const methodName = "cancelSignal"; - validateConnection(methodName, false, subprocess.connected); - return sendOneMessage({ - anyProcess: subprocess, - methodName, - isSubprocess: false, - wrappedMessage: { type: GRACEFUL_CANCEL_TYPE, message }, - message - }); -}; -var getCancelSignal = async ({ anyProcess, channel, isSubprocess, ipc }) => { - await startIpc({ - anyProcess, - channel, - isSubprocess, - ipc - }); - return cancelController.signal; -}; -var startIpc = async ({ anyProcess, channel, isSubprocess, ipc }) => { - if (cancelListening) { - return; - } - cancelListening = true; - if (!ipc) { - throwOnMissingParent(); - return; - } - if (channel === null) { - abortOnDisconnect(); - return; - } - getIpcEmitter(anyProcess, channel, isSubprocess); - await import_promises3.scheduler.yield(); -}; -var cancelListening = false; -var handleAbort = (wrappedMessage) => { - if (wrappedMessage?.type !== GRACEFUL_CANCEL_TYPE) { - return false; + t2.splice(r3, 1); } - cancelController.abort(wrappedMessage.message); - return true; }; -var GRACEFUL_CANCEL_TYPE = "execa:ipc:cancel"; -var abortOnDisconnect = () => { - cancelController.abort(getAbortDisconnectError()); +var U = (t2, n2 = process.argv.slice(2), { ignore: r3 } = {}) => { + const e3 = [], o3 = K(t2), s2 = {}, i3 = []; + return i3[F] = [], $(n2, { onFlag(a4, l3, f4) { + const g4 = w(o3, a4); + if (!r3?.(g4 ? V : k, a4, l3)) { + if (g4) { + const [c3, u3] = o3[a4], y6 = d(u3, l3), p4 = (P4, A5) => { + e3.push(f4), A5 && e3.push(A5), c3.push(m(u3, P4 || "")); + }; + return y6 === void 0 ? p4 : p4(y6); + } + w(s2, a4) || (s2[a4] = []), s2[a4].push(l3 === void 0 ? true : l3), e3.push(f4); + } + }, onArgument(a4, l3, f4) { + r3?.(C, n2[l3[0]]) || (i3.push(...a4), f4 ? (i3[F] = a4, n2.splice(l3[0])) : e3.push(l3)); + } }), E(n2, e3), { flags: _(t2, o3), unknownFlags: s2, _: i3 }; }; -var cancelController = new AbortController(); -// node_modules/execa/lib/terminate/graceful.js -var validateGracefulCancel = ({ gracefulCancel, cancelSignal, ipc, serialization }) => { - if (!gracefulCancel) { - return; - } - if (cancelSignal === void 0) { - throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option."); - } - if (!ipc) { - throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option."); - } - if (serialization === "json") { - throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option."); - } -}; -var throwOnGracefulCancel = ({ - subprocess, - cancelSignal, - gracefulCancel, - forceKillAfterDelay, - context, - controller -}) => gracefulCancel ? [sendOnAbort({ - subprocess, - cancelSignal, - forceKillAfterDelay, - context, - controller -})] : []; -var sendOnAbort = async ({ subprocess, cancelSignal, forceKillAfterDelay, context, controller: { signal } }) => { - await onAbortedSignal(cancelSignal, signal); - const reason = getReason(cancelSignal); - await sendAbort(subprocess, reason); - killOnTimeout({ - kill: subprocess.kill, - forceKillAfterDelay, - context, - controllerSignal: signal - }); - context.terminationReason ??= "gracefulCancel"; - throw cancelSignal.reason; -}; -var getReason = ({ reason }) => { - if (!(reason instanceof DOMException)) { - return reason; - } - const error = new Error(reason.message); - Object.defineProperty(error, "stack", { - value: reason.stack, - enumerable: false, - configurable: true, - writable: true - }); - return error; -}; +// node_modules/cleye/dist/index.mjs +var import_tty = __toESM(require("tty"), 1); -// node_modules/execa/lib/terminate/timeout.js -var import_promises4 = require("node:timers/promises"); -var validateTimeout = ({ timeout }) => { - if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) { - throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); - } +// node_modules/terminal-columns/dist/index.mjs +var DD = Object.create; +var m2 = Object.defineProperty; +var uD = Object.defineProperties; +var FD = Object.getOwnPropertyDescriptor; +var CD = Object.getOwnPropertyDescriptors; +var tD = Object.getOwnPropertyNames; +var I = Object.getOwnPropertySymbols; +var ED = Object.getPrototypeOf; +var L2 = Object.prototype.hasOwnProperty; +var eD = Object.prototype.propertyIsEnumerable; +var W = (D5, F5, u3) => F5 in D5 ? m2(D5, F5, { enumerable: true, configurable: true, writable: true, value: u3 }) : D5[F5] = u3; +var p = (D5, F5) => { + for (var u3 in F5 || (F5 = {})) + L2.call(F5, u3) && W(D5, u3, F5[u3]); + if (I) + for (var u3 of I(F5)) + eD.call(F5, u3) && W(D5, u3, F5[u3]); + return D5; }; -var throwOnTimeout = (subprocess, timeout, context, controller) => timeout === 0 || timeout === void 0 ? [] : [killAfterTimeout(subprocess, timeout, context, controller)]; -var killAfterTimeout = async (subprocess, timeout, context, { signal }) => { - await (0, import_promises4.setTimeout)(timeout, void 0, { signal }); - context.terminationReason ??= "timeout"; - subprocess.kill(); - throw new DiscardedError(); +var c = (D5, F5) => uD(D5, CD(F5)); +var nD = (D5) => m2(D5, "__esModule", { value: true }); +var rD = (D5, F5) => () => (D5 && (F5 = D5(D5 = 0)), F5); +var iD = (D5, F5) => () => (F5 || D5((F5 = { exports: {} }).exports, F5), F5.exports); +var oD = (D5, F5, u3, C5) => { + if (F5 && typeof F5 == "object" || typeof F5 == "function") + for (let t2 of tD(F5)) + !L2.call(D5, t2) && (u3 || t2 !== "default") && m2(D5, t2, { get: () => F5[t2], enumerable: !(C5 = FD(F5, t2)) || C5.enumerable }); + return D5; }; - -// node_modules/execa/lib/methods/node.js -var import_node_process9 = require("node:process"); -var import_node_path2 = __toESM(require("node:path"), 1); -var mapNode = ({ options }) => { - if (options.node === false) { - throw new TypeError('The "node" option cannot be false with `execaNode()`.'); - } - return { options: { ...options, node: true } }; -}; -var handleNodeOption = (file, commandArguments, { - node: shouldHandleNode = false, - nodePath = import_node_process9.execPath, - nodeOptions = import_node_process9.execArgv.filter((nodeOption) => !nodeOption.startsWith("--inspect")), - cwd, - execPath: formerNodePath, - ...options -}) => { - if (formerNodePath !== void 0) { - throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.'); - } - const normalizedNodePath = safeNormalizeFileUrl(nodePath, 'The "nodePath" option'); - const resolvedNodePath = import_node_path2.default.resolve(cwd, normalizedNodePath); - const newOptions = { - ...options, - nodePath: resolvedNodePath, - node: shouldHandleNode, - cwd +var BD = (D5, F5) => oD(nD(m2(D5 != null ? DD(ED(D5)) : {}, "default", !F5 && D5 && D5.__esModule ? { get: () => D5.default, enumerable: true } : { value: D5, enumerable: true })), D5); +var i = rD(() => { +}); +var $2 = iD((LD, N6) => { + "use strict"; + i(); + N6.exports = function() { + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\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])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\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\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\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-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*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\u26A7\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-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\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[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; }; - if (!shouldHandleNode) { - return [file, commandArguments, newOptions]; - } - if (import_node_path2.default.basename(file, ".exe") === "node") { - throw new TypeError('When the "node" option is true, the first argument does not need to be "node".'); - } - return [ - resolvedNodePath, - [...nodeOptions, file, ...commandArguments], - { ipc: true, ...newOptions, shell: false } - ]; -}; - -// node_modules/execa/lib/ipc/ipc-input.js -var import_node_v8 = require("node:v8"); -var validateIpcInputOption = ({ ipcInput, ipc, serialization }) => { - if (ipcInput === void 0) { - return; - } - if (!ipc) { - throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`."); - } - validateIpcInput[serialization](ipcInput); -}; -var validateAdvancedInput = (ipcInput) => { - try { - (0, import_node_v8.serialize)(ipcInput); - } catch (error) { - throw new Error("The `ipcInput` option is not serializable with a structured clone.", { cause: error }); - } -}; -var validateJsonInput = (ipcInput) => { - try { - JSON.stringify(ipcInput); - } catch (error) { - throw new Error("The `ipcInput` option is not serializable with JSON.", { cause: error }); - } -}; -var validateIpcInput = { - advanced: validateAdvancedInput, - json: validateJsonInput -}; -var sendIpcInput = async (subprocess, ipcInput) => { - if (ipcInput === void 0) { - return; - } - await subprocess.sendMessage(ipcInput); -}; - -// node_modules/execa/lib/arguments/encoding-option.js -var validateEncoding = ({ encoding }) => { - if (ENCODINGS.has(encoding)) { - return; - } - const correctEncoding = getCorrectEncoding(encoding); - if (correctEncoding !== void 0) { - throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(encoding)}\`. -Please rename it to ${serializeEncoding(correctEncoding)}.`); - } - const correctEncodings = [...ENCODINGS].map((correctEncoding2) => serializeEncoding(correctEncoding2)).join(", "); - throw new TypeError(`Invalid option \`encoding: ${serializeEncoding(encoding)}\`. -Please rename it to one of: ${correctEncodings}.`); +}); +i(); +i(); +i(); +var v2 = (D5) => { + var u3, C5, t2; + let F5 = (u3 = process.stdout.columns) != null ? u3 : Number.POSITIVE_INFINITY; + return typeof D5 == "function" && (D5 = D5(F5)), D5 || (D5 = {}), Array.isArray(D5) ? { columns: D5, stdoutColumns: F5 } : { columns: (C5 = D5.columns) != null ? C5 : [], stdoutColumns: (t2 = D5.stdoutColumns) != null ? t2 : F5 }; }; -var TEXT_ENCODINGS = /* @__PURE__ */ new Set(["utf8", "utf16le"]); -var BINARY_ENCODINGS = /* @__PURE__ */ new Set(["buffer", "hex", "base64", "base64url", "latin1", "ascii"]); -var ENCODINGS = /* @__PURE__ */ new Set([...TEXT_ENCODINGS, ...BINARY_ENCODINGS]); -var getCorrectEncoding = (encoding) => { - if (encoding === null) { - return "buffer"; - } - if (typeof encoding !== "string") { - return; - } - const lowerEncoding = encoding.toLowerCase(); - if (lowerEncoding in ENCODING_ALIASES) { - return ENCODING_ALIASES[lowerEncoding]; +i(); +i(); +i(); +i(); +i(); +function w2({ onlyFirst: D5 = false } = {}) { + let F5 = ["[\\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(F5, D5 ? void 0 : "g"); +} +function d2(D5) { + if (typeof D5 != "string") + throw new TypeError(`Expected a \`string\`, got \`${typeof D5}\``); + return D5.replace(w2(), ""); +} +i(); +function y(D5) { + return Number.isInteger(D5) ? D5 >= 4352 && (D5 <= 4447 || D5 === 9001 || D5 === 9002 || 11904 <= D5 && D5 <= 12871 && D5 !== 12351 || 12880 <= D5 && D5 <= 19903 || 19968 <= D5 && D5 <= 42182 || 43360 <= D5 && D5 <= 43388 || 44032 <= D5 && D5 <= 55203 || 63744 <= D5 && D5 <= 64255 || 65040 <= D5 && D5 <= 65049 || 65072 <= D5 && D5 <= 65131 || 65281 <= D5 && D5 <= 65376 || 65504 <= D5 && D5 <= 65510 || 110592 <= D5 && D5 <= 110593 || 127488 <= D5 && D5 <= 127569 || 131072 <= D5 && D5 <= 262141) : false; +} +var j = BD($2(), 1); +function g(D5) { + if (typeof D5 != "string" || D5.length === 0 || (D5 = d2(D5), D5.length === 0)) + return 0; + D5 = D5.replace((0, j.default)(), " "); + let F5 = 0; + for (let u3 = 0; u3 < D5.length; u3++) { + let C5 = D5.codePointAt(u3); + C5 <= 31 || C5 >= 127 && C5 <= 159 || C5 >= 768 && C5 <= 879 || (C5 > 65535 && u3++, F5 += y(C5) ? 2 : 1); } - if (ENCODINGS.has(lowerEncoding)) { - return lowerEncoding; + return F5; +} +var b2 = (D5) => Math.max(...D5.split(` +`).map(g)); +var k2 = (D5) => { + let F5 = []; + for (let u3 of D5) { + let { length: C5 } = u3, t2 = C5 - F5.length; + for (let E4 = 0; E4 < t2; E4 += 1) + F5.push(0); + for (let E4 = 0; E4 < C5; E4 += 1) { + let e3 = b2(u3[E4]); + e3 > F5[E4] && (F5[E4] = e3); + } } + return F5; }; -var ENCODING_ALIASES = { - "utf-8": "utf8", - "utf-16le": "utf16le", - "ucs-2": "utf16le", - ucs2: "utf16le", - binary: "latin1" -}; -var serializeEncoding = (encoding) => typeof encoding === "string" ? `"${encoding}"` : String(encoding); - -// node_modules/execa/lib/arguments/cwd.js -var import_node_fs2 = require("node:fs"); -var import_node_path3 = __toESM(require("node:path"), 1); -var import_node_process10 = __toESM(require("node:process"), 1); -var normalizeCwd = (cwd = getDefaultCwd()) => { - const cwdString = safeNormalizeFileUrl(cwd, 'The "cwd" option'); - return import_node_path3.default.resolve(cwdString); -}; -var getDefaultCwd = () => { - try { - return import_node_process10.default.cwd(); - } catch (error) { - error.message = `The current directory does not exist. -${error.message}`; - throw error; +i(); +var _2 = /^\d+%$/; +var z = { width: "auto", align: "left", contentWidth: 0, paddingLeft: 0, paddingRight: 0, paddingTop: 0, paddingBottom: 0, horizontalPadding: 0, paddingLeftString: "", paddingRightString: "" }; +var sD = (D5, F5) => { + var C5; + let u3 = []; + for (let t2 = 0; t2 < D5.length; t2 += 1) { + let E4 = (C5 = F5[t2]) != null ? C5 : "auto"; + if (typeof E4 == "number" || E4 === "auto" || E4 === "content-width" || typeof E4 == "string" && _2.test(E4)) { + u3.push(c(p({}, z), { width: E4, contentWidth: D5[t2] })); + continue; + } + if (E4 && typeof E4 == "object") { + let e3 = c(p(p({}, z), E4), { contentWidth: D5[t2] }); + e3.horizontalPadding = e3.paddingLeft + e3.paddingRight, u3.push(e3); + continue; + } + throw new Error(`Invalid column width: ${JSON.stringify(E4)}`); } + return u3; }; -var fixCwdError = (originalMessage, cwd) => { - if (cwd === getDefaultCwd()) { - return originalMessage; - } - let cwdStat; - try { - cwdStat = (0, import_node_fs2.statSync)(cwd); - } catch (error) { - return `The "cwd" option is invalid: ${cwd}. -${error.message} -${originalMessage}`; - } - if (!cwdStat.isDirectory()) { - return `The "cwd" option is not a directory: ${cwd}. -${originalMessage}`; - } - return originalMessage; -}; - -// node_modules/execa/lib/arguments/options.js -var normalizeOptions = (filePath, rawArguments, rawOptions) => { - rawOptions.cwd = normalizeCwd(rawOptions.cwd); - const [processedFile, processedArguments, processedOptions] = handleNodeOption(filePath, rawArguments, rawOptions); - const { command: file, args: commandArguments, options: initialOptions } = import_cross_spawn.default._parse(processedFile, processedArguments, processedOptions); - const fdOptions = normalizeFdSpecificOptions(initialOptions); - const options = addDefaultOptions(fdOptions); - validateTimeout(options); - validateEncoding(options); - validateIpcInputOption(options); - validateCancelSignal(options); - validateGracefulCancel(options); - options.shell = normalizeFileUrl(options.shell); - options.env = getEnv(options); - options.killSignal = normalizeKillSignal(options.killSignal); - options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay); - options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]); - if (import_node_process11.default.platform === "win32" && import_node_path4.default.basename(file, ".exe") === "cmd") { - commandArguments.unshift("/q"); - } - return { file, commandArguments, options }; -}; -var addDefaultOptions = ({ - extendEnv = true, - preferLocal = false, - cwd, - localDir: localDirectory = cwd, - encoding = "utf8", - reject = true, - cleanup = true, - all: all3 = false, - windowsHide = true, - killSignal = "SIGTERM", - forceKillAfterDelay = true, - gracefulCancel = false, - ipcInput, - ipc = ipcInput !== void 0 || gracefulCancel, - serialization = "advanced", - ...options -}) => ({ - ...options, - extendEnv, - preferLocal, - cwd, - localDirectory, - encoding, - reject, - cleanup, - all: all3, - windowsHide, - killSignal, - forceKillAfterDelay, - gracefulCancel, - ipcInput, - ipc, - serialization -}); -var getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => { - const env2 = extendEnv ? { ...import_node_process11.default.env, ...envOption } : envOption; - if (preferLocal || node) { - return npmRunPathEnv({ - env: env2, - cwd: localDirectory, - execPath: nodePath, - preferLocal, - addExecPath: node - }); +function aD(D5, F5) { + for (let u3 of D5) { + let { width: C5 } = u3; + if (C5 === "content-width" && (u3.width = u3.contentWidth), C5 === "auto") { + let n2 = Math.min(20, u3.contentWidth); + u3.width = n2, u3.autoOverflow = u3.contentWidth - n2; + } + if (typeof C5 == "string" && _2.test(C5)) { + let n2 = Number.parseFloat(C5.slice(0, -1)) / 100; + u3.width = Math.floor(F5 * n2) - (u3.paddingLeft + u3.paddingRight); + } + let { horizontalPadding: t2 } = u3, E4 = 1, e3 = E4 + t2; + if (e3 >= F5) { + let n2 = e3 - F5, o3 = Math.ceil(u3.paddingLeft / t2 * n2), B3 = n2 - o3; + u3.paddingLeft -= o3, u3.paddingRight -= B3, u3.horizontalPadding = u3.paddingLeft + u3.paddingRight; + } + u3.paddingLeftString = u3.paddingLeft ? " ".repeat(u3.paddingLeft) : "", u3.paddingRightString = u3.paddingRight ? " ".repeat(u3.paddingRight) : ""; + let r3 = F5 - u3.horizontalPadding; + u3.width = Math.max(Math.min(u3.width, r3), E4); } - return env2; -}; - -// node_modules/execa/lib/return/message.js -var import_node_util5 = require("node:util"); - -// node_modules/execa/node_modules/strip-final-newline/index.js -function stripFinalNewline(input) { - if (typeof input === "string") { - return stripFinalNewlineString(input); +} +var G2 = () => Object.assign([], { columns: 0 }); +function lD(D5, F5) { + let u3 = [G2()], [C5] = u3; + for (let t2 of D5) { + let E4 = t2.width + t2.horizontalPadding; + C5.columns + E4 > F5 && (C5 = G2(), u3.push(C5)), C5.push(t2), C5.columns += E4; } - if (!(ArrayBuffer.isView(input) && input.BYTES_PER_ELEMENT === 1)) { - throw new Error("Input must be a string or a Uint8Array"); + for (let t2 of u3) { + let E4 = t2.reduce((s2, l3) => s2 + l3.width + l3.horizontalPadding, 0), e3 = F5 - E4; + if (e3 === 0) + continue; + let r3 = t2.filter((s2) => "autoOverflow" in s2), n2 = r3.filter((s2) => s2.autoOverflow > 0), o3 = n2.reduce((s2, l3) => s2 + l3.autoOverflow, 0), B3 = Math.min(o3, e3); + for (let s2 of n2) { + let l3 = Math.floor(s2.autoOverflow / o3 * B3); + s2.width += l3, e3 -= l3; + } + let a4 = Math.floor(e3 / r3.length); + for (let s2 = 0; s2 < r3.length; s2 += 1) { + let l3 = r3[s2]; + s2 === r3.length - 1 ? l3.width += e3 : l3.width += a4, e3 -= a4; + } } - return stripFinalNewlineBinary(input); -} -var stripFinalNewlineString = (input) => input.at(-1) === LF ? input.slice(0, input.at(-2) === CR ? -2 : -1) : input; -var stripFinalNewlineBinary = (input) => input.at(-1) === LF_BINARY ? input.subarray(0, input.at(-2) === CR_BINARY ? -2 : -1) : input; -var LF = "\n"; -var LF_BINARY = LF.codePointAt(0); -var CR = "\r"; -var CR_BINARY = CR.codePointAt(0); - -// node_modules/execa/node_modules/get-stream/source/index.js -var import_node_events6 = require("node:events"); -var import_promises5 = require("node:stream/promises"); - -// node_modules/is-stream/index.js -function isStream(stream4, { checkOpen = true } = {}) { - return stream4 !== null && typeof stream4 === "object" && (stream4.writable || stream4.readable || !checkOpen || stream4.writable === void 0 && stream4.readable === void 0) && typeof stream4.pipe === "function"; -} -function isWritableStream(stream4, { checkOpen = true } = {}) { - return isStream(stream4, { checkOpen }) && (stream4.writable || !checkOpen) && typeof stream4.write === "function" && typeof stream4.end === "function" && typeof stream4.writable === "boolean" && typeof stream4.writableObjectMode === "boolean" && typeof stream4.destroy === "function" && typeof stream4.destroyed === "boolean"; + return u3; } -function isReadableStream(stream4, { checkOpen = true } = {}) { - return isStream(stream4, { checkOpen }) && (stream4.readable || !checkOpen) && typeof stream4.read === "function" && typeof stream4.readable === "boolean" && typeof stream4.readableObjectMode === "boolean" && typeof stream4.destroy === "function" && typeof stream4.destroyed === "boolean"; -} -function isDuplexStream(stream4, options) { - return isWritableStream(stream4, options) && isReadableStream(stream4, options); +function Z(D5, F5, u3) { + let C5 = sD(u3, F5); + return aD(C5, D5), lD(C5, D5); } - -// node_modules/@sec-ant/readable-stream/dist/ponyfill/asyncIterator.js -var a3 = Object.getPrototypeOf( - Object.getPrototypeOf( - async function* () { - } - ).prototype -); -var c2 = class { - #t; - #n; - #r = false; - #e = void 0; - constructor(e3, t2) { - this.#t = e3, this.#n = t2; - } - next() { - const e3 = () => this.#s(); - return this.#e = this.#e ? this.#e.then(e3, e3) : e3(), this.#e; - } - return(e3) { - const t2 = () => this.#i(e3); - return this.#e ? this.#e.then(t2, t2) : t2(); - } - async #s() { - if (this.#r) - return { - done: true, - value: void 0 - }; - let e3; - try { - e3 = await this.#t.read(); - } catch (t2) { - throw this.#e = void 0, this.#r = true, this.#t.releaseLock(), t2; - } - return e3.done && (this.#e = void 0, this.#r = true, this.#t.releaseLock()), e3; +i(); +i(); +i(); +var O2 = 10; +var U2 = (D5 = 0) => (F5) => `\x1B[${F5 + D5}m`; +var V2 = (D5 = 0) => (F5) => `\x1B[${38 + D5};5;${F5}m`; +var Y = (D5 = 0) => (F5, u3, C5) => `\x1B[${38 + D5};2;${F5};${u3};${C5}m`; +function AD() { + let D5 = /* @__PURE__ */ new Map(), F5 = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], 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], 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], bgBlackBright: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; + F5.color.gray = F5.color.blackBright, F5.bgColor.bgGray = F5.bgColor.bgBlackBright, F5.color.grey = F5.color.blackBright, F5.bgColor.bgGrey = F5.bgColor.bgBlackBright; + for (let [u3, C5] of Object.entries(F5)) { + for (let [t2, E4] of Object.entries(C5)) + F5[t2] = { open: `\x1B[${E4[0]}m`, close: `\x1B[${E4[1]}m` }, C5[t2] = F5[t2], D5.set(E4[0], E4[1]); + Object.defineProperty(F5, u3, { value: C5, enumerable: false }); } - async #i(e3) { - if (this.#r) - return { - done: true, - value: e3 - }; - if (this.#r = true, !this.#n) { - const t2 = this.#t.cancel(e3); - return this.#t.releaseLock(), await t2, { - done: true, - value: e3 - }; + return Object.defineProperty(F5, "codes", { value: D5, enumerable: false }), F5.color.close = "\x1B[39m", F5.bgColor.close = "\x1B[49m", F5.color.ansi = U2(), F5.color.ansi256 = V2(), F5.color.ansi16m = Y(), F5.bgColor.ansi = U2(O2), F5.bgColor.ansi256 = V2(O2), F5.bgColor.ansi16m = Y(O2), Object.defineProperties(F5, { rgbToAnsi256: { value: (u3, C5, t2) => u3 === C5 && C5 === t2 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(C5 / 255 * 5) + Math.round(t2 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => { + let C5 = /(?[a-f\d]{6}|[a-f\d]{3})/i.exec(u3.toString(16)); + if (!C5) + return [0, 0, 0]; + let { colorString: t2 } = C5.groups; + t2.length === 3 && (t2 = t2.split("").map((e3) => e3 + e3).join("")); + let E4 = Number.parseInt(t2, 16); + return [E4 >> 16 & 255, E4 >> 8 & 255, E4 & 255]; + }, enumerable: false }, hexToAnsi256: { value: (u3) => F5.rgbToAnsi256(...F5.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => { + if (u3 < 8) + return 30 + u3; + if (u3 < 16) + return 90 + (u3 - 8); + let C5, t2, E4; + if (u3 >= 232) + C5 = ((u3 - 232) * 10 + 8) / 255, t2 = C5, E4 = C5; + else { + u3 -= 16; + let n2 = u3 % 36; + C5 = Math.floor(u3 / 36) / 5, t2 = Math.floor(n2 / 6) / 5, E4 = n2 % 6 / 5; + } + let e3 = Math.max(C5, t2, E4) * 2; + if (e3 === 0) + return 30; + let r3 = 30 + (Math.round(E4) << 2 | Math.round(t2) << 1 | Math.round(C5)); + return e3 === 2 && (r3 += 60), r3; + }, enumerable: false }, rgbToAnsi: { value: (u3, C5, t2) => F5.ansi256ToAnsi(F5.rgbToAnsi256(u3, C5, t2)), enumerable: false }, hexToAnsi: { value: (u3) => F5.ansi256ToAnsi(F5.hexToAnsi256(u3)), enumerable: false } }), F5; +} +var fD = AD(); +var K2 = fD; +var x = /* @__PURE__ */ new Set(["\x1B", "\x9B"]); +var gD = 39; +var R2 = "\x07"; +var q = "["; +var pD = "]"; +var H = "m"; +var M = `${pD}8;;`; +var J = (D5) => `${x.values().next().value}${q}${D5}${H}`; +var Q = (D5) => `${x.values().next().value}${M}${D5}${R2}`; +var hD = (D5) => D5.split(" ").map((F5) => g(F5)); +var S = (D5, F5, u3) => { + let C5 = [...F5], t2 = false, E4 = false, e3 = g(d2(D5[D5.length - 1])); + for (let [r3, n2] of C5.entries()) { + let o3 = g(n2); + if (e3 + o3 <= u3 ? D5[D5.length - 1] += n2 : (D5.push(n2), e3 = 0), x.has(n2) && (t2 = true, E4 = C5.slice(r3 + 1).join("").startsWith(M)), t2) { + E4 ? n2 === R2 && (t2 = false, E4 = false) : n2 === H && (t2 = false); + continue; } - return this.#t.releaseLock(), { - done: true, - value: e3 - }; + e3 += o3, e3 === u3 && r3 < C5.length - 1 && (D5.push(""), e3 = 0); } + !e3 && D5[D5.length - 1].length > 0 && D5.length > 1 && (D5[D5.length - 2] += D5.pop()); }; -var n = Symbol(); -function i2() { - return this[n].next(); -} -Object.defineProperty(i2, "name", { value: "next" }); -function o2(r3) { - return this[n].return(r3); -} -Object.defineProperty(o2, "name", { value: "return" }); -var u2 = Object.create(a3, { - next: { - enumerable: true, - configurable: true, - writable: true, - value: i2 - }, - return: { - enumerable: true, - configurable: true, - writable: true, - value: o2 - } -}); -function h3({ preventCancel: r3 = false } = {}) { - const e3 = this.getReader(), t2 = new c2( - e3, - r3 - ), s2 = Object.create(u2); - return s2[n] = t2, s2; -} - -// node_modules/execa/node_modules/get-stream/source/stream.js -var getAsyncIterable = (stream4) => { - if (isReadableStream(stream4, { checkOpen: false }) && nodeImports.on !== void 0) { - return getStreamIterable(stream4); - } - if (typeof stream4?.[Symbol.asyncIterator] === "function") { - return stream4; - } - if (toString.call(stream4) === "[object ReadableStream]") { - return h3.call(stream4); - } - throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable."); +var cD = (D5) => { + let F5 = D5.split(" "), u3 = F5.length; + for (; u3 > 0 && !(g(F5[u3 - 1]) > 0); ) + u3--; + return u3 === F5.length ? D5 : F5.slice(0, u3).join(" ") + F5.slice(u3).join(""); }; -var { toString } = Object.prototype; -var getStreamIterable = async function* (stream4) { - const controller = new AbortController(); - const state2 = {}; - handleStreamEnd(stream4, controller, state2); - try { - for await (const [chunk] of nodeImports.on(stream4, "data", { signal: controller.signal })) { - yield chunk; +var dD = (D5, F5, u3 = {}) => { + if (u3.trim !== false && D5.trim() === "") + return ""; + let C5 = "", t2, E4, e3 = hD(D5), r3 = [""]; + for (let [o3, B3] of D5.split(" ").entries()) { + u3.trim !== false && (r3[r3.length - 1] = r3[r3.length - 1].trimStart()); + let a4 = g(r3[r3.length - 1]); + if (o3 !== 0 && (a4 >= F5 && (u3.wordWrap === false || u3.trim === false) && (r3.push(""), a4 = 0), (a4 > 0 || u3.trim === false) && (r3[r3.length - 1] += " ", a4++)), u3.hard && e3[o3] > F5) { + let s2 = F5 - a4, l3 = 1 + Math.floor((e3[o3] - s2 - 1) / F5); + Math.floor((e3[o3] - 1) / F5) < l3 && r3.push(""), S(r3, B3, F5); + continue; } - } catch (error) { - if (state2.error !== void 0) { - throw state2.error; - } else if (!controller.signal.aborted) { - throw error; + if (a4 + e3[o3] > F5 && a4 > 0 && e3[o3] > 0) { + if (u3.wordWrap === false && a4 < F5) { + S(r3, B3, F5); + continue; + } + r3.push(""); } - } finally { - stream4.destroy(); - } -}; -var handleStreamEnd = async (stream4, controller, state2) => { - try { - await nodeImports.finished(stream4, { - cleanup: true, - readable: true, - writable: false, - error: false - }); - } catch (error) { - state2.error = error; - } finally { - controller.abort(); - } -}; -var nodeImports = {}; - -// node_modules/execa/node_modules/get-stream/source/contents.js -var getStreamContents = async (stream4, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = Number.POSITIVE_INFINITY } = {}) => { - const asyncIterable = getAsyncIterable(stream4); - const state2 = init(); - state2.length = 0; - try { - for await (const chunk of asyncIterable) { - const chunkType = getChunkType(chunk); - const convertedChunk = convertChunk[chunkType](chunk, state2); - appendChunk({ - convertedChunk, - state: state2, - getSize, - truncateChunk, - addChunk, - maxBuffer - }); + if (a4 + e3[o3] > F5 && u3.wordWrap === false) { + S(r3, B3, F5); + continue; } - appendFinalChunk({ - state: state2, - convertChunk, - getSize, - truncateChunk, - addChunk, - getFinalChunk, - maxBuffer - }); - return finalize(state2); - } catch (error) { - const normalizedError = typeof error === "object" && error !== null ? error : new Error(error); - normalizedError.bufferedData = finalize(state2); - throw normalizedError; - } -}; -var appendFinalChunk = ({ state: state2, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer }) => { - const convertedChunk = getFinalChunk(state2); - if (convertedChunk !== void 0) { - appendChunk({ - convertedChunk, - state: state2, - getSize, - truncateChunk, - addChunk, - maxBuffer - }); - } -}; -var appendChunk = ({ convertedChunk, state: state2, getSize, truncateChunk, addChunk, maxBuffer }) => { - const chunkSize = getSize(convertedChunk); - const newLength = state2.length + chunkSize; - if (newLength <= maxBuffer) { - addNewChunk(convertedChunk, state2, addChunk, newLength); - return; + r3[r3.length - 1] += B3; } - const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state2.length); - if (truncatedChunk !== void 0) { - addNewChunk(truncatedChunk, state2, addChunk, maxBuffer); + u3.trim !== false && (r3 = r3.map((o3) => cD(o3))); + let n2 = [...r3.join(` +`)]; + for (let [o3, B3] of n2.entries()) { + if (C5 += B3, x.has(B3)) { + let { groups: s2 } = new RegExp(`(?:\\${q}(?\\d+)m|\\${M}(?.*)${R2})`).exec(n2.slice(o3).join("")) || { groups: {} }; + if (s2.code !== void 0) { + let l3 = Number.parseFloat(s2.code); + t2 = l3 === gD ? void 0 : l3; + } else + s2.uri !== void 0 && (E4 = s2.uri.length === 0 ? void 0 : s2.uri); + } + let a4 = K2.codes.get(Number(t2)); + n2[o3 + 1] === ` +` ? (E4 && (C5 += Q("")), t2 && a4 && (C5 += J(a4))) : B3 === ` +` && (t2 && a4 && (C5 += J(t2)), E4 && (C5 += Q(E4))); } - throw new MaxBufferError(); -}; -var addNewChunk = (convertedChunk, state2, addChunk, newLength) => { - state2.contents = addChunk(convertedChunk, state2, newLength); - state2.length = newLength; + return C5; }; -var getChunkType = (chunk) => { - const typeOfChunk = typeof chunk; - if (typeOfChunk === "string") { - return "string"; - } - if (typeOfChunk !== "object" || chunk === null) { - return "others"; - } - if (globalThis.Buffer?.isBuffer(chunk)) { - return "buffer"; - } - const prototypeName = objectToString2.call(chunk); - if (prototypeName === "[object ArrayBuffer]") { - return "arrayBuffer"; - } - if (prototypeName === "[object DataView]") { - return "dataView"; - } - if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && objectToString2.call(chunk.buffer) === "[object ArrayBuffer]") { - return "typedArray"; +function T2(D5, F5, u3) { + return String(D5).normalize().replace(/\r\n/g, ` +`).split(` +`).map((C5) => dD(C5, F5, u3)).join(` +`); +} +var X = (D5) => Array.from({ length: D5 }).fill(""); +function P(D5, F5) { + let u3 = [], C5 = 0; + for (let t2 of D5) { + let E4 = 0, e3 = t2.map((n2) => { + var a4; + let o3 = (a4 = F5[C5]) != null ? a4 : ""; + C5 += 1, n2.preprocess && (o3 = n2.preprocess(o3)), b2(o3) > n2.width && (o3 = T2(o3, n2.width, { hard: true })); + let B3 = o3.split(` +`); + if (n2.postprocess) { + let { postprocess: s2 } = n2; + B3 = B3.map((l3, h4) => s2.call(n2, l3, h4)); + } + return n2.paddingTop && B3.unshift(...X(n2.paddingTop)), n2.paddingBottom && B3.push(...X(n2.paddingBottom)), B3.length > E4 && (E4 = B3.length), c(p({}, n2), { lines: B3 }); + }), r3 = []; + for (let n2 = 0; n2 < E4; n2 += 1) { + let o3 = e3.map((B3) => { + var h4; + let a4 = (h4 = B3.lines[n2]) != null ? h4 : "", s2 = Number.isFinite(B3.width) ? " ".repeat(B3.width - g(a4)) : "", l3 = B3.paddingLeftString; + return B3.align === "right" && (l3 += s2), l3 += a4, B3.align === "left" && (l3 += s2), l3 + B3.paddingRightString; + }).join(""); + r3.push(o3); + } + u3.push(r3.join(` +`)); } - return "others"; -}; -var { toString: objectToString2 } = Object.prototype; -var MaxBufferError = class extends Error { - name = "MaxBufferError"; - constructor() { - super("maxBuffer exceeded"); - } -}; - -// node_modules/execa/node_modules/get-stream/source/utils.js -var identity2 = (value) => value; -var noop = () => void 0; -var getContentsProperty = ({ contents }) => contents; -var throwObjectStream = (chunk) => { - throw new Error(`Streams in object mode are not supported: ${String(chunk)}`); -}; -var getLengthProperty = (convertedChunk) => convertedChunk.length; - -// node_modules/execa/node_modules/get-stream/source/array.js -async function getStreamAsArray(stream4, options) { - return getStreamContents(stream4, arrayMethods, options); -} -var initArray = () => ({ contents: [] }); -var increment = () => 1; -var addArrayChunk = (convertedChunk, { contents }) => { - contents.push(convertedChunk); - return contents; -}; -var arrayMethods = { - init: initArray, - convertChunk: { - string: identity2, - buffer: identity2, - arrayBuffer: identity2, - dataView: identity2, - typedArray: identity2, - others: identity2 - }, - getSize: increment, - truncateChunk: noop, - addChunk: addArrayChunk, - getFinalChunk: noop, - finalize: getContentsProperty -}; - -// node_modules/execa/node_modules/get-stream/source/array-buffer.js -async function getStreamAsArrayBuffer(stream4, options) { - return getStreamContents(stream4, arrayBufferMethods, options); -} -var initArrayBuffer = () => ({ contents: new ArrayBuffer(0) }); -var useTextEncoder = (chunk) => textEncoder2.encode(chunk); -var textEncoder2 = new TextEncoder(); -var useUint8Array = (chunk) => new Uint8Array(chunk); -var useUint8ArrayWithOffset = (chunk) => new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength); -var truncateArrayBufferChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); -var addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length) => { - const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length); - new Uint8Array(newContents).set(convertedChunk, previousLength); - return newContents; -}; -var resizeArrayBufferSlow = (contents, length) => { - if (length <= contents.byteLength) { - return contents; - } - const arrayBuffer = new ArrayBuffer(getNewContentsLength(length)); - new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); - return arrayBuffer; -}; -var resizeArrayBuffer = (contents, length) => { - if (length <= contents.maxByteLength) { - contents.resize(length); - return contents; - } - const arrayBuffer = new ArrayBuffer(length, { maxByteLength: getNewContentsLength(length) }); - new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0); - return arrayBuffer; -}; -var getNewContentsLength = (length) => SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR)); -var SCALE_FACTOR = 2; -var finalizeArrayBuffer = ({ contents, length }) => hasArrayBufferResize() ? contents : contents.slice(0, length); -var hasArrayBufferResize = () => "resize" in ArrayBuffer.prototype; -var arrayBufferMethods = { - init: initArrayBuffer, - convertChunk: { - string: useTextEncoder, - buffer: useUint8Array, - arrayBuffer: useUint8Array, - dataView: useUint8ArrayWithOffset, - typedArray: useUint8ArrayWithOffset, - others: throwObjectStream - }, - getSize: getLengthProperty, - truncateChunk: truncateArrayBufferChunk, - addChunk: addArrayBufferChunk, - getFinalChunk: noop, - finalize: finalizeArrayBuffer -}; - -// node_modules/execa/node_modules/get-stream/source/string.js -async function getStreamAsString(stream4, options) { - return getStreamContents(stream4, stringMethods, options); -} -var initString = () => ({ contents: "", textDecoder: new TextDecoder() }); -var useTextDecoder = (chunk, { textDecoder: textDecoder2 }) => textDecoder2.decode(chunk, { stream: true }); -var addStringChunk = (convertedChunk, { contents }) => contents + convertedChunk; -var truncateStringChunk = (convertedChunk, chunkSize) => convertedChunk.slice(0, chunkSize); -var getFinalStringChunk = ({ textDecoder: textDecoder2 }) => { - const finalChunk = textDecoder2.decode(); - return finalChunk === "" ? void 0 : finalChunk; -}; -var stringMethods = { - init: initString, - convertChunk: { - string: identity2, - buffer: useTextDecoder, - arrayBuffer: useTextDecoder, - dataView: useTextDecoder, - typedArray: useTextDecoder, - others: throwObjectStream - }, - getSize: getLengthProperty, - truncateChunk: truncateStringChunk, - addChunk: addStringChunk, - getFinalChunk: getFinalStringChunk, - finalize: getContentsProperty -}; - -// node_modules/execa/node_modules/get-stream/source/index.js -Object.assign(nodeImports, { on: import_node_events6.on, finished: import_promises5.finished }); + return u3.join(` +`); +} +function mD(D5, F5) { + if (!D5 || D5.length === 0) + return ""; + let u3 = k2(D5), C5 = u3.length; + if (C5 === 0) + return ""; + let { stdoutColumns: t2, columns: E4 } = v2(F5); + if (E4.length > C5) + throw new Error(`${E4.length} columns defined, but only ${C5} columns found`); + let e3 = Z(t2, E4, u3); + return D5.map((r3) => P(e3, r3)).join(` +`); +} +i(); +var bD = ["<", ">", "=", ">=", "<="]; +function xD(D5) { + if (!bD.includes(D5)) + throw new TypeError(`Invalid breakpoint operator: ${D5}`); +} +function wD(D5) { + let F5 = Object.keys(D5).map((u3) => { + let [C5, t2] = u3.split(" "); + xD(C5); + let E4 = Number.parseInt(t2, 10); + if (Number.isNaN(E4)) + throw new TypeError(`Invalid breakpoint value: ${t2}`); + let e3 = D5[u3]; + return { operator: C5, breakpoint: E4, value: e3 }; + }).sort((u3, C5) => C5.breakpoint - u3.breakpoint); + return (u3) => { + var C5; + return (C5 = F5.find(({ operator: t2, breakpoint: E4 }) => t2 === "=" && u3 === E4 || t2 === ">" && u3 > E4 || t2 === "<" && u3 < E4 || t2 === ">=" && u3 >= E4 || t2 === "<=" && u3 <= E4)) == null ? void 0 : C5.value; + }; +} -// node_modules/execa/lib/io/max-buffer.js -var handleMaxBuffer = ({ error, stream: stream4, readableObjectMode, lines, encoding, fdNumber }) => { - if (!(error instanceof MaxBufferError)) { - throw error; - } - if (fdNumber === "all") { - return error; - } - const unit = getMaxBufferUnit(readableObjectMode, lines, encoding); - error.maxBufferInfo = { fdNumber, unit }; - stream4.destroy(); - throw error; +// node_modules/cleye/dist/index.mjs +var S2 = (t2) => t2.replace(/[\W_]([a-z\d])?/gi, (e3, r3) => r3 ? r3.toUpperCase() : ""); +var q2 = (t2) => t2.replace(/\B([A-Z])/g, "-$1").toLowerCase(); +var I2 = { "> 80": [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }, { width: "auto" }], "> 40": [{ width: "auto", paddingLeft: 2, paddingRight: 8, preprocess: (t2) => t2.trim() }, { width: "100%", paddingLeft: 2, paddingBottom: 1 }], "> 0": { stdoutColumns: 1e3, columns: [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }, { width: "content-width" }] } }; +function D2(t2) { + let e3 = false; + return { type: "table", data: { tableData: Object.keys(t2).sort((a4, i3) => a4.localeCompare(i3)).map((a4) => { + const i3 = t2[a4], s2 = "alias" in i3; + return s2 && (e3 = true), { name: a4, flag: i3, flagFormatted: `--${q2(a4)}`, aliasesEnabled: e3, aliasFormatted: s2 ? `-${i3.alias}` : void 0 }; + }).map((a4) => (a4.aliasesEnabled = e3, [{ type: "flagName", data: a4 }, { type: "flagDescription", data: a4 }])), tableBreakpoints: I2 } }; +} +var A = (t2) => !t2 || (t2.version ?? (t2.help ? t2.help.version : void 0)); +var C2 = (t2) => { + const e3 = "parent" in t2 && t2.parent?.name; + return (e3 ? `${e3} ` : "") + t2.name; }; -var getMaxBufferUnit = (readableObjectMode, lines, encoding) => { - if (readableObjectMode) { - return "objects"; - } - if (lines) { - return "lines"; - } - if (encoding === "buffer") { - return "bytes"; +function R3(t2) { + const e3 = []; + t2.name && e3.push(C2(t2)); + const r3 = A(t2) ?? ("parent" in t2 && A(t2.parent)); + if (r3 && e3.push(`v${r3}`), e3.length !== 0) + return { id: "name", type: "text", data: `${e3.join(" ")} +` }; +} +function L3(t2) { + const { help: e3 } = t2; + if (!(!e3 || !e3.description)) + return { id: "description", type: "text", data: `${e3.description} +` }; +} +function T3(t2) { + const e3 = t2.help || {}; + if ("usage" in e3) + return e3.usage ? { id: "usage", type: "section", data: { title: "Usage:", body: Array.isArray(e3.usage) ? e3.usage.join(` +`) : e3.usage } } : void 0; + if (t2.name) { + const r3 = [], n2 = [C2(t2)]; + if (t2.flags && Object.keys(t2.flags).length > 0 && n2.push("[flags...]"), t2.parameters && t2.parameters.length > 0) { + const { parameters: a4 } = t2, i3 = a4.indexOf("--"), s2 = i3 > -1 && a4.slice(i3 + 1).some((o3) => o3.startsWith("<")); + n2.push(a4.map((o3) => o3 !== "--" ? o3 : s2 ? "--" : "[--]").join(" ")); + } + if (n2.length > 1 && r3.push(n2.join(" ")), "commands" in t2 && t2.commands?.length && r3.push(`${t2.name} `), r3.length > 0) + return { id: "usage", type: "section", data: { title: "Usage:", body: r3.join(` +`) } }; } - return "characters"; -}; -var checkIpcMaxBuffer = (subprocess, ipcOutput, maxBuffer) => { - if (ipcOutput.length !== maxBuffer) { +} +function _3(t2) { + return !("commands" in t2) || !t2.commands?.length ? void 0 : { id: "commands", type: "section", data: { title: "Commands:", body: { type: "table", data: { tableData: t2.commands.map((n2) => [n2.options.name, n2.options.help ? n2.options.help.description : ""]), tableOptions: [{ width: "content-width", paddingLeft: 2, paddingRight: 8 }] } }, indentBody: 0 } }; +} +function k3(t2) { + if (!(!t2.flags || Object.keys(t2.flags).length === 0)) + return { id: "flags", type: "section", data: { title: "Flags:", body: D2(t2.flags), indentBody: 0 } }; +} +function F2(t2) { + const { help: e3 } = t2; + if (!e3 || !e3.examples || e3.examples.length === 0) return; + let { examples: r3 } = e3; + if (Array.isArray(r3) && (r3 = r3.join(` +`)), r3) + return { id: "examples", type: "section", data: { title: "Examples:", body: r3 } }; +} +function H2(t2) { + if (!("alias" in t2) || !t2.alias) + return; + const { alias: e3 } = t2; + return { id: "aliases", type: "section", data: { title: "Aliases:", body: Array.isArray(e3) ? e3.join(", ") : e3 } }; +} +var U3 = (t2) => [R3, L3, T3, _3, k3, F2, H2].map((e3) => e3(t2)).filter(Boolean); +var J2 = import_tty.default.WriteStream.prototype.hasColors(); +var M2 = class { + text(e3) { + return e3; } - const error = new MaxBufferError(); - error.maxBufferInfo = { fdNumber: "ipc" }; - throw error; -}; -var getMaxBufferMessage = (error, maxBuffer) => { - const { streamName, threshold, unit } = getMaxBufferInfo(error, maxBuffer); - return `Command's ${streamName} was larger than ${threshold} ${unit}`; -}; -var getMaxBufferInfo = (error, maxBuffer) => { - if (error?.maxBufferInfo === void 0) { - return { streamName: "output", threshold: maxBuffer[1], unit: "bytes" }; - } - const { maxBufferInfo: { fdNumber, unit } } = error; - delete error.maxBufferInfo; - const threshold = getFdSpecificValue(maxBuffer, fdNumber); - if (fdNumber === "ipc") { - return { streamName: "IPC output", threshold, unit: "messages" }; + bold(e3) { + return J2 ? `\x1B[1m${e3}\x1B[22m` : e3.toLocaleUpperCase(); } - return { streamName: getStreamName(fdNumber), threshold, unit }; -}; -var isMaxBufferSync = (resultError, output, maxBuffer) => resultError?.code === "ENOBUFS" && output !== null && output.some((result) => result !== null && result.length > getMaxBufferSync(maxBuffer)); -var truncateMaxBufferSync = (result, isMaxBuffer, maxBuffer) => { - if (!isMaxBuffer) { - return result; + indentText({ text: e3, spaces: r3 }) { + return e3.replace(/^/gm, " ".repeat(r3)); } - const maxBufferValue = getMaxBufferSync(maxBuffer); - return result.length > maxBufferValue ? result.slice(0, maxBufferValue) : result; -}; -var getMaxBufferSync = ([, stdoutMaxBuffer]) => stdoutMaxBuffer; - -// node_modules/execa/lib/return/message.js -var createMessages = ({ - stdio, - all: all3, - ipcOutput, - originalError, - signal, - signalDescription, - exitCode, - escapedCommand, - timedOut, - isCanceled, - isGracefullyCanceled, - isMaxBuffer, - isForcefullyTerminated, - forceKillAfterDelay, - killSignal, - maxBuffer, - timeout, - cwd -}) => { - const errorCode = originalError?.code; - const prefix = getErrorPrefix({ - originalError, - timedOut, - timeout, - isMaxBuffer, - maxBuffer, - errorCode, - signal, - signalDescription, - exitCode, - isCanceled, - isGracefullyCanceled, - isForcefullyTerminated, - forceKillAfterDelay, - killSignal - }); - const originalMessage = getOriginalMessage(originalError, cwd); - const suffix = originalMessage === void 0 ? "" : ` -${originalMessage}`; - const shortMessage = `${prefix}: ${escapedCommand}${suffix}`; - const messageStdio = all3 === void 0 ? [stdio[2], stdio[1]] : [all3]; - const message = [ - shortMessage, - ...messageStdio, - ...stdio.slice(3), - ipcOutput.map((ipcMessage) => serializeIpcMessage(ipcMessage)).join("\n") - ].map((messagePart) => escapeLines(stripFinalNewline(serializeMessagePart(messagePart)))).filter(Boolean).join("\n\n"); - return { originalMessage, shortMessage, message }; -}; -var getErrorPrefix = ({ - originalError, - timedOut, - timeout, - isMaxBuffer, - maxBuffer, - errorCode, - signal, - signalDescription, - exitCode, - isCanceled, - isGracefullyCanceled, - isForcefullyTerminated, - forceKillAfterDelay, - killSignal -}) => { - const forcefulSuffix = getForcefulSuffix(isForcefullyTerminated, forceKillAfterDelay); - if (timedOut) { - return `Command timed out after ${timeout} milliseconds${forcefulSuffix}`; + heading(e3) { + return this.bold(e3); } - if (isGracefullyCanceled) { - if (signal === void 0) { - return `Command was gracefully canceled with exit code ${exitCode}`; - } - return isForcefullyTerminated ? `Command was gracefully canceled${forcefulSuffix}` : `Command was gracefully canceled with ${signal} (${signalDescription})`; + section({ title: e3, body: r3, indentBody: n2 = 2 }) { + return `${(e3 ? `${this.heading(e3)} +` : "") + (r3 ? this.indentText({ text: this.render(r3), spaces: n2 }) : "")} +`; } - if (isCanceled) { - return `Command was canceled${forcefulSuffix}`; + table({ tableData: e3, tableOptions: r3, tableBreakpoints: n2 }) { + return mD(e3.map((a4) => a4.map((i3) => this.render(i3))), n2 ? wD(n2) : r3); } - if (isMaxBuffer) { - return `${getMaxBufferMessage(originalError, maxBuffer)}${forcefulSuffix}`; + flagParameter(e3) { + return e3 === Boolean ? "" : e3 === String ? "" : e3 === Number ? "" : Array.isArray(e3) ? this.flagParameter(e3[0]) : ""; } - if (errorCode !== void 0) { - return `Command failed with ${errorCode}${forcefulSuffix}`; + flagOperator(e3) { + return " "; } - if (isForcefullyTerminated) { - return `Command was killed with ${killSignal} (${getSignalDescription(killSignal)})${forcefulSuffix}`; + flagName(e3) { + const { flag: r3, flagFormatted: n2, aliasesEnabled: a4, aliasFormatted: i3 } = e3; + let s2 = ""; + if (i3 ? s2 += `${i3}, ` : a4 && (s2 += " "), s2 += n2, "placeholder" in r3 && typeof r3.placeholder == "string") + s2 += `${this.flagOperator(e3)}${r3.placeholder}`; + else { + const o3 = this.flagParameter("type" in r3 ? r3.type : r3); + o3 && (s2 += `${this.flagOperator(e3)}${o3}`); + } + return s2; } - if (signal !== void 0) { - return `Command was killed with ${signal} (${signalDescription})`; + flagDefault(e3) { + return JSON.stringify(e3); } - if (exitCode !== void 0) { - return `Command failed with exit code ${exitCode}`; + flagDescription({ flag: e3 }) { + let r3 = "description" in e3 ? e3.description ?? "" : ""; + if ("default" in e3) { + let { default: n2 } = e3; + typeof n2 == "function" && (n2 = n2()), n2 && (r3 += ` (default: ${this.flagDefault(n2)})`); + } + return r3; } - return "Command failed"; -}; -var getForcefulSuffix = (isForcefullyTerminated, forceKillAfterDelay) => isForcefullyTerminated ? ` and was forcefully terminated after ${forceKillAfterDelay} milliseconds` : ""; -var getOriginalMessage = (originalError, cwd) => { - if (originalError instanceof DiscardedError) { - return; + render(e3) { + if (typeof e3 == "string") + return e3; + if (Array.isArray(e3)) + return e3.map((r3) => this.render(r3)).join(` +`); + if ("type" in e3 && this[e3.type]) { + const r3 = this[e3.type]; + if (typeof r3 == "function") + return r3.call(this, e3.data); + } + throw new Error(`Invalid node type: ${JSON.stringify(e3)}`); } - const originalMessage = isExecaError(originalError) ? originalError.originalMessage : String(originalError?.message ?? originalError); - const escapedOriginalMessage = escapeLines(fixCwdError(originalMessage, cwd)); - return escapedOriginalMessage === "" ? void 0 : escapedOriginalMessage; }; -var serializeIpcMessage = (ipcMessage) => typeof ipcMessage === "string" ? ipcMessage : (0, import_node_util5.inspect)(ipcMessage); -var serializeMessagePart = (messagePart) => Array.isArray(messagePart) ? messagePart.map((messageItem) => stripFinalNewline(serializeMessageItem(messageItem))).filter(Boolean).join("\n") : serializeMessageItem(messagePart); -var serializeMessageItem = (messageItem) => { - if (typeof messageItem === "string") { - return messageItem; +var y2 = /^[\w.-]+$/; +var { stringify: d3 } = JSON; +var V3 = /[|\\{}()[\]^$+*?.]/; +function w3(t2) { + const e3 = []; + let r3, n2; + for (const a4 of t2) { + if (n2) + throw new Error(`Invalid parameter: Spread parameter ${d3(n2)} must be last`); + const i3 = a4[0], s2 = a4[a4.length - 1]; + let o3; + if (i3 === "<" && s2 === ">" && (o3 = true, r3)) + throw new Error(`Invalid parameter: Required parameter ${d3(a4)} cannot come after optional parameter ${d3(r3)}`); + if (i3 === "[" && s2 === "]" && (o3 = false, r3 = a4), o3 === void 0) + throw new Error(`Invalid parameter: ${d3(a4)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`); + let l3 = a4.slice(1, -1); + const f4 = l3.slice(-3) === "..."; + f4 && (n2 = a4, l3 = l3.slice(0, -3)); + const p4 = l3.match(V3); + if (p4) + throw new Error(`Invalid parameter: ${d3(a4)}. Invalid character found ${d3(p4[0])}`); + e3.push({ name: l3, required: o3, spread: f4 }); } - if (isUint8Array(messageItem)) { - return uint8ArrayToString(messageItem); + return e3; +} +function b3(t2, e3, r3, n2) { + for (let a4 = 0; a4 < e3.length; a4 += 1) { + const { name: i3, required: s2, spread: o3 } = e3[a4], l3 = S2(i3); + if (l3 in t2) + throw new Error(`Invalid parameter: ${d3(i3)} is used more than once.`); + const f4 = o3 ? r3.slice(a4) : r3[a4]; + if (o3 && (a4 = e3.length), s2 && (!f4 || o3 && f4.length === 0)) + return console.error(`Error: Missing required parameter ${d3(i3)} +`), n2(), process.exit(1); + t2[l3] = f4; } - return ""; -}; - -// node_modules/execa/lib/return/result.js -var makeSuccessResult = ({ - command, - escapedCommand, - stdio, - all: all3, - ipcOutput, - options: { cwd }, - startTime -}) => omitUndefinedProperties({ - command, - escapedCommand, - cwd, - durationMs: getDurationMs(startTime), - failed: false, - timedOut: false, - isCanceled: false, - isGracefullyCanceled: false, - isTerminated: false, - isMaxBuffer: false, - isForcefullyTerminated: false, - exitCode: 0, - stdout: stdio[1], - stderr: stdio[2], - all: all3, - stdio, - ipcOutput, - pipedFrom: [] -}); -var makeEarlyError = ({ - error, - command, - escapedCommand, - fileDescriptors, - options, - startTime, - isSync -}) => makeError({ - error, - command, - escapedCommand, - startTime, - timedOut: false, - isCanceled: false, - isGracefullyCanceled: false, - isMaxBuffer: false, - isForcefullyTerminated: false, - stdio: Array.from({ length: fileDescriptors.length }), - ipcOutput: [], - options, - isSync -}); -var makeError = ({ - error: originalError, - command, - escapedCommand, - startTime, - timedOut, - isCanceled, - isGracefullyCanceled, - isMaxBuffer, - isForcefullyTerminated, - exitCode: rawExitCode, - signal: rawSignal, - stdio, - all: all3, - ipcOutput, - options: { - timeoutDuration, - timeout = timeoutDuration, - forceKillAfterDelay, - killSignal, - cwd, - maxBuffer - }, - isSync -}) => { - const { exitCode, signal, signalDescription } = normalizeExitPayload(rawExitCode, rawSignal); - const { originalMessage, shortMessage, message } = createMessages({ - stdio, - all: all3, - ipcOutput, - originalError, - signal, - signalDescription, - exitCode, - escapedCommand, - timedOut, - isCanceled, - isGracefullyCanceled, - isMaxBuffer, - isForcefullyTerminated, - forceKillAfterDelay, - killSignal, - maxBuffer, - timeout, - cwd - }); - const error = getFinalError(originalError, message, isSync); - Object.assign(error, getErrorProperties({ - error, - command, - escapedCommand, - startTime, - timedOut, - isCanceled, - isGracefullyCanceled, - isMaxBuffer, - isForcefullyTerminated, - exitCode, - signal, - signalDescription, - stdio, - all: all3, - ipcOutput, - cwd, - originalMessage, - shortMessage - })); - return error; -}; -var getErrorProperties = ({ - error, - command, - escapedCommand, - startTime, - timedOut, - isCanceled, - isGracefullyCanceled, - isMaxBuffer, - isForcefullyTerminated, - exitCode, - signal, - signalDescription, - stdio, - all: all3, - ipcOutput, - cwd, - originalMessage, - shortMessage -}) => omitUndefinedProperties({ - shortMessage, - originalMessage, - command, - escapedCommand, - cwd, - durationMs: getDurationMs(startTime), - failed: true, - timedOut, - isCanceled, - isGracefullyCanceled, - isTerminated: signal !== void 0, - isMaxBuffer, - isForcefullyTerminated, - exitCode, - signal, - signalDescription, - code: error.cause?.code, - stdout: stdio[1], - stderr: stdio[2], - all: all3, - stdio, - ipcOutput, - pipedFrom: [] -}); -var omitUndefinedProperties = (result) => Object.fromEntries(Object.entries(result).filter(([, value]) => value !== void 0)); -var normalizeExitPayload = (rawExitCode, rawSignal) => { - const exitCode = rawExitCode === null ? void 0 : rawExitCode; - const signal = rawSignal === null ? void 0 : rawSignal; - const signalDescription = signal === void 0 ? void 0 : getSignalDescription(rawSignal); - return { exitCode, signal, signalDescription }; -}; - -// node_modules/parse-ms/index.js -var toZeroIfInfinity = (value) => Number.isFinite(value) ? value : 0; -function parseNumber(milliseconds) { - return { - days: Math.trunc(milliseconds / 864e5), - hours: Math.trunc(milliseconds / 36e5 % 24), - minutes: Math.trunc(milliseconds / 6e4 % 60), - seconds: Math.trunc(milliseconds / 1e3 % 60), - milliseconds: Math.trunc(milliseconds % 1e3), - microseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e3) % 1e3), - nanoseconds: Math.trunc(toZeroIfInfinity(milliseconds * 1e6) % 1e3) - }; } -function parseBigint(milliseconds) { - return { - days: milliseconds / 86400000n, - hours: milliseconds / 3600000n % 24n, - minutes: milliseconds / 60000n % 60n, - seconds: milliseconds / 1000n % 60n, - milliseconds: milliseconds % 1000n, - microseconds: 0n, - nanoseconds: 0n - }; +function W2(t2) { + return t2 === void 0 || t2 !== false; } -function parseMilliseconds(milliseconds) { - switch (typeof milliseconds) { - case "number": { - if (Number.isFinite(milliseconds)) { - return parseNumber(milliseconds); - } - break; - } - case "bigint": { - return parseBigint(milliseconds); - } - } - throw new TypeError("Expected a finite number or bigint"); -} - -// node_modules/pretty-ms/index.js -var isZero = (value) => value === 0 || value === 0n; -var pluralize = (word, count2) => count2 === 1 || count2 === 1n ? word : `${word}s`; -var SECOND_ROUNDING_EPSILON = 1e-7; -var ONE_DAY_IN_MILLISECONDS = 24n * 60n * 60n * 1000n; -function prettyMilliseconds(milliseconds, options) { - const isBigInt = typeof milliseconds === "bigint"; - if (!isBigInt && !Number.isFinite(milliseconds)) { - throw new TypeError("Expected a finite number or bigint"); - } - options = { ...options }; - const sign = milliseconds < 0 ? "-" : ""; - milliseconds = milliseconds < 0 ? -milliseconds : milliseconds; - if (options.colonNotation) { - options.compact = false; - options.formatSubMilliseconds = false; - options.separateMilliseconds = false; - options.verbose = false; - } - if (options.compact) { - options.unitCount = 1; - options.secondsDecimalDigits = 0; - options.millisecondsDecimalDigits = 0; - } - let result = []; - const floorDecimals = (value, decimalDigits) => { - const flooredInterimValue = Math.floor(value * 10 ** decimalDigits + SECOND_ROUNDING_EPSILON); - const flooredValue = Math.round(flooredInterimValue) / 10 ** decimalDigits; - return flooredValue.toFixed(decimalDigits); +function x2(t2, e3, r3, n2) { + const a4 = { ...e3.flags }, i3 = e3.version; + i3 && (a4.version = { type: Boolean, description: "Show version" }); + const { help: s2 } = e3, o3 = W2(s2); + o3 && !("help" in a4) && (a4.help = { type: Boolean, alias: "h", description: "Show help" }); + const l3 = U(a4, n2, { ignore: e3.ignoreArgv }), f4 = () => { + console.log(e3.version); }; - const add = (value, long, short, valueString) => { - if ((result.length === 0 || !options.colonNotation) && isZero(value) && !(options.colonNotation && short === "m")) { - return; - } - valueString ??= String(value); - if (options.colonNotation) { - const wholeDigits = valueString.includes(".") ? valueString.split(".")[0].length : valueString.length; - const minLength = result.length > 0 ? 2 : 1; - valueString = "0".repeat(Math.max(0, minLength - wholeDigits)) + valueString; - } else { - valueString += options.verbose ? " " + pluralize(long, value) : short; - } - result.push(valueString); + if (i3 && l3.flags.version === true) + return f4(), process.exit(0); + const p4 = new M2(), O5 = o3 && s2?.render ? s2.render : (c3) => p4.render(c3), u3 = (c3) => { + const m5 = U3({ ...e3, ...c3 ? { help: c3 } : {}, flags: a4 }); + console.log(O5(m5, p4)); }; - const parsed = parseMilliseconds(milliseconds); - const days = BigInt(parsed.days); - add(days / 365n, "year", "y"); - add(days % 365n, "day", "d"); - add(Number(parsed.hours), "hour", "h"); - add(Number(parsed.minutes), "minute", "m"); - if (options.separateMilliseconds || options.formatSubMilliseconds || !options.colonNotation && milliseconds < 1e3) { - const seconds = Number(parsed.seconds); - const milliseconds2 = Number(parsed.milliseconds); - const microseconds = Number(parsed.microseconds); - const nanoseconds = Number(parsed.nanoseconds); - add(seconds, "second", "s"); - if (options.formatSubMilliseconds) { - add(milliseconds2, "millisecond", "ms"); - add(microseconds, "microsecond", "\xB5s"); - add(nanoseconds, "nanosecond", "ns"); - } else { - const millisecondsAndBelow = milliseconds2 + microseconds / 1e3 + nanoseconds / 1e6; - const millisecondsDecimalDigits = typeof options.millisecondsDecimalDigits === "number" ? options.millisecondsDecimalDigits : 0; - const roundedMilliseconds = millisecondsAndBelow >= 1 ? Math.round(millisecondsAndBelow) : Math.ceil(millisecondsAndBelow); - const millisecondsString = millisecondsDecimalDigits ? millisecondsAndBelow.toFixed(millisecondsDecimalDigits) : roundedMilliseconds; - add( - Number.parseFloat(millisecondsString), - "millisecond", - "ms", - millisecondsString - ); - } - } else { - const seconds = (isBigInt ? Number(milliseconds % ONE_DAY_IN_MILLISECONDS) : milliseconds) / 1e3 % 60; - const secondsDecimalDigits = typeof options.secondsDecimalDigits === "number" ? options.secondsDecimalDigits : 1; - const secondsFixed = floorDecimals(seconds, secondsDecimalDigits); - const secondsString = options.keepDecimalsOnWholeSeconds ? secondsFixed : secondsFixed.replace(/\.0+$/, ""); - add(Number.parseFloat(secondsString), "second", "s", secondsString); - } - if (result.length === 0) { - return sign + "0" + (options.verbose ? " milliseconds" : "ms"); - } - const separator = options.colonNotation ? ":" : " "; - if (typeof options.unitCount === "number") { - result = result.slice(0, Math.max(options.unitCount, 1)); - } - return sign + result.join(separator); -} - -// node_modules/execa/lib/verbose/error.js -var logError = (result, verboseInfo) => { - if (result.failed) { - verboseLog({ - type: "error", - verboseMessage: result.shortMessage, - verboseInfo, - result - }); - } -}; - -// node_modules/execa/lib/verbose/complete.js -var logResult = (result, verboseInfo) => { - if (!isVerbose(verboseInfo)) { - return; - } - logError(result, verboseInfo); - logDuration(result, verboseInfo); -}; -var logDuration = (result, verboseInfo) => { - const verboseMessage = `(done in ${prettyMilliseconds(result.durationMs)})`; - verboseLog({ - type: "duration", - verboseMessage, - verboseInfo, - result - }); -}; - -// node_modules/execa/lib/return/reject.js -var handleResult = (result, verboseInfo, { reject }) => { - logResult(result, verboseInfo); - if (result.failed && reject) { - throw result; - } - return result; -}; - -// node_modules/execa/lib/stdio/handle-sync.js -var import_node_fs4 = require("node:fs"); - -// node_modules/execa/lib/stdio/type.js -var getStdioItemType = (value, optionName) => { - if (isAsyncGenerator(value)) { - return "asyncGenerator"; - } - if (isSyncGenerator(value)) { - return "generator"; - } - if (isUrl(value)) { - return "fileUrl"; + if (o3 && l3.flags.help === true) + return u3(), process.exit(0); + if (e3.parameters) { + let { parameters: c3 } = e3, m5 = l3._; + const g4 = c3.indexOf("--"), v5 = c3.slice(g4 + 1), h4 = /* @__PURE__ */ Object.create(null); + if (g4 > -1 && v5.length > 0) { + c3 = c3.slice(0, g4); + const E4 = l3._["--"]; + m5 = m5.slice(0, -E4.length || void 0), b3(h4, w3(c3), m5, u3), b3(h4, w3(v5), E4, u3); + } else + b3(h4, w3(c3), m5, u3); + Object.assign(l3._, h4); } - if (isFilePathObject(value)) { - return "filePath"; + const $6 = { ...l3, showVersion: f4, showHelp: u3 }; + return typeof r3 == "function" && r3($6), { command: t2, ...$6 }; +} +function z2(t2, e3) { + const r3 = /* @__PURE__ */ new Map(); + for (const n2 of e3) { + const a4 = [n2.options.name], { alias: i3 } = n2.options; + i3 && (Array.isArray(i3) ? a4.push(...i3) : a4.push(i3)); + for (const s2 of a4) { + if (r3.has(s2)) + throw new Error(`Duplicate command name found: ${d3(s2)}`); + r3.set(s2, n2); + } } - if (isWebStream(value)) { - return "webStream"; - } - if (isStream(value, { checkOpen: false })) { - return "native"; - } - if (isUint8Array(value)) { - return "uint8Array"; - } - if (isAsyncIterableObject(value)) { - return "asyncIterable"; - } - if (isIterableObject(value)) { - return "iterable"; - } - if (isTransformStream(value)) { - return getTransformStreamType({ transform: value }, optionName); - } - if (isTransformOptions(value)) { - return getTransformObjectType(value, optionName); - } - return "native"; -}; -var getTransformObjectType = (value, optionName) => { - if (isDuplexStream(value.transform, { checkOpen: false })) { - return getDuplexType(value, optionName); - } - if (isTransformStream(value.transform)) { - return getTransformStreamType(value, optionName); - } - return getGeneratorObjectType(value, optionName); -}; -var getDuplexType = (value, optionName) => { - validateNonGeneratorType(value, optionName, "Duplex stream"); - return "duplex"; -}; -var getTransformStreamType = (value, optionName) => { - validateNonGeneratorType(value, optionName, "web TransformStream"); - return "webTransform"; -}; -var validateNonGeneratorType = ({ final, binary, objectMode }, optionName, typeName) => { - checkUndefinedOption(final, `${optionName}.final`, typeName); - checkUndefinedOption(binary, `${optionName}.binary`, typeName); - checkBooleanOption(objectMode, `${optionName}.objectMode`); -}; -var checkUndefinedOption = (value, optionName, typeName) => { - if (value !== void 0) { - throw new TypeError(`The \`${optionName}\` option can only be defined when using a generator, not a ${typeName}.`); - } -}; -var getGeneratorObjectType = ({ transform, final, binary, objectMode }, optionName) => { - if (transform !== void 0 && !isGenerator(transform)) { - throw new TypeError(`The \`${optionName}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`); - } - if (isDuplexStream(final, { checkOpen: false })) { - throw new TypeError(`The \`${optionName}.final\` option must not be a Duplex stream.`); - } - if (isTransformStream(final)) { - throw new TypeError(`The \`${optionName}.final\` option must not be a web TransformStream.`); - } - if (final !== void 0 && !isGenerator(final)) { - throw new TypeError(`The \`${optionName}.final\` option must be a generator.`); - } - checkBooleanOption(binary, `${optionName}.binary`); - checkBooleanOption(objectMode, `${optionName}.objectMode`); - return isAsyncGenerator(transform) || isAsyncGenerator(final) ? "asyncGenerator" : "generator"; -}; -var checkBooleanOption = (value, optionName) => { - if (value !== void 0 && typeof value !== "boolean") { - throw new TypeError(`The \`${optionName}\` option must use a boolean.`); - } -}; -var isGenerator = (value) => isAsyncGenerator(value) || isSyncGenerator(value); -var isAsyncGenerator = (value) => Object.prototype.toString.call(value) === "[object AsyncGeneratorFunction]"; -var isSyncGenerator = (value) => Object.prototype.toString.call(value) === "[object GeneratorFunction]"; -var isTransformOptions = (value) => isPlainObject(value) && (value.transform !== void 0 || value.final !== void 0); -var isUrl = (value) => Object.prototype.toString.call(value) === "[object URL]"; -var isRegularUrl = (value) => isUrl(value) && value.protocol !== "file:"; -var isFilePathObject = (value) => isPlainObject(value) && Object.keys(value).length === 1 && isFilePathString(value.file); -var isFilePathString = (file) => typeof file === "string"; -var isUnknownStdioString = (type2, value) => type2 === "native" && typeof value === "string" && !KNOWN_STDIO_STRINGS.has(value); -var KNOWN_STDIO_STRINGS = /* @__PURE__ */ new Set(["ipc", "ignore", "inherit", "overlapped", "pipe"]); -var isReadableStream2 = (value) => Object.prototype.toString.call(value) === "[object ReadableStream]"; -var isWritableStream2 = (value) => Object.prototype.toString.call(value) === "[object WritableStream]"; -var isWebStream = (value) => isReadableStream2(value) || isWritableStream2(value); -var isTransformStream = (value) => isReadableStream2(value?.readable) && isWritableStream2(value?.writable); -var isAsyncIterableObject = (value) => isObject(value) && typeof value[Symbol.asyncIterator] === "function"; -var isIterableObject = (value) => isObject(value) && typeof value[Symbol.iterator] === "function"; -var isObject = (value) => typeof value === "object" && value !== null; -var TRANSFORM_TYPES = /* @__PURE__ */ new Set(["generator", "asyncGenerator", "duplex", "webTransform"]); -var FILE_TYPES = /* @__PURE__ */ new Set(["fileUrl", "filePath", "fileNumber"]); -var SPECIAL_DUPLICATE_TYPES_SYNC = /* @__PURE__ */ new Set(["fileUrl", "filePath"]); -var SPECIAL_DUPLICATE_TYPES = /* @__PURE__ */ new Set([...SPECIAL_DUPLICATE_TYPES_SYNC, "webStream", "nodeStream"]); -var FORBID_DUPLICATE_TYPES = /* @__PURE__ */ new Set(["webTransform", "duplex"]); -var TYPE_TO_MESSAGE = { - generator: "a generator", - asyncGenerator: "an async generator", - fileUrl: "a file URL", - filePath: "a file path string", - fileNumber: "a file descriptor number", - webStream: "a web stream", - nodeStream: "a Node.js stream", - webTransform: "a web TransformStream", - duplex: "a Duplex stream", - native: "any value", - iterable: "an iterable", - asyncIterable: "an async iterable", - string: "a string", - uint8Array: "a Uint8Array" -}; - -// node_modules/execa/lib/transform/object-mode.js -var getTransformObjectModes = (objectMode, index, newTransforms, direction) => direction === "output" ? getOutputObjectModes(objectMode, index, newTransforms) : getInputObjectModes(objectMode, index, newTransforms); -var getOutputObjectModes = (objectMode, index, newTransforms) => { - const writableObjectMode = index !== 0 && newTransforms[index - 1].value.readableObjectMode; - const readableObjectMode = objectMode ?? writableObjectMode; - return { writableObjectMode, readableObjectMode }; -}; -var getInputObjectModes = (objectMode, index, newTransforms) => { - const writableObjectMode = index === 0 ? objectMode === true : newTransforms[index - 1].value.readableObjectMode; - const readableObjectMode = index !== newTransforms.length - 1 && (objectMode ?? writableObjectMode); - return { writableObjectMode, readableObjectMode }; -}; -var getFdObjectMode = (stdioItems, direction) => { - const lastTransform = stdioItems.findLast(({ type: type2 }) => TRANSFORM_TYPES.has(type2)); - if (lastTransform === void 0) { - return false; + return r3.get(t2); +} +function Z2(t2, e3, r3 = process.argv.slice(2)) { + if (!t2) + throw new Error("Options is required"); + if ("name" in t2 && (!t2.name || !y2.test(t2.name))) + throw new Error(`Invalid script name: ${d3(t2.name)}`); + const n2 = r3[0]; + if (t2.commands && y2.test(n2)) { + const a4 = z2(n2, t2.commands); + if (a4) + return x2(a4.options.name, { ...a4.options, parent: t2 }, a4.callback, r3.slice(1)); } - return direction === "input" ? lastTransform.value.writableObjectMode : lastTransform.value.readableObjectMode; -}; + return x2(void 0, t2, e3, r3); +} +function G3(t2, e3) { + if (!t2) + throw new Error("Command options are required"); + const { name: r3 } = t2; + if (t2.name === void 0) + throw new Error("Command name is required"); + if (!y2.test(r3)) + throw new Error(`Invalid command name ${JSON.stringify(r3)}. Command names must be one word.`); + return { options: t2, callback: e3 }; +} -// node_modules/execa/lib/transform/normalize.js -var normalizeTransforms = (stdioItems, optionName, direction, options) => [ - ...stdioItems.filter(({ type: type2 }) => !TRANSFORM_TYPES.has(type2)), - ...getTransforms(stdioItems, optionName, direction, options) -]; -var getTransforms = (stdioItems, optionName, direction, { encoding }) => { - const transforms = stdioItems.filter(({ type: type2 }) => TRANSFORM_TYPES.has(type2)); - const newTransforms = Array.from({ length: transforms.length }); - for (const [index, stdioItem] of Object.entries(transforms)) { - newTransforms[index] = normalizeTransform({ - stdioItem, - index: Number(index), - newTransforms, - optionName, - direction, - encoding - }); - } - return sortTransforms(newTransforms, direction); -}; -var normalizeTransform = ({ stdioItem, stdioItem: { type: type2 }, index, newTransforms, optionName, direction, encoding }) => { - if (type2 === "duplex") { - return normalizeDuplex({ stdioItem, optionName }); - } - if (type2 === "webTransform") { - return normalizeTransformStream({ - stdioItem, - index, - newTransforms, - direction - }); - } - return normalizeGenerator({ - stdioItem, - index, - newTransforms, - direction, - encoding - }); -}; -var normalizeDuplex = ({ - stdioItem, - stdioItem: { - value: { - transform, - transform: { writableObjectMode, readableObjectMode }, - objectMode = readableObjectMode - } +// package.json +var package_default = { + name: "opencommit", + version: "3.1.2", + description: "Auto-generate impressive commits in 1 second. Killing lame commits with AI \u{1F92F}\u{1F52B}", + keywords: [ + "git", + "chatgpt", + "gpt", + "ai", + "openai", + "opencommit", + "aicommit", + "aicommits", + "gptcommit", + "commit", + "ollama" + ], + main: "cli.js", + bin: { + opencommit: "./out/cli.cjs", + oco: "./out/cli.cjs" }, - optionName -}) => { - if (objectMode && !readableObjectMode) { - throw new TypeError(`The \`${optionName}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`); - } - if (!objectMode && readableObjectMode) { - throw new TypeError(`The \`${optionName}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`); + repository: { + url: "https://github.com/di-sukharev/opencommit" + }, + type: "module", + author: "https://github.com/di-sukharev", + license: "MIT", + files: [ + "out/cli.cjs", + "out/tiktoken_bg.wasm" + ], + release: { + branches: [ + "master" + ] + }, + publishConfig: { + access: "public" + }, + scripts: { + watch: "npm run -S build -- --sourcemap --watch", + start: "node ./out/cli.cjs", + "ollama:start": "OCO_AI_PROVIDER='ollama' node ./out/cli.cjs", + dev: "ts-node ./src/cli.ts", + "dev:gemini": "OCO_AI_PROVIDER='gemini' ts-node ./src/cli.ts", + build: "rimraf out && node esbuild.config.js", + "build:push": "npm run build && git add . && git commit -m 'build' && git push", + deploy: "npm run build:push && git push --tags && npm publish --tag latest", + "deploy:patch": "npm version patch && npm run deploy", + lint: "eslint src --ext ts && tsc --noEmit", + format: "prettier --write src", + test: "node --no-warnings --experimental-vm-modules $( [ -f ./node_modules/.bin/jest ] && echo ./node_modules/.bin/jest || which jest ) test/unit", + "test:all": "npm run test:unit:docker && npm run test:e2e:docker", + "test:docker-build": "docker build -t oco-test -f test/Dockerfile .", + "test:unit": "NODE_OPTIONS=--experimental-vm-modules jest test/unit", + "test:unit:docker": "npm run test:docker-build && DOCKER_CONTENT_TRUST=0 docker run --rm oco-test npm run test:unit", + "test:e2e": "npm run test:e2e:setup && jest test/e2e", + "test:e2e:setup": "sh test/e2e/setup.sh", + "test:e2e:docker": "npm run test:docker-build && DOCKER_CONTENT_TRUST=0 docker run --rm oco-test npm run test:e2e" + }, + devDependencies: { + "@commitlint/types": "^17.4.4", + "@types/ini": "^1.3.31", + "@types/inquirer": "^9.0.3", + "@types/jest": "^29.5.12", + "@types/node": "^16.18.14", + "@typescript-eslint/eslint-plugin": "^5.45.0", + "@typescript-eslint/parser": "^5.45.0", + "cli-testing-library": "^2.0.2", + dotenv: "^16.0.3", + esbuild: "^0.15.18", + eslint: "^8.28.0", + jest: "^29.7.0", + prettier: "^2.8.4", + "ts-jest": "^29.1.2", + "ts-node": "^10.9.1", + typescript: "^4.9.3" + }, + dependencies: { + "@actions/core": "^1.10.0", + "@actions/exec": "^1.1.1", + "@actions/github": "^5.1.1", + "@anthropic-ai/sdk": "^0.19.2", + "@azure/openai": "^1.0.0-beta.12", + "@clack/prompts": "^0.6.1", + "@dqbd/tiktoken": "^1.0.2", + "@google/generative-ai": "^0.11.4", + "@octokit/webhooks-schemas": "^6.11.0", + "@octokit/webhooks-types": "^6.11.0", + axios: "^1.3.4", + chalk: "^5.2.0", + cleye: "^1.3.2", + crypto: "^1.0.1", + execa: "^7.0.0", + ignore: "^5.2.4", + ini: "^3.0.1", + inquirer: "^9.1.4", + openai: "^4.57.0" } - return { - ...stdioItem, - value: { transform, writableObjectMode, readableObjectMode } - }; }; -var normalizeTransformStream = ({ stdioItem, stdioItem: { value }, index, newTransforms, direction }) => { - const { transform, objectMode } = isPlainObject(value) ? value : { transform: value }; - const { writableObjectMode, readableObjectMode } = getTransformObjectModes(objectMode, index, newTransforms, direction); - return { - ...stdioItem, - value: { transform, writableObjectMode, readableObjectMode } + +// node_modules/@clack/core/dist/index.mjs +var import_sisteransi = __toESM(require_src(), 1); +var import_node_process = require("node:process"); +var f = __toESM(require("node:readline"), 1); +var import_node_readline = __toESM(require("node:readline"), 1); +var import_node_tty = require("node:tty"); +function q3({ onlyFirst: t2 = false } = {}) { + const u3 = ["[\\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(u3, t2 ? void 0 : "g"); +} +function S3(t2) { + if (typeof t2 != "string") + throw new TypeError(`Expected a \`string\`, got \`${typeof t2}\``); + return t2.replace(q3(), ""); +} +function j2(t2) { + return t2 && t2.__esModule && Object.prototype.hasOwnProperty.call(t2, "default") ? t2.default : t2; +} +var M3 = { exports: {} }; +(function(t2) { + var u3 = {}; + t2.exports = u3, u3.eastAsianWidth = function(e3) { + var s2 = e3.charCodeAt(0), C5 = e3.length == 2 ? e3.charCodeAt(1) : 0, D5 = s2; + return 55296 <= s2 && s2 <= 56319 && 56320 <= C5 && C5 <= 57343 && (s2 &= 1023, C5 &= 1023, D5 = s2 << 10 | C5, D5 += 65536), D5 == 12288 || 65281 <= D5 && D5 <= 65376 || 65504 <= D5 && D5 <= 65510 ? "F" : D5 == 8361 || 65377 <= D5 && D5 <= 65470 || 65474 <= D5 && D5 <= 65479 || 65482 <= D5 && D5 <= 65487 || 65490 <= D5 && D5 <= 65495 || 65498 <= D5 && D5 <= 65500 || 65512 <= D5 && D5 <= 65518 ? "H" : 4352 <= D5 && D5 <= 4447 || 4515 <= D5 && D5 <= 4519 || 4602 <= D5 && D5 <= 4607 || 9001 <= D5 && D5 <= 9002 || 11904 <= D5 && D5 <= 11929 || 11931 <= D5 && D5 <= 12019 || 12032 <= D5 && D5 <= 12245 || 12272 <= D5 && D5 <= 12283 || 12289 <= D5 && D5 <= 12350 || 12353 <= D5 && D5 <= 12438 || 12441 <= D5 && D5 <= 12543 || 12549 <= D5 && D5 <= 12589 || 12593 <= D5 && D5 <= 12686 || 12688 <= D5 && D5 <= 12730 || 12736 <= D5 && D5 <= 12771 || 12784 <= D5 && D5 <= 12830 || 12832 <= D5 && D5 <= 12871 || 12880 <= D5 && D5 <= 13054 || 13056 <= D5 && D5 <= 19903 || 19968 <= D5 && D5 <= 42124 || 42128 <= D5 && D5 <= 42182 || 43360 <= D5 && D5 <= 43388 || 44032 <= D5 && D5 <= 55203 || 55216 <= D5 && D5 <= 55238 || 55243 <= D5 && D5 <= 55291 || 63744 <= D5 && D5 <= 64255 || 65040 <= D5 && D5 <= 65049 || 65072 <= D5 && D5 <= 65106 || 65108 <= D5 && D5 <= 65126 || 65128 <= D5 && D5 <= 65131 || 110592 <= D5 && D5 <= 110593 || 127488 <= D5 && D5 <= 127490 || 127504 <= D5 && D5 <= 127546 || 127552 <= D5 && D5 <= 127560 || 127568 <= D5 && D5 <= 127569 || 131072 <= D5 && D5 <= 194367 || 177984 <= D5 && D5 <= 196605 || 196608 <= D5 && D5 <= 262141 ? "W" : 32 <= D5 && D5 <= 126 || 162 <= D5 && D5 <= 163 || 165 <= D5 && D5 <= 166 || D5 == 172 || D5 == 175 || 10214 <= D5 && D5 <= 10221 || 10629 <= D5 && D5 <= 10630 ? "Na" : D5 == 161 || D5 == 164 || 167 <= D5 && D5 <= 168 || D5 == 170 || 173 <= D5 && D5 <= 174 || 176 <= D5 && D5 <= 180 || 182 <= D5 && D5 <= 186 || 188 <= D5 && D5 <= 191 || D5 == 198 || D5 == 208 || 215 <= D5 && D5 <= 216 || 222 <= D5 && D5 <= 225 || D5 == 230 || 232 <= D5 && D5 <= 234 || 236 <= D5 && D5 <= 237 || D5 == 240 || 242 <= D5 && D5 <= 243 || 247 <= D5 && D5 <= 250 || D5 == 252 || D5 == 254 || D5 == 257 || D5 == 273 || D5 == 275 || D5 == 283 || 294 <= D5 && D5 <= 295 || D5 == 299 || 305 <= D5 && D5 <= 307 || D5 == 312 || 319 <= D5 && D5 <= 322 || D5 == 324 || 328 <= D5 && D5 <= 331 || D5 == 333 || 338 <= D5 && D5 <= 339 || 358 <= D5 && D5 <= 359 || D5 == 363 || D5 == 462 || D5 == 464 || D5 == 466 || D5 == 468 || D5 == 470 || D5 == 472 || D5 == 474 || D5 == 476 || D5 == 593 || D5 == 609 || D5 == 708 || D5 == 711 || 713 <= D5 && D5 <= 715 || D5 == 717 || D5 == 720 || 728 <= D5 && D5 <= 731 || D5 == 733 || D5 == 735 || 768 <= D5 && D5 <= 879 || 913 <= D5 && D5 <= 929 || 931 <= D5 && D5 <= 937 || 945 <= D5 && D5 <= 961 || 963 <= D5 && D5 <= 969 || D5 == 1025 || 1040 <= D5 && D5 <= 1103 || D5 == 1105 || D5 == 8208 || 8211 <= D5 && D5 <= 8214 || 8216 <= D5 && D5 <= 8217 || 8220 <= D5 && D5 <= 8221 || 8224 <= D5 && D5 <= 8226 || 8228 <= D5 && D5 <= 8231 || D5 == 8240 || 8242 <= D5 && D5 <= 8243 || D5 == 8245 || D5 == 8251 || D5 == 8254 || D5 == 8308 || D5 == 8319 || 8321 <= D5 && D5 <= 8324 || D5 == 8364 || D5 == 8451 || D5 == 8453 || D5 == 8457 || D5 == 8467 || D5 == 8470 || 8481 <= D5 && D5 <= 8482 || D5 == 8486 || D5 == 8491 || 8531 <= D5 && D5 <= 8532 || 8539 <= D5 && D5 <= 8542 || 8544 <= D5 && D5 <= 8555 || 8560 <= D5 && D5 <= 8569 || D5 == 8585 || 8592 <= D5 && D5 <= 8601 || 8632 <= D5 && D5 <= 8633 || D5 == 8658 || D5 == 8660 || D5 == 8679 || D5 == 8704 || 8706 <= D5 && D5 <= 8707 || 8711 <= D5 && D5 <= 8712 || D5 == 8715 || D5 == 8719 || D5 == 8721 || D5 == 8725 || D5 == 8730 || 8733 <= D5 && D5 <= 8736 || D5 == 8739 || D5 == 8741 || 8743 <= D5 && D5 <= 8748 || D5 == 8750 || 8756 <= D5 && D5 <= 8759 || 8764 <= D5 && D5 <= 8765 || D5 == 8776 || D5 == 8780 || D5 == 8786 || 8800 <= D5 && D5 <= 8801 || 8804 <= D5 && D5 <= 8807 || 8810 <= D5 && D5 <= 8811 || 8814 <= D5 && D5 <= 8815 || 8834 <= D5 && D5 <= 8835 || 8838 <= D5 && D5 <= 8839 || D5 == 8853 || D5 == 8857 || D5 == 8869 || D5 == 8895 || D5 == 8978 || 9312 <= D5 && D5 <= 9449 || 9451 <= D5 && D5 <= 9547 || 9552 <= D5 && D5 <= 9587 || 9600 <= D5 && D5 <= 9615 || 9618 <= D5 && D5 <= 9621 || 9632 <= D5 && D5 <= 9633 || 9635 <= D5 && D5 <= 9641 || 9650 <= D5 && D5 <= 9651 || 9654 <= D5 && D5 <= 9655 || 9660 <= D5 && D5 <= 9661 || 9664 <= D5 && D5 <= 9665 || 9670 <= D5 && D5 <= 9672 || D5 == 9675 || 9678 <= D5 && D5 <= 9681 || 9698 <= D5 && D5 <= 9701 || D5 == 9711 || 9733 <= D5 && D5 <= 9734 || D5 == 9737 || 9742 <= D5 && D5 <= 9743 || 9748 <= D5 && D5 <= 9749 || D5 == 9756 || D5 == 9758 || D5 == 9792 || D5 == 9794 || 9824 <= D5 && D5 <= 9825 || 9827 <= D5 && D5 <= 9829 || 9831 <= D5 && D5 <= 9834 || 9836 <= D5 && D5 <= 9837 || D5 == 9839 || 9886 <= D5 && D5 <= 9887 || 9918 <= D5 && D5 <= 9919 || 9924 <= D5 && D5 <= 9933 || 9935 <= D5 && D5 <= 9953 || D5 == 9955 || 9960 <= D5 && D5 <= 9983 || D5 == 10045 || D5 == 10071 || 10102 <= D5 && D5 <= 10111 || 11093 <= D5 && D5 <= 11097 || 12872 <= D5 && D5 <= 12879 || 57344 <= D5 && D5 <= 63743 || 65024 <= D5 && D5 <= 65039 || D5 == 65533 || 127232 <= D5 && D5 <= 127242 || 127248 <= D5 && D5 <= 127277 || 127280 <= D5 && D5 <= 127337 || 127344 <= D5 && D5 <= 127386 || 917760 <= D5 && D5 <= 917999 || 983040 <= D5 && D5 <= 1048573 || 1048576 <= D5 && D5 <= 1114109 ? "A" : "N"; + }, u3.characterLength = function(e3) { + var s2 = this.eastAsianWidth(e3); + return s2 == "F" || s2 == "W" || s2 == "A" ? 2 : 1; }; -}; -var normalizeGenerator = ({ stdioItem, stdioItem: { value }, index, newTransforms, direction, encoding }) => { - const { - transform, - final, - binary: binaryOption = false, - preserveNewlines = false, - objectMode - } = isPlainObject(value) ? value : { transform: value }; - const binary = binaryOption || BINARY_ENCODINGS.has(encoding); - const { writableObjectMode, readableObjectMode } = getTransformObjectModes(objectMode, index, newTransforms, direction); - return { - ...stdioItem, - value: { - transform, - final, - binary, - preserveNewlines, - writableObjectMode, - readableObjectMode + function F5(e3) { + return e3.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || []; + } + u3.length = function(e3) { + for (var s2 = F5(e3), C5 = 0, D5 = 0; D5 < s2.length; D5++) + C5 = C5 + this.characterLength(s2[D5]); + return C5; + }, u3.slice = function(e3, s2, C5) { + textLen = u3.length(e3), s2 = s2 || 0, C5 = C5 || 1, s2 < 0 && (s2 = textLen + s2), C5 < 0 && (C5 = textLen + C5); + for (var D5 = "", i3 = 0, n2 = F5(e3), E4 = 0; E4 < n2.length; E4++) { + var h4 = n2[E4], o3 = u3.length(h4); + if (i3 >= s2 - (o3 == 2 ? 1 : 0)) + if (i3 + o3 <= C5) + D5 += h4; + else + break; + i3 += o3; } + return D5; }; +})(M3); +var J3 = M3.exports; +var Q2 = j2(J3); +var X2 = function() { + return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\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])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\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\uDF7C\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\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\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\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\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-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*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\u26A7\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-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\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[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g; }; -var sortTransforms = (newTransforms, direction) => direction === "input" ? newTransforms.reverse() : newTransforms; - -// node_modules/execa/lib/stdio/direction.js -var import_node_process12 = __toESM(require("node:process"), 1); -var getStreamDirection = (stdioItems, fdNumber, optionName) => { - const directions = stdioItems.map((stdioItem) => getStdioItemDirection(stdioItem, fdNumber)); - if (directions.includes("input") && directions.includes("output")) { - throw new TypeError(`The \`${optionName}\` option must not be an array of both readable and writable values.`); - } - return directions.find(Boolean) ?? DEFAULT_DIRECTION; -}; -var getStdioItemDirection = ({ type: type2, value }, fdNumber) => KNOWN_DIRECTIONS[fdNumber] ?? guessStreamDirection[type2](value); -var KNOWN_DIRECTIONS = ["input", "output", "output"]; -var anyDirection = () => void 0; -var alwaysInput = () => "input"; -var guessStreamDirection = { - generator: anyDirection, - asyncGenerator: anyDirection, - fileUrl: anyDirection, - filePath: anyDirection, - iterable: alwaysInput, - asyncIterable: alwaysInput, - uint8Array: alwaysInput, - webStream: (value) => isWritableStream2(value) ? "output" : "input", - nodeStream(value) { - if (!isReadableStream(value, { checkOpen: false })) { - return "output"; - } - return isWritableStream(value, { checkOpen: false }) ? void 0 : "input"; - }, - webTransform: anyDirection, - duplex: anyDirection, - native(value) { - const standardStreamDirection = getStandardStreamDirection(value); - if (standardStreamDirection !== void 0) { - return standardStreamDirection; - } - if (isStream(value, { checkOpen: false })) { - return guessStreamDirection.nodeStream(value); +var DD2 = j2(X2); +function A2(t2, u3 = {}) { + if (typeof t2 != "string" || t2.length === 0 || (u3 = { ambiguousIsNarrow: true, ...u3 }, t2 = S3(t2), t2.length === 0)) + return 0; + t2 = t2.replace(DD2(), " "); + const F5 = u3.ambiguousIsNarrow ? 1 : 2; + let e3 = 0; + for (const s2 of t2) { + const C5 = s2.codePointAt(0); + if (C5 <= 31 || C5 >= 127 && C5 <= 159 || C5 >= 768 && C5 <= 879) + continue; + switch (Q2.eastAsianWidth(s2)) { + case "F": + case "W": + e3 += 2; + break; + case "A": + e3 += F5; + break; + default: + e3 += 1; } } -}; -var getStandardStreamDirection = (value) => { - if ([0, import_node_process12.default.stdin].includes(value)) { - return "input"; - } - if ([1, 2, import_node_process12.default.stdout, import_node_process12.default.stderr].includes(value)) { - return "output"; - } -}; -var DEFAULT_DIRECTION = "output"; - -// node_modules/execa/lib/ipc/array.js -var normalizeIpcStdioArray = (stdioArray, ipc) => ipc && !stdioArray.includes("ipc") ? [...stdioArray, "ipc"] : stdioArray; - -// node_modules/execa/lib/stdio/stdio-option.js -var normalizeStdioOption = ({ stdio, ipc, buffer, ...options }, verboseInfo, isSync) => { - const stdioArray = getStdioArray(stdio, options).map((stdioOption, fdNumber) => addDefaultValue2(stdioOption, fdNumber)); - return isSync ? normalizeStdioSync(stdioArray, buffer, verboseInfo) : normalizeIpcStdioArray(stdioArray, ipc); -}; -var getStdioArray = (stdio, options) => { - if (stdio === void 0) { - return STANDARD_STREAMS_ALIASES.map((alias) => options[alias]); - } - if (hasAlias(options)) { - throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${STANDARD_STREAMS_ALIASES.map((alias) => `\`${alias}\``).join(", ")}`); - } - if (typeof stdio === "string") { - return [stdio, stdio, stdio]; + return e3; +} +var m3 = 10; +var T4 = (t2 = 0) => (u3) => `\x1B[${u3 + t2}m`; +var P2 = (t2 = 0) => (u3) => `\x1B[${38 + t2};5;${u3}m`; +var W3 = (t2 = 0) => (u3, F5, e3) => `\x1B[${38 + t2};2;${u3};${F5};${e3}m`; +var r = { modifier: { reset: [0, 0], bold: [1, 22], dim: [2, 22], italic: [3, 23], underline: [4, 24], overline: [53, 55], 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], blackBright: [90, 39], gray: [90, 39], grey: [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], bgBlackBright: [100, 49], bgGray: [100, 49], bgGrey: [100, 49], bgRedBright: [101, 49], bgGreenBright: [102, 49], bgYellowBright: [103, 49], bgBlueBright: [104, 49], bgMagentaBright: [105, 49], bgCyanBright: [106, 49], bgWhiteBright: [107, 49] } }; +Object.keys(r.modifier); +var uD2 = Object.keys(r.color); +var FD2 = Object.keys(r.bgColor); +[...uD2, ...FD2]; +function tD2() { + const t2 = /* @__PURE__ */ new Map(); + for (const [u3, F5] of Object.entries(r)) { + for (const [e3, s2] of Object.entries(F5)) + r[e3] = { open: `\x1B[${s2[0]}m`, close: `\x1B[${s2[1]}m` }, F5[e3] = r[e3], t2.set(s2[0], s2[1]); + Object.defineProperty(r, u3, { value: F5, enumerable: false }); } - if (!Array.isArray(stdio)) { - throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); + return Object.defineProperty(r, "codes", { value: t2, enumerable: false }), r.color.close = "\x1B[39m", r.bgColor.close = "\x1B[49m", r.color.ansi = T4(), r.color.ansi256 = P2(), r.color.ansi16m = W3(), r.bgColor.ansi = T4(m3), r.bgColor.ansi256 = P2(m3), r.bgColor.ansi16m = W3(m3), Object.defineProperties(r, { rgbToAnsi256: { value: (u3, F5, e3) => u3 === F5 && F5 === e3 ? u3 < 8 ? 16 : u3 > 248 ? 231 : Math.round((u3 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(u3 / 255 * 5) + 6 * Math.round(F5 / 255 * 5) + Math.round(e3 / 255 * 5), enumerable: false }, hexToRgb: { value: (u3) => { + const F5 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(u3.toString(16)); + if (!F5) + return [0, 0, 0]; + let [e3] = F5; + e3.length === 3 && (e3 = [...e3].map((C5) => C5 + C5).join("")); + const s2 = Number.parseInt(e3, 16); + return [s2 >> 16 & 255, s2 >> 8 & 255, s2 & 255]; + }, enumerable: false }, hexToAnsi256: { value: (u3) => r.rgbToAnsi256(...r.hexToRgb(u3)), enumerable: false }, ansi256ToAnsi: { value: (u3) => { + if (u3 < 8) + return 30 + u3; + if (u3 < 16) + return 90 + (u3 - 8); + let F5, e3, s2; + if (u3 >= 232) + F5 = ((u3 - 232) * 10 + 8) / 255, e3 = F5, s2 = F5; + else { + u3 -= 16; + const i3 = u3 % 36; + F5 = Math.floor(u3 / 36) / 5, e3 = Math.floor(i3 / 6) / 5, s2 = i3 % 6 / 5; + } + const C5 = Math.max(F5, e3, s2) * 2; + if (C5 === 0) + return 30; + let D5 = 30 + (Math.round(s2) << 2 | Math.round(e3) << 1 | Math.round(F5)); + return C5 === 2 && (D5 += 60), D5; + }, enumerable: false }, rgbToAnsi: { value: (u3, F5, e3) => r.ansi256ToAnsi(r.rgbToAnsi256(u3, F5, e3)), enumerable: false }, hexToAnsi: { value: (u3) => r.ansi256ToAnsi(r.hexToAnsi256(u3)), enumerable: false } }), r; +} +var eD2 = tD2(); +var g2 = /* @__PURE__ */ new Set(["\x1B", "\x9B"]); +var sD2 = 39; +var b4 = "\x07"; +var O3 = "["; +var CD2 = "]"; +var I3 = "m"; +var w4 = `${CD2}8;;`; +var N3 = (t2) => `${g2.values().next().value}${O3}${t2}${I3}`; +var L4 = (t2) => `${g2.values().next().value}${w4}${t2}${b4}`; +var iD2 = (t2) => t2.split(" ").map((u3) => A2(u3)); +var y3 = (t2, u3, F5) => { + const e3 = [...u3]; + let s2 = false, C5 = false, D5 = A2(S3(t2[t2.length - 1])); + for (const [i3, n2] of e3.entries()) { + const E4 = A2(n2); + if (D5 + E4 <= F5 ? t2[t2.length - 1] += n2 : (t2.push(n2), D5 = 0), g2.has(n2) && (s2 = true, C5 = e3.slice(i3 + 1).join("").startsWith(w4)), s2) { + C5 ? n2 === b4 && (s2 = false, C5 = false) : n2 === I3 && (s2 = false); + continue; + } + D5 += E4, D5 === F5 && i3 < e3.length - 1 && (t2.push(""), D5 = 0); } - const length = Math.max(stdio.length, STANDARD_STREAMS_ALIASES.length); - return Array.from({ length }, (_7, fdNumber) => stdio[fdNumber]); + !D5 && t2[t2.length - 1].length > 0 && t2.length > 1 && (t2[t2.length - 2] += t2.pop()); }; -var hasAlias = (options) => STANDARD_STREAMS_ALIASES.some((alias) => options[alias] !== void 0); -var addDefaultValue2 = (stdioOption, fdNumber) => { - if (Array.isArray(stdioOption)) { - return stdioOption.map((item) => addDefaultValue2(item, fdNumber)); - } - if (stdioOption === null || stdioOption === void 0) { - return fdNumber >= STANDARD_STREAMS_ALIASES.length ? "ignore" : "pipe"; - } - return stdioOption; +var rD2 = (t2) => { + const u3 = t2.split(" "); + let F5 = u3.length; + for (; F5 > 0 && !(A2(u3[F5 - 1]) > 0); ) + F5--; + return F5 === u3.length ? t2 : u3.slice(0, F5).join(" ") + u3.slice(F5).join(""); }; -var normalizeStdioSync = (stdioArray, buffer, verboseInfo) => stdioArray.map((stdioOption, fdNumber) => !buffer[fdNumber] && fdNumber !== 0 && !isFullVerbose(verboseInfo, fdNumber) && isOutputPipeOnly(stdioOption) ? "ignore" : stdioOption); -var isOutputPipeOnly = (stdioOption) => stdioOption === "pipe" || Array.isArray(stdioOption) && stdioOption.every((item) => item === "pipe"); - -// node_modules/execa/lib/stdio/native.js -var import_node_fs3 = require("node:fs"); -var import_node_tty4 = __toESM(require("node:tty"), 1); -var handleNativeStream = ({ stdioItem, stdioItem: { type: type2 }, isStdioArray, fdNumber, direction, isSync }) => { - if (!isStdioArray || type2 !== "native") { - return stdioItem; - } - return isSync ? handleNativeStreamSync({ stdioItem, fdNumber, direction }) : handleNativeStreamAsync({ stdioItem, fdNumber }); -}; -var handleNativeStreamSync = ({ stdioItem, stdioItem: { value, optionName }, fdNumber, direction }) => { - const targetFd = getTargetFd({ - value, - optionName, - fdNumber, - direction - }); - if (targetFd !== void 0) { - return targetFd; +var ED2 = (t2, u3, F5 = {}) => { + if (F5.trim !== false && t2.trim() === "") + return ""; + let e3 = "", s2, C5; + const D5 = iD2(t2); + let i3 = [""]; + for (const [E4, h4] of t2.split(" ").entries()) { + F5.trim !== false && (i3[i3.length - 1] = i3[i3.length - 1].trimStart()); + let o3 = A2(i3[i3.length - 1]); + if (E4 !== 0 && (o3 >= u3 && (F5.wordWrap === false || F5.trim === false) && (i3.push(""), o3 = 0), (o3 > 0 || F5.trim === false) && (i3[i3.length - 1] += " ", o3++)), F5.hard && D5[E4] > u3) { + const B3 = u3 - o3, p4 = 1 + Math.floor((D5[E4] - B3 - 1) / u3); + Math.floor((D5[E4] - 1) / u3) < p4 && i3.push(""), y3(i3, h4, u3); + continue; + } + if (o3 + D5[E4] > u3 && o3 > 0 && D5[E4] > 0) { + if (F5.wordWrap === false && o3 < u3) { + y3(i3, h4, u3); + continue; + } + i3.push(""); + } + if (o3 + D5[E4] > u3 && F5.wordWrap === false) { + y3(i3, h4, u3); + continue; + } + i3[i3.length - 1] += h4; } - if (isStream(value, { checkOpen: false })) { - throw new TypeError(`The \`${optionName}: Stream\` option cannot both be an array and include a stream with synchronous methods.`); + F5.trim !== false && (i3 = i3.map((E4) => rD2(E4))); + const n2 = [...i3.join(` +`)]; + for (const [E4, h4] of n2.entries()) { + if (e3 += h4, g2.has(h4)) { + const { groups: B3 } = new RegExp(`(?:\\${O3}(?\\d+)m|\\${w4}(?.*)${b4})`).exec(n2.slice(E4).join("")) || { groups: {} }; + if (B3.code !== void 0) { + const p4 = Number.parseFloat(B3.code); + s2 = p4 === sD2 ? void 0 : p4; + } else + B3.uri !== void 0 && (C5 = B3.uri.length === 0 ? void 0 : B3.uri); + } + const o3 = eD2.codes.get(Number(s2)); + n2[E4 + 1] === ` +` ? (C5 && (e3 += L4("")), s2 && o3 && (e3 += N3(o3))) : h4 === ` +` && (s2 && o3 && (e3 += N3(s2)), C5 && (e3 += L4(C5))); } - return stdioItem; + return e3; }; -var getTargetFd = ({ value, optionName, fdNumber, direction }) => { - const targetFdNumber = getTargetFdNumber(value, fdNumber); - if (targetFdNumber === void 0) { +function R4(t2, u3, F5) { + return String(t2).normalize().replace(/\r\n/g, ` +`).split(` +`).map((e3) => ED2(e3, u3, F5)).join(` +`); +} +var oD2 = Object.defineProperty; +var nD2 = (t2, u3, F5) => u3 in t2 ? oD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5; +var a = (t2, u3, F5) => (nD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5); +function aD2(t2, u3) { + if (t2 === u3) return; + const F5 = t2.split(` +`), e3 = u3.split(` +`), s2 = []; + for (let C5 = 0; C5 < Math.max(F5.length, e3.length); C5++) + F5[C5] !== e3[C5] && s2.push(C5); + return s2; +} +var V4 = Symbol("clack:cancel"); +function hD2(t2) { + return t2 === V4; +} +function v3(t2, u3) { + t2.isTTY && t2.setRawMode(u3); +} +var z3 = /* @__PURE__ */ new Map([["k", "up"], ["j", "down"], ["h", "left"], ["l", "right"]]); +var lD2 = /* @__PURE__ */ new Set(["up", "down", "left", "right", "space", "enter"]); +var x3 = class { + constructor({ render: u3, input: F5 = import_node_process.stdin, output: e3 = import_node_process.stdout, ...s2 }, C5 = true) { + a(this, "input"), a(this, "output"), a(this, "rl"), a(this, "opts"), a(this, "_track", false), a(this, "_render"), a(this, "_cursor", 0), a(this, "state", "initial"), a(this, "value"), a(this, "error", ""), a(this, "subscribers", /* @__PURE__ */ new Map()), a(this, "_prevFrame", ""), this.opts = s2, this.onKeypress = this.onKeypress.bind(this), this.close = this.close.bind(this), this.render = this.render.bind(this), this._render = u3.bind(this), this._track = C5, this.input = F5, this.output = e3; } - if (direction === "output") { - return { type: "fileNumber", value: targetFdNumber, optionName }; - } - if (import_node_tty4.default.isatty(targetFdNumber)) { - throw new TypeError(`The \`${optionName}: ${serializeOptionValue(value)}\` option is invalid: it cannot be a TTY with synchronous methods.`); - } - return { type: "uint8Array", value: bufferToUint8Array((0, import_node_fs3.readFileSync)(targetFdNumber)), optionName }; -}; -var getTargetFdNumber = (value, fdNumber) => { - if (value === "inherit") { - return fdNumber; - } - if (typeof value === "number") { - return value; - } - const standardStreamIndex = STANDARD_STREAMS.indexOf(value); - if (standardStreamIndex !== -1) { - return standardStreamIndex; - } -}; -var handleNativeStreamAsync = ({ stdioItem, stdioItem: { value, optionName }, fdNumber }) => { - if (value === "inherit") { - return { type: "nodeStream", value: getStandardStream(fdNumber, value, optionName), optionName }; + prompt() { + const u3 = new import_node_tty.WriteStream(0); + return u3._write = (F5, e3, s2) => { + this._track && (this.value = this.rl.line.replace(/\t/g, ""), this._cursor = this.rl.cursor, this.emit("value", this.value)), s2(); + }, this.input.pipe(u3), this.rl = import_node_readline.default.createInterface({ input: this.input, output: u3, tabSize: 2, prompt: "", escapeCodeTimeout: 50 }), import_node_readline.default.emitKeypressEvents(this.input, this.rl), this.rl.prompt(), this.opts.initialValue !== void 0 && this._track && this.rl.write(this.opts.initialValue), this.input.on("keypress", this.onKeypress), v3(this.input, true), this.output.on("resize", this.render), this.render(), new Promise((F5, e3) => { + this.once("submit", () => { + this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(this.value); + }), this.once("cancel", () => { + this.output.write(import_sisteransi.cursor.show), this.output.off("resize", this.render), v3(this.input, false), F5(V4); + }); + }); } - if (typeof value === "number") { - return { type: "nodeStream", value: getStandardStream(value, value, optionName), optionName }; + on(u3, F5) { + const e3 = this.subscribers.get(u3) ?? []; + e3.push({ cb: F5 }), this.subscribers.set(u3, e3); } - if (isStream(value, { checkOpen: false })) { - return { type: "nodeStream", value, optionName }; + once(u3, F5) { + const e3 = this.subscribers.get(u3) ?? []; + e3.push({ cb: F5, once: true }), this.subscribers.set(u3, e3); } - return stdioItem; -}; -var getStandardStream = (fdNumber, value, optionName) => { - const standardStream = STANDARD_STREAMS[fdNumber]; - if (standardStream === void 0) { - throw new TypeError(`The \`${optionName}: ${value}\` option is invalid: no such standard stream.`); + emit(u3, ...F5) { + const e3 = this.subscribers.get(u3) ?? [], s2 = []; + for (const C5 of e3) + C5.cb(...F5), C5.once && s2.push(() => e3.splice(e3.indexOf(C5), 1)); + for (const C5 of s2) + C5(); } - return standardStream; -}; - -// node_modules/execa/lib/stdio/input-option.js -var handleInputOptions = ({ input, inputFile }, fdNumber) => fdNumber === 0 ? [ - ...handleInputOption(input), - ...handleInputFileOption(inputFile) -] : []; -var handleInputOption = (input) => input === void 0 ? [] : [{ - type: getInputType(input), - value: input, - optionName: "input" -}]; -var getInputType = (input) => { - if (isReadableStream(input, { checkOpen: false })) { - return "nodeStream"; + unsubscribe() { + this.subscribers.clear(); } - if (typeof input === "string") { - return "string"; + onKeypress(u3, F5) { + if (this.state === "error" && (this.state = "active"), F5?.name && !this._track && z3.has(F5.name) && this.emit("cursor", z3.get(F5.name)), F5?.name && lD2.has(F5.name) && this.emit("cursor", F5.name), u3 && (u3.toLowerCase() === "y" || u3.toLowerCase() === "n") && this.emit("confirm", u3.toLowerCase() === "y"), u3 === " " && this.opts.placeholder && (this.value || (this.rl.write(this.opts.placeholder), this.emit("value", this.opts.placeholder))), u3 && this.emit("key", u3.toLowerCase()), F5?.name === "return") { + if (this.opts.validate) { + const e3 = this.opts.validate(this.value); + e3 && (this.error = e3, this.state = "error", this.rl.write(this.value)); + } + this.state !== "error" && (this.state = "submit"); + } + u3 === "" && (this.state = "cancel"), (this.state === "submit" || this.state === "cancel") && this.emit("finalize"), this.render(), (this.state === "submit" || this.state === "cancel") && this.close(); } - if (isUint8Array(input)) { - return "uint8Array"; + close() { + this.input.unpipe(), this.input.removeListener("keypress", this.onKeypress), this.output.write(` +`), v3(this.input, false), this.rl.close(), this.emit(`${this.state}`, this.value), this.unsubscribe(); } - throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream."); -}; -var handleInputFileOption = (inputFile) => inputFile === void 0 ? [] : [{ - ...getInputFileType(inputFile), - optionName: "inputFile" -}]; -var getInputFileType = (inputFile) => { - if (isUrl(inputFile)) { - return { type: "fileUrl", value: inputFile }; + restoreCursor() { + const u3 = R4(this._prevFrame, process.stdout.columns, { hard: true }).split(` +`).length - 1; + this.output.write(import_sisteransi.cursor.move(-999, u3 * -1)); } - if (isFilePathString(inputFile)) { - return { type: "filePath", value: { file: inputFile } }; + render() { + const u3 = R4(this._render(this) ?? "", process.stdout.columns, { hard: true }); + if (u3 !== this._prevFrame) { + if (this.state === "initial") + this.output.write(import_sisteransi.cursor.hide); + else { + const F5 = aD2(this._prevFrame, u3); + if (this.restoreCursor(), F5 && F5?.length === 1) { + const e3 = F5[0]; + this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.lines(1)); + const s2 = u3.split(` +`); + this.output.write(s2[e3]), this._prevFrame = u3, this.output.write(import_sisteransi.cursor.move(0, s2.length - e3 - 1)); + return; + } else if (F5 && F5?.length > 1) { + const e3 = F5[0]; + this.output.write(import_sisteransi.cursor.move(0, e3)), this.output.write(import_sisteransi.erase.down()); + const s2 = u3.split(` +`).slice(e3); + this.output.write(s2.join(` +`)), this._prevFrame = u3; + return; + } + this.output.write(import_sisteransi.erase.down()); + } + this.output.write(u3), this.state === "initial" && (this.state = "active"), this._prevFrame = u3; + } } - throw new Error("The `inputFile` option must be a file path string or a file URL."); }; - -// node_modules/execa/lib/stdio/duplicate.js -var filterDuplicates = (stdioItems) => stdioItems.filter((stdioItemOne, indexOne) => stdioItems.every((stdioItemTwo, indexTwo) => stdioItemOne.value !== stdioItemTwo.value || indexOne >= indexTwo || stdioItemOne.type === "generator" || stdioItemOne.type === "asyncGenerator")); -var getDuplicateStream = ({ stdioItem: { type: type2, value, optionName }, direction, fileDescriptors, isSync }) => { - const otherStdioItems = getOtherStdioItems(fileDescriptors, type2); - if (otherStdioItems.length === 0) { - return; - } - if (isSync) { - validateDuplicateStreamSync({ - otherStdioItems, - type: type2, - value, - optionName, - direction - }); - return; +var xD2 = class extends x3 { + get cursor() { + return this.value ? 0 : 1; } - if (SPECIAL_DUPLICATE_TYPES.has(type2)) { - return getDuplicateStreamInstance({ - otherStdioItems, - type: type2, - value, - optionName, - direction - }); + get _value() { + return this.cursor === 0; } - if (FORBID_DUPLICATE_TYPES.has(type2)) { - validateDuplicateTransform({ - otherStdioItems, - type: type2, - value, - optionName + constructor(u3) { + super(u3, false), this.value = !!u3.initialValue, this.on("value", () => { + this.value = this._value; + }), this.on("confirm", (F5) => { + this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = F5, this.state = "submit", this.close(); + }), this.on("cursor", () => { + this.value = !this.value; }); } }; -var getOtherStdioItems = (fileDescriptors, type2) => fileDescriptors.flatMap(({ direction, stdioItems }) => stdioItems.filter((stdioItem) => stdioItem.type === type2).map((stdioItem) => ({ ...stdioItem, direction }))); -var validateDuplicateStreamSync = ({ otherStdioItems, type: type2, value, optionName, direction }) => { - if (SPECIAL_DUPLICATE_TYPES_SYNC.has(type2)) { - getDuplicateStreamInstance({ - otherStdioItems, - type: type2, - value, - optionName, - direction +var pD2 = Object.defineProperty; +var fD2 = (t2, u3, F5) => u3 in t2 ? pD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5; +var K3 = (t2, u3, F5) => (fD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5); +var gD2 = class extends x3 { + constructor(u3) { + super(u3, false), K3(this, "options"), K3(this, "cursor", 0), this.options = u3.options, this.value = [...u3.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F5 }) => F5 === u3.cursorAt), 0), this.on("key", (F5) => { + F5 === "a" && this.toggleAll(); + }), this.on("cursor", (F5) => { + switch (F5) { + case "left": + case "up": + this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1; + break; + case "down": + case "right": + this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1; + break; + case "space": + this.toggleValue(); + break; + } }); } -}; -var getDuplicateStreamInstance = ({ otherStdioItems, type: type2, value, optionName, direction }) => { - const duplicateStdioItems = otherStdioItems.filter((stdioItem) => hasSameValue(stdioItem, value)); - if (duplicateStdioItems.length === 0) { - return; - } - const differentStdioItem = duplicateStdioItems.find((stdioItem) => stdioItem.direction !== direction); - throwOnDuplicateStream(differentStdioItem, optionName, type2); - return direction === "output" ? duplicateStdioItems[0].stream : void 0; -}; -var hasSameValue = ({ type: type2, value }, secondValue) => { - if (type2 === "filePath") { - return value.file === secondValue.file; - } - if (type2 === "fileUrl") { - return value.href === secondValue.href; - } - return value === secondValue; -}; -var validateDuplicateTransform = ({ otherStdioItems, type: type2, value, optionName }) => { - const duplicateStdioItem = otherStdioItems.find(({ value: { transform } }) => transform === value.transform); - throwOnDuplicateStream(duplicateStdioItem, optionName, type2); -}; -var throwOnDuplicateStream = (stdioItem, optionName, type2) => { - if (stdioItem !== void 0) { - throw new TypeError(`The \`${stdioItem.optionName}\` and \`${optionName}\` options must not target ${TYPE_TO_MESSAGE[type2]} that is the same.`); - } -}; - -// node_modules/execa/lib/stdio/handle.js -var handleStdio = (addProperties3, options, verboseInfo, isSync) => { - const stdio = normalizeStdioOption(options, verboseInfo, isSync); - const initialFileDescriptors = stdio.map((stdioOption, fdNumber) => getFileDescriptor({ - stdioOption, - fdNumber, - options, - isSync - })); - const fileDescriptors = getFinalFileDescriptors({ - initialFileDescriptors, - addProperties: addProperties3, - options, - isSync - }); - options.stdio = fileDescriptors.map(({ stdioItems }) => forwardStdio(stdioItems)); - return fileDescriptors; -}; -var getFileDescriptor = ({ stdioOption, fdNumber, options, isSync }) => { - const optionName = getStreamName(fdNumber); - const { stdioItems: initialStdioItems, isStdioArray } = initializeStdioItems({ - stdioOption, - fdNumber, - options, - optionName - }); - const direction = getStreamDirection(initialStdioItems, fdNumber, optionName); - const stdioItems = initialStdioItems.map((stdioItem) => handleNativeStream({ - stdioItem, - isStdioArray, - fdNumber, - direction, - isSync - })); - const normalizedStdioItems = normalizeTransforms(stdioItems, optionName, direction, options); - const objectMode = getFdObjectMode(normalizedStdioItems, direction); - validateFileObjectMode(normalizedStdioItems, objectMode); - return { direction, objectMode, stdioItems: normalizedStdioItems }; -}; -var initializeStdioItems = ({ stdioOption, fdNumber, options, optionName }) => { - const values = Array.isArray(stdioOption) ? stdioOption : [stdioOption]; - const initialStdioItems = [ - ...values.map((value) => initializeStdioItem(value, optionName)), - ...handleInputOptions(options, fdNumber) - ]; - const stdioItems = filterDuplicates(initialStdioItems); - const isStdioArray = stdioItems.length > 1; - validateStdioArray(stdioItems, isStdioArray, optionName); - validateStreams(stdioItems); - return { stdioItems, isStdioArray }; -}; -var initializeStdioItem = (value, optionName) => ({ - type: getStdioItemType(value, optionName), - value, - optionName -}); -var validateStdioArray = (stdioItems, isStdioArray, optionName) => { - if (stdioItems.length === 0) { - throw new TypeError(`The \`${optionName}\` option must not be an empty array.`); + get _value() { + return this.options[this.cursor].value; } - if (!isStdioArray) { - return; + toggleAll() { + const u3 = this.value.length === this.options.length; + this.value = u3 ? [] : this.options.map((F5) => F5.value); } - for (const { value, optionName: optionName2 } of stdioItems) { - if (INVALID_STDIO_ARRAY_OPTIONS.has(value)) { - throw new Error(`The \`${optionName2}\` option must not include \`${value}\`.`); - } + toggleValue() { + const u3 = this.value.includes(this._value); + this.value = u3 ? this.value.filter((F5) => F5 !== this._value) : [...this.value, this._value]; } }; -var INVALID_STDIO_ARRAY_OPTIONS = /* @__PURE__ */ new Set(["ignore", "ipc"]); -var validateStreams = (stdioItems) => { - for (const stdioItem of stdioItems) { - validateFileStdio(stdioItem); +var bD2 = Object.defineProperty; +var wD2 = (t2, u3, F5) => u3 in t2 ? bD2(t2, u3, { enumerable: true, configurable: true, writable: true, value: F5 }) : t2[u3] = F5; +var Z3 = (t2, u3, F5) => (wD2(t2, typeof u3 != "symbol" ? u3 + "" : u3, F5), F5); +var yD = class extends x3 { + constructor(u3) { + super(u3, false), Z3(this, "options"), Z3(this, "cursor", 0), this.options = u3.options, this.cursor = this.options.findIndex(({ value: F5 }) => F5 === u3.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (F5) => { + switch (F5) { + case "left": + case "up": + this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1; + break; + case "down": + case "right": + this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1; + break; + } + this.changeValue(); + }); } -}; -var validateFileStdio = ({ type: type2, value, optionName }) => { - if (isRegularUrl(value)) { - throw new TypeError(`The \`${optionName}: URL\` option must use the \`file:\` scheme. -For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`); + get _value() { + return this.options[this.cursor]; } - if (isUnknownStdioString(type2, value)) { - throw new TypeError(`The \`${optionName}: { file: '...' }\` option must be used instead of \`${optionName}: '...'\`.`); + changeValue() { + this.value = this._value.value; } }; -var validateFileObjectMode = (stdioItems, objectMode) => { - if (!objectMode) { - return; - } - const fileStdioItem = stdioItems.find(({ type: type2 }) => FILE_TYPES.has(type2)); - if (fileStdioItem !== void 0) { - throw new TypeError(`The \`${fileStdioItem.optionName}\` option cannot use both files and transforms in objectMode.`); +var PD = globalThis.process.platform.startsWith("win"); +function WD({ input: t2 = import_node_process.stdin, output: u3 = import_node_process.stdout, overwrite: F5 = true, hideCursor: e3 = true } = {}) { + const s2 = f.createInterface({ input: t2, output: u3, prompt: "", tabSize: 1 }); + f.emitKeypressEvents(t2, s2), t2.isTTY && t2.setRawMode(true); + const C5 = (D5, { name: i3 }) => { + if (String(D5) === "" && process.exit(0), !F5) + return; + let n2 = i3 === "return" ? 0 : -1, E4 = i3 === "return" ? -1 : 0; + f.moveCursor(u3, n2, E4, () => { + f.clearLine(u3, 1, () => { + t2.once("keypress", C5); + }); + }); + }; + return e3 && process.stdout.write(import_sisteransi.cursor.hide), t2.once("keypress", C5), () => { + t2.off("keypress", C5), e3 && process.stdout.write(import_sisteransi.cursor.show), t2.isTTY && !PD && t2.setRawMode(false), s2.terminal = false, s2.close(); + }; +} + +// node_modules/@clack/prompts/dist/index.mjs +var import_node_process2 = __toESM(require("node:process"), 1); +var import_picocolors = __toESM(require_picocolors(), 1); +var import_sisteransi2 = __toESM(require_src(), 1); +function N4() { + return import_node_process2.default.platform !== "win32" ? import_node_process2.default.env.TERM !== "linux" : Boolean(import_node_process2.default.env.CI) || Boolean(import_node_process2.default.env.WT_SESSION) || Boolean(import_node_process2.default.env.TERMINUS_SUBLIME) || import_node_process2.default.env.ConEmuTask === "{cmd::Cmder}" || import_node_process2.default.env.TERM_PROGRAM === "Terminus-Sublime" || import_node_process2.default.env.TERM_PROGRAM === "vscode" || import_node_process2.default.env.TERM === "xterm-256color" || import_node_process2.default.env.TERM === "alacritty" || import_node_process2.default.env.TERMINAL_EMULATOR === "JetBrains-JediTerm"; +} +var p2 = N4(); +var u = (r3, n2) => p2 ? r3 : n2; +var W4 = u("\u25C6", "*"); +var D3 = u("\u25A0", "x"); +var F3 = u("\u25B2", "x"); +var f2 = u("\u25C7", "o"); +var L5 = u("\u250C", "T"); +var a2 = u("\u2502", "|"); +var o = u("\u2514", "\u2014"); +var w5 = u("\u25CF", ">"); +var S4 = u("\u25CB", " "); +var _5 = u("\u25FB", "[\u2022]"); +var y4 = u("\u25FC", "[+]"); +var A3 = u("\u25FB", "[ ]"); +var q4 = u("\u25AA", "\u2022"); +var R5 = u("\u2500", "-"); +var G4 = u("\u256E", "+"); +var H3 = u("\u251C", "+"); +var K4 = u("\u256F", "+"); +var U5 = u("\u25CF", "\u2022"); +var Z4 = u("\u25C6", "*"); +var z4 = u("\u25B2", "!"); +var X3 = u("\u25A0", "x"); +var h2 = (r3) => { + switch (r3) { + case "initial": + case "active": + return import_picocolors.default.cyan(W4); + case "cancel": + return import_picocolors.default.red(D3); + case "error": + return import_picocolors.default.yellow(F3); + case "submit": + return import_picocolors.default.green(f2); } }; -var getFinalFileDescriptors = ({ initialFileDescriptors, addProperties: addProperties3, options, isSync }) => { - const fileDescriptors = []; - try { - for (const fileDescriptor of initialFileDescriptors) { - fileDescriptors.push(getFinalFileDescriptor({ - fileDescriptor, - fileDescriptors, - addProperties: addProperties3, - options, - isSync - })); +var Q3 = (r3) => { + const n2 = r3.active ?? "Yes", s2 = r3.inactive ?? "No"; + return new xD2({ active: n2, inactive: s2, initialValue: r3.initialValue ?? true, render() { + const t2 = `${import_picocolors.default.gray(a2)} +${h2(this.state)} ${r3.message} +`, i3 = this.value ? n2 : s2; + switch (this.state) { + case "submit": + return `${t2}${import_picocolors.default.gray(a2)} ${import_picocolors.default.dim(i3)}`; + case "cancel": + return `${t2}${import_picocolors.default.gray(a2)} ${import_picocolors.default.strikethrough(import_picocolors.default.dim(i3))} +${import_picocolors.default.gray(a2)}`; + default: + return `${t2}${import_picocolors.default.cyan(a2)} ${this.value ? `${import_picocolors.default.green(w5)} ${n2}` : `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(n2)}`} ${import_picocolors.default.dim("/")} ${this.value ? `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(s2)}` : `${import_picocolors.default.green(w5)} ${s2}`} +${import_picocolors.default.cyan(o)} +`; } - return fileDescriptors; - } catch (error) { - cleanupCustomStreams(fileDescriptors); - throw error; - } + } }).prompt(); }; -var getFinalFileDescriptor = ({ - fileDescriptor: { direction, objectMode, stdioItems }, - fileDescriptors, - addProperties: addProperties3, - options, - isSync -}) => { - const finalStdioItems = stdioItems.map((stdioItem) => addStreamProperties({ - stdioItem, - addProperties: addProperties3, - direction, - options, - fileDescriptors, - isSync - })); - return { direction, objectMode, stdioItems: finalStdioItems }; -}; -var addStreamProperties = ({ stdioItem, addProperties: addProperties3, direction, options, fileDescriptors, isSync }) => { - const duplicateStream = getDuplicateStream({ - stdioItem, - direction, - fileDescriptors, - isSync - }); - if (duplicateStream !== void 0) { - return { ...stdioItem, stream: duplicateStream }; - } - return { - ...stdioItem, - ...addProperties3[direction][stdioItem.type](stdioItem, options) +var ee = (r3) => { + const n2 = (s2, t2) => { + const i3 = s2.label ?? String(s2.value); + return t2 === "active" ? `${import_picocolors.default.green(w5)} ${i3} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(i3))}` : `${import_picocolors.default.dim(S4)} ${import_picocolors.default.dim(i3)}`; }; -}; -var cleanupCustomStreams = (fileDescriptors) => { - for (const { stdioItems } of fileDescriptors) { - for (const { stream: stream4 } of stdioItems) { - if (stream4 !== void 0 && !isStandardStream(stream4)) { - stream4.destroy(); - } + return new yD({ options: r3.options, initialValue: r3.initialValue, render() { + const s2 = `${import_picocolors.default.gray(a2)} +${h2(this.state)} ${r3.message} +`; + switch (this.state) { + case "submit": + return `${s2}${import_picocolors.default.gray(a2)} ${n2(this.options[this.cursor], "selected")}`; + case "cancel": + return `${s2}${import_picocolors.default.gray(a2)} ${n2(this.options[this.cursor], "cancelled")} +${import_picocolors.default.gray(a2)}`; + default: + return `${s2}${import_picocolors.default.cyan(a2)} ${this.options.map((t2, i3) => n2(t2, i3 === this.cursor ? "active" : "inactive")).join(` +${import_picocolors.default.cyan(a2)} `)} +${import_picocolors.default.cyan(o)} +`; } - } -}; -var forwardStdio = (stdioItems) => { - if (stdioItems.length > 1) { - return stdioItems.some(({ value: value2 }) => value2 === "overlapped") ? "overlapped" : "pipe"; - } - const [{ type: type2, value }] = stdioItems; - return type2 === "native" ? value : "pipe"; -}; - -// node_modules/execa/lib/stdio/handle-sync.js -var handleStdioSync = (options, verboseInfo) => handleStdio(addPropertiesSync, options, verboseInfo, true); -var forbiddenIfSync = ({ type: type2, optionName }) => { - throwInvalidSyncValue(optionName, TYPE_TO_MESSAGE[type2]); -}; -var forbiddenNativeIfSync = ({ optionName, value }) => { - if (value === "ipc" || value === "overlapped") { - throwInvalidSyncValue(optionName, `"${value}"`); - } - return {}; -}; -var throwInvalidSyncValue = (optionName, value) => { - throw new TypeError(`The \`${optionName}\` option cannot be ${value} with synchronous methods.`); -}; -var addProperties = { - generator() { - }, - asyncGenerator: forbiddenIfSync, - webStream: forbiddenIfSync, - nodeStream: forbiddenIfSync, - webTransform: forbiddenIfSync, - duplex: forbiddenIfSync, - asyncIterable: forbiddenIfSync, - native: forbiddenNativeIfSync -}; -var addPropertiesSync = { - input: { - ...addProperties, - fileUrl: ({ value }) => ({ contents: [bufferToUint8Array((0, import_node_fs4.readFileSync)(value))] }), - filePath: ({ value: { file } }) => ({ contents: [bufferToUint8Array((0, import_node_fs4.readFileSync)(file))] }), - fileNumber: forbiddenIfSync, - iterable: ({ value }) => ({ contents: [...value] }), - string: ({ value }) => ({ contents: [value] }), - uint8Array: ({ value }) => ({ contents: [value] }) - }, - output: { - ...addProperties, - fileUrl: ({ value }) => ({ path: value }), - filePath: ({ value: { file } }) => ({ path: file }), - fileNumber: ({ value }) => ({ path: value }), - iterable: forbiddenIfSync, - string: forbiddenIfSync, - uint8Array: forbiddenIfSync - } -}; - -// node_modules/execa/lib/io/strip-newline.js -var stripNewline = (value, { stripFinalNewline: stripFinalNewline2 }, fdNumber) => getStripFinalNewline(stripFinalNewline2, fdNumber) && value !== void 0 && !Array.isArray(value) ? stripFinalNewline(value) : value; -var getStripFinalNewline = (stripFinalNewline2, fdNumber) => fdNumber === "all" ? stripFinalNewline2[1] || stripFinalNewline2[2] : stripFinalNewline2[fdNumber]; - -// node_modules/execa/lib/transform/generator.js -var import_node_stream = require("node:stream"); - -// node_modules/execa/lib/transform/split.js -var getSplitLinesGenerator = (binary, preserveNewlines, skipped, state2) => binary || skipped ? void 0 : initializeSplitLines(preserveNewlines, state2); -var splitLinesSync = (chunk, preserveNewlines, objectMode) => objectMode ? chunk.flatMap((item) => splitLinesItemSync(item, preserveNewlines)) : splitLinesItemSync(chunk, preserveNewlines); -var splitLinesItemSync = (chunk, preserveNewlines) => { - const { transform, final } = initializeSplitLines(preserveNewlines, {}); - return [...transform(chunk), ...final()]; + } }).prompt(); }; -var initializeSplitLines = (preserveNewlines, state2) => { - state2.previousChunks = ""; - return { - transform: splitGenerator.bind(void 0, state2, preserveNewlines), - final: linesFinal.bind(void 0, state2) +var re = (r3) => { + const n2 = (s2, t2) => { + const i3 = s2.label ?? String(s2.value); + return t2 === "active" ? `${import_picocolors.default.cyan(_5)} ${i3} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "selected" ? `${import_picocolors.default.green(y4)} ${import_picocolors.default.dim(i3)}` : t2 === "cancelled" ? `${import_picocolors.default.strikethrough(import_picocolors.default.dim(i3))}` : t2 === "active-selected" ? `${import_picocolors.default.green(y4)} ${i3} ${s2.hint ? import_picocolors.default.dim(`(${s2.hint})`) : ""}` : t2 === "submitted" ? `${import_picocolors.default.dim(i3)}` : `${import_picocolors.default.dim(A3)} ${import_picocolors.default.dim(i3)}`; }; -}; -var splitGenerator = function* (state2, preserveNewlines, chunk) { - if (typeof chunk !== "string") { - yield chunk; - return; - } - let { previousChunks } = state2; - let start = -1; - for (let end = 0; end < chunk.length; end += 1) { - if (chunk[end] === "\n") { - const newlineLength = getNewlineLength(chunk, end, preserveNewlines, state2); - let line = chunk.slice(start + 1, end + 1 - newlineLength); - if (previousChunks.length > 0) { - line = concatString(previousChunks, line); - previousChunks = ""; + return new gD2({ options: r3.options, initialValues: r3.initialValues, required: r3.required ?? true, cursorAt: r3.cursorAt, validate(s2) { + if (this.required && s2.length === 0) + return `Please select at least one option. +${import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`))}`; + }, render() { + let s2 = `${import_picocolors.default.gray(a2)} +${h2(this.state)} ${r3.message} +`; + switch (this.state) { + case "submit": + return `${s2}${import_picocolors.default.gray(a2)} ${this.options.filter(({ value: t2 }) => this.value.includes(t2)).map((t2) => n2(t2, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none")}`; + case "cancel": { + const t2 = this.options.filter(({ value: i3 }) => this.value.includes(i3)).map((i3) => n2(i3, "cancelled")).join(import_picocolors.default.dim(", ")); + return `${s2}${import_picocolors.default.gray(a2)} ${t2.trim() ? `${t2} +${import_picocolors.default.gray(a2)}` : ""}`; + } + case "error": { + const t2 = this.error.split(` +`).map((i3, c3) => c3 === 0 ? `${import_picocolors.default.yellow(o)} ${import_picocolors.default.yellow(i3)}` : ` ${i3}`).join(` +`); + return s2 + import_picocolors.default.yellow(a2) + " " + this.options.map((i3, c3) => { + const l3 = this.value.includes(i3.value), $6 = c3 === this.cursor; + return $6 && l3 ? n2(i3, "active-selected") : l3 ? n2(i3, "selected") : n2(i3, $6 ? "active" : "inactive"); + }).join(` +${import_picocolors.default.yellow(a2)} `) + ` +` + t2 + ` +`; } - yield line; - start = end; + default: + return `${s2}${import_picocolors.default.cyan(a2)} ${this.options.map((t2, i3) => { + const c3 = this.value.includes(t2.value), l3 = i3 === this.cursor; + return l3 && c3 ? n2(t2, "active-selected") : c3 ? n2(t2, "selected") : n2(t2, l3 ? "active" : "inactive"); + }).join(` +${import_picocolors.default.cyan(a2)} `)} +${import_picocolors.default.cyan(o)} +`; } - } - if (start !== chunk.length - 1) { - previousChunks = concatString(previousChunks, chunk.slice(start + 1)); - } - state2.previousChunks = previousChunks; -}; -var getNewlineLength = (chunk, end, preserveNewlines, state2) => { - if (preserveNewlines) { - return 0; - } - state2.isWindowsNewline = end !== 0 && chunk[end - 1] === "\r"; - return state2.isWindowsNewline ? 2 : 1; -}; -var linesFinal = function* ({ previousChunks }) { - if (previousChunks.length > 0) { - yield previousChunks; - } -}; -var getAppendNewlineGenerator = ({ binary, preserveNewlines, readableObjectMode, state: state2 }) => binary || preserveNewlines || readableObjectMode ? void 0 : { transform: appendNewlineGenerator.bind(void 0, state2) }; -var appendNewlineGenerator = function* ({ isWindowsNewline = false }, chunk) { - const { unixNewline, windowsNewline, LF: LF2, concatBytes } = typeof chunk === "string" ? linesStringInfo : linesUint8ArrayInfo; - if (chunk.at(-1) === LF2) { - yield chunk; - return; - } - const newline = isWindowsNewline ? windowsNewline : unixNewline; - yield concatBytes(chunk, newline); -}; -var concatString = (firstChunk, secondChunk) => `${firstChunk}${secondChunk}`; -var linesStringInfo = { - windowsNewline: "\r\n", - unixNewline: "\n", - LF: "\n", - concatBytes: concatString -}; -var concatUint8Array = (firstChunk, secondChunk) => { - const chunk = new Uint8Array(firstChunk.length + secondChunk.length); - chunk.set(firstChunk, 0); - chunk.set(secondChunk, firstChunk.length); - return chunk; -}; -var linesUint8ArrayInfo = { - windowsNewline: new Uint8Array([13, 10]), - unixNewline: new Uint8Array([10]), - LF: 10, - concatBytes: concatUint8Array -}; - -// node_modules/execa/lib/transform/validate.js -var import_node_buffer = require("node:buffer"); -var getValidateTransformInput = (writableObjectMode, optionName) => writableObjectMode ? void 0 : validateStringTransformInput.bind(void 0, optionName); -var validateStringTransformInput = function* (optionName, chunk) { - if (typeof chunk !== "string" && !isUint8Array(chunk) && !import_node_buffer.Buffer.isBuffer(chunk)) { - throw new TypeError(`The \`${optionName}\` option's transform must use "objectMode: true" to receive as input: ${typeof chunk}.`); - } - yield chunk; -}; -var getValidateTransformReturn = (readableObjectMode, optionName) => readableObjectMode ? validateObjectTransformReturn.bind(void 0, optionName) : validateStringTransformReturn.bind(void 0, optionName); -var validateObjectTransformReturn = function* (optionName, chunk) { - validateEmptyReturn(optionName, chunk); - yield chunk; + } }).prompt(); }; -var validateStringTransformReturn = function* (optionName, chunk) { - validateEmptyReturn(optionName, chunk); - if (typeof chunk !== "string" && !isUint8Array(chunk)) { - throw new TypeError(`The \`${optionName}\` option's function must yield a string or an Uint8Array, not ${typeof chunk}.`); - } - yield chunk; +var b5 = (r3) => r3.replace(ue(), ""); +var ie = (r3 = "", n2 = "") => { + const s2 = ` +${r3} +`.split(` +`), t2 = Math.max(s2.reduce((c3, l3) => (l3 = b5(l3), l3.length > c3 ? l3.length : c3), 0), b5(n2).length) + 2, i3 = s2.map((c3) => `${import_picocolors.default.gray(a2)} ${import_picocolors.default.dim(c3)}${" ".repeat(t2 - b5(c3).length)}${import_picocolors.default.gray(a2)}`).join(` +`); + process.stdout.write(`${import_picocolors.default.gray(a2)} +${import_picocolors.default.green(f2)} ${import_picocolors.default.reset(n2)} ${import_picocolors.default.gray(R5.repeat(Math.max(t2 - n2.length - 1, 1)) + G4)} +${i3} +${import_picocolors.default.gray(H3 + R5.repeat(t2 + 2) + K4)} +`); }; -var validateEmptyReturn = (optionName, chunk) => { - if (chunk === null || chunk === void 0) { - throw new TypeError(`The \`${optionName}\` option's function must not call \`yield ${chunk}\`. -Instead, \`yield\` should either be called with a value, or not be called at all. For example: - if (condition) { yield value; }`); - } +var ae = (r3 = "") => { + process.stdout.write(`${import_picocolors.default.gray(L5)} ${r3} +`); }; +var ce = (r3 = "") => { + process.stdout.write(`${import_picocolors.default.gray(a2)} +${import_picocolors.default.gray(o)} ${r3} -// node_modules/execa/lib/transform/encoding-transform.js -var import_node_buffer2 = require("node:buffer"); -var import_node_string_decoder2 = require("node:string_decoder"); -var getEncodingTransformGenerator = (binary, encoding, skipped) => { - if (skipped) { - return; - } - if (binary) { - return { transform: encodingUint8ArrayGenerator.bind(void 0, new TextEncoder()) }; - } - const stringDecoder = new import_node_string_decoder2.StringDecoder(encoding); - return { - transform: encodingStringGenerator.bind(void 0, stringDecoder), - final: encodingStringFinal.bind(void 0, stringDecoder) - }; -}; -var encodingUint8ArrayGenerator = function* (textEncoder4, chunk) { - if (import_node_buffer2.Buffer.isBuffer(chunk)) { - yield bufferToUint8Array(chunk); - } else if (typeof chunk === "string") { - yield textEncoder4.encode(chunk); - } else { - yield chunk; - } -}; -var encodingStringGenerator = function* (stringDecoder, chunk) { - yield isUint8Array(chunk) ? stringDecoder.write(chunk) : chunk; +`); }; -var encodingStringFinal = function* (stringDecoder) { - const lastChunk = stringDecoder.end(); - if (lastChunk !== "") { - yield lastChunk; - } +var C3 = p2 ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"]; +var le = () => { + let r3, n2; + const s2 = p2 ? 80 : 120; + return { start(t2 = "") { + t2 = t2.replace(/\.?\.?\.$/, ""), r3 = WD(), process.stdout.write(`${import_picocolors.default.gray(a2)} +${import_picocolors.default.magenta("\u25CB")} ${t2} +`); + let i3 = 0, c3 = 0; + n2 = setInterval(() => { + let l3 = C3[i3]; + process.stdout.write(import_sisteransi2.cursor.move(-999, -1)), process.stdout.write(`${import_picocolors.default.magenta(l3)} ${t2}${Math.floor(c3) >= 1 ? ".".repeat(Math.floor(c3)).slice(0, 3) : ""} +`), i3 = i3 === C3.length - 1 ? 0 : i3 + 1, c3 = c3 === C3.length ? 0 : c3 + 0.125; + }, s2); + }, stop(t2 = "") { + process.stdout.write(import_sisteransi2.cursor.move(-999, -2)), process.stdout.write(import_sisteransi2.erase.down(2)), clearInterval(n2), process.stdout.write(`${import_picocolors.default.gray(a2)} +${import_picocolors.default.green(f2)} ${t2} +`), r3(); + } }; }; +function ue() { + const r3 = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|"); + return new RegExp(r3, "g"); +} -// node_modules/execa/lib/transform/run-async.js -var import_node_util6 = require("node:util"); -var pushChunks = (0, import_node_util6.callbackify)(async (getChunks, state2, getChunksArguments, transformStream) => { - state2.currentIterable = getChunks(...getChunksArguments); - try { - for await (const chunk of state2.currentIterable) { - transformStream.push(chunk); - } - } finally { - delete state2.currentIterable; - } -}); -var transformChunk = async function* (chunk, generators, index) { - if (index === generators.length) { - yield chunk; - return; - } - const { transform = identityGenerator } = generators[index]; - for await (const transformedChunk of transform(chunk)) { - yield* transformChunk(transformedChunk, generators, index + 1); - } -}; -var finalChunks = async function* (generators) { - for (const [index, { final }] of Object.entries(generators)) { - yield* generatorFinalChunks(final, Number(index), generators); - } -}; -var generatorFinalChunks = async function* (final, index, generators) { - if (final === void 0) { - return; - } - for await (const finalChunk of final()) { - yield* transformChunk(finalChunk, generators, index + 1); - } -}; -var destroyTransform = (0, import_node_util6.callbackify)(async ({ currentIterable }, error) => { - if (currentIterable !== void 0) { - await (error ? currentIterable.throw(error) : currentIterable.return()); - return; - } - if (error) { - throw error; +// node_modules/chalk/source/vendor/ansi-styles/index.js +var ANSI_BACKGROUND_OFFSET = 10; +var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`; +var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`; +var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`; +var styles = { + modifier: { + reset: [0, 0], + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + overline: [53, 55], + 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], + blackBright: [90, 39], + gray: [90, 39], + grey: [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], + bgBlackBright: [100, 49], + bgGray: [100, 49], + bgGrey: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] } -}); -var identityGenerator = function* (chunk) { - yield chunk; }; - -// node_modules/execa/lib/transform/run-sync.js -var pushChunksSync = (getChunksSync, getChunksArguments, transformStream, done) => { - try { - for (const chunk of getChunksSync(...getChunksArguments)) { - transformStream.push(chunk); +var modifierNames = Object.keys(styles.modifier); +var foregroundColorNames = Object.keys(styles.color); +var backgroundColorNames = Object.keys(styles.bgColor); +var colorNames = [...foregroundColorNames, ...backgroundColorNames]; +function assembleStyles() { + const codes = /* @__PURE__ */ new Map(); + 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]); } - done(); - } catch (error) { - done(error); - } -}; -var runTransformSync = (generators, chunks) => [ - ...chunks.flatMap((chunk) => [...transformChunkSync(chunk, generators, 0)]), - ...finalChunksSync(generators) -]; -var transformChunkSync = function* (chunk, generators, index) { - if (index === generators.length) { - yield chunk; - return; - } - const { transform = identityGenerator2 } = generators[index]; - for (const transformedChunk of transform(chunk)) { - yield* transformChunkSync(transformedChunk, generators, index + 1); - } -}; -var finalChunksSync = function* (generators) { - for (const [index, { final }] of Object.entries(generators)) { - yield* generatorFinalChunksSync(final, Number(index), generators); - } -}; -var generatorFinalChunksSync = function* (final, index, generators) { - if (final === void 0) { - return; + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); } - for (const finalChunk of final()) { - yield* transformChunkSync(finalChunk, generators, index + 1); - } -}; -var identityGenerator2 = function* (chunk) { - yield chunk; -}; - -// node_modules/execa/lib/transform/generator.js -var generatorToStream = ({ - value, - value: { transform, final, writableObjectMode, readableObjectMode }, - optionName -}, { encoding }) => { - const state2 = {}; - const generators = addInternalGenerators(value, encoding, optionName); - const transformAsync = isAsyncGenerator(transform); - const finalAsync = isAsyncGenerator(final); - const transformMethod = transformAsync ? pushChunks.bind(void 0, transformChunk, state2) : pushChunksSync.bind(void 0, transformChunkSync); - const finalMethod = transformAsync || finalAsync ? pushChunks.bind(void 0, finalChunks, state2) : pushChunksSync.bind(void 0, finalChunksSync); - const destroyMethod = transformAsync || finalAsync ? destroyTransform.bind(void 0, state2) : void 0; - const stream4 = new import_node_stream.Transform({ - writableObjectMode, - writableHighWaterMark: (0, import_node_stream.getDefaultHighWaterMark)(writableObjectMode), - readableObjectMode, - readableHighWaterMark: (0, import_node_stream.getDefaultHighWaterMark)(readableObjectMode), - transform(chunk, encoding2, done) { - transformMethod([chunk, generators, 0], this, done); + Object.defineProperty(styles, "codes", { + value: codes, + enumerable: false + }); + styles.color.close = "\x1B[39m"; + styles.bgColor.close = "\x1B[49m"; + styles.color.ansi = wrapAnsi16(); + styles.color.ansi256 = wrapAnsi256(); + styles.color.ansi16m = wrapAnsi16m(); + styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET); + styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET); + Object.defineProperties(styles, { + rgbToAnsi256: { + value(red, green, blue) { + if (red === green && green === blue) { + if (red < 8) { + return 16; + } + if (red > 248) { + return 231; + } + return Math.round((red - 8) / 247 * 24) + 232; + } + return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5); + }, + enumerable: false }, - flush(done) { - finalMethod([generators], this, done); + hexToRgb: { + value(hex) { + const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16)); + if (!matches) { + return [0, 0, 0]; + } + let [colorString] = matches; + if (colorString.length === 3) { + colorString = [...colorString].map((character) => character + character).join(""); + } + const integer = Number.parseInt(colorString, 16); + return [ + integer >> 16 & 255, + integer >> 8 & 255, + integer & 255 + ]; + }, + enumerable: false }, - destroy: destroyMethod - }); - return { stream: stream4 }; -}; -var runGeneratorsSync = (chunks, stdioItems, encoding, isInput) => { - const generators = stdioItems.filter(({ type: type2 }) => type2 === "generator"); - const reversedGenerators = isInput ? generators.reverse() : generators; - for (const { value, optionName } of reversedGenerators) { - const generators2 = addInternalGenerators(value, encoding, optionName); - chunks = runTransformSync(generators2, chunks); - } - return chunks; -}; -var addInternalGenerators = ({ transform, final, binary, writableObjectMode, readableObjectMode, preserveNewlines }, encoding, optionName) => { - const state2 = {}; - return [ - { transform: getValidateTransformInput(writableObjectMode, optionName) }, - getEncodingTransformGenerator(binary, encoding, writableObjectMode), - getSplitLinesGenerator(binary, preserveNewlines, writableObjectMode, state2), - { transform, final }, - { transform: getValidateTransformReturn(readableObjectMode, optionName) }, - getAppendNewlineGenerator({ - binary, - preserveNewlines, - readableObjectMode, - state: state2 - }) - ].filter(Boolean); -}; - -// node_modules/execa/lib/io/input-sync.js -var addInputOptionsSync = (fileDescriptors, options) => { - for (const fdNumber of getInputFdNumbers(fileDescriptors)) { - addInputOptionSync(fileDescriptors, fdNumber, options); - } -}; -var getInputFdNumbers = (fileDescriptors) => new Set(Object.entries(fileDescriptors).filter(([, { direction }]) => direction === "input").map(([fdNumber]) => Number(fdNumber))); -var addInputOptionSync = (fileDescriptors, fdNumber, options) => { - const { stdioItems } = fileDescriptors[fdNumber]; - const allStdioItems = stdioItems.filter(({ contents }) => contents !== void 0); - if (allStdioItems.length === 0) { - return; - } - if (fdNumber !== 0) { - const [{ type: type2, optionName }] = allStdioItems; - throw new TypeError(`Only the \`stdin\` option, not \`${optionName}\`, can be ${TYPE_TO_MESSAGE[type2]} with synchronous methods.`); - } - const allContents = allStdioItems.map(({ contents }) => contents); - const transformedContents = allContents.map((contents) => applySingleInputGeneratorsSync(contents, stdioItems)); - options.input = joinToUint8Array(transformedContents); -}; -var applySingleInputGeneratorsSync = (contents, stdioItems) => { - const newContents = runGeneratorsSync(contents, stdioItems, "utf8", true); - validateSerializable(newContents); - return joinToUint8Array(newContents); -}; -var validateSerializable = (newContents) => { - const invalidItem = newContents.find((item) => typeof item !== "string" && !isUint8Array(item)); - if (invalidItem !== void 0) { - throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${invalidItem}.`); - } -}; - -// node_modules/execa/lib/io/output-sync.js -var import_node_fs5 = require("node:fs"); - -// node_modules/execa/lib/verbose/output.js -var shouldLogOutput = ({ stdioItems, encoding, verboseInfo, fdNumber }) => fdNumber !== "all" && isFullVerbose(verboseInfo, fdNumber) && !BINARY_ENCODINGS.has(encoding) && fdUsesVerbose(fdNumber) && (stdioItems.some(({ type: type2, value }) => type2 === "native" && PIPED_STDIO_VALUES.has(value)) || stdioItems.every(({ type: type2 }) => TRANSFORM_TYPES.has(type2))); -var fdUsesVerbose = (fdNumber) => fdNumber === 1 || fdNumber === 2; -var PIPED_STDIO_VALUES = /* @__PURE__ */ new Set(["pipe", "overlapped"]); -var logLines = async (linesIterable, stream4, fdNumber, verboseInfo) => { - for await (const line of linesIterable) { - if (!isPipingStream(stream4)) { - logLine(line, fdNumber, verboseInfo); + hexToAnsi256: { + value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)), + enumerable: false + }, + ansi256ToAnsi: { + value(code) { + if (code < 8) { + return 30 + code; + } + if (code < 16) { + return 90 + (code - 8); + } + let red; + let green; + let blue; + if (code >= 232) { + red = ((code - 232) * 10 + 8) / 255; + green = red; + blue = red; + } else { + code -= 16; + const remainder = code % 36; + red = Math.floor(code / 36) / 5; + green = Math.floor(remainder / 6) / 5; + blue = remainder % 6 / 5; + } + const value = Math.max(red, green, blue) * 2; + if (value === 0) { + return 30; + } + let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red)); + if (value === 2) { + result += 60; + } + return result; + }, + enumerable: false + }, + rgbToAnsi: { + value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)), + enumerable: false + }, + hexToAnsi: { + value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)), + enumerable: false } - } -}; -var logLinesSync = (linesArray, fdNumber, verboseInfo) => { - for (const line of linesArray) { - logLine(line, fdNumber, verboseInfo); - } -}; -var isPipingStream = (stream4) => stream4._readableState.pipes.length > 0; -var logLine = (line, fdNumber, verboseInfo) => { - const verboseMessage = serializeVerboseMessage(line); - verboseLog({ - type: "output", - verboseMessage, - fdNumber, - verboseInfo }); -}; + return styles; +} +var ansiStyles = assembleStyles(); +var ansi_styles_default = ansiStyles; -// node_modules/execa/lib/io/output-sync.js -var transformOutputSync = ({ fileDescriptors, syncResult: { output }, options, isMaxBuffer, verboseInfo }) => { - if (output === null) { - return { output: Array.from({ length: 3 }) }; - } - const state2 = {}; - const outputFiles = /* @__PURE__ */ new Set([]); - const transformedOutput = output.map((result, fdNumber) => transformOutputResultSync({ - result, - fileDescriptors, - fdNumber, - state: state2, - outputFiles, - isMaxBuffer, - verboseInfo - }, options)); - return { output: transformedOutput, ...state2 }; -}; -var transformOutputResultSync = ({ result, fileDescriptors, fdNumber, state: state2, outputFiles, isMaxBuffer, verboseInfo }, { buffer, encoding, lines, stripFinalNewline: stripFinalNewline2, maxBuffer }) => { - if (result === null) { - return; - } - const truncatedResult = truncateMaxBufferSync(result, isMaxBuffer, maxBuffer); - const uint8ArrayResult = bufferToUint8Array(truncatedResult); - const { stdioItems, objectMode } = fileDescriptors[fdNumber]; - const chunks = runOutputGeneratorsSync([uint8ArrayResult], stdioItems, encoding, state2); - const { serializedResult, finalResult = serializedResult } = serializeChunks({ - chunks, - objectMode, - encoding, - lines, - stripFinalNewline: stripFinalNewline2, - fdNumber - }); - logOutputSync({ - serializedResult, - fdNumber, - state: state2, - verboseInfo, - encoding, - stdioItems, - objectMode - }); - const returnedResult = buffer[fdNumber] ? finalResult : void 0; - try { - if (state2.error === void 0) { - writeToFiles(serializedResult, stdioItems, outputFiles); +// node_modules/chalk/source/vendor/supports-color/index.js +var import_node_process3 = __toESM(require("node:process"), 1); +var import_node_os = __toESM(require("node:os"), 1); +var import_node_tty2 = __toESM(require("node:tty"), 1); +function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : import_node_process3.default.argv) { + const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--"; + const position = argv.indexOf(prefix + flag); + const terminatorPosition = argv.indexOf("--"); + return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition); +} +var { env } = import_node_process3.default; +var flagForceColor; +if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) { + flagForceColor = 0; +} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) { + flagForceColor = 1; +} +function envForceColor() { + if ("FORCE_COLOR" in env) { + if (env.FORCE_COLOR === "true") { + return 1; } - return returnedResult; - } catch (error) { - state2.error = error; - return returnedResult; - } -}; -var runOutputGeneratorsSync = (chunks, stdioItems, encoding, state2) => { - try { - return runGeneratorsSync(chunks, stdioItems, encoding, false); - } catch (error) { - state2.error = error; - return chunks; - } -}; -var serializeChunks = ({ chunks, objectMode, encoding, lines, stripFinalNewline: stripFinalNewline2, fdNumber }) => { - if (objectMode) { - return { serializedResult: chunks }; - } - if (encoding === "buffer") { - return { serializedResult: joinToUint8Array(chunks) }; - } - const serializedResult = joinToString(chunks, encoding); - if (lines[fdNumber]) { - return { serializedResult, finalResult: splitLinesSync(serializedResult, !stripFinalNewline2[fdNumber], objectMode) }; - } - return { serializedResult }; -}; -var logOutputSync = ({ serializedResult, fdNumber, state: state2, verboseInfo, encoding, stdioItems, objectMode }) => { - if (!shouldLogOutput({ - stdioItems, - encoding, - verboseInfo, - fdNumber - })) { - return; - } - const linesArray = splitLinesSync(serializedResult, false, objectMode); - try { - logLinesSync(linesArray, fdNumber, verboseInfo); - } catch (error) { - state2.error ??= error; - } -}; -var writeToFiles = (serializedResult, stdioItems, outputFiles) => { - for (const { path: path7 } of stdioItems.filter(({ type: type2 }) => FILE_TYPES.has(type2))) { - const pathString = typeof path7 === "string" ? path7 : path7.toString(); - if (outputFiles.has(pathString)) { - (0, import_node_fs5.appendFileSync)(path7, serializedResult); - } else { - outputFiles.add(pathString); - (0, import_node_fs5.writeFileSync)(path7, serializedResult); + if (env.FORCE_COLOR === "false") { + return 0; } + return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3); } -}; - -// node_modules/execa/lib/resolve/all-sync.js -var getAllSync = ([, stdout, stderr2], options) => { - if (!options.all) { - return; - } - if (stdout === void 0) { - return stderr2; - } - if (stderr2 === void 0) { - return stdout; - } - if (Array.isArray(stdout)) { - return Array.isArray(stderr2) ? [...stdout, ...stderr2] : [...stdout, stripNewline(stderr2, options, "all")]; - } - if (Array.isArray(stderr2)) { - return [stripNewline(stdout, options, "all"), ...stderr2]; - } - if (isUint8Array(stdout) && isUint8Array(stderr2)) { - return concatUint8Arrays([stdout, stderr2]); - } - return `${stdout}${stderr2}`; -}; - -// node_modules/execa/lib/resolve/exit-async.js -var import_node_events7 = require("node:events"); -var waitForExit = async (subprocess, context) => { - const [exitCode, signal] = await waitForExitOrError(subprocess); - context.isForcefullyTerminated ??= false; - return [exitCode, signal]; -}; -var waitForExitOrError = async (subprocess) => { - const [spawnPayload, exitPayload] = await Promise.allSettled([ - (0, import_node_events7.once)(subprocess, "spawn"), - (0, import_node_events7.once)(subprocess, "exit") - ]); - if (spawnPayload.status === "rejected") { - return []; - } - return exitPayload.status === "rejected" ? waitForSubprocessExit(subprocess) : exitPayload.value; -}; -var waitForSubprocessExit = async (subprocess) => { - try { - return await (0, import_node_events7.once)(subprocess, "exit"); - } catch { - return waitForSubprocessExit(subprocess); - } -}; -var waitForSuccessfulExit = async (exitPromise) => { - const [exitCode, signal] = await exitPromise; - if (!isSubprocessErrorExit(exitCode, signal) && isFailedExit(exitCode, signal)) { - throw new DiscardedError(); - } - return [exitCode, signal]; -}; -var isSubprocessErrorExit = (exitCode, signal) => exitCode === void 0 && signal === void 0; -var isFailedExit = (exitCode, signal) => exitCode !== 0 || signal !== null; - -// node_modules/execa/lib/resolve/exit-sync.js -var getExitResultSync = ({ error, status: exitCode, signal, output }, { maxBuffer }) => { - const resultError = getResultError(error, exitCode, signal); - const timedOut = resultError?.code === "ETIMEDOUT"; - const isMaxBuffer = isMaxBufferSync(resultError, output, maxBuffer); - return { - resultError, - exitCode, - signal, - timedOut, - isMaxBuffer - }; -}; -var getResultError = (error, exitCode, signal) => { - if (error !== void 0) { - return error; +} +function translateLevel(level) { + if (level === 0) { + return false; } - return isFailedExit(exitCode, signal) ? new DiscardedError() : void 0; -}; - -// node_modules/execa/lib/methods/main-sync.js -var execaCoreSync = (rawFile, rawArguments, rawOptions) => { - const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleSyncArguments(rawFile, rawArguments, rawOptions); - const result = spawnSubprocessSync({ - file, - commandArguments, - options, - command, - escapedCommand, - verboseInfo, - fileDescriptors, - startTime - }); - return handleResult(result, verboseInfo, options); -}; -var handleSyncArguments = (rawFile, rawArguments, rawOptions) => { - const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions); - const syncOptions = normalizeSyncOptions(rawOptions); - const { file, commandArguments, options } = normalizeOptions(rawFile, rawArguments, syncOptions); - validateSyncOptions(options); - const fileDescriptors = handleStdioSync(options, verboseInfo); return { - file, - commandArguments, - command, - escapedCommand, - startTime, - verboseInfo, - options, - fileDescriptors + level, + hasBasic: true, + has256: level >= 2, + has16m: level >= 3 }; -}; -var normalizeSyncOptions = (options) => options.node && !options.ipc ? { ...options, ipc: false } : options; -var validateSyncOptions = ({ ipc, ipcInput, detached, cancelSignal }) => { - if (ipcInput) { - throwInvalidSyncOption("ipcInput"); - } - if (ipc) { - throwInvalidSyncOption("ipc: true"); +} +function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) { + const noFlagForceColor = envForceColor(); + if (noFlagForceColor !== void 0) { + flagForceColor = noFlagForceColor; } - if (detached) { - throwInvalidSyncOption("detached: true"); + const forceColor = sniffFlags ? flagForceColor : noFlagForceColor; + if (forceColor === 0) { + return 0; } - if (cancelSignal) { - throwInvalidSyncOption("cancelSignal"); + if (sniffFlags) { + if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) { + return 3; + } + if (hasFlag("color=256")) { + return 2; + } } -}; -var throwInvalidSyncOption = (value) => { - throw new TypeError(`The "${value}" option cannot be used with synchronous methods.`); -}; -var spawnSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, verboseInfo, fileDescriptors, startTime }) => { - const syncResult = runSubprocessSync({ - file, - commandArguments, - options, - command, - escapedCommand, - fileDescriptors, - startTime - }); - if (syncResult.failed) { - return syncResult; - } - const { resultError, exitCode, signal, timedOut, isMaxBuffer } = getExitResultSync(syncResult, options); - const { output, error = resultError } = transformOutputSync({ - fileDescriptors, - syncResult, - options, - isMaxBuffer, - verboseInfo - }); - const stdio = output.map((stdioOutput, fdNumber) => stripNewline(stdioOutput, options, fdNumber)); - const all3 = stripNewline(getAllSync(output, options), options, "all"); - return getSyncResult({ - error, - exitCode, - signal, - timedOut, - isMaxBuffer, - stdio, - all: all3, - options, - command, - escapedCommand, - startTime - }); -}; -var runSubprocessSync = ({ file, commandArguments, options, command, escapedCommand, fileDescriptors, startTime }) => { - try { - addInputOptionsSync(fileDescriptors, options); - const normalizedOptions = normalizeSpawnSyncOptions(options); - return (0, import_node_child_process2.spawnSync)(file, commandArguments, normalizedOptions); - } catch (error) { - return makeEarlyError({ - error, - command, - escapedCommand, - fileDescriptors, - options, - startTime, - isSync: true - }); + if ("TF_BUILD" in env && "AGENT_NAME" in env) { + return 1; } -}; -var normalizeSpawnSyncOptions = ({ encoding, maxBuffer, ...options }) => ({ ...options, encoding: "buffer", maxBuffer: getMaxBufferSync(maxBuffer) }); -var getSyncResult = ({ error, exitCode, signal, timedOut, isMaxBuffer, stdio, all: all3, options, command, escapedCommand, startTime }) => error === void 0 ? makeSuccessResult({ - command, - escapedCommand, - stdio, - all: all3, - ipcOutput: [], - options, - startTime -}) : makeError({ - error, - command, - escapedCommand, - timedOut, - isCanceled: false, - isGracefullyCanceled: false, - isMaxBuffer, - isForcefullyTerminated: false, - exitCode, - signal, - stdio, - all: all3, - ipcOutput: [], - options, - startTime, - isSync: true -}); - -// node_modules/execa/lib/methods/main-async.js -var import_node_events14 = require("node:events"); -var import_node_child_process4 = require("node:child_process"); - -// node_modules/execa/lib/ipc/methods.js -var import_node_process13 = __toESM(require("node:process"), 1); - -// node_modules/execa/lib/ipc/get-one.js -var import_node_events8 = require("node:events"); -var getOneMessage = ({ anyProcess, channel, isSubprocess, ipc }, { reference = true, filter: filter2 } = {}) => { - validateIpcMethod({ - methodName: "getOneMessage", - isSubprocess, - ipc, - isConnected: isConnected(anyProcess) - }); - return getOneMessageAsync({ - anyProcess, - channel, - isSubprocess, - filter: filter2, - reference - }); -}; -var getOneMessageAsync = async ({ anyProcess, channel, isSubprocess, filter: filter2, reference }) => { - addReference(channel, reference); - const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess); - const controller = new AbortController(); - try { - return await Promise.race([ - getMessage(ipcEmitter, filter2, controller), - throwOnDisconnect2(ipcEmitter, isSubprocess, controller), - throwOnStrictError(ipcEmitter, isSubprocess, controller) - ]); - } catch (error) { - disconnect(anyProcess); - throw error; - } finally { - controller.abort(); - removeReference(channel, reference); + if (haveStream && !streamIsTTY && forceColor === void 0) { + return 0; } -}; -var getMessage = async (ipcEmitter, filter2, { signal }) => { - if (filter2 === void 0) { - const [message] = await (0, import_node_events8.once)(ipcEmitter, "message", { signal }); - return message; + const min = forceColor || 0; + if (env.TERM === "dumb") { + return min; } - for await (const [message] of (0, import_node_events8.on)(ipcEmitter, "message", { signal })) { - if (filter2(message)) { - return message; + if (import_node_process3.default.platform === "win32") { + const osRelease = import_node_os.default.release().split("."); + if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) { + return Number(osRelease[2]) >= 14931 ? 3 : 2; } + return 1; } -}; -var throwOnDisconnect2 = async (ipcEmitter, isSubprocess, { signal }) => { - await (0, import_node_events8.once)(ipcEmitter, "disconnect", { signal }); - throwOnEarlyDisconnect(isSubprocess); -}; -var throwOnStrictError = async (ipcEmitter, isSubprocess, { signal }) => { - const [error] = await (0, import_node_events8.once)(ipcEmitter, "strict:error", { signal }); - throw getStrictResponseError(error, isSubprocess); -}; - -// node_modules/execa/lib/ipc/get-each.js -var import_node_events9 = require("node:events"); -var getEachMessage = ({ anyProcess, channel, isSubprocess, ipc }, { reference = true } = {}) => loopOnMessages({ - anyProcess, - channel, - isSubprocess, - ipc, - shouldAwait: !isSubprocess, - reference -}); -var loopOnMessages = ({ anyProcess, channel, isSubprocess, ipc, shouldAwait, reference }) => { - validateIpcMethod({ - methodName: "getEachMessage", - isSubprocess, - ipc, - isConnected: isConnected(anyProcess) - }); - addReference(channel, reference); - const ipcEmitter = getIpcEmitter(anyProcess, channel, isSubprocess); - const controller = new AbortController(); - const state2 = {}; - stopOnDisconnect(anyProcess, ipcEmitter, controller); - abortOnStrictError({ - ipcEmitter, - isSubprocess, - controller, - state: state2 - }); - return iterateOnMessages({ - anyProcess, - channel, - ipcEmitter, - isSubprocess, - shouldAwait, - controller, - state: state2, - reference - }); -}; -var stopOnDisconnect = async (anyProcess, ipcEmitter, controller) => { - try { - await (0, import_node_events9.once)(ipcEmitter, "disconnect", { signal: controller.signal }); - controller.abort(); - } catch { - } -}; -var abortOnStrictError = async ({ ipcEmitter, isSubprocess, controller, state: state2 }) => { - try { - const [error] = await (0, import_node_events9.once)(ipcEmitter, "strict:error", { signal: controller.signal }); - state2.error = getStrictResponseError(error, isSubprocess); - controller.abort(); - } catch { - } -}; -var iterateOnMessages = async function* ({ anyProcess, channel, ipcEmitter, isSubprocess, shouldAwait, controller, state: state2, reference }) { - try { - for await (const [message] of (0, import_node_events9.on)(ipcEmitter, "message", { signal: controller.signal })) { - throwIfStrictError(state2); - yield message; - } - } catch { - throwIfStrictError(state2); - } finally { - controller.abort(); - removeReference(channel, reference); - if (!isSubprocess) { - disconnect(anyProcess); + if ("CI" in env) { + if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) { + return 3; } - if (shouldAwait) { - await anyProcess; + if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") { + return 1; } + return min; } -}; -var throwIfStrictError = ({ error }) => { - if (error) { - throw error; + if ("TEAMCITY_VERSION" in env) { + return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0; } -}; - -// node_modules/execa/lib/ipc/methods.js -var addIpcMethods = (subprocess, { ipc }) => { - Object.assign(subprocess, getIpcMethods(subprocess, false, ipc)); -}; -var getIpcExport = () => { - const anyProcess = import_node_process13.default; - const isSubprocess = true; - const ipc = import_node_process13.default.channel !== void 0; - return { - ...getIpcMethods(anyProcess, isSubprocess, ipc), - getCancelSignal: getCancelSignal.bind(void 0, { - anyProcess, - channel: anyProcess.channel, - isSubprocess, - ipc - }) - }; -}; -var getIpcMethods = (anyProcess, isSubprocess, ipc) => ({ - sendMessage: sendMessage.bind(void 0, { - anyProcess, - channel: anyProcess.channel, - isSubprocess, - ipc - }), - getOneMessage: getOneMessage.bind(void 0, { - anyProcess, - channel: anyProcess.channel, - isSubprocess, - ipc - }), - getEachMessage: getEachMessage.bind(void 0, { - anyProcess, - channel: anyProcess.channel, - isSubprocess, - ipc - }) -}); - -// node_modules/execa/lib/return/early-error.js -var import_node_child_process3 = require("node:child_process"); -var import_node_stream2 = require("node:stream"); -var handleEarlyError = ({ error, command, escapedCommand, fileDescriptors, options, startTime, verboseInfo }) => { - cleanupCustomStreams(fileDescriptors); - const subprocess = new import_node_child_process3.ChildProcess(); - createDummyStreams(subprocess, fileDescriptors); - Object.assign(subprocess, { readable, writable, duplex }); - const earlyError = makeEarlyError({ - error, - command, - escapedCommand, - fileDescriptors, - options, - startTime, - isSync: false - }); - const promise = handleDummyPromise(earlyError, verboseInfo, options); - return { subprocess, promise }; -}; -var createDummyStreams = (subprocess, fileDescriptors) => { - const stdin = createDummyStream(); - const stdout = createDummyStream(); - const stderr2 = createDummyStream(); - const extraStdio = Array.from({ length: fileDescriptors.length - 3 }, createDummyStream); - const all3 = createDummyStream(); - const stdio = [stdin, stdout, stderr2, ...extraStdio]; - Object.assign(subprocess, { - stdin, - stdout, - stderr: stderr2, - all: all3, - stdio - }); -}; -var createDummyStream = () => { - const stream4 = new import_node_stream2.PassThrough(); - stream4.end(); - return stream4; -}; -var readable = () => new import_node_stream2.Readable({ read() { -} }); -var writable = () => new import_node_stream2.Writable({ write() { -} }); -var duplex = () => new import_node_stream2.Duplex({ read() { -}, write() { -} }); -var handleDummyPromise = async (error, verboseInfo, options) => handleResult(error, verboseInfo, options); - -// node_modules/execa/lib/stdio/handle-async.js -var import_node_fs6 = require("node:fs"); -var import_node_buffer3 = require("node:buffer"); -var import_node_stream3 = require("node:stream"); -var handleStdioAsync = (options, verboseInfo) => handleStdio(addPropertiesAsync, options, verboseInfo, false); -var forbiddenIfAsync = ({ type: type2, optionName }) => { - throw new TypeError(`The \`${optionName}\` option cannot be ${TYPE_TO_MESSAGE[type2]}.`); -}; -var addProperties2 = { - fileNumber: forbiddenIfAsync, - generator: generatorToStream, - asyncGenerator: generatorToStream, - nodeStream: ({ value }) => ({ stream: value }), - webTransform({ value: { transform, writableObjectMode, readableObjectMode } }) { - const objectMode = writableObjectMode || readableObjectMode; - const stream4 = import_node_stream3.Duplex.fromWeb(transform, { objectMode }); - return { stream: stream4 }; - }, - duplex: ({ value: { transform } }) => ({ stream: transform }), - native() { - } -}; -var addPropertiesAsync = { - input: { - ...addProperties2, - fileUrl: ({ value }) => ({ stream: (0, import_node_fs6.createReadStream)(value) }), - filePath: ({ value: { file } }) => ({ stream: (0, import_node_fs6.createReadStream)(file) }), - webStream: ({ value }) => ({ stream: import_node_stream3.Readable.fromWeb(value) }), - iterable: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }), - asyncIterable: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }), - string: ({ value }) => ({ stream: import_node_stream3.Readable.from(value) }), - uint8Array: ({ value }) => ({ stream: import_node_stream3.Readable.from(import_node_buffer3.Buffer.from(value)) }) - }, - output: { - ...addProperties2, - fileUrl: ({ value }) => ({ stream: (0, import_node_fs6.createWriteStream)(value) }), - filePath: ({ value: { file } }) => ({ stream: (0, import_node_fs6.createWriteStream)(file) }), - webStream: ({ value }) => ({ stream: import_node_stream3.Writable.fromWeb(value) }), - iterable: forbiddenIfAsync, - asyncIterable: forbiddenIfAsync, - string: forbiddenIfAsync, - uint8Array: forbiddenIfAsync + if (env.COLORTERM === "truecolor") { + return 3; } -}; - -// node_modules/@sindresorhus/merge-streams/index.js -var import_node_events10 = require("node:events"); -var import_node_stream4 = require("node:stream"); -var import_promises6 = require("node:stream/promises"); -function mergeStreams(streams) { - if (!Array.isArray(streams)) { - throw new TypeError(`Expected an array, got \`${typeof streams}\`.`); - } - for (const stream4 of streams) { - validateStream(stream4); - } - const objectMode = streams.some(({ readableObjectMode }) => readableObjectMode); - const highWaterMark = getHighWaterMark(streams, objectMode); - const passThroughStream = new MergedStream({ - objectMode, - writableHighWaterMark: highWaterMark, - readableHighWaterMark: highWaterMark - }); - for (const stream4 of streams) { - passThroughStream.add(stream4); - } - return passThroughStream; -} -var getHighWaterMark = (streams, objectMode) => { - if (streams.length === 0) { - return (0, import_node_stream4.getDefaultHighWaterMark)(objectMode); - } - const highWaterMarks = streams.filter(({ readableObjectMode }) => readableObjectMode === objectMode).map(({ readableHighWaterMark }) => readableHighWaterMark); - return Math.max(...highWaterMarks); -}; -var MergedStream = class extends import_node_stream4.PassThrough { - #streams = /* @__PURE__ */ new Set([]); - #ended = /* @__PURE__ */ new Set([]); - #aborted = /* @__PURE__ */ new Set([]); - #onFinished; - #unpipeEvent = Symbol("unpipe"); - #streamPromises = /* @__PURE__ */ new WeakMap(); - add(stream4) { - validateStream(stream4); - if (this.#streams.has(stream4)) { - return; - } - this.#streams.add(stream4); - this.#onFinished ??= onMergedStreamFinished(this, this.#streams, this.#unpipeEvent); - const streamPromise = endWhenStreamsDone({ - passThroughStream: this, - stream: stream4, - streams: this.#streams, - ended: this.#ended, - aborted: this.#aborted, - onFinished: this.#onFinished, - unpipeEvent: this.#unpipeEvent - }); - this.#streamPromises.set(stream4, streamPromise); - stream4.pipe(this, { end: false }); + if (env.TERM === "xterm-kitty") { + return 3; } - async remove(stream4) { - validateStream(stream4); - if (!this.#streams.has(stream4)) { - return false; - } - const streamPromise = this.#streamPromises.get(stream4); - if (streamPromise === void 0) { - return false; + if ("TERM_PROGRAM" in env) { + const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + switch (env.TERM_PROGRAM) { + case "iTerm.app": { + return version >= 3 ? 3 : 2; + } + case "Apple_Terminal": { + return 2; + } } - this.#streamPromises.delete(stream4); - stream4.unpipe(this); - await streamPromise; - return true; } -}; -var onMergedStreamFinished = async (passThroughStream, streams, unpipeEvent) => { - updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_COUNT); - const controller = new AbortController(); - try { - await Promise.race([ - onMergedStreamEnd(passThroughStream, controller), - onInputStreamsUnpipe(passThroughStream, streams, unpipeEvent, controller) - ]); - } finally { - controller.abort(); - updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_COUNT); + if (/-256(color)?$/i.test(env.TERM)) { + return 2; } -}; -var onMergedStreamEnd = async (passThroughStream, { signal }) => { - try { - await (0, import_promises6.finished)(passThroughStream, { signal, cleanup: true }); - } catch (error) { - errorOrAbortStream(passThroughStream, error); - throw error; + if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) { + return 1; } -}; -var onInputStreamsUnpipe = async (passThroughStream, streams, unpipeEvent, { signal }) => { - for await (const [unpipedStream] of (0, import_node_events10.on)(passThroughStream, "unpipe", { signal })) { - if (streams.has(unpipedStream)) { - unpipedStream.emit(unpipeEvent); - } + if ("COLORTERM" in env) { + return 1; } + return min; +} +function createSupportsColor(stream4, options = {}) { + const level = _supportsColor(stream4, { + streamIsTTY: stream4 && stream4.isTTY, + ...options + }); + return translateLevel(level); +} +var supportsColor = { + stdout: createSupportsColor({ isTTY: import_node_tty2.default.isatty(1) }), + stderr: createSupportsColor({ isTTY: import_node_tty2.default.isatty(2) }) }; -var validateStream = (stream4) => { - if (typeof stream4?.pipe !== "function") { - throw new TypeError(`Expected a readable stream, got: \`${typeof stream4}\`.`); +var supports_color_default = supportsColor; + +// node_modules/chalk/source/utilities.js +function stringReplaceAll(string, substring, replacer) { + let index = string.indexOf(substring); + if (index === -1) { + return string; } -}; -var endWhenStreamsDone = async ({ passThroughStream, stream: stream4, streams, ended, aborted: aborted2, onFinished, unpipeEvent }) => { - updateMaxListeners(passThroughStream, PASSTHROUGH_LISTENERS_PER_STREAM); - const controller = new AbortController(); - try { - await Promise.race([ - afterMergedStreamFinished(onFinished, stream4, controller), - onInputStreamEnd({ - passThroughStream, - stream: stream4, - streams, - ended, - aborted: aborted2, - controller - }), - onInputStreamUnpipe({ - stream: stream4, - streams, - ended, - aborted: aborted2, - unpipeEvent, - controller - }) - ]); - } finally { - controller.abort(); - updateMaxListeners(passThroughStream, -PASSTHROUGH_LISTENERS_PER_STREAM); + const substringLength = substring.length; + let endIndex = 0; + let returnValue = ""; + do { + returnValue += string.slice(endIndex, index) + substring + replacer; + endIndex = index + substringLength; + index = string.indexOf(substring, endIndex); + } while (index !== -1); + returnValue += string.slice(endIndex); + return returnValue; +} +function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) { + let endIndex = 0; + let returnValue = ""; + do { + const gotCR = string[index - 1] === "\r"; + returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix; + endIndex = index + 1; + index = string.indexOf("\n", endIndex); + } while (index !== -1); + returnValue += string.slice(endIndex); + return returnValue; +} + +// node_modules/chalk/source/index.js +var { stdout: stdoutColor, stderr: stderrColor } = supports_color_default; +var GENERATOR = Symbol("GENERATOR"); +var STYLER = Symbol("STYLER"); +var IS_EMPTY = Symbol("IS_EMPTY"); +var levelMapping = [ + "ansi", + "ansi", + "ansi256", + "ansi16m" +]; +var styles2 = /* @__PURE__ */ Object.create(null); +var applyOptions = (object, options = {}) => { + if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) { + throw new Error("The `level` option should be an integer from 0 to 3"); } - if (streams.size > 0 && streams.size === ended.size + aborted2.size) { - if (ended.size === 0 && aborted2.size > 0) { - abortStream(passThroughStream); - } else { - endStream(passThroughStream); + const colorLevel = stdoutColor ? stdoutColor.level : 0; + object.level = options.level === void 0 ? colorLevel : options.level; +}; +var chalkFactory = (options) => { + const chalk2 = (...strings) => strings.join(" "); + applyOptions(chalk2, options); + Object.setPrototypeOf(chalk2, createChalk.prototype); + return chalk2; +}; +function createChalk(options) { + return chalkFactory(options); +} +Object.setPrototypeOf(createChalk.prototype, Function.prototype); +for (const [styleName, style] of Object.entries(ansi_styles_default)) { + styles2[styleName] = { + get() { + const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]); + Object.defineProperty(this, styleName, { value: builder }); + return builder; } + }; +} +styles2.visible = { + get() { + const builder = createBuilder(this, this[STYLER], true); + Object.defineProperty(this, "visible", { value: builder }); + return builder; } }; -var afterMergedStreamFinished = async (onFinished, stream4, { signal }) => { - try { - await onFinished; - if (!signal.aborted) { - abortStream(stream4); +var getModelAnsi = (model, level, type2, ...arguments_) => { + if (model === "rgb") { + if (level === "ansi16m") { + return ansi_styles_default[type2].ansi16m(...arguments_); } - } catch (error) { - if (!signal.aborted) { - errorOrAbortStream(stream4, error); + if (level === "ansi256") { + return ansi_styles_default[type2].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_)); } + return ansi_styles_default[type2].ansi(ansi_styles_default.rgbToAnsi(...arguments_)); + } + if (model === "hex") { + return getModelAnsi("rgb", level, type2, ...ansi_styles_default.hexToRgb(...arguments_)); } + return ansi_styles_default[type2][model](...arguments_); }; -var onInputStreamEnd = async ({ passThroughStream, stream: stream4, streams, ended, aborted: aborted2, controller: { signal } }) => { - try { - await (0, import_promises6.finished)(stream4, { - signal, - cleanup: true, - readable: true, - writable: false - }); - if (streams.has(stream4)) { - ended.add(stream4); +var usedModels = ["rgb", "hex", "ansi256"]; +for (const model of usedModels) { + styles2[model] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); + }; } - } catch (error) { - if (signal.aborted || !streams.has(stream4)) { - return; + }; + const bgModel = "bg" + model[0].toUpperCase() + model.slice(1); + styles2[bgModel] = { + get() { + const { level } = this; + return function(...arguments_) { + const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]); + return createBuilder(this, styler, this[IS_EMPTY]); + }; } - if (isAbortError(error)) { - aborted2.add(stream4); - } else { - errorStream(passThroughStream, error); + }; +} +var proto = Object.defineProperties(() => { +}, { + ...styles2, + level: { + enumerable: true, + get() { + return this[GENERATOR].level; + }, + set(level) { + this[GENERATOR].level = level; } } -}; -var onInputStreamUnpipe = async ({ stream: stream4, streams, ended, aborted: aborted2, unpipeEvent, controller: { signal } }) => { - await (0, import_node_events10.once)(stream4, unpipeEvent, { signal }); - if (!stream4.readable) { - return (0, import_node_events10.once)(signal, "abort", { signal }); +}); +var createStyler = (open, close, parent) => { + let openAll; + let closeAll; + if (parent === void 0) { + openAll = open; + closeAll = close; + } else { + openAll = parent.openAll + open; + closeAll = close + parent.closeAll; } - streams.delete(stream4); - ended.delete(stream4); - aborted2.delete(stream4); + return { + open, + close, + openAll, + closeAll, + parent + }; }; -var endStream = (stream4) => { - if (stream4.writable) { - stream4.end(); - } +var createBuilder = (self2, _styler, _isEmpty) => { + const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" ")); + Object.setPrototypeOf(builder, proto); + builder[GENERATOR] = self2; + builder[STYLER] = _styler; + builder[IS_EMPTY] = _isEmpty; + return builder; }; -var errorOrAbortStream = (stream4, error) => { - if (isAbortError(error)) { - abortStream(stream4); - } else { - errorStream(stream4, error); +var applyStyle = (self2, string) => { + if (self2.level <= 0 || !string) { + return self2[IS_EMPTY] ? "" : string; } -}; -var isAbortError = (error) => error?.code === "ERR_STREAM_PREMATURE_CLOSE"; -var abortStream = (stream4) => { - if (stream4.readable || stream4.writable) { - stream4.destroy(); + let styler = self2[STYLER]; + if (styler === void 0) { + return string; } -}; -var errorStream = (stream4, error) => { - if (!stream4.destroyed) { - stream4.once("error", noop2); - stream4.destroy(error); + const { openAll, closeAll } = styler; + if (string.includes("\x1B")) { + while (styler !== void 0) { + string = stringReplaceAll(string, styler.close, styler.open); + styler = styler.parent; + } } -}; -var noop2 = () => { -}; -var updateMaxListeners = (passThroughStream, increment2) => { - const maxListeners = passThroughStream.getMaxListeners(); - if (maxListeners !== 0 && maxListeners !== Number.POSITIVE_INFINITY) { - passThroughStream.setMaxListeners(maxListeners + increment2); + const lfIndex = string.indexOf("\n"); + if (lfIndex !== -1) { + string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex); } + return openAll + string + closeAll; }; -var PASSTHROUGH_LISTENERS_COUNT = 2; -var PASSTHROUGH_LISTENERS_PER_STREAM = 1; +Object.defineProperties(createChalk.prototype, styles2); +var chalk = createChalk(); +var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 }); +var source_default = chalk; -// node_modules/execa/lib/io/pipeline.js -var import_promises7 = require("node:stream/promises"); -var pipeStreams = (source, destination) => { - source.pipe(destination); - onSourceFinish(source, destination); - onDestinationFinish(source, destination); -}; -var onSourceFinish = async (source, destination) => { - if (isStandardStream(source) || isStandardStream(destination)) { - return; +// node_modules/execa/index.js +var import_node_buffer2 = require("node:buffer"); +var import_node_path2 = __toESM(require("node:path"), 1); +var import_node_child_process3 = __toESM(require("node:child_process"), 1); +var import_node_process7 = __toESM(require("node:process"), 1); +var import_cross_spawn = __toESM(require_cross_spawn(), 1); + +// node_modules/execa/node_modules/strip-final-newline/index.js +function stripFinalNewline(input) { + const LF = typeof input === "string" ? "\n" : "\n".charCodeAt(); + const CR = typeof input === "string" ? "\r" : "\r".charCodeAt(); + if (input[input.length - 1] === LF) { + input = input.slice(0, -1); } - try { - await (0, import_promises7.finished)(source, { cleanup: true, readable: true, writable: false }); - } catch { + if (input[input.length - 1] === CR) { + input = input.slice(0, -1); } - endDestinationStream(destination); -}; -var endDestinationStream = (destination) => { - if (destination.writable) { - destination.end(); + return input; +} + +// node_modules/npm-run-path/index.js +var import_node_process4 = __toESM(require("node:process"), 1); +var import_node_path = __toESM(require("node:path"), 1); +var import_node_url = require("node:url"); + +// node_modules/npm-run-path/node_modules/path-key/index.js +function pathKey(options = {}) { + const { + env: env2 = process.env, + platform = process.platform + } = options; + if (platform !== "win32") { + return "PATH"; } -}; -var onDestinationFinish = async (source, destination) => { - if (isStandardStream(source) || isStandardStream(destination)) { - return; + return Object.keys(env2).reverse().find((key) => key.toUpperCase() === "PATH") || "Path"; +} + +// node_modules/npm-run-path/index.js +var npmRunPath = ({ + cwd = import_node_process4.default.cwd(), + path: pathOption = import_node_process4.default.env[pathKey()], + preferLocal = true, + execPath = import_node_process4.default.execPath, + addExecPath = true +} = {}) => { + const cwdString = cwd instanceof URL ? (0, import_node_url.fileURLToPath)(cwd) : cwd; + const cwdPath = import_node_path.default.resolve(cwdString); + const result = []; + if (preferLocal) { + applyPreferLocal(result, cwdPath); } - try { - await (0, import_promises7.finished)(destination, { cleanup: true, readable: false, writable: true }); - } catch { + if (addExecPath) { + applyExecPath(result, execPath, cwdPath); } - abortSourceStream(source); + return [...result, pathOption].join(import_node_path.default.delimiter); }; -var abortSourceStream = (source) => { - if (source.readable) { - source.destroy(); +var applyPreferLocal = (result, cwdPath) => { + let previous; + while (previous !== cwdPath) { + result.push(import_node_path.default.join(cwdPath, "node_modules/.bin")); + previous = cwdPath; + cwdPath = import_node_path.default.resolve(cwdPath, ".."); } }; +var applyExecPath = (result, execPath, cwdPath) => { + const execPathString = execPath instanceof URL ? (0, import_node_url.fileURLToPath)(execPath) : execPath; + result.push(import_node_path.default.resolve(cwdPath, execPathString, "..")); +}; +var npmRunPathEnv = ({ env: env2 = import_node_process4.default.env, ...options } = {}) => { + env2 = { ...env2 }; + const pathName = pathKey({ env: env2 }); + options.path = env2[pathName]; + env2[pathName] = npmRunPath(options); + return env2; +}; -// node_modules/execa/lib/io/output-async.js -var pipeOutputAsync = (subprocess, fileDescriptors, controller) => { - const pipeGroups = /* @__PURE__ */ new Map(); - for (const [fdNumber, { stdioItems, direction }] of Object.entries(fileDescriptors)) { - for (const { stream: stream4 } of stdioItems.filter(({ type: type2 }) => TRANSFORM_TYPES.has(type2))) { - pipeTransform(subprocess, stream4, direction, fdNumber); - } - for (const { stream: stream4 } of stdioItems.filter(({ type: type2 }) => !TRANSFORM_TYPES.has(type2))) { - pipeStdioItem({ - subprocess, - stream: stream4, - direction, - fdNumber, - pipeGroups, - controller - }); - } - } - for (const [outputStream, inputStreams] of pipeGroups.entries()) { - const inputStream = inputStreams.length === 1 ? inputStreams[0] : mergeStreams(inputStreams); - pipeStreams(inputStream, outputStream); +// node_modules/mimic-fn/index.js +var copyProperty = (to, from, property, ignoreNonConfigurable) => { + if (property === "length" || property === "prototype") { + return; } -}; -var pipeTransform = (subprocess, stream4, direction, fdNumber) => { - if (direction === "output") { - pipeStreams(subprocess.stdio[fdNumber], stream4); - } else { - pipeStreams(stream4, subprocess.stdio[fdNumber]); + if (property === "arguments" || property === "caller") { + return; } - const streamProperty = SUBPROCESS_STREAM_PROPERTIES[fdNumber]; - if (streamProperty !== void 0) { - subprocess[streamProperty] = stream4; + const toDescriptor = Object.getOwnPropertyDescriptor(to, property); + const fromDescriptor = Object.getOwnPropertyDescriptor(from, property); + if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) { + return; } - subprocess.stdio[fdNumber] = stream4; + Object.defineProperty(to, property, fromDescriptor); +}; +var canCopyProperty = function(toDescriptor, fromDescriptor) { + return toDescriptor === void 0 || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value); }; -var SUBPROCESS_STREAM_PROPERTIES = ["stdin", "stdout", "stderr"]; -var pipeStdioItem = ({ subprocess, stream: stream4, direction, fdNumber, pipeGroups, controller }) => { - if (stream4 === void 0) { +var changePrototype = (to, from) => { + const fromPrototype = Object.getPrototypeOf(from); + if (fromPrototype === Object.getPrototypeOf(to)) { return; } - setStandardStreamMaxListeners(stream4, controller); - const [inputStream, outputStream] = direction === "output" ? [stream4, subprocess.stdio[fdNumber]] : [subprocess.stdio[fdNumber], stream4]; - const outputStreams = pipeGroups.get(inputStream) ?? []; - pipeGroups.set(inputStream, [...outputStreams, outputStream]); -}; -var setStandardStreamMaxListeners = (stream4, { signal }) => { - if (isStandardStream(stream4)) { - incrementMaxListeners(stream4, MAX_LISTENERS_INCREMENT, signal); - } -}; -var MAX_LISTENERS_INCREMENT = 2; - -// node_modules/execa/lib/terminate/cleanup.js -var import_node_events11 = require("node:events"); - -// node_modules/execa/node_modules/signal-exit/dist/mjs/signals.js -var signals = []; -signals.push("SIGHUP", "SIGINT", "SIGTERM"); -if (process.platform !== "win32") { - signals.push( - "SIGALRM", - "SIGABRT", - "SIGVTALRM", - "SIGXCPU", - "SIGXFSZ", - "SIGUSR2", - "SIGTRAP", - "SIGSYS", - "SIGQUIT", - "SIGIOT" - ); -} -if (process.platform === "linux") { - signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT"); + Object.setPrototypeOf(to, fromPrototype); +}; +var wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/ +${fromBody}`; +var toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, "toString"); +var toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, "name"); +var changeToString = (to, from, name) => { + const withName = name === "" ? "" : `with ${name.trim()}() `; + const newToString = wrappedToString.bind(null, withName, from.toString()); + Object.defineProperty(newToString, "name", toStringName); + Object.defineProperty(to, "toString", { ...toStringDescriptor, value: newToString }); +}; +function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) { + const { name } = to; + for (const property of Reflect.ownKeys(from)) { + copyProperty(to, from, property, ignoreNonConfigurable); + } + changePrototype(to, from); + changeToString(to, from, name); + return to; } -// node_modules/execa/node_modules/signal-exit/dist/mjs/index.js -var processOk = (process13) => !!process13 && typeof process13 === "object" && typeof process13.removeListener === "function" && typeof process13.emit === "function" && typeof process13.reallyExit === "function" && typeof process13.listeners === "function" && typeof process13.kill === "function" && typeof process13.pid === "number" && typeof process13.on === "function"; -var kExitEmitter = Symbol.for("signal-exit emitter"); -var global2 = globalThis; -var ObjectDefineProperty = Object.defineProperty.bind(Object); -var Emitter = class { - emitted = { - afterExit: false, - exit: false - }; - listeners = { - afterExit: [], - exit: [] +// node_modules/onetime/index.js +var calledFunctions = /* @__PURE__ */ new WeakMap(); +var onetime = (function_, options = {}) => { + if (typeof function_ !== "function") { + throw new TypeError("Expected a function"); + } + let returnValue; + let callCount = 0; + const functionName = function_.displayName || function_.name || ""; + const onetime2 = function(...arguments_) { + calledFunctions.set(onetime2, ++callCount); + if (callCount === 1) { + returnValue = function_.apply(this, arguments_); + function_ = null; + } else if (options.throw === true) { + throw new Error(`Function \`${functionName}\` can only be called once`); + } + return returnValue; }; - count = 0; - id = Math.random(); - constructor() { - if (global2[kExitEmitter]) { - return global2[kExitEmitter]; - } - ObjectDefineProperty(global2, kExitEmitter, { - value: this, - writable: false, - enumerable: false, - configurable: false - }); - } - on(ev, fn) { - this.listeners[ev].push(fn); - } - removeListener(ev, fn) { - const list = this.listeners[ev]; - const i4 = list.indexOf(fn); - if (i4 === -1) { - return; - } - if (i4 === 0 && list.length === 1) { - list.length = 0; - } else { - list.splice(i4, 1); - } + mimicFunction(onetime2, function_); + calledFunctions.set(onetime2, callCount); + return onetime2; +}; +onetime.callCount = (function_) => { + if (!calledFunctions.has(function_)) { + throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`); } - emit(ev, code, signal) { - if (this.emitted[ev]) { - return false; - } - this.emitted[ev] = true; - let ret = false; - for (const fn of this.listeners[ev]) { - ret = fn(code, signal) === true || ret; - } - if (ev === "exit") { - ret = this.emit("afterExit", code, signal) || ret; - } - return ret; + return calledFunctions.get(function_); +}; +var onetime_default = onetime; + +// node_modules/execa/lib/error.js +var import_node_process5 = __toESM(require("node:process"), 1); + +// node_modules/human-signals/build/src/main.js +var import_node_os3 = require("node:os"); + +// node_modules/human-signals/build/src/realtime.js +var getRealtimeSignals = () => { + const length = SIGRTMAX - SIGRTMIN + 1; + return Array.from({ length }, getRealtimeSignal); +}; +var getRealtimeSignal = (value, index) => ({ + name: `SIGRT${index + 1}`, + number: SIGRTMIN + index, + action: "terminate", + description: "Application-specific signal (realtime)", + standard: "posix" +}); +var SIGRTMIN = 34; +var SIGRTMAX = 64; + +// node_modules/human-signals/build/src/signals.js +var import_node_os2 = require("node:os"); + +// node_modules/human-signals/build/src/core.js +var SIGNALS = [ + { + name: "SIGHUP", + number: 1, + action: "terminate", + description: "Terminal closed", + standard: "posix" + }, + { + name: "SIGINT", + number: 2, + action: "terminate", + description: "User interruption with CTRL-C", + standard: "ansi" + }, + { + name: "SIGQUIT", + number: 3, + action: "core", + description: "User interruption with CTRL-\\", + standard: "posix" + }, + { + name: "SIGILL", + number: 4, + action: "core", + description: "Invalid machine instruction", + standard: "ansi" + }, + { + name: "SIGTRAP", + number: 5, + action: "core", + description: "Debugger breakpoint", + standard: "posix" + }, + { + name: "SIGABRT", + number: 6, + action: "core", + description: "Aborted", + standard: "ansi" + }, + { + name: "SIGIOT", + number: 6, + action: "core", + description: "Aborted", + standard: "bsd" + }, + { + name: "SIGBUS", + number: 7, + action: "core", + description: "Bus error due to misaligned, non-existing address or paging error", + standard: "bsd" + }, + { + name: "SIGEMT", + number: 7, + action: "terminate", + description: "Command should be emulated but is not implemented", + standard: "other" + }, + { + name: "SIGFPE", + number: 8, + action: "core", + description: "Floating point arithmetic error", + standard: "ansi" + }, + { + name: "SIGKILL", + number: 9, + action: "terminate", + description: "Forced termination", + standard: "posix", + forced: true + }, + { + name: "SIGUSR1", + number: 10, + action: "terminate", + description: "Application-specific signal", + standard: "posix" + }, + { + name: "SIGSEGV", + number: 11, + action: "core", + description: "Segmentation fault", + standard: "ansi" + }, + { + name: "SIGUSR2", + number: 12, + action: "terminate", + description: "Application-specific signal", + standard: "posix" + }, + { + name: "SIGPIPE", + number: 13, + action: "terminate", + description: "Broken pipe or socket", + standard: "posix" + }, + { + name: "SIGALRM", + number: 14, + action: "terminate", + description: "Timeout or timer", + standard: "posix" + }, + { + name: "SIGTERM", + number: 15, + action: "terminate", + description: "Termination", + standard: "ansi" + }, + { + name: "SIGSTKFLT", + number: 16, + action: "terminate", + description: "Stack is empty or overflowed", + standard: "other" + }, + { + name: "SIGCHLD", + number: 17, + action: "ignore", + description: "Child process terminated, paused or unpaused", + standard: "posix" + }, + { + name: "SIGCLD", + number: 17, + action: "ignore", + description: "Child process terminated, paused or unpaused", + standard: "other" + }, + { + name: "SIGCONT", + number: 18, + action: "unpause", + description: "Unpaused", + standard: "posix", + forced: true + }, + { + name: "SIGSTOP", + number: 19, + action: "pause", + description: "Paused", + standard: "posix", + forced: true + }, + { + name: "SIGTSTP", + number: 20, + action: "pause", + description: 'Paused using CTRL-Z or "suspend"', + standard: "posix" + }, + { + name: "SIGTTIN", + number: 21, + action: "pause", + description: "Background process cannot read terminal input", + standard: "posix" + }, + { + name: "SIGBREAK", + number: 21, + action: "terminate", + description: "User interruption with CTRL-BREAK", + standard: "other" + }, + { + name: "SIGTTOU", + number: 22, + action: "pause", + description: "Background process cannot write to terminal output", + standard: "posix" + }, + { + name: "SIGURG", + number: 23, + action: "ignore", + description: "Socket received out-of-band data", + standard: "bsd" + }, + { + name: "SIGXCPU", + number: 24, + action: "core", + description: "Process timed out", + standard: "bsd" + }, + { + name: "SIGXFSZ", + number: 25, + action: "core", + description: "File too big", + standard: "bsd" + }, + { + name: "SIGVTALRM", + number: 26, + action: "terminate", + description: "Timeout or timer", + standard: "bsd" + }, + { + name: "SIGPROF", + number: 27, + action: "terminate", + description: "Timeout or timer", + standard: "bsd" + }, + { + name: "SIGWINCH", + number: 28, + action: "ignore", + description: "Terminal window size changed", + standard: "bsd" + }, + { + name: "SIGIO", + number: 29, + action: "terminate", + description: "I/O is available", + standard: "other" + }, + { + name: "SIGPOLL", + number: 29, + action: "terminate", + description: "Watched event", + standard: "other" + }, + { + name: "SIGINFO", + number: 29, + action: "ignore", + description: "Request for process information", + standard: "other" + }, + { + name: "SIGPWR", + number: 30, + action: "terminate", + description: "Device running out of power", + standard: "systemv" + }, + { + name: "SIGSYS", + number: 31, + action: "core", + description: "Invalid system call", + standard: "other" + }, + { + name: "SIGUNUSED", + number: 31, + action: "terminate", + description: "Invalid system call", + standard: "other" } +]; + +// node_modules/human-signals/build/src/signals.js +var getSignals = () => { + const realtimeSignals = getRealtimeSignals(); + const signals = [...SIGNALS, ...realtimeSignals].map(normalizeSignal); + return signals; +}; +var normalizeSignal = ({ + name, + number: defaultNumber, + description, + action, + forced = false, + standard +}) => { + const { + signals: { [name]: constantSignal } + } = import_node_os2.constants; + const supported = constantSignal !== void 0; + const number = supported ? constantSignal : defaultNumber; + return { name, number, description, supported, action, forced, standard }; +}; + +// node_modules/human-signals/build/src/main.js +var getSignalsByName = () => { + const signals = getSignals(); + return Object.fromEntries(signals.map(getSignalByName)); }; -var SignalExitBase = class { +var getSignalByName = ({ + name, + number, + description, + supported, + action, + forced, + standard +}) => [name, { name, number, description, supported, action, forced, standard }]; +var signalsByName = getSignalsByName(); +var getSignalsByNumber = () => { + const signals = getSignals(); + const length = SIGRTMAX + 1; + const signalsA = Array.from({ length }, (value, number) => getSignalByNumber(number, signals)); + return Object.assign({}, ...signalsA); }; -var signalExitWrap = (handler) => { +var getSignalByNumber = (number, signals) => { + const signal = findSignalByNumber(number, signals); + if (signal === void 0) { + return {}; + } + const { name, description, supported, action, forced, standard } = signal; return { - onExit(cb, opts) { - return handler.onExit(cb, opts); - }, - load() { - return handler.load(); - }, - unload() { - return handler.unload(); + [number]: { + name, + number, + description, + supported, + action, + forced, + standard } }; }; -var SignalExitFallback = class extends SignalExitBase { - onExit() { - return () => { - }; - } - load() { - } - unload() { +var findSignalByNumber = (number, signals) => { + const signal = signals.find(({ name }) => import_node_os3.constants.signals[name] === number); + if (signal !== void 0) { + return signal; } + return signals.find((signalA) => signalA.number === number); }; -var SignalExit = class extends SignalExitBase { - #hupSig = process10.platform === "win32" ? "SIGINT" : "SIGHUP"; - #emitter = new Emitter(); - #process; - #originalProcessEmit; - #originalProcessReallyExit; - #sigListeners = {}; - #loaded = false; - constructor(process13) { - super(); - this.#process = process13; - this.#sigListeners = {}; - for (const sig of signals) { - this.#sigListeners[sig] = () => { - const listeners = this.#process.listeners(sig); - let { count: count2 } = this.#emitter; - const p4 = process13; - if (typeof p4.__signal_exit_emitter__ === "object" && typeof p4.__signal_exit_emitter__.count === "number") { - count2 += p4.__signal_exit_emitter__.count; - } - if (listeners.length === count2) { - this.unload(); - const ret = this.#emitter.emit("exit", null, sig); - const s2 = sig === "SIGHUP" ? this.#hupSig : sig; - if (!ret) - process13.kill(process13.pid, s2); - } - }; - } - this.#originalProcessReallyExit = process13.reallyExit; - this.#originalProcessEmit = process13.emit; - } - onExit(cb, opts) { - if (!processOk(this.#process)) { - return () => { - }; - } - if (this.#loaded === false) { - this.load(); - } - const ev = opts?.alwaysLast ? "afterExit" : "exit"; - this.#emitter.on(ev, cb); - return () => { - this.#emitter.removeListener(ev, cb); - if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) { - this.unload(); - } - }; +var signalsByNumber = getSignalsByNumber(); + +// node_modules/execa/lib/error.js +var getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }) => { + if (timedOut) { + return `timed out after ${timeout} milliseconds`; } - load() { - if (this.#loaded) { - return; - } - this.#loaded = true; - this.#emitter.count += 1; - for (const sig of signals) { - try { - const fn = this.#sigListeners[sig]; - if (fn) - this.#process.on(sig, fn); - } catch (_7) { - } - } - this.#process.emit = (ev, ...a5) => { - return this.#processEmit(ev, ...a5); - }; - this.#process.reallyExit = (code) => { - return this.#processReallyExit(code); - }; + if (isCanceled) { + return "was canceled"; } - unload() { - if (!this.#loaded) { - return; - } - this.#loaded = false; - signals.forEach((sig) => { - const listener = this.#sigListeners[sig]; - if (!listener) { - throw new Error("Listener not defined for signal: " + sig); - } - try { - this.#process.removeListener(sig, listener); - } catch (_7) { - } - }); - this.#process.emit = this.#originalProcessEmit; - this.#process.reallyExit = this.#originalProcessReallyExit; - this.#emitter.count -= 1; + if (errorCode !== void 0) { + return `failed with ${errorCode}`; } - #processReallyExit(code) { - if (!processOk(this.#process)) { - return 0; - } - this.#process.exitCode = code || 0; - this.#emitter.emit("exit", this.#process.exitCode, null); - return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode); + if (signal !== void 0) { + return `was killed with ${signal} (${signalDescription})`; } - #processEmit(ev, ...args) { - const og = this.#originalProcessEmit; - if (ev === "exit" && processOk(this.#process)) { - if (typeof args[0] === "number") { - this.#process.exitCode = args[0]; - } - const ret = og.call(this.#process, ev, ...args); - this.#emitter.emit("exit", this.#process.exitCode, null); - return ret; - } else { - return og.call(this.#process, ev, ...args); - } + if (exitCode !== void 0) { + return `failed with exit code ${exitCode}`; } + return "failed"; }; -var process10 = globalThis.process; -var { - onExit, - load, - unload -} = signalExitWrap(processOk(process10) ? new SignalExit(process10) : new SignalExitFallback()); - -// node_modules/execa/lib/terminate/cleanup.js -var cleanupOnExit = (subprocess, { cleanup, detached }, { signal }) => { - if (!cleanup || detached) { - return; - } - const removeExitHandler = onExit(() => { - subprocess.kill(); - }); - (0, import_node_events11.addAbortListener)(signal, () => { - removeExitHandler(); - }); +var makeError = ({ + stdout, + stderr: stderr2, + all: all3, + error, + signal, + exitCode, + command, + escapedCommand, + timedOut, + isCanceled, + killed, + parsed: { options: { timeout, cwd = import_node_process5.default.cwd() } } +}) => { + exitCode = exitCode === null ? void 0 : exitCode; + signal = signal === null ? void 0 : signal; + const signalDescription = signal === void 0 ? void 0 : signalsByName[signal].description; + const errorCode = error && error.code; + const prefix = getErrorPrefix({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled }); + const execaMessage = `Command ${prefix}: ${command}`; + const isError2 = Object.prototype.toString.call(error) === "[object Error]"; + const shortMessage = isError2 ? `${execaMessage} +${error.message}` : execaMessage; + const message = [shortMessage, stderr2, stdout].filter(Boolean).join("\n"); + if (isError2) { + error.originalMessage = error.message; + error.message = message; + } else { + error = new Error(message); + } + error.shortMessage = shortMessage; + error.command = command; + error.escapedCommand = escapedCommand; + error.exitCode = exitCode; + error.signal = signal; + error.signalDescription = signalDescription; + error.stdout = stdout; + error.stderr = stderr2; + error.cwd = cwd; + if (all3 !== void 0) { + error.all = all3; + } + if ("bufferedData" in error) { + delete error.bufferedData; + } + error.failed = true; + error.timedOut = Boolean(timedOut); + error.isCanceled = isCanceled; + error.killed = killed && !timedOut; + return error; }; -// node_modules/execa/lib/pipe/pipe-arguments.js -var normalizePipeArguments = ({ source, sourcePromise, boundOptions, createNested }, ...pipeArguments) => { - const startTime = getStartTime(); - const { - destination, - destinationStream, - destinationError, - from, - unpipeSignal - } = getDestinationStream(boundOptions, createNested, pipeArguments); - const { sourceStream, sourceError } = getSourceStream(source, from); - const { options: sourceOptions, fileDescriptors } = SUBPROCESS_OPTIONS.get(source); - return { - sourcePromise, - sourceStream, - sourceOptions, - sourceError, - destination, - destinationStream, - destinationError, - unpipeSignal, - fileDescriptors, - startTime - }; -}; -var getDestinationStream = (boundOptions, createNested, pipeArguments) => { - try { - const { - destination, - pipeOptions: { from, to, unpipeSignal } = {} - } = getDestination(boundOptions, createNested, ...pipeArguments); - const destinationStream = getToStream(destination, to); - return { - destination, - destinationStream, - from, - unpipeSignal - }; - } catch (error) { - return { destinationError: error }; +// node_modules/execa/lib/stdio.js +var aliases = ["stdin", "stdout", "stderr"]; +var hasAlias = (options) => aliases.some((alias) => options[alias] !== void 0); +var normalizeStdio = (options) => { + if (!options) { + return; } -}; -var getDestination = (boundOptions, createNested, firstArgument, ...pipeArguments) => { - if (Array.isArray(firstArgument)) { - const destination = createNested(mapDestinationArguments, boundOptions)(firstArgument, ...pipeArguments); - return { destination, pipeOptions: boundOptions }; + const { stdio } = options; + if (stdio === void 0) { + return aliases.map((alias) => options[alias]); } - if (typeof firstArgument === "string" || firstArgument instanceof URL) { - if (Object.keys(boundOptions).length > 0) { - throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).'); - } - const [rawFile, rawArguments, rawOptions] = normalizeParameters(firstArgument, ...pipeArguments); - const destination = createNested(mapDestinationArguments)(rawFile, rawArguments, rawOptions); - return { destination, pipeOptions: rawOptions }; + if (hasAlias(options)) { + throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias) => `\`${alias}\``).join(", ")}`); } - if (SUBPROCESS_OPTIONS.has(firstArgument)) { - if (Object.keys(boundOptions).length > 0) { - throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`)."); - } - return { destination: firstArgument, pipeOptions: pipeArguments[0] }; + if (typeof stdio === "string") { + return stdio; } - throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${firstArgument}`); -}; -var mapDestinationArguments = ({ options }) => ({ options: { ...options, stdin: "pipe", piped: true } }); -var getSourceStream = (source, from) => { - try { - const sourceStream = getFromStream(source, from); - return { sourceStream }; - } catch (error) { - return { sourceError: error }; + if (!Array.isArray(stdio)) { + throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``); } + const length = Math.max(stdio.length, aliases.length); + return Array.from({ length }, (value, index) => stdio[index]); }; -// node_modules/execa/lib/pipe/throw.js -var handlePipeArgumentsError = ({ - sourceStream, - sourceError, - destinationStream, - destinationError, - fileDescriptors, - sourceOptions, - startTime -}) => { - const error = getPipeArgumentsError({ - sourceStream, - sourceError, - destinationStream, - destinationError - }); - if (error !== void 0) { - throw createNonCommandError({ - error, - fileDescriptors, - sourceOptions, - startTime - }); +// node_modules/execa/lib/kill.js +var import_node_os4 = __toESM(require("node:os"), 1); +var import_signal_exit = __toESM(require_signal_exit(), 1); +var DEFAULT_FORCE_KILL_TIMEOUT = 1e3 * 5; +var spawnedKill = (kill, signal = "SIGTERM", options = {}) => { + const killResult = kill(signal); + setKillTimeout(kill, signal, options, killResult); + return killResult; +}; +var setKillTimeout = (kill, signal, options, killResult) => { + if (!shouldForceKill(signal, options, killResult)) { + return; + } + const timeout = getForceKillAfterTimeout(options); + const t2 = setTimeout(() => { + kill("SIGKILL"); + }, timeout); + if (t2.unref) { + t2.unref(); } }; -var getPipeArgumentsError = ({ sourceStream, sourceError, destinationStream, destinationError }) => { - if (sourceError !== void 0 && destinationError !== void 0) { - return destinationError; +var shouldForceKill = (signal, { forceKillAfterTimeout }, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult; +var isSigterm = (signal) => signal === import_node_os4.default.constants.signals.SIGTERM || typeof signal === "string" && signal.toUpperCase() === "SIGTERM"; +var getForceKillAfterTimeout = ({ forceKillAfterTimeout = true }) => { + if (forceKillAfterTimeout === true) { + return DEFAULT_FORCE_KILL_TIMEOUT; } - if (destinationError !== void 0) { - abortSourceStream(sourceStream); - return destinationError; + if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) { + throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`); } - if (sourceError !== void 0) { - endDestinationStream(destinationStream); - return sourceError; + return forceKillAfterTimeout; +}; +var spawnedCancel = (spawned, context) => { + const killResult = spawned.kill(); + if (killResult) { + context.isCanceled = true; } }; -var createNonCommandError = ({ error, fileDescriptors, sourceOptions, startTime }) => makeEarlyError({ - error, - command: PIPE_COMMAND_MESSAGE, - escapedCommand: PIPE_COMMAND_MESSAGE, - fileDescriptors, - options: sourceOptions, - startTime, - isSync: false -}); -var PIPE_COMMAND_MESSAGE = "source.pipe(destination)"; - -// node_modules/execa/lib/pipe/sequence.js -var waitForBothSubprocesses = async (subprocessPromises) => { - const [ - { status: sourceStatus, reason: sourceReason, value: sourceResult = sourceReason }, - { status: destinationStatus, reason: destinationReason, value: destinationResult = destinationReason } - ] = await subprocessPromises; - if (!destinationResult.pipedFrom.includes(sourceResult)) { - destinationResult.pipedFrom.push(sourceResult); - } - if (destinationStatus === "rejected") { - throw destinationResult; - } - if (sourceStatus === "rejected") { - throw sourceResult; - } - return destinationResult; -}; - -// node_modules/execa/lib/pipe/streaming.js -var import_promises8 = require("node:stream/promises"); -var pipeSubprocessStream = (sourceStream, destinationStream, maxListenersController) => { - const mergedStream = MERGED_STREAMS.has(destinationStream) ? pipeMoreSubprocessStream(sourceStream, destinationStream) : pipeFirstSubprocessStream(sourceStream, destinationStream); - incrementMaxListeners(sourceStream, SOURCE_LISTENERS_PER_PIPE, maxListenersController.signal); - incrementMaxListeners(destinationStream, DESTINATION_LISTENERS_PER_PIPE, maxListenersController.signal); - cleanupMergedStreamsMap(destinationStream); - return mergedStream; -}; -var pipeFirstSubprocessStream = (sourceStream, destinationStream) => { - const mergedStream = mergeStreams([sourceStream]); - pipeStreams(mergedStream, destinationStream); - MERGED_STREAMS.set(destinationStream, mergedStream); - return mergedStream; -}; -var pipeMoreSubprocessStream = (sourceStream, destinationStream) => { - const mergedStream = MERGED_STREAMS.get(destinationStream); - mergedStream.add(sourceStream); - return mergedStream; -}; -var cleanupMergedStreamsMap = async (destinationStream) => { - try { - await (0, import_promises8.finished)(destinationStream, { cleanup: true, readable: false, writable: true }); - } catch { - } - MERGED_STREAMS.delete(destinationStream); -}; -var MERGED_STREAMS = /* @__PURE__ */ new WeakMap(); -var SOURCE_LISTENERS_PER_PIPE = 2; -var DESTINATION_LISTENERS_PER_PIPE = 1; - -// node_modules/execa/lib/pipe/abort.js -var import_node_util7 = require("node:util"); -var unpipeOnAbort = (unpipeSignal, unpipeContext) => unpipeSignal === void 0 ? [] : [unpipeOnSignalAbort(unpipeSignal, unpipeContext)]; -var unpipeOnSignalAbort = async (unpipeSignal, { sourceStream, mergedStream, fileDescriptors, sourceOptions, startTime }) => { - await (0, import_node_util7.aborted)(unpipeSignal, sourceStream); - await mergedStream.remove(sourceStream); - const error = new Error("Pipe canceled by `unpipeSignal` option."); - throw createNonCommandError({ - error, - fileDescriptors, - sourceOptions, - startTime - }); +var timeoutKill = (spawned, signal, reject) => { + spawned.kill(signal); + reject(Object.assign(new Error("Timed out"), { timedOut: true, signal })); }; - -// node_modules/execa/lib/pipe/setup.js -var pipeToSubprocess = (sourceInfo, ...pipeArguments) => { - if (isPlainObject(pipeArguments[0])) { - return pipeToSubprocess.bind(void 0, { - ...sourceInfo, - boundOptions: { ...sourceInfo.boundOptions, ...pipeArguments[0] } - }); +var setupTimeout = (spawned, { timeout, killSignal = "SIGTERM" }, spawnedPromise) => { + if (timeout === 0 || timeout === void 0) { + return spawnedPromise; } - const { destination, ...normalizedInfo } = normalizePipeArguments(sourceInfo, ...pipeArguments); - const promise = handlePipePromise({ ...normalizedInfo, destination }); - promise.pipe = pipeToSubprocess.bind(void 0, { - ...sourceInfo, - source: destination, - sourcePromise: promise, - boundOptions: {} + let timeoutId; + const timeoutPromise = new Promise((resolve, reject) => { + timeoutId = setTimeout(() => { + timeoutKill(spawned, killSignal, reject); + }, timeout); }); - return promise; -}; -var handlePipePromise = async ({ - sourcePromise, - sourceStream, - sourceOptions, - sourceError, - destination, - destinationStream, - destinationError, - unpipeSignal, - fileDescriptors, - startTime -}) => { - const subprocessPromises = getSubprocessPromises(sourcePromise, destination); - handlePipeArgumentsError({ - sourceStream, - sourceError, - destinationStream, - destinationError, - fileDescriptors, - sourceOptions, - startTime - }); - const maxListenersController = new AbortController(); - try { - const mergedStream = pipeSubprocessStream(sourceStream, destinationStream, maxListenersController); - return await Promise.race([ - waitForBothSubprocesses(subprocessPromises), - ...unpipeOnAbort(unpipeSignal, { - sourceStream, - mergedStream, - sourceOptions, - fileDescriptors, - startTime - }) - ]); - } finally { - maxListenersController.abort(); - } -}; -var getSubprocessPromises = (sourcePromise, destination) => Promise.allSettled([sourcePromise, destination]); - -// node_modules/execa/lib/io/contents.js -var import_promises9 = require("node:timers/promises"); - -// node_modules/execa/lib/io/iterate.js -var import_node_events12 = require("node:events"); -var import_node_stream5 = require("node:stream"); -var iterateOnSubprocessStream = ({ subprocessStdout, subprocess, binary, shouldEncode, encoding, preserveNewlines }) => { - const controller = new AbortController(); - stopReadingOnExit(subprocess, controller); - return iterateOnStream({ - stream: subprocessStdout, - controller, - binary, - shouldEncode: !subprocessStdout.readableObjectMode && shouldEncode, - encoding, - shouldSplit: !subprocessStdout.readableObjectMode, - preserveNewlines + const safeSpawnedPromise = spawnedPromise.finally(() => { + clearTimeout(timeoutId); }); + return Promise.race([timeoutPromise, safeSpawnedPromise]); }; -var stopReadingOnExit = async (subprocess, controller) => { - try { - await subprocess; - } catch { - } finally { - controller.abort(); +var validateTimeout = ({ timeout }) => { + if (timeout !== void 0 && (!Number.isFinite(timeout) || timeout < 0)) { + throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`); } }; -var iterateForResult = ({ stream: stream4, onStreamEnd, lines, encoding, stripFinalNewline: stripFinalNewline2, allMixed }) => { - const controller = new AbortController(); - stopReadingOnStreamEnd(onStreamEnd, controller, stream4); - const objectMode = stream4.readableObjectMode && !allMixed; - return iterateOnStream({ - stream: stream4, - controller, - binary: encoding === "buffer", - shouldEncode: !objectMode, - encoding, - shouldSplit: !objectMode && lines, - preserveNewlines: !stripFinalNewline2 - }); -}; -var stopReadingOnStreamEnd = async (onStreamEnd, controller, stream4) => { - try { - await onStreamEnd; - } catch { - stream4.destroy(); - } finally { - controller.abort(); +var setExitHandler = async (spawned, { cleanup, detached }, timedPromise) => { + if (!cleanup || detached) { + return timedPromise; } -}; -var iterateOnStream = ({ stream: stream4, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => { - const onStdoutChunk = (0, import_node_events12.on)(stream4, "data", { - signal: controller.signal, - highWaterMark: HIGH_WATER_MARK, - highWatermark: HIGH_WATER_MARK + const removeExitHandler = (0, import_signal_exit.default)(() => { + spawned.kill(); }); - return iterateOnData({ - onStdoutChunk, - controller, - binary, - shouldEncode, - encoding, - shouldSplit, - preserveNewlines + return timedPromise.finally(() => { + removeExitHandler(); }); }; -var DEFAULT_OBJECT_HIGH_WATER_MARK = (0, import_node_stream5.getDefaultHighWaterMark)(true); -var HIGH_WATER_MARK = DEFAULT_OBJECT_HIGH_WATER_MARK; -var iterateOnData = async function* ({ onStdoutChunk, controller, binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) { - const generators = getGenerators({ - binary, - shouldEncode, - encoding, - shouldSplit, - preserveNewlines - }); - try { - for await (const [chunk] of onStdoutChunk) { - yield* transformChunkSync(chunk, generators, 0); - } - } catch (error) { - if (!controller.signal.aborted) { - throw error; - } - } finally { - yield* finalChunksSync(generators); - } -}; -var getGenerators = ({ binary, shouldEncode, encoding, shouldSplit, preserveNewlines }) => [ - getEncodingTransformGenerator(binary, encoding, !shouldEncode), - getSplitLinesGenerator(binary, preserveNewlines, !shouldSplit, {}) -].filter(Boolean); - -// node_modules/execa/lib/io/contents.js -var getStreamOutput = async ({ stream: stream4, onStreamEnd, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline: stripFinalNewline2, verboseInfo, streamInfo }) => { - const logPromise = logOutputAsync({ - stream: stream4, - onStreamEnd, - fdNumber, - encoding, - allMixed, - verboseInfo, - streamInfo - }); - if (!buffer) { - await Promise.all([resumeStream(stream4), logPromise]); - return; + +// node_modules/execa/lib/pipe.js +var import_node_fs = require("node:fs"); +var import_node_child_process = require("node:child_process"); + +// node_modules/is-stream/index.js +function isStream(stream4) { + return stream4 !== null && typeof stream4 === "object" && typeof stream4.pipe === "function"; +} +function isWritableStream(stream4) { + return isStream(stream4) && stream4.writable !== false && typeof stream4._write === "function" && typeof stream4._writableState === "object"; +} + +// node_modules/execa/lib/pipe.js +var isExecaChildProcess = (target) => target instanceof import_node_child_process.ChildProcess && typeof target.then === "function"; +var pipeToTarget = (spawned, streamName, target) => { + if (typeof target === "string") { + spawned[streamName].pipe((0, import_node_fs.createWriteStream)(target)); + return spawned; } - const stripFinalNewlineValue = getStripFinalNewline(stripFinalNewline2, fdNumber); - const iterable = iterateForResult({ - stream: stream4, - onStreamEnd, - lines, - encoding, - stripFinalNewline: stripFinalNewlineValue, - allMixed - }); - const [output] = await Promise.all([ - getStreamContents2({ - stream: stream4, - iterable, - fdNumber, - encoding, - maxBuffer, - lines - }), - logPromise - ]); - return output; -}; -var logOutputAsync = async ({ stream: stream4, onStreamEnd, fdNumber, encoding, allMixed, verboseInfo, streamInfo: { fileDescriptors } }) => { - if (!shouldLogOutput({ - stdioItems: fileDescriptors[fdNumber]?.stdioItems, - encoding, - verboseInfo, - fdNumber - })) { - return; + if (isWritableStream(target)) { + spawned[streamName].pipe(target); + return spawned; } - const linesIterable = iterateForResult({ - stream: stream4, - onStreamEnd, - lines: true, - encoding, - stripFinalNewline: true, - allMixed - }); - await logLines(linesIterable, stream4, fdNumber, verboseInfo); -}; -var resumeStream = async (stream4) => { - await (0, import_promises9.setImmediate)(); - if (stream4.readableFlowing === null) { - stream4.resume(); + if (!isExecaChildProcess(target)) { + throw new TypeError("The second argument must be a string, a stream or an Execa child process."); } -}; -var getStreamContents2 = async ({ stream: stream4, stream: { readableObjectMode }, iterable, fdNumber, encoding, maxBuffer, lines }) => { - try { - if (readableObjectMode || lines) { - return await getStreamAsArray(iterable, { maxBuffer }); - } - if (encoding === "buffer") { - return new Uint8Array(await getStreamAsArrayBuffer(iterable, { maxBuffer })); - } - return await getStreamAsString(iterable, { maxBuffer }); - } catch (error) { - return handleBufferedData(handleMaxBuffer({ - error, - stream: stream4, - readableObjectMode, - lines, - encoding, - fdNumber - })); + if (!isWritableStream(target.stdin)) { + throw new TypeError("The target child process's stdin must be available."); } + spawned[streamName].pipe(target.stdin); + return target; }; -var getBufferedData = async (streamPromise) => { - try { - return await streamPromise; - } catch (error) { - return handleBufferedData(error); +var addPipeMethods = (spawned) => { + if (spawned.stdout !== null) { + spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, "stdout"); + } + if (spawned.stderr !== null) { + spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, "stderr"); + } + if (spawned.all !== void 0) { + spawned.pipeAll = pipeToTarget.bind(void 0, spawned, "all"); } }; -var handleBufferedData = ({ bufferedData }) => isArrayBuffer(bufferedData) ? new Uint8Array(bufferedData) : bufferedData; -// node_modules/execa/lib/resolve/wait-stream.js -var import_promises10 = require("node:stream/promises"); -var waitForStream = async (stream4, fdNumber, streamInfo, { isSameDirection, stopOnExit = false } = {}) => { - const state2 = handleStdinDestroy(stream4, streamInfo); - const abortController = new AbortController(); - try { - await Promise.race([ - ...stopOnExit ? [streamInfo.exitPromise] : [], - (0, import_promises10.finished)(stream4, { cleanup: true, signal: abortController.signal }) - ]); - } catch (error) { - if (!state2.stdinCleanedUp) { - handleStreamError(error, fdNumber, streamInfo, isSameDirection); - } - } finally { - abortController.abort(); +// node_modules/execa/lib/stream.js +var import_node_fs2 = require("node:fs"); +var import_get_stream = __toESM(require_get_stream(), 1); +var import_merge_stream = __toESM(require_merge_stream(), 1); +var validateInputOptions = (input) => { + if (input !== void 0) { + throw new TypeError("The `input` and `inputFile` options cannot be both set."); } }; -var handleStdinDestroy = (stream4, { originalStreams: [originalStdin], subprocess }) => { - const state2 = { stdinCleanedUp: false }; - if (stream4 === originalStdin) { - spyOnStdinDestroy(stream4, subprocess, state2); +var getInputSync = ({ input, inputFile }) => { + if (typeof inputFile !== "string") { + return input; } - return state2; -}; -var spyOnStdinDestroy = (subprocessStdin, subprocess, state2) => { - const { _destroy } = subprocessStdin; - subprocessStdin._destroy = (...destroyArguments) => { - setStdinCleanedUp(subprocess, state2); - _destroy.call(subprocessStdin, ...destroyArguments); - }; + validateInputOptions(input); + return (0, import_node_fs2.readFileSync)(inputFile); }; -var setStdinCleanedUp = ({ exitCode, signalCode }, state2) => { - if (exitCode !== null || signalCode !== null) { - state2.stdinCleanedUp = true; +var handleInputSync = (options) => { + const input = getInputSync(options); + if (isStream(input)) { + throw new TypeError("The `input` option cannot be a stream in sync mode"); } + return input; }; -var handleStreamError = (error, fdNumber, streamInfo, isSameDirection) => { - if (!shouldIgnoreStreamError(error, fdNumber, streamInfo, isSameDirection)) { - throw error; +var getInput = ({ input, inputFile }) => { + if (typeof inputFile !== "string") { + return input; } + validateInputOptions(input); + return (0, import_node_fs2.createReadStream)(inputFile); }; -var shouldIgnoreStreamError = (error, fdNumber, streamInfo, isSameDirection = true) => { - if (streamInfo.propagating) { - return isStreamEpipe(error) || isStreamAbort(error); - } - streamInfo.propagating = true; - return isInputFileDescriptor(streamInfo, fdNumber) === isSameDirection ? isStreamEpipe(error) : isStreamAbort(error); -}; -var isInputFileDescriptor = ({ fileDescriptors }, fdNumber) => fdNumber !== "all" && fileDescriptors[fdNumber].direction === "input"; -var isStreamAbort = (error) => error?.code === "ERR_STREAM_PREMATURE_CLOSE"; -var isStreamEpipe = (error) => error?.code === "EPIPE"; - -// node_modules/execa/lib/resolve/stdio.js -var waitForStdioStreams = ({ subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline: stripFinalNewline2, verboseInfo, streamInfo }) => subprocess.stdio.map((stream4, fdNumber) => waitForSubprocessStream({ - stream: stream4, - fdNumber, - encoding, - buffer: buffer[fdNumber], - maxBuffer: maxBuffer[fdNumber], - lines: lines[fdNumber], - allMixed: false, - stripFinalNewline: stripFinalNewline2, - verboseInfo, - streamInfo -})); -var waitForSubprocessStream = async ({ stream: stream4, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline: stripFinalNewline2, verboseInfo, streamInfo }) => { - if (!stream4) { +var handleInput = (spawned, options) => { + const input = getInput(options); + if (input === void 0) { return; } - const onStreamEnd = waitForStream(stream4, fdNumber, streamInfo); - if (isInputFileDescriptor(streamInfo, fdNumber)) { - await onStreamEnd; - return; + if (isStream(input)) { + input.pipe(spawned.stdin); + } else { + spawned.stdin.end(input); } - const [output] = await Promise.all([ - getStreamOutput({ - stream: stream4, - onStreamEnd, - fdNumber, - encoding, - buffer, - maxBuffer, - lines, - allMixed, - stripFinalNewline: stripFinalNewline2, - verboseInfo, - streamInfo - }), - onStreamEnd - ]); - return output; }; - -// node_modules/execa/lib/resolve/all-async.js -var makeAllStream = ({ stdout, stderr: stderr2 }, { all: all3 }) => all3 && (stdout || stderr2) ? mergeStreams([stdout, stderr2].filter(Boolean)) : void 0; -var waitForAllStream = ({ subprocess, encoding, buffer, maxBuffer, lines, stripFinalNewline: stripFinalNewline2, verboseInfo, streamInfo }) => waitForSubprocessStream({ - ...getAllStream(subprocess, buffer), - fdNumber: "all", - encoding, - maxBuffer: maxBuffer[1] + maxBuffer[2], - lines: lines[1] || lines[2], - allMixed: getAllMixed(subprocess), - stripFinalNewline: stripFinalNewline2, - verboseInfo, - streamInfo -}); -var getAllStream = ({ stdout, stderr: stderr2, all: all3 }, [, bufferStdout, bufferStderr]) => { - const buffer = bufferStdout || bufferStderr; - if (!buffer) { - return { stream: all3, buffer }; - } - if (!bufferStdout) { - return { stream: stderr2, buffer }; +var makeAllStream = (spawned, { all: all3 }) => { + if (!all3 || !spawned.stdout && !spawned.stderr) { + return; } - if (!bufferStderr) { - return { stream: stdout, buffer }; + const mixed = (0, import_merge_stream.default)(); + if (spawned.stdout) { + mixed.add(spawned.stdout); } - return { stream: all3, buffer }; -}; -var getAllMixed = ({ all: all3, stdout, stderr: stderr2 }) => all3 && stdout && stderr2 && stdout.readableObjectMode !== stderr2.readableObjectMode; - -// node_modules/execa/lib/resolve/wait-subprocess.js -var import_node_events13 = require("node:events"); - -// node_modules/execa/lib/verbose/ipc.js -var shouldLogIpc = (verboseInfo) => isFullVerbose(verboseInfo, "ipc"); -var logIpcOutput = (message, verboseInfo) => { - const verboseMessage = serializeVerboseMessage(message); - verboseLog({ - type: "ipc", - verboseMessage, - fdNumber: "ipc", - verboseInfo - }); -}; - -// node_modules/execa/lib/ipc/buffer-messages.js -var waitForIpcOutput = async ({ - subprocess, - buffer: bufferArray, - maxBuffer: maxBufferArray, - ipc, - ipcOutput, - verboseInfo -}) => { - if (!ipc) { - return ipcOutput; - } - const isVerbose2 = shouldLogIpc(verboseInfo); - const buffer = getFdSpecificValue(bufferArray, "ipc"); - const maxBuffer = getFdSpecificValue(maxBufferArray, "ipc"); - for await (const message of loopOnMessages({ - anyProcess: subprocess, - channel: subprocess.channel, - isSubprocess: false, - ipc, - shouldAwait: false, - reference: true - })) { - if (buffer) { - checkIpcMaxBuffer(subprocess, ipcOutput, maxBuffer); - ipcOutput.push(message); - } - if (isVerbose2) { - logIpcOutput(message, verboseInfo); - } - } - return ipcOutput; -}; -var getBufferedIpcOutput = async (ipcOutputPromise, ipcOutput) => { - await Promise.allSettled([ipcOutputPromise]); - return ipcOutput; -}; - -// node_modules/execa/lib/resolve/wait-subprocess.js -var waitForSubprocessResult = async ({ - subprocess, - options: { - encoding, - buffer, - maxBuffer, - lines, - timeoutDuration: timeout, - cancelSignal, - gracefulCancel, - forceKillAfterDelay, - stripFinalNewline: stripFinalNewline2, - ipc, - ipcInput - }, - context, - verboseInfo, - fileDescriptors, - originalStreams, - onInternalError, - controller -}) => { - const exitPromise = waitForExit(subprocess, context); - const streamInfo = { - originalStreams, - fileDescriptors, - subprocess, - exitPromise, - propagating: false - }; - const stdioPromises = waitForStdioStreams({ - subprocess, - encoding, - buffer, - maxBuffer, - lines, - stripFinalNewline: stripFinalNewline2, - verboseInfo, - streamInfo - }); - const allPromise = waitForAllStream({ - subprocess, - encoding, - buffer, - maxBuffer, - lines, - stripFinalNewline: stripFinalNewline2, - verboseInfo, - streamInfo - }); - const ipcOutput = []; - const ipcOutputPromise = waitForIpcOutput({ - subprocess, - buffer, - maxBuffer, - ipc, - ipcOutput, - verboseInfo - }); - const originalPromises = waitForOriginalStreams(originalStreams, subprocess, streamInfo); - const customStreamsEndPromises = waitForCustomStreamsEnd(fileDescriptors, streamInfo); - try { - return await Promise.race([ - Promise.all([ - {}, - waitForSuccessfulExit(exitPromise), - Promise.all(stdioPromises), - allPromise, - ipcOutputPromise, - sendIpcInput(subprocess, ipcInput), - ...originalPromises, - ...customStreamsEndPromises - ]), - onInternalError, - throwOnSubprocessError(subprocess, controller), - ...throwOnTimeout(subprocess, timeout, context, controller), - ...throwOnCancel({ - subprocess, - cancelSignal, - gracefulCancel, - context, - controller - }), - ...throwOnGracefulCancel({ - subprocess, - cancelSignal, - gracefulCancel, - forceKillAfterDelay, - context, - controller - }) - ]); - } catch (error) { - context.terminationReason ??= "other"; - return Promise.all([ - { error }, - exitPromise, - Promise.all(stdioPromises.map((stdioPromise) => getBufferedData(stdioPromise))), - getBufferedData(allPromise), - getBufferedIpcOutput(ipcOutputPromise, ipcOutput), - Promise.allSettled(originalPromises), - Promise.allSettled(customStreamsEndPromises) - ]); + if (spawned.stderr) { + mixed.add(spawned.stderr); } + return mixed; }; -var waitForOriginalStreams = (originalStreams, subprocess, streamInfo) => originalStreams.map((stream4, fdNumber) => stream4 === subprocess.stdio[fdNumber] ? void 0 : waitForStream(stream4, fdNumber, streamInfo)); -var waitForCustomStreamsEnd = (fileDescriptors, streamInfo) => fileDescriptors.flatMap(({ stdioItems }, fdNumber) => stdioItems.filter(({ value, stream: stream4 = value }) => isStream(stream4, { checkOpen: false }) && !isStandardStream(stream4)).map(({ type: type2, value, stream: stream4 = value }) => waitForStream(stream4, fdNumber, streamInfo, { - isSameDirection: TRANSFORM_TYPES.has(type2), - stopOnExit: type2 === "native" -}))); -var throwOnSubprocessError = async (subprocess, { signal }) => { - const [error] = await (0, import_node_events13.once)(subprocess, "error", { signal }); - throw error; -}; - -// node_modules/execa/lib/convert/concurrent.js -var initializeConcurrentStreams = () => ({ - readableDestroy: /* @__PURE__ */ new WeakMap(), - writableFinal: /* @__PURE__ */ new WeakMap(), - writableDestroy: /* @__PURE__ */ new WeakMap() -}); -var addConcurrentStream = (concurrentStreams, stream4, waitName) => { - const weakMap = concurrentStreams[waitName]; - if (!weakMap.has(stream4)) { - weakMap.set(stream4, []); - } - const promises = weakMap.get(stream4); - const promise = createDeferred(); - promises.push(promise); - const resolve = promise.resolve.bind(promise); - return { resolve, promises }; -}; -var waitForConcurrentStreams = async ({ resolve, promises }, subprocess) => { - resolve(); - const [isSubprocessExit] = await Promise.race([ - Promise.allSettled([true, subprocess]), - Promise.all([false, ...promises]) - ]); - return !isSubprocessExit; -}; - -// node_modules/execa/lib/convert/readable.js -var import_node_stream6 = require("node:stream"); -var import_node_util8 = require("node:util"); - -// node_modules/execa/lib/convert/shared.js -var import_promises11 = require("node:stream/promises"); -var safeWaitForSubprocessStdin = async (subprocessStdin) => { - if (subprocessStdin === void 0) { +var getBufferedData = async (stream4, streamPromise) => { + if (!stream4 || streamPromise === void 0) { return; } + stream4.destroy(); try { - await waitForSubprocessStdin(subprocessStdin); - } catch { + return await streamPromise; + } catch (error) { + return error.bufferedData; } }; -var safeWaitForSubprocessStdout = async (subprocessStdout) => { - if (subprocessStdout === void 0) { +var getStreamPromise = (stream4, { encoding, buffer, maxBuffer }) => { + if (!stream4 || !buffer) { return; } - try { - await waitForSubprocessStdout(subprocessStdout); - } catch { + if (encoding) { + return (0, import_get_stream.default)(stream4, { encoding, maxBuffer }); } + return import_get_stream.default.buffer(stream4, { maxBuffer }); }; -var waitForSubprocessStdin = async (subprocessStdin) => { - await (0, import_promises11.finished)(subprocessStdin, { cleanup: true, readable: false, writable: true }); -}; -var waitForSubprocessStdout = async (subprocessStdout) => { - await (0, import_promises11.finished)(subprocessStdout, { cleanup: true, readable: true, writable: false }); -}; -var waitForSubprocess = async (subprocess, error) => { - await subprocess; - if (error) { - throw error; +var getSpawnedResult = async ({ stdout, stderr: stderr2, all: all3 }, { encoding, buffer, maxBuffer }, processDone) => { + const stdoutPromise = getStreamPromise(stdout, { encoding, buffer, maxBuffer }); + const stderrPromise = getStreamPromise(stderr2, { encoding, buffer, maxBuffer }); + const allPromise = getStreamPromise(all3, { encoding, buffer, maxBuffer: maxBuffer * 2 }); + try { + return await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]); + } catch (error) { + return Promise.all([ + { error, signal: error.signal, timedOut: error.timedOut }, + getBufferedData(stdout, stdoutPromise), + getBufferedData(stderr2, stderrPromise), + getBufferedData(all3, allPromise) + ]); } }; -var destroyOtherStream = (stream4, isOpen, error) => { - if (error && !isStreamAbort(error)) { - stream4.destroy(error); - } else if (isOpen) { - stream4.destroy(); + +// node_modules/execa/lib/promise.js +var nativePromisePrototype = (async () => { +})().constructor.prototype; +var descriptors = ["then", "catch", "finally"].map((property) => [ + property, + Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) +]); +var mergePromise = (spawned, promise) => { + for (const [property, descriptor] of descriptors) { + const value = typeof promise === "function" ? (...args) => Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise); + Reflect.defineProperty(spawned, property, { ...descriptor, value }); } }; - -// node_modules/execa/lib/convert/readable.js -var createReadable = ({ subprocess, concurrentStreams, encoding }, { from, binary: binaryOption = true, preserveNewlines = true } = {}) => { - const binary = binaryOption || BINARY_ENCODINGS.has(encoding); - const { subprocessStdout, waitReadableDestroy } = getSubprocessStdout(subprocess, from, concurrentStreams); - const { readableEncoding, readableObjectMode, readableHighWaterMark } = getReadableOptions(subprocessStdout, binary); - const { read, onStdoutDataDone } = getReadableMethods({ - subprocessStdout, - subprocess, - binary, - encoding, - preserveNewlines +var getSpawnedPromise = (spawned) => new Promise((resolve, reject) => { + spawned.on("exit", (exitCode, signal) => { + resolve({ exitCode, signal }); }); - const readable2 = new import_node_stream6.Readable({ - read, - destroy: (0, import_node_util8.callbackify)(onReadableDestroy.bind(void 0, { subprocessStdout, subprocess, waitReadableDestroy })), - highWaterMark: readableHighWaterMark, - objectMode: readableObjectMode, - encoding: readableEncoding + spawned.on("error", (error) => { + reject(error); }); - onStdoutFinished({ - subprocessStdout, - onStdoutDataDone, - readable: readable2, - subprocess - }); - return readable2; -}; -var getSubprocessStdout = (subprocess, from, concurrentStreams) => { - const subprocessStdout = getFromStream(subprocess, from); - const waitReadableDestroy = addConcurrentStream(concurrentStreams, subprocessStdout, "readableDestroy"); - return { subprocessStdout, waitReadableDestroy }; -}; -var getReadableOptions = ({ readableEncoding, readableObjectMode, readableHighWaterMark }, binary) => binary ? { readableEncoding, readableObjectMode, readableHighWaterMark } : { readableEncoding, readableObjectMode: true, readableHighWaterMark: DEFAULT_OBJECT_HIGH_WATER_MARK }; -var getReadableMethods = ({ subprocessStdout, subprocess, binary, encoding, preserveNewlines }) => { - const onStdoutDataDone = createDeferred(); - const onStdoutData = iterateOnSubprocessStream({ - subprocessStdout, - subprocess, - binary, - shouldEncode: !binary, - encoding, - preserveNewlines - }); - return { - read() { - onRead(this, onStdoutData, onStdoutDataDone); - }, - onStdoutDataDone - }; -}; -var onRead = async (readable2, onStdoutData, onStdoutDataDone) => { - try { - const { value, done } = await onStdoutData.next(); - if (done) { - onStdoutDataDone.resolve(); - } else { - readable2.push(value); - } - } catch { + if (spawned.stdin) { + spawned.stdin.on("error", (error) => { + reject(error); + }); } -}; -var onStdoutFinished = async ({ subprocessStdout, onStdoutDataDone, readable: readable2, subprocess, subprocessStdin }) => { - try { - await waitForSubprocessStdout(subprocessStdout); - await subprocess; - await safeWaitForSubprocessStdin(subprocessStdin); - await onStdoutDataDone; - if (readable2.readable) { - readable2.push(null); - } - } catch (error) { - await safeWaitForSubprocessStdin(subprocessStdin); - destroyOtherReadable(readable2, error); +}); + +// node_modules/execa/lib/command.js +var import_node_buffer = require("node:buffer"); +var import_node_child_process2 = require("node:child_process"); +var normalizeArgs = (file, args = []) => { + if (!Array.isArray(args)) { + return [file]; } + return [file, ...args]; }; -var onReadableDestroy = async ({ subprocessStdout, subprocess, waitReadableDestroy }, error) => { - if (await waitForConcurrentStreams(waitReadableDestroy, subprocess)) { - destroyOtherReadable(subprocessStdout, error); - await waitForSubprocess(subprocess, error); +var NO_ESCAPE_REGEXP = /^[\w.-]+$/; +var DOUBLE_QUOTES_REGEXP = /"/g; +var escapeArg = (arg) => { + if (typeof arg !== "string" || NO_ESCAPE_REGEXP.test(arg)) { + return arg; } + return `"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\"')}"`; }; -var destroyOtherReadable = (stream4, error) => { - destroyOtherStream(stream4, stream4.readable, error); -}; - -// node_modules/execa/lib/convert/writable.js -var import_node_stream7 = require("node:stream"); -var import_node_util9 = require("node:util"); -var createWritable = ({ subprocess, concurrentStreams }, { to } = {}) => { - const { subprocessStdin, waitWritableFinal, waitWritableDestroy } = getSubprocessStdin(subprocess, to, concurrentStreams); - const writable2 = new import_node_stream7.Writable({ - ...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal), - destroy: (0, import_node_util9.callbackify)(onWritableDestroy.bind(void 0, { - subprocessStdin, - subprocess, - waitWritableFinal, - waitWritableDestroy - })), - highWaterMark: subprocessStdin.writableHighWaterMark, - objectMode: subprocessStdin.writableObjectMode - }); - onStdinFinished(subprocessStdin, writable2); - return writable2; -}; -var getSubprocessStdin = (subprocess, to, concurrentStreams) => { - const subprocessStdin = getToStream(subprocess, to); - const waitWritableFinal = addConcurrentStream(concurrentStreams, subprocessStdin, "writableFinal"); - const waitWritableDestroy = addConcurrentStream(concurrentStreams, subprocessStdin, "writableDestroy"); - return { subprocessStdin, waitWritableFinal, waitWritableDestroy }; -}; -var getWritableMethods = (subprocessStdin, subprocess, waitWritableFinal) => ({ - write: onWrite.bind(void 0, subprocessStdin), - final: (0, import_node_util9.callbackify)(onWritableFinal.bind(void 0, subprocessStdin, subprocess, waitWritableFinal)) -}); -var onWrite = (subprocessStdin, chunk, encoding, done) => { - if (subprocessStdin.write(chunk, encoding)) { - done(); - } else { - subprocessStdin.once("drain", done); +var joinCommand = (file, args) => normalizeArgs(file, args).join(" "); +var getEscapedCommand = (file, args) => normalizeArgs(file, args).map((arg) => escapeArg(arg)).join(" "); +var SPACES_REGEXP = / +/g; +var parseExpression = (expression) => { + const typeOfExpression = typeof expression; + if (typeOfExpression === "string") { + return expression; } -}; -var onWritableFinal = async (subprocessStdin, subprocess, waitWritableFinal) => { - if (await waitForConcurrentStreams(waitWritableFinal, subprocess)) { - if (subprocessStdin.writable) { - subprocessStdin.end(); - } - await subprocess; + if (typeOfExpression === "number") { + return String(expression); } -}; -var onStdinFinished = async (subprocessStdin, writable2, subprocessStdout) => { - try { - await waitForSubprocessStdin(subprocessStdin); - if (writable2.writable) { - writable2.end(); + if (typeOfExpression === "object" && expression !== null && !(expression instanceof import_node_child_process2.ChildProcess) && "stdout" in expression) { + const typeOfStdout = typeof expression.stdout; + if (typeOfStdout === "string") { + return expression.stdout; } - } catch (error) { - await safeWaitForSubprocessStdout(subprocessStdout); - destroyOtherWritable(writable2, error); - } -}; -var onWritableDestroy = async ({ subprocessStdin, subprocess, waitWritableFinal, waitWritableDestroy }, error) => { - await waitForConcurrentStreams(waitWritableFinal, subprocess); - if (await waitForConcurrentStreams(waitWritableDestroy, subprocess)) { - destroyOtherWritable(subprocessStdin, error); - await waitForSubprocess(subprocess, error); - } -}; -var destroyOtherWritable = (stream4, error) => { - destroyOtherStream(stream4, stream4.writable, error); -}; - -// node_modules/execa/lib/convert/duplex.js -var import_node_stream8 = require("node:stream"); -var import_node_util10 = require("node:util"); -var createDuplex = ({ subprocess, concurrentStreams, encoding }, { from, to, binary: binaryOption = true, preserveNewlines = true } = {}) => { - const binary = binaryOption || BINARY_ENCODINGS.has(encoding); - const { subprocessStdout, waitReadableDestroy } = getSubprocessStdout(subprocess, from, concurrentStreams); - const { subprocessStdin, waitWritableFinal, waitWritableDestroy } = getSubprocessStdin(subprocess, to, concurrentStreams); - const { readableEncoding, readableObjectMode, readableHighWaterMark } = getReadableOptions(subprocessStdout, binary); - const { read, onStdoutDataDone } = getReadableMethods({ - subprocessStdout, - subprocess, - binary, - encoding, - preserveNewlines - }); - const duplex2 = new import_node_stream8.Duplex({ - read, - ...getWritableMethods(subprocessStdin, subprocess, waitWritableFinal), - destroy: (0, import_node_util10.callbackify)(onDuplexDestroy.bind(void 0, { - subprocessStdout, - subprocessStdin, - subprocess, - waitReadableDestroy, - waitWritableFinal, - waitWritableDestroy - })), - readableHighWaterMark, - writableHighWaterMark: subprocessStdin.writableHighWaterMark, - readableObjectMode, - writableObjectMode: subprocessStdin.writableObjectMode, - encoding: readableEncoding - }); - onStdoutFinished({ - subprocessStdout, - onStdoutDataDone, - readable: duplex2, - subprocess, - subprocessStdin - }); - onStdinFinished(subprocessStdin, duplex2, subprocessStdout); - return duplex2; -}; -var onDuplexDestroy = async ({ subprocessStdout, subprocessStdin, subprocess, waitReadableDestroy, waitWritableFinal, waitWritableDestroy }, error) => { - await Promise.all([ - onReadableDestroy({ subprocessStdout, subprocess, waitReadableDestroy }, error), - onWritableDestroy({ - subprocessStdin, - subprocess, - waitWritableFinal, - waitWritableDestroy - }, error) - ]); + if (import_node_buffer.Buffer.isBuffer(expression.stdout)) { + return expression.stdout.toString(); + } + throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`); + } + throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`); }; - -// node_modules/execa/lib/convert/iterable.js -var createIterable = (subprocess, encoding, { - from, - binary: binaryOption = false, - preserveNewlines = false -} = {}) => { - const binary = binaryOption || BINARY_ENCODINGS.has(encoding); - const subprocessStdout = getFromStream(subprocess, from); - const onStdoutData = iterateOnSubprocessStream({ - subprocessStdout, - subprocess, - binary, - shouldEncode: true, - encoding, - preserveNewlines - }); - return iterateOnStdoutData(onStdoutData, subprocessStdout, subprocess); +var concatTokens = (tokens, nextTokens, isNew) => isNew || tokens.length === 0 || nextTokens.length === 0 ? [...tokens, ...nextTokens] : [ + ...tokens.slice(0, -1), + `${tokens[tokens.length - 1]}${nextTokens[0]}`, + ...nextTokens.slice(1) +]; +var parseTemplate = ({ templates, expressions, tokens, index, template }) => { + const templateString = template ?? templates.raw[index]; + const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean); + const newTokens = concatTokens( + tokens, + templateTokens, + templateString.startsWith(" ") + ); + if (index === expressions.length) { + return newTokens; + } + const expression = expressions[index]; + const expressionTokens = Array.isArray(expression) ? expression.map((expression2) => parseExpression(expression2)) : [parseExpression(expression)]; + return concatTokens( + newTokens, + expressionTokens, + templateString.endsWith(" ") + ); }; -var iterateOnStdoutData = async function* (onStdoutData, subprocessStdout, subprocess) { - try { - yield* onStdoutData; - } finally { - if (subprocessStdout.readable) { - subprocessStdout.destroy(); - } - await subprocess; +var parseTemplates = (templates, expressions) => { + let tokens = []; + for (const [index, template] of templates.entries()) { + tokens = parseTemplate({ templates, expressions, tokens, index, template }); } + return tokens; }; -// node_modules/execa/lib/convert/add.js -var addConvertedStreams = (subprocess, { encoding }) => { - const concurrentStreams = initializeConcurrentStreams(); - subprocess.readable = createReadable.bind(void 0, { subprocess, concurrentStreams, encoding }); - subprocess.writable = createWritable.bind(void 0, { subprocess, concurrentStreams }); - subprocess.duplex = createDuplex.bind(void 0, { subprocess, concurrentStreams, encoding }); - subprocess.iterable = createIterable.bind(void 0, subprocess, encoding); - subprocess[Symbol.asyncIterator] = createIterable.bind(void 0, subprocess, encoding, {}); +// node_modules/execa/lib/verbose.js +var import_node_util = require("node:util"); +var import_node_process6 = __toESM(require("node:process"), 1); +var verboseDefault = (0, import_node_util.debuglog)("execa").enabled; +var padField = (field, padding) => String(field).padStart(padding, "0"); +var getTimestamp = () => { + const date = new Date(); + return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`; }; - -// node_modules/execa/lib/methods/promise.js -var mergePromise = (subprocess, promise) => { - for (const [property, descriptor] of descriptors) { - const value = descriptor.value.bind(promise); - Reflect.defineProperty(subprocess, property, { ...descriptor, value }); +var logCommand = (escapedCommand, { verbose }) => { + if (!verbose) { + return; } + import_node_process6.default.stderr.write(`[${getTimestamp()}] ${escapedCommand} +`); }; -var nativePromisePrototype = (async () => { -})().constructor.prototype; -var descriptors = ["then", "catch", "finally"].map((property) => [ - property, - Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property) -]); -// node_modules/execa/lib/methods/main-async.js -var execaCoreAsync = (rawFile, rawArguments, rawOptions, createNested) => { - const { file, commandArguments, command, escapedCommand, startTime, verboseInfo, options, fileDescriptors } = handleAsyncArguments(rawFile, rawArguments, rawOptions); - const { subprocess, promise } = spawnSubprocessAsync({ - file, - commandArguments, - options, - startTime, - verboseInfo, - command, - escapedCommand, - fileDescriptors - }); - subprocess.pipe = pipeToSubprocess.bind(void 0, { - source: subprocess, - sourcePromise: promise, - boundOptions: {}, - createNested - }); - mergePromise(subprocess, promise); - SUBPROCESS_OPTIONS.set(subprocess, { options, fileDescriptors }); - return subprocess; -}; -var handleAsyncArguments = (rawFile, rawArguments, rawOptions) => { - const { command, escapedCommand, startTime, verboseInfo } = handleCommand(rawFile, rawArguments, rawOptions); - const { file, commandArguments, options: normalizedOptions } = normalizeOptions(rawFile, rawArguments, rawOptions); - const options = handleAsyncOptions(normalizedOptions); - const fileDescriptors = handleStdioAsync(options, verboseInfo); - return { - file, - commandArguments, - command, - escapedCommand, - startTime, - verboseInfo, - options, - fileDescriptors +// node_modules/execa/index.js +var DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100; +var getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => { + const env2 = extendEnv ? { ...import_node_process7.default.env, ...envOption } : envOption; + if (preferLocal) { + return npmRunPathEnv({ env: env2, cwd: localDir, execPath }); + } + return env2; +}; +var handleArguments = (file, args, options = {}) => { + const parsed = import_cross_spawn.default._parse(file, args, options); + file = parsed.command; + args = parsed.args; + options = parsed.options; + options = { + maxBuffer: DEFAULT_MAX_BUFFER, + buffer: true, + stripFinalNewline: true, + extendEnv: true, + preferLocal: false, + localDir: options.cwd || import_node_process7.default.cwd(), + execPath: import_node_process7.default.execPath, + encoding: "utf8", + reject: true, + cleanup: true, + all: false, + windowsHide: true, + verbose: verboseDefault, + ...options }; + options.env = getEnv(options); + options.stdio = normalizeStdio(options); + if (import_node_process7.default.platform === "win32" && import_node_path2.default.basename(file, ".exe") === "cmd") { + args.unshift("/q"); + } + return { file, args, options, parsed }; }; -var handleAsyncOptions = ({ timeout, signal, ...options }) => { - if (signal !== void 0) { - throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.'); +var handleOutput = (options, value, error) => { + if (typeof value !== "string" && !import_node_buffer2.Buffer.isBuffer(value)) { + return error === void 0 ? void 0 : ""; + } + if (options.stripFinalNewline) { + return stripFinalNewline(value); } - return { ...options, timeoutDuration: timeout }; + return value; }; -var spawnSubprocessAsync = ({ file, commandArguments, options, startTime, verboseInfo, command, escapedCommand, fileDescriptors }) => { - let subprocess; +function execa(file, args, options) { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); + const escapedCommand = getEscapedCommand(file, args); + logCommand(escapedCommand, parsed.options); + validateTimeout(parsed.options); + let spawned; + try { + spawned = import_node_child_process3.default.spawn(parsed.file, parsed.args, parsed.options); + } catch (error) { + const dummySpawned = new import_node_child_process3.default.ChildProcess(); + const errorPromise = Promise.reject(makeError({ + error, + stdout: "", + stderr: "", + all: "", + command, + escapedCommand, + parsed, + timedOut: false, + isCanceled: false, + killed: false + })); + mergePromise(dummySpawned, errorPromise); + return dummySpawned; + } + const spawnedPromise = getSpawnedPromise(spawned); + const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise); + const processDone = setExitHandler(spawned, parsed.options, timedPromise); + const context = { isCanceled: false }; + spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned)); + spawned.cancel = spawnedCancel.bind(null, spawned, context); + const handlePromise = async () => { + const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone); + const stdout = handleOutput(parsed.options, stdoutResult); + const stderr2 = handleOutput(parsed.options, stderrResult); + const all3 = handleOutput(parsed.options, allResult); + if (error || exitCode !== 0 || signal !== null) { + const returnedError = makeError({ + error, + exitCode, + signal, + stdout, + stderr: stderr2, + all: all3, + command, + escapedCommand, + parsed, + timedOut, + isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false), + killed: spawned.killed + }); + if (!parsed.options.reject) { + return returnedError; + } + throw returnedError; + } + return { + command, + escapedCommand, + exitCode: 0, + stdout, + stderr: stderr2, + all: all3, + failed: false, + timedOut: false, + isCanceled: false, + killed: false + }; + }; + const handlePromiseOnce = onetime_default(handlePromise); + handleInput(spawned, parsed.options); + spawned.all = makeAllStream(spawned, parsed.options); + addPipeMethods(spawned); + mergePromise(spawned, handlePromiseOnce); + return spawned; +} +function execaSync(file, args, options) { + const parsed = handleArguments(file, args, options); + const command = joinCommand(file, args); + const escapedCommand = getEscapedCommand(file, args); + logCommand(escapedCommand, parsed.options); + const input = handleInputSync(parsed.options); + let result; try { - subprocess = (0, import_node_child_process4.spawn)(file, commandArguments, options); + result = import_node_child_process3.default.spawnSync(parsed.file, parsed.args, { ...parsed.options, input }); } catch (error) { - return handleEarlyError({ + throw makeError({ error, + stdout: "", + stderr: "", + all: "", command, escapedCommand, - fileDescriptors, - options, - startTime, - verboseInfo + parsed, + timedOut: false, + isCanceled: false, + killed: false }); } - const controller = new AbortController(); - (0, import_node_events14.setMaxListeners)(Number.POSITIVE_INFINITY, controller.signal); - const originalStreams = [...subprocess.stdio]; - pipeOutputAsync(subprocess, fileDescriptors, controller); - cleanupOnExit(subprocess, options, controller); - const context = {}; - const onInternalError = createDeferred(); - subprocess.kill = subprocessKill.bind(void 0, { - kill: subprocess.kill.bind(subprocess), - options, - onInternalError, - context, - controller - }); - subprocess.all = makeAllStream(subprocess, options); - addConvertedStreams(subprocess, options); - addIpcMethods(subprocess, options); - const promise = handlePromise({ - subprocess, - options, - startTime, - verboseInfo, - fileDescriptors, - originalStreams, - command, - escapedCommand, - context, - onInternalError, - controller - }); - return { subprocess, promise }; -}; -var handlePromise = async ({ subprocess, options, startTime, verboseInfo, fileDescriptors, originalStreams, command, escapedCommand, context, onInternalError, controller }) => { - const [ - errorInfo, - [exitCode, signal], - stdioResults, - allResult, - ipcOutput - ] = await waitForSubprocessResult({ - subprocess, - options, - context, - verboseInfo, - fileDescriptors, - originalStreams, - onInternalError, - controller - }); - controller.abort(); - onInternalError.resolve(); - const stdio = stdioResults.map((stdioResult, fdNumber) => stripNewline(stdioResult, options, fdNumber)); - const all3 = stripNewline(allResult, options, "all"); - const result = getAsyncResult({ - errorInfo, - exitCode, - signal, - stdio, - all: all3, - ipcOutput, - context, - options, + const stdout = handleOutput(parsed.options, result.stdout, result.error); + const stderr2 = handleOutput(parsed.options, result.stderr, result.error); + if (result.error || result.status !== 0 || result.signal !== null) { + const error = makeError({ + stdout, + stderr: stderr2, + error: result.error, + signal: result.signal, + exitCode: result.status, + command, + escapedCommand, + parsed, + timedOut: result.error && result.error.code === "ETIMEDOUT", + isCanceled: false, + killed: result.signal !== null + }); + if (!parsed.options.reject) { + return error; + } + throw error; + } + return { command, escapedCommand, - startTime - }); - return handleResult(result, verboseInfo, options); -}; -var getAsyncResult = ({ errorInfo, exitCode, signal, stdio, all: all3, ipcOutput, context, options, command, escapedCommand, startTime }) => "error" in errorInfo ? makeError({ - error: errorInfo.error, - command, - escapedCommand, - timedOut: context.terminationReason === "timeout", - isCanceled: context.terminationReason === "cancel" || context.terminationReason === "gracefulCancel", - isGracefullyCanceled: context.terminationReason === "gracefulCancel", - isMaxBuffer: errorInfo.error instanceof MaxBufferError, - isForcefullyTerminated: context.isForcefullyTerminated, - exitCode, - signal, - stdio, - all: all3, - ipcOutput, - options, - startTime, - isSync: false -}) : makeSuccessResult({ - command, - escapedCommand, - stdio, - all: all3, - ipcOutput, - options, - startTime -}); - -// node_modules/execa/lib/methods/bind.js -var mergeOptions = (boundOptions, options) => { - const newOptions = Object.fromEntries( - Object.entries(options).map(([optionName, optionValue]) => [ - optionName, - mergeOption(optionName, boundOptions[optionName], optionValue) - ]) - ); - return { ...boundOptions, ...newOptions }; -}; -var mergeOption = (optionName, boundOptionValue, optionValue) => { - if (DEEP_OPTIONS.has(optionName) && isPlainObject(boundOptionValue) && isPlainObject(optionValue)) { - return { ...boundOptionValue, ...optionValue }; - } - return optionValue; -}; -var DEEP_OPTIONS = /* @__PURE__ */ new Set(["env", ...FD_SPECIFIC_OPTIONS]); - -// node_modules/execa/lib/methods/create.js -var createExeca = (mapArguments, boundOptions, deepOptions, setBoundExeca) => { - const createNested = (mapArguments2, boundOptions2, setBoundExeca2) => createExeca(mapArguments2, boundOptions2, deepOptions, setBoundExeca2); - const boundExeca = (...execaArguments) => callBoundExeca({ - mapArguments, - deepOptions, - boundOptions, - setBoundExeca, - createNested - }, ...execaArguments); - if (setBoundExeca !== void 0) { - setBoundExeca(boundExeca, createNested, boundOptions); - } - return boundExeca; -}; -var callBoundExeca = ({ mapArguments, deepOptions = {}, boundOptions = {}, setBoundExeca, createNested }, firstArgument, ...nextArguments) => { - if (isPlainObject(firstArgument)) { - return createNested(mapArguments, mergeOptions(boundOptions, firstArgument), setBoundExeca); - } - const { file, commandArguments, options, isSync } = parseArguments({ - mapArguments, - firstArgument, - nextArguments, - deepOptions, - boundOptions - }); - return isSync ? execaCoreSync(file, commandArguments, options) : execaCoreAsync(file, commandArguments, options, createNested); -}; -var parseArguments = ({ mapArguments, firstArgument, nextArguments, deepOptions, boundOptions }) => { - const callArguments = isTemplateString(firstArgument) ? parseTemplates(firstArgument, nextArguments) : [firstArgument, ...nextArguments]; - const [initialFile, initialArguments, initialOptions] = normalizeParameters(...callArguments); - const mergedOptions = mergeOptions(mergeOptions(deepOptions, boundOptions), initialOptions); - const { - file = initialFile, - commandArguments = initialArguments, - options = mergedOptions, - isSync = false - } = mapArguments({ file: initialFile, commandArguments: initialArguments, options: mergedOptions }); - return { - file, - commandArguments, - options, - isSync + exitCode: 0, + stdout, + stderr: stderr2, + failed: false, + timedOut: false, + isCanceled: false, + killed: false }; -}; - -// node_modules/execa/lib/methods/command.js -var mapCommandAsync = ({ file, commandArguments }) => parseCommand(file, commandArguments); -var mapCommandSync = ({ file, commandArguments }) => ({ ...parseCommand(file, commandArguments), isSync: true }); -var parseCommand = (command, unusedArguments) => { - if (unusedArguments.length > 0) { - throw new TypeError(`The command and its arguments must be passed as a single string: ${command} ${unusedArguments}.`); - } - const [file, ...commandArguments] = parseCommandString(command); - return { file, commandArguments }; -}; -var parseCommandString = (command) => { - if (typeof command !== "string") { - throw new TypeError(`The command must be a string: ${String(command)}.`); - } - const trimmedCommand = command.trim(); - if (trimmedCommand === "") { - return []; - } - const tokens = []; - for (const token of trimmedCommand.split(SPACES_REGEXP)) { - const previousToken = tokens.at(-1); - if (previousToken && previousToken.endsWith("\\")) { - tokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`; - } else { - tokens.push(token); +} +var normalizeScriptStdin = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {}; +var normalizeScriptOptions = (options = {}) => ({ + preferLocal: true, + ...normalizeScriptStdin(options), + ...options +}); +function create$(options) { + function $6(templatesOrOptions, ...expressions) { + if (!Array.isArray(templatesOrOptions)) { + return create$({ ...options, ...templatesOrOptions }); } + const [file, ...args] = parseTemplates(templatesOrOptions, expressions); + return execa(file, args, normalizeScriptOptions(options)); } - return tokens; -}; -var SPACES_REGEXP = / +/g; - -// node_modules/execa/lib/methods/script.js -var setScriptSync = (boundExeca, createNested, boundOptions) => { - boundExeca.sync = createNested(mapScriptSync, boundOptions); - boundExeca.s = boundExeca.sync; -}; -var mapScriptAsync = ({ options }) => getScriptOptions(options); -var mapScriptSync = ({ options }) => ({ ...getScriptOptions(options), isSync: true }); -var getScriptOptions = (options) => ({ options: { ...getScriptStdinOption(options), ...options } }); -var getScriptStdinOption = ({ input, inputFile, stdio }) => input === void 0 && inputFile === void 0 && stdio === void 0 ? { stdin: "inherit" } : {}; -var deepScriptOptions = { preferLocal: true }; - -// node_modules/execa/index.js -var execa = createExeca(() => ({})); -var execaSync = createExeca(() => ({ isSync: true })); -var execaCommand = createExeca(mapCommandAsync); -var execaCommandSync = createExeca(mapCommandSync); -var execaNode = createExeca(mapNode); -var $4 = createExeca(mapScriptAsync, {}, deepScriptOptions, setScriptSync); -var { - sendMessage: sendMessage2, - getOneMessage: getOneMessage2, - getEachMessage: getEachMessage2, - getCancelSignal: getCancelSignal2 -} = getIpcExport(); + $6.sync = (templates, ...expressions) => { + if (!Array.isArray(templates)) { + throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`."); + } + const [file, ...args] = parseTemplates(templates, expressions); + return execaSync(file, args, normalizeScriptOptions(options)); + }; + return $6; +} +var $4 = create$(); // src/commands/config.ts var dotenv = __toESM(require_main(), 1); @@ -32943,8 +29867,8 @@ var I18N_CONFIG_ALIAS = { }; function getI18nLocal(value) { for (const key in I18N_CONFIG_ALIAS) { - const aliases = I18N_CONFIG_ALIAS[key]; - if (aliases.includes(value)) { + const aliases2 = I18N_CONFIG_ALIAS[key]; + if (aliases2.includes(value)) { return key; } } @@ -32952,33 +29876,6 @@ function getI18nLocal(value) { } // src/commands/config.ts -var CONFIG_KEYS = /* @__PURE__ */ ((CONFIG_KEYS2) => { - CONFIG_KEYS2["OCO_OPENAI_API_KEY"] = "OCO_OPENAI_API_KEY"; - CONFIG_KEYS2["OCO_ANTHROPIC_API_KEY"] = "OCO_ANTHROPIC_API_KEY"; - CONFIG_KEYS2["OCO_AZURE_API_KEY"] = "OCO_AZURE_API_KEY"; - CONFIG_KEYS2["OCO_GEMINI_API_KEY"] = "OCO_GEMINI_API_KEY"; - CONFIG_KEYS2["OCO_GEMINI_BASE_PATH"] = "OCO_GEMINI_BASE_PATH"; - CONFIG_KEYS2["OCO_TOKENS_MAX_INPUT"] = "OCO_TOKENS_MAX_INPUT"; - CONFIG_KEYS2["OCO_TOKENS_MAX_OUTPUT"] = "OCO_TOKENS_MAX_OUTPUT"; - CONFIG_KEYS2["OCO_OPENAI_BASE_PATH"] = "OCO_OPENAI_BASE_PATH"; - CONFIG_KEYS2["OCO_DESCRIPTION"] = "OCO_DESCRIPTION"; - CONFIG_KEYS2["OCO_EMOJI"] = "OCO_EMOJI"; - CONFIG_KEYS2["OCO_MODEL"] = "OCO_MODEL"; - CONFIG_KEYS2["OCO_LANGUAGE"] = "OCO_LANGUAGE"; - CONFIG_KEYS2["OCO_WHY"] = "OCO_WHY"; - CONFIG_KEYS2["OCO_MESSAGE_TEMPLATE_PLACEHOLDER"] = "OCO_MESSAGE_TEMPLATE_PLACEHOLDER"; - CONFIG_KEYS2["OCO_PROMPT_MODULE"] = "OCO_PROMPT_MODULE"; - CONFIG_KEYS2["OCO_AI_PROVIDER"] = "OCO_AI_PROVIDER"; - CONFIG_KEYS2["OCO_GITPUSH"] = "OCO_GITPUSH"; - CONFIG_KEYS2["OCO_ONE_LINE_COMMIT"] = "OCO_ONE_LINE_COMMIT"; - CONFIG_KEYS2["OCO_AZURE_ENDPOINT"] = "OCO_AZURE_ENDPOINT"; - CONFIG_KEYS2["OCO_TEST_MOCK_TYPE"] = "OCO_TEST_MOCK_TYPE"; - CONFIG_KEYS2["OCO_API_URL"] = "OCO_API_URL"; - CONFIG_KEYS2["OCO_OLLAMA_API_URL"] = "OCO_OLLAMA_API_URL"; - CONFIG_KEYS2["OCO_FLOWISE_ENDPOINT"] = "OCO_FLOWISE_ENDPOINT"; - CONFIG_KEYS2["OCO_FLOWISE_API_KEY"] = "OCO_FLOWISE_API_KEY"; - return CONFIG_KEYS2; -})(CONFIG_KEYS || {}); var MODEL_LIST = { openai: [ "gpt-4o-mini", @@ -33044,56 +29941,18 @@ var validateConfig = (key, condition, validationMessage) => { } }; var configValidators = { - ["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value, config7 = {}) { + ["OCO_API_KEY" /* OCO_API_KEY */](value, config7 = {}) { if (config7.OCO_AI_PROVIDER !== "openai") return value; validateConfig( - "OCO_OPENAI_API_KEY", + "OCO_API_KEY", typeof value === "string" && value.length > 0, "Empty value is not allowed" ); validateConfig( - "OCO_OPENAI_API_KEY", + "OCO_API_KEY", value, - 'You need to provide the OCO_OPENAI_API_KEY when OCO_AI_PROVIDER is set to "openai" (default). Run `oco config set OCO_OPENAI_API_KEY=your_key`' - ); - return value; - }, - ["OCO_AZURE_API_KEY" /* OCO_AZURE_API_KEY */](value, config7 = {}) { - if (config7.OCO_AI_PROVIDER !== "azure") - return value; - validateConfig( - "OCO_AZURE_API_KEY", - !!value, - 'You need to provide the OCO_AZURE_API_KEY when OCO_AI_PROVIDER is set to "azure". Run: `oco config set OCO_AZURE_API_KEY=your_key`' - ); - return value; - }, - ["OCO_GEMINI_API_KEY" /* OCO_GEMINI_API_KEY */](value, config7 = {}) { - if (config7.OCO_AI_PROVIDER !== "gemini") - return value; - validateConfig( - "OCO_GEMINI_API_KEY", - value || config7.OCO_GEMINI_API_KEY || config7.OCO_AI_PROVIDER === "test", - 'You need to provide the OCO_GEMINI_API_KEY when OCO_AI_PROVIDER is set to "gemini". Run: `oco config set OCO_GEMINI_API_KEY=your_key`' - ); - return value; - }, - ["OCO_ANTHROPIC_API_KEY" /* OCO_ANTHROPIC_API_KEY */](value, config7 = {}) { - if (config7.OCO_AI_PROVIDER !== "anthropic") - return value; - validateConfig( - "ANTHROPIC_API_KEY", - !!value, - 'You need to provide the OCO_ANTHROPIC_API_KEY key when OCO_AI_PROVIDER is set to "anthropic". Run: `oco config set OCO_ANTHROPIC_API_KEY=your_key`' - ); - return value; - }, - ["OCO_FLOWISE_API_KEY" /* OCO_FLOWISE_API_KEY */](value, config7 = {}) { - validateConfig( - "OCO_FLOWISE_API_KEY" /* OCO_FLOWISE_API_KEY */, - value || config7.OCO_AI_PROVIDER !== "flowise", - 'You need to provide the OCO_FLOWISE_API_KEY when OCO_AI_PROVIDER is set to "flowise". Run: `oco config set OCO_FLOWISE_API_KEY=your_key`' + 'You need to provide the OCO_API_KEY when OCO_AI_PROVIDER set to "openai" (default) or "ollama" or "azure" or "gemini" or "flowise" or "anthropic". Run `oco config set OCO_API_KEY=your_key OCO_AI_PROVIDER=openai`' ); return value; }, @@ -33140,11 +29999,11 @@ var configValidators = { ); return getI18nLocal(value); }, - ["OCO_OPENAI_BASE_PATH" /* OCO_OPENAI_BASE_PATH */](value) { + ["OCO_API_URL" /* OCO_API_URL */](value) { validateConfig( - "OCO_OPENAI_BASE_PATH" /* OCO_OPENAI_BASE_PATH */, + "OCO_API_URL" /* OCO_API_URL */, typeof value === "string", - "Must be string" + `${value} is not a valid URL. It should start with 'http://' or 'https://'.` ); return value; }, @@ -33206,22 +30065,6 @@ var configValidators = { ); return value; }, - ["OCO_AZURE_ENDPOINT" /* OCO_AZURE_ENDPOINT */](value) { - validateConfig( - "OCO_AZURE_ENDPOINT" /* OCO_AZURE_ENDPOINT */, - value.includes("openai.azure.com"), - 'Must be in format "https://.openai.azure.com/"' - ); - return value; - }, - ["OCO_FLOWISE_ENDPOINT" /* OCO_FLOWISE_ENDPOINT */](value) { - validateConfig( - "OCO_FLOWISE_ENDPOINT" /* OCO_FLOWISE_ENDPOINT */, - typeof value === "string" && value.includes(":"), - "Value must be string and should include both I.P. and port number" - ); - return value; - }, ["OCO_TEST_MOCK_TYPE" /* OCO_TEST_MOCK_TYPE */](value) { validateConfig( "OCO_TEST_MOCK_TYPE" /* OCO_TEST_MOCK_TYPE */, @@ -33232,15 +30075,25 @@ var configValidators = { ); return value; }, - ["OCO_OLLAMA_API_URL" /* OCO_OLLAMA_API_URL */](value) { + ["OCO_WHY" /* OCO_WHY */](value) { validateConfig( - "OCO_OLLAMA_API_URL" /* OCO_OLLAMA_API_URL */, - typeof value === "string" && value.startsWith("http"), - `${value} is not a valid URL. It should start with 'http://' or 'https://'.` + "OCO_WHY" /* OCO_WHY */, + typeof value === "boolean", + "Must be true or false" ); return value; } }; +var OCO_AI_PROVIDER_ENUM = /* @__PURE__ */ ((OCO_AI_PROVIDER_ENUM2) => { + OCO_AI_PROVIDER_ENUM2["OLLAMA"] = "ollama"; + OCO_AI_PROVIDER_ENUM2["OPENAI"] = "openai"; + OCO_AI_PROVIDER_ENUM2["ANTHROPIC"] = "anthropic"; + OCO_AI_PROVIDER_ENUM2["GEMINI"] = "gemini"; + OCO_AI_PROVIDER_ENUM2["AZURE"] = "azure"; + OCO_AI_PROVIDER_ENUM2["TEST"] = "test"; + OCO_AI_PROVIDER_ENUM2["FLOWISE"] = "flowise"; + return OCO_AI_PROVIDER_ENUM2; +})(OCO_AI_PROVIDER_ENUM || {}); var defaultConfigPath = (0, import_path.join)((0, import_os.homedir)(), ".opencommit"); var defaultEnvPath = (0, import_path.resolve)(process.cwd(), ".env"); var DEFAULT_CONFIG = { @@ -33263,7 +30116,7 @@ var initGlobalConfig = (configPath = defaultConfigPath) => { (0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(DEFAULT_CONFIG), "utf8"); return DEFAULT_CONFIG; }; -var parseEnvVarValue = (value) => { +var parseConfigVarValue = (value) => { try { return JSON.parse(value); } catch (error) { @@ -33274,32 +30127,32 @@ var getEnvConfig = (envPath) => { dotenv.config({ path: envPath }); return { OCO_MODEL: process.env.OCO_MODEL, - OCO_OPENAI_API_KEY: process.env.OCO_OPENAI_API_KEY, - OCO_ANTHROPIC_API_KEY: process.env.OCO_ANTHROPIC_API_KEY, - OCO_AZURE_API_KEY: process.env.OCO_AZURE_API_KEY, - OCO_GEMINI_API_KEY: process.env.OCO_GEMINI_API_KEY, - OCO_FLOWISE_API_KEY: process.env.OCO_FLOWISE_API_KEY, - OCO_TOKENS_MAX_INPUT: parseEnvVarValue(process.env.OCO_TOKENS_MAX_INPUT), - OCO_TOKENS_MAX_OUTPUT: parseEnvVarValue(process.env.OCO_TOKENS_MAX_OUTPUT), - OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH, - OCO_GEMINI_BASE_PATH: process.env.OCO_GEMINI_BASE_PATH, - OCO_AZURE_ENDPOINT: process.env.OCO_AZURE_ENDPOINT, - OCO_FLOWISE_ENDPOINT: process.env.OCO_FLOWISE_ENDPOINT, - OCO_OLLAMA_API_URL: process.env.OCO_OLLAMA_API_URL, - OCO_DESCRIPTION: parseEnvVarValue(process.env.OCO_DESCRIPTION), - OCO_EMOJI: parseEnvVarValue(process.env.OCO_EMOJI), + OCO_API_URL: process.env.OCO_API_URL, + OCO_API_KEY: process.env.OCO_API_KEY, + OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER, + OCO_TOKENS_MAX_INPUT: parseConfigVarValue(process.env.OCO_TOKENS_MAX_INPUT), + OCO_TOKENS_MAX_OUTPUT: parseConfigVarValue( + process.env.OCO_TOKENS_MAX_OUTPUT + ), + OCO_DESCRIPTION: parseConfigVarValue(process.env.OCO_DESCRIPTION), + OCO_EMOJI: parseConfigVarValue(process.env.OCO_EMOJI), OCO_LANGUAGE: process.env.OCO_LANGUAGE, OCO_MESSAGE_TEMPLATE_PLACEHOLDER: process.env.OCO_MESSAGE_TEMPLATE_PLACEHOLDER, OCO_PROMPT_MODULE: process.env.OCO_PROMPT_MODULE, - OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER, - OCO_ONE_LINE_COMMIT: parseEnvVarValue(process.env.OCO_ONE_LINE_COMMIT), + OCO_ONE_LINE_COMMIT: parseConfigVarValue(process.env.OCO_ONE_LINE_COMMIT), OCO_TEST_MOCK_TYPE: process.env.OCO_TEST_MOCK_TYPE, - OCO_GITPUSH: parseEnvVarValue(process.env.OCO_GITPUSH) + OCO_GITPUSH: parseConfigVarValue(process.env.OCO_GITPUSH) }; }; -var getGlobalConfig = (configPath) => { +var setGlobalConfig = (config7, configPath = defaultConfigPath) => { + (0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(config7), "utf8"); +}; +var getIsGlobalConfigFileExist = (configPath = defaultConfigPath) => { + return (0, import_fs.existsSync)(configPath); +}; +var getGlobalConfig = (configPath = defaultConfigPath) => { let globalConfig; - const isGlobalConfigFileExist = (0, import_fs.existsSync)(configPath); + const isGlobalConfigFileExist = getIsGlobalConfigFileExist(configPath); if (!isGlobalConfigFileExist) globalConfig = initGlobalConfig(configPath); else { @@ -33308,10 +30161,13 @@ var getGlobalConfig = (configPath) => { } return globalConfig; }; -var mergeConfigs = (main, fallback) => Object.keys(CONFIG_KEYS).reduce((acc, key) => { - acc[key] = parseEnvVarValue(main[key] ?? fallback[key]); - return acc; -}, {}); +var mergeConfigs = (main, fallback) => { + const allKeys = /* @__PURE__ */ new Set([...Object.keys(main), ...Object.keys(fallback)]); + return Array.from(allKeys).reduce((acc, key) => { + acc[key] = parseConfigVarValue(main[key] ?? fallback[key]); + return acc; + }, {}); +}; var getConfig = ({ envPath = defaultEnvPath, globalPath = defaultConfigPath @@ -33325,6 +30181,7 @@ var setConfig = (keyValues, globalConfigPath = defaultConfigPath) => { const config7 = getConfig({ globalPath: globalConfigPath }); + const configToSet = {}; for (let [key, value] of keyValues) { if (!configValidators.hasOwnProperty(key)) { const supportedKeys = Object.keys(configValidators).join("\n"); @@ -33338,7 +30195,10 @@ For more help refer to our docs: https://github.com/di-sukharev/opencommit` } let parsedConfigValue; try { - parsedConfigValue = JSON.parse(value); + if (typeof value === "string") + parsedConfigValue = JSON.parse(value); + else + parsedConfigValue = value; } catch (error) { parsedConfigValue = value; } @@ -33346,9 +30206,9 @@ For more help refer to our docs: https://github.com/di-sukharev/opencommit` parsedConfigValue, config7 ); - config7[key] = validValue; + configToSet[key] = validValue; } - (0, import_fs.writeFileSync)(globalConfigPath, (0, import_ini.stringify)(config7), "utf8"); + setGlobalConfig(mergeConfigs(configToSet, config7), globalConfigPath); ce(`${source_default.green("\u2714")} config successfully set`); }; var configCommand = G3( @@ -33573,7 +30433,7 @@ init_File(); // node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs var import_agentkeepalive = __toESM(require_agentkeepalive(), 1); var import_abort_controller = __toESM(require_abort_controller(), 1); -var import_node_fs7 = require("node:fs"); +var import_node_fs3 = require("node:fs"); // node_modules/form-data-encoder/lib/esm/util/createBoundary.js var alphabet = "abcdefghijklmnopqrstuvwxyz0123456789"; @@ -33589,7 +30449,7 @@ var createBoundary_default = createBoundary; // node_modules/form-data-encoder/lib/esm/util/isPlainObject.js var getType = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); -function isPlainObject2(value) { +function isPlainObject(value) { if (getType(value) !== "object") { return false; } @@ -33600,11 +30460,11 @@ function isPlainObject2(value) { const Ctor = pp.constructor && pp.constructor.toString(); return Ctor === Object.toString(); } -var isPlainObject_default = isPlainObject2; +var isPlainObject_default = isPlainObject; // node_modules/form-data-encoder/lib/esm/util/normalizeValue.js -var normalizeValue = (value) => String(value).replace(/\r|\n/g, (match, i4, str2) => { - if (match === "\r" && str2[i4 + 1] !== "\n" || match === "\n" && str2[i4 - 1] !== "\r") { +var normalizeValue = (value) => String(value).replace(/\r|\n/g, (match, i3, str2) => { + if (match === "\r" && str2[i3 + 1] !== "\n" || match === "\n" && str2[i3 - 1] !== "\r") { return "\r\n"; } return match; @@ -33752,7 +30612,7 @@ var FormDataEncoder = class { }; // node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs -var import_node_stream9 = require("node:stream"); +var import_node_stream = require("node:stream"); // node_modules/@anthropic-ai/sdk/_shims/MultipartBody.mjs var MultipartBody = class { @@ -33767,20 +30627,20 @@ var MultipartBody = class { // node_modules/@anthropic-ai/sdk/_shims/node-runtime.mjs var import_ponyfill_es2018 = __toESM(require_ponyfill_es2018(), 1); var fileFromPathWarned = false; -async function fileFromPath3(path7, ...args) { +async function fileFromPath3(path5, ...args) { const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports)); if (!fileFromPathWarned) { - console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path7)}) instead`); + console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path5)}) instead`); fileFromPathWarned = true; } - return await _fileFromPath(path7, ...args); + return await _fileFromPath(path5, ...args); } var defaultHttpAgent = new import_agentkeepalive.default({ keepAlive: true, timeout: 5 * 60 * 1e3 }); var defaultHttpsAgent = new import_agentkeepalive.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 }); async function getMultipartRequestOptions2(form, opts) { const encoder = new FormDataEncoder(form); - const readable2 = import_node_stream9.Readable.from(encoder); - const body = new MultipartBody(readable2); + const readable = import_node_stream.Readable.from(encoder); + const body = new MultipartBody(readable); const headers = { ...opts.headers, ...encoder.headers, @@ -33805,7 +30665,7 @@ function getRuntime() { getMultipartRequestOptions: getMultipartRequestOptions2, getDefaultAgent: (url2) => url2.startsWith("https") ? defaultHttpsAgent : defaultHttpAgent, fileFromPath: fileFromPath3, - isFsReadStream: (value) => value instanceof import_node_fs7.ReadStream + isFsReadStream: (value) => value instanceof import_node_fs3.ReadStream }; } @@ -34137,15 +30997,15 @@ async function* iterSSEChunks(iterator) { function findDoubleNewlineIndex(buffer) { const newline = 10; const carriage = 13; - for (let i4 = 0; i4 < buffer.length - 2; i4++) { - if (buffer[i4] === newline && buffer[i4 + 1] === newline) { - return i4 + 2; + for (let i3 = 0; i3 < buffer.length - 2; i3++) { + if (buffer[i3] === newline && buffer[i3 + 1] === newline) { + return i3 + 2; } - if (buffer[i4] === carriage && buffer[i4 + 1] === carriage) { - return i4 + 2; + if (buffer[i3] === carriage && buffer[i3 + 1] === carriage) { + return i3 + 2; } - if (buffer[i4] === carriage && buffer[i4 + 1] === newline && i4 + 3 < buffer.length && buffer[i4 + 2] === carriage && buffer[i4 + 3] === newline) { - return i4 + 4; + if (buffer[i3] === carriage && buffer[i3 + 1] === newline && i3 + 3 < buffer.length && buffer[i3 + 2] === carriage && buffer[i3 + 3] === newline) { + return i3 + 4; } } return -1; @@ -34458,26 +31318,26 @@ var APIClient = class { defaultIdempotencyKey() { return `stainless-node-retry-${uuid4()}`; } - get(path7, opts) { - return this.methodRequest("get", path7, opts); + get(path5, opts) { + return this.methodRequest("get", path5, opts); } - post(path7, opts) { - return this.methodRequest("post", path7, opts); + post(path5, opts) { + return this.methodRequest("post", path5, opts); } - patch(path7, opts) { - return this.methodRequest("patch", path7, opts); + patch(path5, opts) { + return this.methodRequest("patch", path5, opts); } - put(path7, opts) { - return this.methodRequest("put", path7, opts); + put(path5, opts) { + return this.methodRequest("put", path5, opts); } - delete(path7, opts) { - return this.methodRequest("delete", path7, opts); + delete(path5, opts) { + return this.methodRequest("delete", path5, opts); } - methodRequest(method, path7, opts) { - return this.request(Promise.resolve(opts).then((opts2) => ({ method, path: path7, ...opts2 }))); + methodRequest(method, path5, opts) { + return this.request(Promise.resolve(opts).then((opts2) => ({ method, path: path5, ...opts2 }))); } - getAPIList(path7, Page2, opts) { - return this.requestAPIList(Page2, { method: "get", path: path7, ...opts }); + getAPIList(path5, Page2, opts) { + return this.requestAPIList(Page2, { method: "get", path: path5, ...opts }); } calculateContentLength(body) { if (typeof body === "string") { @@ -34493,10 +31353,10 @@ var APIClient = class { return null; } buildRequest(options) { - const { method, path: path7, query, headers = {} } = options; + const { method, path: path5, query, headers = {} } = options; const body = isMultipartBody(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null; const contentLength = this.calculateContentLength(body); - const url2 = this.buildURL(path7, query); + const url2 = this.buildURL(path5, query); if ("timeout" in options) validatePositiveInteger("timeout", options.timeout); const timeout = options.timeout ?? this.timeout; @@ -34594,8 +31454,8 @@ var APIClient = class { const request3 = this.makeRequest(options, null); return new PagePromise(this, request3, Page2); } - buildURL(path7, query) { - const url2 = isAbsoluteURL(path7) ? new URL(path7) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path7.startsWith("/") ? path7.slice(1) : path7)); + buildURL(path5, query) { + const url2 = isAbsoluteURL(path5) ? new URL(path5) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path5.startsWith("/") ? path5.slice(1) : path5)); const defaultQuery = this.defaultQuery(); if (!isEmptyObj(defaultQuery)) { query = { ...defaultQuery, ...query }; @@ -34837,24 +31697,24 @@ var normalizeArch = (arch2) => { return `other:${arch2}`; return "unknown"; }; -var normalizePlatform = (platform2) => { - platform2 = platform2.toLowerCase(); - if (platform2.includes("ios")) +var normalizePlatform = (platform) => { + platform = platform.toLowerCase(); + if (platform.includes("ios")) return "iOS"; - if (platform2 === "android") + if (platform === "android") return "Android"; - if (platform2 === "darwin") + if (platform === "darwin") return "MacOS"; - if (platform2 === "win32") + if (platform === "win32") return "Windows"; - if (platform2 === "freebsd") + if (platform === "freebsd") return "FreeBSD"; - if (platform2 === "openbsd") + if (platform === "openbsd") return "OpenBSD"; - if (platform2 === "linux") + if (platform === "linux") return "Linux"; - if (platform2) - return `Other:${platform2}`; + if (platform) + return `Other:${platform}`; return "Unknown"; }; var _platformHeaders; @@ -34873,14 +31733,14 @@ var isAbsoluteURL = (url2) => { return startsWithSchemeRegexp.test(url2); }; var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); -var validatePositiveInteger = (name, n3) => { - if (typeof n3 !== "number" || !Number.isInteger(n3)) { +var validatePositiveInteger = (name, n2) => { + if (typeof n2 !== "number" || !Number.isInteger(n2)) { throw new AnthropicError(`${name} must be an integer`); } - if (n3 < 0) { + if (n2 < 0) { throw new AnthropicError(`${name} must be a positive integer`); } - return n3; + return n2; }; var castToError = (err) => { if (err instanceof Error) @@ -34927,9 +31787,9 @@ function debug(action, ...args) { } } var uuid4 = () => { - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c5) => { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c3) => { const r3 = Math.random() * 16 | 0; - const v5 = c5 === "x" ? r3 : r3 & 3 | 8; + const v5 = c3 === "x" ? r3 : r3 & 3 | 8; return v5.toString(16); }); }; @@ -35477,10 +32337,10 @@ function bind(fn, thisArg) { } // node_modules/axios/lib/utils.js -var { toString: toString2 } = Object.prototype; +var { toString } = Object.prototype; var { getPrototypeOf } = Object; var kindOf = ((cache) => (thing) => { - const str2 = toString2.call(thing); + const str2 = toString.call(thing); return cache[str2] || (cache[str2] = str2.slice(8, -1).toLowerCase()); })(/* @__PURE__ */ Object.create(null)); var kindOfTest = (type2) => { @@ -35493,22 +32353,22 @@ var isUndefined = typeOfTest("undefined"); function isBuffer(val) { return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction3(val.constructor.isBuffer) && val.constructor.isBuffer(val); } -var isArrayBuffer2 = kindOfTest("ArrayBuffer"); +var isArrayBuffer = kindOfTest("ArrayBuffer"); function isArrayBufferView(val) { let result; if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) { result = ArrayBuffer.isView(val); } else { - result = val && val.buffer && isArrayBuffer2(val.buffer); + result = val && val.buffer && isArrayBuffer(val.buffer); } return result; } var isString = typeOfTest("string"); var isFunction3 = typeOfTest("function"); var isNumber = typeOfTest("number"); -var isObject2 = (thing) => thing !== null && typeof thing === "object"; +var isObject = (thing) => thing !== null && typeof thing === "object"; var isBoolean = (thing) => thing === true || thing === false; -var isPlainObject4 = (val) => { +var isPlainObject3 = (val) => { if (kindOf(val) !== "object") { return false; } @@ -35519,33 +32379,33 @@ var isDate = kindOfTest("Date"); var isFile2 = kindOfTest("File"); var isBlob2 = kindOfTest("Blob"); var isFileList = kindOfTest("FileList"); -var isStream2 = (val) => isObject2(val) && isFunction3(val.pipe); +var isStream2 = (val) => isObject(val) && isFunction3(val.pipe); var isFormData2 = (thing) => { let kind3; return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction3(thing.append) && ((kind3 = kindOf(thing)) === "formdata" || kind3 === "object" && isFunction3(thing.toString) && thing.toString() === "[object FormData]")); }; var isURLSearchParams = kindOfTest("URLSearchParams"); -var [isReadableStream3, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); +var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); var trim = (str2) => str2.trim ? str2.trim() : str2.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function forEach(obj, fn, { allOwnKeys = false } = {}) { if (obj === null || typeof obj === "undefined") { return; } - let i4; + let i3; let l3; if (typeof obj !== "object") { obj = [obj]; } if (isArray(obj)) { - for (i4 = 0, l3 = obj.length; i4 < l3; i4++) { - fn.call(null, obj[i4], i4, obj); + for (i3 = 0, l3 = obj.length; i3 < l3; i3++) { + fn.call(null, obj[i3], i3, obj); } } else { const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); const len = keys.length; let key; - for (i4 = 0; i4 < len; i4++) { - key = keys[i4]; + for (i3 = 0; i3 < len; i3++) { + key = keys[i3]; fn.call(null, obj[key], key, obj); } } @@ -35553,10 +32413,10 @@ function forEach(obj, fn, { allOwnKeys = false } = {}) { function findKey(obj, key) { key = key.toLowerCase(); const keys = Object.keys(obj); - let i4 = keys.length; + let i3 = keys.length; let _key; - while (i4-- > 0) { - _key = keys[i4]; + while (i3-- > 0) { + _key = keys[i3]; if (key === _key.toLowerCase()) { return _key; } @@ -35574,9 +32434,9 @@ function merge() { const result = {}; const assignValue = (val, key) => { const targetKey = caseless && findKey(result, key) || key; - if (isPlainObject4(result[targetKey]) && isPlainObject4(val)) { + if (isPlainObject3(result[targetKey]) && isPlainObject3(val)) { result[targetKey] = merge(result[targetKey], val); - } else if (isPlainObject4(val)) { + } else if (isPlainObject3(val)) { result[targetKey] = merge({}, val); } else if (isArray(val)) { result[targetKey] = val.slice(); @@ -35584,20 +32444,20 @@ function merge() { result[targetKey] = val; } }; - for (let i4 = 0, l3 = arguments.length; i4 < l3; i4++) { - arguments[i4] && forEach(arguments[i4], assignValue); + for (let i3 = 0, l3 = arguments.length; i3 < l3; i3++) { + arguments[i3] && forEach(arguments[i3], assignValue); } return result; } -var extend = (a5, b7, thisArg, { allOwnKeys } = {}) => { +var extend = (a4, b7, thisArg, { allOwnKeys } = {}) => { forEach(b7, (val, key) => { if (thisArg && isFunction3(val)) { - a5[key] = bind(val, thisArg); + a4[key] = bind(val, thisArg); } else { - a5[key] = val; + a4[key] = val; } }, { allOwnKeys }); - return a5; + return a4; }; var stripBOM = (content) => { if (content.charCodeAt(0) === 65279) { @@ -35615,7 +32475,7 @@ var inherits = (constructor, superConstructor, props, descriptors3) => { }; var toFlatObject = (sourceObj, destObj, filter2, propFilter) => { let props; - let i4; + let i3; let prop; const merged = {}; destObj = destObj || {}; @@ -35623,9 +32483,9 @@ var toFlatObject = (sourceObj, destObj, filter2, propFilter) => { return destObj; do { props = Object.getOwnPropertyNames(sourceObj); - i4 = props.length; - while (i4-- > 0) { - prop = props[i4]; + i3 = props.length; + while (i3-- > 0) { + prop = props[i3]; if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) { destObj[prop] = sourceObj[prop]; merged[prop] = true; @@ -35649,12 +32509,12 @@ var toArray = (thing) => { return null; if (isArray(thing)) return thing; - let i4 = thing.length; - if (!isNumber(i4)) + let i3 = thing.length; + if (!isNumber(i3)) return null; - const arr = new Array(i4); - while (i4-- > 0) { - arr[i4] = thing[i4]; + const arr = new Array(i3); + while (i3-- > 0) { + arr[i3] = thing[i3]; } return arr; }; @@ -35732,7 +32592,7 @@ var toObjectSet = (arrayOrString, delimiter) => { isArray(arrayOrString) ? define2(arrayOrString) : define2(String(arrayOrString).split(delimiter)); return obj; }; -var noop3 = () => { +var noop = () => { }; var toFiniteNumber = (value, defaultValue) => { return value != null && Number.isFinite(value = +value) ? value : defaultValue; @@ -35757,19 +32617,19 @@ function isSpecCompliantForm(thing) { } var toJSONObject = (obj) => { const stack = new Array(10); - const visit = (source, i4) => { - if (isObject2(source)) { + const visit = (source, i3) => { + if (isObject(source)) { if (stack.indexOf(source) >= 0) { return; } if (!("toJSON" in source)) { - stack[i4] = source; + stack[i3] = source; const target = isArray(source) ? [] : {}; forEach(source, (value, key) => { - const reducedValue = visit(value, i4 + 1); + const reducedValue = visit(value, i3 + 1); !isUndefined(reducedValue) && (target[key] = reducedValue); }); - stack[i4] = void 0; + stack[i3] = void 0; return target; } } @@ -35778,7 +32638,7 @@ var toJSONObject = (obj) => { return visit(obj, 0); }; var isAsyncFn = kindOfTest("AsyncFunction"); -var isThenable = (thing) => thing && (isObject2(thing) || isFunction3(thing)) && isFunction3(thing.then) && isFunction3(thing.catch); +var isThenable = (thing) => thing && (isObject(thing) || isFunction3(thing)) && isFunction3(thing.then) && isFunction3(thing.catch); var _setImmediate = ((setImmediateSupported, postMessageSupported) => { if (setImmediateSupported) { return setImmediate; @@ -35801,16 +32661,16 @@ var _setImmediate = ((setImmediateSupported, postMessageSupported) => { var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; var utils_default = { isArray, - isArrayBuffer: isArrayBuffer2, + isArrayBuffer, isBuffer, isFormData: isFormData2, isArrayBufferView, isString, isNumber, isBoolean, - isObject: isObject2, - isPlainObject: isPlainObject4, - isReadableStream: isReadableStream3, + isObject, + isPlainObject: isPlainObject3, + isReadableStream, isRequest, isResponse, isHeaders, @@ -35844,7 +32704,7 @@ var utils_default = { freezeMethods, toObjectSet, toCamelCase, - noop: noop3, + noop, toFiniteNumber, findKey, global: _global, @@ -35937,12 +32797,12 @@ function isVisitable(thing) { function removeBrackets(key) { return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key; } -function renderKey(path7, key, dots) { - if (!path7) +function renderKey(path5, key, dots) { + if (!path5) return key; - return path7.concat(key).map(function each(token, i4) { + return path5.concat(key).map(function each(token, i3) { token = removeBrackets(token); - return !dots && i4 ? "[" + token + "]" : token; + return !dots && i3 ? "[" + token + "]" : token; }).join(dots ? "." : ""); } function isFlatArray(arr) { @@ -35986,9 +32846,9 @@ function toFormData(obj, formData, options) { } return value; } - function defaultVisitor(value, key, path7) { + function defaultVisitor(value, key, path5) { let arr = value; - if (value && !path7 && typeof value === "object") { + if (value && !path5 && typeof value === "object") { if (utils_default.endsWith(key, "{}")) { key = metaTokens ? key : key.slice(0, -2); value = JSON.stringify(value); @@ -36006,7 +32866,7 @@ function toFormData(obj, formData, options) { if (isVisitable(value)) { return true; } - formData.append(renderKey(path7, key, dots), convertValue(value)); + formData.append(renderKey(path5, key, dots), convertValue(value)); return false; } const stack = []; @@ -36015,11 +32875,11 @@ function toFormData(obj, formData, options) { convertValue, isVisitable }); - function build(value, path7) { + function build(value, path5) { if (utils_default.isUndefined(value)) return; if (stack.indexOf(value) !== -1) { - throw Error("Circular reference detected in " + path7.join(".")); + throw Error("Circular reference detected in " + path5.join(".")); } stack.push(value); utils_default.forEach(value, function each(el, key) { @@ -36027,11 +32887,11 @@ function toFormData(obj, formData, options) { formData, el, utils_default.isString(key) ? key.trim() : key, - path7, + path5, exposedHelpers ); if (result === true) { - build(el, path7 ? path7.concat(key) : [key]); + build(el, path5 ? path5.concat(key) : [key]); } }); stack.pop(); @@ -36067,7 +32927,7 @@ var prototype2 = AxiosURLSearchParams.prototype; prototype2.append = function append(name, value) { this._pairs.push([name, value]); }; -prototype2.toString = function toString3(encoder) { +prototype2.toString = function toString2(encoder) { const _encode = encoder ? function(value) { return encoder.call(this, value, encode); } : encode; @@ -36128,9 +32988,9 @@ var InterceptorManager = class { } } forEach(fn) { - utils_default.forEach(this.handlers, function forEachHandler(h5) { - if (h5 !== null) { - fn(h5); + utils_default.forEach(this.handlers, function forEachHandler(h4) { + if (h4 !== null) { + fn(h4); } }); } @@ -36185,7 +33045,7 @@ var platform_default = { // node_modules/axios/lib/helpers/toURLEncodedForm.js function toURLEncodedForm(data, options) { return toFormData_default(data, new platform_default.classes.URLSearchParams(), Object.assign({ - visitor: function(value, key, path7, helpers) { + visitor: function(value, key, path5, helpers) { if (platform_default.isNode && utils_default.isBuffer(value)) { this.append(key, value.toString("base64")); return false; @@ -36204,22 +33064,22 @@ function parsePropPath(name) { function arrayToObject(arr) { const obj = {}; const keys = Object.keys(arr); - let i4; + let i3; const len = keys.length; let key; - for (i4 = 0; i4 < len; i4++) { - key = keys[i4]; + for (i3 = 0; i3 < len; i3++) { + key = keys[i3]; obj[key] = arr[key]; } return obj; } function formDataToJSON(formData) { - function buildPath(path7, value, target, index) { - let name = path7[index++]; + function buildPath(path5, value, target, index) { + let name = path5[index++]; if (name === "__proto__") return true; const isNumericKey = Number.isFinite(+name); - const isLast = index >= path7.length; + const isLast = index >= path5.length; name = !name && utils_default.isArray(target) ? target.length : name; if (isLast) { if (utils_default.hasOwnProp(target, name)) { @@ -36232,7 +33092,7 @@ function formDataToJSON(formData) { if (!target[name] || !utils_default.isObject(target[name])) { target[name] = []; } - const result = buildPath(path7, value, target[name], index); + const result = buildPath(path5, value, target[name], index); if (result && utils_default.isArray(target[name])) { target[name] = arrayToObject(target[name]); } @@ -36378,11 +33238,11 @@ var parseHeaders_default = (rawHeaders) => { const parsed = {}; let key; let val; - let i4; + let i3; rawHeaders && rawHeaders.split("\n").forEach(function parser(line) { - i4 = line.indexOf(":"); - key = line.substring(0, i4).trim().toLowerCase(); - val = line.substring(i4 + 1).trim(); + i3 = line.indexOf(":"); + key = line.substring(0, i3).trim().toLowerCase(); + val = line.substring(i3 + 1).trim(); if (!key || parsed[key] && ignoreDuplicateOf[key]) { return; } @@ -36534,10 +33394,10 @@ var AxiosHeaders = class { } clear(matcher) { const keys = Object.keys(this); - let i4 = keys.length; + let i3 = keys.length; let deleted = false; - while (i4--) { - const key = keys[i4]; + while (i3--) { + const key = keys[i3]; if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) { delete this[key]; deleted = true; @@ -36545,7 +33405,7 @@ var AxiosHeaders = class { } return deleted; } - normalize(format2) { + normalize(format) { const self2 = this; const headers = {}; utils_default.forEach(this, (value, header) => { @@ -36555,7 +33415,7 @@ var AxiosHeaders = class { delete self2[header]; return; } - const normalized = format2 ? formatHeader(header) : String(header).trim(); + const normalized = format ? formatHeader(header) : String(header).trim(); if (normalized !== header) { delete self2[header]; } @@ -36730,12 +33590,12 @@ function fromDataURI(uri, asBlob, options) { } // node_modules/axios/lib/adapters/http.js -var import_stream6 = __toESM(require("stream"), 1); +var import_stream5 = __toESM(require("stream"), 1); // node_modules/axios/lib/helpers/AxiosTransformStream.js -var import_stream3 = __toESM(require("stream"), 1); +var import_stream2 = __toESM(require("stream"), 1); var kInternals = Symbol("internals"); -var AxiosTransformStream = class extends import_stream3.default.Transform { +var AxiosTransformStream = class extends import_stream2.default.Transform { constructor(options) { options = utils_default.toFlatObject(options, { maxRate: 0, @@ -36799,7 +33659,7 @@ var AxiosTransformStream = class extends import_stream3.default.Transform { }; } }; - const transformChunk2 = (_chunk, _callback) => { + const transformChunk = (_chunk, _callback) => { const chunkSize = Buffer.byteLength(_chunk); let chunkRemainder = null; let maxChunkSize = readableHighWaterMark; @@ -36833,12 +33693,12 @@ var AxiosTransformStream = class extends import_stream3.default.Transform { process.nextTick(_callback, null, chunkRemainder); } : _callback); }; - transformChunk2(chunk, function transformNextChunk(err, _chunk) { + transformChunk(chunk, function transformNextChunk(err, _chunk) { if (err) { return callback(err); } if (_chunk) { - transformChunk2(_chunk, transformNextChunk); + transformChunk(_chunk, transformNextChunk); } else { callback(null); } @@ -36852,7 +33712,7 @@ var import_events = require("events"); // node_modules/axios/lib/helpers/formDataToStream.js var import_util3 = require("util"); -var import_stream4 = require("stream"); +var import_stream3 = require("stream"); // node_modules/axios/lib/helpers/readBlob.js var { asyncIterator } = Symbol; @@ -36871,9 +33731,9 @@ var readBlob_default = readBlob; // node_modules/axios/lib/helpers/formDataToStream.js var BOUNDARY_ALPHABET = utils_default.ALPHABET.ALPHA_DIGIT + "-_"; -var textEncoder3 = new import_util3.TextEncoder(); +var textEncoder = new import_util3.TextEncoder(); var CRLF = "\r\n"; -var CRLF_BYTES = textEncoder3.encode(CRLF); +var CRLF_BYTES = textEncoder.encode(CRLF); var CRLF_BYTES_COUNT = 2; var FormDataPart = class { constructor(name, value) { @@ -36881,11 +33741,11 @@ var FormDataPart = class { const isStringValue = utils_default.isString(value); let headers = `Content-Disposition: form-data; name="${escapeName2(name)}"${!isStringValue && value.name ? `; filename="${escapeName2(value.name)}"` : ""}${CRLF}`; if (isStringValue) { - value = textEncoder3.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); + value = textEncoder.encode(String(value).replace(/\r?\n|\r\n?/g, CRLF)); } else { headers += `Content-Type: ${value.type || "application/octet-stream"}${CRLF}`; } - this.headers = textEncoder3.encode(headers + CRLF); + this.headers = textEncoder.encode(headers + CRLF); this.contentLength = isStringValue ? value.byteLength : value.size; this.size = this.headers.byteLength + this.contentLength + CRLF_BYTES_COUNT; this.name = name; @@ -36921,8 +33781,8 @@ var formDataToStream = (form, headersHandler, options) => { if (boundary.length < 1 || boundary.length > 70) { throw Error("boundary must be 10-70 characters long"); } - const boundaryBytes = textEncoder3.encode("--" + boundary + CRLF); - const footerBytes = textEncoder3.encode("--" + boundary + "--" + CRLF + CRLF); + const boundaryBytes = textEncoder.encode("--" + boundary + CRLF); + const footerBytes = textEncoder.encode("--" + boundary + "--" + CRLF + CRLF); let contentLength = footerBytes.byteLength; const parts = Array.from(form.entries()).map(([name, value]) => { const part = new FormDataPart(name, value); @@ -36938,7 +33798,7 @@ var formDataToStream = (form, headersHandler, options) => { computedHeaders["Content-Length"] = contentLength; } headersHandler && headersHandler(computedHeaders); - return import_stream4.Readable.from(async function* () { + return import_stream3.Readable.from(async function* () { for (const part of parts) { yield boundaryBytes; yield* part.encode(); @@ -36949,8 +33809,8 @@ var formDataToStream = (form, headersHandler, options) => { var formDataToStream_default = formDataToStream; // node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js -var import_stream5 = __toESM(require("stream"), 1); -var ZlibHeaderTransformStream = class extends import_stream5.default.Transform { +var import_stream4 = __toESM(require("stream"), 1); +var ZlibHeaderTransformStream = class extends import_stream4.default.Transform { __transform(chunk, encoding, callback) { this.push(chunk); callback(); @@ -36971,7 +33831,7 @@ var ZlibHeaderTransformStream = class extends import_stream5.default.Transform { var ZlibHeaderTransformStream_default = ZlibHeaderTransformStream; // node_modules/axios/lib/helpers/callbackify.js -var callbackify5 = (fn, reducer) => { +var callbackify = (fn, reducer) => { return utils_default.isAsyncFn(fn) ? function(...args) { const cb = args.pop(); fn.apply(this, args).then((value) => { @@ -36983,7 +33843,7 @@ var callbackify5 = (fn, reducer) => { }, cb); } : fn; }; -var callbackify_default = callbackify5; +var callbackify_default = callbackify; // node_modules/axios/lib/helpers/speedometer.js function speedometer(samplesCount, min) { @@ -37002,11 +33862,11 @@ function speedometer(samplesCount, min) { } bytes[head] = chunkLength; timestamps[head] = now; - let i4 = tail; + let i3 = tail; let bytesCount = 0; - while (i4 !== head) { - bytesCount += bytes[i4++]; - i4 = i4 % samplesCount; + while (i3 !== head) { + bytesCount += bytes[i3++]; + i3 = i3 % samplesCount; } head = (head + 1) % samplesCount; if (head === tail) { @@ -37256,7 +34116,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { convertedData = utils_default.stripBOM(convertedData); } } else if (responseType === "stream") { - convertedData = import_stream6.default.Readable.from(convertedData); + convertedData = import_stream5.default.Readable.from(convertedData); } return settle(resolve, reject, { data: convertedData, @@ -37299,7 +34159,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { } else if (utils_default.isBlob(data)) { data.size && headers.setContentType(data.type || "application/octet-stream"); headers.setContentLength(data.size || 0); - data = import_stream6.default.Readable.from(readBlob_default(data)); + data = import_stream5.default.Readable.from(readBlob_default(data)); } else if (data && !utils_default.isStream(data)) { if (Buffer.isBuffer(data)) { } else if (utils_default.isArrayBuffer(data)) { @@ -37331,9 +34191,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { } if (data && (onUploadProgress || maxUploadRate)) { if (!utils_default.isStream(data)) { - data = import_stream6.default.Readable.from(data, { objectMode: false }); + data = import_stream5.default.Readable.from(data, { objectMode: false }); } - data = import_stream6.default.pipeline([data, new AxiosTransformStream_default({ + data = import_stream5.default.pipeline([data, new AxiosTransformStream_default({ maxRate: utils_default.toFiniteNumber(maxUploadRate) })], utils_default.noop); onUploadProgress && data.on("progress", flushOnFinish( @@ -37356,9 +34216,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { auth = urlUsername + ":" + urlPassword; } auth && headers.delete("authorization"); - let path7; + let path5; try { - path7 = buildURL( + path5 = buildURL( parsed.pathname + parsed.search, config7.params, config7.paramsSerializer @@ -37376,7 +34236,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { false ); const options = { - path: path7, + path: path5, method, headers: headers.toJSON(), agents: { http: config7.httpAgent, https: config7.httpsAgent }, @@ -37462,8 +34322,8 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { } } } - responseStream = streams.length > 1 ? import_stream6.default.pipeline(streams, utils_default.noop) : streams[0]; - const offListeners = import_stream6.default.finished(responseStream, () => { + responseStream = streams.length > 1 ? import_stream5.default.pipeline(streams, utils_default.noop) : streams[0]; + const offListeners = import_stream5.default.finished(responseStream, () => { offListeners(); onFinished(); }); @@ -37507,12 +34367,12 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config7) { responseStream.destroy(err); reject(err); }); - responseStream.on("error", function handleStreamError2(err) { + responseStream.on("error", function handleStreamError(err) { if (req.destroyed) return; reject(AxiosError_default.from(err, null, config7, lastRequest)); }); - responseStream.on("end", function handleStreamEnd2() { + responseStream.on("end", function handleStreamEnd() { try { let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer); if (responseType !== "arraybuffer") { @@ -37631,10 +34491,10 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? function // node_modules/axios/lib/helpers/cookies.js var cookies_default = platform_default.hasStandardBrowserEnv ? { - write(name, value, expires, path7, domain, secure) { + write(name, value, expires, path5, domain, secure) { const cookie = [name + "=" + encodeURIComponent(value)]; utils_default.isNumber(expires) && cookie.push("expires=" + new Date(expires).toGMTString()); - utils_default.isString(path7) && cookie.push("path=" + path7); + utils_default.isString(path5) && cookie.push("path=" + path5); utils_default.isString(domain) && cookie.push("domain=" + domain); secure === true && cookie.push("secure"); document.cookie = cookie.join("; "); @@ -37671,30 +34531,30 @@ function mergeConfig(config1, config22) { } return source; } - function mergeDeepProperties(a5, b7, caseless) { + function mergeDeepProperties(a4, b7, caseless) { if (!utils_default.isUndefined(b7)) { - return getMergedValue(a5, b7, caseless); - } else if (!utils_default.isUndefined(a5)) { - return getMergedValue(void 0, a5, caseless); + return getMergedValue(a4, b7, caseless); + } else if (!utils_default.isUndefined(a4)) { + return getMergedValue(void 0, a4, caseless); } } - function valueFromConfig2(a5, b7) { + function valueFromConfig2(a4, b7) { if (!utils_default.isUndefined(b7)) { return getMergedValue(void 0, b7); } } - function defaultToConfig2(a5, b7) { + function defaultToConfig2(a4, b7) { if (!utils_default.isUndefined(b7)) { return getMergedValue(void 0, b7); - } else if (!utils_default.isUndefined(a5)) { - return getMergedValue(void 0, a5); + } else if (!utils_default.isUndefined(a4)) { + return getMergedValue(void 0, a4); } } - function mergeDirectKeys(a5, b7, prop) { + function mergeDirectKeys(a4, b7, prop) { if (prop in config22) { - return getMergedValue(a5, b7); + return getMergedValue(a4, b7); } else if (prop in config1) { - return getMergedValue(void 0, a5); + return getMergedValue(void 0, a4); } } const mergeMap = { @@ -37726,7 +34586,7 @@ function mergeConfig(config1, config22) { socketPath: defaultToConfig2, responseEncoding: defaultToConfig2, validateStatus: mergeDirectKeys, - headers: (a5, b7) => mergeDeepProperties(headersToObject(a5), headersToObject(b7), true) + headers: (a4, b7) => mergeDeepProperties(headersToObject(a4), headersToObject(b7), true) }; utils_default.forEach(Object.keys(Object.assign({}, config1, config22)), function computeConfigValue(prop) { const merge2 = mergeMap[prop] || mergeDeepProperties; @@ -37827,7 +34687,7 @@ var xhr_default = isXHRAdapterSupported && function(config7) { setTimeout(onloadend); }; } - request3.onabort = function handleAbort2() { + request3.onabort = function handleAbort() { if (!request3) { return; } @@ -37897,12 +34757,12 @@ var xhr_default = isXHRAdapterSupported && function(config7) { }; // node_modules/axios/lib/helpers/composeSignals.js -var composeSignals = (signals2, timeout) => { +var composeSignals = (signals, timeout) => { let controller = new AbortController(); - let aborted2; + let aborted; const onabort = function(cancel) { - if (!aborted2) { - aborted2 = true; + if (!aborted) { + aborted = true; unsubscribe(); const err = cancel instanceof Error ? cancel : this.reason; controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err)); @@ -37912,16 +34772,16 @@ var composeSignals = (signals2, timeout) => { onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT)); }, timeout); const unsubscribe = () => { - if (signals2) { + if (signals) { timer && clearTimeout(timer); timer = null; - signals2.forEach((signal2) => { + signals.forEach((signal2) => { signal2 && (signal2.removeEventListener ? signal2.removeEventListener("abort", onabort) : signal2.unsubscribe(onabort)); }); - signals2 = null; + signals = null; } }; - signals2.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort)); + signals.forEach((signal2) => signal2 && signal2.addEventListener && signal2.addEventListener("abort", onabort)); const { signal } = controller; signal.unsubscribe = unsubscribe; return [signal, () => { @@ -38066,12 +34926,12 @@ var fetch_default = isFetchSupported && (async (config7) => { } = resolveConfig_default(config7); responseType = responseType ? (responseType + "").toLowerCase() : "text"; let [composedSignal, stopTimeout] = signal || cancelToken || timeout ? composeSignals_default([signal, cancelToken], timeout) : []; - let finished7, request3; + let finished, request3; const onFinish = () => { - !finished7 && setTimeout(() => { + !finished && setTimeout(() => { composedSignal && composedSignal.unsubscribe(); }); - finished7 = true; + finished = true; }; let requestContentLength; try { @@ -38177,8 +35037,8 @@ var adapters_default = { let nameOrAdapter; let adapter; const rejectedReasons = {}; - for (let i4 = 0; i4 < length; i4++) { - nameOrAdapter = adapters[i4]; + for (let i3 = 0; i3 < length; i3++) { + nameOrAdapter = adapters[i3]; let id; adapter = nameOrAdapter; if (!isResolvedHandle(nameOrAdapter)) { @@ -38190,7 +35050,7 @@ var adapters_default = { if (adapter) { break; } - rejectedReasons[id || "#" + i4] = adapter; + rejectedReasons[id || "#" + i3] = adapter; } if (!adapter) { const reasons = Object.entries(rejectedReasons).map( @@ -38254,9 +35114,9 @@ function dispatchRequest(config7) { // node_modules/axios/lib/helpers/validator.js var validators = {}; -["object", "boolean", "number", "function", "string", "symbol"].forEach((type2, i4) => { +["object", "boolean", "number", "function", "string", "symbol"].forEach((type2, i3) => { validators[type2] = function validator(thing) { - return typeof thing === type2 || "a" + (i4 < 1 ? "n " : " ") + type2; + return typeof thing === type2 || "a" + (i3 < 1 ? "n " : " ") + type2; }; }); var deprecatedWarnings = {}; @@ -38288,9 +35148,9 @@ function assertOptions(options, schema, allowUnknown) { throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE); } const keys = Object.keys(options); - let i4 = keys.length; - while (i4-- > 0) { - const opt = keys[i4]; + let i3 = keys.length; + while (i3-- > 0) { + const opt = keys[i3]; const validator = schema[opt]; if (validator) { const value = options[opt]; @@ -38394,7 +35254,7 @@ var Axios = class { responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected); }); let promise; - let i4 = 0; + let i3 = 0; let len; if (!synchronousRequestInterceptors) { const chain = [dispatchRequest.bind(this), void 0]; @@ -38402,17 +35262,17 @@ var Axios = class { chain.push.apply(chain, responseInterceptorChain); len = chain.length; promise = Promise.resolve(config7); - while (i4 < len) { - promise = promise.then(chain[i4++], chain[i4++]); + while (i3 < len) { + promise = promise.then(chain[i3++], chain[i3++]); } return promise; } len = requestInterceptorChain.length; let newConfig = config7; - i4 = 0; - while (i4 < len) { - const onFulfilled = requestInterceptorChain[i4++]; - const onRejected = requestInterceptorChain[i4++]; + i3 = 0; + while (i3 < len) { + const onFulfilled = requestInterceptorChain[i3++]; + const onRejected = requestInterceptorChain[i3++]; try { newConfig = onFulfilled(newConfig); } catch (error) { @@ -38425,10 +35285,10 @@ var Axios = class { } catch (error) { return Promise.reject(error); } - i4 = 0; + i3 = 0; len = responseInterceptorChain.length; - while (i4 < len) { - promise = promise.then(responseInterceptorChain[i4++], responseInterceptorChain[i4++]); + while (i3 < len) { + promise = promise.then(responseInterceptorChain[i3++], responseInterceptorChain[i3++]); } return promise; } @@ -38479,9 +35339,9 @@ var CancelToken = class { this.promise.then((cancel) => { if (!token._listeners) return; - let i4 = token._listeners.length; - while (i4-- > 0) { - token._listeners[i4](cancel); + let i3 = token._listeners.length; + while (i3-- > 0) { + token._listeners[i3](cancel); } token._listeners = null; }); @@ -38531,8 +35391,8 @@ var CancelToken = class { } static source() { let cancel; - const token = new CancelToken(function executor(c5) { - cancel = c5; + const token = new CancelToken(function executor(c3) { + cancel = c3; }); return { token, @@ -38711,7 +35571,7 @@ var AnthropicEngine = class { max_tokens: this.config.maxTokensOutput }; try { - const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a5, b7) => a5 + b7, 0); + const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a4, b7) => a4 + b7, 0); if (REQUEST_TOKENS > this.config.maxTokensInput - this.config.maxTokensOutput) { throw new Error("TOO_MUCH_TOKENS" /* tooMuchTokens */); } @@ -38770,13 +35630,13 @@ function getRandomIntegerInclusive(min, max) { } // node_modules/@azure/core-util/dist/esm/object.js -function isObject3(input) { +function isObject2(input) { return typeof input === "object" && input !== null && !Array.isArray(input) && !(input instanceof RegExp) && !(input instanceof Date); } // node_modules/@azure/core-util/dist/esm/error.js function isError(e3) { - if (isObject3(e3)) { + if (isObject2(e3)) { const hasName = typeof e3.name === "string"; const hasMessage = typeof e3.message === "string"; return hasName && hasMessage; @@ -38823,8 +35683,8 @@ var isNode = isNodeLike; var isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative"; // node_modules/@azure/core-util/dist/esm/bytesEncoding.js -function stringToUint8Array2(value, format2) { - return Buffer.from(value, format2); +function stringToUint8Array(value, format) { + return Buffer.from(value, format); } // node_modules/@azure/core-auth/dist/esm/tokenCredential.js @@ -39052,10 +35912,10 @@ function createEmptyPipeline() { // node_modules/@azure/logger/dist/esm/log.js var import_node_os5 = require("node:os"); -var import_node_util11 = __toESM(require("node:util"), 1); -var process11 = __toESM(require("node:process"), 1); +var import_node_util2 = __toESM(require("node:util"), 1); +var process7 = __toESM(require("node:process"), 1); function log(message, ...args) { - process11.stderr.write(`${import_node_util11.default.format(message, ...args)}${import_node_os5.EOL}`); + process7.stderr.write(`${import_node_util2.default.format(message, ...args)}${import_node_os5.EOL}`); } // node_modules/@azure/logger/dist/esm/debug.js @@ -39268,7 +36128,7 @@ var Sanitizer = class { constructor({ additionalAllowedHeaderNames: allowedHeaderNames = [], additionalAllowedQueryParameters: allowedQueryParameters = [] } = {}) { allowedHeaderNames = defaultAllowedHeaderNames.concat(allowedHeaderNames); allowedQueryParameters = defaultAllowedQueryParameters.concat(allowedQueryParameters); - this.allowedHeaderNames = new Set(allowedHeaderNames.map((n3) => n3.toLowerCase())); + this.allowedHeaderNames = new Set(allowedHeaderNames.map((n2) => n2.toLowerCase())); this.allowedQueryParameters = new Set(allowedQueryParameters.map((p4) => p4.toLowerCase())); } sanitize(obj) { @@ -39289,7 +36149,7 @@ var Sanitizer = class { return void 0; } else if (key === "operationSpec") { return void 0; - } else if (Array.isArray(value) || isObject3(value)) { + } else if (Array.isArray(value) || isObject2(value)) { if (seen.has(value)) { return "[Circular]"; } @@ -39396,13 +36256,13 @@ async function handleRedirect(next, response, maxRetries, currentRetries = 0) { } // node_modules/@azure/core-rest-pipeline/dist/esm/util/userAgentPlatform.js -var os2 = __toESM(require("node:os"), 1); -var process12 = __toESM(require("node:process"), 1); +var os3 = __toESM(require("node:os"), 1); +var process8 = __toESM(require("node:process"), 1); function getHeaderName() { return "User-Agent"; } function setPlatformSpecificData(map) { - const versions2 = process12.versions; + const versions2 = process8.versions; if (versions2.bun) { map.set("Bun", versions2.bun); } else if (versions2.deno) { @@ -39410,7 +36270,7 @@ function setPlatformSpecificData(map) { } else if (versions2.node) { map.set("Node", versions2.node); } - map.set("OS", `(${os2.arch()}-${os2.type()}-${os2.release()})`); + map.set("OS", `(${os3.arch()}-${os3.type()}-${os3.release()})`); } // node_modules/@azure/core-rest-pipeline/dist/esm/constants.js @@ -39455,7 +36315,7 @@ function userAgentPolicy(options = {}) { } // node_modules/@azure/core-rest-pipeline/dist/esm/util/concat.js -var import_node_stream10 = require("node:stream"); +var import_node_stream2 = require("node:stream"); // node_modules/@azure/core-rest-pipeline/dist/esm/util/typeGuards.js function isBlob3(x5) { @@ -39522,14 +36382,14 @@ function makeAsyncIterable(webStream) { function ensureNodeStream(stream4) { if (stream4 instanceof ReadableStream) { makeAsyncIterable(stream4); - return import_node_stream10.Readable.fromWeb(stream4); + return import_node_stream2.Readable.fromWeb(stream4); } else { return stream4; } } function toStream(source) { if (source instanceof Uint8Array) { - return import_node_stream10.Readable.from(Buffer.from(source)); + return import_node_stream2.Readable.from(Buffer.from(source)); } else if (isBlob3(source)) { return toStream(getRawContent(source)); } else { @@ -39539,7 +36399,7 @@ function toStream(source) { async function concat(sources) { return function() { const streams = sources.map((x5) => typeof x5 === "function" ? x5() : x5).map(toStream); - return import_node_stream10.Readable.from(function() { + return import_node_stream2.Readable.from(function() { return __asyncGenerator(this, arguments, function* () { var _a5, e_1, _b2, _c2; for (const stream4 of streams) { @@ -39602,16 +36462,16 @@ function getTotalLength(sources) { } async function buildRequestBody(request3, parts, boundary) { const sources = [ - stringToUint8Array2(`--${boundary}`, "utf-8"), + stringToUint8Array(`--${boundary}`, "utf-8"), ...parts.flatMap((part) => [ - stringToUint8Array2("\r\n", "utf-8"), - stringToUint8Array2(encodeHeaders(part.headers), "utf-8"), - stringToUint8Array2("\r\n", "utf-8"), + stringToUint8Array("\r\n", "utf-8"), + stringToUint8Array(encodeHeaders(part.headers), "utf-8"), + stringToUint8Array("\r\n", "utf-8"), part.body, - stringToUint8Array2(`\r + stringToUint8Array(`\r --${boundary}`, "utf-8") ]), - stringToUint8Array2("--\r\n\r\n", "utf-8") + stringToUint8Array("--\r\n\r\n", "utf-8") ]; const contentLength = getTotalLength(sources); if (contentLength) { @@ -40003,7 +36863,7 @@ async function prepareFormData(formData, request3) { headers: createHttpHeaders({ "Content-Disposition": `form-data; name="${fieldName}"` }), - body: stringToUint8Array2(value, "utf-8") + body: stringToUint8Array(value, "utf-8") }); } else if (value === void 0 || value === null || typeof value !== "object") { throw new Error(`Unexpected value for key ${fieldName}: ${value}. Value should be serialized to string first.`); @@ -40305,8 +37165,8 @@ function createTracingClient(options) { } // node_modules/@azure/core-rest-pipeline/dist/esm/util/inspect.js -var import_node_util12 = require("node:util"); -var custom = import_node_util12.inspect.custom; +var import_node_util3 = require("node:util"); +var custom = import_node_util3.inspect.custom; // node_modules/@azure/core-rest-pipeline/dist/esm/restError.js var errorSanitizer = new Sanitizer(); @@ -40458,9 +37318,9 @@ function createPipelineFromOptions(options) { var http2 = __toESM(require("node:http"), 1); var https2 = __toESM(require("node:https"), 1); var zlib2 = __toESM(require("node:zlib"), 1); -var import_node_stream11 = require("node:stream"); +var import_node_stream3 = require("node:stream"); var DEFAULT_TLS_SETTINGS = {}; -function isReadableStream4(body) { +function isReadableStream2(body) { return body && typeof body.pipe === "function"; } function isStreamComplete(stream4) { @@ -40470,10 +37330,10 @@ function isStreamComplete(stream4) { stream4.on("error", resolve); }); } -function isArrayBuffer3(body) { +function isArrayBuffer2(body) { return body && typeof body.byteLength === "number"; } -var ReportTransform = class extends import_node_stream11.Transform { +var ReportTransform = class extends import_node_stream3.Transform { _transform(chunk, _encoding, callback) { this.push(chunk); this.loadedBytes += chunk.length; @@ -40531,7 +37391,7 @@ var NodeHttpClient = class { uploadReportStream.on("error", (e3) => { logger.error("Error in upload progress", e3); }); - if (isReadableStream4(body)) { + if (isReadableStream2(body)) { body.pipe(uploadReportStream); } else { uploadReportStream.end(body); @@ -40569,11 +37429,11 @@ var NodeHttpClient = class { } finally { if (request3.abortSignal && abortListener) { let uploadStreamDone = Promise.resolve(); - if (isReadableStream4(body)) { + if (isReadableStream2(body)) { uploadStreamDone = isStreamComplete(body); } let downloadStreamDone = Promise.resolve(); - if (isReadableStream4(responseStream)) { + if (isReadableStream2(responseStream)) { downloadStreamDone = isStreamComplete(responseStream); } Promise.all([uploadStreamDone, downloadStreamDone]).then(() => { @@ -40614,12 +37474,12 @@ var NodeHttpClient = class { req.destroy(abortError); reject(abortError); }); - if (body && isReadableStream4(body)) { + if (body && isReadableStream2(body)) { body.pipe(req); } else if (body) { if (typeof body === "string" || Buffer.isBuffer(body)) { req.end(body); - } else if (isArrayBuffer3(body)) { + } else if (isArrayBuffer2(body)) { req.end(ArrayBuffer.isView(body) ? Buffer.from(body.buffer) : Buffer.from(body)); } else { logger.error("Unrecognized body type", body); @@ -40715,9 +37575,9 @@ function getBodyLength2(body) { return 0; } else if (Buffer.isBuffer(body)) { return body.length; - } else if (isReadableStream4(body)) { + } else if (isReadableStream2(body)) { return null; - } else if (isArrayBuffer3(body)) { + } else if (isArrayBuffer2(body)) { return body.byteLength; } else if (typeof body === "string") { return Buffer.from(body).length; @@ -40990,7 +37850,7 @@ function operationOptionsToRequestParameters(options) { } // node_modules/@azure-rest/core-client/dist/esm/helpers/isReadableStream.js -function isReadableStream5(body) { +function isReadableStream3(body) { return Boolean(body) && typeof body.pipe === "function"; } @@ -41060,7 +37920,7 @@ function getRequestBody(body, contentType = "") { if (body === void 0) { return { body: void 0 }; } - if (isReadableStream5(body)) { + if (isReadableStream3(body)) { return { body }; } const firstType = contentType.split(";")[0]; @@ -41229,8 +38089,8 @@ function getClient(endpoint, credentialsOrPipelineOptions, clientOptions = {}) { } const { allowInsecureConnection, httpClient } = clientOptions; const endpointUrl = (_b2 = clientOptions.endpoint) !== null && _b2 !== void 0 ? _b2 : endpoint; - const client = (path7, ...args) => { - const getUrl = (requestOptions) => buildRequestUrl(endpointUrl, path7, args, Object.assign({ allowInsecureConnection }, requestOptions)); + const client = (path5, ...args) => { + const getUrl = (requestOptions) => buildRequestUrl(endpointUrl, path5, args, Object.assign({ allowInsecureConnection }, requestOptions)); return { get: (requestOptions = {}) => { return buildOperation("GET", getUrl(requestOptions), pipeline, requestOptions, allowInsecureConnection, httpClient); @@ -41330,9 +38190,9 @@ function isUnexpected(response) { } return !pathDetails.includes(response.status); } -function getParametrizedPathSuccess(method, path7) { +function getParametrizedPathSuccess(method, path5) { var _a5, _b2, _c2, _d2; - const pathParts = path7.split("/"); + const pathParts = path5.split("/"); let matchedLen = -1, matchedValue = []; for (const [key, value] of Object.entries(responseMap)) { if (!key.startsWith(method)) { @@ -41341,17 +38201,17 @@ function getParametrizedPathSuccess(method, path7) { const candidatePath = getPathFromMapKey(key); const candidateParts = candidatePath.split("/"); let found = true; - for (let i4 = candidateParts.length - 1, j4 = pathParts.length - 1; i4 >= 1 && j4 >= 1; i4--, j4--) { - if (((_a5 = candidateParts[i4]) === null || _a5 === void 0 ? void 0 : _a5.startsWith("{")) && ((_b2 = candidateParts[i4]) === null || _b2 === void 0 ? void 0 : _b2.indexOf("}")) !== -1) { - const start = candidateParts[i4].indexOf("}") + 1, end = (_c2 = candidateParts[i4]) === null || _c2 === void 0 ? void 0 : _c2.length; - const isMatched = new RegExp(`${(_d2 = candidateParts[i4]) === null || _d2 === void 0 ? void 0 : _d2.slice(start, end)}`).test(pathParts[j4] || ""); + for (let i3 = candidateParts.length - 1, j4 = pathParts.length - 1; i3 >= 1 && j4 >= 1; i3--, j4--) { + if (((_a5 = candidateParts[i3]) === null || _a5 === void 0 ? void 0 : _a5.startsWith("{")) && ((_b2 = candidateParts[i3]) === null || _b2 === void 0 ? void 0 : _b2.indexOf("}")) !== -1) { + const start = candidateParts[i3].indexOf("}") + 1, end = (_c2 = candidateParts[i3]) === null || _c2 === void 0 ? void 0 : _c2.length; + const isMatched = new RegExp(`${(_d2 = candidateParts[i3]) === null || _d2 === void 0 ? void 0 : _d2.slice(start, end)}`).test(pathParts[j4] || ""); if (!isMatched) { found = false; break; } continue; } - if (candidateParts[i4] !== pathParts[j4]) { + if (candidateParts[i3] !== pathParts[j4]) { found = false; break; } @@ -41667,7 +38527,7 @@ function serializeOnYourDataVectorizationSourceUnion(obj) { } // node_modules/@azure/openai/dist-esm/src/api/getSSEs.js -async function getStream(response) { +async function getStream2(response) { const { body, status } = await response.asNodeStream(); if (status !== "200" && body !== void 0) { const text = await streamToText2(body); @@ -41741,7 +38601,7 @@ function iteratorToStream(iterator, cancel) { }); } function ensureAsyncIterable(stream4) { - if (isReadableStream6(stream4)) { + if (isReadableStream4(stream4)) { makeAsyncIterable2(stream4); return { cancel: () => stream4.cancel(), @@ -41756,7 +38616,7 @@ function ensureAsyncIterable(stream4) { }; } } -function isReadableStream6(body) { +function isReadableStream4(body) { return Boolean(body && typeof body.getReader === "function" && typeof body.tee === "function"); } function toAsyncIterable(stream4) { @@ -41791,10 +38651,10 @@ function createSseStream(chunkStream) { const asyncIter = toMessage(toLine(iterable)); return createStream(asyncIter, cancel); } -function concatBuffer(a5, b7) { - const res = new Uint8Array(a5.length + b7.length); - res.set(a5); - res.set(b7, a5.length); +function concatBuffer(a4, b7) { + const res = new Uint8Array(a4.length + b7.length); + res.set(a4); + res.set(b7, a4.length); return res; } function createMessage() { @@ -41962,7 +38822,7 @@ function toAsyncIterable2(stream4) { // node_modules/@azure/openai/dist-esm/src/api/oaiSse.js async function getOaiSSEs(response, toEvent) { - const stringStream = await getStream(response); + const stringStream = await getStream2(response); const eventStream = createSseStream(stringStream); const jsonParser = new TransformStream({ transform: async (chunk, controller) => { @@ -42397,7 +39257,7 @@ var AzureEngine = class { constructor(config7) { this.generateCommitMessage = async (messages) => { try { - const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a5, b7) => a5 + b7, 0); + const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a4, b7) => a4 + b7, 0); if (REQUEST_TOKENS > this.config.maxTokensInput - this.config.maxTokensOutput) { throw new Error("TOO_MUCH_TOKENS" /* tooMuchTokens */); } @@ -42434,7 +39294,7 @@ var AzureEngine = class { }; // src/engine/flowise.ts -var FlowiseAi = class { +var FlowiseEngine = class { constructor(config7) { this.config = config7; this.client = axios_default.create({ @@ -42773,21 +39633,21 @@ function __await2(v5) { function __asyncGenerator2(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g4 = generator.apply(thisArg, _arguments || []), i4, q6 = []; - return i4 = {}, verb("next"), verb("throw"), verb("return"), i4[Symbol.asyncIterator] = function() { + var g4 = generator.apply(thisArg, _arguments || []), i3, q6 = []; + return i3 = {}, verb("next"), verb("throw"), verb("return"), i3[Symbol.asyncIterator] = function() { return this; - }, i4; - function verb(n3) { - if (g4[n3]) - i4[n3] = function(v5) { - return new Promise(function(a5, b7) { - q6.push([n3, v5, a5, b7]) > 1 || resume(n3, v5); + }, i3; + function verb(n2) { + if (g4[n2]) + i3[n2] = function(v5) { + return new Promise(function(a4, b7) { + q6.push([n2, v5, a4, b7]) > 1 || resume(n2, v5); }); }; } - function resume(n3, v5) { + function resume(n2, v5) { try { - step(g4[n3](v5)); + step(g4[n2](v5)); } catch (e3) { settle2(q6[0][3], e3); } @@ -42884,22 +39744,22 @@ function aggregateResponses(responses) { for (const response of responses) { if (response.candidates) { for (const candidate of response.candidates) { - const i4 = candidate.index; + const i3 = candidate.index; if (!aggregatedResponse.candidates) { aggregatedResponse.candidates = []; } - if (!aggregatedResponse.candidates[i4]) { - aggregatedResponse.candidates[i4] = { + if (!aggregatedResponse.candidates[i3]) { + aggregatedResponse.candidates[i3] = { index: candidate.index }; } - aggregatedResponse.candidates[i4].citationMetadata = candidate.citationMetadata; - aggregatedResponse.candidates[i4].finishReason = candidate.finishReason; - aggregatedResponse.candidates[i4].finishMessage = candidate.finishMessage; - aggregatedResponse.candidates[i4].safetyRatings = candidate.safetyRatings; + aggregatedResponse.candidates[i3].citationMetadata = candidate.citationMetadata; + aggregatedResponse.candidates[i3].finishReason = candidate.finishReason; + aggregatedResponse.candidates[i3].finishMessage = candidate.finishMessage; + aggregatedResponse.candidates[i3].safetyRatings = candidate.safetyRatings; if (candidate.content && candidate.content.parts) { - if (!aggregatedResponse.candidates[i4].content) { - aggregatedResponse.candidates[i4].content = { + if (!aggregatedResponse.candidates[i3].content) { + aggregatedResponse.candidates[i3].content = { role: candidate.content.role || "user", parts: [] }; @@ -42915,7 +39775,7 @@ function aggregateResponses(responses) { if (Object.keys(newPart).length === 0) { newPart.text = ""; } - aggregatedResponse.candidates[i4].content.parts.push(newPart); + aggregatedResponse.candidates[i3].content.parts.push(newPart); } } } @@ -43229,7 +40089,7 @@ var GoogleGenerativeAI = class { }; // src/engine/gemini.ts -var Gemini = class { +var GeminiEngine = class { constructor(config7) { this.client = new GoogleGenerativeAI(config7.apiKey); this.config = config7; @@ -43287,7 +40147,7 @@ var Gemini = class { }; // src/engine/ollama.ts -var OllamaAi = class { +var OllamaEngine = class { constructor(config7) { this.config = config7; this.client = axios_default.create({ @@ -43337,7 +40197,7 @@ __export(error_exports2, { }); // node_modules/openai/version.mjs -var VERSION4 = "4.56.0"; +var VERSION4 = "4.57.0"; // node_modules/openai/_shims/registry.mjs var auto2 = false; @@ -43381,8 +40241,8 @@ function setShims2(shims, options = { auto: false }) { var nf2 = __toESM(require_lib2(), 1); var import_agentkeepalive2 = __toESM(require_agentkeepalive(), 1); var import_abort_controller6 = __toESM(require_abort_controller(), 1); -var import_node_fs8 = require("node:fs"); -var import_node_stream12 = require("node:stream"); +var import_node_fs4 = require("node:fs"); +var import_node_stream4 = require("node:stream"); // node_modules/openai/_shims/MultipartBody.mjs var MultipartBody2 = class { @@ -43397,20 +40257,20 @@ var MultipartBody2 = class { // node_modules/openai/_shims/node-runtime.mjs var import_web = require("node:stream/web"); var fileFromPathWarned2 = false; -async function fileFromPath5(path7, ...args) { +async function fileFromPath5(path5, ...args) { const { fileFromPath: _fileFromPath } = await Promise.resolve().then(() => (init_fileFromPath(), fileFromPath_exports)); if (!fileFromPathWarned2) { - console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path7)}) instead`); + console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path5)}) instead`); fileFromPathWarned2 = true; } - return await _fileFromPath(path7, ...args); + return await _fileFromPath(path5, ...args); } var defaultHttpAgent2 = new import_agentkeepalive2.default({ keepAlive: true, timeout: 5 * 60 * 1e3 }); var defaultHttpsAgent2 = new import_agentkeepalive2.default.HttpsAgent({ keepAlive: true, timeout: 5 * 60 * 1e3 }); async function getMultipartRequestOptions4(form, opts) { const encoder = new FormDataEncoder(form); - const readable2 = import_node_stream12.Readable.from(encoder); - const body = new MultipartBody2(readable2); + const readable = import_node_stream4.Readable.from(encoder); + const body = new MultipartBody2(readable); const headers = { ...opts.headers, ...encoder.headers, @@ -43435,7 +40295,7 @@ function getRuntime2() { getMultipartRequestOptions: getMultipartRequestOptions4, getDefaultAgent: (url2) => url2.startsWith("https") ? defaultHttpsAgent2 : defaultHttpAgent2, fileFromPath: fileFromPath5, - isFsReadStream: (value) => value instanceof import_node_fs8.ReadStream + isFsReadStream: (value) => value instanceof import_node_fs4.ReadStream }; } @@ -43638,15 +40498,15 @@ async function* iterSSEChunks2(iterator) { function findDoubleNewlineIndex2(buffer) { const newline = 10; const carriage = 13; - for (let i4 = 0; i4 < buffer.length - 2; i4++) { - if (buffer[i4] === newline && buffer[i4 + 1] === newline) { - return i4 + 2; + for (let i3 = 0; i3 < buffer.length - 2; i3++) { + if (buffer[i3] === newline && buffer[i3 + 1] === newline) { + return i3 + 2; } - if (buffer[i4] === carriage && buffer[i4 + 1] === carriage) { - return i4 + 2; + if (buffer[i3] === carriage && buffer[i3 + 1] === carriage) { + return i3 + 2; } - if (buffer[i4] === carriage && buffer[i4 + 1] === newline && i4 + 3 < buffer.length && buffer[i4 + 2] === carriage && buffer[i4 + 3] === newline) { - return i4 + 4; + if (buffer[i3] === carriage && buffer[i3 + 1] === newline && i3 + 3 < buffer.length && buffer[i3 + 2] === carriage && buffer[i3 + 3] === newline) { + return i3 + 4; } } return -1; @@ -43990,29 +40850,29 @@ var APIClient2 = class { defaultIdempotencyKey() { return `stainless-node-retry-${uuid42()}`; } - get(path7, opts) { - return this.methodRequest("get", path7, opts); + get(path5, opts) { + return this.methodRequest("get", path5, opts); } - post(path7, opts) { - return this.methodRequest("post", path7, opts); + post(path5, opts) { + return this.methodRequest("post", path5, opts); } - patch(path7, opts) { - return this.methodRequest("patch", path7, opts); + patch(path5, opts) { + return this.methodRequest("patch", path5, opts); } - put(path7, opts) { - return this.methodRequest("put", path7, opts); + put(path5, opts) { + return this.methodRequest("put", path5, opts); } - delete(path7, opts) { - return this.methodRequest("delete", path7, opts); + delete(path5, opts) { + return this.methodRequest("delete", path5, opts); } - methodRequest(method, path7, opts) { + methodRequest(method, path5, opts) { return this.request(Promise.resolve(opts).then(async (opts2) => { const body = opts2 && isBlobLike2(opts2?.body) ? new DataView(await opts2.body.arrayBuffer()) : opts2?.body instanceof DataView ? opts2.body : opts2?.body instanceof ArrayBuffer ? new DataView(opts2.body) : opts2 && ArrayBuffer.isView(opts2?.body) ? new DataView(opts2.body.buffer) : opts2?.body; - return { method, path: path7, ...opts2, body }; + return { method, path: path5, ...opts2, body }; })); } - getAPIList(path7, Page2, opts) { - return this.requestAPIList(Page2, { method: "get", path: path7, ...opts }); + getAPIList(path5, Page2, opts) { + return this.requestAPIList(Page2, { method: "get", path: path5, ...opts }); } calculateContentLength(body) { if (typeof body === "string") { @@ -44030,10 +40890,10 @@ var APIClient2 = class { return null; } buildRequest(options) { - const { method, path: path7, query, headers = {} } = options; + const { method, path: path5, query, headers = {} } = options; const body = ArrayBuffer.isView(options.body) || options.__binaryRequest && typeof options.body === "string" ? options.body : isMultipartBody2(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null; const contentLength = this.calculateContentLength(body); - const url2 = this.buildURL(path7, query); + const url2 = this.buildURL(path5, query); if ("timeout" in options) validatePositiveInteger2("timeout", options.timeout); const timeout = options.timeout ?? this.timeout; @@ -44131,8 +40991,8 @@ var APIClient2 = class { const request3 = this.makeRequest(options, null); return new PagePromise2(this, request3, Page2); } - buildURL(path7, query) { - const url2 = isAbsoluteURL3(path7) ? new URL(path7) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path7.startsWith("/") ? path7.slice(1) : path7)); + buildURL(path5, query) { + const url2 = isAbsoluteURL3(path5) ? new URL(path5) : new URL(this.baseURL + (this.baseURL.endsWith("/") && path5.startsWith("/") ? path5.slice(1) : path5)); const defaultQuery = this.defaultQuery(); if (!isEmptyObj2(defaultQuery)) { query = { ...defaultQuery, ...query }; @@ -44393,24 +41253,24 @@ var normalizeArch2 = (arch2) => { return `other:${arch2}`; return "unknown"; }; -var normalizePlatform2 = (platform2) => { - platform2 = platform2.toLowerCase(); - if (platform2.includes("ios")) +var normalizePlatform2 = (platform) => { + platform = platform.toLowerCase(); + if (platform.includes("ios")) return "iOS"; - if (platform2 === "android") + if (platform === "android") return "Android"; - if (platform2 === "darwin") + if (platform === "darwin") return "MacOS"; - if (platform2 === "win32") + if (platform === "win32") return "Windows"; - if (platform2 === "freebsd") + if (platform === "freebsd") return "FreeBSD"; - if (platform2 === "openbsd") + if (platform === "openbsd") return "OpenBSD"; - if (platform2 === "linux") + if (platform === "linux") return "Linux"; - if (platform2) - return `Other:${platform2}`; + if (platform) + return `Other:${platform}`; return "Unknown"; }; var _platformHeaders2; @@ -44429,14 +41289,14 @@ var isAbsoluteURL3 = (url2) => { return startsWithSchemeRegexp2.test(url2); }; var sleep2 = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); -var validatePositiveInteger2 = (name, n3) => { - if (typeof n3 !== "number" || !Number.isInteger(n3)) { +var validatePositiveInteger2 = (name, n2) => { + if (typeof n2 !== "number" || !Number.isInteger(n2)) { throw new OpenAIError(`${name} must be an integer`); } - if (n3 < 0) { + if (n2 < 0) { throw new OpenAIError(`${name} must be a positive integer`); } - return n3; + return n2; }; var castToError2 = (err) => { if (err instanceof Error) @@ -44483,9 +41343,9 @@ function debug2(action, ...args) { } } var uuid42 = () => { - return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c5) => { + return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c3) => { const r3 = Math.random() * 16 | 0; - const v5 = c5 === "x" ? r3 : r3 & 3 | 8; + const v5 = c3 === "x" ? r3 : r3 & 3 | 8; return v5.toString(16); }); }; @@ -44630,6 +41490,9 @@ var ContentFilterFinishReasonError = class extends OpenAIError { } }; +// node_modules/openai/index.mjs +var qs = __toESM(require_lib3(), 1); + // node_modules/openai/pagination.mjs var Page = class extends AbstractPage2 { constructor(client, response, body, options) { @@ -45190,7 +42053,7 @@ var AbstractChatCompletionRunner = class extends EventStream { const finalFunctionCallResult = __classPrivateFieldGet11(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalFunctionCallResult).call(this); if (finalFunctionCallResult != null) this._emit("finalFunctionCallResult", finalFunctionCallResult); - if (this._chatCompletions.some((c5) => c5.usage)) { + if (this._chatCompletions.some((c3) => c3.usage)) { this._emit("totalUsage", __classPrivateFieldGet11(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_calculateTotalUsage).call(this)); } } @@ -45229,7 +42092,7 @@ var AbstractChatCompletionRunner = class extends EventStream { for (const message of params.messages) { this._addMessage(message, false); } - for (let i4 = 0; i4 < maxChatCompletions; ++i4) { + for (let i3 = 0; i3 < maxChatCompletions; ++i3) { const chatCompletion = await this._createChatCompletion(client, { ...restParams, function_call, @@ -45313,7 +42176,7 @@ var AbstractChatCompletionRunner = class extends EventStream { for (const message of params.messages) { this._addMessage(message, false); } - for (let i4 = 0; i4 < maxChatCompletions; ++i4) { + for (let i3 = 0; i3 < maxChatCompletions; ++i3) { const chatCompletion = await this._createChatCompletion(client, { ...restParams, tool_choice, @@ -45364,9 +42227,9 @@ var AbstractChatCompletionRunner = class extends EventStream { _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _AbstractChatCompletionRunner_getFinalContent = function _AbstractChatCompletionRunner_getFinalContent2() { return __classPrivateFieldGet11(this, _AbstractChatCompletionRunner_instances, "m", _AbstractChatCompletionRunner_getFinalMessage).call(this).content ?? null; }, _AbstractChatCompletionRunner_getFinalMessage = function _AbstractChatCompletionRunner_getFinalMessage2() { - let i4 = this.messages.length; - while (i4-- > 0) { - const message = this.messages[i4]; + let i3 = this.messages.length; + while (i3-- > 0) { + const message = this.messages[i3]; if (isAssistantMessage(message)) { const { function_call, ...rest } = message; const ret = { @@ -45382,8 +42245,8 @@ _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _Abstra } throw new OpenAIError("stream ended without producing a ChatCompletionMessage with role=assistant"); }, _AbstractChatCompletionRunner_getFinalFunctionCall = function _AbstractChatCompletionRunner_getFinalFunctionCall2() { - for (let i4 = this.messages.length - 1; i4 >= 0; i4--) { - const message = this.messages[i4]; + for (let i3 = this.messages.length - 1; i3 >= 0; i3--) { + const message = this.messages[i3]; if (isAssistantMessage(message) && message?.function_call) { return message.function_call; } @@ -45393,8 +42256,8 @@ _AbstractChatCompletionRunner_instances = /* @__PURE__ */ new WeakSet(), _Abstra } return; }, _AbstractChatCompletionRunner_getFinalFunctionCallResult = function _AbstractChatCompletionRunner_getFinalFunctionCallResult2() { - for (let i4 = this.messages.length - 1; i4 >= 0; i4--) { - const message = this.messages[i4]; + for (let i3 = this.messages.length - 1; i3 >= 0; i3--) { + const message = this.messages[i3]; if (isFunctionMessage(message) && message.content != null) { return message.content; } @@ -46114,23 +42977,23 @@ function finalizeChatCompletion(snapshot, params) { role, content, refusal: message.refusal ?? null, - tool_calls: tool_calls.map((tool_call, i4) => { + tool_calls: tool_calls.map((tool_call, i3) => { const { function: fn, type: type2, id: id2, ...toolRest } = tool_call; const { arguments: args, name, ...fnRest } = fn || {}; if (id2 == null) { - throw new OpenAIError(`missing choices[${index}].tool_calls[${i4}].id + throw new OpenAIError(`missing choices[${index}].tool_calls[${i3}].id ${str(snapshot)}`); } if (type2 == null) { - throw new OpenAIError(`missing choices[${index}].tool_calls[${i4}].type + throw new OpenAIError(`missing choices[${index}].tool_calls[${i3}].type ${str(snapshot)}`); } if (name == null) { - throw new OpenAIError(`missing choices[${index}].tool_calls[${i4}].function.name + throw new OpenAIError(`missing choices[${index}].tool_calls[${i3}].function.name ${str(snapshot)}`); } if (args == null) { - throw new OpenAIError(`missing choices[${index}].tool_calls[${i4}].function.arguments + throw new OpenAIError(`missing choices[${index}].tool_calls[${i3}].function.arguments ${str(snapshot)}`); } return { ...toolRest, id: id2, type: type2, function: { ...fnRest, name, arguments: args } }; @@ -46807,8 +43670,12 @@ var MessagesPage = class extends CursorPage { // node_modules/openai/resources/beta/threads/runs/steps.mjs var Steps = class extends APIResource2 { - retrieve(threadId, runId, stepId, options) { + retrieve(threadId, runId, stepId, query = {}, options) { + if (isRequestOptions(query)) { + return this.retrieve(threadId, runId, stepId, {}, query); + } return this._client.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, { + query, ...options, headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } }); @@ -46836,12 +43703,14 @@ var Runs = class extends APIResource2 { super(...arguments); this.steps = new Steps(this._client); } - create(threadId, body, options) { + create(threadId, params, options) { + const { include, ...body } = params; return this._client.post(`/threads/${threadId}/runs`, { + query: { include }, body, ...options, headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers }, - stream: body.stream ?? false + stream: params.stream ?? false }); } retrieve(threadId, runId, options) { @@ -47529,6 +44398,9 @@ var OpenAI = class extends APIClient2 { authHeaders(opts) { return { Authorization: `Bearer ${this.apiKey}` }; } + stringifyQuery(query) { + return qs.stringify(query, { arrayFormat: "brackets" }); + } }; _a4 = OpenAI; OpenAI.OpenAI = _a4; @@ -47581,7 +44453,7 @@ var OpenAiEngine = class { max_tokens: this.config.maxTokensOutput }; try { - const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a5, b7) => a5 + b7, 0); + const REQUEST_TOKENS = messages.map((msg) => tokenCount(msg.content) + 4).reduce((a4, b7) => a4 + b7, 0); if (REQUEST_TOKENS > this.config.maxTokensInput - this.config.maxTokensOutput) throw new Error("TOO_MUCH_TOKENS" /* tooMuchTokens */); const completion = await this.client.chat.completions.create(params); @@ -47610,44 +44482,24 @@ function getEngine() { model: config7.OCO_MODEL, maxTokensOutput: config7.OCO_TOKENS_MAX_OUTPUT, maxTokensInput: config7.OCO_TOKENS_MAX_INPUT, - baseURL: config7.OCO_OPENAI_BASE_PATH + baseURL: config7.OCO_API_URL, + apiKey: config7.OCO_API_KEY }; switch (provider) { case "ollama" /* OLLAMA */: - return new OllamaAi({ - ...DEFAULT_CONFIG2, - apiKey: "", - baseURL: config7.OCO_OLLAMA_API_URL - }); + return new OllamaEngine(DEFAULT_CONFIG2); case "anthropic" /* ANTHROPIC */: - return new AnthropicEngine({ - ...DEFAULT_CONFIG2, - apiKey: config7.OCO_ANTHROPIC_API_KEY - }); + return new AnthropicEngine(DEFAULT_CONFIG2); case "test" /* TEST */: return new TestAi(config7.OCO_TEST_MOCK_TYPE); case "gemini" /* GEMINI */: - return new Gemini({ - ...DEFAULT_CONFIG2, - apiKey: config7.OCO_GEMINI_API_KEY, - baseURL: config7.OCO_GEMINI_BASE_PATH - }); + return new GeminiEngine(DEFAULT_CONFIG2); case "azure" /* AZURE */: - return new AzureEngine({ - ...DEFAULT_CONFIG2, - apiKey: config7.OCO_AZURE_API_KEY - }); + return new AzureEngine(DEFAULT_CONFIG2); case "flowise" /* FLOWISE */: - return new FlowiseAi({ - ...DEFAULT_CONFIG2, - baseURL: config7.OCO_FLOWISE_ENDPOINT || DEFAULT_CONFIG2.baseURL, - apiKey: config7.OCO_FLOWISE_API_KEY - }); + return new FlowiseEngine(DEFAULT_CONFIG2); default: - return new OpenAiEngine({ - ...DEFAULT_CONFIG2, - apiKey: config7.OCO_OPENAI_API_KEY - }); + return new OpenAiEngine(DEFAULT_CONFIG2); } } @@ -47668,7 +44520,7 @@ var computeHash = async (content, algorithm = "sha256") => { }; // src/modules/commitlint/prompts.ts -var import_types = __toESM(require_lib3(), 1); +var import_types = __toESM(require_lib4(), 1); var config2 = getConfig(); var translation = i18n[config2.OCO_LANGUAGE || "en"]; var getTypeRuleExtraDescription = (type2, prompt) => prompt?.questions?.type?.enum?.[type2]?.description; @@ -47804,7 +44656,7 @@ var commitlintPrompts = { }; // src/modules/commitlint/pwd-commitlint.ts -var import_promises12 = __toESM(require("fs/promises"), 1); +var import_promises = __toESM(require("fs/promises"), 1); var import_path3 = __toESM(require("path"), 1); var findModulePath = (moduleName) => { const searchPaths = [ @@ -47823,32 +44675,32 @@ var findModulePath = (moduleName) => { var getCommitLintModuleType = async () => { const packageFile = "@commitlint/load/package.json"; const packageJsonPath = findModulePath(packageFile); - const packageJson = JSON.parse(await import_promises12.default.readFile(packageJsonPath, "utf8")); + const packageJson = JSON.parse(await import_promises.default.readFile(packageJsonPath, "utf8")); if (!packageJson) { throw new Error(`Failed to parse ${packageFile}`); } return packageJson.type === "module" ? "esm" : "cjs"; }; var getCommitLintPWDConfig = async () => { - let load2, modulePath; + let load, modulePath; switch (await getCommitLintModuleType()) { case "cjs": modulePath = findModulePath("@commitlint/load"); - load2 = require(modulePath).default; + load = require(modulePath).default; break; case "esm": modulePath = await findModulePath("@commitlint/load/lib/load.js"); - load2 = (await import(modulePath)).default; + load = (await import(modulePath)).default; break; } - if (load2 && typeof load2 === "function") { - return await load2(); + if (load && typeof load === "function") { + return await load(); } return null; }; // src/modules/commitlint/utils.ts -var import_promises13 = __toESM(require("fs/promises"), 1); +var import_promises2 = __toESM(require("fs/promises"), 1); var removeDoubleNewlines = (input) => { const pattern = /\\n\\n/g; if (pattern.test(input)) { @@ -47869,7 +44721,7 @@ var getJSONBlock = (input) => { var commitlintLLMConfigExists = async () => { let exists; try { - await import_promises13.default.access(COMMITLINT_LLM_CONFIG_PATH); + await import_promises2.default.access(COMMITLINT_LLM_CONFIG_PATH); exists = true; } catch (e3) { exists = false; @@ -47877,13 +44729,13 @@ var commitlintLLMConfigExists = async () => { return exists; }; var writeCommitlintLLMConfig = async (commitlintLLMConfig) => { - await import_promises13.default.writeFile( + await import_promises2.default.writeFile( COMMITLINT_LLM_CONFIG_PATH, JSON.stringify(commitlintLLMConfig, null, 2) ); }; var getCommitlintLLMConfig = async () => { - const content = await import_promises13.default.readFile(COMMITLINT_LLM_CONFIG_PATH); + const content = await import_promises2.default.readFile(COMMITLINT_LLM_CONFIG_PATH); const commitLintLLMConfig = JSON.parse( content.toString() ); @@ -48131,8 +44983,8 @@ function mergeDiffs(arr, maxStringLength) { // src/generateCommitMessageFromGitDiff.ts var config5 = getConfig(); -var MAX_TOKENS_INPUT = config5.OCO_TOKENS_MAX_INPUT || 40960 /* DEFAULT_MAX_TOKENS_INPUT */; -var MAX_TOKENS_OUTPUT = config5.OCO_TOKENS_MAX_OUTPUT || 4096 /* DEFAULT_MAX_TOKENS_OUTPUT */; +var MAX_TOKENS_INPUT = config5.OCO_TOKENS_MAX_INPUT; +var MAX_TOKENS_OUTPUT = config5.OCO_TOKENS_MAX_OUTPUT; var generateCommitMessageChatCompletionPrompt = async (diff, fullGitMojiSpec) => { const INIT_MESSAGES_PROMPT = await getMainCommitPrompt(fullGitMojiSpec); const chatContextAsCompletionRequest = [...INIT_MESSAGES_PROMPT]; @@ -48155,7 +45007,7 @@ var generateCommitMessageByDiff = async (diff, fullGitMojiSpec = false) => { const INIT_MESSAGES_PROMPT = await getMainCommitPrompt(fullGitMojiSpec); const INIT_MESSAGES_PROMPT_LENGTH = INIT_MESSAGES_PROMPT.map( (msg) => tokenCount(msg.content) + 4 - ).reduce((a5, b7) => a5 + b7, 0); + ).reduce((a4, b7) => a4 + b7, 0); const MAX_REQUEST_TOKENS = MAX_TOKENS_INPUT - ADJUSTMENT_FACTOR - INIT_MESSAGES_PROMPT_LENGTH - MAX_TOKENS_OUTPUT; if (tokenCount(diff) >= MAX_REQUEST_TOKENS) { const commitMessagePromises = await getCommitMsgsPromisesFromFileDiffs( @@ -48464,13 +45316,13 @@ ${source_default.grey("\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2 const pushSpinner = le(); pushSpinner.start(`Running 'git push ${selectedRemote}'`); const { stdout: stdout2 } = await execa("git", ["push", selectedRemote]); + if (stdout2) + ce(stdout2); pushSpinner.stop( `${source_default.green( "\u2714" - )} Successfully pushed all commits to ${selectedRemote}` + )} successfully pushed all commits to ${selectedRemote}` ); - if (stdout2) - ce(stdout2); } } else { const regenerateMessage = await Q3({ @@ -48592,7 +45444,7 @@ var commitlintConfigCommand = G3( // src/commands/githook.ts var import_fs4 = require("fs"); -var import_promises14 = __toESM(require("fs/promises"), 1); +var import_promises3 = __toESM(require("fs/promises"), 1); var import_path4 = __toESM(require("path"), 1); var HOOK_NAME = "prepare-commit-msg"; var DEFAULT_SYMLINK_URL = import_path4.default.join(".git", "hooks", HOOK_NAME); @@ -48628,7 +45480,7 @@ var hookCommand = G3( if (await isHookExists()) { let realPath; try { - realPath = await import_promises14.default.realpath(SYMLINK_URL); + realPath = await import_promises3.default.realpath(SYMLINK_URL); } catch (error) { ce(error); realPath = null; @@ -48639,9 +45491,9 @@ var hookCommand = G3( `Different ${HOOK_NAME} is already set. Remove it before setting opencommit as '${HOOK_NAME}' hook.` ); } - await import_promises14.default.mkdir(import_path4.default.dirname(SYMLINK_URL), { recursive: true }); - await import_promises14.default.symlink(HOOK_URL, SYMLINK_URL, "file"); - await import_promises14.default.chmod(SYMLINK_URL, 493); + await import_promises3.default.mkdir(import_path4.default.dirname(SYMLINK_URL), { recursive: true }); + await import_promises3.default.symlink(HOOK_URL, SYMLINK_URL, "file"); + await import_promises3.default.chmod(SYMLINK_URL, 493); return ce(`${source_default.green("\u2714")} Hook set`); } if (mode === "unset") { @@ -48653,13 +45505,13 @@ var hookCommand = G3( `OpenCommit wasn't previously set as '${HOOK_NAME}' hook, nothing to remove` ); } - const realpath = await import_promises14.default.realpath(SYMLINK_URL); + const realpath = await import_promises3.default.realpath(SYMLINK_URL); if (realpath !== HOOK_URL) { return ce( `OpenCommit wasn't previously set as '${HOOK_NAME}' hook, but different hook was, if you want to remove it \u2014 do it manually` ); } - await import_promises14.default.rm(SYMLINK_URL); + await import_promises3.default.rm(SYMLINK_URL); return ce(`${source_default.green("\u2714")} Hook is removed`); } throw new Error( @@ -48673,7 +45525,7 @@ var hookCommand = G3( ); // src/commands/prepare-commit-msg-hook.ts -var import_promises15 = __toESM(require("fs/promises"), 1); +var import_promises4 = __toESM(require("fs/promises"), 1); var [messageFilePath, commitSource] = process.argv.slice(2); var prepareCommitMessageHook = async (isStageAllFlag = false) => { try { @@ -48698,10 +45550,11 @@ var prepareCommitMessageHook = async (isStageAllFlag = false) => { return; ae("opencommit"); const config7 = getConfig(); - if (!config7.OCO_OPENAI_API_KEY && !config7.OCO_ANTHROPIC_API_KEY && !config7.OCO_AZURE_API_KEY) { - throw new Error( - "No OPEN_AI_API or OCO_ANTHROPIC_API_KEY or OCO_AZURE_API_KEY exists. Set your key in ~/.opencommit" + if (!config7.OCO_API_KEY) { + ce( + "No OCO_API_KEY is set. Set your key via `oco config set OCO_API_KEY=. For more info see https://github.com/di-sukharev/opencommit" ); + return; } const spin = le(); spin.start("Generating commit message"); @@ -48709,8 +45562,8 @@ var prepareCommitMessageHook = async (isStageAllFlag = false) => { await getDiff({ files: staged }) ); spin.stop("Done"); - const fileContent = await import_promises15.default.readFile(messageFilePath); - await import_promises15.default.writeFile( + const fileContent = await import_promises4.default.readFile(messageFilePath); + await import_promises4.default.writeFile( messageFilePath, commitMessage + "\n" + fileContent.toString() ); @@ -48750,6 +45603,152 @@ Current version: ${currentVersion}. Latest version: ${latestVersion}. } }; +// src/migrations/_run.ts +var import_fs5 = __toESM(require("fs"), 1); +var import_os2 = require("os"); +var import_path5 = require("path"); + +// src/migrations/00_use_single_api_key_and_url.ts +function use_single_api_key_and_url_default() { + const config7 = getConfig({ setDefaultValues: false }); + const aiProvider = config7.OCO_AI_PROVIDER; + let apiKey; + let apiUrl; + if (aiProvider === "ollama" /* OLLAMA */) { + apiKey = config7["OCO_OLLAMA_API_KEY"]; + apiUrl = config7["OCO_OLLAMA_API_URL"]; + } else if (aiProvider === "anthropic" /* ANTHROPIC */) { + apiKey = config7["OCO_ANTHROPIC_API_KEY"]; + apiUrl = config7["OCO_ANTHROPIC_BASE_PATH"]; + } else if (aiProvider === "openai" /* OPENAI */) { + apiKey = config7["OCO_OPENAI_API_KEY"]; + apiUrl = config7["OCO_OPENAI_BASE_PATH"]; + } else if (aiProvider === "azure" /* AZURE */) { + apiKey = config7["OCO_AZURE_API_KEY"]; + apiUrl = config7["OCO_AZURE_ENDPOINT"]; + } else if (aiProvider === "gemini" /* GEMINI */) { + apiKey = config7["OCO_GEMINI_API_KEY"]; + apiUrl = config7["OCO_GEMINI_BASE_PATH"]; + } else if (aiProvider === "flowise" /* FLOWISE */) { + apiKey = config7["OCO_FLOWISE_API_KEY"]; + apiUrl = config7["OCO_FLOWISE_ENDPOINT"]; + } else { + throw new Error( + `Migration failed, set AI provider first. Run "oco config set OCO_AI_PROVIDER=", where is one of: ${Object.values( + OCO_AI_PROVIDER_ENUM + ).join(", ")}` + ); + } + if (apiKey) + setConfig([["OCO_API_KEY" /* OCO_API_KEY */, apiKey]]); + if (apiUrl) + setConfig([["OCO_API_URL" /* OCO_API_URL */, apiUrl]]); +} + +// src/migrations/01_remove_obsolete_config_keys_from_global_file.ts +function remove_obsolete_config_keys_from_global_file_default() { + const obsoleteKeys = [ + "OCO_OLLAMA_API_KEY", + "OCO_OLLAMA_API_URL", + "OCO_ANTHROPIC_API_KEY", + "OCO_ANTHROPIC_BASE_PATH", + "OCO_OPENAI_API_KEY", + "OCO_OPENAI_BASE_PATH", + "OCO_AZURE_API_KEY", + "OCO_AZURE_ENDPOINT", + "OCO_GEMINI_API_KEY", + "OCO_GEMINI_BASE_PATH", + "OCO_FLOWISE_API_KEY", + "OCO_FLOWISE_ENDPOINT" + ]; + const globalConfig = getGlobalConfig(); + const configToOverride = { ...globalConfig }; + for (const key of obsoleteKeys) + delete configToOverride[key]; + setGlobalConfig(configToOverride); +} + +// src/migrations/02_set_missing_default_values.ts +function set_missing_default_values_default() { + const setDefaultConfigValues = (config7) => { + const entriesToSet = []; + for (const entry of Object.entries(DEFAULT_CONFIG)) { + const [key, _value] = entry; + if (config7[key] === "undefined") + entriesToSet.push(entry); + } + if (entriesToSet.length > 0) + setConfig(entriesToSet); + }; + setDefaultConfigValues(getGlobalConfig()); +} + +// src/migrations/_migrations.ts +var migrations = [ + { + name: "00_use_single_api_key_and_url", + run: use_single_api_key_and_url_default + }, + { + name: "01_remove_obsolete_config_keys_from_global_file", + run: remove_obsolete_config_keys_from_global_file_default + }, + { + name: "02_set_missing_default_values", + run: set_missing_default_values_default + } +]; + +// src/migrations/_run.ts +var migrationsFile = (0, import_path5.join)((0, import_os2.homedir)(), ".opencommit_migrations"); +var getCompletedMigrations = () => { + if (!import_fs5.default.existsSync(migrationsFile)) { + return []; + } + const data = import_fs5.default.readFileSync(migrationsFile, "utf-8"); + return data ? JSON.parse(data) : []; +}; +var saveCompletedMigration = (migrationName) => { + const completedMigrations = getCompletedMigrations(); + completedMigrations.push(migrationName); + import_fs5.default.writeFileSync( + migrationsFile, + JSON.stringify(completedMigrations, null, 2) + ); +}; +var runMigrations = async () => { + if (!getIsGlobalConfigFileExist()) + return; + const config7 = getConfig(); + if (config7.OCO_AI_PROVIDER === "test" /* TEST */) + return; + const completedMigrations = getCompletedMigrations(); + let isMigrated = false; + for (const migration of migrations) { + if (!completedMigrations.includes(migration.name)) { + try { + console.log("Applying migration", migration.name); + migration.run(); + console.log("Migration applied successfully", migration.name); + saveCompletedMigration(migration.name); + } catch (error) { + ce( + `${source_default.red("Failed to apply migration")} ${migration.name}: ${error}` + ); + } + isMigrated = true; + } + } + if (isMigrated) { + ce( + `${source_default.green( + "\u2714" + )} Migrations to your config were applied successfully. Please rerun.` + ); + process.exit(0); + } +}; + // src/cli.ts var extraArgs = process.argv.slice(2); Z2( @@ -48770,6 +45769,7 @@ Z2( help: { description: package_default.description } }, async ({ flags }) => { + await runMigrations(); await checkIsLatestVersion(); if (await isHookCalled()) { prepareCommitMessageHook(); diff --git a/out/github-action.cjs b/out/github-action.cjs index 65729f68..68b14210 100644 --- a/out/github-action.cjs +++ b/out/github-action.cjs @@ -220,14 +220,14 @@ var require_stringify = __commonJS({ for (let i3 = 0; i3 < 256; ++i3) { byteToHex.push((i3 + 256).toString(16).substr(1)); } - function stringify(arr, offset = 0) { + function stringify2(arr, offset = 0) { const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); if (!(0, _validate.default)(uuid)) { throw TypeError("Stringified UUID is invalid"); } return uuid; } - var _default = stringify; + var _default = stringify2; exports.default = _default; } }); @@ -1421,7 +1421,7 @@ var require_util = __commonJS({ var { InvalidArgumentError } = require_errors(); var { Blob: Blob5 } = require("buffer"); var nodeUtil = require("util"); - var { stringify } = require("querystring"); + var { stringify: stringify2 } = require("querystring"); var { headerNameLowerCasedRecord } = require_constants(); var [nodeMajor, nodeMinor] = process.versions.node.split(".").map((v2) => Number(v2)); function nop() { @@ -1436,7 +1436,7 @@ var require_util = __commonJS({ if (url2.includes("?") || url2.includes("#")) { throw new Error('Query params cannot be passed when url already contains "?" or "#".'); } - const stringified = stringify(queryParams); + const stringified = stringify2(queryParams); if (stringified) { url2 += "?" + stringified; } @@ -5774,7 +5774,7 @@ var require_body = __commonJS({ const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, "0")}`; const prefix = `--${boundary}\r Content-Disposition: form-data`; - const escape = (str2) => str2.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); + const escape2 = (str2) => str2.replace(/\n/g, "%0A").replace(/\r/g, "%0D").replace(/"/g, "%22"); const normalizeLinefeeds = (value) => value.replace(/\r?\n|\r/g, "\r\n"); const blobParts = []; const rn = new Uint8Array([13, 10]); @@ -5782,14 +5782,14 @@ Content-Disposition: form-data`; let hasUnknownSizeValue = false; for (const [name, value] of object) { if (typeof value === "string") { - const chunk2 = textEncoder2.encode(prefix + `; name="${escape(normalizeLinefeeds(name))}"\r + const chunk2 = textEncoder2.encode(prefix + `; name="${escape2(normalizeLinefeeds(name))}"\r \r ${normalizeLinefeeds(value)}\r `); blobParts.push(chunk2); length += chunk2.byteLength; } else { - const chunk2 = textEncoder2.encode(`${prefix}; name="${escape(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape(value.name)}"` : "") + `\r + const chunk2 = textEncoder2.encode(`${prefix}; name="${escape2(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${escape2(value.name)}"` : "") + `\r Content-Type: ${value.type || "application/octet-stream"}\r \r `); @@ -15762,7 +15762,7 @@ var require_util6 = __commonJS({ throw new Error("Invalid cookie max-age"); } } - function stringify(cookie) { + function stringify2(cookie) { if (cookie.name.length === 0) { return null; } @@ -15827,7 +15827,7 @@ var require_util6 = __commonJS({ } module2.exports = { isCTLExcludingHtab, - stringify, + stringify: stringify2, getHeadersList }; } @@ -15978,7 +15978,7 @@ var require_cookies = __commonJS({ "node_modules/undici/lib/cookies/index.js"(exports, module2) { "use strict"; var { parseSetCookie } = require_parse2(); - var { stringify, getHeadersList } = require_util6(); + var { stringify: stringify2, getHeadersList } = require_util6(); var { webidl } = require_webidl(); var { Headers: Headers6 } = require_headers(); function getCookies(headers) { @@ -16020,9 +16020,9 @@ var require_cookies = __commonJS({ webidl.argumentLengthCheck(arguments, 2, { header: "setCookie" }); webidl.brandCheck(headers, Headers6, { strict: false }); cookie = webidl.converters.Cookie(cookie); - const str2 = stringify(cookie); + const str2 = stringify2(cookie); if (str2) { - headers.append("Set-Cookie", stringify(cookie)); + headers.append("Set-Cookie", stringify2(cookie)); } } webidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([ @@ -45416,6 +45416,2144 @@ var require_state2 = __commonJS({ } }); +// node_modules/es-errors/index.js +var require_es_errors = __commonJS({ + "node_modules/es-errors/index.js"(exports, module2) { + "use strict"; + module2.exports = Error; + } +}); + +// node_modules/es-errors/eval.js +var require_eval = __commonJS({ + "node_modules/es-errors/eval.js"(exports, module2) { + "use strict"; + module2.exports = EvalError; + } +}); + +// node_modules/es-errors/range.js +var require_range = __commonJS({ + "node_modules/es-errors/range.js"(exports, module2) { + "use strict"; + module2.exports = RangeError; + } +}); + +// node_modules/es-errors/ref.js +var require_ref = __commonJS({ + "node_modules/es-errors/ref.js"(exports, module2) { + "use strict"; + module2.exports = ReferenceError; + } +}); + +// node_modules/es-errors/syntax.js +var require_syntax = __commonJS({ + "node_modules/es-errors/syntax.js"(exports, module2) { + "use strict"; + module2.exports = SyntaxError; + } +}); + +// node_modules/es-errors/type.js +var require_type = __commonJS({ + "node_modules/es-errors/type.js"(exports, module2) { + "use strict"; + module2.exports = TypeError; + } +}); + +// node_modules/es-errors/uri.js +var require_uri = __commonJS({ + "node_modules/es-errors/uri.js"(exports, module2) { + "use strict"; + module2.exports = URIError; + } +}); + +// node_modules/has-symbols/shams.js +var require_shams = __commonJS({ + "node_modules/has-symbols/shams.js"(exports, module2) { + "use strict"; + module2.exports = function hasSymbols() { + if (typeof Symbol !== "function" || typeof Object.getOwnPropertySymbols !== "function") { + return false; + } + if (typeof Symbol.iterator === "symbol") { + return true; + } + var obj = {}; + var sym = Symbol("test"); + var symObj = Object(sym); + if (typeof sym === "string") { + return false; + } + if (Object.prototype.toString.call(sym) !== "[object Symbol]") { + return false; + } + if (Object.prototype.toString.call(symObj) !== "[object Symbol]") { + return false; + } + var symVal = 42; + obj[sym] = symVal; + for (sym in obj) { + return false; + } + if (typeof Object.keys === "function" && Object.keys(obj).length !== 0) { + return false; + } + if (typeof Object.getOwnPropertyNames === "function" && Object.getOwnPropertyNames(obj).length !== 0) { + return false; + } + var syms = Object.getOwnPropertySymbols(obj); + if (syms.length !== 1 || syms[0] !== sym) { + return false; + } + if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { + return false; + } + if (typeof Object.getOwnPropertyDescriptor === "function") { + var descriptor = Object.getOwnPropertyDescriptor(obj, sym); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { + return false; + } + } + return true; + }; + } +}); + +// node_modules/has-symbols/index.js +var require_has_symbols = __commonJS({ + "node_modules/has-symbols/index.js"(exports, module2) { + "use strict"; + var origSymbol = typeof Symbol !== "undefined" && Symbol; + var hasSymbolSham = require_shams(); + module2.exports = function hasNativeSymbols() { + if (typeof origSymbol !== "function") { + return false; + } + if (typeof Symbol !== "function") { + return false; + } + if (typeof origSymbol("foo") !== "symbol") { + return false; + } + if (typeof Symbol("bar") !== "symbol") { + return false; + } + return hasSymbolSham(); + }; + } +}); + +// node_modules/has-proto/index.js +var require_has_proto = __commonJS({ + "node_modules/has-proto/index.js"(exports, module2) { + "use strict"; + var test2 = { + __proto__: null, + foo: {} + }; + var $Object = Object; + module2.exports = function hasProto() { + return { __proto__: test2 }.foo === test2.foo && !(test2 instanceof $Object); + }; + } +}); + +// node_modules/function-bind/implementation.js +var require_implementation = __commonJS({ + "node_modules/function-bind/implementation.js"(exports, module2) { + "use strict"; + var ERROR_MESSAGE = "Function.prototype.bind called on incompatible "; + var toStr = Object.prototype.toString; + var max = Math.max; + var funcType = "[object Function]"; + var concatty = function concatty2(a3, b3) { + var arr = []; + for (var i3 = 0; i3 < a3.length; i3 += 1) { + arr[i3] = a3[i3]; + } + for (var j4 = 0; j4 < b3.length; j4 += 1) { + arr[j4 + a3.length] = b3[j4]; + } + return arr; + }; + var slicy = function slicy2(arrLike, offset) { + var arr = []; + for (var i3 = offset || 0, j4 = 0; i3 < arrLike.length; i3 += 1, j4 += 1) { + arr[j4] = arrLike[i3]; + } + return arr; + }; + var joiny = function(arr, joiner) { + var str2 = ""; + for (var i3 = 0; i3 < arr.length; i3 += 1) { + str2 += arr[i3]; + if (i3 + 1 < arr.length) { + str2 += joiner; + } + } + return str2; + }; + module2.exports = function bind2(that) { + var target = this; + if (typeof target !== "function" || toStr.apply(target) !== funcType) { + throw new TypeError(ERROR_MESSAGE + target); + } + var args = slicy(arguments, 1); + var bound; + var binder = function() { + if (this instanceof bound) { + var result = target.apply( + this, + concatty(args, arguments) + ); + if (Object(result) === result) { + return result; + } + return this; + } + return target.apply( + that, + concatty(args, arguments) + ); + }; + var boundLength = max(0, target.length - args.length); + var boundArgs = []; + for (var i3 = 0; i3 < boundLength; i3++) { + boundArgs[i3] = "$" + i3; + } + bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder); + if (target.prototype) { + var Empty = function Empty2() { + }; + Empty.prototype = target.prototype; + bound.prototype = new Empty(); + Empty.prototype = null; + } + return bound; + }; + } +}); + +// node_modules/function-bind/index.js +var require_function_bind = __commonJS({ + "node_modules/function-bind/index.js"(exports, module2) { + "use strict"; + var implementation = require_implementation(); + module2.exports = Function.prototype.bind || implementation; + } +}); + +// node_modules/hasown/index.js +var require_hasown = __commonJS({ + "node_modules/hasown/index.js"(exports, module2) { + "use strict"; + var call = Function.prototype.call; + var $hasOwn = Object.prototype.hasOwnProperty; + var bind2 = require_function_bind(); + module2.exports = bind2.call(call, $hasOwn); + } +}); + +// node_modules/get-intrinsic/index.js +var require_get_intrinsic = __commonJS({ + "node_modules/get-intrinsic/index.js"(exports, module2) { + "use strict"; + var undefined2; + var $Error = require_es_errors(); + var $EvalError = require_eval(); + var $RangeError = require_range(); + var $ReferenceError = require_ref(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type(); + var $URIError = require_uri(); + var $Function = Function; + var getEvalledConstructor = function(expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")(); + } catch (e3) { + } + }; + var $gOPD = Object.getOwnPropertyDescriptor; + if ($gOPD) { + try { + $gOPD({}, ""); + } catch (e3) { + $gOPD = null; + } + } + var throwTypeError = function() { + throw new $TypeError(); + }; + var ThrowTypeError = $gOPD ? function() { + try { + arguments.callee; + return throwTypeError; + } catch (calleeThrows) { + try { + return $gOPD(arguments, "callee").get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }() : throwTypeError; + var hasSymbols = require_has_symbols()(); + var hasProto = require_has_proto()(); + var getProto = Object.getPrototypeOf || (hasProto ? function(x2) { + return x2.__proto__; + } : null); + var needsEval = {}; + var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined2 : getProto(Uint8Array); + var INTRINSICS = { + __proto__: null, + "%AggregateError%": typeof AggregateError === "undefined" ? undefined2 : AggregateError, + "%Array%": Array, + "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined2 : ArrayBuffer, + "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined2, + "%AsyncFromSyncIteratorPrototype%": undefined2, + "%AsyncFunction%": needsEval, + "%AsyncGenerator%": needsEval, + "%AsyncGeneratorFunction%": needsEval, + "%AsyncIteratorPrototype%": needsEval, + "%Atomics%": typeof Atomics === "undefined" ? undefined2 : Atomics, + "%BigInt%": typeof BigInt === "undefined" ? undefined2 : BigInt, + "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined2 : BigInt64Array, + "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined2 : BigUint64Array, + "%Boolean%": Boolean, + "%DataView%": typeof DataView === "undefined" ? undefined2 : DataView, + "%Date%": Date, + "%decodeURI%": decodeURI, + "%decodeURIComponent%": decodeURIComponent, + "%encodeURI%": encodeURI, + "%encodeURIComponent%": encodeURIComponent, + "%Error%": $Error, + "%eval%": eval, + "%EvalError%": $EvalError, + "%Float32Array%": typeof Float32Array === "undefined" ? undefined2 : Float32Array, + "%Float64Array%": typeof Float64Array === "undefined" ? undefined2 : Float64Array, + "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined2 : FinalizationRegistry, + "%Function%": $Function, + "%GeneratorFunction%": needsEval, + "%Int8Array%": typeof Int8Array === "undefined" ? undefined2 : Int8Array, + "%Int16Array%": typeof Int16Array === "undefined" ? undefined2 : Int16Array, + "%Int32Array%": typeof Int32Array === "undefined" ? undefined2 : Int32Array, + "%isFinite%": isFinite, + "%isNaN%": isNaN, + "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined2, + "%JSON%": typeof JSON === "object" ? JSON : undefined2, + "%Map%": typeof Map === "undefined" ? undefined2 : Map, + "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Map())[Symbol.iterator]()), + "%Math%": Math, + "%Number%": Number, + "%Object%": Object, + "%parseFloat%": parseFloat, + "%parseInt%": parseInt, + "%Promise%": typeof Promise === "undefined" ? undefined2 : Promise, + "%Proxy%": typeof Proxy === "undefined" ? undefined2 : Proxy, + "%RangeError%": $RangeError, + "%ReferenceError%": $ReferenceError, + "%Reflect%": typeof Reflect === "undefined" ? undefined2 : Reflect, + "%RegExp%": RegExp, + "%Set%": typeof Set === "undefined" ? undefined2 : Set, + "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined2 : getProto((/* @__PURE__ */ new Set())[Symbol.iterator]()), + "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined2 : SharedArrayBuffer, + "%String%": String, + "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined2, + "%Symbol%": hasSymbols ? Symbol : undefined2, + "%SyntaxError%": $SyntaxError, + "%ThrowTypeError%": ThrowTypeError, + "%TypedArray%": TypedArray, + "%TypeError%": $TypeError, + "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined2 : Uint8Array, + "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined2 : Uint8ClampedArray, + "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined2 : Uint16Array, + "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined2 : Uint32Array, + "%URIError%": $URIError, + "%WeakMap%": typeof WeakMap === "undefined" ? undefined2 : WeakMap, + "%WeakRef%": typeof WeakRef === "undefined" ? undefined2 : WeakRef, + "%WeakSet%": typeof WeakSet === "undefined" ? undefined2 : WeakSet + }; + if (getProto) { + try { + null.error; + } catch (e3) { + errorProto = getProto(getProto(e3)); + INTRINSICS["%Error.prototype%"] = errorProto; + } + } + var errorProto; + var doEval = function doEval2(name) { + var value; + if (name === "%AsyncFunction%") { + value = getEvalledConstructor("async function () {}"); + } else if (name === "%GeneratorFunction%") { + value = getEvalledConstructor("function* () {}"); + } else if (name === "%AsyncGeneratorFunction%") { + value = getEvalledConstructor("async function* () {}"); + } else if (name === "%AsyncGenerator%") { + var fn = doEval2("%AsyncGeneratorFunction%"); + if (fn) { + value = fn.prototype; + } + } else if (name === "%AsyncIteratorPrototype%") { + var gen = doEval2("%AsyncGenerator%"); + if (gen && getProto) { + value = getProto(gen.prototype); + } + } + INTRINSICS[name] = value; + return value; + }; + var LEGACY_ALIASES = { + __proto__: null, + "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"], + "%ArrayPrototype%": ["Array", "prototype"], + "%ArrayProto_entries%": ["Array", "prototype", "entries"], + "%ArrayProto_forEach%": ["Array", "prototype", "forEach"], + "%ArrayProto_keys%": ["Array", "prototype", "keys"], + "%ArrayProto_values%": ["Array", "prototype", "values"], + "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"], + "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"], + "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"], + "%BooleanPrototype%": ["Boolean", "prototype"], + "%DataViewPrototype%": ["DataView", "prototype"], + "%DatePrototype%": ["Date", "prototype"], + "%ErrorPrototype%": ["Error", "prototype"], + "%EvalErrorPrototype%": ["EvalError", "prototype"], + "%Float32ArrayPrototype%": ["Float32Array", "prototype"], + "%Float64ArrayPrototype%": ["Float64Array", "prototype"], + "%FunctionPrototype%": ["Function", "prototype"], + "%Generator%": ["GeneratorFunction", "prototype"], + "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"], + "%Int8ArrayPrototype%": ["Int8Array", "prototype"], + "%Int16ArrayPrototype%": ["Int16Array", "prototype"], + "%Int32ArrayPrototype%": ["Int32Array", "prototype"], + "%JSONParse%": ["JSON", "parse"], + "%JSONStringify%": ["JSON", "stringify"], + "%MapPrototype%": ["Map", "prototype"], + "%NumberPrototype%": ["Number", "prototype"], + "%ObjectPrototype%": ["Object", "prototype"], + "%ObjProto_toString%": ["Object", "prototype", "toString"], + "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"], + "%PromisePrototype%": ["Promise", "prototype"], + "%PromiseProto_then%": ["Promise", "prototype", "then"], + "%Promise_all%": ["Promise", "all"], + "%Promise_reject%": ["Promise", "reject"], + "%Promise_resolve%": ["Promise", "resolve"], + "%RangeErrorPrototype%": ["RangeError", "prototype"], + "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"], + "%RegExpPrototype%": ["RegExp", "prototype"], + "%SetPrototype%": ["Set", "prototype"], + "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"], + "%StringPrototype%": ["String", "prototype"], + "%SymbolPrototype%": ["Symbol", "prototype"], + "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"], + "%TypedArrayPrototype%": ["TypedArray", "prototype"], + "%TypeErrorPrototype%": ["TypeError", "prototype"], + "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"], + "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"], + "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"], + "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"], + "%URIErrorPrototype%": ["URIError", "prototype"], + "%WeakMapPrototype%": ["WeakMap", "prototype"], + "%WeakSetPrototype%": ["WeakSet", "prototype"] + }; + var bind2 = require_function_bind(); + var hasOwn3 = require_hasown(); + var $concat = bind2.call(Function.call, Array.prototype.concat); + var $spliceApply = bind2.call(Function.apply, Array.prototype.splice); + var $replace = bind2.call(Function.call, String.prototype.replace); + var $strSlice = bind2.call(Function.call, String.prototype.slice); + var $exec = bind2.call(Function.call, RegExp.prototype.exec); + var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; + var reEscapeChar = /\\(\\)?/g; + var stringToPath = function stringToPath2(string) { + var first = $strSlice(string, 0, 1); + var last = $strSlice(string, -1); + if (first === "%" && last !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected closing `%`"); + } else if (last === "%" && first !== "%") { + throw new $SyntaxError("invalid intrinsic syntax, expected opening `%`"); + } + var result = []; + $replace(string, rePropName, function(match, number, quote, subString) { + result[result.length] = quote ? $replace(subString, reEscapeChar, "$1") : number || match; + }); + return result; + }; + var getBaseIntrinsic = function getBaseIntrinsic2(name, allowMissing) { + var intrinsicName = name; + var alias; + if (hasOwn3(LEGACY_ALIASES, intrinsicName)) { + alias = LEGACY_ALIASES[intrinsicName]; + intrinsicName = "%" + alias[0] + "%"; + } + if (hasOwn3(INTRINSICS, intrinsicName)) { + var value = INTRINSICS[intrinsicName]; + if (value === needsEval) { + value = doEval(intrinsicName); + } + if (typeof value === "undefined" && !allowMissing) { + throw new $TypeError("intrinsic " + name + " exists, but is not available. Please file an issue!"); + } + return { + alias, + name: intrinsicName, + value + }; + } + throw new $SyntaxError("intrinsic " + name + " does not exist!"); + }; + module2.exports = function GetIntrinsic(name, allowMissing) { + if (typeof name !== "string" || name.length === 0) { + throw new $TypeError("intrinsic name must be a non-empty string"); + } + if (arguments.length > 1 && typeof allowMissing !== "boolean") { + throw new $TypeError('"allowMissing" argument must be a boolean'); + } + if ($exec(/^%?[^%]*%?$/, name) === null) { + throw new $SyntaxError("`%` may not be present anywhere but at the beginning and end of the intrinsic name"); + } + var parts = stringToPath(name); + var intrinsicBaseName = parts.length > 0 ? parts[0] : ""; + var intrinsic = getBaseIntrinsic("%" + intrinsicBaseName + "%", allowMissing); + var intrinsicRealName = intrinsic.name; + var value = intrinsic.value; + var skipFurtherCaching = false; + var alias = intrinsic.alias; + if (alias) { + intrinsicBaseName = alias[0]; + $spliceApply(parts, $concat([0, 1], alias)); + } + for (var i3 = 1, isOwn = true; i3 < parts.length; i3 += 1) { + var part = parts[i3]; + var first = $strSlice(part, 0, 1); + var last = $strSlice(part, -1); + if ((first === '"' || first === "'" || first === "`" || (last === '"' || last === "'" || last === "`")) && first !== last) { + throw new $SyntaxError("property names with quotes must have matching quotes"); + } + if (part === "constructor" || !isOwn) { + skipFurtherCaching = true; + } + intrinsicBaseName += "." + part; + intrinsicRealName = "%" + intrinsicBaseName + "%"; + if (hasOwn3(INTRINSICS, intrinsicRealName)) { + value = INTRINSICS[intrinsicRealName]; + } else if (value != null) { + if (!(part in value)) { + if (!allowMissing) { + throw new $TypeError("base intrinsic for " + name + " exists, but the property is not available."); + } + return void 0; + } + if ($gOPD && i3 + 1 >= parts.length) { + var desc = $gOPD(value, part); + isOwn = !!desc; + if (isOwn && "get" in desc && !("originalValue" in desc.get)) { + value = desc.get; + } else { + value = value[part]; + } + } else { + isOwn = hasOwn3(value, part); + value = value[part]; + } + if (isOwn && !skipFurtherCaching) { + INTRINSICS[intrinsicRealName] = value; + } + } + } + return value; + }; + } +}); + +// node_modules/es-define-property/index.js +var require_es_define_property = __commonJS({ + "node_modules/es-define-property/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var $defineProperty = GetIntrinsic("%Object.defineProperty%", true) || false; + if ($defineProperty) { + try { + $defineProperty({}, "a", { value: 1 }); + } catch (e3) { + $defineProperty = false; + } + } + module2.exports = $defineProperty; + } +}); + +// node_modules/gopd/index.js +var require_gopd = __commonJS({ + "node_modules/gopd/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", true); + if ($gOPD) { + try { + $gOPD([], "length"); + } catch (e3) { + $gOPD = null; + } + } + module2.exports = $gOPD; + } +}); + +// node_modules/define-data-property/index.js +var require_define_data_property = __commonJS({ + "node_modules/define-data-property/index.js"(exports, module2) { + "use strict"; + var $defineProperty = require_es_define_property(); + var $SyntaxError = require_syntax(); + var $TypeError = require_type(); + var gopd = require_gopd(); + module2.exports = function defineDataProperty(obj, property, value) { + if (!obj || typeof obj !== "object" && typeof obj !== "function") { + throw new $TypeError("`obj` must be an object or a function`"); + } + if (typeof property !== "string" && typeof property !== "symbol") { + throw new $TypeError("`property` must be a string or a symbol`"); + } + if (arguments.length > 3 && typeof arguments[3] !== "boolean" && arguments[3] !== null) { + throw new $TypeError("`nonEnumerable`, if provided, must be a boolean or null"); + } + if (arguments.length > 4 && typeof arguments[4] !== "boolean" && arguments[4] !== null) { + throw new $TypeError("`nonWritable`, if provided, must be a boolean or null"); + } + if (arguments.length > 5 && typeof arguments[5] !== "boolean" && arguments[5] !== null) { + throw new $TypeError("`nonConfigurable`, if provided, must be a boolean or null"); + } + if (arguments.length > 6 && typeof arguments[6] !== "boolean") { + throw new $TypeError("`loose`, if provided, must be a boolean"); + } + var nonEnumerable = arguments.length > 3 ? arguments[3] : null; + var nonWritable = arguments.length > 4 ? arguments[4] : null; + var nonConfigurable = arguments.length > 5 ? arguments[5] : null; + var loose = arguments.length > 6 ? arguments[6] : false; + var desc = !!gopd && gopd(obj, property); + if ($defineProperty) { + $defineProperty(obj, property, { + configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, + enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, + value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) { + obj[property] = value; + } else { + throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable."); + } + }; + } +}); + +// node_modules/has-property-descriptors/index.js +var require_has_property_descriptors = __commonJS({ + "node_modules/has-property-descriptors/index.js"(exports, module2) { + "use strict"; + var $defineProperty = require_es_define_property(); + var hasPropertyDescriptors = function hasPropertyDescriptors2() { + return !!$defineProperty; + }; + hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + if (!$defineProperty) { + return null; + } + try { + return $defineProperty([], "length", { value: 1 }).length !== 1; + } catch (e3) { + return true; + } + }; + module2.exports = hasPropertyDescriptors; + } +}); + +// node_modules/set-function-length/index.js +var require_set_function_length = __commonJS({ + "node_modules/set-function-length/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var define2 = require_define_data_property(); + var hasDescriptors = require_has_property_descriptors()(); + var gOPD = require_gopd(); + var $TypeError = require_type(); + var $floor = GetIntrinsic("%Math.floor%"); + module2.exports = function setFunctionLength(fn, length) { + if (typeof fn !== "function") { + throw new $TypeError("`fn` is not a function"); + } + if (typeof length !== "number" || length < 0 || length > 4294967295 || $floor(length) !== length) { + throw new $TypeError("`length` must be a positive 32-bit integer"); + } + var loose = arguments.length > 2 && !!arguments[2]; + var functionLengthIsConfigurable = true; + var functionLengthIsWritable = true; + if ("length" in fn && gOPD) { + var desc = gOPD(fn, "length"); + if (desc && !desc.configurable) { + functionLengthIsConfigurable = false; + } + if (desc && !desc.writable) { + functionLengthIsWritable = false; + } + } + if (functionLengthIsConfigurable || functionLengthIsWritable || !loose) { + if (hasDescriptors) { + define2(fn, "length", length, true, true); + } else { + define2(fn, "length", length); + } + } + return fn; + }; + } +}); + +// node_modules/call-bind/index.js +var require_call_bind = __commonJS({ + "node_modules/call-bind/index.js"(exports, module2) { + "use strict"; + var bind2 = require_function_bind(); + var GetIntrinsic = require_get_intrinsic(); + var setFunctionLength = require_set_function_length(); + var $TypeError = require_type(); + var $apply = GetIntrinsic("%Function.prototype.apply%"); + var $call = GetIntrinsic("%Function.prototype.call%"); + var $reflectApply = GetIntrinsic("%Reflect.apply%", true) || bind2.call($call, $apply); + var $defineProperty = require_es_define_property(); + var $max = GetIntrinsic("%Math.max%"); + module2.exports = function callBind(originalFunction) { + if (typeof originalFunction !== "function") { + throw new $TypeError("a function is required"); + } + var func = $reflectApply(bind2, $call, arguments); + return setFunctionLength( + func, + 1 + $max(0, originalFunction.length - (arguments.length - 1)), + true + ); + }; + var applyBind = function applyBind2() { + return $reflectApply(bind2, $apply, arguments); + }; + if ($defineProperty) { + $defineProperty(module2.exports, "apply", { value: applyBind }); + } else { + module2.exports.apply = applyBind; + } + } +}); + +// node_modules/call-bind/callBound.js +var require_callBound = __commonJS({ + "node_modules/call-bind/callBound.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var callBind = require_call_bind(); + var $indexOf = callBind(GetIntrinsic("String.prototype.indexOf")); + module2.exports = function callBoundIntrinsic(name, allowMissing) { + var intrinsic = GetIntrinsic(name, !!allowMissing); + if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) { + return callBind(intrinsic); + } + return intrinsic; + }; + } +}); + +// node_modules/object-inspect/util.inspect.js +var require_util_inspect = __commonJS({ + "node_modules/object-inspect/util.inspect.js"(exports, module2) { + module2.exports = require("util").inspect; + } +}); + +// node_modules/object-inspect/index.js +var require_object_inspect = __commonJS({ + "node_modules/object-inspect/index.js"(exports, module2) { + var hasMap = typeof Map === "function" && Map.prototype; + var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null; + var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === "function" ? mapSizeDescriptor.get : null; + var mapForEach = hasMap && Map.prototype.forEach; + var hasSet = typeof Set === "function" && Set.prototype; + var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null; + var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === "function" ? setSizeDescriptor.get : null; + var setForEach = hasSet && Set.prototype.forEach; + var hasWeakMap = typeof WeakMap === "function" && WeakMap.prototype; + var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null; + var hasWeakSet = typeof WeakSet === "function" && WeakSet.prototype; + var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null; + var hasWeakRef = typeof WeakRef === "function" && WeakRef.prototype; + var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null; + var booleanValueOf = Boolean.prototype.valueOf; + var objectToString = Object.prototype.toString; + var functionToString = Function.prototype.toString; + var $match = String.prototype.match; + var $slice = String.prototype.slice; + var $replace = String.prototype.replace; + var $toUpperCase = String.prototype.toUpperCase; + var $toLowerCase = String.prototype.toLowerCase; + var $test = RegExp.prototype.test; + var $concat = Array.prototype.concat; + var $join = Array.prototype.join; + var $arrSlice = Array.prototype.slice; + var $floor = Math.floor; + var bigIntValueOf = typeof BigInt === "function" ? BigInt.prototype.valueOf : null; + var gOPS = Object.getOwnPropertySymbols; + var symToString = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol.prototype.toString : null; + var hasShammedSymbols = typeof Symbol === "function" && typeof Symbol.iterator === "object"; + var toStringTag = typeof Symbol === "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? "object" : "symbol") ? Symbol.toStringTag : null; + var isEnumerable = Object.prototype.propertyIsEnumerable; + var gPO = (typeof Reflect === "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(O3) { + return O3.__proto__; + } : null); + function addNumericSeparator(num, str2) { + if (num === Infinity || num === -Infinity || num !== num || num && num > -1e3 && num < 1e3 || $test.call(/e/, str2)) { + return str2; + } + var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g; + if (typeof num === "number") { + var int = num < 0 ? -$floor(-num) : $floor(num); + if (int !== num) { + var intStr = String(int); + var dec = $slice.call(str2, intStr.length + 1); + return $replace.call(intStr, sepRegex, "$&_") + "." + $replace.call($replace.call(dec, /([0-9]{3})/g, "$&_"), /_$/, ""); + } + } + return $replace.call(str2, sepRegex, "$&_"); + } + var utilInspect = require_util_inspect(); + var inspectCustom = utilInspect.custom; + var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null; + module2.exports = function inspect_(obj, options, depth, seen) { + var opts = options || {}; + if (has(opts, "quoteStyle") && (opts.quoteStyle !== "single" && opts.quoteStyle !== "double")) { + throw new TypeError('option "quoteStyle" must be "single" or "double"'); + } + if (has(opts, "maxStringLength") && (typeof opts.maxStringLength === "number" ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity : opts.maxStringLength !== null)) { + throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`'); + } + var customInspect = has(opts, "customInspect") ? opts.customInspect : true; + if (typeof customInspect !== "boolean" && customInspect !== "symbol") { + throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`"); + } + if (has(opts, "indent") && opts.indent !== null && opts.indent !== " " && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)) { + throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`'); + } + if (has(opts, "numericSeparator") && typeof opts.numericSeparator !== "boolean") { + throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`'); + } + var numericSeparator = opts.numericSeparator; + if (typeof obj === "undefined") { + return "undefined"; + } + if (obj === null) { + return "null"; + } + if (typeof obj === "boolean") { + return obj ? "true" : "false"; + } + if (typeof obj === "string") { + return inspectString(obj, opts); + } + if (typeof obj === "number") { + if (obj === 0) { + return Infinity / obj > 0 ? "0" : "-0"; + } + var str2 = String(obj); + return numericSeparator ? addNumericSeparator(obj, str2) : str2; + } + if (typeof obj === "bigint") { + var bigIntStr = String(obj) + "n"; + return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr; + } + var maxDepth = typeof opts.depth === "undefined" ? 5 : opts.depth; + if (typeof depth === "undefined") { + depth = 0; + } + if (depth >= maxDepth && maxDepth > 0 && typeof obj === "object") { + return isArray2(obj) ? "[Array]" : "[Object]"; + } + var indent = getIndent(opts, depth); + if (typeof seen === "undefined") { + seen = []; + } else if (indexOf(seen, obj) >= 0) { + return "[Circular]"; + } + function inspect3(value, from, noIndent) { + if (from) { + seen = $arrSlice.call(seen); + seen.push(from); + } + if (noIndent) { + var newOpts = { + depth: opts.depth + }; + if (has(opts, "quoteStyle")) { + newOpts.quoteStyle = opts.quoteStyle; + } + return inspect_(value, newOpts, depth + 1, seen); + } + return inspect_(value, opts, depth + 1, seen); + } + if (typeof obj === "function" && !isRegExp2(obj)) { + var name = nameOf(obj); + var keys = arrObjKeys(obj, inspect3); + return "[Function" + (name ? ": " + name : " (anonymous)") + "]" + (keys.length > 0 ? " { " + $join.call(keys, ", ") + " }" : ""); + } + if (isSymbol(obj)) { + var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, "$1") : symToString.call(obj); + return typeof obj === "object" && !hasShammedSymbols ? markBoxed(symString) : symString; + } + if (isElement(obj)) { + var s2 = "<" + $toLowerCase.call(String(obj.nodeName)); + var attrs = obj.attributes || []; + for (var i3 = 0; i3 < attrs.length; i3++) { + s2 += " " + attrs[i3].name + "=" + wrapQuotes(quote(attrs[i3].value), "double", opts); + } + s2 += ">"; + if (obj.childNodes && obj.childNodes.length) { + s2 += "..."; + } + s2 += ""; + return s2; + } + if (isArray2(obj)) { + if (obj.length === 0) { + return "[]"; + } + var xs = arrObjKeys(obj, inspect3); + if (indent && !singleLineValues(xs)) { + return "[" + indentedJoin(xs, indent) + "]"; + } + return "[ " + $join.call(xs, ", ") + " ]"; + } + if (isError2(obj)) { + var parts = arrObjKeys(obj, inspect3); + if (!("cause" in Error.prototype) && "cause" in obj && !isEnumerable.call(obj, "cause")) { + return "{ [" + String(obj) + "] " + $join.call($concat.call("[cause]: " + inspect3(obj.cause), parts), ", ") + " }"; + } + if (parts.length === 0) { + return "[" + String(obj) + "]"; + } + return "{ [" + String(obj) + "] " + $join.call(parts, ", ") + " }"; + } + if (typeof obj === "object" && customInspect) { + if (inspectSymbol && typeof obj[inspectSymbol] === "function" && utilInspect) { + return utilInspect(obj, { depth: maxDepth - depth }); + } else if (customInspect !== "symbol" && typeof obj.inspect === "function") { + return obj.inspect(); + } + } + if (isMap(obj)) { + var mapParts = []; + if (mapForEach) { + mapForEach.call(obj, function(value, key) { + mapParts.push(inspect3(key, obj, true) + " => " + inspect3(value, obj)); + }); + } + return collectionOf("Map", mapSize.call(obj), mapParts, indent); + } + if (isSet(obj)) { + var setParts = []; + if (setForEach) { + setForEach.call(obj, function(value) { + setParts.push(inspect3(value, obj)); + }); + } + return collectionOf("Set", setSize.call(obj), setParts, indent); + } + if (isWeakMap(obj)) { + return weakCollectionOf("WeakMap"); + } + if (isWeakSet(obj)) { + return weakCollectionOf("WeakSet"); + } + if (isWeakRef(obj)) { + return weakCollectionOf("WeakRef"); + } + if (isNumber2(obj)) { + return markBoxed(inspect3(Number(obj))); + } + if (isBigInt(obj)) { + return markBoxed(inspect3(bigIntValueOf.call(obj))); + } + if (isBoolean2(obj)) { + return markBoxed(booleanValueOf.call(obj)); + } + if (isString2(obj)) { + return markBoxed(inspect3(String(obj))); + } + if (typeof window !== "undefined" && obj === window) { + return "{ [object Window] }"; + } + if (typeof globalThis !== "undefined" && obj === globalThis || typeof global !== "undefined" && obj === global) { + return "{ [object globalThis] }"; + } + if (!isDate2(obj) && !isRegExp2(obj)) { + var ys = arrObjKeys(obj, inspect3); + var isPlainObject4 = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object; + var protoTag = obj instanceof Object ? "" : "null prototype"; + var stringTag = !isPlainObject4 && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : ""; + var constructorTag = isPlainObject4 || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : ""; + var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat.call([], stringTag || [], protoTag || []), ": ") + "] " : ""); + if (ys.length === 0) { + return tag + "{}"; + } + if (indent) { + return tag + "{" + indentedJoin(ys, indent) + "}"; + } + return tag + "{ " + $join.call(ys, ", ") + " }"; + } + return String(obj); + }; + function wrapQuotes(s2, defaultStyle, opts) { + var quoteChar = (opts.quoteStyle || defaultStyle) === "double" ? '"' : "'"; + return quoteChar + s2 + quoteChar; + } + function quote(s2) { + return $replace.call(String(s2), /"/g, """); + } + function isArray2(obj) { + return toStr(obj) === "[object Array]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); + } + function isDate2(obj) { + return toStr(obj) === "[object Date]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); + } + function isRegExp2(obj) { + return toStr(obj) === "[object RegExp]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); + } + function isError2(obj) { + return toStr(obj) === "[object Error]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); + } + function isString2(obj) { + return toStr(obj) === "[object String]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); + } + function isNumber2(obj) { + return toStr(obj) === "[object Number]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); + } + function isBoolean2(obj) { + return toStr(obj) === "[object Boolean]" && (!toStringTag || !(typeof obj === "object" && toStringTag in obj)); + } + function isSymbol(obj) { + if (hasShammedSymbols) { + return obj && typeof obj === "object" && obj instanceof Symbol; + } + if (typeof obj === "symbol") { + return true; + } + if (!obj || typeof obj !== "object" || !symToString) { + return false; + } + try { + symToString.call(obj); + return true; + } catch (e3) { + } + return false; + } + function isBigInt(obj) { + if (!obj || typeof obj !== "object" || !bigIntValueOf) { + return false; + } + try { + bigIntValueOf.call(obj); + return true; + } catch (e3) { + } + return false; + } + var hasOwn3 = Object.prototype.hasOwnProperty || function(key) { + return key in this; + }; + function has(obj, key) { + return hasOwn3.call(obj, key); + } + function toStr(obj) { + return objectToString.call(obj); + } + function nameOf(f4) { + if (f4.name) { + return f4.name; + } + var m4 = $match.call(functionToString.call(f4), /^function\s*([\w$]+)/); + if (m4) { + return m4[1]; + } + return null; + } + function indexOf(xs, x2) { + if (xs.indexOf) { + return xs.indexOf(x2); + } + for (var i3 = 0, l3 = xs.length; i3 < l3; i3++) { + if (xs[i3] === x2) { + return i3; + } + } + return -1; + } + function isMap(x2) { + if (!mapSize || !x2 || typeof x2 !== "object") { + return false; + } + try { + mapSize.call(x2); + try { + setSize.call(x2); + } catch (s2) { + return true; + } + return x2 instanceof Map; + } catch (e3) { + } + return false; + } + function isWeakMap(x2) { + if (!weakMapHas || !x2 || typeof x2 !== "object") { + return false; + } + try { + weakMapHas.call(x2, weakMapHas); + try { + weakSetHas.call(x2, weakSetHas); + } catch (s2) { + return true; + } + return x2 instanceof WeakMap; + } catch (e3) { + } + return false; + } + function isWeakRef(x2) { + if (!weakRefDeref || !x2 || typeof x2 !== "object") { + return false; + } + try { + weakRefDeref.call(x2); + return true; + } catch (e3) { + } + return false; + } + function isSet(x2) { + if (!setSize || !x2 || typeof x2 !== "object") { + return false; + } + try { + setSize.call(x2); + try { + mapSize.call(x2); + } catch (m4) { + return true; + } + return x2 instanceof Set; + } catch (e3) { + } + return false; + } + function isWeakSet(x2) { + if (!weakSetHas || !x2 || typeof x2 !== "object") { + return false; + } + try { + weakSetHas.call(x2, weakSetHas); + try { + weakMapHas.call(x2, weakMapHas); + } catch (s2) { + return true; + } + return x2 instanceof WeakSet; + } catch (e3) { + } + return false; + } + function isElement(x2) { + if (!x2 || typeof x2 !== "object") { + return false; + } + if (typeof HTMLElement !== "undefined" && x2 instanceof HTMLElement) { + return true; + } + return typeof x2.nodeName === "string" && typeof x2.getAttribute === "function"; + } + function inspectString(str2, opts) { + if (str2.length > opts.maxStringLength) { + var remaining = str2.length - opts.maxStringLength; + var trailer = "... " + remaining + " more character" + (remaining > 1 ? "s" : ""); + return inspectString($slice.call(str2, 0, opts.maxStringLength), opts) + trailer; + } + var s2 = $replace.call($replace.call(str2, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, lowbyte); + return wrapQuotes(s2, "single", opts); + } + function lowbyte(c2) { + var n2 = c2.charCodeAt(0); + var x2 = { + 8: "b", + 9: "t", + 10: "n", + 12: "f", + 13: "r" + }[n2]; + if (x2) { + return "\\" + x2; + } + return "\\x" + (n2 < 16 ? "0" : "") + $toUpperCase.call(n2.toString(16)); + } + function markBoxed(str2) { + return "Object(" + str2 + ")"; + } + function weakCollectionOf(type2) { + return type2 + " { ? }"; + } + function collectionOf(type2, size, entries, indent) { + var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ", "); + return type2 + " (" + size + ") {" + joinedEntries + "}"; + } + function singleLineValues(xs) { + for (var i3 = 0; i3 < xs.length; i3++) { + if (indexOf(xs[i3], "\n") >= 0) { + return false; + } + } + return true; + } + function getIndent(opts, depth) { + var baseIndent; + if (opts.indent === " ") { + baseIndent = " "; + } else if (typeof opts.indent === "number" && opts.indent > 0) { + baseIndent = $join.call(Array(opts.indent + 1), " "); + } else { + return null; + } + return { + base: baseIndent, + prev: $join.call(Array(depth + 1), baseIndent) + }; + } + function indentedJoin(xs, indent) { + if (xs.length === 0) { + return ""; + } + var lineJoiner = "\n" + indent.prev + indent.base; + return lineJoiner + $join.call(xs, "," + lineJoiner) + "\n" + indent.prev; + } + function arrObjKeys(obj, inspect3) { + var isArr = isArray2(obj); + var xs = []; + if (isArr) { + xs.length = obj.length; + for (var i3 = 0; i3 < obj.length; i3++) { + xs[i3] = has(obj, i3) ? inspect3(obj[i3], obj) : ""; + } + } + var syms = typeof gOPS === "function" ? gOPS(obj) : []; + var symMap; + if (hasShammedSymbols) { + symMap = {}; + for (var k4 = 0; k4 < syms.length; k4++) { + symMap["$" + syms[k4]] = syms[k4]; + } + } + for (var key in obj) { + if (!has(obj, key)) { + continue; + } + if (isArr && String(Number(key)) === key && key < obj.length) { + continue; + } + if (hasShammedSymbols && symMap["$" + key] instanceof Symbol) { + continue; + } else if ($test.call(/[^\w$]/, key)) { + xs.push(inspect3(key, obj) + ": " + inspect3(obj[key], obj)); + } else { + xs.push(key + ": " + inspect3(obj[key], obj)); + } + } + if (typeof gOPS === "function") { + for (var j4 = 0; j4 < syms.length; j4++) { + if (isEnumerable.call(obj, syms[j4])) { + xs.push("[" + inspect3(syms[j4]) + "]: " + inspect3(obj[syms[j4]], obj)); + } + } + } + return xs; + } + } +}); + +// node_modules/side-channel/index.js +var require_side_channel = __commonJS({ + "node_modules/side-channel/index.js"(exports, module2) { + "use strict"; + var GetIntrinsic = require_get_intrinsic(); + var callBound = require_callBound(); + var inspect3 = require_object_inspect(); + var $TypeError = require_type(); + var $WeakMap = GetIntrinsic("%WeakMap%", true); + var $Map = GetIntrinsic("%Map%", true); + var $weakMapGet = callBound("WeakMap.prototype.get", true); + var $weakMapSet = callBound("WeakMap.prototype.set", true); + var $weakMapHas = callBound("WeakMap.prototype.has", true); + var $mapGet = callBound("Map.prototype.get", true); + var $mapSet = callBound("Map.prototype.set", true); + var $mapHas = callBound("Map.prototype.has", true); + var listGetNode = function(list, key) { + var prev = list; + var curr; + for (; (curr = prev.next) !== null; prev = curr) { + if (curr.key === key) { + prev.next = curr.next; + curr.next = list.next; + list.next = curr; + return curr; + } + } + }; + var listGet = function(objects, key) { + var node = listGetNode(objects, key); + return node && node.value; + }; + var listSet = function(objects, key, value) { + var node = listGetNode(objects, key); + if (node) { + node.value = value; + } else { + objects.next = { + key, + next: objects.next, + value + }; + } + }; + var listHas = function(objects, key) { + return !!listGetNode(objects, key); + }; + module2.exports = function getSideChannel() { + var $wm; + var $m; + var $o; + var channel = { + assert: function(key) { + if (!channel.has(key)) { + throw new $TypeError("Side channel does not contain " + inspect3(key)); + } + }, + get: function(key) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if ($wm) { + return $weakMapGet($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapGet($m, key); + } + } else { + if ($o) { + return listGet($o, key); + } + } + }, + has: function(key) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if ($wm) { + return $weakMapHas($wm, key); + } + } else if ($Map) { + if ($m) { + return $mapHas($m, key); + } + } else { + if ($o) { + return listHas($o, key); + } + } + return false; + }, + set: function(key, value) { + if ($WeakMap && key && (typeof key === "object" || typeof key === "function")) { + if (!$wm) { + $wm = new $WeakMap(); + } + $weakMapSet($wm, key, value); + } else if ($Map) { + if (!$m) { + $m = new $Map(); + } + $mapSet($m, key, value); + } else { + if (!$o) { + $o = { key: {}, next: null }; + } + listSet($o, key, value); + } + } + }; + return channel; + }; + } +}); + +// node_modules/qs/lib/formats.js +var require_formats = __commonJS({ + "node_modules/qs/lib/formats.js"(exports, module2) { + "use strict"; + var replace = String.prototype.replace; + var percentTwenties = /%20/g; + var Format = { + RFC1738: "RFC1738", + RFC3986: "RFC3986" + }; + module2.exports = { + "default": Format.RFC3986, + formatters: { + RFC1738: function(value) { + return replace.call(value, percentTwenties, "+"); + }, + RFC3986: function(value) { + return String(value); + } + }, + RFC1738: Format.RFC1738, + RFC3986: Format.RFC3986 + }; + } +}); + +// node_modules/qs/lib/utils.js +var require_utils6 = __commonJS({ + "node_modules/qs/lib/utils.js"(exports, module2) { + "use strict"; + var formats = require_formats(); + var has = Object.prototype.hasOwnProperty; + var isArray2 = Array.isArray; + var hexTable = function() { + var array = []; + for (var i3 = 0; i3 < 256; ++i3) { + array.push("%" + ((i3 < 16 ? "0" : "") + i3.toString(16)).toUpperCase()); + } + return array; + }(); + var compactQueue = function compactQueue2(queue) { + while (queue.length > 1) { + var item = queue.pop(); + var obj = item.obj[item.prop]; + if (isArray2(obj)) { + var compacted = []; + for (var j4 = 0; j4 < obj.length; ++j4) { + if (typeof obj[j4] !== "undefined") { + compacted.push(obj[j4]); + } + } + item.obj[item.prop] = compacted; + } + } + }; + var arrayToObject2 = function arrayToObject3(source, options) { + var obj = options && options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + for (var i3 = 0; i3 < source.length; ++i3) { + if (typeof source[i3] !== "undefined") { + obj[i3] = source[i3]; + } + } + return obj; + }; + var merge2 = function merge3(target, source, options) { + if (!source) { + return target; + } + if (typeof source !== "object") { + if (isArray2(target)) { + target.push(source); + } else if (target && typeof target === "object") { + if (options && (options.plainObjects || options.allowPrototypes) || !has.call(Object.prototype, source)) { + target[source] = true; + } + } else { + return [target, source]; + } + return target; + } + if (!target || typeof target !== "object") { + return [target].concat(source); + } + var mergeTarget = target; + if (isArray2(target) && !isArray2(source)) { + mergeTarget = arrayToObject2(target, options); + } + if (isArray2(target) && isArray2(source)) { + source.forEach(function(item, i3) { + if (has.call(target, i3)) { + var targetItem = target[i3]; + if (targetItem && typeof targetItem === "object" && item && typeof item === "object") { + target[i3] = merge3(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i3] = item; + } + }); + return target; + } + return Object.keys(source).reduce(function(acc, key) { + var value = source[key]; + if (has.call(acc, key)) { + acc[key] = merge3(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); + }; + var assign = function assignSingleSource(target, source) { + return Object.keys(source).reduce(function(acc, key) { + acc[key] = source[key]; + return acc; + }, target); + }; + var decode = function(str2, decoder, charset) { + var strWithoutPlus = str2.replace(/\+/g, " "); + if (charset === "iso-8859-1") { + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + try { + return decodeURIComponent(strWithoutPlus); + } catch (e3) { + return strWithoutPlus; + } + }; + var limit = 1024; + var encode3 = function encode4(str2, defaultEncoder, charset, kind3, format) { + if (str2.length === 0) { + return str2; + } + var string = str2; + if (typeof str2 === "symbol") { + string = Symbol.prototype.toString.call(str2); + } else if (typeof str2 !== "string") { + string = String(str2); + } + if (charset === "iso-8859-1") { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function($0) { + return "%26%23" + parseInt($0.slice(2), 16) + "%3B"; + }); + } + var out = ""; + for (var j4 = 0; j4 < string.length; j4 += limit) { + var segment = string.length >= limit ? string.slice(j4, j4 + limit) : string; + var arr = []; + for (var i3 = 0; i3 < segment.length; ++i3) { + var c2 = segment.charCodeAt(i3); + if (c2 === 45 || c2 === 46 || c2 === 95 || c2 === 126 || c2 >= 48 && c2 <= 57 || c2 >= 65 && c2 <= 90 || c2 >= 97 && c2 <= 122 || format === formats.RFC1738 && (c2 === 40 || c2 === 41)) { + arr[arr.length] = segment.charAt(i3); + continue; + } + if (c2 < 128) { + arr[arr.length] = hexTable[c2]; + continue; + } + if (c2 < 2048) { + arr[arr.length] = hexTable[192 | c2 >> 6] + hexTable[128 | c2 & 63]; + continue; + } + if (c2 < 55296 || c2 >= 57344) { + arr[arr.length] = hexTable[224 | c2 >> 12] + hexTable[128 | c2 >> 6 & 63] + hexTable[128 | c2 & 63]; + continue; + } + i3 += 1; + c2 = 65536 + ((c2 & 1023) << 10 | segment.charCodeAt(i3) & 1023); + arr[arr.length] = hexTable[240 | c2 >> 18] + hexTable[128 | c2 >> 12 & 63] + hexTable[128 | c2 >> 6 & 63] + hexTable[128 | c2 & 63]; + } + out += arr.join(""); + } + return out; + }; + var compact = function compact2(value) { + var queue = [{ obj: { o: value }, prop: "o" }]; + var refs = []; + for (var i3 = 0; i3 < queue.length; ++i3) { + var item = queue[i3]; + var obj = item.obj[item.prop]; + var keys = Object.keys(obj); + for (var j4 = 0; j4 < keys.length; ++j4) { + var key = keys[j4]; + var val = obj[key]; + if (typeof val === "object" && val !== null && refs.indexOf(val) === -1) { + queue.push({ obj, prop: key }); + refs.push(val); + } + } + } + compactQueue(queue); + return value; + }; + var isRegExp2 = function isRegExp3(obj) { + return Object.prototype.toString.call(obj) === "[object RegExp]"; + }; + var isBuffer2 = function isBuffer3(obj) { + if (!obj || typeof obj !== "object") { + return false; + } + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); + }; + var combine = function combine2(a3, b3) { + return [].concat(a3, b3); + }; + var maybeMap = function maybeMap2(val, fn) { + if (isArray2(val)) { + var mapped = []; + for (var i3 = 0; i3 < val.length; i3 += 1) { + mapped.push(fn(val[i3])); + } + return mapped; + } + return fn(val); + }; + module2.exports = { + arrayToObject: arrayToObject2, + assign, + combine, + compact, + decode, + encode: encode3, + isBuffer: isBuffer2, + isRegExp: isRegExp2, + maybeMap, + merge: merge2 + }; + } +}); + +// node_modules/qs/lib/stringify.js +var require_stringify2 = __commonJS({ + "node_modules/qs/lib/stringify.js"(exports, module2) { + "use strict"; + var getSideChannel = require_side_channel(); + var utils = require_utils6(); + var formats = require_formats(); + var has = Object.prototype.hasOwnProperty; + var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + "[]"; + }, + comma: "comma", + indices: function indices(prefix, key) { + return prefix + "[" + key + "]"; + }, + repeat: function repeat(prefix) { + return prefix; + } + }; + var isArray2 = Array.isArray; + var push = Array.prototype.push; + var pushToArray = function(arr, valueOrArray) { + push.apply(arr, isArray2(valueOrArray) ? valueOrArray : [valueOrArray]); + }; + var toISO = Date.prototype.toISOString; + var defaultFormat = formats["default"]; + var defaults2 = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: "indices", + charset: "utf-8", + charsetSentinel: false, + delimiter: "&", + encode: true, + encodeDotInKeys: false, + encoder: utils.encode, + encodeValuesOnly: false, + format: defaultFormat, + formatter: formats.formatters[defaultFormat], + indices: false, + serializeDate: function serializeDate(date) { + return toISO.call(date); + }, + skipNulls: false, + strictNullHandling: false + }; + var isNonNullishPrimitive = function isNonNullishPrimitive2(v2) { + return typeof v2 === "string" || typeof v2 === "number" || typeof v2 === "boolean" || typeof v2 === "symbol" || typeof v2 === "bigint"; + }; + var sentinel = {}; + var stringify2 = function stringify3(object, prefix, generateArrayPrefix, commaRoundTrip, allowEmptyArrays, strictNullHandling, skipNulls, encodeDotInKeys, encoder, filter2, sort, allowDots, serializeDate, format, formatter, encodeValuesOnly, charset, sideChannel) { + var obj = object; + var tmpSc = sideChannel; + var step = 0; + var findFlag = false; + while ((tmpSc = tmpSc.get(sentinel)) !== void 0 && !findFlag) { + var pos = tmpSc.get(object); + step += 1; + if (typeof pos !== "undefined") { + if (pos === step) { + throw new RangeError("Cyclic object value"); + } else { + findFlag = true; + } + } + if (typeof tmpSc.get(sentinel) === "undefined") { + step = 0; + } + } + if (typeof filter2 === "function") { + obj = filter2(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate(obj); + } else if (generateArrayPrefix === "comma" && isArray2(obj)) { + obj = utils.maybeMap(obj, function(value2) { + if (value2 instanceof Date) { + return serializeDate(value2); + } + return value2; + }); + } + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? encoder(prefix, defaults2.encoder, charset, "key", format) : prefix; + } + obj = ""; + } + if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) { + if (encoder) { + var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults2.encoder, charset, "key", format); + return [formatter(keyValue) + "=" + formatter(encoder(obj, defaults2.encoder, charset, "value", format))]; + } + return [formatter(prefix) + "=" + formatter(String(obj))]; + } + var values = []; + if (typeof obj === "undefined") { + return values; + } + var objKeys; + if (generateArrayPrefix === "comma" && isArray2(obj)) { + if (encodeValuesOnly && encoder) { + obj = utils.maybeMap(obj, encoder); + } + objKeys = [{ value: obj.length > 0 ? obj.join(",") || null : void 0 }]; + } else if (isArray2(filter2)) { + objKeys = filter2; + } else { + var keys = Object.keys(obj); + objKeys = sort ? keys.sort(sort) : keys; + } + var encodedPrefix = encodeDotInKeys ? prefix.replace(/\./g, "%2E") : prefix; + var adjustedPrefix = commaRoundTrip && isArray2(obj) && obj.length === 1 ? encodedPrefix + "[]" : encodedPrefix; + if (allowEmptyArrays && isArray2(obj) && obj.length === 0) { + return adjustedPrefix + "[]"; + } + for (var j4 = 0; j4 < objKeys.length; ++j4) { + var key = objKeys[j4]; + var value = typeof key === "object" && typeof key.value !== "undefined" ? key.value : obj[key]; + if (skipNulls && value === null) { + continue; + } + var encodedKey = allowDots && encodeDotInKeys ? key.replace(/\./g, "%2E") : key; + var keyPrefix = isArray2(obj) ? typeof generateArrayPrefix === "function" ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix : adjustedPrefix + (allowDots ? "." + encodedKey : "[" + encodedKey + "]"); + sideChannel.set(object, step); + var valueSideChannel = getSideChannel(); + valueSideChannel.set(sentinel, sideChannel); + pushToArray(values, stringify3( + value, + keyPrefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + generateArrayPrefix === "comma" && encodeValuesOnly && isArray2(obj) ? null : encoder, + filter2, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel + )); + } + return values; + }; + var normalizeStringifyOptions = function normalizeStringifyOptions2(opts) { + if (!opts) { + return defaults2; + } + if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { + throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); + } + if (typeof opts.encodeDotInKeys !== "undefined" && typeof opts.encodeDotInKeys !== "boolean") { + throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided"); + } + if (opts.encoder !== null && typeof opts.encoder !== "undefined" && typeof opts.encoder !== "function") { + throw new TypeError("Encoder has to be a function."); + } + var charset = opts.charset || defaults2.charset; + if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { + throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); + } + var format = formats["default"]; + if (typeof opts.format !== "undefined") { + if (!has.call(formats.formatters, opts.format)) { + throw new TypeError("Unknown format option provided."); + } + format = opts.format; + } + var formatter = formats.formatters[format]; + var filter2 = defaults2.filter; + if (typeof opts.filter === "function" || isArray2(opts.filter)) { + filter2 = opts.filter; + } + var arrayFormat; + if (opts.arrayFormat in arrayPrefixGenerators) { + arrayFormat = opts.arrayFormat; + } else if ("indices" in opts) { + arrayFormat = opts.indices ? "indices" : "repeat"; + } else { + arrayFormat = defaults2.arrayFormat; + } + if ("commaRoundTrip" in opts && typeof opts.commaRoundTrip !== "boolean") { + throw new TypeError("`commaRoundTrip` must be a boolean, or absent"); + } + var allowDots = typeof opts.allowDots === "undefined" ? opts.encodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; + return { + addQueryPrefix: typeof opts.addQueryPrefix === "boolean" ? opts.addQueryPrefix : defaults2.addQueryPrefix, + allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, + arrayFormat, + charset, + charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, + commaRoundTrip: opts.commaRoundTrip, + delimiter: typeof opts.delimiter === "undefined" ? defaults2.delimiter : opts.delimiter, + encode: typeof opts.encode === "boolean" ? opts.encode : defaults2.encode, + encodeDotInKeys: typeof opts.encodeDotInKeys === "boolean" ? opts.encodeDotInKeys : defaults2.encodeDotInKeys, + encoder: typeof opts.encoder === "function" ? opts.encoder : defaults2.encoder, + encodeValuesOnly: typeof opts.encodeValuesOnly === "boolean" ? opts.encodeValuesOnly : defaults2.encodeValuesOnly, + filter: filter2, + format, + formatter, + serializeDate: typeof opts.serializeDate === "function" ? opts.serializeDate : defaults2.serializeDate, + skipNulls: typeof opts.skipNulls === "boolean" ? opts.skipNulls : defaults2.skipNulls, + sort: typeof opts.sort === "function" ? opts.sort : null, + strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling + }; + }; + module2.exports = function(object, opts) { + var obj = object; + var options = normalizeStringifyOptions(opts); + var objKeys; + var filter2; + if (typeof options.filter === "function") { + filter2 = options.filter; + obj = filter2("", obj); + } else if (isArray2(options.filter)) { + filter2 = options.filter; + objKeys = filter2; + } + var keys = []; + if (typeof obj !== "object" || obj === null) { + return ""; + } + var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat]; + var commaRoundTrip = generateArrayPrefix === "comma" && options.commaRoundTrip; + if (!objKeys) { + objKeys = Object.keys(obj); + } + if (options.sort) { + objKeys.sort(options.sort); + } + var sideChannel = getSideChannel(); + for (var i3 = 0; i3 < objKeys.length; ++i3) { + var key = objKeys[i3]; + if (options.skipNulls && obj[key] === null) { + continue; + } + pushToArray(keys, stringify2( + obj[key], + key, + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel + )); + } + var joined = keys.join(options.delimiter); + var prefix = options.addQueryPrefix === true ? "?" : ""; + if (options.charsetSentinel) { + if (options.charset === "iso-8859-1") { + prefix += "utf8=%26%2310003%3B&"; + } else { + prefix += "utf8=%E2%9C%93&"; + } + } + return joined.length > 0 ? prefix + joined : ""; + }; + } +}); + +// node_modules/qs/lib/parse.js +var require_parse3 = __commonJS({ + "node_modules/qs/lib/parse.js"(exports, module2) { + "use strict"; + var utils = require_utils6(); + var has = Object.prototype.hasOwnProperty; + var isArray2 = Array.isArray; + var defaults2 = { + allowDots: false, + allowEmptyArrays: false, + allowPrototypes: false, + allowSparse: false, + arrayLimit: 20, + charset: "utf-8", + charsetSentinel: false, + comma: false, + decodeDotInKeys: false, + decoder: utils.decode, + delimiter: "&", + depth: 5, + duplicates: "combine", + ignoreQueryPrefix: false, + interpretNumericEntities: false, + parameterLimit: 1e3, + parseArrays: true, + plainObjects: false, + strictDepth: false, + strictNullHandling: false + }; + var interpretNumericEntities = function(str2) { + return str2.replace(/&#(\d+);/g, function($0, numberStr) { + return String.fromCharCode(parseInt(numberStr, 10)); + }); + }; + var parseArrayValue = function(val, options) { + if (val && typeof val === "string" && options.comma && val.indexOf(",") > -1) { + return val.split(","); + } + return val; + }; + var isoSentinel = "utf8=%26%2310003%3B"; + var charsetSentinel = "utf8=%E2%9C%93"; + var parseValues = function parseQueryStringValues(str2, options) { + var obj = { __proto__: null }; + var cleanStr = options.ignoreQueryPrefix ? str2.replace(/^\?/, "") : str2; + cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]"); + var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit; + var parts = cleanStr.split(options.delimiter, limit); + var skipIndex = -1; + var i3; + var charset = options.charset; + if (options.charsetSentinel) { + for (i3 = 0; i3 < parts.length; ++i3) { + if (parts[i3].indexOf("utf8=") === 0) { + if (parts[i3] === charsetSentinel) { + charset = "utf-8"; + } else if (parts[i3] === isoSentinel) { + charset = "iso-8859-1"; + } + skipIndex = i3; + i3 = parts.length; + } + } + } + for (i3 = 0; i3 < parts.length; ++i3) { + if (i3 === skipIndex) { + continue; + } + var part = parts[i3]; + var bracketEqualsPos = part.indexOf("]="); + var pos = bracketEqualsPos === -1 ? part.indexOf("=") : bracketEqualsPos + 1; + var key, val; + if (pos === -1) { + key = options.decoder(part, defaults2.decoder, charset, "key"); + val = options.strictNullHandling ? null : ""; + } else { + key = options.decoder(part.slice(0, pos), defaults2.decoder, charset, "key"); + val = utils.maybeMap( + parseArrayValue(part.slice(pos + 1), options), + function(encodedVal) { + return options.decoder(encodedVal, defaults2.decoder, charset, "value"); + } + ); + } + if (val && options.interpretNumericEntities && charset === "iso-8859-1") { + val = interpretNumericEntities(val); + } + if (part.indexOf("[]=") > -1) { + val = isArray2(val) ? [val] : val; + } + var existing = has.call(obj, key); + if (existing && options.duplicates === "combine") { + obj[key] = utils.combine(obj[key], val); + } else if (!existing || options.duplicates === "last") { + obj[key] = val; + } + } + return obj; + }; + var parseObject = function(chain, val, options, valuesParsed) { + var leaf = valuesParsed ? val : parseArrayValue(val, options); + for (var i3 = chain.length - 1; i3 >= 0; --i3) { + var obj; + var root = chain[i3]; + if (root === "[]" && options.parseArrays) { + obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf); + } else { + obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root; + var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, ".") : cleanRoot; + var index = parseInt(decodedRoot, 10); + if (!options.parseArrays && decodedRoot === "") { + obj = { 0: leaf }; + } else if (!isNaN(index) && root !== decodedRoot && String(index) === decodedRoot && index >= 0 && (options.parseArrays && index <= options.arrayLimit)) { + obj = []; + obj[index] = leaf; + } else if (decodedRoot !== "__proto__") { + obj[decodedRoot] = leaf; + } + } + leaf = obj; + } + return leaf; + }; + var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) { + if (!givenKey) { + return; + } + var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, "[$1]") : givenKey; + var brackets = /(\[[^[\]]*])/; + var child = /(\[[^[\]]*])/g; + var segment = options.depth > 0 && brackets.exec(key); + var parent = segment ? key.slice(0, segment.index) : key; + var keys = []; + if (parent) { + if (!options.plainObjects && has.call(Object.prototype, parent)) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(parent); + } + var i3 = 0; + while (options.depth > 0 && (segment = child.exec(key)) !== null && i3 < options.depth) { + i3 += 1; + if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { + if (!options.allowPrototypes) { + return; + } + } + keys.push(segment[1]); + } + if (segment) { + if (options.strictDepth === true) { + throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true"); + } + keys.push("[" + key.slice(segment.index) + "]"); + } + return parseObject(keys, val, options, valuesParsed); + }; + var normalizeParseOptions = function normalizeParseOptions2(opts) { + if (!opts) { + return defaults2; + } + if (typeof opts.allowEmptyArrays !== "undefined" && typeof opts.allowEmptyArrays !== "boolean") { + throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided"); + } + if (typeof opts.decodeDotInKeys !== "undefined" && typeof opts.decodeDotInKeys !== "boolean") { + throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided"); + } + if (opts.decoder !== null && typeof opts.decoder !== "undefined" && typeof opts.decoder !== "function") { + throw new TypeError("Decoder has to be a function."); + } + if (typeof opts.charset !== "undefined" && opts.charset !== "utf-8" && opts.charset !== "iso-8859-1") { + throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined"); + } + var charset = typeof opts.charset === "undefined" ? defaults2.charset : opts.charset; + var duplicates = typeof opts.duplicates === "undefined" ? defaults2.duplicates : opts.duplicates; + if (duplicates !== "combine" && duplicates !== "first" && duplicates !== "last") { + throw new TypeError("The duplicates option must be either combine, first, or last"); + } + var allowDots = typeof opts.allowDots === "undefined" ? opts.decodeDotInKeys === true ? true : defaults2.allowDots : !!opts.allowDots; + return { + allowDots, + allowEmptyArrays: typeof opts.allowEmptyArrays === "boolean" ? !!opts.allowEmptyArrays : defaults2.allowEmptyArrays, + allowPrototypes: typeof opts.allowPrototypes === "boolean" ? opts.allowPrototypes : defaults2.allowPrototypes, + allowSparse: typeof opts.allowSparse === "boolean" ? opts.allowSparse : defaults2.allowSparse, + arrayLimit: typeof opts.arrayLimit === "number" ? opts.arrayLimit : defaults2.arrayLimit, + charset, + charsetSentinel: typeof opts.charsetSentinel === "boolean" ? opts.charsetSentinel : defaults2.charsetSentinel, + comma: typeof opts.comma === "boolean" ? opts.comma : defaults2.comma, + decodeDotInKeys: typeof opts.decodeDotInKeys === "boolean" ? opts.decodeDotInKeys : defaults2.decodeDotInKeys, + decoder: typeof opts.decoder === "function" ? opts.decoder : defaults2.decoder, + delimiter: typeof opts.delimiter === "string" || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults2.delimiter, + depth: typeof opts.depth === "number" || opts.depth === false ? +opts.depth : defaults2.depth, + duplicates, + ignoreQueryPrefix: opts.ignoreQueryPrefix === true, + interpretNumericEntities: typeof opts.interpretNumericEntities === "boolean" ? opts.interpretNumericEntities : defaults2.interpretNumericEntities, + parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults2.parameterLimit, + parseArrays: opts.parseArrays !== false, + plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults2.plainObjects, + strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults2.strictDepth, + strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults2.strictNullHandling + }; + }; + module2.exports = function(str2, opts) { + var options = normalizeParseOptions(opts); + if (str2 === "" || str2 === null || typeof str2 === "undefined") { + return options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + } + var tempObj = typeof str2 === "string" ? parseValues(str2, options) : str2; + var obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {}; + var keys = Object.keys(tempObj); + for (var i3 = 0; i3 < keys.length; ++i3) { + var key = keys[i3]; + var newObj = parseKeys(key, tempObj[key], options, typeof str2 === "string"); + obj = utils.merge(obj, newObj, options); + } + if (options.allowSparse === true) { + return obj; + } + return utils.compact(obj); + }; + } +}); + +// node_modules/qs/lib/index.js +var require_lib4 = __commonJS({ + "node_modules/qs/lib/index.js"(exports, module2) { + "use strict"; + var stringify2 = require_stringify2(); + var parse = require_parse3(); + var formats = require_formats(); + module2.exports = { + formats, + parse, + stringify: stringify2 + }; + } +}); + // node_modules/@commitlint/types/lib/ensure.js var require_ensure = __commonJS({ "node_modules/@commitlint/types/lib/ensure.js"(exports) { @@ -45457,7 +47595,7 @@ var require_load = __commonJS({ }); // node_modules/@commitlint/types/lib/parse.js -var require_parse3 = __commonJS({ +var require_parse4 = __commonJS({ "node_modules/@commitlint/types/lib/parse.js"(exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); @@ -45493,7 +47631,7 @@ var require_rules = __commonJS({ }); // node_modules/@commitlint/types/lib/index.js -var require_lib4 = __commonJS({ +var require_lib5 = __commonJS({ "node_modules/@commitlint/types/lib/index.js"(exports) { "use strict"; var __createBinding2 = exports && exports.__createBinding || (Object.create ? function(o3, m4, k4, k22) { @@ -45522,7 +47660,7 @@ var require_lib4 = __commonJS({ __exportStar2(require_is_ignored(), exports); __exportStar2(require_lint(), exports); __exportStar2(require_load(), exports); - __exportStar2(require_parse3(), exports); + __exportStar2(require_parse4(), exports); __exportStar2(require_prompt(), exports); __exportStar2(require_rules(), exports); } @@ -46551,33 +48689,6 @@ function getI18nLocal(value) { } // src/commands/config.ts -var CONFIG_KEYS = /* @__PURE__ */ ((CONFIG_KEYS2) => { - CONFIG_KEYS2["OCO_OPENAI_API_KEY"] = "OCO_OPENAI_API_KEY"; - CONFIG_KEYS2["OCO_ANTHROPIC_API_KEY"] = "OCO_ANTHROPIC_API_KEY"; - CONFIG_KEYS2["OCO_AZURE_API_KEY"] = "OCO_AZURE_API_KEY"; - CONFIG_KEYS2["OCO_GEMINI_API_KEY"] = "OCO_GEMINI_API_KEY"; - CONFIG_KEYS2["OCO_GEMINI_BASE_PATH"] = "OCO_GEMINI_BASE_PATH"; - CONFIG_KEYS2["OCO_TOKENS_MAX_INPUT"] = "OCO_TOKENS_MAX_INPUT"; - CONFIG_KEYS2["OCO_TOKENS_MAX_OUTPUT"] = "OCO_TOKENS_MAX_OUTPUT"; - CONFIG_KEYS2["OCO_OPENAI_BASE_PATH"] = "OCO_OPENAI_BASE_PATH"; - CONFIG_KEYS2["OCO_DESCRIPTION"] = "OCO_DESCRIPTION"; - CONFIG_KEYS2["OCO_EMOJI"] = "OCO_EMOJI"; - CONFIG_KEYS2["OCO_MODEL"] = "OCO_MODEL"; - CONFIG_KEYS2["OCO_LANGUAGE"] = "OCO_LANGUAGE"; - CONFIG_KEYS2["OCO_WHY"] = "OCO_WHY"; - CONFIG_KEYS2["OCO_MESSAGE_TEMPLATE_PLACEHOLDER"] = "OCO_MESSAGE_TEMPLATE_PLACEHOLDER"; - CONFIG_KEYS2["OCO_PROMPT_MODULE"] = "OCO_PROMPT_MODULE"; - CONFIG_KEYS2["OCO_AI_PROVIDER"] = "OCO_AI_PROVIDER"; - CONFIG_KEYS2["OCO_GITPUSH"] = "OCO_GITPUSH"; - CONFIG_KEYS2["OCO_ONE_LINE_COMMIT"] = "OCO_ONE_LINE_COMMIT"; - CONFIG_KEYS2["OCO_AZURE_ENDPOINT"] = "OCO_AZURE_ENDPOINT"; - CONFIG_KEYS2["OCO_TEST_MOCK_TYPE"] = "OCO_TEST_MOCK_TYPE"; - CONFIG_KEYS2["OCO_API_URL"] = "OCO_API_URL"; - CONFIG_KEYS2["OCO_OLLAMA_API_URL"] = "OCO_OLLAMA_API_URL"; - CONFIG_KEYS2["OCO_FLOWISE_ENDPOINT"] = "OCO_FLOWISE_ENDPOINT"; - CONFIG_KEYS2["OCO_FLOWISE_API_KEY"] = "OCO_FLOWISE_API_KEY"; - return CONFIG_KEYS2; -})(CONFIG_KEYS || {}); var MODEL_LIST = { openai: [ "gpt-4o-mini", @@ -46643,56 +48754,18 @@ var validateConfig = (key, condition, validationMessage) => { } }; var configValidators = { - ["OCO_OPENAI_API_KEY" /* OCO_OPENAI_API_KEY */](value, config6 = {}) { + ["OCO_API_KEY" /* OCO_API_KEY */](value, config6 = {}) { if (config6.OCO_AI_PROVIDER !== "openai") return value; validateConfig( - "OCO_OPENAI_API_KEY", + "OCO_API_KEY", typeof value === "string" && value.length > 0, "Empty value is not allowed" ); validateConfig( - "OCO_OPENAI_API_KEY", + "OCO_API_KEY", value, - 'You need to provide the OCO_OPENAI_API_KEY when OCO_AI_PROVIDER is set to "openai" (default). Run `oco config set OCO_OPENAI_API_KEY=your_key`' - ); - return value; - }, - ["OCO_AZURE_API_KEY" /* OCO_AZURE_API_KEY */](value, config6 = {}) { - if (config6.OCO_AI_PROVIDER !== "azure") - return value; - validateConfig( - "OCO_AZURE_API_KEY", - !!value, - 'You need to provide the OCO_AZURE_API_KEY when OCO_AI_PROVIDER is set to "azure". Run: `oco config set OCO_AZURE_API_KEY=your_key`' - ); - return value; - }, - ["OCO_GEMINI_API_KEY" /* OCO_GEMINI_API_KEY */](value, config6 = {}) { - if (config6.OCO_AI_PROVIDER !== "gemini") - return value; - validateConfig( - "OCO_GEMINI_API_KEY", - value || config6.OCO_GEMINI_API_KEY || config6.OCO_AI_PROVIDER === "test", - 'You need to provide the OCO_GEMINI_API_KEY when OCO_AI_PROVIDER is set to "gemini". Run: `oco config set OCO_GEMINI_API_KEY=your_key`' - ); - return value; - }, - ["OCO_ANTHROPIC_API_KEY" /* OCO_ANTHROPIC_API_KEY */](value, config6 = {}) { - if (config6.OCO_AI_PROVIDER !== "anthropic") - return value; - validateConfig( - "ANTHROPIC_API_KEY", - !!value, - 'You need to provide the OCO_ANTHROPIC_API_KEY key when OCO_AI_PROVIDER is set to "anthropic". Run: `oco config set OCO_ANTHROPIC_API_KEY=your_key`' - ); - return value; - }, - ["OCO_FLOWISE_API_KEY" /* OCO_FLOWISE_API_KEY */](value, config6 = {}) { - validateConfig( - "OCO_FLOWISE_API_KEY" /* OCO_FLOWISE_API_KEY */, - value || config6.OCO_AI_PROVIDER !== "flowise", - 'You need to provide the OCO_FLOWISE_API_KEY when OCO_AI_PROVIDER is set to "flowise". Run: `oco config set OCO_FLOWISE_API_KEY=your_key`' + 'You need to provide the OCO_API_KEY when OCO_AI_PROVIDER set to "openai" (default) or "ollama" or "azure" or "gemini" or "flowise" or "anthropic". Run `oco config set OCO_API_KEY=your_key OCO_AI_PROVIDER=openai`' ); return value; }, @@ -46739,11 +48812,11 @@ var configValidators = { ); return getI18nLocal(value); }, - ["OCO_OPENAI_BASE_PATH" /* OCO_OPENAI_BASE_PATH */](value) { + ["OCO_API_URL" /* OCO_API_URL */](value) { validateConfig( - "OCO_OPENAI_BASE_PATH" /* OCO_OPENAI_BASE_PATH */, + "OCO_API_URL" /* OCO_API_URL */, typeof value === "string", - "Must be string" + `${value} is not a valid URL. It should start with 'http://' or 'https://'.` ); return value; }, @@ -46805,22 +48878,6 @@ var configValidators = { ); return value; }, - ["OCO_AZURE_ENDPOINT" /* OCO_AZURE_ENDPOINT */](value) { - validateConfig( - "OCO_AZURE_ENDPOINT" /* OCO_AZURE_ENDPOINT */, - value.includes("openai.azure.com"), - 'Must be in format "https://.openai.azure.com/"' - ); - return value; - }, - ["OCO_FLOWISE_ENDPOINT" /* OCO_FLOWISE_ENDPOINT */](value) { - validateConfig( - "OCO_FLOWISE_ENDPOINT" /* OCO_FLOWISE_ENDPOINT */, - typeof value === "string" && value.includes(":"), - "Value must be string and should include both I.P. and port number" - ); - return value; - }, ["OCO_TEST_MOCK_TYPE" /* OCO_TEST_MOCK_TYPE */](value) { validateConfig( "OCO_TEST_MOCK_TYPE" /* OCO_TEST_MOCK_TYPE */, @@ -46831,11 +48888,11 @@ var configValidators = { ); return value; }, - ["OCO_OLLAMA_API_URL" /* OCO_OLLAMA_API_URL */](value) { + ["OCO_WHY" /* OCO_WHY */](value) { validateConfig( - "OCO_OLLAMA_API_URL" /* OCO_OLLAMA_API_URL */, - typeof value === "string" && value.startsWith("http"), - `${value} is not a valid URL. It should start with 'http://' or 'https://'.` + "OCO_WHY" /* OCO_WHY */, + typeof value === "boolean", + "Must be true or false" ); return value; } @@ -46862,7 +48919,7 @@ var initGlobalConfig = (configPath = defaultConfigPath) => { (0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(DEFAULT_CONFIG), "utf8"); return DEFAULT_CONFIG; }; -var parseEnvVarValue = (value) => { +var parseConfigVarValue = (value) => { try { return JSON.parse(value); } catch (error) { @@ -46873,32 +48930,32 @@ var getEnvConfig = (envPath) => { dotenv.config({ path: envPath }); return { OCO_MODEL: process.env.OCO_MODEL, - OCO_OPENAI_API_KEY: process.env.OCO_OPENAI_API_KEY, - OCO_ANTHROPIC_API_KEY: process.env.OCO_ANTHROPIC_API_KEY, - OCO_AZURE_API_KEY: process.env.OCO_AZURE_API_KEY, - OCO_GEMINI_API_KEY: process.env.OCO_GEMINI_API_KEY, - OCO_FLOWISE_API_KEY: process.env.OCO_FLOWISE_API_KEY, - OCO_TOKENS_MAX_INPUT: parseEnvVarValue(process.env.OCO_TOKENS_MAX_INPUT), - OCO_TOKENS_MAX_OUTPUT: parseEnvVarValue(process.env.OCO_TOKENS_MAX_OUTPUT), - OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH, - OCO_GEMINI_BASE_PATH: process.env.OCO_GEMINI_BASE_PATH, - OCO_AZURE_ENDPOINT: process.env.OCO_AZURE_ENDPOINT, - OCO_FLOWISE_ENDPOINT: process.env.OCO_FLOWISE_ENDPOINT, - OCO_OLLAMA_API_URL: process.env.OCO_OLLAMA_API_URL, - OCO_DESCRIPTION: parseEnvVarValue(process.env.OCO_DESCRIPTION), - OCO_EMOJI: parseEnvVarValue(process.env.OCO_EMOJI), + OCO_API_URL: process.env.OCO_API_URL, + OCO_API_KEY: process.env.OCO_API_KEY, + OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER, + OCO_TOKENS_MAX_INPUT: parseConfigVarValue(process.env.OCO_TOKENS_MAX_INPUT), + OCO_TOKENS_MAX_OUTPUT: parseConfigVarValue( + process.env.OCO_TOKENS_MAX_OUTPUT + ), + OCO_DESCRIPTION: parseConfigVarValue(process.env.OCO_DESCRIPTION), + OCO_EMOJI: parseConfigVarValue(process.env.OCO_EMOJI), OCO_LANGUAGE: process.env.OCO_LANGUAGE, OCO_MESSAGE_TEMPLATE_PLACEHOLDER: process.env.OCO_MESSAGE_TEMPLATE_PLACEHOLDER, OCO_PROMPT_MODULE: process.env.OCO_PROMPT_MODULE, - OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER, - OCO_ONE_LINE_COMMIT: parseEnvVarValue(process.env.OCO_ONE_LINE_COMMIT), + OCO_ONE_LINE_COMMIT: parseConfigVarValue(process.env.OCO_ONE_LINE_COMMIT), OCO_TEST_MOCK_TYPE: process.env.OCO_TEST_MOCK_TYPE, - OCO_GITPUSH: parseEnvVarValue(process.env.OCO_GITPUSH) + OCO_GITPUSH: parseConfigVarValue(process.env.OCO_GITPUSH) }; }; -var getGlobalConfig = (configPath) => { +var setGlobalConfig = (config6, configPath = defaultConfigPath) => { + (0, import_fs.writeFileSync)(configPath, (0, import_ini.stringify)(config6), "utf8"); +}; +var getIsGlobalConfigFileExist = (configPath = defaultConfigPath) => { + return (0, import_fs.existsSync)(configPath); +}; +var getGlobalConfig = (configPath = defaultConfigPath) => { let globalConfig; - const isGlobalConfigFileExist = (0, import_fs.existsSync)(configPath); + const isGlobalConfigFileExist = getIsGlobalConfigFileExist(configPath); if (!isGlobalConfigFileExist) globalConfig = initGlobalConfig(configPath); else { @@ -46907,10 +48964,13 @@ var getGlobalConfig = (configPath) => { } return globalConfig; }; -var mergeConfigs = (main, fallback) => Object.keys(CONFIG_KEYS).reduce((acc, key) => { - acc[key] = parseEnvVarValue(main[key] ?? fallback[key]); - return acc; -}, {}); +var mergeConfigs = (main, fallback) => { + const allKeys = /* @__PURE__ */ new Set([...Object.keys(main), ...Object.keys(fallback)]); + return Array.from(allKeys).reduce((acc, key) => { + acc[key] = parseConfigVarValue(main[key] ?? fallback[key]); + return acc; + }, {}); +}; var getConfig = ({ envPath = defaultEnvPath, globalPath = defaultConfigPath @@ -46924,6 +48984,7 @@ var setConfig = (keyValues, globalConfigPath = defaultConfigPath) => { const config6 = getConfig({ globalPath: globalConfigPath }); + const configToSet = {}; for (let [key, value] of keyValues) { if (!configValidators.hasOwnProperty(key)) { const supportedKeys = Object.keys(configValidators).join("\n"); @@ -46937,7 +48998,10 @@ For more help refer to our docs: https://github.com/di-sukharev/opencommit` } let parsedConfigValue; try { - parsedConfigValue = JSON.parse(value); + if (typeof value === "string") + parsedConfigValue = JSON.parse(value); + else + parsedConfigValue = value; } catch (error) { parsedConfigValue = value; } @@ -46945,9 +49009,9 @@ For more help refer to our docs: https://github.com/di-sukharev/opencommit` parsedConfigValue, config6 ); - config6[key] = validValue; + configToSet[key] = validValue; } - (0, import_fs.writeFileSync)(globalConfigPath, (0, import_ini.stringify)(config6), "utf8"); + setGlobalConfig(mergeConfigs(configToSet, config6), globalConfigPath); ce(`${source_default.green("\u2714")} config successfully set`); }; var configCommand = G2( @@ -56033,7 +58097,7 @@ var AzureEngine = class { }; // src/engine/flowise.ts -var FlowiseAi = class { +var FlowiseEngine = class { constructor(config6) { this.config = config6; this.client = axios_default.create({ @@ -56828,7 +58892,7 @@ var GoogleGenerativeAI = class { }; // src/engine/gemini.ts -var Gemini = class { +var GeminiEngine = class { constructor(config6) { this.client = new GoogleGenerativeAI(config6.apiKey); this.config = config6; @@ -56886,7 +58950,7 @@ var Gemini = class { }; // src/engine/ollama.ts -var OllamaAi = class { +var OllamaEngine = class { constructor(config6) { this.config = config6; this.client = axios_default.create({ @@ -56936,7 +59000,7 @@ __export(error_exports2, { }); // node_modules/openai/version.mjs -var VERSION4 = "4.56.0"; +var VERSION4 = "4.57.0"; // node_modules/openai/_shims/registry.mjs var auto2 = false; @@ -58229,6 +60293,9 @@ var ContentFilterFinishReasonError = class extends OpenAIError { } }; +// node_modules/openai/index.mjs +var qs = __toESM(require_lib4(), 1); + // node_modules/openai/pagination.mjs var Page = class extends AbstractPage2 { constructor(client, response, body, options) { @@ -60406,8 +62473,12 @@ var MessagesPage = class extends CursorPage { // node_modules/openai/resources/beta/threads/runs/steps.mjs var Steps = class extends APIResource2 { - retrieve(threadId, runId, stepId, options) { + retrieve(threadId, runId, stepId, query = {}, options) { + if (isRequestOptions(query)) { + return this.retrieve(threadId, runId, stepId, {}, query); + } return this._client.get(`/threads/${threadId}/runs/${runId}/steps/${stepId}`, { + query, ...options, headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers } }); @@ -60435,12 +62506,14 @@ var Runs = class extends APIResource2 { super(...arguments); this.steps = new Steps(this._client); } - create(threadId, body, options) { + create(threadId, params, options) { + const { include, ...body } = params; return this._client.post(`/threads/${threadId}/runs`, { + query: { include }, body, ...options, headers: { "OpenAI-Beta": "assistants=v2", ...options?.headers }, - stream: body.stream ?? false + stream: params.stream ?? false }); } retrieve(threadId, runId, options) { @@ -61128,6 +63201,9 @@ var OpenAI = class extends APIClient2 { authHeaders(opts) { return { Authorization: `Bearer ${this.apiKey}` }; } + stringifyQuery(query) { + return qs.stringify(query, { arrayFormat: "brackets" }); + } }; _a4 = OpenAI; OpenAI.OpenAI = _a4; @@ -61209,44 +63285,24 @@ function getEngine() { model: config6.OCO_MODEL, maxTokensOutput: config6.OCO_TOKENS_MAX_OUTPUT, maxTokensInput: config6.OCO_TOKENS_MAX_INPUT, - baseURL: config6.OCO_OPENAI_BASE_PATH + baseURL: config6.OCO_API_URL, + apiKey: config6.OCO_API_KEY }; switch (provider) { case "ollama" /* OLLAMA */: - return new OllamaAi({ - ...DEFAULT_CONFIG2, - apiKey: "", - baseURL: config6.OCO_OLLAMA_API_URL - }); + return new OllamaEngine(DEFAULT_CONFIG2); case "anthropic" /* ANTHROPIC */: - return new AnthropicEngine({ - ...DEFAULT_CONFIG2, - apiKey: config6.OCO_ANTHROPIC_API_KEY - }); + return new AnthropicEngine(DEFAULT_CONFIG2); case "test" /* TEST */: return new TestAi(config6.OCO_TEST_MOCK_TYPE); case "gemini" /* GEMINI */: - return new Gemini({ - ...DEFAULT_CONFIG2, - apiKey: config6.OCO_GEMINI_API_KEY, - baseURL: config6.OCO_GEMINI_BASE_PATH - }); + return new GeminiEngine(DEFAULT_CONFIG2); case "azure" /* AZURE */: - return new AzureEngine({ - ...DEFAULT_CONFIG2, - apiKey: config6.OCO_AZURE_API_KEY - }); + return new AzureEngine(DEFAULT_CONFIG2); case "flowise" /* FLOWISE */: - return new FlowiseAi({ - ...DEFAULT_CONFIG2, - baseURL: config6.OCO_FLOWISE_ENDPOINT || DEFAULT_CONFIG2.baseURL, - apiKey: config6.OCO_FLOWISE_API_KEY - }); + return new FlowiseEngine(DEFAULT_CONFIG2); default: - return new OpenAiEngine({ - ...DEFAULT_CONFIG2, - apiKey: config6.OCO_OPENAI_API_KEY - }); + return new OpenAiEngine(DEFAULT_CONFIG2); } } @@ -61267,7 +63323,7 @@ var computeHash = async (content, algorithm = "sha256") => { }; // src/modules/commitlint/prompts.ts -var import_types = __toESM(require_lib4(), 1); +var import_types = __toESM(require_lib5(), 1); var config2 = getConfig(); var translation = i18n[config2.OCO_LANGUAGE || "en"]; var getTypeRuleExtraDescription = (type2, prompt) => prompt?.questions?.type?.enum?.[type2]?.description; @@ -61730,8 +63786,8 @@ function mergeDiffs(arr, maxStringLength) { // src/generateCommitMessageFromGitDiff.ts var config5 = getConfig(); -var MAX_TOKENS_INPUT = config5.OCO_TOKENS_MAX_INPUT || 40960 /* DEFAULT_MAX_TOKENS_INPUT */; -var MAX_TOKENS_OUTPUT = config5.OCO_TOKENS_MAX_OUTPUT || 4096 /* DEFAULT_MAX_TOKENS_OUTPUT */; +var MAX_TOKENS_INPUT = config5.OCO_TOKENS_MAX_INPUT; +var MAX_TOKENS_OUTPUT = config5.OCO_TOKENS_MAX_OUTPUT; var generateCommitMessageChatCompletionPrompt = async (diff, fullGitMojiSpec) => { const INIT_MESSAGES_PROMPT = await getMainCommitPrompt(fullGitMojiSpec); const chatContextAsCompletionRequest = [...INIT_MESSAGES_PROMPT]; diff --git a/package-lock.json b/package-lock.json index 21a7dab5..70584fc4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "ignore": "^5.2.4", "ini": "^3.0.1", "inquirer": "^9.1.4", - "openai": "^4.56.0" + "openai": "^4.57.0" }, "bin": { "oco": "out/cli.cjs", @@ -2098,6 +2098,11 @@ "form-data": "^4.0.0" } }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==" + }, "node_modules/@types/semver": { "version": "7.5.8", "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", @@ -7219,6 +7224,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -7242,17 +7258,19 @@ } }, "node_modules/openai": { - "version": "4.56.0", - "resolved": "https://registry.npmjs.org/openai/-/openai-4.56.0.tgz", - "integrity": "sha512-zcag97+3bG890MNNa0DQD9dGmmTWL8unJdNkulZzWRXrl+QeD+YkBI4H58rJcwErxqGK6a0jVPZ4ReJjhDGcmw==", + "version": "4.57.0", + "resolved": "https://registry.npmjs.org/openai/-/openai-4.57.0.tgz", + "integrity": "sha512-JnwBSIYqiZ3jYjB5f2in8hQ0PRA092c6m+/6dYB0MzK0BEbn+0dioxZsPLBm5idJbg9xzLNOiGVm2OSuhZ+BdQ==", "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", + "@types/qs": "^6.9.7", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7" + "node-fetch": "^2.6.7", + "qs": "^6.10.3" }, "bin": { "openai": "bin/cli" @@ -7704,6 +7722,20 @@ } ] }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -8050,6 +8082,23 @@ "node": ">=8" } }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/signal-exit": { "version": "3.0.7", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", diff --git a/package.json b/package.json index cc682ab7..2c00c15c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opencommit", - "version": "3.1.2", + "version": "3.2.0", "description": "Auto-generate impressive commits in 1 second. Killing lame commits with AI 🤯🔫", "keywords": [ "git", @@ -46,8 +46,9 @@ "dev:gemini": "OCO_AI_PROVIDER='gemini' ts-node ./src/cli.ts", "build": "rimraf out && node esbuild.config.js", "build:push": "npm run build && git add . && git commit -m 'build' && git push", - "deploy": "npm run build:push && git push --tags && npm publish --tag latest", - "deploy:patch": "npm version patch && npm run deploy", + "deploy": "npm publish --tag latest", + "deploy:build": "npm run build:push && git push --tags && npm run deploy", + "deploy:patch": "npm version patch && npm run deploy:build", "lint": "eslint src --ext ts && tsc --noEmit", "format": "prettier --write src", "test": "node --no-warnings --experimental-vm-modules $( [ -f ./node_modules/.bin/jest ] && echo ./node_modules/.bin/jest || which jest ) test/unit", @@ -88,7 +89,6 @@ "@google/generative-ai": "^0.11.4", "@octokit/webhooks-schemas": "^6.11.0", "@octokit/webhooks-types": "^6.11.0", - "ai": "^2.2.14", "axios": "^1.3.4", "chalk": "^5.2.0", "cleye": "^1.3.2", @@ -97,6 +97,6 @@ "ignore": "^5.2.4", "ini": "^3.0.1", "inquirer": "^9.1.4", - "openai": "^4.56.0" + "openai": "^4.57.0" } } diff --git a/src/cli.ts b/src/cli.ts index e225a734..7d731d9f 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -9,6 +9,7 @@ import { configCommand } from './commands/config'; import { hookCommand, isHookCalled } from './commands/githook.js'; import { prepareCommitMessageHook } from './commands/prepare-commit-msg-hook'; import { checkIsLatestVersion } from './utils/checkIsLatestVersion'; +import { runMigrations } from './migrations/_run.js'; const extraArgs = process.argv.slice(2); @@ -30,6 +31,7 @@ cli( help: { description: packageJSON.description } }, async ({ flags }) => { + await runMigrations(); await checkIsLatestVersion(); if (await isHookCalled()) { diff --git a/src/commands/commit.ts b/src/commands/commit.ts index 5bb9de85..8d61df0d 100644 --- a/src/commands/commit.ts +++ b/src/commands/commit.ts @@ -107,13 +107,16 @@ ${chalk.grey('——————————————————')}` const remotes = await getGitRemotes(); + // user isn't pushing, return early + if (config.OCO_GITPUSH === false) return; + if (!remotes.length) { const { stdout } = await execa('git', ['push']); if (stdout) outro(stdout); process.exit(0); } - if (remotes.length === 1 && config.OCO_GITPUSH !== true) { + if (remotes.length === 1) { const isPushConfirmedByUser = await confirm({ message: 'Do you want to run `git push`?' }); @@ -156,13 +159,13 @@ ${chalk.grey('——————————————————')}` const { stdout } = await execa('git', ['push', selectedRemote]); + if (stdout) outro(stdout); + pushSpinner.stop( `${chalk.green( '✔' - )} Successfully pushed all commits to ${selectedRemote}` + )} successfully pushed all commits to ${selectedRemote}` ); - - if (stdout) outro(stdout); } } else { const regenerateMessage = await confirm({ diff --git a/src/commands/config.ts b/src/commands/config.ts index 1391f356..c45e2f2f 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -11,14 +11,9 @@ import { TEST_MOCK_TYPES } from '../engine/testAi'; import { getI18nLocal, i18n } from '../i18n'; export enum CONFIG_KEYS { - OCO_OPENAI_API_KEY = 'OCO_OPENAI_API_KEY', - OCO_ANTHROPIC_API_KEY = 'OCO_ANTHROPIC_API_KEY', - OCO_AZURE_API_KEY = 'OCO_AZURE_API_KEY', - OCO_GEMINI_API_KEY = 'OCO_GEMINI_API_KEY', - OCO_GEMINI_BASE_PATH = 'OCO_GEMINI_BASE_PATH', + OCO_API_KEY = 'OCO_API_KEY', OCO_TOKENS_MAX_INPUT = 'OCO_TOKENS_MAX_INPUT', OCO_TOKENS_MAX_OUTPUT = 'OCO_TOKENS_MAX_OUTPUT', - OCO_OPENAI_BASE_PATH = 'OCO_OPENAI_BASE_PATH', OCO_DESCRIPTION = 'OCO_DESCRIPTION', OCO_EMOJI = 'OCO_EMOJI', OCO_MODEL = 'OCO_MODEL', @@ -27,14 +22,10 @@ export enum CONFIG_KEYS { OCO_MESSAGE_TEMPLATE_PLACEHOLDER = 'OCO_MESSAGE_TEMPLATE_PLACEHOLDER', OCO_PROMPT_MODULE = 'OCO_PROMPT_MODULE', OCO_AI_PROVIDER = 'OCO_AI_PROVIDER', - OCO_GITPUSH = 'OCO_GITPUSH', // todo: deprecate OCO_ONE_LINE_COMMIT = 'OCO_ONE_LINE_COMMIT', - OCO_AZURE_ENDPOINT = 'OCO_AZURE_ENDPOINT', OCO_TEST_MOCK_TYPE = 'OCO_TEST_MOCK_TYPE', OCO_API_URL = 'OCO_API_URL', - OCO_OLLAMA_API_URL = 'OCO_OLLAMA_API_URL', - OCO_FLOWISE_ENDPOINT = 'OCO_FLOWISE_ENDPOINT', - OCO_FLOWISE_API_KEY = 'OCO_FLOWISE_API_KEY' + OCO_GITPUSH = 'OCO_GITPUSH' // todo: deprecate } export enum CONFIG_MODES { @@ -123,65 +114,19 @@ const validateConfig = ( }; export const configValidators = { - [CONFIG_KEYS.OCO_OPENAI_API_KEY](value: any, config: any = {}) { + [CONFIG_KEYS.OCO_API_KEY](value: any, config: any = {}) { if (config.OCO_AI_PROVIDER !== 'openai') return value; validateConfig( - 'OCO_OPENAI_API_KEY', + 'OCO_API_KEY', typeof value === 'string' && value.length > 0, 'Empty value is not allowed' ); validateConfig( - 'OCO_OPENAI_API_KEY', + 'OCO_API_KEY', value, - 'You need to provide the OCO_OPENAI_API_KEY when OCO_AI_PROVIDER is set to "openai" (default). Run `oco config set OCO_OPENAI_API_KEY=your_key`' - ); - - return value; - }, - - [CONFIG_KEYS.OCO_AZURE_API_KEY](value: any, config: any = {}) { - if (config.OCO_AI_PROVIDER !== 'azure') return value; - - validateConfig( - 'OCO_AZURE_API_KEY', - !!value, - 'You need to provide the OCO_AZURE_API_KEY when OCO_AI_PROVIDER is set to "azure". Run: `oco config set OCO_AZURE_API_KEY=your_key`' - ); - - return value; - }, - - [CONFIG_KEYS.OCO_GEMINI_API_KEY](value: any, config: any = {}) { - if (config.OCO_AI_PROVIDER !== 'gemini') return value; - - validateConfig( - 'OCO_GEMINI_API_KEY', - value || config.OCO_GEMINI_API_KEY || config.OCO_AI_PROVIDER === 'test', - 'You need to provide the OCO_GEMINI_API_KEY when OCO_AI_PROVIDER is set to "gemini". Run: `oco config set OCO_GEMINI_API_KEY=your_key`' - ); - - return value; - }, - - [CONFIG_KEYS.OCO_ANTHROPIC_API_KEY](value: any, config: any = {}) { - if (config.OCO_AI_PROVIDER !== 'anthropic') return value; - - validateConfig( - 'ANTHROPIC_API_KEY', - !!value, - 'You need to provide the OCO_ANTHROPIC_API_KEY key when OCO_AI_PROVIDER is set to "anthropic". Run: `oco config set OCO_ANTHROPIC_API_KEY=your_key`' - ); - - return value; - }, - - [CONFIG_KEYS.OCO_FLOWISE_API_KEY](value: any, config: any = {}) { - validateConfig( - CONFIG_KEYS.OCO_FLOWISE_API_KEY, - value || config.OCO_AI_PROVIDER !== 'flowise', - 'You need to provide the OCO_FLOWISE_API_KEY when OCO_AI_PROVIDER is set to "flowise". Run: `oco config set OCO_FLOWISE_API_KEY=your_key`' + 'You need to provide the OCO_API_KEY when OCO_AI_PROVIDER set to "openai" (default) or "ollama" or "azure" or "gemini" or "flowise" or "anthropic". Run `oco config set OCO_API_KEY=your_key OCO_AI_PROVIDER=openai`' ); return value; @@ -241,11 +186,11 @@ export const configValidators = { return getI18nLocal(value); }, - [CONFIG_KEYS.OCO_OPENAI_BASE_PATH](value: any) { + [CONFIG_KEYS.OCO_API_URL](value: any) { validateConfig( - CONFIG_KEYS.OCO_OPENAI_BASE_PATH, + CONFIG_KEYS.OCO_API_URL, typeof value === 'string', - 'Must be string' + `${value} is not a valid URL. It should start with 'http://' or 'https://'.` ); return value; }, @@ -315,26 +260,6 @@ export const configValidators = { return value; }, - [CONFIG_KEYS.OCO_AZURE_ENDPOINT](value: any) { - validateConfig( - CONFIG_KEYS.OCO_AZURE_ENDPOINT, - value.includes('openai.azure.com'), - 'Must be in format "https://.openai.azure.com/"' - ); - - return value; - }, - - [CONFIG_KEYS.OCO_FLOWISE_ENDPOINT](value: any) { - validateConfig( - CONFIG_KEYS.OCO_FLOWISE_ENDPOINT, - typeof value === 'string' && value.includes(':'), - 'Value must be string and should include both I.P. and port number' // Considering the possibility of DNS lookup or feeding the I.P. explicitly, there is no pattern to verify, except a column for the port number - ); - - return value; - }, - [CONFIG_KEYS.OCO_TEST_MOCK_TYPE](value: any) { validateConfig( CONFIG_KEYS.OCO_TEST_MOCK_TYPE, @@ -346,11 +271,11 @@ export const configValidators = { return value; }, - [CONFIG_KEYS.OCO_OLLAMA_API_URL](value: any) { + [CONFIG_KEYS.OCO_WHY](value: any) { validateConfig( - CONFIG_KEYS.OCO_OLLAMA_API_URL, - typeof value === 'string' && value.startsWith('http'), - `${value} is not a valid URL. It should start with 'http://' or 'https://'.` + CONFIG_KEYS.OCO_WHY, + typeof value === 'boolean', + 'Must be true or false' ); return value; } @@ -367,14 +292,10 @@ export enum OCO_AI_PROVIDER_ENUM { } export type ConfigType = { - [CONFIG_KEYS.OCO_OPENAI_API_KEY]?: string; - [CONFIG_KEYS.OCO_ANTHROPIC_API_KEY]?: string; - [CONFIG_KEYS.OCO_AZURE_API_KEY]?: string; - [CONFIG_KEYS.OCO_GEMINI_API_KEY]?: string; - [CONFIG_KEYS.OCO_GEMINI_BASE_PATH]?: string; + [CONFIG_KEYS.OCO_API_KEY]?: string; [CONFIG_KEYS.OCO_TOKENS_MAX_INPUT]: number; [CONFIG_KEYS.OCO_TOKENS_MAX_OUTPUT]: number; - [CONFIG_KEYS.OCO_OPENAI_BASE_PATH]?: string; + [CONFIG_KEYS.OCO_API_URL]?: string; [CONFIG_KEYS.OCO_DESCRIPTION]: boolean; [CONFIG_KEYS.OCO_EMOJI]: boolean; [CONFIG_KEYS.OCO_WHY]: boolean; @@ -385,16 +306,11 @@ export type ConfigType = { [CONFIG_KEYS.OCO_AI_PROVIDER]: OCO_AI_PROVIDER_ENUM; [CONFIG_KEYS.OCO_GITPUSH]: boolean; [CONFIG_KEYS.OCO_ONE_LINE_COMMIT]: boolean; - [CONFIG_KEYS.OCO_AZURE_ENDPOINT]?: string; [CONFIG_KEYS.OCO_TEST_MOCK_TYPE]: string; - [CONFIG_KEYS.OCO_API_URL]?: string; - [CONFIG_KEYS.OCO_OLLAMA_API_URL]?: string; - [CONFIG_KEYS.OCO_FLOWISE_ENDPOINT]: string; - [CONFIG_KEYS.OCO_FLOWISE_API_KEY]?: string; }; -const defaultConfigPath = pathJoin(homedir(), '.opencommit'); -const defaultEnvPath = pathResolve(process.cwd(), '.env'); +export const defaultConfigPath = pathJoin(homedir(), '.opencommit'); +export const defaultEnvPath = pathResolve(process.cwd(), '.env'); const assertConfigsAreValid = (config: Record) => { for (const [key, value] of Object.entries(config)) { @@ -446,7 +362,7 @@ const initGlobalConfig = (configPath: string = defaultConfigPath) => { return DEFAULT_CONFIG; }; -const parseEnvVarValue = (value?: any) => { +const parseConfigVarValue = (value?: any) => { try { return JSON.parse(value); } catch (error) { @@ -459,41 +375,45 @@ const getEnvConfig = (envPath: string) => { return { OCO_MODEL: process.env.OCO_MODEL, + OCO_API_URL: process.env.OCO_API_URL, + OCO_API_KEY: process.env.OCO_API_KEY, + OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER as OCO_AI_PROVIDER_ENUM, - OCO_OPENAI_API_KEY: process.env.OCO_OPENAI_API_KEY, - OCO_ANTHROPIC_API_KEY: process.env.OCO_ANTHROPIC_API_KEY, - OCO_AZURE_API_KEY: process.env.OCO_AZURE_API_KEY, - OCO_GEMINI_API_KEY: process.env.OCO_GEMINI_API_KEY, - OCO_FLOWISE_API_KEY: process.env.OCO_FLOWISE_API_KEY, - - OCO_TOKENS_MAX_INPUT: parseEnvVarValue(process.env.OCO_TOKENS_MAX_INPUT), - OCO_TOKENS_MAX_OUTPUT: parseEnvVarValue(process.env.OCO_TOKENS_MAX_OUTPUT), - - OCO_OPENAI_BASE_PATH: process.env.OCO_OPENAI_BASE_PATH, - OCO_GEMINI_BASE_PATH: process.env.OCO_GEMINI_BASE_PATH, - - OCO_AZURE_ENDPOINT: process.env.OCO_AZURE_ENDPOINT, - OCO_FLOWISE_ENDPOINT: process.env.OCO_FLOWISE_ENDPOINT, - OCO_OLLAMA_API_URL: process.env.OCO_OLLAMA_API_URL, + OCO_TOKENS_MAX_INPUT: parseConfigVarValue(process.env.OCO_TOKENS_MAX_INPUT), + OCO_TOKENS_MAX_OUTPUT: parseConfigVarValue( + process.env.OCO_TOKENS_MAX_OUTPUT + ), - OCO_DESCRIPTION: parseEnvVarValue(process.env.OCO_DESCRIPTION), - OCO_EMOJI: parseEnvVarValue(process.env.OCO_EMOJI), + OCO_DESCRIPTION: parseConfigVarValue(process.env.OCO_DESCRIPTION), + OCO_EMOJI: parseConfigVarValue(process.env.OCO_EMOJI), OCO_LANGUAGE: process.env.OCO_LANGUAGE, OCO_MESSAGE_TEMPLATE_PLACEHOLDER: process.env.OCO_MESSAGE_TEMPLATE_PLACEHOLDER, OCO_PROMPT_MODULE: process.env.OCO_PROMPT_MODULE as OCO_PROMPT_MODULE_ENUM, - OCO_AI_PROVIDER: process.env.OCO_AI_PROVIDER as OCO_AI_PROVIDER_ENUM, - OCO_ONE_LINE_COMMIT: parseEnvVarValue(process.env.OCO_ONE_LINE_COMMIT), + OCO_ONE_LINE_COMMIT: parseConfigVarValue(process.env.OCO_ONE_LINE_COMMIT), OCO_TEST_MOCK_TYPE: process.env.OCO_TEST_MOCK_TYPE, - OCO_GITPUSH: parseEnvVarValue(process.env.OCO_GITPUSH) // todo: deprecate + OCO_GITPUSH: parseConfigVarValue(process.env.OCO_GITPUSH) // todo: deprecate }; }; -const getGlobalConfig = (configPath: string) => { +export const setGlobalConfig = ( + config: ConfigType, + configPath: string = defaultConfigPath +) => { + writeFileSync(configPath, iniStringify(config), 'utf8'); +}; + +export const getIsGlobalConfigFileExist = ( + configPath: string = defaultConfigPath +) => { + return existsSync(configPath); +}; + +export const getGlobalConfig = (configPath: string = defaultConfigPath) => { let globalConfig: ConfigType; - const isGlobalConfigFileExist = existsSync(configPath); + const isGlobalConfigFileExist = getIsGlobalConfigFileExist(configPath); if (!isGlobalConfigFileExist) globalConfig = initGlobalConfig(configPath); else { const configFile = readFileSync(configPath, 'utf8'); @@ -510,16 +430,18 @@ const getGlobalConfig = (configPath: string) => { * @param fallback - global ~/.opencommit config file * @returns merged config */ -const mergeConfigs = (main: Partial, fallback: ConfigType) => - Object.keys(CONFIG_KEYS).reduce((acc, key) => { - acc[key] = parseEnvVarValue(main[key] ?? fallback[key]); - +const mergeConfigs = (main: Partial, fallback: ConfigType) => { + const allKeys = new Set([...Object.keys(main), ...Object.keys(fallback)]); + return Array.from(allKeys).reduce((acc, key) => { + acc[key] = parseConfigVarValue(main[key] ?? fallback[key]); return acc; }, {} as ConfigType); +}; interface GetConfigOptions { globalPath?: string; envPath?: string; + setDefaultValues?: boolean; } export const getConfig = ({ @@ -535,13 +457,15 @@ export const getConfig = ({ }; export const setConfig = ( - keyValues: [key: string, value: string][], + keyValues: [key: string, value: string | boolean | number | null][], globalConfigPath: string = defaultConfigPath ) => { const config = getConfig({ globalPath: globalConfigPath }); + const configToSet = {}; + for (let [key, value] of keyValues) { if (!configValidators.hasOwnProperty(key)) { const supportedKeys = Object.keys(configValidators).join('\n'); @@ -553,7 +477,8 @@ export const setConfig = ( let parsedConfigValue; try { - parsedConfigValue = JSON.parse(value); + if (typeof value === 'string') parsedConfigValue = JSON.parse(value); + else parsedConfigValue = value; } catch (error) { parsedConfigValue = value; } @@ -563,10 +488,10 @@ export const setConfig = ( config ); - config[key] = validValue; + configToSet[key] = validValue; } - writeFileSync(globalConfigPath, iniStringify(config), 'utf8'); + setGlobalConfig(mergeConfigs(configToSet, config), globalConfigPath); outro(`${chalk.green('✔')} config successfully set`); }; diff --git a/src/commands/prepare-commit-msg-hook.ts b/src/commands/prepare-commit-msg-hook.ts index c9ad0a96..676757c7 100644 --- a/src/commands/prepare-commit-msg-hook.ts +++ b/src/commands/prepare-commit-msg-hook.ts @@ -39,14 +39,11 @@ export const prepareCommitMessageHook = async ( const config = getConfig(); - if ( - !config.OCO_OPENAI_API_KEY && - !config.OCO_ANTHROPIC_API_KEY && - !config.OCO_AZURE_API_KEY - ) { - throw new Error( - 'No OPEN_AI_API or OCO_ANTHROPIC_API_KEY or OCO_AZURE_API_KEY exists. Set your key in ~/.opencommit' + if (!config.OCO_API_KEY) { + outro( + 'No OCO_API_KEY is set. Set your key via `oco config set OCO_API_KEY=. For more info see https://github.com/di-sukharev/opencommit' ); + return; } const spin = spinner(); diff --git a/src/engine/flowise.ts b/src/engine/flowise.ts index d7ae2067..00890f5c 100644 --- a/src/engine/flowise.ts +++ b/src/engine/flowise.ts @@ -4,7 +4,7 @@ import { AiEngine, AiEngineConfig } from './Engine'; interface FlowiseAiConfig extends AiEngineConfig {} -export class FlowiseAi implements AiEngine { +export class FlowiseEngine implements AiEngine { config: FlowiseAiConfig; client: AxiosInstance; diff --git a/src/engine/gemini.ts b/src/engine/gemini.ts index 1e068757..e2e63acc 100644 --- a/src/engine/gemini.ts +++ b/src/engine/gemini.ts @@ -11,7 +11,7 @@ import { AiEngine, AiEngineConfig } from './Engine'; interface GeminiConfig extends AiEngineConfig {} -export class Gemini implements AiEngine { +export class GeminiEngine implements AiEngine { config: GeminiConfig; client: GoogleGenerativeAI; diff --git a/src/engine/ollama.ts b/src/engine/ollama.ts index 0347fc63..225a24b3 100644 --- a/src/engine/ollama.ts +++ b/src/engine/ollama.ts @@ -4,7 +4,7 @@ import { AiEngine, AiEngineConfig } from './Engine'; interface OllamaConfig extends AiEngineConfig {} -export class OllamaAi implements AiEngine { +export class OllamaEngine implements AiEngine { config: OllamaConfig; client: AxiosInstance; diff --git a/src/generateCommitMessageFromGitDiff.ts b/src/generateCommitMessageFromGitDiff.ts index 33b84bf9..8ba87407 100644 --- a/src/generateCommitMessageFromGitDiff.ts +++ b/src/generateCommitMessageFromGitDiff.ts @@ -6,11 +6,8 @@ import { mergeDiffs } from './utils/mergeDiffs'; import { tokenCount } from './utils/tokenCount'; const config = getConfig(); -const MAX_TOKENS_INPUT = - config.OCO_TOKENS_MAX_INPUT || DEFAULT_TOKEN_LIMITS.DEFAULT_MAX_TOKENS_INPUT; -const MAX_TOKENS_OUTPUT = - config.OCO_TOKENS_MAX_OUTPUT || - DEFAULT_TOKEN_LIMITS.DEFAULT_MAX_TOKENS_OUTPUT; +const MAX_TOKENS_INPUT = config.OCO_TOKENS_MAX_INPUT; +const MAX_TOKENS_OUTPUT = config.OCO_TOKENS_MAX_OUTPUT; const generateCommitMessageChatCompletionPrompt = async ( diff: string, diff --git a/src/migrations/00_use_single_api_key_and_url.ts b/src/migrations/00_use_single_api_key_and_url.ts new file mode 100644 index 00000000..a927f7b6 --- /dev/null +++ b/src/migrations/00_use_single_api_key_and_url.ts @@ -0,0 +1,45 @@ +import { + CONFIG_KEYS, + getConfig, + OCO_AI_PROVIDER_ENUM, + setConfig +} from '../commands/config'; + +export default function () { + const config = getConfig({ setDefaultValues: false }); + + const aiProvider = config.OCO_AI_PROVIDER; + + let apiKey: string | undefined; + let apiUrl: string | undefined; + + if (aiProvider === OCO_AI_PROVIDER_ENUM.OLLAMA) { + apiKey = config['OCO_OLLAMA_API_KEY']; + apiUrl = config['OCO_OLLAMA_API_URL']; + } else if (aiProvider === OCO_AI_PROVIDER_ENUM.ANTHROPIC) { + apiKey = config['OCO_ANTHROPIC_API_KEY']; + apiUrl = config['OCO_ANTHROPIC_BASE_PATH']; + } else if (aiProvider === OCO_AI_PROVIDER_ENUM.OPENAI) { + apiKey = config['OCO_OPENAI_API_KEY']; + apiUrl = config['OCO_OPENAI_BASE_PATH']; + } else if (aiProvider === OCO_AI_PROVIDER_ENUM.AZURE) { + apiKey = config['OCO_AZURE_API_KEY']; + apiUrl = config['OCO_AZURE_ENDPOINT']; + } else if (aiProvider === OCO_AI_PROVIDER_ENUM.GEMINI) { + apiKey = config['OCO_GEMINI_API_KEY']; + apiUrl = config['OCO_GEMINI_BASE_PATH']; + } else if (aiProvider === OCO_AI_PROVIDER_ENUM.FLOWISE) { + apiKey = config['OCO_FLOWISE_API_KEY']; + apiUrl = config['OCO_FLOWISE_ENDPOINT']; + } else { + throw new Error( + `Migration failed, set AI provider first. Run "oco config set OCO_AI_PROVIDER=", where is one of: ${Object.values( + OCO_AI_PROVIDER_ENUM + ).join(', ')}` + ); + } + + if (apiKey) setConfig([[CONFIG_KEYS.OCO_API_KEY, apiKey]]); + + if (apiUrl) setConfig([[CONFIG_KEYS.OCO_API_URL, apiUrl]]); +} diff --git a/src/migrations/01_remove_obsolete_config_keys_from_global_file.ts b/src/migrations/01_remove_obsolete_config_keys_from_global_file.ts new file mode 100644 index 00000000..f29c1c02 --- /dev/null +++ b/src/migrations/01_remove_obsolete_config_keys_from_global_file.ts @@ -0,0 +1,26 @@ +import { getGlobalConfig, setGlobalConfig } from '../commands/config'; + +export default function () { + const obsoleteKeys = [ + 'OCO_OLLAMA_API_KEY', + 'OCO_OLLAMA_API_URL', + 'OCO_ANTHROPIC_API_KEY', + 'OCO_ANTHROPIC_BASE_PATH', + 'OCO_OPENAI_API_KEY', + 'OCO_OPENAI_BASE_PATH', + 'OCO_AZURE_API_KEY', + 'OCO_AZURE_ENDPOINT', + 'OCO_GEMINI_API_KEY', + 'OCO_GEMINI_BASE_PATH', + 'OCO_FLOWISE_API_KEY', + 'OCO_FLOWISE_ENDPOINT' + ]; + + const globalConfig = getGlobalConfig(); + + const configToOverride = { ...globalConfig }; + + for (const key of obsoleteKeys) delete configToOverride[key]; + + setGlobalConfig(configToOverride); +} diff --git a/src/migrations/02_set_missing_default_values.ts b/src/migrations/02_set_missing_default_values.ts new file mode 100644 index 00000000..107fc06b --- /dev/null +++ b/src/migrations/02_set_missing_default_values.ts @@ -0,0 +1,20 @@ +import { + ConfigType, + DEFAULT_CONFIG, + getGlobalConfig, + setConfig +} from '../commands/config'; + +export default function () { + const setDefaultConfigValues = (config: ConfigType) => { + const entriesToSet: [key: string, value: string | boolean | number][] = []; + for (const entry of Object.entries(DEFAULT_CONFIG)) { + const [key, _value] = entry; + if (config[key] === 'undefined') entriesToSet.push(entry); + } + + if (entriesToSet.length > 0) setConfig(entriesToSet); + }; + + setDefaultConfigValues(getGlobalConfig()); +} diff --git a/src/migrations/_migrations.ts b/src/migrations/_migrations.ts new file mode 100644 index 00000000..9f2b7bf6 --- /dev/null +++ b/src/migrations/_migrations.ts @@ -0,0 +1,18 @@ +import migration00 from './00_use_single_api_key_and_url'; +import migration01 from './01_remove_obsolete_config_keys_from_global_file'; +import migration02 from './02_set_missing_default_values'; + +export const migrations = [ + { + name: '00_use_single_api_key_and_url', + run: migration00 + }, + { + name: '01_remove_obsolete_config_keys_from_global_file', + run: migration01 + }, + { + name: '02_set_missing_default_values', + run: migration02 + } +]; diff --git a/src/migrations/_run.ts b/src/migrations/_run.ts new file mode 100644 index 00000000..03a6b1bc --- /dev/null +++ b/src/migrations/_run.ts @@ -0,0 +1,70 @@ +import fs from 'fs'; +import { homedir } from 'os'; +import { join as pathJoin } from 'path'; +import { migrations } from './_migrations'; +import { outro } from '@clack/prompts'; +import chalk from 'chalk'; +import { + getConfig, + getIsGlobalConfigFileExist, + OCO_AI_PROVIDER_ENUM +} from '../commands/config'; + +const migrationsFile = pathJoin(homedir(), '.opencommit_migrations'); + +const getCompletedMigrations = (): string[] => { + if (!fs.existsSync(migrationsFile)) { + return []; + } + const data = fs.readFileSync(migrationsFile, 'utf-8'); + return data ? JSON.parse(data) : []; +}; + +const saveCompletedMigration = (migrationName: string) => { + const completedMigrations = getCompletedMigrations(); + completedMigrations.push(migrationName); + fs.writeFileSync( + migrationsFile, + JSON.stringify(completedMigrations, null, 2) + ); +}; + +export const runMigrations = async () => { + // if no config file, we assume it's a new installation and no migrations are needed + if (!getIsGlobalConfigFileExist()) return; + + const config = getConfig(); + if (config.OCO_AI_PROVIDER === OCO_AI_PROVIDER_ENUM.TEST) return; + + const completedMigrations = getCompletedMigrations(); + + let isMigrated = false; + + for (const migration of migrations) { + if (!completedMigrations.includes(migration.name)) { + try { + console.log('Applying migration', migration.name); + migration.run(); + console.log('Migration applied successfully', migration.name); + saveCompletedMigration(migration.name); + } catch (error) { + outro( + `${chalk.red('Failed to apply migration')} ${ + migration.name + }: ${error}` + ); + } + + isMigrated = true; + } + } + + if (isMigrated) { + outro( + `${chalk.green( + '✔' + )} Migrations to your config were applied successfully. Please rerun.` + ); + process.exit(0); + } +}; diff --git a/src/utils/engine.ts b/src/utils/engine.ts index 1c1a20e6..f3b3ae0a 100644 --- a/src/utils/engine.ts +++ b/src/utils/engine.ts @@ -2,9 +2,9 @@ import { getConfig, OCO_AI_PROVIDER_ENUM } from '../commands/config'; import { AnthropicEngine } from '../engine/anthropic'; import { AzureEngine } from '../engine/azure'; import { AiEngine } from '../engine/Engine'; -import { FlowiseAi } from '../engine/flowise'; -import { Gemini } from '../engine/gemini'; -import { OllamaAi } from '../engine/ollama'; +import { FlowiseEngine } from '../engine/flowise'; +import { GeminiEngine } from '../engine/gemini'; +import { OllamaEngine } from '../engine/ollama'; import { OpenAiEngine } from '../engine/openAi'; import { TestAi, TestMockType } from '../engine/testAi'; @@ -16,50 +16,30 @@ export function getEngine(): AiEngine { model: config.OCO_MODEL!, maxTokensOutput: config.OCO_TOKENS_MAX_OUTPUT!, maxTokensInput: config.OCO_TOKENS_MAX_INPUT!, - baseURL: config.OCO_OPENAI_BASE_PATH! + baseURL: config.OCO_API_URL!, + apiKey: config.OCO_API_KEY! }; switch (provider) { case OCO_AI_PROVIDER_ENUM.OLLAMA: - return new OllamaAi({ - ...DEFAULT_CONFIG, - apiKey: '', - baseURL: config.OCO_OLLAMA_API_URL! - }); + return new OllamaEngine(DEFAULT_CONFIG); case OCO_AI_PROVIDER_ENUM.ANTHROPIC: - return new AnthropicEngine({ - ...DEFAULT_CONFIG, - apiKey: config.OCO_ANTHROPIC_API_KEY! - }); + return new AnthropicEngine(DEFAULT_CONFIG); case OCO_AI_PROVIDER_ENUM.TEST: return new TestAi(config.OCO_TEST_MOCK_TYPE as TestMockType); case OCO_AI_PROVIDER_ENUM.GEMINI: - return new Gemini({ - ...DEFAULT_CONFIG, - apiKey: config.OCO_GEMINI_API_KEY!, - baseURL: config.OCO_GEMINI_BASE_PATH! - }); + return new GeminiEngine(DEFAULT_CONFIG); case OCO_AI_PROVIDER_ENUM.AZURE: - return new AzureEngine({ - ...DEFAULT_CONFIG, - apiKey: config.OCO_AZURE_API_KEY! - }); + return new AzureEngine(DEFAULT_CONFIG); case OCO_AI_PROVIDER_ENUM.FLOWISE: - return new FlowiseAi({ - ...DEFAULT_CONFIG, - baseURL: config.OCO_FLOWISE_ENDPOINT || DEFAULT_CONFIG.baseURL, - apiKey: config.OCO_FLOWISE_API_KEY! - }); + return new FlowiseEngine(DEFAULT_CONFIG); default: - return new OpenAiEngine({ - ...DEFAULT_CONFIG, - apiKey: config.OCO_OPENAI_API_KEY! - }); + return new OpenAiEngine(DEFAULT_CONFIG); } } diff --git a/test/e2e/gitPush.test.ts b/test/e2e/gitPush.test.ts new file mode 100644 index 00000000..611f8d04 --- /dev/null +++ b/test/e2e/gitPush.test.ts @@ -0,0 +1,205 @@ +import path from 'path'; +import 'cli-testing-library/extend-expect'; +import { exec } from 'child_process'; +import { prepareTempDir } from './utils'; +import { promisify } from 'util'; +import { render } from 'cli-testing-library'; +import { resolve } from 'path'; +import { rm } from 'fs'; +const fsExec = promisify(exec); +const fsRemove = promisify(rm); + +/** + * git remote -v + * + * [no remotes] + */ +const prepareNoRemoteGitRepository = async (): Promise<{ + gitDir: string; + cleanup: () => Promise; +}> => { + const tempDir = await prepareTempDir(); + await fsExec('git init test', { cwd: tempDir }); + const gitDir = path.resolve(tempDir, 'test'); + + const cleanup = async () => { + return fsRemove(tempDir, { recursive: true }); + }; + return { + gitDir, + cleanup + }; +}; + +/** + * git remote -v + * + * origin /tmp/remote.git (fetch) + * origin /tmp/remote.git (push) + */ +const prepareOneRemoteGitRepository = async (): Promise<{ + gitDir: string; + cleanup: () => Promise; +}> => { + const tempDir = await prepareTempDir(); + await fsExec('git init --bare remote.git', { cwd: tempDir }); + await fsExec('git clone remote.git test', { cwd: tempDir }); + const gitDir = path.resolve(tempDir, 'test'); + + const cleanup = async () => { + return fsRemove(tempDir, { recursive: true }); + }; + return { + gitDir, + cleanup + }; +}; + +/** + * git remote -v + * + * origin /tmp/remote.git (fetch) + * origin /tmp/remote.git (push) + * other ../remote2.git (fetch) + * other ../remote2.git (push) + */ +const prepareTwoRemotesGitRepository = async (): Promise<{ + gitDir: string; + cleanup: () => Promise; +}> => { + const tempDir = await prepareTempDir(); + await fsExec('git init --bare remote.git', { cwd: tempDir }); + await fsExec('git init --bare other.git', { cwd: tempDir }); + await fsExec('git clone remote.git test', { cwd: tempDir }); + const gitDir = path.resolve(tempDir, 'test'); + await fsExec('git remote add other ../other.git', { cwd: gitDir }); + + const cleanup = async () => { + return fsRemove(tempDir, { recursive: true }); + }; + return { + gitDir, + cleanup + }; +}; + +describe('cli flow to push git branch', () => { + it('do nothing when OCO_GITPUSH is set to false', async () => { + const { gitDir, cleanup } = await prepareNoRemoteGitRepository(); + + await render('echo', [`'console.log("Hello World");' > index.ts`], { + cwd: gitDir + }); + await render('git', ['add index.ts'], { cwd: gitDir }); + + const { queryByText, findByText, userEvent } = await render( + `OCO_AI_PROVIDER='test' OCO_GITPUSH='false' node`, + [resolve('./out/cli.cjs')], + { cwd: gitDir } + ); + expect(await findByText('Confirm the commit message?')).toBeInTheConsole(); + userEvent.keyboard('[Enter]'); + + expect( + await queryByText('Choose a remote to push to') + ).not.toBeInTheConsole(); + expect( + await queryByText('Do you want to run `git push`?') + ).not.toBeInTheConsole(); + expect( + await queryByText('Successfully pushed all commits to origin') + ).not.toBeInTheConsole(); + expect( + await queryByText('Command failed with exit code 1') + ).not.toBeInTheConsole(); + + await cleanup(); + }); + + it('push and cause error when there is no remote', async () => { + const { gitDir, cleanup } = await prepareNoRemoteGitRepository(); + + await render('echo', [`'console.log("Hello World");' > index.ts`], { + cwd: gitDir + }); + await render('git', ['add index.ts'], { cwd: gitDir }); + + const { queryByText, findByText, userEvent } = await render( + `OCO_AI_PROVIDER='test' node`, + [resolve('./out/cli.cjs')], + { cwd: gitDir } + ); + expect(await findByText('Confirm the commit message?')).toBeInTheConsole(); + userEvent.keyboard('[Enter]'); + + expect( + await queryByText('Choose a remote to push to') + ).not.toBeInTheConsole(); + expect( + await queryByText('Do you want to run `git push`?') + ).not.toBeInTheConsole(); + expect( + await queryByText('Successfully pushed all commits to origin') + ).not.toBeInTheConsole(); + + expect( + await findByText('Command failed with exit code 1') + ).toBeInTheConsole(); + + await cleanup(); + }); + + it('push when one remote is set', async () => { + const { gitDir, cleanup } = await prepareOneRemoteGitRepository(); + + await render('echo', [`'console.log("Hello World");' > index.ts`], { + cwd: gitDir + }); + await render('git', ['add index.ts'], { cwd: gitDir }); + + const { findByText, userEvent } = await render( + `OCO_AI_PROVIDER='test' node`, + [resolve('./out/cli.cjs')], + { cwd: gitDir } + ); + expect(await findByText('Confirm the commit message?')).toBeInTheConsole(); + userEvent.keyboard('[Enter]'); + + expect( + await findByText('Do you want to run `git push`?') + ).toBeInTheConsole(); + userEvent.keyboard('[Enter]'); + + expect( + await findByText('Successfully pushed all commits to origin') + ).toBeInTheConsole(); + + await cleanup(); + }); + + it('push when two remotes are set', async () => { + const { gitDir, cleanup } = await prepareTwoRemotesGitRepository(); + + await render('echo', [`'console.log("Hello World");' > index.ts`], { + cwd: gitDir + }); + await render('git', ['add index.ts'], { cwd: gitDir }); + + const { findByText, userEvent } = await render( + `OCO_AI_PROVIDER='test' node`, + [resolve('./out/cli.cjs')], + { cwd: gitDir } + ); + expect(await findByText('Confirm the commit message?')).toBeInTheConsole(); + userEvent.keyboard('[Enter]'); + + expect(await findByText('Choose a remote to push to')).toBeInTheConsole(); + userEvent.keyboard('[Enter]'); + + expect( + await findByText('Successfully pushed all commits to origin') + ).toBeInTheConsole(); + + await cleanup(); + }); +}); diff --git a/test/e2e/oneFile.test.ts b/test/e2e/oneFile.test.ts index ddfbc10a..b3e25f96 100644 --- a/test/e2e/oneFile.test.ts +++ b/test/e2e/oneFile.test.ts @@ -17,7 +17,7 @@ it('cli flow to generate commit message for 1 new file (staged)', async () => { expect(await findByText('Confirm the commit message?')).toBeInTheConsole(); userEvent.keyboard('[Enter]'); - expect(await findByText('Choose a remote to push to')).toBeInTheConsole(); + expect(await findByText('Do you want to run `git push`?')).toBeInTheConsole(); userEvent.keyboard('[Enter]'); expect(await findByText('Successfully pushed all commits to origin')).toBeInTheConsole(); @@ -46,7 +46,7 @@ it('cli flow to generate commit message for 1 changed file (not staged)', async expect(await findByText('Successfully committed')).toBeInTheConsole(); - expect(await findByText('Choose a remote to push to')).toBeInTheConsole(); + expect(await findByText('Do you want to run `git push`?')).toBeInTheConsole(); userEvent.keyboard('[Enter]'); expect(await findByText('Successfully pushed all commits to origin')).toBeInTheConsole(); diff --git a/test/e2e/prompt-module/commitlint.test.ts b/test/e2e/prompt-module/commitlint.test.ts index a78ebb61..ab849994 100644 --- a/test/e2e/prompt-module/commitlint.test.ts +++ b/test/e2e/prompt-module/commitlint.test.ts @@ -209,7 +209,7 @@ describe('cli flow to generate commit message using @commitlint prompt-module', oco.userEvent.keyboard('[Enter]'); expect( - await oco.findByText('Choose a remote to push to') + await oco.findByText('Do you want to run `git push`?') ).toBeInTheConsole(); oco.userEvent.keyboard('[Enter]'); diff --git a/test/e2e/utils.ts b/test/e2e/utils.ts index 73f909c5..6ae56633 100644 --- a/test/e2e/utils.ts +++ b/test/e2e/utils.ts @@ -15,7 +15,7 @@ export const prepareEnvironment = async (): Promise<{ gitDir: string; cleanup: () => Promise; }> => { - const tempDir = await fsMakeTempDir(path.join(tmpdir(), 'opencommit-test-')); + const tempDir = await prepareTempDir(); // Create a remote git repository int the temp directory. This is necessary to execute the `git push` command await fsExec('git init --bare remote.git', { cwd: tempDir }); await fsExec('git clone remote.git test', { cwd: tempDir }); @@ -30,4 +30,8 @@ export const prepareEnvironment = async (): Promise<{ } } +export const prepareTempDir = async(): Promise => { + return await fsMakeTempDir(path.join(tmpdir(), 'opencommit-test-')); +} + export const wait = (ms: number) => new Promise(resolve => setTimeout(resolve, ms)); diff --git a/test/unit/config.test.ts b/test/unit/config.test.ts index 35c15528..49a84ae6 100644 --- a/test/unit/config.test.ts +++ b/test/unit/config.test.ts @@ -1,5 +1,6 @@ import { existsSync, readFileSync, rmSync } from 'fs'; import { + CONFIG_KEYS, DEFAULT_CONFIG, getConfig, setConfig @@ -50,14 +51,13 @@ describe('config', () => { describe('getConfig', () => { it('should prioritize local .env over global .opencommit config', async () => { globalConfigFile = await generateConfig('.opencommit', { - OCO_OPENAI_API_KEY: 'global-key', + OCO_API_KEY: 'global-key', OCO_MODEL: 'gpt-3.5-turbo', OCO_LANGUAGE: 'en' }); envConfigFile = await generateConfig('.env', { - OCO_OPENAI_API_KEY: 'local-key', - OCO_ANTHROPIC_API_KEY: 'local-anthropic-key', + OCO_API_KEY: 'local-key', OCO_LANGUAGE: 'fr' }); @@ -67,22 +67,21 @@ describe('config', () => { }); expect(config).not.toEqual(null); - expect(config.OCO_OPENAI_API_KEY).toEqual('local-key'); + expect(config.OCO_API_KEY).toEqual('local-key'); expect(config.OCO_MODEL).toEqual('gpt-3.5-turbo'); expect(config.OCO_LANGUAGE).toEqual('fr'); - expect(config.OCO_ANTHROPIC_API_KEY).toEqual('local-anthropic-key'); }); it('should fallback to global config when local config is not set', async () => { globalConfigFile = await generateConfig('.opencommit', { - OCO_OPENAI_API_KEY: 'global-key', + OCO_API_KEY: 'global-key', OCO_MODEL: 'gpt-4', OCO_LANGUAGE: 'de', OCO_DESCRIPTION: 'true' }); envConfigFile = await generateConfig('.env', { - OCO_ANTHROPIC_API_KEY: 'local-anthropic-key' + OCO_API_URL: 'local-api-url' }); const config = getConfig({ @@ -91,8 +90,8 @@ describe('config', () => { }); expect(config).not.toEqual(null); - expect(config.OCO_OPENAI_API_KEY).toEqual('global-key'); - expect(config.OCO_ANTHROPIC_API_KEY).toEqual('local-anthropic-key'); + expect(config.OCO_API_KEY).toEqual('global-key'); + expect(config.OCO_API_URL).toEqual('local-api-url'); expect(config.OCO_MODEL).toEqual('gpt-4'); expect(config.OCO_LANGUAGE).toEqual('de'); expect(config.OCO_DESCRIPTION).toEqual(true); @@ -124,7 +123,7 @@ describe('config', () => { it('should handle empty local config correctly', async () => { globalConfigFile = await generateConfig('.opencommit', { - OCO_OPENAI_API_KEY: 'global-key', + OCO_API_KEY: 'global-key', OCO_MODEL: 'gpt-4', OCO_LANGUAGE: 'es' }); @@ -137,20 +136,20 @@ describe('config', () => { }); expect(config).not.toEqual(null); - expect(config.OCO_OPENAI_API_KEY).toEqual('global-key'); + expect(config.OCO_API_KEY).toEqual('global-key'); expect(config.OCO_MODEL).toEqual('gpt-4'); expect(config.OCO_LANGUAGE).toEqual('es'); }); it('should override global config with null values in local .env', async () => { globalConfigFile = await generateConfig('.opencommit', { - OCO_OPENAI_API_KEY: 'global-key', + OCO_API_KEY: 'global-key', OCO_MODEL: 'gpt-4', OCO_LANGUAGE: 'es' }); envConfigFile = await generateConfig('.env', { - OCO_OPENAI_API_KEY: 'null' + OCO_API_KEY: 'null' }); const config = getConfig({ @@ -159,7 +158,7 @@ describe('config', () => { }); expect(config).not.toEqual(null); - expect(config.OCO_OPENAI_API_KEY).toEqual(null); + expect(config.OCO_API_KEY).toEqual(null); }); it('should handle empty global config', async () => { @@ -172,7 +171,7 @@ describe('config', () => { }); expect(config).not.toEqual(null); - expect(config.OCO_OPENAI_API_KEY).toEqual(undefined); + expect(config.OCO_API_KEY).toEqual(undefined); }); }); @@ -188,12 +187,12 @@ describe('config', () => { expect(isGlobalConfigFileExist).toBe(false); await setConfig( - [['OCO_OPENAI_API_KEY', 'persisted-key_1']], + [[CONFIG_KEYS.OCO_API_KEY, 'persisted-key_1']], globalConfigFile.filePath ); const fileContent = readFileSync(globalConfigFile.filePath, 'utf8'); - expect(fileContent).toContain('OCO_OPENAI_API_KEY=persisted-key_1'); + expect(fileContent).toContain('OCO_API_KEY=persisted-key_1'); Object.entries(DEFAULT_CONFIG).forEach(([key, value]) => { expect(fileContent).toContain(`${key}=${value}`); }); @@ -203,42 +202,48 @@ describe('config', () => { globalConfigFile = await generateConfig('.opencommit', {}); await setConfig( [ - ['OCO_OPENAI_API_KEY', 'new-key'], - ['OCO_MODEL', 'gpt-4'] + [CONFIG_KEYS.OCO_API_KEY, 'new-key'], + [CONFIG_KEYS.OCO_MODEL, 'gpt-4'] ], globalConfigFile.filePath ); - const config = getConfig({ globalPath: globalConfigFile.filePath }); - expect(config.OCO_OPENAI_API_KEY).toEqual('new-key'); + const config = getConfig({ + globalPath: globalConfigFile.filePath + }); + expect(config.OCO_API_KEY).toEqual('new-key'); expect(config.OCO_MODEL).toEqual('gpt-4'); }); it('should update existing config values', async () => { globalConfigFile = await generateConfig('.opencommit', { - OCO_OPENAI_API_KEY: 'initial-key' + OCO_API_KEY: 'initial-key' }); await setConfig( - [['OCO_OPENAI_API_KEY', 'updated-key']], + [[CONFIG_KEYS.OCO_API_KEY, 'updated-key']], globalConfigFile.filePath ); - const config = getConfig({ globalPath: globalConfigFile.filePath }); - expect(config.OCO_OPENAI_API_KEY).toEqual('updated-key'); + const config = getConfig({ + globalPath: globalConfigFile.filePath + }); + expect(config.OCO_API_KEY).toEqual('updated-key'); }); it('should handle boolean and numeric values correctly', async () => { globalConfigFile = await generateConfig('.opencommit', {}); await setConfig( [ - ['OCO_TOKENS_MAX_INPUT', '8192'], - ['OCO_DESCRIPTION', 'true'], - ['OCO_ONE_LINE_COMMIT', 'false'] + [CONFIG_KEYS.OCO_TOKENS_MAX_INPUT, '8192'], + [CONFIG_KEYS.OCO_DESCRIPTION, 'true'], + [CONFIG_KEYS.OCO_ONE_LINE_COMMIT, 'false'] ], globalConfigFile.filePath ); - const config = getConfig({ globalPath: globalConfigFile.filePath }); + const config = getConfig({ + globalPath: globalConfigFile.filePath + }); expect(config.OCO_TOKENS_MAX_INPUT).toEqual(8192); expect(config.OCO_DESCRIPTION).toEqual(true); expect(config.OCO_ONE_LINE_COMMIT).toEqual(false); @@ -266,12 +271,12 @@ describe('config', () => { expect(isGlobalConfigFileExist).toBe(false); await setConfig( - [['OCO_OPENAI_API_KEY', 'persisted-key']], + [[CONFIG_KEYS.OCO_API_KEY, 'persisted-key']], globalConfigFile.filePath ); const fileContent = readFileSync(globalConfigFile.filePath, 'utf8'); - expect(fileContent).toContain('OCO_OPENAI_API_KEY=persisted-key'); + expect(fileContent).toContain('OCO_API_KEY=persisted-key'); }); it('should set multiple configs in a row and keep the changes', async () => { @@ -279,14 +284,17 @@ describe('config', () => { expect(isGlobalConfigFileExist).toBe(false); await setConfig( - [['OCO_OPENAI_API_KEY', 'persisted-key']], + [[CONFIG_KEYS.OCO_API_KEY, 'persisted-key']], globalConfigFile.filePath ); const fileContent1 = readFileSync(globalConfigFile.filePath, 'utf8'); - expect(fileContent1).toContain('OCO_OPENAI_API_KEY=persisted-key'); + expect(fileContent1).toContain('OCO_API_KEY=persisted-key'); - await setConfig([['OCO_MODEL', 'gpt-4']], globalConfigFile.filePath); + await setConfig( + [[CONFIG_KEYS.OCO_MODEL, 'gpt-4']], + globalConfigFile.filePath + ); const fileContent2 = readFileSync(globalConfigFile.filePath, 'utf8'); expect(fileContent2).toContain('OCO_MODEL=gpt-4'); diff --git a/test/unit/gemini.test.ts b/test/unit/gemini.test.ts index b11e374d..d7024f0b 100644 --- a/test/unit/gemini.test.ts +++ b/test/unit/gemini.test.ts @@ -1,4 +1,4 @@ -import { Gemini } from '../../src/engine/gemini'; +import { GeminiEngine } from '../../src/engine/gemini'; import { GenerativeModel, GoogleGenerativeAI } from '@google/generative-ai'; import { @@ -9,7 +9,7 @@ import { import { OpenAI } from 'openai'; describe('Gemini', () => { - let gemini: Gemini; + let gemini: GeminiEngine; let mockConfig: ConfigType; let mockGoogleGenerativeAi: GoogleGenerativeAI; let mockGenerativeModel: GenerativeModel; @@ -20,8 +20,8 @@ describe('Gemini', () => { const mockGemini = () => { mockConfig = getConfig() as ConfigType; - gemini = new Gemini({ - apiKey: mockConfig.OCO_GEMINI_API_KEY, + gemini = new GeminiEngine({ + apiKey: mockConfig.OCO_API_KEY, model: mockConfig.OCO_MODEL }); }; @@ -45,12 +45,10 @@ describe('Gemini', () => { mockConfig = getConfig() as ConfigType; mockConfig.OCO_AI_PROVIDER = OCO_AI_PROVIDER_ENUM.GEMINI; - mockConfig.OCO_GEMINI_API_KEY = 'mock-api-key'; + mockConfig.OCO_API_KEY = 'mock-api-key'; mockConfig.OCO_MODEL = 'gemini-1.5-flash'; - mockGoogleGenerativeAi = new GoogleGenerativeAI( - mockConfig.OCO_GEMINI_API_KEY - ); + mockGoogleGenerativeAi = new GoogleGenerativeAI(mockConfig.OCO_API_KEY); mockGenerativeModel = mockGoogleGenerativeAi.getGenerativeModel({ model: mockConfig.OCO_MODEL });