summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaindropsSys <contact@minteck.org>2023-08-07 18:41:17 +0200
committerRaindropsSys <contact@minteck.org>2023-08-07 18:41:17 +0200
commitce7217a5943b937f5d4a0dc79e213cf938f5d7d8 (patch)
treeac7e3aacdc8b9425c222beff759fff095f3fd314
downloadunicornshell-ce7217a5943b937f5d4a0dc79e213cf938f5d7d8.tar.gz
unicornshell-ce7217a5943b937f5d4a0dc79e213cf938f5d7d8.tar.bz2
unicornshell-ce7217a5943b937f5d4a0dc79e213cf938f5d7d8.zip
Initial commit
-rw-r--r--.gitignore1
-rw-r--r--.idea/.gitignore8
-rw-r--r--.idea/discord.xml7
-rw-r--r--.idea/jsLibraryMappings.xml6
-rw-r--r--.idea/modules.xml8
-rw-r--r--.idea/unicornshell.iml12
-rw-r--r--builtins/abort.js1
-rw-r--r--builtins/cd.js12
-rw-r--r--builtins/echo.js6
-rw-r--r--builtins/export.js16
-rw-r--r--builtins/unset.js14
-rw-r--r--builtins/version.js3
-rw-r--r--core/builtins.js12
-rw-r--r--core/history.js21
-rw-r--r--core/keyboard.js139
-rw-r--r--core/notfound.js16
-rw-r--r--core/parser.js300
-rw-r--r--core/prompt.js97
-rw-r--r--core/runtime.js41
-rw-r--r--core/shell.js36
-rw-r--r--core/ui.js46
-rw-r--r--index.js28
-rw-r--r--key.js30
-rw-r--r--node_modules/.package-lock.json210
-rw-r--r--node_modules/ansi-regex/index.d.ts37
-rw-r--r--node_modules/ansi-regex/index.js10
-rw-r--r--node_modules/ansi-regex/license9
-rw-r--r--node_modules/ansi-regex/package.json55
-rw-r--r--node_modules/ansi-regex/readme.md78
-rw-r--r--node_modules/ansi-styles/index.d.ts345
-rw-r--r--node_modules/ansi-styles/index.js163
-rw-r--r--node_modules/ansi-styles/license9
-rw-r--r--node_modules/ansi-styles/package.json56
-rw-r--r--node_modules/ansi-styles/readme.md152
-rw-r--r--node_modules/chalk/index.d.ts415
-rw-r--r--node_modules/chalk/license9
-rw-r--r--node_modules/chalk/package.json68
-rw-r--r--node_modules/chalk/readme.md341
-rw-r--r--node_modules/chalk/source/index.js229
-rw-r--r--node_modules/chalk/source/templates.js134
-rw-r--r--node_modules/chalk/source/util.js39
-rw-r--r--node_modules/cliui/CHANGELOG.md139
-rw-r--r--node_modules/cliui/LICENSE.txt14
-rw-r--r--node_modules/cliui/README.md141
-rw-r--r--node_modules/cliui/build/index.cjs302
-rw-r--r--node_modules/cliui/build/index.d.cts43
-rw-r--r--node_modules/cliui/build/lib/index.js287
-rw-r--r--node_modules/cliui/build/lib/string-utils.js27
-rw-r--r--node_modules/cliui/index.mjs13
-rw-r--r--node_modules/cliui/package.json83
-rw-r--r--node_modules/color-convert/CHANGELOG.md54
-rw-r--r--node_modules/color-convert/LICENSE21
-rw-r--r--node_modules/color-convert/README.md68
-rw-r--r--node_modules/color-convert/conversions.js839
-rw-r--r--node_modules/color-convert/index.js81
-rw-r--r--node_modules/color-convert/package.json48
-rw-r--r--node_modules/color-convert/route.js97
-rw-r--r--node_modules/color-name/LICENSE8
-rw-r--r--node_modules/color-name/README.md11
-rw-r--r--node_modules/color-name/index.js152
-rw-r--r--node_modules/color-name/package.json28
-rw-r--r--node_modules/emoji-regex/LICENSE-MIT.txt20
-rw-r--r--node_modules/emoji-regex/README.md73
-rw-r--r--node_modules/emoji-regex/es2015/index.js6
-rw-r--r--node_modules/emoji-regex/es2015/text.js6
-rw-r--r--node_modules/emoji-regex/index.d.ts23
-rw-r--r--node_modules/emoji-regex/index.js6
-rw-r--r--node_modules/emoji-regex/package.json50
-rw-r--r--node_modules/emoji-regex/text.js6
-rw-r--r--node_modules/escalade/dist/index.js22
-rw-r--r--node_modules/escalade/dist/index.mjs22
-rw-r--r--node_modules/escalade/index.d.ts3
-rw-r--r--node_modules/escalade/license9
-rw-r--r--node_modules/escalade/package.json61
-rw-r--r--node_modules/escalade/readme.md211
-rw-r--r--node_modules/escalade/sync/index.d.ts2
-rw-r--r--node_modules/escalade/sync/index.js18
-rw-r--r--node_modules/escalade/sync/index.mjs18
-rw-r--r--node_modules/fuse.js/CHANGELOG.md326
-rw-r--r--node_modules/fuse.js/LICENSE201
-rw-r--r--node_modules/fuse.js/README.md56
-rw-r--r--node_modules/fuse.js/dist/fuse.basic.common.js1467
-rw-r--r--node_modules/fuse.js/dist/fuse.basic.esm.js1261
-rw-r--r--node_modules/fuse.js/dist/fuse.basic.esm.min.js9
-rw-r--r--node_modules/fuse.js/dist/fuse.basic.js1473
-rw-r--r--node_modules/fuse.js/dist/fuse.basic.min.js9
-rw-r--r--node_modules/fuse.js/dist/fuse.common.js2234
-rw-r--r--node_modules/fuse.js/dist/fuse.d.ts313
-rw-r--r--node_modules/fuse.js/dist/fuse.esm.js1780
-rw-r--r--node_modules/fuse.js/dist/fuse.esm.min.js9
-rw-r--r--node_modules/fuse.js/dist/fuse.js2240
-rw-r--r--node_modules/fuse.js/dist/fuse.min.js9
-rw-r--r--node_modules/fuse.js/package.json104
-rw-r--r--node_modules/get-caller-file/LICENSE.md6
-rw-r--r--node_modules/get-caller-file/README.md41
-rw-r--r--node_modules/get-caller-file/index.d.ts2
-rw-r--r--node_modules/get-caller-file/index.js22
-rw-r--r--node_modules/get-caller-file/index.js.map1
-rw-r--r--node_modules/get-caller-file/package.json42
-rw-r--r--node_modules/has-flag/index.d.ts39
-rw-r--r--node_modules/has-flag/index.js8
-rw-r--r--node_modules/has-flag/license9
-rw-r--r--node_modules/has-flag/package.json46
-rw-r--r--node_modules/has-flag/readme.md89
-rw-r--r--node_modules/is-fullwidth-code-point/index.d.ts17
-rw-r--r--node_modules/is-fullwidth-code-point/index.js50
-rw-r--r--node_modules/is-fullwidth-code-point/license9
-rw-r--r--node_modules/is-fullwidth-code-point/package.json42
-rw-r--r--node_modules/is-fullwidth-code-point/readme.md39
-rw-r--r--node_modules/require-directory/.jshintrc67
-rw-r--r--node_modules/require-directory/.npmignore1
-rw-r--r--node_modules/require-directory/.travis.yml3
-rw-r--r--node_modules/require-directory/LICENSE22
-rw-r--r--node_modules/require-directory/README.markdown184
-rw-r--r--node_modules/require-directory/index.js86
-rw-r--r--node_modules/require-directory/package.json40
-rw-r--r--node_modules/string-width/index.d.ts29
-rw-r--r--node_modules/string-width/index.js47
-rw-r--r--node_modules/string-width/license9
-rw-r--r--node_modules/string-width/package.json56
-rw-r--r--node_modules/string-width/readme.md50
-rw-r--r--node_modules/strip-ansi/index.d.ts17
-rw-r--r--node_modules/strip-ansi/index.js4
-rw-r--r--node_modules/strip-ansi/license9
-rw-r--r--node_modules/strip-ansi/package.json54
-rw-r--r--node_modules/strip-ansi/readme.md46
-rw-r--r--node_modules/supports-color/browser.js5
-rw-r--r--node_modules/supports-color/index.js135
-rw-r--r--node_modules/supports-color/license9
-rw-r--r--node_modules/supports-color/package.json53
-rw-r--r--node_modules/supports-color/readme.md76
-rwxr-xr-xnode_modules/wrap-ansi/index.js216
-rw-r--r--node_modules/wrap-ansi/license9
-rw-r--r--node_modules/wrap-ansi/package.json62
-rw-r--r--node_modules/wrap-ansi/readme.md91
-rw-r--r--node_modules/y18n/CHANGELOG.md100
-rw-r--r--node_modules/y18n/LICENSE13
-rw-r--r--node_modules/y18n/README.md127
-rw-r--r--node_modules/y18n/build/index.cjs203
-rw-r--r--node_modules/y18n/build/lib/cjs.js6
-rw-r--r--node_modules/y18n/build/lib/index.js174
-rw-r--r--node_modules/y18n/build/lib/platform-shims/node.js19
-rw-r--r--node_modules/y18n/index.mjs8
-rw-r--r--node_modules/y18n/package.json70
-rw-r--r--node_modules/yargs-parser/CHANGELOG.md308
-rw-r--r--node_modules/yargs-parser/LICENSE.txt14
-rw-r--r--node_modules/yargs-parser/README.md518
-rw-r--r--node_modules/yargs-parser/browser.js29
-rw-r--r--node_modules/yargs-parser/build/index.cjs1050
-rw-r--r--node_modules/yargs-parser/build/lib/index.js62
-rw-r--r--node_modules/yargs-parser/build/lib/string-utils.js65
-rw-r--r--node_modules/yargs-parser/build/lib/tokenize-arg-string.js40
-rw-r--r--node_modules/yargs-parser/build/lib/yargs-parser-types.js12
-rw-r--r--node_modules/yargs-parser/build/lib/yargs-parser.js1045
-rw-r--r--node_modules/yargs-parser/package.json92
-rw-r--r--node_modules/yargs/LICENSE21
-rw-r--r--node_modules/yargs/README.md204
-rw-r--r--node_modules/yargs/browser.d.ts5
-rw-r--r--node_modules/yargs/browser.mjs7
-rw-r--r--node_modules/yargs/build/index.cjs1
-rw-r--r--node_modules/yargs/build/lib/argsert.js62
-rw-r--r--node_modules/yargs/build/lib/command.js449
-rw-r--r--node_modules/yargs/build/lib/completion-templates.js48
-rw-r--r--node_modules/yargs/build/lib/completion.js243
-rw-r--r--node_modules/yargs/build/lib/middleware.js88
-rw-r--r--node_modules/yargs/build/lib/parse-command.js32
-rw-r--r--node_modules/yargs/build/lib/typings/common-types.js9
-rw-r--r--node_modules/yargs/build/lib/typings/yargs-parser-types.js1
-rw-r--r--node_modules/yargs/build/lib/usage.js584
-rw-r--r--node_modules/yargs/build/lib/utils/apply-extends.js59
-rw-r--r--node_modules/yargs/build/lib/utils/is-promise.js5
-rw-r--r--node_modules/yargs/build/lib/utils/levenshtein.js34
-rw-r--r--node_modules/yargs/build/lib/utils/maybe-async-result.js17
-rw-r--r--node_modules/yargs/build/lib/utils/obj-filter.js10
-rw-r--r--node_modules/yargs/build/lib/utils/process-argv.js17
-rw-r--r--node_modules/yargs/build/lib/utils/set-blocking.js12
-rw-r--r--node_modules/yargs/build/lib/utils/which-module.js10
-rw-r--r--node_modules/yargs/build/lib/validation.js305
-rw-r--r--node_modules/yargs/build/lib/yargs-factory.js1512
-rw-r--r--node_modules/yargs/build/lib/yerror.js9
-rw-r--r--node_modules/yargs/helpers/helpers.mjs10
-rw-r--r--node_modules/yargs/helpers/index.js14
-rw-r--r--node_modules/yargs/helpers/package.json3
-rw-r--r--node_modules/yargs/index.cjs53
-rw-r--r--node_modules/yargs/index.mjs8
-rw-r--r--node_modules/yargs/lib/platform-shims/browser.mjs95
-rw-r--r--node_modules/yargs/lib/platform-shims/esm.mjs73
-rw-r--r--node_modules/yargs/locales/be.json46
-rw-r--r--node_modules/yargs/locales/cs.json51
-rw-r--r--node_modules/yargs/locales/de.json46
-rw-r--r--node_modules/yargs/locales/en.json55
-rw-r--r--node_modules/yargs/locales/es.json46
-rw-r--r--node_modules/yargs/locales/fi.json49
-rw-r--r--node_modules/yargs/locales/fr.json53
-rw-r--r--node_modules/yargs/locales/hi.json49
-rw-r--r--node_modules/yargs/locales/hu.json46
-rw-r--r--node_modules/yargs/locales/id.json50
-rw-r--r--node_modules/yargs/locales/it.json46
-rw-r--r--node_modules/yargs/locales/ja.json51
-rw-r--r--node_modules/yargs/locales/ko.json49
-rw-r--r--node_modules/yargs/locales/nb.json44
-rw-r--r--node_modules/yargs/locales/nl.json49
-rw-r--r--node_modules/yargs/locales/nn.json44
-rw-r--r--node_modules/yargs/locales/pirate.json13
-rw-r--r--node_modules/yargs/locales/pl.json49
-rw-r--r--node_modules/yargs/locales/pt.json45
-rw-r--r--node_modules/yargs/locales/pt_BR.json48
-rw-r--r--node_modules/yargs/locales/ru.json51
-rw-r--r--node_modules/yargs/locales/th.json46
-rw-r--r--node_modules/yargs/locales/tr.json48
-rw-r--r--node_modules/yargs/locales/uk_UA.json51
-rw-r--r--node_modules/yargs/locales/uz.json52
-rw-r--r--node_modules/yargs/locales/zh_CN.json48
-rw-r--r--node_modules/yargs/locales/zh_TW.json51
-rw-r--r--node_modules/yargs/package.json123
-rw-r--r--node_modules/yargs/yargs9
-rw-r--r--node_modules/yargs/yargs.mjs10
-rw-r--r--package-lock.json217
-rw-r--r--package.json7
-rwxr-xr-xunish2
220 files changed, 29163 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..30d74d2
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+test \ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..13566b8
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/discord.xml b/.idea/discord.xml
new file mode 100644
index 0000000..d8e9561
--- /dev/null
+++ b/.idea/discord.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="DiscordProjectSettings">
+ <option name="show" value="PROJECT_FILES" />
+ <option name="description" value="" />
+ </component>
+</project> \ No newline at end of file
diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml
new file mode 100644
index 0000000..d23208f
--- /dev/null
+++ b/.idea/jsLibraryMappings.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="JavaScriptLibraryMappings">
+ <includedPredefinedLibrary name="Node.js Core" />
+ </component>
+</project> \ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..629d62b
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="ProjectModuleManager">
+ <modules>
+ <module fileurl="file://$PROJECT_DIR$/.idea/unicornshell.iml" filepath="$PROJECT_DIR$/.idea/unicornshell.iml" />
+ </modules>
+ </component>
+</project> \ No newline at end of file
diff --git a/.idea/unicornshell.iml b/.idea/unicornshell.iml
new file mode 100644
index 0000000..24643cc
--- /dev/null
+++ b/.idea/unicornshell.iml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+ <component name="NewModuleRootManager">
+ <content url="file://$MODULE_DIR$">
+ <excludeFolder url="file://$MODULE_DIR$/.tmp" />
+ <excludeFolder url="file://$MODULE_DIR$/temp" />
+ <excludeFolder url="file://$MODULE_DIR$/tmp" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ </component>
+</module> \ No newline at end of file
diff --git a/builtins/abort.js b/builtins/abort.js
new file mode 100644
index 0000000..48a59e9
--- /dev/null
+++ b/builtins/abort.js
@@ -0,0 +1 @@
+module.exports = (_1, _2) => {} \ No newline at end of file
diff --git a/builtins/cd.js b/builtins/cd.js
new file mode 100644
index 0000000..8370140
--- /dev/null
+++ b/builtins/cd.js
@@ -0,0 +1,12 @@
+const path = require('path');
+const fs = require("fs");
+
+module.exports = (parameters, output) => {
+ if (fs.existsSync(path.resolve(parameters[0] ?? global.env.HOME))) {
+ global.directory = path.resolve(parameters[0] ?? global.env.HOME);
+ process.chdir(directory);
+ refreshPS1();
+ } else {
+ error("No such file or directory: " + path.resolve(parameters[0] ?? global.env.HOME));
+ }
+} \ No newline at end of file
diff --git a/builtins/echo.js b/builtins/echo.js
new file mode 100644
index 0000000..4fd8897
--- /dev/null
+++ b/builtins/echo.js
@@ -0,0 +1,6 @@
+const path = require('path');
+const fs = require("fs");
+
+module.exports = (parameters, output) => {
+ output(parameters.join(" "));
+} \ No newline at end of file
diff --git a/builtins/export.js b/builtins/export.js
new file mode 100644
index 0000000..598a6d5
--- /dev/null
+++ b/builtins/export.js
@@ -0,0 +1,16 @@
+const path = require('path');
+const fs = require("fs");
+
+module.exports = (parameters, output) => {
+ if (parameters[0]) {
+ if (parameters[0].trim().replace(/^[a-zA-Z\d_]+$/gm, "") !== "") {
+ error("Variable names can only contain alphanumeric characters and underscores.");
+ } else {
+ global.env[parameters[0]] = parameters[1];
+ }
+ } else {
+ for (let name of Object.keys(global.env)) {
+ output(name + "=" + global.env[name]);
+ }
+ }
+} \ No newline at end of file
diff --git a/builtins/unset.js b/builtins/unset.js
new file mode 100644
index 0000000..e34783c
--- /dev/null
+++ b/builtins/unset.js
@@ -0,0 +1,14 @@
+const path = require('path');
+const fs = require("fs");
+
+module.exports = (parameters, output) => {
+ if (parameters[0]) {
+ if (parameters[0].trim().replace(/^[a-zA-Z\d_]+$/gm, "") !== "") {
+ error("Variable names can only contain alphanumeric characters and underscores.");
+ } else {
+ delete global.env[parameters[0]];
+ }
+ } else {
+ error("Cannot unset all variables.");
+ }
+} \ No newline at end of file
diff --git a/builtins/version.js b/builtins/version.js
new file mode 100644
index 0000000..9864a93
--- /dev/null
+++ b/builtins/version.js
@@ -0,0 +1,3 @@
+module.exports = (parameters, output) => {
+ output("Unicorn Shell (unish) version " + version + " (" + process.platform + ", " + process.arch + ")");
+} \ No newline at end of file
diff --git a/core/builtins.js b/core/builtins.js
new file mode 100644
index 0000000..8d55754
--- /dev/null
+++ b/core/builtins.js
@@ -0,0 +1,12 @@
+module.exports = {
+ cd: require('../builtins/cd'),
+ export: require('../builtins/export'),
+ version: require('../builtins/version'),
+ abort: require('../builtins/abort'),
+ echo: require('../builtins/echo'),
+ unset: require('../builtins/unset')
+}
+
+global.parametersToAdd = {
+ ls: ["-G", "--color=auto"]
+} \ No newline at end of file
diff --git a/core/history.js b/core/history.js
new file mode 100644
index 0000000..6206598
--- /dev/null
+++ b/core/history.js
@@ -0,0 +1,21 @@
+const fs = require('fs');
+
+global.historyWrite = (str) => {
+ try {
+ let current = historyRead();
+ if (current[1] === str) return true;
+
+ fs.appendFileSync(process.env.HOME + "/.unish/history.txt", "\n" + str);
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+global.historyRead = () => {
+ try {
+ return ["", ...fs.readFileSync(process.env.HOME + "/.unish/history.txt").toString().trim().split("\n").reverse()];
+ } catch (e) {
+ return [""];
+ }
+} \ No newline at end of file
diff --git a/core/keyboard.js b/core/keyboard.js
new file mode 100644
index 0000000..5c6204d
--- /dev/null
+++ b/core/keyboard.js
@@ -0,0 +1,139 @@
+const readline = require('readline');
+readline.emitKeypressEvents(process.stdin);
+
+global.historyPosition = 0;
+
+global.upKey = () => {
+ if (buf.trim() !== "" && historyPosition === 0) return;
+ let history = historyRead();
+
+ if (global.historyPosition < history.length - 1) {
+ global.historyPosition++;
+ buf = history[global.historyPosition];
+ cursor = ps1.length + buf.length;
+ refreshLine();
+ }
+}
+
+global.downKey = () => {
+ if (buf.trim() !== "" && historyPosition === 0) return;
+ let history = historyRead();
+
+ if (global.historyPosition > 0) {
+ global.historyPosition--;
+ buf = history[global.historyPosition];
+ cursor = ps1.length + buf.length;
+ refreshLine();
+ }
+}
+
+global.home = () => {
+ cursor = ps1.length;
+ refreshLine();
+}
+
+global.end = () => {
+ cursor = ps1.length + buf.length;
+ refreshLine();
+}
+
+global.leftKey = () => {
+ if (cursor > ps1.length) {
+ cursor--;
+ refreshLine();
+ }
+}
+
+global.rightKey = () => {
+ if (cursor < buf.length + ps1.length) {
+ cursor++;
+ refreshLine();
+ }
+}
+
+global.backspace = () => {
+ if (buf.length > 0) {
+ buf = buf.substring(0, cursor - ps1.length - 1) + buf.substring(cursor - ps1.length);
+ cursor--;
+ refreshLine();
+ }
+}
+
+global.wordBackspace = () => {
+ if (buf.length > 0) {
+ let textBefore = buf.substring(0, cursor - ps1.length - 1);
+ let wordSize = 0;
+
+ for (let pos = cursor - ps1.length; pos > 0; pos--) {
+ if (delimiters.includes(textBefore.charAt(pos))) {
+ wordSize = (cursor - ps1.length) - pos - 1;
+ break;
+ }
+ }
+
+ if (wordSize > 0) {
+ buf = buf.substring(0, cursor - ps1.length - wordSize) + buf.substring(cursor - ps1.length);
+ cursor -= wordSize;
+ } else {
+ buf = "";
+ cursor = ps1.length;
+ }
+
+ refreshLine();
+ }
+}
+
+global.del = () => {
+ buf = buf.substring(0, cursor - ps1.length) + buf.substring(cursor - ps1.length + 1);
+ refreshLine();
+}
+
+global.leftWord = () => {
+ let textBefore = buf.substring(0, cursor - ps1.length - 1);
+ let updated = false;
+
+ for (let pos = cursor - ps1.length; pos > 0; pos--) {
+ if (delimiters.includes(textBefore.charAt(pos))) {
+ cursor = pos + ps1.length + 1;
+ updated = true;
+ break;
+ }
+ }
+
+ if (!updated) {
+ cursor = ps1.length;
+ }
+
+ refreshLine();
+}
+
+global.rightWord = () => {
+ let textAfter = buf.substring(cursor - ps1.length);
+ let updated = false;
+
+ for (let pos = 0; pos < textAfter.length; pos++) {
+ if (delimiters.includes(textAfter.charAt(pos))) {
+ cursor = pos + (cursor - ps1.length) + 3;
+ updated = true;
+ break;
+ }
+ }
+
+ if (!updated) {
+ cursor = ps1.length + buf.length;
+ }
+
+ refreshLine();
+}
+
+global.tab = () => {
+
+}
+
+global.nextKey = () => {
+ return new Promise((res) => {
+ process.stdin.once('keypress', (ch, key) => {
+ res(key);
+ });
+ });
+} \ No newline at end of file
diff --git a/core/notfound.js b/core/notfound.js
new file mode 100644
index 0000000..0438fec
--- /dev/null
+++ b/core/notfound.js
@@ -0,0 +1,16 @@
+const Fuse = require('fuse.js');
+
+let list = [...new Set([...Object.keys(require('./builtins')), ...getCommands().map(i => require('path').basename(i))])];
+const fuse = new Fuse(list)
+
+global.notFound = (command) => {
+ let results1 = fuse.search(command).map(i => i.item).filter(i => i.length === command.length);
+ let results2 = fuse.search(command).map(i => i.item).filter(i => i.length !== command.length);
+ let results = [...results1, ...results2];
+
+ if (results.length > 0) {
+ error("Command not found: " + command + ". Did you mean \"" + results[0] + "\"?");
+ } else {
+ error("Command not found: " + command);
+ }
+} \ No newline at end of file
diff --git a/core/parser.js b/core/parser.js
new file mode 100644
index 0000000..d1c52d0
--- /dev/null
+++ b/core/parser.js
@@ -0,0 +1,300 @@
+require('./runtime');
+require('./notfound');
+const nodePath = require('path');
+const fs = require('fs');
+const chalk = require('chalk');
+
+let builtins = require('./builtins');
+
+function yesNo(def) {
+ return new Promise((res) => {
+ process.stdin.setRawMode(true);
+ process.stdin.resume();
+ process.stdin.setEncoding('utf8');
+
+ let listener = (ch, key) => {
+ if (key.sequence === "y" || key.sequence === "Y") {
+ process.stdin.removeListener('keypress', listener);
+ process.stdout.write(key.sequence + "\n");
+ res(true);
+ } else if (key.sequence === "n" || key.sequence === "N") {
+ process.stdin.removeListener('keypress', listener);
+ process.stdout.write(key.sequence + "\n");
+ res(false);
+ } else if (key.sequence === "\r" || key.sequence === "\n" || key.sequence === " ") {
+ process.stdin.removeListener('keypress', listener);
+ process.stdout.write("\n");
+ res(def);
+ }
+ };
+
+ process.stdin.addListener('keypress', listener);
+ });
+}
+
+function substituteVariables(str) {
+ for (let name of Object.keys(global.env)) {
+ str = str.replace(new RegExp("(?<!\\\\)\\$" + name + "\\b", "g"), global.env[name]);
+ }
+
+ str = str.replace(/(?<!\\)\$[a-zA-Z\d_]+\b/g, "");
+
+ return str;
+}
+
+function scandir(dir, recursive) {
+ let list = [];
+
+ if (fs.existsSync(dir)) {
+ for (let file of fs.readdirSync(dir)) {
+ if (recursive) {
+ if (fs.existsSync(dir + "/" + file) && fs.statSync(dir + "/" + file).isDirectory()) {
+ list.push(dir + "/" + file);
+ list.push(...scandir(dir + "/" + file, true));
+ } else if (fs.existsSync(dir + "/" + file)) {
+ list.push(dir + "/" + file);
+ }
+ } else {
+ list.push(dir + "/" + file);
+ }
+ }
+ } else {
+ return [dir];
+ }
+
+ return list;
+}
+
+async function expendWildcards(parameter, ignoreWarning) {
+ if (parameter.includes("**") || parameter.includes("*")) {
+ let parts = parameter.replace(/(.*)(?<!\\)\*(.*)/g, "$1\t$2").split("\t");
+ let recursive = false;
+
+ if (parameter.includes("**")) {
+ parts = parameter.replace(/(.*)(?<!\\)\*\*(.*)/g, "$1\t$2").split("\t");
+ recursive = true;
+ }
+
+ if (parts.length !== 2) {
+ return [parameter];
+ } else {
+ let start = parts[0];
+ let end = parts[1];
+ let directory;
+
+ if (start.endsWith("/")) {
+ directory = start;
+ } else {
+ directory = nodePath.dirname(start);
+ }
+
+ let allow;
+
+ if (ignoreWarning) {
+ allow = true;
+ } else {
+ if (start.trim() !== "" && end.trim() === "") {
+ process.stdout.write(chalk.yellow("Warning: ") + "The wildcard will expand to match all the files in " + nodePath.resolve(directory) + (recursive ? " recursively, " : "") + " starting with \"" + start + "\", expand? (y/N)");
+ } else if (start.trim() === "" && end.trim() !== "") {
+ process.stdout.write(chalk.yellow("Warning: ") + "The wildcard will expand to match all the files in " + nodePath.resolve(directory) + (recursive ? " recursively, " : "") + " ending with \"" + end + "\", expand? (y/N)");
+ } else if (start.trim() !== "" && end.trim() !== "") {
+ process.stdout.write(chalk.yellow("Warning: ") + "The wildcard will expand to match all the files in " + nodePath.resolve(directory) + (recursive ? " recursively, " : "") + " starting with \"" + start + "\" and ending with \"" + end + "\", expand? (y/N)");
+ } else {
+ process.stdout.write(chalk.yellow("Warning: ") + "The wildcard will expand to match all the files in " + nodePath.resolve(directory) + (recursive ? " recursively" : "") + ", expand? (y/N)");
+ }
+
+ allow = await yesNo(false);
+ }
+
+ if (allow) {
+ return scandir(directory, recursive).filter(i => {
+ if (i.startsWith("./")) {
+ return i.substring(2).startsWith(start) && i.substring(2).endsWith(end)
+ } else {
+ return i.startsWith(start) && i.endsWith(end)
+ }
+ });
+ } else {
+ return null;
+ }
+ }
+ }
+
+ return [parameter];
+}
+
+function baseParse(str) {
+ let result = [];
+
+ let regex = /((([\w\-\/_()[\]{}!@$~*.]|\\ )+)|("(.*?)")|('(.*?)'))/g;
+ let groups = [2, 4, 6];
+ let match;
+
+ while ((match = regex.exec(str)) !== null) {
+ if (match.index === regex.lastIndex) {
+ regex.lastIndex++;
+ }
+
+ groups.forEach(function(group) {
+ if (match[group]) {
+ result.push(match[group]);
+ }
+ });
+ }
+
+ return result;
+}
+
+async function parse(str) {
+ let argv = baseParse(substituteVariables(str));
+ let command = argv[0];
+ let parameters = [];
+ let runCommand = true;
+
+ for (let initial of argv.slice(1).map(i => i.replaceAll("\\", "").replace(/^('|")(.*)('|")$/gm, "$2"))) {
+ let i = initial;
+ let list = [i];
+ let expend = i.replace(/(.*)(?<!\\)\*(.*)/g, "$1\t$2").replace(/(.*)(?<!\\)\*\*(.*)/g, "$1\t$2").includes("\t");
+
+ while (expend) {
+ let newList = [];
+
+ for (let item of list) {
+ let expanded = await expendWildcards(item);
+
+ if (expanded) {
+ newList.push(...expanded);
+ } else {
+ runCommand = false;
+ }
+ }
+
+ list = newList;
+ expend = false;
+
+ for (let i of list) {
+ if (expend) break;
+ expend = i.replace(/(.*)(?<!\\)\*(.*)/g, "$1\t$2").replace(/(.*)(?<!\\)\*\*(.*)/g, "$1\t$2").includes("\t");
+ }
+ }
+
+ parameters.push(...list.map(i => i.replaceAll("\\*", "*")));
+ }
+
+ if (runCommand) {
+ return {
+ command,
+ parameters
+ };
+ } else {
+ return {
+ command: "abort",
+ parameters: []
+ };
+ }
+}
+
+global.processLine = async (str, writeToHistory) => {
+ if (!!str.match(/foreach (.*) {(.*)}/gm)) {
+ if (writeToHistory) historyWrite(str);
+ let parts = str.replace(/foreach (.*) {(.*)}/gm, "$1\t$2").split("\t");
+
+ let list = await expendWildcards(parts[0], true);
+ let valueBefore = global.env.it;
+
+ for (let item of list) {
+ global.env.it = item;
+ await processLine(parts[1], false);
+ global.env.it = valueBefore;
+ }
+ } else if (!!str.match(/forever {(.*)}/gm)) {
+ if (writeToHistory) historyWrite(str);
+ let parts = str.replace(/forever {(.*)}/gm, "$1").split("\t");
+
+ while (true) {
+ await processLine(parts[0], false);
+ }
+ } else if (!!str.match(/save (.*) {(.*)}/gm)) {
+ if (writeToHistory) historyWrite(str);
+ let parts = str.replace(/save (.*) {(.*)}/gm, "$1\t$2").split("\t");
+ let variable = parts[0];
+
+ if (variable.trim().replace(/^[a-zA-Z\d_]+$/gm, "") !== "") {
+ error("Variable names can only contain alphanumeric characters and underscores.");
+ return;
+ }
+
+ global.env[variable] = await execute(parts[1], false, true);
+ } else {
+ let list = str.split(";").filter(i => i.trim() !== "");
+
+ for (let item of list) {
+ await execute(item, writeToHistory);
+ }
+ }
+}
+
+global.execute = async (str, writeToHistory, returnOutput) => {
+ if (writeToHistory) historyWrite(str);
+ let parsed = await parse(str);
+
+ if (global.parametersToAdd[parsed.command]) {
+ parsed.parameters.unshift(...global.parametersToAdd[parsed.command]);
+ }
+
+ if (builtins[parsed.command]) {
+ let output;
+ let out = "";
+
+ if (returnOutput) {
+
+ output = (text) => {
+ out += text + "\n";
+ }
+ } else {
+ output = (text) => {
+ console.log(text);
+ }
+ }
+
+ builtins[parsed.command](parsed.parameters, output);
+
+ if (returnOutput) {
+ return out;
+ }
+ } else {
+ let executable = resolve(parsed.command);
+
+ if (executable) {
+ if (fs.existsSync(executable)) {
+ if (returnOutput) {
+ let proc = require('child_process').spawnSync(executable, parsed.parameters, {
+ argv0: parsed.command,
+ cwd: global.directory,
+ env: global.env,
+ windowsHide: true,
+ windowsVerbatimArguments: true,
+ shell: false,
+ stdio: ["ignore", "pipe", "inherit"]
+ });
+
+ return proc.stdout;
+ } else {
+ require('child_process').spawnSync(executable, parsed.parameters, {
+ argv0: parsed.command,
+ cwd: global.directory,
+ env: global.env,
+ windowsHide: true,
+ windowsVerbatimArguments: true,
+ shell: false,
+ stdio: "inherit"
+ });
+ }
+ } else {
+ notFound(parsed.command);
+ }
+ } else {
+ notFound(parsed.command);
+ }
+ }
+} \ No newline at end of file
diff --git a/core/prompt.js b/core/prompt.js
new file mode 100644
index 0000000..b8e6c60
--- /dev/null
+++ b/core/prompt.js
@@ -0,0 +1,97 @@
+require('./parser');
+const chalk = require("chalk");
+
+global.refreshPS1 = () => {
+ if (directory.startsWith(global.env.HOME)) {
+ let directory = global.directory.substring(global.env.HOME.length);
+ let parts = directory.split("/");
+
+ if (parts.length > 4) {
+ directory = parts[0] + "/" + parts[1] + "/…/" + parts[parts.length - 1];
+ }
+
+ global.ps1 = "US ~" + directory + "> ";
+ global.ps1color = "🦄 " + chalk.yellow("~") + chalk.green(directory) + "> ";
+ } else {
+ let directory = global.directory;
+ let parts = directory.split("/");
+
+ if (parts.length > 4) {
+ directory = parts[0] + "/" + parts[1] + "/…/" + parts[parts.length - 1];
+ }
+
+ global.ps1 = "US " + directory + "> ";
+ global.ps1color = "🦄 " + chalk.green(directory) + "> ";
+ }
+}
+
+global.prompt = async () => {
+ global.buf = "";
+ global.cursor = ps1.length;
+
+ process.stdin.setRawMode(true);
+ process.stdin.resume();
+ process.stdin.setEncoding('utf8');
+
+ process.stdout.write(ps1color);
+ let input = true;
+
+ global.inputHandler = async (char, key) => {
+ if (key.sequence === "\x03") {
+ historyPosition = 0;
+ process.stdout.write("\n");
+ global.buf = "";
+ global.cursor = ps1.length;
+ refreshLine();
+ } else if (key.sequence === "\x04") {
+ process.stdout.write("\n");
+ process.exit();
+ } else if (key.sequence === "\n" || key.sequence === "\r") {
+ historyPosition = 0;
+ refreshLine(true);
+ process.stdout.write("\n");
+
+ process.stdin.removeListener('keypress', inputHandler);
+ process.stdin.setRawMode(false);
+ process.stdin.pause();
+
+ await processLine(buf, true);
+
+ prompt();
+ } else if (key.sequence === "\x1B[A" || key.sequence === "\x1B\x1B[A" || key.sequence === "\x1B[1;9A" || key.sequence === "\x1B[1;2A") {
+ upKey();
+ } else if (key.sequence === "\x1B[B" || key.sequence === "\x1B\x1B[B" || key.sequence === "\x1B[1;9B" || key.sequence === "\x1B[1;2B") {
+ downKey();
+ } else if (key.sequence === "\x1B[D" || key.sequence === "\x1B[1;2D") {
+ leftKey();
+ } else if (key.sequence === "\x1B[1;9D" || key.sequence === "\x1Bb") {
+ leftWord();
+ } else if (key.sequence === "\x1B[1;9C" || key.sequence === "\x1Bf") {
+ rightWord();
+ } else if (key.sequence === "\x1B[C" || key.sequence === "\x1B[1;2C") {
+ rightKey();
+ } else if (key.sequence === "\x7F") {
+ backspace();
+ } else if (key.sequence === "\x1B\x7F") {
+ wordBackspace();
+ } else if (key.sequence === "\x1B[3~") {
+ del();
+ } else if (key.sequence === "\x1B[H") {
+ home();
+ } else if (key.sequence === "\x1B[F") {
+ end();
+ } else if (key.sequence === "\t") {
+ tab();
+ } else if (key.sequence === "\f") {
+ console.clear();
+ refreshLine();
+ } else if (!key.control && !key.meta) {
+ historyPosition = 0;
+ global.buf = buf.substring(0, cursor - ps1.length) + key.sequence + buf.substring(cursor - ps1.length);
+ cursor++;
+ refreshLine();
+ }
+ }
+
+ process.stdin.addListener('keypress', inputHandler);
+} \ No newline at end of file
diff --git a/core/runtime.js b/core/runtime.js
new file mode 100644
index 0000000..11742dc
--- /dev/null
+++ b/core/runtime.js
@@ -0,0 +1,41 @@
+const nodePath = require('path');
+const fs = require('fs');
+
+global.resolve = (command) => {
+ let commands = getCommands();
+
+ let resolved = null;
+
+ for (let file of commands) {
+ if (nodePath.basename(file) === command) {
+ if (fs.lstatSync(file).isSymbolicLink()) {
+ try {
+ resolved = fs.realpathSync(file);
+ break;
+ } catch (e) {}
+ } else {
+ resolved = file;
+ break;
+ }
+ }
+ }
+
+ return resolved;
+}
+
+global.getCommands = () => {
+ let path = (process.env ?? global.env).PATH.split(":");
+ let commands = [];
+
+ for (let dir of path) {
+ try {
+ let list = fs.readdirSync(dir);
+
+ for (let file of list) {
+ commands.push(dir + "/" + file);
+ }
+ } catch (e) {}
+ }
+
+ return commands;
+} \ No newline at end of file
diff --git a/core/shell.js b/core/shell.js
new file mode 100644
index 0000000..b3497d0
--- /dev/null
+++ b/core/shell.js
@@ -0,0 +1,36 @@
+const fs = require('fs');
+
+process.on('SIGINT', () => {
+
+});
+
+try {
+ if (!fs.existsSync(process.env.HOME + "/.unish")) fs.mkdirSync(process.env.HOME + "/.unish");
+} catch (e) {
+ console.log(require('chalk').red("Error: ") + "Unable to create " + process.env.HOME + "/.unish, configuration and history saving are disabled.");
+}
+
+try {
+ if (!fs.existsSync(process.env.HOME + "/.unish/history.txt")) fs.writeFileSync(process.env.HOME + "/.unish/history.txt", "");
+} catch (e) {
+ console.log(require('chalk').red("Error: ") + "Unable to create " + process.env.HOME + "/.unish/history.txt, configuration and history saving are disabled.");
+}
+
+require('./history');
+require('./keyboard');
+require('./ui');
+require('./prompt');
+
+console.log("Welcome to Unicorn Shell, the modern pony shell.\n© 2023 Equestria.dev Developers\n");
+
+process.env["SHELL"] = process.argv0;
+
+global.directory = process.cwd();
+global.env = process.env;
+
+global.delimiters = [" ", ",", ".", "-", "_"];
+refreshPS1();
+global.cursor = 0;
+global.buf = "";
+
+prompt(); \ No newline at end of file
diff --git a/core/ui.js b/core/ui.js
new file mode 100644
index 0000000..9f80dcb
--- /dev/null
+++ b/core/ui.js
@@ -0,0 +1,46 @@
+const chalk = require('chalk');
+
+global.error = (text) => {
+ console.log(chalk.red("Error:") + " " + text);
+}
+
+global.warning = (text) => {
+ console.log(chalk.yellow("Warning:") + " " + text);
+}
+
+global.refreshLine = (final) => {
+ process.stdout.clearLine();
+ process.stdout.cursorTo(0);
+
+ if (ps1.length + buf.length >= process.stdout.columns) {
+ if (buf.length >= process.stdout.columns) {
+ let start = buf.length - (process.stdout.columns - 3);
+
+ if ((cursor - ps1.length - Math.round(process.stdout.columns / 2)) - start > 1) {
+ process.stdout.write(chalk.gray("…") + buf.substr(start, process.stdout.columns - 2));
+ process.stdout.cursorTo((cursor - ps1.length + 1) - start);
+ } else if (start === 0) {
+ process.stdout.write(" " + buf.substr(start, process.stdout.columns - 3) + chalk.gray("…"));
+ process.stdout.cursorTo((cursor - ps1.length + 1) - start);
+ } else {
+ while ((cursor - ps1.length - Math.round(process.stdout.columns / 2)) - start <= 1 && start > 0) {
+ start--;
+ }
+
+ if (start === 0) {
+ process.stdout.write(" " + buf.substr(start, process.stdout.columns - 3) + chalk.gray("…"));
+ process.stdout.cursorTo((cursor - ps1.length + 1) - start);
+ } else {
+ process.stdout.write(chalk.gray("…") + buf.substr(start, process.stdout.columns - 3) + chalk.gray("…"));
+ process.stdout.cursorTo((cursor - ps1.length + 1) - start);
+ }
+ }
+ } else {
+ process.stdout.write(chalk.gray("…") + buf);
+ process.stdout.cursorTo(cursor - ps1.length + 1);
+ }
+ } else {
+ process.stdout.write(ps1color + buf);
+ process.stdout.cursorTo(cursor);
+ }
+} \ No newline at end of file
diff --git a/index.js b/index.js
new file mode 100644
index 0000000..413fb73
--- /dev/null
+++ b/index.js
@@ -0,0 +1,28 @@
+global.version = "0.1";
+
+const yargs = require('yargs/yargs')()
+ .scriptName(process.argv0)
+ .usage('$0 [<options>] [<argument> ...]')
+ .version(false)
+ .options({
+ 'version': {
+ alias: 'v',
+ type: 'boolean',
+ description: 'Shows version number'
+ }
+ })
+ .help();
+
+yargs.parse(process.argv, function yargsCallback(err, args, output) {
+ if (output) {
+ output = output.replace(/\[\w+\]/g, '');
+ console.log(output);
+ return;
+ }
+
+ if (args.version) {
+ console.log("unish " + version);
+ } else {
+ require('./core/shell');
+ }
+}); \ No newline at end of file
diff --git a/key.js b/key.js
new file mode 100644
index 0000000..04a684d
--- /dev/null
+++ b/key.js
@@ -0,0 +1,30 @@
+const chalk = require('chalk');
+const readline = require('readline');
+
+readline.emitKeypressEvents(process.stdin);
+
+function nextKey() {
+ return new Promise((res) => {
+ process.stdin.once('keypress', (ch, key) => {
+ res(key);
+ });
+ });
+}
+
+async function prompt() {
+ process.stdin.setRawMode(true);
+ process.stdin.resume();
+ process.stdin.setEncoding('utf8');
+
+ while (true) {
+ let key = await nextKey();
+ console.log(key);
+
+ if (key.sequence === "\x03") {
+ process.stdout.write("\n");
+ process.exit();
+ }
+ }
+}
+
+prompt(); \ No newline at end of file
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
new file mode 100644
index 0000000..57f089f
--- /dev/null
+++ b/node_modules/.package-lock.json
@@ -0,0 +1,210 @@
+{
+ "name": "unicornshell",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/cliui": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
+ "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.1",
+ "wrap-ansi": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
+ },
+ "node_modules/escalade": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/fuse.js": {
+ "version": "6.6.2",
+ "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz",
+ "integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "engines": {
+ "node": "6.* || 8.* || >= 10.*"
+ }
+ },
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/yargs": {
+ "version": "17.7.2",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
+ "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
+ "dependencies": {
+ "cliui": "^8.0.1",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.3",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^21.1.1"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/yargs-parser": {
+ "version": "21.1.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
+ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
+ "engines": {
+ "node": ">=12"
+ }
+ }
+ }
+}
diff --git a/node_modules/ansi-regex/index.d.ts b/node_modules/ansi-regex/index.d.ts
new file mode 100644
index 0000000..2dbf6af
--- /dev/null
+++ b/node_modules/ansi-regex/index.d.ts
@@ -0,0 +1,37 @@
+declare namespace ansiRegex {
+ interface Options {
+ /**
+ Match only the first ANSI escape.
+
+ @default false
+ */
+ onlyFirst: boolean;
+ }
+}
+
+/**
+Regular expression for matching ANSI escape codes.
+
+@example
+```
+import ansiRegex = require('ansi-regex');
+
+ansiRegex().test('\u001B[4mcake\u001B[0m');
+//=> true
+
+ansiRegex().test('cake');
+//=> false
+
+'\u001B[4mcake\u001B[0m'.match(ansiRegex());
+//=> ['\u001B[4m', '\u001B[0m']
+
+'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
+//=> ['\u001B[4m']
+
+'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
+//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
+```
+*/
+declare function ansiRegex(options?: ansiRegex.Options): RegExp;
+
+export = ansiRegex;
diff --git a/node_modules/ansi-regex/index.js b/node_modules/ansi-regex/index.js
new file mode 100644
index 0000000..616ff83
--- /dev/null
+++ b/node_modules/ansi-regex/index.js
@@ -0,0 +1,10 @@
+'use strict';
+
+module.exports = ({onlyFirst = false} = {}) => {
+ const pattern = [
+ '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
+ '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
+ ].join('|');
+
+ return new RegExp(pattern, onlyFirst ? undefined : 'g');
+};
diff --git a/node_modules/ansi-regex/license b/node_modules/ansi-regex/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/ansi-regex/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/ansi-regex/package.json b/node_modules/ansi-regex/package.json
new file mode 100644
index 0000000..017f531
--- /dev/null
+++ b/node_modules/ansi-regex/package.json
@@ -0,0 +1,55 @@
+{
+ "name": "ansi-regex",
+ "version": "5.0.1",
+ "description": "Regular expression for matching ANSI escape codes",
+ "license": "MIT",
+ "repository": "chalk/ansi-regex",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd",
+ "view-supported": "node fixtures/view-codes.js"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "command-line",
+ "text",
+ "regex",
+ "regexp",
+ "re",
+ "match",
+ "test",
+ "find",
+ "pattern"
+ ],
+ "devDependencies": {
+ "ava": "^2.4.0",
+ "tsd": "^0.9.0",
+ "xo": "^0.25.3"
+ }
+}
diff --git a/node_modules/ansi-regex/readme.md b/node_modules/ansi-regex/readme.md
new file mode 100644
index 0000000..4d848bc
--- /dev/null
+++ b/node_modules/ansi-regex/readme.md
@@ -0,0 +1,78 @@
+# ansi-regex
+
+> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
+
+
+## Install
+
+```
+$ npm install ansi-regex
+```
+
+
+## Usage
+
+```js
+const ansiRegex = require('ansi-regex');
+
+ansiRegex().test('\u001B[4mcake\u001B[0m');
+//=> true
+
+ansiRegex().test('cake');
+//=> false
+
+'\u001B[4mcake\u001B[0m'.match(ansiRegex());
+//=> ['\u001B[4m', '\u001B[0m']
+
+'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
+//=> ['\u001B[4m']
+
+'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
+//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
+```
+
+
+## API
+
+### ansiRegex(options?)
+
+Returns a regex for matching ANSI escape codes.
+
+#### options
+
+Type: `object`
+
+##### onlyFirst
+
+Type: `boolean`<br>
+Default: `false` *(Matches any ANSI escape codes in a string)*
+
+Match only the first ANSI escape.
+
+
+## FAQ
+
+### Why do you test for codes not in the ECMA 48 standard?
+
+Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
+
+On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
+
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
+
+
+---
+
+<div align="center">
+ <b>
+ <a href="https://tidelift.com/subscription/pkg/npm-ansi-regex?utm_source=npm-ansi-regex&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
+ </b>
+ <br>
+ <sub>
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
+ </sub>
+</div>
diff --git a/node_modules/ansi-styles/index.d.ts b/node_modules/ansi-styles/index.d.ts
new file mode 100644
index 0000000..44a907e
--- /dev/null
+++ b/node_modules/ansi-styles/index.d.ts
@@ -0,0 +1,345 @@
+declare type CSSColor =
+ | 'aliceblue'
+ | 'antiquewhite'
+ | 'aqua'
+ | 'aquamarine'
+ | 'azure'
+ | 'beige'
+ | 'bisque'
+ | 'black'
+ | 'blanchedalmond'
+ | 'blue'
+ | 'blueviolet'
+ | 'brown'
+ | 'burlywood'
+ | 'cadetblue'
+ | 'chartreuse'
+ | 'chocolate'
+ | 'coral'
+ | 'cornflowerblue'
+ | 'cornsilk'
+ | 'crimson'
+ | 'cyan'
+ | 'darkblue'
+ | 'darkcyan'
+ | 'darkgoldenrod'
+ | 'darkgray'
+ | 'darkgreen'
+ | 'darkgrey'
+ | 'darkkhaki'
+ | 'darkmagenta'
+ | 'darkolivegreen'
+ | 'darkorange'
+ | 'darkorchid'
+ | 'darkred'
+ | 'darksalmon'
+ | 'darkseagreen'
+ | 'darkslateblue'
+ | 'darkslategray'
+ | 'darkslategrey'
+ | 'darkturquoise'
+ | 'darkviolet'
+ | 'deeppink'
+ | 'deepskyblue'
+ | 'dimgray'
+ | 'dimgrey'
+ | 'dodgerblue'
+ | 'firebrick'
+ | 'floralwhite'
+ | 'forestgreen'
+ | 'fuchsia'
+ | 'gainsboro'
+ | 'ghostwhite'
+ | 'gold'
+ | 'goldenrod'
+ | 'gray'
+ | 'green'
+ | 'greenyellow'
+ | 'grey'
+ | 'honeydew'
+ | 'hotpink'
+ | 'indianred'
+ | 'indigo'
+ | 'ivory'
+ | 'khaki'
+ | 'lavender'
+ | 'lavenderblush'
+ | 'lawngreen'
+ | 'lemonchiffon'
+ | 'lightblue'
+ | 'lightcoral'
+ | 'lightcyan'
+ | 'lightgoldenrodyellow'
+ | 'lightgray'
+ | 'lightgreen'
+ | 'lightgrey'
+ | 'lightpink'
+ | 'lightsalmon'
+ | 'lightseagreen'
+ | 'lightskyblue'
+ | 'lightslategray'
+ | 'lightslategrey'
+ | 'lightsteelblue'
+ | 'lightyellow'
+ | 'lime'
+ | 'limegreen'
+ | 'linen'
+ | 'magenta'
+ | 'maroon'
+ | 'mediumaquamarine'
+ | 'mediumblue'
+ | 'mediumorchid'
+ | 'mediumpurple'
+ | 'mediumseagreen'
+ | 'mediumslateblue'
+ | 'mediumspringgreen'
+ | 'mediumturquoise'
+ | 'mediumvioletred'
+ | 'midnightblue'
+ | 'mintcream'
+ | 'mistyrose'
+ | 'moccasin'
+ | 'navajowhite'
+ | 'navy'
+ | 'oldlace'
+ | 'olive'
+ | 'olivedrab'
+ | 'orange'
+ | 'orangered'
+ | 'orchid'
+ | 'palegoldenrod'
+ | 'palegreen'
+ | 'paleturquoise'
+ | 'palevioletred'
+ | 'papayawhip'
+ | 'peachpuff'
+ | 'peru'
+ | 'pink'
+ | 'plum'
+ | 'powderblue'
+ | 'purple'
+ | 'rebeccapurple'
+ | 'red'
+ | 'rosybrown'
+ | 'royalblue'
+ | 'saddlebrown'
+ | 'salmon'
+ | 'sandybrown'
+ | 'seagreen'
+ | 'seashell'
+ | 'sienna'
+ | 'silver'
+ | 'skyblue'
+ | 'slateblue'
+ | 'slategray'
+ | 'slategrey'
+ | 'snow'
+ | 'springgreen'
+ | 'steelblue'
+ | 'tan'
+ | 'teal'
+ | 'thistle'
+ | 'tomato'
+ | 'turquoise'
+ | 'violet'
+ | 'wheat'
+ | 'white'
+ | 'whitesmoke'
+ | 'yellow'
+ | 'yellowgreen';
+
+declare namespace ansiStyles {
+ interface ColorConvert {
+ /**
+ The RGB color space.
+
+ @param red - (`0`-`255`)
+ @param green - (`0`-`255`)
+ @param blue - (`0`-`255`)
+ */
+ rgb(red: number, green: number, blue: number): string;
+
+ /**
+ The RGB HEX color space.
+
+ @param hex - A hexadecimal string containing RGB data.
+ */
+ hex(hex: string): string;
+
+ /**
+ @param keyword - A CSS color name.
+ */
+ keyword(keyword: CSSColor): string;
+
+ /**
+ The HSL color space.
+
+ @param hue - (`0`-`360`)
+ @param saturation - (`0`-`100`)
+ @param lightness - (`0`-`100`)
+ */
+ hsl(hue: number, saturation: number, lightness: number): string;
+
+ /**
+ The HSV color space.
+
+ @param hue - (`0`-`360`)
+ @param saturation - (`0`-`100`)
+ @param value - (`0`-`100`)
+ */
+ hsv(hue: number, saturation: number, value: number): string;
+
+ /**
+ The HSV color space.
+
+ @param hue - (`0`-`360`)
+ @param whiteness - (`0`-`100`)
+ @param blackness - (`0`-`100`)
+ */
+ hwb(hue: number, whiteness: number, blackness: number): string;
+
+ /**
+ Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color.
+ */
+ ansi(ansi: number): string;
+
+ /**
+ Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
+ */
+ ansi256(ansi: number): string;
+ }
+
+ interface CSPair {
+ /**
+ The ANSI terminal control sequence for starting this style.
+ */
+ readonly open: string;
+
+ /**
+ The ANSI terminal control sequence for ending this style.
+ */
+ readonly close: string;
+ }
+
+ interface ColorBase {
+ readonly ansi: ColorConvert;
+ readonly ansi256: ColorConvert;
+ readonly ansi16m: ColorConvert;
+
+ /**
+ The ANSI terminal control sequence for ending this color.
+ */
+ readonly close: string;
+ }
+
+ interface Modifier {
+ /**
+ Resets the current color chain.
+ */
+ readonly reset: CSPair;
+
+ /**
+ Make text bold.
+ */
+ readonly bold: CSPair;
+
+ /**
+ Emitting only a small amount of light.
+ */
+ readonly dim: CSPair;
+
+ /**
+ Make text italic. (Not widely supported)
+ */
+ readonly italic: CSPair;
+
+ /**
+ Make text underline. (Not widely supported)
+ */
+ readonly underline: CSPair;
+
+ /**
+ Inverse background and foreground colors.
+ */
+ readonly inverse: CSPair;
+
+ /**
+ Prints the text, but makes it invisible.
+ */
+ readonly hidden: CSPair;
+
+ /**
+ Puts a horizontal line through the center of the text. (Not widely supported)
+ */
+ readonly strikethrough: CSPair;
+ }
+
+ interface ForegroundColor {
+ readonly black: CSPair;
+ readonly red: CSPair;
+ readonly green: CSPair;
+ readonly yellow: CSPair;
+ readonly blue: CSPair;
+ readonly cyan: CSPair;
+ readonly magenta: CSPair;
+ readonly white: CSPair;
+
+ /**
+ Alias for `blackBright`.
+ */
+ readonly gray: CSPair;
+
+ /**
+ Alias for `blackBright`.
+ */
+ readonly grey: CSPair;
+
+ readonly blackBright: CSPair;
+ readonly redBright: CSPair;
+ readonly greenBright: CSPair;
+ readonly yellowBright: CSPair;
+ readonly blueBright: CSPair;
+ readonly cyanBright: CSPair;
+ readonly magentaBright: CSPair;
+ readonly whiteBright: CSPair;
+ }
+
+ interface BackgroundColor {
+ readonly bgBlack: CSPair;
+ readonly bgRed: CSPair;
+ readonly bgGreen: CSPair;
+ readonly bgYellow: CSPair;
+ readonly bgBlue: CSPair;
+ readonly bgCyan: CSPair;
+ readonly bgMagenta: CSPair;
+ readonly bgWhite: CSPair;
+
+ /**
+ Alias for `bgBlackBright`.
+ */
+ readonly bgGray: CSPair;
+
+ /**
+ Alias for `bgBlackBright`.
+ */
+ readonly bgGrey: CSPair;
+
+ readonly bgBlackBright: CSPair;
+ readonly bgRedBright: CSPair;
+ readonly bgGreenBright: CSPair;
+ readonly bgYellowBright: CSPair;
+ readonly bgBlueBright: CSPair;
+ readonly bgCyanBright: CSPair;
+ readonly bgMagentaBright: CSPair;
+ readonly bgWhiteBright: CSPair;
+ }
+}
+
+declare const ansiStyles: {
+ readonly modifier: ansiStyles.Modifier;
+ readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase;
+ readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase;
+ readonly codes: ReadonlyMap<number, number>;
+} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier;
+
+export = ansiStyles;
diff --git a/node_modules/ansi-styles/index.js b/node_modules/ansi-styles/index.js
new file mode 100644
index 0000000..5d82581
--- /dev/null
+++ b/node_modules/ansi-styles/index.js
@@ -0,0 +1,163 @@
+'use strict';
+
+const wrapAnsi16 = (fn, offset) => (...args) => {
+ const code = fn(...args);
+ return `\u001B[${code + offset}m`;
+};
+
+const wrapAnsi256 = (fn, offset) => (...args) => {
+ const code = fn(...args);
+ return `\u001B[${38 + offset};5;${code}m`;
+};
+
+const wrapAnsi16m = (fn, offset) => (...args) => {
+ const rgb = fn(...args);
+ return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
+};
+
+const ansi2ansi = n => n;
+const rgb2rgb = (r, g, b) => [r, g, b];
+
+const setLazyProperty = (object, property, get) => {
+ Object.defineProperty(object, property, {
+ get: () => {
+ const value = get();
+
+ Object.defineProperty(object, property, {
+ value,
+ enumerable: true,
+ configurable: true
+ });
+
+ return value;
+ },
+ enumerable: true,
+ configurable: true
+ });
+};
+
+/** @type {typeof import('color-convert')} */
+let colorConvert;
+const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
+ if (colorConvert === undefined) {
+ colorConvert = require('color-convert');
+ }
+
+ const offset = isBackground ? 10 : 0;
+ const styles = {};
+
+ for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
+ const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;
+ if (sourceSpace === targetSpace) {
+ styles[name] = wrap(identity, offset);
+ } else if (typeof suite === 'object') {
+ styles[name] = wrap(suite[targetSpace], offset);
+ }
+ }
+
+ return styles;
+};
+
+function assembleStyles() {
+ const codes = new Map();
+ const styles = {
+ modifier: {
+ reset: [0, 0],
+ // 21 isn't widely supported and 22 does the same thing
+ bold: [1, 22],
+ dim: [2, 22],
+ italic: [3, 23],
+ underline: [4, 24],
+ inverse: [7, 27],
+ hidden: [8, 28],
+ strikethrough: [9, 29]
+ },
+ color: {
+ black: [30, 39],
+ red: [31, 39],
+ green: [32, 39],
+ yellow: [33, 39],
+ blue: [34, 39],
+ magenta: [35, 39],
+ cyan: [36, 39],
+ white: [37, 39],
+
+ // Bright color
+ blackBright: [90, 39],
+ redBright: [91, 39],
+ greenBright: [92, 39],
+ yellowBright: [93, 39],
+ blueBright: [94, 39],
+ magentaBright: [95, 39],
+ cyanBright: [96, 39],
+ whiteBright: [97, 39]
+ },
+ bgColor: {
+ bgBlack: [40, 49],
+ bgRed: [41, 49],
+ bgGreen: [42, 49],
+ bgYellow: [43, 49],
+ bgBlue: [44, 49],
+ bgMagenta: [45, 49],
+ bgCyan: [46, 49],
+ bgWhite: [47, 49],
+
+ // Bright color
+ bgBlackBright: [100, 49],
+ bgRedBright: [101, 49],
+ bgGreenBright: [102, 49],
+ bgYellowBright: [103, 49],
+ bgBlueBright: [104, 49],
+ bgMagentaBright: [105, 49],
+ bgCyanBright: [106, 49],
+ bgWhiteBright: [107, 49]
+ }
+ };
+
+ // Alias bright black as gray (and grey)
+ styles.color.gray = styles.color.blackBright;
+ styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
+ styles.color.grey = styles.color.blackBright;
+ styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
+
+ for (const [groupName, group] of Object.entries(styles)) {
+ for (const [styleName, style] of Object.entries(group)) {
+ styles[styleName] = {
+ open: `\u001B[${style[0]}m`,
+ close: `\u001B[${style[1]}m`
+ };
+
+ group[styleName] = styles[styleName];
+
+ codes.set(style[0], style[1]);
+ }
+
+ Object.defineProperty(styles, groupName, {
+ value: group,
+ enumerable: false
+ });
+ }
+
+ Object.defineProperty(styles, 'codes', {
+ value: codes,
+ enumerable: false
+ });
+
+ styles.color.close = '\u001B[39m';
+ styles.bgColor.close = '\u001B[49m';
+
+ setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));
+ setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));
+ setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));
+ setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));
+ setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));
+ setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));
+
+ return styles;
+}
+
+// Make the export immutable
+Object.defineProperty(module, 'exports', {
+ enumerable: true,
+ get: assembleStyles
+});
diff --git a/node_modules/ansi-styles/license b/node_modules/ansi-styles/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/ansi-styles/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/ansi-styles/package.json b/node_modules/ansi-styles/package.json
new file mode 100644
index 0000000..7539328
--- /dev/null
+++ b/node_modules/ansi-styles/package.json
@@ -0,0 +1,56 @@
+{
+ "name": "ansi-styles",
+ "version": "4.3.0",
+ "description": "ANSI escape codes for styling strings in the terminal",
+ "license": "MIT",
+ "repository": "chalk/ansi-styles",
+ "funding": "https://github.com/chalk/ansi-styles?sponsor=1",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd",
+ "screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "devDependencies": {
+ "@types/color-convert": "^1.9.0",
+ "ava": "^2.3.0",
+ "svg-term-cli": "^2.1.1",
+ "tsd": "^0.11.0",
+ "xo": "^0.25.3"
+ }
+}
diff --git a/node_modules/ansi-styles/readme.md b/node_modules/ansi-styles/readme.md
new file mode 100644
index 0000000..24883de
--- /dev/null
+++ b/node_modules/ansi-styles/readme.md
@@ -0,0 +1,152 @@
+# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)
+
+> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
+
+You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
+
+<img src="screenshot.svg" width="900">
+
+## Install
+
+```
+$ npm install ansi-styles
+```
+
+## Usage
+
+```js
+const style = require('ansi-styles');
+
+console.log(`${style.green.open}Hello world!${style.green.close}`);
+
+
+// Color conversion between 16/256/truecolor
+// NOTE: If conversion goes to 16 colors or 256 colors, the original color
+// may be degraded to fit that color palette. This means terminals
+// that do not support 16 million colors will best-match the
+// original color.
+console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
+console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
+console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close);
+```
+
+## API
+
+Each style has an `open` and `close` property.
+
+## Styles
+
+### Modifiers
+
+- `reset`
+- `bold`
+- `dim`
+- `italic` *(Not widely supported)*
+- `underline`
+- `inverse`
+- `hidden`
+- `strikethrough` *(Not widely supported)*
+
+### Colors
+
+- `black`
+- `red`
+- `green`
+- `yellow`
+- `blue`
+- `magenta`
+- `cyan`
+- `white`
+- `blackBright` (alias: `gray`, `grey`)
+- `redBright`
+- `greenBright`
+- `yellowBright`
+- `blueBright`
+- `magentaBright`
+- `cyanBright`
+- `whiteBright`
+
+### Background colors
+
+- `bgBlack`
+- `bgRed`
+- `bgGreen`
+- `bgYellow`
+- `bgBlue`
+- `bgMagenta`
+- `bgCyan`
+- `bgWhite`
+- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
+- `bgRedBright`
+- `bgGreenBright`
+- `bgYellowBright`
+- `bgBlueBright`
+- `bgMagentaBright`
+- `bgCyanBright`
+- `bgWhiteBright`
+
+## Advanced usage
+
+By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
+
+- `style.modifier`
+- `style.color`
+- `style.bgColor`
+
+###### Example
+
+```js
+console.log(style.color.green.open);
+```
+
+Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
+
+###### Example
+
+```js
+console.log(style.codes.get(36));
+//=> 39
+```
+
+## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
+
+`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
+
+The following color spaces from `color-convert` are supported:
+
+- `rgb`
+- `hex`
+- `keyword`
+- `hsl`
+- `hsv`
+- `hwb`
+- `ansi`
+- `ansi256`
+
+To use these, call the associated conversion function with the intended output, for example:
+
+```js
+style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
+style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
+
+style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
+style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
+
+style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
+style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
+```
+
+## Related
+
+- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
+
+## For enterprise
+
+Available as part of the Tidelift Subscription.
+
+The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
diff --git a/node_modules/chalk/index.d.ts b/node_modules/chalk/index.d.ts
new file mode 100644
index 0000000..9cd88f3
--- /dev/null
+++ b/node_modules/chalk/index.d.ts
@@ -0,0 +1,415 @@
+/**
+Basic foreground colors.
+
+[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
+*/
+declare type ForegroundColor =
+ | 'black'
+ | 'red'
+ | 'green'
+ | 'yellow'
+ | 'blue'
+ | 'magenta'
+ | 'cyan'
+ | 'white'
+ | 'gray'
+ | 'grey'
+ | 'blackBright'
+ | 'redBright'
+ | 'greenBright'
+ | 'yellowBright'
+ | 'blueBright'
+ | 'magentaBright'
+ | 'cyanBright'
+ | 'whiteBright';
+
+/**
+Basic background colors.
+
+[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
+*/
+declare type BackgroundColor =
+ | 'bgBlack'
+ | 'bgRed'
+ | 'bgGreen'
+ | 'bgYellow'
+ | 'bgBlue'
+ | 'bgMagenta'
+ | 'bgCyan'
+ | 'bgWhite'
+ | 'bgGray'
+ | 'bgGrey'
+ | 'bgBlackBright'
+ | 'bgRedBright'
+ | 'bgGreenBright'
+ | 'bgYellowBright'
+ | 'bgBlueBright'
+ | 'bgMagentaBright'
+ | 'bgCyanBright'
+ | 'bgWhiteBright';
+
+/**
+Basic colors.
+
+[More colors here.](https://github.com/chalk/chalk/blob/master/readme.md#256-and-truecolor-color-support)
+*/
+declare type Color = ForegroundColor | BackgroundColor;
+
+declare type Modifiers =
+ | 'reset'
+ | 'bold'
+ | 'dim'
+ | 'italic'
+ | 'underline'
+ | 'inverse'
+ | 'hidden'
+ | 'strikethrough'
+ | 'visible';
+
+declare namespace chalk {
+ /**
+ Levels:
+ - `0` - All colors disabled.
+ - `1` - Basic 16 colors support.
+ - `2` - ANSI 256 colors support.
+ - `3` - Truecolor 16 million colors support.
+ */
+ type Level = 0 | 1 | 2 | 3;
+
+ interface Options {
+ /**
+ Specify the color support for Chalk.
+
+ By default, color support is automatically detected based on the environment.
+
+ Levels:
+ - `0` - All colors disabled.
+ - `1` - Basic 16 colors support.
+ - `2` - ANSI 256 colors support.
+ - `3` - Truecolor 16 million colors support.
+ */
+ level?: Level;
+ }
+
+ /**
+ Return a new Chalk instance.
+ */
+ type Instance = new (options?: Options) => Chalk;
+
+ /**
+ Detect whether the terminal supports color.
+ */
+ interface ColorSupport {
+ /**
+ The color level used by Chalk.
+ */
+ level: Level;
+
+ /**
+ Return whether Chalk supports basic 16 colors.
+ */
+ hasBasic: boolean;
+
+ /**
+ Return whether Chalk supports ANSI 256 colors.
+ */
+ has256: boolean;
+
+ /**
+ Return whether Chalk supports Truecolor 16 million colors.
+ */
+ has16m: boolean;
+ }
+
+ interface ChalkFunction {
+ /**
+ Use a template string.
+
+ @remarks Template literals are unsupported for nested calls (see [issue #341](https://github.com/chalk/chalk/issues/341))
+
+ @example
+ ```
+ import chalk = require('chalk');
+
+ log(chalk`
+ CPU: {red ${cpu.totalPercent}%}
+ RAM: {green ${ram.used / ram.total * 100}%}
+ DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
+ `);
+ ```
+
+ @example
+ ```
+ import chalk = require('chalk');
+
+ log(chalk.red.bgBlack`2 + 3 = {bold ${2 + 3}}`)
+ ```
+ */
+ (text: TemplateStringsArray, ...placeholders: unknown[]): string;
+
+ (...text: unknown[]): string;
+ }
+
+ interface Chalk extends ChalkFunction {
+ /**
+ Return a new Chalk instance.
+ */
+ Instance: Instance;
+
+ /**
+ The color support for Chalk.
+
+ By default, color support is automatically detected based on the environment.
+
+ Levels:
+ - `0` - All colors disabled.
+ - `1` - Basic 16 colors support.
+ - `2` - ANSI 256 colors support.
+ - `3` - Truecolor 16 million colors support.
+ */
+ level: Level;
+
+ /**
+ Use HEX value to set text color.
+
+ @param color - Hexadecimal value representing the desired color.
+
+ @example
+ ```
+ import chalk = require('chalk');
+
+ chalk.hex('#DEADED');
+ ```
+ */
+ hex(color: string): Chalk;
+
+ /**
+ Use keyword color value to set text color.
+
+ @param color - Keyword value representing the desired color.
+
+ @example
+ ```
+ import chalk = require('chalk');
+
+ chalk.keyword('orange');
+ ```
+ */
+ keyword(color: string): Chalk;
+
+ /**
+ Use RGB values to set text color.
+ */
+ rgb(red: number, green: number, blue: number): Chalk;
+
+ /**
+ Use HSL values to set text color.
+ */
+ hsl(hue: number, saturation: number, lightness: number): Chalk;
+
+ /**
+ Use HSV values to set text color.
+ */
+ hsv(hue: number, saturation: number, value: number): Chalk;
+
+ /**
+ Use HWB values to set text color.
+ */
+ hwb(hue: number, whiteness: number, blackness: number): Chalk;
+
+ /**
+ Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color.
+
+ 30 <= code && code < 38 || 90 <= code && code < 98
+ For example, 31 for red, 91 for redBright.
+ */
+ ansi(code: number): Chalk;
+
+ /**
+ Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
+ */
+ ansi256(index: number): Chalk;
+
+ /**
+ Use HEX value to set background color.
+
+ @param color - Hexadecimal value representing the desired color.
+
+ @example
+ ```
+ import chalk = require('chalk');
+
+ chalk.bgHex('#DEADED');
+ ```
+ */
+ bgHex(color: string): Chalk;
+
+ /**
+ Use keyword color value to set background color.
+
+ @param color - Keyword value representing the desired color.
+
+ @example
+ ```
+ import chalk = require('chalk');
+
+ chalk.bgKeyword('orange');
+ ```
+ */
+ bgKeyword(color: string): Chalk;
+
+ /**
+ Use RGB values to set background color.
+ */
+ bgRgb(red: number, green: number, blue: number): Chalk;
+
+ /**
+ Use HSL values to set background color.
+ */
+ bgHsl(hue: number, saturation: number, lightness: number): Chalk;
+
+ /**
+ Use HSV values to set background color.
+ */
+ bgHsv(hue: number, saturation: number, value: number): Chalk;
+
+ /**
+ Use HWB values to set background color.
+ */
+ bgHwb(hue: number, whiteness: number, blackness: number): Chalk;
+
+ /**
+ Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color.
+
+ 30 <= code && code < 38 || 90 <= code && code < 98
+ For example, 31 for red, 91 for redBright.
+ Use the foreground code, not the background code (for example, not 41, nor 101).
+ */
+ bgAnsi(code: number): Chalk;
+
+ /**
+ Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.
+ */
+ bgAnsi256(index: number): Chalk;
+
+ /**
+ Modifier: Resets the current color chain.
+ */
+ readonly reset: Chalk;
+
+ /**
+ Modifier: Make text bold.
+ */
+ readonly bold: Chalk;
+
+ /**
+ Modifier: Emitting only a small amount of light.
+ */
+ readonly dim: Chalk;
+
+ /**
+ Modifier: Make text italic. (Not widely supported)
+ */
+ readonly italic: Chalk;
+
+ /**
+ Modifier: Make text underline. (Not widely supported)
+ */
+ readonly underline: Chalk;
+
+ /**
+ Modifier: Inverse background and foreground colors.
+ */
+ readonly inverse: Chalk;
+
+ /**
+ Modifier: Prints the text, but makes it invisible.
+ */
+ readonly hidden: Chalk;
+
+ /**
+ Modifier: Puts a horizontal line through the center of the text. (Not widely supported)
+ */
+ readonly strikethrough: Chalk;
+
+ /**
+ Modifier: Prints the text only when Chalk has a color support level > 0.
+ Can be useful for things that are purely cosmetic.
+ */
+ readonly visible: Chalk;
+
+ readonly black: Chalk;
+ readonly red: Chalk;
+ readonly green: Chalk;
+ readonly yellow: Chalk;
+ readonly blue: Chalk;
+ readonly magenta: Chalk;
+ readonly cyan: Chalk;
+ readonly white: Chalk;
+
+ /*
+ Alias for `blackBright`.
+ */
+ readonly gray: Chalk;
+
+ /*
+ Alias for `blackBright`.
+ */
+ readonly grey: Chalk;
+
+ readonly blackBright: Chalk;
+ readonly redBright: Chalk;
+ readonly greenBright: Chalk;
+ readonly yellowBright: Chalk;
+ readonly blueBright: Chalk;
+ readonly magentaBright: Chalk;
+ readonly cyanBright: Chalk;
+ readonly whiteBright: Chalk;
+
+ readonly bgBlack: Chalk;
+ readonly bgRed: Chalk;
+ readonly bgGreen: Chalk;
+ readonly bgYellow: Chalk;
+ readonly bgBlue: Chalk;
+ readonly bgMagenta: Chalk;
+ readonly bgCyan: Chalk;
+ readonly bgWhite: Chalk;
+
+ /*
+ Alias for `bgBlackBright`.
+ */
+ readonly bgGray: Chalk;
+
+ /*
+ Alias for `bgBlackBright`.
+ */
+ readonly bgGrey: Chalk;
+
+ readonly bgBlackBright: Chalk;
+ readonly bgRedBright: Chalk;
+ readonly bgGreenBright: Chalk;
+ readonly bgYellowBright: Chalk;
+ readonly bgBlueBright: Chalk;
+ readonly bgMagentaBright: Chalk;
+ readonly bgCyanBright: Chalk;
+ readonly bgWhiteBright: Chalk;
+ }
+}
+
+/**
+Main Chalk object that allows to chain styles together.
+Call the last one as a method with a string argument.
+Order doesn't matter, and later styles take precedent in case of a conflict.
+This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
+*/
+declare const chalk: chalk.Chalk & chalk.ChalkFunction & {
+ supportsColor: chalk.ColorSupport | false;
+ Level: chalk.Level;
+ Color: Color;
+ ForegroundColor: ForegroundColor;
+ BackgroundColor: BackgroundColor;
+ Modifiers: Modifiers;
+ stderr: chalk.Chalk & {supportsColor: chalk.ColorSupport | false};
+};
+
+export = chalk;
diff --git a/node_modules/chalk/license b/node_modules/chalk/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/chalk/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/chalk/package.json b/node_modules/chalk/package.json
new file mode 100644
index 0000000..47c23f2
--- /dev/null
+++ b/node_modules/chalk/package.json
@@ -0,0 +1,68 @@
+{
+ "name": "chalk",
+ "version": "4.1.2",
+ "description": "Terminal string styling done right",
+ "license": "MIT",
+ "repository": "chalk/chalk",
+ "funding": "https://github.com/chalk/chalk?sponsor=1",
+ "main": "source",
+ "engines": {
+ "node": ">=10"
+ },
+ "scripts": {
+ "test": "xo && nyc ava && tsd",
+ "bench": "matcha benchmark.js"
+ },
+ "files": [
+ "source",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "str",
+ "ansi",
+ "style",
+ "styles",
+ "tty",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "devDependencies": {
+ "ava": "^2.4.0",
+ "coveralls": "^3.0.7",
+ "execa": "^4.0.0",
+ "import-fresh": "^3.1.0",
+ "matcha": "^0.7.0",
+ "nyc": "^15.0.0",
+ "resolve-from": "^5.0.0",
+ "tsd": "^0.7.4",
+ "xo": "^0.28.2"
+ },
+ "xo": {
+ "rules": {
+ "unicorn/prefer-string-slice": "off",
+ "unicorn/prefer-includes": "off",
+ "@typescript-eslint/member-ordering": "off",
+ "no-redeclare": "off",
+ "unicorn/string-content": "off",
+ "unicorn/better-regex": "off"
+ }
+ }
+}
diff --git a/node_modules/chalk/readme.md b/node_modules/chalk/readme.md
new file mode 100644
index 0000000..a055d21
--- /dev/null
+++ b/node_modules/chalk/readme.md
@@ -0,0 +1,341 @@
+<h1 align="center">
+ <br>
+ <br>
+ <img width="320" src="media/logo.svg" alt="Chalk">
+ <br>
+ <br>
+ <br>
+</h1>
+
+> Terminal string styling done right
+
+[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk) [![Coverage Status](https://coveralls.io/repos/github/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/github/chalk/chalk?branch=master) [![npm dependents](https://badgen.net/npm/dependents/chalk)](https://www.npmjs.com/package/chalk?activeTab=dependents) [![Downloads](https://badgen.net/npm/dt/chalk)](https://www.npmjs.com/package/chalk) [![](https://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo) ![TypeScript-ready](https://img.shields.io/npm/types/chalk.svg) [![run on repl.it](https://repl.it/badge/github/chalk/chalk)](https://repl.it/github/chalk/chalk)
+
+<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
+
+<br>
+
+---
+
+<div align="center">
+ <p>
+ <p>
+ <sup>
+ Sindre Sorhus' open source work is supported by the community on <a href="https://github.com/sponsors/sindresorhus">GitHub Sponsors</a> and <a href="https://stakes.social/0x44d871aebF0126Bf646753E2C976Aa7e68A66c15">Dev</a>
+ </sup>
+ </p>
+ <sup>Special thanks to:</sup>
+ <br>
+ <br>
+ <a href="https://standardresume.co/tech">
+ <img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="160"/>
+ </a>
+ <br>
+ <br>
+ <a href="https://retool.com/?utm_campaign=sindresorhus">
+ <img src="https://sindresorhus.com/assets/thanks/retool-logo.svg" width="230"/>
+ </a>
+ <br>
+ <br>
+ <a href="https://doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=chalk&utm_source=github">
+ <div>
+ <img src="https://dashboard.doppler.com/imgs/logo-long.svg" width="240" alt="Doppler">
+ </div>
+ <b>All your environment variables, in one place</b>
+ <div>
+ <span>Stop struggling with scattered API keys, hacking together home-brewed tools,</span>
+ <br>
+ <span>and avoiding access controls. Keep your team and servers in sync with Doppler.</span>
+ </div>
+ </a>
+ <br>
+ <a href="https://uibakery.io/?utm_source=chalk&utm_medium=sponsor&utm_campaign=github">
+ <div>
+ <img src="https://sindresorhus.com/assets/thanks/uibakery-logo.jpg" width="270" alt="UI Bakery">
+ </div>
+ </a>
+ </p>
+</div>
+
+---
+
+<br>
+
+## Highlights
+
+- Expressive API
+- Highly performant
+- Ability to nest styles
+- [256/Truecolor color support](#256-and-truecolor-color-support)
+- Auto-detects color support
+- Doesn't extend `String.prototype`
+- Clean and focused
+- Actively maintained
+- [Used by ~50,000 packages](https://www.npmjs.com/browse/depended/chalk) as of January 1, 2020
+
+## Install
+
+```console
+$ npm install chalk
+```
+
+## Usage
+
+```js
+const chalk = require('chalk');
+
+console.log(chalk.blue('Hello world!'));
+```
+
+Chalk comes with an easy to use composable API where you just chain and nest the styles you want.
+
+```js
+const chalk = require('chalk');
+const log = console.log;
+
+// Combine styled and normal strings
+log(chalk.blue('Hello') + ' World' + chalk.red('!'));
+
+// Compose multiple styles using the chainable API
+log(chalk.blue.bgRed.bold('Hello world!'));
+
+// Pass in multiple arguments
+log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
+
+// Nest styles
+log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
+
+// Nest styles of the same type even (color, underline, background)
+log(chalk.green(
+ 'I am a green line ' +
+ chalk.blue.underline.bold('with a blue substring') +
+ ' that becomes green again!'
+));
+
+// ES2015 template literal
+log(`
+CPU: ${chalk.red('90%')}
+RAM: ${chalk.green('40%')}
+DISK: ${chalk.yellow('70%')}
+`);
+
+// ES2015 tagged template literal
+log(chalk`
+CPU: {red ${cpu.totalPercent}%}
+RAM: {green ${ram.used / ram.total * 100}%}
+DISK: {rgb(255,131,0) ${disk.used / disk.total * 100}%}
+`);
+
+// Use RGB colors in terminal emulators that support it.
+log(chalk.keyword('orange')('Yay for orange colored text!'));
+log(chalk.rgb(123, 45, 67).underline('Underlined reddish color'));
+log(chalk.hex('#DEADED').bold('Bold gray!'));
+```
+
+Easily define your own themes:
+
+```js
+const chalk = require('chalk');
+
+const error = chalk.bold.red;
+const warning = chalk.keyword('orange');
+
+console.log(error('Error!'));
+console.log(warning('Warning!'));
+```
+
+Take advantage of console.log [string substitution](https://nodejs.org/docs/latest/api/console.html#console_console_log_data_args):
+
+```js
+const name = 'Sindre';
+console.log(chalk.green('Hello %s'), name);
+//=> 'Hello Sindre'
+```
+
+## API
+
+### chalk.`<style>[.<style>...](string, [string...])`
+
+Example: `chalk.red.bold.underline('Hello', 'world');`
+
+Chain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `chalk.red.yellow.green` is equivalent to `chalk.green`.
+
+Multiple arguments will be separated by space.
+
+### chalk.level
+
+Specifies the level of color support.
+
+Color support is automatically detected, but you can override it by setting the `level` property. You should however only do this in your own code as it applies globally to all Chalk consumers.
+
+If you need to change this in a reusable module, create a new instance:
+
+```js
+const ctx = new chalk.Instance({level: 0});
+```
+
+| Level | Description |
+| :---: | :--- |
+| `0` | All colors disabled |
+| `1` | Basic color support (16 colors) |
+| `2` | 256 color support |
+| `3` | Truecolor support (16 million colors) |
+
+### chalk.supportsColor
+
+Detect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.
+
+Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
+
+Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
+
+### chalk.stderr and chalk.stderr.supportsColor
+
+`chalk.stderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `chalk.supportsColor` apply to this too. `chalk.stderr.supportsColor` is exposed for convenience.
+
+## Styles
+
+### Modifiers
+
+- `reset` - Resets the current color chain.
+- `bold` - Make text bold.
+- `dim` - Emitting only a small amount of light.
+- `italic` - Make text italic. *(Not widely supported)*
+- `underline` - Make text underline. *(Not widely supported)*
+- `inverse`- Inverse background and foreground colors.
+- `hidden` - Prints the text, but makes it invisible.
+- `strikethrough` - Puts a horizontal line through the center of the text. *(Not widely supported)*
+- `visible`- Prints the text only when Chalk has a color level > 0. Can be useful for things that are purely cosmetic.
+
+### Colors
+
+- `black`
+- `red`
+- `green`
+- `yellow`
+- `blue`
+- `magenta`
+- `cyan`
+- `white`
+- `blackBright` (alias: `gray`, `grey`)
+- `redBright`
+- `greenBright`
+- `yellowBright`
+- `blueBright`
+- `magentaBright`
+- `cyanBright`
+- `whiteBright`
+
+### Background colors
+
+- `bgBlack`
+- `bgRed`
+- `bgGreen`
+- `bgYellow`
+- `bgBlue`
+- `bgMagenta`
+- `bgCyan`
+- `bgWhite`
+- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
+- `bgRedBright`
+- `bgGreenBright`
+- `bgYellowBright`
+- `bgBlueBright`
+- `bgMagentaBright`
+- `bgCyanBright`
+- `bgWhiteBright`
+
+## Tagged template literal
+
+Chalk can be used as a [tagged template literal](https://exploringjs.com/es6/ch_template-literals.html#_tagged-template-literals).
+
+```js
+const chalk = require('chalk');
+
+const miles = 18;
+const calculateFeet = miles => miles * 5280;
+
+console.log(chalk`
+ There are {bold 5280 feet} in a mile.
+ In {bold ${miles} miles}, there are {green.bold ${calculateFeet(miles)} feet}.
+`);
+```
+
+Blocks are delimited by an opening curly brace (`{`), a style, some content, and a closing curly brace (`}`).
+
+Template styles are chained exactly like normal Chalk styles. The following three statements are equivalent:
+
+```js
+console.log(chalk.bold.rgb(10, 100, 200)('Hello!'));
+console.log(chalk.bold.rgb(10, 100, 200)`Hello!`);
+console.log(chalk`{bold.rgb(10,100,200) Hello!}`);
+```
+
+Note that function styles (`rgb()`, `hsl()`, `keyword()`, etc.) may not contain spaces between parameters.
+
+All interpolated values (`` chalk`${foo}` ``) are converted to strings via the `.toString()` method. All curly braces (`{` and `}`) in interpolated value strings are escaped.
+
+## 256 and Truecolor color support
+
+Chalk supports 256 colors and [Truecolor](https://gist.github.com/XVilka/8346728) (16 million colors) on supported terminal apps.
+
+Colors are downsampled from 16 million RGB values to an ANSI color format that is supported by the terminal emulator (or by specifying `{level: n}` as a Chalk option). For example, Chalk configured to run at level 1 (basic color support) will downsample an RGB value of #FF0000 (red) to 31 (ANSI escape for red).
+
+Examples:
+
+- `chalk.hex('#DEADED').underline('Hello, world!')`
+- `chalk.keyword('orange')('Some orange text')`
+- `chalk.rgb(15, 100, 204).inverse('Hello!')`
+
+Background versions of these models are prefixed with `bg` and the first level of the module capitalized (e.g. `keyword` for foreground colors and `bgKeyword` for background colors).
+
+- `chalk.bgHex('#DEADED').underline('Hello, world!')`
+- `chalk.bgKeyword('orange')('Some orange text')`
+- `chalk.bgRgb(15, 100, 204).inverse('Hello!')`
+
+The following color models can be used:
+
+- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
+- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
+- [`keyword`](https://www.w3.org/wiki/CSS/Properties/color/keywords) (CSS keywords) - Example: `chalk.keyword('orange').bold('Orange!')`
+- [`hsl`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsl(32, 100, 50).bold('Orange!')`
+- [`hsv`](https://en.wikipedia.org/wiki/HSL_and_HSV) - Example: `chalk.hsv(32, 100, 100).bold('Orange!')`
+- [`hwb`](https://en.wikipedia.org/wiki/HWB_color_model) - Example: `chalk.hwb(32, 0, 50).bold('Orange!')`
+- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
+- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
+
+## Windows
+
+If you're on Windows, do yourself a favor and use [Windows Terminal](https://github.com/microsoft/terminal) instead of `cmd.exe`.
+
+## Origin story
+
+[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68) and the package is unmaintained. Although there are other packages, they either do too much or not enough. Chalk is a clean and focused alternative.
+
+## chalk for enterprise
+
+Available as part of the Tidelift Subscription.
+
+The maintainers of chalk and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-chalk?utm_source=npm-chalk&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
+
+## Related
+
+- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module
+- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
+- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color
+- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes
+- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Strip ANSI escape codes from a stream
+- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
+- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
+- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes
+- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
+- [color-convert](https://github.com/qix-/color-convert) - Converts colors between different models
+- [chalk-animation](https://github.com/bokub/chalk-animation) - Animate strings in the terminal
+- [gradient-string](https://github.com/bokub/gradient-string) - Apply color gradients to strings
+- [chalk-pipe](https://github.com/LitoMore/chalk-pipe) - Create chalk style schemes with simpler style strings
+- [terminal-link](https://github.com/sindresorhus/terminal-link) - Create clickable links in the terminal
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
diff --git a/node_modules/chalk/source/index.js b/node_modules/chalk/source/index.js
new file mode 100644
index 0000000..75ec663
--- /dev/null
+++ b/node_modules/chalk/source/index.js
@@ -0,0 +1,229 @@
+'use strict';
+const ansiStyles = require('ansi-styles');
+const {stdout: stdoutColor, stderr: stderrColor} = require('supports-color');
+const {
+ stringReplaceAll,
+ stringEncaseCRLFWithFirstIndex
+} = require('./util');
+
+const {isArray} = Array;
+
+// `supportsColor.level` → `ansiStyles.color[name]` mapping
+const levelMapping = [
+ 'ansi',
+ 'ansi',
+ 'ansi256',
+ 'ansi16m'
+];
+
+const styles = Object.create(null);
+
+const 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');
+ }
+
+ // Detect level if not set manually
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
+ object.level = options.level === undefined ? colorLevel : options.level;
+};
+
+class ChalkClass {
+ constructor(options) {
+ // eslint-disable-next-line no-constructor-return
+ return chalkFactory(options);
+ }
+}
+
+const chalkFactory = options => {
+ const chalk = {};
+ applyOptions(chalk, options);
+
+ chalk.template = (...arguments_) => chalkTag(chalk.template, ...arguments_);
+
+ Object.setPrototypeOf(chalk, Chalk.prototype);
+ Object.setPrototypeOf(chalk.template, chalk);
+
+ chalk.template.constructor = () => {
+ throw new Error('`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.');
+ };
+
+ chalk.template.Instance = ChalkClass;
+
+ return chalk.template;
+};
+
+function Chalk(options) {
+ return chalkFactory(options);
+}
+
+for (const [styleName, style] of Object.entries(ansiStyles)) {
+ styles[styleName] = {
+ get() {
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
+ Object.defineProperty(this, styleName, {value: builder});
+ return builder;
+ }
+ };
+}
+
+styles.visible = {
+ get() {
+ const builder = createBuilder(this, this._styler, true);
+ Object.defineProperty(this, 'visible', {value: builder});
+ return builder;
+ }
+};
+
+const usedModels = ['rgb', 'hex', 'keyword', 'hsl', 'hsv', 'hwb', 'ansi', 'ansi256'];
+
+for (const model of usedModels) {
+ styles[model] = {
+ get() {
+ const {level} = this;
+ return function (...arguments_) {
+ const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
+ return createBuilder(this, styler, this._isEmpty);
+ };
+ }
+ };
+}
+
+for (const model of usedModels) {
+ const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
+ styles[bgModel] = {
+ get() {
+ const {level} = this;
+ return function (...arguments_) {
+ const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
+ return createBuilder(this, styler, this._isEmpty);
+ };
+ }
+ };
+}
+
+const proto = Object.defineProperties(() => {}, {
+ ...styles,
+ level: {
+ enumerable: true,
+ get() {
+ return this._generator.level;
+ },
+ set(level) {
+ this._generator.level = level;
+ }
+ }
+});
+
+const createStyler = (open, close, parent) => {
+ let openAll;
+ let closeAll;
+ if (parent === undefined) {
+ openAll = open;
+ closeAll = close;
+ } else {
+ openAll = parent.openAll + open;
+ closeAll = close + parent.closeAll;
+ }
+
+ return {
+ open,
+ close,
+ openAll,
+ closeAll,
+ parent
+ };
+};
+
+const createBuilder = (self, _styler, _isEmpty) => {
+ const builder = (...arguments_) => {
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
+ // Called as a template literal, for example: chalk.red`2 + 3 = {bold ${2+3}}`
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
+ }
+
+ // Single argument is hot path, implicit coercion is faster than anything
+ // eslint-disable-next-line no-implicit-coercion
+ return applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
+ };
+
+ // We alter the prototype because we must return a function, but there is
+ // no way to create a function with a different prototype
+ Object.setPrototypeOf(builder, proto);
+
+ builder._generator = self;
+ builder._styler = _styler;
+ builder._isEmpty = _isEmpty;
+
+ return builder;
+};
+
+const applyStyle = (self, string) => {
+ if (self.level <= 0 || !string) {
+ return self._isEmpty ? '' : string;
+ }
+
+ let styler = self._styler;
+
+ if (styler === undefined) {
+ return string;
+ }
+
+ const {openAll, closeAll} = styler;
+ if (string.indexOf('\u001B') !== -1) {
+ while (styler !== undefined) {
+ // Replace any instances already present with a re-opening code
+ // otherwise only the part of the string until said closing code
+ // will be colored, and the rest will simply be 'plain'.
+ string = stringReplaceAll(string, styler.close, styler.open);
+
+ styler = styler.parent;
+ }
+ }
+
+ // We can move both next actions out of loop, because remaining actions in loop won't have
+ // any/visible effect on parts we add here. Close the styling before a linebreak and reopen
+ // after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
+ const lfIndex = string.indexOf('\n');
+ if (lfIndex !== -1) {
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
+ }
+
+ return openAll + string + closeAll;
+};
+
+let template;
+const chalkTag = (chalk, ...strings) => {
+ const [firstString] = strings;
+
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
+ // If chalk() was called by itself or with a string,
+ // return the string itself as a string.
+ return strings.join(' ');
+ }
+
+ const arguments_ = strings.slice(1);
+ const parts = [firstString.raw[0]];
+
+ for (let i = 1; i < firstString.length; i++) {
+ parts.push(
+ String(arguments_[i - 1]).replace(/[{}\\]/g, '\\$&'),
+ String(firstString.raw[i])
+ );
+ }
+
+ if (template === undefined) {
+ template = require('./templates');
+ }
+
+ return template(chalk, parts.join(''));
+};
+
+Object.defineProperties(Chalk.prototype, styles);
+
+const chalk = Chalk(); // eslint-disable-line new-cap
+chalk.supportsColor = stdoutColor;
+chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap
+chalk.stderr.supportsColor = stderrColor;
+
+module.exports = chalk;
diff --git a/node_modules/chalk/source/templates.js b/node_modules/chalk/source/templates.js
new file mode 100644
index 0000000..b130949
--- /dev/null
+++ b/node_modules/chalk/source/templates.js
@@ -0,0 +1,134 @@
+'use strict';
+const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
+const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
+const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
+const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
+
+const ESCAPES = new Map([
+ ['n', '\n'],
+ ['r', '\r'],
+ ['t', '\t'],
+ ['b', '\b'],
+ ['f', '\f'],
+ ['v', '\v'],
+ ['0', '\0'],
+ ['\\', '\\'],
+ ['e', '\u001B'],
+ ['a', '\u0007']
+]);
+
+function unescape(c) {
+ const u = c[0] === 'u';
+ const bracket = c[1] === '{';
+
+ if ((u && !bracket && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
+ return String.fromCharCode(parseInt(c.slice(1), 16));
+ }
+
+ if (u && bracket) {
+ return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
+ }
+
+ return ESCAPES.get(c) || c;
+}
+
+function parseArguments(name, arguments_) {
+ const results = [];
+ const chunks = arguments_.trim().split(/\s*,\s*/g);
+ let matches;
+
+ for (const chunk of chunks) {
+ const number = Number(chunk);
+ if (!Number.isNaN(number)) {
+ results.push(number);
+ } else if ((matches = chunk.match(STRING_REGEX))) {
+ results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
+ } else {
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
+ }
+ }
+
+ return results;
+}
+
+function parseStyle(style) {
+ STYLE_REGEX.lastIndex = 0;
+
+ const results = [];
+ let matches;
+
+ while ((matches = STYLE_REGEX.exec(style)) !== null) {
+ const name = matches[1];
+
+ if (matches[2]) {
+ const args = parseArguments(name, matches[2]);
+ results.push([name].concat(args));
+ } else {
+ results.push([name]);
+ }
+ }
+
+ return results;
+}
+
+function buildStyle(chalk, styles) {
+ const enabled = {};
+
+ for (const layer of styles) {
+ for (const style of layer.styles) {
+ enabled[style[0]] = layer.inverse ? null : style.slice(1);
+ }
+ }
+
+ let current = chalk;
+ for (const [styleName, styles] of Object.entries(enabled)) {
+ if (!Array.isArray(styles)) {
+ continue;
+ }
+
+ if (!(styleName in current)) {
+ throw new Error(`Unknown Chalk style: ${styleName}`);
+ }
+
+ current = styles.length > 0 ? current[styleName](...styles) : current[styleName];
+ }
+
+ return current;
+}
+
+module.exports = (chalk, temporary) => {
+ const styles = [];
+ const chunks = [];
+ let chunk = [];
+
+ // eslint-disable-next-line max-params
+ temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
+ if (escapeCharacter) {
+ chunk.push(unescape(escapeCharacter));
+ } else if (style) {
+ const string = chunk.join('');
+ chunk = [];
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk, styles)(string));
+ styles.push({inverse, styles: parseStyle(style)});
+ } else if (close) {
+ if (styles.length === 0) {
+ throw new Error('Found extraneous } in Chalk template literal');
+ }
+
+ chunks.push(buildStyle(chalk, styles)(chunk.join('')));
+ chunk = [];
+ styles.pop();
+ } else {
+ chunk.push(character);
+ }
+ });
+
+ chunks.push(chunk.join(''));
+
+ if (styles.length > 0) {
+ const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
+ throw new Error(errMessage);
+ }
+
+ return chunks.join('');
+};
diff --git a/node_modules/chalk/source/util.js b/node_modules/chalk/source/util.js
new file mode 100644
index 0000000..ca466fd
--- /dev/null
+++ b/node_modules/chalk/source/util.js
@@ -0,0 +1,39 @@
+'use strict';
+
+const 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.substr(endIndex, index - endIndex) + substring + replacer;
+ endIndex = index + substringLength;
+ index = string.indexOf(substring, endIndex);
+ } while (index !== -1);
+
+ returnValue += string.substr(endIndex);
+ return returnValue;
+};
+
+const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
+ let endIndex = 0;
+ let returnValue = '';
+ do {
+ const gotCR = string[index - 1] === '\r';
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? '\r\n' : '\n') + postfix;
+ endIndex = index + 1;
+ index = string.indexOf('\n', endIndex);
+ } while (index !== -1);
+
+ returnValue += string.substr(endIndex);
+ return returnValue;
+};
+
+module.exports = {
+ stringReplaceAll,
+ stringEncaseCRLFWithFirstIndex
+};
diff --git a/node_modules/cliui/CHANGELOG.md b/node_modules/cliui/CHANGELOG.md
new file mode 100644
index 0000000..61f06c3
--- /dev/null
+++ b/node_modules/cliui/CHANGELOG.md
@@ -0,0 +1,139 @@
+# Change Log
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+## [8.0.1](https://github.com/yargs/cliui/compare/v8.0.0...v8.0.1) (2022-10-01)
+
+
+### Bug Fixes
+
+* **deps:** move rollup-plugin-ts to dev deps ([#124](https://github.com/yargs/cliui/issues/124)) ([7c8bd6b](https://github.com/yargs/cliui/commit/7c8bd6ba024d61e4eeae310c7959ab8ab6829081))
+
+## [8.0.0](https://github.com/yargs/cliui/compare/v7.0.4...v8.0.0) (2022-09-30)
+
+
+### ⚠ BREAKING CHANGES
+
+* **deps:** drop Node 10 to release CVE-2021-3807 patch (#122)
+
+### Bug Fixes
+
+* **deps:** drop Node 10 to release CVE-2021-3807 patch ([#122](https://github.com/yargs/cliui/issues/122)) ([f156571](https://github.com/yargs/cliui/commit/f156571ce4f2ebf313335e3a53ad905589da5a30))
+
+### [7.0.4](https://www.github.com/yargs/cliui/compare/v7.0.3...v7.0.4) (2020-11-08)
+
+
+### Bug Fixes
+
+* **deno:** import UIOptions from definitions ([#97](https://www.github.com/yargs/cliui/issues/97)) ([f04f343](https://www.github.com/yargs/cliui/commit/f04f3439bc78114c7e90f82ff56f5acf16268ea8))
+
+### [7.0.3](https://www.github.com/yargs/cliui/compare/v7.0.2...v7.0.3) (2020-10-16)
+
+
+### Bug Fixes
+
+* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#93](https://www.github.com/yargs/cliui/issues/93)) ([eca16fc](https://www.github.com/yargs/cliui/commit/eca16fc05d26255df3280906c36d7f0e5b05c6e9))
+
+### [7.0.2](https://www.github.com/yargs/cliui/compare/v7.0.1...v7.0.2) (2020-10-14)
+
+
+### Bug Fixes
+
+* **exports:** node 13.0-13.6 require a string fallback ([#91](https://www.github.com/yargs/cliui/issues/91)) ([b529d7e](https://www.github.com/yargs/cliui/commit/b529d7e432901af1af7848b23ed6cf634497d961))
+
+### [7.0.1](https://www.github.com/yargs/cliui/compare/v7.0.0...v7.0.1) (2020-08-16)
+
+
+### Bug Fixes
+
+* **build:** main should be build/index.cjs ([dc29a3c](https://www.github.com/yargs/cliui/commit/dc29a3cc617a410aa850e06337b5954b04f2cb4d))
+
+## [7.0.0](https://www.github.com/yargs/cliui/compare/v6.0.0...v7.0.0) (2020-08-16)
+
+
+### ⚠ BREAKING CHANGES
+
+* tsc/ESM/Deno support (#82)
+* modernize deps and build (#80)
+
+### Build System
+
+* modernize deps and build ([#80](https://www.github.com/yargs/cliui/issues/80)) ([339d08d](https://www.github.com/yargs/cliui/commit/339d08dc71b15a3928aeab09042af94db2f43743))
+
+
+### Code Refactoring
+
+* tsc/ESM/Deno support ([#82](https://www.github.com/yargs/cliui/issues/82)) ([4b777a5](https://www.github.com/yargs/cliui/commit/4b777a5fe01c5d8958c6708695d6aab7dbe5706c))
+
+## [6.0.0](https://www.github.com/yargs/cliui/compare/v5.0.0...v6.0.0) (2019-11-10)
+
+
+### ⚠ BREAKING CHANGES
+
+* update deps, drop Node 6
+
+### Code Refactoring
+
+* update deps, drop Node 6 ([62056df](https://www.github.com/yargs/cliui/commit/62056df))
+
+## [5.0.0](https://github.com/yargs/cliui/compare/v4.1.0...v5.0.0) (2019-04-10)
+
+
+### Bug Fixes
+
+* Update wrap-ansi to fix compatibility with latest versions of chalk. ([#60](https://github.com/yargs/cliui/issues/60)) ([7bf79ae](https://github.com/yargs/cliui/commit/7bf79ae))
+
+
+### BREAKING CHANGES
+
+* Drop support for node < 6.
+
+
+
+<a name="4.1.0"></a>
+## [4.1.0](https://github.com/yargs/cliui/compare/v4.0.0...v4.1.0) (2018-04-23)
+
+
+### Features
+
+* add resetOutput method ([#57](https://github.com/yargs/cliui/issues/57)) ([7246902](https://github.com/yargs/cliui/commit/7246902))
+
+
+
+<a name="4.0.0"></a>
+## [4.0.0](https://github.com/yargs/cliui/compare/v3.2.0...v4.0.0) (2017-12-18)
+
+
+### Bug Fixes
+
+* downgrades strip-ansi to version 3.0.1 ([#54](https://github.com/yargs/cliui/issues/54)) ([5764c46](https://github.com/yargs/cliui/commit/5764c46))
+* set env variable FORCE_COLOR. ([#56](https://github.com/yargs/cliui/issues/56)) ([7350e36](https://github.com/yargs/cliui/commit/7350e36))
+
+
+### Chores
+
+* drop support for node < 4 ([#53](https://github.com/yargs/cliui/issues/53)) ([b105376](https://github.com/yargs/cliui/commit/b105376))
+
+
+### Features
+
+* add fallback for window width ([#45](https://github.com/yargs/cliui/issues/45)) ([d064922](https://github.com/yargs/cliui/commit/d064922))
+
+
+### BREAKING CHANGES
+
+* officially drop support for Node < 4
+
+
+
+<a name="3.2.0"></a>
+## [3.2.0](https://github.com/yargs/cliui/compare/v3.1.2...v3.2.0) (2016-04-11)
+
+
+### Bug Fixes
+
+* reduces tarball size ([acc6c33](https://github.com/yargs/cliui/commit/acc6c33))
+
+### Features
+
+* adds standard-version for release management ([ff84e32](https://github.com/yargs/cliui/commit/ff84e32))
diff --git a/node_modules/cliui/LICENSE.txt b/node_modules/cliui/LICENSE.txt
new file mode 100644
index 0000000..c7e2747
--- /dev/null
+++ b/node_modules/cliui/LICENSE.txt
@@ -0,0 +1,14 @@
+Copyright (c) 2015, Contributors
+
+Permission to use, copy, modify, and/or distribute this software
+for any purpose with or without fee is hereby granted, provided
+that the above copyright notice and this permission notice
+appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
+LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/cliui/README.md b/node_modules/cliui/README.md
new file mode 100644
index 0000000..65b5672
--- /dev/null
+++ b/node_modules/cliui/README.md
@@ -0,0 +1,141 @@
+# cliui
+
+![ci](https://github.com/yargs/cliui/workflows/ci/badge.svg)
+[![NPM version](https://img.shields.io/npm/v/cliui.svg)](https://www.npmjs.com/package/cliui)
+[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
+![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/cliui)
+
+easily create complex multi-column command-line-interfaces.
+
+## Example
+
+```js
+const ui = require('cliui')()
+
+ui.div('Usage: $0 [command] [options]')
+
+ui.div({
+ text: 'Options:',
+ padding: [2, 0, 1, 0]
+})
+
+ui.div(
+ {
+ text: "-f, --file",
+ width: 20,
+ padding: [0, 4, 0, 4]
+ },
+ {
+ text: "the file to load." +
+ chalk.green("(if this description is long it wraps).")
+ ,
+ width: 20
+ },
+ {
+ text: chalk.red("[required]"),
+ align: 'right'
+ }
+)
+
+console.log(ui.toString())
+```
+
+## Deno/ESM Support
+
+As of `v7` `cliui` supports [Deno](https://github.com/denoland/deno) and
+[ESM](https://nodejs.org/api/esm.html#esm_ecmascript_modules):
+
+```typescript
+import cliui from "https://deno.land/x/cliui/deno.ts";
+
+const ui = cliui({})
+
+ui.div('Usage: $0 [command] [options]')
+
+ui.div({
+ text: 'Options:',
+ padding: [2, 0, 1, 0]
+})
+
+ui.div({
+ text: "-f, --file",
+ width: 20,
+ padding: [0, 4, 0, 4]
+})
+
+console.log(ui.toString())
+```
+
+<img width="500" src="screenshot.png">
+
+## Layout DSL
+
+cliui exposes a simple layout DSL:
+
+If you create a single `ui.div`, passing a string rather than an
+object:
+
+* `\n`: characters will be interpreted as new rows.
+* `\t`: characters will be interpreted as new columns.
+* `\s`: characters will be interpreted as padding.
+
+**as an example...**
+
+```js
+var ui = require('./')({
+ width: 60
+})
+
+ui.div(
+ 'Usage: node ./bin/foo.js\n' +
+ ' <regex>\t provide a regex\n' +
+ ' <glob>\t provide a glob\t [required]'
+)
+
+console.log(ui.toString())
+```
+
+**will output:**
+
+```shell
+Usage: node ./bin/foo.js
+ <regex> provide a regex
+ <glob> provide a glob [required]
+```
+
+## Methods
+
+```js
+cliui = require('cliui')
+```
+
+### cliui({width: integer})
+
+Specify the maximum width of the UI being generated.
+If no width is provided, cliui will try to get the current window's width and use it, and if that doesn't work, width will be set to `80`.
+
+### cliui({wrap: boolean})
+
+Enable or disable the wrapping of text in a column.
+
+### cliui.div(column, column, column)
+
+Create a row with any number of columns, a column
+can either be a string, or an object with the following
+options:
+
+* **text:** some text to place in the column.
+* **width:** the width of a column.
+* **align:** alignment, `right` or `center`.
+* **padding:** `[top, right, bottom, left]`.
+* **border:** should a border be placed around the div?
+
+### cliui.span(column, column, column)
+
+Similar to `div`, except the next row will be appended without
+a new line being created.
+
+### cliui.resetOutput()
+
+Resets the UI elements of the current cliui instance, maintaining the values
+set for `width` and `wrap`.
diff --git a/node_modules/cliui/build/index.cjs b/node_modules/cliui/build/index.cjs
new file mode 100644
index 0000000..82126b6
--- /dev/null
+++ b/node_modules/cliui/build/index.cjs
@@ -0,0 +1,302 @@
+'use strict';
+
+const align = {
+ right: alignRight,
+ center: alignCenter
+};
+const top = 0;
+const right = 1;
+const bottom = 2;
+const left = 3;
+class UI {
+ constructor(opts) {
+ var _a;
+ this.width = opts.width;
+ this.wrap = (_a = opts.wrap) !== null && _a !== void 0 ? _a : true;
+ this.rows = [];
+ }
+ span(...args) {
+ const cols = this.div(...args);
+ cols.span = true;
+ }
+ resetOutput() {
+ this.rows = [];
+ }
+ div(...args) {
+ if (args.length === 0) {
+ this.div('');
+ }
+ if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === 'string') {
+ return this.applyLayoutDSL(args[0]);
+ }
+ const cols = args.map(arg => {
+ if (typeof arg === 'string') {
+ return this.colFromString(arg);
+ }
+ return arg;
+ });
+ this.rows.push(cols);
+ return cols;
+ }
+ shouldApplyLayoutDSL(...args) {
+ return args.length === 1 && typeof args[0] === 'string' &&
+ /[\t\n]/.test(args[0]);
+ }
+ applyLayoutDSL(str) {
+ const rows = str.split('\n').map(row => row.split('\t'));
+ let leftColumnWidth = 0;
+ // simple heuristic for layout, make sure the
+ // second column lines up along the left-hand.
+ // don't allow the first column to take up more
+ // than 50% of the screen.
+ rows.forEach(columns => {
+ if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) {
+ leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0]));
+ }
+ });
+ // generate a table:
+ // replacing ' ' with padding calculations.
+ // using the algorithmically generated width.
+ rows.forEach(columns => {
+ this.div(...columns.map((r, i) => {
+ return {
+ text: r.trim(),
+ padding: this.measurePadding(r),
+ width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined
+ };
+ }));
+ });
+ return this.rows[this.rows.length - 1];
+ }
+ colFromString(text) {
+ return {
+ text,
+ padding: this.measurePadding(text)
+ };
+ }
+ measurePadding(str) {
+ // measure padding without ansi escape codes
+ const noAnsi = mixin.stripAnsi(str);
+ return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length];
+ }
+ toString() {
+ const lines = [];
+ this.rows.forEach(row => {
+ this.rowToString(row, lines);
+ });
+ // don't display any lines with the
+ // hidden flag set.
+ return lines
+ .filter(line => !line.hidden)
+ .map(line => line.text)
+ .join('\n');
+ }
+ rowToString(row, lines) {
+ this.rasterize(row).forEach((rrow, r) => {
+ let str = '';
+ rrow.forEach((col, c) => {
+ const { width } = row[c]; // the width with padding.
+ const wrapWidth = this.negatePadding(row[c]); // the width without padding.
+ let ts = col; // temporary string used during alignment/padding.
+ if (wrapWidth > mixin.stringWidth(col)) {
+ ts += ' '.repeat(wrapWidth - mixin.stringWidth(col));
+ }
+ // align the string within its column.
+ if (row[c].align && row[c].align !== 'left' && this.wrap) {
+ const fn = align[row[c].align];
+ ts = fn(ts, wrapWidth);
+ if (mixin.stringWidth(ts) < wrapWidth) {
+ ts += ' '.repeat((width || 0) - mixin.stringWidth(ts) - 1);
+ }
+ }
+ // apply border and padding to string.
+ const padding = row[c].padding || [0, 0, 0, 0];
+ if (padding[left]) {
+ str += ' '.repeat(padding[left]);
+ }
+ str += addBorder(row[c], ts, '| ');
+ str += ts;
+ str += addBorder(row[c], ts, ' |');
+ if (padding[right]) {
+ str += ' '.repeat(padding[right]);
+ }
+ // if prior row is span, try to render the
+ // current row on the prior line.
+ if (r === 0 && lines.length > 0) {
+ str = this.renderInline(str, lines[lines.length - 1]);
+ }
+ });
+ // remove trailing whitespace.
+ lines.push({
+ text: str.replace(/ +$/, ''),
+ span: row.span
+ });
+ });
+ return lines;
+ }
+ // if the full 'source' can render in
+ // the target line, do so.
+ renderInline(source, previousLine) {
+ const match = source.match(/^ */);
+ const leadingWhitespace = match ? match[0].length : 0;
+ const target = previousLine.text;
+ const targetTextWidth = mixin.stringWidth(target.trimRight());
+ if (!previousLine.span) {
+ return source;
+ }
+ // if we're not applying wrapping logic,
+ // just always append to the span.
+ if (!this.wrap) {
+ previousLine.hidden = true;
+ return target + source;
+ }
+ if (leadingWhitespace < targetTextWidth) {
+ return source;
+ }
+ previousLine.hidden = true;
+ return target.trimRight() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
+ }
+ rasterize(row) {
+ const rrows = [];
+ const widths = this.columnWidths(row);
+ let wrapped;
+ // word wrap all columns, and create
+ // a data-structure that is easy to rasterize.
+ row.forEach((col, c) => {
+ // leave room for left and right padding.
+ col.width = widths[c];
+ if (this.wrap) {
+ wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split('\n');
+ }
+ else {
+ wrapped = col.text.split('\n');
+ }
+ if (col.border) {
+ wrapped.unshift('.' + '-'.repeat(this.negatePadding(col) + 2) + '.');
+ wrapped.push("'" + '-'.repeat(this.negatePadding(col) + 2) + "'");
+ }
+ // add top and bottom padding.
+ if (col.padding) {
+ wrapped.unshift(...new Array(col.padding[top] || 0).fill(''));
+ wrapped.push(...new Array(col.padding[bottom] || 0).fill(''));
+ }
+ wrapped.forEach((str, r) => {
+ if (!rrows[r]) {
+ rrows.push([]);
+ }
+ const rrow = rrows[r];
+ for (let i = 0; i < c; i++) {
+ if (rrow[i] === undefined) {
+ rrow.push('');
+ }
+ }
+ rrow.push(str);
+ });
+ });
+ return rrows;
+ }
+ negatePadding(col) {
+ let wrapWidth = col.width || 0;
+ if (col.padding) {
+ wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
+ }
+ if (col.border) {
+ wrapWidth -= 4;
+ }
+ return wrapWidth;
+ }
+ columnWidths(row) {
+ if (!this.wrap) {
+ return row.map(col => {
+ return col.width || mixin.stringWidth(col.text);
+ });
+ }
+ let unset = row.length;
+ let remainingWidth = this.width;
+ // column widths can be set in config.
+ const widths = row.map(col => {
+ if (col.width) {
+ unset--;
+ remainingWidth -= col.width;
+ return col.width;
+ }
+ return undefined;
+ });
+ // any unset widths should be calculated.
+ const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
+ return widths.map((w, i) => {
+ if (w === undefined) {
+ return Math.max(unsetWidth, _minWidth(row[i]));
+ }
+ return w;
+ });
+ }
+}
+function addBorder(col, ts, style) {
+ if (col.border) {
+ if (/[.']-+[.']/.test(ts)) {
+ return '';
+ }
+ if (ts.trim().length !== 0) {
+ return style;
+ }
+ return ' ';
+ }
+ return '';
+}
+// calculates the minimum width of
+// a column, based on padding preferences.
+function _minWidth(col) {
+ const padding = col.padding || [];
+ const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
+ if (col.border) {
+ return minWidth + 4;
+ }
+ return minWidth;
+}
+function getWindowWidth() {
+ /* istanbul ignore next: depends on terminal */
+ if (typeof process === 'object' && process.stdout && process.stdout.columns) {
+ return process.stdout.columns;
+ }
+ return 80;
+}
+function alignRight(str, width) {
+ str = str.trim();
+ const strWidth = mixin.stringWidth(str);
+ if (strWidth < width) {
+ return ' '.repeat(width - strWidth) + str;
+ }
+ return str;
+}
+function alignCenter(str, width) {
+ str = str.trim();
+ const strWidth = mixin.stringWidth(str);
+ /* istanbul ignore next */
+ if (strWidth >= width) {
+ return str;
+ }
+ return ' '.repeat((width - strWidth) >> 1) + str;
+}
+let mixin;
+function cliui(opts, _mixin) {
+ mixin = _mixin;
+ return new UI({
+ width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
+ wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
+ });
+}
+
+// Bootstrap cliui with CommonJS dependencies:
+const stringWidth = require('string-width');
+const stripAnsi = require('strip-ansi');
+const wrap = require('wrap-ansi');
+function ui(opts) {
+ return cliui(opts, {
+ stringWidth,
+ stripAnsi,
+ wrap
+ });
+}
+
+module.exports = ui;
diff --git a/node_modules/cliui/build/index.d.cts b/node_modules/cliui/build/index.d.cts
new file mode 100644
index 0000000..4567f94
--- /dev/null
+++ b/node_modules/cliui/build/index.d.cts
@@ -0,0 +1,43 @@
+interface UIOptions {
+ width: number;
+ wrap?: boolean;
+ rows?: string[];
+}
+interface Column {
+ text: string;
+ width?: number;
+ align?: "right" | "left" | "center";
+ padding: number[];
+ border?: boolean;
+}
+interface ColumnArray extends Array<Column> {
+ span: boolean;
+}
+interface Line {
+ hidden?: boolean;
+ text: string;
+ span?: boolean;
+}
+declare class UI {
+ width: number;
+ wrap: boolean;
+ rows: ColumnArray[];
+ constructor(opts: UIOptions);
+ span(...args: ColumnArray): void;
+ resetOutput(): void;
+ div(...args: (Column | string)[]): ColumnArray;
+ private shouldApplyLayoutDSL;
+ private applyLayoutDSL;
+ private colFromString;
+ private measurePadding;
+ toString(): string;
+ rowToString(row: ColumnArray, lines: Line[]): Line[];
+ // if the full 'source' can render in
+ // the target line, do so.
+ private renderInline;
+ private rasterize;
+ private negatePadding;
+ private columnWidths;
+}
+declare function ui(opts: UIOptions): UI;
+export { ui as default };
diff --git a/node_modules/cliui/build/lib/index.js b/node_modules/cliui/build/lib/index.js
new file mode 100644
index 0000000..b6eb054
--- /dev/null
+++ b/node_modules/cliui/build/lib/index.js
@@ -0,0 +1,287 @@
+'use strict';
+const align = {
+ right: alignRight,
+ center: alignCenter
+};
+const top = 0;
+const right = 1;
+const bottom = 2;
+const left = 3;
+export class UI {
+ constructor(opts) {
+ var _a;
+ this.width = opts.width;
+ this.wrap = (_a = opts.wrap) !== null && _a !== void 0 ? _a : true;
+ this.rows = [];
+ }
+ span(...args) {
+ const cols = this.div(...args);
+ cols.span = true;
+ }
+ resetOutput() {
+ this.rows = [];
+ }
+ div(...args) {
+ if (args.length === 0) {
+ this.div('');
+ }
+ if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === 'string') {
+ return this.applyLayoutDSL(args[0]);
+ }
+ const cols = args.map(arg => {
+ if (typeof arg === 'string') {
+ return this.colFromString(arg);
+ }
+ return arg;
+ });
+ this.rows.push(cols);
+ return cols;
+ }
+ shouldApplyLayoutDSL(...args) {
+ return args.length === 1 && typeof args[0] === 'string' &&
+ /[\t\n]/.test(args[0]);
+ }
+ applyLayoutDSL(str) {
+ const rows = str.split('\n').map(row => row.split('\t'));
+ let leftColumnWidth = 0;
+ // simple heuristic for layout, make sure the
+ // second column lines up along the left-hand.
+ // don't allow the first column to take up more
+ // than 50% of the screen.
+ rows.forEach(columns => {
+ if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) {
+ leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0]));
+ }
+ });
+ // generate a table:
+ // replacing ' ' with padding calculations.
+ // using the algorithmically generated width.
+ rows.forEach(columns => {
+ this.div(...columns.map((r, i) => {
+ return {
+ text: r.trim(),
+ padding: this.measurePadding(r),
+ width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined
+ };
+ }));
+ });
+ return this.rows[this.rows.length - 1];
+ }
+ colFromString(text) {
+ return {
+ text,
+ padding: this.measurePadding(text)
+ };
+ }
+ measurePadding(str) {
+ // measure padding without ansi escape codes
+ const noAnsi = mixin.stripAnsi(str);
+ return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length];
+ }
+ toString() {
+ const lines = [];
+ this.rows.forEach(row => {
+ this.rowToString(row, lines);
+ });
+ // don't display any lines with the
+ // hidden flag set.
+ return lines
+ .filter(line => !line.hidden)
+ .map(line => line.text)
+ .join('\n');
+ }
+ rowToString(row, lines) {
+ this.rasterize(row).forEach((rrow, r) => {
+ let str = '';
+ rrow.forEach((col, c) => {
+ const { width } = row[c]; // the width with padding.
+ const wrapWidth = this.negatePadding(row[c]); // the width without padding.
+ let ts = col; // temporary string used during alignment/padding.
+ if (wrapWidth > mixin.stringWidth(col)) {
+ ts += ' '.repeat(wrapWidth - mixin.stringWidth(col));
+ }
+ // align the string within its column.
+ if (row[c].align && row[c].align !== 'left' && this.wrap) {
+ const fn = align[row[c].align];
+ ts = fn(ts, wrapWidth);
+ if (mixin.stringWidth(ts) < wrapWidth) {
+ ts += ' '.repeat((width || 0) - mixin.stringWidth(ts) - 1);
+ }
+ }
+ // apply border and padding to string.
+ const padding = row[c].padding || [0, 0, 0, 0];
+ if (padding[left]) {
+ str += ' '.repeat(padding[left]);
+ }
+ str += addBorder(row[c], ts, '| ');
+ str += ts;
+ str += addBorder(row[c], ts, ' |');
+ if (padding[right]) {
+ str += ' '.repeat(padding[right]);
+ }
+ // if prior row is span, try to render the
+ // current row on the prior line.
+ if (r === 0 && lines.length > 0) {
+ str = this.renderInline(str, lines[lines.length - 1]);
+ }
+ });
+ // remove trailing whitespace.
+ lines.push({
+ text: str.replace(/ +$/, ''),
+ span: row.span
+ });
+ });
+ return lines;
+ }
+ // if the full 'source' can render in
+ // the target line, do so.
+ renderInline(source, previousLine) {
+ const match = source.match(/^ */);
+ const leadingWhitespace = match ? match[0].length : 0;
+ const target = previousLine.text;
+ const targetTextWidth = mixin.stringWidth(target.trimRight());
+ if (!previousLine.span) {
+ return source;
+ }
+ // if we're not applying wrapping logic,
+ // just always append to the span.
+ if (!this.wrap) {
+ previousLine.hidden = true;
+ return target + source;
+ }
+ if (leadingWhitespace < targetTextWidth) {
+ return source;
+ }
+ previousLine.hidden = true;
+ return target.trimRight() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
+ }
+ rasterize(row) {
+ const rrows = [];
+ const widths = this.columnWidths(row);
+ let wrapped;
+ // word wrap all columns, and create
+ // a data-structure that is easy to rasterize.
+ row.forEach((col, c) => {
+ // leave room for left and right padding.
+ col.width = widths[c];
+ if (this.wrap) {
+ wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split('\n');
+ }
+ else {
+ wrapped = col.text.split('\n');
+ }
+ if (col.border) {
+ wrapped.unshift('.' + '-'.repeat(this.negatePadding(col) + 2) + '.');
+ wrapped.push("'" + '-'.repeat(this.negatePadding(col) + 2) + "'");
+ }
+ // add top and bottom padding.
+ if (col.padding) {
+ wrapped.unshift(...new Array(col.padding[top] || 0).fill(''));
+ wrapped.push(...new Array(col.padding[bottom] || 0).fill(''));
+ }
+ wrapped.forEach((str, r) => {
+ if (!rrows[r]) {
+ rrows.push([]);
+ }
+ const rrow = rrows[r];
+ for (let i = 0; i < c; i++) {
+ if (rrow[i] === undefined) {
+ rrow.push('');
+ }
+ }
+ rrow.push(str);
+ });
+ });
+ return rrows;
+ }
+ negatePadding(col) {
+ let wrapWidth = col.width || 0;
+ if (col.padding) {
+ wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
+ }
+ if (col.border) {
+ wrapWidth -= 4;
+ }
+ return wrapWidth;
+ }
+ columnWidths(row) {
+ if (!this.wrap) {
+ return row.map(col => {
+ return col.width || mixin.stringWidth(col.text);
+ });
+ }
+ let unset = row.length;
+ let remainingWidth = this.width;
+ // column widths can be set in config.
+ const widths = row.map(col => {
+ if (col.width) {
+ unset--;
+ remainingWidth -= col.width;
+ return col.width;
+ }
+ return undefined;
+ });
+ // any unset widths should be calculated.
+ const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
+ return widths.map((w, i) => {
+ if (w === undefined) {
+ return Math.max(unsetWidth, _minWidth(row[i]));
+ }
+ return w;
+ });
+ }
+}
+function addBorder(col, ts, style) {
+ if (col.border) {
+ if (/[.']-+[.']/.test(ts)) {
+ return '';
+ }
+ if (ts.trim().length !== 0) {
+ return style;
+ }
+ return ' ';
+ }
+ return '';
+}
+// calculates the minimum width of
+// a column, based on padding preferences.
+function _minWidth(col) {
+ const padding = col.padding || [];
+ const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
+ if (col.border) {
+ return minWidth + 4;
+ }
+ return minWidth;
+}
+function getWindowWidth() {
+ /* istanbul ignore next: depends on terminal */
+ if (typeof process === 'object' && process.stdout && process.stdout.columns) {
+ return process.stdout.columns;
+ }
+ return 80;
+}
+function alignRight(str, width) {
+ str = str.trim();
+ const strWidth = mixin.stringWidth(str);
+ if (strWidth < width) {
+ return ' '.repeat(width - strWidth) + str;
+ }
+ return str;
+}
+function alignCenter(str, width) {
+ str = str.trim();
+ const strWidth = mixin.stringWidth(str);
+ /* istanbul ignore next */
+ if (strWidth >= width) {
+ return str;
+ }
+ return ' '.repeat((width - strWidth) >> 1) + str;
+}
+let mixin;
+export function cliui(opts, _mixin) {
+ mixin = _mixin;
+ return new UI({
+ width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
+ wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
+ });
+}
diff --git a/node_modules/cliui/build/lib/string-utils.js b/node_modules/cliui/build/lib/string-utils.js
new file mode 100644
index 0000000..4b87453
--- /dev/null
+++ b/node_modules/cliui/build/lib/string-utils.js
@@ -0,0 +1,27 @@
+// Minimal replacement for ansi string helpers "wrap-ansi" and "strip-ansi".
+// to facilitate ESM and Deno modules.
+// TODO: look at porting https://www.npmjs.com/package/wrap-ansi to ESM.
+// The npm application
+// Copyright (c) npm, Inc. and Contributors
+// Licensed on the terms of The Artistic License 2.0
+// See: https://github.com/npm/cli/blob/4c65cd952bc8627811735bea76b9b110cc4fc80e/lib/utils/ansi-trim.js
+const ansi = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' +
+ '\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g');
+export function stripAnsi(str) {
+ return str.replace(ansi, '');
+}
+export function wrap(str, width) {
+ const [start, end] = str.match(ansi) || ['', ''];
+ str = stripAnsi(str);
+ let wrapped = '';
+ for (let i = 0; i < str.length; i++) {
+ if (i !== 0 && (i % width) === 0) {
+ wrapped += '\n';
+ }
+ wrapped += str.charAt(i);
+ }
+ if (start && end) {
+ wrapped = `${start}${wrapped}${end}`;
+ }
+ return wrapped;
+}
diff --git a/node_modules/cliui/index.mjs b/node_modules/cliui/index.mjs
new file mode 100644
index 0000000..bc7a022
--- /dev/null
+++ b/node_modules/cliui/index.mjs
@@ -0,0 +1,13 @@
+// Bootstrap cliui with CommonJS dependencies:
+import { cliui } from './build/lib/index.js'
+import { wrap, stripAnsi } from './build/lib/string-utils.js'
+
+export default function ui (opts) {
+ return cliui(opts, {
+ stringWidth: (str) => {
+ return [...str].length
+ },
+ stripAnsi,
+ wrap
+ })
+}
diff --git a/node_modules/cliui/package.json b/node_modules/cliui/package.json
new file mode 100644
index 0000000..eab6bf4
--- /dev/null
+++ b/node_modules/cliui/package.json
@@ -0,0 +1,83 @@
+{
+ "name": "cliui",
+ "version": "8.0.1",
+ "description": "easily create complex multi-column command-line-interfaces",
+ "main": "build/index.cjs",
+ "exports": {
+ ".": [
+ {
+ "import": "./index.mjs",
+ "require": "./build/index.cjs"
+ },
+ "./build/index.cjs"
+ ]
+ },
+ "type": "module",
+ "module": "./index.mjs",
+ "scripts": {
+ "check": "standardx '**/*.ts' && standardx '**/*.js' && standardx '**/*.cjs'",
+ "fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'",
+ "pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
+ "test": "c8 mocha ./test/*.cjs",
+ "test:esm": "c8 mocha ./test/esm/cliui-test.mjs",
+ "postest": "check",
+ "coverage": "c8 report --check-coverage",
+ "precompile": "rimraf build",
+ "compile": "tsc",
+ "postcompile": "npm run build:cjs",
+ "build:cjs": "rollup -c",
+ "prepare": "npm run compile"
+ },
+ "repository": "yargs/cliui",
+ "standard": {
+ "ignore": [
+ "**/example/**"
+ ],
+ "globals": [
+ "it"
+ ]
+ },
+ "keywords": [
+ "cli",
+ "command-line",
+ "layout",
+ "design",
+ "console",
+ "wrap",
+ "table"
+ ],
+ "author": "Ben Coe <ben@npmjs.com>",
+ "license": "ISC",
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.1",
+ "wrap-ansi": "^7.0.0"
+ },
+ "devDependencies": {
+ "@types/node": "^14.0.27",
+ "@typescript-eslint/eslint-plugin": "^4.0.0",
+ "@typescript-eslint/parser": "^4.0.0",
+ "c8": "^7.3.0",
+ "chai": "^4.2.0",
+ "chalk": "^4.1.0",
+ "cross-env": "^7.0.2",
+ "eslint": "^7.6.0",
+ "eslint-plugin-import": "^2.22.0",
+ "eslint-plugin-node": "^11.1.0",
+ "gts": "^3.0.0",
+ "mocha": "^10.0.0",
+ "rimraf": "^3.0.2",
+ "rollup": "^2.23.1",
+ "rollup-plugin-ts": "^3.0.2",
+ "standardx": "^7.0.0",
+ "typescript": "^4.0.0"
+ },
+ "files": [
+ "build",
+ "index.mjs",
+ "!*.d.ts"
+ ],
+ "engines": {
+ "node": ">=12"
+ }
+}
diff --git a/node_modules/color-convert/CHANGELOG.md b/node_modules/color-convert/CHANGELOG.md
new file mode 100644
index 0000000..0a7bce4
--- /dev/null
+++ b/node_modules/color-convert/CHANGELOG.md
@@ -0,0 +1,54 @@
+# 1.0.0 - 2016-01-07
+
+- Removed: unused speed test
+- Added: Automatic routing between previously unsupported conversions
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Removed: `convert()` class
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Changed: all functions to lookup dictionary
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Changed: `ansi` to `ansi256`
+([#27](https://github.com/Qix-/color-convert/pull/27))
+- Fixed: argument grouping for functions requiring only one argument
+([#27](https://github.com/Qix-/color-convert/pull/27))
+
+# 0.6.0 - 2015-07-23
+
+- Added: methods to handle
+[ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors:
+ - rgb2ansi16
+ - rgb2ansi
+ - hsl2ansi16
+ - hsl2ansi
+ - hsv2ansi16
+ - hsv2ansi
+ - hwb2ansi16
+ - hwb2ansi
+ - cmyk2ansi16
+ - cmyk2ansi
+ - keyword2ansi16
+ - keyword2ansi
+ - ansi162rgb
+ - ansi162hsl
+ - ansi162hsv
+ - ansi162hwb
+ - ansi162cmyk
+ - ansi162keyword
+ - ansi2rgb
+ - ansi2hsl
+ - ansi2hsv
+ - ansi2hwb
+ - ansi2cmyk
+ - ansi2keyword
+([#18](https://github.com/harthur/color-convert/pull/18))
+
+# 0.5.3 - 2015-06-02
+
+- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]`
+([#15](https://github.com/harthur/color-convert/issues/15))
+
+---
+
+Check out commit logs for older releases
diff --git a/node_modules/color-convert/LICENSE b/node_modules/color-convert/LICENSE
new file mode 100644
index 0000000..5b4c386
--- /dev/null
+++ b/node_modules/color-convert/LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
diff --git a/node_modules/color-convert/README.md b/node_modules/color-convert/README.md
new file mode 100644
index 0000000..d4b08fc
--- /dev/null
+++ b/node_modules/color-convert/README.md
@@ -0,0 +1,68 @@
+# color-convert
+
+[![Build Status](https://travis-ci.org/Qix-/color-convert.svg?branch=master)](https://travis-ci.org/Qix-/color-convert)
+
+Color-convert is a color conversion library for JavaScript and node.
+It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest):
+
+```js
+var convert = require('color-convert');
+
+convert.rgb.hsl(140, 200, 100); // [96, 48, 59]
+convert.keyword.rgb('blue'); // [0, 0, 255]
+
+var rgbChannels = convert.rgb.channels; // 3
+var cmykChannels = convert.cmyk.channels; // 4
+var ansiChannels = convert.ansi16.channels; // 1
+```
+
+# Install
+
+```console
+$ npm install color-convert
+```
+
+# API
+
+Simply get the property of the _from_ and _to_ conversion that you're looking for.
+
+All functions have a rounded and unrounded variant. By default, return values are rounded. To get the unrounded (raw) results, simply tack on `.raw` to the function.
+
+All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha).
+
+```js
+var convert = require('color-convert');
+
+// Hex to LAB
+convert.hex.lab('DEADBF'); // [ 76, 21, -2 ]
+convert.hex.lab.raw('DEADBF'); // [ 75.56213190997677, 20.653827952644754, -2.290532499330533 ]
+
+// RGB to CMYK
+convert.rgb.cmyk(167, 255, 4); // [ 35, 0, 98, 0 ]
+convert.rgb.cmyk.raw(167, 255, 4); // [ 34.509803921568626, 0, 98.43137254901961, 0 ]
+```
+
+### Arrays
+All functions that accept multiple arguments also support passing an array.
+
+Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
+
+```js
+var convert = require('color-convert');
+
+convert.rgb.hex(123, 45, 67); // '7B2D43'
+convert.rgb.hex([123, 45, 67]); // '7B2D43'
+```
+
+## Routing
+
+Conversions that don't have an _explicitly_ defined conversion (in [conversions.js](conversions.js)), but can be converted by means of sub-conversions (e.g. XYZ -> **RGB** -> CMYK), are automatically routed together. This allows just about any color model supported by `color-convert` to be converted to any other model, so long as a sub-conversion path exists. This is also true for conversions requiring more than one step in between (e.g. LCH -> **LAB** -> **XYZ** -> **RGB** -> Hex).
+
+Keep in mind that extensive conversions _may_ result in a loss of precision, and exist only to be complete. For a list of "direct" (single-step) conversions, see [conversions.js](conversions.js).
+
+# Contribute
+
+If there is a new model you would like to support, or want to add a direct conversion between two existing models, please send us a pull request.
+
+# License
+Copyright &copy; 2011-2016, Heather Arthur and Josh Junon. Licensed under the [MIT License](LICENSE).
diff --git a/node_modules/color-convert/conversions.js b/node_modules/color-convert/conversions.js
new file mode 100644
index 0000000..2657f26
--- /dev/null
+++ b/node_modules/color-convert/conversions.js
@@ -0,0 +1,839 @@
+/* MIT license */
+/* eslint-disable no-mixed-operators */
+const cssKeywords = require('color-name');
+
+// NOTE: conversions should only return primitive values (i.e. arrays, or
+// values that give correct `typeof` results).
+// do not use box values types (i.e. Number(), String(), etc.)
+
+const reverseKeywords = {};
+for (const key of Object.keys(cssKeywords)) {
+ reverseKeywords[cssKeywords[key]] = key;
+}
+
+const convert = {
+ rgb: {channels: 3, labels: 'rgb'},
+ hsl: {channels: 3, labels: 'hsl'},
+ hsv: {channels: 3, labels: 'hsv'},
+ hwb: {channels: 3, labels: 'hwb'},
+ cmyk: {channels: 4, labels: 'cmyk'},
+ xyz: {channels: 3, labels: 'xyz'},
+ lab: {channels: 3, labels: 'lab'},
+ lch: {channels: 3, labels: 'lch'},
+ hex: {channels: 1, labels: ['hex']},
+ keyword: {channels: 1, labels: ['keyword']},
+ ansi16: {channels: 1, labels: ['ansi16']},
+ ansi256: {channels: 1, labels: ['ansi256']},
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
+ gray: {channels: 1, labels: ['gray']}
+};
+
+module.exports = convert;
+
+// Hide .channels and .labels properties
+for (const model of Object.keys(convert)) {
+ if (!('channels' in convert[model])) {
+ throw new Error('missing channels property: ' + model);
+ }
+
+ if (!('labels' in convert[model])) {
+ throw new Error('missing channel labels property: ' + model);
+ }
+
+ if (convert[model].labels.length !== convert[model].channels) {
+ throw new Error('channel and label counts mismatch: ' + model);
+ }
+
+ const {channels, labels} = convert[model];
+ delete convert[model].channels;
+ delete convert[model].labels;
+ Object.defineProperty(convert[model], 'channels', {value: channels});
+ Object.defineProperty(convert[model], 'labels', {value: labels});
+}
+
+convert.rgb.hsl = function (rgb) {
+ const r = rgb[0] / 255;
+ const g = rgb[1] / 255;
+ const b = rgb[2] / 255;
+ const min = Math.min(r, g, b);
+ const max = Math.max(r, g, b);
+ const delta = max - min;
+ let h;
+ let s;
+
+ if (max === min) {
+ h = 0;
+ } else if (r === max) {
+ h = (g - b) / delta;
+ } else if (g === max) {
+ h = 2 + (b - r) / delta;
+ } else if (b === max) {
+ h = 4 + (r - g) / delta;
+ }
+
+ h = Math.min(h * 60, 360);
+
+ if (h < 0) {
+ h += 360;
+ }
+
+ const l = (min + max) / 2;
+
+ if (max === min) {
+ s = 0;
+ } else if (l <= 0.5) {
+ s = delta / (max + min);
+ } else {
+ s = delta / (2 - max - min);
+ }
+
+ return [h, s * 100, l * 100];
+};
+
+convert.rgb.hsv = function (rgb) {
+ let rdif;
+ let gdif;
+ let bdif;
+ let h;
+ let s;
+
+ const r = rgb[0] / 255;
+ const g = rgb[1] / 255;
+ const b = rgb[2] / 255;
+ const v = Math.max(r, g, b);
+ const diff = v - Math.min(r, g, b);
+ const diffc = function (c) {
+ return (v - c) / 6 / diff + 1 / 2;
+ };
+
+ if (diff === 0) {
+ h = 0;
+ s = 0;
+ } else {
+ s = diff / v;
+ rdif = diffc(r);
+ gdif = diffc(g);
+ bdif = diffc(b);
+
+ if (r === v) {
+ h = bdif - gdif;
+ } else if (g === v) {
+ h = (1 / 3) + rdif - bdif;
+ } else if (b === v) {
+ h = (2 / 3) + gdif - rdif;
+ }
+
+ if (h < 0) {
+ h += 1;
+ } else if (h > 1) {
+ h -= 1;
+ }
+ }
+
+ return [
+ h * 360,
+ s * 100,
+ v * 100
+ ];
+};
+
+convert.rgb.hwb = function (rgb) {
+ const r = rgb[0];
+ const g = rgb[1];
+ let b = rgb[2];
+ const h = convert.rgb.hsl(rgb)[0];
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
+
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
+
+ return [h, w * 100, b * 100];
+};
+
+convert.rgb.cmyk = function (rgb) {
+ const r = rgb[0] / 255;
+ const g = rgb[1] / 255;
+ const b = rgb[2] / 255;
+
+ const k = Math.min(1 - r, 1 - g, 1 - b);
+ const c = (1 - r - k) / (1 - k) || 0;
+ const m = (1 - g - k) / (1 - k) || 0;
+ const y = (1 - b - k) / (1 - k) || 0;
+
+ return [c * 100, m * 100, y * 100, k * 100];
+};
+
+function comparativeDistance(x, y) {
+ /*
+ See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
+ */
+ return (
+ ((x[0] - y[0]) ** 2) +
+ ((x[1] - y[1]) ** 2) +
+ ((x[2] - y[2]) ** 2)
+ );
+}
+
+convert.rgb.keyword = function (rgb) {
+ const reversed = reverseKeywords[rgb];
+ if (reversed) {
+ return reversed;
+ }
+
+ let currentClosestDistance = Infinity;
+ let currentClosestKeyword;
+
+ for (const keyword of Object.keys(cssKeywords)) {
+ const value = cssKeywords[keyword];
+
+ // Compute comparative distance
+ const distance = comparativeDistance(rgb, value);
+
+ // Check if its less, if so set as closest
+ if (distance < currentClosestDistance) {
+ currentClosestDistance = distance;
+ currentClosestKeyword = keyword;
+ }
+ }
+
+ return currentClosestKeyword;
+};
+
+convert.keyword.rgb = function (keyword) {
+ return cssKeywords[keyword];
+};
+
+convert.rgb.xyz = function (rgb) {
+ let r = rgb[0] / 255;
+ let g = rgb[1] / 255;
+ let b = rgb[2] / 255;
+
+ // Assume sRGB
+ r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
+ g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
+ b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
+
+ const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
+ const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
+ const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
+
+ return [x * 100, y * 100, z * 100];
+};
+
+convert.rgb.lab = function (rgb) {
+ const xyz = convert.rgb.xyz(rgb);
+ let x = xyz[0];
+ let y = xyz[1];
+ let z = xyz[2];
+
+ x /= 95.047;
+ y /= 100;
+ z /= 108.883;
+
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
+
+ const l = (116 * y) - 16;
+ const a = 500 * (x - y);
+ const b = 200 * (y - z);
+
+ return [l, a, b];
+};
+
+convert.hsl.rgb = function (hsl) {
+ const h = hsl[0] / 360;
+ const s = hsl[1] / 100;
+ const l = hsl[2] / 100;
+ let t2;
+ let t3;
+ let val;
+
+ if (s === 0) {
+ val = l * 255;
+ return [val, val, val];
+ }
+
+ if (l < 0.5) {
+ t2 = l * (1 + s);
+ } else {
+ t2 = l + s - l * s;
+ }
+
+ const t1 = 2 * l - t2;
+
+ const rgb = [0, 0, 0];
+ for (let i = 0; i < 3; i++) {
+ t3 = h + 1 / 3 * -(i - 1);
+ if (t3 < 0) {
+ t3++;
+ }
+
+ if (t3 > 1) {
+ t3--;
+ }
+
+ if (6 * t3 < 1) {
+ val = t1 + (t2 - t1) * 6 * t3;
+ } else if (2 * t3 < 1) {
+ val = t2;
+ } else if (3 * t3 < 2) {
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
+ } else {
+ val = t1;
+ }
+
+ rgb[i] = val * 255;
+ }
+
+ return rgb;
+};
+
+convert.hsl.hsv = function (hsl) {
+ const h = hsl[0];
+ let s = hsl[1] / 100;
+ let l = hsl[2] / 100;
+ let smin = s;
+ const lmin = Math.max(l, 0.01);
+
+ l *= 2;
+ s *= (l <= 1) ? l : 2 - l;
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
+ const v = (l + s) / 2;
+ const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
+
+ return [h, sv * 100, v * 100];
+};
+
+convert.hsv.rgb = function (hsv) {
+ const h = hsv[0] / 60;
+ const s = hsv[1] / 100;
+ let v = hsv[2] / 100;
+ const hi = Math.floor(h) % 6;
+
+ const f = h - Math.floor(h);
+ const p = 255 * v * (1 - s);
+ const q = 255 * v * (1 - (s * f));
+ const t = 255 * v * (1 - (s * (1 - f)));
+ v *= 255;
+
+ switch (hi) {
+ case 0:
+ return [v, t, p];
+ case 1:
+ return [q, v, p];
+ case 2:
+ return [p, v, t];
+ case 3:
+ return [p, q, v];
+ case 4:
+ return [t, p, v];
+ case 5:
+ return [v, p, q];
+ }
+};
+
+convert.hsv.hsl = function (hsv) {
+ const h = hsv[0];
+ const s = hsv[1] / 100;
+ const v = hsv[2] / 100;
+ const vmin = Math.max(v, 0.01);
+ let sl;
+ let l;
+
+ l = (2 - s) * v;
+ const lmin = (2 - s) * vmin;
+ sl = s * vmin;
+ sl /= (lmin <= 1) ? lmin : 2 - lmin;
+ sl = sl || 0;
+ l /= 2;
+
+ return [h, sl * 100, l * 100];
+};
+
+// http://dev.w3.org/csswg/css-color/#hwb-to-rgb
+convert.hwb.rgb = function (hwb) {
+ const h = hwb[0] / 360;
+ let wh = hwb[1] / 100;
+ let bl = hwb[2] / 100;
+ const ratio = wh + bl;
+ let f;
+
+ // Wh + bl cant be > 1
+ if (ratio > 1) {
+ wh /= ratio;
+ bl /= ratio;
+ }
+
+ const i = Math.floor(6 * h);
+ const v = 1 - bl;
+ f = 6 * h - i;
+
+ if ((i & 0x01) !== 0) {
+ f = 1 - f;
+ }
+
+ const n = wh + f * (v - wh); // Linear interpolation
+
+ let r;
+ let g;
+ let b;
+ /* eslint-disable max-statements-per-line,no-multi-spaces */
+ switch (i) {
+ default:
+ case 6:
+ case 0: r = v; g = n; b = wh; break;
+ case 1: r = n; g = v; b = wh; break;
+ case 2: r = wh; g = v; b = n; break;
+ case 3: r = wh; g = n; b = v; break;
+ case 4: r = n; g = wh; b = v; break;
+ case 5: r = v; g = wh; b = n; break;
+ }
+ /* eslint-enable max-statements-per-line,no-multi-spaces */
+
+ return [r * 255, g * 255, b * 255];
+};
+
+convert.cmyk.rgb = function (cmyk) {
+ const c = cmyk[0] / 100;
+ const m = cmyk[1] / 100;
+ const y = cmyk[2] / 100;
+ const k = cmyk[3] / 100;
+
+ const r = 1 - Math.min(1, c * (1 - k) + k);
+ const g = 1 - Math.min(1, m * (1 - k) + k);
+ const b = 1 - Math.min(1, y * (1 - k) + k);
+
+ return [r * 255, g * 255, b * 255];
+};
+
+convert.xyz.rgb = function (xyz) {
+ const x = xyz[0] / 100;
+ const y = xyz[1] / 100;
+ const z = xyz[2] / 100;
+ let r;
+ let g;
+ let b;
+
+ r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
+ g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
+ b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
+
+ // Assume sRGB
+ r = r > 0.0031308
+ ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
+ : r * 12.92;
+
+ g = g > 0.0031308
+ ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
+ : g * 12.92;
+
+ b = b > 0.0031308
+ ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
+ : b * 12.92;
+
+ r = Math.min(Math.max(0, r), 1);
+ g = Math.min(Math.max(0, g), 1);
+ b = Math.min(Math.max(0, b), 1);
+
+ return [r * 255, g * 255, b * 255];
+};
+
+convert.xyz.lab = function (xyz) {
+ let x = xyz[0];
+ let y = xyz[1];
+ let z = xyz[2];
+
+ x /= 95.047;
+ y /= 100;
+ z /= 108.883;
+
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
+
+ const l = (116 * y) - 16;
+ const a = 500 * (x - y);
+ const b = 200 * (y - z);
+
+ return [l, a, b];
+};
+
+convert.lab.xyz = function (lab) {
+ const l = lab[0];
+ const a = lab[1];
+ const b = lab[2];
+ let x;
+ let y;
+ let z;
+
+ y = (l + 16) / 116;
+ x = a / 500 + y;
+ z = y - b / 200;
+
+ const y2 = y ** 3;
+ const x2 = x ** 3;
+ const z2 = z ** 3;
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
+
+ x *= 95.047;
+ y *= 100;
+ z *= 108.883;
+
+ return [x, y, z];
+};
+
+convert.lab.lch = function (lab) {
+ const l = lab[0];
+ const a = lab[1];
+ const b = lab[2];
+ let h;
+
+ const hr = Math.atan2(b, a);
+ h = hr * 360 / 2 / Math.PI;
+
+ if (h < 0) {
+ h += 360;
+ }
+
+ const c = Math.sqrt(a * a + b * b);
+
+ return [l, c, h];
+};
+
+convert.lch.lab = function (lch) {
+ const l = lch[0];
+ const c = lch[1];
+ const h = lch[2];
+
+ const hr = h / 360 * 2 * Math.PI;
+ const a = c * Math.cos(hr);
+ const b = c * Math.sin(hr);
+
+ return [l, a, b];
+};
+
+convert.rgb.ansi16 = function (args, saturation = null) {
+ const [r, g, b] = args;
+ let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
+
+ value = Math.round(value / 50);
+
+ if (value === 0) {
+ return 30;
+ }
+
+ let ansi = 30
+ + ((Math.round(b / 255) << 2)
+ | (Math.round(g / 255) << 1)
+ | Math.round(r / 255));
+
+ if (value === 2) {
+ ansi += 60;
+ }
+
+ return ansi;
+};
+
+convert.hsv.ansi16 = function (args) {
+ // Optimization here; we already know the value and don't need to get
+ // it converted for us.
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
+};
+
+convert.rgb.ansi256 = function (args) {
+ const r = args[0];
+ const g = args[1];
+ const b = args[2];
+
+ // We use the extended greyscale palette here, with the exception of
+ // black and white. normal palette only has 4 greyscale shades.
+ if (r === g && g === b) {
+ if (r < 8) {
+ return 16;
+ }
+
+ if (r > 248) {
+ return 231;
+ }
+
+ return Math.round(((r - 8) / 247) * 24) + 232;
+ }
+
+ const ansi = 16
+ + (36 * Math.round(r / 255 * 5))
+ + (6 * Math.round(g / 255 * 5))
+ + Math.round(b / 255 * 5);
+
+ return ansi;
+};
+
+convert.ansi16.rgb = function (args) {
+ let color = args % 10;
+
+ // Handle greyscale
+ if (color === 0 || color === 7) {
+ if (args > 50) {
+ color += 3.5;
+ }
+
+ color = color / 10.5 * 255;
+
+ return [color, color, color];
+ }
+
+ const mult = (~~(args > 50) + 1) * 0.5;
+ const r = ((color & 1) * mult) * 255;
+ const g = (((color >> 1) & 1) * mult) * 255;
+ const b = (((color >> 2) & 1) * mult) * 255;
+
+ return [r, g, b];
+};
+
+convert.ansi256.rgb = function (args) {
+ // Handle greyscale
+ if (args >= 232) {
+ const c = (args - 232) * 10 + 8;
+ return [c, c, c];
+ }
+
+ args -= 16;
+
+ let rem;
+ const r = Math.floor(args / 36) / 5 * 255;
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
+ const b = (rem % 6) / 5 * 255;
+
+ return [r, g, b];
+};
+
+convert.rgb.hex = function (args) {
+ const integer = ((Math.round(args[0]) & 0xFF) << 16)
+ + ((Math.round(args[1]) & 0xFF) << 8)
+ + (Math.round(args[2]) & 0xFF);
+
+ const string = integer.toString(16).toUpperCase();
+ return '000000'.substring(string.length) + string;
+};
+
+convert.hex.rgb = function (args) {
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
+ if (!match) {
+ return [0, 0, 0];
+ }
+
+ let colorString = match[0];
+
+ if (match[0].length === 3) {
+ colorString = colorString.split('').map(char => {
+ return char + char;
+ }).join('');
+ }
+
+ const integer = parseInt(colorString, 16);
+ const r = (integer >> 16) & 0xFF;
+ const g = (integer >> 8) & 0xFF;
+ const b = integer & 0xFF;
+
+ return [r, g, b];
+};
+
+convert.rgb.hcg = function (rgb) {
+ const r = rgb[0] / 255;
+ const g = rgb[1] / 255;
+ const b = rgb[2] / 255;
+ const max = Math.max(Math.max(r, g), b);
+ const min = Math.min(Math.min(r, g), b);
+ const chroma = (max - min);
+ let grayscale;
+ let hue;
+
+ if (chroma < 1) {
+ grayscale = min / (1 - chroma);
+ } else {
+ grayscale = 0;
+ }
+
+ if (chroma <= 0) {
+ hue = 0;
+ } else
+ if (max === r) {
+ hue = ((g - b) / chroma) % 6;
+ } else
+ if (max === g) {
+ hue = 2 + (b - r) / chroma;
+ } else {
+ hue = 4 + (r - g) / chroma;
+ }
+
+ hue /= 6;
+ hue %= 1;
+
+ return [hue * 360, chroma * 100, grayscale * 100];
+};
+
+convert.hsl.hcg = function (hsl) {
+ const s = hsl[1] / 100;
+ const l = hsl[2] / 100;
+
+ const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
+
+ let f = 0;
+ if (c < 1.0) {
+ f = (l - 0.5 * c) / (1.0 - c);
+ }
+
+ return [hsl[0], c * 100, f * 100];
+};
+
+convert.hsv.hcg = function (hsv) {
+ const s = hsv[1] / 100;
+ const v = hsv[2] / 100;
+
+ const c = s * v;
+ let f = 0;
+
+ if (c < 1.0) {
+ f = (v - c) / (1 - c);
+ }
+
+ return [hsv[0], c * 100, f * 100];
+};
+
+convert.hcg.rgb = function (hcg) {
+ const h = hcg[0] / 360;
+ const c = hcg[1] / 100;
+ const g = hcg[2] / 100;
+
+ if (c === 0.0) {
+ return [g * 255, g * 255, g * 255];
+ }
+
+ const pure = [0, 0, 0];
+ const hi = (h % 1) * 6;
+ const v = hi % 1;
+ const w = 1 - v;
+ let mg = 0;
+
+ /* eslint-disable max-statements-per-line */
+ switch (Math.floor(hi)) {
+ case 0:
+ pure[0] = 1; pure[1] = v; pure[2] = 0; break;
+ case 1:
+ pure[0] = w; pure[1] = 1; pure[2] = 0; break;
+ case 2:
+ pure[0] = 0; pure[1] = 1; pure[2] = v; break;
+ case 3:
+ pure[0] = 0; pure[1] = w; pure[2] = 1; break;
+ case 4:
+ pure[0] = v; pure[1] = 0; pure[2] = 1; break;
+ default:
+ pure[0] = 1; pure[1] = 0; pure[2] = w;
+ }
+ /* eslint-enable max-statements-per-line */
+
+ mg = (1.0 - c) * g;
+
+ return [
+ (c * pure[0] + mg) * 255,
+ (c * pure[1] + mg) * 255,
+ (c * pure[2] + mg) * 255
+ ];
+};
+
+convert.hcg.hsv = function (hcg) {
+ const c = hcg[1] / 100;
+ const g = hcg[2] / 100;
+
+ const v = c + g * (1.0 - c);
+ let f = 0;
+
+ if (v > 0.0) {
+ f = c / v;
+ }
+
+ return [hcg[0], f * 100, v * 100];
+};
+
+convert.hcg.hsl = function (hcg) {
+ const c = hcg[1] / 100;
+ const g = hcg[2] / 100;
+
+ const l = g * (1.0 - c) + 0.5 * c;
+ let s = 0;
+
+ if (l > 0.0 && l < 0.5) {
+ s = c / (2 * l);
+ } else
+ if (l >= 0.5 && l < 1.0) {
+ s = c / (2 * (1 - l));
+ }
+
+ return [hcg[0], s * 100, l * 100];
+};
+
+convert.hcg.hwb = function (hcg) {
+ const c = hcg[1] / 100;
+ const g = hcg[2] / 100;
+ const v = c + g * (1.0 - c);
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
+};
+
+convert.hwb.hcg = function (hwb) {
+ const w = hwb[1] / 100;
+ const b = hwb[2] / 100;
+ const v = 1 - b;
+ const c = v - w;
+ let g = 0;
+
+ if (c < 1) {
+ g = (v - c) / (1 - c);
+ }
+
+ return [hwb[0], c * 100, g * 100];
+};
+
+convert.apple.rgb = function (apple) {
+ return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
+};
+
+convert.rgb.apple = function (rgb) {
+ return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
+};
+
+convert.gray.rgb = function (args) {
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
+};
+
+convert.gray.hsl = function (args) {
+ return [0, 0, args[0]];
+};
+
+convert.gray.hsv = convert.gray.hsl;
+
+convert.gray.hwb = function (gray) {
+ return [0, 100, gray[0]];
+};
+
+convert.gray.cmyk = function (gray) {
+ return [0, 0, 0, gray[0]];
+};
+
+convert.gray.lab = function (gray) {
+ return [gray[0], 0, 0];
+};
+
+convert.gray.hex = function (gray) {
+ const val = Math.round(gray[0] / 100 * 255) & 0xFF;
+ const integer = (val << 16) + (val << 8) + val;
+
+ const string = integer.toString(16).toUpperCase();
+ return '000000'.substring(string.length) + string;
+};
+
+convert.rgb.gray = function (rgb) {
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
+ return [val / 255 * 100];
+};
diff --git a/node_modules/color-convert/index.js b/node_modules/color-convert/index.js
new file mode 100644
index 0000000..b648e57
--- /dev/null
+++ b/node_modules/color-convert/index.js
@@ -0,0 +1,81 @@
+const conversions = require('./conversions');
+const route = require('./route');
+
+const convert = {};
+
+const models = Object.keys(conversions);
+
+function wrapRaw(fn) {
+ const wrappedFn = function (...args) {
+ const arg0 = args[0];
+ if (arg0 === undefined || arg0 === null) {
+ return arg0;
+ }
+
+ if (arg0.length > 1) {
+ args = arg0;
+ }
+
+ return fn(args);
+ };
+
+ // Preserve .conversion property if there is one
+ if ('conversion' in fn) {
+ wrappedFn.conversion = fn.conversion;
+ }
+
+ return wrappedFn;
+}
+
+function wrapRounded(fn) {
+ const wrappedFn = function (...args) {
+ const arg0 = args[0];
+
+ if (arg0 === undefined || arg0 === null) {
+ return arg0;
+ }
+
+ if (arg0.length > 1) {
+ args = arg0;
+ }
+
+ const result = fn(args);
+
+ // We're assuming the result is an array here.
+ // see notice in conversions.js; don't use box types
+ // in conversion functions.
+ if (typeof result === 'object') {
+ for (let len = result.length, i = 0; i < len; i++) {
+ result[i] = Math.round(result[i]);
+ }
+ }
+
+ return result;
+ };
+
+ // Preserve .conversion property if there is one
+ if ('conversion' in fn) {
+ wrappedFn.conversion = fn.conversion;
+ }
+
+ return wrappedFn;
+}
+
+models.forEach(fromModel => {
+ convert[fromModel] = {};
+
+ Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
+ Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
+
+ const routes = route(fromModel);
+ const routeModels = Object.keys(routes);
+
+ routeModels.forEach(toModel => {
+ const fn = routes[toModel];
+
+ convert[fromModel][toModel] = wrapRounded(fn);
+ convert[fromModel][toModel].raw = wrapRaw(fn);
+ });
+});
+
+module.exports = convert;
diff --git a/node_modules/color-convert/package.json b/node_modules/color-convert/package.json
new file mode 100644
index 0000000..6e48000
--- /dev/null
+++ b/node_modules/color-convert/package.json
@@ -0,0 +1,48 @@
+{
+ "name": "color-convert",
+ "description": "Plain color conversion functions",
+ "version": "2.0.1",
+ "author": "Heather Arthur <fayearthur@gmail.com>",
+ "license": "MIT",
+ "repository": "Qix-/color-convert",
+ "scripts": {
+ "pretest": "xo",
+ "test": "node test/basic.js"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ },
+ "keywords": [
+ "color",
+ "colour",
+ "convert",
+ "converter",
+ "conversion",
+ "rgb",
+ "hsl",
+ "hsv",
+ "hwb",
+ "cmyk",
+ "ansi",
+ "ansi16"
+ ],
+ "files": [
+ "index.js",
+ "conversions.js",
+ "route.js"
+ ],
+ "xo": {
+ "rules": {
+ "default-case": 0,
+ "no-inline-comments": 0,
+ "operator-linebreak": 0
+ }
+ },
+ "devDependencies": {
+ "chalk": "^2.4.2",
+ "xo": "^0.24.0"
+ },
+ "dependencies": {
+ "color-name": "~1.1.4"
+ }
+}
diff --git a/node_modules/color-convert/route.js b/node_modules/color-convert/route.js
new file mode 100644
index 0000000..1a08521
--- /dev/null
+++ b/node_modules/color-convert/route.js
@@ -0,0 +1,97 @@
+const conversions = require('./conversions');
+
+/*
+ This function routes a model to all other models.
+
+ all functions that are routed have a property `.conversion` attached
+ to the returned synthetic function. This property is an array
+ of strings, each with the steps in between the 'from' and 'to'
+ color models (inclusive).
+
+ conversions that are not possible simply are not included.
+*/
+
+function buildGraph() {
+ const graph = {};
+ // https://jsperf.com/object-keys-vs-for-in-with-closure/3
+ const models = Object.keys(conversions);
+
+ for (let len = models.length, i = 0; i < len; i++) {
+ graph[models[i]] = {
+ // http://jsperf.com/1-vs-infinity
+ // micro-opt, but this is simple.
+ distance: -1,
+ parent: null
+ };
+ }
+
+ return graph;
+}
+
+// https://en.wikipedia.org/wiki/Breadth-first_search
+function deriveBFS(fromModel) {
+ const graph = buildGraph();
+ const queue = [fromModel]; // Unshift -> queue -> pop
+
+ graph[fromModel].distance = 0;
+
+ while (queue.length) {
+ const current = queue.pop();
+ const adjacents = Object.keys(conversions[current]);
+
+ for (let len = adjacents.length, i = 0; i < len; i++) {
+ const adjacent = adjacents[i];
+ const node = graph[adjacent];
+
+ if (node.distance === -1) {
+ node.distance = graph[current].distance + 1;
+ node.parent = current;
+ queue.unshift(adjacent);
+ }
+ }
+ }
+
+ return graph;
+}
+
+function link(from, to) {
+ return function (args) {
+ return to(from(args));
+ };
+}
+
+function wrapConversion(toModel, graph) {
+ const path = [graph[toModel].parent, toModel];
+ let fn = conversions[graph[toModel].parent][toModel];
+
+ let cur = graph[toModel].parent;
+ while (graph[cur].parent) {
+ path.unshift(graph[cur].parent);
+ fn = link(conversions[graph[cur].parent][cur], fn);
+ cur = graph[cur].parent;
+ }
+
+ fn.conversion = path;
+ return fn;
+}
+
+module.exports = function (fromModel) {
+ const graph = deriveBFS(fromModel);
+ const conversion = {};
+
+ const models = Object.keys(graph);
+ for (let len = models.length, i = 0; i < len; i++) {
+ const toModel = models[i];
+ const node = graph[toModel];
+
+ if (node.parent === null) {
+ // No possible conversion, or this node is the source model.
+ continue;
+ }
+
+ conversion[toModel] = wrapConversion(toModel, graph);
+ }
+
+ return conversion;
+};
+
diff --git a/node_modules/color-name/LICENSE b/node_modules/color-name/LICENSE
new file mode 100644
index 0000000..c6b1001
--- /dev/null
+++ b/node_modules/color-name/LICENSE
@@ -0,0 +1,8 @@
+The MIT License (MIT)
+Copyright (c) 2015 Dmitry Ivanov
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/node_modules/color-name/README.md b/node_modules/color-name/README.md
new file mode 100644
index 0000000..932b979
--- /dev/null
+++ b/node_modules/color-name/README.md
@@ -0,0 +1,11 @@
+A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors.
+
+[![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/)
+
+
+```js
+var colors = require('color-name');
+colors.red //[255,0,0]
+```
+
+<a href="LICENSE"><img src="https://upload.wikimedia.org/wikipedia/commons/0/0c/MIT_logo.svg" width="120"/></a>
diff --git a/node_modules/color-name/index.js b/node_modules/color-name/index.js
new file mode 100644
index 0000000..b7c198a
--- /dev/null
+++ b/node_modules/color-name/index.js
@@ -0,0 +1,152 @@
+'use strict'
+
+module.exports = {
+ "aliceblue": [240, 248, 255],
+ "antiquewhite": [250, 235, 215],
+ "aqua": [0, 255, 255],
+ "aquamarine": [127, 255, 212],
+ "azure": [240, 255, 255],
+ "beige": [245, 245, 220],
+ "bisque": [255, 228, 196],
+ "black": [0, 0, 0],
+ "blanchedalmond": [255, 235, 205],
+ "blue": [0, 0, 255],
+ "blueviolet": [138, 43, 226],
+ "brown": [165, 42, 42],
+ "burlywood": [222, 184, 135],
+ "cadetblue": [95, 158, 160],
+ "chartreuse": [127, 255, 0],
+ "chocolate": [210, 105, 30],
+ "coral": [255, 127, 80],
+ "cornflowerblue": [100, 149, 237],
+ "cornsilk": [255, 248, 220],
+ "crimson": [220, 20, 60],
+ "cyan": [0, 255, 255],
+ "darkblue": [0, 0, 139],
+ "darkcyan": [0, 139, 139],
+ "darkgoldenrod": [184, 134, 11],
+ "darkgray": [169, 169, 169],
+ "darkgreen": [0, 100, 0],
+ "darkgrey": [169, 169, 169],
+ "darkkhaki": [189, 183, 107],
+ "darkmagenta": [139, 0, 139],
+ "darkolivegreen": [85, 107, 47],
+ "darkorange": [255, 140, 0],
+ "darkorchid": [153, 50, 204],
+ "darkred": [139, 0, 0],
+ "darksalmon": [233, 150, 122],
+ "darkseagreen": [143, 188, 143],
+ "darkslateblue": [72, 61, 139],
+ "darkslategray": [47, 79, 79],
+ "darkslategrey": [47, 79, 79],
+ "darkturquoise": [0, 206, 209],
+ "darkviolet": [148, 0, 211],
+ "deeppink": [255, 20, 147],
+ "deepskyblue": [0, 191, 255],
+ "dimgray": [105, 105, 105],
+ "dimgrey": [105, 105, 105],
+ "dodgerblue": [30, 144, 255],
+ "firebrick": [178, 34, 34],
+ "floralwhite": [255, 250, 240],
+ "forestgreen": [34, 139, 34],
+ "fuchsia": [255, 0, 255],
+ "gainsboro": [220, 220, 220],
+ "ghostwhite": [248, 248, 255],
+ "gold": [255, 215, 0],
+ "goldenrod": [218, 165, 32],
+ "gray": [128, 128, 128],
+ "green": [0, 128, 0],
+ "greenyellow": [173, 255, 47],
+ "grey": [128, 128, 128],
+ "honeydew": [240, 255, 240],
+ "hotpink": [255, 105, 180],
+ "indianred": [205, 92, 92],
+ "indigo": [75, 0, 130],
+ "ivory": [255, 255, 240],
+ "khaki": [240, 230, 140],
+ "lavender": [230, 230, 250],
+ "lavenderblush": [255, 240, 245],
+ "lawngreen": [124, 252, 0],
+ "lemonchiffon": [255, 250, 205],
+ "lightblue": [173, 216, 230],
+ "lightcoral": [240, 128, 128],
+ "lightcyan": [224, 255, 255],
+ "lightgoldenrodyellow": [250, 250, 210],
+ "lightgray": [211, 211, 211],
+ "lightgreen": [144, 238, 144],
+ "lightgrey": [211, 211, 211],
+ "lightpink": [255, 182, 193],
+ "lightsalmon": [255, 160, 122],
+ "lightseagreen": [32, 178, 170],
+ "lightskyblue": [135, 206, 250],
+ "lightslategray": [119, 136, 153],
+ "lightslategrey": [119, 136, 153],
+ "lightsteelblue": [176, 196, 222],
+ "lightyellow": [255, 255, 224],
+ "lime": [0, 255, 0],
+ "limegreen": [50, 205, 50],
+ "linen": [250, 240, 230],
+ "magenta": [255, 0, 255],
+ "maroon": [128, 0, 0],
+ "mediumaquamarine": [102, 205, 170],
+ "mediumblue": [0, 0, 205],
+ "mediumorchid": [186, 85, 211],
+ "mediumpurple": [147, 112, 219],
+ "mediumseagreen": [60, 179, 113],
+ "mediumslateblue": [123, 104, 238],
+ "mediumspringgreen": [0, 250, 154],
+ "mediumturquoise": [72, 209, 204],
+ "mediumvioletred": [199, 21, 133],
+ "midnightblue": [25, 25, 112],
+ "mintcream": [245, 255, 250],
+ "mistyrose": [255, 228, 225],
+ "moccasin": [255, 228, 181],
+ "navajowhite": [255, 222, 173],
+ "navy": [0, 0, 128],
+ "oldlace": [253, 245, 230],
+ "olive": [128, 128, 0],
+ "olivedrab": [107, 142, 35],
+ "orange": [255, 165, 0],
+ "orangered": [255, 69, 0],
+ "orchid": [218, 112, 214],
+ "palegoldenrod": [238, 232, 170],
+ "palegreen": [152, 251, 152],
+ "paleturquoise": [175, 238, 238],
+ "palevioletred": [219, 112, 147],
+ "papayawhip": [255, 239, 213],
+ "peachpuff": [255, 218, 185],
+ "peru": [205, 133, 63],
+ "pink": [255, 192, 203],
+ "plum": [221, 160, 221],
+ "powderblue": [176, 224, 230],
+ "purple": [128, 0, 128],
+ "rebeccapurple": [102, 51, 153],
+ "red": [255, 0, 0],
+ "rosybrown": [188, 143, 143],
+ "royalblue": [65, 105, 225],
+ "saddlebrown": [139, 69, 19],
+ "salmon": [250, 128, 114],
+ "sandybrown": [244, 164, 96],
+ "seagreen": [46, 139, 87],
+ "seashell": [255, 245, 238],
+ "sienna": [160, 82, 45],
+ "silver": [192, 192, 192],
+ "skyblue": [135, 206, 235],
+ "slateblue": [106, 90, 205],
+ "slategray": [112, 128, 144],
+ "slategrey": [112, 128, 144],
+ "snow": [255, 250, 250],
+ "springgreen": [0, 255, 127],
+ "steelblue": [70, 130, 180],
+ "tan": [210, 180, 140],
+ "teal": [0, 128, 128],
+ "thistle": [216, 191, 216],
+ "tomato": [255, 99, 71],
+ "turquoise": [64, 224, 208],
+ "violet": [238, 130, 238],
+ "wheat": [245, 222, 179],
+ "white": [255, 255, 255],
+ "whitesmoke": [245, 245, 245],
+ "yellow": [255, 255, 0],
+ "yellowgreen": [154, 205, 50]
+};
diff --git a/node_modules/color-name/package.json b/node_modules/color-name/package.json
new file mode 100644
index 0000000..782dd82
--- /dev/null
+++ b/node_modules/color-name/package.json
@@ -0,0 +1,28 @@
+{
+ "name": "color-name",
+ "version": "1.1.4",
+ "description": "A list of color names and its values",
+ "main": "index.js",
+ "files": [
+ "index.js"
+ ],
+ "scripts": {
+ "test": "node test.js"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git@github.com:colorjs/color-name.git"
+ },
+ "keywords": [
+ "color-name",
+ "color",
+ "color-keyword",
+ "keyword"
+ ],
+ "author": "DY <dfcreative@gmail.com>",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/colorjs/color-name/issues"
+ },
+ "homepage": "https://github.com/colorjs/color-name"
+}
diff --git a/node_modules/emoji-regex/LICENSE-MIT.txt b/node_modules/emoji-regex/LICENSE-MIT.txt
new file mode 100644
index 0000000..a41e0a7
--- /dev/null
+++ b/node_modules/emoji-regex/LICENSE-MIT.txt
@@ -0,0 +1,20 @@
+Copyright Mathias Bynens <https://mathiasbynens.be/>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/emoji-regex/README.md b/node_modules/emoji-regex/README.md
new file mode 100644
index 0000000..f10e173
--- /dev/null
+++ b/node_modules/emoji-regex/README.md
@@ -0,0 +1,73 @@
+# emoji-regex [![Build status](https://travis-ci.org/mathiasbynens/emoji-regex.svg?branch=master)](https://travis-ci.org/mathiasbynens/emoji-regex)
+
+_emoji-regex_ offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard.
+
+This repository contains a script that generates this regular expression based on [the data from Unicode v12](https://github.com/mathiasbynens/unicode-12.0.0). Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard.
+
+## Installation
+
+Via [npm](https://www.npmjs.com/):
+
+```bash
+npm install emoji-regex
+```
+
+In [Node.js](https://nodejs.org/):
+
+```js
+const emojiRegex = require('emoji-regex');
+// Note: because the regular expression has the global flag set, this module
+// exports a function that returns the regex rather than exporting the regular
+// expression itself, to make it impossible to (accidentally) mutate the
+// original regular expression.
+
+const text = `
+\u{231A}: ⌚ default emoji presentation character (Emoji_Presentation)
+\u{2194}\u{FE0F}: ↔️ default text presentation character rendered as emoji
+\u{1F469}: 👩 emoji modifier base (Emoji_Modifier_Base)
+\u{1F469}\u{1F3FF}: 👩🏿 emoji modifier base followed by a modifier
+`;
+
+const regex = emojiRegex();
+let match;
+while (match = regex.exec(text)) {
+ const emoji = match[0];
+ console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`);
+}
+```
+
+Console output:
+
+```
+Matched sequence ⌚ — code points: 1
+Matched sequence ⌚ — code points: 1
+Matched sequence ↔️ — code points: 2
+Matched sequence ↔️ — code points: 2
+Matched sequence 👩 — code points: 1
+Matched sequence 👩 — code points: 1
+Matched sequence 👩🏿 — code points: 2
+Matched sequence 👩🏿 — code points: 2
+```
+
+To match emoji in their textual representation as well (i.e. emoji that are not `Emoji_Presentation` symbols and that aren’t forced to render as emoji by a variation selector), `require` the other regex:
+
+```js
+const emojiRegex = require('emoji-regex/text.js');
+```
+
+Additionally, in environments which support ES2015 Unicode escapes, you may `require` ES2015-style versions of the regexes:
+
+```js
+const emojiRegex = require('emoji-regex/es2015/index.js');
+const emojiRegexText = require('emoji-regex/es2015/text.js');
+```
+
+## Author
+
+| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
+|---|
+| [Mathias Bynens](https://mathiasbynens.be/) |
+
+## License
+
+_emoji-regex_ is available under the [MIT](https://mths.be/mit) license.
diff --git a/node_modules/emoji-regex/es2015/index.js b/node_modules/emoji-regex/es2015/index.js
new file mode 100644
index 0000000..b4cf3dc
--- /dev/null
+++ b/node_modules/emoji-regex/es2015/index.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = () => {
+ // https://mths.be/emoji
+ return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\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\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu;
+};
diff --git a/node_modules/emoji-regex/es2015/text.js b/node_modules/emoji-regex/es2015/text.js
new file mode 100644
index 0000000..780309d
--- /dev/null
+++ b/node_modules/emoji-regex/es2015/text.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = () => {
+ // https://mths.be/emoji
+ return /\u{1F3F4}\u{E0067}\u{E0062}(?:\u{E0065}\u{E006E}\u{E0067}|\u{E0073}\u{E0063}\u{E0074}|\u{E0077}\u{E006C}\u{E0073})\u{E007F}|\u{1F468}(?:\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}\u{1F3FB}|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FE}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D)?\u{1F468}|[\u{1F468}\u{1F469}]\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}]|[\u{1F468}\u{1F469}]\u200D[\u{1F466}\u{1F467}]|[\u2695\u2696\u2708]\uFE0F|[\u{1F466}\u{1F467}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|(?:\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708])\uFE0F|\u{1F3FB}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}]|[\u{1F3FB}-\u{1F3FF}])|(?:\u{1F9D1}\u{1F3FB}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F469})\u{1F3FB}|\u{1F9D1}(?:\u{1F3FF}\u200D\u{1F91D}\u200D\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u200D\u{1F91D}\u200D\u{1F9D1})|(?:\u{1F9D1}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FF}\u200D\u{1F91D}\u200D[\u{1F468}\u{1F469}])[\u{1F3FB}-\u{1F3FE}]|(?:\u{1F9D1}\u{1F3FC}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}\u{1F3FC}]|\u{1F469}(?:\u{1F3FE}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}-\u{1F3FD}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FC}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FD}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FB}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FC}-\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FD}\u200D(?:\u{1F91D}\u200D\u{1F468}[\u{1F3FB}\u{1F3FC}\u{1F3FE}\u{1F3FF}]|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u200D(?:\u2764\uFE0F\u200D(?:\u{1F48B}\u200D[\u{1F468}\u{1F469}]|[\u{1F468}\u{1F469}])|[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F3FF}\u200D[\u{1F33E}\u{1F373}\u{1F393}\u{1F3A4}\u{1F3A8}\u{1F3EB}\u{1F3ED}\u{1F4BB}\u{1F4BC}\u{1F527}\u{1F52C}\u{1F680}\u{1F692}\u{1F9AF}-\u{1F9B3}\u{1F9BC}\u{1F9BD}])|\u{1F469}\u200D\u{1F469}\u200D(?:\u{1F466}\u200D\u{1F466}|\u{1F467}\u200D[\u{1F466}\u{1F467}])|(?:\u{1F9D1}\u{1F3FD}\u200D\u{1F91D}\u200D\u{1F9D1}|\u{1F469}\u{1F3FE}\u200D\u{1F91D}\u200D\u{1F469})[\u{1F3FB}-\u{1F3FD}]|\u{1F469}\u200D\u{1F466}\u200D\u{1F466}|\u{1F469}\u200D\u{1F469}\u200D[\u{1F466}\u{1F467}]|(?:\u{1F441}\uFE0F\u200D\u{1F5E8}|\u{1F469}(?:\u{1F3FF}\u200D[\u2695\u2696\u2708]|\u{1F3FE}\u200D[\u2695\u2696\u2708]|\u{1F3FC}\u200D[\u2695\u2696\u2708]|\u{1F3FB}\u200D[\u2695\u2696\u2708]|\u{1F3FD}\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}]\uFE0F|[\u{1F46F}\u{1F93C}\u{1F9DE}\u{1F9DF}])\u200D[\u2640\u2642]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}](?:[\u{1F3FB}-\u{1F3FF}]\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\u{1F3F4}\u200D\u2620)\uFE0F|\u{1F469}\u200D\u{1F467}\u200D[\u{1F466}\u{1F467}]|\u{1F3F3}\uFE0F\u200D\u{1F308}|\u{1F415}\u200D\u{1F9BA}|\u{1F469}\u200D\u{1F466}|\u{1F469}\u200D\u{1F467}|\u{1F1FD}\u{1F1F0}|\u{1F1F4}\u{1F1F2}|\u{1F1F6}\u{1F1E6}|[#\*0-9]\uFE0F\u20E3|\u{1F1E7}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EF}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1F9}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1ED}\u{1F1EF}-\u{1F1F4}\u{1F1F7}\u{1F1F9}\u{1F1FB}\u{1F1FC}\u{1F1FF}]|\u{1F1EA}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1ED}\u{1F1F7}-\u{1F1FA}]|\u{1F9D1}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F7}[\u{1F1EA}\u{1F1F4}\u{1F1F8}\u{1F1FA}\u{1F1FC}]|\u{1F469}[\u{1F3FB}-\u{1F3FF}]|\u{1F1F2}[\u{1F1E6}\u{1F1E8}-\u{1F1ED}\u{1F1F0}-\u{1F1FF}]|\u{1F1E6}[\u{1F1E8}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F2}\u{1F1F4}\u{1F1F6}-\u{1F1FA}\u{1F1FC}\u{1F1FD}\u{1F1FF}]|\u{1F1F0}[\u{1F1EA}\u{1F1EC}-\u{1F1EE}\u{1F1F2}\u{1F1F3}\u{1F1F5}\u{1F1F7}\u{1F1FC}\u{1F1FE}\u{1F1FF}]|\u{1F1ED}[\u{1F1F0}\u{1F1F2}\u{1F1F3}\u{1F1F7}\u{1F1F9}\u{1F1FA}]|\u{1F1E9}[\u{1F1EA}\u{1F1EC}\u{1F1EF}\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1FF}]|\u{1F1FE}[\u{1F1EA}\u{1F1F9}]|\u{1F1EC}[\u{1F1E6}\u{1F1E7}\u{1F1E9}-\u{1F1EE}\u{1F1F1}-\u{1F1F3}\u{1F1F5}-\u{1F1FA}\u{1F1FC}\u{1F1FE}]|\u{1F1F8}[\u{1F1E6}-\u{1F1EA}\u{1F1EC}-\u{1F1F4}\u{1F1F7}-\u{1F1F9}\u{1F1FB}\u{1F1FD}-\u{1F1FF}]|\u{1F1EB}[\u{1F1EE}-\u{1F1F0}\u{1F1F2}\u{1F1F4}\u{1F1F7}]|\u{1F1F5}[\u{1F1E6}\u{1F1EA}-\u{1F1ED}\u{1F1F0}-\u{1F1F3}\u{1F1F7}-\u{1F1F9}\u{1F1FC}\u{1F1FE}]|\u{1F1FB}[\u{1F1E6}\u{1F1E8}\u{1F1EA}\u{1F1EC}\u{1F1EE}\u{1F1F3}\u{1F1FA}]|\u{1F1F3}[\u{1F1E6}\u{1F1E8}\u{1F1EA}-\u{1F1EC}\u{1F1EE}\u{1F1F1}\u{1F1F4}\u{1F1F5}\u{1F1F7}\u{1F1FA}\u{1F1FF}]|\u{1F1E8}[\u{1F1E6}\u{1F1E8}\u{1F1E9}\u{1F1EB}-\u{1F1EE}\u{1F1F0}-\u{1F1F5}\u{1F1F7}\u{1F1FA}-\u{1F1FF}]|\u{1F1F1}[\u{1F1E6}-\u{1F1E8}\u{1F1EE}\u{1F1F0}\u{1F1F7}-\u{1F1FB}\u{1F1FE}]|\u{1F1FF}[\u{1F1E6}\u{1F1F2}\u{1F1FC}]|\u{1F1FC}[\u{1F1EB}\u{1F1F8}]|\u{1F1FA}[\u{1F1E6}\u{1F1EC}\u{1F1F2}\u{1F1F3}\u{1F1F8}\u{1F1FE}\u{1F1FF}]|\u{1F1EE}[\u{1F1E8}-\u{1F1EA}\u{1F1F1}-\u{1F1F4}\u{1F1F6}-\u{1F1F9}]|\u{1F1EF}[\u{1F1EA}\u{1F1F2}\u{1F1F4}\u{1F1F5}]|[\u{1F3C3}\u{1F3C4}\u{1F3CA}\u{1F46E}\u{1F471}\u{1F473}\u{1F477}\u{1F481}\u{1F482}\u{1F486}\u{1F487}\u{1F645}-\u{1F647}\u{1F64B}\u{1F64D}\u{1F64E}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F926}\u{1F937}-\u{1F939}\u{1F93D}\u{1F93E}\u{1F9B8}\u{1F9B9}\u{1F9CD}-\u{1F9CF}\u{1F9D6}-\u{1F9DD}][\u{1F3FB}-\u{1F3FF}]|[\u26F9\u{1F3CB}\u{1F3CC}\u{1F575}][\u{1F3FB}-\u{1F3FF}]|[\u261D\u270A-\u270D\u{1F385}\u{1F3C2}\u{1F3C7}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}\u{1F467}\u{1F46B}-\u{1F46D}\u{1F470}\u{1F472}\u{1F474}-\u{1F476}\u{1F478}\u{1F47C}\u{1F483}\u{1F485}\u{1F4AA}\u{1F574}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F64C}\u{1F64F}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91C}\u{1F91E}\u{1F91F}\u{1F930}-\u{1F936}\u{1F9B5}\u{1F9B6}\u{1F9BB}\u{1F9D2}-\u{1F9D5}][\u{1F3FB}-\u{1F3FF}]|[\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\u{1F004}\u{1F0CF}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F236}\u{1F238}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F320}\u{1F32D}-\u{1F335}\u{1F337}-\u{1F37C}\u{1F37E}-\u{1F393}\u{1F3A0}-\u{1F3CA}\u{1F3CF}-\u{1F3D3}\u{1F3E0}-\u{1F3F0}\u{1F3F4}\u{1F3F8}-\u{1F43E}\u{1F440}\u{1F442}-\u{1F4FC}\u{1F4FF}-\u{1F53D}\u{1F54B}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F57A}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5FB}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CC}\u{1F6D0}-\u{1F6D2}\u{1F6D5}\u{1F6EB}\u{1F6EC}\u{1F6F4}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]|[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299\u{1F004}\u{1F0CF}\u{1F170}\u{1F171}\u{1F17E}\u{1F17F}\u{1F18E}\u{1F191}-\u{1F19A}\u{1F1E6}-\u{1F1FF}\u{1F201}\u{1F202}\u{1F21A}\u{1F22F}\u{1F232}-\u{1F23A}\u{1F250}\u{1F251}\u{1F300}-\u{1F321}\u{1F324}-\u{1F393}\u{1F396}\u{1F397}\u{1F399}-\u{1F39B}\u{1F39E}-\u{1F3F0}\u{1F3F3}-\u{1F3F5}\u{1F3F7}-\u{1F4FD}\u{1F4FF}-\u{1F53D}\u{1F549}-\u{1F54E}\u{1F550}-\u{1F567}\u{1F56F}\u{1F570}\u{1F573}-\u{1F57A}\u{1F587}\u{1F58A}-\u{1F58D}\u{1F590}\u{1F595}\u{1F596}\u{1F5A4}\u{1F5A5}\u{1F5A8}\u{1F5B1}\u{1F5B2}\u{1F5BC}\u{1F5C2}-\u{1F5C4}\u{1F5D1}-\u{1F5D3}\u{1F5DC}-\u{1F5DE}\u{1F5E1}\u{1F5E3}\u{1F5E8}\u{1F5EF}\u{1F5F3}\u{1F5FA}-\u{1F64F}\u{1F680}-\u{1F6C5}\u{1F6CB}-\u{1F6D2}\u{1F6D5}\u{1F6E0}-\u{1F6E5}\u{1F6E9}\u{1F6EB}\u{1F6EC}\u{1F6F0}\u{1F6F3}-\u{1F6FA}\u{1F7E0}-\u{1F7EB}\u{1F90D}-\u{1F93A}\u{1F93C}-\u{1F945}\u{1F947}-\u{1F971}\u{1F973}-\u{1F976}\u{1F97A}-\u{1F9A2}\u{1F9A5}-\u{1F9AA}\u{1F9AE}-\u{1F9CA}\u{1F9CD}-\u{1F9FF}\u{1FA70}-\u{1FA73}\u{1FA78}-\u{1FA7A}\u{1FA80}-\u{1FA82}\u{1FA90}-\u{1FA95}]\uFE0F?|[\u261D\u26F9\u270A-\u270D\u{1F385}\u{1F3C2}-\u{1F3C4}\u{1F3C7}\u{1F3CA}-\u{1F3CC}\u{1F442}\u{1F443}\u{1F446}-\u{1F450}\u{1F466}-\u{1F478}\u{1F47C}\u{1F481}-\u{1F483}\u{1F485}-\u{1F487}\u{1F48F}\u{1F491}\u{1F4AA}\u{1F574}\u{1F575}\u{1F57A}\u{1F590}\u{1F595}\u{1F596}\u{1F645}-\u{1F647}\u{1F64B}-\u{1F64F}\u{1F6A3}\u{1F6B4}-\u{1F6B6}\u{1F6C0}\u{1F6CC}\u{1F90F}\u{1F918}-\u{1F91F}\u{1F926}\u{1F930}-\u{1F939}\u{1F93C}-\u{1F93E}\u{1F9B5}\u{1F9B6}\u{1F9B8}\u{1F9B9}\u{1F9BB}\u{1F9CD}-\u{1F9CF}\u{1F9D1}-\u{1F9DD}]/gu;
+};
diff --git a/node_modules/emoji-regex/index.d.ts b/node_modules/emoji-regex/index.d.ts
new file mode 100644
index 0000000..1955b47
--- /dev/null
+++ b/node_modules/emoji-regex/index.d.ts
@@ -0,0 +1,23 @@
+declare module 'emoji-regex' {
+ function emojiRegex(): RegExp;
+
+ export default emojiRegex;
+}
+
+declare module 'emoji-regex/text' {
+ function emojiRegex(): RegExp;
+
+ export default emojiRegex;
+}
+
+declare module 'emoji-regex/es2015' {
+ function emojiRegex(): RegExp;
+
+ export default emojiRegex;
+}
+
+declare module 'emoji-regex/es2015/text' {
+ function emojiRegex(): RegExp;
+
+ export default emojiRegex;
+}
diff --git a/node_modules/emoji-regex/index.js b/node_modules/emoji-regex/index.js
new file mode 100644
index 0000000..d993a3a
--- /dev/null
+++ b/node_modules/emoji-regex/index.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function () {
+ // https://mths.be/emoji
+ return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
+};
diff --git a/node_modules/emoji-regex/package.json b/node_modules/emoji-regex/package.json
new file mode 100644
index 0000000..6d32352
--- /dev/null
+++ b/node_modules/emoji-regex/package.json
@@ -0,0 +1,50 @@
+{
+ "name": "emoji-regex",
+ "version": "8.0.0",
+ "description": "A regular expression to match all Emoji-only symbols as per the Unicode Standard.",
+ "homepage": "https://mths.be/emoji-regex",
+ "main": "index.js",
+ "types": "index.d.ts",
+ "keywords": [
+ "unicode",
+ "regex",
+ "regexp",
+ "regular expressions",
+ "code points",
+ "symbols",
+ "characters",
+ "emoji"
+ ],
+ "license": "MIT",
+ "author": {
+ "name": "Mathias Bynens",
+ "url": "https://mathiasbynens.be/"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/mathiasbynens/emoji-regex.git"
+ },
+ "bugs": "https://github.com/mathiasbynens/emoji-regex/issues",
+ "files": [
+ "LICENSE-MIT.txt",
+ "index.js",
+ "index.d.ts",
+ "text.js",
+ "es2015/index.js",
+ "es2015/text.js"
+ ],
+ "scripts": {
+ "build": "rm -rf -- es2015; babel src -d .; NODE_ENV=es2015 babel src -d ./es2015; node script/inject-sequences.js",
+ "test": "mocha",
+ "test:watch": "npm run test -- --watch"
+ },
+ "devDependencies": {
+ "@babel/cli": "^7.2.3",
+ "@babel/core": "^7.3.4",
+ "@babel/plugin-proposal-unicode-property-regex": "^7.2.0",
+ "@babel/preset-env": "^7.3.4",
+ "mocha": "^6.0.2",
+ "regexgen": "^1.3.0",
+ "unicode-12.0.0": "^0.7.9"
+ }
+}
diff --git a/node_modules/emoji-regex/text.js b/node_modules/emoji-regex/text.js
new file mode 100644
index 0000000..0a55ce2
--- /dev/null
+++ b/node_modules/emoji-regex/text.js
@@ -0,0 +1,6 @@
+"use strict";
+
+module.exports = function () {
+ // https://mths.be/emoji
+ return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F?|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g;
+};
diff --git a/node_modules/escalade/dist/index.js b/node_modules/escalade/dist/index.js
new file mode 100644
index 0000000..ad236c4
--- /dev/null
+++ b/node_modules/escalade/dist/index.js
@@ -0,0 +1,22 @@
+const { dirname, resolve } = require('path');
+const { readdir, stat } = require('fs');
+const { promisify } = require('util');
+
+const toStats = promisify(stat);
+const toRead = promisify(readdir);
+
+module.exports = async function (start, callback) {
+ let dir = resolve('.', start);
+ let tmp, stats = await toStats(dir);
+
+ if (!stats.isDirectory()) {
+ dir = dirname(dir);
+ }
+
+ while (true) {
+ tmp = await callback(dir, await toRead(dir));
+ if (tmp) return resolve(dir, tmp);
+ dir = dirname(tmp = dir);
+ if (tmp === dir) break;
+ }
+}
diff --git a/node_modules/escalade/dist/index.mjs b/node_modules/escalade/dist/index.mjs
new file mode 100644
index 0000000..bf95be0
--- /dev/null
+++ b/node_modules/escalade/dist/index.mjs
@@ -0,0 +1,22 @@
+import { dirname, resolve } from 'path';
+import { readdir, stat } from 'fs';
+import { promisify } from 'util';
+
+const toStats = promisify(stat);
+const toRead = promisify(readdir);
+
+export default async function (start, callback) {
+ let dir = resolve('.', start);
+ let tmp, stats = await toStats(dir);
+
+ if (!stats.isDirectory()) {
+ dir = dirname(dir);
+ }
+
+ while (true) {
+ tmp = await callback(dir, await toRead(dir));
+ if (tmp) return resolve(dir, tmp);
+ dir = dirname(tmp = dir);
+ if (tmp === dir) break;
+ }
+}
diff --git a/node_modules/escalade/index.d.ts b/node_modules/escalade/index.d.ts
new file mode 100644
index 0000000..283e398
--- /dev/null
+++ b/node_modules/escalade/index.d.ts
@@ -0,0 +1,3 @@
+type Promisable<T> = T | Promise<T>;
+export type Callback = (directory: string, files: string[]) => Promisable<string | false | void>;
+export default function (directory: string, callback: Callback): Promise<string | void>;
diff --git a/node_modules/escalade/license b/node_modules/escalade/license
new file mode 100644
index 0000000..fa6089f
--- /dev/null
+++ b/node_modules/escalade/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/escalade/package.json b/node_modules/escalade/package.json
new file mode 100644
index 0000000..0d1bfce
--- /dev/null
+++ b/node_modules/escalade/package.json
@@ -0,0 +1,61 @@
+{
+ "name": "escalade",
+ "version": "3.1.1",
+ "repository": "lukeed/escalade",
+ "description": "A tiny (183B to 210B) and fast utility to ascend parent directories",
+ "module": "dist/index.mjs",
+ "main": "dist/index.js",
+ "types": "index.d.ts",
+ "license": "MIT",
+ "author": {
+ "name": "Luke Edwards",
+ "email": "luke.edwards05@gmail.com",
+ "url": "https://lukeed.com"
+ },
+ "exports": {
+ ".": [
+ {
+ "import": "./dist/index.mjs",
+ "require": "./dist/index.js"
+ },
+ "./dist/index.js"
+ ],
+ "./sync": [
+ {
+ "import": "./sync/index.mjs",
+ "require": "./sync/index.js"
+ },
+ "./sync/index.js"
+ ]
+ },
+ "files": [
+ "*.d.ts",
+ "dist",
+ "sync"
+ ],
+ "modes": {
+ "sync": "src/sync.js",
+ "default": "src/async.js"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "scripts": {
+ "build": "bundt",
+ "pretest": "npm run build",
+ "test": "uvu -r esm test -i fixtures"
+ },
+ "keywords": [
+ "find",
+ "parent",
+ "parents",
+ "directory",
+ "search",
+ "walk"
+ ],
+ "devDependencies": {
+ "bundt": "1.1.1",
+ "esm": "3.2.25",
+ "uvu": "0.3.3"
+ }
+}
diff --git a/node_modules/escalade/readme.md b/node_modules/escalade/readme.md
new file mode 100644
index 0000000..4e2195c
--- /dev/null
+++ b/node_modules/escalade/readme.md
@@ -0,0 +1,211 @@
+# escalade [![CI](https://github.com/lukeed/escalade/workflows/CI/badge.svg)](https://github.com/lukeed/escalade/actions) [![codecov](https://badgen.now.sh/codecov/c/github/lukeed/escalade)](https://codecov.io/gh/lukeed/escalade)
+
+> A tiny (183B to 210B) and [fast](#benchmarks) utility to ascend parent directories
+
+With [escalade](https://en.wikipedia.org/wiki/Escalade), you can scale parent directories until you've found what you're looking for.<br>Given an input file or directory, `escalade` will continue executing your callback function until either:
+
+1) the callback returns a truthy value
+2) `escalade` has reached the system root directory (eg, `/`)
+
+> **Important:**<br>Please note that `escalade` only deals with direct ancestry – it will not dive into parents' sibling directories.
+
+---
+
+**Notice:** As of v3.1.0, `escalade` now includes [Deno support](http://deno.land/x/escalade)! Please see [Deno Usage](#deno) below.
+
+---
+
+## Install
+
+```
+$ npm install --save escalade
+```
+
+
+## Modes
+
+There are two "versions" of `escalade` available:
+
+#### "async"
+> **Node.js:** >= 8.x<br>
+> **Size (gzip):** 210 bytes<br>
+> **Availability:** [CommonJS](https://unpkg.com/escalade/dist/index.js), [ES Module](https://unpkg.com/escalade/dist/index.mjs)
+
+This is the primary/default mode. It makes use of `async`/`await` and [`util.promisify`](https://nodejs.org/api/util.html#util_util_promisify_original).
+
+#### "sync"
+> **Node.js:** >= 6.x<br>
+> **Size (gzip):** 183 bytes<br>
+> **Availability:** [CommonJS](https://unpkg.com/escalade/sync/index.js), [ES Module](https://unpkg.com/escalade/sync/index.mjs)
+
+This is the opt-in mode, ideal for scenarios where `async` usage cannot be supported.
+
+
+## Usage
+
+***Example Structure***
+
+```
+/Users/lukeed
+ └── oss
+ ├── license
+ └── escalade
+ ├── package.json
+ └── test
+ └── fixtures
+ ├── index.js
+ └── foobar
+ └── demo.js
+```
+
+***Example Usage***
+
+```js
+//~> demo.js
+import { join } from 'path';
+import escalade from 'escalade';
+
+const input = join(__dirname, 'demo.js');
+// or: const input = __dirname;
+
+const pkg = await escalade(input, (dir, names) => {
+ console.log('~> dir:', dir);
+ console.log('~> names:', names);
+ console.log('---');
+
+ if (names.includes('package.json')) {
+ // will be resolved into absolute
+ return 'package.json';
+ }
+});
+
+//~> dir: /Users/lukeed/oss/escalade/test/fixtures/foobar
+//~> names: ['demo.js']
+//---
+//~> dir: /Users/lukeed/oss/escalade/test/fixtures
+//~> names: ['index.js', 'foobar']
+//---
+//~> dir: /Users/lukeed/oss/escalade/test
+//~> names: ['fixtures']
+//---
+//~> dir: /Users/lukeed/oss/escalade
+//~> names: ['package.json', 'test']
+//---
+
+console.log(pkg);
+//=> /Users/lukeed/oss/escalade/package.json
+
+// Now search for "missing123.txt"
+// (Assume it doesn't exist anywhere!)
+const missing = await escalade(input, (dir, names) => {
+ console.log('~> dir:', dir);
+ return names.includes('missing123.txt') && 'missing123.txt';
+});
+
+//~> dir: /Users/lukeed/oss/escalade/test/fixtures/foobar
+//~> dir: /Users/lukeed/oss/escalade/test/fixtures
+//~> dir: /Users/lukeed/oss/escalade/test
+//~> dir: /Users/lukeed/oss/escalade
+//~> dir: /Users/lukeed/oss
+//~> dir: /Users/lukeed
+//~> dir: /Users
+//~> dir: /
+
+console.log(missing);
+//=> undefined
+```
+
+> **Note:** To run the above example with "sync" mode, import from `escalade/sync` and remove the `await` keyword.
+
+
+## API
+
+### escalade(input, callback)
+Returns: `string|void` or `Promise<string|void>`
+
+When your `callback` locates a file, `escalade` will resolve/return with an absolute path.<br>
+If your `callback` was never satisfied, then `escalade` will resolve/return with nothing (undefined).
+
+> **Important:**<br>The `sync` and `async` versions share the same API.<br>The **only** difference is that `sync` is not Promise-based.
+
+#### input
+Type: `string`
+
+The path from which to start ascending.
+
+This may be a file or a directory path.<br>However, when `input` is a file, `escalade` will begin with its parent directory.
+
+> **Important:** Unless given an absolute path, `input` will be resolved from `process.cwd()` location.
+
+#### callback
+Type: `Function`
+
+The callback to execute for each ancestry level. It always is given two arguments:
+
+1) `dir` - an absolute path of the current parent directory
+2) `names` - a list (`string[]`) of contents _relative to_ the `dir` parent
+
+> **Note:** The `names` list can contain names of files _and_ directories.
+
+When your callback returns a _falsey_ value, then `escalade` will continue with `dir`'s parent directory, re-invoking your callback with new argument values.
+
+When your callback returns a string, then `escalade` stops iteration immediately.<br>
+If the string is an absolute path, then it's left as is. Otherwise, the string is resolved into an absolute path _from_ the `dir` that housed the satisfying condition.
+
+> **Important:** Your `callback` can be a `Promise/AsyncFunction` when using the "async" version of `escalade`.
+
+## Benchmarks
+
+> Running on Node.js v10.13.0
+
+```
+# Load Time
+ find-up 3.891ms
+ escalade 0.485ms
+ escalade/sync 0.309ms
+
+# Levels: 6 (target = "foo.txt"):
+ find-up x 24,856 ops/sec ±6.46% (55 runs sampled)
+ escalade x 73,084 ops/sec ±4.23% (73 runs sampled)
+ find-up.sync x 3,663 ops/sec ±1.12% (83 runs sampled)
+ escalade/sync x 9,360 ops/sec ±0.62% (88 runs sampled)
+
+# Levels: 12 (target = "package.json"):
+ find-up x 29,300 ops/sec ±10.68% (70 runs sampled)
+ escalade x 73,685 ops/sec ± 5.66% (66 runs sampled)
+ find-up.sync x 1,707 ops/sec ± 0.58% (91 runs sampled)
+ escalade/sync x 4,667 ops/sec ± 0.68% (94 runs sampled)
+
+# Levels: 18 (target = "missing123.txt"):
+ find-up x 21,818 ops/sec ±17.37% (14 runs sampled)
+ escalade x 67,101 ops/sec ±21.60% (20 runs sampled)
+ find-up.sync x 1,037 ops/sec ± 2.86% (88 runs sampled)
+ escalade/sync x 1,248 ops/sec ± 0.50% (93 runs sampled)
+```
+
+## Deno
+
+As of v3.1.0, `escalade` is available on the Deno registry.
+
+Please note that the [API](#api) is identical and that there are still [two modes](#modes) from which to choose:
+
+```ts
+// Choose "async" mode
+import escalade from 'https://deno.land/escalade/async.ts';
+
+// Choose "sync" mode
+import escalade from 'https://deno.land/escalade/sync.ts';
+```
+
+> **Important:** The `allow-read` permission is required!
+
+
+## Related
+
+- [premove](https://github.com/lukeed/premove) - A tiny (247B) utility to remove items recursively
+- [totalist](https://github.com/lukeed/totalist) - A tiny (195B to 224B) utility to recursively list all (total) files in a directory
+- [mk-dirs](https://github.com/lukeed/mk-dirs) - A tiny (420B) utility to make a directory and its parents, recursively
+
+## License
+
+MIT © [Luke Edwards](https://lukeed.com)
diff --git a/node_modules/escalade/sync/index.d.ts b/node_modules/escalade/sync/index.d.ts
new file mode 100644
index 0000000..746ddd3
--- /dev/null
+++ b/node_modules/escalade/sync/index.d.ts
@@ -0,0 +1,2 @@
+export type Callback = (directory: string, files: string[]) => string | false | void;
+export default function (directory: string, callback: Callback): string | void;
diff --git a/node_modules/escalade/sync/index.js b/node_modules/escalade/sync/index.js
new file mode 100644
index 0000000..902cc46
--- /dev/null
+++ b/node_modules/escalade/sync/index.js
@@ -0,0 +1,18 @@
+const { dirname, resolve } = require('path');
+const { readdirSync, statSync } = require('fs');
+
+module.exports = function (start, callback) {
+ let dir = resolve('.', start);
+ let tmp, stats = statSync(dir);
+
+ if (!stats.isDirectory()) {
+ dir = dirname(dir);
+ }
+
+ while (true) {
+ tmp = callback(dir, readdirSync(dir));
+ if (tmp) return resolve(dir, tmp);
+ dir = dirname(tmp = dir);
+ if (tmp === dir) break;
+ }
+}
diff --git a/node_modules/escalade/sync/index.mjs b/node_modules/escalade/sync/index.mjs
new file mode 100644
index 0000000..3cdc5bd
--- /dev/null
+++ b/node_modules/escalade/sync/index.mjs
@@ -0,0 +1,18 @@
+import { dirname, resolve } from 'path';
+import { readdirSync, statSync } from 'fs';
+
+export default function (start, callback) {
+ let dir = resolve('.', start);
+ let tmp, stats = statSync(dir);
+
+ if (!stats.isDirectory()) {
+ dir = dirname(dir);
+ }
+
+ while (true) {
+ tmp = callback(dir, readdirSync(dir));
+ if (tmp) return resolve(dir, tmp);
+ dir = dirname(tmp = dir);
+ if (tmp === dir) break;
+ }
+}
diff --git a/node_modules/fuse.js/CHANGELOG.md b/node_modules/fuse.js/CHANGELOG.md
new file mode 100644
index 0000000..4e21b03
--- /dev/null
+++ b/node_modules/fuse.js/CHANGELOG.md
@@ -0,0 +1,326 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+### [6.6.2](https://github.com/krisk/Fuse/compare/v6.6.1...v6.6.2) (2022-05-11)
+
+
+### Bug Fixes
+
+* value fetched at the end must be a string ([1de1dff](https://github.com/krisk/Fuse/commit/1de1dffa3f16992e21d817370e2b5d9611d3ad6d)), closes [#661](https://github.com/krisk/Fuse/issues/661)
+
+### [6.6.1](https://github.com/krisk/Fuse/compare/v6.6.0...v6.6.1) (2022-05-06)
+
+
+### Bug Fixes
+
+* getFn to FuseOptionKeyObject ([80b87a9](https://github.com/krisk/Fuse/commit/80b87a9035b3dcecc92dc913ceb160045e1a95bd)), closes [#655](https://github.com/krisk/Fuse/issues/655)
+* **typescript:** type definition for `FuseOptionKeyObject, fixes [#655](https://github.com/krisk/Fuse/issues/655) ([4acabb6](https://github.com/krisk/Fuse/commit/4acabb686f9a1a95adc766bc2fb387c0ce0b477c))
+* **typescript:** type definition for FuseOptionKeyObject ([0a790b5](https://github.com/krisk/Fuse/commit/0a790b516efec2e6c5539bdd40d04889e6252dfe)), closes [#655](https://github.com/krisk/Fuse/issues/655) [#656](https://github.com/krisk/Fuse/issues/656)
+
+## [6.6.0](https://github.com/krisk/Fuse/compare/v6.5.3...v6.6.0) (2022-05-03)
+
+
+### Features
+
+* allow passing getFn for a specific key ([1d445b9](https://github.com/krisk/Fuse/commit/1d445b9999e26d6eefecbdd333d46be01aff06e5)), closes [#627](https://github.com/krisk/Fuse/issues/627)
+
+
+### Bug Fixes
+
+* excessive splitting in parseQuery ([2c78022](https://github.com/krisk/Fuse/commit/2c78022c6ccb424e1013dc486649a7d6388df193))
+* type mismatch on toJSON ([f5425ea](https://github.com/krisk/Fuse/commit/f5425ea1bd6b95eae912b8dab68c9e3cac0ad27f))
+
+### [6.5.3](https://github.com/krisk/Fuse/compare/v6.5.2...v6.5.3) (2021-12-23)
+
+
+### Bug Fixes
+
+* **logical:** scoring for logical OR ([6f6af51](https://github.com/krisk/Fuse/commit/6f6af51cc39058fafea6b126f7120afc4f7c192a)), closes [#593](https://github.com/krisk/Fuse/issues/593)
+
+### [6.5.2](https://github.com/krisk/Fuse/compare/v6.5.1...v6.5.2) (2021-12-23)
+
+### [6.5.1](https://github.com/krisk/Fuse/compare/v6.5.0...v6.5.1) (2021-12-23)
+
+
+### Bug Fixes
+
+* rollback min node version ([9918f67](https://github.com/krisk/Fuse/commit/9918f67ba9b6b9b54e53576312fa33a51f428a9d))
+
+## [6.5.0](https://github.com/krisk/Fuse/compare/v6.4.6...v6.5.0) (2021-12-22)
+
+
+### Features
+
+* **scoring:** field length norm weight ([a9e0080](https://github.com/krisk/Fuse/commit/a9e00804497a1bfd7a94040520417825c085c945))
+
+
+### Bug Fixes
+
+* **typescript:** add config declaration to types ([2f4de0c](https://github.com/krisk/Fuse/commit/2f4de0c5ce061808f460de7f399b56a06539d4d5))
+
+### [6.4.6](https://github.com/krisk/Fuse/compare/v6.4.5...v6.4.6) (2021-01-05)
+
+
+### Bug Fixes
+
+* **typescript:** fix search typings ([94766b2](https://github.com/krisk/Fuse/commit/94766b2ffcc2be0e5f15daa9a29cd92adbe2647a)), closes [#527](https://github.com/krisk/Fuse/issues/527)
+
+### [6.4.5](https://github.com/krisk/Fuse/compare/v6.4.4...v6.4.5) (2021-01-01)
+
+
+### Bug Fixes
+
+* **ts:** export FuseIndex type ([2e60bee](https://github.com/krisk/Fuse/commit/2e60bee242c7b82f0d014a3a35281b34bc6b62fb)), closes [#519](https://github.com/krisk/Fuse/issues/519)
+
+### [6.4.4](https://github.com/krisk/Fuse/compare/v6.4.3...v6.4.4) (2020-12-29)
+
+
+### Bug Fixes
+
+* **extended:** correctly score include-match results ([443c863](https://github.com/krisk/Fuse/commit/443c863c44a48225510057d7597cb743fda2d25f)), closes [#522](https://github.com/krisk/Fuse/issues/522)
+
+### [6.4.3](https://github.com/krisk/Fuse/compare/v6.4.2...v6.4.3) (2020-10-30)
+
+
+### Bug Fixes
+
+* **extended:** ignoreLocation when useExtendedSearch is true ([8f67ac9](https://github.com/krisk/Fuse/commit/8f67ac985d3440c20d93ce1e1c5ba66f384ea9bf)), closes [#465](https://github.com/krisk/Fuse/issues/465)
+
+### [6.4.2](https://github.com/krisk/Fuse/compare/v6.4.1...v6.4.2) (2020-10-20)
+
+
+### Bug Fixes
+
+* if null in array ([740a500](https://github.com/krisk/Fuse/commit/740a5004763d84b285075a2cece4f37bc5fa2830))
+
+### [6.4.1](https://github.com/krisk/Fuse/compare/v6.4.0...v6.4.1) (2020-07-26)
+
+
+### Bug Fixes
+
+* handle booleans in the data ([226d868](https://github.com/krisk/Fuse/commit/226d868a1102402e1e773db305ddd3928ae92f79)), closes [#469](https://github.com/krisk/Fuse/issues/469)
+
+## [6.4.0](https://github.com/krisk/Fuse/compare/v6.3.1...v6.4.0) (2020-06-28)
+
+
+### Features
+
+* **extended:** add ability to search actual exact string ([350283f](https://github.com/krisk/Fuse/commit/350283f45a9affe05c6b3176bb5a5a037916de58))
+
+### [6.3.1](https://github.com/krisk/Fuse/compare/v6.3.0...v6.3.1) (2020-06-24)
+
+
+### Bug Fixes
+
+* **logical:** scores in logical query operators are ignored ([e357229](https://github.com/krisk/Fuse/commit/e357229846fff585707903c93f556d1562fbabba)), closes [#449](https://github.com/krisk/Fuse/issues/449)
+
+## [6.3.0](https://github.com/krisk/Fuse/compare/v6.2.1...v6.3.0) (2020-06-23)
+
+
+### Features
+
+* provide alternative array notation for nested paths ([7077fbe](https://github.com/krisk/Fuse/commit/7077fbe5f40872f9555645dbad2e6729ca55a5d4)), closes [#432](https://github.com/krisk/Fuse/issues/432)
+
+
+### Bug Fixes
+
+* **typescript:** add types for string and object together for the key property ([85fb211](https://github.com/krisk/Fuse/commit/85fb211a22bf5921ecefab9ecf3f8e2647f46b49))
+* **typescript:** add typing for nested paths with array notation ([dfa4823](https://github.com/krisk/Fuse/commit/dfa48238f9a28600fd36677f958f43bb3cab4c03))
+
+# Version 6.0.0
+
+- Added [logical query expressions](https://fusejs.io/api/query.html) (#411)
+- Added ability to dynamically add/remove items (#412)
+- Mix different `options:key` types during intialization (#413)
+- Improved indexing performances, as well storage savings (#405, #407)
+
+# Version 5.2.0
+
+- Addresses #390, #376, #382, #385
+- Removed ngram search and extended bitap to search long patterns
+
+# Version 5.0.9-beta
+
+- Fixed Fuse global name. Erroenously set as 'Fuse.js'
+
+# Version 5.0.8-beta
+
+- Changed bundler to Rollup.
+- Added ES6 modules for bundlers and browsers (`fuse.esm.js`) (fixed [#262](#262))
+- Added CommonJS builds (`fuse.common.js`)
+
+## Breaking Changes
+
+- The minimified version is finally actually called `fuse.min.js`
+
+# Version 5.0.7-beta
+
+- Fixed (#363)
+
+# Version 5.0.6-beta
+
+- Fixed (#357)
+
+# Version 5.0.3-beta
+
+- A couple of fixes, courtesy of [Daniel Dickinson](https://github.com/cshoredaniel):
+ - Generate multiple targets with webpack (#359)
+ - Fixed TypeError (#360)
+
+# Version 5.0.2-beta
+
+- Added indexing for increased performance over large lists
+ - Added `Fuse.createIndex`, which created and returns an index. This function can be used to pre-generate the index, which you can then save, and ultimately pass to the `Fuse` instance.
+
+## Breaking Changes
+
+- Removed `id` option
+- Changed format of the search results
+- Updated TypeScript definitions
+
+# Version 5.0.1-beta
+
+- Removed `matchAllTokens` option.
+
+# Version 5.0.0-beta
+
+- Added ability to search patterns longer > 32 characters
+- Removed `maxPatternLength` option
+
+# Version 4.1.0-beta
+
+- Perf optimization on nested array search
+
+# Version 4.0.4-beta
+
+- Re-added license information
+
+# Version 4.0.3-beta
+
+- Increased Node version
+
+# Version 4.0.2-beta
+
+- Added missing tests
+
+# Version 4.0.1-beta
+
+- Removed unused codepath
+- Fixed case sensititivity check
+- Upgraded dev dependencies
+
+# Version 4.0.0-beta
+
+- Added extended search [Discussion](https://github.com/krisk/Fuse/issues/356)
+- Removed tokenization [Discussion](https://github.com/krisk/Fuse/issues/355)
+
+# Version 3.6.0
+
+- Improved error handling for keys
+
+# Version 3.5.0
+
+- Fixed #341, adjusting weights into the calculation
+- Improved performance by ~10% (really can only be seen when you have 10k+ items)
+
+# Version 3.4.3
+
+- Fixed #261
+- Rewrote tests to Jest framework
+- Wrote tests for TypeScript typings
+- Cleanup build
+
+# Version 3.4.2
+
+- Fixed #288
+
+# Version 3.4.1
+
+- Ensured `dist/` content is production ready (both full and min versions) #283
+
+# Version 3.4.0
+
+- Upgraded build tool to Webpack 4. New `dist/` output.
+
+# Version 3.3.1
+
+- Fixed the circular JSON TypeError (#197). Thanks [ThinkTankShark](https://github.com/ThinkTankShark)!
+
+# Version 3.2.1
+
+- Fixed issue in which more fuzzy matches would weaken a score instead of strengthening it (#233)
+
+# Version 3.2.0
+
+- Give better result for exact match when using weighted keys (#192)
+
+# Version 3.1.0
+
+- Added match index location for array key (#183)
+- Allow searching deep nested numbers (#189)
+
+# Version 3.0.5
+
+- Escape special characters in search pattern (#168)
+
+# Version 3.0.4
+
+- Random bug fixes (#162)
+
+# Version 3.0.0
+
+- Removed Bower support
+- Modified library into a more more palatable architecture, where the Bitap portion is now its own separate module.
+
+### BREAKING CHANGES
+
+- Removed `include` option in favor of more explicit booleans: `includeScore` and `includeMatches`. Both are `false` by default.
+- Removed `searchFn` option, as this (for now) will remain a Bitap based solution
+
+# Version 2.7.4
+
+- Reverted to previous version, thus fixing breaking changes (a little bit of a version match here)
+
+# Version 2.6.2
+
+- Revert back to previous version
+
+# Version 2.6.2
+
+- Fix typings based on TypeScript guidelines (#129)
+
+# Version 2.6.0
+
+- Added Typescript definition
+- Added ability to set min/max matched character lengths when returning the matched indices (#122)
+
+# Version 2.5.0
+
+- Added option to search by matching all tokens (in every record) when `matchAllTokens:true` (#95)
+
+# Version 2.3.0
+
+- Added token separator to options, when `tokenize:true` (#93)
+- General code clean up (#88)
+- Bunch of other bug fixes
+
+# Version 2.2.0
+
+- Added option to include matched indices (#6)
+- Added ability to search with weighted keys (#62)
+
+# Version 2.1.0-beta
+
+- Added ability to search with weighted keys (#62)
+
+# Version 2.0.0
+
+- Modified search algorithm to search individual words AND the full string, computing the final score as a function of both. This yields better scoring accuracy (#41)
+- Changed exact substrings to not have a score of zero. That is searching for "hell" in "hello" will not yield a score of zero, while searching for "hello" will (#63)
+- Added `verbose` option, which will print to the console useful information, mostly for debugging
+- Improved code structure.
+- Added version information within Fuse itself
+- Added this Changelog (#64)
+- Added fallback when pattern length is greater than machine word length (i.e, > 32 characters) (#38)
+- Allowed results with a value of 0 to be returned (#73)
diff --git a/node_modules/fuse.js/LICENSE b/node_modules/fuse.js/LICENSE
new file mode 100644
index 0000000..453d70b
--- /dev/null
+++ b/node_modules/fuse.js/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "{}"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2017 Kirollos Risk
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/node_modules/fuse.js/README.md b/node_modules/fuse.js/README.md
new file mode 100644
index 0000000..2ef3110
--- /dev/null
+++ b/node_modules/fuse.js/README.md
@@ -0,0 +1,56 @@
+# Fuse.js
+
+![Node.js CI](https://github.com/krisk/Fuse/workflows/Node.js%20CI/badge.svg)
+[![Version](https://img.shields.io/npm/v/fuse.js.svg)](https://www.npmjs.com/package/fuse.js)
+[![Downloads](https://img.shields.io/npm/dm/fuse.js.svg)](https://npmcharts.com/compare/fuse.js?minimal=tru)
+[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
+[![Contributors](https://img.shields.io/github/contributors/krisk/fuse.svg)](https://github.com/krisk/Fuse/graphs/contributors)
+![License](https://img.shields.io/npm/l/fuse.js.svg)
+
+## Supporting Fuse.js
+
+Through contributions, donations, and sponsorship, you allow Fuse.js to thrive. Also, you will be recognized as a beacon of support to open-source developers.
+
+- [Become a backer or sponsor on **GitHub**.](https://github.com/sponsors/krisk)
+- [Become a backer or sponsor on **Patreon**.](https://patreon.com/fusejs)
+- [One-time donation via **PayPal**.](https://www.paypal.me/kirorisk)
+
+---
+
+<h3 align="center">Silver Sponsors</h3>
+<!--Silver start-->
+<table>
+<tbody>
+ <tr>
+ <td align="center" valign="middle">
+ <a href="https://www.worksome.com" target="_blank">
+ <img width="222px" src="https://raw.githubusercontent.com/krisk/Fuse/7a0d77d85ac90063575613b6a738f418b624357f/docs/.vuepress/public/assets/img/sponsors/worksome.svg">
+ </a>
+ </td>
+ </tr>
+</body>
+</table>
+<!--Silver end-->
+
+---
+
+## Introduction
+
+Fuse.js is a lightweight fuzzy-search, in JavaScript, with zero dependencies.
+
+### Browser Compatibility
+
+Fuse.js supports all browsers that are [ES5-compliant](http://kangax.github.io/compat-table/es5/) (IE8 and below are not supported).
+
+## Documentation
+
+To check out a [live demo](https://fusejs.io/demo.html) and docs, visit [fusejs.io](https://fusejs.io).
+
+## Develop
+
+Here's a separate document for [developers](https://github.com/krisk/Fuse/blob/master/DEVELOPERS.md).
+
+## Contribute
+
+We've set up a separate document for our
+[contribution guidelines](https://github.com/krisk/Fuse/blob/master/CONTRIBUTING.md).
diff --git a/node_modules/fuse.js/dist/fuse.basic.common.js b/node_modules/fuse.js/dist/fuse.basic.common.js
new file mode 100644
index 0000000..5b2adf9
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.basic.common.js
@@ -0,0 +1,1467 @@
+/**
+ * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
+ *
+ * Copyright (c) 2022 Kiro Risk (http://kiro.me)
+ * All Rights Reserved. Apache Software License 2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+
+'use strict';
+
+function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ })), keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+}
+
+function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = null != arguments[i] ? arguments[i] : {};
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+
+ return target;
+}
+
+function _typeof(obj) {
+ "@babel/helpers - typeof";
+
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ }, _typeof(obj);
+}
+
+function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+}
+
+function _defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+}
+
+function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ Object.defineProperty(Constructor, "prototype", {
+ writable: false
+ });
+ return Constructor;
+}
+
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+}
+
+function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+}
+
+function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+}
+
+function _iterableToArray(iter) {
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
+}
+
+function _unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(o);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+}
+
+function _arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+
+ return arr2;
+}
+
+function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+}
+
+function isArray(value) {
+ return !Array.isArray ? getTag(value) === '[object Array]' : Array.isArray(value);
+} // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js
+
+var INFINITY = 1 / 0;
+function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+
+ var result = value + '';
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result;
+}
+function toString(value) {
+ return value == null ? '' : baseToString(value);
+}
+function isString(value) {
+ return typeof value === 'string';
+}
+function isNumber(value) {
+ return typeof value === 'number';
+} // Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
+
+function isBoolean(value) {
+ return value === true || value === false || isObjectLike(value) && getTag(value) == '[object Boolean]';
+}
+function isObject(value) {
+ return _typeof(value) === 'object';
+} // Checks if `value` is object-like.
+
+function isObjectLike(value) {
+ return isObject(value) && value !== null;
+}
+function isDefined(value) {
+ return value !== undefined && value !== null;
+}
+function isBlank(value) {
+ return !value.trim().length;
+} // Gets the `toStringTag` of `value`.
+// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js
+
+function getTag(value) {
+ return value == null ? value === undefined ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(value);
+}
+
+var EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';
+var LOGICAL_SEARCH_UNAVAILABLE = 'Logical search is not available';
+var INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
+var LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = function LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key) {
+ return "Invalid value for key ".concat(key);
+};
+var PATTERN_LENGTH_TOO_LARGE = function PATTERN_LENGTH_TOO_LARGE(max) {
+ return "Pattern length exceeds max of ".concat(max, ".");
+};
+var MISSING_KEY_PROPERTY = function MISSING_KEY_PROPERTY(name) {
+ return "Missing ".concat(name, " property in key");
+};
+var INVALID_KEY_WEIGHT_VALUE = function INVALID_KEY_WEIGHT_VALUE(key) {
+ return "Property 'weight' in key '".concat(key, "' must be a positive integer");
+};
+
+var hasOwn = Object.prototype.hasOwnProperty;
+
+var KeyStore = /*#__PURE__*/function () {
+ function KeyStore(keys) {
+ var _this = this;
+
+ _classCallCheck(this, KeyStore);
+
+ this._keys = [];
+ this._keyMap = {};
+ var totalWeight = 0;
+ keys.forEach(function (key) {
+ var obj = createKey(key);
+ totalWeight += obj.weight;
+
+ _this._keys.push(obj);
+
+ _this._keyMap[obj.id] = obj;
+ totalWeight += obj.weight;
+ }); // Normalize weights so that their sum is equal to 1
+
+ this._keys.forEach(function (key) {
+ key.weight /= totalWeight;
+ });
+ }
+
+ _createClass(KeyStore, [{
+ key: "get",
+ value: function get(keyId) {
+ return this._keyMap[keyId];
+ }
+ }, {
+ key: "keys",
+ value: function keys() {
+ return this._keys;
+ }
+ }, {
+ key: "toJSON",
+ value: function toJSON() {
+ return JSON.stringify(this._keys);
+ }
+ }]);
+
+ return KeyStore;
+}();
+function createKey(key) {
+ var path = null;
+ var id = null;
+ var src = null;
+ var weight = 1;
+ var getFn = null;
+
+ if (isString(key) || isArray(key)) {
+ src = key;
+ path = createKeyPath(key);
+ id = createKeyId(key);
+ } else {
+ if (!hasOwn.call(key, 'name')) {
+ throw new Error(MISSING_KEY_PROPERTY('name'));
+ }
+
+ var name = key.name;
+ src = name;
+
+ if (hasOwn.call(key, 'weight')) {
+ weight = key.weight;
+
+ if (weight <= 0) {
+ throw new Error(INVALID_KEY_WEIGHT_VALUE(name));
+ }
+ }
+
+ path = createKeyPath(name);
+ id = createKeyId(name);
+ getFn = key.getFn;
+ }
+
+ return {
+ path: path,
+ id: id,
+ weight: weight,
+ src: src,
+ getFn: getFn
+ };
+}
+function createKeyPath(key) {
+ return isArray(key) ? key : key.split('.');
+}
+function createKeyId(key) {
+ return isArray(key) ? key.join('.') : key;
+}
+
+function get(obj, path) {
+ var list = [];
+ var arr = false;
+
+ var deepGet = function deepGet(obj, path, index) {
+ if (!isDefined(obj)) {
+ return;
+ }
+
+ if (!path[index]) {
+ // If there's no path left, we've arrived at the object we care about.
+ list.push(obj);
+ } else {
+ var key = path[index];
+ var value = obj[key];
+
+ if (!isDefined(value)) {
+ return;
+ } // If we're at the last value in the path, and if it's a string/number/bool,
+ // add it to the list
+
+
+ if (index === path.length - 1 && (isString(value) || isNumber(value) || isBoolean(value))) {
+ list.push(toString(value));
+ } else if (isArray(value)) {
+ arr = true; // Search each item in the array.
+
+ for (var i = 0, len = value.length; i < len; i += 1) {
+ deepGet(value[i], path, index + 1);
+ }
+ } else if (path.length) {
+ // An object. Recurse further.
+ deepGet(value, path, index + 1);
+ }
+ }
+ }; // Backwards compatibility (since path used to be a string)
+
+
+ deepGet(obj, isString(path) ? path.split('.') : path, 0);
+ return arr ? list : list[0];
+}
+
+var MatchOptions = {
+ // Whether the matches should be included in the result set. When `true`, each record in the result
+ // set will include the indices of the matched characters.
+ // These can consequently be used for highlighting purposes.
+ includeMatches: false,
+ // When `true`, the matching function will continue to the end of a search pattern even if
+ // a perfect match has already been located in the string.
+ findAllMatches: false,
+ // Minimum number of characters that must be matched before a result is considered a match
+ minMatchCharLength: 1
+};
+var BasicOptions = {
+ // When `true`, the algorithm continues searching to the end of the input even if a perfect
+ // match is found before the end of the same input.
+ isCaseSensitive: false,
+ // When true, the matching function will continue to the end of a search pattern even if
+ includeScore: false,
+ // List of properties that will be searched. This also supports nested properties.
+ keys: [],
+ // Whether to sort the result list, by score
+ shouldSort: true,
+ // Default sort function: sort by ascending score, ascending index
+ sortFn: function sortFn(a, b) {
+ return a.score === b.score ? a.idx < b.idx ? -1 : 1 : a.score < b.score ? -1 : 1;
+ }
+};
+var FuzzyOptions = {
+ // Approximately where in the text is the pattern expected to be found?
+ location: 0,
+ // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
+ // (of both letters and location), a threshold of '1.0' would match anything.
+ threshold: 0.6,
+ // Determines how close the match must be to the fuzzy location (specified above).
+ // An exact letter match which is 'distance' characters away from the fuzzy location
+ // would score as a complete mismatch. A distance of '0' requires the match be at
+ // the exact location specified, a threshold of '1000' would require a perfect match
+ // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
+ distance: 100
+};
+var AdvancedOptions = {
+ // When `true`, it enables the use of unix-like search commands
+ useExtendedSearch: false,
+ // The get function to use when fetching an object's properties.
+ // The default will search nested paths *ie foo.bar.baz*
+ getFn: get,
+ // When `true`, search will ignore `location` and `distance`, so it won't matter
+ // where in the string the pattern appears.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
+ ignoreLocation: false,
+ // When `true`, the calculation for the relevance score (used for sorting) will
+ // ignore the field-length norm.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
+ ignoreFieldNorm: false,
+ // The weight to determine how much field length norm effects scoring.
+ fieldNormWeight: 1
+};
+var Config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, BasicOptions), MatchOptions), FuzzyOptions), AdvancedOptions);
+
+var SPACE = /[^ ]+/g; // Field-length norm: the shorter the field, the higher the weight.
+// Set to 3 decimals to reduce index size.
+
+function norm() {
+ var weight = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
+ var mantissa = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
+ var cache = new Map();
+ var m = Math.pow(10, mantissa);
+ return {
+ get: function get(value) {
+ var numTokens = value.match(SPACE).length;
+
+ if (cache.has(numTokens)) {
+ return cache.get(numTokens);
+ } // Default function is 1/sqrt(x), weight makes that variable
+
+
+ var norm = 1 / Math.pow(numTokens, 0.5 * weight); // In place of `toFixed(mantissa)`, for faster computation
+
+ var n = parseFloat(Math.round(norm * m) / m);
+ cache.set(numTokens, n);
+ return n;
+ },
+ clear: function clear() {
+ cache.clear();
+ }
+ };
+}
+
+var FuseIndex = /*#__PURE__*/function () {
+ function FuseIndex() {
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
+ _ref$getFn = _ref.getFn,
+ getFn = _ref$getFn === void 0 ? Config.getFn : _ref$getFn,
+ _ref$fieldNormWeight = _ref.fieldNormWeight,
+ fieldNormWeight = _ref$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref$fieldNormWeight;
+
+ _classCallCheck(this, FuseIndex);
+
+ this.norm = norm(fieldNormWeight, 3);
+ this.getFn = getFn;
+ this.isCreated = false;
+ this.setIndexRecords();
+ }
+
+ _createClass(FuseIndex, [{
+ key: "setSources",
+ value: function setSources() {
+ var docs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.docs = docs;
+ }
+ }, {
+ key: "setIndexRecords",
+ value: function setIndexRecords() {
+ var records = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.records = records;
+ }
+ }, {
+ key: "setKeys",
+ value: function setKeys() {
+ var _this = this;
+
+ var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.keys = keys;
+ this._keysMap = {};
+ keys.forEach(function (key, idx) {
+ _this._keysMap[key.id] = idx;
+ });
+ }
+ }, {
+ key: "create",
+ value: function create() {
+ var _this2 = this;
+
+ if (this.isCreated || !this.docs.length) {
+ return;
+ }
+
+ this.isCreated = true; // List is Array<String>
+
+ if (isString(this.docs[0])) {
+ this.docs.forEach(function (doc, docIndex) {
+ _this2._addString(doc, docIndex);
+ });
+ } else {
+ // List is Array<Object>
+ this.docs.forEach(function (doc, docIndex) {
+ _this2._addObject(doc, docIndex);
+ });
+ }
+
+ this.norm.clear();
+ } // Adds a doc to the end of the index
+
+ }, {
+ key: "add",
+ value: function add(doc) {
+ var idx = this.size();
+
+ if (isString(doc)) {
+ this._addString(doc, idx);
+ } else {
+ this._addObject(doc, idx);
+ }
+ } // Removes the doc at the specified index of the index
+
+ }, {
+ key: "removeAt",
+ value: function removeAt(idx) {
+ this.records.splice(idx, 1); // Change ref index of every subsquent doc
+
+ for (var i = idx, len = this.size(); i < len; i += 1) {
+ this.records[i].i -= 1;
+ }
+ }
+ }, {
+ key: "getValueForItemAtKeyId",
+ value: function getValueForItemAtKeyId(item, keyId) {
+ return item[this._keysMap[keyId]];
+ }
+ }, {
+ key: "size",
+ value: function size() {
+ return this.records.length;
+ }
+ }, {
+ key: "_addString",
+ value: function _addString(doc, docIndex) {
+ if (!isDefined(doc) || isBlank(doc)) {
+ return;
+ }
+
+ var record = {
+ v: doc,
+ i: docIndex,
+ n: this.norm.get(doc)
+ };
+ this.records.push(record);
+ }
+ }, {
+ key: "_addObject",
+ value: function _addObject(doc, docIndex) {
+ var _this3 = this;
+
+ var record = {
+ i: docIndex,
+ $: {}
+ }; // Iterate over every key (i.e, path), and fetch the value at that key
+
+ this.keys.forEach(function (key, keyIndex) {
+ var value = key.getFn ? key.getFn(doc) : _this3.getFn(doc, key.path);
+
+ if (!isDefined(value)) {
+ return;
+ }
+
+ if (isArray(value)) {
+ (function () {
+ var subRecords = [];
+ var stack = [{
+ nestedArrIndex: -1,
+ value: value
+ }];
+
+ while (stack.length) {
+ var _stack$pop = stack.pop(),
+ nestedArrIndex = _stack$pop.nestedArrIndex,
+ _value = _stack$pop.value;
+
+ if (!isDefined(_value)) {
+ continue;
+ }
+
+ if (isString(_value) && !isBlank(_value)) {
+ var subRecord = {
+ v: _value,
+ i: nestedArrIndex,
+ n: _this3.norm.get(_value)
+ };
+ subRecords.push(subRecord);
+ } else if (isArray(_value)) {
+ _value.forEach(function (item, k) {
+ stack.push({
+ nestedArrIndex: k,
+ value: item
+ });
+ });
+ } else ;
+ }
+
+ record.$[keyIndex] = subRecords;
+ })();
+ } else if (isString(value) && !isBlank(value)) {
+ var subRecord = {
+ v: value,
+ n: _this3.norm.get(value)
+ };
+ record.$[keyIndex] = subRecord;
+ }
+ });
+ this.records.push(record);
+ }
+ }, {
+ key: "toJSON",
+ value: function toJSON() {
+ return {
+ keys: this.keys,
+ records: this.records
+ };
+ }
+ }]);
+
+ return FuseIndex;
+}();
+function createIndex(keys, docs) {
+ var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref2$getFn = _ref2.getFn,
+ getFn = _ref2$getFn === void 0 ? Config.getFn : _ref2$getFn,
+ _ref2$fieldNormWeight = _ref2.fieldNormWeight,
+ fieldNormWeight = _ref2$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref2$fieldNormWeight;
+
+ var myIndex = new FuseIndex({
+ getFn: getFn,
+ fieldNormWeight: fieldNormWeight
+ });
+ myIndex.setKeys(keys.map(createKey));
+ myIndex.setSources(docs);
+ myIndex.create();
+ return myIndex;
+}
+function parseIndex(data) {
+ var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref3$getFn = _ref3.getFn,
+ getFn = _ref3$getFn === void 0 ? Config.getFn : _ref3$getFn,
+ _ref3$fieldNormWeight = _ref3.fieldNormWeight,
+ fieldNormWeight = _ref3$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref3$fieldNormWeight;
+
+ var keys = data.keys,
+ records = data.records;
+ var myIndex = new FuseIndex({
+ getFn: getFn,
+ fieldNormWeight: fieldNormWeight
+ });
+ myIndex.setKeys(keys);
+ myIndex.setIndexRecords(records);
+ return myIndex;
+}
+
+function computeScore$1(pattern) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$errors = _ref.errors,
+ errors = _ref$errors === void 0 ? 0 : _ref$errors,
+ _ref$currentLocation = _ref.currentLocation,
+ currentLocation = _ref$currentLocation === void 0 ? 0 : _ref$currentLocation,
+ _ref$expectedLocation = _ref.expectedLocation,
+ expectedLocation = _ref$expectedLocation === void 0 ? 0 : _ref$expectedLocation,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ var accuracy = errors / pattern.length;
+
+ if (ignoreLocation) {
+ return accuracy;
+ }
+
+ var proximity = Math.abs(expectedLocation - currentLocation);
+
+ if (!distance) {
+ // Dodge divide by zero error.
+ return proximity ? 1.0 : accuracy;
+ }
+
+ return accuracy + proximity / distance;
+}
+
+function convertMaskToIndices() {
+ var matchmask = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ var minMatchCharLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Config.minMatchCharLength;
+ var indices = [];
+ var start = -1;
+ var end = -1;
+ var i = 0;
+
+ for (var len = matchmask.length; i < len; i += 1) {
+ var match = matchmask[i];
+
+ if (match && start === -1) {
+ start = i;
+ } else if (!match && start !== -1) {
+ end = i - 1;
+
+ if (end - start + 1 >= minMatchCharLength) {
+ indices.push([start, end]);
+ }
+
+ start = -1;
+ }
+ } // (i-1 - start) + 1 => i - start
+
+
+ if (matchmask[i - 1] && i - start >= minMatchCharLength) {
+ indices.push([start, i - 1]);
+ }
+
+ return indices;
+}
+
+// Machine word size
+var MAX_BITS = 32;
+
+function search(text, pattern, patternAlphabet) {
+ var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ if (pattern.length > MAX_BITS) {
+ throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));
+ }
+
+ var patternLen = pattern.length; // Set starting location at beginning text and initialize the alphabet.
+
+ var textLen = text.length; // Handle the case when location > text.length
+
+ var expectedLocation = Math.max(0, Math.min(location, textLen)); // Highest score beyond which we give up.
+
+ var currentThreshold = threshold; // Is there a nearby exact match? (speedup)
+
+ var bestLocation = expectedLocation; // Performance: only computer matches when the minMatchCharLength > 1
+ // OR if `includeMatches` is true.
+
+ var computeMatches = minMatchCharLength > 1 || includeMatches; // A mask of the matches, used for building the indices
+
+ var matchMask = computeMatches ? Array(textLen) : [];
+ var index; // Get all exact matches, here for speed up
+
+ while ((index = text.indexOf(pattern, bestLocation)) > -1) {
+ var score = computeScore$1(pattern, {
+ currentLocation: index,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+ currentThreshold = Math.min(score, currentThreshold);
+ bestLocation = index + patternLen;
+
+ if (computeMatches) {
+ var i = 0;
+
+ while (i < patternLen) {
+ matchMask[index + i] = 1;
+ i += 1;
+ }
+ }
+ } // Reset the best location
+
+
+ bestLocation = -1;
+ var lastBitArr = [];
+ var finalScore = 1;
+ var binMax = patternLen + textLen;
+ var mask = 1 << patternLen - 1;
+
+ for (var _i = 0; _i < patternLen; _i += 1) {
+ // Scan for the best match; each iteration allows for one more error.
+ // Run a binary search to determine how far from the match location we can stray
+ // at this error level.
+ var binMin = 0;
+ var binMid = binMax;
+
+ while (binMin < binMid) {
+ var _score2 = computeScore$1(pattern, {
+ errors: _i,
+ currentLocation: expectedLocation + binMid,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+
+ if (_score2 <= currentThreshold) {
+ binMin = binMid;
+ } else {
+ binMax = binMid;
+ }
+
+ binMid = Math.floor((binMax - binMin) / 2 + binMin);
+ } // Use the result from this iteration as the maximum for the next.
+
+
+ binMax = binMid;
+ var start = Math.max(1, expectedLocation - binMid + 1);
+ var finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen; // Initialize the bit array
+
+ var bitArr = Array(finish + 2);
+ bitArr[finish + 1] = (1 << _i) - 1;
+
+ for (var j = finish; j >= start; j -= 1) {
+ var currentLocation = j - 1;
+ var charMatch = patternAlphabet[text.charAt(currentLocation)];
+
+ if (computeMatches) {
+ // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)
+ matchMask[currentLocation] = +!!charMatch;
+ } // First pass: exact match
+
+
+ bitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch; // Subsequent passes: fuzzy match
+
+ if (_i) {
+ bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1];
+ }
+
+ if (bitArr[j] & mask) {
+ finalScore = computeScore$1(pattern, {
+ errors: _i,
+ currentLocation: currentLocation,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ }); // This match will almost certainly be better than any existing match.
+ // But check anyway.
+
+ if (finalScore <= currentThreshold) {
+ // Indeed it is
+ currentThreshold = finalScore;
+ bestLocation = currentLocation; // Already passed `loc`, downhill from here on in.
+
+ if (bestLocation <= expectedLocation) {
+ break;
+ } // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.
+
+
+ start = Math.max(1, 2 * expectedLocation - bestLocation);
+ }
+ }
+ } // No hope for a (better) match at greater error levels.
+
+
+ var _score = computeScore$1(pattern, {
+ errors: _i + 1,
+ currentLocation: expectedLocation,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+
+ if (_score > currentThreshold) {
+ break;
+ }
+
+ lastBitArr = bitArr;
+ }
+
+ var result = {
+ isMatch: bestLocation >= 0,
+ // Count exact matches (those with a score of 0) to be "almost" exact
+ score: Math.max(0.001, finalScore)
+ };
+
+ if (computeMatches) {
+ var indices = convertMaskToIndices(matchMask, minMatchCharLength);
+
+ if (!indices.length) {
+ result.isMatch = false;
+ } else if (includeMatches) {
+ result.indices = indices;
+ }
+ }
+
+ return result;
+}
+
+function createPatternAlphabet(pattern) {
+ var mask = {};
+
+ for (var i = 0, len = pattern.length; i < len; i += 1) {
+ var _char = pattern.charAt(i);
+
+ mask[_char] = (mask[_char] || 0) | 1 << len - i - 1;
+ }
+
+ return mask;
+}
+
+var BitapSearch = /*#__PURE__*/function () {
+ function BitapSearch(pattern) {
+ var _this = this;
+
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$isCaseSensitive = _ref.isCaseSensitive,
+ isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ _classCallCheck(this, BitapSearch);
+
+ this.options = {
+ location: location,
+ threshold: threshold,
+ distance: distance,
+ includeMatches: includeMatches,
+ findAllMatches: findAllMatches,
+ minMatchCharLength: minMatchCharLength,
+ isCaseSensitive: isCaseSensitive,
+ ignoreLocation: ignoreLocation
+ };
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+ this.chunks = [];
+
+ if (!this.pattern.length) {
+ return;
+ }
+
+ var addChunk = function addChunk(pattern, startIndex) {
+ _this.chunks.push({
+ pattern: pattern,
+ alphabet: createPatternAlphabet(pattern),
+ startIndex: startIndex
+ });
+ };
+
+ var len = this.pattern.length;
+
+ if (len > MAX_BITS) {
+ var i = 0;
+ var remainder = len % MAX_BITS;
+ var end = len - remainder;
+
+ while (i < end) {
+ addChunk(this.pattern.substr(i, MAX_BITS), i);
+ i += MAX_BITS;
+ }
+
+ if (remainder) {
+ var startIndex = len - MAX_BITS;
+ addChunk(this.pattern.substr(startIndex), startIndex);
+ }
+ } else {
+ addChunk(this.pattern, 0);
+ }
+ }
+
+ _createClass(BitapSearch, [{
+ key: "searchIn",
+ value: function searchIn(text) {
+ var _this$options = this.options,
+ isCaseSensitive = _this$options.isCaseSensitive,
+ includeMatches = _this$options.includeMatches;
+
+ if (!isCaseSensitive) {
+ text = text.toLowerCase();
+ } // Exact match
+
+
+ if (this.pattern === text) {
+ var _result = {
+ isMatch: true,
+ score: 0
+ };
+
+ if (includeMatches) {
+ _result.indices = [[0, text.length - 1]];
+ }
+
+ return _result;
+ } // Otherwise, use Bitap algorithm
+
+
+ var _this$options2 = this.options,
+ location = _this$options2.location,
+ distance = _this$options2.distance,
+ threshold = _this$options2.threshold,
+ findAllMatches = _this$options2.findAllMatches,
+ minMatchCharLength = _this$options2.minMatchCharLength,
+ ignoreLocation = _this$options2.ignoreLocation;
+ var allIndices = [];
+ var totalScore = 0;
+ var hasMatches = false;
+ this.chunks.forEach(function (_ref2) {
+ var pattern = _ref2.pattern,
+ alphabet = _ref2.alphabet,
+ startIndex = _ref2.startIndex;
+
+ var _search = search(text, pattern, alphabet, {
+ location: location + startIndex,
+ distance: distance,
+ threshold: threshold,
+ findAllMatches: findAllMatches,
+ minMatchCharLength: minMatchCharLength,
+ includeMatches: includeMatches,
+ ignoreLocation: ignoreLocation
+ }),
+ isMatch = _search.isMatch,
+ score = _search.score,
+ indices = _search.indices;
+
+ if (isMatch) {
+ hasMatches = true;
+ }
+
+ totalScore += score;
+
+ if (isMatch && indices) {
+ allIndices = [].concat(_toConsumableArray(allIndices), _toConsumableArray(indices));
+ }
+ });
+ var result = {
+ isMatch: hasMatches,
+ score: hasMatches ? totalScore / this.chunks.length : 1
+ };
+
+ if (hasMatches && includeMatches) {
+ result.indices = allIndices;
+ }
+
+ return result;
+ }
+ }]);
+
+ return BitapSearch;
+}();
+
+var registeredSearchers = [];
+function createSearcher(pattern, options) {
+ for (var i = 0, len = registeredSearchers.length; i < len; i += 1) {
+ var searcherClass = registeredSearchers[i];
+
+ if (searcherClass.condition(pattern, options)) {
+ return new searcherClass(pattern, options);
+ }
+ }
+
+ return new BitapSearch(pattern, options);
+}
+
+var LogicalOperator = {
+ AND: '$and',
+ OR: '$or'
+};
+var KeyType = {
+ PATH: '$path',
+ PATTERN: '$val'
+};
+
+var isExpression = function isExpression(query) {
+ return !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
+};
+
+var isPath = function isPath(query) {
+ return !!query[KeyType.PATH];
+};
+
+var isLeaf = function isLeaf(query) {
+ return !isArray(query) && isObject(query) && !isExpression(query);
+};
+
+var convertToExplicit = function convertToExplicit(query) {
+ return _defineProperty({}, LogicalOperator.AND, Object.keys(query).map(function (key) {
+ return _defineProperty({}, key, query[key]);
+ }));
+}; // When `auto` is `true`, the parse function will infer and initialize and add
+// the appropriate `Searcher` instance
+
+
+function parse(query, options) {
+ var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref3$auto = _ref3.auto,
+ auto = _ref3$auto === void 0 ? true : _ref3$auto;
+
+ var next = function next(query) {
+ var keys = Object.keys(query);
+ var isQueryPath = isPath(query);
+
+ if (!isQueryPath && keys.length > 1 && !isExpression(query)) {
+ return next(convertToExplicit(query));
+ }
+
+ if (isLeaf(query)) {
+ var key = isQueryPath ? query[KeyType.PATH] : keys[0];
+ var pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];
+
+ if (!isString(pattern)) {
+ throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));
+ }
+
+ var obj = {
+ keyId: createKeyId(key),
+ pattern: pattern
+ };
+
+ if (auto) {
+ obj.searcher = createSearcher(pattern, options);
+ }
+
+ return obj;
+ }
+
+ var node = {
+ children: [],
+ operator: keys[0]
+ };
+ keys.forEach(function (key) {
+ var value = query[key];
+
+ if (isArray(value)) {
+ value.forEach(function (item) {
+ node.children.push(next(item));
+ });
+ }
+ });
+ return node;
+ };
+
+ if (!isExpression(query)) {
+ query = convertToExplicit(query);
+ }
+
+ return next(query);
+}
+
+function computeScore(results, _ref) {
+ var _ref$ignoreFieldNorm = _ref.ignoreFieldNorm,
+ ignoreFieldNorm = _ref$ignoreFieldNorm === void 0 ? Config.ignoreFieldNorm : _ref$ignoreFieldNorm;
+ results.forEach(function (result) {
+ var totalScore = 1;
+ result.matches.forEach(function (_ref2) {
+ var key = _ref2.key,
+ norm = _ref2.norm,
+ score = _ref2.score;
+ var weight = key ? key.weight : null;
+ totalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm));
+ });
+ result.score = totalScore;
+ });
+}
+
+function transformMatches(result, data) {
+ var matches = result.matches;
+ data.matches = [];
+
+ if (!isDefined(matches)) {
+ return;
+ }
+
+ matches.forEach(function (match) {
+ if (!isDefined(match.indices) || !match.indices.length) {
+ return;
+ }
+
+ var indices = match.indices,
+ value = match.value;
+ var obj = {
+ indices: indices,
+ value: value
+ };
+
+ if (match.key) {
+ obj.key = match.key.src;
+ }
+
+ if (match.idx > -1) {
+ obj.refIndex = match.idx;
+ }
+
+ data.matches.push(obj);
+ });
+}
+
+function transformScore(result, data) {
+ data.score = result.score;
+}
+
+function format(results, docs) {
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$includeScore = _ref.includeScore,
+ includeScore = _ref$includeScore === void 0 ? Config.includeScore : _ref$includeScore;
+
+ var transformers = [];
+ if (includeMatches) transformers.push(transformMatches);
+ if (includeScore) transformers.push(transformScore);
+ return results.map(function (result) {
+ var idx = result.idx;
+ var data = {
+ item: docs[idx],
+ refIndex: idx
+ };
+
+ if (transformers.length) {
+ transformers.forEach(function (transformer) {
+ transformer(result, data);
+ });
+ }
+
+ return data;
+ });
+}
+
+var Fuse$1 = /*#__PURE__*/function () {
+ function Fuse(docs) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ var index = arguments.length > 2 ? arguments[2] : undefined;
+
+ _classCallCheck(this, Fuse);
+
+ this.options = _objectSpread2(_objectSpread2({}, Config), options);
+
+ if (this.options.useExtendedSearch && !false) {
+ throw new Error(EXTENDED_SEARCH_UNAVAILABLE);
+ }
+
+ this._keyStore = new KeyStore(this.options.keys);
+ this.setCollection(docs, index);
+ }
+
+ _createClass(Fuse, [{
+ key: "setCollection",
+ value: function setCollection(docs, index) {
+ this._docs = docs;
+
+ if (index && !(index instanceof FuseIndex)) {
+ throw new Error(INCORRECT_INDEX_TYPE);
+ }
+
+ this._myIndex = index || createIndex(this.options.keys, this._docs, {
+ getFn: this.options.getFn,
+ fieldNormWeight: this.options.fieldNormWeight
+ });
+ }
+ }, {
+ key: "add",
+ value: function add(doc) {
+ if (!isDefined(doc)) {
+ return;
+ }
+
+ this._docs.push(doc);
+
+ this._myIndex.add(doc);
+ }
+ }, {
+ key: "remove",
+ value: function remove() {
+ var predicate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function
+ /* doc, idx */
+ () {
+ return false;
+ };
+ var results = [];
+
+ for (var i = 0, len = this._docs.length; i < len; i += 1) {
+ var doc = this._docs[i];
+
+ if (predicate(doc, i)) {
+ this.removeAt(i);
+ i -= 1;
+ len -= 1;
+ results.push(doc);
+ }
+ }
+
+ return results;
+ }
+ }, {
+ key: "removeAt",
+ value: function removeAt(idx) {
+ this._docs.splice(idx, 1);
+
+ this._myIndex.removeAt(idx);
+ }
+ }, {
+ key: "getIndex",
+ value: function getIndex() {
+ return this._myIndex;
+ }
+ }, {
+ key: "search",
+ value: function search(query) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$limit = _ref.limit,
+ limit = _ref$limit === void 0 ? -1 : _ref$limit;
+
+ var _this$options = this.options,
+ includeMatches = _this$options.includeMatches,
+ includeScore = _this$options.includeScore,
+ shouldSort = _this$options.shouldSort,
+ sortFn = _this$options.sortFn,
+ ignoreFieldNorm = _this$options.ignoreFieldNorm;
+ var results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);
+ computeScore(results, {
+ ignoreFieldNorm: ignoreFieldNorm
+ });
+
+ if (shouldSort) {
+ results.sort(sortFn);
+ }
+
+ if (isNumber(limit) && limit > -1) {
+ results = results.slice(0, limit);
+ }
+
+ return format(results, this._docs, {
+ includeMatches: includeMatches,
+ includeScore: includeScore
+ });
+ }
+ }, {
+ key: "_searchStringList",
+ value: function _searchStringList(query) {
+ var searcher = createSearcher(query, this.options);
+ var records = this._myIndex.records;
+ var results = []; // Iterate over every string in the index
+
+ records.forEach(function (_ref2) {
+ var text = _ref2.v,
+ idx = _ref2.i,
+ norm = _ref2.n;
+
+ if (!isDefined(text)) {
+ return;
+ }
+
+ var _searcher$searchIn = searcher.searchIn(text),
+ isMatch = _searcher$searchIn.isMatch,
+ score = _searcher$searchIn.score,
+ indices = _searcher$searchIn.indices;
+
+ if (isMatch) {
+ results.push({
+ item: text,
+ idx: idx,
+ matches: [{
+ score: score,
+ value: text,
+ norm: norm,
+ indices: indices
+ }]
+ });
+ }
+ });
+ return results;
+ }
+ }, {
+ key: "_searchLogical",
+ value: function _searchLogical(query) {
+
+ {
+ throw new Error(LOGICAL_SEARCH_UNAVAILABLE);
+ }
+ }
+ }, {
+ key: "_searchObjectList",
+ value: function _searchObjectList(query) {
+ var _this2 = this;
+
+ var searcher = createSearcher(query, this.options);
+ var _this$_myIndex = this._myIndex,
+ keys = _this$_myIndex.keys,
+ records = _this$_myIndex.records;
+ var results = []; // List is Array<Object>
+
+ records.forEach(function (_ref5) {
+ var item = _ref5.$,
+ idx = _ref5.i;
+
+ if (!isDefined(item)) {
+ return;
+ }
+
+ var matches = []; // Iterate over every key (i.e, path), and fetch the value at that key
+
+ keys.forEach(function (key, keyIndex) {
+ matches.push.apply(matches, _toConsumableArray(_this2._findMatches({
+ key: key,
+ value: item[keyIndex],
+ searcher: searcher
+ })));
+ });
+
+ if (matches.length) {
+ results.push({
+ idx: idx,
+ item: item,
+ matches: matches
+ });
+ }
+ });
+ return results;
+ }
+ }, {
+ key: "_findMatches",
+ value: function _findMatches(_ref6) {
+ var key = _ref6.key,
+ value = _ref6.value,
+ searcher = _ref6.searcher;
+
+ if (!isDefined(value)) {
+ return [];
+ }
+
+ var matches = [];
+
+ if (isArray(value)) {
+ value.forEach(function (_ref7) {
+ var text = _ref7.v,
+ idx = _ref7.i,
+ norm = _ref7.n;
+
+ if (!isDefined(text)) {
+ return;
+ }
+
+ var _searcher$searchIn2 = searcher.searchIn(text),
+ isMatch = _searcher$searchIn2.isMatch,
+ score = _searcher$searchIn2.score,
+ indices = _searcher$searchIn2.indices;
+
+ if (isMatch) {
+ matches.push({
+ score: score,
+ key: key,
+ value: text,
+ idx: idx,
+ norm: norm,
+ indices: indices
+ });
+ }
+ });
+ } else {
+ var text = value.v,
+ norm = value.n;
+
+ var _searcher$searchIn3 = searcher.searchIn(text),
+ isMatch = _searcher$searchIn3.isMatch,
+ score = _searcher$searchIn3.score,
+ indices = _searcher$searchIn3.indices;
+
+ if (isMatch) {
+ matches.push({
+ score: score,
+ key: key,
+ value: text,
+ norm: norm,
+ indices: indices
+ });
+ }
+ }
+
+ return matches;
+ }
+ }]);
+
+ return Fuse;
+}();
+
+Fuse$1.version = '6.6.2';
+Fuse$1.createIndex = createIndex;
+Fuse$1.parseIndex = parseIndex;
+Fuse$1.config = Config;
+
+{
+ Fuse$1.parseQuery = parse;
+}
+
+var Fuse = Fuse$1;
+
+module.exports = Fuse;
diff --git a/node_modules/fuse.js/dist/fuse.basic.esm.js b/node_modules/fuse.js/dist/fuse.basic.esm.js
new file mode 100644
index 0000000..2bac072
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.basic.esm.js
@@ -0,0 +1,1261 @@
+/**
+ * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
+ *
+ * Copyright (c) 2022 Kiro Risk (http://kiro.me)
+ * All Rights Reserved. Apache Software License 2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+
+function isArray(value) {
+ return !Array.isArray
+ ? getTag(value) === '[object Array]'
+ : Array.isArray(value)
+}
+
+// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js
+const INFINITY = 1 / 0;
+function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value
+ }
+ let result = value + '';
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result
+}
+
+function toString(value) {
+ return value == null ? '' : baseToString(value)
+}
+
+function isString(value) {
+ return typeof value === 'string'
+}
+
+function isNumber(value) {
+ return typeof value === 'number'
+}
+
+// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
+function isBoolean(value) {
+ return (
+ value === true ||
+ value === false ||
+ (isObjectLike(value) && getTag(value) == '[object Boolean]')
+ )
+}
+
+function isObject(value) {
+ return typeof value === 'object'
+}
+
+// Checks if `value` is object-like.
+function isObjectLike(value) {
+ return isObject(value) && value !== null
+}
+
+function isDefined(value) {
+ return value !== undefined && value !== null
+}
+
+function isBlank(value) {
+ return !value.trim().length
+}
+
+// Gets the `toStringTag` of `value`.
+// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js
+function getTag(value) {
+ return value == null
+ ? value === undefined
+ ? '[object Undefined]'
+ : '[object Null]'
+ : Object.prototype.toString.call(value)
+}
+
+const EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';
+
+const LOGICAL_SEARCH_UNAVAILABLE = 'Logical search is not available';
+
+const INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
+
+const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) =>
+ `Invalid value for key ${key}`;
+
+const PATTERN_LENGTH_TOO_LARGE = (max) =>
+ `Pattern length exceeds max of ${max}.`;
+
+const MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;
+
+const INVALID_KEY_WEIGHT_VALUE = (key) =>
+ `Property 'weight' in key '${key}' must be a positive integer`;
+
+const hasOwn = Object.prototype.hasOwnProperty;
+
+class KeyStore {
+ constructor(keys) {
+ this._keys = [];
+ this._keyMap = {};
+
+ let totalWeight = 0;
+
+ keys.forEach((key) => {
+ let obj = createKey(key);
+
+ totalWeight += obj.weight;
+
+ this._keys.push(obj);
+ this._keyMap[obj.id] = obj;
+
+ totalWeight += obj.weight;
+ });
+
+ // Normalize weights so that their sum is equal to 1
+ this._keys.forEach((key) => {
+ key.weight /= totalWeight;
+ });
+ }
+ get(keyId) {
+ return this._keyMap[keyId]
+ }
+ keys() {
+ return this._keys
+ }
+ toJSON() {
+ return JSON.stringify(this._keys)
+ }
+}
+
+function createKey(key) {
+ let path = null;
+ let id = null;
+ let src = null;
+ let weight = 1;
+ let getFn = null;
+
+ if (isString(key) || isArray(key)) {
+ src = key;
+ path = createKeyPath(key);
+ id = createKeyId(key);
+ } else {
+ if (!hasOwn.call(key, 'name')) {
+ throw new Error(MISSING_KEY_PROPERTY('name'))
+ }
+
+ const name = key.name;
+ src = name;
+
+ if (hasOwn.call(key, 'weight')) {
+ weight = key.weight;
+
+ if (weight <= 0) {
+ throw new Error(INVALID_KEY_WEIGHT_VALUE(name))
+ }
+ }
+
+ path = createKeyPath(name);
+ id = createKeyId(name);
+ getFn = key.getFn;
+ }
+
+ return { path, id, weight, src, getFn }
+}
+
+function createKeyPath(key) {
+ return isArray(key) ? key : key.split('.')
+}
+
+function createKeyId(key) {
+ return isArray(key) ? key.join('.') : key
+}
+
+function get(obj, path) {
+ let list = [];
+ let arr = false;
+
+ const deepGet = (obj, path, index) => {
+ if (!isDefined(obj)) {
+ return
+ }
+ if (!path[index]) {
+ // If there's no path left, we've arrived at the object we care about.
+ list.push(obj);
+ } else {
+ let key = path[index];
+
+ const value = obj[key];
+
+ if (!isDefined(value)) {
+ return
+ }
+
+ // If we're at the last value in the path, and if it's a string/number/bool,
+ // add it to the list
+ if (
+ index === path.length - 1 &&
+ (isString(value) || isNumber(value) || isBoolean(value))
+ ) {
+ list.push(toString(value));
+ } else if (isArray(value)) {
+ arr = true;
+ // Search each item in the array.
+ for (let i = 0, len = value.length; i < len; i += 1) {
+ deepGet(value[i], path, index + 1);
+ }
+ } else if (path.length) {
+ // An object. Recurse further.
+ deepGet(value, path, index + 1);
+ }
+ }
+ };
+
+ // Backwards compatibility (since path used to be a string)
+ deepGet(obj, isString(path) ? path.split('.') : path, 0);
+
+ return arr ? list : list[0]
+}
+
+const MatchOptions = {
+ // Whether the matches should be included in the result set. When `true`, each record in the result
+ // set will include the indices of the matched characters.
+ // These can consequently be used for highlighting purposes.
+ includeMatches: false,
+ // When `true`, the matching function will continue to the end of a search pattern even if
+ // a perfect match has already been located in the string.
+ findAllMatches: false,
+ // Minimum number of characters that must be matched before a result is considered a match
+ minMatchCharLength: 1
+};
+
+const BasicOptions = {
+ // When `true`, the algorithm continues searching to the end of the input even if a perfect
+ // match is found before the end of the same input.
+ isCaseSensitive: false,
+ // When true, the matching function will continue to the end of a search pattern even if
+ includeScore: false,
+ // List of properties that will be searched. This also supports nested properties.
+ keys: [],
+ // Whether to sort the result list, by score
+ shouldSort: true,
+ // Default sort function: sort by ascending score, ascending index
+ sortFn: (a, b) =>
+ a.score === b.score ? (a.idx < b.idx ? -1 : 1) : a.score < b.score ? -1 : 1
+};
+
+const FuzzyOptions = {
+ // Approximately where in the text is the pattern expected to be found?
+ location: 0,
+ // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
+ // (of both letters and location), a threshold of '1.0' would match anything.
+ threshold: 0.6,
+ // Determines how close the match must be to the fuzzy location (specified above).
+ // An exact letter match which is 'distance' characters away from the fuzzy location
+ // would score as a complete mismatch. A distance of '0' requires the match be at
+ // the exact location specified, a threshold of '1000' would require a perfect match
+ // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
+ distance: 100
+};
+
+const AdvancedOptions = {
+ // When `true`, it enables the use of unix-like search commands
+ useExtendedSearch: false,
+ // The get function to use when fetching an object's properties.
+ // The default will search nested paths *ie foo.bar.baz*
+ getFn: get,
+ // When `true`, search will ignore `location` and `distance`, so it won't matter
+ // where in the string the pattern appears.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
+ ignoreLocation: false,
+ // When `true`, the calculation for the relevance score (used for sorting) will
+ // ignore the field-length norm.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
+ ignoreFieldNorm: false,
+ // The weight to determine how much field length norm effects scoring.
+ fieldNormWeight: 1
+};
+
+var Config = {
+ ...BasicOptions,
+ ...MatchOptions,
+ ...FuzzyOptions,
+ ...AdvancedOptions
+};
+
+const SPACE = /[^ ]+/g;
+
+// Field-length norm: the shorter the field, the higher the weight.
+// Set to 3 decimals to reduce index size.
+function norm(weight = 1, mantissa = 3) {
+ const cache = new Map();
+ const m = Math.pow(10, mantissa);
+
+ return {
+ get(value) {
+ const numTokens = value.match(SPACE).length;
+
+ if (cache.has(numTokens)) {
+ return cache.get(numTokens)
+ }
+
+ // Default function is 1/sqrt(x), weight makes that variable
+ const norm = 1 / Math.pow(numTokens, 0.5 * weight);
+
+ // In place of `toFixed(mantissa)`, for faster computation
+ const n = parseFloat(Math.round(norm * m) / m);
+
+ cache.set(numTokens, n);
+
+ return n
+ },
+ clear() {
+ cache.clear();
+ }
+ }
+}
+
+class FuseIndex {
+ constructor({
+ getFn = Config.getFn,
+ fieldNormWeight = Config.fieldNormWeight
+ } = {}) {
+ this.norm = norm(fieldNormWeight, 3);
+ this.getFn = getFn;
+ this.isCreated = false;
+
+ this.setIndexRecords();
+ }
+ setSources(docs = []) {
+ this.docs = docs;
+ }
+ setIndexRecords(records = []) {
+ this.records = records;
+ }
+ setKeys(keys = []) {
+ this.keys = keys;
+ this._keysMap = {};
+ keys.forEach((key, idx) => {
+ this._keysMap[key.id] = idx;
+ });
+ }
+ create() {
+ if (this.isCreated || !this.docs.length) {
+ return
+ }
+
+ this.isCreated = true;
+
+ // List is Array<String>
+ if (isString(this.docs[0])) {
+ this.docs.forEach((doc, docIndex) => {
+ this._addString(doc, docIndex);
+ });
+ } else {
+ // List is Array<Object>
+ this.docs.forEach((doc, docIndex) => {
+ this._addObject(doc, docIndex);
+ });
+ }
+
+ this.norm.clear();
+ }
+ // Adds a doc to the end of the index
+ add(doc) {
+ const idx = this.size();
+
+ if (isString(doc)) {
+ this._addString(doc, idx);
+ } else {
+ this._addObject(doc, idx);
+ }
+ }
+ // Removes the doc at the specified index of the index
+ removeAt(idx) {
+ this.records.splice(idx, 1);
+
+ // Change ref index of every subsquent doc
+ for (let i = idx, len = this.size(); i < len; i += 1) {
+ this.records[i].i -= 1;
+ }
+ }
+ getValueForItemAtKeyId(item, keyId) {
+ return item[this._keysMap[keyId]]
+ }
+ size() {
+ return this.records.length
+ }
+ _addString(doc, docIndex) {
+ if (!isDefined(doc) || isBlank(doc)) {
+ return
+ }
+
+ let record = {
+ v: doc,
+ i: docIndex,
+ n: this.norm.get(doc)
+ };
+
+ this.records.push(record);
+ }
+ _addObject(doc, docIndex) {
+ let record = { i: docIndex, $: {} };
+
+ // Iterate over every key (i.e, path), and fetch the value at that key
+ this.keys.forEach((key, keyIndex) => {
+ let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);
+
+ if (!isDefined(value)) {
+ return
+ }
+
+ if (isArray(value)) {
+ let subRecords = [];
+ const stack = [{ nestedArrIndex: -1, value }];
+
+ while (stack.length) {
+ const { nestedArrIndex, value } = stack.pop();
+
+ if (!isDefined(value)) {
+ continue
+ }
+
+ if (isString(value) && !isBlank(value)) {
+ let subRecord = {
+ v: value,
+ i: nestedArrIndex,
+ n: this.norm.get(value)
+ };
+
+ subRecords.push(subRecord);
+ } else if (isArray(value)) {
+ value.forEach((item, k) => {
+ stack.push({
+ nestedArrIndex: k,
+ value: item
+ });
+ });
+ } else ;
+ }
+ record.$[keyIndex] = subRecords;
+ } else if (isString(value) && !isBlank(value)) {
+ let subRecord = {
+ v: value,
+ n: this.norm.get(value)
+ };
+
+ record.$[keyIndex] = subRecord;
+ }
+ });
+
+ this.records.push(record);
+ }
+ toJSON() {
+ return {
+ keys: this.keys,
+ records: this.records
+ }
+ }
+}
+
+function createIndex(
+ keys,
+ docs,
+ { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}
+) {
+ const myIndex = new FuseIndex({ getFn, fieldNormWeight });
+ myIndex.setKeys(keys.map(createKey));
+ myIndex.setSources(docs);
+ myIndex.create();
+ return myIndex
+}
+
+function parseIndex(
+ data,
+ { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}
+) {
+ const { keys, records } = data;
+ const myIndex = new FuseIndex({ getFn, fieldNormWeight });
+ myIndex.setKeys(keys);
+ myIndex.setIndexRecords(records);
+ return myIndex
+}
+
+function computeScore$1(
+ pattern,
+ {
+ errors = 0,
+ currentLocation = 0,
+ expectedLocation = 0,
+ distance = Config.distance,
+ ignoreLocation = Config.ignoreLocation
+ } = {}
+) {
+ const accuracy = errors / pattern.length;
+
+ if (ignoreLocation) {
+ return accuracy
+ }
+
+ const proximity = Math.abs(expectedLocation - currentLocation);
+
+ if (!distance) {
+ // Dodge divide by zero error.
+ return proximity ? 1.0 : accuracy
+ }
+
+ return accuracy + proximity / distance
+}
+
+function convertMaskToIndices(
+ matchmask = [],
+ minMatchCharLength = Config.minMatchCharLength
+) {
+ let indices = [];
+ let start = -1;
+ let end = -1;
+ let i = 0;
+
+ for (let len = matchmask.length; i < len; i += 1) {
+ let match = matchmask[i];
+ if (match && start === -1) {
+ start = i;
+ } else if (!match && start !== -1) {
+ end = i - 1;
+ if (end - start + 1 >= minMatchCharLength) {
+ indices.push([start, end]);
+ }
+ start = -1;
+ }
+ }
+
+ // (i-1 - start) + 1 => i - start
+ if (matchmask[i - 1] && i - start >= minMatchCharLength) {
+ indices.push([start, i - 1]);
+ }
+
+ return indices
+}
+
+// Machine word size
+const MAX_BITS = 32;
+
+function search(
+ text,
+ pattern,
+ patternAlphabet,
+ {
+ location = Config.location,
+ distance = Config.distance,
+ threshold = Config.threshold,
+ findAllMatches = Config.findAllMatches,
+ minMatchCharLength = Config.minMatchCharLength,
+ includeMatches = Config.includeMatches,
+ ignoreLocation = Config.ignoreLocation
+ } = {}
+) {
+ if (pattern.length > MAX_BITS) {
+ throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS))
+ }
+
+ const patternLen = pattern.length;
+ // Set starting location at beginning text and initialize the alphabet.
+ const textLen = text.length;
+ // Handle the case when location > text.length
+ const expectedLocation = Math.max(0, Math.min(location, textLen));
+ // Highest score beyond which we give up.
+ let currentThreshold = threshold;
+ // Is there a nearby exact match? (speedup)
+ let bestLocation = expectedLocation;
+
+ // Performance: only computer matches when the minMatchCharLength > 1
+ // OR if `includeMatches` is true.
+ const computeMatches = minMatchCharLength > 1 || includeMatches;
+ // A mask of the matches, used for building the indices
+ const matchMask = computeMatches ? Array(textLen) : [];
+
+ let index;
+
+ // Get all exact matches, here for speed up
+ while ((index = text.indexOf(pattern, bestLocation)) > -1) {
+ let score = computeScore$1(pattern, {
+ currentLocation: index,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+
+ currentThreshold = Math.min(score, currentThreshold);
+ bestLocation = index + patternLen;
+
+ if (computeMatches) {
+ let i = 0;
+ while (i < patternLen) {
+ matchMask[index + i] = 1;
+ i += 1;
+ }
+ }
+ }
+
+ // Reset the best location
+ bestLocation = -1;
+
+ let lastBitArr = [];
+ let finalScore = 1;
+ let binMax = patternLen + textLen;
+
+ const mask = 1 << (patternLen - 1);
+
+ for (let i = 0; i < patternLen; i += 1) {
+ // Scan for the best match; each iteration allows for one more error.
+ // Run a binary search to determine how far from the match location we can stray
+ // at this error level.
+ let binMin = 0;
+ let binMid = binMax;
+
+ while (binMin < binMid) {
+ const score = computeScore$1(pattern, {
+ errors: i,
+ currentLocation: expectedLocation + binMid,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+
+ if (score <= currentThreshold) {
+ binMin = binMid;
+ } else {
+ binMax = binMid;
+ }
+
+ binMid = Math.floor((binMax - binMin) / 2 + binMin);
+ }
+
+ // Use the result from this iteration as the maximum for the next.
+ binMax = binMid;
+
+ let start = Math.max(1, expectedLocation - binMid + 1);
+ let finish = findAllMatches
+ ? textLen
+ : Math.min(expectedLocation + binMid, textLen) + patternLen;
+
+ // Initialize the bit array
+ let bitArr = Array(finish + 2);
+
+ bitArr[finish + 1] = (1 << i) - 1;
+
+ for (let j = finish; j >= start; j -= 1) {
+ let currentLocation = j - 1;
+ let charMatch = patternAlphabet[text.charAt(currentLocation)];
+
+ if (computeMatches) {
+ // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)
+ matchMask[currentLocation] = +!!charMatch;
+ }
+
+ // First pass: exact match
+ bitArr[j] = ((bitArr[j + 1] << 1) | 1) & charMatch;
+
+ // Subsequent passes: fuzzy match
+ if (i) {
+ bitArr[j] |=
+ ((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1 | lastBitArr[j + 1];
+ }
+
+ if (bitArr[j] & mask) {
+ finalScore = computeScore$1(pattern, {
+ errors: i,
+ currentLocation,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+
+ // This match will almost certainly be better than any existing match.
+ // But check anyway.
+ if (finalScore <= currentThreshold) {
+ // Indeed it is
+ currentThreshold = finalScore;
+ bestLocation = currentLocation;
+
+ // Already passed `loc`, downhill from here on in.
+ if (bestLocation <= expectedLocation) {
+ break
+ }
+
+ // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.
+ start = Math.max(1, 2 * expectedLocation - bestLocation);
+ }
+ }
+ }
+
+ // No hope for a (better) match at greater error levels.
+ const score = computeScore$1(pattern, {
+ errors: i + 1,
+ currentLocation: expectedLocation,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+
+ if (score > currentThreshold) {
+ break
+ }
+
+ lastBitArr = bitArr;
+ }
+
+ const result = {
+ isMatch: bestLocation >= 0,
+ // Count exact matches (those with a score of 0) to be "almost" exact
+ score: Math.max(0.001, finalScore)
+ };
+
+ if (computeMatches) {
+ const indices = convertMaskToIndices(matchMask, minMatchCharLength);
+ if (!indices.length) {
+ result.isMatch = false;
+ } else if (includeMatches) {
+ result.indices = indices;
+ }
+ }
+
+ return result
+}
+
+function createPatternAlphabet(pattern) {
+ let mask = {};
+
+ for (let i = 0, len = pattern.length; i < len; i += 1) {
+ const char = pattern.charAt(i);
+ mask[char] = (mask[char] || 0) | (1 << (len - i - 1));
+ }
+
+ return mask
+}
+
+class BitapSearch {
+ constructor(
+ pattern,
+ {
+ location = Config.location,
+ threshold = Config.threshold,
+ distance = Config.distance,
+ includeMatches = Config.includeMatches,
+ findAllMatches = Config.findAllMatches,
+ minMatchCharLength = Config.minMatchCharLength,
+ isCaseSensitive = Config.isCaseSensitive,
+ ignoreLocation = Config.ignoreLocation
+ } = {}
+ ) {
+ this.options = {
+ location,
+ threshold,
+ distance,
+ includeMatches,
+ findAllMatches,
+ minMatchCharLength,
+ isCaseSensitive,
+ ignoreLocation
+ };
+
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+
+ this.chunks = [];
+
+ if (!this.pattern.length) {
+ return
+ }
+
+ const addChunk = (pattern, startIndex) => {
+ this.chunks.push({
+ pattern,
+ alphabet: createPatternAlphabet(pattern),
+ startIndex
+ });
+ };
+
+ const len = this.pattern.length;
+
+ if (len > MAX_BITS) {
+ let i = 0;
+ const remainder = len % MAX_BITS;
+ const end = len - remainder;
+
+ while (i < end) {
+ addChunk(this.pattern.substr(i, MAX_BITS), i);
+ i += MAX_BITS;
+ }
+
+ if (remainder) {
+ const startIndex = len - MAX_BITS;
+ addChunk(this.pattern.substr(startIndex), startIndex);
+ }
+ } else {
+ addChunk(this.pattern, 0);
+ }
+ }
+
+ searchIn(text) {
+ const { isCaseSensitive, includeMatches } = this.options;
+
+ if (!isCaseSensitive) {
+ text = text.toLowerCase();
+ }
+
+ // Exact match
+ if (this.pattern === text) {
+ let result = {
+ isMatch: true,
+ score: 0
+ };
+
+ if (includeMatches) {
+ result.indices = [[0, text.length - 1]];
+ }
+
+ return result
+ }
+
+ // Otherwise, use Bitap algorithm
+ const {
+ location,
+ distance,
+ threshold,
+ findAllMatches,
+ minMatchCharLength,
+ ignoreLocation
+ } = this.options;
+
+ let allIndices = [];
+ let totalScore = 0;
+ let hasMatches = false;
+
+ this.chunks.forEach(({ pattern, alphabet, startIndex }) => {
+ const { isMatch, score, indices } = search(text, pattern, alphabet, {
+ location: location + startIndex,
+ distance,
+ threshold,
+ findAllMatches,
+ minMatchCharLength,
+ includeMatches,
+ ignoreLocation
+ });
+
+ if (isMatch) {
+ hasMatches = true;
+ }
+
+ totalScore += score;
+
+ if (isMatch && indices) {
+ allIndices = [...allIndices, ...indices];
+ }
+ });
+
+ let result = {
+ isMatch: hasMatches,
+ score: hasMatches ? totalScore / this.chunks.length : 1
+ };
+
+ if (hasMatches && includeMatches) {
+ result.indices = allIndices;
+ }
+
+ return result
+ }
+}
+
+const registeredSearchers = [];
+
+function createSearcher(pattern, options) {
+ for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {
+ let searcherClass = registeredSearchers[i];
+ if (searcherClass.condition(pattern, options)) {
+ return new searcherClass(pattern, options)
+ }
+ }
+
+ return new BitapSearch(pattern, options)
+}
+
+const LogicalOperator = {
+ AND: '$and',
+ OR: '$or'
+};
+
+const KeyType = {
+ PATH: '$path',
+ PATTERN: '$val'
+};
+
+const isExpression = (query) =>
+ !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
+
+const isPath = (query) => !!query[KeyType.PATH];
+
+const isLeaf = (query) =>
+ !isArray(query) && isObject(query) && !isExpression(query);
+
+const convertToExplicit = (query) => ({
+ [LogicalOperator.AND]: Object.keys(query).map((key) => ({
+ [key]: query[key]
+ }))
+});
+
+// When `auto` is `true`, the parse function will infer and initialize and add
+// the appropriate `Searcher` instance
+function parse(query, options, { auto = true } = {}) {
+ const next = (query) => {
+ let keys = Object.keys(query);
+
+ const isQueryPath = isPath(query);
+
+ if (!isQueryPath && keys.length > 1 && !isExpression(query)) {
+ return next(convertToExplicit(query))
+ }
+
+ if (isLeaf(query)) {
+ const key = isQueryPath ? query[KeyType.PATH] : keys[0];
+
+ const pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];
+
+ if (!isString(pattern)) {
+ throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key))
+ }
+
+ const obj = {
+ keyId: createKeyId(key),
+ pattern
+ };
+
+ if (auto) {
+ obj.searcher = createSearcher(pattern, options);
+ }
+
+ return obj
+ }
+
+ let node = {
+ children: [],
+ operator: keys[0]
+ };
+
+ keys.forEach((key) => {
+ const value = query[key];
+
+ if (isArray(value)) {
+ value.forEach((item) => {
+ node.children.push(next(item));
+ });
+ }
+ });
+
+ return node
+ };
+
+ if (!isExpression(query)) {
+ query = convertToExplicit(query);
+ }
+
+ return next(query)
+}
+
+// Practical scoring function
+function computeScore(
+ results,
+ { ignoreFieldNorm = Config.ignoreFieldNorm }
+) {
+ results.forEach((result) => {
+ let totalScore = 1;
+
+ result.matches.forEach(({ key, norm, score }) => {
+ const weight = key ? key.weight : null;
+
+ totalScore *= Math.pow(
+ score === 0 && weight ? Number.EPSILON : score,
+ (weight || 1) * (ignoreFieldNorm ? 1 : norm)
+ );
+ });
+
+ result.score = totalScore;
+ });
+}
+
+function transformMatches(result, data) {
+ const matches = result.matches;
+ data.matches = [];
+
+ if (!isDefined(matches)) {
+ return
+ }
+
+ matches.forEach((match) => {
+ if (!isDefined(match.indices) || !match.indices.length) {
+ return
+ }
+
+ const { indices, value } = match;
+
+ let obj = {
+ indices,
+ value
+ };
+
+ if (match.key) {
+ obj.key = match.key.src;
+ }
+
+ if (match.idx > -1) {
+ obj.refIndex = match.idx;
+ }
+
+ data.matches.push(obj);
+ });
+}
+
+function transformScore(result, data) {
+ data.score = result.score;
+}
+
+function format(
+ results,
+ docs,
+ {
+ includeMatches = Config.includeMatches,
+ includeScore = Config.includeScore
+ } = {}
+) {
+ const transformers = [];
+
+ if (includeMatches) transformers.push(transformMatches);
+ if (includeScore) transformers.push(transformScore);
+
+ return results.map((result) => {
+ const { idx } = result;
+
+ const data = {
+ item: docs[idx],
+ refIndex: idx
+ };
+
+ if (transformers.length) {
+ transformers.forEach((transformer) => {
+ transformer(result, data);
+ });
+ }
+
+ return data
+ })
+}
+
+class Fuse {
+ constructor(docs, options = {}, index) {
+ this.options = { ...Config, ...options };
+
+ if (
+ this.options.useExtendedSearch &&
+ !false
+ ) {
+ throw new Error(EXTENDED_SEARCH_UNAVAILABLE)
+ }
+
+ this._keyStore = new KeyStore(this.options.keys);
+
+ this.setCollection(docs, index);
+ }
+
+ setCollection(docs, index) {
+ this._docs = docs;
+
+ if (index && !(index instanceof FuseIndex)) {
+ throw new Error(INCORRECT_INDEX_TYPE)
+ }
+
+ this._myIndex =
+ index ||
+ createIndex(this.options.keys, this._docs, {
+ getFn: this.options.getFn,
+ fieldNormWeight: this.options.fieldNormWeight
+ });
+ }
+
+ add(doc) {
+ if (!isDefined(doc)) {
+ return
+ }
+
+ this._docs.push(doc);
+ this._myIndex.add(doc);
+ }
+
+ remove(predicate = (/* doc, idx */) => false) {
+ const results = [];
+
+ for (let i = 0, len = this._docs.length; i < len; i += 1) {
+ const doc = this._docs[i];
+ if (predicate(doc, i)) {
+ this.removeAt(i);
+ i -= 1;
+ len -= 1;
+
+ results.push(doc);
+ }
+ }
+
+ return results
+ }
+
+ removeAt(idx) {
+ this._docs.splice(idx, 1);
+ this._myIndex.removeAt(idx);
+ }
+
+ getIndex() {
+ return this._myIndex
+ }
+
+ search(query, { limit = -1 } = {}) {
+ const {
+ includeMatches,
+ includeScore,
+ shouldSort,
+ sortFn,
+ ignoreFieldNorm
+ } = this.options;
+
+ let results = isString(query)
+ ? isString(this._docs[0])
+ ? this._searchStringList(query)
+ : this._searchObjectList(query)
+ : this._searchLogical(query);
+
+ computeScore(results, { ignoreFieldNorm });
+
+ if (shouldSort) {
+ results.sort(sortFn);
+ }
+
+ if (isNumber(limit) && limit > -1) {
+ results = results.slice(0, limit);
+ }
+
+ return format(results, this._docs, {
+ includeMatches,
+ includeScore
+ })
+ }
+
+ _searchStringList(query) {
+ const searcher = createSearcher(query, this.options);
+ const { records } = this._myIndex;
+ const results = [];
+
+ // Iterate over every string in the index
+ records.forEach(({ v: text, i: idx, n: norm }) => {
+ if (!isDefined(text)) {
+ return
+ }
+
+ const { isMatch, score, indices } = searcher.searchIn(text);
+
+ if (isMatch) {
+ results.push({
+ item: text,
+ idx,
+ matches: [{ score, value: text, norm, indices }]
+ });
+ }
+ });
+
+ return results
+ }
+
+ _searchLogical(query) {
+ {
+ throw new Error(LOGICAL_SEARCH_UNAVAILABLE)
+ }
+ }
+
+ _searchObjectList(query) {
+ const searcher = createSearcher(query, this.options);
+ const { keys, records } = this._myIndex;
+ const results = [];
+
+ // List is Array<Object>
+ records.forEach(({ $: item, i: idx }) => {
+ if (!isDefined(item)) {
+ return
+ }
+
+ let matches = [];
+
+ // Iterate over every key (i.e, path), and fetch the value at that key
+ keys.forEach((key, keyIndex) => {
+ matches.push(
+ ...this._findMatches({
+ key,
+ value: item[keyIndex],
+ searcher
+ })
+ );
+ });
+
+ if (matches.length) {
+ results.push({
+ idx,
+ item,
+ matches
+ });
+ }
+ });
+
+ return results
+ }
+ _findMatches({ key, value, searcher }) {
+ if (!isDefined(value)) {
+ return []
+ }
+
+ let matches = [];
+
+ if (isArray(value)) {
+ value.forEach(({ v: text, i: idx, n: norm }) => {
+ if (!isDefined(text)) {
+ return
+ }
+
+ const { isMatch, score, indices } = searcher.searchIn(text);
+
+ if (isMatch) {
+ matches.push({
+ score,
+ key,
+ value: text,
+ idx,
+ norm,
+ indices
+ });
+ }
+ });
+ } else {
+ const { v: text, n: norm } = value;
+
+ const { isMatch, score, indices } = searcher.searchIn(text);
+
+ if (isMatch) {
+ matches.push({ score, key, value: text, norm, indices });
+ }
+ }
+
+ return matches
+ }
+}
+
+Fuse.version = '6.6.2';
+Fuse.createIndex = createIndex;
+Fuse.parseIndex = parseIndex;
+Fuse.config = Config;
+
+{
+ Fuse.parseQuery = parse;
+}
+
+export { Fuse as default };
diff --git a/node_modules/fuse.js/dist/fuse.basic.esm.min.js b/node_modules/fuse.js/dist/fuse.basic.esm.min.js
new file mode 100644
index 0000000..2a2220c
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.basic.esm.min.js
@@ -0,0 +1,9 @@
+/**
+ * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
+ *
+ * Copyright (c) 2022 Kiro Risk (http://kiro.me)
+ * All Rights Reserved. Apache Software License 2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function e(e){return Array.isArray?Array.isArray(e):"[object Array]"===o(e)}function t(e){return"string"==typeof e}function n(e){return"number"==typeof e}function i(e){return!0===e||!1===e||function(e){return function(e){return"object"==typeof e}(e)&&null!==e}(e)&&"[object Boolean]"==o(e)}function s(e){return null!=e}function r(e){return!e.trim().length}function o(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const c=Object.prototype.hasOwnProperty;class h{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach((e=>{let n=a(e);t+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight})),this._keys.forEach((e=>{e.weight/=t}))}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function a(n){let i=null,s=null,r=null,o=1,h=null;if(t(n)||e(n))r=n,i=l(n),s=d(n);else{if(!c.call(n,"name"))throw new Error((e=>`Missing ${e} property in key`)("name"));const e=n.name;if(r=e,c.call(n,"weight")&&(o=n.weight,o<=0))throw new Error((e=>`Property 'weight' in key '${e}' must be a positive integer`)(e));i=l(e),s=d(e),h=n.getFn}return{path:i,id:s,weight:o,src:r,getFn:h}}function l(t){return e(t)?t:t.split(".")}function d(t){return e(t)?t.join("."):t}var u={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(r,o){let c=[],h=!1;const a=(r,o,l)=>{if(s(r))if(o[l]){const d=r[o[l]];if(!s(d))return;if(l===o.length-1&&(t(d)||n(d)||i(d)))c.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;let t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(d));else if(e(d)){h=!0;for(let e=0,t=d.length;e<t;e+=1)a(d[e],o,l+1)}else o.length&&a(d,o,l+1)}else c.push(r)};return a(r,t(o)?o.split("."):o,0),h?c:c[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const f=/[^ ]+/g;class g{constructor({getFn:e=u.getFn,fieldNormWeight:t=u.fieldNormWeight}={}){this.norm=function(e=1,t=3){const n=new Map,i=Math.pow(10,t);return{get(t){const s=t.match(f).length;if(n.has(s))return n.get(s);const r=1/Math.pow(s,.5*e),o=parseFloat(Math.round(r*i)/i);return n.set(s,o),o},clear(){n.clear()}}}(t,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach(((e,t)=>{this._keysMap[e.id]=t}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,t(this.docs[0])?this.docs.forEach(((e,t)=>{this._addString(e,t)})):this.docs.forEach(((e,t)=>{this._addObject(e,t)})),this.norm.clear())}add(e){const n=this.size();t(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_addString(e,t){if(!s(e)||r(e))return;let n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}_addObject(n,i){let o={i:i,$:{}};this.keys.forEach(((i,c)=>{let h=i.getFn?i.getFn(n):this.getFn(n,i.path);if(s(h))if(e(h)){let n=[];const i=[{nestedArrIndex:-1,value:h}];for(;i.length;){const{nestedArrIndex:o,value:c}=i.pop();if(s(c))if(t(c)&&!r(c)){let e={v:c,i:o,n:this.norm.get(c)};n.push(e)}else e(c)&&c.forEach(((e,t)=>{i.push({nestedArrIndex:t,value:e})}))}o.$[c]=n}else if(t(h)&&!r(h)){let e={v:h,n:this.norm.get(h)};o.$[c]=e}})),this.records.push(o)}toJSON(){return{keys:this.keys,records:this.records}}}function p(e,t,{getFn:n=u.getFn,fieldNormWeight:i=u.fieldNormWeight}={}){const s=new g({getFn:n,fieldNormWeight:i});return s.setKeys(e.map(a)),s.setSources(t),s.create(),s}function m(e,{errors:t=0,currentLocation:n=0,expectedLocation:i=0,distance:s=u.distance,ignoreLocation:r=u.ignoreLocation}={}){const o=t/e.length;if(r)return o;const c=Math.abs(i-n);return s?o+c/s:c?1:o}function y(e,t,n,{location:i=u.location,distance:s=u.distance,threshold:r=u.threshold,findAllMatches:o=u.findAllMatches,minMatchCharLength:c=u.minMatchCharLength,includeMatches:h=u.includeMatches,ignoreLocation:a=u.ignoreLocation}={}){if(t.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const l=t.length,d=e.length,f=Math.max(0,Math.min(i,d));let g=r,p=f;const y=c>1||h,M=y?Array(d):[];let x;for(;(x=e.indexOf(t,p))>-1;){let e=m(t,{currentLocation:x,expectedLocation:f,distance:s,ignoreLocation:a});if(g=Math.min(e,g),p=x+l,y){let e=0;for(;e<l;)M[x+e]=1,e+=1}}p=-1;let L=[],_=1,k=l+d;const v=1<<l-1;for(let i=0;i<l;i+=1){let r=0,c=k;for(;r<c;){m(t,{errors:i,currentLocation:f+c,expectedLocation:f,distance:s,ignoreLocation:a})<=g?r=c:k=c,c=Math.floor((k-r)/2+r)}k=c;let h=Math.max(1,f-c+1),u=o?d:Math.min(f+c,d)+l,x=Array(u+2);x[u+1]=(1<<i)-1;for(let r=u;r>=h;r-=1){let o=r-1,c=n[e.charAt(o)];if(y&&(M[o]=+!!c),x[r]=(x[r+1]<<1|1)&c,i&&(x[r]|=(L[r+1]|L[r])<<1|1|L[r+1]),x[r]&v&&(_=m(t,{errors:i,currentLocation:o,expectedLocation:f,distance:s,ignoreLocation:a}),_<=g)){if(g=_,p=o,p<=f)break;h=Math.max(1,2*f-p)}}if(m(t,{errors:i+1,currentLocation:f,expectedLocation:f,distance:s,ignoreLocation:a})>g)break;L=x}const w={isMatch:p>=0,score:Math.max(.001,_)};if(y){const e=function(e=[],t=u.minMatchCharLength){let n=[],i=-1,s=-1,r=0;for(let o=e.length;r<o;r+=1){let o=e[r];o&&-1===i?i=r:o||-1===i||(s=r-1,s-i+1>=t&&n.push([i,s]),i=-1)}return e[r-1]&&r-i>=t&&n.push([i,r-1]),n}(M,c);e.length?h&&(w.indices=e):w.isMatch=!1}return w}function M(e){let t={};for(let n=0,i=e.length;n<i;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<i-n-1}return t}class x{constructor(e,{location:t=u.location,threshold:n=u.threshold,distance:i=u.distance,includeMatches:s=u.includeMatches,findAllMatches:r=u.findAllMatches,minMatchCharLength:o=u.minMatchCharLength,isCaseSensitive:c=u.isCaseSensitive,ignoreLocation:h=u.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:s,findAllMatches:r,minMatchCharLength:o,isCaseSensitive:c,ignoreLocation:h},this.pattern=c?e:e.toLowerCase(),this.chunks=[],!this.pattern.length)return;const a=(e,t)=>{this.chunks.push({pattern:e,alphabet:M(e),startIndex:t})},l=this.pattern.length;if(l>32){let e=0;const t=l%32,n=l-t;for(;e<n;)a(this.pattern.substr(e,32),e),e+=32;if(t){const e=l-32;a(this.pattern.substr(e),e)}}else a(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,includeMatches:n}=this.options;if(t||(e=e.toLowerCase()),this.pattern===e){let t={isMatch:!0,score:0};return n&&(t.indices=[[0,e.length-1]]),t}const{location:i,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:c,ignoreLocation:h}=this.options;let a=[],l=0,d=!1;this.chunks.forEach((({pattern:t,alphabet:u,startIndex:f})=>{const{isMatch:g,score:p,indices:m}=y(e,t,u,{location:i+f,distance:s,threshold:r,findAllMatches:o,minMatchCharLength:c,includeMatches:n,ignoreLocation:h});g&&(d=!0),l+=p,g&&m&&(a=[...a,...m])}));let u={isMatch:d,score:d?l/this.chunks.length:1};return d&&n&&(u.indices=a),u}}const L=[];function _(e,t){for(let n=0,i=L.length;n<i;n+=1){let i=L[n];if(i.condition(e,t))return new i(e,t)}return new x(e,t)}function k(e,t){const n=e.matches;t.matches=[],s(n)&&n.forEach((e=>{if(!s(e.indices)||!e.indices.length)return;const{indices:n,value:i}=e;let r={indices:n,value:i};e.key&&(r.key=e.key.src),e.idx>-1&&(r.refIndex=e.idx),t.matches.push(r)}))}function v(e,t){t.score=e.score}class w{constructor(e,t={},n){if(this.options={...u,...t},this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new h(this.options.keys),this.setCollection(e,n)}setCollection(e,t){if(this._docs=e,t&&!(t instanceof g))throw new Error("Incorrect 'index' type");this._myIndex=t||p(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){s(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=(()=>!1)){const t=[];for(let n=0,i=this._docs.length;n<i;n+=1){const s=this._docs[n];e(s,n)&&(this.removeAt(n),n-=1,i-=1,t.push(s))}return t}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:i=-1}={}){const{includeMatches:s,includeScore:r,shouldSort:o,sortFn:c,ignoreFieldNorm:h}=this.options;let a=t(e)?t(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,{ignoreFieldNorm:t=u.ignoreFieldNorm}){e.forEach((e=>{let n=1;e.matches.forEach((({key:e,norm:i,score:s})=>{const r=e?e.weight:null;n*=Math.pow(0===s&&r?Number.EPSILON:s,(r||1)*(t?1:i))})),e.score=n}))}(a,{ignoreFieldNorm:h}),o&&a.sort(c),n(i)&&i>-1&&(a=a.slice(0,i)),function(e,t,{includeMatches:n=u.includeMatches,includeScore:i=u.includeScore}={}){const s=[];return n&&s.push(k),i&&s.push(v),e.map((e=>{const{idx:n}=e,i={item:t[n],refIndex:n};return s.length&&s.forEach((t=>{t(e,i)})),i}))}(a,this._docs,{includeMatches:s,includeScore:r})}_searchStringList(e){const t=_(e,this.options),{records:n}=this._myIndex,i=[];return n.forEach((({v:e,i:n,n:r})=>{if(!s(e))return;const{isMatch:o,score:c,indices:h}=t.searchIn(e);o&&i.push({item:e,idx:n,matches:[{score:c,value:e,norm:r,indices:h}]})})),i}_searchLogical(e){throw new Error("Logical search is not available")}_searchObjectList(e){const t=_(e,this.options),{keys:n,records:i}=this._myIndex,r=[];return i.forEach((({$:e,i:i})=>{if(!s(e))return;let o=[];n.forEach(((n,i)=>{o.push(...this._findMatches({key:n,value:e[i],searcher:t}))})),o.length&&r.push({idx:i,item:e,matches:o})})),r}_findMatches({key:t,value:n,searcher:i}){if(!s(n))return[];let r=[];if(e(n))n.forEach((({v:e,i:n,n:o})=>{if(!s(e))return;const{isMatch:c,score:h,indices:a}=i.searchIn(e);c&&r.push({score:h,key:t,value:e,idx:n,norm:o,indices:a})}));else{const{v:e,n:s}=n,{isMatch:o,score:c,indices:h}=i.searchIn(e);o&&r.push({score:c,key:t,value:e,norm:s,indices:h})}return r}}w.version="6.6.2",w.createIndex=p,w.parseIndex=function(e,{getFn:t=u.getFn,fieldNormWeight:n=u.fieldNormWeight}={}){const{keys:i,records:s}=e,r=new g({getFn:t,fieldNormWeight:n});return r.setKeys(i),r.setIndexRecords(s),r},w.config=u;export{w as default}; \ No newline at end of file
diff --git a/node_modules/fuse.js/dist/fuse.basic.js b/node_modules/fuse.js/dist/fuse.basic.js
new file mode 100644
index 0000000..bf98d65
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.basic.js
@@ -0,0 +1,1473 @@
+/**
+ * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
+ *
+ * Copyright (c) 2022 Kiro Risk (http://kiro.me)
+ * All Rights Reserved. Apache Software License 2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Fuse = factory());
+})(this, (function () { 'use strict';
+
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ })), keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+ }
+
+ function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = null != arguments[i] ? arguments[i] : {};
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+
+ return target;
+ }
+
+ function _typeof(obj) {
+ "@babel/helpers - typeof";
+
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ }, _typeof(obj);
+ }
+
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+ }
+
+ function _defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ }
+
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ Object.defineProperty(Constructor, "prototype", {
+ writable: false
+ });
+ return Constructor;
+ }
+
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+ }
+
+ function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+ }
+
+ function _iterableToArray(iter) {
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
+ }
+
+ function _unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(o);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+ }
+
+ function _arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+
+ return arr2;
+ }
+
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+
+ function isArray(value) {
+ return !Array.isArray ? getTag(value) === '[object Array]' : Array.isArray(value);
+ } // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js
+
+ var INFINITY = 1 / 0;
+ function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+
+ var result = value + '';
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result;
+ }
+ function toString(value) {
+ return value == null ? '' : baseToString(value);
+ }
+ function isString(value) {
+ return typeof value === 'string';
+ }
+ function isNumber(value) {
+ return typeof value === 'number';
+ } // Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
+
+ function isBoolean(value) {
+ return value === true || value === false || isObjectLike(value) && getTag(value) == '[object Boolean]';
+ }
+ function isObject(value) {
+ return _typeof(value) === 'object';
+ } // Checks if `value` is object-like.
+
+ function isObjectLike(value) {
+ return isObject(value) && value !== null;
+ }
+ function isDefined(value) {
+ return value !== undefined && value !== null;
+ }
+ function isBlank(value) {
+ return !value.trim().length;
+ } // Gets the `toStringTag` of `value`.
+ // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js
+
+ function getTag(value) {
+ return value == null ? value === undefined ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(value);
+ }
+
+ var EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';
+ var LOGICAL_SEARCH_UNAVAILABLE = 'Logical search is not available';
+ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
+ var LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = function LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key) {
+ return "Invalid value for key ".concat(key);
+ };
+ var PATTERN_LENGTH_TOO_LARGE = function PATTERN_LENGTH_TOO_LARGE(max) {
+ return "Pattern length exceeds max of ".concat(max, ".");
+ };
+ var MISSING_KEY_PROPERTY = function MISSING_KEY_PROPERTY(name) {
+ return "Missing ".concat(name, " property in key");
+ };
+ var INVALID_KEY_WEIGHT_VALUE = function INVALID_KEY_WEIGHT_VALUE(key) {
+ return "Property 'weight' in key '".concat(key, "' must be a positive integer");
+ };
+
+ var hasOwn = Object.prototype.hasOwnProperty;
+
+ var KeyStore = /*#__PURE__*/function () {
+ function KeyStore(keys) {
+ var _this = this;
+
+ _classCallCheck(this, KeyStore);
+
+ this._keys = [];
+ this._keyMap = {};
+ var totalWeight = 0;
+ keys.forEach(function (key) {
+ var obj = createKey(key);
+ totalWeight += obj.weight;
+
+ _this._keys.push(obj);
+
+ _this._keyMap[obj.id] = obj;
+ totalWeight += obj.weight;
+ }); // Normalize weights so that their sum is equal to 1
+
+ this._keys.forEach(function (key) {
+ key.weight /= totalWeight;
+ });
+ }
+
+ _createClass(KeyStore, [{
+ key: "get",
+ value: function get(keyId) {
+ return this._keyMap[keyId];
+ }
+ }, {
+ key: "keys",
+ value: function keys() {
+ return this._keys;
+ }
+ }, {
+ key: "toJSON",
+ value: function toJSON() {
+ return JSON.stringify(this._keys);
+ }
+ }]);
+
+ return KeyStore;
+ }();
+ function createKey(key) {
+ var path = null;
+ var id = null;
+ var src = null;
+ var weight = 1;
+ var getFn = null;
+
+ if (isString(key) || isArray(key)) {
+ src = key;
+ path = createKeyPath(key);
+ id = createKeyId(key);
+ } else {
+ if (!hasOwn.call(key, 'name')) {
+ throw new Error(MISSING_KEY_PROPERTY('name'));
+ }
+
+ var name = key.name;
+ src = name;
+
+ if (hasOwn.call(key, 'weight')) {
+ weight = key.weight;
+
+ if (weight <= 0) {
+ throw new Error(INVALID_KEY_WEIGHT_VALUE(name));
+ }
+ }
+
+ path = createKeyPath(name);
+ id = createKeyId(name);
+ getFn = key.getFn;
+ }
+
+ return {
+ path: path,
+ id: id,
+ weight: weight,
+ src: src,
+ getFn: getFn
+ };
+ }
+ function createKeyPath(key) {
+ return isArray(key) ? key : key.split('.');
+ }
+ function createKeyId(key) {
+ return isArray(key) ? key.join('.') : key;
+ }
+
+ function get(obj, path) {
+ var list = [];
+ var arr = false;
+
+ var deepGet = function deepGet(obj, path, index) {
+ if (!isDefined(obj)) {
+ return;
+ }
+
+ if (!path[index]) {
+ // If there's no path left, we've arrived at the object we care about.
+ list.push(obj);
+ } else {
+ var key = path[index];
+ var value = obj[key];
+
+ if (!isDefined(value)) {
+ return;
+ } // If we're at the last value in the path, and if it's a string/number/bool,
+ // add it to the list
+
+
+ if (index === path.length - 1 && (isString(value) || isNumber(value) || isBoolean(value))) {
+ list.push(toString(value));
+ } else if (isArray(value)) {
+ arr = true; // Search each item in the array.
+
+ for (var i = 0, len = value.length; i < len; i += 1) {
+ deepGet(value[i], path, index + 1);
+ }
+ } else if (path.length) {
+ // An object. Recurse further.
+ deepGet(value, path, index + 1);
+ }
+ }
+ }; // Backwards compatibility (since path used to be a string)
+
+
+ deepGet(obj, isString(path) ? path.split('.') : path, 0);
+ return arr ? list : list[0];
+ }
+
+ var MatchOptions = {
+ // Whether the matches should be included in the result set. When `true`, each record in the result
+ // set will include the indices of the matched characters.
+ // These can consequently be used for highlighting purposes.
+ includeMatches: false,
+ // When `true`, the matching function will continue to the end of a search pattern even if
+ // a perfect match has already been located in the string.
+ findAllMatches: false,
+ // Minimum number of characters that must be matched before a result is considered a match
+ minMatchCharLength: 1
+ };
+ var BasicOptions = {
+ // When `true`, the algorithm continues searching to the end of the input even if a perfect
+ // match is found before the end of the same input.
+ isCaseSensitive: false,
+ // When true, the matching function will continue to the end of a search pattern even if
+ includeScore: false,
+ // List of properties that will be searched. This also supports nested properties.
+ keys: [],
+ // Whether to sort the result list, by score
+ shouldSort: true,
+ // Default sort function: sort by ascending score, ascending index
+ sortFn: function sortFn(a, b) {
+ return a.score === b.score ? a.idx < b.idx ? -1 : 1 : a.score < b.score ? -1 : 1;
+ }
+ };
+ var FuzzyOptions = {
+ // Approximately where in the text is the pattern expected to be found?
+ location: 0,
+ // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
+ // (of both letters and location), a threshold of '1.0' would match anything.
+ threshold: 0.6,
+ // Determines how close the match must be to the fuzzy location (specified above).
+ // An exact letter match which is 'distance' characters away from the fuzzy location
+ // would score as a complete mismatch. A distance of '0' requires the match be at
+ // the exact location specified, a threshold of '1000' would require a perfect match
+ // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
+ distance: 100
+ };
+ var AdvancedOptions = {
+ // When `true`, it enables the use of unix-like search commands
+ useExtendedSearch: false,
+ // The get function to use when fetching an object's properties.
+ // The default will search nested paths *ie foo.bar.baz*
+ getFn: get,
+ // When `true`, search will ignore `location` and `distance`, so it won't matter
+ // where in the string the pattern appears.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
+ ignoreLocation: false,
+ // When `true`, the calculation for the relevance score (used for sorting) will
+ // ignore the field-length norm.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
+ ignoreFieldNorm: false,
+ // The weight to determine how much field length norm effects scoring.
+ fieldNormWeight: 1
+ };
+ var Config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, BasicOptions), MatchOptions), FuzzyOptions), AdvancedOptions);
+
+ var SPACE = /[^ ]+/g; // Field-length norm: the shorter the field, the higher the weight.
+ // Set to 3 decimals to reduce index size.
+
+ function norm() {
+ var weight = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
+ var mantissa = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
+ var cache = new Map();
+ var m = Math.pow(10, mantissa);
+ return {
+ get: function get(value) {
+ var numTokens = value.match(SPACE).length;
+
+ if (cache.has(numTokens)) {
+ return cache.get(numTokens);
+ } // Default function is 1/sqrt(x), weight makes that variable
+
+
+ var norm = 1 / Math.pow(numTokens, 0.5 * weight); // In place of `toFixed(mantissa)`, for faster computation
+
+ var n = parseFloat(Math.round(norm * m) / m);
+ cache.set(numTokens, n);
+ return n;
+ },
+ clear: function clear() {
+ cache.clear();
+ }
+ };
+ }
+
+ var FuseIndex = /*#__PURE__*/function () {
+ function FuseIndex() {
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
+ _ref$getFn = _ref.getFn,
+ getFn = _ref$getFn === void 0 ? Config.getFn : _ref$getFn,
+ _ref$fieldNormWeight = _ref.fieldNormWeight,
+ fieldNormWeight = _ref$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref$fieldNormWeight;
+
+ _classCallCheck(this, FuseIndex);
+
+ this.norm = norm(fieldNormWeight, 3);
+ this.getFn = getFn;
+ this.isCreated = false;
+ this.setIndexRecords();
+ }
+
+ _createClass(FuseIndex, [{
+ key: "setSources",
+ value: function setSources() {
+ var docs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.docs = docs;
+ }
+ }, {
+ key: "setIndexRecords",
+ value: function setIndexRecords() {
+ var records = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.records = records;
+ }
+ }, {
+ key: "setKeys",
+ value: function setKeys() {
+ var _this = this;
+
+ var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.keys = keys;
+ this._keysMap = {};
+ keys.forEach(function (key, idx) {
+ _this._keysMap[key.id] = idx;
+ });
+ }
+ }, {
+ key: "create",
+ value: function create() {
+ var _this2 = this;
+
+ if (this.isCreated || !this.docs.length) {
+ return;
+ }
+
+ this.isCreated = true; // List is Array<String>
+
+ if (isString(this.docs[0])) {
+ this.docs.forEach(function (doc, docIndex) {
+ _this2._addString(doc, docIndex);
+ });
+ } else {
+ // List is Array<Object>
+ this.docs.forEach(function (doc, docIndex) {
+ _this2._addObject(doc, docIndex);
+ });
+ }
+
+ this.norm.clear();
+ } // Adds a doc to the end of the index
+
+ }, {
+ key: "add",
+ value: function add(doc) {
+ var idx = this.size();
+
+ if (isString(doc)) {
+ this._addString(doc, idx);
+ } else {
+ this._addObject(doc, idx);
+ }
+ } // Removes the doc at the specified index of the index
+
+ }, {
+ key: "removeAt",
+ value: function removeAt(idx) {
+ this.records.splice(idx, 1); // Change ref index of every subsquent doc
+
+ for (var i = idx, len = this.size(); i < len; i += 1) {
+ this.records[i].i -= 1;
+ }
+ }
+ }, {
+ key: "getValueForItemAtKeyId",
+ value: function getValueForItemAtKeyId(item, keyId) {
+ return item[this._keysMap[keyId]];
+ }
+ }, {
+ key: "size",
+ value: function size() {
+ return this.records.length;
+ }
+ }, {
+ key: "_addString",
+ value: function _addString(doc, docIndex) {
+ if (!isDefined(doc) || isBlank(doc)) {
+ return;
+ }
+
+ var record = {
+ v: doc,
+ i: docIndex,
+ n: this.norm.get(doc)
+ };
+ this.records.push(record);
+ }
+ }, {
+ key: "_addObject",
+ value: function _addObject(doc, docIndex) {
+ var _this3 = this;
+
+ var record = {
+ i: docIndex,
+ $: {}
+ }; // Iterate over every key (i.e, path), and fetch the value at that key
+
+ this.keys.forEach(function (key, keyIndex) {
+ var value = key.getFn ? key.getFn(doc) : _this3.getFn(doc, key.path);
+
+ if (!isDefined(value)) {
+ return;
+ }
+
+ if (isArray(value)) {
+ (function () {
+ var subRecords = [];
+ var stack = [{
+ nestedArrIndex: -1,
+ value: value
+ }];
+
+ while (stack.length) {
+ var _stack$pop = stack.pop(),
+ nestedArrIndex = _stack$pop.nestedArrIndex,
+ _value = _stack$pop.value;
+
+ if (!isDefined(_value)) {
+ continue;
+ }
+
+ if (isString(_value) && !isBlank(_value)) {
+ var subRecord = {
+ v: _value,
+ i: nestedArrIndex,
+ n: _this3.norm.get(_value)
+ };
+ subRecords.push(subRecord);
+ } else if (isArray(_value)) {
+ _value.forEach(function (item, k) {
+ stack.push({
+ nestedArrIndex: k,
+ value: item
+ });
+ });
+ } else ;
+ }
+
+ record.$[keyIndex] = subRecords;
+ })();
+ } else if (isString(value) && !isBlank(value)) {
+ var subRecord = {
+ v: value,
+ n: _this3.norm.get(value)
+ };
+ record.$[keyIndex] = subRecord;
+ }
+ });
+ this.records.push(record);
+ }
+ }, {
+ key: "toJSON",
+ value: function toJSON() {
+ return {
+ keys: this.keys,
+ records: this.records
+ };
+ }
+ }]);
+
+ return FuseIndex;
+ }();
+ function createIndex(keys, docs) {
+ var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref2$getFn = _ref2.getFn,
+ getFn = _ref2$getFn === void 0 ? Config.getFn : _ref2$getFn,
+ _ref2$fieldNormWeight = _ref2.fieldNormWeight,
+ fieldNormWeight = _ref2$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref2$fieldNormWeight;
+
+ var myIndex = new FuseIndex({
+ getFn: getFn,
+ fieldNormWeight: fieldNormWeight
+ });
+ myIndex.setKeys(keys.map(createKey));
+ myIndex.setSources(docs);
+ myIndex.create();
+ return myIndex;
+ }
+ function parseIndex(data) {
+ var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref3$getFn = _ref3.getFn,
+ getFn = _ref3$getFn === void 0 ? Config.getFn : _ref3$getFn,
+ _ref3$fieldNormWeight = _ref3.fieldNormWeight,
+ fieldNormWeight = _ref3$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref3$fieldNormWeight;
+
+ var keys = data.keys,
+ records = data.records;
+ var myIndex = new FuseIndex({
+ getFn: getFn,
+ fieldNormWeight: fieldNormWeight
+ });
+ myIndex.setKeys(keys);
+ myIndex.setIndexRecords(records);
+ return myIndex;
+ }
+
+ function computeScore$1(pattern) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$errors = _ref.errors,
+ errors = _ref$errors === void 0 ? 0 : _ref$errors,
+ _ref$currentLocation = _ref.currentLocation,
+ currentLocation = _ref$currentLocation === void 0 ? 0 : _ref$currentLocation,
+ _ref$expectedLocation = _ref.expectedLocation,
+ expectedLocation = _ref$expectedLocation === void 0 ? 0 : _ref$expectedLocation,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ var accuracy = errors / pattern.length;
+
+ if (ignoreLocation) {
+ return accuracy;
+ }
+
+ var proximity = Math.abs(expectedLocation - currentLocation);
+
+ if (!distance) {
+ // Dodge divide by zero error.
+ return proximity ? 1.0 : accuracy;
+ }
+
+ return accuracy + proximity / distance;
+ }
+
+ function convertMaskToIndices() {
+ var matchmask = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ var minMatchCharLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Config.minMatchCharLength;
+ var indices = [];
+ var start = -1;
+ var end = -1;
+ var i = 0;
+
+ for (var len = matchmask.length; i < len; i += 1) {
+ var match = matchmask[i];
+
+ if (match && start === -1) {
+ start = i;
+ } else if (!match && start !== -1) {
+ end = i - 1;
+
+ if (end - start + 1 >= minMatchCharLength) {
+ indices.push([start, end]);
+ }
+
+ start = -1;
+ }
+ } // (i-1 - start) + 1 => i - start
+
+
+ if (matchmask[i - 1] && i - start >= minMatchCharLength) {
+ indices.push([start, i - 1]);
+ }
+
+ return indices;
+ }
+
+ // Machine word size
+ var MAX_BITS = 32;
+
+ function search(text, pattern, patternAlphabet) {
+ var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ if (pattern.length > MAX_BITS) {
+ throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));
+ }
+
+ var patternLen = pattern.length; // Set starting location at beginning text and initialize the alphabet.
+
+ var textLen = text.length; // Handle the case when location > text.length
+
+ var expectedLocation = Math.max(0, Math.min(location, textLen)); // Highest score beyond which we give up.
+
+ var currentThreshold = threshold; // Is there a nearby exact match? (speedup)
+
+ var bestLocation = expectedLocation; // Performance: only computer matches when the minMatchCharLength > 1
+ // OR if `includeMatches` is true.
+
+ var computeMatches = minMatchCharLength > 1 || includeMatches; // A mask of the matches, used for building the indices
+
+ var matchMask = computeMatches ? Array(textLen) : [];
+ var index; // Get all exact matches, here for speed up
+
+ while ((index = text.indexOf(pattern, bestLocation)) > -1) {
+ var score = computeScore$1(pattern, {
+ currentLocation: index,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+ currentThreshold = Math.min(score, currentThreshold);
+ bestLocation = index + patternLen;
+
+ if (computeMatches) {
+ var i = 0;
+
+ while (i < patternLen) {
+ matchMask[index + i] = 1;
+ i += 1;
+ }
+ }
+ } // Reset the best location
+
+
+ bestLocation = -1;
+ var lastBitArr = [];
+ var finalScore = 1;
+ var binMax = patternLen + textLen;
+ var mask = 1 << patternLen - 1;
+
+ for (var _i = 0; _i < patternLen; _i += 1) {
+ // Scan for the best match; each iteration allows for one more error.
+ // Run a binary search to determine how far from the match location we can stray
+ // at this error level.
+ var binMin = 0;
+ var binMid = binMax;
+
+ while (binMin < binMid) {
+ var _score2 = computeScore$1(pattern, {
+ errors: _i,
+ currentLocation: expectedLocation + binMid,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+
+ if (_score2 <= currentThreshold) {
+ binMin = binMid;
+ } else {
+ binMax = binMid;
+ }
+
+ binMid = Math.floor((binMax - binMin) / 2 + binMin);
+ } // Use the result from this iteration as the maximum for the next.
+
+
+ binMax = binMid;
+ var start = Math.max(1, expectedLocation - binMid + 1);
+ var finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen; // Initialize the bit array
+
+ var bitArr = Array(finish + 2);
+ bitArr[finish + 1] = (1 << _i) - 1;
+
+ for (var j = finish; j >= start; j -= 1) {
+ var currentLocation = j - 1;
+ var charMatch = patternAlphabet[text.charAt(currentLocation)];
+
+ if (computeMatches) {
+ // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)
+ matchMask[currentLocation] = +!!charMatch;
+ } // First pass: exact match
+
+
+ bitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch; // Subsequent passes: fuzzy match
+
+ if (_i) {
+ bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1];
+ }
+
+ if (bitArr[j] & mask) {
+ finalScore = computeScore$1(pattern, {
+ errors: _i,
+ currentLocation: currentLocation,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ }); // This match will almost certainly be better than any existing match.
+ // But check anyway.
+
+ if (finalScore <= currentThreshold) {
+ // Indeed it is
+ currentThreshold = finalScore;
+ bestLocation = currentLocation; // Already passed `loc`, downhill from here on in.
+
+ if (bestLocation <= expectedLocation) {
+ break;
+ } // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.
+
+
+ start = Math.max(1, 2 * expectedLocation - bestLocation);
+ }
+ }
+ } // No hope for a (better) match at greater error levels.
+
+
+ var _score = computeScore$1(pattern, {
+ errors: _i + 1,
+ currentLocation: expectedLocation,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+
+ if (_score > currentThreshold) {
+ break;
+ }
+
+ lastBitArr = bitArr;
+ }
+
+ var result = {
+ isMatch: bestLocation >= 0,
+ // Count exact matches (those with a score of 0) to be "almost" exact
+ score: Math.max(0.001, finalScore)
+ };
+
+ if (computeMatches) {
+ var indices = convertMaskToIndices(matchMask, minMatchCharLength);
+
+ if (!indices.length) {
+ result.isMatch = false;
+ } else if (includeMatches) {
+ result.indices = indices;
+ }
+ }
+
+ return result;
+ }
+
+ function createPatternAlphabet(pattern) {
+ var mask = {};
+
+ for (var i = 0, len = pattern.length; i < len; i += 1) {
+ var _char = pattern.charAt(i);
+
+ mask[_char] = (mask[_char] || 0) | 1 << len - i - 1;
+ }
+
+ return mask;
+ }
+
+ var BitapSearch = /*#__PURE__*/function () {
+ function BitapSearch(pattern) {
+ var _this = this;
+
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$isCaseSensitive = _ref.isCaseSensitive,
+ isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ _classCallCheck(this, BitapSearch);
+
+ this.options = {
+ location: location,
+ threshold: threshold,
+ distance: distance,
+ includeMatches: includeMatches,
+ findAllMatches: findAllMatches,
+ minMatchCharLength: minMatchCharLength,
+ isCaseSensitive: isCaseSensitive,
+ ignoreLocation: ignoreLocation
+ };
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+ this.chunks = [];
+
+ if (!this.pattern.length) {
+ return;
+ }
+
+ var addChunk = function addChunk(pattern, startIndex) {
+ _this.chunks.push({
+ pattern: pattern,
+ alphabet: createPatternAlphabet(pattern),
+ startIndex: startIndex
+ });
+ };
+
+ var len = this.pattern.length;
+
+ if (len > MAX_BITS) {
+ var i = 0;
+ var remainder = len % MAX_BITS;
+ var end = len - remainder;
+
+ while (i < end) {
+ addChunk(this.pattern.substr(i, MAX_BITS), i);
+ i += MAX_BITS;
+ }
+
+ if (remainder) {
+ var startIndex = len - MAX_BITS;
+ addChunk(this.pattern.substr(startIndex), startIndex);
+ }
+ } else {
+ addChunk(this.pattern, 0);
+ }
+ }
+
+ _createClass(BitapSearch, [{
+ key: "searchIn",
+ value: function searchIn(text) {
+ var _this$options = this.options,
+ isCaseSensitive = _this$options.isCaseSensitive,
+ includeMatches = _this$options.includeMatches;
+
+ if (!isCaseSensitive) {
+ text = text.toLowerCase();
+ } // Exact match
+
+
+ if (this.pattern === text) {
+ var _result = {
+ isMatch: true,
+ score: 0
+ };
+
+ if (includeMatches) {
+ _result.indices = [[0, text.length - 1]];
+ }
+
+ return _result;
+ } // Otherwise, use Bitap algorithm
+
+
+ var _this$options2 = this.options,
+ location = _this$options2.location,
+ distance = _this$options2.distance,
+ threshold = _this$options2.threshold,
+ findAllMatches = _this$options2.findAllMatches,
+ minMatchCharLength = _this$options2.minMatchCharLength,
+ ignoreLocation = _this$options2.ignoreLocation;
+ var allIndices = [];
+ var totalScore = 0;
+ var hasMatches = false;
+ this.chunks.forEach(function (_ref2) {
+ var pattern = _ref2.pattern,
+ alphabet = _ref2.alphabet,
+ startIndex = _ref2.startIndex;
+
+ var _search = search(text, pattern, alphabet, {
+ location: location + startIndex,
+ distance: distance,
+ threshold: threshold,
+ findAllMatches: findAllMatches,
+ minMatchCharLength: minMatchCharLength,
+ includeMatches: includeMatches,
+ ignoreLocation: ignoreLocation
+ }),
+ isMatch = _search.isMatch,
+ score = _search.score,
+ indices = _search.indices;
+
+ if (isMatch) {
+ hasMatches = true;
+ }
+
+ totalScore += score;
+
+ if (isMatch && indices) {
+ allIndices = [].concat(_toConsumableArray(allIndices), _toConsumableArray(indices));
+ }
+ });
+ var result = {
+ isMatch: hasMatches,
+ score: hasMatches ? totalScore / this.chunks.length : 1
+ };
+
+ if (hasMatches && includeMatches) {
+ result.indices = allIndices;
+ }
+
+ return result;
+ }
+ }]);
+
+ return BitapSearch;
+ }();
+
+ var registeredSearchers = [];
+ function createSearcher(pattern, options) {
+ for (var i = 0, len = registeredSearchers.length; i < len; i += 1) {
+ var searcherClass = registeredSearchers[i];
+
+ if (searcherClass.condition(pattern, options)) {
+ return new searcherClass(pattern, options);
+ }
+ }
+
+ return new BitapSearch(pattern, options);
+ }
+
+ var LogicalOperator = {
+ AND: '$and',
+ OR: '$or'
+ };
+ var KeyType = {
+ PATH: '$path',
+ PATTERN: '$val'
+ };
+
+ var isExpression = function isExpression(query) {
+ return !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
+ };
+
+ var isPath = function isPath(query) {
+ return !!query[KeyType.PATH];
+ };
+
+ var isLeaf = function isLeaf(query) {
+ return !isArray(query) && isObject(query) && !isExpression(query);
+ };
+
+ var convertToExplicit = function convertToExplicit(query) {
+ return _defineProperty({}, LogicalOperator.AND, Object.keys(query).map(function (key) {
+ return _defineProperty({}, key, query[key]);
+ }));
+ }; // When `auto` is `true`, the parse function will infer and initialize and add
+ // the appropriate `Searcher` instance
+
+
+ function parse(query, options) {
+ var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref3$auto = _ref3.auto,
+ auto = _ref3$auto === void 0 ? true : _ref3$auto;
+
+ var next = function next(query) {
+ var keys = Object.keys(query);
+ var isQueryPath = isPath(query);
+
+ if (!isQueryPath && keys.length > 1 && !isExpression(query)) {
+ return next(convertToExplicit(query));
+ }
+
+ if (isLeaf(query)) {
+ var key = isQueryPath ? query[KeyType.PATH] : keys[0];
+ var pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];
+
+ if (!isString(pattern)) {
+ throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));
+ }
+
+ var obj = {
+ keyId: createKeyId(key),
+ pattern: pattern
+ };
+
+ if (auto) {
+ obj.searcher = createSearcher(pattern, options);
+ }
+
+ return obj;
+ }
+
+ var node = {
+ children: [],
+ operator: keys[0]
+ };
+ keys.forEach(function (key) {
+ var value = query[key];
+
+ if (isArray(value)) {
+ value.forEach(function (item) {
+ node.children.push(next(item));
+ });
+ }
+ });
+ return node;
+ };
+
+ if (!isExpression(query)) {
+ query = convertToExplicit(query);
+ }
+
+ return next(query);
+ }
+
+ function computeScore(results, _ref) {
+ var _ref$ignoreFieldNorm = _ref.ignoreFieldNorm,
+ ignoreFieldNorm = _ref$ignoreFieldNorm === void 0 ? Config.ignoreFieldNorm : _ref$ignoreFieldNorm;
+ results.forEach(function (result) {
+ var totalScore = 1;
+ result.matches.forEach(function (_ref2) {
+ var key = _ref2.key,
+ norm = _ref2.norm,
+ score = _ref2.score;
+ var weight = key ? key.weight : null;
+ totalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm));
+ });
+ result.score = totalScore;
+ });
+ }
+
+ function transformMatches(result, data) {
+ var matches = result.matches;
+ data.matches = [];
+
+ if (!isDefined(matches)) {
+ return;
+ }
+
+ matches.forEach(function (match) {
+ if (!isDefined(match.indices) || !match.indices.length) {
+ return;
+ }
+
+ var indices = match.indices,
+ value = match.value;
+ var obj = {
+ indices: indices,
+ value: value
+ };
+
+ if (match.key) {
+ obj.key = match.key.src;
+ }
+
+ if (match.idx > -1) {
+ obj.refIndex = match.idx;
+ }
+
+ data.matches.push(obj);
+ });
+ }
+
+ function transformScore(result, data) {
+ data.score = result.score;
+ }
+
+ function format(results, docs) {
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$includeScore = _ref.includeScore,
+ includeScore = _ref$includeScore === void 0 ? Config.includeScore : _ref$includeScore;
+
+ var transformers = [];
+ if (includeMatches) transformers.push(transformMatches);
+ if (includeScore) transformers.push(transformScore);
+ return results.map(function (result) {
+ var idx = result.idx;
+ var data = {
+ item: docs[idx],
+ refIndex: idx
+ };
+
+ if (transformers.length) {
+ transformers.forEach(function (transformer) {
+ transformer(result, data);
+ });
+ }
+
+ return data;
+ });
+ }
+
+ var Fuse$1 = /*#__PURE__*/function () {
+ function Fuse(docs) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ var index = arguments.length > 2 ? arguments[2] : undefined;
+
+ _classCallCheck(this, Fuse);
+
+ this.options = _objectSpread2(_objectSpread2({}, Config), options);
+
+ if (this.options.useExtendedSearch && !false) {
+ throw new Error(EXTENDED_SEARCH_UNAVAILABLE);
+ }
+
+ this._keyStore = new KeyStore(this.options.keys);
+ this.setCollection(docs, index);
+ }
+
+ _createClass(Fuse, [{
+ key: "setCollection",
+ value: function setCollection(docs, index) {
+ this._docs = docs;
+
+ if (index && !(index instanceof FuseIndex)) {
+ throw new Error(INCORRECT_INDEX_TYPE);
+ }
+
+ this._myIndex = index || createIndex(this.options.keys, this._docs, {
+ getFn: this.options.getFn,
+ fieldNormWeight: this.options.fieldNormWeight
+ });
+ }
+ }, {
+ key: "add",
+ value: function add(doc) {
+ if (!isDefined(doc)) {
+ return;
+ }
+
+ this._docs.push(doc);
+
+ this._myIndex.add(doc);
+ }
+ }, {
+ key: "remove",
+ value: function remove() {
+ var predicate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function
+ /* doc, idx */
+ () {
+ return false;
+ };
+ var results = [];
+
+ for (var i = 0, len = this._docs.length; i < len; i += 1) {
+ var doc = this._docs[i];
+
+ if (predicate(doc, i)) {
+ this.removeAt(i);
+ i -= 1;
+ len -= 1;
+ results.push(doc);
+ }
+ }
+
+ return results;
+ }
+ }, {
+ key: "removeAt",
+ value: function removeAt(idx) {
+ this._docs.splice(idx, 1);
+
+ this._myIndex.removeAt(idx);
+ }
+ }, {
+ key: "getIndex",
+ value: function getIndex() {
+ return this._myIndex;
+ }
+ }, {
+ key: "search",
+ value: function search(query) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$limit = _ref.limit,
+ limit = _ref$limit === void 0 ? -1 : _ref$limit;
+
+ var _this$options = this.options,
+ includeMatches = _this$options.includeMatches,
+ includeScore = _this$options.includeScore,
+ shouldSort = _this$options.shouldSort,
+ sortFn = _this$options.sortFn,
+ ignoreFieldNorm = _this$options.ignoreFieldNorm;
+ var results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);
+ computeScore(results, {
+ ignoreFieldNorm: ignoreFieldNorm
+ });
+
+ if (shouldSort) {
+ results.sort(sortFn);
+ }
+
+ if (isNumber(limit) && limit > -1) {
+ results = results.slice(0, limit);
+ }
+
+ return format(results, this._docs, {
+ includeMatches: includeMatches,
+ includeScore: includeScore
+ });
+ }
+ }, {
+ key: "_searchStringList",
+ value: function _searchStringList(query) {
+ var searcher = createSearcher(query, this.options);
+ var records = this._myIndex.records;
+ var results = []; // Iterate over every string in the index
+
+ records.forEach(function (_ref2) {
+ var text = _ref2.v,
+ idx = _ref2.i,
+ norm = _ref2.n;
+
+ if (!isDefined(text)) {
+ return;
+ }
+
+ var _searcher$searchIn = searcher.searchIn(text),
+ isMatch = _searcher$searchIn.isMatch,
+ score = _searcher$searchIn.score,
+ indices = _searcher$searchIn.indices;
+
+ if (isMatch) {
+ results.push({
+ item: text,
+ idx: idx,
+ matches: [{
+ score: score,
+ value: text,
+ norm: norm,
+ indices: indices
+ }]
+ });
+ }
+ });
+ return results;
+ }
+ }, {
+ key: "_searchLogical",
+ value: function _searchLogical(query) {
+
+ {
+ throw new Error(LOGICAL_SEARCH_UNAVAILABLE);
+ }
+ }
+ }, {
+ key: "_searchObjectList",
+ value: function _searchObjectList(query) {
+ var _this2 = this;
+
+ var searcher = createSearcher(query, this.options);
+ var _this$_myIndex = this._myIndex,
+ keys = _this$_myIndex.keys,
+ records = _this$_myIndex.records;
+ var results = []; // List is Array<Object>
+
+ records.forEach(function (_ref5) {
+ var item = _ref5.$,
+ idx = _ref5.i;
+
+ if (!isDefined(item)) {
+ return;
+ }
+
+ var matches = []; // Iterate over every key (i.e, path), and fetch the value at that key
+
+ keys.forEach(function (key, keyIndex) {
+ matches.push.apply(matches, _toConsumableArray(_this2._findMatches({
+ key: key,
+ value: item[keyIndex],
+ searcher: searcher
+ })));
+ });
+
+ if (matches.length) {
+ results.push({
+ idx: idx,
+ item: item,
+ matches: matches
+ });
+ }
+ });
+ return results;
+ }
+ }, {
+ key: "_findMatches",
+ value: function _findMatches(_ref6) {
+ var key = _ref6.key,
+ value = _ref6.value,
+ searcher = _ref6.searcher;
+
+ if (!isDefined(value)) {
+ return [];
+ }
+
+ var matches = [];
+
+ if (isArray(value)) {
+ value.forEach(function (_ref7) {
+ var text = _ref7.v,
+ idx = _ref7.i,
+ norm = _ref7.n;
+
+ if (!isDefined(text)) {
+ return;
+ }
+
+ var _searcher$searchIn2 = searcher.searchIn(text),
+ isMatch = _searcher$searchIn2.isMatch,
+ score = _searcher$searchIn2.score,
+ indices = _searcher$searchIn2.indices;
+
+ if (isMatch) {
+ matches.push({
+ score: score,
+ key: key,
+ value: text,
+ idx: idx,
+ norm: norm,
+ indices: indices
+ });
+ }
+ });
+ } else {
+ var text = value.v,
+ norm = value.n;
+
+ var _searcher$searchIn3 = searcher.searchIn(text),
+ isMatch = _searcher$searchIn3.isMatch,
+ score = _searcher$searchIn3.score,
+ indices = _searcher$searchIn3.indices;
+
+ if (isMatch) {
+ matches.push({
+ score: score,
+ key: key,
+ value: text,
+ norm: norm,
+ indices: indices
+ });
+ }
+ }
+
+ return matches;
+ }
+ }]);
+
+ return Fuse;
+ }();
+
+ Fuse$1.version = '6.6.2';
+ Fuse$1.createIndex = createIndex;
+ Fuse$1.parseIndex = parseIndex;
+ Fuse$1.config = Config;
+
+ {
+ Fuse$1.parseQuery = parse;
+ }
+
+ var Fuse = Fuse$1;
+
+ return Fuse;
+
+}));
diff --git a/node_modules/fuse.js/dist/fuse.basic.min.js b/node_modules/fuse.js/dist/fuse.basic.min.js
new file mode 100644
index 0000000..89477c6
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.basic.min.js
@@ -0,0 +1,9 @@
+/**
+ * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
+ *
+ * Copyright (c) 2022 Kiro Risk (http://kiro.me)
+ * All Rights Reserved. Apache Software License 2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){a(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function h(e){return Array.isArray?Array.isArray(e):"[object Array]"===g(e)}function u(e){return"string"==typeof e}function l(e){return"number"==typeof e}function d(e){return!0===e||!1===e||function(e){return function(e){return"object"===n(e)}(e)&&null!==e}(e)&&"[object Boolean]"==g(e)}function f(e){return null!=e}function v(e){return!e.trim().length}function g(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var y="Extended search is not available",p=function(e){return"Pattern length exceeds max of ".concat(e,".")},m=Object.prototype.hasOwnProperty,b=function(){function e(t){var n=this;r(this,e),this._keys=[],this._keyMap={};var i=0;t.forEach((function(e){var t=k(e);i+=t.weight,n._keys.push(t),n._keyMap[t.id]=t,i+=t.weight})),this._keys.forEach((function(e){e.weight/=i}))}return o(e,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function k(e){var t=null,n=null,r=null,i=1,o=null;if(u(e)||h(e))r=e,t=M(e),n=w(e);else{if(!m.call(e,"name"))throw new Error(function(e){return"Missing ".concat(e," property in key")}("name"));var a=e.name;if(r=a,m.call(e,"weight")&&(i=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(a));t=M(a),n=w(a),o=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:o}}function M(e){return h(e)?e:e.split(".")}function w(e){return h(e)?e.join("."):e}var x={useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,i,o){if(f(t))if(i[o]){var a=t[i[o]];if(!f(a))return;if(o===i.length-1&&(u(a)||l(a)||d(a)))n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(a));else if(h(a)){r=!0;for(var c=0,s=a.length;c<s;c+=1)e(a[c],i,o+1)}else i.length&&e(a,i,o+1)}else n.push(t)}(e,u(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},L=t(t(t(t({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){return e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}}),{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1}),{location:0,threshold:.6,distance:100}),x),_=/[^ ]+/g;function S(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(_).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),a=parseFloat(Math.round(o*r)/r);return n.set(i,a),a},clear:function(){n.clear()}}}var O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?L.getFn:n,o=t.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o;r(this,e),this.norm=S(a,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,u(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();u(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}},{key:"getValueForItemAtKeyId",value:function(e,t){return e[this._keysMap[t]]}},{key:"size",value:function(){return this.records.length}},{key:"_addString",value:function(e,t){if(f(e)&&!v(e)){var n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}}},{key:"_addObject",value:function(e,t){var n=this,r={i:t,$:{}};this.keys.forEach((function(t,i){var o=t.getFn?t.getFn(e):n.getFn(e,t.path);if(f(o))if(h(o))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:o}];t.length;){var a=t.pop(),c=a.nestedArrIndex,s=a.value;if(f(s))if(u(s)&&!v(s)){var l={v:s,i:c,n:n.norm.get(s)};e.push(l)}else h(s)&&s.forEach((function(e,n){t.push({nestedArrIndex:n,value:e})}))}r.$[i]=e}();else if(u(o)&&!v(o)){var a={v:o,n:n.norm.get(o)};r.$[i]=a}})),this.records.push(r)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),e}();function A(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?L.getFn:r,o=n.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o,c=new O({getFn:i,fieldNormWeight:a});return c.setKeys(e.map(k)),c.setSources(t),c.create(),c}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,a=t.expectedLocation,c=void 0===a?0:a,s=t.distance,h=void 0===s?L.distance:s,u=t.ignoreLocation,l=void 0===u?L.ignoreLocation:u,d=r/e.length;if(l)return d;var f=Math.abs(c-o);return h?d+f/h:f?1:d}function E(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o<a;o+=1){var c=e[o];c&&-1===r?r=o:c||-1===r||((i=o-1)-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var I=32;function F(e){for(var t={},n=0,r=e.length;n<r;n+=1){var i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}var C=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?L.location:o,c=i.threshold,s=void 0===c?L.threshold:c,h=i.distance,u=void 0===h?L.distance:h,l=i.includeMatches,d=void 0===l?L.includeMatches:l,f=i.findAllMatches,v=void 0===f?L.findAllMatches:f,g=i.minMatchCharLength,y=void 0===g?L.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?L.isCaseSensitive:p,b=i.ignoreLocation,k=void 0===b?L.ignoreLocation:b;if(r(this,e),this.options={location:a,threshold:s,distance:u,includeMatches:d,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:k},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var M=function(e,t){n.chunks.push({pattern:e,alphabet:F(e),startIndex:t})},w=this.pattern.length;if(w>I){for(var x=0,_=w%I,S=w-_;x<S;)M(this.pattern.substr(x,I),x),x+=I;if(_){var O=w-I;M(this.pattern.substr(O),O)}}else M(this.pattern,0)}}return o(e,[{key:"searchIn",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var i={isMatch:!0,score:0};return r&&(i.indices=[[0,e.length-1]]),i}var o=this.options,a=o.location,s=o.distance,h=o.threshold,u=o.findAllMatches,l=o.minMatchCharLength,d=o.ignoreLocation,f=[],v=0,g=!1;this.chunks.forEach((function(t){var n=t.pattern,i=t.alphabet,o=t.startIndex,y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?L.location:i,a=r.distance,c=void 0===a?L.distance:a,s=r.threshold,h=void 0===s?L.threshold:s,u=r.findAllMatches,l=void 0===u?L.findAllMatches:u,d=r.minMatchCharLength,f=void 0===d?L.minMatchCharLength:d,v=r.includeMatches,g=void 0===v?L.includeMatches:v,y=r.ignoreLocation,m=void 0===y?L.ignoreLocation:y;if(t.length>I)throw new Error(p(I));for(var b,k=t.length,M=e.length,w=Math.max(0,Math.min(o,M)),x=h,_=w,S=f>1||g,O=S?Array(M):[];(b=e.indexOf(t,_))>-1;){var A=j(t,{currentLocation:b,expectedLocation:w,distance:c,ignoreLocation:m});if(x=Math.min(A,x),_=b+k,S)for(var F=0;F<k;)O[b+F]=1,F+=1}_=-1;for(var C=[],N=1,P=k+M,W=1<<k-1,$=0;$<k;$+=1){for(var D=0,K=P;D<K;)j(t,{errors:$,currentLocation:w+K,expectedLocation:w,distance:c,ignoreLocation:m})<=x?D=K:P=K,K=Math.floor((P-D)/2+D);P=K;var T=Math.max(1,w-K+1),z=l?M:Math.min(w+K,M)+k,J=Array(z+2);J[z+1]=(1<<$)-1;for(var R=z;R>=T;R-=1){var U=R-1,B=n[e.charAt(U)];if(S&&(O[U]=+!!B),J[R]=(J[R+1]<<1|1)&B,$&&(J[R]|=(C[R+1]|C[R])<<1|1|C[R+1]),J[R]&W&&(N=j(t,{errors:$,currentLocation:U,expectedLocation:w,distance:c,ignoreLocation:m}))<=x){if(x=N,(_=U)<=w)break;T=Math.max(1,2*w-_)}}if(j(t,{errors:$+1,currentLocation:w,expectedLocation:w,distance:c,ignoreLocation:m})>x)break;C=J}var V={isMatch:_>=0,score:Math.max(.001,N)};if(S){var q=E(O,f);q.length?g&&(V.indices=q):V.isMatch=!1}return V}(e,n,i,{location:a+o,distance:s,threshold:h,findAllMatches:u,minMatchCharLength:l,includeMatches:r,ignoreLocation:d}),m=y.isMatch,b=y.score,k=y.indices;m&&(g=!0),v+=b,m&&k&&(f=[].concat(c(f),c(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=f),y}}]),e}(),N=[];function P(e,t){for(var n=0,r=N.length;n<r;n+=1){var i=N[n];if(i.condition(e,t))return new i(e,t)}return new C(e,t)}function W(e,t){var n=t.ignoreFieldNorm,r=void 0===n?L.ignoreFieldNorm:n;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,i=e.norm,o=e.score,a=n?n.weight:null;t*=Math.pow(0===o&&a?Number.EPSILON:o,(a||1)*(r?1:i))})),e.score=t}))}function $(e,t){var n=e.matches;t.matches=[],f(n)&&n.forEach((function(e){if(f(e.indices)&&e.indices.length){var n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function D(e,t){t.score=e.score}function K(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?L.includeMatches:r,o=n.includeScore,a=void 0===o?L.includeScore:o,c=[];return i&&c.push($),a&&c.push(D),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return c.length&&c.forEach((function(t){t(e,r)})),r}))}var T=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(r(this,e),this.options=t(t({},L),i),this.options.useExtendedSearch)throw new Error(y);this._keyStore=new b(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof O))throw new Error("Incorrect 'index' type");this._myIndex=t||A(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){f(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n<r;n+=1){var i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,r-=1,t.push(i))}return t}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){return this._myIndex}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,a=i.includeScore,c=i.shouldSort,s=i.sortFn,h=i.ignoreFieldNorm,d=u(e)?u(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return W(d,{ignoreFieldNorm:h}),c&&d.sort(s),l(r)&&r>-1&&(d=d.slice(0,r)),K(d,this._docs,{includeMatches:o,includeScore:a})}},{key:"_searchStringList",value:function(e){var t=P(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(f(n)){var a=t.searchIn(n),c=a.isMatch,s=a.score,h=a.indices;c&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:h}]})}})),r}},{key:"_searchLogical",value:function(e){throw new Error("Logical search is not available")}},{key:"_searchObjectList",value:function(e){var t=this,n=P(e,this.options),r=this._myIndex,i=r.keys,o=r.records,a=[];return o.forEach((function(e){var r=e.$,o=e.i;if(f(r)){var s=[];i.forEach((function(e,i){s.push.apply(s,c(t._findMatches({key:e,value:r[i],searcher:n})))})),s.length&&a.push({idx:o,item:r,matches:s})}})),a}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!f(n))return[];var i=[];if(h(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(f(n)){var c=r.searchIn(n),s=c.isMatch,h=c.score,u=c.indices;s&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,c=r.searchIn(o),s=c.isMatch,u=c.score,l=c.indices;s&&i.push({score:u,key:t,value:o,norm:a,indices:l})}return i}}]),e}();return T.version="6.6.2",T.createIndex=A,T.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?L.getFn:n,i=t.fieldNormWeight,o=void 0===i?L.fieldNormWeight:i,a=e.keys,c=e.records,s=new O({getFn:r,fieldNormWeight:o});return s.setKeys(a),s.setIndexRecords(c),s},T.config=L,T},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); \ No newline at end of file
diff --git a/node_modules/fuse.js/dist/fuse.common.js b/node_modules/fuse.js/dist/fuse.common.js
new file mode 100644
index 0000000..2d4293c
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.common.js
@@ -0,0 +1,2234 @@
+/**
+ * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
+ *
+ * Copyright (c) 2022 Kiro Risk (http://kiro.me)
+ * All Rights Reserved. Apache Software License 2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+
+'use strict';
+
+function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ })), keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+}
+
+function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = null != arguments[i] ? arguments[i] : {};
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+
+ return target;
+}
+
+function _typeof(obj) {
+ "@babel/helpers - typeof";
+
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ }, _typeof(obj);
+}
+
+function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+}
+
+function _defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+}
+
+function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ Object.defineProperty(Constructor, "prototype", {
+ writable: false
+ });
+ return Constructor;
+}
+
+function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+}
+
+function _inherits(subClass, superClass) {
+ if (typeof superClass !== "function" && superClass !== null) {
+ throw new TypeError("Super expression must either be null or a function");
+ }
+
+ Object.defineProperty(subClass, "prototype", {
+ value: Object.create(superClass && superClass.prototype, {
+ constructor: {
+ value: subClass,
+ writable: true,
+ configurable: true
+ }
+ }),
+ writable: false
+ });
+ if (superClass) _setPrototypeOf(subClass, superClass);
+}
+
+function _getPrototypeOf(o) {
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
+ return o.__proto__ || Object.getPrototypeOf(o);
+ };
+ return _getPrototypeOf(o);
+}
+
+function _setPrototypeOf(o, p) {
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
+ o.__proto__ = p;
+ return o;
+ };
+
+ return _setPrototypeOf(o, p);
+}
+
+function _isNativeReflectConstruct() {
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
+ if (Reflect.construct.sham) return false;
+ if (typeof Proxy === "function") return true;
+
+ try {
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
+ return true;
+ } catch (e) {
+ return false;
+ }
+}
+
+function _assertThisInitialized(self) {
+ if (self === void 0) {
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ }
+
+ return self;
+}
+
+function _possibleConstructorReturn(self, call) {
+ if (call && (typeof call === "object" || typeof call === "function")) {
+ return call;
+ } else if (call !== void 0) {
+ throw new TypeError("Derived constructors may only return object or undefined");
+ }
+
+ return _assertThisInitialized(self);
+}
+
+function _createSuper(Derived) {
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
+
+ return function _createSuperInternal() {
+ var Super = _getPrototypeOf(Derived),
+ result;
+
+ if (hasNativeReflectConstruct) {
+ var NewTarget = _getPrototypeOf(this).constructor;
+
+ result = Reflect.construct(Super, arguments, NewTarget);
+ } else {
+ result = Super.apply(this, arguments);
+ }
+
+ return _possibleConstructorReturn(this, result);
+ };
+}
+
+function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+}
+
+function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+}
+
+function _iterableToArray(iter) {
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
+}
+
+function _unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(o);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+}
+
+function _arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+
+ return arr2;
+}
+
+function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+}
+
+function isArray(value) {
+ return !Array.isArray ? getTag(value) === '[object Array]' : Array.isArray(value);
+} // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js
+
+var INFINITY = 1 / 0;
+function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+
+ var result = value + '';
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result;
+}
+function toString(value) {
+ return value == null ? '' : baseToString(value);
+}
+function isString(value) {
+ return typeof value === 'string';
+}
+function isNumber(value) {
+ return typeof value === 'number';
+} // Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
+
+function isBoolean(value) {
+ return value === true || value === false || isObjectLike(value) && getTag(value) == '[object Boolean]';
+}
+function isObject(value) {
+ return _typeof(value) === 'object';
+} // Checks if `value` is object-like.
+
+function isObjectLike(value) {
+ return isObject(value) && value !== null;
+}
+function isDefined(value) {
+ return value !== undefined && value !== null;
+}
+function isBlank(value) {
+ return !value.trim().length;
+} // Gets the `toStringTag` of `value`.
+// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js
+
+function getTag(value) {
+ return value == null ? value === undefined ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(value);
+}
+
+var EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';
+var INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
+var LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = function LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key) {
+ return "Invalid value for key ".concat(key);
+};
+var PATTERN_LENGTH_TOO_LARGE = function PATTERN_LENGTH_TOO_LARGE(max) {
+ return "Pattern length exceeds max of ".concat(max, ".");
+};
+var MISSING_KEY_PROPERTY = function MISSING_KEY_PROPERTY(name) {
+ return "Missing ".concat(name, " property in key");
+};
+var INVALID_KEY_WEIGHT_VALUE = function INVALID_KEY_WEIGHT_VALUE(key) {
+ return "Property 'weight' in key '".concat(key, "' must be a positive integer");
+};
+
+var hasOwn = Object.prototype.hasOwnProperty;
+
+var KeyStore = /*#__PURE__*/function () {
+ function KeyStore(keys) {
+ var _this = this;
+
+ _classCallCheck(this, KeyStore);
+
+ this._keys = [];
+ this._keyMap = {};
+ var totalWeight = 0;
+ keys.forEach(function (key) {
+ var obj = createKey(key);
+ totalWeight += obj.weight;
+
+ _this._keys.push(obj);
+
+ _this._keyMap[obj.id] = obj;
+ totalWeight += obj.weight;
+ }); // Normalize weights so that their sum is equal to 1
+
+ this._keys.forEach(function (key) {
+ key.weight /= totalWeight;
+ });
+ }
+
+ _createClass(KeyStore, [{
+ key: "get",
+ value: function get(keyId) {
+ return this._keyMap[keyId];
+ }
+ }, {
+ key: "keys",
+ value: function keys() {
+ return this._keys;
+ }
+ }, {
+ key: "toJSON",
+ value: function toJSON() {
+ return JSON.stringify(this._keys);
+ }
+ }]);
+
+ return KeyStore;
+}();
+function createKey(key) {
+ var path = null;
+ var id = null;
+ var src = null;
+ var weight = 1;
+ var getFn = null;
+
+ if (isString(key) || isArray(key)) {
+ src = key;
+ path = createKeyPath(key);
+ id = createKeyId(key);
+ } else {
+ if (!hasOwn.call(key, 'name')) {
+ throw new Error(MISSING_KEY_PROPERTY('name'));
+ }
+
+ var name = key.name;
+ src = name;
+
+ if (hasOwn.call(key, 'weight')) {
+ weight = key.weight;
+
+ if (weight <= 0) {
+ throw new Error(INVALID_KEY_WEIGHT_VALUE(name));
+ }
+ }
+
+ path = createKeyPath(name);
+ id = createKeyId(name);
+ getFn = key.getFn;
+ }
+
+ return {
+ path: path,
+ id: id,
+ weight: weight,
+ src: src,
+ getFn: getFn
+ };
+}
+function createKeyPath(key) {
+ return isArray(key) ? key : key.split('.');
+}
+function createKeyId(key) {
+ return isArray(key) ? key.join('.') : key;
+}
+
+function get(obj, path) {
+ var list = [];
+ var arr = false;
+
+ var deepGet = function deepGet(obj, path, index) {
+ if (!isDefined(obj)) {
+ return;
+ }
+
+ if (!path[index]) {
+ // If there's no path left, we've arrived at the object we care about.
+ list.push(obj);
+ } else {
+ var key = path[index];
+ var value = obj[key];
+
+ if (!isDefined(value)) {
+ return;
+ } // If we're at the last value in the path, and if it's a string/number/bool,
+ // add it to the list
+
+
+ if (index === path.length - 1 && (isString(value) || isNumber(value) || isBoolean(value))) {
+ list.push(toString(value));
+ } else if (isArray(value)) {
+ arr = true; // Search each item in the array.
+
+ for (var i = 0, len = value.length; i < len; i += 1) {
+ deepGet(value[i], path, index + 1);
+ }
+ } else if (path.length) {
+ // An object. Recurse further.
+ deepGet(value, path, index + 1);
+ }
+ }
+ }; // Backwards compatibility (since path used to be a string)
+
+
+ deepGet(obj, isString(path) ? path.split('.') : path, 0);
+ return arr ? list : list[0];
+}
+
+var MatchOptions = {
+ // Whether the matches should be included in the result set. When `true`, each record in the result
+ // set will include the indices of the matched characters.
+ // These can consequently be used for highlighting purposes.
+ includeMatches: false,
+ // When `true`, the matching function will continue to the end of a search pattern even if
+ // a perfect match has already been located in the string.
+ findAllMatches: false,
+ // Minimum number of characters that must be matched before a result is considered a match
+ minMatchCharLength: 1
+};
+var BasicOptions = {
+ // When `true`, the algorithm continues searching to the end of the input even if a perfect
+ // match is found before the end of the same input.
+ isCaseSensitive: false,
+ // When true, the matching function will continue to the end of a search pattern even if
+ includeScore: false,
+ // List of properties that will be searched. This also supports nested properties.
+ keys: [],
+ // Whether to sort the result list, by score
+ shouldSort: true,
+ // Default sort function: sort by ascending score, ascending index
+ sortFn: function sortFn(a, b) {
+ return a.score === b.score ? a.idx < b.idx ? -1 : 1 : a.score < b.score ? -1 : 1;
+ }
+};
+var FuzzyOptions = {
+ // Approximately where in the text is the pattern expected to be found?
+ location: 0,
+ // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
+ // (of both letters and location), a threshold of '1.0' would match anything.
+ threshold: 0.6,
+ // Determines how close the match must be to the fuzzy location (specified above).
+ // An exact letter match which is 'distance' characters away from the fuzzy location
+ // would score as a complete mismatch. A distance of '0' requires the match be at
+ // the exact location specified, a threshold of '1000' would require a perfect match
+ // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
+ distance: 100
+};
+var AdvancedOptions = {
+ // When `true`, it enables the use of unix-like search commands
+ useExtendedSearch: false,
+ // The get function to use when fetching an object's properties.
+ // The default will search nested paths *ie foo.bar.baz*
+ getFn: get,
+ // When `true`, search will ignore `location` and `distance`, so it won't matter
+ // where in the string the pattern appears.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
+ ignoreLocation: false,
+ // When `true`, the calculation for the relevance score (used for sorting) will
+ // ignore the field-length norm.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
+ ignoreFieldNorm: false,
+ // The weight to determine how much field length norm effects scoring.
+ fieldNormWeight: 1
+};
+var Config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, BasicOptions), MatchOptions), FuzzyOptions), AdvancedOptions);
+
+var SPACE = /[^ ]+/g; // Field-length norm: the shorter the field, the higher the weight.
+// Set to 3 decimals to reduce index size.
+
+function norm() {
+ var weight = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
+ var mantissa = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
+ var cache = new Map();
+ var m = Math.pow(10, mantissa);
+ return {
+ get: function get(value) {
+ var numTokens = value.match(SPACE).length;
+
+ if (cache.has(numTokens)) {
+ return cache.get(numTokens);
+ } // Default function is 1/sqrt(x), weight makes that variable
+
+
+ var norm = 1 / Math.pow(numTokens, 0.5 * weight); // In place of `toFixed(mantissa)`, for faster computation
+
+ var n = parseFloat(Math.round(norm * m) / m);
+ cache.set(numTokens, n);
+ return n;
+ },
+ clear: function clear() {
+ cache.clear();
+ }
+ };
+}
+
+var FuseIndex = /*#__PURE__*/function () {
+ function FuseIndex() {
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
+ _ref$getFn = _ref.getFn,
+ getFn = _ref$getFn === void 0 ? Config.getFn : _ref$getFn,
+ _ref$fieldNormWeight = _ref.fieldNormWeight,
+ fieldNormWeight = _ref$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref$fieldNormWeight;
+
+ _classCallCheck(this, FuseIndex);
+
+ this.norm = norm(fieldNormWeight, 3);
+ this.getFn = getFn;
+ this.isCreated = false;
+ this.setIndexRecords();
+ }
+
+ _createClass(FuseIndex, [{
+ key: "setSources",
+ value: function setSources() {
+ var docs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.docs = docs;
+ }
+ }, {
+ key: "setIndexRecords",
+ value: function setIndexRecords() {
+ var records = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.records = records;
+ }
+ }, {
+ key: "setKeys",
+ value: function setKeys() {
+ var _this = this;
+
+ var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.keys = keys;
+ this._keysMap = {};
+ keys.forEach(function (key, idx) {
+ _this._keysMap[key.id] = idx;
+ });
+ }
+ }, {
+ key: "create",
+ value: function create() {
+ var _this2 = this;
+
+ if (this.isCreated || !this.docs.length) {
+ return;
+ }
+
+ this.isCreated = true; // List is Array<String>
+
+ if (isString(this.docs[0])) {
+ this.docs.forEach(function (doc, docIndex) {
+ _this2._addString(doc, docIndex);
+ });
+ } else {
+ // List is Array<Object>
+ this.docs.forEach(function (doc, docIndex) {
+ _this2._addObject(doc, docIndex);
+ });
+ }
+
+ this.norm.clear();
+ } // Adds a doc to the end of the index
+
+ }, {
+ key: "add",
+ value: function add(doc) {
+ var idx = this.size();
+
+ if (isString(doc)) {
+ this._addString(doc, idx);
+ } else {
+ this._addObject(doc, idx);
+ }
+ } // Removes the doc at the specified index of the index
+
+ }, {
+ key: "removeAt",
+ value: function removeAt(idx) {
+ this.records.splice(idx, 1); // Change ref index of every subsquent doc
+
+ for (var i = idx, len = this.size(); i < len; i += 1) {
+ this.records[i].i -= 1;
+ }
+ }
+ }, {
+ key: "getValueForItemAtKeyId",
+ value: function getValueForItemAtKeyId(item, keyId) {
+ return item[this._keysMap[keyId]];
+ }
+ }, {
+ key: "size",
+ value: function size() {
+ return this.records.length;
+ }
+ }, {
+ key: "_addString",
+ value: function _addString(doc, docIndex) {
+ if (!isDefined(doc) || isBlank(doc)) {
+ return;
+ }
+
+ var record = {
+ v: doc,
+ i: docIndex,
+ n: this.norm.get(doc)
+ };
+ this.records.push(record);
+ }
+ }, {
+ key: "_addObject",
+ value: function _addObject(doc, docIndex) {
+ var _this3 = this;
+
+ var record = {
+ i: docIndex,
+ $: {}
+ }; // Iterate over every key (i.e, path), and fetch the value at that key
+
+ this.keys.forEach(function (key, keyIndex) {
+ var value = key.getFn ? key.getFn(doc) : _this3.getFn(doc, key.path);
+
+ if (!isDefined(value)) {
+ return;
+ }
+
+ if (isArray(value)) {
+ (function () {
+ var subRecords = [];
+ var stack = [{
+ nestedArrIndex: -1,
+ value: value
+ }];
+
+ while (stack.length) {
+ var _stack$pop = stack.pop(),
+ nestedArrIndex = _stack$pop.nestedArrIndex,
+ _value = _stack$pop.value;
+
+ if (!isDefined(_value)) {
+ continue;
+ }
+
+ if (isString(_value) && !isBlank(_value)) {
+ var subRecord = {
+ v: _value,
+ i: nestedArrIndex,
+ n: _this3.norm.get(_value)
+ };
+ subRecords.push(subRecord);
+ } else if (isArray(_value)) {
+ _value.forEach(function (item, k) {
+ stack.push({
+ nestedArrIndex: k,
+ value: item
+ });
+ });
+ } else ;
+ }
+
+ record.$[keyIndex] = subRecords;
+ })();
+ } else if (isString(value) && !isBlank(value)) {
+ var subRecord = {
+ v: value,
+ n: _this3.norm.get(value)
+ };
+ record.$[keyIndex] = subRecord;
+ }
+ });
+ this.records.push(record);
+ }
+ }, {
+ key: "toJSON",
+ value: function toJSON() {
+ return {
+ keys: this.keys,
+ records: this.records
+ };
+ }
+ }]);
+
+ return FuseIndex;
+}();
+function createIndex(keys, docs) {
+ var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref2$getFn = _ref2.getFn,
+ getFn = _ref2$getFn === void 0 ? Config.getFn : _ref2$getFn,
+ _ref2$fieldNormWeight = _ref2.fieldNormWeight,
+ fieldNormWeight = _ref2$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref2$fieldNormWeight;
+
+ var myIndex = new FuseIndex({
+ getFn: getFn,
+ fieldNormWeight: fieldNormWeight
+ });
+ myIndex.setKeys(keys.map(createKey));
+ myIndex.setSources(docs);
+ myIndex.create();
+ return myIndex;
+}
+function parseIndex(data) {
+ var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref3$getFn = _ref3.getFn,
+ getFn = _ref3$getFn === void 0 ? Config.getFn : _ref3$getFn,
+ _ref3$fieldNormWeight = _ref3.fieldNormWeight,
+ fieldNormWeight = _ref3$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref3$fieldNormWeight;
+
+ var keys = data.keys,
+ records = data.records;
+ var myIndex = new FuseIndex({
+ getFn: getFn,
+ fieldNormWeight: fieldNormWeight
+ });
+ myIndex.setKeys(keys);
+ myIndex.setIndexRecords(records);
+ return myIndex;
+}
+
+function computeScore$1(pattern) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$errors = _ref.errors,
+ errors = _ref$errors === void 0 ? 0 : _ref$errors,
+ _ref$currentLocation = _ref.currentLocation,
+ currentLocation = _ref$currentLocation === void 0 ? 0 : _ref$currentLocation,
+ _ref$expectedLocation = _ref.expectedLocation,
+ expectedLocation = _ref$expectedLocation === void 0 ? 0 : _ref$expectedLocation,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ var accuracy = errors / pattern.length;
+
+ if (ignoreLocation) {
+ return accuracy;
+ }
+
+ var proximity = Math.abs(expectedLocation - currentLocation);
+
+ if (!distance) {
+ // Dodge divide by zero error.
+ return proximity ? 1.0 : accuracy;
+ }
+
+ return accuracy + proximity / distance;
+}
+
+function convertMaskToIndices() {
+ var matchmask = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ var minMatchCharLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Config.minMatchCharLength;
+ var indices = [];
+ var start = -1;
+ var end = -1;
+ var i = 0;
+
+ for (var len = matchmask.length; i < len; i += 1) {
+ var match = matchmask[i];
+
+ if (match && start === -1) {
+ start = i;
+ } else if (!match && start !== -1) {
+ end = i - 1;
+
+ if (end - start + 1 >= minMatchCharLength) {
+ indices.push([start, end]);
+ }
+
+ start = -1;
+ }
+ } // (i-1 - start) + 1 => i - start
+
+
+ if (matchmask[i - 1] && i - start >= minMatchCharLength) {
+ indices.push([start, i - 1]);
+ }
+
+ return indices;
+}
+
+// Machine word size
+var MAX_BITS = 32;
+
+function search(text, pattern, patternAlphabet) {
+ var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ if (pattern.length > MAX_BITS) {
+ throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));
+ }
+
+ var patternLen = pattern.length; // Set starting location at beginning text and initialize the alphabet.
+
+ var textLen = text.length; // Handle the case when location > text.length
+
+ var expectedLocation = Math.max(0, Math.min(location, textLen)); // Highest score beyond which we give up.
+
+ var currentThreshold = threshold; // Is there a nearby exact match? (speedup)
+
+ var bestLocation = expectedLocation; // Performance: only computer matches when the minMatchCharLength > 1
+ // OR if `includeMatches` is true.
+
+ var computeMatches = minMatchCharLength > 1 || includeMatches; // A mask of the matches, used for building the indices
+
+ var matchMask = computeMatches ? Array(textLen) : [];
+ var index; // Get all exact matches, here for speed up
+
+ while ((index = text.indexOf(pattern, bestLocation)) > -1) {
+ var score = computeScore$1(pattern, {
+ currentLocation: index,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+ currentThreshold = Math.min(score, currentThreshold);
+ bestLocation = index + patternLen;
+
+ if (computeMatches) {
+ var i = 0;
+
+ while (i < patternLen) {
+ matchMask[index + i] = 1;
+ i += 1;
+ }
+ }
+ } // Reset the best location
+
+
+ bestLocation = -1;
+ var lastBitArr = [];
+ var finalScore = 1;
+ var binMax = patternLen + textLen;
+ var mask = 1 << patternLen - 1;
+
+ for (var _i = 0; _i < patternLen; _i += 1) {
+ // Scan for the best match; each iteration allows for one more error.
+ // Run a binary search to determine how far from the match location we can stray
+ // at this error level.
+ var binMin = 0;
+ var binMid = binMax;
+
+ while (binMin < binMid) {
+ var _score2 = computeScore$1(pattern, {
+ errors: _i,
+ currentLocation: expectedLocation + binMid,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+
+ if (_score2 <= currentThreshold) {
+ binMin = binMid;
+ } else {
+ binMax = binMid;
+ }
+
+ binMid = Math.floor((binMax - binMin) / 2 + binMin);
+ } // Use the result from this iteration as the maximum for the next.
+
+
+ binMax = binMid;
+ var start = Math.max(1, expectedLocation - binMid + 1);
+ var finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen; // Initialize the bit array
+
+ var bitArr = Array(finish + 2);
+ bitArr[finish + 1] = (1 << _i) - 1;
+
+ for (var j = finish; j >= start; j -= 1) {
+ var currentLocation = j - 1;
+ var charMatch = patternAlphabet[text.charAt(currentLocation)];
+
+ if (computeMatches) {
+ // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)
+ matchMask[currentLocation] = +!!charMatch;
+ } // First pass: exact match
+
+
+ bitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch; // Subsequent passes: fuzzy match
+
+ if (_i) {
+ bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1];
+ }
+
+ if (bitArr[j] & mask) {
+ finalScore = computeScore$1(pattern, {
+ errors: _i,
+ currentLocation: currentLocation,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ }); // This match will almost certainly be better than any existing match.
+ // But check anyway.
+
+ if (finalScore <= currentThreshold) {
+ // Indeed it is
+ currentThreshold = finalScore;
+ bestLocation = currentLocation; // Already passed `loc`, downhill from here on in.
+
+ if (bestLocation <= expectedLocation) {
+ break;
+ } // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.
+
+
+ start = Math.max(1, 2 * expectedLocation - bestLocation);
+ }
+ }
+ } // No hope for a (better) match at greater error levels.
+
+
+ var _score = computeScore$1(pattern, {
+ errors: _i + 1,
+ currentLocation: expectedLocation,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+
+ if (_score > currentThreshold) {
+ break;
+ }
+
+ lastBitArr = bitArr;
+ }
+
+ var result = {
+ isMatch: bestLocation >= 0,
+ // Count exact matches (those with a score of 0) to be "almost" exact
+ score: Math.max(0.001, finalScore)
+ };
+
+ if (computeMatches) {
+ var indices = convertMaskToIndices(matchMask, minMatchCharLength);
+
+ if (!indices.length) {
+ result.isMatch = false;
+ } else if (includeMatches) {
+ result.indices = indices;
+ }
+ }
+
+ return result;
+}
+
+function createPatternAlphabet(pattern) {
+ var mask = {};
+
+ for (var i = 0, len = pattern.length; i < len; i += 1) {
+ var _char = pattern.charAt(i);
+
+ mask[_char] = (mask[_char] || 0) | 1 << len - i - 1;
+ }
+
+ return mask;
+}
+
+var BitapSearch = /*#__PURE__*/function () {
+ function BitapSearch(pattern) {
+ var _this = this;
+
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$isCaseSensitive = _ref.isCaseSensitive,
+ isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ _classCallCheck(this, BitapSearch);
+
+ this.options = {
+ location: location,
+ threshold: threshold,
+ distance: distance,
+ includeMatches: includeMatches,
+ findAllMatches: findAllMatches,
+ minMatchCharLength: minMatchCharLength,
+ isCaseSensitive: isCaseSensitive,
+ ignoreLocation: ignoreLocation
+ };
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+ this.chunks = [];
+
+ if (!this.pattern.length) {
+ return;
+ }
+
+ var addChunk = function addChunk(pattern, startIndex) {
+ _this.chunks.push({
+ pattern: pattern,
+ alphabet: createPatternAlphabet(pattern),
+ startIndex: startIndex
+ });
+ };
+
+ var len = this.pattern.length;
+
+ if (len > MAX_BITS) {
+ var i = 0;
+ var remainder = len % MAX_BITS;
+ var end = len - remainder;
+
+ while (i < end) {
+ addChunk(this.pattern.substr(i, MAX_BITS), i);
+ i += MAX_BITS;
+ }
+
+ if (remainder) {
+ var startIndex = len - MAX_BITS;
+ addChunk(this.pattern.substr(startIndex), startIndex);
+ }
+ } else {
+ addChunk(this.pattern, 0);
+ }
+ }
+
+ _createClass(BitapSearch, [{
+ key: "searchIn",
+ value: function searchIn(text) {
+ var _this$options = this.options,
+ isCaseSensitive = _this$options.isCaseSensitive,
+ includeMatches = _this$options.includeMatches;
+
+ if (!isCaseSensitive) {
+ text = text.toLowerCase();
+ } // Exact match
+
+
+ if (this.pattern === text) {
+ var _result = {
+ isMatch: true,
+ score: 0
+ };
+
+ if (includeMatches) {
+ _result.indices = [[0, text.length - 1]];
+ }
+
+ return _result;
+ } // Otherwise, use Bitap algorithm
+
+
+ var _this$options2 = this.options,
+ location = _this$options2.location,
+ distance = _this$options2.distance,
+ threshold = _this$options2.threshold,
+ findAllMatches = _this$options2.findAllMatches,
+ minMatchCharLength = _this$options2.minMatchCharLength,
+ ignoreLocation = _this$options2.ignoreLocation;
+ var allIndices = [];
+ var totalScore = 0;
+ var hasMatches = false;
+ this.chunks.forEach(function (_ref2) {
+ var pattern = _ref2.pattern,
+ alphabet = _ref2.alphabet,
+ startIndex = _ref2.startIndex;
+
+ var _search = search(text, pattern, alphabet, {
+ location: location + startIndex,
+ distance: distance,
+ threshold: threshold,
+ findAllMatches: findAllMatches,
+ minMatchCharLength: minMatchCharLength,
+ includeMatches: includeMatches,
+ ignoreLocation: ignoreLocation
+ }),
+ isMatch = _search.isMatch,
+ score = _search.score,
+ indices = _search.indices;
+
+ if (isMatch) {
+ hasMatches = true;
+ }
+
+ totalScore += score;
+
+ if (isMatch && indices) {
+ allIndices = [].concat(_toConsumableArray(allIndices), _toConsumableArray(indices));
+ }
+ });
+ var result = {
+ isMatch: hasMatches,
+ score: hasMatches ? totalScore / this.chunks.length : 1
+ };
+
+ if (hasMatches && includeMatches) {
+ result.indices = allIndices;
+ }
+
+ return result;
+ }
+ }]);
+
+ return BitapSearch;
+}();
+
+var BaseMatch = /*#__PURE__*/function () {
+ function BaseMatch(pattern) {
+ _classCallCheck(this, BaseMatch);
+
+ this.pattern = pattern;
+ }
+
+ _createClass(BaseMatch, [{
+ key: "search",
+ value: function
+ /*text*/
+ search() {}
+ }], [{
+ key: "isMultiMatch",
+ value: function isMultiMatch(pattern) {
+ return getMatch(pattern, this.multiRegex);
+ }
+ }, {
+ key: "isSingleMatch",
+ value: function isSingleMatch(pattern) {
+ return getMatch(pattern, this.singleRegex);
+ }
+ }]);
+
+ return BaseMatch;
+}();
+
+function getMatch(pattern, exp) {
+ var matches = pattern.match(exp);
+ return matches ? matches[1] : null;
+}
+
+var ExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(ExactMatch, _BaseMatch);
+
+ var _super = _createSuper(ExactMatch);
+
+ function ExactMatch(pattern) {
+ _classCallCheck(this, ExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(ExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var isMatch = text === this.pattern;
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, this.pattern.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^="(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^=(.*)$/;
+ }
+ }]);
+
+ return ExactMatch;
+}(BaseMatch);
+
+var InverseExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(InverseExactMatch, _BaseMatch);
+
+ var _super = _createSuper(InverseExactMatch);
+
+ function InverseExactMatch(pattern) {
+ _classCallCheck(this, InverseExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(InverseExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var index = text.indexOf(this.pattern);
+ var isMatch = index === -1;
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'inverse-exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^!"(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^!(.*)$/;
+ }
+ }]);
+
+ return InverseExactMatch;
+}(BaseMatch);
+
+var PrefixExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(PrefixExactMatch, _BaseMatch);
+
+ var _super = _createSuper(PrefixExactMatch);
+
+ function PrefixExactMatch(pattern) {
+ _classCallCheck(this, PrefixExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(PrefixExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var isMatch = text.startsWith(this.pattern);
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, this.pattern.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'prefix-exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^\^"(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^\^(.*)$/;
+ }
+ }]);
+
+ return PrefixExactMatch;
+}(BaseMatch);
+
+var InversePrefixExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(InversePrefixExactMatch, _BaseMatch);
+
+ var _super = _createSuper(InversePrefixExactMatch);
+
+ function InversePrefixExactMatch(pattern) {
+ _classCallCheck(this, InversePrefixExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(InversePrefixExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var isMatch = !text.startsWith(this.pattern);
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'inverse-prefix-exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^!\^"(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^!\^(.*)$/;
+ }
+ }]);
+
+ return InversePrefixExactMatch;
+}(BaseMatch);
+
+var SuffixExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(SuffixExactMatch, _BaseMatch);
+
+ var _super = _createSuper(SuffixExactMatch);
+
+ function SuffixExactMatch(pattern) {
+ _classCallCheck(this, SuffixExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(SuffixExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var isMatch = text.endsWith(this.pattern);
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [text.length - this.pattern.length, text.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'suffix-exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^"(.*)"\$$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^(.*)\$$/;
+ }
+ }]);
+
+ return SuffixExactMatch;
+}(BaseMatch);
+
+var InverseSuffixExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(InverseSuffixExactMatch, _BaseMatch);
+
+ var _super = _createSuper(InverseSuffixExactMatch);
+
+ function InverseSuffixExactMatch(pattern) {
+ _classCallCheck(this, InverseSuffixExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(InverseSuffixExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var isMatch = !text.endsWith(this.pattern);
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'inverse-suffix-exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^!"(.*)"\$$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^!(.*)\$$/;
+ }
+ }]);
+
+ return InverseSuffixExactMatch;
+}(BaseMatch);
+
+var FuzzyMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(FuzzyMatch, _BaseMatch);
+
+ var _super = _createSuper(FuzzyMatch);
+
+ function FuzzyMatch(pattern) {
+ var _this;
+
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$isCaseSensitive = _ref.isCaseSensitive,
+ isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ _classCallCheck(this, FuzzyMatch);
+
+ _this = _super.call(this, pattern);
+ _this._bitapSearch = new BitapSearch(pattern, {
+ location: location,
+ threshold: threshold,
+ distance: distance,
+ includeMatches: includeMatches,
+ findAllMatches: findAllMatches,
+ minMatchCharLength: minMatchCharLength,
+ isCaseSensitive: isCaseSensitive,
+ ignoreLocation: ignoreLocation
+ });
+ return _this;
+ }
+
+ _createClass(FuzzyMatch, [{
+ key: "search",
+ value: function search(text) {
+ return this._bitapSearch.searchIn(text);
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'fuzzy';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^"(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^(.*)$/;
+ }
+ }]);
+
+ return FuzzyMatch;
+}(BaseMatch);
+
+var IncludeMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(IncludeMatch, _BaseMatch);
+
+ var _super = _createSuper(IncludeMatch);
+
+ function IncludeMatch(pattern) {
+ _classCallCheck(this, IncludeMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(IncludeMatch, [{
+ key: "search",
+ value: function search(text) {
+ var location = 0;
+ var index;
+ var indices = [];
+ var patternLen = this.pattern.length; // Get all exact matches
+
+ while ((index = text.indexOf(this.pattern, location)) > -1) {
+ location = index + patternLen;
+ indices.push([index, location - 1]);
+ }
+
+ var isMatch = !!indices.length;
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: indices
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'include';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^'"(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^'(.*)$/;
+ }
+ }]);
+
+ return IncludeMatch;
+}(BaseMatch);
+
+var searchers = [ExactMatch, IncludeMatch, PrefixExactMatch, InversePrefixExactMatch, InverseSuffixExactMatch, SuffixExactMatch, InverseExactMatch, FuzzyMatch];
+var searchersLen = searchers.length; // Regex to split by spaces, but keep anything in quotes together
+
+var SPACE_RE = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;
+var OR_TOKEN = '|'; // Return a 2D array representation of the query, for simpler parsing.
+// Example:
+// "^core go$ | rb$ | py$ xy$" => [["^core", "go$"], ["rb$"], ["py$", "xy$"]]
+
+function parseQuery(pattern) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ return pattern.split(OR_TOKEN).map(function (item) {
+ var query = item.trim().split(SPACE_RE).filter(function (item) {
+ return item && !!item.trim();
+ });
+ var results = [];
+
+ for (var i = 0, len = query.length; i < len; i += 1) {
+ var queryItem = query[i]; // 1. Handle multiple query match (i.e, once that are quoted, like `"hello world"`)
+
+ var found = false;
+ var idx = -1;
+
+ while (!found && ++idx < searchersLen) {
+ var searcher = searchers[idx];
+ var token = searcher.isMultiMatch(queryItem);
+
+ if (token) {
+ results.push(new searcher(token, options));
+ found = true;
+ }
+ }
+
+ if (found) {
+ continue;
+ } // 2. Handle single query matches (i.e, once that are *not* quoted)
+
+
+ idx = -1;
+
+ while (++idx < searchersLen) {
+ var _searcher = searchers[idx];
+
+ var _token = _searcher.isSingleMatch(queryItem);
+
+ if (_token) {
+ results.push(new _searcher(_token, options));
+ break;
+ }
+ }
+ }
+
+ return results;
+ });
+}
+
+// to a singl match
+
+var MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);
+/**
+ * Command-like searching
+ * ======================
+ *
+ * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,
+ * search in a given text.
+ *
+ * Search syntax:
+ *
+ * | Token | Match type | Description |
+ * | ----------- | -------------------------- | -------------------------------------- |
+ * | `jscript` | fuzzy-match | Items that fuzzy match `jscript` |
+ * | `=scheme` | exact-match | Items that are `scheme` |
+ * | `'python` | include-match | Items that include `python` |
+ * | `!ruby` | inverse-exact-match | Items that do not include `ruby` |
+ * | `^java` | prefix-exact-match | Items that start with `java` |
+ * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |
+ * | `.js$` | suffix-exact-match | Items that end with `.js` |
+ * | `!.go$` | inverse-suffix-exact-match | Items that do not end with `.go` |
+ *
+ * A single pipe character acts as an OR operator. For example, the following
+ * query matches entries that start with `core` and end with either`go`, `rb`,
+ * or`py`.
+ *
+ * ```
+ * ^core go$ | rb$ | py$
+ * ```
+ */
+
+var ExtendedSearch = /*#__PURE__*/function () {
+ function ExtendedSearch(pattern) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$isCaseSensitive = _ref.isCaseSensitive,
+ isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance;
+
+ _classCallCheck(this, ExtendedSearch);
+
+ this.query = null;
+ this.options = {
+ isCaseSensitive: isCaseSensitive,
+ includeMatches: includeMatches,
+ minMatchCharLength: minMatchCharLength,
+ findAllMatches: findAllMatches,
+ ignoreLocation: ignoreLocation,
+ location: location,
+ threshold: threshold,
+ distance: distance
+ };
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+ this.query = parseQuery(this.pattern, this.options);
+ }
+
+ _createClass(ExtendedSearch, [{
+ key: "searchIn",
+ value: function searchIn(text) {
+ var query = this.query;
+
+ if (!query) {
+ return {
+ isMatch: false,
+ score: 1
+ };
+ }
+
+ var _this$options = this.options,
+ includeMatches = _this$options.includeMatches,
+ isCaseSensitive = _this$options.isCaseSensitive;
+ text = isCaseSensitive ? text : text.toLowerCase();
+ var numMatches = 0;
+ var allIndices = [];
+ var totalScore = 0; // ORs
+
+ for (var i = 0, qLen = query.length; i < qLen; i += 1) {
+ var searchers = query[i]; // Reset indices
+
+ allIndices.length = 0;
+ numMatches = 0; // ANDs
+
+ for (var j = 0, pLen = searchers.length; j < pLen; j += 1) {
+ var searcher = searchers[j];
+
+ var _searcher$search = searcher.search(text),
+ isMatch = _searcher$search.isMatch,
+ indices = _searcher$search.indices,
+ score = _searcher$search.score;
+
+ if (isMatch) {
+ numMatches += 1;
+ totalScore += score;
+
+ if (includeMatches) {
+ var type = searcher.constructor.type;
+
+ if (MultiMatchSet.has(type)) {
+ allIndices = [].concat(_toConsumableArray(allIndices), _toConsumableArray(indices));
+ } else {
+ allIndices.push(indices);
+ }
+ }
+ } else {
+ totalScore = 0;
+ numMatches = 0;
+ allIndices.length = 0;
+ break;
+ }
+ } // OR condition, so if TRUE, return
+
+
+ if (numMatches) {
+ var result = {
+ isMatch: true,
+ score: totalScore / numMatches
+ };
+
+ if (includeMatches) {
+ result.indices = allIndices;
+ }
+
+ return result;
+ }
+ } // Nothing was matched
+
+
+ return {
+ isMatch: false,
+ score: 1
+ };
+ }
+ }], [{
+ key: "condition",
+ value: function condition(_, options) {
+ return options.useExtendedSearch;
+ }
+ }]);
+
+ return ExtendedSearch;
+}();
+
+var registeredSearchers = [];
+function register() {
+ registeredSearchers.push.apply(registeredSearchers, arguments);
+}
+function createSearcher(pattern, options) {
+ for (var i = 0, len = registeredSearchers.length; i < len; i += 1) {
+ var searcherClass = registeredSearchers[i];
+
+ if (searcherClass.condition(pattern, options)) {
+ return new searcherClass(pattern, options);
+ }
+ }
+
+ return new BitapSearch(pattern, options);
+}
+
+var LogicalOperator = {
+ AND: '$and',
+ OR: '$or'
+};
+var KeyType = {
+ PATH: '$path',
+ PATTERN: '$val'
+};
+
+var isExpression = function isExpression(query) {
+ return !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
+};
+
+var isPath = function isPath(query) {
+ return !!query[KeyType.PATH];
+};
+
+var isLeaf = function isLeaf(query) {
+ return !isArray(query) && isObject(query) && !isExpression(query);
+};
+
+var convertToExplicit = function convertToExplicit(query) {
+ return _defineProperty({}, LogicalOperator.AND, Object.keys(query).map(function (key) {
+ return _defineProperty({}, key, query[key]);
+ }));
+}; // When `auto` is `true`, the parse function will infer and initialize and add
+// the appropriate `Searcher` instance
+
+
+function parse(query, options) {
+ var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref3$auto = _ref3.auto,
+ auto = _ref3$auto === void 0 ? true : _ref3$auto;
+
+ var next = function next(query) {
+ var keys = Object.keys(query);
+ var isQueryPath = isPath(query);
+
+ if (!isQueryPath && keys.length > 1 && !isExpression(query)) {
+ return next(convertToExplicit(query));
+ }
+
+ if (isLeaf(query)) {
+ var key = isQueryPath ? query[KeyType.PATH] : keys[0];
+ var pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];
+
+ if (!isString(pattern)) {
+ throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));
+ }
+
+ var obj = {
+ keyId: createKeyId(key),
+ pattern: pattern
+ };
+
+ if (auto) {
+ obj.searcher = createSearcher(pattern, options);
+ }
+
+ return obj;
+ }
+
+ var node = {
+ children: [],
+ operator: keys[0]
+ };
+ keys.forEach(function (key) {
+ var value = query[key];
+
+ if (isArray(value)) {
+ value.forEach(function (item) {
+ node.children.push(next(item));
+ });
+ }
+ });
+ return node;
+ };
+
+ if (!isExpression(query)) {
+ query = convertToExplicit(query);
+ }
+
+ return next(query);
+}
+
+function computeScore(results, _ref) {
+ var _ref$ignoreFieldNorm = _ref.ignoreFieldNorm,
+ ignoreFieldNorm = _ref$ignoreFieldNorm === void 0 ? Config.ignoreFieldNorm : _ref$ignoreFieldNorm;
+ results.forEach(function (result) {
+ var totalScore = 1;
+ result.matches.forEach(function (_ref2) {
+ var key = _ref2.key,
+ norm = _ref2.norm,
+ score = _ref2.score;
+ var weight = key ? key.weight : null;
+ totalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm));
+ });
+ result.score = totalScore;
+ });
+}
+
+function transformMatches(result, data) {
+ var matches = result.matches;
+ data.matches = [];
+
+ if (!isDefined(matches)) {
+ return;
+ }
+
+ matches.forEach(function (match) {
+ if (!isDefined(match.indices) || !match.indices.length) {
+ return;
+ }
+
+ var indices = match.indices,
+ value = match.value;
+ var obj = {
+ indices: indices,
+ value: value
+ };
+
+ if (match.key) {
+ obj.key = match.key.src;
+ }
+
+ if (match.idx > -1) {
+ obj.refIndex = match.idx;
+ }
+
+ data.matches.push(obj);
+ });
+}
+
+function transformScore(result, data) {
+ data.score = result.score;
+}
+
+function format(results, docs) {
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$includeScore = _ref.includeScore,
+ includeScore = _ref$includeScore === void 0 ? Config.includeScore : _ref$includeScore;
+
+ var transformers = [];
+ if (includeMatches) transformers.push(transformMatches);
+ if (includeScore) transformers.push(transformScore);
+ return results.map(function (result) {
+ var idx = result.idx;
+ var data = {
+ item: docs[idx],
+ refIndex: idx
+ };
+
+ if (transformers.length) {
+ transformers.forEach(function (transformer) {
+ transformer(result, data);
+ });
+ }
+
+ return data;
+ });
+}
+
+var Fuse$1 = /*#__PURE__*/function () {
+ function Fuse(docs) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ var index = arguments.length > 2 ? arguments[2] : undefined;
+
+ _classCallCheck(this, Fuse);
+
+ this.options = _objectSpread2(_objectSpread2({}, Config), options);
+
+ if (this.options.useExtendedSearch && !true) {
+ throw new Error(EXTENDED_SEARCH_UNAVAILABLE);
+ }
+
+ this._keyStore = new KeyStore(this.options.keys);
+ this.setCollection(docs, index);
+ }
+
+ _createClass(Fuse, [{
+ key: "setCollection",
+ value: function setCollection(docs, index) {
+ this._docs = docs;
+
+ if (index && !(index instanceof FuseIndex)) {
+ throw new Error(INCORRECT_INDEX_TYPE);
+ }
+
+ this._myIndex = index || createIndex(this.options.keys, this._docs, {
+ getFn: this.options.getFn,
+ fieldNormWeight: this.options.fieldNormWeight
+ });
+ }
+ }, {
+ key: "add",
+ value: function add(doc) {
+ if (!isDefined(doc)) {
+ return;
+ }
+
+ this._docs.push(doc);
+
+ this._myIndex.add(doc);
+ }
+ }, {
+ key: "remove",
+ value: function remove() {
+ var predicate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function
+ /* doc, idx */
+ () {
+ return false;
+ };
+ var results = [];
+
+ for (var i = 0, len = this._docs.length; i < len; i += 1) {
+ var doc = this._docs[i];
+
+ if (predicate(doc, i)) {
+ this.removeAt(i);
+ i -= 1;
+ len -= 1;
+ results.push(doc);
+ }
+ }
+
+ return results;
+ }
+ }, {
+ key: "removeAt",
+ value: function removeAt(idx) {
+ this._docs.splice(idx, 1);
+
+ this._myIndex.removeAt(idx);
+ }
+ }, {
+ key: "getIndex",
+ value: function getIndex() {
+ return this._myIndex;
+ }
+ }, {
+ key: "search",
+ value: function search(query) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$limit = _ref.limit,
+ limit = _ref$limit === void 0 ? -1 : _ref$limit;
+
+ var _this$options = this.options,
+ includeMatches = _this$options.includeMatches,
+ includeScore = _this$options.includeScore,
+ shouldSort = _this$options.shouldSort,
+ sortFn = _this$options.sortFn,
+ ignoreFieldNorm = _this$options.ignoreFieldNorm;
+ var results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);
+ computeScore(results, {
+ ignoreFieldNorm: ignoreFieldNorm
+ });
+
+ if (shouldSort) {
+ results.sort(sortFn);
+ }
+
+ if (isNumber(limit) && limit > -1) {
+ results = results.slice(0, limit);
+ }
+
+ return format(results, this._docs, {
+ includeMatches: includeMatches,
+ includeScore: includeScore
+ });
+ }
+ }, {
+ key: "_searchStringList",
+ value: function _searchStringList(query) {
+ var searcher = createSearcher(query, this.options);
+ var records = this._myIndex.records;
+ var results = []; // Iterate over every string in the index
+
+ records.forEach(function (_ref2) {
+ var text = _ref2.v,
+ idx = _ref2.i,
+ norm = _ref2.n;
+
+ if (!isDefined(text)) {
+ return;
+ }
+
+ var _searcher$searchIn = searcher.searchIn(text),
+ isMatch = _searcher$searchIn.isMatch,
+ score = _searcher$searchIn.score,
+ indices = _searcher$searchIn.indices;
+
+ if (isMatch) {
+ results.push({
+ item: text,
+ idx: idx,
+ matches: [{
+ score: score,
+ value: text,
+ norm: norm,
+ indices: indices
+ }]
+ });
+ }
+ });
+ return results;
+ }
+ }, {
+ key: "_searchLogical",
+ value: function _searchLogical(query) {
+ var _this = this;
+
+ var expression = parse(query, this.options);
+
+ var evaluate = function evaluate(node, item, idx) {
+ if (!node.children) {
+ var keyId = node.keyId,
+ searcher = node.searcher;
+
+ var matches = _this._findMatches({
+ key: _this._keyStore.get(keyId),
+ value: _this._myIndex.getValueForItemAtKeyId(item, keyId),
+ searcher: searcher
+ });
+
+ if (matches && matches.length) {
+ return [{
+ idx: idx,
+ item: item,
+ matches: matches
+ }];
+ }
+
+ return [];
+ }
+
+ var res = [];
+
+ for (var i = 0, len = node.children.length; i < len; i += 1) {
+ var child = node.children[i];
+ var result = evaluate(child, item, idx);
+
+ if (result.length) {
+ res.push.apply(res, _toConsumableArray(result));
+ } else if (node.operator === LogicalOperator.AND) {
+ return [];
+ }
+ }
+
+ return res;
+ };
+
+ var records = this._myIndex.records;
+ var resultMap = {};
+ var results = [];
+ records.forEach(function (_ref3) {
+ var item = _ref3.$,
+ idx = _ref3.i;
+
+ if (isDefined(item)) {
+ var expResults = evaluate(expression, item, idx);
+
+ if (expResults.length) {
+ // Dedupe when adding
+ if (!resultMap[idx]) {
+ resultMap[idx] = {
+ idx: idx,
+ item: item,
+ matches: []
+ };
+ results.push(resultMap[idx]);
+ }
+
+ expResults.forEach(function (_ref4) {
+ var _resultMap$idx$matche;
+
+ var matches = _ref4.matches;
+
+ (_resultMap$idx$matche = resultMap[idx].matches).push.apply(_resultMap$idx$matche, _toConsumableArray(matches));
+ });
+ }
+ }
+ });
+ return results;
+ }
+ }, {
+ key: "_searchObjectList",
+ value: function _searchObjectList(query) {
+ var _this2 = this;
+
+ var searcher = createSearcher(query, this.options);
+ var _this$_myIndex = this._myIndex,
+ keys = _this$_myIndex.keys,
+ records = _this$_myIndex.records;
+ var results = []; // List is Array<Object>
+
+ records.forEach(function (_ref5) {
+ var item = _ref5.$,
+ idx = _ref5.i;
+
+ if (!isDefined(item)) {
+ return;
+ }
+
+ var matches = []; // Iterate over every key (i.e, path), and fetch the value at that key
+
+ keys.forEach(function (key, keyIndex) {
+ matches.push.apply(matches, _toConsumableArray(_this2._findMatches({
+ key: key,
+ value: item[keyIndex],
+ searcher: searcher
+ })));
+ });
+
+ if (matches.length) {
+ results.push({
+ idx: idx,
+ item: item,
+ matches: matches
+ });
+ }
+ });
+ return results;
+ }
+ }, {
+ key: "_findMatches",
+ value: function _findMatches(_ref6) {
+ var key = _ref6.key,
+ value = _ref6.value,
+ searcher = _ref6.searcher;
+
+ if (!isDefined(value)) {
+ return [];
+ }
+
+ var matches = [];
+
+ if (isArray(value)) {
+ value.forEach(function (_ref7) {
+ var text = _ref7.v,
+ idx = _ref7.i,
+ norm = _ref7.n;
+
+ if (!isDefined(text)) {
+ return;
+ }
+
+ var _searcher$searchIn2 = searcher.searchIn(text),
+ isMatch = _searcher$searchIn2.isMatch,
+ score = _searcher$searchIn2.score,
+ indices = _searcher$searchIn2.indices;
+
+ if (isMatch) {
+ matches.push({
+ score: score,
+ key: key,
+ value: text,
+ idx: idx,
+ norm: norm,
+ indices: indices
+ });
+ }
+ });
+ } else {
+ var text = value.v,
+ norm = value.n;
+
+ var _searcher$searchIn3 = searcher.searchIn(text),
+ isMatch = _searcher$searchIn3.isMatch,
+ score = _searcher$searchIn3.score,
+ indices = _searcher$searchIn3.indices;
+
+ if (isMatch) {
+ matches.push({
+ score: score,
+ key: key,
+ value: text,
+ norm: norm,
+ indices: indices
+ });
+ }
+ }
+
+ return matches;
+ }
+ }]);
+
+ return Fuse;
+}();
+
+Fuse$1.version = '6.6.2';
+Fuse$1.createIndex = createIndex;
+Fuse$1.parseIndex = parseIndex;
+Fuse$1.config = Config;
+
+{
+ Fuse$1.parseQuery = parse;
+}
+
+{
+ register(ExtendedSearch);
+}
+
+var Fuse = Fuse$1;
+
+module.exports = Fuse;
diff --git a/node_modules/fuse.js/dist/fuse.d.ts b/node_modules/fuse.js/dist/fuse.d.ts
new file mode 100644
index 0000000..f702238
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.d.ts
@@ -0,0 +1,313 @@
+// Type definitions for Fuse.js v6.6.2
+// TypeScript v4.5.4
+
+export default Fuse
+export as namespace Fuse
+
+declare class Fuse<T> {
+ constructor(
+ list: ReadonlyArray<T>,
+ options?: Fuse.IFuseOptions<T>,
+ index?: Fuse.FuseIndex<T>
+ )
+ /**
+ * Search function for the Fuse instance.
+ *
+ * ```typescript
+ * const list: MyType[] = [myType1, myType2, etc...]
+
+ * const options: Fuse.IFuseOptions<MyType> = {
+ * keys: ['key1', 'key2']
+ * }
+ *
+ * const myFuse = new Fuse(list, options)
+ * let result = myFuse.search('pattern')
+ * ```
+ *
+ * @param pattern The pattern to search
+ * @param options `Fuse.FuseSearchOptions`
+ * @returns An array of search results
+ */
+ search<R = T>(
+ pattern: string | Fuse.Expression,
+ options?: Fuse.FuseSearchOptions
+ ): Fuse.FuseResult<R>[]
+
+ setCollection(docs: ReadonlyArray<T>, index?: Fuse.FuseIndex<T>): void
+
+ /**
+ * Adds a doc to the end the list.
+ */
+ add(doc: T): void
+
+ /**
+ * Removes all documents from the list which the predicate returns truthy for,
+ * and returns an array of the removed docs.
+ * The predicate is invoked with two arguments: (doc, index).
+ */
+ remove(predicate: (doc: T, idx: number) => boolean): T[]
+
+ /**
+ * Removes the doc at the specified index.
+ */
+ removeAt(idx: number): void
+
+ /**
+ * Returns the generated Fuse index
+ */
+ getIndex(): Fuse.FuseIndex<T>
+
+ /**
+ * Return the current version.
+ */
+ static version: string
+
+ /**
+ * Use this method to pre-generate the index from the list, and pass it
+ * directly into the Fuse instance.
+ *
+ * _Note that Fuse will automatically index the table if one isn't provided
+ * during instantiation._
+ *
+ * ```typescript
+ * const list: MyType[] = [myType1, myType2, etc...]
+ *
+ * const index = Fuse.createIndex<MyType>(
+ * keys: ['key1', 'key2']
+ * list: list
+ * )
+ *
+ * const options: Fuse.IFuseOptions<MyType> = {
+ * keys: ['key1', 'key2']
+ * }
+ *
+ * const myFuse = new Fuse(list, options, index)
+ * ```
+ * @param keys The keys to index
+ * @param list The list from which to create an index
+ * @param options?
+ * @returns An indexed list
+ */
+ static createIndex<U>(
+ keys: Array<Fuse.FuseOptionKey<U>>,
+ list: ReadonlyArray<U>,
+ options?: Fuse.FuseIndexOptions<U>
+ ): Fuse.FuseIndex<U>
+
+ static parseIndex<U>(
+ index: any,
+ options?: Fuse.FuseIndexOptions<U>
+ ): Fuse.FuseIndex<U>
+}
+
+declare namespace Fuse {
+ export class FuseIndex<T> {
+ constructor(options?: FuseIndexOptions<T>)
+ setSources(docs: ReadonlyArray<T>): void
+ setKeys(keys: ReadonlyArray<string>): void
+ setIndexRecords(records: FuseIndexRecords): void
+ create(): void
+ add(doc: T): void
+ toJSON(): {
+ keys: ReadonlyArray<string>
+ records: FuseIndexRecords
+ }
+ }
+
+ type FuseGetFunction<T> = (
+ obj: T,
+ path: string | string[]
+ ) => ReadonlyArray<string> | string
+
+ export type FuseIndexOptions<T> = {
+ getFn: FuseGetFunction<T>
+ }
+
+ // {
+ // title: { '$': "Old Man's War" },
+ // 'author.firstName': { '$': 'Codenar' }
+ // }
+ //
+ // OR
+ //
+ // {
+ // tags: [
+ // { $: 'nonfiction', idx: 0 },
+ // { $: 'web development', idx: 1 },
+ // ]
+ // }
+ export type FuseSortFunctionItem = {
+ [key: string]: { $: string } | { $: string; idx: number }[]
+ }
+
+ // {
+ // score: 0.001,
+ // key: 'author.firstName',
+ // value: 'Codenar',
+ // indices: [ [ 0, 3 ] ]
+ // }
+ export type FuseSortFunctionMatch = {
+ score: number
+ key: string
+ value: string
+ indices: ReadonlyArray<number>[]
+ }
+
+ // {
+ // score: 0,
+ // key: 'tags',
+ // value: 'nonfiction',
+ // idx: 1,
+ // indices: [ [ 0, 9 ] ]
+ // }
+ export type FuseSortFunctionMatchList = FuseSortFunctionMatch & {
+ idx: number
+ }
+
+ export type FuseSortFunctionArg = {
+ idx: number
+ item: FuseSortFunctionItem
+ score: number
+ matches?: (FuseSortFunctionMatch | FuseSortFunctionMatchList)[]
+ }
+
+ export type FuseSortFunction = (
+ a: FuseSortFunctionArg,
+ b: FuseSortFunctionArg
+ ) => number
+
+ // title: {
+ // '$': "Old Man's War",
+ // 'n': 0.5773502691896258
+ // }
+ type RecordEntryObject = {
+ v: string // The text value
+ n: number // The field-length norm
+ }
+
+ // 'author.tags.name': [{
+ // 'v': 'pizza lover',
+ // 'i': 2,
+ // 'n: 0.7071067811865475
+ // }
+ type RecordEntryArrayItem = ReadonlyArray<RecordEntryObject & { i: number }>
+
+ // TODO: this makes it difficult to infer the type. Need to think more about this
+ type RecordEntry = { [key: string]: RecordEntryObject | RecordEntryArrayItem }
+
+ // {
+ // i: 0,
+ // '$': {
+ // '0': { v: "Old Man's War", n: 0.5773502691896258 },
+ // '1': { v: 'Codenar', n: 1 },
+ // '2': [
+ // { v: 'pizza lover', i: 2, n: 0.7071067811865475 },
+ // { v: 'helo wold', i: 1, n: 0.7071067811865475 },
+ // { v: 'hello world', i: 0, n: 0.7071067811865475 }
+ // ]
+ // }
+ // }
+ type FuseIndexObjectRecord = {
+ i: number // The index of the record in the source list
+ $: RecordEntry
+ }
+
+ // {
+ // keys: null,
+ // list: [
+ // { v: 'one', i: 0, n: 1 },
+ // { v: 'two', i: 1, n: 1 },
+ // { v: 'three', i: 2, n: 1 }
+ // ]
+ // }
+ type FuseIndexStringRecord = {
+ i: number // The index of the record in the source list
+ v: string // The text value
+ n: number // The field-length norm
+ }
+
+ type FuseIndexRecords =
+ | ReadonlyArray<FuseIndexObjectRecord>
+ | ReadonlyArray<FuseIndexStringRecord>
+
+ // {
+ // name: 'title',
+ // weight: 0.7
+ // }
+ export type FuseOptionKeyObject<T> = {
+ name: string | string[]
+ weight?: number
+ getFn?: (obj: T) => ReadonlyArray<string> | string
+ }
+
+ export type FuseOptionKey<T> = FuseOptionKeyObject<T> | string | string[]
+
+ export interface IFuseOptions<T> {
+ /** Indicates whether comparisons should be case sensitive. */
+ isCaseSensitive?: boolean
+ /** Determines how close the match must be to the fuzzy location (specified by `location`). An exact letter match which is `distance` characters away from the fuzzy location would score as a complete mismatch. A `distance` of `0` requires the match be at the exact `location` specified. A distance of `1000` would require a perfect match to be within `800` characters of the `location` to be found using a `threshold` of `0.8`. */
+ distance?: number
+ /** When true, the matching function will continue to the end of a search pattern even if a perfect match has already been located in the string. */
+ findAllMatches?: boolean
+ /** The function to use to retrieve an object's value at the provided path. The default will also search nested paths. */
+ getFn?: FuseGetFunction<T>
+ /** When `true`, search will ignore `location` and `distance`, so it won't matter where in the string the pattern appears. */
+ ignoreLocation?: boolean
+ /** When `true`, the calculation for the relevance score (used for sorting) will ignore the `field-length norm`. */
+ ignoreFieldNorm?: boolean
+ /** Determines how much the `field-length norm` affects scoring. A value of `0` is equivalent to ignoring the field-length norm. A value of `0.5` will greatly reduce the effect of field-length norm, while a value of `2.0` will greatly increase it. */
+ fieldNormWeight?: number
+ /** Whether the matches should be included in the result set. When `true`, each record in the result set will include the indices of the matched characters. These can consequently be used for highlighting purposes. */
+ includeMatches?: boolean
+ /** Whether the score should be included in the result set. A score of `0`indicates a perfect match, while a score of `1` indicates a complete mismatch. */
+ includeScore?: boolean
+ /** List of keys that will be searched. This supports nested paths, weighted search, searching in arrays of `strings` and `objects`. */
+ keys?: Array<FuseOptionKey<T>>
+ /** Determines approximately where in the text is the pattern expected to be found. */
+ location?: number
+ /** Only the matches whose length exceeds this value will be returned. (For instance, if you want to ignore single character matches in the result, set it to `2`). */
+ minMatchCharLength?: number
+ /** Whether to sort the result list, by score. */
+ shouldSort?: boolean
+ /** The function to use to sort all the results. The default will sort by ascending relevance score, ascending index. */
+ sortFn?: FuseSortFunction
+ /** At what point does the match algorithm give up. A threshold of `0.0` requires a perfect match (of both letters and location), a threshold of `1.0` would match anything. */
+ threshold?: number
+ /** When `true`, it enables the use of unix-like search commands. See [example](/examples.html#extended-search). */
+ useExtendedSearch?: boolean
+ }
+
+ // Denotes the start/end indices of a match
+ // start end
+ // ↓ ↓
+ type RangeTuple = [number, number]
+
+ export type FuseResultMatch = {
+ indices: ReadonlyArray<RangeTuple>
+ key?: string
+ refIndex?: number
+ value?: string
+ }
+
+ export type FuseSearchOptions = {
+ limit: number
+ }
+
+ export type FuseResult<T> = {
+ item: T
+ refIndex: number
+ score?: number
+ matches?: ReadonlyArray<FuseResultMatch>
+ }
+
+ export type Expression =
+ | { [key: string]: string }
+ | {
+ $path: ReadonlyArray<string>
+ $val: string
+ }
+ | { $and?: Expression[] }
+ | { $or?: Expression[] }
+
+ export const config: Required<IFuseOptions<any>>
+}
diff --git a/node_modules/fuse.js/dist/fuse.esm.js b/node_modules/fuse.js/dist/fuse.esm.js
new file mode 100644
index 0000000..55b68c8
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.esm.js
@@ -0,0 +1,1780 @@
+/**
+ * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
+ *
+ * Copyright (c) 2022 Kiro Risk (http://kiro.me)
+ * All Rights Reserved. Apache Software License 2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+
+function isArray(value) {
+ return !Array.isArray
+ ? getTag(value) === '[object Array]'
+ : Array.isArray(value)
+}
+
+// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js
+const INFINITY = 1 / 0;
+function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value
+ }
+ let result = value + '';
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result
+}
+
+function toString(value) {
+ return value == null ? '' : baseToString(value)
+}
+
+function isString(value) {
+ return typeof value === 'string'
+}
+
+function isNumber(value) {
+ return typeof value === 'number'
+}
+
+// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
+function isBoolean(value) {
+ return (
+ value === true ||
+ value === false ||
+ (isObjectLike(value) && getTag(value) == '[object Boolean]')
+ )
+}
+
+function isObject(value) {
+ return typeof value === 'object'
+}
+
+// Checks if `value` is object-like.
+function isObjectLike(value) {
+ return isObject(value) && value !== null
+}
+
+function isDefined(value) {
+ return value !== undefined && value !== null
+}
+
+function isBlank(value) {
+ return !value.trim().length
+}
+
+// Gets the `toStringTag` of `value`.
+// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js
+function getTag(value) {
+ return value == null
+ ? value === undefined
+ ? '[object Undefined]'
+ : '[object Null]'
+ : Object.prototype.toString.call(value)
+}
+
+const EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';
+
+const INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
+
+const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = (key) =>
+ `Invalid value for key ${key}`;
+
+const PATTERN_LENGTH_TOO_LARGE = (max) =>
+ `Pattern length exceeds max of ${max}.`;
+
+const MISSING_KEY_PROPERTY = (name) => `Missing ${name} property in key`;
+
+const INVALID_KEY_WEIGHT_VALUE = (key) =>
+ `Property 'weight' in key '${key}' must be a positive integer`;
+
+const hasOwn = Object.prototype.hasOwnProperty;
+
+class KeyStore {
+ constructor(keys) {
+ this._keys = [];
+ this._keyMap = {};
+
+ let totalWeight = 0;
+
+ keys.forEach((key) => {
+ let obj = createKey(key);
+
+ totalWeight += obj.weight;
+
+ this._keys.push(obj);
+ this._keyMap[obj.id] = obj;
+
+ totalWeight += obj.weight;
+ });
+
+ // Normalize weights so that their sum is equal to 1
+ this._keys.forEach((key) => {
+ key.weight /= totalWeight;
+ });
+ }
+ get(keyId) {
+ return this._keyMap[keyId]
+ }
+ keys() {
+ return this._keys
+ }
+ toJSON() {
+ return JSON.stringify(this._keys)
+ }
+}
+
+function createKey(key) {
+ let path = null;
+ let id = null;
+ let src = null;
+ let weight = 1;
+ let getFn = null;
+
+ if (isString(key) || isArray(key)) {
+ src = key;
+ path = createKeyPath(key);
+ id = createKeyId(key);
+ } else {
+ if (!hasOwn.call(key, 'name')) {
+ throw new Error(MISSING_KEY_PROPERTY('name'))
+ }
+
+ const name = key.name;
+ src = name;
+
+ if (hasOwn.call(key, 'weight')) {
+ weight = key.weight;
+
+ if (weight <= 0) {
+ throw new Error(INVALID_KEY_WEIGHT_VALUE(name))
+ }
+ }
+
+ path = createKeyPath(name);
+ id = createKeyId(name);
+ getFn = key.getFn;
+ }
+
+ return { path, id, weight, src, getFn }
+}
+
+function createKeyPath(key) {
+ return isArray(key) ? key : key.split('.')
+}
+
+function createKeyId(key) {
+ return isArray(key) ? key.join('.') : key
+}
+
+function get(obj, path) {
+ let list = [];
+ let arr = false;
+
+ const deepGet = (obj, path, index) => {
+ if (!isDefined(obj)) {
+ return
+ }
+ if (!path[index]) {
+ // If there's no path left, we've arrived at the object we care about.
+ list.push(obj);
+ } else {
+ let key = path[index];
+
+ const value = obj[key];
+
+ if (!isDefined(value)) {
+ return
+ }
+
+ // If we're at the last value in the path, and if it's a string/number/bool,
+ // add it to the list
+ if (
+ index === path.length - 1 &&
+ (isString(value) || isNumber(value) || isBoolean(value))
+ ) {
+ list.push(toString(value));
+ } else if (isArray(value)) {
+ arr = true;
+ // Search each item in the array.
+ for (let i = 0, len = value.length; i < len; i += 1) {
+ deepGet(value[i], path, index + 1);
+ }
+ } else if (path.length) {
+ // An object. Recurse further.
+ deepGet(value, path, index + 1);
+ }
+ }
+ };
+
+ // Backwards compatibility (since path used to be a string)
+ deepGet(obj, isString(path) ? path.split('.') : path, 0);
+
+ return arr ? list : list[0]
+}
+
+const MatchOptions = {
+ // Whether the matches should be included in the result set. When `true`, each record in the result
+ // set will include the indices of the matched characters.
+ // These can consequently be used for highlighting purposes.
+ includeMatches: false,
+ // When `true`, the matching function will continue to the end of a search pattern even if
+ // a perfect match has already been located in the string.
+ findAllMatches: false,
+ // Minimum number of characters that must be matched before a result is considered a match
+ minMatchCharLength: 1
+};
+
+const BasicOptions = {
+ // When `true`, the algorithm continues searching to the end of the input even if a perfect
+ // match is found before the end of the same input.
+ isCaseSensitive: false,
+ // When true, the matching function will continue to the end of a search pattern even if
+ includeScore: false,
+ // List of properties that will be searched. This also supports nested properties.
+ keys: [],
+ // Whether to sort the result list, by score
+ shouldSort: true,
+ // Default sort function: sort by ascending score, ascending index
+ sortFn: (a, b) =>
+ a.score === b.score ? (a.idx < b.idx ? -1 : 1) : a.score < b.score ? -1 : 1
+};
+
+const FuzzyOptions = {
+ // Approximately where in the text is the pattern expected to be found?
+ location: 0,
+ // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
+ // (of both letters and location), a threshold of '1.0' would match anything.
+ threshold: 0.6,
+ // Determines how close the match must be to the fuzzy location (specified above).
+ // An exact letter match which is 'distance' characters away from the fuzzy location
+ // would score as a complete mismatch. A distance of '0' requires the match be at
+ // the exact location specified, a threshold of '1000' would require a perfect match
+ // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
+ distance: 100
+};
+
+const AdvancedOptions = {
+ // When `true`, it enables the use of unix-like search commands
+ useExtendedSearch: false,
+ // The get function to use when fetching an object's properties.
+ // The default will search nested paths *ie foo.bar.baz*
+ getFn: get,
+ // When `true`, search will ignore `location` and `distance`, so it won't matter
+ // where in the string the pattern appears.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
+ ignoreLocation: false,
+ // When `true`, the calculation for the relevance score (used for sorting) will
+ // ignore the field-length norm.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
+ ignoreFieldNorm: false,
+ // The weight to determine how much field length norm effects scoring.
+ fieldNormWeight: 1
+};
+
+var Config = {
+ ...BasicOptions,
+ ...MatchOptions,
+ ...FuzzyOptions,
+ ...AdvancedOptions
+};
+
+const SPACE = /[^ ]+/g;
+
+// Field-length norm: the shorter the field, the higher the weight.
+// Set to 3 decimals to reduce index size.
+function norm(weight = 1, mantissa = 3) {
+ const cache = new Map();
+ const m = Math.pow(10, mantissa);
+
+ return {
+ get(value) {
+ const numTokens = value.match(SPACE).length;
+
+ if (cache.has(numTokens)) {
+ return cache.get(numTokens)
+ }
+
+ // Default function is 1/sqrt(x), weight makes that variable
+ const norm = 1 / Math.pow(numTokens, 0.5 * weight);
+
+ // In place of `toFixed(mantissa)`, for faster computation
+ const n = parseFloat(Math.round(norm * m) / m);
+
+ cache.set(numTokens, n);
+
+ return n
+ },
+ clear() {
+ cache.clear();
+ }
+ }
+}
+
+class FuseIndex {
+ constructor({
+ getFn = Config.getFn,
+ fieldNormWeight = Config.fieldNormWeight
+ } = {}) {
+ this.norm = norm(fieldNormWeight, 3);
+ this.getFn = getFn;
+ this.isCreated = false;
+
+ this.setIndexRecords();
+ }
+ setSources(docs = []) {
+ this.docs = docs;
+ }
+ setIndexRecords(records = []) {
+ this.records = records;
+ }
+ setKeys(keys = []) {
+ this.keys = keys;
+ this._keysMap = {};
+ keys.forEach((key, idx) => {
+ this._keysMap[key.id] = idx;
+ });
+ }
+ create() {
+ if (this.isCreated || !this.docs.length) {
+ return
+ }
+
+ this.isCreated = true;
+
+ // List is Array<String>
+ if (isString(this.docs[0])) {
+ this.docs.forEach((doc, docIndex) => {
+ this._addString(doc, docIndex);
+ });
+ } else {
+ // List is Array<Object>
+ this.docs.forEach((doc, docIndex) => {
+ this._addObject(doc, docIndex);
+ });
+ }
+
+ this.norm.clear();
+ }
+ // Adds a doc to the end of the index
+ add(doc) {
+ const idx = this.size();
+
+ if (isString(doc)) {
+ this._addString(doc, idx);
+ } else {
+ this._addObject(doc, idx);
+ }
+ }
+ // Removes the doc at the specified index of the index
+ removeAt(idx) {
+ this.records.splice(idx, 1);
+
+ // Change ref index of every subsquent doc
+ for (let i = idx, len = this.size(); i < len; i += 1) {
+ this.records[i].i -= 1;
+ }
+ }
+ getValueForItemAtKeyId(item, keyId) {
+ return item[this._keysMap[keyId]]
+ }
+ size() {
+ return this.records.length
+ }
+ _addString(doc, docIndex) {
+ if (!isDefined(doc) || isBlank(doc)) {
+ return
+ }
+
+ let record = {
+ v: doc,
+ i: docIndex,
+ n: this.norm.get(doc)
+ };
+
+ this.records.push(record);
+ }
+ _addObject(doc, docIndex) {
+ let record = { i: docIndex, $: {} };
+
+ // Iterate over every key (i.e, path), and fetch the value at that key
+ this.keys.forEach((key, keyIndex) => {
+ let value = key.getFn ? key.getFn(doc) : this.getFn(doc, key.path);
+
+ if (!isDefined(value)) {
+ return
+ }
+
+ if (isArray(value)) {
+ let subRecords = [];
+ const stack = [{ nestedArrIndex: -1, value }];
+
+ while (stack.length) {
+ const { nestedArrIndex, value } = stack.pop();
+
+ if (!isDefined(value)) {
+ continue
+ }
+
+ if (isString(value) && !isBlank(value)) {
+ let subRecord = {
+ v: value,
+ i: nestedArrIndex,
+ n: this.norm.get(value)
+ };
+
+ subRecords.push(subRecord);
+ } else if (isArray(value)) {
+ value.forEach((item, k) => {
+ stack.push({
+ nestedArrIndex: k,
+ value: item
+ });
+ });
+ } else ;
+ }
+ record.$[keyIndex] = subRecords;
+ } else if (isString(value) && !isBlank(value)) {
+ let subRecord = {
+ v: value,
+ n: this.norm.get(value)
+ };
+
+ record.$[keyIndex] = subRecord;
+ }
+ });
+
+ this.records.push(record);
+ }
+ toJSON() {
+ return {
+ keys: this.keys,
+ records: this.records
+ }
+ }
+}
+
+function createIndex(
+ keys,
+ docs,
+ { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}
+) {
+ const myIndex = new FuseIndex({ getFn, fieldNormWeight });
+ myIndex.setKeys(keys.map(createKey));
+ myIndex.setSources(docs);
+ myIndex.create();
+ return myIndex
+}
+
+function parseIndex(
+ data,
+ { getFn = Config.getFn, fieldNormWeight = Config.fieldNormWeight } = {}
+) {
+ const { keys, records } = data;
+ const myIndex = new FuseIndex({ getFn, fieldNormWeight });
+ myIndex.setKeys(keys);
+ myIndex.setIndexRecords(records);
+ return myIndex
+}
+
+function computeScore$1(
+ pattern,
+ {
+ errors = 0,
+ currentLocation = 0,
+ expectedLocation = 0,
+ distance = Config.distance,
+ ignoreLocation = Config.ignoreLocation
+ } = {}
+) {
+ const accuracy = errors / pattern.length;
+
+ if (ignoreLocation) {
+ return accuracy
+ }
+
+ const proximity = Math.abs(expectedLocation - currentLocation);
+
+ if (!distance) {
+ // Dodge divide by zero error.
+ return proximity ? 1.0 : accuracy
+ }
+
+ return accuracy + proximity / distance
+}
+
+function convertMaskToIndices(
+ matchmask = [],
+ minMatchCharLength = Config.minMatchCharLength
+) {
+ let indices = [];
+ let start = -1;
+ let end = -1;
+ let i = 0;
+
+ for (let len = matchmask.length; i < len; i += 1) {
+ let match = matchmask[i];
+ if (match && start === -1) {
+ start = i;
+ } else if (!match && start !== -1) {
+ end = i - 1;
+ if (end - start + 1 >= minMatchCharLength) {
+ indices.push([start, end]);
+ }
+ start = -1;
+ }
+ }
+
+ // (i-1 - start) + 1 => i - start
+ if (matchmask[i - 1] && i - start >= minMatchCharLength) {
+ indices.push([start, i - 1]);
+ }
+
+ return indices
+}
+
+// Machine word size
+const MAX_BITS = 32;
+
+function search(
+ text,
+ pattern,
+ patternAlphabet,
+ {
+ location = Config.location,
+ distance = Config.distance,
+ threshold = Config.threshold,
+ findAllMatches = Config.findAllMatches,
+ minMatchCharLength = Config.minMatchCharLength,
+ includeMatches = Config.includeMatches,
+ ignoreLocation = Config.ignoreLocation
+ } = {}
+) {
+ if (pattern.length > MAX_BITS) {
+ throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS))
+ }
+
+ const patternLen = pattern.length;
+ // Set starting location at beginning text and initialize the alphabet.
+ const textLen = text.length;
+ // Handle the case when location > text.length
+ const expectedLocation = Math.max(0, Math.min(location, textLen));
+ // Highest score beyond which we give up.
+ let currentThreshold = threshold;
+ // Is there a nearby exact match? (speedup)
+ let bestLocation = expectedLocation;
+
+ // Performance: only computer matches when the minMatchCharLength > 1
+ // OR if `includeMatches` is true.
+ const computeMatches = minMatchCharLength > 1 || includeMatches;
+ // A mask of the matches, used for building the indices
+ const matchMask = computeMatches ? Array(textLen) : [];
+
+ let index;
+
+ // Get all exact matches, here for speed up
+ while ((index = text.indexOf(pattern, bestLocation)) > -1) {
+ let score = computeScore$1(pattern, {
+ currentLocation: index,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+
+ currentThreshold = Math.min(score, currentThreshold);
+ bestLocation = index + patternLen;
+
+ if (computeMatches) {
+ let i = 0;
+ while (i < patternLen) {
+ matchMask[index + i] = 1;
+ i += 1;
+ }
+ }
+ }
+
+ // Reset the best location
+ bestLocation = -1;
+
+ let lastBitArr = [];
+ let finalScore = 1;
+ let binMax = patternLen + textLen;
+
+ const mask = 1 << (patternLen - 1);
+
+ for (let i = 0; i < patternLen; i += 1) {
+ // Scan for the best match; each iteration allows for one more error.
+ // Run a binary search to determine how far from the match location we can stray
+ // at this error level.
+ let binMin = 0;
+ let binMid = binMax;
+
+ while (binMin < binMid) {
+ const score = computeScore$1(pattern, {
+ errors: i,
+ currentLocation: expectedLocation + binMid,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+
+ if (score <= currentThreshold) {
+ binMin = binMid;
+ } else {
+ binMax = binMid;
+ }
+
+ binMid = Math.floor((binMax - binMin) / 2 + binMin);
+ }
+
+ // Use the result from this iteration as the maximum for the next.
+ binMax = binMid;
+
+ let start = Math.max(1, expectedLocation - binMid + 1);
+ let finish = findAllMatches
+ ? textLen
+ : Math.min(expectedLocation + binMid, textLen) + patternLen;
+
+ // Initialize the bit array
+ let bitArr = Array(finish + 2);
+
+ bitArr[finish + 1] = (1 << i) - 1;
+
+ for (let j = finish; j >= start; j -= 1) {
+ let currentLocation = j - 1;
+ let charMatch = patternAlphabet[text.charAt(currentLocation)];
+
+ if (computeMatches) {
+ // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)
+ matchMask[currentLocation] = +!!charMatch;
+ }
+
+ // First pass: exact match
+ bitArr[j] = ((bitArr[j + 1] << 1) | 1) & charMatch;
+
+ // Subsequent passes: fuzzy match
+ if (i) {
+ bitArr[j] |=
+ ((lastBitArr[j + 1] | lastBitArr[j]) << 1) | 1 | lastBitArr[j + 1];
+ }
+
+ if (bitArr[j] & mask) {
+ finalScore = computeScore$1(pattern, {
+ errors: i,
+ currentLocation,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+
+ // This match will almost certainly be better than any existing match.
+ // But check anyway.
+ if (finalScore <= currentThreshold) {
+ // Indeed it is
+ currentThreshold = finalScore;
+ bestLocation = currentLocation;
+
+ // Already passed `loc`, downhill from here on in.
+ if (bestLocation <= expectedLocation) {
+ break
+ }
+
+ // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.
+ start = Math.max(1, 2 * expectedLocation - bestLocation);
+ }
+ }
+ }
+
+ // No hope for a (better) match at greater error levels.
+ const score = computeScore$1(pattern, {
+ errors: i + 1,
+ currentLocation: expectedLocation,
+ expectedLocation,
+ distance,
+ ignoreLocation
+ });
+
+ if (score > currentThreshold) {
+ break
+ }
+
+ lastBitArr = bitArr;
+ }
+
+ const result = {
+ isMatch: bestLocation >= 0,
+ // Count exact matches (those with a score of 0) to be "almost" exact
+ score: Math.max(0.001, finalScore)
+ };
+
+ if (computeMatches) {
+ const indices = convertMaskToIndices(matchMask, minMatchCharLength);
+ if (!indices.length) {
+ result.isMatch = false;
+ } else if (includeMatches) {
+ result.indices = indices;
+ }
+ }
+
+ return result
+}
+
+function createPatternAlphabet(pattern) {
+ let mask = {};
+
+ for (let i = 0, len = pattern.length; i < len; i += 1) {
+ const char = pattern.charAt(i);
+ mask[char] = (mask[char] || 0) | (1 << (len - i - 1));
+ }
+
+ return mask
+}
+
+class BitapSearch {
+ constructor(
+ pattern,
+ {
+ location = Config.location,
+ threshold = Config.threshold,
+ distance = Config.distance,
+ includeMatches = Config.includeMatches,
+ findAllMatches = Config.findAllMatches,
+ minMatchCharLength = Config.minMatchCharLength,
+ isCaseSensitive = Config.isCaseSensitive,
+ ignoreLocation = Config.ignoreLocation
+ } = {}
+ ) {
+ this.options = {
+ location,
+ threshold,
+ distance,
+ includeMatches,
+ findAllMatches,
+ minMatchCharLength,
+ isCaseSensitive,
+ ignoreLocation
+ };
+
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+
+ this.chunks = [];
+
+ if (!this.pattern.length) {
+ return
+ }
+
+ const addChunk = (pattern, startIndex) => {
+ this.chunks.push({
+ pattern,
+ alphabet: createPatternAlphabet(pattern),
+ startIndex
+ });
+ };
+
+ const len = this.pattern.length;
+
+ if (len > MAX_BITS) {
+ let i = 0;
+ const remainder = len % MAX_BITS;
+ const end = len - remainder;
+
+ while (i < end) {
+ addChunk(this.pattern.substr(i, MAX_BITS), i);
+ i += MAX_BITS;
+ }
+
+ if (remainder) {
+ const startIndex = len - MAX_BITS;
+ addChunk(this.pattern.substr(startIndex), startIndex);
+ }
+ } else {
+ addChunk(this.pattern, 0);
+ }
+ }
+
+ searchIn(text) {
+ const { isCaseSensitive, includeMatches } = this.options;
+
+ if (!isCaseSensitive) {
+ text = text.toLowerCase();
+ }
+
+ // Exact match
+ if (this.pattern === text) {
+ let result = {
+ isMatch: true,
+ score: 0
+ };
+
+ if (includeMatches) {
+ result.indices = [[0, text.length - 1]];
+ }
+
+ return result
+ }
+
+ // Otherwise, use Bitap algorithm
+ const {
+ location,
+ distance,
+ threshold,
+ findAllMatches,
+ minMatchCharLength,
+ ignoreLocation
+ } = this.options;
+
+ let allIndices = [];
+ let totalScore = 0;
+ let hasMatches = false;
+
+ this.chunks.forEach(({ pattern, alphabet, startIndex }) => {
+ const { isMatch, score, indices } = search(text, pattern, alphabet, {
+ location: location + startIndex,
+ distance,
+ threshold,
+ findAllMatches,
+ minMatchCharLength,
+ includeMatches,
+ ignoreLocation
+ });
+
+ if (isMatch) {
+ hasMatches = true;
+ }
+
+ totalScore += score;
+
+ if (isMatch && indices) {
+ allIndices = [...allIndices, ...indices];
+ }
+ });
+
+ let result = {
+ isMatch: hasMatches,
+ score: hasMatches ? totalScore / this.chunks.length : 1
+ };
+
+ if (hasMatches && includeMatches) {
+ result.indices = allIndices;
+ }
+
+ return result
+ }
+}
+
+class BaseMatch {
+ constructor(pattern) {
+ this.pattern = pattern;
+ }
+ static isMultiMatch(pattern) {
+ return getMatch(pattern, this.multiRegex)
+ }
+ static isSingleMatch(pattern) {
+ return getMatch(pattern, this.singleRegex)
+ }
+ search(/*text*/) {}
+}
+
+function getMatch(pattern, exp) {
+ const matches = pattern.match(exp);
+ return matches ? matches[1] : null
+}
+
+// Token: 'file
+
+class ExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return 'exact'
+ }
+ static get multiRegex() {
+ return /^="(.*)"$/
+ }
+ static get singleRegex() {
+ return /^=(.*)$/
+ }
+ search(text) {
+ const isMatch = text === this.pattern;
+
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, this.pattern.length - 1]
+ }
+ }
+}
+
+// Token: !fire
+
+class InverseExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return 'inverse-exact'
+ }
+ static get multiRegex() {
+ return /^!"(.*)"$/
+ }
+ static get singleRegex() {
+ return /^!(.*)$/
+ }
+ search(text) {
+ const index = text.indexOf(this.pattern);
+ const isMatch = index === -1;
+
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ }
+ }
+}
+
+// Token: ^file
+
+class PrefixExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return 'prefix-exact'
+ }
+ static get multiRegex() {
+ return /^\^"(.*)"$/
+ }
+ static get singleRegex() {
+ return /^\^(.*)$/
+ }
+ search(text) {
+ const isMatch = text.startsWith(this.pattern);
+
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, this.pattern.length - 1]
+ }
+ }
+}
+
+// Token: !^fire
+
+class InversePrefixExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return 'inverse-prefix-exact'
+ }
+ static get multiRegex() {
+ return /^!\^"(.*)"$/
+ }
+ static get singleRegex() {
+ return /^!\^(.*)$/
+ }
+ search(text) {
+ const isMatch = !text.startsWith(this.pattern);
+
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ }
+ }
+}
+
+// Token: .file$
+
+class SuffixExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return 'suffix-exact'
+ }
+ static get multiRegex() {
+ return /^"(.*)"\$$/
+ }
+ static get singleRegex() {
+ return /^(.*)\$$/
+ }
+ search(text) {
+ const isMatch = text.endsWith(this.pattern);
+
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [text.length - this.pattern.length, text.length - 1]
+ }
+ }
+}
+
+// Token: !.file$
+
+class InverseSuffixExactMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return 'inverse-suffix-exact'
+ }
+ static get multiRegex() {
+ return /^!"(.*)"\$$/
+ }
+ static get singleRegex() {
+ return /^!(.*)\$$/
+ }
+ search(text) {
+ const isMatch = !text.endsWith(this.pattern);
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ }
+ }
+}
+
+class FuzzyMatch extends BaseMatch {
+ constructor(
+ pattern,
+ {
+ location = Config.location,
+ threshold = Config.threshold,
+ distance = Config.distance,
+ includeMatches = Config.includeMatches,
+ findAllMatches = Config.findAllMatches,
+ minMatchCharLength = Config.minMatchCharLength,
+ isCaseSensitive = Config.isCaseSensitive,
+ ignoreLocation = Config.ignoreLocation
+ } = {}
+ ) {
+ super(pattern);
+ this._bitapSearch = new BitapSearch(pattern, {
+ location,
+ threshold,
+ distance,
+ includeMatches,
+ findAllMatches,
+ minMatchCharLength,
+ isCaseSensitive,
+ ignoreLocation
+ });
+ }
+ static get type() {
+ return 'fuzzy'
+ }
+ static get multiRegex() {
+ return /^"(.*)"$/
+ }
+ static get singleRegex() {
+ return /^(.*)$/
+ }
+ search(text) {
+ return this._bitapSearch.searchIn(text)
+ }
+}
+
+// Token: 'file
+
+class IncludeMatch extends BaseMatch {
+ constructor(pattern) {
+ super(pattern);
+ }
+ static get type() {
+ return 'include'
+ }
+ static get multiRegex() {
+ return /^'"(.*)"$/
+ }
+ static get singleRegex() {
+ return /^'(.*)$/
+ }
+ search(text) {
+ let location = 0;
+ let index;
+
+ const indices = [];
+ const patternLen = this.pattern.length;
+
+ // Get all exact matches
+ while ((index = text.indexOf(this.pattern, location)) > -1) {
+ location = index + patternLen;
+ indices.push([index, location - 1]);
+ }
+
+ const isMatch = !!indices.length;
+
+ return {
+ isMatch,
+ score: isMatch ? 0 : 1,
+ indices
+ }
+ }
+}
+
+// ❗Order is important. DO NOT CHANGE.
+const searchers = [
+ ExactMatch,
+ IncludeMatch,
+ PrefixExactMatch,
+ InversePrefixExactMatch,
+ InverseSuffixExactMatch,
+ SuffixExactMatch,
+ InverseExactMatch,
+ FuzzyMatch
+];
+
+const searchersLen = searchers.length;
+
+// Regex to split by spaces, but keep anything in quotes together
+const SPACE_RE = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;
+const OR_TOKEN = '|';
+
+// Return a 2D array representation of the query, for simpler parsing.
+// Example:
+// "^core go$ | rb$ | py$ xy$" => [["^core", "go$"], ["rb$"], ["py$", "xy$"]]
+function parseQuery(pattern, options = {}) {
+ return pattern.split(OR_TOKEN).map((item) => {
+ let query = item
+ .trim()
+ .split(SPACE_RE)
+ .filter((item) => item && !!item.trim());
+
+ let results = [];
+ for (let i = 0, len = query.length; i < len; i += 1) {
+ const queryItem = query[i];
+
+ // 1. Handle multiple query match (i.e, once that are quoted, like `"hello world"`)
+ let found = false;
+ let idx = -1;
+ while (!found && ++idx < searchersLen) {
+ const searcher = searchers[idx];
+ let token = searcher.isMultiMatch(queryItem);
+ if (token) {
+ results.push(new searcher(token, options));
+ found = true;
+ }
+ }
+
+ if (found) {
+ continue
+ }
+
+ // 2. Handle single query matches (i.e, once that are *not* quoted)
+ idx = -1;
+ while (++idx < searchersLen) {
+ const searcher = searchers[idx];
+ let token = searcher.isSingleMatch(queryItem);
+ if (token) {
+ results.push(new searcher(token, options));
+ break
+ }
+ }
+ }
+
+ return results
+ })
+}
+
+// These extended matchers can return an array of matches, as opposed
+// to a singl match
+const MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);
+
+/**
+ * Command-like searching
+ * ======================
+ *
+ * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,
+ * search in a given text.
+ *
+ * Search syntax:
+ *
+ * | Token | Match type | Description |
+ * | ----------- | -------------------------- | -------------------------------------- |
+ * | `jscript` | fuzzy-match | Items that fuzzy match `jscript` |
+ * | `=scheme` | exact-match | Items that are `scheme` |
+ * | `'python` | include-match | Items that include `python` |
+ * | `!ruby` | inverse-exact-match | Items that do not include `ruby` |
+ * | `^java` | prefix-exact-match | Items that start with `java` |
+ * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |
+ * | `.js$` | suffix-exact-match | Items that end with `.js` |
+ * | `!.go$` | inverse-suffix-exact-match | Items that do not end with `.go` |
+ *
+ * A single pipe character acts as an OR operator. For example, the following
+ * query matches entries that start with `core` and end with either`go`, `rb`,
+ * or`py`.
+ *
+ * ```
+ * ^core go$ | rb$ | py$
+ * ```
+ */
+class ExtendedSearch {
+ constructor(
+ pattern,
+ {
+ isCaseSensitive = Config.isCaseSensitive,
+ includeMatches = Config.includeMatches,
+ minMatchCharLength = Config.minMatchCharLength,
+ ignoreLocation = Config.ignoreLocation,
+ findAllMatches = Config.findAllMatches,
+ location = Config.location,
+ threshold = Config.threshold,
+ distance = Config.distance
+ } = {}
+ ) {
+ this.query = null;
+ this.options = {
+ isCaseSensitive,
+ includeMatches,
+ minMatchCharLength,
+ findAllMatches,
+ ignoreLocation,
+ location,
+ threshold,
+ distance
+ };
+
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+ this.query = parseQuery(this.pattern, this.options);
+ }
+
+ static condition(_, options) {
+ return options.useExtendedSearch
+ }
+
+ searchIn(text) {
+ const query = this.query;
+
+ if (!query) {
+ return {
+ isMatch: false,
+ score: 1
+ }
+ }
+
+ const { includeMatches, isCaseSensitive } = this.options;
+
+ text = isCaseSensitive ? text : text.toLowerCase();
+
+ let numMatches = 0;
+ let allIndices = [];
+ let totalScore = 0;
+
+ // ORs
+ for (let i = 0, qLen = query.length; i < qLen; i += 1) {
+ const searchers = query[i];
+
+ // Reset indices
+ allIndices.length = 0;
+ numMatches = 0;
+
+ // ANDs
+ for (let j = 0, pLen = searchers.length; j < pLen; j += 1) {
+ const searcher = searchers[j];
+ const { isMatch, indices, score } = searcher.search(text);
+
+ if (isMatch) {
+ numMatches += 1;
+ totalScore += score;
+ if (includeMatches) {
+ const type = searcher.constructor.type;
+ if (MultiMatchSet.has(type)) {
+ allIndices = [...allIndices, ...indices];
+ } else {
+ allIndices.push(indices);
+ }
+ }
+ } else {
+ totalScore = 0;
+ numMatches = 0;
+ allIndices.length = 0;
+ break
+ }
+ }
+
+ // OR condition, so if TRUE, return
+ if (numMatches) {
+ let result = {
+ isMatch: true,
+ score: totalScore / numMatches
+ };
+
+ if (includeMatches) {
+ result.indices = allIndices;
+ }
+
+ return result
+ }
+ }
+
+ // Nothing was matched
+ return {
+ isMatch: false,
+ score: 1
+ }
+ }
+}
+
+const registeredSearchers = [];
+
+function register(...args) {
+ registeredSearchers.push(...args);
+}
+
+function createSearcher(pattern, options) {
+ for (let i = 0, len = registeredSearchers.length; i < len; i += 1) {
+ let searcherClass = registeredSearchers[i];
+ if (searcherClass.condition(pattern, options)) {
+ return new searcherClass(pattern, options)
+ }
+ }
+
+ return new BitapSearch(pattern, options)
+}
+
+const LogicalOperator = {
+ AND: '$and',
+ OR: '$or'
+};
+
+const KeyType = {
+ PATH: '$path',
+ PATTERN: '$val'
+};
+
+const isExpression = (query) =>
+ !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
+
+const isPath = (query) => !!query[KeyType.PATH];
+
+const isLeaf = (query) =>
+ !isArray(query) && isObject(query) && !isExpression(query);
+
+const convertToExplicit = (query) => ({
+ [LogicalOperator.AND]: Object.keys(query).map((key) => ({
+ [key]: query[key]
+ }))
+});
+
+// When `auto` is `true`, the parse function will infer and initialize and add
+// the appropriate `Searcher` instance
+function parse(query, options, { auto = true } = {}) {
+ const next = (query) => {
+ let keys = Object.keys(query);
+
+ const isQueryPath = isPath(query);
+
+ if (!isQueryPath && keys.length > 1 && !isExpression(query)) {
+ return next(convertToExplicit(query))
+ }
+
+ if (isLeaf(query)) {
+ const key = isQueryPath ? query[KeyType.PATH] : keys[0];
+
+ const pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];
+
+ if (!isString(pattern)) {
+ throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key))
+ }
+
+ const obj = {
+ keyId: createKeyId(key),
+ pattern
+ };
+
+ if (auto) {
+ obj.searcher = createSearcher(pattern, options);
+ }
+
+ return obj
+ }
+
+ let node = {
+ children: [],
+ operator: keys[0]
+ };
+
+ keys.forEach((key) => {
+ const value = query[key];
+
+ if (isArray(value)) {
+ value.forEach((item) => {
+ node.children.push(next(item));
+ });
+ }
+ });
+
+ return node
+ };
+
+ if (!isExpression(query)) {
+ query = convertToExplicit(query);
+ }
+
+ return next(query)
+}
+
+// Practical scoring function
+function computeScore(
+ results,
+ { ignoreFieldNorm = Config.ignoreFieldNorm }
+) {
+ results.forEach((result) => {
+ let totalScore = 1;
+
+ result.matches.forEach(({ key, norm, score }) => {
+ const weight = key ? key.weight : null;
+
+ totalScore *= Math.pow(
+ score === 0 && weight ? Number.EPSILON : score,
+ (weight || 1) * (ignoreFieldNorm ? 1 : norm)
+ );
+ });
+
+ result.score = totalScore;
+ });
+}
+
+function transformMatches(result, data) {
+ const matches = result.matches;
+ data.matches = [];
+
+ if (!isDefined(matches)) {
+ return
+ }
+
+ matches.forEach((match) => {
+ if (!isDefined(match.indices) || !match.indices.length) {
+ return
+ }
+
+ const { indices, value } = match;
+
+ let obj = {
+ indices,
+ value
+ };
+
+ if (match.key) {
+ obj.key = match.key.src;
+ }
+
+ if (match.idx > -1) {
+ obj.refIndex = match.idx;
+ }
+
+ data.matches.push(obj);
+ });
+}
+
+function transformScore(result, data) {
+ data.score = result.score;
+}
+
+function format(
+ results,
+ docs,
+ {
+ includeMatches = Config.includeMatches,
+ includeScore = Config.includeScore
+ } = {}
+) {
+ const transformers = [];
+
+ if (includeMatches) transformers.push(transformMatches);
+ if (includeScore) transformers.push(transformScore);
+
+ return results.map((result) => {
+ const { idx } = result;
+
+ const data = {
+ item: docs[idx],
+ refIndex: idx
+ };
+
+ if (transformers.length) {
+ transformers.forEach((transformer) => {
+ transformer(result, data);
+ });
+ }
+
+ return data
+ })
+}
+
+class Fuse {
+ constructor(docs, options = {}, index) {
+ this.options = { ...Config, ...options };
+
+ if (
+ this.options.useExtendedSearch &&
+ !true
+ ) {
+ throw new Error(EXTENDED_SEARCH_UNAVAILABLE)
+ }
+
+ this._keyStore = new KeyStore(this.options.keys);
+
+ this.setCollection(docs, index);
+ }
+
+ setCollection(docs, index) {
+ this._docs = docs;
+
+ if (index && !(index instanceof FuseIndex)) {
+ throw new Error(INCORRECT_INDEX_TYPE)
+ }
+
+ this._myIndex =
+ index ||
+ createIndex(this.options.keys, this._docs, {
+ getFn: this.options.getFn,
+ fieldNormWeight: this.options.fieldNormWeight
+ });
+ }
+
+ add(doc) {
+ if (!isDefined(doc)) {
+ return
+ }
+
+ this._docs.push(doc);
+ this._myIndex.add(doc);
+ }
+
+ remove(predicate = (/* doc, idx */) => false) {
+ const results = [];
+
+ for (let i = 0, len = this._docs.length; i < len; i += 1) {
+ const doc = this._docs[i];
+ if (predicate(doc, i)) {
+ this.removeAt(i);
+ i -= 1;
+ len -= 1;
+
+ results.push(doc);
+ }
+ }
+
+ return results
+ }
+
+ removeAt(idx) {
+ this._docs.splice(idx, 1);
+ this._myIndex.removeAt(idx);
+ }
+
+ getIndex() {
+ return this._myIndex
+ }
+
+ search(query, { limit = -1 } = {}) {
+ const {
+ includeMatches,
+ includeScore,
+ shouldSort,
+ sortFn,
+ ignoreFieldNorm
+ } = this.options;
+
+ let results = isString(query)
+ ? isString(this._docs[0])
+ ? this._searchStringList(query)
+ : this._searchObjectList(query)
+ : this._searchLogical(query);
+
+ computeScore(results, { ignoreFieldNorm });
+
+ if (shouldSort) {
+ results.sort(sortFn);
+ }
+
+ if (isNumber(limit) && limit > -1) {
+ results = results.slice(0, limit);
+ }
+
+ return format(results, this._docs, {
+ includeMatches,
+ includeScore
+ })
+ }
+
+ _searchStringList(query) {
+ const searcher = createSearcher(query, this.options);
+ const { records } = this._myIndex;
+ const results = [];
+
+ // Iterate over every string in the index
+ records.forEach(({ v: text, i: idx, n: norm }) => {
+ if (!isDefined(text)) {
+ return
+ }
+
+ const { isMatch, score, indices } = searcher.searchIn(text);
+
+ if (isMatch) {
+ results.push({
+ item: text,
+ idx,
+ matches: [{ score, value: text, norm, indices }]
+ });
+ }
+ });
+
+ return results
+ }
+
+ _searchLogical(query) {
+
+ const expression = parse(query, this.options);
+
+ const evaluate = (node, item, idx) => {
+ if (!node.children) {
+ const { keyId, searcher } = node;
+
+ const matches = this._findMatches({
+ key: this._keyStore.get(keyId),
+ value: this._myIndex.getValueForItemAtKeyId(item, keyId),
+ searcher
+ });
+
+ if (matches && matches.length) {
+ return [
+ {
+ idx,
+ item,
+ matches
+ }
+ ]
+ }
+
+ return []
+ }
+
+ const res = [];
+ for (let i = 0, len = node.children.length; i < len; i += 1) {
+ const child = node.children[i];
+ const result = evaluate(child, item, idx);
+ if (result.length) {
+ res.push(...result);
+ } else if (node.operator === LogicalOperator.AND) {
+ return []
+ }
+ }
+ return res
+ };
+
+ const records = this._myIndex.records;
+ const resultMap = {};
+ const results = [];
+
+ records.forEach(({ $: item, i: idx }) => {
+ if (isDefined(item)) {
+ let expResults = evaluate(expression, item, idx);
+
+ if (expResults.length) {
+ // Dedupe when adding
+ if (!resultMap[idx]) {
+ resultMap[idx] = { idx, item, matches: [] };
+ results.push(resultMap[idx]);
+ }
+ expResults.forEach(({ matches }) => {
+ resultMap[idx].matches.push(...matches);
+ });
+ }
+ }
+ });
+
+ return results
+ }
+
+ _searchObjectList(query) {
+ const searcher = createSearcher(query, this.options);
+ const { keys, records } = this._myIndex;
+ const results = [];
+
+ // List is Array<Object>
+ records.forEach(({ $: item, i: idx }) => {
+ if (!isDefined(item)) {
+ return
+ }
+
+ let matches = [];
+
+ // Iterate over every key (i.e, path), and fetch the value at that key
+ keys.forEach((key, keyIndex) => {
+ matches.push(
+ ...this._findMatches({
+ key,
+ value: item[keyIndex],
+ searcher
+ })
+ );
+ });
+
+ if (matches.length) {
+ results.push({
+ idx,
+ item,
+ matches
+ });
+ }
+ });
+
+ return results
+ }
+ _findMatches({ key, value, searcher }) {
+ if (!isDefined(value)) {
+ return []
+ }
+
+ let matches = [];
+
+ if (isArray(value)) {
+ value.forEach(({ v: text, i: idx, n: norm }) => {
+ if (!isDefined(text)) {
+ return
+ }
+
+ const { isMatch, score, indices } = searcher.searchIn(text);
+
+ if (isMatch) {
+ matches.push({
+ score,
+ key,
+ value: text,
+ idx,
+ norm,
+ indices
+ });
+ }
+ });
+ } else {
+ const { v: text, n: norm } = value;
+
+ const { isMatch, score, indices } = searcher.searchIn(text);
+
+ if (isMatch) {
+ matches.push({ score, key, value: text, norm, indices });
+ }
+ }
+
+ return matches
+ }
+}
+
+Fuse.version = '6.6.2';
+Fuse.createIndex = createIndex;
+Fuse.parseIndex = parseIndex;
+Fuse.config = Config;
+
+{
+ Fuse.parseQuery = parse;
+}
+
+{
+ register(ExtendedSearch);
+}
+
+export { Fuse as default };
diff --git a/node_modules/fuse.js/dist/fuse.esm.min.js b/node_modules/fuse.js/dist/fuse.esm.min.js
new file mode 100644
index 0000000..855f99e
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.esm.min.js
@@ -0,0 +1,9 @@
+/**
+ * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
+ *
+ * Copyright (c) 2022 Kiro Risk (http://kiro.me)
+ * All Rights Reserved. Apache Software License 2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+function t(t){return Array.isArray?Array.isArray(t):"[object Array]"===o(t)}function e(t){return"string"==typeof t}function n(t){return"number"==typeof t}function s(t){return!0===t||!1===t||function(t){return i(t)&&null!==t}(t)&&"[object Boolean]"==o(t)}function i(t){return"object"==typeof t}function r(t){return null!=t}function c(t){return!t.trim().length}function o(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const h=Object.prototype.hasOwnProperty;class a{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach((t=>{let n=l(t);e+=n.weight,this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight})),this._keys.forEach((t=>{t.weight/=e}))}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function l(n){let s=null,i=null,r=null,c=1,o=null;if(e(n)||t(n))r=n,s=u(n),i=d(n);else{if(!h.call(n,"name"))throw new Error((t=>`Missing ${t} property in key`)("name"));const t=n.name;if(r=t,h.call(n,"weight")&&(c=n.weight,c<=0))throw new Error((t=>`Property 'weight' in key '${t}' must be a positive integer`)(t));s=u(t),i=d(t),o=n.getFn}return{path:s,id:i,weight:c,src:r,getFn:o}}function u(e){return t(e)?e:e.split(".")}function d(e){return t(e)?e.join("."):e}var g={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1,includeMatches:!1,findAllMatches:!1,minMatchCharLength:1,location:0,threshold:.6,distance:100,...{useExtendedSearch:!1,getFn:function(i,c){let o=[],h=!1;const a=(i,c,l)=>{if(r(i))if(c[l]){const u=i[c[l]];if(!r(u))return;if(l===c.length-1&&(e(u)||n(u)||s(u)))o.push(function(t){return null==t?"":function(t){if("string"==typeof t)return t;let e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(t)}(u));else if(t(u)){h=!0;for(let t=0,e=u.length;t<e;t+=1)a(u[t],c,l+1)}else c.length&&a(u,c,l+1)}else o.push(i)};return a(i,e(c)?c.split("."):c,0),h?o:o[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1}};const f=/[^ ]+/g;class p{constructor({getFn:t=g.getFn,fieldNormWeight:e=g.fieldNormWeight}={}){this.norm=function(t=1,e=3){const n=new Map,s=Math.pow(10,e);return{get(e){const i=e.match(f).length;if(n.has(i))return n.get(i);const r=1/Math.pow(i,.5*t),c=parseFloat(Math.round(r*s)/s);return n.set(i,c),c},clear(){n.clear()}}}(e,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach(((t,e)=>{this._keysMap[t.id]=e}))}create(){!this.isCreated&&this.docs.length&&(this.isCreated=!0,e(this.docs[0])?this.docs.forEach(((t,e)=>{this._addString(t,e)})):this.docs.forEach(((t,e)=>{this._addObject(t,e)})),this.norm.clear())}add(t){const n=this.size();e(t)?this._addString(t,n):this._addObject(t,n)}removeAt(t){this.records.splice(t,1);for(let e=t,n=this.size();e<n;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!r(t)||c(t))return;let n={v:t,i:e,n:this.norm.get(t)};this.records.push(n)}_addObject(n,s){let i={i:s,$:{}};this.keys.forEach(((s,o)=>{let h=s.getFn?s.getFn(n):this.getFn(n,s.path);if(r(h))if(t(h)){let n=[];const s=[{nestedArrIndex:-1,value:h}];for(;s.length;){const{nestedArrIndex:i,value:o}=s.pop();if(r(o))if(e(o)&&!c(o)){let t={v:o,i:i,n:this.norm.get(o)};n.push(t)}else t(o)&&o.forEach(((t,e)=>{s.push({nestedArrIndex:e,value:t})}))}i.$[o]=n}else if(e(h)&&!c(h)){let t={v:h,n:this.norm.get(h)};i.$[o]=t}})),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function m(t,e,{getFn:n=g.getFn,fieldNormWeight:s=g.fieldNormWeight}={}){const i=new p({getFn:n,fieldNormWeight:s});return i.setKeys(t.map(l)),i.setSources(e),i.create(),i}function M(t,{errors:e=0,currentLocation:n=0,expectedLocation:s=0,distance:i=g.distance,ignoreLocation:r=g.ignoreLocation}={}){const c=e/t.length;if(r)return c;const o=Math.abs(s-n);return i?c+o/i:o?1:c}function x(t,e,n,{location:s=g.location,distance:i=g.distance,threshold:r=g.threshold,findAllMatches:c=g.findAllMatches,minMatchCharLength:o=g.minMatchCharLength,includeMatches:h=g.includeMatches,ignoreLocation:a=g.ignoreLocation}={}){if(e.length>32)throw new Error(`Pattern length exceeds max of ${32}.`);const l=e.length,u=t.length,d=Math.max(0,Math.min(s,u));let f=r,p=d;const m=o>1||h,x=m?Array(u):[];let y;for(;(y=t.indexOf(e,p))>-1;){let t=M(e,{currentLocation:y,expectedLocation:d,distance:i,ignoreLocation:a});if(f=Math.min(t,f),p=y+l,m){let t=0;for(;t<l;)x[y+t]=1,t+=1}}p=-1;let L=[],k=1,_=l+u;const v=1<<l-1;for(let s=0;s<l;s+=1){let r=0,o=_;for(;r<o;){M(e,{errors:s,currentLocation:d+o,expectedLocation:d,distance:i,ignoreLocation:a})<=f?r=o:_=o,o=Math.floor((_-r)/2+r)}_=o;let h=Math.max(1,d-o+1),g=c?u:Math.min(d+o,u)+l,y=Array(g+2);y[g+1]=(1<<s)-1;for(let r=g;r>=h;r-=1){let c=r-1,o=n[t.charAt(c)];if(m&&(x[c]=+!!o),y[r]=(y[r+1]<<1|1)&o,s&&(y[r]|=(L[r+1]|L[r])<<1|1|L[r+1]),y[r]&v&&(k=M(e,{errors:s,currentLocation:c,expectedLocation:d,distance:i,ignoreLocation:a}),k<=f)){if(f=k,p=c,p<=d)break;h=Math.max(1,2*d-p)}}if(M(e,{errors:s+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:a})>f)break;L=y}const S={isMatch:p>=0,score:Math.max(.001,k)};if(m){const t=function(t=[],e=g.minMatchCharLength){let n=[],s=-1,i=-1,r=0;for(let c=t.length;r<c;r+=1){let c=t[r];c&&-1===s?s=r:c||-1===s||(i=r-1,i-s+1>=e&&n.push([s,i]),s=-1)}return t[r-1]&&r-s>=e&&n.push([s,r-1]),n}(x,o);t.length?h&&(S.indices=t):S.isMatch=!1}return S}function y(t){let e={};for(let n=0,s=t.length;n<s;n+=1){const i=t.charAt(n);e[i]=(e[i]||0)|1<<s-n-1}return e}class L{constructor(t,{location:e=g.location,threshold:n=g.threshold,distance:s=g.distance,includeMatches:i=g.includeMatches,findAllMatches:r=g.findAllMatches,minMatchCharLength:c=g.minMatchCharLength,isCaseSensitive:o=g.isCaseSensitive,ignoreLocation:h=g.ignoreLocation}={}){if(this.options={location:e,threshold:n,distance:s,includeMatches:i,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:h},this.pattern=o?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const a=(t,e)=>{this.chunks.push({pattern:t,alphabet:y(t),startIndex:e})},l=this.pattern.length;if(l>32){let t=0;const e=l%32,n=l-e;for(;t<n;)a(this.pattern.substr(t,32),t),t+=32;if(e){const t=l-32;a(this.pattern.substr(t),t)}}else a(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:n}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let e={isMatch:!0,score:0};return n&&(e.indices=[[0,t.length-1]]),e}const{location:s,distance:i,threshold:r,findAllMatches:c,minMatchCharLength:o,ignoreLocation:h}=this.options;let a=[],l=0,u=!1;this.chunks.forEach((({pattern:e,alphabet:d,startIndex:g})=>{const{isMatch:f,score:p,indices:m}=x(t,e,d,{location:s+g,distance:i,threshold:r,findAllMatches:c,minMatchCharLength:o,includeMatches:n,ignoreLocation:h});f&&(u=!0),l+=p,f&&m&&(a=[...a,...m])}));let d={isMatch:u,score:u?l/this.chunks.length:1};return u&&n&&(d.indices=a),d}}class k{constructor(t){this.pattern=t}static isMultiMatch(t){return _(t,this.multiRegex)}static isSingleMatch(t){return _(t,this.singleRegex)}search(){}}function _(t,e){const n=t.match(e);return n?n[1]:null}class v extends k{constructor(t,{location:e=g.location,threshold:n=g.threshold,distance:s=g.distance,includeMatches:i=g.includeMatches,findAllMatches:r=g.findAllMatches,minMatchCharLength:c=g.minMatchCharLength,isCaseSensitive:o=g.isCaseSensitive,ignoreLocation:h=g.ignoreLocation}={}){super(t),this._bitapSearch=new L(t,{location:e,threshold:n,distance:s,includeMatches:i,findAllMatches:r,minMatchCharLength:c,isCaseSensitive:o,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class S extends k{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e,n=0;const s=[],i=this.pattern.length;for(;(e=t.indexOf(this.pattern,n))>-1;)n=e+i,s.push([e,n-1]);const r=!!s.length;return{isMatch:r,score:r?0:1,indices:s}}}const w=[class extends k{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},S,class extends k{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}},class extends k{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends k{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},class extends k{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}},class extends k{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const e=-1===t.indexOf(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}},v],C=w.length,I=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;const $=new Set([v.type,S.type]);class A{constructor(t,{isCaseSensitive:e=g.isCaseSensitive,includeMatches:n=g.includeMatches,minMatchCharLength:s=g.minMatchCharLength,ignoreLocation:i=g.ignoreLocation,findAllMatches:r=g.findAllMatches,location:c=g.location,threshold:o=g.threshold,distance:h=g.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:n,minMatchCharLength:s,findAllMatches:r,ignoreLocation:i,location:c,threshold:o,distance:h},this.pattern=e?t:t.toLowerCase(),this.query=function(t,e={}){return t.split("|").map((t=>{let n=t.trim().split(I).filter((t=>t&&!!t.trim())),s=[];for(let t=0,i=n.length;t<i;t+=1){const i=n[t];let r=!1,c=-1;for(;!r&&++c<C;){const t=w[c];let n=t.isMultiMatch(i);n&&(s.push(new t(n,e)),r=!0)}if(!r)for(c=-1;++c<C;){const t=w[c];let n=t.isSingleMatch(i);if(n){s.push(new t(n,e));break}}}return s}))}(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s}=this.options;t=s?t:t.toLowerCase();let i=0,r=[],c=0;for(let s=0,o=e.length;s<o;s+=1){const o=e[s];r.length=0,i=0;for(let e=0,s=o.length;e<s;e+=1){const s=o[e],{isMatch:h,indices:a,score:l}=s.search(t);if(!h){c=0,i=0,r.length=0;break}if(i+=1,c+=l,n){const t=s.constructor.type;$.has(t)?r=[...r,...a]:r.push(a)}}if(i){let t={isMatch:!0,score:c/i};return n&&(t.indices=r),t}}return{isMatch:!1,score:1}}}const E=[];function b(t,e){for(let n=0,s=E.length;n<s;n+=1){let s=E[n];if(s.condition(t,e))return new s(t,e)}return new L(t,e)}const F="$and",N="$or",R="$path",O="$val",j=t=>!(!t[F]&&!t[N]),W=t=>({[F]:Object.keys(t).map((e=>({[e]:t[e]})))});function z(n,s,{auto:r=!0}={}){const c=n=>{let o=Object.keys(n);const h=(t=>!!t[R])(n);if(!h&&o.length>1&&!j(n))return c(W(n));if((e=>!t(e)&&i(e)&&!j(e))(n)){const t=h?n[R]:o[0],i=h?n[O]:n[t];if(!e(i))throw new Error((t=>`Invalid value for key ${t}`)(t));const c={keyId:d(t),pattern:i};return r&&(c.searcher=b(i,s)),c}let a={children:[],operator:o[0]};return o.forEach((e=>{const s=n[e];t(s)&&s.forEach((t=>{a.children.push(c(t))}))})),a};return j(n)||(n=W(n)),c(n)}function K(t,e){const n=t.matches;e.matches=[],r(n)&&n.forEach((t=>{if(!r(t.indices)||!t.indices.length)return;const{indices:n,value:s}=t;let i={indices:n,value:s};t.key&&(i.key=t.key.src),t.idx>-1&&(i.refIndex=t.idx),e.matches.push(i)}))}function P(t,e){e.score=t.score}class q{constructor(t,e={},n){this.options={...g,...e},this.options.useExtendedSearch,this._keyStore=new a(this.options.keys),this.setCollection(t,n)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof p))throw new Error("Incorrect 'index' type");this._myIndex=e||m(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){r(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=(()=>!1)){const e=[];for(let n=0,s=this._docs.length;n<s;n+=1){const i=this._docs[n];t(i,n)&&(this.removeAt(n),n-=1,s-=1,e.push(i))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:s=-1}={}){const{includeMatches:i,includeScore:r,shouldSort:c,sortFn:o,ignoreFieldNorm:h}=this.options;let a=e(t)?e(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return function(t,{ignoreFieldNorm:e=g.ignoreFieldNorm}){t.forEach((t=>{let n=1;t.matches.forEach((({key:t,norm:s,score:i})=>{const r=t?t.weight:null;n*=Math.pow(0===i&&r?Number.EPSILON:i,(r||1)*(e?1:s))})),t.score=n}))}(a,{ignoreFieldNorm:h}),c&&a.sort(o),n(s)&&s>-1&&(a=a.slice(0,s)),function(t,e,{includeMatches:n=g.includeMatches,includeScore:s=g.includeScore}={}){const i=[];return n&&i.push(K),s&&i.push(P),t.map((t=>{const{idx:n}=t,s={item:e[n],refIndex:n};return i.length&&i.forEach((e=>{e(t,s)})),s}))}(a,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(t){const e=b(t,this.options),{records:n}=this._myIndex,s=[];return n.forEach((({v:t,i:n,n:i})=>{if(!r(t))return;const{isMatch:c,score:o,indices:h}=e.searchIn(t);c&&s.push({item:t,idx:n,matches:[{score:o,value:t,norm:i,indices:h}]})})),s}_searchLogical(t){const e=z(t,this.options),n=(t,e,s)=>{if(!t.children){const{keyId:n,searcher:i}=t,r=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(e,n),searcher:i});return r&&r.length?[{idx:s,item:e,matches:r}]:[]}const i=[];for(let r=0,c=t.children.length;r<c;r+=1){const c=t.children[r],o=n(c,e,s);if(o.length)i.push(...o);else if(t.operator===F)return[]}return i},s=this._myIndex.records,i={},c=[];return s.forEach((({$:t,i:s})=>{if(r(t)){let r=n(e,t,s);r.length&&(i[s]||(i[s]={idx:s,item:t,matches:[]},c.push(i[s])),r.forEach((({matches:t})=>{i[s].matches.push(...t)})))}})),c}_searchObjectList(t){const e=b(t,this.options),{keys:n,records:s}=this._myIndex,i=[];return s.forEach((({$:t,i:s})=>{if(!r(t))return;let c=[];n.forEach(((n,s)=>{c.push(...this._findMatches({key:n,value:t[s],searcher:e}))})),c.length&&i.push({idx:s,item:t,matches:c})})),i}_findMatches({key:e,value:n,searcher:s}){if(!r(n))return[];let i=[];if(t(n))n.forEach((({v:t,i:n,n:c})=>{if(!r(t))return;const{isMatch:o,score:h,indices:a}=s.searchIn(t);o&&i.push({score:h,key:e,value:t,idx:n,norm:c,indices:a})}));else{const{v:t,n:r}=n,{isMatch:c,score:o,indices:h}=s.searchIn(t);c&&i.push({score:o,key:e,value:t,norm:r,indices:h})}return i}}q.version="6.6.2",q.createIndex=m,q.parseIndex=function(t,{getFn:e=g.getFn,fieldNormWeight:n=g.fieldNormWeight}={}){const{keys:s,records:i}=t,r=new p({getFn:e,fieldNormWeight:n});return r.setKeys(s),r.setIndexRecords(i),r},q.config=g,function(...t){E.push(...t)}(A);export{q as default}; \ No newline at end of file
diff --git a/node_modules/fuse.js/dist/fuse.js b/node_modules/fuse.js/dist/fuse.js
new file mode 100644
index 0000000..42e7d3b
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.js
@@ -0,0 +1,2240 @@
+/**
+ * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
+ *
+ * Copyright (c) 2022 Kiro Risk (http://kiro.me)
+ * All Rights Reserved. Apache Software License 2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+
+(function (global, factory) {
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
+ typeof define === 'function' && define.amd ? define(factory) :
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Fuse = factory());
+})(this, (function () { 'use strict';
+
+ function ownKeys(object, enumerableOnly) {
+ var keys = Object.keys(object);
+
+ if (Object.getOwnPropertySymbols) {
+ var symbols = Object.getOwnPropertySymbols(object);
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
+ })), keys.push.apply(keys, symbols);
+ }
+
+ return keys;
+ }
+
+ function _objectSpread2(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = null != arguments[i] ? arguments[i] : {};
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
+ });
+ }
+
+ return target;
+ }
+
+ function _typeof(obj) {
+ "@babel/helpers - typeof";
+
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
+ return typeof obj;
+ } : function (obj) {
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
+ }, _typeof(obj);
+ }
+
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor)) {
+ throw new TypeError("Cannot call a class as a function");
+ }
+ }
+
+ function _defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ descriptor.enumerable = descriptor.enumerable || false;
+ descriptor.configurable = true;
+ if ("value" in descriptor) descriptor.writable = true;
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ }
+
+ function _createClass(Constructor, protoProps, staticProps) {
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
+ if (staticProps) _defineProperties(Constructor, staticProps);
+ Object.defineProperty(Constructor, "prototype", {
+ writable: false
+ });
+ return Constructor;
+ }
+
+ function _defineProperty(obj, key, value) {
+ if (key in obj) {
+ Object.defineProperty(obj, key, {
+ value: value,
+ enumerable: true,
+ configurable: true,
+ writable: true
+ });
+ } else {
+ obj[key] = value;
+ }
+
+ return obj;
+ }
+
+ function _inherits(subClass, superClass) {
+ if (typeof superClass !== "function" && superClass !== null) {
+ throw new TypeError("Super expression must either be null or a function");
+ }
+
+ Object.defineProperty(subClass, "prototype", {
+ value: Object.create(superClass && superClass.prototype, {
+ constructor: {
+ value: subClass,
+ writable: true,
+ configurable: true
+ }
+ }),
+ writable: false
+ });
+ if (superClass) _setPrototypeOf(subClass, superClass);
+ }
+
+ function _getPrototypeOf(o) {
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
+ return o.__proto__ || Object.getPrototypeOf(o);
+ };
+ return _getPrototypeOf(o);
+ }
+
+ function _setPrototypeOf(o, p) {
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
+ o.__proto__ = p;
+ return o;
+ };
+
+ return _setPrototypeOf(o, p);
+ }
+
+ function _isNativeReflectConstruct() {
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
+ if (Reflect.construct.sham) return false;
+ if (typeof Proxy === "function") return true;
+
+ try {
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
+ return true;
+ } catch (e) {
+ return false;
+ }
+ }
+
+ function _assertThisInitialized(self) {
+ if (self === void 0) {
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
+ }
+
+ return self;
+ }
+
+ function _possibleConstructorReturn(self, call) {
+ if (call && (typeof call === "object" || typeof call === "function")) {
+ return call;
+ } else if (call !== void 0) {
+ throw new TypeError("Derived constructors may only return object or undefined");
+ }
+
+ return _assertThisInitialized(self);
+ }
+
+ function _createSuper(Derived) {
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
+
+ return function _createSuperInternal() {
+ var Super = _getPrototypeOf(Derived),
+ result;
+
+ if (hasNativeReflectConstruct) {
+ var NewTarget = _getPrototypeOf(this).constructor;
+
+ result = Reflect.construct(Super, arguments, NewTarget);
+ } else {
+ result = Super.apply(this, arguments);
+ }
+
+ return _possibleConstructorReturn(this, result);
+ };
+ }
+
+ function _toConsumableArray(arr) {
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
+ }
+
+ function _arrayWithoutHoles(arr) {
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
+ }
+
+ function _iterableToArray(iter) {
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
+ }
+
+ function _unsupportedIterableToArray(o, minLen) {
+ if (!o) return;
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
+ var n = Object.prototype.toString.call(o).slice(8, -1);
+ if (n === "Object" && o.constructor) n = o.constructor.name;
+ if (n === "Map" || n === "Set") return Array.from(o);
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
+ }
+
+ function _arrayLikeToArray(arr, len) {
+ if (len == null || len > arr.length) len = arr.length;
+
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
+
+ return arr2;
+ }
+
+ function _nonIterableSpread() {
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
+ }
+
+ function isArray(value) {
+ return !Array.isArray ? getTag(value) === '[object Array]' : Array.isArray(value);
+ } // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js
+
+ var INFINITY = 1 / 0;
+ function baseToString(value) {
+ // Exit early for strings to avoid a performance hit in some environments.
+ if (typeof value == 'string') {
+ return value;
+ }
+
+ var result = value + '';
+ return result == '0' && 1 / value == -INFINITY ? '-0' : result;
+ }
+ function toString(value) {
+ return value == null ? '' : baseToString(value);
+ }
+ function isString(value) {
+ return typeof value === 'string';
+ }
+ function isNumber(value) {
+ return typeof value === 'number';
+ } // Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js
+
+ function isBoolean(value) {
+ return value === true || value === false || isObjectLike(value) && getTag(value) == '[object Boolean]';
+ }
+ function isObject(value) {
+ return _typeof(value) === 'object';
+ } // Checks if `value` is object-like.
+
+ function isObjectLike(value) {
+ return isObject(value) && value !== null;
+ }
+ function isDefined(value) {
+ return value !== undefined && value !== null;
+ }
+ function isBlank(value) {
+ return !value.trim().length;
+ } // Gets the `toStringTag` of `value`.
+ // Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js
+
+ function getTag(value) {
+ return value == null ? value === undefined ? '[object Undefined]' : '[object Null]' : Object.prototype.toString.call(value);
+ }
+
+ var EXTENDED_SEARCH_UNAVAILABLE = 'Extended search is not available';
+ var INCORRECT_INDEX_TYPE = "Incorrect 'index' type";
+ var LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY = function LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key) {
+ return "Invalid value for key ".concat(key);
+ };
+ var PATTERN_LENGTH_TOO_LARGE = function PATTERN_LENGTH_TOO_LARGE(max) {
+ return "Pattern length exceeds max of ".concat(max, ".");
+ };
+ var MISSING_KEY_PROPERTY = function MISSING_KEY_PROPERTY(name) {
+ return "Missing ".concat(name, " property in key");
+ };
+ var INVALID_KEY_WEIGHT_VALUE = function INVALID_KEY_WEIGHT_VALUE(key) {
+ return "Property 'weight' in key '".concat(key, "' must be a positive integer");
+ };
+
+ var hasOwn = Object.prototype.hasOwnProperty;
+
+ var KeyStore = /*#__PURE__*/function () {
+ function KeyStore(keys) {
+ var _this = this;
+
+ _classCallCheck(this, KeyStore);
+
+ this._keys = [];
+ this._keyMap = {};
+ var totalWeight = 0;
+ keys.forEach(function (key) {
+ var obj = createKey(key);
+ totalWeight += obj.weight;
+
+ _this._keys.push(obj);
+
+ _this._keyMap[obj.id] = obj;
+ totalWeight += obj.weight;
+ }); // Normalize weights so that their sum is equal to 1
+
+ this._keys.forEach(function (key) {
+ key.weight /= totalWeight;
+ });
+ }
+
+ _createClass(KeyStore, [{
+ key: "get",
+ value: function get(keyId) {
+ return this._keyMap[keyId];
+ }
+ }, {
+ key: "keys",
+ value: function keys() {
+ return this._keys;
+ }
+ }, {
+ key: "toJSON",
+ value: function toJSON() {
+ return JSON.stringify(this._keys);
+ }
+ }]);
+
+ return KeyStore;
+ }();
+ function createKey(key) {
+ var path = null;
+ var id = null;
+ var src = null;
+ var weight = 1;
+ var getFn = null;
+
+ if (isString(key) || isArray(key)) {
+ src = key;
+ path = createKeyPath(key);
+ id = createKeyId(key);
+ } else {
+ if (!hasOwn.call(key, 'name')) {
+ throw new Error(MISSING_KEY_PROPERTY('name'));
+ }
+
+ var name = key.name;
+ src = name;
+
+ if (hasOwn.call(key, 'weight')) {
+ weight = key.weight;
+
+ if (weight <= 0) {
+ throw new Error(INVALID_KEY_WEIGHT_VALUE(name));
+ }
+ }
+
+ path = createKeyPath(name);
+ id = createKeyId(name);
+ getFn = key.getFn;
+ }
+
+ return {
+ path: path,
+ id: id,
+ weight: weight,
+ src: src,
+ getFn: getFn
+ };
+ }
+ function createKeyPath(key) {
+ return isArray(key) ? key : key.split('.');
+ }
+ function createKeyId(key) {
+ return isArray(key) ? key.join('.') : key;
+ }
+
+ function get(obj, path) {
+ var list = [];
+ var arr = false;
+
+ var deepGet = function deepGet(obj, path, index) {
+ if (!isDefined(obj)) {
+ return;
+ }
+
+ if (!path[index]) {
+ // If there's no path left, we've arrived at the object we care about.
+ list.push(obj);
+ } else {
+ var key = path[index];
+ var value = obj[key];
+
+ if (!isDefined(value)) {
+ return;
+ } // If we're at the last value in the path, and if it's a string/number/bool,
+ // add it to the list
+
+
+ if (index === path.length - 1 && (isString(value) || isNumber(value) || isBoolean(value))) {
+ list.push(toString(value));
+ } else if (isArray(value)) {
+ arr = true; // Search each item in the array.
+
+ for (var i = 0, len = value.length; i < len; i += 1) {
+ deepGet(value[i], path, index + 1);
+ }
+ } else if (path.length) {
+ // An object. Recurse further.
+ deepGet(value, path, index + 1);
+ }
+ }
+ }; // Backwards compatibility (since path used to be a string)
+
+
+ deepGet(obj, isString(path) ? path.split('.') : path, 0);
+ return arr ? list : list[0];
+ }
+
+ var MatchOptions = {
+ // Whether the matches should be included in the result set. When `true`, each record in the result
+ // set will include the indices of the matched characters.
+ // These can consequently be used for highlighting purposes.
+ includeMatches: false,
+ // When `true`, the matching function will continue to the end of a search pattern even if
+ // a perfect match has already been located in the string.
+ findAllMatches: false,
+ // Minimum number of characters that must be matched before a result is considered a match
+ minMatchCharLength: 1
+ };
+ var BasicOptions = {
+ // When `true`, the algorithm continues searching to the end of the input even if a perfect
+ // match is found before the end of the same input.
+ isCaseSensitive: false,
+ // When true, the matching function will continue to the end of a search pattern even if
+ includeScore: false,
+ // List of properties that will be searched. This also supports nested properties.
+ keys: [],
+ // Whether to sort the result list, by score
+ shouldSort: true,
+ // Default sort function: sort by ascending score, ascending index
+ sortFn: function sortFn(a, b) {
+ return a.score === b.score ? a.idx < b.idx ? -1 : 1 : a.score < b.score ? -1 : 1;
+ }
+ };
+ var FuzzyOptions = {
+ // Approximately where in the text is the pattern expected to be found?
+ location: 0,
+ // At what point does the match algorithm give up. A threshold of '0.0' requires a perfect match
+ // (of both letters and location), a threshold of '1.0' would match anything.
+ threshold: 0.6,
+ // Determines how close the match must be to the fuzzy location (specified above).
+ // An exact letter match which is 'distance' characters away from the fuzzy location
+ // would score as a complete mismatch. A distance of '0' requires the match be at
+ // the exact location specified, a threshold of '1000' would require a perfect match
+ // to be within 800 characters of the fuzzy location to be found using a 0.8 threshold.
+ distance: 100
+ };
+ var AdvancedOptions = {
+ // When `true`, it enables the use of unix-like search commands
+ useExtendedSearch: false,
+ // The get function to use when fetching an object's properties.
+ // The default will search nested paths *ie foo.bar.baz*
+ getFn: get,
+ // When `true`, search will ignore `location` and `distance`, so it won't matter
+ // where in the string the pattern appears.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#fuzziness-score
+ ignoreLocation: false,
+ // When `true`, the calculation for the relevance score (used for sorting) will
+ // ignore the field-length norm.
+ // More info: https://fusejs.io/concepts/scoring-theory.html#field-length-norm
+ ignoreFieldNorm: false,
+ // The weight to determine how much field length norm effects scoring.
+ fieldNormWeight: 1
+ };
+ var Config = _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, BasicOptions), MatchOptions), FuzzyOptions), AdvancedOptions);
+
+ var SPACE = /[^ ]+/g; // Field-length norm: the shorter the field, the higher the weight.
+ // Set to 3 decimals to reduce index size.
+
+ function norm() {
+ var weight = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
+ var mantissa = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
+ var cache = new Map();
+ var m = Math.pow(10, mantissa);
+ return {
+ get: function get(value) {
+ var numTokens = value.match(SPACE).length;
+
+ if (cache.has(numTokens)) {
+ return cache.get(numTokens);
+ } // Default function is 1/sqrt(x), weight makes that variable
+
+
+ var norm = 1 / Math.pow(numTokens, 0.5 * weight); // In place of `toFixed(mantissa)`, for faster computation
+
+ var n = parseFloat(Math.round(norm * m) / m);
+ cache.set(numTokens, n);
+ return n;
+ },
+ clear: function clear() {
+ cache.clear();
+ }
+ };
+ }
+
+ var FuseIndex = /*#__PURE__*/function () {
+ function FuseIndex() {
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
+ _ref$getFn = _ref.getFn,
+ getFn = _ref$getFn === void 0 ? Config.getFn : _ref$getFn,
+ _ref$fieldNormWeight = _ref.fieldNormWeight,
+ fieldNormWeight = _ref$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref$fieldNormWeight;
+
+ _classCallCheck(this, FuseIndex);
+
+ this.norm = norm(fieldNormWeight, 3);
+ this.getFn = getFn;
+ this.isCreated = false;
+ this.setIndexRecords();
+ }
+
+ _createClass(FuseIndex, [{
+ key: "setSources",
+ value: function setSources() {
+ var docs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.docs = docs;
+ }
+ }, {
+ key: "setIndexRecords",
+ value: function setIndexRecords() {
+ var records = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.records = records;
+ }
+ }, {
+ key: "setKeys",
+ value: function setKeys() {
+ var _this = this;
+
+ var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ this.keys = keys;
+ this._keysMap = {};
+ keys.forEach(function (key, idx) {
+ _this._keysMap[key.id] = idx;
+ });
+ }
+ }, {
+ key: "create",
+ value: function create() {
+ var _this2 = this;
+
+ if (this.isCreated || !this.docs.length) {
+ return;
+ }
+
+ this.isCreated = true; // List is Array<String>
+
+ if (isString(this.docs[0])) {
+ this.docs.forEach(function (doc, docIndex) {
+ _this2._addString(doc, docIndex);
+ });
+ } else {
+ // List is Array<Object>
+ this.docs.forEach(function (doc, docIndex) {
+ _this2._addObject(doc, docIndex);
+ });
+ }
+
+ this.norm.clear();
+ } // Adds a doc to the end of the index
+
+ }, {
+ key: "add",
+ value: function add(doc) {
+ var idx = this.size();
+
+ if (isString(doc)) {
+ this._addString(doc, idx);
+ } else {
+ this._addObject(doc, idx);
+ }
+ } // Removes the doc at the specified index of the index
+
+ }, {
+ key: "removeAt",
+ value: function removeAt(idx) {
+ this.records.splice(idx, 1); // Change ref index of every subsquent doc
+
+ for (var i = idx, len = this.size(); i < len; i += 1) {
+ this.records[i].i -= 1;
+ }
+ }
+ }, {
+ key: "getValueForItemAtKeyId",
+ value: function getValueForItemAtKeyId(item, keyId) {
+ return item[this._keysMap[keyId]];
+ }
+ }, {
+ key: "size",
+ value: function size() {
+ return this.records.length;
+ }
+ }, {
+ key: "_addString",
+ value: function _addString(doc, docIndex) {
+ if (!isDefined(doc) || isBlank(doc)) {
+ return;
+ }
+
+ var record = {
+ v: doc,
+ i: docIndex,
+ n: this.norm.get(doc)
+ };
+ this.records.push(record);
+ }
+ }, {
+ key: "_addObject",
+ value: function _addObject(doc, docIndex) {
+ var _this3 = this;
+
+ var record = {
+ i: docIndex,
+ $: {}
+ }; // Iterate over every key (i.e, path), and fetch the value at that key
+
+ this.keys.forEach(function (key, keyIndex) {
+ var value = key.getFn ? key.getFn(doc) : _this3.getFn(doc, key.path);
+
+ if (!isDefined(value)) {
+ return;
+ }
+
+ if (isArray(value)) {
+ (function () {
+ var subRecords = [];
+ var stack = [{
+ nestedArrIndex: -1,
+ value: value
+ }];
+
+ while (stack.length) {
+ var _stack$pop = stack.pop(),
+ nestedArrIndex = _stack$pop.nestedArrIndex,
+ _value = _stack$pop.value;
+
+ if (!isDefined(_value)) {
+ continue;
+ }
+
+ if (isString(_value) && !isBlank(_value)) {
+ var subRecord = {
+ v: _value,
+ i: nestedArrIndex,
+ n: _this3.norm.get(_value)
+ };
+ subRecords.push(subRecord);
+ } else if (isArray(_value)) {
+ _value.forEach(function (item, k) {
+ stack.push({
+ nestedArrIndex: k,
+ value: item
+ });
+ });
+ } else ;
+ }
+
+ record.$[keyIndex] = subRecords;
+ })();
+ } else if (isString(value) && !isBlank(value)) {
+ var subRecord = {
+ v: value,
+ n: _this3.norm.get(value)
+ };
+ record.$[keyIndex] = subRecord;
+ }
+ });
+ this.records.push(record);
+ }
+ }, {
+ key: "toJSON",
+ value: function toJSON() {
+ return {
+ keys: this.keys,
+ records: this.records
+ };
+ }
+ }]);
+
+ return FuseIndex;
+ }();
+ function createIndex(keys, docs) {
+ var _ref2 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref2$getFn = _ref2.getFn,
+ getFn = _ref2$getFn === void 0 ? Config.getFn : _ref2$getFn,
+ _ref2$fieldNormWeight = _ref2.fieldNormWeight,
+ fieldNormWeight = _ref2$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref2$fieldNormWeight;
+
+ var myIndex = new FuseIndex({
+ getFn: getFn,
+ fieldNormWeight: fieldNormWeight
+ });
+ myIndex.setKeys(keys.map(createKey));
+ myIndex.setSources(docs);
+ myIndex.create();
+ return myIndex;
+ }
+ function parseIndex(data) {
+ var _ref3 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref3$getFn = _ref3.getFn,
+ getFn = _ref3$getFn === void 0 ? Config.getFn : _ref3$getFn,
+ _ref3$fieldNormWeight = _ref3.fieldNormWeight,
+ fieldNormWeight = _ref3$fieldNormWeight === void 0 ? Config.fieldNormWeight : _ref3$fieldNormWeight;
+
+ var keys = data.keys,
+ records = data.records;
+ var myIndex = new FuseIndex({
+ getFn: getFn,
+ fieldNormWeight: fieldNormWeight
+ });
+ myIndex.setKeys(keys);
+ myIndex.setIndexRecords(records);
+ return myIndex;
+ }
+
+ function computeScore$1(pattern) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$errors = _ref.errors,
+ errors = _ref$errors === void 0 ? 0 : _ref$errors,
+ _ref$currentLocation = _ref.currentLocation,
+ currentLocation = _ref$currentLocation === void 0 ? 0 : _ref$currentLocation,
+ _ref$expectedLocation = _ref.expectedLocation,
+ expectedLocation = _ref$expectedLocation === void 0 ? 0 : _ref$expectedLocation,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ var accuracy = errors / pattern.length;
+
+ if (ignoreLocation) {
+ return accuracy;
+ }
+
+ var proximity = Math.abs(expectedLocation - currentLocation);
+
+ if (!distance) {
+ // Dodge divide by zero error.
+ return proximity ? 1.0 : accuracy;
+ }
+
+ return accuracy + proximity / distance;
+ }
+
+ function convertMaskToIndices() {
+ var matchmask = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
+ var minMatchCharLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Config.minMatchCharLength;
+ var indices = [];
+ var start = -1;
+ var end = -1;
+ var i = 0;
+
+ for (var len = matchmask.length; i < len; i += 1) {
+ var match = matchmask[i];
+
+ if (match && start === -1) {
+ start = i;
+ } else if (!match && start !== -1) {
+ end = i - 1;
+
+ if (end - start + 1 >= minMatchCharLength) {
+ indices.push([start, end]);
+ }
+
+ start = -1;
+ }
+ } // (i-1 - start) + 1 => i - start
+
+
+ if (matchmask[i - 1] && i - start >= minMatchCharLength) {
+ indices.push([start, i - 1]);
+ }
+
+ return indices;
+ }
+
+ // Machine word size
+ var MAX_BITS = 32;
+
+ function search(text, pattern, patternAlphabet) {
+ var _ref = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {},
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ if (pattern.length > MAX_BITS) {
+ throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));
+ }
+
+ var patternLen = pattern.length; // Set starting location at beginning text and initialize the alphabet.
+
+ var textLen = text.length; // Handle the case when location > text.length
+
+ var expectedLocation = Math.max(0, Math.min(location, textLen)); // Highest score beyond which we give up.
+
+ var currentThreshold = threshold; // Is there a nearby exact match? (speedup)
+
+ var bestLocation = expectedLocation; // Performance: only computer matches when the minMatchCharLength > 1
+ // OR if `includeMatches` is true.
+
+ var computeMatches = minMatchCharLength > 1 || includeMatches; // A mask of the matches, used for building the indices
+
+ var matchMask = computeMatches ? Array(textLen) : [];
+ var index; // Get all exact matches, here for speed up
+
+ while ((index = text.indexOf(pattern, bestLocation)) > -1) {
+ var score = computeScore$1(pattern, {
+ currentLocation: index,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+ currentThreshold = Math.min(score, currentThreshold);
+ bestLocation = index + patternLen;
+
+ if (computeMatches) {
+ var i = 0;
+
+ while (i < patternLen) {
+ matchMask[index + i] = 1;
+ i += 1;
+ }
+ }
+ } // Reset the best location
+
+
+ bestLocation = -1;
+ var lastBitArr = [];
+ var finalScore = 1;
+ var binMax = patternLen + textLen;
+ var mask = 1 << patternLen - 1;
+
+ for (var _i = 0; _i < patternLen; _i += 1) {
+ // Scan for the best match; each iteration allows for one more error.
+ // Run a binary search to determine how far from the match location we can stray
+ // at this error level.
+ var binMin = 0;
+ var binMid = binMax;
+
+ while (binMin < binMid) {
+ var _score2 = computeScore$1(pattern, {
+ errors: _i,
+ currentLocation: expectedLocation + binMid,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+
+ if (_score2 <= currentThreshold) {
+ binMin = binMid;
+ } else {
+ binMax = binMid;
+ }
+
+ binMid = Math.floor((binMax - binMin) / 2 + binMin);
+ } // Use the result from this iteration as the maximum for the next.
+
+
+ binMax = binMid;
+ var start = Math.max(1, expectedLocation - binMid + 1);
+ var finish = findAllMatches ? textLen : Math.min(expectedLocation + binMid, textLen) + patternLen; // Initialize the bit array
+
+ var bitArr = Array(finish + 2);
+ bitArr[finish + 1] = (1 << _i) - 1;
+
+ for (var j = finish; j >= start; j -= 1) {
+ var currentLocation = j - 1;
+ var charMatch = patternAlphabet[text.charAt(currentLocation)];
+
+ if (computeMatches) {
+ // Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`)
+ matchMask[currentLocation] = +!!charMatch;
+ } // First pass: exact match
+
+
+ bitArr[j] = (bitArr[j + 1] << 1 | 1) & charMatch; // Subsequent passes: fuzzy match
+
+ if (_i) {
+ bitArr[j] |= (lastBitArr[j + 1] | lastBitArr[j]) << 1 | 1 | lastBitArr[j + 1];
+ }
+
+ if (bitArr[j] & mask) {
+ finalScore = computeScore$1(pattern, {
+ errors: _i,
+ currentLocation: currentLocation,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ }); // This match will almost certainly be better than any existing match.
+ // But check anyway.
+
+ if (finalScore <= currentThreshold) {
+ // Indeed it is
+ currentThreshold = finalScore;
+ bestLocation = currentLocation; // Already passed `loc`, downhill from here on in.
+
+ if (bestLocation <= expectedLocation) {
+ break;
+ } // When passing `bestLocation`, don't exceed our current distance from `expectedLocation`.
+
+
+ start = Math.max(1, 2 * expectedLocation - bestLocation);
+ }
+ }
+ } // No hope for a (better) match at greater error levels.
+
+
+ var _score = computeScore$1(pattern, {
+ errors: _i + 1,
+ currentLocation: expectedLocation,
+ expectedLocation: expectedLocation,
+ distance: distance,
+ ignoreLocation: ignoreLocation
+ });
+
+ if (_score > currentThreshold) {
+ break;
+ }
+
+ lastBitArr = bitArr;
+ }
+
+ var result = {
+ isMatch: bestLocation >= 0,
+ // Count exact matches (those with a score of 0) to be "almost" exact
+ score: Math.max(0.001, finalScore)
+ };
+
+ if (computeMatches) {
+ var indices = convertMaskToIndices(matchMask, minMatchCharLength);
+
+ if (!indices.length) {
+ result.isMatch = false;
+ } else if (includeMatches) {
+ result.indices = indices;
+ }
+ }
+
+ return result;
+ }
+
+ function createPatternAlphabet(pattern) {
+ var mask = {};
+
+ for (var i = 0, len = pattern.length; i < len; i += 1) {
+ var _char = pattern.charAt(i);
+
+ mask[_char] = (mask[_char] || 0) | 1 << len - i - 1;
+ }
+
+ return mask;
+ }
+
+ var BitapSearch = /*#__PURE__*/function () {
+ function BitapSearch(pattern) {
+ var _this = this;
+
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$isCaseSensitive = _ref.isCaseSensitive,
+ isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ _classCallCheck(this, BitapSearch);
+
+ this.options = {
+ location: location,
+ threshold: threshold,
+ distance: distance,
+ includeMatches: includeMatches,
+ findAllMatches: findAllMatches,
+ minMatchCharLength: minMatchCharLength,
+ isCaseSensitive: isCaseSensitive,
+ ignoreLocation: ignoreLocation
+ };
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+ this.chunks = [];
+
+ if (!this.pattern.length) {
+ return;
+ }
+
+ var addChunk = function addChunk(pattern, startIndex) {
+ _this.chunks.push({
+ pattern: pattern,
+ alphabet: createPatternAlphabet(pattern),
+ startIndex: startIndex
+ });
+ };
+
+ var len = this.pattern.length;
+
+ if (len > MAX_BITS) {
+ var i = 0;
+ var remainder = len % MAX_BITS;
+ var end = len - remainder;
+
+ while (i < end) {
+ addChunk(this.pattern.substr(i, MAX_BITS), i);
+ i += MAX_BITS;
+ }
+
+ if (remainder) {
+ var startIndex = len - MAX_BITS;
+ addChunk(this.pattern.substr(startIndex), startIndex);
+ }
+ } else {
+ addChunk(this.pattern, 0);
+ }
+ }
+
+ _createClass(BitapSearch, [{
+ key: "searchIn",
+ value: function searchIn(text) {
+ var _this$options = this.options,
+ isCaseSensitive = _this$options.isCaseSensitive,
+ includeMatches = _this$options.includeMatches;
+
+ if (!isCaseSensitive) {
+ text = text.toLowerCase();
+ } // Exact match
+
+
+ if (this.pattern === text) {
+ var _result = {
+ isMatch: true,
+ score: 0
+ };
+
+ if (includeMatches) {
+ _result.indices = [[0, text.length - 1]];
+ }
+
+ return _result;
+ } // Otherwise, use Bitap algorithm
+
+
+ var _this$options2 = this.options,
+ location = _this$options2.location,
+ distance = _this$options2.distance,
+ threshold = _this$options2.threshold,
+ findAllMatches = _this$options2.findAllMatches,
+ minMatchCharLength = _this$options2.minMatchCharLength,
+ ignoreLocation = _this$options2.ignoreLocation;
+ var allIndices = [];
+ var totalScore = 0;
+ var hasMatches = false;
+ this.chunks.forEach(function (_ref2) {
+ var pattern = _ref2.pattern,
+ alphabet = _ref2.alphabet,
+ startIndex = _ref2.startIndex;
+
+ var _search = search(text, pattern, alphabet, {
+ location: location + startIndex,
+ distance: distance,
+ threshold: threshold,
+ findAllMatches: findAllMatches,
+ minMatchCharLength: minMatchCharLength,
+ includeMatches: includeMatches,
+ ignoreLocation: ignoreLocation
+ }),
+ isMatch = _search.isMatch,
+ score = _search.score,
+ indices = _search.indices;
+
+ if (isMatch) {
+ hasMatches = true;
+ }
+
+ totalScore += score;
+
+ if (isMatch && indices) {
+ allIndices = [].concat(_toConsumableArray(allIndices), _toConsumableArray(indices));
+ }
+ });
+ var result = {
+ isMatch: hasMatches,
+ score: hasMatches ? totalScore / this.chunks.length : 1
+ };
+
+ if (hasMatches && includeMatches) {
+ result.indices = allIndices;
+ }
+
+ return result;
+ }
+ }]);
+
+ return BitapSearch;
+ }();
+
+ var BaseMatch = /*#__PURE__*/function () {
+ function BaseMatch(pattern) {
+ _classCallCheck(this, BaseMatch);
+
+ this.pattern = pattern;
+ }
+
+ _createClass(BaseMatch, [{
+ key: "search",
+ value: function
+ /*text*/
+ search() {}
+ }], [{
+ key: "isMultiMatch",
+ value: function isMultiMatch(pattern) {
+ return getMatch(pattern, this.multiRegex);
+ }
+ }, {
+ key: "isSingleMatch",
+ value: function isSingleMatch(pattern) {
+ return getMatch(pattern, this.singleRegex);
+ }
+ }]);
+
+ return BaseMatch;
+ }();
+
+ function getMatch(pattern, exp) {
+ var matches = pattern.match(exp);
+ return matches ? matches[1] : null;
+ }
+
+ var ExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(ExactMatch, _BaseMatch);
+
+ var _super = _createSuper(ExactMatch);
+
+ function ExactMatch(pattern) {
+ _classCallCheck(this, ExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(ExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var isMatch = text === this.pattern;
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, this.pattern.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^="(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^=(.*)$/;
+ }
+ }]);
+
+ return ExactMatch;
+ }(BaseMatch);
+
+ var InverseExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(InverseExactMatch, _BaseMatch);
+
+ var _super = _createSuper(InverseExactMatch);
+
+ function InverseExactMatch(pattern) {
+ _classCallCheck(this, InverseExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(InverseExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var index = text.indexOf(this.pattern);
+ var isMatch = index === -1;
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'inverse-exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^!"(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^!(.*)$/;
+ }
+ }]);
+
+ return InverseExactMatch;
+ }(BaseMatch);
+
+ var PrefixExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(PrefixExactMatch, _BaseMatch);
+
+ var _super = _createSuper(PrefixExactMatch);
+
+ function PrefixExactMatch(pattern) {
+ _classCallCheck(this, PrefixExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(PrefixExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var isMatch = text.startsWith(this.pattern);
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, this.pattern.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'prefix-exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^\^"(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^\^(.*)$/;
+ }
+ }]);
+
+ return PrefixExactMatch;
+ }(BaseMatch);
+
+ var InversePrefixExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(InversePrefixExactMatch, _BaseMatch);
+
+ var _super = _createSuper(InversePrefixExactMatch);
+
+ function InversePrefixExactMatch(pattern) {
+ _classCallCheck(this, InversePrefixExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(InversePrefixExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var isMatch = !text.startsWith(this.pattern);
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'inverse-prefix-exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^!\^"(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^!\^(.*)$/;
+ }
+ }]);
+
+ return InversePrefixExactMatch;
+ }(BaseMatch);
+
+ var SuffixExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(SuffixExactMatch, _BaseMatch);
+
+ var _super = _createSuper(SuffixExactMatch);
+
+ function SuffixExactMatch(pattern) {
+ _classCallCheck(this, SuffixExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(SuffixExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var isMatch = text.endsWith(this.pattern);
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [text.length - this.pattern.length, text.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'suffix-exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^"(.*)"\$$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^(.*)\$$/;
+ }
+ }]);
+
+ return SuffixExactMatch;
+ }(BaseMatch);
+
+ var InverseSuffixExactMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(InverseSuffixExactMatch, _BaseMatch);
+
+ var _super = _createSuper(InverseSuffixExactMatch);
+
+ function InverseSuffixExactMatch(pattern) {
+ _classCallCheck(this, InverseSuffixExactMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(InverseSuffixExactMatch, [{
+ key: "search",
+ value: function search(text) {
+ var isMatch = !text.endsWith(this.pattern);
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: [0, text.length - 1]
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'inverse-suffix-exact';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^!"(.*)"\$$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^!(.*)\$$/;
+ }
+ }]);
+
+ return InverseSuffixExactMatch;
+ }(BaseMatch);
+
+ var FuzzyMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(FuzzyMatch, _BaseMatch);
+
+ var _super = _createSuper(FuzzyMatch);
+
+ function FuzzyMatch(pattern) {
+ var _this;
+
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$isCaseSensitive = _ref.isCaseSensitive,
+ isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation;
+
+ _classCallCheck(this, FuzzyMatch);
+
+ _this = _super.call(this, pattern);
+ _this._bitapSearch = new BitapSearch(pattern, {
+ location: location,
+ threshold: threshold,
+ distance: distance,
+ includeMatches: includeMatches,
+ findAllMatches: findAllMatches,
+ minMatchCharLength: minMatchCharLength,
+ isCaseSensitive: isCaseSensitive,
+ ignoreLocation: ignoreLocation
+ });
+ return _this;
+ }
+
+ _createClass(FuzzyMatch, [{
+ key: "search",
+ value: function search(text) {
+ return this._bitapSearch.searchIn(text);
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'fuzzy';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^"(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^(.*)$/;
+ }
+ }]);
+
+ return FuzzyMatch;
+ }(BaseMatch);
+
+ var IncludeMatch = /*#__PURE__*/function (_BaseMatch) {
+ _inherits(IncludeMatch, _BaseMatch);
+
+ var _super = _createSuper(IncludeMatch);
+
+ function IncludeMatch(pattern) {
+ _classCallCheck(this, IncludeMatch);
+
+ return _super.call(this, pattern);
+ }
+
+ _createClass(IncludeMatch, [{
+ key: "search",
+ value: function search(text) {
+ var location = 0;
+ var index;
+ var indices = [];
+ var patternLen = this.pattern.length; // Get all exact matches
+
+ while ((index = text.indexOf(this.pattern, location)) > -1) {
+ location = index + patternLen;
+ indices.push([index, location - 1]);
+ }
+
+ var isMatch = !!indices.length;
+ return {
+ isMatch: isMatch,
+ score: isMatch ? 0 : 1,
+ indices: indices
+ };
+ }
+ }], [{
+ key: "type",
+ get: function get() {
+ return 'include';
+ }
+ }, {
+ key: "multiRegex",
+ get: function get() {
+ return /^'"(.*)"$/;
+ }
+ }, {
+ key: "singleRegex",
+ get: function get() {
+ return /^'(.*)$/;
+ }
+ }]);
+
+ return IncludeMatch;
+ }(BaseMatch);
+
+ var searchers = [ExactMatch, IncludeMatch, PrefixExactMatch, InversePrefixExactMatch, InverseSuffixExactMatch, SuffixExactMatch, InverseExactMatch, FuzzyMatch];
+ var searchersLen = searchers.length; // Regex to split by spaces, but keep anything in quotes together
+
+ var SPACE_RE = / +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;
+ var OR_TOKEN = '|'; // Return a 2D array representation of the query, for simpler parsing.
+ // Example:
+ // "^core go$ | rb$ | py$ xy$" => [["^core", "go$"], ["rb$"], ["py$", "xy$"]]
+
+ function parseQuery(pattern) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ return pattern.split(OR_TOKEN).map(function (item) {
+ var query = item.trim().split(SPACE_RE).filter(function (item) {
+ return item && !!item.trim();
+ });
+ var results = [];
+
+ for (var i = 0, len = query.length; i < len; i += 1) {
+ var queryItem = query[i]; // 1. Handle multiple query match (i.e, once that are quoted, like `"hello world"`)
+
+ var found = false;
+ var idx = -1;
+
+ while (!found && ++idx < searchersLen) {
+ var searcher = searchers[idx];
+ var token = searcher.isMultiMatch(queryItem);
+
+ if (token) {
+ results.push(new searcher(token, options));
+ found = true;
+ }
+ }
+
+ if (found) {
+ continue;
+ } // 2. Handle single query matches (i.e, once that are *not* quoted)
+
+
+ idx = -1;
+
+ while (++idx < searchersLen) {
+ var _searcher = searchers[idx];
+
+ var _token = _searcher.isSingleMatch(queryItem);
+
+ if (_token) {
+ results.push(new _searcher(_token, options));
+ break;
+ }
+ }
+ }
+
+ return results;
+ });
+ }
+
+ // to a singl match
+
+ var MultiMatchSet = new Set([FuzzyMatch.type, IncludeMatch.type]);
+ /**
+ * Command-like searching
+ * ======================
+ *
+ * Given multiple search terms delimited by spaces.e.g. `^jscript .python$ ruby !java`,
+ * search in a given text.
+ *
+ * Search syntax:
+ *
+ * | Token | Match type | Description |
+ * | ----------- | -------------------------- | -------------------------------------- |
+ * | `jscript` | fuzzy-match | Items that fuzzy match `jscript` |
+ * | `=scheme` | exact-match | Items that are `scheme` |
+ * | `'python` | include-match | Items that include `python` |
+ * | `!ruby` | inverse-exact-match | Items that do not include `ruby` |
+ * | `^java` | prefix-exact-match | Items that start with `java` |
+ * | `!^earlang` | inverse-prefix-exact-match | Items that do not start with `earlang` |
+ * | `.js$` | suffix-exact-match | Items that end with `.js` |
+ * | `!.go$` | inverse-suffix-exact-match | Items that do not end with `.go` |
+ *
+ * A single pipe character acts as an OR operator. For example, the following
+ * query matches entries that start with `core` and end with either`go`, `rb`,
+ * or`py`.
+ *
+ * ```
+ * ^core go$ | rb$ | py$
+ * ```
+ */
+
+ var ExtendedSearch = /*#__PURE__*/function () {
+ function ExtendedSearch(pattern) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$isCaseSensitive = _ref.isCaseSensitive,
+ isCaseSensitive = _ref$isCaseSensitive === void 0 ? Config.isCaseSensitive : _ref$isCaseSensitive,
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$minMatchCharLeng = _ref.minMatchCharLength,
+ minMatchCharLength = _ref$minMatchCharLeng === void 0 ? Config.minMatchCharLength : _ref$minMatchCharLeng,
+ _ref$ignoreLocation = _ref.ignoreLocation,
+ ignoreLocation = _ref$ignoreLocation === void 0 ? Config.ignoreLocation : _ref$ignoreLocation,
+ _ref$findAllMatches = _ref.findAllMatches,
+ findAllMatches = _ref$findAllMatches === void 0 ? Config.findAllMatches : _ref$findAllMatches,
+ _ref$location = _ref.location,
+ location = _ref$location === void 0 ? Config.location : _ref$location,
+ _ref$threshold = _ref.threshold,
+ threshold = _ref$threshold === void 0 ? Config.threshold : _ref$threshold,
+ _ref$distance = _ref.distance,
+ distance = _ref$distance === void 0 ? Config.distance : _ref$distance;
+
+ _classCallCheck(this, ExtendedSearch);
+
+ this.query = null;
+ this.options = {
+ isCaseSensitive: isCaseSensitive,
+ includeMatches: includeMatches,
+ minMatchCharLength: minMatchCharLength,
+ findAllMatches: findAllMatches,
+ ignoreLocation: ignoreLocation,
+ location: location,
+ threshold: threshold,
+ distance: distance
+ };
+ this.pattern = isCaseSensitive ? pattern : pattern.toLowerCase();
+ this.query = parseQuery(this.pattern, this.options);
+ }
+
+ _createClass(ExtendedSearch, [{
+ key: "searchIn",
+ value: function searchIn(text) {
+ var query = this.query;
+
+ if (!query) {
+ return {
+ isMatch: false,
+ score: 1
+ };
+ }
+
+ var _this$options = this.options,
+ includeMatches = _this$options.includeMatches,
+ isCaseSensitive = _this$options.isCaseSensitive;
+ text = isCaseSensitive ? text : text.toLowerCase();
+ var numMatches = 0;
+ var allIndices = [];
+ var totalScore = 0; // ORs
+
+ for (var i = 0, qLen = query.length; i < qLen; i += 1) {
+ var searchers = query[i]; // Reset indices
+
+ allIndices.length = 0;
+ numMatches = 0; // ANDs
+
+ for (var j = 0, pLen = searchers.length; j < pLen; j += 1) {
+ var searcher = searchers[j];
+
+ var _searcher$search = searcher.search(text),
+ isMatch = _searcher$search.isMatch,
+ indices = _searcher$search.indices,
+ score = _searcher$search.score;
+
+ if (isMatch) {
+ numMatches += 1;
+ totalScore += score;
+
+ if (includeMatches) {
+ var type = searcher.constructor.type;
+
+ if (MultiMatchSet.has(type)) {
+ allIndices = [].concat(_toConsumableArray(allIndices), _toConsumableArray(indices));
+ } else {
+ allIndices.push(indices);
+ }
+ }
+ } else {
+ totalScore = 0;
+ numMatches = 0;
+ allIndices.length = 0;
+ break;
+ }
+ } // OR condition, so if TRUE, return
+
+
+ if (numMatches) {
+ var result = {
+ isMatch: true,
+ score: totalScore / numMatches
+ };
+
+ if (includeMatches) {
+ result.indices = allIndices;
+ }
+
+ return result;
+ }
+ } // Nothing was matched
+
+
+ return {
+ isMatch: false,
+ score: 1
+ };
+ }
+ }], [{
+ key: "condition",
+ value: function condition(_, options) {
+ return options.useExtendedSearch;
+ }
+ }]);
+
+ return ExtendedSearch;
+ }();
+
+ var registeredSearchers = [];
+ function register() {
+ registeredSearchers.push.apply(registeredSearchers, arguments);
+ }
+ function createSearcher(pattern, options) {
+ for (var i = 0, len = registeredSearchers.length; i < len; i += 1) {
+ var searcherClass = registeredSearchers[i];
+
+ if (searcherClass.condition(pattern, options)) {
+ return new searcherClass(pattern, options);
+ }
+ }
+
+ return new BitapSearch(pattern, options);
+ }
+
+ var LogicalOperator = {
+ AND: '$and',
+ OR: '$or'
+ };
+ var KeyType = {
+ PATH: '$path',
+ PATTERN: '$val'
+ };
+
+ var isExpression = function isExpression(query) {
+ return !!(query[LogicalOperator.AND] || query[LogicalOperator.OR]);
+ };
+
+ var isPath = function isPath(query) {
+ return !!query[KeyType.PATH];
+ };
+
+ var isLeaf = function isLeaf(query) {
+ return !isArray(query) && isObject(query) && !isExpression(query);
+ };
+
+ var convertToExplicit = function convertToExplicit(query) {
+ return _defineProperty({}, LogicalOperator.AND, Object.keys(query).map(function (key) {
+ return _defineProperty({}, key, query[key]);
+ }));
+ }; // When `auto` is `true`, the parse function will infer and initialize and add
+ // the appropriate `Searcher` instance
+
+
+ function parse(query, options) {
+ var _ref3 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref3$auto = _ref3.auto,
+ auto = _ref3$auto === void 0 ? true : _ref3$auto;
+
+ var next = function next(query) {
+ var keys = Object.keys(query);
+ var isQueryPath = isPath(query);
+
+ if (!isQueryPath && keys.length > 1 && !isExpression(query)) {
+ return next(convertToExplicit(query));
+ }
+
+ if (isLeaf(query)) {
+ var key = isQueryPath ? query[KeyType.PATH] : keys[0];
+ var pattern = isQueryPath ? query[KeyType.PATTERN] : query[key];
+
+ if (!isString(pattern)) {
+ throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));
+ }
+
+ var obj = {
+ keyId: createKeyId(key),
+ pattern: pattern
+ };
+
+ if (auto) {
+ obj.searcher = createSearcher(pattern, options);
+ }
+
+ return obj;
+ }
+
+ var node = {
+ children: [],
+ operator: keys[0]
+ };
+ keys.forEach(function (key) {
+ var value = query[key];
+
+ if (isArray(value)) {
+ value.forEach(function (item) {
+ node.children.push(next(item));
+ });
+ }
+ });
+ return node;
+ };
+
+ if (!isExpression(query)) {
+ query = convertToExplicit(query);
+ }
+
+ return next(query);
+ }
+
+ function computeScore(results, _ref) {
+ var _ref$ignoreFieldNorm = _ref.ignoreFieldNorm,
+ ignoreFieldNorm = _ref$ignoreFieldNorm === void 0 ? Config.ignoreFieldNorm : _ref$ignoreFieldNorm;
+ results.forEach(function (result) {
+ var totalScore = 1;
+ result.matches.forEach(function (_ref2) {
+ var key = _ref2.key,
+ norm = _ref2.norm,
+ score = _ref2.score;
+ var weight = key ? key.weight : null;
+ totalScore *= Math.pow(score === 0 && weight ? Number.EPSILON : score, (weight || 1) * (ignoreFieldNorm ? 1 : norm));
+ });
+ result.score = totalScore;
+ });
+ }
+
+ function transformMatches(result, data) {
+ var matches = result.matches;
+ data.matches = [];
+
+ if (!isDefined(matches)) {
+ return;
+ }
+
+ matches.forEach(function (match) {
+ if (!isDefined(match.indices) || !match.indices.length) {
+ return;
+ }
+
+ var indices = match.indices,
+ value = match.value;
+ var obj = {
+ indices: indices,
+ value: value
+ };
+
+ if (match.key) {
+ obj.key = match.key.src;
+ }
+
+ if (match.idx > -1) {
+ obj.refIndex = match.idx;
+ }
+
+ data.matches.push(obj);
+ });
+ }
+
+ function transformScore(result, data) {
+ data.score = result.score;
+ }
+
+ function format(results, docs) {
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
+ _ref$includeMatches = _ref.includeMatches,
+ includeMatches = _ref$includeMatches === void 0 ? Config.includeMatches : _ref$includeMatches,
+ _ref$includeScore = _ref.includeScore,
+ includeScore = _ref$includeScore === void 0 ? Config.includeScore : _ref$includeScore;
+
+ var transformers = [];
+ if (includeMatches) transformers.push(transformMatches);
+ if (includeScore) transformers.push(transformScore);
+ return results.map(function (result) {
+ var idx = result.idx;
+ var data = {
+ item: docs[idx],
+ refIndex: idx
+ };
+
+ if (transformers.length) {
+ transformers.forEach(function (transformer) {
+ transformer(result, data);
+ });
+ }
+
+ return data;
+ });
+ }
+
+ var Fuse$1 = /*#__PURE__*/function () {
+ function Fuse(docs) {
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+ var index = arguments.length > 2 ? arguments[2] : undefined;
+
+ _classCallCheck(this, Fuse);
+
+ this.options = _objectSpread2(_objectSpread2({}, Config), options);
+
+ if (this.options.useExtendedSearch && !true) {
+ throw new Error(EXTENDED_SEARCH_UNAVAILABLE);
+ }
+
+ this._keyStore = new KeyStore(this.options.keys);
+ this.setCollection(docs, index);
+ }
+
+ _createClass(Fuse, [{
+ key: "setCollection",
+ value: function setCollection(docs, index) {
+ this._docs = docs;
+
+ if (index && !(index instanceof FuseIndex)) {
+ throw new Error(INCORRECT_INDEX_TYPE);
+ }
+
+ this._myIndex = index || createIndex(this.options.keys, this._docs, {
+ getFn: this.options.getFn,
+ fieldNormWeight: this.options.fieldNormWeight
+ });
+ }
+ }, {
+ key: "add",
+ value: function add(doc) {
+ if (!isDefined(doc)) {
+ return;
+ }
+
+ this._docs.push(doc);
+
+ this._myIndex.add(doc);
+ }
+ }, {
+ key: "remove",
+ value: function remove() {
+ var predicate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function
+ /* doc, idx */
+ () {
+ return false;
+ };
+ var results = [];
+
+ for (var i = 0, len = this._docs.length; i < len; i += 1) {
+ var doc = this._docs[i];
+
+ if (predicate(doc, i)) {
+ this.removeAt(i);
+ i -= 1;
+ len -= 1;
+ results.push(doc);
+ }
+ }
+
+ return results;
+ }
+ }, {
+ key: "removeAt",
+ value: function removeAt(idx) {
+ this._docs.splice(idx, 1);
+
+ this._myIndex.removeAt(idx);
+ }
+ }, {
+ key: "getIndex",
+ value: function getIndex() {
+ return this._myIndex;
+ }
+ }, {
+ key: "search",
+ value: function search(query) {
+ var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
+ _ref$limit = _ref.limit,
+ limit = _ref$limit === void 0 ? -1 : _ref$limit;
+
+ var _this$options = this.options,
+ includeMatches = _this$options.includeMatches,
+ includeScore = _this$options.includeScore,
+ shouldSort = _this$options.shouldSort,
+ sortFn = _this$options.sortFn,
+ ignoreFieldNorm = _this$options.ignoreFieldNorm;
+ var results = isString(query) ? isString(this._docs[0]) ? this._searchStringList(query) : this._searchObjectList(query) : this._searchLogical(query);
+ computeScore(results, {
+ ignoreFieldNorm: ignoreFieldNorm
+ });
+
+ if (shouldSort) {
+ results.sort(sortFn);
+ }
+
+ if (isNumber(limit) && limit > -1) {
+ results = results.slice(0, limit);
+ }
+
+ return format(results, this._docs, {
+ includeMatches: includeMatches,
+ includeScore: includeScore
+ });
+ }
+ }, {
+ key: "_searchStringList",
+ value: function _searchStringList(query) {
+ var searcher = createSearcher(query, this.options);
+ var records = this._myIndex.records;
+ var results = []; // Iterate over every string in the index
+
+ records.forEach(function (_ref2) {
+ var text = _ref2.v,
+ idx = _ref2.i,
+ norm = _ref2.n;
+
+ if (!isDefined(text)) {
+ return;
+ }
+
+ var _searcher$searchIn = searcher.searchIn(text),
+ isMatch = _searcher$searchIn.isMatch,
+ score = _searcher$searchIn.score,
+ indices = _searcher$searchIn.indices;
+
+ if (isMatch) {
+ results.push({
+ item: text,
+ idx: idx,
+ matches: [{
+ score: score,
+ value: text,
+ norm: norm,
+ indices: indices
+ }]
+ });
+ }
+ });
+ return results;
+ }
+ }, {
+ key: "_searchLogical",
+ value: function _searchLogical(query) {
+ var _this = this;
+
+ var expression = parse(query, this.options);
+
+ var evaluate = function evaluate(node, item, idx) {
+ if (!node.children) {
+ var keyId = node.keyId,
+ searcher = node.searcher;
+
+ var matches = _this._findMatches({
+ key: _this._keyStore.get(keyId),
+ value: _this._myIndex.getValueForItemAtKeyId(item, keyId),
+ searcher: searcher
+ });
+
+ if (matches && matches.length) {
+ return [{
+ idx: idx,
+ item: item,
+ matches: matches
+ }];
+ }
+
+ return [];
+ }
+
+ var res = [];
+
+ for (var i = 0, len = node.children.length; i < len; i += 1) {
+ var child = node.children[i];
+ var result = evaluate(child, item, idx);
+
+ if (result.length) {
+ res.push.apply(res, _toConsumableArray(result));
+ } else if (node.operator === LogicalOperator.AND) {
+ return [];
+ }
+ }
+
+ return res;
+ };
+
+ var records = this._myIndex.records;
+ var resultMap = {};
+ var results = [];
+ records.forEach(function (_ref3) {
+ var item = _ref3.$,
+ idx = _ref3.i;
+
+ if (isDefined(item)) {
+ var expResults = evaluate(expression, item, idx);
+
+ if (expResults.length) {
+ // Dedupe when adding
+ if (!resultMap[idx]) {
+ resultMap[idx] = {
+ idx: idx,
+ item: item,
+ matches: []
+ };
+ results.push(resultMap[idx]);
+ }
+
+ expResults.forEach(function (_ref4) {
+ var _resultMap$idx$matche;
+
+ var matches = _ref4.matches;
+
+ (_resultMap$idx$matche = resultMap[idx].matches).push.apply(_resultMap$idx$matche, _toConsumableArray(matches));
+ });
+ }
+ }
+ });
+ return results;
+ }
+ }, {
+ key: "_searchObjectList",
+ value: function _searchObjectList(query) {
+ var _this2 = this;
+
+ var searcher = createSearcher(query, this.options);
+ var _this$_myIndex = this._myIndex,
+ keys = _this$_myIndex.keys,
+ records = _this$_myIndex.records;
+ var results = []; // List is Array<Object>
+
+ records.forEach(function (_ref5) {
+ var item = _ref5.$,
+ idx = _ref5.i;
+
+ if (!isDefined(item)) {
+ return;
+ }
+
+ var matches = []; // Iterate over every key (i.e, path), and fetch the value at that key
+
+ keys.forEach(function (key, keyIndex) {
+ matches.push.apply(matches, _toConsumableArray(_this2._findMatches({
+ key: key,
+ value: item[keyIndex],
+ searcher: searcher
+ })));
+ });
+
+ if (matches.length) {
+ results.push({
+ idx: idx,
+ item: item,
+ matches: matches
+ });
+ }
+ });
+ return results;
+ }
+ }, {
+ key: "_findMatches",
+ value: function _findMatches(_ref6) {
+ var key = _ref6.key,
+ value = _ref6.value,
+ searcher = _ref6.searcher;
+
+ if (!isDefined(value)) {
+ return [];
+ }
+
+ var matches = [];
+
+ if (isArray(value)) {
+ value.forEach(function (_ref7) {
+ var text = _ref7.v,
+ idx = _ref7.i,
+ norm = _ref7.n;
+
+ if (!isDefined(text)) {
+ return;
+ }
+
+ var _searcher$searchIn2 = searcher.searchIn(text),
+ isMatch = _searcher$searchIn2.isMatch,
+ score = _searcher$searchIn2.score,
+ indices = _searcher$searchIn2.indices;
+
+ if (isMatch) {
+ matches.push({
+ score: score,
+ key: key,
+ value: text,
+ idx: idx,
+ norm: norm,
+ indices: indices
+ });
+ }
+ });
+ } else {
+ var text = value.v,
+ norm = value.n;
+
+ var _searcher$searchIn3 = searcher.searchIn(text),
+ isMatch = _searcher$searchIn3.isMatch,
+ score = _searcher$searchIn3.score,
+ indices = _searcher$searchIn3.indices;
+
+ if (isMatch) {
+ matches.push({
+ score: score,
+ key: key,
+ value: text,
+ norm: norm,
+ indices: indices
+ });
+ }
+ }
+
+ return matches;
+ }
+ }]);
+
+ return Fuse;
+ }();
+
+ Fuse$1.version = '6.6.2';
+ Fuse$1.createIndex = createIndex;
+ Fuse$1.parseIndex = parseIndex;
+ Fuse$1.config = Config;
+
+ {
+ Fuse$1.parseQuery = parse;
+ }
+
+ {
+ register(ExtendedSearch);
+ }
+
+ var Fuse = Fuse$1;
+
+ return Fuse;
+
+}));
diff --git a/node_modules/fuse.js/dist/fuse.min.js b/node_modules/fuse.js/dist/fuse.min.js
new file mode 100644
index 0000000..adc2835
--- /dev/null
+++ b/node_modules/fuse.js/dist/fuse.min.js
@@ -0,0 +1,9 @@
+/**
+ * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
+ *
+ * Copyright (c) 2022 Kiro Risk (http://kiro.me)
+ * All Rights Reserved. Apache Software License 2.0
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ */
+var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){c(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&u(e,t)}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function h(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return h(this,n)}}function f(e){return function(e){if(Array.isArray(e))return d(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e){return Array.isArray?Array.isArray(e):"[object Array]"===b(e)}function g(e){return"string"==typeof e}function y(e){return"number"==typeof e}function p(e){return!0===e||!1===e||function(e){return m(e)&&null!==e}(e)&&"[object Boolean]"==b(e)}function m(e){return"object"===n(e)}function k(e){return null!=e}function M(e){return!e.trim().length}function b(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var x=function(e){return"Invalid value for key ".concat(e)},w=function(e){return"Pattern length exceeds max of ".concat(e,".")},L=Object.prototype.hasOwnProperty,S=function(){function e(t){var n=this;r(this,e),this._keys=[],this._keyMap={};var i=0;t.forEach((function(e){var t=_(e);i+=t.weight,n._keys.push(t),n._keyMap[t.id]=t,i+=t.weight})),this._keys.forEach((function(e){e.weight/=i}))}return o(e,[{key:"get",value:function(e){return this._keyMap[e]}},{key:"keys",value:function(){return this._keys}},{key:"toJSON",value:function(){return JSON.stringify(this._keys)}}]),e}();function _(e){var t=null,n=null,r=null,i=1,o=null;if(g(e)||v(e))r=e,t=O(e),n=j(e);else{if(!L.call(e,"name"))throw new Error(function(e){return"Missing ".concat(e," property in key")}("name"));var c=e.name;if(r=c,L.call(e,"weight")&&(i=e.weight)<=0)throw new Error(function(e){return"Property 'weight' in key '".concat(e,"' must be a positive integer")}(c));t=O(c),n=j(c),o=e.getFn}return{path:t,id:n,weight:i,src:r,getFn:o}}function O(e){return v(e)?e:e.split(".")}function j(e){return v(e)?e.join("."):e}var A={useExtendedSearch:!1,getFn:function(e,t){var n=[],r=!1;return function e(t,i,o){if(k(t))if(i[o]){var c=t[i[o]];if(!k(c))return;if(o===i.length-1&&(g(c)||y(c)||p(c)))n.push(function(e){return null==e?"":function(e){if("string"==typeof e)return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(e)}(c));else if(v(c)){r=!0;for(var a=0,s=c.length;a<s;a+=1)e(c[a],i,o+1)}else i.length&&e(c,i,o+1)}else n.push(t)}(e,g(t)?t.split("."):t,0),r?n:n[0]},ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},I=t(t(t(t({},{isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:function(e,t){return e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1}}),{includeMatches:!1,findAllMatches:!1,minMatchCharLength:1}),{location:0,threshold:.6,distance:100}),A),C=/[^ ]+/g;function E(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(C).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),c=parseFloat(Math.round(o*r)/r);return n.set(i,c),c},clear:function(){n.clear()}}}var $=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?I.getFn:n,o=t.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o;r(this,e),this.norm=E(c,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,g(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();g(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t<n;t+=1)this.records[t].i-=1}},{key:"getValueForItemAtKeyId",value:function(e,t){return e[this._keysMap[t]]}},{key:"size",value:function(){return this.records.length}},{key:"_addString",value:function(e,t){if(k(e)&&!M(e)){var n={v:e,i:t,n:this.norm.get(e)};this.records.push(n)}}},{key:"_addObject",value:function(e,t){var n=this,r={i:t,$:{}};this.keys.forEach((function(t,i){var o=t.getFn?t.getFn(e):n.getFn(e,t.path);if(k(o))if(v(o))!function(){for(var e=[],t=[{nestedArrIndex:-1,value:o}];t.length;){var c=t.pop(),a=c.nestedArrIndex,s=c.value;if(k(s))if(g(s)&&!M(s)){var u={v:s,i:a,n:n.norm.get(s)};e.push(u)}else v(s)&&s.forEach((function(e,n){t.push({nestedArrIndex:n,value:e})}))}r.$[i]=e}();else if(g(o)&&!M(o)){var c={v:o,n:n.norm.get(o)};r.$[i]=c}})),this.records.push(r)}},{key:"toJSON",value:function(){return{keys:this.keys,records:this.records}}}]),e}();function F(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?I.getFn:r,o=n.fieldNormWeight,c=void 0===o?I.fieldNormWeight:o,a=new $({getFn:i,fieldNormWeight:c});return a.setKeys(e.map(_)),a.setSources(t),a.create(),a}function R(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,c=t.expectedLocation,a=void 0===c?0:c,s=t.distance,u=void 0===s?I.distance:s,h=t.ignoreLocation,l=void 0===h?I.ignoreLocation:h,f=r/e.length;if(l)return f;var d=Math.abs(a-o);return u?f+d/u:d?1:f}function N(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:I.minMatchCharLength,n=[],r=-1,i=-1,o=0,c=e.length;o<c;o+=1){var a=e[o];a&&-1===r?r=o:a||-1===r||((i=o-1)-r+1>=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var P=32;function W(e){for(var t={},n=0,r=e.length;n<r;n+=1){var i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}var T=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,c=void 0===o?I.location:o,a=i.threshold,s=void 0===a?I.threshold:a,u=i.distance,h=void 0===u?I.distance:u,l=i.includeMatches,f=void 0===l?I.includeMatches:l,d=i.findAllMatches,v=void 0===d?I.findAllMatches:d,g=i.minMatchCharLength,y=void 0===g?I.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?I.isCaseSensitive:p,k=i.ignoreLocation,M=void 0===k?I.ignoreLocation:k;if(r(this,e),this.options={location:c,threshold:s,distance:h,includeMatches:f,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:M},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var b=function(e,t){n.chunks.push({pattern:e,alphabet:W(e),startIndex:t})},x=this.pattern.length;if(x>P){for(var w=0,L=x%P,S=x-L;w<S;)b(this.pattern.substr(w,P),w),w+=P;if(L){var _=x-P;b(this.pattern.substr(_),_)}}else b(this.pattern,0)}}return o(e,[{key:"searchIn",value:function(e){var t=this.options,n=t.isCaseSensitive,r=t.includeMatches;if(n||(e=e.toLowerCase()),this.pattern===e){var i={isMatch:!0,score:0};return r&&(i.indices=[[0,e.length-1]]),i}var o=this.options,c=o.location,a=o.distance,s=o.threshold,u=o.findAllMatches,h=o.minMatchCharLength,l=o.ignoreLocation,d=[],v=0,g=!1;this.chunks.forEach((function(t){var n=t.pattern,i=t.alphabet,o=t.startIndex,y=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?I.location:i,c=r.distance,a=void 0===c?I.distance:c,s=r.threshold,u=void 0===s?I.threshold:s,h=r.findAllMatches,l=void 0===h?I.findAllMatches:h,f=r.minMatchCharLength,d=void 0===f?I.minMatchCharLength:f,v=r.includeMatches,g=void 0===v?I.includeMatches:v,y=r.ignoreLocation,p=void 0===y?I.ignoreLocation:y;if(t.length>P)throw new Error(w(P));for(var m,k=t.length,M=e.length,b=Math.max(0,Math.min(o,M)),x=u,L=b,S=d>1||g,_=S?Array(M):[];(m=e.indexOf(t,L))>-1;){var O=R(t,{currentLocation:m,expectedLocation:b,distance:a,ignoreLocation:p});if(x=Math.min(O,x),L=m+k,S)for(var j=0;j<k;)_[m+j]=1,j+=1}L=-1;for(var A=[],C=1,E=k+M,$=1<<k-1,F=0;F<k;F+=1){for(var W=0,T=E;W<T;)R(t,{errors:F,currentLocation:b+T,expectedLocation:b,distance:a,ignoreLocation:p})<=x?W=T:E=T,T=Math.floor((E-W)/2+W);E=T;var z=Math.max(1,b-T+1),D=l?M:Math.min(b+T,M)+k,K=Array(D+2);K[D+1]=(1<<F)-1;for(var q=D;q>=z;q-=1){var B=q-1,J=n[e.charAt(B)];if(S&&(_[B]=+!!J),K[q]=(K[q+1]<<1|1)&J,F&&(K[q]|=(A[q+1]|A[q])<<1|1|A[q+1]),K[q]&$&&(C=R(t,{errors:F,currentLocation:B,expectedLocation:b,distance:a,ignoreLocation:p}))<=x){if(x=C,(L=B)<=b)break;z=Math.max(1,2*b-L)}}if(R(t,{errors:F+1,currentLocation:b,expectedLocation:b,distance:a,ignoreLocation:p})>x)break;A=K}var U={isMatch:L>=0,score:Math.max(.001,C)};if(S){var V=N(_,d);V.length?g&&(U.indices=V):U.isMatch=!1}return U}(e,n,i,{location:c+o,distance:a,threshold:s,findAllMatches:u,minMatchCharLength:h,includeMatches:r,ignoreLocation:l}),p=y.isMatch,m=y.score,k=y.indices;p&&(g=!0),v+=m,p&&k&&(d=[].concat(f(d),f(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=d),y}}]),e}(),z=function(){function e(t){r(this,e),this.pattern=t}return o(e,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(e){return D(e,this.multiRegex)}},{key:"isSingleMatch",value:function(e){return D(e,this.singleRegex)}}]),e}();function D(e,t){var n=e.match(t);return n?n[1]:null}var K=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),n}(z),q=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=-1===e.indexOf(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),n}(z),B=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),n}(z),J=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),n}(z),U=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),n}(z),V=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){var t=!e.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,e.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),n}(z),G=function(e){a(n,e);var t=l(n);function n(e){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},c=o.location,a=void 0===c?I.location:c,s=o.threshold,u=void 0===s?I.threshold:s,h=o.distance,l=void 0===h?I.distance:h,f=o.includeMatches,d=void 0===f?I.includeMatches:f,v=o.findAllMatches,g=void 0===v?I.findAllMatches:v,y=o.minMatchCharLength,p=void 0===y?I.minMatchCharLength:y,m=o.isCaseSensitive,k=void 0===m?I.isCaseSensitive:m,M=o.ignoreLocation,b=void 0===M?I.ignoreLocation:M;return r(this,n),(i=t.call(this,e))._bitapSearch=new T(e,{location:a,threshold:u,distance:l,includeMatches:d,findAllMatches:g,minMatchCharLength:p,isCaseSensitive:k,ignoreLocation:b}),i}return o(n,[{key:"search",value:function(e){return this._bitapSearch.searchIn(e)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),n}(z),H=function(e){a(n,e);var t=l(n);function n(e){return r(this,n),t.call(this,e)}return o(n,[{key:"search",value:function(e){for(var t,n=0,r=[],i=this.pattern.length;(t=e.indexOf(this.pattern,n))>-1;)n=t+i,r.push([t,n-1]);var o=!!r.length;return{isMatch:o,score:o?0:1,indices:r}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),n}(z),Q=[K,H,B,J,V,U,q,G],X=Q.length,Y=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/;function Z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.split("|").map((function(e){for(var n=e.trim().split(Y).filter((function(e){return e&&!!e.trim()})),r=[],i=0,o=n.length;i<o;i+=1){for(var c=n[i],a=!1,s=-1;!a&&++s<X;){var u=Q[s],h=u.isMultiMatch(c);h&&(r.push(new u(h,t)),a=!0)}if(!a)for(s=-1;++s<X;){var l=Q[s],f=l.isSingleMatch(c);if(f){r.push(new l(f,t));break}}}return r}))}var ee=new Set([G.type,H.type]),te=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.isCaseSensitive,o=void 0===i?I.isCaseSensitive:i,c=n.includeMatches,a=void 0===c?I.includeMatches:c,s=n.minMatchCharLength,u=void 0===s?I.minMatchCharLength:s,h=n.ignoreLocation,l=void 0===h?I.ignoreLocation:h,f=n.findAllMatches,d=void 0===f?I.findAllMatches:f,v=n.location,g=void 0===v?I.location:v,y=n.threshold,p=void 0===y?I.threshold:y,m=n.distance,k=void 0===m?I.distance:m;r(this,e),this.query=null,this.options={isCaseSensitive:o,includeMatches:a,minMatchCharLength:u,findAllMatches:d,ignoreLocation:l,location:g,threshold:p,distance:k},this.pattern=o?t:t.toLowerCase(),this.query=Z(this.pattern,this.options)}return o(e,[{key:"searchIn",value:function(e){var t=this.query;if(!t)return{isMatch:!1,score:1};var n=this.options,r=n.includeMatches;e=n.isCaseSensitive?e:e.toLowerCase();for(var i=0,o=[],c=0,a=0,s=t.length;a<s;a+=1){var u=t[a];o.length=0,i=0;for(var h=0,l=u.length;h<l;h+=1){var d=u[h],v=d.search(e),g=v.isMatch,y=v.indices,p=v.score;if(!g){c=0,i=0,o.length=0;break}if(i+=1,c+=p,r){var m=d.constructor.type;ee.has(m)?o=[].concat(f(o),f(y)):o.push(y)}}if(i){var k={isMatch:!0,score:c/i};return r&&(k.indices=o),k}}return{isMatch:!1,score:1}}}],[{key:"condition",value:function(e,t){return t.useExtendedSearch}}]),e}(),ne=[];function re(e,t){for(var n=0,r=ne.length;n<r;n+=1){var i=ne[n];if(i.condition(e,t))return new i(e,t)}return new T(e,t)}var ie="$and",oe="$or",ce="$path",ae="$val",se=function(e){return!(!e[ie]&&!e[oe])},ue=function(e){return!!e[ce]},he=function(e){return!v(e)&&m(e)&&!se(e)},le=function(e){return c({},ie,Object.keys(e).map((function(t){return c({},t,e[t])})))};function fe(e,t){var n=t.ignoreFieldNorm,r=void 0===n?I.ignoreFieldNorm:n;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,i=e.norm,o=e.score,c=n?n.weight:null;t*=Math.pow(0===o&&c?Number.EPSILON:o,(c||1)*(r?1:i))})),e.score=t}))}function de(e,t){var n=e.matches;t.matches=[],k(n)&&n.forEach((function(e){if(k(e.indices)&&e.indices.length){var n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.src),e.idx>-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function ve(e,t){t.score=e.score}function ge(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?I.includeMatches:r,o=n.includeScore,c=void 0===o?I.includeScore:o,a=[];return i&&a.push(de),c&&a.push(ve),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return a.length&&a.forEach((function(t){t(e,r)})),r}))}var ye=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;r(this,e),this.options=t(t({},I),i),this.options.useExtendedSearch,this._keyStore=new S(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof $))throw new Error("Incorrect 'index' type");this._myIndex=t||F(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){k(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n<r;n+=1){var i=this._docs[n];e(i,n)&&(this.removeAt(n),n-=1,r-=1,t.push(i))}return t}},{key:"removeAt",value:function(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}},{key:"getIndex",value:function(){return this._myIndex}},{key:"search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,c=i.includeScore,a=i.shouldSort,s=i.sortFn,u=i.ignoreFieldNorm,h=g(e)?g(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return fe(h,{ignoreFieldNorm:u}),a&&h.sort(s),y(r)&&r>-1&&(h=h.slice(0,r)),ge(h,this._docs,{includeMatches:o,includeScore:c})}},{key:"_searchStringList",value:function(e){var t=re(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(k(n)){var c=t.searchIn(n),a=c.isMatch,s=c.score,u=c.indices;a&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:u}]})}})),r}},{key:"_searchLogical",value:function(e){var t=this,n=function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,r=void 0===n||n,i=function e(n){var i=Object.keys(n),o=ue(n);if(!o&&i.length>1&&!se(n))return e(le(n));if(he(n)){var c=o?n[ce]:i[0],a=o?n[ae]:n[c];if(!g(a))throw new Error(x(c));var s={keyId:j(c),pattern:a};return r&&(s.searcher=re(a,t)),s}var u={children:[],operator:i[0]};return i.forEach((function(t){var r=n[t];v(r)&&r.forEach((function(t){u.children.push(e(t))}))})),u};return se(e)||(e=le(e)),i(e)}(e,this.options),r=function e(n,r,i){if(!n.children){var o=n.keyId,c=n.searcher,a=t._findMatches({key:t._keyStore.get(o),value:t._myIndex.getValueForItemAtKeyId(r,o),searcher:c});return a&&a.length?[{idx:i,item:r,matches:a}]:[]}for(var s=[],u=0,h=n.children.length;u<h;u+=1){var l=e(n.children[u],r,i);if(l.length)s.push.apply(s,f(l));else if(n.operator===ie)return[]}return s},i=this._myIndex.records,o={},c=[];return i.forEach((function(e){var t=e.$,i=e.i;if(k(t)){var a=r(n,t,i);a.length&&(o[i]||(o[i]={idx:i,item:t,matches:[]},c.push(o[i])),a.forEach((function(e){var t,n=e.matches;(t=o[i].matches).push.apply(t,f(n))})))}})),c}},{key:"_searchObjectList",value:function(e){var t=this,n=re(e,this.options),r=this._myIndex,i=r.keys,o=r.records,c=[];return o.forEach((function(e){var r=e.$,o=e.i;if(k(r)){var a=[];i.forEach((function(e,i){a.push.apply(a,f(t._findMatches({key:e,value:r[i],searcher:n})))})),a.length&&c.push({idx:o,item:r,matches:a})}})),c}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!k(n))return[];var i=[];if(v(n))n.forEach((function(e){var n=e.v,o=e.i,c=e.n;if(k(n)){var a=r.searchIn(n),s=a.isMatch,u=a.score,h=a.indices;s&&i.push({score:u,key:t,value:n,idx:o,norm:c,indices:h})}}));else{var o=n.v,c=n.n,a=r.searchIn(o),s=a.isMatch,u=a.score,h=a.indices;s&&i.push({score:u,key:t,value:o,norm:c,indices:h})}return i}}]),e}();return ye.version="6.6.2",ye.createIndex=F,ye.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?I.getFn:n,i=t.fieldNormWeight,o=void 0===i?I.fieldNormWeight:i,c=e.keys,a=e.records,s=new $({getFn:r,fieldNormWeight:o});return s.setKeys(c),s.setIndexRecords(a),s},ye.config=I,function(){ne.push.apply(ne,arguments)}(te),ye},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); \ No newline at end of file
diff --git a/node_modules/fuse.js/package.json b/node_modules/fuse.js/package.json
new file mode 100644
index 0000000..6d02a4e
--- /dev/null
+++ b/node_modules/fuse.js/package.json
@@ -0,0 +1,104 @@
+{
+ "name": "fuse.js",
+ "author": {
+ "name": "Kiro Risk",
+ "email": "kirollos@gmail.com",
+ "url": "http://kiro.me"
+ },
+ "main": "./dist/fuse.common.js",
+ "module": "./dist/fuse.esm.js",
+ "unpkg": "./dist/fuse.js",
+ "jsdelivr": "./dist/fuse.js",
+ "typings": "./dist/fuse.d.ts",
+ "sideEffects": false,
+ "files": [
+ "dist"
+ ],
+ "version": "6.6.2",
+ "description": "Lightweight fuzzy-search",
+ "license": "Apache-2.0",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/krisk/Fuse.git"
+ },
+ "homepage": "http://fusejs.io",
+ "keywords": [
+ "fuzzy",
+ "search",
+ "bitap"
+ ],
+ "scripts": {
+ "dev": "rollup -w -c scripts/configs.js --environment TARGET:umd-dev-full",
+ "dev:cjs": "rollup -w -c scripts/configs.js --environment TARGET:commonjs-full",
+ "dev:esm": "rollup -w -c scripts/configs.js --environment TARGET:esm-dev-full",
+ "build": "rm -r dist && mkdir dist && node ./scripts/build.main.js",
+ "test": "jest",
+ "lint": "eslint src scripts test",
+ "release": "./scripts/release.sh",
+ "docs:bump": "node ./scripts/bump-docs.js",
+ "docs:dev": "vuepress dev docs",
+ "docs:build": "vuepress build docs",
+ "docs:release": "./scripts/deploy-docs.sh",
+ "prepare": "husky install"
+ },
+ "standard-version": {
+ "scripts": {
+ "postbump": "yarn build && yarn lint && yarn test 2>/dev/null",
+ "precommit": "git add dist/*.js dist/*.ts"
+ }
+ },
+ "husky": {
+ "hooks": {
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
+ }
+ },
+ "commitlint": {
+ "extends": [
+ "@commitlint/config-conventional"
+ ]
+ },
+ "devDependencies": {
+ "@babel/cli": "^7.2.3",
+ "@babel/core": "^7.3.4",
+ "@babel/eslint-parser": "^7.16.3",
+ "@babel/plugin-proposal-object-rest-spread": "7.16.0",
+ "@babel/preset-env": "7.16.0",
+ "@babel/preset-typescript": "7.16.0",
+ "@commitlint/cli": "^14.1.0",
+ "@commitlint/config-conventional": "^14.1.0",
+ "@rollup/plugin-babel": "^5.3.0",
+ "@rollup/plugin-node-resolve": "^13.0.6",
+ "@rollup/plugin-replace": "^3.0.0",
+ "@types/jest": "27.0.2",
+ "@vuepress/plugin-google-analytics": "^1.4.0",
+ "@vuepress/plugin-register-components": "^1.5.2",
+ "babel-loader": "^8.0.5",
+ "codemirror": "5.63.3",
+ "eslint": "8.2.0",
+ "eslint-config-prettier": "8.3.0",
+ "eslint-plugin-vue": "8.0.3",
+ "faker": "5.5.3",
+ "husky": "^7.0.0",
+ "jest": "^27.3.1",
+ "prettier": "2.4.1",
+ "replace-in-file": "^6.1.0",
+ "rimraf": "3.0.2",
+ "rollup": "^2.61.1",
+ "rollup-plugin-copy": "3.4.0",
+ "standard-version": "^9.3.2",
+ "terser-webpack-plugin": "5.2.5",
+ "typescript": "^4.4.4",
+ "vue-codemirror": "^4.0.6",
+ "vue-eslint-parser": "^8.0.1",
+ "vuepress": "^1.4.0",
+ "vuepress-plugin-element-tabs": "^0.2.8",
+ "vuepress-plugin-google-adsense": "^0.2.1",
+ "vuepress-plugin-smooth-scroll": "^0.0.10",
+ "vuepress-plugin-social-share": "^1.1.0",
+ "webpack": "4.46.0",
+ "webpack-cli": "^4.9.1"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+}
diff --git a/node_modules/get-caller-file/LICENSE.md b/node_modules/get-caller-file/LICENSE.md
new file mode 100644
index 0000000..bf3e1c0
--- /dev/null
+++ b/node_modules/get-caller-file/LICENSE.md
@@ -0,0 +1,6 @@
+ISC License (ISC)
+Copyright 2018 Stefan Penner
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/get-caller-file/README.md b/node_modules/get-caller-file/README.md
new file mode 100644
index 0000000..a7d8c07
--- /dev/null
+++ b/node_modules/get-caller-file/README.md
@@ -0,0 +1,41 @@
+# get-caller-file
+
+[![Build Status](https://travis-ci.org/stefanpenner/get-caller-file.svg?branch=master)](https://travis-ci.org/stefanpenner/get-caller-file)
+[![Build status](https://ci.appveyor.com/api/projects/status/ol2q94g1932cy14a/branch/master?svg=true)](https://ci.appveyor.com/project/embercli/get-caller-file/branch/master)
+
+This is a utility, which allows a function to figure out from which file it was invoked. It does so by inspecting v8's stack trace at the time it is invoked.
+
+Inspired by http://stackoverflow.com/questions/13227489
+
+*note: this relies on Node/V8 specific APIs, as such other runtimes may not work*
+
+## Installation
+
+```bash
+yarn add get-caller-file
+```
+
+## Usage
+
+Given:
+
+```js
+// ./foo.js
+const getCallerFile = require('get-caller-file');
+
+module.exports = function() {
+ return getCallerFile(); // figures out who called it
+};
+```
+
+```js
+// index.js
+const foo = require('./foo');
+
+foo() // => /full/path/to/this/file/index.js
+```
+
+
+## Options:
+
+* `getCallerFile(position = 2)`: where position is stack frame whos fileName we want.
diff --git a/node_modules/get-caller-file/index.d.ts b/node_modules/get-caller-file/index.d.ts
new file mode 100644
index 0000000..babed69
--- /dev/null
+++ b/node_modules/get-caller-file/index.d.ts
@@ -0,0 +1,2 @@
+declare const _default: (position?: number) => any;
+export = _default;
diff --git a/node_modules/get-caller-file/index.js b/node_modules/get-caller-file/index.js
new file mode 100644
index 0000000..57304f8
--- /dev/null
+++ b/node_modules/get-caller-file/index.js
@@ -0,0 +1,22 @@
+"use strict";
+// Call this function in a another function to find out the file from
+// which that function was called from. (Inspects the v8 stack trace)
+//
+// Inspired by http://stackoverflow.com/questions/13227489
+module.exports = function getCallerFile(position) {
+ if (position === void 0) { position = 2; }
+ if (position >= Error.stackTraceLimit) {
+ throw new TypeError('getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `' + position + '` and Error.stackTraceLimit was: `' + Error.stackTraceLimit + '`');
+ }
+ var oldPrepareStackTrace = Error.prepareStackTrace;
+ Error.prepareStackTrace = function (_, stack) { return stack; };
+ var stack = new Error().stack;
+ Error.prepareStackTrace = oldPrepareStackTrace;
+ if (stack !== null && typeof stack === 'object') {
+ // stack[0] holds this file
+ // stack[1] holds where this function was called
+ // stack[2] holds the file we're interested in
+ return stack[position] ? stack[position].getFileName() : undefined;
+ }
+};
+//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/node_modules/get-caller-file/index.js.map b/node_modules/get-caller-file/index.js.map
new file mode 100644
index 0000000..89c655c
--- /dev/null
+++ b/node_modules/get-caller-file/index.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,qEAAqE;AACrE,EAAE;AACF,0DAA0D;AAE1D,iBAAS,SAAS,aAAa,CAAC,QAAY;IAAZ,yBAAA,EAAA,YAAY;IAC1C,IAAI,QAAQ,IAAI,KAAK,CAAC,eAAe,EAAE;QACrC,MAAM,IAAI,SAAS,CAAC,kGAAkG,GAAG,QAAQ,GAAG,oCAAoC,GAAG,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC,CAAC;KACzM;IAED,IAAM,oBAAoB,GAAG,KAAK,CAAC,iBAAiB,CAAC;IACrD,KAAK,CAAC,iBAAiB,GAAG,UAAC,CAAC,EAAE,KAAK,IAAM,OAAA,KAAK,EAAL,CAAK,CAAC;IAC/C,IAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAC,KAAK,CAAC;IAChC,KAAK,CAAC,iBAAiB,GAAG,oBAAoB,CAAC;IAG/C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC/C,2BAA2B;QAC3B,gDAAgD;QAChD,8CAA8C;QAC9C,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAE,KAAK,CAAC,QAAQ,CAAS,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;KAC7E;AACH,CAAC,CAAC"} \ No newline at end of file
diff --git a/node_modules/get-caller-file/package.json b/node_modules/get-caller-file/package.json
new file mode 100644
index 0000000..b0dd571
--- /dev/null
+++ b/node_modules/get-caller-file/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "get-caller-file",
+ "version": "2.0.5",
+ "description": "",
+ "main": "index.js",
+ "directories": {
+ "test": "tests"
+ },
+ "files": [
+ "index.js",
+ "index.js.map",
+ "index.d.ts"
+ ],
+ "scripts": {
+ "prepare": "tsc",
+ "test": "mocha test",
+ "test:debug": "mocha test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/stefanpenner/get-caller-file.git"
+ },
+ "author": "Stefan Penner",
+ "license": "ISC",
+ "bugs": {
+ "url": "https://github.com/stefanpenner/get-caller-file/issues"
+ },
+ "homepage": "https://github.com/stefanpenner/get-caller-file#readme",
+ "devDependencies": {
+ "@types/chai": "^4.1.7",
+ "@types/ensure-posix-path": "^1.0.0",
+ "@types/mocha": "^5.2.6",
+ "@types/node": "^11.10.5",
+ "chai": "^4.1.2",
+ "ensure-posix-path": "^1.0.1",
+ "mocha": "^5.2.0",
+ "typescript": "^3.3.3333"
+ },
+ "engines": {
+ "node": "6.* || 8.* || >= 10.*"
+ }
+}
diff --git a/node_modules/has-flag/index.d.ts b/node_modules/has-flag/index.d.ts
new file mode 100644
index 0000000..a0a48c8
--- /dev/null
+++ b/node_modules/has-flag/index.d.ts
@@ -0,0 +1,39 @@
+/**
+Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag.
+
+@param flag - CLI flag to look for. The `--` prefix is optional.
+@param argv - CLI arguments. Default: `process.argv`.
+@returns Whether the flag exists.
+
+@example
+```
+// $ ts-node foo.ts -f --unicorn --foo=bar -- --rainbow
+
+// foo.ts
+import hasFlag = require('has-flag');
+
+hasFlag('unicorn');
+//=> true
+
+hasFlag('--unicorn');
+//=> true
+
+hasFlag('f');
+//=> true
+
+hasFlag('-f');
+//=> true
+
+hasFlag('foo=bar');
+//=> true
+
+hasFlag('foo');
+//=> false
+
+hasFlag('rainbow');
+//=> false
+```
+*/
+declare function hasFlag(flag: string, argv?: string[]): boolean;
+
+export = hasFlag;
diff --git a/node_modules/has-flag/index.js b/node_modules/has-flag/index.js
new file mode 100644
index 0000000..b6f80b1
--- /dev/null
+++ b/node_modules/has-flag/index.js
@@ -0,0 +1,8 @@
+'use strict';
+
+module.exports = (flag, argv = process.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);
+};
diff --git a/node_modules/has-flag/license b/node_modules/has-flag/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/has-flag/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/has-flag/package.json b/node_modules/has-flag/package.json
new file mode 100644
index 0000000..a9cba4b
--- /dev/null
+++ b/node_modules/has-flag/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "has-flag",
+ "version": "4.0.0",
+ "description": "Check if argv has a specific flag",
+ "license": "MIT",
+ "repository": "sindresorhus/has-flag",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "has",
+ "check",
+ "detect",
+ "contains",
+ "find",
+ "flag",
+ "cli",
+ "command-line",
+ "argv",
+ "process",
+ "arg",
+ "args",
+ "argument",
+ "arguments",
+ "getopt",
+ "minimist",
+ "optimist"
+ ],
+ "devDependencies": {
+ "ava": "^1.4.1",
+ "tsd": "^0.7.2",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/node_modules/has-flag/readme.md b/node_modules/has-flag/readme.md
new file mode 100644
index 0000000..3f72dff
--- /dev/null
+++ b/node_modules/has-flag/readme.md
@@ -0,0 +1,89 @@
+# has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag)
+
+> Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag
+
+Correctly stops looking after an `--` argument terminator.
+
+---
+
+<div align="center">
+ <b>
+ <a href="https://tidelift.com/subscription/pkg/npm-has-flag?utm_source=npm-has-flag&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
+ </b>
+ <br>
+ <sub>
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
+ </sub>
+</div>
+
+---
+
+
+## Install
+
+```
+$ npm install has-flag
+```
+
+
+## Usage
+
+```js
+// foo.js
+const hasFlag = require('has-flag');
+
+hasFlag('unicorn');
+//=> true
+
+hasFlag('--unicorn');
+//=> true
+
+hasFlag('f');
+//=> true
+
+hasFlag('-f');
+//=> true
+
+hasFlag('foo=bar');
+//=> true
+
+hasFlag('foo');
+//=> false
+
+hasFlag('rainbow');
+//=> false
+```
+
+```
+$ node foo.js -f --unicorn --foo=bar -- --rainbow
+```
+
+
+## API
+
+### hasFlag(flag, [argv])
+
+Returns a boolean for whether the flag exists.
+
+#### flag
+
+Type: `string`
+
+CLI flag to look for. The `--` prefix is optional.
+
+#### argv
+
+Type: `string[]`<br>
+Default: `process.argv`
+
+CLI arguments.
+
+
+## Security
+
+To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/node_modules/is-fullwidth-code-point/index.d.ts b/node_modules/is-fullwidth-code-point/index.d.ts
new file mode 100644
index 0000000..729d202
--- /dev/null
+++ b/node_modules/is-fullwidth-code-point/index.d.ts
@@ -0,0 +1,17 @@
+/**
+Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms).
+
+@param codePoint - The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
+
+@example
+```
+import isFullwidthCodePoint from 'is-fullwidth-code-point';
+
+isFullwidthCodePoint('谢'.codePointAt(0));
+//=> true
+
+isFullwidthCodePoint('a'.codePointAt(0));
+//=> false
+```
+*/
+export default function isFullwidthCodePoint(codePoint: number): boolean;
diff --git a/node_modules/is-fullwidth-code-point/index.js b/node_modules/is-fullwidth-code-point/index.js
new file mode 100644
index 0000000..671f97f
--- /dev/null
+++ b/node_modules/is-fullwidth-code-point/index.js
@@ -0,0 +1,50 @@
+/* eslint-disable yoda */
+'use strict';
+
+const isFullwidthCodePoint = codePoint => {
+ if (Number.isNaN(codePoint)) {
+ return false;
+ }
+
+ // Code points are derived from:
+ // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
+ if (
+ codePoint >= 0x1100 && (
+ codePoint <= 0x115F || // Hangul Jamo
+ codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET
+ codePoint === 0x232A || // RIGHT-POINTING ANGLE BRACKET
+ // CJK Radicals Supplement .. Enclosed CJK Letters and Months
+ (0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F) ||
+ // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
+ (0x3250 <= codePoint && codePoint <= 0x4DBF) ||
+ // CJK Unified Ideographs .. Yi Radicals
+ (0x4E00 <= codePoint && codePoint <= 0xA4C6) ||
+ // Hangul Jamo Extended-A
+ (0xA960 <= codePoint && codePoint <= 0xA97C) ||
+ // Hangul Syllables
+ (0xAC00 <= codePoint && codePoint <= 0xD7A3) ||
+ // CJK Compatibility Ideographs
+ (0xF900 <= codePoint && codePoint <= 0xFAFF) ||
+ // Vertical Forms
+ (0xFE10 <= codePoint && codePoint <= 0xFE19) ||
+ // CJK Compatibility Forms .. Small Form Variants
+ (0xFE30 <= codePoint && codePoint <= 0xFE6B) ||
+ // Halfwidth and Fullwidth Forms
+ (0xFF01 <= codePoint && codePoint <= 0xFF60) ||
+ (0xFFE0 <= codePoint && codePoint <= 0xFFE6) ||
+ // Kana Supplement
+ (0x1B000 <= codePoint && codePoint <= 0x1B001) ||
+ // Enclosed Ideographic Supplement
+ (0x1F200 <= codePoint && codePoint <= 0x1F251) ||
+ // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
+ (0x20000 <= codePoint && codePoint <= 0x3FFFD)
+ )
+ ) {
+ return true;
+ }
+
+ return false;
+};
+
+module.exports = isFullwidthCodePoint;
+module.exports.default = isFullwidthCodePoint;
diff --git a/node_modules/is-fullwidth-code-point/license b/node_modules/is-fullwidth-code-point/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/is-fullwidth-code-point/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/is-fullwidth-code-point/package.json b/node_modules/is-fullwidth-code-point/package.json
new file mode 100644
index 0000000..2137e88
--- /dev/null
+++ b/node_modules/is-fullwidth-code-point/package.json
@@ -0,0 +1,42 @@
+{
+ "name": "is-fullwidth-code-point",
+ "version": "3.0.0",
+ "description": "Check if the character represented by a given Unicode code point is fullwidth",
+ "license": "MIT",
+ "repository": "sindresorhus/is-fullwidth-code-point",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd-check"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "fullwidth",
+ "full-width",
+ "full",
+ "width",
+ "unicode",
+ "character",
+ "string",
+ "codepoint",
+ "code",
+ "point",
+ "is",
+ "detect",
+ "check"
+ ],
+ "devDependencies": {
+ "ava": "^1.3.1",
+ "tsd-check": "^0.5.0",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/node_modules/is-fullwidth-code-point/readme.md b/node_modules/is-fullwidth-code-point/readme.md
new file mode 100644
index 0000000..4236bba
--- /dev/null
+++ b/node_modules/is-fullwidth-code-point/readme.md
@@ -0,0 +1,39 @@
+# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point)
+
+> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms)
+
+
+## Install
+
+```
+$ npm install is-fullwidth-code-point
+```
+
+
+## Usage
+
+```js
+const isFullwidthCodePoint = require('is-fullwidth-code-point');
+
+isFullwidthCodePoint('谢'.codePointAt(0));
+//=> true
+
+isFullwidthCodePoint('a'.codePointAt(0));
+//=> false
+```
+
+
+## API
+
+### isFullwidthCodePoint(codePoint)
+
+#### codePoint
+
+Type: `number`
+
+The [code point](https://en.wikipedia.org/wiki/Code_point) of a character.
+
+
+## License
+
+MIT © [Sindre Sorhus](https://sindresorhus.com)
diff --git a/node_modules/require-directory/.jshintrc b/node_modules/require-directory/.jshintrc
new file mode 100644
index 0000000..e14e4dc
--- /dev/null
+++ b/node_modules/require-directory/.jshintrc
@@ -0,0 +1,67 @@
+{
+ "maxerr" : 50,
+ "bitwise" : true,
+ "camelcase" : true,
+ "curly" : true,
+ "eqeqeq" : true,
+ "forin" : true,
+ "immed" : true,
+ "indent" : 2,
+ "latedef" : true,
+ "newcap" : true,
+ "noarg" : true,
+ "noempty" : true,
+ "nonew" : true,
+ "plusplus" : true,
+ "quotmark" : true,
+ "undef" : true,
+ "unused" : true,
+ "strict" : true,
+ "trailing" : true,
+ "maxparams" : false,
+ "maxdepth" : false,
+ "maxstatements" : false,
+ "maxcomplexity" : false,
+ "maxlen" : false,
+ "asi" : false,
+ "boss" : false,
+ "debug" : false,
+ "eqnull" : true,
+ "es5" : false,
+ "esnext" : false,
+ "moz" : false,
+ "evil" : false,
+ "expr" : true,
+ "funcscope" : true,
+ "globalstrict" : true,
+ "iterator" : true,
+ "lastsemic" : false,
+ "laxbreak" : false,
+ "laxcomma" : false,
+ "loopfunc" : false,
+ "multistr" : false,
+ "proto" : false,
+ "scripturl" : false,
+ "smarttabs" : false,
+ "shadow" : false,
+ "sub" : false,
+ "supernew" : false,
+ "validthis" : false,
+ "browser" : true,
+ "couch" : false,
+ "devel" : true,
+ "dojo" : false,
+ "jquery" : false,
+ "mootools" : false,
+ "node" : true,
+ "nonstandard" : false,
+ "prototypejs" : false,
+ "rhino" : false,
+ "worker" : false,
+ "wsh" : false,
+ "yui" : false,
+ "nomen" : true,
+ "onevar" : true,
+ "passfail" : false,
+ "white" : true
+}
diff --git a/node_modules/require-directory/.npmignore b/node_modules/require-directory/.npmignore
new file mode 100644
index 0000000..47cf365
--- /dev/null
+++ b/node_modules/require-directory/.npmignore
@@ -0,0 +1 @@
+test/**
diff --git a/node_modules/require-directory/.travis.yml b/node_modules/require-directory/.travis.yml
new file mode 100644
index 0000000..20fd86b
--- /dev/null
+++ b/node_modules/require-directory/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - 0.10
diff --git a/node_modules/require-directory/LICENSE b/node_modules/require-directory/LICENSE
new file mode 100644
index 0000000..a70f253
--- /dev/null
+++ b/node_modules/require-directory/LICENSE
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2011 Troy Goode <troygoode@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/require-directory/README.markdown b/node_modules/require-directory/README.markdown
new file mode 100644
index 0000000..926a063
--- /dev/null
+++ b/node_modules/require-directory/README.markdown
@@ -0,0 +1,184 @@
+# require-directory
+
+Recursively iterates over specified directory, `require()`'ing each file, and returning a nested hash structure containing those modules.
+
+**[Follow me (@troygoode) on Twitter!](https://twitter.com/intent/user?screen_name=troygoode)**
+
+[![NPM](https://nodei.co/npm/require-directory.png?downloads=true&stars=true)](https://nodei.co/npm/require-directory/)
+
+[![build status](https://secure.travis-ci.org/troygoode/node-require-directory.png)](http://travis-ci.org/troygoode/node-require-directory)
+
+## How To Use
+
+### Installation (via [npm](https://npmjs.org/package/require-directory))
+
+```bash
+$ npm install require-directory
+```
+
+### Usage
+
+A common pattern in node.js is to include an index file which creates a hash of the files in its current directory. Given a directory structure like so:
+
+* app.js
+* routes/
+ * index.js
+ * home.js
+ * auth/
+ * login.js
+ * logout.js
+ * register.js
+
+`routes/index.js` uses `require-directory` to build the hash (rather than doing so manually) like so:
+
+```javascript
+var requireDirectory = require('require-directory');
+module.exports = requireDirectory(module);
+```
+
+`app.js` references `routes/index.js` like any other module, but it now has a hash/tree of the exports from the `./routes/` directory:
+
+```javascript
+var routes = require('./routes');
+
+// snip
+
+app.get('/', routes.home);
+app.get('/register', routes.auth.register);
+app.get('/login', routes.auth.login);
+app.get('/logout', routes.auth.logout);
+```
+
+The `routes` variable above is the equivalent of this:
+
+```javascript
+var routes = {
+ home: require('routes/home.js'),
+ auth: {
+ login: require('routes/auth/login.js'),
+ logout: require('routes/auth/logout.js'),
+ register: require('routes/auth/register.js')
+ }
+};
+```
+
+*Note that `routes.index` will be `undefined` as you would hope.*
+
+### Specifying Another Directory
+
+You can specify which directory you want to build a tree of (if it isn't the current directory for whatever reason) by passing it as the second parameter. Not specifying the path (`requireDirectory(module)`) is the equivelant of `requireDirectory(module, __dirname)`:
+
+```javascript
+var requireDirectory = require('require-directory');
+module.exports = requireDirectory(module, './some/subdirectory');
+```
+
+For example, in the [example in the Usage section](#usage) we could have avoided creating `routes/index.js` and instead changed the first lines of `app.js` to:
+
+```javascript
+var requireDirectory = require('require-directory');
+var routes = requireDirectory(module, './routes');
+```
+
+## Options
+
+You can pass an options hash to `require-directory` as the 2nd parameter (or 3rd if you're passing the path to another directory as the 2nd parameter already). Here are the available options:
+
+### Whitelisting
+
+Whitelisting (either via RegExp or function) allows you to specify that only certain files be loaded.
+
+```javascript
+var requireDirectory = require('require-directory'),
+ whitelist = /onlyinclude.js$/,
+ hash = requireDirectory(module, {include: whitelist});
+```
+
+```javascript
+var requireDirectory = require('require-directory'),
+ check = function(path){
+ if(/onlyinclude.js$/.test(path)){
+ return true; // don't include
+ }else{
+ return false; // go ahead and include
+ }
+ },
+ hash = requireDirectory(module, {include: check});
+```
+
+### Blacklisting
+
+Blacklisting (either via RegExp or function) allows you to specify that all but certain files should be loaded.
+
+```javascript
+var requireDirectory = require('require-directory'),
+ blacklist = /dontinclude\.js$/,
+ hash = requireDirectory(module, {exclude: blacklist});
+```
+
+```javascript
+var requireDirectory = require('require-directory'),
+ check = function(path){
+ if(/dontinclude\.js$/.test(path)){
+ return false; // don't include
+ }else{
+ return true; // go ahead and include
+ }
+ },
+ hash = requireDirectory(module, {exclude: check});
+```
+
+### Visiting Objects As They're Loaded
+
+`require-directory` takes a function as the `visit` option that will be called for each module that is added to module.exports.
+
+```javascript
+var requireDirectory = require('require-directory'),
+ visitor = function(obj) {
+ console.log(obj); // will be called for every module that is loaded
+ },
+ hash = requireDirectory(module, {visit: visitor});
+```
+
+The visitor can also transform the objects by returning a value:
+
+```javascript
+var requireDirectory = require('require-directory'),
+ visitor = function(obj) {
+ return obj(new Date());
+ },
+ hash = requireDirectory(module, {visit: visitor});
+```
+
+### Renaming Keys
+
+```javascript
+var requireDirectory = require('require-directory'),
+ renamer = function(name) {
+ return name.toUpperCase();
+ },
+ hash = requireDirectory(module, {rename: renamer});
+```
+
+### No Recursion
+
+```javascript
+var requireDirectory = require('require-directory'),
+ hash = requireDirectory(module, {recurse: false});
+```
+
+## Run Unit Tests
+
+```bash
+$ npm run lint
+$ npm test
+```
+
+## License
+
+[MIT License](http://www.opensource.org/licenses/mit-license.php)
+
+## Author
+
+[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com))
+
diff --git a/node_modules/require-directory/index.js b/node_modules/require-directory/index.js
new file mode 100644
index 0000000..cd37da7
--- /dev/null
+++ b/node_modules/require-directory/index.js
@@ -0,0 +1,86 @@
+'use strict';
+
+var fs = require('fs'),
+ join = require('path').join,
+ resolve = require('path').resolve,
+ dirname = require('path').dirname,
+ defaultOptions = {
+ extensions: ['js', 'json', 'coffee'],
+ recurse: true,
+ rename: function (name) {
+ return name;
+ },
+ visit: function (obj) {
+ return obj;
+ }
+ };
+
+function checkFileInclusion(path, filename, options) {
+ return (
+ // verify file has valid extension
+ (new RegExp('\\.(' + options.extensions.join('|') + ')$', 'i').test(filename)) &&
+
+ // if options.include is a RegExp, evaluate it and make sure the path passes
+ !(options.include && options.include instanceof RegExp && !options.include.test(path)) &&
+
+ // if options.include is a function, evaluate it and make sure the path passes
+ !(options.include && typeof options.include === 'function' && !options.include(path, filename)) &&
+
+ // if options.exclude is a RegExp, evaluate it and make sure the path doesn't pass
+ !(options.exclude && options.exclude instanceof RegExp && options.exclude.test(path)) &&
+
+ // if options.exclude is a function, evaluate it and make sure the path doesn't pass
+ !(options.exclude && typeof options.exclude === 'function' && options.exclude(path, filename))
+ );
+}
+
+function requireDirectory(m, path, options) {
+ var retval = {};
+
+ // path is optional
+ if (path && !options && typeof path !== 'string') {
+ options = path;
+ path = null;
+ }
+
+ // default options
+ options = options || {};
+ for (var prop in defaultOptions) {
+ if (typeof options[prop] === 'undefined') {
+ options[prop] = defaultOptions[prop];
+ }
+ }
+
+ // if no path was passed in, assume the equivelant of __dirname from caller
+ // otherwise, resolve path relative to the equivalent of __dirname
+ path = !path ? dirname(m.filename) : resolve(dirname(m.filename), path);
+
+ // get the path of each file in specified directory, append to current tree node, recurse
+ fs.readdirSync(path).forEach(function (filename) {
+ var joined = join(path, filename),
+ files,
+ key,
+ obj;
+
+ if (fs.statSync(joined).isDirectory() && options.recurse) {
+ // this node is a directory; recurse
+ files = requireDirectory(m, joined, options);
+ // exclude empty directories
+ if (Object.keys(files).length) {
+ retval[options.rename(filename, joined, filename)] = files;
+ }
+ } else {
+ if (joined !== m.filename && checkFileInclusion(joined, filename, options)) {
+ // hash node key shouldn't include file extension
+ key = filename.substring(0, filename.lastIndexOf('.'));
+ obj = m.require(joined);
+ retval[options.rename(key, joined, filename)] = options.visit(obj, joined, filename) || obj;
+ }
+ }
+ });
+
+ return retval;
+}
+
+module.exports = requireDirectory;
+module.exports.defaults = defaultOptions;
diff --git a/node_modules/require-directory/package.json b/node_modules/require-directory/package.json
new file mode 100644
index 0000000..25ece4b
--- /dev/null
+++ b/node_modules/require-directory/package.json
@@ -0,0 +1,40 @@
+{
+ "author": "Troy Goode <troygoode@gmail.com> (http://github.com/troygoode/)",
+ "name": "require-directory",
+ "version": "2.1.1",
+ "description": "Recursively iterates over specified directory, require()'ing each file, and returning a nested hash structure containing those modules.",
+ "keywords": [
+ "require",
+ "directory",
+ "library",
+ "recursive"
+ ],
+ "homepage": "https://github.com/troygoode/node-require-directory/",
+ "main": "index.js",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/troygoode/node-require-directory.git"
+ },
+ "contributors": [
+ {
+ "name": "Troy Goode",
+ "email": "troygoode@gmail.com",
+ "web": "http://github.com/troygoode/"
+ }
+ ],
+ "license": "MIT",
+ "bugs": {
+ "url": "http://github.com/troygoode/node-require-directory/issues/"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "devDependencies": {
+ "jshint": "^2.6.0",
+ "mocha": "^2.1.0"
+ },
+ "scripts": {
+ "test": "mocha",
+ "lint": "jshint index.js test/test.js"
+ }
+}
diff --git a/node_modules/string-width/index.d.ts b/node_modules/string-width/index.d.ts
new file mode 100644
index 0000000..12b5309
--- /dev/null
+++ b/node_modules/string-width/index.d.ts
@@ -0,0 +1,29 @@
+declare const stringWidth: {
+ /**
+ Get the visual width of a string - the number of columns required to display it.
+
+ Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
+
+ @example
+ ```
+ import stringWidth = require('string-width');
+
+ stringWidth('a');
+ //=> 1
+
+ stringWidth('古');
+ //=> 2
+
+ stringWidth('\u001B[1m古\u001B[22m');
+ //=> 2
+ ```
+ */
+ (string: string): number;
+
+ // TODO: remove this in the next major version, refactor the whole definition to:
+ // declare function stringWidth(string: string): number;
+ // export = stringWidth;
+ default: typeof stringWidth;
+}
+
+export = stringWidth;
diff --git a/node_modules/string-width/index.js b/node_modules/string-width/index.js
new file mode 100644
index 0000000..f4d261a
--- /dev/null
+++ b/node_modules/string-width/index.js
@@ -0,0 +1,47 @@
+'use strict';
+const stripAnsi = require('strip-ansi');
+const isFullwidthCodePoint = require('is-fullwidth-code-point');
+const emojiRegex = require('emoji-regex');
+
+const stringWidth = string => {
+ if (typeof string !== 'string' || string.length === 0) {
+ return 0;
+ }
+
+ string = stripAnsi(string);
+
+ if (string.length === 0) {
+ return 0;
+ }
+
+ string = string.replace(emojiRegex(), ' ');
+
+ let width = 0;
+
+ for (let i = 0; i < string.length; i++) {
+ const code = string.codePointAt(i);
+
+ // Ignore control characters
+ if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
+ continue;
+ }
+
+ // Ignore combining characters
+ if (code >= 0x300 && code <= 0x36F) {
+ continue;
+ }
+
+ // Surrogates
+ if (code > 0xFFFF) {
+ i++;
+ }
+
+ width += isFullwidthCodePoint(code) ? 2 : 1;
+ }
+
+ return width;
+};
+
+module.exports = stringWidth;
+// TODO: remove this in the next major version
+module.exports.default = stringWidth;
diff --git a/node_modules/string-width/license b/node_modules/string-width/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/string-width/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/string-width/package.json b/node_modules/string-width/package.json
new file mode 100644
index 0000000..28ba7b4
--- /dev/null
+++ b/node_modules/string-width/package.json
@@ -0,0 +1,56 @@
+{
+ "name": "string-width",
+ "version": "4.2.3",
+ "description": "Get the visual width of a string - the number of columns required to display it",
+ "license": "MIT",
+ "repository": "sindresorhus/string-width",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "string",
+ "character",
+ "unicode",
+ "width",
+ "visual",
+ "column",
+ "columns",
+ "fullwidth",
+ "full-width",
+ "full",
+ "ansi",
+ "escape",
+ "codes",
+ "cli",
+ "command-line",
+ "terminal",
+ "console",
+ "cjk",
+ "chinese",
+ "japanese",
+ "korean",
+ "fixed-width"
+ ],
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "devDependencies": {
+ "ava": "^1.4.1",
+ "tsd": "^0.7.1",
+ "xo": "^0.24.0"
+ }
+}
diff --git a/node_modules/string-width/readme.md b/node_modules/string-width/readme.md
new file mode 100644
index 0000000..bdd3141
--- /dev/null
+++ b/node_modules/string-width/readme.md
@@ -0,0 +1,50 @@
+# string-width
+
+> Get the visual width of a string - the number of columns required to display it
+
+Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width.
+
+Useful to be able to measure the actual width of command-line output.
+
+
+## Install
+
+```
+$ npm install string-width
+```
+
+
+## Usage
+
+```js
+const stringWidth = require('string-width');
+
+stringWidth('a');
+//=> 1
+
+stringWidth('古');
+//=> 2
+
+stringWidth('\u001B[1m古\u001B[22m');
+//=> 2
+```
+
+
+## Related
+
+- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module
+- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string
+- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string
+
+
+---
+
+<div align="center">
+ <b>
+ <a href="https://tidelift.com/subscription/pkg/npm-string-width?utm_source=npm-string-width&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
+ </b>
+ <br>
+ <sub>
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
+ </sub>
+</div>
diff --git a/node_modules/strip-ansi/index.d.ts b/node_modules/strip-ansi/index.d.ts
new file mode 100644
index 0000000..907fccc
--- /dev/null
+++ b/node_modules/strip-ansi/index.d.ts
@@ -0,0 +1,17 @@
+/**
+Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string.
+
+@example
+```
+import stripAnsi = require('strip-ansi');
+
+stripAnsi('\u001B[4mUnicorn\u001B[0m');
+//=> 'Unicorn'
+
+stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
+//=> 'Click'
+```
+*/
+declare function stripAnsi(string: string): string;
+
+export = stripAnsi;
diff --git a/node_modules/strip-ansi/index.js b/node_modules/strip-ansi/index.js
new file mode 100644
index 0000000..9a593df
--- /dev/null
+++ b/node_modules/strip-ansi/index.js
@@ -0,0 +1,4 @@
+'use strict';
+const ansiRegex = require('ansi-regex');
+
+module.exports = string => typeof string === 'string' ? string.replace(ansiRegex(), '') : string;
diff --git a/node_modules/strip-ansi/license b/node_modules/strip-ansi/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/strip-ansi/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/strip-ansi/package.json b/node_modules/strip-ansi/package.json
new file mode 100644
index 0000000..1a41108
--- /dev/null
+++ b/node_modules/strip-ansi/package.json
@@ -0,0 +1,54 @@
+{
+ "name": "strip-ansi",
+ "version": "6.0.1",
+ "description": "Strip ANSI escape codes from a string",
+ "license": "MIT",
+ "repository": "chalk/strip-ansi",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava && tsd"
+ },
+ "files": [
+ "index.js",
+ "index.d.ts"
+ ],
+ "keywords": [
+ "strip",
+ "trim",
+ "remove",
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "devDependencies": {
+ "ava": "^2.4.0",
+ "tsd": "^0.10.0",
+ "xo": "^0.25.3"
+ }
+}
diff --git a/node_modules/strip-ansi/readme.md b/node_modules/strip-ansi/readme.md
new file mode 100644
index 0000000..7c4b56d
--- /dev/null
+++ b/node_modules/strip-ansi/readme.md
@@ -0,0 +1,46 @@
+# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)
+
+> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code) from a string
+
+
+## Install
+
+```
+$ npm install strip-ansi
+```
+
+
+## Usage
+
+```js
+const stripAnsi = require('strip-ansi');
+
+stripAnsi('\u001B[4mUnicorn\u001B[0m');
+//=> 'Unicorn'
+
+stripAnsi('\u001B]8;;https://github.com\u0007Click\u001B]8;;\u0007');
+//=> 'Click'
+```
+
+
+## strip-ansi for enterprise
+
+Available as part of the Tidelift Subscription.
+
+The maintainers of strip-ansi and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-strip-ansi?utm_source=npm-strip-ansi&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
+
+
+## Related
+
+- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for this module
+- [strip-ansi-stream](https://github.com/chalk/strip-ansi-stream) - Streaming version of this module
+- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
+- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
+- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
+
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
+
diff --git a/node_modules/supports-color/browser.js b/node_modules/supports-color/browser.js
new file mode 100644
index 0000000..62afa3a
--- /dev/null
+++ b/node_modules/supports-color/browser.js
@@ -0,0 +1,5 @@
+'use strict';
+module.exports = {
+ stdout: false,
+ stderr: false
+};
diff --git a/node_modules/supports-color/index.js b/node_modules/supports-color/index.js
new file mode 100644
index 0000000..6fada39
--- /dev/null
+++ b/node_modules/supports-color/index.js
@@ -0,0 +1,135 @@
+'use strict';
+const os = require('os');
+const tty = require('tty');
+const hasFlag = require('has-flag');
+
+const {env} = process;
+
+let forceColor;
+if (hasFlag('no-color') ||
+ hasFlag('no-colors') ||
+ hasFlag('color=false') ||
+ hasFlag('color=never')) {
+ forceColor = 0;
+} else if (hasFlag('color') ||
+ hasFlag('colors') ||
+ hasFlag('color=true') ||
+ hasFlag('color=always')) {
+ forceColor = 1;
+}
+
+if ('FORCE_COLOR' in env) {
+ if (env.FORCE_COLOR === 'true') {
+ forceColor = 1;
+ } else if (env.FORCE_COLOR === 'false') {
+ forceColor = 0;
+ } else {
+ forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
+ }
+}
+
+function translateLevel(level) {
+ if (level === 0) {
+ return false;
+ }
+
+ return {
+ level,
+ hasBasic: true,
+ has256: level >= 2,
+ has16m: level >= 3
+ };
+}
+
+function supportsColor(haveStream, streamIsTTY) {
+ if (forceColor === 0) {
+ return 0;
+ }
+
+ if (hasFlag('color=16m') ||
+ hasFlag('color=full') ||
+ hasFlag('color=truecolor')) {
+ return 3;
+ }
+
+ if (hasFlag('color=256')) {
+ return 2;
+ }
+
+ if (haveStream && !streamIsTTY && forceColor === undefined) {
+ return 0;
+ }
+
+ const min = forceColor || 0;
+
+ if (env.TERM === 'dumb') {
+ return min;
+ }
+
+ if (process.platform === 'win32') {
+ // Windows 10 build 10586 is the first Windows release that supports 256 colors.
+ // Windows 10 build 14931 is the first release that supports 16m/TrueColor.
+ const osRelease = os.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 (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI', 'GITHUB_ACTIONS', 'BUILDKITE'].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 ('TERM_PROGRAM' in env) {
+ const version = 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;
+ // No default
+ }
+ }
+
+ 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 getSupportLevel(stream) {
+ const level = supportsColor(stream, stream && stream.isTTY);
+ return translateLevel(level);
+}
+
+module.exports = {
+ supportsColor: getSupportLevel,
+ stdout: translateLevel(supportsColor(true, tty.isatty(1))),
+ stderr: translateLevel(supportsColor(true, tty.isatty(2)))
+};
diff --git a/node_modules/supports-color/license b/node_modules/supports-color/license
new file mode 100644
index 0000000..e7af2f7
--- /dev/null
+++ b/node_modules/supports-color/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/supports-color/package.json b/node_modules/supports-color/package.json
new file mode 100644
index 0000000..f7182ed
--- /dev/null
+++ b/node_modules/supports-color/package.json
@@ -0,0 +1,53 @@
+{
+ "name": "supports-color",
+ "version": "7.2.0",
+ "description": "Detect whether a terminal supports color",
+ "license": "MIT",
+ "repository": "chalk/supports-color",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "scripts": {
+ "test": "xo && ava"
+ },
+ "files": [
+ "index.js",
+ "browser.js"
+ ],
+ "keywords": [
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "ansi",
+ "styles",
+ "tty",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "command-line",
+ "support",
+ "supports",
+ "capability",
+ "detect",
+ "truecolor",
+ "16m"
+ ],
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "devDependencies": {
+ "ava": "^1.4.1",
+ "import-fresh": "^3.0.0",
+ "xo": "^0.24.0"
+ },
+ "browser": "browser.js"
+}
diff --git a/node_modules/supports-color/readme.md b/node_modules/supports-color/readme.md
new file mode 100644
index 0000000..3654228
--- /dev/null
+++ b/node_modules/supports-color/readme.md
@@ -0,0 +1,76 @@
+# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)
+
+> Detect whether a terminal supports color
+
+
+## Install
+
+```
+$ npm install supports-color
+```
+
+
+## Usage
+
+```js
+const supportsColor = require('supports-color');
+
+if (supportsColor.stdout) {
+ console.log('Terminal stdout supports color');
+}
+
+if (supportsColor.stdout.has256) {
+ console.log('Terminal stdout supports 256 colors');
+}
+
+if (supportsColor.stderr.has16m) {
+ console.log('Terminal stderr supports 16 million colors (truecolor)');
+}
+```
+
+
+## API
+
+Returns an `Object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.
+
+The `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:
+
+- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)
+- `.level = 2` and `.has256 = true`: 256 color support
+- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)
+
+
+## Info
+
+It obeys the `--color` and `--no-color` CLI flags.
+
+For situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.
+
+Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.
+
+
+## Related
+
+- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module
+- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
+
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
+
+
+---
+
+<div align="center">
+ <b>
+ <a href="https://tidelift.com/subscription/pkg/npm-supports-color?utm_source=npm-supports-color&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
+ </b>
+ <br>
+ <sub>
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
+ </sub>
+</div>
+
+---
diff --git a/node_modules/wrap-ansi/index.js b/node_modules/wrap-ansi/index.js
new file mode 100755
index 0000000..d502255
--- /dev/null
+++ b/node_modules/wrap-ansi/index.js
@@ -0,0 +1,216 @@
+'use strict';
+const stringWidth = require('string-width');
+const stripAnsi = require('strip-ansi');
+const ansiStyles = require('ansi-styles');
+
+const ESCAPES = new Set([
+ '\u001B',
+ '\u009B'
+]);
+
+const END_CODE = 39;
+
+const ANSI_ESCAPE_BELL = '\u0007';
+const ANSI_CSI = '[';
+const ANSI_OSC = ']';
+const ANSI_SGR_TERMINATOR = 'm';
+const ANSI_ESCAPE_LINK = `${ANSI_OSC}8;;`;
+
+const wrapAnsi = code => `${ESCAPES.values().next().value}${ANSI_CSI}${code}${ANSI_SGR_TERMINATOR}`;
+const wrapAnsiHyperlink = uri => `${ESCAPES.values().next().value}${ANSI_ESCAPE_LINK}${uri}${ANSI_ESCAPE_BELL}`;
+
+// Calculate the length of words split on ' ', ignoring
+// the extra characters added by ansi escape codes
+const wordLengths = string => string.split(' ').map(character => stringWidth(character));
+
+// Wrap a long word across multiple rows
+// Ansi escape codes do not count towards length
+const wrapWord = (rows, word, columns) => {
+ const characters = [...word];
+
+ let isInsideEscape = false;
+ let isInsideLinkEscape = false;
+ let visible = stringWidth(stripAnsi(rows[rows.length - 1]));
+
+ for (const [index, character] of characters.entries()) {
+ const characterLength = stringWidth(character);
+
+ if (visible + characterLength <= columns) {
+ rows[rows.length - 1] += character;
+ } else {
+ rows.push(character);
+ visible = 0;
+ }
+
+ if (ESCAPES.has(character)) {
+ isInsideEscape = true;
+ isInsideLinkEscape = characters.slice(index + 1).join('').startsWith(ANSI_ESCAPE_LINK);
+ }
+
+ if (isInsideEscape) {
+ if (isInsideLinkEscape) {
+ if (character === ANSI_ESCAPE_BELL) {
+ isInsideEscape = false;
+ isInsideLinkEscape = false;
+ }
+ } else if (character === ANSI_SGR_TERMINATOR) {
+ isInsideEscape = false;
+ }
+
+ continue;
+ }
+
+ visible += characterLength;
+
+ if (visible === columns && index < characters.length - 1) {
+ rows.push('');
+ visible = 0;
+ }
+ }
+
+ // It's possible that the last row we copy over is only
+ // ansi escape characters, handle this edge-case
+ if (!visible && rows[rows.length - 1].length > 0 && rows.length > 1) {
+ rows[rows.length - 2] += rows.pop();
+ }
+};
+
+// Trims spaces from a string ignoring invisible sequences
+const stringVisibleTrimSpacesRight = string => {
+ const words = string.split(' ');
+ let last = words.length;
+
+ while (last > 0) {
+ if (stringWidth(words[last - 1]) > 0) {
+ break;
+ }
+
+ last--;
+ }
+
+ if (last === words.length) {
+ return string;
+ }
+
+ return words.slice(0, last).join(' ') + words.slice(last).join('');
+};
+
+// The wrap-ansi module can be invoked in either 'hard' or 'soft' wrap mode
+//
+// 'hard' will never allow a string to take up more than columns characters
+//
+// 'soft' allows long words to expand past the column length
+const exec = (string, columns, options = {}) => {
+ if (options.trim !== false && string.trim() === '') {
+ return '';
+ }
+
+ let returnValue = '';
+ let escapeCode;
+ let escapeUrl;
+
+ const lengths = wordLengths(string);
+ let rows = [''];
+
+ for (const [index, word] of string.split(' ').entries()) {
+ if (options.trim !== false) {
+ rows[rows.length - 1] = rows[rows.length - 1].trimStart();
+ }
+
+ let rowLength = stringWidth(rows[rows.length - 1]);
+
+ if (index !== 0) {
+ if (rowLength >= columns && (options.wordWrap === false || options.trim === false)) {
+ // If we start with a new word but the current row length equals the length of the columns, add a new row
+ rows.push('');
+ rowLength = 0;
+ }
+
+ if (rowLength > 0 || options.trim === false) {
+ rows[rows.length - 1] += ' ';
+ rowLength++;
+ }
+ }
+
+ // In 'hard' wrap mode, the length of a line is never allowed to extend past 'columns'
+ if (options.hard && lengths[index] > columns) {
+ const remainingColumns = (columns - rowLength);
+ const breaksStartingThisLine = 1 + Math.floor((lengths[index] - remainingColumns - 1) / columns);
+ const breaksStartingNextLine = Math.floor((lengths[index] - 1) / columns);
+ if (breaksStartingNextLine < breaksStartingThisLine) {
+ rows.push('');
+ }
+
+ wrapWord(rows, word, columns);
+ continue;
+ }
+
+ if (rowLength + lengths[index] > columns && rowLength > 0 && lengths[index] > 0) {
+ if (options.wordWrap === false && rowLength < columns) {
+ wrapWord(rows, word, columns);
+ continue;
+ }
+
+ rows.push('');
+ }
+
+ if (rowLength + lengths[index] > columns && options.wordWrap === false) {
+ wrapWord(rows, word, columns);
+ continue;
+ }
+
+ rows[rows.length - 1] += word;
+ }
+
+ if (options.trim !== false) {
+ rows = rows.map(stringVisibleTrimSpacesRight);
+ }
+
+ const pre = [...rows.join('\n')];
+
+ for (const [index, character] of pre.entries()) {
+ returnValue += character;
+
+ if (ESCAPES.has(character)) {
+ const {groups} = new RegExp(`(?:\\${ANSI_CSI}(?<code>\\d+)m|\\${ANSI_ESCAPE_LINK}(?<uri>.*)${ANSI_ESCAPE_BELL})`).exec(pre.slice(index).join('')) || {groups: {}};
+ if (groups.code !== undefined) {
+ const code = Number.parseFloat(groups.code);
+ escapeCode = code === END_CODE ? undefined : code;
+ } else if (groups.uri !== undefined) {
+ escapeUrl = groups.uri.length === 0 ? undefined : groups.uri;
+ }
+ }
+
+ const code = ansiStyles.codes.get(Number(escapeCode));
+
+ if (pre[index + 1] === '\n') {
+ if (escapeUrl) {
+ returnValue += wrapAnsiHyperlink('');
+ }
+
+ if (escapeCode && code) {
+ returnValue += wrapAnsi(code);
+ }
+ } else if (character === '\n') {
+ if (escapeCode && code) {
+ returnValue += wrapAnsi(escapeCode);
+ }
+
+ if (escapeUrl) {
+ returnValue += wrapAnsiHyperlink(escapeUrl);
+ }
+ }
+ }
+
+ return returnValue;
+};
+
+// For each newline, invoke the method separately
+module.exports = (string, columns, options) => {
+ return String(string)
+ .normalize()
+ .replace(/\r\n/g, '\n')
+ .split('\n')
+ .map(line => exec(line, columns, options))
+ .join('\n');
+};
diff --git a/node_modules/wrap-ansi/license b/node_modules/wrap-ansi/license
new file mode 100644
index 0000000..fa7ceba
--- /dev/null
+++ b/node_modules/wrap-ansi/license
@@ -0,0 +1,9 @@
+MIT License
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/wrap-ansi/package.json b/node_modules/wrap-ansi/package.json
new file mode 100644
index 0000000..dfb2f4f
--- /dev/null
+++ b/node_modules/wrap-ansi/package.json
@@ -0,0 +1,62 @@
+{
+ "name": "wrap-ansi",
+ "version": "7.0.0",
+ "description": "Wordwrap a string with ANSI escape codes",
+ "license": "MIT",
+ "repository": "chalk/wrap-ansi",
+ "funding": "https://github.com/chalk/wrap-ansi?sponsor=1",
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "https://sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "scripts": {
+ "test": "xo && nyc ava"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "wrap",
+ "break",
+ "wordwrap",
+ "wordbreak",
+ "linewrap",
+ "ansi",
+ "styles",
+ "color",
+ "colour",
+ "colors",
+ "terminal",
+ "console",
+ "cli",
+ "string",
+ "tty",
+ "escape",
+ "formatting",
+ "rgb",
+ "256",
+ "shell",
+ "xterm",
+ "log",
+ "logging",
+ "command-line",
+ "text"
+ ],
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "devDependencies": {
+ "ava": "^2.1.0",
+ "chalk": "^4.0.0",
+ "coveralls": "^3.0.3",
+ "has-ansi": "^4.0.0",
+ "nyc": "^15.0.1",
+ "xo": "^0.29.1"
+ }
+}
diff --git a/node_modules/wrap-ansi/readme.md b/node_modules/wrap-ansi/readme.md
new file mode 100644
index 0000000..68779ba
--- /dev/null
+++ b/node_modules/wrap-ansi/readme.md
@@ -0,0 +1,91 @@
+# wrap-ansi [![Build Status](https://travis-ci.com/chalk/wrap-ansi.svg?branch=master)](https://travis-ci.com/chalk/wrap-ansi) [![Coverage Status](https://coveralls.io/repos/github/chalk/wrap-ansi/badge.svg?branch=master)](https://coveralls.io/github/chalk/wrap-ansi?branch=master)
+
+> Wordwrap a string with [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles)
+
+## Install
+
+```
+$ npm install wrap-ansi
+```
+
+## Usage
+
+```js
+const chalk = require('chalk');
+const wrapAnsi = require('wrap-ansi');
+
+const input = 'The quick brown ' + chalk.red('fox jumped over ') +
+ 'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
+
+console.log(wrapAnsi(input, 20));
+```
+
+<img width="331" src="screenshot.png">
+
+## API
+
+### wrapAnsi(string, columns, options?)
+
+Wrap words to the specified column width.
+
+#### string
+
+Type: `string`
+
+String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\n`.
+
+#### columns
+
+Type: `number`
+
+Number of columns to wrap the text to.
+
+#### options
+
+Type: `object`
+
+##### hard
+
+Type: `boolean`\
+Default: `false`
+
+By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width.
+
+##### wordWrap
+
+Type: `boolean`\
+Default: `true`
+
+By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary.
+
+##### trim
+
+Type: `boolean`\
+Default: `true`
+
+Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim.
+
+## Related
+
+- [slice-ansi](https://github.com/chalk/slice-ansi) - Slice a string with ANSI escape codes
+- [cli-truncate](https://github.com/sindresorhus/cli-truncate) - Truncate a string to a specific width in the terminal
+- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right
+- [jsesc](https://github.com/mathiasbynens/jsesc) - Generate ASCII-only output from Unicode strings. Useful for creating test fixtures.
+
+## Maintainers
+
+- [Sindre Sorhus](https://github.com/sindresorhus)
+- [Josh Junon](https://github.com/qix-)
+- [Benjamin Coe](https://github.com/bcoe)
+
+---
+
+<div align="center">
+ <b>
+ <a href="https://tidelift.com/subscription/pkg/npm-wrap_ansi?utm_source=npm-wrap-ansi&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
+ </b>
+ <br>
+ <sub>
+ Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
+ </sub>
+</div>
diff --git a/node_modules/y18n/CHANGELOG.md b/node_modules/y18n/CHANGELOG.md
new file mode 100644
index 0000000..244d838
--- /dev/null
+++ b/node_modules/y18n/CHANGELOG.md
@@ -0,0 +1,100 @@
+# Change Log
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+### [5.0.8](https://www.github.com/yargs/y18n/compare/v5.0.7...v5.0.8) (2021-04-07)
+
+
+### Bug Fixes
+
+* **deno:** force modern release for Deno ([b1c215a](https://www.github.com/yargs/y18n/commit/b1c215aed714bee5830e76de3e335504dc2c4dab))
+
+### [5.0.7](https://www.github.com/yargs/y18n/compare/v5.0.6...v5.0.7) (2021-04-07)
+
+
+### Bug Fixes
+
+* **deno:** force release for deno ([#121](https://www.github.com/yargs/y18n/issues/121)) ([d3f2560](https://www.github.com/yargs/y18n/commit/d3f2560e6cedf2bfa2352e9eec044da53f9a06b2))
+
+### [5.0.6](https://www.github.com/yargs/y18n/compare/v5.0.5...v5.0.6) (2021-04-05)
+
+
+### Bug Fixes
+
+* **webpack:** skip readFileSync if not defined ([#117](https://www.github.com/yargs/y18n/issues/117)) ([6966fa9](https://www.github.com/yargs/y18n/commit/6966fa91d2881cc6a6c531e836099e01f4da1616))
+
+### [5.0.5](https://www.github.com/yargs/y18n/compare/v5.0.4...v5.0.5) (2020-10-25)
+
+
+### Bug Fixes
+
+* address prototype pollution issue ([#108](https://www.github.com/yargs/y18n/issues/108)) ([a9ac604](https://www.github.com/yargs/y18n/commit/a9ac604abf756dec9687be3843e2c93bfe581f25))
+
+### [5.0.4](https://www.github.com/yargs/y18n/compare/v5.0.3...v5.0.4) (2020-10-16)
+
+
+### Bug Fixes
+
+* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#105](https://www.github.com/yargs/y18n/issues/105)) ([4f85d80](https://www.github.com/yargs/y18n/commit/4f85d80dbaae6d2c7899ae394f7ad97805df4886))
+
+### [5.0.3](https://www.github.com/yargs/y18n/compare/v5.0.2...v5.0.3) (2020-10-16)
+
+
+### Bug Fixes
+
+* **exports:** node 13.0-13.6 require a string fallback ([#103](https://www.github.com/yargs/y18n/issues/103)) ([e39921e](https://www.github.com/yargs/y18n/commit/e39921e1017f88f5d8ea97ddea854ffe92d68e74))
+
+### [5.0.2](https://www.github.com/yargs/y18n/compare/v5.0.1...v5.0.2) (2020-10-01)
+
+
+### Bug Fixes
+
+* **deno:** update types for deno ^1.4.0 ([#100](https://www.github.com/yargs/y18n/issues/100)) ([3834d9a](https://www.github.com/yargs/y18n/commit/3834d9ab1332f2937c935ada5e76623290efae81))
+
+### [5.0.1](https://www.github.com/yargs/y18n/compare/v5.0.0...v5.0.1) (2020-09-05)
+
+
+### Bug Fixes
+
+* main had old index path ([#98](https://www.github.com/yargs/y18n/issues/98)) ([124f7b0](https://www.github.com/yargs/y18n/commit/124f7b047ba9596bdbdf64459988304e77f3de1b))
+
+## [5.0.0](https://www.github.com/yargs/y18n/compare/v4.0.0...v5.0.0) (2020-09-05)
+
+
+### ⚠ BREAKING CHANGES
+
+* exports maps are now used, which modifies import behavior.
+* drops Node 6 and 4. begin following Node.js LTS schedule (#89)
+
+### Features
+
+* add support for ESM and Deno [#95](https://www.github.com/yargs/y18n/issues/95)) ([4d7ae94](https://www.github.com/yargs/y18n/commit/4d7ae94bcb42e84164e2180366474b1cd321ed94))
+
+
+### Build System
+
+* drops Node 6 and 4. begin following Node.js LTS schedule ([#89](https://www.github.com/yargs/y18n/issues/89)) ([3cc0c28](https://www.github.com/yargs/y18n/commit/3cc0c287240727b84eaf1927f903612ec80f5e43))
+
+### 4.0.1 (2020-10-25)
+
+
+### Bug Fixes
+
+* address prototype pollution issue ([#108](https://www.github.com/yargs/y18n/issues/108)) ([a9ac604](https://www.github.com/yargs/y18n/commit/7de58ca0d315990cdb38234e97fc66254cdbcd71))
+
+## [4.0.0](https://github.com/yargs/y18n/compare/v3.2.1...v4.0.0) (2017-10-10)
+
+
+### Bug Fixes
+
+* allow support for falsy values like 0 in tagged literal ([#45](https://github.com/yargs/y18n/issues/45)) ([c926123](https://github.com/yargs/y18n/commit/c926123))
+
+
+### Features
+
+* **__:** added tagged template literal support ([#44](https://github.com/yargs/y18n/issues/44)) ([0598daf](https://github.com/yargs/y18n/commit/0598daf))
+
+
+### BREAKING CHANGES
+
+* **__:** dropping Node 0.10/Node 0.12 support
diff --git a/node_modules/y18n/LICENSE b/node_modules/y18n/LICENSE
new file mode 100644
index 0000000..3c157f0
--- /dev/null
+++ b/node_modules/y18n/LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2015, Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any purpose
+with or without fee is hereby granted, provided that the above copyright notice
+and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+THIS SOFTWARE.
diff --git a/node_modules/y18n/README.md b/node_modules/y18n/README.md
new file mode 100644
index 0000000..5102bb1
--- /dev/null
+++ b/node_modules/y18n/README.md
@@ -0,0 +1,127 @@
+# y18n
+
+[![NPM version][npm-image]][npm-url]
+[![js-standard-style][standard-image]][standard-url]
+[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
+
+The bare-bones internationalization library used by yargs.
+
+Inspired by [i18n](https://www.npmjs.com/package/i18n).
+
+## Examples
+
+_simple string translation:_
+
+```js
+const __ = require('y18n')().__;
+
+console.log(__('my awesome string %s', 'foo'));
+```
+
+output:
+
+`my awesome string foo`
+
+_using tagged template literals_
+
+```js
+const __ = require('y18n')().__;
+
+const str = 'foo';
+
+console.log(__`my awesome string ${str}`);
+```
+
+output:
+
+`my awesome string foo`
+
+_pluralization support:_
+
+```js
+const __n = require('y18n')().__n;
+
+console.log(__n('one fish %s', '%d fishes %s', 2, 'foo'));
+```
+
+output:
+
+`2 fishes foo`
+
+## Deno Example
+
+As of `v5` `y18n` supports [Deno](https://github.com/denoland/deno):
+
+```typescript
+import y18n from "https://deno.land/x/y18n/deno.ts";
+
+const __ = y18n({
+ locale: 'pirate',
+ directory: './test/locales'
+}).__
+
+console.info(__`Hi, ${'Ben'} ${'Coe'}!`)
+```
+
+You will need to run with `--allow-read` to load alternative locales.
+
+## JSON Language Files
+
+The JSON language files should be stored in a `./locales` folder.
+File names correspond to locales, e.g., `en.json`, `pirate.json`.
+
+When strings are observed for the first time they will be
+added to the JSON file corresponding to the current locale.
+
+## Methods
+
+### require('y18n')(config)
+
+Create an instance of y18n with the config provided, options include:
+
+* `directory`: the locale directory, default `./locales`.
+* `updateFiles`: should newly observed strings be updated in file, default `true`.
+* `locale`: what locale should be used.
+* `fallbackToLanguage`: should fallback to a language-only file (e.g. `en.json`)
+ be allowed if a file matching the locale does not exist (e.g. `en_US.json`),
+ default `true`.
+
+### y18n.\_\_(str, arg, arg, arg)
+
+Print a localized string, `%s` will be replaced with `arg`s.
+
+This function can also be used as a tag for a template literal. You can use it
+like this: <code>__&#96;hello ${'world'}&#96;</code>. This will be equivalent to
+`__('hello %s', 'world')`.
+
+### y18n.\_\_n(singularString, pluralString, count, arg, arg, arg)
+
+Print a localized string with appropriate pluralization. If `%d` is provided
+in the string, the `count` will replace this placeholder.
+
+### y18n.setLocale(str)
+
+Set the current locale being used.
+
+### y18n.getLocale()
+
+What locale is currently being used?
+
+### y18n.updateLocale(obj)
+
+Update the current locale with the key value pairs in `obj`.
+
+## Supported Node.js Versions
+
+Libraries in this ecosystem make a best effort to track
+[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a
+post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
+
+## License
+
+ISC
+
+[npm-url]: https://npmjs.org/package/y18n
+[npm-image]: https://img.shields.io/npm/v/y18n.svg
+[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
+[standard-url]: https://github.com/feross/standard
diff --git a/node_modules/y18n/build/index.cjs b/node_modules/y18n/build/index.cjs
new file mode 100644
index 0000000..b2731e1
--- /dev/null
+++ b/node_modules/y18n/build/index.cjs
@@ -0,0 +1,203 @@
+'use strict';
+
+var fs = require('fs');
+var util = require('util');
+var path = require('path');
+
+let shim;
+class Y18N {
+ constructor(opts) {
+ // configurable options.
+ opts = opts || {};
+ this.directory = opts.directory || './locales';
+ this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true;
+ this.locale = opts.locale || 'en';
+ this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true;
+ // internal stuff.
+ this.cache = Object.create(null);
+ this.writeQueue = [];
+ }
+ __(...args) {
+ if (typeof arguments[0] !== 'string') {
+ return this._taggedLiteral(arguments[0], ...arguments);
+ }
+ const str = args.shift();
+ let cb = function () { }; // start with noop.
+ if (typeof args[args.length - 1] === 'function')
+ cb = args.pop();
+ cb = cb || function () { }; // noop.
+ if (!this.cache[this.locale])
+ this._readLocaleFile();
+ // we've observed a new string, update the language file.
+ if (!this.cache[this.locale][str] && this.updateFiles) {
+ this.cache[this.locale][str] = str;
+ // include the current directory and locale,
+ // since these values could change before the
+ // write is performed.
+ this._enqueueWrite({
+ directory: this.directory,
+ locale: this.locale,
+ cb
+ });
+ }
+ else {
+ cb();
+ }
+ return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args));
+ }
+ __n() {
+ const args = Array.prototype.slice.call(arguments);
+ const singular = args.shift();
+ const plural = args.shift();
+ const quantity = args.shift();
+ let cb = function () { }; // start with noop.
+ if (typeof args[args.length - 1] === 'function')
+ cb = args.pop();
+ if (!this.cache[this.locale])
+ this._readLocaleFile();
+ let str = quantity === 1 ? singular : plural;
+ if (this.cache[this.locale][singular]) {
+ const entry = this.cache[this.locale][singular];
+ str = entry[quantity === 1 ? 'one' : 'other'];
+ }
+ // we've observed a new string, update the language file.
+ if (!this.cache[this.locale][singular] && this.updateFiles) {
+ this.cache[this.locale][singular] = {
+ one: singular,
+ other: plural
+ };
+ // include the current directory and locale,
+ // since these values could change before the
+ // write is performed.
+ this._enqueueWrite({
+ directory: this.directory,
+ locale: this.locale,
+ cb
+ });
+ }
+ else {
+ cb();
+ }
+ // if a %d placeholder is provided, add quantity
+ // to the arguments expanded by util.format.
+ const values = [str];
+ if (~str.indexOf('%d'))
+ values.push(quantity);
+ return shim.format.apply(shim.format, values.concat(args));
+ }
+ setLocale(locale) {
+ this.locale = locale;
+ }
+ getLocale() {
+ return this.locale;
+ }
+ updateLocale(obj) {
+ if (!this.cache[this.locale])
+ this._readLocaleFile();
+ for (const key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ this.cache[this.locale][key] = obj[key];
+ }
+ }
+ }
+ _taggedLiteral(parts, ...args) {
+ let str = '';
+ parts.forEach(function (part, i) {
+ const arg = args[i + 1];
+ str += part;
+ if (typeof arg !== 'undefined') {
+ str += '%s';
+ }
+ });
+ return this.__.apply(this, [str].concat([].slice.call(args, 1)));
+ }
+ _enqueueWrite(work) {
+ this.writeQueue.push(work);
+ if (this.writeQueue.length === 1)
+ this._processWriteQueue();
+ }
+ _processWriteQueue() {
+ const _this = this;
+ const work = this.writeQueue[0];
+ // destructure the enqueued work.
+ const directory = work.directory;
+ const locale = work.locale;
+ const cb = work.cb;
+ const languageFile = this._resolveLocaleFile(directory, locale);
+ const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
+ shim.fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) {
+ _this.writeQueue.shift();
+ if (_this.writeQueue.length > 0)
+ _this._processWriteQueue();
+ cb(err);
+ });
+ }
+ _readLocaleFile() {
+ let localeLookup = {};
+ const languageFile = this._resolveLocaleFile(this.directory, this.locale);
+ try {
+ // When using a bundler such as webpack, readFileSync may not be defined:
+ if (shim.fs.readFileSync) {
+ localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, 'utf-8'));
+ }
+ }
+ catch (err) {
+ if (err instanceof SyntaxError) {
+ err.message = 'syntax error in ' + languageFile;
+ }
+ if (err.code === 'ENOENT')
+ localeLookup = {};
+ else
+ throw err;
+ }
+ this.cache[this.locale] = localeLookup;
+ }
+ _resolveLocaleFile(directory, locale) {
+ let file = shim.resolve(directory, './', locale + '.json');
+ if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) {
+ // attempt fallback to language only
+ const languageFile = shim.resolve(directory, './', locale.split('_')[0] + '.json');
+ if (this._fileExistsSync(languageFile))
+ file = languageFile;
+ }
+ return file;
+ }
+ _fileExistsSync(file) {
+ return shim.exists(file);
+ }
+}
+function y18n$1(opts, _shim) {
+ shim = _shim;
+ const y18n = new Y18N(opts);
+ return {
+ __: y18n.__.bind(y18n),
+ __n: y18n.__n.bind(y18n),
+ setLocale: y18n.setLocale.bind(y18n),
+ getLocale: y18n.getLocale.bind(y18n),
+ updateLocale: y18n.updateLocale.bind(y18n),
+ locale: y18n.locale
+ };
+}
+
+var nodePlatformShim = {
+ fs: {
+ readFileSync: fs.readFileSync,
+ writeFile: fs.writeFile
+ },
+ format: util.format,
+ resolve: path.resolve,
+ exists: (file) => {
+ try {
+ return fs.statSync(file).isFile();
+ }
+ catch (err) {
+ return false;
+ }
+ }
+};
+
+const y18n = (opts) => {
+ return y18n$1(opts, nodePlatformShim);
+};
+
+module.exports = y18n;
diff --git a/node_modules/y18n/build/lib/cjs.js b/node_modules/y18n/build/lib/cjs.js
new file mode 100644
index 0000000..ff58470
--- /dev/null
+++ b/node_modules/y18n/build/lib/cjs.js
@@ -0,0 +1,6 @@
+import { y18n as _y18n } from './index.js';
+import nodePlatformShim from './platform-shims/node.js';
+const y18n = (opts) => {
+ return _y18n(opts, nodePlatformShim);
+};
+export default y18n;
diff --git a/node_modules/y18n/build/lib/index.js b/node_modules/y18n/build/lib/index.js
new file mode 100644
index 0000000..e38f335
--- /dev/null
+++ b/node_modules/y18n/build/lib/index.js
@@ -0,0 +1,174 @@
+let shim;
+class Y18N {
+ constructor(opts) {
+ // configurable options.
+ opts = opts || {};
+ this.directory = opts.directory || './locales';
+ this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true;
+ this.locale = opts.locale || 'en';
+ this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true;
+ // internal stuff.
+ this.cache = Object.create(null);
+ this.writeQueue = [];
+ }
+ __(...args) {
+ if (typeof arguments[0] !== 'string') {
+ return this._taggedLiteral(arguments[0], ...arguments);
+ }
+ const str = args.shift();
+ let cb = function () { }; // start with noop.
+ if (typeof args[args.length - 1] === 'function')
+ cb = args.pop();
+ cb = cb || function () { }; // noop.
+ if (!this.cache[this.locale])
+ this._readLocaleFile();
+ // we've observed a new string, update the language file.
+ if (!this.cache[this.locale][str] && this.updateFiles) {
+ this.cache[this.locale][str] = str;
+ // include the current directory and locale,
+ // since these values could change before the
+ // write is performed.
+ this._enqueueWrite({
+ directory: this.directory,
+ locale: this.locale,
+ cb
+ });
+ }
+ else {
+ cb();
+ }
+ return shim.format.apply(shim.format, [this.cache[this.locale][str] || str].concat(args));
+ }
+ __n() {
+ const args = Array.prototype.slice.call(arguments);
+ const singular = args.shift();
+ const plural = args.shift();
+ const quantity = args.shift();
+ let cb = function () { }; // start with noop.
+ if (typeof args[args.length - 1] === 'function')
+ cb = args.pop();
+ if (!this.cache[this.locale])
+ this._readLocaleFile();
+ let str = quantity === 1 ? singular : plural;
+ if (this.cache[this.locale][singular]) {
+ const entry = this.cache[this.locale][singular];
+ str = entry[quantity === 1 ? 'one' : 'other'];
+ }
+ // we've observed a new string, update the language file.
+ if (!this.cache[this.locale][singular] && this.updateFiles) {
+ this.cache[this.locale][singular] = {
+ one: singular,
+ other: plural
+ };
+ // include the current directory and locale,
+ // since these values could change before the
+ // write is performed.
+ this._enqueueWrite({
+ directory: this.directory,
+ locale: this.locale,
+ cb
+ });
+ }
+ else {
+ cb();
+ }
+ // if a %d placeholder is provided, add quantity
+ // to the arguments expanded by util.format.
+ const values = [str];
+ if (~str.indexOf('%d'))
+ values.push(quantity);
+ return shim.format.apply(shim.format, values.concat(args));
+ }
+ setLocale(locale) {
+ this.locale = locale;
+ }
+ getLocale() {
+ return this.locale;
+ }
+ updateLocale(obj) {
+ if (!this.cache[this.locale])
+ this._readLocaleFile();
+ for (const key in obj) {
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
+ this.cache[this.locale][key] = obj[key];
+ }
+ }
+ }
+ _taggedLiteral(parts, ...args) {
+ let str = '';
+ parts.forEach(function (part, i) {
+ const arg = args[i + 1];
+ str += part;
+ if (typeof arg !== 'undefined') {
+ str += '%s';
+ }
+ });
+ return this.__.apply(this, [str].concat([].slice.call(args, 1)));
+ }
+ _enqueueWrite(work) {
+ this.writeQueue.push(work);
+ if (this.writeQueue.length === 1)
+ this._processWriteQueue();
+ }
+ _processWriteQueue() {
+ const _this = this;
+ const work = this.writeQueue[0];
+ // destructure the enqueued work.
+ const directory = work.directory;
+ const locale = work.locale;
+ const cb = work.cb;
+ const languageFile = this._resolveLocaleFile(directory, locale);
+ const serializedLocale = JSON.stringify(this.cache[locale], null, 2);
+ shim.fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) {
+ _this.writeQueue.shift();
+ if (_this.writeQueue.length > 0)
+ _this._processWriteQueue();
+ cb(err);
+ });
+ }
+ _readLocaleFile() {
+ let localeLookup = {};
+ const languageFile = this._resolveLocaleFile(this.directory, this.locale);
+ try {
+ // When using a bundler such as webpack, readFileSync may not be defined:
+ if (shim.fs.readFileSync) {
+ localeLookup = JSON.parse(shim.fs.readFileSync(languageFile, 'utf-8'));
+ }
+ }
+ catch (err) {
+ if (err instanceof SyntaxError) {
+ err.message = 'syntax error in ' + languageFile;
+ }
+ if (err.code === 'ENOENT')
+ localeLookup = {};
+ else
+ throw err;
+ }
+ this.cache[this.locale] = localeLookup;
+ }
+ _resolveLocaleFile(directory, locale) {
+ let file = shim.resolve(directory, './', locale + '.json');
+ if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) {
+ // attempt fallback to language only
+ const languageFile = shim.resolve(directory, './', locale.split('_')[0] + '.json');
+ if (this._fileExistsSync(languageFile))
+ file = languageFile;
+ }
+ return file;
+ }
+ _fileExistsSync(file) {
+ return shim.exists(file);
+ }
+}
+export function y18n(opts, _shim) {
+ shim = _shim;
+ const y18n = new Y18N(opts);
+ return {
+ __: y18n.__.bind(y18n),
+ __n: y18n.__n.bind(y18n),
+ setLocale: y18n.setLocale.bind(y18n),
+ getLocale: y18n.getLocale.bind(y18n),
+ updateLocale: y18n.updateLocale.bind(y18n),
+ locale: y18n.locale
+ };
+}
diff --git a/node_modules/y18n/build/lib/platform-shims/node.js b/node_modules/y18n/build/lib/platform-shims/node.js
new file mode 100644
index 0000000..181208b
--- /dev/null
+++ b/node_modules/y18n/build/lib/platform-shims/node.js
@@ -0,0 +1,19 @@
+import { readFileSync, statSync, writeFile } from 'fs';
+import { format } from 'util';
+import { resolve } from 'path';
+export default {
+ fs: {
+ readFileSync,
+ writeFile
+ },
+ format,
+ resolve,
+ exists: (file) => {
+ try {
+ return statSync(file).isFile();
+ }
+ catch (err) {
+ return false;
+ }
+ }
+};
diff --git a/node_modules/y18n/index.mjs b/node_modules/y18n/index.mjs
new file mode 100644
index 0000000..46c8213
--- /dev/null
+++ b/node_modules/y18n/index.mjs
@@ -0,0 +1,8 @@
+import shim from './build/lib/platform-shims/node.js'
+import { y18n as _y18n } from './build/lib/index.js'
+
+const y18n = (opts) => {
+ return _y18n(opts, shim)
+}
+
+export default y18n
diff --git a/node_modules/y18n/package.json b/node_modules/y18n/package.json
new file mode 100644
index 0000000..4e5c1ca
--- /dev/null
+++ b/node_modules/y18n/package.json
@@ -0,0 +1,70 @@
+{
+ "name": "y18n",
+ "version": "5.0.8",
+ "description": "the bare-bones internationalization library used by yargs",
+ "exports": {
+ ".": [
+ {
+ "import": "./index.mjs",
+ "require": "./build/index.cjs"
+ },
+ "./build/index.cjs"
+ ]
+ },
+ "type": "module",
+ "module": "./build/lib/index.js",
+ "keywords": [
+ "i18n",
+ "internationalization",
+ "yargs"
+ ],
+ "homepage": "https://github.com/yargs/y18n",
+ "bugs": {
+ "url": "https://github.com/yargs/y18n/issues"
+ },
+ "repository": "yargs/y18n",
+ "license": "ISC",
+ "author": "Ben Coe <bencoe@gmail.com>",
+ "main": "./build/index.cjs",
+ "scripts": {
+ "check": "standardx **/*.ts **/*.cjs **/*.mjs",
+ "fix": "standardx --fix **/*.ts **/*.cjs **/*.mjs",
+ "pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
+ "test": "c8 --reporter=text --reporter=html mocha test/*.cjs",
+ "test:esm": "c8 --reporter=text --reporter=html mocha test/esm/*.mjs",
+ "posttest": "npm run check",
+ "coverage": "c8 report --check-coverage",
+ "precompile": "rimraf build",
+ "compile": "tsc",
+ "postcompile": "npm run build:cjs",
+ "build:cjs": "rollup -c",
+ "prepare": "npm run compile"
+ },
+ "devDependencies": {
+ "@types/node": "^14.6.4",
+ "@wessberg/rollup-plugin-ts": "^1.3.1",
+ "c8": "^7.3.0",
+ "chai": "^4.0.1",
+ "cross-env": "^7.0.2",
+ "gts": "^3.0.0",
+ "mocha": "^8.0.0",
+ "rimraf": "^3.0.2",
+ "rollup": "^2.26.10",
+ "standardx": "^7.0.0",
+ "ts-transform-default-export": "^1.0.2",
+ "typescript": "^4.0.0"
+ },
+ "files": [
+ "build",
+ "index.mjs",
+ "!*.d.ts"
+ ],
+ "engines": {
+ "node": ">=10"
+ },
+ "standardx": {
+ "ignore": [
+ "build"
+ ]
+ }
+}
diff --git a/node_modules/yargs-parser/CHANGELOG.md b/node_modules/yargs-parser/CHANGELOG.md
new file mode 100644
index 0000000..584eb86
--- /dev/null
+++ b/node_modules/yargs-parser/CHANGELOG.md
@@ -0,0 +1,308 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+## [21.1.1](https://github.com/yargs/yargs-parser/compare/yargs-parser-v21.1.0...yargs-parser-v21.1.1) (2022-08-04)
+
+
+### Bug Fixes
+
+* **typescript:** ignore .cts files during publish ([#454](https://github.com/yargs/yargs-parser/issues/454)) ([d69f9c3](https://github.com/yargs/yargs-parser/commit/d69f9c3a91c3ad2f9494d0a94e29a8b76c41b81b)), closes [#452](https://github.com/yargs/yargs-parser/issues/452)
+
+## [21.1.0](https://github.com/yargs/yargs-parser/compare/yargs-parser-v21.0.1...yargs-parser-v21.1.0) (2022-08-03)
+
+
+### Features
+
+* allow the browser build to be imported ([#443](https://github.com/yargs/yargs-parser/issues/443)) ([a89259f](https://github.com/yargs/yargs-parser/commit/a89259ff41d6f5312b3ce8a30bef343a993f395a))
+
+
+### Bug Fixes
+
+* **halt-at-non-option:** prevent known args from being parsed when "unknown-options-as-args" is enabled ([#438](https://github.com/yargs/yargs-parser/issues/438)) ([c474bc1](https://github.com/yargs/yargs-parser/commit/c474bc10c3aa0ae864b95e5722730114ef15f573))
+* node version check now uses process.versions.node ([#450](https://github.com/yargs/yargs-parser/issues/450)) ([d07bcdb](https://github.com/yargs/yargs-parser/commit/d07bcdbe43075f7201fbe8a08e491217247fe1f1))
+* parse options ending with 3+ hyphens ([#434](https://github.com/yargs/yargs-parser/issues/434)) ([4f1060b](https://github.com/yargs/yargs-parser/commit/4f1060b50759fadbac3315c5117b0c3d65b0a7d8))
+
+### [21.0.1](https://github.com/yargs/yargs-parser/compare/yargs-parser-v21.0.0...yargs-parser-v21.0.1) (2022-02-27)
+
+
+### Bug Fixes
+
+* return deno env object ([#432](https://github.com/yargs/yargs-parser/issues/432)) ([b00eb87](https://github.com/yargs/yargs-parser/commit/b00eb87b4860a890dd2dab0d6058241bbfd2b3ec))
+
+## [21.0.0](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.9...yargs-parser-v21.0.0) (2021-11-15)
+
+
+### ⚠ BREAKING CHANGES
+
+* drops support for 10 (#421)
+
+### Bug Fixes
+
+* esm json import ([#416](https://www.github.com/yargs/yargs-parser/issues/416)) ([90f970a](https://www.github.com/yargs/yargs-parser/commit/90f970a6482dd4f5b5eb18d38596dd6f02d73edf))
+* parser should preserve inner quotes ([#407](https://www.github.com/yargs/yargs-parser/issues/407)) ([ae11f49](https://www.github.com/yargs/yargs-parser/commit/ae11f496a8318ea8885aa25015d429b33713c314))
+
+
+### Code Refactoring
+
+* drops support for 10 ([#421](https://www.github.com/yargs/yargs-parser/issues/421)) ([3aaf878](https://www.github.com/yargs/yargs-parser/commit/3aaf8784f5c7f2aec6108c1c6a55537fa7e3b5c1))
+
+### [20.2.9](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.8...yargs-parser-v20.2.9) (2021-06-20)
+
+
+### Bug Fixes
+
+* **build:** fixed automated release pipeline ([1fe9135](https://www.github.com/yargs/yargs-parser/commit/1fe9135884790a083615419b2861683e2597dac3))
+
+### [20.2.8](https://www.github.com/yargs/yargs-parser/compare/yargs-parser-v20.2.7...yargs-parser-v20.2.8) (2021-06-20)
+
+
+### Bug Fixes
+
+* **locale:** Turkish camelize and decamelize issues with toLocaleLowerCase/toLocaleUpperCase ([2617303](https://www.github.com/yargs/yargs-parser/commit/261730383e02448562f737b94bbd1f164aed5143))
+* **perf:** address slow parse when using unknown-options-as-args ([#394](https://www.github.com/yargs/yargs-parser/issues/394)) ([441f059](https://www.github.com/yargs/yargs-parser/commit/441f059d585d446551068ad213db79ac91daf83a))
+* **string-utils:** detect [0,1] ranged values as numbers ([#388](https://www.github.com/yargs/yargs-parser/issues/388)) ([efcc32c](https://www.github.com/yargs/yargs-parser/commit/efcc32c2d6b09aba31abfa2db9bd947befe5586b))
+
+### [20.2.7](https://www.github.com/yargs/yargs-parser/compare/v20.2.6...v20.2.7) (2021-03-10)
+
+
+### Bug Fixes
+
+* **deno:** force release for Deno ([6687c97](https://www.github.com/yargs/yargs-parser/commit/6687c972d0f3ca7865a97908dde3080b05f8b026))
+
+### [20.2.6](https://www.github.com/yargs/yargs-parser/compare/v20.2.5...v20.2.6) (2021-02-22)
+
+
+### Bug Fixes
+
+* **populate--:** -- should always be array ([#354](https://www.github.com/yargs/yargs-parser/issues/354)) ([585ae8f](https://www.github.com/yargs/yargs-parser/commit/585ae8ffad74cc02974f92d788e750137fd65146))
+
+### [20.2.5](https://www.github.com/yargs/yargs-parser/compare/v20.2.4...v20.2.5) (2021-02-13)
+
+
+### Bug Fixes
+
+* do not lowercase camel cased string ([#348](https://www.github.com/yargs/yargs-parser/issues/348)) ([5f4da1f](https://www.github.com/yargs/yargs-parser/commit/5f4da1f17d9d50542d2aaa206c9806ce3e320335))
+
+### [20.2.4](https://www.github.com/yargs/yargs-parser/compare/v20.2.3...v20.2.4) (2020-11-09)
+
+
+### Bug Fixes
+
+* **deno:** address import issues in Deno ([#339](https://www.github.com/yargs/yargs-parser/issues/339)) ([3b54e5e](https://www.github.com/yargs/yargs-parser/commit/3b54e5eef6e9a7b7c6eec7c12bab3ba3b8ba8306))
+
+### [20.2.3](https://www.github.com/yargs/yargs-parser/compare/v20.2.2...v20.2.3) (2020-10-16)
+
+
+### Bug Fixes
+
+* **exports:** node 13.0 and 13.1 require the dotted object form _with_ a string fallback ([#336](https://www.github.com/yargs/yargs-parser/issues/336)) ([3ae7242](https://www.github.com/yargs/yargs-parser/commit/3ae7242040ff876d28dabded60ac226e00150c88))
+
+### [20.2.2](https://www.github.com/yargs/yargs-parser/compare/v20.2.1...v20.2.2) (2020-10-14)
+
+
+### Bug Fixes
+
+* **exports:** node 13.0-13.6 require a string fallback ([#333](https://www.github.com/yargs/yargs-parser/issues/333)) ([291aeda](https://www.github.com/yargs/yargs-parser/commit/291aeda06b685b7a015d83bdf2558e180b37388d))
+
+### [20.2.1](https://www.github.com/yargs/yargs-parser/compare/v20.2.0...v20.2.1) (2020-10-01)
+
+
+### Bug Fixes
+
+* **deno:** update types for deno ^1.4.0 ([#330](https://www.github.com/yargs/yargs-parser/issues/330)) ([0ab92e5](https://www.github.com/yargs/yargs-parser/commit/0ab92e50b090f11196334c048c9c92cecaddaf56))
+
+## [20.2.0](https://www.github.com/yargs/yargs-parser/compare/v20.1.0...v20.2.0) (2020-09-21)
+
+
+### Features
+
+* **string-utils:** export looksLikeNumber helper ([#324](https://www.github.com/yargs/yargs-parser/issues/324)) ([c8580a2](https://www.github.com/yargs/yargs-parser/commit/c8580a2327b55f6342acecb6e72b62963d506750))
+
+
+### Bug Fixes
+
+* **unknown-options-as-args:** convert positionals that look like numbers ([#326](https://www.github.com/yargs/yargs-parser/issues/326)) ([f85ebb4](https://www.github.com/yargs/yargs-parser/commit/f85ebb4face9d4b0f56147659404cbe0002f3dad))
+
+## [20.1.0](https://www.github.com/yargs/yargs-parser/compare/v20.0.0...v20.1.0) (2020-09-20)
+
+
+### Features
+
+* adds parse-positional-numbers configuration ([#321](https://www.github.com/yargs/yargs-parser/issues/321)) ([9cec00a](https://www.github.com/yargs/yargs-parser/commit/9cec00a622251292ffb7dce6f78f5353afaa0d4c))
+
+
+### Bug Fixes
+
+* **build:** update release-please; make labels kick off builds ([#323](https://www.github.com/yargs/yargs-parser/issues/323)) ([09f448b](https://www.github.com/yargs/yargs-parser/commit/09f448b4cd66e25d2872544718df46dab8af062a))
+
+## [20.0.0](https://www.github.com/yargs/yargs-parser/compare/v19.0.4...v20.0.0) (2020-09-09)
+
+
+### ⚠ BREAKING CHANGES
+
+* do not ship type definitions (#318)
+
+### Bug Fixes
+
+* only strip camel case if hyphenated ([#316](https://www.github.com/yargs/yargs-parser/issues/316)) ([95a9e78](https://www.github.com/yargs/yargs-parser/commit/95a9e785127b9bbf2d1db1f1f808ca1fb100e82a)), closes [#315](https://www.github.com/yargs/yargs-parser/issues/315)
+
+
+### Code Refactoring
+
+* do not ship type definitions ([#318](https://www.github.com/yargs/yargs-parser/issues/318)) ([8fbd56f](https://www.github.com/yargs/yargs-parser/commit/8fbd56f1d0b6c44c30fca62708812151ca0ce330))
+
+### [19.0.4](https://www.github.com/yargs/yargs-parser/compare/v19.0.3...v19.0.4) (2020-08-27)
+
+
+### Bug Fixes
+
+* **build:** fixing publication ([#310](https://www.github.com/yargs/yargs-parser/issues/310)) ([5d3c6c2](https://www.github.com/yargs/yargs-parser/commit/5d3c6c29a9126248ba601920d9cf87c78e161ff5))
+
+### [19.0.3](https://www.github.com/yargs/yargs-parser/compare/v19.0.2...v19.0.3) (2020-08-27)
+
+
+### Bug Fixes
+
+* **build:** switch to action for publish ([#308](https://www.github.com/yargs/yargs-parser/issues/308)) ([5c2f305](https://www.github.com/yargs/yargs-parser/commit/5c2f30585342bcd8aaf926407c863099d256d174))
+
+### [19.0.2](https://www.github.com/yargs/yargs-parser/compare/v19.0.1...v19.0.2) (2020-08-27)
+
+
+### Bug Fixes
+
+* **types:** envPrefix should be optional ([#305](https://www.github.com/yargs/yargs-parser/issues/305)) ([ae3f180](https://www.github.com/yargs/yargs-parser/commit/ae3f180e14df2de2fd962145f4518f9aa0e76523))
+
+### [19.0.1](https://www.github.com/yargs/yargs-parser/compare/v19.0.0...v19.0.1) (2020-08-09)
+
+
+### Bug Fixes
+
+* **build:** push tag created for deno ([2186a14](https://www.github.com/yargs/yargs-parser/commit/2186a14989749887d56189867602e39e6679f8b0))
+
+## [19.0.0](https://www.github.com/yargs/yargs-parser/compare/v18.1.3...v19.0.0) (2020-08-09)
+
+
+### ⚠ BREAKING CHANGES
+
+* adds support for ESM and Deno (#295)
+* **ts:** projects using `@types/yargs-parser` may see variations in type definitions.
+* drops Node 6. begin following Node.js LTS schedule (#278)
+
+### Features
+
+* adds support for ESM and Deno ([#295](https://www.github.com/yargs/yargs-parser/issues/295)) ([195bc4a](https://www.github.com/yargs/yargs-parser/commit/195bc4a7f20c2a8f8e33fbb6ba96ef6e9a0120a1))
+* expose camelCase and decamelize helpers ([#296](https://www.github.com/yargs/yargs-parser/issues/296)) ([39154ce](https://www.github.com/yargs/yargs-parser/commit/39154ceb5bdcf76b5f59a9219b34cedb79b67f26))
+* **deps:** update to latest camelcase/decamelize ([#281](https://www.github.com/yargs/yargs-parser/issues/281)) ([8931ab0](https://www.github.com/yargs/yargs-parser/commit/8931ab08f686cc55286f33a95a83537da2be5516))
+
+
+### Bug Fixes
+
+* boolean numeric short option ([#294](https://www.github.com/yargs/yargs-parser/issues/294)) ([f600082](https://www.github.com/yargs/yargs-parser/commit/f600082c959e092076caf420bbbc9d7a231e2418))
+* raise permission error for Deno if config load fails ([#298](https://www.github.com/yargs/yargs-parser/issues/298)) ([1174e2b](https://www.github.com/yargs/yargs-parser/commit/1174e2b3f0c845a1cd64e14ffc3703e730567a84))
+* **deps:** update dependency decamelize to v3 ([#274](https://www.github.com/yargs/yargs-parser/issues/274)) ([4d98698](https://www.github.com/yargs/yargs-parser/commit/4d98698bc6767e84ec54a0842908191739be73b7))
+* **types:** switch back to using Partial types ([#293](https://www.github.com/yargs/yargs-parser/issues/293)) ([bdc80ba](https://www.github.com/yargs/yargs-parser/commit/bdc80ba59fa13bc3025ce0a85e8bad9f9da24ea7))
+
+
+### Build System
+
+* drops Node 6. begin following Node.js LTS schedule ([#278](https://www.github.com/yargs/yargs-parser/issues/278)) ([9014ed7](https://www.github.com/yargs/yargs-parser/commit/9014ed722a32768b96b829e65a31705db5c1458a))
+
+
+### Code Refactoring
+
+* **ts:** move index.js to TypeScript ([#292](https://www.github.com/yargs/yargs-parser/issues/292)) ([f78d2b9](https://www.github.com/yargs/yargs-parser/commit/f78d2b97567ac4828624406e420b4047c710b789))
+
+### [18.1.3](https://www.github.com/yargs/yargs-parser/compare/v18.1.2...v18.1.3) (2020-04-16)
+
+
+### Bug Fixes
+
+* **setArg:** options using camel-case and dot-notation populated twice ([#268](https://www.github.com/yargs/yargs-parser/issues/268)) ([f7e15b9](https://www.github.com/yargs/yargs-parser/commit/f7e15b9800900b9856acac1a830a5f35847be73e))
+
+### [18.1.2](https://www.github.com/yargs/yargs-parser/compare/v18.1.1...v18.1.2) (2020-03-26)
+
+
+### Bug Fixes
+
+* **array, nargs:** support -o=--value and --option=--value format ([#262](https://www.github.com/yargs/yargs-parser/issues/262)) ([41d3f81](https://www.github.com/yargs/yargs-parser/commit/41d3f8139e116706b28de9b0de3433feb08d2f13))
+
+### [18.1.1](https://www.github.com/yargs/yargs-parser/compare/v18.1.0...v18.1.1) (2020-03-16)
+
+
+### Bug Fixes
+
+* \_\_proto\_\_ will now be replaced with \_\_\_proto\_\_\_ in parse ([#258](https://www.github.com/yargs/yargs-parser/issues/258)), patching a potential
+prototype pollution vulnerability. This was reported by the Snyk Security Research Team.([63810ca](https://www.github.com/yargs/yargs-parser/commit/63810ca1ae1a24b08293a4d971e70e058c7a41e2))
+
+## [18.1.0](https://www.github.com/yargs/yargs-parser/compare/v18.0.0...v18.1.0) (2020-03-07)
+
+
+### Features
+
+* introduce single-digit boolean aliases ([#255](https://www.github.com/yargs/yargs-parser/issues/255)) ([9c60265](https://www.github.com/yargs/yargs-parser/commit/9c60265fd7a03cb98e6df3e32c8c5e7508d9f56f))
+
+## [18.0.0](https://www.github.com/yargs/yargs-parser/compare/v17.1.0...v18.0.0) (2020-03-02)
+
+
+### ⚠ BREAKING CHANGES
+
+* the narg count is now enforced when parsing arrays.
+
+### Features
+
+* NaN can now be provided as a value for nargs, indicating "at least" one value is expected for array ([#251](https://www.github.com/yargs/yargs-parser/issues/251)) ([9db4be8](https://www.github.com/yargs/yargs-parser/commit/9db4be81417a2c7097128db34d86fe70ef4af70c))
+
+## [17.1.0](https://www.github.com/yargs/yargs-parser/compare/v17.0.1...v17.1.0) (2020-03-01)
+
+
+### Features
+
+* introduce greedy-arrays config, for specifying whether arrays consume multiple positionals ([#249](https://www.github.com/yargs/yargs-parser/issues/249)) ([60e880a](https://www.github.com/yargs/yargs-parser/commit/60e880a837046314d89fa4725f923837fd33a9eb))
+
+### [17.0.1](https://www.github.com/yargs/yargs-parser/compare/v17.0.0...v17.0.1) (2020-02-29)
+
+
+### Bug Fixes
+
+* normalized keys were not enumerable ([#247](https://www.github.com/yargs/yargs-parser/issues/247)) ([57119f9](https://www.github.com/yargs/yargs-parser/commit/57119f9f17cf27499bd95e61c2f72d18314f11ba))
+
+## [17.0.0](https://www.github.com/yargs/yargs-parser/compare/v16.1.0...v17.0.0) (2020-02-10)
+
+
+### ⚠ BREAKING CHANGES
+
+* this reverts parsing behavior of booleans to that of yargs@14
+* objects used during parsing are now created with a null
+prototype. There may be some scenarios where this change in behavior
+leaks externally.
+
+### Features
+
+* boolean arguments will not be collected into an implicit array ([#236](https://www.github.com/yargs/yargs-parser/issues/236)) ([34c4e19](https://www.github.com/yargs/yargs-parser/commit/34c4e19bae4e7af63e3cb6fa654a97ed476e5eb5))
+* introduce nargs-eats-options config option ([#246](https://www.github.com/yargs/yargs-parser/issues/246)) ([d50822a](https://www.github.com/yargs/yargs-parser/commit/d50822ac10e1b05f2e9643671ca131ac251b6732))
+
+
+### Bug Fixes
+
+* address bugs with "uknown-options-as-args" ([bc023e3](https://www.github.com/yargs/yargs-parser/commit/bc023e3b13e20a118353f9507d1c999bf388a346))
+* array should take precedence over nargs, but enforce nargs ([#243](https://www.github.com/yargs/yargs-parser/issues/243)) ([4cbc188](https://www.github.com/yargs/yargs-parser/commit/4cbc188b7abb2249529a19c090338debdad2fe6c))
+* support keys that collide with object prototypes ([#234](https://www.github.com/yargs/yargs-parser/issues/234)) ([1587b6d](https://www.github.com/yargs/yargs-parser/commit/1587b6d91db853a9109f1be6b209077993fee4de))
+* unknown options terminated with digits now handled by unknown-options-as-args ([#238](https://www.github.com/yargs/yargs-parser/issues/238)) ([d36cdfa](https://www.github.com/yargs/yargs-parser/commit/d36cdfa854254d7c7e0fe1d583818332ac46c2a5))
+
+## [16.1.0](https://www.github.com/yargs/yargs-parser/compare/v16.0.0...v16.1.0) (2019-11-01)
+
+
+### ⚠ BREAKING CHANGES
+
+* populate error if incompatible narg/count or array/count options are used (#191)
+
+### Features
+
+* options that have had their default value used are now tracked ([#211](https://www.github.com/yargs/yargs-parser/issues/211)) ([a525234](https://www.github.com/yargs/yargs-parser/commit/a525234558c847deedd73f8792e0a3b77b26e2c0))
+* populate error if incompatible narg/count or array/count options are used ([#191](https://www.github.com/yargs/yargs-parser/issues/191)) ([84a401f](https://www.github.com/yargs/yargs-parser/commit/84a401f0fa3095e0a19661670d1570d0c3b9d3c9))
+
+
+### Reverts
+
+* revert 16.0.0 CHANGELOG entry ([920320a](https://www.github.com/yargs/yargs-parser/commit/920320ad9861bbfd58eda39221ae211540fc1daf))
diff --git a/node_modules/yargs-parser/LICENSE.txt b/node_modules/yargs-parser/LICENSE.txt
new file mode 100644
index 0000000..836440b
--- /dev/null
+++ b/node_modules/yargs-parser/LICENSE.txt
@@ -0,0 +1,14 @@
+Copyright (c) 2016, Contributors
+
+Permission to use, copy, modify, and/or distribute this software
+for any purpose with or without fee is hereby granted, provided
+that the above copyright notice and this permission notice
+appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
+LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
+OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/yargs-parser/README.md b/node_modules/yargs-parser/README.md
new file mode 100644
index 0000000..2614840
--- /dev/null
+++ b/node_modules/yargs-parser/README.md
@@ -0,0 +1,518 @@
+# yargs-parser
+
+![ci](https://github.com/yargs/yargs-parser/workflows/ci/badge.svg)
+[![NPM version](https://img.shields.io/npm/v/yargs-parser.svg)](https://www.npmjs.com/package/yargs-parser)
+[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
+![nycrc config on GitHub](https://img.shields.io/nycrc/yargs/yargs-parser)
+
+The mighty option parser used by [yargs](https://github.com/yargs/yargs).
+
+visit the [yargs website](http://yargs.js.org/) for more examples, and thorough usage instructions.
+
+<img width="250" src="https://raw.githubusercontent.com/yargs/yargs-parser/main/yargs-logo.png">
+
+## Example
+
+```sh
+npm i yargs-parser --save
+```
+
+```js
+const argv = require('yargs-parser')(process.argv.slice(2))
+console.log(argv)
+```
+
+```console
+$ node example.js --foo=33 --bar hello
+{ _: [], foo: 33, bar: 'hello' }
+```
+
+_or parse a string!_
+
+```js
+const argv = require('yargs-parser')('--foo=99 --bar=33')
+console.log(argv)
+```
+
+```console
+{ _: [], foo: 99, bar: 33 }
+```
+
+Convert an array of mixed types before passing to `yargs-parser`:
+
+```js
+const parse = require('yargs-parser')
+parse(['-f', 11, '--zoom', 55].join(' ')) // <-- array to string
+parse(['-f', 11, '--zoom', 55].map(String)) // <-- array of strings
+```
+
+## Deno Example
+
+As of `v19` `yargs-parser` supports [Deno](https://github.com/denoland/deno):
+
+```typescript
+import parser from "https://deno.land/x/yargs_parser/deno.ts";
+
+const argv = parser('--foo=99 --bar=9987930', {
+ string: ['bar']
+})
+console.log(argv)
+```
+
+## ESM Example
+
+As of `v19` `yargs-parser` supports ESM (_both in Node.js and in the browser_):
+
+**Node.js:**
+
+```js
+import parser from 'yargs-parser'
+
+const argv = parser('--foo=99 --bar=9987930', {
+ string: ['bar']
+})
+console.log(argv)
+```
+
+**Browsers:**
+
+```html
+<!doctype html>
+<body>
+ <script type="module">
+ import parser from "https://unpkg.com/yargs-parser@19.0.0/browser.js";
+
+ const argv = parser('--foo=99 --bar=9987930', {
+ string: ['bar']
+ })
+ console.log(argv)
+ </script>
+</body>
+```
+
+## API
+
+### parser(args, opts={})
+
+Parses command line arguments returning a simple mapping of keys and values.
+
+**expects:**
+
+* `args`: a string or array of strings representing the options to parse.
+* `opts`: provide a set of hints indicating how `args` should be parsed:
+ * `opts.alias`: an object representing the set of aliases for a key: `{alias: {foo: ['f']}}`.
+ * `opts.array`: indicate that keys should be parsed as an array: `{array: ['foo', 'bar']}`.<br>
+ Indicate that keys should be parsed as an array and coerced to booleans / numbers:<br>
+ `{array: [{ key: 'foo', boolean: true }, {key: 'bar', number: true}]}`.
+ * `opts.boolean`: arguments should be parsed as booleans: `{boolean: ['x', 'y']}`.
+ * `opts.coerce`: provide a custom synchronous function that returns a coerced value from the argument provided
+ (or throws an error). For arrays the function is called only once for the entire array:<br>
+ `{coerce: {foo: function (arg) {return modifiedArg}}}`.
+ * `opts.config`: indicate a key that represents a path to a configuration file (this file will be loaded and parsed).
+ * `opts.configObjects`: configuration objects to parse, their properties will be set as arguments:<br>
+ `{configObjects: [{'x': 5, 'y': 33}, {'z': 44}]}`.
+ * `opts.configuration`: provide configuration options to the yargs-parser (see: [configuration](#configuration)).
+ * `opts.count`: indicate a key that should be used as a counter, e.g., `-vvv` = `{v: 3}`.
+ * `opts.default`: provide default values for keys: `{default: {x: 33, y: 'hello world!'}}`.
+ * `opts.envPrefix`: environment variables (`process.env`) with the prefix provided should be parsed.
+ * `opts.narg`: specify that a key requires `n` arguments: `{narg: {x: 2}}`.
+ * `opts.normalize`: `path.normalize()` will be applied to values set to this key.
+ * `opts.number`: keys should be treated as numbers.
+ * `opts.string`: keys should be treated as strings (even if they resemble a number `-x 33`).
+
+**returns:**
+
+* `obj`: an object representing the parsed value of `args`
+ * `key/value`: key value pairs for each argument and their aliases.
+ * `_`: an array representing the positional arguments.
+ * [optional] `--`: an array with arguments after the end-of-options flag `--`.
+
+### require('yargs-parser').detailed(args, opts={})
+
+Parses a command line string, returning detailed information required by the
+yargs engine.
+
+**expects:**
+
+* `args`: a string or array of strings representing options to parse.
+* `opts`: provide a set of hints indicating how `args`, inputs are identical to `require('yargs-parser')(args, opts={})`.
+
+**returns:**
+
+* `argv`: an object representing the parsed value of `args`
+ * `key/value`: key value pairs for each argument and their aliases.
+ * `_`: an array representing the positional arguments.
+ * [optional] `--`: an array with arguments after the end-of-options flag `--`.
+* `error`: populated with an error object if an exception occurred during parsing.
+* `aliases`: the inferred list of aliases built by combining lists in `opts.alias`.
+* `newAliases`: any new aliases added via camel-case expansion:
+ * `boolean`: `{ fooBar: true }`
+* `defaulted`: any new argument created by `opts.default`, no aliases included.
+ * `boolean`: `{ foo: true }`
+* `configuration`: given by default settings and `opts.configuration`.
+
+<a name="configuration"></a>
+
+### Configuration
+
+The yargs-parser applies several automated transformations on the keys provided
+in `args`. These features can be turned on and off using the `configuration` field
+of `opts`.
+
+```js
+var parsed = parser(['--no-dice'], {
+ configuration: {
+ 'boolean-negation': false
+ }
+})
+```
+
+### short option groups
+
+* default: `true`.
+* key: `short-option-groups`.
+
+Should a group of short-options be treated as boolean flags?
+
+```console
+$ node example.js -abc
+{ _: [], a: true, b: true, c: true }
+```
+
+_if disabled:_
+
+```console
+$ node example.js -abc
+{ _: [], abc: true }
+```
+
+### camel-case expansion
+
+* default: `true`.
+* key: `camel-case-expansion`.
+
+Should hyphenated arguments be expanded into camel-case aliases?
+
+```console
+$ node example.js --foo-bar
+{ _: [], 'foo-bar': true, fooBar: true }
+```
+
+_if disabled:_
+
+```console
+$ node example.js --foo-bar
+{ _: [], 'foo-bar': true }
+```
+
+### dot-notation
+
+* default: `true`
+* key: `dot-notation`
+
+Should keys that contain `.` be treated as objects?
+
+```console
+$ node example.js --foo.bar
+{ _: [], foo: { bar: true } }
+```
+
+_if disabled:_
+
+```console
+$ node example.js --foo.bar
+{ _: [], "foo.bar": true }
+```
+
+### parse numbers
+
+* default: `true`
+* key: `parse-numbers`
+
+Should keys that look like numbers be treated as such?
+
+```console
+$ node example.js --foo=99.3
+{ _: [], foo: 99.3 }
+```
+
+_if disabled:_
+
+```console
+$ node example.js --foo=99.3
+{ _: [], foo: "99.3" }
+```
+
+### parse positional numbers
+
+* default: `true`
+* key: `parse-positional-numbers`
+
+Should positional keys that look like numbers be treated as such.
+
+```console
+$ node example.js 99.3
+{ _: [99.3] }
+```
+
+_if disabled:_
+
+```console
+$ node example.js 99.3
+{ _: ['99.3'] }
+```
+
+### boolean negation
+
+* default: `true`
+* key: `boolean-negation`
+
+Should variables prefixed with `--no` be treated as negations?
+
+```console
+$ node example.js --no-foo
+{ _: [], foo: false }
+```
+
+_if disabled:_
+
+```console
+$ node example.js --no-foo
+{ _: [], "no-foo": true }
+```
+
+### combine arrays
+
+* default: `false`
+* key: `combine-arrays`
+
+Should arrays be combined when provided by both command line arguments and
+a configuration file.
+
+### duplicate arguments array
+
+* default: `true`
+* key: `duplicate-arguments-array`
+
+Should arguments be coerced into an array when duplicated:
+
+```console
+$ node example.js -x 1 -x 2
+{ _: [], x: [1, 2] }
+```
+
+_if disabled:_
+
+```console
+$ node example.js -x 1 -x 2
+{ _: [], x: 2 }
+```
+
+### flatten duplicate arrays
+
+* default: `true`
+* key: `flatten-duplicate-arrays`
+
+Should array arguments be coerced into a single array when duplicated:
+
+```console
+$ node example.js -x 1 2 -x 3 4
+{ _: [], x: [1, 2, 3, 4] }
+```
+
+_if disabled:_
+
+```console
+$ node example.js -x 1 2 -x 3 4
+{ _: [], x: [[1, 2], [3, 4]] }
+```
+
+### greedy arrays
+
+* default: `true`
+* key: `greedy-arrays`
+
+Should arrays consume more than one positional argument following their flag.
+
+```console
+$ node example --arr 1 2
+{ _: [], arr: [1, 2] }
+```
+
+_if disabled:_
+
+```console
+$ node example --arr 1 2
+{ _: [2], arr: [1] }
+```
+
+**Note: in `v18.0.0` we are considering defaulting greedy arrays to `false`.**
+
+### nargs eats options
+
+* default: `false`
+* key: `nargs-eats-options`
+
+Should nargs consume dash options as well as positional arguments.
+
+### negation prefix
+
+* default: `no-`
+* key: `negation-prefix`
+
+The prefix to use for negated boolean variables.
+
+```console
+$ node example.js --no-foo
+{ _: [], foo: false }
+```
+
+_if set to `quux`:_
+
+```console
+$ node example.js --quuxfoo
+{ _: [], foo: false }
+```
+
+### populate --
+
+* default: `false`.
+* key: `populate--`
+
+Should unparsed flags be stored in `--` or `_`.
+
+_If disabled:_
+
+```console
+$ node example.js a -b -- x y
+{ _: [ 'a', 'x', 'y' ], b: true }
+```
+
+_If enabled:_
+
+```console
+$ node example.js a -b -- x y
+{ _: [ 'a' ], '--': [ 'x', 'y' ], b: true }
+```
+
+### set placeholder key
+
+* default: `false`.
+* key: `set-placeholder-key`.
+
+Should a placeholder be added for keys not set via the corresponding CLI argument?
+
+_If disabled:_
+
+```console
+$ node example.js -a 1 -c 2
+{ _: [], a: 1, c: 2 }
+```
+
+_If enabled:_
+
+```console
+$ node example.js -a 1 -c 2
+{ _: [], a: 1, b: undefined, c: 2 }
+```
+
+### halt at non-option
+
+* default: `false`.
+* key: `halt-at-non-option`.
+
+Should parsing stop at the first positional argument? This is similar to how e.g. `ssh` parses its command line.
+
+_If disabled:_
+
+```console
+$ node example.js -a run b -x y
+{ _: [ 'b' ], a: 'run', x: 'y' }
+```
+
+_If enabled:_
+
+```console
+$ node example.js -a run b -x y
+{ _: [ 'b', '-x', 'y' ], a: 'run' }
+```
+
+### strip aliased
+
+* default: `false`
+* key: `strip-aliased`
+
+Should aliases be removed before returning results?
+
+_If disabled:_
+
+```console
+$ node example.js --test-field 1
+{ _: [], 'test-field': 1, testField: 1, 'test-alias': 1, testAlias: 1 }
+```
+
+_If enabled:_
+
+```console
+$ node example.js --test-field 1
+{ _: [], 'test-field': 1, testField: 1 }
+```
+
+### strip dashed
+
+* default: `false`
+* key: `strip-dashed`
+
+Should dashed keys be removed before returning results? This option has no effect if
+`camel-case-expansion` is disabled.
+
+_If disabled:_
+
+```console
+$ node example.js --test-field 1
+{ _: [], 'test-field': 1, testField: 1 }
+```
+
+_If enabled:_
+
+```console
+$ node example.js --test-field 1
+{ _: [], testField: 1 }
+```
+
+### unknown options as args
+
+* default: `false`
+* key: `unknown-options-as-args`
+
+Should unknown options be treated like regular arguments? An unknown option is one that is not
+configured in `opts`.
+
+_If disabled_
+
+```console
+$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2
+{ _: [], unknownOption: true, knownOption: 2, stringOption: '', unknownOption2: true }
+```
+
+_If enabled_
+
+```console
+$ node example.js --unknown-option --known-option 2 --string-option --unknown-option2
+{ _: ['--unknown-option'], knownOption: 2, stringOption: '--unknown-option2' }
+```
+
+## Supported Node.js Versions
+
+Libraries in this ecosystem make a best effort to track
+[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a
+post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
+
+## Special Thanks
+
+The yargs project evolves from optimist and minimist. It owes its
+existence to a lot of James Halliday's hard work. Thanks [substack](https://github.com/substack) **beep** **boop** \o/
+
+## License
+
+ISC
diff --git a/node_modules/yargs-parser/browser.js b/node_modules/yargs-parser/browser.js
new file mode 100644
index 0000000..241202c
--- /dev/null
+++ b/node_modules/yargs-parser/browser.js
@@ -0,0 +1,29 @@
+// Main entrypoint for ESM web browser environments. Avoids using Node.js
+// specific libraries, such as "path".
+//
+// TODO: figure out reasonable web equivalents for "resolve", "normalize", etc.
+import { camelCase, decamelize, looksLikeNumber } from './build/lib/string-utils.js'
+import { YargsParser } from './build/lib/yargs-parser.js'
+const parser = new YargsParser({
+ cwd: () => { return '' },
+ format: (str, arg) => { return str.replace('%s', arg) },
+ normalize: (str) => { return str },
+ resolve: (str) => { return str },
+ require: () => {
+ throw Error('loading config from files not currently supported in browser')
+ },
+ env: () => {}
+})
+
+const yargsParser = function Parser (args, opts) {
+ const result = parser.parse(args.slice(), opts)
+ return result.argv
+}
+yargsParser.detailed = function (args, opts) {
+ return parser.parse(args.slice(), opts)
+}
+yargsParser.camelCase = camelCase
+yargsParser.decamelize = decamelize
+yargsParser.looksLikeNumber = looksLikeNumber
+
+export default yargsParser
diff --git a/node_modules/yargs-parser/build/index.cjs b/node_modules/yargs-parser/build/index.cjs
new file mode 100644
index 0000000..cf6f50f
--- /dev/null
+++ b/node_modules/yargs-parser/build/index.cjs
@@ -0,0 +1,1050 @@
+'use strict';
+
+var util = require('util');
+var path = require('path');
+var fs = require('fs');
+
+function camelCase(str) {
+ const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
+ if (!isCamelCase) {
+ str = str.toLowerCase();
+ }
+ if (str.indexOf('-') === -1 && str.indexOf('_') === -1) {
+ return str;
+ }
+ else {
+ let camelcase = '';
+ let nextChrUpper = false;
+ const leadingHyphens = str.match(/^-+/);
+ for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) {
+ let chr = str.charAt(i);
+ if (nextChrUpper) {
+ nextChrUpper = false;
+ chr = chr.toUpperCase();
+ }
+ if (i !== 0 && (chr === '-' || chr === '_')) {
+ nextChrUpper = true;
+ }
+ else if (chr !== '-' && chr !== '_') {
+ camelcase += chr;
+ }
+ }
+ return camelcase;
+ }
+}
+function decamelize(str, joinString) {
+ const lowercase = str.toLowerCase();
+ joinString = joinString || '-';
+ let notCamelcase = '';
+ for (let i = 0; i < str.length; i++) {
+ const chrLower = lowercase.charAt(i);
+ const chrString = str.charAt(i);
+ if (chrLower !== chrString && i > 0) {
+ notCamelcase += `${joinString}${lowercase.charAt(i)}`;
+ }
+ else {
+ notCamelcase += chrString;
+ }
+ }
+ return notCamelcase;
+}
+function looksLikeNumber(x) {
+ if (x === null || x === undefined)
+ return false;
+ if (typeof x === 'number')
+ return true;
+ if (/^0x[0-9a-f]+$/i.test(x))
+ return true;
+ if (/^0[^.]/.test(x))
+ return false;
+ return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
+}
+
+function tokenizeArgString(argString) {
+ if (Array.isArray(argString)) {
+ return argString.map(e => typeof e !== 'string' ? e + '' : e);
+ }
+ argString = argString.trim();
+ let i = 0;
+ let prevC = null;
+ let c = null;
+ let opening = null;
+ const args = [];
+ for (let ii = 0; ii < argString.length; ii++) {
+ prevC = c;
+ c = argString.charAt(ii);
+ if (c === ' ' && !opening) {
+ if (!(prevC === ' ')) {
+ i++;
+ }
+ continue;
+ }
+ if (c === opening) {
+ opening = null;
+ }
+ else if ((c === "'" || c === '"') && !opening) {
+ opening = c;
+ }
+ if (!args[i])
+ args[i] = '';
+ args[i] += c;
+ }
+ return args;
+}
+
+var DefaultValuesForTypeKey;
+(function (DefaultValuesForTypeKey) {
+ DefaultValuesForTypeKey["BOOLEAN"] = "boolean";
+ DefaultValuesForTypeKey["STRING"] = "string";
+ DefaultValuesForTypeKey["NUMBER"] = "number";
+ DefaultValuesForTypeKey["ARRAY"] = "array";
+})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {}));
+
+let mixin;
+class YargsParser {
+ constructor(_mixin) {
+ mixin = _mixin;
+ }
+ parse(argsInput, options) {
+ const opts = Object.assign({
+ alias: undefined,
+ array: undefined,
+ boolean: undefined,
+ config: undefined,
+ configObjects: undefined,
+ configuration: undefined,
+ coerce: undefined,
+ count: undefined,
+ default: undefined,
+ envPrefix: undefined,
+ narg: undefined,
+ normalize: undefined,
+ string: undefined,
+ number: undefined,
+ __: undefined,
+ key: undefined
+ }, options);
+ const args = tokenizeArgString(argsInput);
+ const inputIsString = typeof argsInput === 'string';
+ const aliases = combineAliases(Object.assign(Object.create(null), opts.alias));
+ const configuration = Object.assign({
+ 'boolean-negation': true,
+ 'camel-case-expansion': true,
+ 'combine-arrays': false,
+ 'dot-notation': true,
+ 'duplicate-arguments-array': true,
+ 'flatten-duplicate-arrays': true,
+ 'greedy-arrays': true,
+ 'halt-at-non-option': false,
+ 'nargs-eats-options': false,
+ 'negation-prefix': 'no-',
+ 'parse-numbers': true,
+ 'parse-positional-numbers': true,
+ 'populate--': false,
+ 'set-placeholder-key': false,
+ 'short-option-groups': true,
+ 'strip-aliased': false,
+ 'strip-dashed': false,
+ 'unknown-options-as-args': false
+ }, opts.configuration);
+ const defaults = Object.assign(Object.create(null), opts.default);
+ const configObjects = opts.configObjects || [];
+ const envPrefix = opts.envPrefix;
+ const notFlagsOption = configuration['populate--'];
+ const notFlagsArgv = notFlagsOption ? '--' : '_';
+ const newAliases = Object.create(null);
+ const defaulted = Object.create(null);
+ const __ = opts.__ || mixin.format;
+ const flags = {
+ aliases: Object.create(null),
+ arrays: Object.create(null),
+ bools: Object.create(null),
+ strings: Object.create(null),
+ numbers: Object.create(null),
+ counts: Object.create(null),
+ normalize: Object.create(null),
+ configs: Object.create(null),
+ nargs: Object.create(null),
+ coercions: Object.create(null),
+ keys: []
+ };
+ const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;
+ const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)');
+ [].concat(opts.array || []).filter(Boolean).forEach(function (opt) {
+ const key = typeof opt === 'object' ? opt.key : opt;
+ const assignment = Object.keys(opt).map(function (key) {
+ const arrayFlagKeys = {
+ boolean: 'bools',
+ string: 'strings',
+ number: 'numbers'
+ };
+ return arrayFlagKeys[key];
+ }).filter(Boolean).pop();
+ if (assignment) {
+ flags[assignment][key] = true;
+ }
+ flags.arrays[key] = true;
+ flags.keys.push(key);
+ });
+ [].concat(opts.boolean || []).filter(Boolean).forEach(function (key) {
+ flags.bools[key] = true;
+ flags.keys.push(key);
+ });
+ [].concat(opts.string || []).filter(Boolean).forEach(function (key) {
+ flags.strings[key] = true;
+ flags.keys.push(key);
+ });
+ [].concat(opts.number || []).filter(Boolean).forEach(function (key) {
+ flags.numbers[key] = true;
+ flags.keys.push(key);
+ });
+ [].concat(opts.count || []).filter(Boolean).forEach(function (key) {
+ flags.counts[key] = true;
+ flags.keys.push(key);
+ });
+ [].concat(opts.normalize || []).filter(Boolean).forEach(function (key) {
+ flags.normalize[key] = true;
+ flags.keys.push(key);
+ });
+ if (typeof opts.narg === 'object') {
+ Object.entries(opts.narg).forEach(([key, value]) => {
+ if (typeof value === 'number') {
+ flags.nargs[key] = value;
+ flags.keys.push(key);
+ }
+ });
+ }
+ if (typeof opts.coerce === 'object') {
+ Object.entries(opts.coerce).forEach(([key, value]) => {
+ if (typeof value === 'function') {
+ flags.coercions[key] = value;
+ flags.keys.push(key);
+ }
+ });
+ }
+ if (typeof opts.config !== 'undefined') {
+ if (Array.isArray(opts.config) || typeof opts.config === 'string') {
+ [].concat(opts.config).filter(Boolean).forEach(function (key) {
+ flags.configs[key] = true;
+ });
+ }
+ else if (typeof opts.config === 'object') {
+ Object.entries(opts.config).forEach(([key, value]) => {
+ if (typeof value === 'boolean' || typeof value === 'function') {
+ flags.configs[key] = value;
+ }
+ });
+ }
+ }
+ extendAliases(opts.key, aliases, opts.default, flags.arrays);
+ Object.keys(defaults).forEach(function (key) {
+ (flags.aliases[key] || []).forEach(function (alias) {
+ defaults[alias] = defaults[key];
+ });
+ });
+ let error = null;
+ checkConfiguration();
+ let notFlags = [];
+ const argv = Object.assign(Object.create(null), { _: [] });
+ const argvReturn = {};
+ for (let i = 0; i < args.length; i++) {
+ const arg = args[i];
+ const truncatedArg = arg.replace(/^-{3,}/, '---');
+ let broken;
+ let key;
+ let letters;
+ let m;
+ let next;
+ let value;
+ if (arg !== '--' && /^-/.test(arg) && isUnknownOptionAsArg(arg)) {
+ pushPositional(arg);
+ }
+ else if (truncatedArg.match(/^---+(=|$)/)) {
+ pushPositional(arg);
+ continue;
+ }
+ else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) {
+ m = arg.match(/^--?([^=]+)=([\s\S]*)$/);
+ if (m !== null && Array.isArray(m) && m.length >= 3) {
+ if (checkAllAliases(m[1], flags.arrays)) {
+ i = eatArray(i, m[1], args, m[2]);
+ }
+ else if (checkAllAliases(m[1], flags.nargs) !== false) {
+ i = eatNargs(i, m[1], args, m[2]);
+ }
+ else {
+ setArg(m[1], m[2], true);
+ }
+ }
+ }
+ else if (arg.match(negatedBoolean) && configuration['boolean-negation']) {
+ m = arg.match(negatedBoolean);
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
+ key = m[1];
+ setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false);
+ }
+ }
+ else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) {
+ m = arg.match(/^--?(.+)/);
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
+ key = m[1];
+ if (checkAllAliases(key, flags.arrays)) {
+ i = eatArray(i, key, args);
+ }
+ else if (checkAllAliases(key, flags.nargs) !== false) {
+ i = eatNargs(i, key, args);
+ }
+ else {
+ next = args[i + 1];
+ if (next !== undefined && (!next.match(/^-/) ||
+ next.match(negative)) &&
+ !checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts)) {
+ setArg(key, next);
+ i++;
+ }
+ else if (/^(true|false)$/.test(next)) {
+ setArg(key, next);
+ i++;
+ }
+ else {
+ setArg(key, defaultValue(key));
+ }
+ }
+ }
+ }
+ else if (arg.match(/^-.\..+=/)) {
+ m = arg.match(/^-([^=]+)=([\s\S]*)$/);
+ if (m !== null && Array.isArray(m) && m.length >= 3) {
+ setArg(m[1], m[2]);
+ }
+ }
+ else if (arg.match(/^-.\..+/) && !arg.match(negative)) {
+ next = args[i + 1];
+ m = arg.match(/^-(.\..+)/);
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
+ key = m[1];
+ if (next !== undefined && !next.match(/^-/) &&
+ !checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts)) {
+ setArg(key, next);
+ i++;
+ }
+ else {
+ setArg(key, defaultValue(key));
+ }
+ }
+ }
+ else if (arg.match(/^-[^-]+/) && !arg.match(negative)) {
+ letters = arg.slice(1, -1).split('');
+ broken = false;
+ for (let j = 0; j < letters.length; j++) {
+ next = arg.slice(j + 2);
+ if (letters[j + 1] && letters[j + 1] === '=') {
+ value = arg.slice(j + 3);
+ key = letters[j];
+ if (checkAllAliases(key, flags.arrays)) {
+ i = eatArray(i, key, args, value);
+ }
+ else if (checkAllAliases(key, flags.nargs) !== false) {
+ i = eatNargs(i, key, args, value);
+ }
+ else {
+ setArg(key, value);
+ }
+ broken = true;
+ break;
+ }
+ if (next === '-') {
+ setArg(letters[j], next);
+ continue;
+ }
+ if (/[A-Za-z]/.test(letters[j]) &&
+ /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) &&
+ checkAllAliases(next, flags.bools) === false) {
+ setArg(letters[j], next);
+ broken = true;
+ break;
+ }
+ if (letters[j + 1] && letters[j + 1].match(/\W/)) {
+ setArg(letters[j], next);
+ broken = true;
+ break;
+ }
+ else {
+ setArg(letters[j], defaultValue(letters[j]));
+ }
+ }
+ key = arg.slice(-1)[0];
+ if (!broken && key !== '-') {
+ if (checkAllAliases(key, flags.arrays)) {
+ i = eatArray(i, key, args);
+ }
+ else if (checkAllAliases(key, flags.nargs) !== false) {
+ i = eatNargs(i, key, args);
+ }
+ else {
+ next = args[i + 1];
+ if (next !== undefined && (!/^(-|--)[^-]/.test(next) ||
+ next.match(negative)) &&
+ !checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts)) {
+ setArg(key, next);
+ i++;
+ }
+ else if (/^(true|false)$/.test(next)) {
+ setArg(key, next);
+ i++;
+ }
+ else {
+ setArg(key, defaultValue(key));
+ }
+ }
+ }
+ }
+ else if (arg.match(/^-[0-9]$/) &&
+ arg.match(negative) &&
+ checkAllAliases(arg.slice(1), flags.bools)) {
+ key = arg.slice(1);
+ setArg(key, defaultValue(key));
+ }
+ else if (arg === '--') {
+ notFlags = args.slice(i + 1);
+ break;
+ }
+ else if (configuration['halt-at-non-option']) {
+ notFlags = args.slice(i);
+ break;
+ }
+ else {
+ pushPositional(arg);
+ }
+ }
+ applyEnvVars(argv, true);
+ applyEnvVars(argv, false);
+ setConfig(argv);
+ setConfigObjects();
+ applyDefaultsAndAliases(argv, flags.aliases, defaults, true);
+ applyCoercions(argv);
+ if (configuration['set-placeholder-key'])
+ setPlaceholderKeys(argv);
+ Object.keys(flags.counts).forEach(function (key) {
+ if (!hasKey(argv, key.split('.')))
+ setArg(key, 0);
+ });
+ if (notFlagsOption && notFlags.length)
+ argv[notFlagsArgv] = [];
+ notFlags.forEach(function (key) {
+ argv[notFlagsArgv].push(key);
+ });
+ if (configuration['camel-case-expansion'] && configuration['strip-dashed']) {
+ Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => {
+ delete argv[key];
+ });
+ }
+ if (configuration['strip-aliased']) {
+ [].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => {
+ if (configuration['camel-case-expansion'] && alias.includes('-')) {
+ delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')];
+ }
+ delete argv[alias];
+ });
+ }
+ function pushPositional(arg) {
+ const maybeCoercedNumber = maybeCoerceNumber('_', arg);
+ if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') {
+ argv._.push(maybeCoercedNumber);
+ }
+ }
+ function eatNargs(i, key, args, argAfterEqualSign) {
+ let ii;
+ let toEat = checkAllAliases(key, flags.nargs);
+ toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat;
+ if (toEat === 0) {
+ if (!isUndefined(argAfterEqualSign)) {
+ error = Error(__('Argument unexpected for: %s', key));
+ }
+ setArg(key, defaultValue(key));
+ return i;
+ }
+ let available = isUndefined(argAfterEqualSign) ? 0 : 1;
+ if (configuration['nargs-eats-options']) {
+ if (args.length - (i + 1) + available < toEat) {
+ error = Error(__('Not enough arguments following: %s', key));
+ }
+ available = toEat;
+ }
+ else {
+ for (ii = i + 1; ii < args.length; ii++) {
+ if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii]))
+ available++;
+ else
+ break;
+ }
+ if (available < toEat)
+ error = Error(__('Not enough arguments following: %s', key));
+ }
+ let consumed = Math.min(available, toEat);
+ if (!isUndefined(argAfterEqualSign) && consumed > 0) {
+ setArg(key, argAfterEqualSign);
+ consumed--;
+ }
+ for (ii = i + 1; ii < (consumed + i + 1); ii++) {
+ setArg(key, args[ii]);
+ }
+ return (i + consumed);
+ }
+ function eatArray(i, key, args, argAfterEqualSign) {
+ let argsToSet = [];
+ let next = argAfterEqualSign || args[i + 1];
+ const nargsCount = checkAllAliases(key, flags.nargs);
+ if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) {
+ argsToSet.push(true);
+ }
+ else if (isUndefined(next) ||
+ (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) {
+ if (defaults[key] !== undefined) {
+ const defVal = defaults[key];
+ argsToSet = Array.isArray(defVal) ? defVal : [defVal];
+ }
+ }
+ else {
+ if (!isUndefined(argAfterEqualSign)) {
+ argsToSet.push(processValue(key, argAfterEqualSign, true));
+ }
+ for (let ii = i + 1; ii < args.length; ii++) {
+ if ((!configuration['greedy-arrays'] && argsToSet.length > 0) ||
+ (nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount))
+ break;
+ next = args[ii];
+ if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))
+ break;
+ i = ii;
+ argsToSet.push(processValue(key, next, inputIsString));
+ }
+ }
+ if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) ||
+ (isNaN(nargsCount) && argsToSet.length === 0))) {
+ error = Error(__('Not enough arguments following: %s', key));
+ }
+ setArg(key, argsToSet);
+ return i;
+ }
+ function setArg(key, val, shouldStripQuotes = inputIsString) {
+ if (/-/.test(key) && configuration['camel-case-expansion']) {
+ const alias = key.split('.').map(function (prop) {
+ return camelCase(prop);
+ }).join('.');
+ addNewAlias(key, alias);
+ }
+ const value = processValue(key, val, shouldStripQuotes);
+ const splitKey = key.split('.');
+ setKey(argv, splitKey, value);
+ if (flags.aliases[key]) {
+ flags.aliases[key].forEach(function (x) {
+ const keyProperties = x.split('.');
+ setKey(argv, keyProperties, value);
+ });
+ }
+ if (splitKey.length > 1 && configuration['dot-notation']) {
+ (flags.aliases[splitKey[0]] || []).forEach(function (x) {
+ let keyProperties = x.split('.');
+ const a = [].concat(splitKey);
+ a.shift();
+ keyProperties = keyProperties.concat(a);
+ if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) {
+ setKey(argv, keyProperties, value);
+ }
+ });
+ }
+ if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) {
+ const keys = [key].concat(flags.aliases[key] || []);
+ keys.forEach(function (key) {
+ Object.defineProperty(argvReturn, key, {
+ enumerable: true,
+ get() {
+ return val;
+ },
+ set(value) {
+ val = typeof value === 'string' ? mixin.normalize(value) : value;
+ }
+ });
+ });
+ }
+ }
+ function addNewAlias(key, alias) {
+ if (!(flags.aliases[key] && flags.aliases[key].length)) {
+ flags.aliases[key] = [alias];
+ newAliases[alias] = true;
+ }
+ if (!(flags.aliases[alias] && flags.aliases[alias].length)) {
+ addNewAlias(alias, key);
+ }
+ }
+ function processValue(key, val, shouldStripQuotes) {
+ if (shouldStripQuotes) {
+ val = stripQuotes(val);
+ }
+ if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
+ if (typeof val === 'string')
+ val = val === 'true';
+ }
+ let value = Array.isArray(val)
+ ? val.map(function (v) { return maybeCoerceNumber(key, v); })
+ : maybeCoerceNumber(key, val);
+ if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) {
+ value = increment();
+ }
+ if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) {
+ if (Array.isArray(val))
+ value = val.map((val) => { return mixin.normalize(val); });
+ else
+ value = mixin.normalize(val);
+ }
+ return value;
+ }
+ function maybeCoerceNumber(key, value) {
+ if (!configuration['parse-positional-numbers'] && key === '_')
+ return value;
+ if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) {
+ const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`))));
+ if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) {
+ value = Number(value);
+ }
+ }
+ return value;
+ }
+ function setConfig(argv) {
+ const configLookup = Object.create(null);
+ applyDefaultsAndAliases(configLookup, flags.aliases, defaults);
+ Object.keys(flags.configs).forEach(function (configKey) {
+ const configPath = argv[configKey] || configLookup[configKey];
+ if (configPath) {
+ try {
+ let config = null;
+ const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath);
+ const resolveConfig = flags.configs[configKey];
+ if (typeof resolveConfig === 'function') {
+ try {
+ config = resolveConfig(resolvedConfigPath);
+ }
+ catch (e) {
+ config = e;
+ }
+ if (config instanceof Error) {
+ error = config;
+ return;
+ }
+ }
+ else {
+ config = mixin.require(resolvedConfigPath);
+ }
+ setConfigObject(config);
+ }
+ catch (ex) {
+ if (ex.name === 'PermissionDenied')
+ error = ex;
+ else if (argv[configKey])
+ error = Error(__('Invalid JSON config file: %s', configPath));
+ }
+ }
+ });
+ }
+ function setConfigObject(config, prev) {
+ Object.keys(config).forEach(function (key) {
+ const value = config[key];
+ const fullKey = prev ? prev + '.' + key : key;
+ if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {
+ setConfigObject(value, fullKey);
+ }
+ else {
+ if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) {
+ setArg(fullKey, value);
+ }
+ }
+ });
+ }
+ function setConfigObjects() {
+ if (typeof configObjects !== 'undefined') {
+ configObjects.forEach(function (configObject) {
+ setConfigObject(configObject);
+ });
+ }
+ }
+ function applyEnvVars(argv, configOnly) {
+ if (typeof envPrefix === 'undefined')
+ return;
+ const prefix = typeof envPrefix === 'string' ? envPrefix : '';
+ const env = mixin.env();
+ Object.keys(env).forEach(function (envVar) {
+ if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) {
+ const keys = envVar.split('__').map(function (key, i) {
+ if (i === 0) {
+ key = key.substring(prefix.length);
+ }
+ return camelCase(key);
+ });
+ if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) {
+ setArg(keys.join('.'), env[envVar]);
+ }
+ }
+ });
+ }
+ function applyCoercions(argv) {
+ let coerce;
+ const applied = new Set();
+ Object.keys(argv).forEach(function (key) {
+ if (!applied.has(key)) {
+ coerce = checkAllAliases(key, flags.coercions);
+ if (typeof coerce === 'function') {
+ try {
+ const value = maybeCoerceNumber(key, coerce(argv[key]));
+ ([].concat(flags.aliases[key] || [], key)).forEach(ali => {
+ applied.add(ali);
+ argv[ali] = value;
+ });
+ }
+ catch (err) {
+ error = err;
+ }
+ }
+ }
+ });
+ }
+ function setPlaceholderKeys(argv) {
+ flags.keys.forEach((key) => {
+ if (~key.indexOf('.'))
+ return;
+ if (typeof argv[key] === 'undefined')
+ argv[key] = undefined;
+ });
+ return argv;
+ }
+ function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) {
+ Object.keys(defaults).forEach(function (key) {
+ if (!hasKey(obj, key.split('.'))) {
+ setKey(obj, key.split('.'), defaults[key]);
+ if (canLog)
+ defaulted[key] = true;
+ (aliases[key] || []).forEach(function (x) {
+ if (hasKey(obj, x.split('.')))
+ return;
+ setKey(obj, x.split('.'), defaults[key]);
+ });
+ }
+ });
+ }
+ function hasKey(obj, keys) {
+ let o = obj;
+ if (!configuration['dot-notation'])
+ keys = [keys.join('.')];
+ keys.slice(0, -1).forEach(function (key) {
+ o = (o[key] || {});
+ });
+ const key = keys[keys.length - 1];
+ if (typeof o !== 'object')
+ return false;
+ else
+ return key in o;
+ }
+ function setKey(obj, keys, value) {
+ let o = obj;
+ if (!configuration['dot-notation'])
+ keys = [keys.join('.')];
+ keys.slice(0, -1).forEach(function (key) {
+ key = sanitizeKey(key);
+ if (typeof o === 'object' && o[key] === undefined) {
+ o[key] = {};
+ }
+ if (typeof o[key] !== 'object' || Array.isArray(o[key])) {
+ if (Array.isArray(o[key])) {
+ o[key].push({});
+ }
+ else {
+ o[key] = [o[key], {}];
+ }
+ o = o[key][o[key].length - 1];
+ }
+ else {
+ o = o[key];
+ }
+ });
+ const key = sanitizeKey(keys[keys.length - 1]);
+ const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays);
+ const isValueArray = Array.isArray(value);
+ let duplicate = configuration['duplicate-arguments-array'];
+ if (!duplicate && checkAllAliases(key, flags.nargs)) {
+ duplicate = true;
+ if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) {
+ o[key] = undefined;
+ }
+ }
+ if (value === increment()) {
+ o[key] = increment(o[key]);
+ }
+ else if (Array.isArray(o[key])) {
+ if (duplicate && isTypeArray && isValueArray) {
+ o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]);
+ }
+ else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) {
+ o[key] = value;
+ }
+ else {
+ o[key] = o[key].concat([value]);
+ }
+ }
+ else if (o[key] === undefined && isTypeArray) {
+ o[key] = isValueArray ? value : [value];
+ }
+ else if (duplicate && !(o[key] === undefined ||
+ checkAllAliases(key, flags.counts) ||
+ checkAllAliases(key, flags.bools))) {
+ o[key] = [o[key], value];
+ }
+ else {
+ o[key] = value;
+ }
+ }
+ function extendAliases(...args) {
+ args.forEach(function (obj) {
+ Object.keys(obj || {}).forEach(function (key) {
+ if (flags.aliases[key])
+ return;
+ flags.aliases[key] = [].concat(aliases[key] || []);
+ flags.aliases[key].concat(key).forEach(function (x) {
+ if (/-/.test(x) && configuration['camel-case-expansion']) {
+ const c = camelCase(x);
+ if (c !== key && flags.aliases[key].indexOf(c) === -1) {
+ flags.aliases[key].push(c);
+ newAliases[c] = true;
+ }
+ }
+ });
+ flags.aliases[key].concat(key).forEach(function (x) {
+ if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) {
+ const c = decamelize(x, '-');
+ if (c !== key && flags.aliases[key].indexOf(c) === -1) {
+ flags.aliases[key].push(c);
+ newAliases[c] = true;
+ }
+ }
+ });
+ flags.aliases[key].forEach(function (x) {
+ flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) {
+ return x !== y;
+ }));
+ });
+ });
+ });
+ }
+ function checkAllAliases(key, flag) {
+ const toCheck = [].concat(flags.aliases[key] || [], key);
+ const keys = Object.keys(flag);
+ const setAlias = toCheck.find(key => keys.includes(key));
+ return setAlias ? flag[setAlias] : false;
+ }
+ function hasAnyFlag(key) {
+ const flagsKeys = Object.keys(flags);
+ const toCheck = [].concat(flagsKeys.map(k => flags[k]));
+ return toCheck.some(function (flag) {
+ return Array.isArray(flag) ? flag.includes(key) : flag[key];
+ });
+ }
+ function hasFlagsMatching(arg, ...patterns) {
+ const toCheck = [].concat(...patterns);
+ return toCheck.some(function (pattern) {
+ const match = arg.match(pattern);
+ return match && hasAnyFlag(match[1]);
+ });
+ }
+ function hasAllShortFlags(arg) {
+ if (arg.match(negative) || !arg.match(/^-[^-]+/)) {
+ return false;
+ }
+ let hasAllFlags = true;
+ let next;
+ const letters = arg.slice(1).split('');
+ for (let j = 0; j < letters.length; j++) {
+ next = arg.slice(j + 2);
+ if (!hasAnyFlag(letters[j])) {
+ hasAllFlags = false;
+ break;
+ }
+ if ((letters[j + 1] && letters[j + 1] === '=') ||
+ next === '-' ||
+ (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) ||
+ (letters[j + 1] && letters[j + 1].match(/\W/))) {
+ break;
+ }
+ }
+ return hasAllFlags;
+ }
+ function isUnknownOptionAsArg(arg) {
+ return configuration['unknown-options-as-args'] && isUnknownOption(arg);
+ }
+ function isUnknownOption(arg) {
+ arg = arg.replace(/^-{3,}/, '--');
+ if (arg.match(negative)) {
+ return false;
+ }
+ if (hasAllShortFlags(arg)) {
+ return false;
+ }
+ const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/;
+ const normalFlag = /^-+([^=]+?)$/;
+ const flagEndingInHyphen = /^-+([^=]+?)-$/;
+ const flagEndingInDigits = /^-+([^=]+?\d+)$/;
+ const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/;
+ return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters);
+ }
+ function defaultValue(key) {
+ if (!checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts) &&
+ `${key}` in defaults) {
+ return defaults[key];
+ }
+ else {
+ return defaultForType(guessType(key));
+ }
+ }
+ function defaultForType(type) {
+ const def = {
+ [DefaultValuesForTypeKey.BOOLEAN]: true,
+ [DefaultValuesForTypeKey.STRING]: '',
+ [DefaultValuesForTypeKey.NUMBER]: undefined,
+ [DefaultValuesForTypeKey.ARRAY]: []
+ };
+ return def[type];
+ }
+ function guessType(key) {
+ let type = DefaultValuesForTypeKey.BOOLEAN;
+ if (checkAllAliases(key, flags.strings))
+ type = DefaultValuesForTypeKey.STRING;
+ else if (checkAllAliases(key, flags.numbers))
+ type = DefaultValuesForTypeKey.NUMBER;
+ else if (checkAllAliases(key, flags.bools))
+ type = DefaultValuesForTypeKey.BOOLEAN;
+ else if (checkAllAliases(key, flags.arrays))
+ type = DefaultValuesForTypeKey.ARRAY;
+ return type;
+ }
+ function isUndefined(num) {
+ return num === undefined;
+ }
+ function checkConfiguration() {
+ Object.keys(flags.counts).find(key => {
+ if (checkAllAliases(key, flags.arrays)) {
+ error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key));
+ return true;
+ }
+ else if (checkAllAliases(key, flags.nargs)) {
+ error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key));
+ return true;
+ }
+ return false;
+ });
+ }
+ return {
+ aliases: Object.assign({}, flags.aliases),
+ argv: Object.assign(argvReturn, argv),
+ configuration: configuration,
+ defaulted: Object.assign({}, defaulted),
+ error: error,
+ newAliases: Object.assign({}, newAliases)
+ };
+ }
+}
+function combineAliases(aliases) {
+ const aliasArrays = [];
+ const combined = Object.create(null);
+ let change = true;
+ Object.keys(aliases).forEach(function (key) {
+ aliasArrays.push([].concat(aliases[key], key));
+ });
+ while (change) {
+ change = false;
+ for (let i = 0; i < aliasArrays.length; i++) {
+ for (let ii = i + 1; ii < aliasArrays.length; ii++) {
+ const intersect = aliasArrays[i].filter(function (v) {
+ return aliasArrays[ii].indexOf(v) !== -1;
+ });
+ if (intersect.length) {
+ aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]);
+ aliasArrays.splice(ii, 1);
+ change = true;
+ break;
+ }
+ }
+ }
+ }
+ aliasArrays.forEach(function (aliasArray) {
+ aliasArray = aliasArray.filter(function (v, i, self) {
+ return self.indexOf(v) === i;
+ });
+ const lastAlias = aliasArray.pop();
+ if (lastAlias !== undefined && typeof lastAlias === 'string') {
+ combined[lastAlias] = aliasArray;
+ }
+ });
+ return combined;
+}
+function increment(orig) {
+ return orig !== undefined ? orig + 1 : 1;
+}
+function sanitizeKey(key) {
+ if (key === '__proto__')
+ return '___proto___';
+ return key;
+}
+function stripQuotes(val) {
+ return (typeof val === 'string' &&
+ (val[0] === "'" || val[0] === '"') &&
+ val[val.length - 1] === val[0])
+ ? val.substring(1, val.length - 1)
+ : val;
+}
+
+var _a, _b, _c;
+const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION)
+ ? Number(process.env.YARGS_MIN_NODE_VERSION)
+ : 12;
+const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
+if (nodeVersion) {
+ const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
+ if (major < minNodeVersion) {
+ throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
+ }
+}
+const env = process ? process.env : {};
+const parser = new YargsParser({
+ cwd: process.cwd,
+ env: () => {
+ return env;
+ },
+ format: util.format,
+ normalize: path.normalize,
+ resolve: path.resolve,
+ require: (path) => {
+ if (typeof require !== 'undefined') {
+ return require(path);
+ }
+ else if (path.match(/\.json$/)) {
+ return JSON.parse(fs.readFileSync(path, 'utf8'));
+ }
+ else {
+ throw Error('only .json config files are supported in ESM');
+ }
+ }
+});
+const yargsParser = function Parser(args, opts) {
+ const result = parser.parse(args.slice(), opts);
+ return result.argv;
+};
+yargsParser.detailed = function (args, opts) {
+ return parser.parse(args.slice(), opts);
+};
+yargsParser.camelCase = camelCase;
+yargsParser.decamelize = decamelize;
+yargsParser.looksLikeNumber = looksLikeNumber;
+
+module.exports = yargsParser;
diff --git a/node_modules/yargs-parser/build/lib/index.js b/node_modules/yargs-parser/build/lib/index.js
new file mode 100644
index 0000000..43ef485
--- /dev/null
+++ b/node_modules/yargs-parser/build/lib/index.js
@@ -0,0 +1,62 @@
+/**
+ * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
+ * CJS and ESM environments.
+ *
+ * @license
+ * Copyright (c) 2016, Contributors
+ * SPDX-License-Identifier: ISC
+ */
+var _a, _b, _c;
+import { format } from 'util';
+import { normalize, resolve } from 'path';
+import { camelCase, decamelize, looksLikeNumber } from './string-utils.js';
+import { YargsParser } from './yargs-parser.js';
+import { readFileSync } from 'fs';
+// See https://github.com/yargs/yargs-parser#supported-nodejs-versions for our
+// version support policy. The YARGS_MIN_NODE_VERSION is used for testing only.
+const minNodeVersion = (process && process.env && process.env.YARGS_MIN_NODE_VERSION)
+ ? Number(process.env.YARGS_MIN_NODE_VERSION)
+ : 12;
+const nodeVersion = (_b = (_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) !== null && _b !== void 0 ? _b : (_c = process === null || process === void 0 ? void 0 : process.version) === null || _c === void 0 ? void 0 : _c.slice(1);
+if (nodeVersion) {
+ const major = Number(nodeVersion.match(/^([^.]+)/)[1]);
+ if (major < minNodeVersion) {
+ throw Error(`yargs parser supports a minimum Node.js version of ${minNodeVersion}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);
+ }
+}
+// Creates a yargs-parser instance using Node.js standard libraries:
+const env = process ? process.env : {};
+const parser = new YargsParser({
+ cwd: process.cwd,
+ env: () => {
+ return env;
+ },
+ format,
+ normalize,
+ resolve,
+ // TODO: figure out a way to combine ESM and CJS coverage, such that
+ // we can exercise all the lines below:
+ require: (path) => {
+ if (typeof require !== 'undefined') {
+ return require(path);
+ }
+ else if (path.match(/\.json$/)) {
+ // Addresses: https://github.com/yargs/yargs/issues/2040
+ return JSON.parse(readFileSync(path, 'utf8'));
+ }
+ else {
+ throw Error('only .json config files are supported in ESM');
+ }
+ }
+});
+const yargsParser = function Parser(args, opts) {
+ const result = parser.parse(args.slice(), opts);
+ return result.argv;
+};
+yargsParser.detailed = function (args, opts) {
+ return parser.parse(args.slice(), opts);
+};
+yargsParser.camelCase = camelCase;
+yargsParser.decamelize = decamelize;
+yargsParser.looksLikeNumber = looksLikeNumber;
+export default yargsParser;
diff --git a/node_modules/yargs-parser/build/lib/string-utils.js b/node_modules/yargs-parser/build/lib/string-utils.js
new file mode 100644
index 0000000..4e8bd99
--- /dev/null
+++ b/node_modules/yargs-parser/build/lib/string-utils.js
@@ -0,0 +1,65 @@
+/**
+ * @license
+ * Copyright (c) 2016, Contributors
+ * SPDX-License-Identifier: ISC
+ */
+export function camelCase(str) {
+ // Handle the case where an argument is provided as camel case, e.g., fooBar.
+ // by ensuring that the string isn't already mixed case:
+ const isCamelCase = str !== str.toLowerCase() && str !== str.toUpperCase();
+ if (!isCamelCase) {
+ str = str.toLowerCase();
+ }
+ if (str.indexOf('-') === -1 && str.indexOf('_') === -1) {
+ return str;
+ }
+ else {
+ let camelcase = '';
+ let nextChrUpper = false;
+ const leadingHyphens = str.match(/^-+/);
+ for (let i = leadingHyphens ? leadingHyphens[0].length : 0; i < str.length; i++) {
+ let chr = str.charAt(i);
+ if (nextChrUpper) {
+ nextChrUpper = false;
+ chr = chr.toUpperCase();
+ }
+ if (i !== 0 && (chr === '-' || chr === '_')) {
+ nextChrUpper = true;
+ }
+ else if (chr !== '-' && chr !== '_') {
+ camelcase += chr;
+ }
+ }
+ return camelcase;
+ }
+}
+export function decamelize(str, joinString) {
+ const lowercase = str.toLowerCase();
+ joinString = joinString || '-';
+ let notCamelcase = '';
+ for (let i = 0; i < str.length; i++) {
+ const chrLower = lowercase.charAt(i);
+ const chrString = str.charAt(i);
+ if (chrLower !== chrString && i > 0) {
+ notCamelcase += `${joinString}${lowercase.charAt(i)}`;
+ }
+ else {
+ notCamelcase += chrString;
+ }
+ }
+ return notCamelcase;
+}
+export function looksLikeNumber(x) {
+ if (x === null || x === undefined)
+ return false;
+ // if loaded from config, may already be a number.
+ if (typeof x === 'number')
+ return true;
+ // hexadecimal.
+ if (/^0x[0-9a-f]+$/i.test(x))
+ return true;
+ // don't treat 0123 as a number; as it drops the leading '0'.
+ if (/^0[^.]/.test(x))
+ return false;
+ return /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
+}
diff --git a/node_modules/yargs-parser/build/lib/tokenize-arg-string.js b/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
new file mode 100644
index 0000000..5e732ef
--- /dev/null
+++ b/node_modules/yargs-parser/build/lib/tokenize-arg-string.js
@@ -0,0 +1,40 @@
+/**
+ * @license
+ * Copyright (c) 2016, Contributors
+ * SPDX-License-Identifier: ISC
+ */
+// take an un-split argv string and tokenize it.
+export function tokenizeArgString(argString) {
+ if (Array.isArray(argString)) {
+ return argString.map(e => typeof e !== 'string' ? e + '' : e);
+ }
+ argString = argString.trim();
+ let i = 0;
+ let prevC = null;
+ let c = null;
+ let opening = null;
+ const args = [];
+ for (let ii = 0; ii < argString.length; ii++) {
+ prevC = c;
+ c = argString.charAt(ii);
+ // split on spaces unless we're in quotes.
+ if (c === ' ' && !opening) {
+ if (!(prevC === ' ')) {
+ i++;
+ }
+ continue;
+ }
+ // don't split the string if we're in matching
+ // opening or closing single and double quotes.
+ if (c === opening) {
+ opening = null;
+ }
+ else if ((c === "'" || c === '"') && !opening) {
+ opening = c;
+ }
+ if (!args[i])
+ args[i] = '';
+ args[i] += c;
+ }
+ return args;
+}
diff --git a/node_modules/yargs-parser/build/lib/yargs-parser-types.js b/node_modules/yargs-parser/build/lib/yargs-parser-types.js
new file mode 100644
index 0000000..63b7c31
--- /dev/null
+++ b/node_modules/yargs-parser/build/lib/yargs-parser-types.js
@@ -0,0 +1,12 @@
+/**
+ * @license
+ * Copyright (c) 2016, Contributors
+ * SPDX-License-Identifier: ISC
+ */
+export var DefaultValuesForTypeKey;
+(function (DefaultValuesForTypeKey) {
+ DefaultValuesForTypeKey["BOOLEAN"] = "boolean";
+ DefaultValuesForTypeKey["STRING"] = "string";
+ DefaultValuesForTypeKey["NUMBER"] = "number";
+ DefaultValuesForTypeKey["ARRAY"] = "array";
+})(DefaultValuesForTypeKey || (DefaultValuesForTypeKey = {}));
diff --git a/node_modules/yargs-parser/build/lib/yargs-parser.js b/node_modules/yargs-parser/build/lib/yargs-parser.js
new file mode 100644
index 0000000..415d4bc
--- /dev/null
+++ b/node_modules/yargs-parser/build/lib/yargs-parser.js
@@ -0,0 +1,1045 @@
+/**
+ * @license
+ * Copyright (c) 2016, Contributors
+ * SPDX-License-Identifier: ISC
+ */
+import { tokenizeArgString } from './tokenize-arg-string.js';
+import { DefaultValuesForTypeKey } from './yargs-parser-types.js';
+import { camelCase, decamelize, looksLikeNumber } from './string-utils.js';
+let mixin;
+export class YargsParser {
+ constructor(_mixin) {
+ mixin = _mixin;
+ }
+ parse(argsInput, options) {
+ const opts = Object.assign({
+ alias: undefined,
+ array: undefined,
+ boolean: undefined,
+ config: undefined,
+ configObjects: undefined,
+ configuration: undefined,
+ coerce: undefined,
+ count: undefined,
+ default: undefined,
+ envPrefix: undefined,
+ narg: undefined,
+ normalize: undefined,
+ string: undefined,
+ number: undefined,
+ __: undefined,
+ key: undefined
+ }, options);
+ // allow a string argument to be passed in rather
+ // than an argv array.
+ const args = tokenizeArgString(argsInput);
+ // tokenizeArgString adds extra quotes to args if argsInput is a string
+ // only strip those extra quotes in processValue if argsInput is a string
+ const inputIsString = typeof argsInput === 'string';
+ // aliases might have transitive relationships, normalize this.
+ const aliases = combineAliases(Object.assign(Object.create(null), opts.alias));
+ const configuration = Object.assign({
+ 'boolean-negation': true,
+ 'camel-case-expansion': true,
+ 'combine-arrays': false,
+ 'dot-notation': true,
+ 'duplicate-arguments-array': true,
+ 'flatten-duplicate-arrays': true,
+ 'greedy-arrays': true,
+ 'halt-at-non-option': false,
+ 'nargs-eats-options': false,
+ 'negation-prefix': 'no-',
+ 'parse-numbers': true,
+ 'parse-positional-numbers': true,
+ 'populate--': false,
+ 'set-placeholder-key': false,
+ 'short-option-groups': true,
+ 'strip-aliased': false,
+ 'strip-dashed': false,
+ 'unknown-options-as-args': false
+ }, opts.configuration);
+ const defaults = Object.assign(Object.create(null), opts.default);
+ const configObjects = opts.configObjects || [];
+ const envPrefix = opts.envPrefix;
+ const notFlagsOption = configuration['populate--'];
+ const notFlagsArgv = notFlagsOption ? '--' : '_';
+ const newAliases = Object.create(null);
+ const defaulted = Object.create(null);
+ // allow a i18n handler to be passed in, default to a fake one (util.format).
+ const __ = opts.__ || mixin.format;
+ const flags = {
+ aliases: Object.create(null),
+ arrays: Object.create(null),
+ bools: Object.create(null),
+ strings: Object.create(null),
+ numbers: Object.create(null),
+ counts: Object.create(null),
+ normalize: Object.create(null),
+ configs: Object.create(null),
+ nargs: Object.create(null),
+ coercions: Object.create(null),
+ keys: []
+ };
+ const negative = /^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;
+ const negatedBoolean = new RegExp('^--' + configuration['negation-prefix'] + '(.+)');
+ [].concat(opts.array || []).filter(Boolean).forEach(function (opt) {
+ const key = typeof opt === 'object' ? opt.key : opt;
+ // assign to flags[bools|strings|numbers]
+ const assignment = Object.keys(opt).map(function (key) {
+ const arrayFlagKeys = {
+ boolean: 'bools',
+ string: 'strings',
+ number: 'numbers'
+ };
+ return arrayFlagKeys[key];
+ }).filter(Boolean).pop();
+ // assign key to be coerced
+ if (assignment) {
+ flags[assignment][key] = true;
+ }
+ flags.arrays[key] = true;
+ flags.keys.push(key);
+ });
+ [].concat(opts.boolean || []).filter(Boolean).forEach(function (key) {
+ flags.bools[key] = true;
+ flags.keys.push(key);
+ });
+ [].concat(opts.string || []).filter(Boolean).forEach(function (key) {
+ flags.strings[key] = true;
+ flags.keys.push(key);
+ });
+ [].concat(opts.number || []).filter(Boolean).forEach(function (key) {
+ flags.numbers[key] = true;
+ flags.keys.push(key);
+ });
+ [].concat(opts.count || []).filter(Boolean).forEach(function (key) {
+ flags.counts[key] = true;
+ flags.keys.push(key);
+ });
+ [].concat(opts.normalize || []).filter(Boolean).forEach(function (key) {
+ flags.normalize[key] = true;
+ flags.keys.push(key);
+ });
+ if (typeof opts.narg === 'object') {
+ Object.entries(opts.narg).forEach(([key, value]) => {
+ if (typeof value === 'number') {
+ flags.nargs[key] = value;
+ flags.keys.push(key);
+ }
+ });
+ }
+ if (typeof opts.coerce === 'object') {
+ Object.entries(opts.coerce).forEach(([key, value]) => {
+ if (typeof value === 'function') {
+ flags.coercions[key] = value;
+ flags.keys.push(key);
+ }
+ });
+ }
+ if (typeof opts.config !== 'undefined') {
+ if (Array.isArray(opts.config) || typeof opts.config === 'string') {
+ ;
+ [].concat(opts.config).filter(Boolean).forEach(function (key) {
+ flags.configs[key] = true;
+ });
+ }
+ else if (typeof opts.config === 'object') {
+ Object.entries(opts.config).forEach(([key, value]) => {
+ if (typeof value === 'boolean' || typeof value === 'function') {
+ flags.configs[key] = value;
+ }
+ });
+ }
+ }
+ // create a lookup table that takes into account all
+ // combinations of aliases: {f: ['foo'], foo: ['f']}
+ extendAliases(opts.key, aliases, opts.default, flags.arrays);
+ // apply default values to all aliases.
+ Object.keys(defaults).forEach(function (key) {
+ (flags.aliases[key] || []).forEach(function (alias) {
+ defaults[alias] = defaults[key];
+ });
+ });
+ let error = null;
+ checkConfiguration();
+ let notFlags = [];
+ const argv = Object.assign(Object.create(null), { _: [] });
+ // TODO(bcoe): for the first pass at removing object prototype we didn't
+ // remove all prototypes from objects returned by this API, we might want
+ // to gradually move towards doing so.
+ const argvReturn = {};
+ for (let i = 0; i < args.length; i++) {
+ const arg = args[i];
+ const truncatedArg = arg.replace(/^-{3,}/, '---');
+ let broken;
+ let key;
+ let letters;
+ let m;
+ let next;
+ let value;
+ // any unknown option (except for end-of-options, "--")
+ if (arg !== '--' && /^-/.test(arg) && isUnknownOptionAsArg(arg)) {
+ pushPositional(arg);
+ // ---, ---=, ----, etc,
+ }
+ else if (truncatedArg.match(/^---+(=|$)/)) {
+ // options without key name are invalid.
+ pushPositional(arg);
+ continue;
+ // -- separated by =
+ }
+ else if (arg.match(/^--.+=/) || (!configuration['short-option-groups'] && arg.match(/^-.+=/))) {
+ // Using [\s\S] instead of . because js doesn't support the
+ // 'dotall' regex modifier. See:
+ // http://stackoverflow.com/a/1068308/13216
+ m = arg.match(/^--?([^=]+)=([\s\S]*)$/);
+ // arrays format = '--f=a b c'
+ if (m !== null && Array.isArray(m) && m.length >= 3) {
+ if (checkAllAliases(m[1], flags.arrays)) {
+ i = eatArray(i, m[1], args, m[2]);
+ }
+ else if (checkAllAliases(m[1], flags.nargs) !== false) {
+ // nargs format = '--f=monkey washing cat'
+ i = eatNargs(i, m[1], args, m[2]);
+ }
+ else {
+ setArg(m[1], m[2], true);
+ }
+ }
+ }
+ else if (arg.match(negatedBoolean) && configuration['boolean-negation']) {
+ m = arg.match(negatedBoolean);
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
+ key = m[1];
+ setArg(key, checkAllAliases(key, flags.arrays) ? [false] : false);
+ }
+ // -- separated by space.
+ }
+ else if (arg.match(/^--.+/) || (!configuration['short-option-groups'] && arg.match(/^-[^-]+/))) {
+ m = arg.match(/^--?(.+)/);
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
+ key = m[1];
+ if (checkAllAliases(key, flags.arrays)) {
+ // array format = '--foo a b c'
+ i = eatArray(i, key, args);
+ }
+ else if (checkAllAliases(key, flags.nargs) !== false) {
+ // nargs format = '--foo a b c'
+ // should be truthy even if: flags.nargs[key] === 0
+ i = eatNargs(i, key, args);
+ }
+ else {
+ next = args[i + 1];
+ if (next !== undefined && (!next.match(/^-/) ||
+ next.match(negative)) &&
+ !checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts)) {
+ setArg(key, next);
+ i++;
+ }
+ else if (/^(true|false)$/.test(next)) {
+ setArg(key, next);
+ i++;
+ }
+ else {
+ setArg(key, defaultValue(key));
+ }
+ }
+ }
+ // dot-notation flag separated by '='.
+ }
+ else if (arg.match(/^-.\..+=/)) {
+ m = arg.match(/^-([^=]+)=([\s\S]*)$/);
+ if (m !== null && Array.isArray(m) && m.length >= 3) {
+ setArg(m[1], m[2]);
+ }
+ // dot-notation flag separated by space.
+ }
+ else if (arg.match(/^-.\..+/) && !arg.match(negative)) {
+ next = args[i + 1];
+ m = arg.match(/^-(.\..+)/);
+ if (m !== null && Array.isArray(m) && m.length >= 2) {
+ key = m[1];
+ if (next !== undefined && !next.match(/^-/) &&
+ !checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts)) {
+ setArg(key, next);
+ i++;
+ }
+ else {
+ setArg(key, defaultValue(key));
+ }
+ }
+ }
+ else if (arg.match(/^-[^-]+/) && !arg.match(negative)) {
+ letters = arg.slice(1, -1).split('');
+ broken = false;
+ for (let j = 0; j < letters.length; j++) {
+ next = arg.slice(j + 2);
+ if (letters[j + 1] && letters[j + 1] === '=') {
+ value = arg.slice(j + 3);
+ key = letters[j];
+ if (checkAllAliases(key, flags.arrays)) {
+ // array format = '-f=a b c'
+ i = eatArray(i, key, args, value);
+ }
+ else if (checkAllAliases(key, flags.nargs) !== false) {
+ // nargs format = '-f=monkey washing cat'
+ i = eatNargs(i, key, args, value);
+ }
+ else {
+ setArg(key, value);
+ }
+ broken = true;
+ break;
+ }
+ if (next === '-') {
+ setArg(letters[j], next);
+ continue;
+ }
+ // current letter is an alphabetic character and next value is a number
+ if (/[A-Za-z]/.test(letters[j]) &&
+ /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next) &&
+ checkAllAliases(next, flags.bools) === false) {
+ setArg(letters[j], next);
+ broken = true;
+ break;
+ }
+ if (letters[j + 1] && letters[j + 1].match(/\W/)) {
+ setArg(letters[j], next);
+ broken = true;
+ break;
+ }
+ else {
+ setArg(letters[j], defaultValue(letters[j]));
+ }
+ }
+ key = arg.slice(-1)[0];
+ if (!broken && key !== '-') {
+ if (checkAllAliases(key, flags.arrays)) {
+ // array format = '-f a b c'
+ i = eatArray(i, key, args);
+ }
+ else if (checkAllAliases(key, flags.nargs) !== false) {
+ // nargs format = '-f a b c'
+ // should be truthy even if: flags.nargs[key] === 0
+ i = eatNargs(i, key, args);
+ }
+ else {
+ next = args[i + 1];
+ if (next !== undefined && (!/^(-|--)[^-]/.test(next) ||
+ next.match(negative)) &&
+ !checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts)) {
+ setArg(key, next);
+ i++;
+ }
+ else if (/^(true|false)$/.test(next)) {
+ setArg(key, next);
+ i++;
+ }
+ else {
+ setArg(key, defaultValue(key));
+ }
+ }
+ }
+ }
+ else if (arg.match(/^-[0-9]$/) &&
+ arg.match(negative) &&
+ checkAllAliases(arg.slice(1), flags.bools)) {
+ // single-digit boolean alias, e.g: xargs -0
+ key = arg.slice(1);
+ setArg(key, defaultValue(key));
+ }
+ else if (arg === '--') {
+ notFlags = args.slice(i + 1);
+ break;
+ }
+ else if (configuration['halt-at-non-option']) {
+ notFlags = args.slice(i);
+ break;
+ }
+ else {
+ pushPositional(arg);
+ }
+ }
+ // order of precedence:
+ // 1. command line arg
+ // 2. value from env var
+ // 3. value from config file
+ // 4. value from config objects
+ // 5. configured default value
+ applyEnvVars(argv, true); // special case: check env vars that point to config file
+ applyEnvVars(argv, false);
+ setConfig(argv);
+ setConfigObjects();
+ applyDefaultsAndAliases(argv, flags.aliases, defaults, true);
+ applyCoercions(argv);
+ if (configuration['set-placeholder-key'])
+ setPlaceholderKeys(argv);
+ // for any counts either not in args or without an explicit default, set to 0
+ Object.keys(flags.counts).forEach(function (key) {
+ if (!hasKey(argv, key.split('.')))
+ setArg(key, 0);
+ });
+ // '--' defaults to undefined.
+ if (notFlagsOption && notFlags.length)
+ argv[notFlagsArgv] = [];
+ notFlags.forEach(function (key) {
+ argv[notFlagsArgv].push(key);
+ });
+ if (configuration['camel-case-expansion'] && configuration['strip-dashed']) {
+ Object.keys(argv).filter(key => key !== '--' && key.includes('-')).forEach(key => {
+ delete argv[key];
+ });
+ }
+ if (configuration['strip-aliased']) {
+ ;
+ [].concat(...Object.keys(aliases).map(k => aliases[k])).forEach(alias => {
+ if (configuration['camel-case-expansion'] && alias.includes('-')) {
+ delete argv[alias.split('.').map(prop => camelCase(prop)).join('.')];
+ }
+ delete argv[alias];
+ });
+ }
+ // Push argument into positional array, applying numeric coercion:
+ function pushPositional(arg) {
+ const maybeCoercedNumber = maybeCoerceNumber('_', arg);
+ if (typeof maybeCoercedNumber === 'string' || typeof maybeCoercedNumber === 'number') {
+ argv._.push(maybeCoercedNumber);
+ }
+ }
+ // how many arguments should we consume, based
+ // on the nargs option?
+ function eatNargs(i, key, args, argAfterEqualSign) {
+ let ii;
+ let toEat = checkAllAliases(key, flags.nargs);
+ // NaN has a special meaning for the array type, indicating that one or
+ // more values are expected.
+ toEat = typeof toEat !== 'number' || isNaN(toEat) ? 1 : toEat;
+ if (toEat === 0) {
+ if (!isUndefined(argAfterEqualSign)) {
+ error = Error(__('Argument unexpected for: %s', key));
+ }
+ setArg(key, defaultValue(key));
+ return i;
+ }
+ let available = isUndefined(argAfterEqualSign) ? 0 : 1;
+ if (configuration['nargs-eats-options']) {
+ // classic behavior, yargs eats positional and dash arguments.
+ if (args.length - (i + 1) + available < toEat) {
+ error = Error(__('Not enough arguments following: %s', key));
+ }
+ available = toEat;
+ }
+ else {
+ // nargs will not consume flag arguments, e.g., -abc, --foo,
+ // and terminates when one is observed.
+ for (ii = i + 1; ii < args.length; ii++) {
+ if (!args[ii].match(/^-[^0-9]/) || args[ii].match(negative) || isUnknownOptionAsArg(args[ii]))
+ available++;
+ else
+ break;
+ }
+ if (available < toEat)
+ error = Error(__('Not enough arguments following: %s', key));
+ }
+ let consumed = Math.min(available, toEat);
+ if (!isUndefined(argAfterEqualSign) && consumed > 0) {
+ setArg(key, argAfterEqualSign);
+ consumed--;
+ }
+ for (ii = i + 1; ii < (consumed + i + 1); ii++) {
+ setArg(key, args[ii]);
+ }
+ return (i + consumed);
+ }
+ // if an option is an array, eat all non-hyphenated arguments
+ // following it... YUM!
+ // e.g., --foo apple banana cat becomes ["apple", "banana", "cat"]
+ function eatArray(i, key, args, argAfterEqualSign) {
+ let argsToSet = [];
+ let next = argAfterEqualSign || args[i + 1];
+ // If both array and nargs are configured, enforce the nargs count:
+ const nargsCount = checkAllAliases(key, flags.nargs);
+ if (checkAllAliases(key, flags.bools) && !(/^(true|false)$/.test(next))) {
+ argsToSet.push(true);
+ }
+ else if (isUndefined(next) ||
+ (isUndefined(argAfterEqualSign) && /^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))) {
+ // for keys without value ==> argsToSet remains an empty []
+ // set user default value, if available
+ if (defaults[key] !== undefined) {
+ const defVal = defaults[key];
+ argsToSet = Array.isArray(defVal) ? defVal : [defVal];
+ }
+ }
+ else {
+ // value in --option=value is eaten as is
+ if (!isUndefined(argAfterEqualSign)) {
+ argsToSet.push(processValue(key, argAfterEqualSign, true));
+ }
+ for (let ii = i + 1; ii < args.length; ii++) {
+ if ((!configuration['greedy-arrays'] && argsToSet.length > 0) ||
+ (nargsCount && typeof nargsCount === 'number' && argsToSet.length >= nargsCount))
+ break;
+ next = args[ii];
+ if (/^-/.test(next) && !negative.test(next) && !isUnknownOptionAsArg(next))
+ break;
+ i = ii;
+ argsToSet.push(processValue(key, next, inputIsString));
+ }
+ }
+ // If both array and nargs are configured, create an error if less than
+ // nargs positionals were found. NaN has special meaning, indicating
+ // that at least one value is required (more are okay).
+ if (typeof nargsCount === 'number' && ((nargsCount && argsToSet.length < nargsCount) ||
+ (isNaN(nargsCount) && argsToSet.length === 0))) {
+ error = Error(__('Not enough arguments following: %s', key));
+ }
+ setArg(key, argsToSet);
+ return i;
+ }
+ function setArg(key, val, shouldStripQuotes = inputIsString) {
+ if (/-/.test(key) && configuration['camel-case-expansion']) {
+ const alias = key.split('.').map(function (prop) {
+ return camelCase(prop);
+ }).join('.');
+ addNewAlias(key, alias);
+ }
+ const value = processValue(key, val, shouldStripQuotes);
+ const splitKey = key.split('.');
+ setKey(argv, splitKey, value);
+ // handle populating aliases of the full key
+ if (flags.aliases[key]) {
+ flags.aliases[key].forEach(function (x) {
+ const keyProperties = x.split('.');
+ setKey(argv, keyProperties, value);
+ });
+ }
+ // handle populating aliases of the first element of the dot-notation key
+ if (splitKey.length > 1 && configuration['dot-notation']) {
+ ;
+ (flags.aliases[splitKey[0]] || []).forEach(function (x) {
+ let keyProperties = x.split('.');
+ // expand alias with nested objects in key
+ const a = [].concat(splitKey);
+ a.shift(); // nuke the old key.
+ keyProperties = keyProperties.concat(a);
+ // populate alias only if is not already an alias of the full key
+ // (already populated above)
+ if (!(flags.aliases[key] || []).includes(keyProperties.join('.'))) {
+ setKey(argv, keyProperties, value);
+ }
+ });
+ }
+ // Set normalize getter and setter when key is in 'normalize' but isn't an array
+ if (checkAllAliases(key, flags.normalize) && !checkAllAliases(key, flags.arrays)) {
+ const keys = [key].concat(flags.aliases[key] || []);
+ keys.forEach(function (key) {
+ Object.defineProperty(argvReturn, key, {
+ enumerable: true,
+ get() {
+ return val;
+ },
+ set(value) {
+ val = typeof value === 'string' ? mixin.normalize(value) : value;
+ }
+ });
+ });
+ }
+ }
+ function addNewAlias(key, alias) {
+ if (!(flags.aliases[key] && flags.aliases[key].length)) {
+ flags.aliases[key] = [alias];
+ newAliases[alias] = true;
+ }
+ if (!(flags.aliases[alias] && flags.aliases[alias].length)) {
+ addNewAlias(alias, key);
+ }
+ }
+ function processValue(key, val, shouldStripQuotes) {
+ // strings may be quoted, clean this up as we assign values.
+ if (shouldStripQuotes) {
+ val = stripQuotes(val);
+ }
+ // handle parsing boolean arguments --foo=true --bar false.
+ if (checkAllAliases(key, flags.bools) || checkAllAliases(key, flags.counts)) {
+ if (typeof val === 'string')
+ val = val === 'true';
+ }
+ let value = Array.isArray(val)
+ ? val.map(function (v) { return maybeCoerceNumber(key, v); })
+ : maybeCoerceNumber(key, val);
+ // increment a count given as arg (either no value or value parsed as boolean)
+ if (checkAllAliases(key, flags.counts) && (isUndefined(value) || typeof value === 'boolean')) {
+ value = increment();
+ }
+ // Set normalized value when key is in 'normalize' and in 'arrays'
+ if (checkAllAliases(key, flags.normalize) && checkAllAliases(key, flags.arrays)) {
+ if (Array.isArray(val))
+ value = val.map((val) => { return mixin.normalize(val); });
+ else
+ value = mixin.normalize(val);
+ }
+ return value;
+ }
+ function maybeCoerceNumber(key, value) {
+ if (!configuration['parse-positional-numbers'] && key === '_')
+ return value;
+ if (!checkAllAliases(key, flags.strings) && !checkAllAliases(key, flags.bools) && !Array.isArray(value)) {
+ const shouldCoerceNumber = looksLikeNumber(value) && configuration['parse-numbers'] && (Number.isSafeInteger(Math.floor(parseFloat(`${value}`))));
+ if (shouldCoerceNumber || (!isUndefined(value) && checkAllAliases(key, flags.numbers))) {
+ value = Number(value);
+ }
+ }
+ return value;
+ }
+ // set args from config.json file, this should be
+ // applied last so that defaults can be applied.
+ function setConfig(argv) {
+ const configLookup = Object.create(null);
+ // expand defaults/aliases, in-case any happen to reference
+ // the config.json file.
+ applyDefaultsAndAliases(configLookup, flags.aliases, defaults);
+ Object.keys(flags.configs).forEach(function (configKey) {
+ const configPath = argv[configKey] || configLookup[configKey];
+ if (configPath) {
+ try {
+ let config = null;
+ const resolvedConfigPath = mixin.resolve(mixin.cwd(), configPath);
+ const resolveConfig = flags.configs[configKey];
+ if (typeof resolveConfig === 'function') {
+ try {
+ config = resolveConfig(resolvedConfigPath);
+ }
+ catch (e) {
+ config = e;
+ }
+ if (config instanceof Error) {
+ error = config;
+ return;
+ }
+ }
+ else {
+ config = mixin.require(resolvedConfigPath);
+ }
+ setConfigObject(config);
+ }
+ catch (ex) {
+ // Deno will receive a PermissionDenied error if an attempt is
+ // made to load config without the --allow-read flag:
+ if (ex.name === 'PermissionDenied')
+ error = ex;
+ else if (argv[configKey])
+ error = Error(__('Invalid JSON config file: %s', configPath));
+ }
+ }
+ });
+ }
+ // set args from config object.
+ // it recursively checks nested objects.
+ function setConfigObject(config, prev) {
+ Object.keys(config).forEach(function (key) {
+ const value = config[key];
+ const fullKey = prev ? prev + '.' + key : key;
+ // if the value is an inner object and we have dot-notation
+ // enabled, treat inner objects in config the same as
+ // heavily nested dot notations (foo.bar.apple).
+ if (typeof value === 'object' && value !== null && !Array.isArray(value) && configuration['dot-notation']) {
+ // if the value is an object but not an array, check nested object
+ setConfigObject(value, fullKey);
+ }
+ else {
+ // setting arguments via CLI takes precedence over
+ // values within the config file.
+ if (!hasKey(argv, fullKey.split('.')) || (checkAllAliases(fullKey, flags.arrays) && configuration['combine-arrays'])) {
+ setArg(fullKey, value);
+ }
+ }
+ });
+ }
+ // set all config objects passed in opts
+ function setConfigObjects() {
+ if (typeof configObjects !== 'undefined') {
+ configObjects.forEach(function (configObject) {
+ setConfigObject(configObject);
+ });
+ }
+ }
+ function applyEnvVars(argv, configOnly) {
+ if (typeof envPrefix === 'undefined')
+ return;
+ const prefix = typeof envPrefix === 'string' ? envPrefix : '';
+ const env = mixin.env();
+ Object.keys(env).forEach(function (envVar) {
+ if (prefix === '' || envVar.lastIndexOf(prefix, 0) === 0) {
+ // get array of nested keys and convert them to camel case
+ const keys = envVar.split('__').map(function (key, i) {
+ if (i === 0) {
+ key = key.substring(prefix.length);
+ }
+ return camelCase(key);
+ });
+ if (((configOnly && flags.configs[keys.join('.')]) || !configOnly) && !hasKey(argv, keys)) {
+ setArg(keys.join('.'), env[envVar]);
+ }
+ }
+ });
+ }
+ function applyCoercions(argv) {
+ let coerce;
+ const applied = new Set();
+ Object.keys(argv).forEach(function (key) {
+ if (!applied.has(key)) { // If we haven't already coerced this option via one of its aliases
+ coerce = checkAllAliases(key, flags.coercions);
+ if (typeof coerce === 'function') {
+ try {
+ const value = maybeCoerceNumber(key, coerce(argv[key]));
+ ([].concat(flags.aliases[key] || [], key)).forEach(ali => {
+ applied.add(ali);
+ argv[ali] = value;
+ });
+ }
+ catch (err) {
+ error = err;
+ }
+ }
+ }
+ });
+ }
+ function setPlaceholderKeys(argv) {
+ flags.keys.forEach((key) => {
+ // don't set placeholder keys for dot notation options 'foo.bar'.
+ if (~key.indexOf('.'))
+ return;
+ if (typeof argv[key] === 'undefined')
+ argv[key] = undefined;
+ });
+ return argv;
+ }
+ function applyDefaultsAndAliases(obj, aliases, defaults, canLog = false) {
+ Object.keys(defaults).forEach(function (key) {
+ if (!hasKey(obj, key.split('.'))) {
+ setKey(obj, key.split('.'), defaults[key]);
+ if (canLog)
+ defaulted[key] = true;
+ (aliases[key] || []).forEach(function (x) {
+ if (hasKey(obj, x.split('.')))
+ return;
+ setKey(obj, x.split('.'), defaults[key]);
+ });
+ }
+ });
+ }
+ function hasKey(obj, keys) {
+ let o = obj;
+ if (!configuration['dot-notation'])
+ keys = [keys.join('.')];
+ keys.slice(0, -1).forEach(function (key) {
+ o = (o[key] || {});
+ });
+ const key = keys[keys.length - 1];
+ if (typeof o !== 'object')
+ return false;
+ else
+ return key in o;
+ }
+ function setKey(obj, keys, value) {
+ let o = obj;
+ if (!configuration['dot-notation'])
+ keys = [keys.join('.')];
+ keys.slice(0, -1).forEach(function (key) {
+ // TODO(bcoe): in the next major version of yargs, switch to
+ // Object.create(null) for dot notation:
+ key = sanitizeKey(key);
+ if (typeof o === 'object' && o[key] === undefined) {
+ o[key] = {};
+ }
+ if (typeof o[key] !== 'object' || Array.isArray(o[key])) {
+ // ensure that o[key] is an array, and that the last item is an empty object.
+ if (Array.isArray(o[key])) {
+ o[key].push({});
+ }
+ else {
+ o[key] = [o[key], {}];
+ }
+ // we want to update the empty object at the end of the o[key] array, so set o to that object
+ o = o[key][o[key].length - 1];
+ }
+ else {
+ o = o[key];
+ }
+ });
+ // TODO(bcoe): in the next major version of yargs, switch to
+ // Object.create(null) for dot notation:
+ const key = sanitizeKey(keys[keys.length - 1]);
+ const isTypeArray = checkAllAliases(keys.join('.'), flags.arrays);
+ const isValueArray = Array.isArray(value);
+ let duplicate = configuration['duplicate-arguments-array'];
+ // nargs has higher priority than duplicate
+ if (!duplicate && checkAllAliases(key, flags.nargs)) {
+ duplicate = true;
+ if ((!isUndefined(o[key]) && flags.nargs[key] === 1) || (Array.isArray(o[key]) && o[key].length === flags.nargs[key])) {
+ o[key] = undefined;
+ }
+ }
+ if (value === increment()) {
+ o[key] = increment(o[key]);
+ }
+ else if (Array.isArray(o[key])) {
+ if (duplicate && isTypeArray && isValueArray) {
+ o[key] = configuration['flatten-duplicate-arrays'] ? o[key].concat(value) : (Array.isArray(o[key][0]) ? o[key] : [o[key]]).concat([value]);
+ }
+ else if (!duplicate && Boolean(isTypeArray) === Boolean(isValueArray)) {
+ o[key] = value;
+ }
+ else {
+ o[key] = o[key].concat([value]);
+ }
+ }
+ else if (o[key] === undefined && isTypeArray) {
+ o[key] = isValueArray ? value : [value];
+ }
+ else if (duplicate && !(o[key] === undefined ||
+ checkAllAliases(key, flags.counts) ||
+ checkAllAliases(key, flags.bools))) {
+ o[key] = [o[key], value];
+ }
+ else {
+ o[key] = value;
+ }
+ }
+ // extend the aliases list with inferred aliases.
+ function extendAliases(...args) {
+ args.forEach(function (obj) {
+ Object.keys(obj || {}).forEach(function (key) {
+ // short-circuit if we've already added a key
+ // to the aliases array, for example it might
+ // exist in both 'opts.default' and 'opts.key'.
+ if (flags.aliases[key])
+ return;
+ flags.aliases[key] = [].concat(aliases[key] || []);
+ // For "--option-name", also set argv.optionName
+ flags.aliases[key].concat(key).forEach(function (x) {
+ if (/-/.test(x) && configuration['camel-case-expansion']) {
+ const c = camelCase(x);
+ if (c !== key && flags.aliases[key].indexOf(c) === -1) {
+ flags.aliases[key].push(c);
+ newAliases[c] = true;
+ }
+ }
+ });
+ // For "--optionName", also set argv['option-name']
+ flags.aliases[key].concat(key).forEach(function (x) {
+ if (x.length > 1 && /[A-Z]/.test(x) && configuration['camel-case-expansion']) {
+ const c = decamelize(x, '-');
+ if (c !== key && flags.aliases[key].indexOf(c) === -1) {
+ flags.aliases[key].push(c);
+ newAliases[c] = true;
+ }
+ }
+ });
+ flags.aliases[key].forEach(function (x) {
+ flags.aliases[x] = [key].concat(flags.aliases[key].filter(function (y) {
+ return x !== y;
+ }));
+ });
+ });
+ });
+ }
+ function checkAllAliases(key, flag) {
+ const toCheck = [].concat(flags.aliases[key] || [], key);
+ const keys = Object.keys(flag);
+ const setAlias = toCheck.find(key => keys.includes(key));
+ return setAlias ? flag[setAlias] : false;
+ }
+ function hasAnyFlag(key) {
+ const flagsKeys = Object.keys(flags);
+ const toCheck = [].concat(flagsKeys.map(k => flags[k]));
+ return toCheck.some(function (flag) {
+ return Array.isArray(flag) ? flag.includes(key) : flag[key];
+ });
+ }
+ function hasFlagsMatching(arg, ...patterns) {
+ const toCheck = [].concat(...patterns);
+ return toCheck.some(function (pattern) {
+ const match = arg.match(pattern);
+ return match && hasAnyFlag(match[1]);
+ });
+ }
+ // based on a simplified version of the short flag group parsing logic
+ function hasAllShortFlags(arg) {
+ // if this is a negative number, or doesn't start with a single hyphen, it's not a short flag group
+ if (arg.match(negative) || !arg.match(/^-[^-]+/)) {
+ return false;
+ }
+ let hasAllFlags = true;
+ let next;
+ const letters = arg.slice(1).split('');
+ for (let j = 0; j < letters.length; j++) {
+ next = arg.slice(j + 2);
+ if (!hasAnyFlag(letters[j])) {
+ hasAllFlags = false;
+ break;
+ }
+ if ((letters[j + 1] && letters[j + 1] === '=') ||
+ next === '-' ||
+ (/[A-Za-z]/.test(letters[j]) && /^-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) ||
+ (letters[j + 1] && letters[j + 1].match(/\W/))) {
+ break;
+ }
+ }
+ return hasAllFlags;
+ }
+ function isUnknownOptionAsArg(arg) {
+ return configuration['unknown-options-as-args'] && isUnknownOption(arg);
+ }
+ function isUnknownOption(arg) {
+ arg = arg.replace(/^-{3,}/, '--');
+ // ignore negative numbers
+ if (arg.match(negative)) {
+ return false;
+ }
+ // if this is a short option group and all of them are configured, it isn't unknown
+ if (hasAllShortFlags(arg)) {
+ return false;
+ }
+ // e.g. '--count=2'
+ const flagWithEquals = /^-+([^=]+?)=[\s\S]*$/;
+ // e.g. '-a' or '--arg'
+ const normalFlag = /^-+([^=]+?)$/;
+ // e.g. '-a-'
+ const flagEndingInHyphen = /^-+([^=]+?)-$/;
+ // e.g. '-abc123'
+ const flagEndingInDigits = /^-+([^=]+?\d+)$/;
+ // e.g. '-a/usr/local'
+ const flagEndingInNonWordCharacters = /^-+([^=]+?)\W+.*$/;
+ // check the different types of flag styles, including negatedBoolean, a pattern defined near the start of the parse method
+ return !hasFlagsMatching(arg, flagWithEquals, negatedBoolean, normalFlag, flagEndingInHyphen, flagEndingInDigits, flagEndingInNonWordCharacters);
+ }
+ // make a best effort to pick a default value
+ // for an option based on name and type.
+ function defaultValue(key) {
+ if (!checkAllAliases(key, flags.bools) &&
+ !checkAllAliases(key, flags.counts) &&
+ `${key}` in defaults) {
+ return defaults[key];
+ }
+ else {
+ return defaultForType(guessType(key));
+ }
+ }
+ // return a default value, given the type of a flag.,
+ function defaultForType(type) {
+ const def = {
+ [DefaultValuesForTypeKey.BOOLEAN]: true,
+ [DefaultValuesForTypeKey.STRING]: '',
+ [DefaultValuesForTypeKey.NUMBER]: undefined,
+ [DefaultValuesForTypeKey.ARRAY]: []
+ };
+ return def[type];
+ }
+ // given a flag, enforce a default type.
+ function guessType(key) {
+ let type = DefaultValuesForTypeKey.BOOLEAN;
+ if (checkAllAliases(key, flags.strings))
+ type = DefaultValuesForTypeKey.STRING;
+ else if (checkAllAliases(key, flags.numbers))
+ type = DefaultValuesForTypeKey.NUMBER;
+ else if (checkAllAliases(key, flags.bools))
+ type = DefaultValuesForTypeKey.BOOLEAN;
+ else if (checkAllAliases(key, flags.arrays))
+ type = DefaultValuesForTypeKey.ARRAY;
+ return type;
+ }
+ function isUndefined(num) {
+ return num === undefined;
+ }
+ // check user configuration settings for inconsistencies
+ function checkConfiguration() {
+ // count keys should not be set as array/narg
+ Object.keys(flags.counts).find(key => {
+ if (checkAllAliases(key, flags.arrays)) {
+ error = Error(__('Invalid configuration: %s, opts.count excludes opts.array.', key));
+ return true;
+ }
+ else if (checkAllAliases(key, flags.nargs)) {
+ error = Error(__('Invalid configuration: %s, opts.count excludes opts.narg.', key));
+ return true;
+ }
+ return false;
+ });
+ }
+ return {
+ aliases: Object.assign({}, flags.aliases),
+ argv: Object.assign(argvReturn, argv),
+ configuration: configuration,
+ defaulted: Object.assign({}, defaulted),
+ error: error,
+ newAliases: Object.assign({}, newAliases)
+ };
+ }
+}
+// if any aliases reference each other, we should
+// merge them together.
+function combineAliases(aliases) {
+ const aliasArrays = [];
+ const combined = Object.create(null);
+ let change = true;
+ // turn alias lookup hash {key: ['alias1', 'alias2']} into
+ // a simple array ['key', 'alias1', 'alias2']
+ Object.keys(aliases).forEach(function (key) {
+ aliasArrays.push([].concat(aliases[key], key));
+ });
+ // combine arrays until zero changes are
+ // made in an iteration.
+ while (change) {
+ change = false;
+ for (let i = 0; i < aliasArrays.length; i++) {
+ for (let ii = i + 1; ii < aliasArrays.length; ii++) {
+ const intersect = aliasArrays[i].filter(function (v) {
+ return aliasArrays[ii].indexOf(v) !== -1;
+ });
+ if (intersect.length) {
+ aliasArrays[i] = aliasArrays[i].concat(aliasArrays[ii]);
+ aliasArrays.splice(ii, 1);
+ change = true;
+ break;
+ }
+ }
+ }
+ }
+ // map arrays back to the hash-lookup (de-dupe while
+ // we're at it).
+ aliasArrays.forEach(function (aliasArray) {
+ aliasArray = aliasArray.filter(function (v, i, self) {
+ return self.indexOf(v) === i;
+ });
+ const lastAlias = aliasArray.pop();
+ if (lastAlias !== undefined && typeof lastAlias === 'string') {
+ combined[lastAlias] = aliasArray;
+ }
+ });
+ return combined;
+}
+// this function should only be called when a count is given as an arg
+// it is NOT called to set a default value
+// thus we can start the count at 1 instead of 0
+function increment(orig) {
+ return orig !== undefined ? orig + 1 : 1;
+}
+// TODO(bcoe): in the next major version of yargs, switch to
+// Object.create(null) for dot notation:
+function sanitizeKey(key) {
+ if (key === '__proto__')
+ return '___proto___';
+ return key;
+}
+function stripQuotes(val) {
+ return (typeof val === 'string' &&
+ (val[0] === "'" || val[0] === '"') &&
+ val[val.length - 1] === val[0])
+ ? val.substring(1, val.length - 1)
+ : val;
+}
diff --git a/node_modules/yargs-parser/package.json b/node_modules/yargs-parser/package.json
new file mode 100644
index 0000000..decd0c3
--- /dev/null
+++ b/node_modules/yargs-parser/package.json
@@ -0,0 +1,92 @@
+{
+ "name": "yargs-parser",
+ "version": "21.1.1",
+ "description": "the mighty option parser used by yargs",
+ "main": "build/index.cjs",
+ "exports": {
+ ".": [
+ {
+ "import": "./build/lib/index.js",
+ "require": "./build/index.cjs"
+ },
+ "./build/index.cjs"
+ ],
+ "./browser": [
+ "./browser.js"
+ ]
+ },
+ "type": "module",
+ "module": "./build/lib/index.js",
+ "scripts": {
+ "check": "standardx '**/*.ts' && standardx '**/*.js' && standardx '**/*.cjs'",
+ "fix": "standardx --fix '**/*.ts' && standardx --fix '**/*.js' && standardx --fix '**/*.cjs'",
+ "pretest": "rimraf build && tsc -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
+ "test": "c8 --reporter=text --reporter=html mocha test/*.cjs",
+ "test:esm": "c8 --reporter=text --reporter=html mocha test/*.mjs",
+ "test:browser": "start-server-and-test 'serve ./ -p 8080' http://127.0.0.1:8080/package.json 'node ./test/browser/yargs-test.cjs'",
+ "pretest:typescript": "npm run pretest",
+ "test:typescript": "c8 mocha ./build/test/typescript/*.js",
+ "coverage": "c8 report --check-coverage",
+ "precompile": "rimraf build",
+ "compile": "tsc",
+ "postcompile": "npm run build:cjs",
+ "build:cjs": "rollup -c",
+ "prepare": "npm run compile"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/yargs/yargs-parser.git"
+ },
+ "keywords": [
+ "argument",
+ "parser",
+ "yargs",
+ "command",
+ "cli",
+ "parsing",
+ "option",
+ "args",
+ "argument"
+ ],
+ "author": "Ben Coe <ben@npmjs.com>",
+ "license": "ISC",
+ "devDependencies": {
+ "@types/chai": "^4.2.11",
+ "@types/mocha": "^9.0.0",
+ "@types/node": "^16.11.4",
+ "@typescript-eslint/eslint-plugin": "^3.10.1",
+ "@typescript-eslint/parser": "^3.10.1",
+ "c8": "^7.3.0",
+ "chai": "^4.2.0",
+ "cross-env": "^7.0.2",
+ "eslint": "^7.0.0",
+ "eslint-plugin-import": "^2.20.1",
+ "eslint-plugin-node": "^11.0.0",
+ "gts": "^3.0.0",
+ "mocha": "^10.0.0",
+ "puppeteer": "^16.0.0",
+ "rimraf": "^3.0.2",
+ "rollup": "^2.22.1",
+ "rollup-plugin-cleanup": "^3.1.1",
+ "rollup-plugin-ts": "^3.0.2",
+ "serve": "^14.0.0",
+ "standardx": "^7.0.0",
+ "start-server-and-test": "^1.11.2",
+ "ts-transform-default-export": "^1.0.2",
+ "typescript": "^4.0.0"
+ },
+ "files": [
+ "browser.js",
+ "build",
+ "!*.d.ts",
+ "!*.d.cts"
+ ],
+ "engines": {
+ "node": ">=12"
+ },
+ "standardx": {
+ "ignore": [
+ "build"
+ ]
+ }
+}
diff --git a/node_modules/yargs/LICENSE b/node_modules/yargs/LICENSE
new file mode 100644
index 0000000..b0145ca
--- /dev/null
+++ b/node_modules/yargs/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright 2010 James Halliday (mail@substack.net); Modified work Copyright 2014 Contributors (ben@npmjs.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/yargs/README.md b/node_modules/yargs/README.md
new file mode 100644
index 0000000..51f5b22
--- /dev/null
+++ b/node_modules/yargs/README.md
@@ -0,0 +1,204 @@
+<p align="center">
+ <img width="250" src="https://raw.githubusercontent.com/yargs/yargs/main/yargs-logo.png">
+</p>
+<h1 align="center"> Yargs </h1>
+<p align="center">
+ <b >Yargs be a node.js library fer hearties tryin' ter parse optstrings</b>
+</p>
+
+<br>
+
+![ci](https://github.com/yargs/yargs/workflows/ci/badge.svg)
+[![NPM version][npm-image]][npm-url]
+[![js-standard-style][standard-image]][standard-url]
+[![Coverage][coverage-image]][coverage-url]
+[![Conventional Commits][conventional-commits-image]][conventional-commits-url]
+[![Slack][slack-image]][slack-url]
+
+## Description
+Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface.
+
+It gives you:
+
+* commands and (grouped) options (`my-program.js serve --port=5000`).
+* a dynamically generated help menu based on your arguments:
+
+```
+mocha [spec..]
+
+Run tests with Mocha
+
+Commands
+ mocha inspect [spec..] Run tests with Mocha [default]
+ mocha init <path> create a client-side Mocha setup at <path>
+
+Rules & Behavior
+ --allow-uncaught Allow uncaught errors to propagate [boolean]
+ --async-only, -A Require all tests to use a callback (async) or
+ return a Promise [boolean]
+```
+
+* bash-completion shortcuts for commands and options.
+* and [tons more](/docs/api.md).
+
+## Installation
+
+Stable version:
+```bash
+npm i yargs
+```
+
+Bleeding edge version with the most recent features:
+```bash
+npm i yargs@next
+```
+
+## Usage
+
+### Simple Example
+
+```javascript
+#!/usr/bin/env node
+const yargs = require('yargs/yargs')
+const { hideBin } = require('yargs/helpers')
+const argv = yargs(hideBin(process.argv)).argv
+
+if (argv.ships > 3 && argv.distance < 53.5) {
+ console.log('Plunder more riffiwobbles!')
+} else {
+ console.log('Retreat from the xupptumblers!')
+}
+```
+
+```bash
+$ ./plunder.js --ships=4 --distance=22
+Plunder more riffiwobbles!
+
+$ ./plunder.js --ships 12 --distance 98.7
+Retreat from the xupptumblers!
+```
+
+> Note: `hideBin` is a shorthand for [`process.argv.slice(2)`](https://nodejs.org/en/knowledge/command-line/how-to-parse-command-line-arguments/). It has the benefit that it takes into account variations in some environments, e.g., [Electron](https://github.com/electron/electron/issues/4690).
+
+### Complex Example
+
+```javascript
+#!/usr/bin/env node
+const yargs = require('yargs/yargs')
+const { hideBin } = require('yargs/helpers')
+
+yargs(hideBin(process.argv))
+ .command('serve [port]', 'start the server', (yargs) => {
+ return yargs
+ .positional('port', {
+ describe: 'port to bind on',
+ default: 5000
+ })
+ }, (argv) => {
+ if (argv.verbose) console.info(`start server on :${argv.port}`)
+ serve(argv.port)
+ })
+ .option('verbose', {
+ alias: 'v',
+ type: 'boolean',
+ description: 'Run with verbose logging'
+ })
+ .parse()
+```
+
+Run the example above with `--help` to see the help for the application.
+
+## Supported Platforms
+
+### TypeScript
+
+yargs has type definitions at [@types/yargs][type-definitions].
+
+```
+npm i @types/yargs --save-dev
+```
+
+See usage examples in [docs](/docs/typescript.md).
+
+### Deno
+
+As of `v16`, `yargs` supports [Deno](https://github.com/denoland/deno):
+
+```typescript
+import yargs from 'https://deno.land/x/yargs/deno.ts'
+import { Arguments } from 'https://deno.land/x/yargs/deno-types.ts'
+
+yargs(Deno.args)
+ .command('download <files...>', 'download a list of files', (yargs: any) => {
+ return yargs.positional('files', {
+ describe: 'a list of files to do something with'
+ })
+ }, (argv: Arguments) => {
+ console.info(argv)
+ })
+ .strictCommands()
+ .demandCommand(1)
+ .parse()
+```
+
+### ESM
+
+As of `v16`,`yargs` supports ESM imports:
+
+```js
+import yargs from 'yargs'
+import { hideBin } from 'yargs/helpers'
+
+yargs(hideBin(process.argv))
+ .command('curl <url>', 'fetch the contents of the URL', () => {}, (argv) => {
+ console.info(argv)
+ })
+ .demandCommand(1)
+ .parse()
+```
+
+### Usage in Browser
+
+See examples of using yargs in the browser in [docs](/docs/browser.md).
+
+## Community
+
+Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com).
+
+## Documentation
+
+### Table of Contents
+
+* [Yargs' API](/docs/api.md)
+* [Examples](/docs/examples.md)
+* [Parsing Tricks](/docs/tricks.md)
+ * [Stop the Parser](/docs/tricks.md#stop)
+ * [Negating Boolean Arguments](/docs/tricks.md#negate)
+ * [Numbers](/docs/tricks.md#numbers)
+ * [Arrays](/docs/tricks.md#arrays)
+ * [Objects](/docs/tricks.md#objects)
+ * [Quotes](/docs/tricks.md#quotes)
+* [Advanced Topics](/docs/advanced.md)
+ * [Composing Your App Using Commands](/docs/advanced.md#commands)
+ * [Building Configurable CLI Apps](/docs/advanced.md#configuration)
+ * [Customizing Yargs' Parser](/docs/advanced.md#customizing)
+ * [Bundling yargs](/docs/bundling.md)
+* [Contributing](/contributing.md)
+
+## Supported Node.js Versions
+
+Libraries in this ecosystem make a best effort to track
+[Node.js' release schedule](https://nodejs.org/en/about/releases/). Here's [a
+post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
+
+[npm-url]: https://www.npmjs.com/package/yargs
+[npm-image]: https://img.shields.io/npm/v/yargs.svg
+[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
+[standard-url]: http://standardjs.com/
+[conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
+[conventional-commits-url]: https://conventionalcommits.org/
+[slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg
+[slack-url]: http://devtoolscommunity.herokuapp.com
+[type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs
+[coverage-image]: https://img.shields.io/nycrc/yargs/yargs
+[coverage-url]: https://github.com/yargs/yargs/blob/main/.nycrc
diff --git a/node_modules/yargs/browser.d.ts b/node_modules/yargs/browser.d.ts
new file mode 100644
index 0000000..21f3fc6
--- /dev/null
+++ b/node_modules/yargs/browser.d.ts
@@ -0,0 +1,5 @@
+import {YargsFactory} from './build/lib/yargs-factory';
+
+declare const Yargs: ReturnType<typeof YargsFactory>;
+
+export default Yargs;
diff --git a/node_modules/yargs/browser.mjs b/node_modules/yargs/browser.mjs
new file mode 100644
index 0000000..2d0d6e9
--- /dev/null
+++ b/node_modules/yargs/browser.mjs
@@ -0,0 +1,7 @@
+// Bootstrap yargs for browser:
+import browserPlatformShim from './lib/platform-shims/browser.mjs';
+import {YargsFactory} from './build/lib/yargs-factory.js';
+
+const Yargs = YargsFactory(browserPlatformShim);
+
+export default Yargs;
diff --git a/node_modules/yargs/build/index.cjs b/node_modules/yargs/build/index.cjs
new file mode 100644
index 0000000..e9cf013
--- /dev/null
+++ b/node_modules/yargs/build/index.cjs
@@ -0,0 +1 @@
+"use strict";var t=require("assert");class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,e)}}let s,i=[];function n(t,o,a,h){s=h;let l={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return l;const r=/\.json|\..*rc$/.test(t.extends);let h=null;if(r)h=function(t,e){return s.path.resolve(t,e)}(o,t.extends);else try{h=require.resolve(t.extends)}catch(e){return t}!function(t){if(i.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(h),i.push(h),l=r?JSON.parse(s.readFileSync(h,"utf8")):require(t.extends),delete t.extends,l=n(l,s.path.dirname(h),a,s)}return i=[],a?r(l,t):Object.assign({},l,t)}function r(t,e){const s={};function i(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(s,t);for(const n of Object.keys(e))i(e[n])&&i(s[n])?s[n]=r(t[n],e[n]):s[n]=e[n];return s}function o(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,i=e.shift();if(!i)throw new Error(`No command found in: ${t}`);const n={cmd:i.replace(s,""),demanded:[],optional:[]};return e.forEach(((t,i)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&i===e.length-1&&(r=!0),/^\[/.test(t)?n.optional.push({cmd:t.replace(s,"").split("|"),variadic:r}):n.demanded.push({cmd:t.replace(s,"").split("|"),variadic:r})})),n}const a=["first","second","third","fourth","fifth","sixth"];function h(t,s,i){try{let n=0;const[r,a,h]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,i],f=[].slice.call(a);for(;f.length&&void 0===f[f.length-1];)f.pop();const d=h||f.length;if(d<r.demanded.length)throw new e(`Not enough arguments provided. Expected ${r.demanded.length} but received ${f.length}.`);const u=r.demanded.length+r.optional.length;if(d>u)throw new e(`Too many arguments provided. Expected max ${u} but received ${d}.`);r.demanded.forEach((t=>{const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1})),r.optional.forEach((t=>{if(0===f.length)return;const e=l(f.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,n),n+=1}))}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,i){throw new e(`Invalid ${a[i]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function f(t){return!!t&&!!t.then&&"function"==typeof t.then}function d(t,e,s,i){s.assert.notStrictEqual(t,e,i)}function u(t,e){e.assert.strictEqual(typeof t,"string")}function p(t){return Object.keys(t)}function g(t={},e=(()=>!0)){const s={};return p(t).forEach((i=>{e(i,t[i])&&(s[i]=t[i])})),s}function m(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[m()]}var b=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(m()+1)},getProcessArgvBin:y});function v(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function O(t,e,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(t,s):n?n.value=s:e.set(t,s),s}class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,s=!0,i=!1){if(h("<array|function> [boolean] [boolean] [boolean]",[t,e,s],arguments.length),Array.isArray(t)){for(let i=0;i<t.length;i++){if("function"!=typeof t[i])throw Error("middleware must be a function");const n=t[i];n.applyBeforeValidation=e,n.global=s}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const n=t;n.applyBeforeValidation=e,n.global=s,n.mutates=i,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const s=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const i=[...s[e]||[],e];return!t.option||!i.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function C(t,e,s,i){return s.reduce(((t,s)=>{if(s.applyBeforeValidation!==i)return t;if(s.mutates){if(s.applied)return t;s.applied=!0}if(f(t))return t.then((t=>Promise.all([t,s(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const i=s(t,e);return f(i)?i.then((e=>Object.assign(t,e))):Object.assign(t,i)}}),t)}function j(t,e,s=(t=>{throw t})){try{const s="function"==typeof t?t():t;return f(s)?s.then((t=>e(t))):e(s)}catch(t){return s(t)}}const M=/(^\*)|(^\$0)/;class _{constructor(t,e,s,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=t,this.globalMiddleware=s,this.validation=e}addDirectory(t,e,s,i){"boolean"!=typeof(i=i||{}).recurse&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);const n="function"==typeof i.visit?i.visit:t=>t;i.visit=(t,e,s)=>{const i=n(t,e,s);if(i){if(this.requireCache.has(e))return i;this.requireCache.add(e),this.addHandler(i)}return i},this.shim.requireDirectory({require:e,filename:s},t,i)}addHandler(t,e,s,i,n,r){let a=[];const h=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(n);if(i=i||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...a]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(k(s))return void this.addHandler([t].concat(a),e,s.builder,s.handler,s.middlewares,s.deprecated)}if("string"==typeof t){const n=o(t);a=a.map((t=>o(t).cmd));let l=!1;const c=[n.cmd].concat(a).filter((t=>!M.test(t)||(l=!0,!1)));0===c.length&&l&&c.push("$0"),l&&(n.cmd=c[0],a=c.slice(1),t=t.replace(M,n.cmd)),a.forEach((t=>{this.aliasMap[t]=n.cmd})),!1!==e&&this.usage.command(t,e,l,a,r),this.handlers[n.cmd]={original:t,description:e,handler:i,builder:s||{},middlewares:h,deprecated:r,demanded:n.demanded,optional:n.optional},l&&(this.defaultCommand=this.handlers[n.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,s,i,n,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),h=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const c=this.applyBuilderUpdateUsageAndParse(l,o,e,s.aliases,h,i,n,r);return f(c)?c.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,n,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,c.innerArgv,a,n,c.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,s,i,n,r,o,a){const h=e.builder;let l=s;if(x(h)){s.getInternalMethods().getUsageInstance().freeze();const c=h(s.getInternalMethods().reset(i),a);if(f(c))return c.then((i=>{var a;return l=(a=i)&&"function"==typeof a.getInternalMethods?i:s,this.parseAndUpdateUsage(t,e,l,n,r,o)}))}else(function(t){return"object"==typeof t})(h)&&(s.getInternalMethods().getUsageInstance().freeze(),l=s.getInternalMethods().reset(i),Object.keys(e.builder).forEach((t=>{l.option(t,h[t])})));return this.parseAndUpdateUsage(t,e,l,n,r,o)}parseAndUpdateUsage(t,e,s,i,n,r){t&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,e),e.description);const o=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,n,r);return f(o)?o.then((t=>({aliases:s.parsed.aliases,innerArgv:t}))):{aliases:s.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const s=M.test(e.original)?e.original.replace(M,"").trim():e.original,i=t.filter((t=>!M.test(t)));return i.push(s),`$0 ${i.join(" ")}`}handleValidationAndGetResult(t,e,s,i,n,r,o,a){if(!r.getInternalMethods().getHasOutput()){const e=r.getInternalMethods().runValidation(n,a,r.parsed.error,t);s=j(s,(t=>(e(t),t)))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const i=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(s,i,!1,!1),s=j(s=C(s,r,o,!1),(t=>{const s=e.handler(t);return f(s)?s.then((()=>t)):t})),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),f(s)&&!r.getInternalMethods().hasParseCallback()&&s.catch((t=>{try{r.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(i.commands.pop(),i.fullCommands.pop()),s}applyMiddlewareAndGetResult(t,e,s,i,n,r,o){let a={};if(n)return s;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,s,i,o));const h=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),l=C(s,o,h,!0);return f(l)?l.then((s=>this.handleValidationAndGetResult(t,e,s,i,r,o,h,a))):this.handleValidationAndGetResult(t,e,l,i,r,o,h,a)}populatePositionals(t,e,s,i){e._=e._.slice(s.commands.length);const n=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(n.length,e._.length);n.length;){const t=n.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=s.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),i),o}populatePositional(t,e,s){const i=t.cmd[0];t.variadic?s[i]=e._.splice(0).map(String):e._.length&&(s[i]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},s=o(t);return s.demanded.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i,e.demand[s]=!0})),s.optional.forEach((t=>{const[s,...i]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=i})),e}postProcessPositionals(t,e,s,i){const n=Object.assign({},i.getOptions());n.default=Object.assign(s.default,n.default);for(const t of Object.keys(s.alias))n.alias[t]=(n.alias[t]||[]).concat(s.alias[t]);n.array=n.array.concat(s.array),n.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{n.configuration["unknown-options-as-args"]&&(n.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},n.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},n,{configuration:o}));if(a.error)i.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const s=Object.keys(e);Object.keys(e).forEach((t=>{s.push(...a.aliases[t])})),Object.keys(a.argv).forEach((n=>{s.includes(n)&&(e[n]||(e[n]=a.argv[n]),!this.isInConfigs(i,n)&&!this.isDefaulted(i,n)&&Object.prototype.hasOwnProperty.call(t,n)&&Object.prototype.hasOwnProperty.call(a.argv,n)&&(Array.isArray(t[n])||Array.isArray(a.argv[n]))?t[n]=[].concat(t[n],a.argv[n]):t[n]=a.argv[n])}))}}isDefaulted(t,e){const{default:s}=t.getOptions();return Object.prototype.hasOwnProperty.call(s,e)||Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:s}=t.getOptions();return s.some((t=>Object.prototype.hasOwnProperty.call(t,e)))||s.some((t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(e))))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=M.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(x(e))return e(t,!0);k(e)||Object.keys(e).forEach((s=>{t.option(s,e[s])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,s=0,i=Object.keys(require.cache);s<i.length;s++)if(e=require.cache[i[s]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:s}){for(const i of[t,e,s]){if("string"==typeof i||!1===i)return i;d(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();d(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function k(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function x(t){return"function"==typeof t}function E(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((e=>{const s=e;s._handle&&s.isTTY&&"function"==typeof s._handle.setBlocking&&s._handle.setBlocking(t)}))}function A(t){return"boolean"==typeof t}function P(t,s){const i=s.y18n.__,n={},r=[];n.failFn=function(t){r.push(t)};let o=null,a=null,h=!0;n.showHelpOnFail=function(e=!0,s){const[i,r]="string"==typeof e?[!0,e]:[e,s];return t.getInternalMethods().isGlobalContext()&&(a=r),o=r,h=i,n};let l=!1;n.fail=function(s,i){const c=t.getInternalMethods().getLoggerInstance();if(!r.length){if(t.getExitProcess()&&E(!0),!l){l=!0,h&&(t.showHelp("error"),c.error()),(s||i)&&c.error(s||i);const e=o||a;e&&((s||i)&&c.error(""),c.error(e))}if(i=i||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,i);throw i}for(let t=r.length-1;t>=0;--t){const e=r[t];if(A(e)){if(i)throw i;if(s)throw Error(s)}else e(s,i,n)}};let c=[],f=!1;n.usage=(t,e)=>null===t?(f=!0,c=[],n):(f=!1,c.push([t,e||""]),n),n.getUsage=()=>c,n.getUsageDisabled=()=>f,n.getPositionalGroupName=()=>i("Positionals:");let d=[];n.example=(t,e)=>{d.push([t,e||""])};let u=[];n.command=function(t,e,s,i,n=!1){s&&(u=u.map((t=>(t[2]=!1,t)))),u.push([t,e||"",s,i,n])},n.getCommands=()=>u;let p={};n.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{n.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{n.describe(e,t[e])})):p[t]=e},n.getDescriptions=()=>p;let m=[];n.epilog=t=>{m.push(t)};let y,b=!1;n.wrap=t=>{b=!0,y=t},n.getWrap=()=>s.getEnv("YARGS_DISABLE_WRAP")?null:(b||(y=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),b=!0),y);const v="__yargsString__:";function O(t,e,i){let n=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{n=Math.max(s.stringWidth(i?`${i} ${I(t[0])}`:I(t[0]))+$(t[0]),n)})),e&&(n=Math.min(n,parseInt((.5*e).toString(),10))),n}let w;function C(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function j(t,e){let s=`[${i("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}n.deferY18nLookup=t=>v+t,n.help=function(){if(w)return w;!function(){const e=t.getDemandedOptions(),s=t.getOptions();(Object.keys(s.alias)||[]).forEach((i=>{s.alias[i].forEach((r=>{p[r]&&n.describe(i,p[r]),r in e&&t.demandOption(i,e[r]),s.boolean.includes(r)&&t.boolean(i),s.count.includes(r)&&t.count(i),s.string.includes(r)&&t.string(i),s.normalize.includes(r)&&t.normalize(i),s.array.includes(r)&&t.array(i),s.number.includes(r)&&t.number(i)}))}))}();const e=t.customScriptName?t.$0:s.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),h=t.getGroups(),l=t.getOptions();let g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(l.default)),g=g.filter(C),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const y=n.getWrap(),b=s.cliui({width:y,wrap:!!y});if(!f)if(c.length)c.forEach((t=>{b.div({text:`${t[0].replace(/\$0/g,e)}`}),t[1]&&b.div({text:`${t[1]}`,padding:[1,0,0,0]})})),b.div();else if(u.length){let t=null;t=o._?`${e} <${i("command")}>\n`:`${e} [${i("command")}]\n`,b.div(`${t}`)}if(u.length>1||1===u.length&&!u[0][2]){b.div(i("Commands:"));const s=t.getInternalMethods().getContext(),n=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(u=u.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=e?`${e} `:"";u.forEach((t=>{const s=`${r}${n}${t[0].replace(/^\$0 ?/,"")}`;b.span({text:s,padding:[0,2,0,2],width:O(u,y,`${e}${n}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${i("default")}]`),t[3]&&t[3].length&&o.push(`[${i("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${i("deprecated: %s",t[4])}]`):o.push(`[${i("deprecated")}]`)),o.length?b.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):b.div()})),b.div()}const M=(Object.keys(l.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&M.every((t=>-1===(l.alias[t]||[]).indexOf(e)))));const _=i("Options:");h[_]||(h[_]=[]),function(t,e,s,i){let n=[],r=null;Object.keys(s).forEach((t=>{n=n.concat(s[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==n.indexOf(t)))||s[i].push(t)}))}(g,l.alias,h,_);const k=t=>/^--/.test(I(t)),x=Object.keys(h).filter((t=>h[t].length>0)).map((t=>({groupName:t,normalizedKeys:h[t].filter(C).map((t=>{if(M.includes(t))return t;for(let e,s=0;void 0!==(e=M[s]);s++)if((l.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const s=e.reduce(((e,s)=>(e[s]=[s].concat(l.alias[s]||[]).map((e=>t===n.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?l.boolean.includes(s)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>k(t)===k(e)?0:k(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:s}}));if(x.filter((({groupName:t})=>t!==n.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>k(e[t])))))&&x.filter((({groupName:t})=>t!==n.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var s,i;k(e[t])&&(e[t]=(s=e[t],i=4,S(s)?{text:s.text,indentation:s.indentation+i}:{text:s,indentation:i}))}))})),x.forEach((({groupName:e,normalizedKeys:s,switches:o})=>{b.div(e),s.forEach((e=>{const s=o[e];let h=p[e]||"",c=null;h.includes(v)&&(h=i(h.substring(16))),l.boolean.includes(e)&&(c=`[${i("boolean")}]`),l.count.includes(e)&&(c=`[${i("count")}]`),l.string.includes(e)&&(c=`[${i("string")}]`),l.normalize.includes(e)&&(c=`[${i("string")}]`),l.array.includes(e)&&(c=`[${i("array")}]`),l.number.includes(e)&&(c=`[${i("number")}]`);const f=[e in a?(d=a[e],"string"==typeof d?`[${i("deprecated: %s",d)}]`:`[${i("deprecated")}]`):null,c,e in r?`[${i("required")}]`:null,l.choices&&l.choices[e]?`[${i("choices:")} ${n.stringifiedValues(l.choices[e])}]`:null,j(l.default[e],l.defaultDescription[e])].filter(Boolean).join(" ");var d;b.span({text:I(s),padding:[0,2,0,2+$(s)],width:O(o,y)+4},h);const u=!0===t.getInternalMethods().getUsageConfiguration()["hide-types"];f&&!u?b.div({text:f,padding:[0,0,0,2],align:"right"}):b.div()})),b.div()})),d.length&&(b.div(i("Examples:")),d.forEach((t=>{t[0]=t[0].replace(/\$0/g,e)})),d.forEach((t=>{""===t[1]?b.div({text:t[0],padding:[0,2,0,2]}):b.div({text:t[0],padding:[0,2,0,2],width:O(d,y)+4},{text:t[1]})})),b.div()),m.length>0){const t=m.map((t=>t.replace(/\$0/g,e))).join("\n");b.div(`${t}\n`)}return b.toString().replace(/\s*$/,"")},n.cacheHelpMessage=function(){w=this.help()},n.clearCachedHelpMessage=function(){w=void 0},n.hasCachedHelpMessage=function(){return!!w},n.showHelp=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(n.help())},n.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):i("generated-value"),")"].join(""),n.stringifiedValues=function(t,e){let s="";const i=e||", ",n=[].concat(t);return t&&n.length?(n.forEach((t=>{s.length&&(s+=i),s+=JSON.stringify(t)})),s):s};let M=null;n.version=t=>{M=t},n.showVersion=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(M)},n.reset=function(t){return o=null,l=!1,c=[],f=!1,m=[],d=[],u=[],p=g(p,(e=>!t[e])),n};const _=[];return n.freeze=function(){_.push({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p})},n.unfreeze=function(t=!1){const e=_.pop();e&&(t?(p={...e.descriptions,...p},u=[...e.commands,...u],c=[...e.usages,...c],d=[...e.examples,...d],m=[...e.epilogs,...m]):({failMessage:o,failureOutput:l,usages:c,usageDisabled:f,epilogs:m,examples:d,commands:u,descriptions:p}=e))},n}function S(t){return"object"==typeof t}function $(t){return S(t)?t.indentation:0}function I(t){return S(t)?t.text:t}class D{constructor(t,e,s,i){var n,r,o;this.yargs=t,this.usage=e,this.command=s,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(n=this.shim.getEnv("SHELL"))||void 0===n?void 0:n.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,s,i){const n=this.command.getCommandHandlers();for(let e=0,s=t.length;e<s;++e)if(n[t[e]]&&n[t[e]].builder){const s=n[t[e]].builder;if(x(s)){this.indexAfterLastReset=e+1;const t=this.yargs.getInternalMethods().reset();return s(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,s),this.optionCompletions(r,t,e,s),this.choicesFromOptionsCompletions(r,t,e,s),this.choicesFromPositionalsCompletions(r,t,e,s),i(null,r)}commandCompletions(t,e,s){const i=this.yargs.getInternalMethods().getContext().commands;s.match(/^-/)||i[i.length-1]===s||this.previousArgHasChoices(e)||this.usage.getCommands().forEach((s=>{const i=o(s[0]).cmd;if(-1===e.indexOf(i))if(this.zshShell){const e=s[1]||"";t.push(i.replace(/:/g,"\\:")+":"+e)}else t.push(i)}))}optionCompletions(t,e,s,i){if((i.match(/^-/)||""===i&&0===t.length)&&!this.previousArgHasChoices(e)){const s=this.yargs.getOptions(),n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach((r=>{const o=!!s.configuration["boolean-negation"]&&s.boolean.includes(r);n.includes(r)||s.hiddenOptions.includes(r)||this.argsContainKey(e,r,o)||this.completeOptionKey(r,t,i,o&&!!s.default[r])}))}}choicesFromOptionsCompletions(t,e,s,i){if(this.previousArgHasChoices(e)){const s=this.getPreviousArgChoices(e);s&&s.length>0&&t.push(...s.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,s,i){if(""===i&&t.length>0&&this.previousArgHasChoices(e))return;const n=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=n[s._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(i)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],s="";if(!e.startsWith("-")&&t.length>1&&(s=e,e=t[t.length-2]),!e.startsWith("-"))return;const i=e.replace(/^-+/,""),n=this.yargs.getOptions(),r=[i,...this.yargs.getAliases()[i]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(n.key,t)&&Array.isArray(n.choices[t])){o=n.choices[t];break}return o?o.filter((t=>!s||t.startsWith(s))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,s){const i=e=>-1!==t.indexOf((/^[^0-9]$/.test(e)?"-":"--")+e);if(i(e))return!0;if(s&&i(`no-${e}`))return!0;if(this.aliases)for(const t of this.aliases[e])if(i(t))return!0;return!1}completeOptionKey(t,e,s,i){var n,r,o,a;let h=t;if(this.zshShell){const e=this.usage.getDescriptions(),s=null===(r=null===(n=null==this?void 0:this.aliases)||void 0===n?void 0:n[t])||void 0===r?void 0:r.find((t=>{const s=e[t];return"string"==typeof s&&s.length>0})),i=s?e[s]:void 0,l=null!==(a=null!==(o=e[t])&&void 0!==o?o:i)&&void 0!==a?a:"";h=`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const l=!/^--/.test(s)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";e.push(l+h),i&&e.push(l+"no-"+h)}customCompletion(t,e,s,i){if(d(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(s,e);return f(t)?t.then((t=>{this.shim.process.nextTick((()=>{i(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{i(t,void 0)}))})):i(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(s,e,((n=i)=>this.defaultCompletion(t,e,s,n)),(t=>{i(null,t)})):this.customCompletionFunction(s,e,(t=>{i(null,t)}))}getCompletion(t,e){const s=t.length?t[t.length-1]:"",i=this.yargs.parse(t,!0),n=this.customCompletionFunction?i=>this.customCompletion(t,i,s,e):i=>this.defaultCompletion(t,i,s,e);return f(i)?i.then(n):n(i)}generateCompletionScript(t,e){let s=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const i=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,i),s=s.replace(/{{completion_command}}/g,e),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function N(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const s=[];let i,n;for(i=0;i<=e.length;i++)s[i]=[i];for(n=0;n<=t.length;n++)s[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)===t.charAt(n-1)?s[i][n]=s[i-1][n-1]:i>1&&n>1&&e.charAt(i-2)===t.charAt(n-1)&&e.charAt(i-1)===t.charAt(n-2)?s[i][n]=s[i-2][n-2]+1:s[i][n]=Math.min(s[i-1][n-1]+1,Math.min(s[i][n-1]+1,s[i-1][n]+1));return s[e.length][t.length]}const H=["$0","--","_"];var z,W,q,U,F,L,V,G,R,T,B,Y,K,J,Z,X,Q,tt,et,st,it,nt,rt,ot,at,ht,lt,ct,ft,dt,ut,pt,gt,mt,yt;const bt=Symbol("copyDoubleDash"),vt=Symbol("copyDoubleDash"),Ot=Symbol("deleteFromParserHintObject"),wt=Symbol("emitWarning"),Ct=Symbol("freeze"),jt=Symbol("getDollarZero"),Mt=Symbol("getParserConfiguration"),_t=Symbol("getUsageConfiguration"),kt=Symbol("guessLocale"),xt=Symbol("guessVersion"),Et=Symbol("parsePositionalNumbers"),At=Symbol("pkgUp"),Pt=Symbol("populateParserHintArray"),St=Symbol("populateParserHintSingleValueDictionary"),$t=Symbol("populateParserHintArrayDictionary"),It=Symbol("populateParserHintDictionary"),Dt=Symbol("sanitizeKey"),Nt=Symbol("setKey"),Ht=Symbol("unfreeze"),zt=Symbol("validateAsync"),Wt=Symbol("getCommandInstance"),qt=Symbol("getContext"),Ut=Symbol("getHasOutput"),Ft=Symbol("getLoggerInstance"),Lt=Symbol("getParseContext"),Vt=Symbol("getUsageInstance"),Gt=Symbol("getValidationInstance"),Rt=Symbol("hasParseCallback"),Tt=Symbol("isGlobalContext"),Bt=Symbol("postProcess"),Yt=Symbol("rebase"),Kt=Symbol("reset"),Jt=Symbol("runYargsParserAndExecuteCommands"),Zt=Symbol("runValidation"),Xt=Symbol("setHasOutput"),Qt=Symbol("kTrackManuallySetKeys");class te{constructor(t=[],e,s,i){this.customScriptName=!1,this.parsed=!1,z.set(this,void 0),W.set(this,void 0),q.set(this,{commands:[],fullCommands:[]}),U.set(this,null),F.set(this,null),L.set(this,"show-hidden"),V.set(this,null),G.set(this,!0),R.set(this,{}),T.set(this,!0),B.set(this,[]),Y.set(this,void 0),K.set(this,{}),J.set(this,!1),Z.set(this,null),X.set(this,!0),Q.set(this,void 0),tt.set(this,""),et.set(this,void 0),st.set(this,void 0),it.set(this,{}),nt.set(this,null),rt.set(this,null),ot.set(this,{}),at.set(this,{}),ht.set(this,void 0),lt.set(this,!1),ct.set(this,void 0),ft.set(this,!1),dt.set(this,!1),ut.set(this,!1),pt.set(this,void 0),gt.set(this,{}),mt.set(this,null),yt.set(this,void 0),O(this,ct,i,"f"),O(this,ht,t,"f"),O(this,W,e,"f"),O(this,st,s,"f"),O(this,Y,new w(this),"f"),this.$0=this[jt](),this[Kt](),O(this,z,v(this,z,"f"),"f"),O(this,pt,v(this,pt,"f"),"f"),O(this,yt,v(this,yt,"f"),"f"),O(this,et,v(this,et,"f"),"f"),v(this,et,"f").showHiddenOpt=v(this,L,"f"),O(this,Q,this[vt](),"f")}addHelpOpt(t,e){return h("[string|boolean] [string]",[t,e],arguments.length),v(this,Z,"f")&&(this[Ot](v(this,Z,"f")),O(this,Z,null,"f")),!1===t&&void 0===e||(O(this,Z,"string"==typeof t?t:"help","f"),this.boolean(v(this,Z,"f")),this.describe(v(this,Z,"f"),e||v(this,pt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(h("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const s="string"==typeof t?t:v(this,L,"f");return this.boolean(s),this.describe(s,e||v(this,pt,"f").deferY18nLookup("Show hidden options")),v(this,et,"f").showHiddenOpt=s,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return h("<object|string|array> [string|array]",[t,e],arguments.length),this[$t](this.alias.bind(this),"alias",t,e),this}array(t){return h("<array|string>",[t],arguments.length),this[Pt]("array",t),this[Qt](t),this}boolean(t){return h("<array|string>",[t],arguments.length),this[Pt]("boolean",t),this[Qt](t),this}check(t,e){return h("<function> [boolean]",[t,e],arguments.length),this.middleware(((e,s)=>j((()=>t(e,s.getOptions())),(s=>(s?("string"==typeof s||s instanceof Error)&&v(this,pt,"f").fail(s.toString(),s):v(this,pt,"f").fail(v(this,ct,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(v(this,pt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return h("<object|string|array> [string|array]",[t,e],arguments.length),this[$t](this.choices.bind(this),"choices",t,e),this}coerce(t,s){if(h("<object|string|array> [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const e of t)this.coerce(e,s);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!s)throw new e("coerce callback must be provided");return v(this,et,"f").key[t]=!0,v(this,Y,"f").addCoerceMiddleware(((i,n)=>{let r;return Object.prototype.hasOwnProperty.call(i,t)?j((()=>(r=n.getAliases(),s(i[t]))),(e=>{i[t]=e;const s=n.getInternalMethods().getParserConfiguration()["strip-aliased"];if(r[t]&&!0!==s)for(const s of r[t])i[s]=e;return i}),(t=>{throw new e(t.message)})):i}),t),this}conflicts(t,e){return h("<string|object> [string|array]",[t,e],arguments.length),v(this,yt,"f").conflicts(t,e),this}config(t="config",e,s){return h("[object|string] [string|function] [function]",[t,e,s],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(s=e,e=void 0),this.describe(t,e||v(this,pt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{v(this,et,"f").config[t]=s||!0})),this):(t=n(t,v(this,W,"f"),this[Mt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(t),this)}completion(t,e,s){return h("[string] [string|boolean|function] [function]",[t,e,s],arguments.length),"function"==typeof e&&(s=e,e=void 0),O(this,F,t||v(this,F,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(v(this,F,"f"),e),s&&v(this,U,"f").registerFunction(s),this}command(t,e,s,i,n,r){return h("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,s,i,n,r],arguments.length),v(this,z,"f").addHandler(t,e,s,i,n,r),this}commands(t,e,s,i,n,r){return this.command(t,e,s,i,n,r)}commandDir(t,e){h("<string> [object]",[t,e],arguments.length);const s=v(this,st,"f")||v(this,ct,"f").require;return v(this,z,"f").addDirectory(t,s,v(this,ct,"f").getCallerFile(),e),this}count(t){return h("<array|string>",[t],arguments.length),this[Pt]("count",t),this[Qt](t),this}default(t,e,s){return h("<object|string|array> [*] [string]",[t,e,s],arguments.length),s&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]=s),"function"==typeof e&&(u(t,v(this,ct,"f")),v(this,et,"f").defaultDescription[t]||(v(this,et,"f").defaultDescription[t]=v(this,pt,"f").functionDescription(e)),e=e.call()),this[St](this.default.bind(this),"default",t,e),this}defaults(t,e,s){return this.default(t,e,s)}demandCommand(t=1,e,s,i){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,s,i],arguments.length),"number"!=typeof e&&(s=e,e=1/0),this.global("_",!1),v(this,et,"f").demandedCommands._={min:t,max:e,minMsg:s,maxMsg:i},this}demand(t,e,s){return Array.isArray(e)?(e.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})),e=1/0):"number"!=typeof e&&(s=e,e=1/0),"number"==typeof t?(d(s,!0,v(this,ct,"f")),this.demandCommand(t,e,s,s)):Array.isArray(t)?t.forEach((t=>{d(s,!0,v(this,ct,"f")),this.demandOption(t,s)})):"string"==typeof s?this.demandOption(t,s):!0!==s&&void 0!==s||this.demandOption(t),this}demandOption(t,e){return h("<object|string|array> [string]",[t,e],arguments.length),this[St](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return h("<string> [string|boolean]",[t,e],arguments.length),v(this,et,"f").deprecatedOptions[t]=e,this}describe(t,e){return h("<object|string|array> [string]",[t,e],arguments.length),this[Nt](t,!0),v(this,pt,"f").describe(t,e),this}detectLocale(t){return h("<boolean>",[t],arguments.length),O(this,G,t,"f"),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete v(this,et,"f").envPrefix:v(this,et,"f").envPrefix=t||"",this}epilogue(t){return h("<string>",[t],arguments.length),v(this,pt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return h("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):v(this,pt,"f").example(t,e),this}exit(t,e){O(this,J,!0,"f"),O(this,V,e,"f"),v(this,T,"f")&&v(this,ct,"f").process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),O(this,T,t,"f"),this}fail(t){if(h("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return v(this,pt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return h("<array> [function]",[t,e],arguments.length),e?v(this,U,"f").getCompletion(t,e):new Promise(((e,s)=>{v(this,U,"f").getCompletion(t,((t,i)=>{t?s(t):e(i)}))}))}getDemandedOptions(){return h([],0),v(this,et,"f").demandedOptions}getDemandedCommands(){return h([],0),v(this,et,"f").demandedCommands}getDeprecatedOptions(){return h([],0),v(this,et,"f").deprecatedOptions}getDetectLocale(){return v(this,G,"f")}getExitProcess(){return v(this,T,"f")}getGroups(){return Object.assign({},v(this,K,"f"),v(this,at,"f"))}getHelp(){if(O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Jt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(t))return t.then((()=>v(this,pt,"f").help()))}const t=v(this,z,"f").runDefaultBuilderOn(this);if(f(t))return t.then((()=>v(this,pt,"f").help()))}return Promise.resolve(v(this,pt,"f").help())}getOptions(){return v(this,et,"f")}getStrict(){return v(this,ft,"f")}getStrictCommands(){return v(this,dt,"f")}getStrictOptions(){return v(this,ut,"f")}global(t,e){return h("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?v(this,et,"f").local=v(this,et,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{v(this,et,"f").local.includes(t)||v(this,et,"f").local.push(t)})),this}group(t,e){h("<string|array> <string>",[t,e],arguments.length);const s=v(this,at,"f")[e]||v(this,K,"f")[e];v(this,at,"f")[e]&&delete v(this,at,"f")[e];const i={};return v(this,K,"f")[e]=(s||[]).concat(t).filter((t=>!i[t]&&(i[t]=!0))),this}hide(t){return h("<string>",[t],arguments.length),v(this,et,"f").hiddenOptions.push(t),this}implies(t,e){return h("<string|object> [number|string|array]",[t,e],arguments.length),v(this,yt,"f").implies(t,e),this}locale(t){return h("[string]",[t],arguments.length),void 0===t?(this[kt](),v(this,ct,"f").y18n.getLocale()):(O(this,G,!1,"f"),v(this,ct,"f").y18n.setLocale(t),this)}middleware(t,e,s){return v(this,Y,"f").addMiddleware(t,!!e,s)}nargs(t,e){return h("<string|object|array> [number]",[t,e],arguments.length),this[St](this.nargs.bind(this),"narg",t,e),this}normalize(t){return h("<array|string>",[t],arguments.length),this[Pt]("normalize",t),this}number(t){return h("<array|string>",[t],arguments.length),this[Pt]("number",t),this[Qt](t),this}option(t,e){if(h("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Qt](t),!v(this,mt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[wt](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),v(this,et,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const s=e.deprecate||e.deprecated;s&&this.deprecateOption(t,s);const i=e.demand||e.required||e.require;i&&this.demand(t,i),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(v(this,et,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const n=e.describe||e.description||e.desc,r=v(this,pt,"f").getDescriptions();Object.prototype.hasOwnProperty.call(r,t)&&"string"!=typeof n||this.describe(t,n),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,s){h("[string|array] [function|boolean|object] [function]",[t,e,s],arguments.length),this[Ct](),void 0===t&&(t=v(this,ht,"f")),"object"==typeof e&&(O(this,rt,e,"f"),e=s),"function"==typeof e&&(O(this,nt,e,"f"),e=!1),e||O(this,ht,t,"f"),v(this,nt,"f")&&O(this,T,!1,"f");const i=this[Jt](t,!!e),n=this.parsed;return v(this,U,"f").setParsed(this.parsed),f(i)?i.then((t=>(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),t,v(this,tt,"f")),t))).catch((t=>{throw v(this,nt,"f")&&v(this,nt,"f")(t,this.parsed.argv,v(this,tt,"f")),t})).finally((()=>{this[Ht](),this.parsed=n})):(v(this,nt,"f")&&v(this,nt,"f").call(this,v(this,V,"f"),i,v(this,tt,"f")),this[Ht](),this.parsed=n,i)}parseAsync(t,e,s){const i=this.parse(t,e,s);return f(i)?i:Promise.resolve(i)}parseSync(t,s,i){const n=this.parse(t,s,i);if(f(n))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return n}parserConfiguration(t){return h("<object>",[t],arguments.length),O(this,it,t,"f"),this}pkgConf(t,e){h("<string> [string]",[t,e],arguments.length);let s=null;const i=this[At](e||v(this,W,"f"));return i[t]&&"object"==typeof i[t]&&(s=n(i[t],e||v(this,W,"f"),this[Mt]()["deep-merge-config"]||!1,v(this,ct,"f")),v(this,et,"f").configObjects=(v(this,et,"f").configObjects||[]).concat(s)),this}positional(t,e){h("<string> <object>",[t,e],arguments.length);const s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=g(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&s.includes(t)));const i=v(this,q,"f").fullCommands[v(this,q,"f").fullCommands.length-1],n=i?v(this,z,"f").cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return p(n).forEach((s=>{const i=n[s];Array.isArray(i)?-1!==i.indexOf(t)&&(e[s]=!0):i[t]&&!(s in e)&&(e[s]=i[t])})),this.group(t,v(this,pt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),O(this,lt,t,"f"),this}required(t,e,s){return this.demand(t,e,s)}require(t,e,s){return this.demand(t,e,s)}requiresArg(t){return h("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&v(this,et,"f").narg[t]||this[St](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return h("[string] [string]",[t,e],arguments.length),t=t||this.$0,v(this,Q,"f").log(v(this,U,"f").generateCompletionScript(t,e||v(this,F,"f")||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),O(this,J,!0,"f"),!v(this,pt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Jt](v(this,ht,"f"),void 0,void 0,0,!0);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}const e=v(this,z,"f").runDefaultBuilderOn(this);if(f(e))return e.then((()=>{v(this,pt,"f").showHelp(t)})),this}return v(this,pt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return h("[boolean|string] [string]",[t,e],arguments.length),v(this,pt,"f").showHelpOnFail(t,e),this}showVersion(t){return h("[string|function]",[t],arguments.length),v(this,pt,"f").showVersion(t),this}skipValidation(t){return h("<array|string>",[t],arguments.length),this[Pt]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),O(this,ft,!1!==t,"f"),this}strictCommands(t){return h("[boolean]",[t],arguments.length),O(this,dt,!1!==t,"f"),this}strictOptions(t){return h("[boolean]",[t],arguments.length),O(this,ut,!1!==t,"f"),this}string(t){return h("<array|string>",[t],arguments.length),this[Pt]("string",t),this[Qt](t),this}terminalWidth(){return h([],0),v(this,ct,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("<object>",[t],arguments.length),O(this,G,!1,"f"),v(this,ct,"f").y18n.updateLocale(t),this}usage(t,s,i,n){if(h("<string|null|undefined> [string|boolean] [function|object] [function]",[t,s,i,n],arguments.length),void 0!==s){if(d(t,null,v(this,ct,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,s,i,n);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return v(this,pt,"f").usage(t),this}usageConfiguration(t){return h("<object>",[t],arguments.length),O(this,gt,t,"f"),this}version(t,e,s){const i="version";if(h("[boolean|string] [string] [string]",[t,e,s],arguments.length),v(this,mt,"f")&&(this[Ot](v(this,mt,"f")),v(this,pt,"f").version(void 0),O(this,mt,null,"f")),0===arguments.length)s=this[xt](),t=i;else if(1===arguments.length){if(!1===t)return this;s=t,t=i}else 2===arguments.length&&(s=e,e=void 0);return O(this,mt,"string"==typeof t?t:i,"f"),e=e||v(this,pt,"f").deferY18nLookup("Show version number"),v(this,pt,"f").version(s||void 0),this.boolean(v(this,mt,"f")),this.describe(v(this,mt,"f"),e),this}wrap(t){return h("<number|null|undefined>",[t],arguments.length),v(this,pt,"f").wrap(t),this}[(z=new WeakMap,W=new WeakMap,q=new WeakMap,U=new WeakMap,F=new WeakMap,L=new WeakMap,V=new WeakMap,G=new WeakMap,R=new WeakMap,T=new WeakMap,B=new WeakMap,Y=new WeakMap,K=new WeakMap,J=new WeakMap,Z=new WeakMap,X=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,it=new WeakMap,nt=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,lt=new WeakMap,ct=new WeakMap,ft=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt=new WeakMap,yt=new WeakMap,bt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[vt](){return{log:(...t)=>{this[Rt]()||console.log(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")},error:(...t)=>{this[Rt]()||console.error(...t),O(this,J,!0,"f"),v(this,tt,"f").length&&O(this,tt,v(this,tt,"f")+"\n","f"),O(this,tt,v(this,tt,"f")+t.join(" "),"f")}}}[Ot](t){p(v(this,et,"f")).forEach((e=>{if("configObjects"===e)return;const s=v(this,et,"f")[e];Array.isArray(s)?s.includes(t)&&s.splice(s.indexOf(t),1):"object"==typeof s&&delete s[t]})),delete v(this,pt,"f").getDescriptions()[t]}[wt](t,e,s){v(this,R,"f")[s]||(v(this,ct,"f").process.emitWarning(t,e),v(this,R,"f")[s]=!0)}[Ct](){v(this,B,"f").push({options:v(this,et,"f"),configObjects:v(this,et,"f").configObjects.slice(0),exitProcess:v(this,T,"f"),groups:v(this,K,"f"),strict:v(this,ft,"f"),strictCommands:v(this,dt,"f"),strictOptions:v(this,ut,"f"),completionCommand:v(this,F,"f"),output:v(this,tt,"f"),exitError:v(this,V,"f"),hasOutput:v(this,J,"f"),parsed:this.parsed,parseFn:v(this,nt,"f"),parseContext:v(this,rt,"f")}),v(this,pt,"f").freeze(),v(this,yt,"f").freeze(),v(this,z,"f").freeze(),v(this,Y,"f").freeze()}[jt](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(v(this,ct,"f").process.argv()[0])?v(this,ct,"f").process.argv().slice(1,2):v(this,ct,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[Yt](v(this,W,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t})).join(" ").trim(),v(this,ct,"f").getEnv("_")&&v(this,ct,"f").getProcessArgvBin()===v(this,ct,"f").getEnv("_")&&(e=v(this,ct,"f").getEnv("_").replace(`${v(this,ct,"f").path.dirname(v(this,ct,"f").process.execPath())}/`,"")),e}[Mt](){return v(this,it,"f")}[_t](){return v(this,gt,"f")}[kt](){if(!v(this,G,"f"))return;const t=v(this,ct,"f").getEnv("LC_ALL")||v(this,ct,"f").getEnv("LC_MESSAGES")||v(this,ct,"f").getEnv("LANG")||v(this,ct,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[xt](){return this[At]().version||"unknown"}[Et](t){const e=t["--"]?t["--"]:t._;for(let t,s=0;void 0!==(t=e[s]);s++)v(this,ct,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[s]=Number(t));return t}[At](t){const e=t||"*";if(v(this,ot,"f")[e])return v(this,ot,"f")[e];let s={};try{let e=t||v(this,ct,"f").mainFilename;!t&&v(this,ct,"f").path.extname(e)&&(e=v(this,ct,"f").path.dirname(e));const i=v(this,ct,"f").findUp(e,((t,e)=>e.includes("package.json")?"package.json":void 0));d(i,void 0,v(this,ct,"f")),s=JSON.parse(v(this,ct,"f").readFileSync(i,"utf8"))}catch(t){}return v(this,ot,"f")[e]=s||{},v(this,ot,"f")[e]}[Pt](t,e){(e=[].concat(e)).forEach((e=>{e=this[Dt](e),v(this,et,"f")[t].push(e)}))}[St](t,e,s,i){this[It](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=s}))}[$t](t,e,s,i){this[It](t,e,s,i,((t,e,s)=>{v(this,et,"f")[t][e]=(v(this,et,"f")[t][e]||[]).concat(s)}))}[It](t,e,s,i,n){if(Array.isArray(s))s.forEach((e=>{t(e,i)}));else if((t=>"object"==typeof t)(s))for(const e of p(s))t(e,s[e]);else n(e,this[Dt](s),i)}[Dt](t){return"__proto__"===t?"___proto___":t}[Nt](t,e){return this[St](this[Nt].bind(this),"key",t,e),this}[Ht](){var t,e,s,i,n,r,o,a,h,l,c,f;const u=v(this,B,"f").pop();let p;d(u,void 0,v(this,ct,"f")),t=this,e=this,s=this,i=this,n=this,r=this,o=this,a=this,h=this,l=this,c=this,f=this,({options:{set value(e){O(t,et,e,"f")}}.value,configObjects:p,exitProcess:{set value(t){O(e,T,t,"f")}}.value,groups:{set value(t){O(s,K,t,"f")}}.value,output:{set value(t){O(i,tt,t,"f")}}.value,exitError:{set value(t){O(n,V,t,"f")}}.value,hasOutput:{set value(t){O(r,J,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){O(o,ft,t,"f")}}.value,strictCommands:{set value(t){O(a,dt,t,"f")}}.value,strictOptions:{set value(t){O(h,ut,t,"f")}}.value,completionCommand:{set value(t){O(l,F,t,"f")}}.value,parseFn:{set value(t){O(c,nt,t,"f")}}.value,parseContext:{set value(t){O(f,rt,t,"f")}}.value}=u),v(this,et,"f").configObjects=p,v(this,pt,"f").unfreeze(),v(this,yt,"f").unfreeze(),v(this,z,"f").unfreeze(),v(this,Y,"f").unfreeze()}[zt](t,e){return j(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Wt].bind(this),getContext:this[qt].bind(this),getHasOutput:this[Ut].bind(this),getLoggerInstance:this[Ft].bind(this),getParseContext:this[Lt].bind(this),getParserConfiguration:this[Mt].bind(this),getUsageConfiguration:this[_t].bind(this),getUsageInstance:this[Vt].bind(this),getValidationInstance:this[Gt].bind(this),hasParseCallback:this[Rt].bind(this),isGlobalContext:this[Tt].bind(this),postProcess:this[Bt].bind(this),reset:this[Kt].bind(this),runValidation:this[Zt].bind(this),runYargsParserAndExecuteCommands:this[Jt].bind(this),setHasOutput:this[Xt].bind(this)}}[Wt](){return v(this,z,"f")}[qt](){return v(this,q,"f")}[Ut](){return v(this,J,"f")}[Ft](){return v(this,Q,"f")}[Lt](){return v(this,rt,"f")||{}}[Vt](){return v(this,pt,"f")}[Gt](){return v(this,yt,"f")}[Rt](){return!!v(this,nt,"f")}[Tt](){return v(this,X,"f")}[Bt](t,e,s,i){if(s)return t;if(f(t))return t;e||(t=this[bt](t));return(this[Mt]()["parse-positional-numbers"]||void 0===this[Mt]()["parse-positional-numbers"])&&(t=this[Et](t)),i&&(t=C(t,this,v(this,Y,"f").getMiddleware(),!1)),t}[Kt](t={}){O(this,et,v(this,et,"f")||{},"f");const e={};e.local=v(this,et,"f").local||[],e.configObjects=v(this,et,"f").configObjects||[];const s={};e.local.forEach((e=>{s[e]=!0,(t[e]||[]).forEach((t=>{s[t]=!0}))})),Object.assign(v(this,at,"f"),Object.keys(v(this,K,"f")).reduce(((t,e)=>{const i=v(this,K,"f")[e].filter((t=>!(t in s)));return i.length>0&&(t[e]=i),t}),{})),O(this,K,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(v(this,et,"f")[t]||[]).filter((t=>!s[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=g(v(this,et,"f")[t],(t=>!s[t]))})),e.envPrefix=v(this,et,"f").envPrefix,O(this,et,e,"f"),O(this,pt,v(this,pt,"f")?v(this,pt,"f").reset(s):P(this,v(this,ct,"f")),"f"),O(this,yt,v(this,yt,"f")?v(this,yt,"f").reset(s):function(t,e,s){const i=s.y18n.__,n=s.y18n.__n,r={nonOptionCount:function(s){const i=t.getDemandedCommands(),r=s._.length+(s["--"]?s["--"].length:0)-t.getInternalMethods().getContext().commands.length;i._&&(r<i._.min||r>i._.max)&&(r<i._.min?void 0!==i._.minMsg?e.fail(i._.minMsg?i._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.min.toString()):null):e.fail(n("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r.toString(),i._.min.toString())):r>i._.max&&(void 0!==i._.maxMsg?e.fail(i._.maxMsg?i._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,i._.max.toString()):null):e.fail(n("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),i._.max.toString()))))},positionalCount:function(t,s){s<t&&e.fail(n("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",s,s+"",t+""))},requiredArguments:function(t,s){let i=null;for(const e of Object.keys(s))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(i=i||{},i[e]=s[e]);if(i){const t=[];for(const e of Object.keys(i)){const s=i[e];s&&t.indexOf(s)<0&&t.push(s)}const s=t.length?`\n${t.join("\n")}`:"";e.fail(n("Missing required argument: %s","Missing required arguments: %s",Object.keys(i).length,Object.keys(i).join(", ")+s))}},unknownArguments:function(s,i,o,a,h=!0){var l;const c=t.getInternalMethods().getCommandInstance().getCommands(),f=[],d=t.getInternalMethods().getContext();if(Object.keys(s).forEach((e=>{H.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,i)||f.push(e)})),h&&(d.commands.length>0||c.length>0||a)&&s._.slice(d.commands.length).forEach((t=>{c.includes(""+t)||f.push(""+t)})),h){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,i=d.commands.length+e;i<s._.length&&s._.slice(i).forEach((t=>{t=String(t),d.commands.includes(t)||f.includes(t)||f.push(t)}))}f.length&&e.fail(n("Unknown argument: %s","Unknown arguments: %s",f.length,f.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(s){const i=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||i.length>0)&&s._.slice(o.commands.length).forEach((t=>{i.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(n("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,s){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;const i=t.parsed.newAliases;return[e,...s[e]].some((t=>!Object.prototype.hasOwnProperty.call(i,t)||!i[e]))},limitedChoices:function(s){const n=t.getOptions(),r={};if(!Object.keys(n.choices).length)return;Object.keys(s).forEach((t=>{-1===H.indexOf(t)&&Object.prototype.hasOwnProperty.call(n.choices,t)&&[].concat(s[t]).forEach((e=>{-1===n.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=i("Invalid values:");o.forEach((t=>{a+=`\n ${i("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(n.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const s=Number(e);return"number"==typeof(e=isNaN(s)?e:s)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,i){h("<string|object> [array|number|string]",[e,i],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(i)?i.forEach((t=>r.implies(e,t))):(d(i,void 0,s),o[e].push(i)))},r.getImplied=function(){return o},r.implications=function(t){const s=[];if(Object.keys(o).forEach((e=>{const i=e;(o[e]||[]).forEach((e=>{let n=i;const r=e;n=a(t,n),e=a(t,e),n&&!e&&s.push(` ${i} -> ${r}`)}))})),s.length){let t=`${i("Implications failed:")}\n`;s.forEach((e=>{t+=e})),e.fail(t)}};let l={};r.conflicts=function(e,s){h("<string|object> [array|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),l[e]||(l[e]=[]),Array.isArray(s)?s.forEach((t=>r.conflicts(e,t))):l[e].push(s))},r.getConflicting=()=>l,r.conflicting=function(n){Object.keys(n).forEach((t=>{l[t]&&l[t].forEach((s=>{s&&void 0!==n[t]&&void 0!==n[s]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,s))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(l).forEach((t=>{l[t].forEach((r=>{r&&void 0!==n[s.Parser.camelCase(t)]&&void 0!==n[s.Parser.camelCase(r)]&&e.fail(i("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,s){s=s.sort(((t,e)=>e.length-t.length));let n=null,r=1/0;for(let e,i=0;void 0!==(e=s[i]);i++){const s=N(t,e);s<=3&&s<r&&(r=s,n=e)}n&&e.fail(i("Did you mean %s?",n))},r.reset=function(t){return o=g(o,(e=>!t[e])),l=g(l,(e=>!t[e])),r};const c=[];return r.freeze=function(){c.push({implied:o,conflicting:l})},r.unfreeze=function(){const t=c.pop();d(t,void 0,s),({implied:o,conflicting:l}=t)},r}(this,v(this,pt,"f"),v(this,ct,"f")),"f"),O(this,z,v(this,z,"f")?v(this,z,"f").reset():function(t,e,s,i){return new _(t,e,s,i)}(v(this,pt,"f"),v(this,yt,"f"),v(this,Y,"f"),v(this,ct,"f")),"f"),v(this,U,"f")||O(this,U,function(t,e,s,i){return new D(t,e,s,i)}(this,v(this,pt,"f"),v(this,z,"f"),v(this,ct,"f")),"f"),v(this,Y,"f").reset(),O(this,F,null,"f"),O(this,tt,"","f"),O(this,V,null,"f"),O(this,J,!1,"f"),this.parsed=!1,this}[Yt](t,e){return v(this,ct,"f").path.relative(t,e)}[Jt](t,s,i,n=0,r=!1){let o=!!i||r;t=t||v(this,ht,"f"),v(this,et,"f").__=v(this,ct,"f").y18n.__,v(this,et,"f").configuration=this[Mt]();const a=!!v(this,et,"f").configuration["populate--"],h=Object.assign({},v(this,et,"f").configuration,{"populate--":!0}),l=v(this,ct,"f").Parser.detailed(t,Object.assign({},v(this,et,"f"),{configuration:{"parse-positional-numbers":!1,...h}})),c=Object.assign(l.argv,v(this,rt,"f"));let d;const u=l.aliases;let p=!1,g=!1;Object.keys(c).forEach((t=>{t===v(this,Z,"f")&&c[t]?p=!0:t===v(this,mt,"f")&&c[t]&&(g=!0)})),c.$0=this.$0,this.parsed=l,0===n&&v(this,pt,"f").clearCachedHelpMessage();try{if(this[kt](),s)return this[Bt](c,a,!!i,!1);if(v(this,Z,"f")){[v(this,Z,"f")].concat(u[v(this,Z,"f")]||[]).filter((t=>t.length>1)).includes(""+c._[c._.length-1])&&(c._.pop(),p=!0)}O(this,X,!1,"f");const h=v(this,z,"f").getCommands(),m=v(this,U,"f").completionKey in c,y=p||m||r;if(c._.length){if(h.length){let t;for(let e,s=n||0;void 0!==c._[s];s++){if(e=String(c._[s]),h.includes(e)&&e!==v(this,F,"f")){const t=v(this,z,"f").runCommand(e,this,l,s+1,r,p||g||r);return this[Bt](t,a,!!i,!1)}if(!t&&e!==v(this,F,"f")){t=e;break}}!v(this,z,"f").hasDefaultCommand()&&v(this,lt,"f")&&t&&!y&&v(this,yt,"f").recommendCommands(t,h)}v(this,F,"f")&&c._.includes(v(this,F,"f"))&&!m&&(v(this,T,"f")&&E(!0),this.showCompletionScript(),this.exit(0))}if(v(this,z,"f").hasDefaultCommand()&&!y){const t=v(this,z,"f").runCommand(null,this,l,0,r,p||g||r);return this[Bt](t,a,!!i,!1)}if(m){v(this,T,"f")&&E(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${v(this,U,"f").completionKey}`)+1);return v(this,U,"f").getCompletion(s,((t,s)=>{if(t)throw new e(t.message);(s||[]).forEach((t=>{v(this,Q,"f").log(t)})),this.exit(0)})),this[Bt](c,!a,!!i,!1)}if(v(this,J,"f")||(p?(v(this,T,"f")&&E(!0),o=!0,this.showHelp("log"),this.exit(0)):g&&(v(this,T,"f")&&E(!0),o=!0,v(this,pt,"f").showVersion("log"),this.exit(0))),!o&&v(this,et,"f").skipValidation.length>0&&(o=Object.keys(c).some((t=>v(this,et,"f").skipValidation.indexOf(t)>=0&&!0===c[t]))),!o){if(l.error)throw new e(l.error.message);if(!m){const t=this[Zt](u,{},l.error);i||(d=C(c,this,v(this,Y,"f").getMiddleware(),!0)),d=this[zt](t,null!=d?d:c),f(d)&&!i&&(d=d.then((()=>C(c,this,v(this,Y,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof e))throw t;v(this,pt,"f").fail(t.message,t)}return this[Bt](null!=d?d:c,a,!!i,!0)}[Zt](t,s,i,n){const r={...this.getDemandedOptions()};return o=>{if(i)throw new e(i.message);v(this,yt,"f").nonOptionCount(o),v(this,yt,"f").requiredArguments(o,r);let a=!1;v(this,dt,"f")&&(a=v(this,yt,"f").unknownCommands(o)),v(this,ft,"f")&&!a?v(this,yt,"f").unknownArguments(o,t,s,!!n):v(this,ut,"f")&&v(this,yt,"f").unknownArguments(o,t,{},!1,!1),v(this,yt,"f").limitedChoices(o),v(this,yt,"f").implications(o),v(this,yt,"f").conflicting(o)}}[Xt](){O(this,J,!0,"f")}[Qt](t){if("string"==typeof t)v(this,et,"f").key[t]=!0;else for(const e of t)v(this,et,"f").key[e]=!0}}var ee,se;const{readFileSync:ie}=require("fs"),{inspect:ne}=require("util"),{resolve:re}=require("path"),oe=require("y18n"),ae=require("yargs-parser");var he,le={assert:{notStrictEqual:t.notStrictEqual,strictEqual:t.strictEqual},cliui:require("cliui"),findUp:require("escalade/sync"),getEnv:t=>process.env[t],getCallerFile:require("get-caller-file"),getProcessArgvBin:y,inspect:ne,mainFilename:null!==(se=null===(ee=null===require||void 0===require?void 0:require.main)||void 0===ee?void 0:ee.filename)&&void 0!==se?se:process.cwd(),Parser:ae,path:require("path"),process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:ie,require:require,requireDirectory:require("require-directory"),stringWidth:require("string-width"),y18n:oe({directory:re(__dirname,"../locales"),updateFiles:!1})};const ce=(null===(he=null===process||void 0===process?void 0:process.env)||void 0===he?void 0:he.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1])<ce)throw Error(`yargs supports a minimum Node.js version of ${ce}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`)}const fe=require("yargs-parser");var de,ue={applyExtends:n,cjsPlatformShim:le,Yargs:(de=le,(t=[],e=de.process.cwd(),s)=>{const i=new te(t,e,s,de);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}),argsert:h,isPromise:f,objFilter:g,parseCommand:o,Parser:fe,processArgv:b,YError:e};module.exports=ue;
diff --git a/node_modules/yargs/build/lib/argsert.js b/node_modules/yargs/build/lib/argsert.js
new file mode 100644
index 0000000..be5b3aa
--- /dev/null
+++ b/node_modules/yargs/build/lib/argsert.js
@@ -0,0 +1,62 @@
+import { YError } from './yerror.js';
+import { parseCommand } from './parse-command.js';
+const positionName = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth'];
+export function argsert(arg1, arg2, arg3) {
+ function parseArgs() {
+ return typeof arg1 === 'object'
+ ? [{ demanded: [], optional: [] }, arg1, arg2]
+ : [
+ parseCommand(`cmd ${arg1}`),
+ arg2,
+ arg3,
+ ];
+ }
+ try {
+ let position = 0;
+ const [parsed, callerArguments, _length] = parseArgs();
+ const args = [].slice.call(callerArguments);
+ while (args.length && args[args.length - 1] === undefined)
+ args.pop();
+ const length = _length || args.length;
+ if (length < parsed.demanded.length) {
+ throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`);
+ }
+ const totalCommands = parsed.demanded.length + parsed.optional.length;
+ if (length > totalCommands) {
+ throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`);
+ }
+ parsed.demanded.forEach(demanded => {
+ const arg = args.shift();
+ const observedType = guessType(arg);
+ const matchingTypes = demanded.cmd.filter(type => type === observedType || type === '*');
+ if (matchingTypes.length === 0)
+ argumentTypeError(observedType, demanded.cmd, position);
+ position += 1;
+ });
+ parsed.optional.forEach(optional => {
+ if (args.length === 0)
+ return;
+ const arg = args.shift();
+ const observedType = guessType(arg);
+ const matchingTypes = optional.cmd.filter(type => type === observedType || type === '*');
+ if (matchingTypes.length === 0)
+ argumentTypeError(observedType, optional.cmd, position);
+ position += 1;
+ });
+ }
+ catch (err) {
+ console.warn(err.stack);
+ }
+}
+function guessType(arg) {
+ if (Array.isArray(arg)) {
+ return 'array';
+ }
+ else if (arg === null) {
+ return 'null';
+ }
+ return typeof arg;
+}
+function argumentTypeError(observedType, allowedTypes, position) {
+ throw new YError(`Invalid ${positionName[position] || 'manyith'} argument. Expected ${allowedTypes.join(' or ')} but received ${observedType}.`);
+}
diff --git a/node_modules/yargs/build/lib/command.js b/node_modules/yargs/build/lib/command.js
new file mode 100644
index 0000000..47c1ed6
--- /dev/null
+++ b/node_modules/yargs/build/lib/command.js
@@ -0,0 +1,449 @@
+import { assertNotStrictEqual, } from './typings/common-types.js';
+import { isPromise } from './utils/is-promise.js';
+import { applyMiddleware, commandMiddlewareFactory, } from './middleware.js';
+import { parseCommand } from './parse-command.js';
+import { isYargsInstance, } from './yargs-factory.js';
+import { maybeAsyncResult } from './utils/maybe-async-result.js';
+import whichModule from './utils/which-module.js';
+const DEFAULT_MARKER = /(^\*)|(^\$0)/;
+export class CommandInstance {
+ constructor(usage, validation, globalMiddleware, shim) {
+ this.requireCache = new Set();
+ this.handlers = {};
+ this.aliasMap = {};
+ this.frozens = [];
+ this.shim = shim;
+ this.usage = usage;
+ this.globalMiddleware = globalMiddleware;
+ this.validation = validation;
+ }
+ addDirectory(dir, req, callerFile, opts) {
+ opts = opts || {};
+ if (typeof opts.recurse !== 'boolean')
+ opts.recurse = false;
+ if (!Array.isArray(opts.extensions))
+ opts.extensions = ['js'];
+ const parentVisit = typeof opts.visit === 'function' ? opts.visit : (o) => o;
+ opts.visit = (obj, joined, filename) => {
+ const visited = parentVisit(obj, joined, filename);
+ if (visited) {
+ if (this.requireCache.has(joined))
+ return visited;
+ else
+ this.requireCache.add(joined);
+ this.addHandler(visited);
+ }
+ return visited;
+ };
+ this.shim.requireDirectory({ require: req, filename: callerFile }, dir, opts);
+ }
+ addHandler(cmd, description, builder, handler, commandMiddleware, deprecated) {
+ let aliases = [];
+ const middlewares = commandMiddlewareFactory(commandMiddleware);
+ handler = handler || (() => { });
+ if (Array.isArray(cmd)) {
+ if (isCommandAndAliases(cmd)) {
+ [cmd, ...aliases] = cmd;
+ }
+ else {
+ for (const command of cmd) {
+ this.addHandler(command);
+ }
+ }
+ }
+ else if (isCommandHandlerDefinition(cmd)) {
+ let command = Array.isArray(cmd.command) || typeof cmd.command === 'string'
+ ? cmd.command
+ : this.moduleName(cmd);
+ if (cmd.aliases)
+ command = [].concat(command).concat(cmd.aliases);
+ this.addHandler(command, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated);
+ return;
+ }
+ else if (isCommandBuilderDefinition(builder)) {
+ this.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated);
+ return;
+ }
+ if (typeof cmd === 'string') {
+ const parsedCommand = parseCommand(cmd);
+ aliases = aliases.map(alias => parseCommand(alias).cmd);
+ let isDefault = false;
+ const parsedAliases = [parsedCommand.cmd].concat(aliases).filter(c => {
+ if (DEFAULT_MARKER.test(c)) {
+ isDefault = true;
+ return false;
+ }
+ return true;
+ });
+ if (parsedAliases.length === 0 && isDefault)
+ parsedAliases.push('$0');
+ if (isDefault) {
+ parsedCommand.cmd = parsedAliases[0];
+ aliases = parsedAliases.slice(1);
+ cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd);
+ }
+ aliases.forEach(alias => {
+ this.aliasMap[alias] = parsedCommand.cmd;
+ });
+ if (description !== false) {
+ this.usage.command(cmd, description, isDefault, aliases, deprecated);
+ }
+ this.handlers[parsedCommand.cmd] = {
+ original: cmd,
+ description,
+ handler,
+ builder: builder || {},
+ middlewares,
+ deprecated,
+ demanded: parsedCommand.demanded,
+ optional: parsedCommand.optional,
+ };
+ if (isDefault)
+ this.defaultCommand = this.handlers[parsedCommand.cmd];
+ }
+ }
+ getCommandHandlers() {
+ return this.handlers;
+ }
+ getCommands() {
+ return Object.keys(this.handlers).concat(Object.keys(this.aliasMap));
+ }
+ hasDefaultCommand() {
+ return !!this.defaultCommand;
+ }
+ runCommand(command, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) {
+ const commandHandler = this.handlers[command] ||
+ this.handlers[this.aliasMap[command]] ||
+ this.defaultCommand;
+ const currentContext = yargs.getInternalMethods().getContext();
+ const parentCommands = currentContext.commands.slice();
+ const isDefaultCommand = !command;
+ if (command) {
+ currentContext.commands.push(command);
+ currentContext.fullCommands.push(commandHandler.original);
+ }
+ const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet);
+ return isPromise(builderResult)
+ ? builderResult.then(result => this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs))
+ : this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs);
+ }
+ applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet) {
+ const builder = commandHandler.builder;
+ let innerYargs = yargs;
+ if (isCommandBuilderCallback(builder)) {
+ yargs.getInternalMethods().getUsageInstance().freeze();
+ const builderOutput = builder(yargs.getInternalMethods().reset(aliases), helpOrVersionSet);
+ if (isPromise(builderOutput)) {
+ return builderOutput.then(output => {
+ innerYargs = isYargsInstance(output) ? output : yargs;
+ return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
+ });
+ }
+ }
+ else if (isCommandBuilderOptionDefinitions(builder)) {
+ yargs.getInternalMethods().getUsageInstance().freeze();
+ innerYargs = yargs.getInternalMethods().reset(aliases);
+ Object.keys(commandHandler.builder).forEach(key => {
+ innerYargs.option(key, builder[key]);
+ });
+ }
+ return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
+ }
+ parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly) {
+ if (isDefaultCommand)
+ innerYargs.getInternalMethods().getUsageInstance().unfreeze(true);
+ if (this.shouldUpdateUsage(innerYargs)) {
+ innerYargs
+ .getInternalMethods()
+ .getUsageInstance()
+ .usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description);
+ }
+ const innerArgv = innerYargs
+ .getInternalMethods()
+ .runYargsParserAndExecuteCommands(null, undefined, true, commandIndex, helpOnly);
+ return isPromise(innerArgv)
+ ? innerArgv.then(argv => ({
+ aliases: innerYargs.parsed.aliases,
+ innerArgv: argv,
+ }))
+ : {
+ aliases: innerYargs.parsed.aliases,
+ innerArgv: innerArgv,
+ };
+ }
+ shouldUpdateUsage(yargs) {
+ return (!yargs.getInternalMethods().getUsageInstance().getUsageDisabled() &&
+ yargs.getInternalMethods().getUsageInstance().getUsage().length === 0);
+ }
+ usageFromParentCommandsCommandHandler(parentCommands, commandHandler) {
+ const c = DEFAULT_MARKER.test(commandHandler.original)
+ ? commandHandler.original.replace(DEFAULT_MARKER, '').trim()
+ : commandHandler.original;
+ const pc = parentCommands.filter(c => {
+ return !DEFAULT_MARKER.test(c);
+ });
+ pc.push(c);
+ return `$0 ${pc.join(' ')}`;
+ }
+ handleValidationAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, aliases, yargs, middlewares, positionalMap) {
+ if (!yargs.getInternalMethods().getHasOutput()) {
+ const validation = yargs
+ .getInternalMethods()
+ .runValidation(aliases, positionalMap, yargs.parsed.error, isDefaultCommand);
+ innerArgv = maybeAsyncResult(innerArgv, result => {
+ validation(result);
+ return result;
+ });
+ }
+ if (commandHandler.handler && !yargs.getInternalMethods().getHasOutput()) {
+ yargs.getInternalMethods().setHasOutput();
+ const populateDoubleDash = !!yargs.getOptions().configuration['populate--'];
+ yargs
+ .getInternalMethods()
+ .postProcess(innerArgv, populateDoubleDash, false, false);
+ innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false);
+ innerArgv = maybeAsyncResult(innerArgv, result => {
+ const handlerResult = commandHandler.handler(result);
+ return isPromise(handlerResult)
+ ? handlerResult.then(() => result)
+ : result;
+ });
+ if (!isDefaultCommand) {
+ yargs.getInternalMethods().getUsageInstance().cacheHelpMessage();
+ }
+ if (isPromise(innerArgv) &&
+ !yargs.getInternalMethods().hasParseCallback()) {
+ innerArgv.catch(error => {
+ try {
+ yargs.getInternalMethods().getUsageInstance().fail(null, error);
+ }
+ catch (_err) {
+ }
+ });
+ }
+ }
+ if (!isDefaultCommand) {
+ currentContext.commands.pop();
+ currentContext.fullCommands.pop();
+ }
+ return innerArgv;
+ }
+ applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, helpOnly, aliases, yargs) {
+ let positionalMap = {};
+ if (helpOnly)
+ return innerArgv;
+ if (!yargs.getInternalMethods().getHasOutput()) {
+ positionalMap = this.populatePositionals(commandHandler, innerArgv, currentContext, yargs);
+ }
+ const middlewares = this.globalMiddleware
+ .getMiddleware()
+ .slice(0)
+ .concat(commandHandler.middlewares);
+ const maybePromiseArgv = applyMiddleware(innerArgv, yargs, middlewares, true);
+ return isPromise(maybePromiseArgv)
+ ? maybePromiseArgv.then(resolvedInnerArgv => this.handleValidationAndGetResult(isDefaultCommand, commandHandler, resolvedInnerArgv, currentContext, aliases, yargs, middlewares, positionalMap))
+ : this.handleValidationAndGetResult(isDefaultCommand, commandHandler, maybePromiseArgv, currentContext, aliases, yargs, middlewares, positionalMap);
+ }
+ populatePositionals(commandHandler, argv, context, yargs) {
+ argv._ = argv._.slice(context.commands.length);
+ const demanded = commandHandler.demanded.slice(0);
+ const optional = commandHandler.optional.slice(0);
+ const positionalMap = {};
+ this.validation.positionalCount(demanded.length, argv._.length);
+ while (demanded.length) {
+ const demand = demanded.shift();
+ this.populatePositional(demand, argv, positionalMap);
+ }
+ while (optional.length) {
+ const maybe = optional.shift();
+ this.populatePositional(maybe, argv, positionalMap);
+ }
+ argv._ = context.commands.concat(argv._.map(a => '' + a));
+ this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs);
+ return positionalMap;
+ }
+ populatePositional(positional, argv, positionalMap) {
+ const cmd = positional.cmd[0];
+ if (positional.variadic) {
+ positionalMap[cmd] = argv._.splice(0).map(String);
+ }
+ else {
+ if (argv._.length)
+ positionalMap[cmd] = [String(argv._.shift())];
+ }
+ }
+ cmdToParseOptions(cmdString) {
+ const parseOptions = {
+ array: [],
+ default: {},
+ alias: {},
+ demand: {},
+ };
+ const parsed = parseCommand(cmdString);
+ parsed.demanded.forEach(d => {
+ const [cmd, ...aliases] = d.cmd;
+ if (d.variadic) {
+ parseOptions.array.push(cmd);
+ parseOptions.default[cmd] = [];
+ }
+ parseOptions.alias[cmd] = aliases;
+ parseOptions.demand[cmd] = true;
+ });
+ parsed.optional.forEach(o => {
+ const [cmd, ...aliases] = o.cmd;
+ if (o.variadic) {
+ parseOptions.array.push(cmd);
+ parseOptions.default[cmd] = [];
+ }
+ parseOptions.alias[cmd] = aliases;
+ });
+ return parseOptions;
+ }
+ postProcessPositionals(argv, positionalMap, parseOptions, yargs) {
+ const options = Object.assign({}, yargs.getOptions());
+ options.default = Object.assign(parseOptions.default, options.default);
+ for (const key of Object.keys(parseOptions.alias)) {
+ options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]);
+ }
+ options.array = options.array.concat(parseOptions.array);
+ options.config = {};
+ const unparsed = [];
+ Object.keys(positionalMap).forEach(key => {
+ positionalMap[key].map(value => {
+ if (options.configuration['unknown-options-as-args'])
+ options.key[key] = true;
+ unparsed.push(`--${key}`);
+ unparsed.push(value);
+ });
+ });
+ if (!unparsed.length)
+ return;
+ const config = Object.assign({}, options.configuration, {
+ 'populate--': false,
+ });
+ const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
+ configuration: config,
+ }));
+ if (parsed.error) {
+ yargs
+ .getInternalMethods()
+ .getUsageInstance()
+ .fail(parsed.error.message, parsed.error);
+ }
+ else {
+ const positionalKeys = Object.keys(positionalMap);
+ Object.keys(positionalMap).forEach(key => {
+ positionalKeys.push(...parsed.aliases[key]);
+ });
+ Object.keys(parsed.argv).forEach(key => {
+ if (positionalKeys.includes(key)) {
+ if (!positionalMap[key])
+ positionalMap[key] = parsed.argv[key];
+ if (!this.isInConfigs(yargs, key) &&
+ !this.isDefaulted(yargs, key) &&
+ Object.prototype.hasOwnProperty.call(argv, key) &&
+ Object.prototype.hasOwnProperty.call(parsed.argv, key) &&
+ (Array.isArray(argv[key]) || Array.isArray(parsed.argv[key]))) {
+ argv[key] = [].concat(argv[key], parsed.argv[key]);
+ }
+ else {
+ argv[key] = parsed.argv[key];
+ }
+ }
+ });
+ }
+ }
+ isDefaulted(yargs, key) {
+ const { default: defaults } = yargs.getOptions();
+ return (Object.prototype.hasOwnProperty.call(defaults, key) ||
+ Object.prototype.hasOwnProperty.call(defaults, this.shim.Parser.camelCase(key)));
+ }
+ isInConfigs(yargs, key) {
+ const { configObjects } = yargs.getOptions();
+ return (configObjects.some(c => Object.prototype.hasOwnProperty.call(c, key)) ||
+ configObjects.some(c => Object.prototype.hasOwnProperty.call(c, this.shim.Parser.camelCase(key))));
+ }
+ runDefaultBuilderOn(yargs) {
+ if (!this.defaultCommand)
+ return;
+ if (this.shouldUpdateUsage(yargs)) {
+ const commandString = DEFAULT_MARKER.test(this.defaultCommand.original)
+ ? this.defaultCommand.original
+ : this.defaultCommand.original.replace(/^[^[\]<>]*/, '$0 ');
+ yargs
+ .getInternalMethods()
+ .getUsageInstance()
+ .usage(commandString, this.defaultCommand.description);
+ }
+ const builder = this.defaultCommand.builder;
+ if (isCommandBuilderCallback(builder)) {
+ return builder(yargs, true);
+ }
+ else if (!isCommandBuilderDefinition(builder)) {
+ Object.keys(builder).forEach(key => {
+ yargs.option(key, builder[key]);
+ });
+ }
+ return undefined;
+ }
+ moduleName(obj) {
+ const mod = whichModule(obj);
+ if (!mod)
+ throw new Error(`No command name given for module: ${this.shim.inspect(obj)}`);
+ return this.commandFromFilename(mod.filename);
+ }
+ commandFromFilename(filename) {
+ return this.shim.path.basename(filename, this.shim.path.extname(filename));
+ }
+ extractDesc({ describe, description, desc }) {
+ for (const test of [describe, description, desc]) {
+ if (typeof test === 'string' || test === false)
+ return test;
+ assertNotStrictEqual(test, true, this.shim);
+ }
+ return false;
+ }
+ freeze() {
+ this.frozens.push({
+ handlers: this.handlers,
+ aliasMap: this.aliasMap,
+ defaultCommand: this.defaultCommand,
+ });
+ }
+ unfreeze() {
+ const frozen = this.frozens.pop();
+ assertNotStrictEqual(frozen, undefined, this.shim);
+ ({
+ handlers: this.handlers,
+ aliasMap: this.aliasMap,
+ defaultCommand: this.defaultCommand,
+ } = frozen);
+ }
+ reset() {
+ this.handlers = {};
+ this.aliasMap = {};
+ this.defaultCommand = undefined;
+ this.requireCache = new Set();
+ return this;
+ }
+}
+export function command(usage, validation, globalMiddleware, shim) {
+ return new CommandInstance(usage, validation, globalMiddleware, shim);
+}
+export function isCommandBuilderDefinition(builder) {
+ return (typeof builder === 'object' &&
+ !!builder.builder &&
+ typeof builder.handler === 'function');
+}
+function isCommandAndAliases(cmd) {
+ return cmd.every(c => typeof c === 'string');
+}
+export function isCommandBuilderCallback(builder) {
+ return typeof builder === 'function';
+}
+function isCommandBuilderOptionDefinitions(builder) {
+ return typeof builder === 'object';
+}
+export function isCommandHandlerDefinition(cmd) {
+ return typeof cmd === 'object' && !Array.isArray(cmd);
+}
diff --git a/node_modules/yargs/build/lib/completion-templates.js b/node_modules/yargs/build/lib/completion-templates.js
new file mode 100644
index 0000000..2c4dcb5
--- /dev/null
+++ b/node_modules/yargs/build/lib/completion-templates.js
@@ -0,0 +1,48 @@
+export const completionShTemplate = `###-begin-{{app_name}}-completions-###
+#
+# yargs command completion script
+#
+# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
+# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
+#
+_{{app_name}}_yargs_completions()
+{
+ local cur_word args type_list
+
+ cur_word="\${COMP_WORDS[COMP_CWORD]}"
+ args=("\${COMP_WORDS[@]}")
+
+ # ask yargs to generate completions.
+ type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")
+
+ COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )
+
+ # if no match was found, fall back to filename completion
+ if [ \${#COMPREPLY[@]} -eq 0 ]; then
+ COMPREPLY=()
+ fi
+
+ return 0
+}
+complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
+###-end-{{app_name}}-completions-###
+`;
+export const completionZshTemplate = `#compdef {{app_name}}
+###-begin-{{app_name}}-completions-###
+#
+# yargs command completion script
+#
+# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
+# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
+#
+_{{app_name}}_yargs_completions()
+{
+ local reply
+ local si=$IFS
+ IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
+ IFS=$si
+ _describe 'values' reply
+}
+compdef _{{app_name}}_yargs_completions {{app_name}}
+###-end-{{app_name}}-completions-###
+`;
diff --git a/node_modules/yargs/build/lib/completion.js b/node_modules/yargs/build/lib/completion.js
new file mode 100644
index 0000000..cef2bbe
--- /dev/null
+++ b/node_modules/yargs/build/lib/completion.js
@@ -0,0 +1,243 @@
+import { isCommandBuilderCallback } from './command.js';
+import { assertNotStrictEqual } from './typings/common-types.js';
+import * as templates from './completion-templates.js';
+import { isPromise } from './utils/is-promise.js';
+import { parseCommand } from './parse-command.js';
+export class Completion {
+ constructor(yargs, usage, command, shim) {
+ var _a, _b, _c;
+ this.yargs = yargs;
+ this.usage = usage;
+ this.command = command;
+ this.shim = shim;
+ this.completionKey = 'get-yargs-completions';
+ this.aliases = null;
+ this.customCompletionFunction = null;
+ this.indexAfterLastReset = 0;
+ this.zshShell =
+ (_c = (((_a = this.shim.getEnv('SHELL')) === null || _a === void 0 ? void 0 : _a.includes('zsh')) ||
+ ((_b = this.shim.getEnv('ZSH_NAME')) === null || _b === void 0 ? void 0 : _b.includes('zsh')))) !== null && _c !== void 0 ? _c : false;
+ }
+ defaultCompletion(args, argv, current, done) {
+ const handlers = this.command.getCommandHandlers();
+ for (let i = 0, ii = args.length; i < ii; ++i) {
+ if (handlers[args[i]] && handlers[args[i]].builder) {
+ const builder = handlers[args[i]].builder;
+ if (isCommandBuilderCallback(builder)) {
+ this.indexAfterLastReset = i + 1;
+ const y = this.yargs.getInternalMethods().reset();
+ builder(y, true);
+ return y.argv;
+ }
+ }
+ }
+ const completions = [];
+ this.commandCompletions(completions, args, current);
+ this.optionCompletions(completions, args, argv, current);
+ this.choicesFromOptionsCompletions(completions, args, argv, current);
+ this.choicesFromPositionalsCompletions(completions, args, argv, current);
+ done(null, completions);
+ }
+ commandCompletions(completions, args, current) {
+ const parentCommands = this.yargs
+ .getInternalMethods()
+ .getContext().commands;
+ if (!current.match(/^-/) &&
+ parentCommands[parentCommands.length - 1] !== current &&
+ !this.previousArgHasChoices(args)) {
+ this.usage.getCommands().forEach(usageCommand => {
+ const commandName = parseCommand(usageCommand[0]).cmd;
+ if (args.indexOf(commandName) === -1) {
+ if (!this.zshShell) {
+ completions.push(commandName);
+ }
+ else {
+ const desc = usageCommand[1] || '';
+ completions.push(commandName.replace(/:/g, '\\:') + ':' + desc);
+ }
+ }
+ });
+ }
+ }
+ optionCompletions(completions, args, argv, current) {
+ if ((current.match(/^-/) || (current === '' && completions.length === 0)) &&
+ !this.previousArgHasChoices(args)) {
+ const options = this.yargs.getOptions();
+ const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
+ Object.keys(options.key).forEach(key => {
+ const negable = !!options.configuration['boolean-negation'] &&
+ options.boolean.includes(key);
+ const isPositionalKey = positionalKeys.includes(key);
+ if (!isPositionalKey &&
+ !options.hiddenOptions.includes(key) &&
+ !this.argsContainKey(args, key, negable)) {
+ this.completeOptionKey(key, completions, current, negable && !!options.default[key]);
+ }
+ });
+ }
+ }
+ choicesFromOptionsCompletions(completions, args, argv, current) {
+ if (this.previousArgHasChoices(args)) {
+ const choices = this.getPreviousArgChoices(args);
+ if (choices && choices.length > 0) {
+ completions.push(...choices.map(c => c.replace(/:/g, '\\:')));
+ }
+ }
+ }
+ choicesFromPositionalsCompletions(completions, args, argv, current) {
+ if (current === '' &&
+ completions.length > 0 &&
+ this.previousArgHasChoices(args)) {
+ return;
+ }
+ const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
+ const offset = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length +
+ 1);
+ const positionalKey = positionalKeys[argv._.length - offset - 1];
+ if (!positionalKey) {
+ return;
+ }
+ const choices = this.yargs.getOptions().choices[positionalKey] || [];
+ for (const choice of choices) {
+ if (choice.startsWith(current)) {
+ completions.push(choice.replace(/:/g, '\\:'));
+ }
+ }
+ }
+ getPreviousArgChoices(args) {
+ if (args.length < 1)
+ return;
+ let previousArg = args[args.length - 1];
+ let filter = '';
+ if (!previousArg.startsWith('-') && args.length > 1) {
+ filter = previousArg;
+ previousArg = args[args.length - 2];
+ }
+ if (!previousArg.startsWith('-'))
+ return;
+ const previousArgKey = previousArg.replace(/^-+/, '');
+ const options = this.yargs.getOptions();
+ const possibleAliases = [
+ previousArgKey,
+ ...(this.yargs.getAliases()[previousArgKey] || []),
+ ];
+ let choices;
+ for (const possibleAlias of possibleAliases) {
+ if (Object.prototype.hasOwnProperty.call(options.key, possibleAlias) &&
+ Array.isArray(options.choices[possibleAlias])) {
+ choices = options.choices[possibleAlias];
+ break;
+ }
+ }
+ if (choices) {
+ return choices.filter(choice => !filter || choice.startsWith(filter));
+ }
+ }
+ previousArgHasChoices(args) {
+ const choices = this.getPreviousArgChoices(args);
+ return choices !== undefined && choices.length > 0;
+ }
+ argsContainKey(args, key, negable) {
+ const argsContains = (s) => args.indexOf((/^[^0-9]$/.test(s) ? '-' : '--') + s) !== -1;
+ if (argsContains(key))
+ return true;
+ if (negable && argsContains(`no-${key}`))
+ return true;
+ if (this.aliases) {
+ for (const alias of this.aliases[key]) {
+ if (argsContains(alias))
+ return true;
+ }
+ }
+ return false;
+ }
+ completeOptionKey(key, completions, current, negable) {
+ var _a, _b, _c, _d;
+ let keyWithDesc = key;
+ if (this.zshShell) {
+ const descs = this.usage.getDescriptions();
+ const aliasKey = (_b = (_a = this === null || this === void 0 ? void 0 : this.aliases) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.find(alias => {
+ const desc = descs[alias];
+ return typeof desc === 'string' && desc.length > 0;
+ });
+ const descFromAlias = aliasKey ? descs[aliasKey] : undefined;
+ const desc = (_d = (_c = descs[key]) !== null && _c !== void 0 ? _c : descFromAlias) !== null && _d !== void 0 ? _d : '';
+ keyWithDesc = `${key.replace(/:/g, '\\:')}:${desc
+ .replace('__yargsString__:', '')
+ .replace(/(\r\n|\n|\r)/gm, ' ')}`;
+ }
+ const startsByTwoDashes = (s) => /^--/.test(s);
+ const isShortOption = (s) => /^[^0-9]$/.test(s);
+ const dashes = !startsByTwoDashes(current) && isShortOption(key) ? '-' : '--';
+ completions.push(dashes + keyWithDesc);
+ if (negable) {
+ completions.push(dashes + 'no-' + keyWithDesc);
+ }
+ }
+ customCompletion(args, argv, current, done) {
+ assertNotStrictEqual(this.customCompletionFunction, null, this.shim);
+ if (isSyncCompletionFunction(this.customCompletionFunction)) {
+ const result = this.customCompletionFunction(current, argv);
+ if (isPromise(result)) {
+ return result
+ .then(list => {
+ this.shim.process.nextTick(() => {
+ done(null, list);
+ });
+ })
+ .catch(err => {
+ this.shim.process.nextTick(() => {
+ done(err, undefined);
+ });
+ });
+ }
+ return done(null, result);
+ }
+ else if (isFallbackCompletionFunction(this.customCompletionFunction)) {
+ return this.customCompletionFunction(current, argv, (onCompleted = done) => this.defaultCompletion(args, argv, current, onCompleted), completions => {
+ done(null, completions);
+ });
+ }
+ else {
+ return this.customCompletionFunction(current, argv, completions => {
+ done(null, completions);
+ });
+ }
+ }
+ getCompletion(args, done) {
+ const current = args.length ? args[args.length - 1] : '';
+ const argv = this.yargs.parse(args, true);
+ const completionFunction = this.customCompletionFunction
+ ? (argv) => this.customCompletion(args, argv, current, done)
+ : (argv) => this.defaultCompletion(args, argv, current, done);
+ return isPromise(argv)
+ ? argv.then(completionFunction)
+ : completionFunction(argv);
+ }
+ generateCompletionScript($0, cmd) {
+ let script = this.zshShell
+ ? templates.completionZshTemplate
+ : templates.completionShTemplate;
+ const name = this.shim.path.basename($0);
+ if ($0.match(/\.js$/))
+ $0 = `./${$0}`;
+ script = script.replace(/{{app_name}}/g, name);
+ script = script.replace(/{{completion_command}}/g, cmd);
+ return script.replace(/{{app_path}}/g, $0);
+ }
+ registerFunction(fn) {
+ this.customCompletionFunction = fn;
+ }
+ setParsed(parsed) {
+ this.aliases = parsed.aliases;
+ }
+}
+export function completion(yargs, usage, command, shim) {
+ return new Completion(yargs, usage, command, shim);
+}
+function isSyncCompletionFunction(completionFunction) {
+ return completionFunction.length < 3;
+}
+function isFallbackCompletionFunction(completionFunction) {
+ return completionFunction.length > 3;
+}
diff --git a/node_modules/yargs/build/lib/middleware.js b/node_modules/yargs/build/lib/middleware.js
new file mode 100644
index 0000000..4e561a7
--- /dev/null
+++ b/node_modules/yargs/build/lib/middleware.js
@@ -0,0 +1,88 @@
+import { argsert } from './argsert.js';
+import { isPromise } from './utils/is-promise.js';
+export class GlobalMiddleware {
+ constructor(yargs) {
+ this.globalMiddleware = [];
+ this.frozens = [];
+ this.yargs = yargs;
+ }
+ addMiddleware(callback, applyBeforeValidation, global = true, mutates = false) {
+ argsert('<array|function> [boolean] [boolean] [boolean]', [callback, applyBeforeValidation, global], arguments.length);
+ if (Array.isArray(callback)) {
+ for (let i = 0; i < callback.length; i++) {
+ if (typeof callback[i] !== 'function') {
+ throw Error('middleware must be a function');
+ }
+ const m = callback[i];
+ m.applyBeforeValidation = applyBeforeValidation;
+ m.global = global;
+ }
+ Array.prototype.push.apply(this.globalMiddleware, callback);
+ }
+ else if (typeof callback === 'function') {
+ const m = callback;
+ m.applyBeforeValidation = applyBeforeValidation;
+ m.global = global;
+ m.mutates = mutates;
+ this.globalMiddleware.push(callback);
+ }
+ return this.yargs;
+ }
+ addCoerceMiddleware(callback, option) {
+ const aliases = this.yargs.getAliases();
+ this.globalMiddleware = this.globalMiddleware.filter(m => {
+ const toCheck = [...(aliases[option] || []), option];
+ if (!m.option)
+ return true;
+ else
+ return !toCheck.includes(m.option);
+ });
+ callback.option = option;
+ return this.addMiddleware(callback, true, true, true);
+ }
+ getMiddleware() {
+ return this.globalMiddleware;
+ }
+ freeze() {
+ this.frozens.push([...this.globalMiddleware]);
+ }
+ unfreeze() {
+ const frozen = this.frozens.pop();
+ if (frozen !== undefined)
+ this.globalMiddleware = frozen;
+ }
+ reset() {
+ this.globalMiddleware = this.globalMiddleware.filter(m => m.global);
+ }
+}
+export function commandMiddlewareFactory(commandMiddleware) {
+ if (!commandMiddleware)
+ return [];
+ return commandMiddleware.map(middleware => {
+ middleware.applyBeforeValidation = false;
+ return middleware;
+ });
+}
+export function applyMiddleware(argv, yargs, middlewares, beforeValidation) {
+ return middlewares.reduce((acc, middleware) => {
+ if (middleware.applyBeforeValidation !== beforeValidation) {
+ return acc;
+ }
+ if (middleware.mutates) {
+ if (middleware.applied)
+ return acc;
+ middleware.applied = true;
+ }
+ if (isPromise(acc)) {
+ return acc
+ .then(initialObj => Promise.all([initialObj, middleware(initialObj, yargs)]))
+ .then(([initialObj, middlewareObj]) => Object.assign(initialObj, middlewareObj));
+ }
+ else {
+ const result = middleware(acc, yargs);
+ return isPromise(result)
+ ? result.then(middlewareObj => Object.assign(acc, middlewareObj))
+ : Object.assign(acc, result);
+ }
+ }, argv);
+}
diff --git a/node_modules/yargs/build/lib/parse-command.js b/node_modules/yargs/build/lib/parse-command.js
new file mode 100644
index 0000000..4989f53
--- /dev/null
+++ b/node_modules/yargs/build/lib/parse-command.js
@@ -0,0 +1,32 @@
+export function parseCommand(cmd) {
+ const extraSpacesStrippedCommand = cmd.replace(/\s{2,}/g, ' ');
+ const splitCommand = extraSpacesStrippedCommand.split(/\s+(?![^[]*]|[^<]*>)/);
+ const bregex = /\.*[\][<>]/g;
+ const firstCommand = splitCommand.shift();
+ if (!firstCommand)
+ throw new Error(`No command found in: ${cmd}`);
+ const parsedCommand = {
+ cmd: firstCommand.replace(bregex, ''),
+ demanded: [],
+ optional: [],
+ };
+ splitCommand.forEach((cmd, i) => {
+ let variadic = false;
+ cmd = cmd.replace(/\s/g, '');
+ if (/\.+[\]>]/.test(cmd) && i === splitCommand.length - 1)
+ variadic = true;
+ if (/^\[/.test(cmd)) {
+ parsedCommand.optional.push({
+ cmd: cmd.replace(bregex, '').split('|'),
+ variadic,
+ });
+ }
+ else {
+ parsedCommand.demanded.push({
+ cmd: cmd.replace(bregex, '').split('|'),
+ variadic,
+ });
+ }
+ });
+ return parsedCommand;
+}
diff --git a/node_modules/yargs/build/lib/typings/common-types.js b/node_modules/yargs/build/lib/typings/common-types.js
new file mode 100644
index 0000000..73e1773
--- /dev/null
+++ b/node_modules/yargs/build/lib/typings/common-types.js
@@ -0,0 +1,9 @@
+export function assertNotStrictEqual(actual, expected, shim, message) {
+ shim.assert.notStrictEqual(actual, expected, message);
+}
+export function assertSingleKey(actual, shim) {
+ shim.assert.strictEqual(typeof actual, 'string');
+}
+export function objectKeys(object) {
+ return Object.keys(object);
+}
diff --git a/node_modules/yargs/build/lib/typings/yargs-parser-types.js b/node_modules/yargs/build/lib/typings/yargs-parser-types.js
new file mode 100644
index 0000000..cb0ff5c
--- /dev/null
+++ b/node_modules/yargs/build/lib/typings/yargs-parser-types.js
@@ -0,0 +1 @@
+export {};
diff --git a/node_modules/yargs/build/lib/usage.js b/node_modules/yargs/build/lib/usage.js
new file mode 100644
index 0000000..0127c13
--- /dev/null
+++ b/node_modules/yargs/build/lib/usage.js
@@ -0,0 +1,584 @@
+import { objFilter } from './utils/obj-filter.js';
+import { YError } from './yerror.js';
+import setBlocking from './utils/set-blocking.js';
+function isBoolean(fail) {
+ return typeof fail === 'boolean';
+}
+export function usage(yargs, shim) {
+ const __ = shim.y18n.__;
+ const self = {};
+ const fails = [];
+ self.failFn = function failFn(f) {
+ fails.push(f);
+ };
+ let failMessage = null;
+ let globalFailMessage = null;
+ let showHelpOnFail = true;
+ self.showHelpOnFail = function showHelpOnFailFn(arg1 = true, arg2) {
+ const [enabled, message] = typeof arg1 === 'string' ? [true, arg1] : [arg1, arg2];
+ if (yargs.getInternalMethods().isGlobalContext()) {
+ globalFailMessage = message;
+ }
+ failMessage = message;
+ showHelpOnFail = enabled;
+ return self;
+ };
+ let failureOutput = false;
+ self.fail = function fail(msg, err) {
+ const logger = yargs.getInternalMethods().getLoggerInstance();
+ if (fails.length) {
+ for (let i = fails.length - 1; i >= 0; --i) {
+ const fail = fails[i];
+ if (isBoolean(fail)) {
+ if (err)
+ throw err;
+ else if (msg)
+ throw Error(msg);
+ }
+ else {
+ fail(msg, err, self);
+ }
+ }
+ }
+ else {
+ if (yargs.getExitProcess())
+ setBlocking(true);
+ if (!failureOutput) {
+ failureOutput = true;
+ if (showHelpOnFail) {
+ yargs.showHelp('error');
+ logger.error();
+ }
+ if (msg || err)
+ logger.error(msg || err);
+ const globalOrCommandFailMessage = failMessage || globalFailMessage;
+ if (globalOrCommandFailMessage) {
+ if (msg || err)
+ logger.error('');
+ logger.error(globalOrCommandFailMessage);
+ }
+ }
+ err = err || new YError(msg);
+ if (yargs.getExitProcess()) {
+ return yargs.exit(1);
+ }
+ else if (yargs.getInternalMethods().hasParseCallback()) {
+ return yargs.exit(1, err);
+ }
+ else {
+ throw err;
+ }
+ }
+ };
+ let usages = [];
+ let usageDisabled = false;
+ self.usage = (msg, description) => {
+ if (msg === null) {
+ usageDisabled = true;
+ usages = [];
+ return self;
+ }
+ usageDisabled = false;
+ usages.push([msg, description || '']);
+ return self;
+ };
+ self.getUsage = () => {
+ return usages;
+ };
+ self.getUsageDisabled = () => {
+ return usageDisabled;
+ };
+ self.getPositionalGroupName = () => {
+ return __('Positionals:');
+ };
+ let examples = [];
+ self.example = (cmd, description) => {
+ examples.push([cmd, description || '']);
+ };
+ let commands = [];
+ self.command = function command(cmd, description, isDefault, aliases, deprecated = false) {
+ if (isDefault) {
+ commands = commands.map(cmdArray => {
+ cmdArray[2] = false;
+ return cmdArray;
+ });
+ }
+ commands.push([cmd, description || '', isDefault, aliases, deprecated]);
+ };
+ self.getCommands = () => commands;
+ let descriptions = {};
+ self.describe = function describe(keyOrKeys, desc) {
+ if (Array.isArray(keyOrKeys)) {
+ keyOrKeys.forEach(k => {
+ self.describe(k, desc);
+ });
+ }
+ else if (typeof keyOrKeys === 'object') {
+ Object.keys(keyOrKeys).forEach(k => {
+ self.describe(k, keyOrKeys[k]);
+ });
+ }
+ else {
+ descriptions[keyOrKeys] = desc;
+ }
+ };
+ self.getDescriptions = () => descriptions;
+ let epilogs = [];
+ self.epilog = msg => {
+ epilogs.push(msg);
+ };
+ let wrapSet = false;
+ let wrap;
+ self.wrap = cols => {
+ wrapSet = true;
+ wrap = cols;
+ };
+ self.getWrap = () => {
+ if (shim.getEnv('YARGS_DISABLE_WRAP')) {
+ return null;
+ }
+ if (!wrapSet) {
+ wrap = windowWidth();
+ wrapSet = true;
+ }
+ return wrap;
+ };
+ const deferY18nLookupPrefix = '__yargsString__:';
+ self.deferY18nLookup = str => deferY18nLookupPrefix + str;
+ self.help = function help() {
+ if (cachedHelpMessage)
+ return cachedHelpMessage;
+ normalizeAliases();
+ const base$0 = yargs.customScriptName
+ ? yargs.$0
+ : shim.path.basename(yargs.$0);
+ const demandedOptions = yargs.getDemandedOptions();
+ const demandedCommands = yargs.getDemandedCommands();
+ const deprecatedOptions = yargs.getDeprecatedOptions();
+ const groups = yargs.getGroups();
+ const options = yargs.getOptions();
+ let keys = [];
+ keys = keys.concat(Object.keys(descriptions));
+ keys = keys.concat(Object.keys(demandedOptions));
+ keys = keys.concat(Object.keys(demandedCommands));
+ keys = keys.concat(Object.keys(options.default));
+ keys = keys.filter(filterHiddenOptions);
+ keys = Object.keys(keys.reduce((acc, key) => {
+ if (key !== '_')
+ acc[key] = true;
+ return acc;
+ }, {}));
+ const theWrap = self.getWrap();
+ const ui = shim.cliui({
+ width: theWrap,
+ wrap: !!theWrap,
+ });
+ if (!usageDisabled) {
+ if (usages.length) {
+ usages.forEach(usage => {
+ ui.div({ text: `${usage[0].replace(/\$0/g, base$0)}` });
+ if (usage[1]) {
+ ui.div({ text: `${usage[1]}`, padding: [1, 0, 0, 0] });
+ }
+ });
+ ui.div();
+ }
+ else if (commands.length) {
+ let u = null;
+ if (demandedCommands._) {
+ u = `${base$0} <${__('command')}>\n`;
+ }
+ else {
+ u = `${base$0} [${__('command')}]\n`;
+ }
+ ui.div(`${u}`);
+ }
+ }
+ if (commands.length > 1 || (commands.length === 1 && !commands[0][2])) {
+ ui.div(__('Commands:'));
+ const context = yargs.getInternalMethods().getContext();
+ const parentCommands = context.commands.length
+ ? `${context.commands.join(' ')} `
+ : '';
+ if (yargs.getInternalMethods().getParserConfiguration()['sort-commands'] ===
+ true) {
+ commands = commands.sort((a, b) => a[0].localeCompare(b[0]));
+ }
+ const prefix = base$0 ? `${base$0} ` : '';
+ commands.forEach(command => {
+ const commandString = `${prefix}${parentCommands}${command[0].replace(/^\$0 ?/, '')}`;
+ ui.span({
+ text: commandString,
+ padding: [0, 2, 0, 2],
+ width: maxWidth(commands, theWrap, `${base$0}${parentCommands}`) + 4,
+ }, { text: command[1] });
+ const hints = [];
+ if (command[2])
+ hints.push(`[${__('default')}]`);
+ if (command[3] && command[3].length) {
+ hints.push(`[${__('aliases:')} ${command[3].join(', ')}]`);
+ }
+ if (command[4]) {
+ if (typeof command[4] === 'string') {
+ hints.push(`[${__('deprecated: %s', command[4])}]`);
+ }
+ else {
+ hints.push(`[${__('deprecated')}]`);
+ }
+ }
+ if (hints.length) {
+ ui.div({
+ text: hints.join(' '),
+ padding: [0, 0, 0, 2],
+ align: 'right',
+ });
+ }
+ else {
+ ui.div();
+ }
+ });
+ ui.div();
+ }
+ const aliasKeys = (Object.keys(options.alias) || []).concat(Object.keys(yargs.parsed.newAliases) || []);
+ keys = keys.filter(key => !yargs.parsed.newAliases[key] &&
+ aliasKeys.every(alias => (options.alias[alias] || []).indexOf(key) === -1));
+ const defaultGroup = __('Options:');
+ if (!groups[defaultGroup])
+ groups[defaultGroup] = [];
+ addUngroupedKeys(keys, options.alias, groups, defaultGroup);
+ const isLongSwitch = (sw) => /^--/.test(getText(sw));
+ const displayedGroups = Object.keys(groups)
+ .filter(groupName => groups[groupName].length > 0)
+ .map(groupName => {
+ const normalizedKeys = groups[groupName]
+ .filter(filterHiddenOptions)
+ .map(key => {
+ if (aliasKeys.includes(key))
+ return key;
+ for (let i = 0, aliasKey; (aliasKey = aliasKeys[i]) !== undefined; i++) {
+ if ((options.alias[aliasKey] || []).includes(key))
+ return aliasKey;
+ }
+ return key;
+ });
+ return { groupName, normalizedKeys };
+ })
+ .filter(({ normalizedKeys }) => normalizedKeys.length > 0)
+ .map(({ groupName, normalizedKeys }) => {
+ const switches = normalizedKeys.reduce((acc, key) => {
+ acc[key] = [key]
+ .concat(options.alias[key] || [])
+ .map(sw => {
+ if (groupName === self.getPositionalGroupName())
+ return sw;
+ else {
+ return ((/^[0-9]$/.test(sw)
+ ? options.boolean.includes(key)
+ ? '-'
+ : '--'
+ : sw.length > 1
+ ? '--'
+ : '-') + sw);
+ }
+ })
+ .sort((sw1, sw2) => isLongSwitch(sw1) === isLongSwitch(sw2)
+ ? 0
+ : isLongSwitch(sw1)
+ ? 1
+ : -1)
+ .join(', ');
+ return acc;
+ }, {});
+ return { groupName, normalizedKeys, switches };
+ });
+ const shortSwitchesUsed = displayedGroups
+ .filter(({ groupName }) => groupName !== self.getPositionalGroupName())
+ .some(({ normalizedKeys, switches }) => !normalizedKeys.every(key => isLongSwitch(switches[key])));
+ if (shortSwitchesUsed) {
+ displayedGroups
+ .filter(({ groupName }) => groupName !== self.getPositionalGroupName())
+ .forEach(({ normalizedKeys, switches }) => {
+ normalizedKeys.forEach(key => {
+ if (isLongSwitch(switches[key])) {
+ switches[key] = addIndentation(switches[key], '-x, '.length);
+ }
+ });
+ });
+ }
+ displayedGroups.forEach(({ groupName, normalizedKeys, switches }) => {
+ ui.div(groupName);
+ normalizedKeys.forEach(key => {
+ const kswitch = switches[key];
+ let desc = descriptions[key] || '';
+ let type = null;
+ if (desc.includes(deferY18nLookupPrefix))
+ desc = __(desc.substring(deferY18nLookupPrefix.length));
+ if (options.boolean.includes(key))
+ type = `[${__('boolean')}]`;
+ if (options.count.includes(key))
+ type = `[${__('count')}]`;
+ if (options.string.includes(key))
+ type = `[${__('string')}]`;
+ if (options.normalize.includes(key))
+ type = `[${__('string')}]`;
+ if (options.array.includes(key))
+ type = `[${__('array')}]`;
+ if (options.number.includes(key))
+ type = `[${__('number')}]`;
+ const deprecatedExtra = (deprecated) => typeof deprecated === 'string'
+ ? `[${__('deprecated: %s', deprecated)}]`
+ : `[${__('deprecated')}]`;
+ const extra = [
+ key in deprecatedOptions
+ ? deprecatedExtra(deprecatedOptions[key])
+ : null,
+ type,
+ key in demandedOptions ? `[${__('required')}]` : null,
+ options.choices && options.choices[key]
+ ? `[${__('choices:')} ${self.stringifiedValues(options.choices[key])}]`
+ : null,
+ defaultString(options.default[key], options.defaultDescription[key]),
+ ]
+ .filter(Boolean)
+ .join(' ');
+ ui.span({
+ text: getText(kswitch),
+ padding: [0, 2, 0, 2 + getIndentation(kswitch)],
+ width: maxWidth(switches, theWrap) + 4,
+ }, desc);
+ const shouldHideOptionExtras = yargs.getInternalMethods().getUsageConfiguration()['hide-types'] ===
+ true;
+ if (extra && !shouldHideOptionExtras)
+ ui.div({ text: extra, padding: [0, 0, 0, 2], align: 'right' });
+ else
+ ui.div();
+ });
+ ui.div();
+ });
+ if (examples.length) {
+ ui.div(__('Examples:'));
+ examples.forEach(example => {
+ example[0] = example[0].replace(/\$0/g, base$0);
+ });
+ examples.forEach(example => {
+ if (example[1] === '') {
+ ui.div({
+ text: example[0],
+ padding: [0, 2, 0, 2],
+ });
+ }
+ else {
+ ui.div({
+ text: example[0],
+ padding: [0, 2, 0, 2],
+ width: maxWidth(examples, theWrap) + 4,
+ }, {
+ text: example[1],
+ });
+ }
+ });
+ ui.div();
+ }
+ if (epilogs.length > 0) {
+ const e = epilogs
+ .map(epilog => epilog.replace(/\$0/g, base$0))
+ .join('\n');
+ ui.div(`${e}\n`);
+ }
+ return ui.toString().replace(/\s*$/, '');
+ };
+ function maxWidth(table, theWrap, modifier) {
+ let width = 0;
+ if (!Array.isArray(table)) {
+ table = Object.values(table).map(v => [v]);
+ }
+ table.forEach(v => {
+ width = Math.max(shim.stringWidth(modifier ? `${modifier} ${getText(v[0])}` : getText(v[0])) + getIndentation(v[0]), width);
+ });
+ if (theWrap)
+ width = Math.min(width, parseInt((theWrap * 0.5).toString(), 10));
+ return width;
+ }
+ function normalizeAliases() {
+ const demandedOptions = yargs.getDemandedOptions();
+ const options = yargs.getOptions();
+ (Object.keys(options.alias) || []).forEach(key => {
+ options.alias[key].forEach(alias => {
+ if (descriptions[alias])
+ self.describe(key, descriptions[alias]);
+ if (alias in demandedOptions)
+ yargs.demandOption(key, demandedOptions[alias]);
+ if (options.boolean.includes(alias))
+ yargs.boolean(key);
+ if (options.count.includes(alias))
+ yargs.count(key);
+ if (options.string.includes(alias))
+ yargs.string(key);
+ if (options.normalize.includes(alias))
+ yargs.normalize(key);
+ if (options.array.includes(alias))
+ yargs.array(key);
+ if (options.number.includes(alias))
+ yargs.number(key);
+ });
+ });
+ }
+ let cachedHelpMessage;
+ self.cacheHelpMessage = function () {
+ cachedHelpMessage = this.help();
+ };
+ self.clearCachedHelpMessage = function () {
+ cachedHelpMessage = undefined;
+ };
+ self.hasCachedHelpMessage = function () {
+ return !!cachedHelpMessage;
+ };
+ function addUngroupedKeys(keys, aliases, groups, defaultGroup) {
+ let groupedKeys = [];
+ let toCheck = null;
+ Object.keys(groups).forEach(group => {
+ groupedKeys = groupedKeys.concat(groups[group]);
+ });
+ keys.forEach(key => {
+ toCheck = [key].concat(aliases[key]);
+ if (!toCheck.some(k => groupedKeys.indexOf(k) !== -1)) {
+ groups[defaultGroup].push(key);
+ }
+ });
+ return groupedKeys;
+ }
+ function filterHiddenOptions(key) {
+ return (yargs.getOptions().hiddenOptions.indexOf(key) < 0 ||
+ yargs.parsed.argv[yargs.getOptions().showHiddenOpt]);
+ }
+ self.showHelp = (level) => {
+ const logger = yargs.getInternalMethods().getLoggerInstance();
+ if (!level)
+ level = 'error';
+ const emit = typeof level === 'function' ? level : logger[level];
+ emit(self.help());
+ };
+ self.functionDescription = fn => {
+ const description = fn.name
+ ? shim.Parser.decamelize(fn.name, '-')
+ : __('generated-value');
+ return ['(', description, ')'].join('');
+ };
+ self.stringifiedValues = function stringifiedValues(values, separator) {
+ let string = '';
+ const sep = separator || ', ';
+ const array = [].concat(values);
+ if (!values || !array.length)
+ return string;
+ array.forEach(value => {
+ if (string.length)
+ string += sep;
+ string += JSON.stringify(value);
+ });
+ return string;
+ };
+ function defaultString(value, defaultDescription) {
+ let string = `[${__('default:')} `;
+ if (value === undefined && !defaultDescription)
+ return null;
+ if (defaultDescription) {
+ string += defaultDescription;
+ }
+ else {
+ switch (typeof value) {
+ case 'string':
+ string += `"${value}"`;
+ break;
+ case 'object':
+ string += JSON.stringify(value);
+ break;
+ default:
+ string += value;
+ }
+ }
+ return `${string}]`;
+ }
+ function windowWidth() {
+ const maxWidth = 80;
+ if (shim.process.stdColumns) {
+ return Math.min(maxWidth, shim.process.stdColumns);
+ }
+ else {
+ return maxWidth;
+ }
+ }
+ let version = null;
+ self.version = ver => {
+ version = ver;
+ };
+ self.showVersion = level => {
+ const logger = yargs.getInternalMethods().getLoggerInstance();
+ if (!level)
+ level = 'error';
+ const emit = typeof level === 'function' ? level : logger[level];
+ emit(version);
+ };
+ self.reset = function reset(localLookup) {
+ failMessage = null;
+ failureOutput = false;
+ usages = [];
+ usageDisabled = false;
+ epilogs = [];
+ examples = [];
+ commands = [];
+ descriptions = objFilter(descriptions, k => !localLookup[k]);
+ return self;
+ };
+ const frozens = [];
+ self.freeze = function freeze() {
+ frozens.push({
+ failMessage,
+ failureOutput,
+ usages,
+ usageDisabled,
+ epilogs,
+ examples,
+ commands,
+ descriptions,
+ });
+ };
+ self.unfreeze = function unfreeze(defaultCommand = false) {
+ const frozen = frozens.pop();
+ if (!frozen)
+ return;
+ if (defaultCommand) {
+ descriptions = { ...frozen.descriptions, ...descriptions };
+ commands = [...frozen.commands, ...commands];
+ usages = [...frozen.usages, ...usages];
+ examples = [...frozen.examples, ...examples];
+ epilogs = [...frozen.epilogs, ...epilogs];
+ }
+ else {
+ ({
+ failMessage,
+ failureOutput,
+ usages,
+ usageDisabled,
+ epilogs,
+ examples,
+ commands,
+ descriptions,
+ } = frozen);
+ }
+ };
+ return self;
+}
+function isIndentedText(text) {
+ return typeof text === 'object';
+}
+function addIndentation(text, indent) {
+ return isIndentedText(text)
+ ? { text: text.text, indentation: text.indentation + indent }
+ : { text, indentation: indent };
+}
+function getIndentation(text) {
+ return isIndentedText(text) ? text.indentation : 0;
+}
+function getText(text) {
+ return isIndentedText(text) ? text.text : text;
+}
diff --git a/node_modules/yargs/build/lib/utils/apply-extends.js b/node_modules/yargs/build/lib/utils/apply-extends.js
new file mode 100644
index 0000000..0e593b4
--- /dev/null
+++ b/node_modules/yargs/build/lib/utils/apply-extends.js
@@ -0,0 +1,59 @@
+import { YError } from '../yerror.js';
+let previouslyVisitedConfigs = [];
+let shim;
+export function applyExtends(config, cwd, mergeExtends, _shim) {
+ shim = _shim;
+ let defaultConfig = {};
+ if (Object.prototype.hasOwnProperty.call(config, 'extends')) {
+ if (typeof config.extends !== 'string')
+ return defaultConfig;
+ const isPath = /\.json|\..*rc$/.test(config.extends);
+ let pathToDefault = null;
+ if (!isPath) {
+ try {
+ pathToDefault = require.resolve(config.extends);
+ }
+ catch (_err) {
+ return config;
+ }
+ }
+ else {
+ pathToDefault = getPathToDefaultConfig(cwd, config.extends);
+ }
+ checkForCircularExtends(pathToDefault);
+ previouslyVisitedConfigs.push(pathToDefault);
+ defaultConfig = isPath
+ ? JSON.parse(shim.readFileSync(pathToDefault, 'utf8'))
+ : require(config.extends);
+ delete config.extends;
+ defaultConfig = applyExtends(defaultConfig, shim.path.dirname(pathToDefault), mergeExtends, shim);
+ }
+ previouslyVisitedConfigs = [];
+ return mergeExtends
+ ? mergeDeep(defaultConfig, config)
+ : Object.assign({}, defaultConfig, config);
+}
+function checkForCircularExtends(cfgPath) {
+ if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
+ throw new YError(`Circular extended configurations: '${cfgPath}'.`);
+ }
+}
+function getPathToDefaultConfig(cwd, pathToExtend) {
+ return shim.path.resolve(cwd, pathToExtend);
+}
+function mergeDeep(config1, config2) {
+ const target = {};
+ function isObject(obj) {
+ return obj && typeof obj === 'object' && !Array.isArray(obj);
+ }
+ Object.assign(target, config1);
+ for (const key of Object.keys(config2)) {
+ if (isObject(config2[key]) && isObject(target[key])) {
+ target[key] = mergeDeep(config1[key], config2[key]);
+ }
+ else {
+ target[key] = config2[key];
+ }
+ }
+ return target;
+}
diff --git a/node_modules/yargs/build/lib/utils/is-promise.js b/node_modules/yargs/build/lib/utils/is-promise.js
new file mode 100644
index 0000000..d250c08
--- /dev/null
+++ b/node_modules/yargs/build/lib/utils/is-promise.js
@@ -0,0 +1,5 @@
+export function isPromise(maybePromise) {
+ return (!!maybePromise &&
+ !!maybePromise.then &&
+ typeof maybePromise.then === 'function');
+}
diff --git a/node_modules/yargs/build/lib/utils/levenshtein.js b/node_modules/yargs/build/lib/utils/levenshtein.js
new file mode 100644
index 0000000..60575ef
--- /dev/null
+++ b/node_modules/yargs/build/lib/utils/levenshtein.js
@@ -0,0 +1,34 @@
+export function levenshtein(a, b) {
+ if (a.length === 0)
+ return b.length;
+ if (b.length === 0)
+ return a.length;
+ const matrix = [];
+ let i;
+ for (i = 0; i <= b.length; i++) {
+ matrix[i] = [i];
+ }
+ let j;
+ for (j = 0; j <= a.length; j++) {
+ matrix[0][j] = j;
+ }
+ for (i = 1; i <= b.length; i++) {
+ for (j = 1; j <= a.length; j++) {
+ if (b.charAt(i - 1) === a.charAt(j - 1)) {
+ matrix[i][j] = matrix[i - 1][j - 1];
+ }
+ else {
+ if (i > 1 &&
+ j > 1 &&
+ b.charAt(i - 2) === a.charAt(j - 1) &&
+ b.charAt(i - 1) === a.charAt(j - 2)) {
+ matrix[i][j] = matrix[i - 2][j - 2] + 1;
+ }
+ else {
+ matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, Math.min(matrix[i][j - 1] + 1, matrix[i - 1][j] + 1));
+ }
+ }
+ }
+ }
+ return matrix[b.length][a.length];
+}
diff --git a/node_modules/yargs/build/lib/utils/maybe-async-result.js b/node_modules/yargs/build/lib/utils/maybe-async-result.js
new file mode 100644
index 0000000..8c6a40c
--- /dev/null
+++ b/node_modules/yargs/build/lib/utils/maybe-async-result.js
@@ -0,0 +1,17 @@
+import { isPromise } from './is-promise.js';
+export function maybeAsyncResult(getResult, resultHandler, errorHandler = (err) => {
+ throw err;
+}) {
+ try {
+ const result = isFunction(getResult) ? getResult() : getResult;
+ return isPromise(result)
+ ? result.then((result) => resultHandler(result))
+ : resultHandler(result);
+ }
+ catch (err) {
+ return errorHandler(err);
+ }
+}
+function isFunction(arg) {
+ return typeof arg === 'function';
+}
diff --git a/node_modules/yargs/build/lib/utils/obj-filter.js b/node_modules/yargs/build/lib/utils/obj-filter.js
new file mode 100644
index 0000000..cd68ad2
--- /dev/null
+++ b/node_modules/yargs/build/lib/utils/obj-filter.js
@@ -0,0 +1,10 @@
+import { objectKeys } from '../typings/common-types.js';
+export function objFilter(original = {}, filter = () => true) {
+ const obj = {};
+ objectKeys(original).forEach(key => {
+ if (filter(key, original[key])) {
+ obj[key] = original[key];
+ }
+ });
+ return obj;
+}
diff --git a/node_modules/yargs/build/lib/utils/process-argv.js b/node_modules/yargs/build/lib/utils/process-argv.js
new file mode 100644
index 0000000..74dc9e4
--- /dev/null
+++ b/node_modules/yargs/build/lib/utils/process-argv.js
@@ -0,0 +1,17 @@
+function getProcessArgvBinIndex() {
+ if (isBundledElectronApp())
+ return 0;
+ return 1;
+}
+function isBundledElectronApp() {
+ return isElectronApp() && !process.defaultApp;
+}
+function isElectronApp() {
+ return !!process.versions.electron;
+}
+export function hideBin(argv) {
+ return argv.slice(getProcessArgvBinIndex() + 1);
+}
+export function getProcessArgvBin() {
+ return process.argv[getProcessArgvBinIndex()];
+}
diff --git a/node_modules/yargs/build/lib/utils/set-blocking.js b/node_modules/yargs/build/lib/utils/set-blocking.js
new file mode 100644
index 0000000..88fb806
--- /dev/null
+++ b/node_modules/yargs/build/lib/utils/set-blocking.js
@@ -0,0 +1,12 @@
+export default function setBlocking(blocking) {
+ if (typeof process === 'undefined')
+ return;
+ [process.stdout, process.stderr].forEach(_stream => {
+ const stream = _stream;
+ if (stream._handle &&
+ stream.isTTY &&
+ typeof stream._handle.setBlocking === 'function') {
+ stream._handle.setBlocking(blocking);
+ }
+ });
+}
diff --git a/node_modules/yargs/build/lib/utils/which-module.js b/node_modules/yargs/build/lib/utils/which-module.js
new file mode 100644
index 0000000..5974e22
--- /dev/null
+++ b/node_modules/yargs/build/lib/utils/which-module.js
@@ -0,0 +1,10 @@
+export default function whichModule(exported) {
+ if (typeof require === 'undefined')
+ return null;
+ for (let i = 0, files = Object.keys(require.cache), mod; i < files.length; i++) {
+ mod = require.cache[files[i]];
+ if (mod.exports === exported)
+ return mod;
+ }
+ return null;
+}
diff --git a/node_modules/yargs/build/lib/validation.js b/node_modules/yargs/build/lib/validation.js
new file mode 100644
index 0000000..bd2e1b8
--- /dev/null
+++ b/node_modules/yargs/build/lib/validation.js
@@ -0,0 +1,305 @@
+import { argsert } from './argsert.js';
+import { assertNotStrictEqual, } from './typings/common-types.js';
+import { levenshtein as distance } from './utils/levenshtein.js';
+import { objFilter } from './utils/obj-filter.js';
+const specialKeys = ['$0', '--', '_'];
+export function validation(yargs, usage, shim) {
+ const __ = shim.y18n.__;
+ const __n = shim.y18n.__n;
+ const self = {};
+ self.nonOptionCount = function nonOptionCount(argv) {
+ const demandedCommands = yargs.getDemandedCommands();
+ const positionalCount = argv._.length + (argv['--'] ? argv['--'].length : 0);
+ const _s = positionalCount - yargs.getInternalMethods().getContext().commands.length;
+ if (demandedCommands._ &&
+ (_s < demandedCommands._.min || _s > demandedCommands._.max)) {
+ if (_s < demandedCommands._.min) {
+ if (demandedCommands._.minMsg !== undefined) {
+ usage.fail(demandedCommands._.minMsg
+ ? demandedCommands._.minMsg
+ .replace(/\$0/g, _s.toString())
+ .replace(/\$1/, demandedCommands._.min.toString())
+ : null);
+ }
+ else {
+ usage.fail(__n('Not enough non-option arguments: got %s, need at least %s', 'Not enough non-option arguments: got %s, need at least %s', _s, _s.toString(), demandedCommands._.min.toString()));
+ }
+ }
+ else if (_s > demandedCommands._.max) {
+ if (demandedCommands._.maxMsg !== undefined) {
+ usage.fail(demandedCommands._.maxMsg
+ ? demandedCommands._.maxMsg
+ .replace(/\$0/g, _s.toString())
+ .replace(/\$1/, demandedCommands._.max.toString())
+ : null);
+ }
+ else {
+ usage.fail(__n('Too many non-option arguments: got %s, maximum of %s', 'Too many non-option arguments: got %s, maximum of %s', _s, _s.toString(), demandedCommands._.max.toString()));
+ }
+ }
+ }
+ };
+ self.positionalCount = function positionalCount(required, observed) {
+ if (observed < required) {
+ usage.fail(__n('Not enough non-option arguments: got %s, need at least %s', 'Not enough non-option arguments: got %s, need at least %s', observed, observed + '', required + ''));
+ }
+ };
+ self.requiredArguments = function requiredArguments(argv, demandedOptions) {
+ let missing = null;
+ for (const key of Object.keys(demandedOptions)) {
+ if (!Object.prototype.hasOwnProperty.call(argv, key) ||
+ typeof argv[key] === 'undefined') {
+ missing = missing || {};
+ missing[key] = demandedOptions[key];
+ }
+ }
+ if (missing) {
+ const customMsgs = [];
+ for (const key of Object.keys(missing)) {
+ const msg = missing[key];
+ if (msg && customMsgs.indexOf(msg) < 0) {
+ customMsgs.push(msg);
+ }
+ }
+ const customMsg = customMsgs.length ? `\n${customMsgs.join('\n')}` : '';
+ usage.fail(__n('Missing required argument: %s', 'Missing required arguments: %s', Object.keys(missing).length, Object.keys(missing).join(', ') + customMsg));
+ }
+ };
+ self.unknownArguments = function unknownArguments(argv, aliases, positionalMap, isDefaultCommand, checkPositionals = true) {
+ var _a;
+ const commandKeys = yargs
+ .getInternalMethods()
+ .getCommandInstance()
+ .getCommands();
+ const unknown = [];
+ const currentContext = yargs.getInternalMethods().getContext();
+ Object.keys(argv).forEach(key => {
+ if (!specialKeys.includes(key) &&
+ !Object.prototype.hasOwnProperty.call(positionalMap, key) &&
+ !Object.prototype.hasOwnProperty.call(yargs.getInternalMethods().getParseContext(), key) &&
+ !self.isValidAndSomeAliasIsNotNew(key, aliases)) {
+ unknown.push(key);
+ }
+ });
+ if (checkPositionals &&
+ (currentContext.commands.length > 0 ||
+ commandKeys.length > 0 ||
+ isDefaultCommand)) {
+ argv._.slice(currentContext.commands.length).forEach(key => {
+ if (!commandKeys.includes('' + key)) {
+ unknown.push('' + key);
+ }
+ });
+ }
+ if (checkPositionals) {
+ const demandedCommands = yargs.getDemandedCommands();
+ const maxNonOptDemanded = ((_a = demandedCommands._) === null || _a === void 0 ? void 0 : _a.max) || 0;
+ const expected = currentContext.commands.length + maxNonOptDemanded;
+ if (expected < argv._.length) {
+ argv._.slice(expected).forEach(key => {
+ key = String(key);
+ if (!currentContext.commands.includes(key) &&
+ !unknown.includes(key)) {
+ unknown.push(key);
+ }
+ });
+ }
+ }
+ if (unknown.length) {
+ usage.fail(__n('Unknown argument: %s', 'Unknown arguments: %s', unknown.length, unknown.map(s => (s.trim() ? s : `"${s}"`)).join(', ')));
+ }
+ };
+ self.unknownCommands = function unknownCommands(argv) {
+ const commandKeys = yargs
+ .getInternalMethods()
+ .getCommandInstance()
+ .getCommands();
+ const unknown = [];
+ const currentContext = yargs.getInternalMethods().getContext();
+ if (currentContext.commands.length > 0 || commandKeys.length > 0) {
+ argv._.slice(currentContext.commands.length).forEach(key => {
+ if (!commandKeys.includes('' + key)) {
+ unknown.push('' + key);
+ }
+ });
+ }
+ if (unknown.length > 0) {
+ usage.fail(__n('Unknown command: %s', 'Unknown commands: %s', unknown.length, unknown.join(', ')));
+ return true;
+ }
+ else {
+ return false;
+ }
+ };
+ self.isValidAndSomeAliasIsNotNew = function isValidAndSomeAliasIsNotNew(key, aliases) {
+ if (!Object.prototype.hasOwnProperty.call(aliases, key)) {
+ return false;
+ }
+ const newAliases = yargs.parsed.newAliases;
+ return [key, ...aliases[key]].some(a => !Object.prototype.hasOwnProperty.call(newAliases, a) || !newAliases[key]);
+ };
+ self.limitedChoices = function limitedChoices(argv) {
+ const options = yargs.getOptions();
+ const invalid = {};
+ if (!Object.keys(options.choices).length)
+ return;
+ Object.keys(argv).forEach(key => {
+ if (specialKeys.indexOf(key) === -1 &&
+ Object.prototype.hasOwnProperty.call(options.choices, key)) {
+ [].concat(argv[key]).forEach(value => {
+ if (options.choices[key].indexOf(value) === -1 &&
+ value !== undefined) {
+ invalid[key] = (invalid[key] || []).concat(value);
+ }
+ });
+ }
+ });
+ const invalidKeys = Object.keys(invalid);
+ if (!invalidKeys.length)
+ return;
+ let msg = __('Invalid values:');
+ invalidKeys.forEach(key => {
+ msg += `\n ${__('Argument: %s, Given: %s, Choices: %s', key, usage.stringifiedValues(invalid[key]), usage.stringifiedValues(options.choices[key]))}`;
+ });
+ usage.fail(msg);
+ };
+ let implied = {};
+ self.implies = function implies(key, value) {
+ argsert('<string|object> [array|number|string]', [key, value], arguments.length);
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(k => {
+ self.implies(k, key[k]);
+ });
+ }
+ else {
+ yargs.global(key);
+ if (!implied[key]) {
+ implied[key] = [];
+ }
+ if (Array.isArray(value)) {
+ value.forEach(i => self.implies(key, i));
+ }
+ else {
+ assertNotStrictEqual(value, undefined, shim);
+ implied[key].push(value);
+ }
+ }
+ };
+ self.getImplied = function getImplied() {
+ return implied;
+ };
+ function keyExists(argv, val) {
+ const num = Number(val);
+ val = isNaN(num) ? val : num;
+ if (typeof val === 'number') {
+ val = argv._.length >= val;
+ }
+ else if (val.match(/^--no-.+/)) {
+ val = val.match(/^--no-(.+)/)[1];
+ val = !Object.prototype.hasOwnProperty.call(argv, val);
+ }
+ else {
+ val = Object.prototype.hasOwnProperty.call(argv, val);
+ }
+ return val;
+ }
+ self.implications = function implications(argv) {
+ const implyFail = [];
+ Object.keys(implied).forEach(key => {
+ const origKey = key;
+ (implied[key] || []).forEach(value => {
+ let key = origKey;
+ const origValue = value;
+ key = keyExists(argv, key);
+ value = keyExists(argv, value);
+ if (key && !value) {
+ implyFail.push(` ${origKey} -> ${origValue}`);
+ }
+ });
+ });
+ if (implyFail.length) {
+ let msg = `${__('Implications failed:')}\n`;
+ implyFail.forEach(value => {
+ msg += value;
+ });
+ usage.fail(msg);
+ }
+ };
+ let conflicting = {};
+ self.conflicts = function conflicts(key, value) {
+ argsert('<string|object> [array|string]', [key, value], arguments.length);
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(k => {
+ self.conflicts(k, key[k]);
+ });
+ }
+ else {
+ yargs.global(key);
+ if (!conflicting[key]) {
+ conflicting[key] = [];
+ }
+ if (Array.isArray(value)) {
+ value.forEach(i => self.conflicts(key, i));
+ }
+ else {
+ conflicting[key].push(value);
+ }
+ }
+ };
+ self.getConflicting = () => conflicting;
+ self.conflicting = function conflictingFn(argv) {
+ Object.keys(argv).forEach(key => {
+ if (conflicting[key]) {
+ conflicting[key].forEach(value => {
+ if (value && argv[key] !== undefined && argv[value] !== undefined) {
+ usage.fail(__('Arguments %s and %s are mutually exclusive', key, value));
+ }
+ });
+ }
+ });
+ if (yargs.getInternalMethods().getParserConfiguration()['strip-dashed']) {
+ Object.keys(conflicting).forEach(key => {
+ conflicting[key].forEach(value => {
+ if (value &&
+ argv[shim.Parser.camelCase(key)] !== undefined &&
+ argv[shim.Parser.camelCase(value)] !== undefined) {
+ usage.fail(__('Arguments %s and %s are mutually exclusive', key, value));
+ }
+ });
+ });
+ }
+ };
+ self.recommendCommands = function recommendCommands(cmd, potentialCommands) {
+ const threshold = 3;
+ potentialCommands = potentialCommands.sort((a, b) => b.length - a.length);
+ let recommended = null;
+ let bestDistance = Infinity;
+ for (let i = 0, candidate; (candidate = potentialCommands[i]) !== undefined; i++) {
+ const d = distance(cmd, candidate);
+ if (d <= threshold && d < bestDistance) {
+ bestDistance = d;
+ recommended = candidate;
+ }
+ }
+ if (recommended)
+ usage.fail(__('Did you mean %s?', recommended));
+ };
+ self.reset = function reset(localLookup) {
+ implied = objFilter(implied, k => !localLookup[k]);
+ conflicting = objFilter(conflicting, k => !localLookup[k]);
+ return self;
+ };
+ const frozens = [];
+ self.freeze = function freeze() {
+ frozens.push({
+ implied,
+ conflicting,
+ });
+ };
+ self.unfreeze = function unfreeze() {
+ const frozen = frozens.pop();
+ assertNotStrictEqual(frozen, undefined, shim);
+ ({ implied, conflicting } = frozen);
+ };
+ return self;
+}
diff --git a/node_modules/yargs/build/lib/yargs-factory.js b/node_modules/yargs/build/lib/yargs-factory.js
new file mode 100644
index 0000000..c4b1d50
--- /dev/null
+++ b/node_modules/yargs/build/lib/yargs-factory.js
@@ -0,0 +1,1512 @@
+var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
+ if (kind === "m") throw new TypeError("Private method is not writable");
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
+};
+var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
+};
+var _YargsInstance_command, _YargsInstance_cwd, _YargsInstance_context, _YargsInstance_completion, _YargsInstance_completionCommand, _YargsInstance_defaultShowHiddenOpt, _YargsInstance_exitError, _YargsInstance_detectLocale, _YargsInstance_emittedWarnings, _YargsInstance_exitProcess, _YargsInstance_frozens, _YargsInstance_globalMiddleware, _YargsInstance_groups, _YargsInstance_hasOutput, _YargsInstance_helpOpt, _YargsInstance_isGlobalContext, _YargsInstance_logger, _YargsInstance_output, _YargsInstance_options, _YargsInstance_parentRequire, _YargsInstance_parserConfig, _YargsInstance_parseFn, _YargsInstance_parseContext, _YargsInstance_pkgs, _YargsInstance_preservedGroups, _YargsInstance_processArgs, _YargsInstance_recommendCommands, _YargsInstance_shim, _YargsInstance_strict, _YargsInstance_strictCommands, _YargsInstance_strictOptions, _YargsInstance_usage, _YargsInstance_usageConfig, _YargsInstance_versionOpt, _YargsInstance_validation;
+import { command as Command, } from './command.js';
+import { assertNotStrictEqual, assertSingleKey, objectKeys, } from './typings/common-types.js';
+import { YError } from './yerror.js';
+import { usage as Usage } from './usage.js';
+import { argsert } from './argsert.js';
+import { completion as Completion, } from './completion.js';
+import { validation as Validation, } from './validation.js';
+import { objFilter } from './utils/obj-filter.js';
+import { applyExtends } from './utils/apply-extends.js';
+import { applyMiddleware, GlobalMiddleware, } from './middleware.js';
+import { isPromise } from './utils/is-promise.js';
+import { maybeAsyncResult } from './utils/maybe-async-result.js';
+import setBlocking from './utils/set-blocking.js';
+export function YargsFactory(_shim) {
+ return (processArgs = [], cwd = _shim.process.cwd(), parentRequire) => {
+ const yargs = new YargsInstance(processArgs, cwd, parentRequire, _shim);
+ Object.defineProperty(yargs, 'argv', {
+ get: () => {
+ return yargs.parse();
+ },
+ enumerable: true,
+ });
+ yargs.help();
+ yargs.version();
+ return yargs;
+ };
+}
+const kCopyDoubleDash = Symbol('copyDoubleDash');
+const kCreateLogger = Symbol('copyDoubleDash');
+const kDeleteFromParserHintObject = Symbol('deleteFromParserHintObject');
+const kEmitWarning = Symbol('emitWarning');
+const kFreeze = Symbol('freeze');
+const kGetDollarZero = Symbol('getDollarZero');
+const kGetParserConfiguration = Symbol('getParserConfiguration');
+const kGetUsageConfiguration = Symbol('getUsageConfiguration');
+const kGuessLocale = Symbol('guessLocale');
+const kGuessVersion = Symbol('guessVersion');
+const kParsePositionalNumbers = Symbol('parsePositionalNumbers');
+const kPkgUp = Symbol('pkgUp');
+const kPopulateParserHintArray = Symbol('populateParserHintArray');
+const kPopulateParserHintSingleValueDictionary = Symbol('populateParserHintSingleValueDictionary');
+const kPopulateParserHintArrayDictionary = Symbol('populateParserHintArrayDictionary');
+const kPopulateParserHintDictionary = Symbol('populateParserHintDictionary');
+const kSanitizeKey = Symbol('sanitizeKey');
+const kSetKey = Symbol('setKey');
+const kUnfreeze = Symbol('unfreeze');
+const kValidateAsync = Symbol('validateAsync');
+const kGetCommandInstance = Symbol('getCommandInstance');
+const kGetContext = Symbol('getContext');
+const kGetHasOutput = Symbol('getHasOutput');
+const kGetLoggerInstance = Symbol('getLoggerInstance');
+const kGetParseContext = Symbol('getParseContext');
+const kGetUsageInstance = Symbol('getUsageInstance');
+const kGetValidationInstance = Symbol('getValidationInstance');
+const kHasParseCallback = Symbol('hasParseCallback');
+const kIsGlobalContext = Symbol('isGlobalContext');
+const kPostProcess = Symbol('postProcess');
+const kRebase = Symbol('rebase');
+const kReset = Symbol('reset');
+const kRunYargsParserAndExecuteCommands = Symbol('runYargsParserAndExecuteCommands');
+const kRunValidation = Symbol('runValidation');
+const kSetHasOutput = Symbol('setHasOutput');
+const kTrackManuallySetKeys = Symbol('kTrackManuallySetKeys');
+export class YargsInstance {
+ constructor(processArgs = [], cwd, parentRequire, shim) {
+ this.customScriptName = false;
+ this.parsed = false;
+ _YargsInstance_command.set(this, void 0);
+ _YargsInstance_cwd.set(this, void 0);
+ _YargsInstance_context.set(this, { commands: [], fullCommands: [] });
+ _YargsInstance_completion.set(this, null);
+ _YargsInstance_completionCommand.set(this, null);
+ _YargsInstance_defaultShowHiddenOpt.set(this, 'show-hidden');
+ _YargsInstance_exitError.set(this, null);
+ _YargsInstance_detectLocale.set(this, true);
+ _YargsInstance_emittedWarnings.set(this, {});
+ _YargsInstance_exitProcess.set(this, true);
+ _YargsInstance_frozens.set(this, []);
+ _YargsInstance_globalMiddleware.set(this, void 0);
+ _YargsInstance_groups.set(this, {});
+ _YargsInstance_hasOutput.set(this, false);
+ _YargsInstance_helpOpt.set(this, null);
+ _YargsInstance_isGlobalContext.set(this, true);
+ _YargsInstance_logger.set(this, void 0);
+ _YargsInstance_output.set(this, '');
+ _YargsInstance_options.set(this, void 0);
+ _YargsInstance_parentRequire.set(this, void 0);
+ _YargsInstance_parserConfig.set(this, {});
+ _YargsInstance_parseFn.set(this, null);
+ _YargsInstance_parseContext.set(this, null);
+ _YargsInstance_pkgs.set(this, {});
+ _YargsInstance_preservedGroups.set(this, {});
+ _YargsInstance_processArgs.set(this, void 0);
+ _YargsInstance_recommendCommands.set(this, false);
+ _YargsInstance_shim.set(this, void 0);
+ _YargsInstance_strict.set(this, false);
+ _YargsInstance_strictCommands.set(this, false);
+ _YargsInstance_strictOptions.set(this, false);
+ _YargsInstance_usage.set(this, void 0);
+ _YargsInstance_usageConfig.set(this, {});
+ _YargsInstance_versionOpt.set(this, null);
+ _YargsInstance_validation.set(this, void 0);
+ __classPrivateFieldSet(this, _YargsInstance_shim, shim, "f");
+ __classPrivateFieldSet(this, _YargsInstance_processArgs, processArgs, "f");
+ __classPrivateFieldSet(this, _YargsInstance_cwd, cwd, "f");
+ __classPrivateFieldSet(this, _YargsInstance_parentRequire, parentRequire, "f");
+ __classPrivateFieldSet(this, _YargsInstance_globalMiddleware, new GlobalMiddleware(this), "f");
+ this.$0 = this[kGetDollarZero]();
+ this[kReset]();
+ __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f"), "f");
+ __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), "f");
+ __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f"), "f");
+ __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f"), "f");
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f");
+ __classPrivateFieldSet(this, _YargsInstance_logger, this[kCreateLogger](), "f");
+ }
+ addHelpOpt(opt, msg) {
+ const defaultHelpOpt = 'help';
+ argsert('[string|boolean] [string]', [opt, msg], arguments.length);
+ if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) {
+ this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"));
+ __classPrivateFieldSet(this, _YargsInstance_helpOpt, null, "f");
+ }
+ if (opt === false && msg === undefined)
+ return this;
+ __classPrivateFieldSet(this, _YargsInstance_helpOpt, typeof opt === 'string' ? opt : defaultHelpOpt, "f");
+ this.boolean(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"));
+ this.describe(__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f"), msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Show help'));
+ return this;
+ }
+ help(opt, msg) {
+ return this.addHelpOpt(opt, msg);
+ }
+ addShowHiddenOpt(opt, msg) {
+ argsert('[string|boolean] [string]', [opt, msg], arguments.length);
+ if (opt === false && msg === undefined)
+ return this;
+ const showHiddenOpt = typeof opt === 'string' ? opt : __classPrivateFieldGet(this, _YargsInstance_defaultShowHiddenOpt, "f");
+ this.boolean(showHiddenOpt);
+ this.describe(showHiddenOpt, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Show hidden options'));
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").showHiddenOpt = showHiddenOpt;
+ return this;
+ }
+ showHidden(opt, msg) {
+ return this.addShowHiddenOpt(opt, msg);
+ }
+ alias(key, value) {
+ argsert('<object|string|array> [string|array]', [key, value], arguments.length);
+ this[kPopulateParserHintArrayDictionary](this.alias.bind(this), 'alias', key, value);
+ return this;
+ }
+ array(keys) {
+ argsert('<array|string>', [keys], arguments.length);
+ this[kPopulateParserHintArray]('array', keys);
+ this[kTrackManuallySetKeys](keys);
+ return this;
+ }
+ boolean(keys) {
+ argsert('<array|string>', [keys], arguments.length);
+ this[kPopulateParserHintArray]('boolean', keys);
+ this[kTrackManuallySetKeys](keys);
+ return this;
+ }
+ check(f, global) {
+ argsert('<function> [boolean]', [f, global], arguments.length);
+ this.middleware((argv, _yargs) => {
+ return maybeAsyncResult(() => {
+ return f(argv, _yargs.getOptions());
+ }, (result) => {
+ if (!result) {
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(__classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__('Argument check failed: %s', f.toString()));
+ }
+ else if (typeof result === 'string' || result instanceof Error) {
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(result.toString(), result);
+ }
+ return argv;
+ }, (err) => {
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message ? err.message : err.toString(), err);
+ return argv;
+ });
+ }, false, global);
+ return this;
+ }
+ choices(key, value) {
+ argsert('<object|string|array> [string|array]', [key, value], arguments.length);
+ this[kPopulateParserHintArrayDictionary](this.choices.bind(this), 'choices', key, value);
+ return this;
+ }
+ coerce(keys, value) {
+ argsert('<object|string|array> [function]', [keys, value], arguments.length);
+ if (Array.isArray(keys)) {
+ if (!value) {
+ throw new YError('coerce callback must be provided');
+ }
+ for (const key of keys) {
+ this.coerce(key, value);
+ }
+ return this;
+ }
+ else if (typeof keys === 'object') {
+ for (const key of Object.keys(keys)) {
+ this.coerce(key, keys[key]);
+ }
+ return this;
+ }
+ if (!value) {
+ throw new YError('coerce callback must be provided');
+ }
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").key[keys] = true;
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addCoerceMiddleware((argv, yargs) => {
+ let aliases;
+ const shouldCoerce = Object.prototype.hasOwnProperty.call(argv, keys);
+ if (!shouldCoerce) {
+ return argv;
+ }
+ return maybeAsyncResult(() => {
+ aliases = yargs.getAliases();
+ return value(argv[keys]);
+ }, (result) => {
+ argv[keys] = result;
+ const stripAliased = yargs
+ .getInternalMethods()
+ .getParserConfiguration()['strip-aliased'];
+ if (aliases[keys] && stripAliased !== true) {
+ for (const alias of aliases[keys]) {
+ argv[alias] = result;
+ }
+ }
+ return argv;
+ }, (err) => {
+ throw new YError(err.message);
+ });
+ }, keys);
+ return this;
+ }
+ conflicts(key1, key2) {
+ argsert('<string|object> [string|array]', [key1, key2], arguments.length);
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicts(key1, key2);
+ return this;
+ }
+ config(key = 'config', msg, parseFn) {
+ argsert('[object|string] [string|function] [function]', [key, msg, parseFn], arguments.length);
+ if (typeof key === 'object' && !Array.isArray(key)) {
+ key = applyExtends(key, __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()['deep-merge-config'] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(key);
+ return this;
+ }
+ if (typeof msg === 'function') {
+ parseFn = msg;
+ msg = undefined;
+ }
+ this.describe(key, msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Path to JSON config file'));
+ (Array.isArray(key) ? key : [key]).forEach(k => {
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").config[k] = parseFn || true;
+ });
+ return this;
+ }
+ completion(cmd, desc, fn) {
+ argsert('[string] [string|boolean|function] [function]', [cmd, desc, fn], arguments.length);
+ if (typeof desc === 'function') {
+ fn = desc;
+ desc = undefined;
+ }
+ __classPrivateFieldSet(this, _YargsInstance_completionCommand, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || 'completion', "f");
+ if (!desc && desc !== false) {
+ desc = 'generate completion script';
+ }
+ this.command(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"), desc);
+ if (fn)
+ __classPrivateFieldGet(this, _YargsInstance_completion, "f").registerFunction(fn);
+ return this;
+ }
+ command(cmd, description, builder, handler, middlewares, deprecated) {
+ argsert('<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]', [cmd, description, builder, handler, middlewares, deprecated], arguments.length);
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").addHandler(cmd, description, builder, handler, middlewares, deprecated);
+ return this;
+ }
+ commands(cmd, description, builder, handler, middlewares, deprecated) {
+ return this.command(cmd, description, builder, handler, middlewares, deprecated);
+ }
+ commandDir(dir, opts) {
+ argsert('<string> [object]', [dir, opts], arguments.length);
+ const req = __classPrivateFieldGet(this, _YargsInstance_parentRequire, "f") || __classPrivateFieldGet(this, _YargsInstance_shim, "f").require;
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").addDirectory(dir, req, __classPrivateFieldGet(this, _YargsInstance_shim, "f").getCallerFile(), opts);
+ return this;
+ }
+ count(keys) {
+ argsert('<array|string>', [keys], arguments.length);
+ this[kPopulateParserHintArray]('count', keys);
+ this[kTrackManuallySetKeys](keys);
+ return this;
+ }
+ default(key, value, defaultDescription) {
+ argsert('<object|string|array> [*] [string]', [key, value, defaultDescription], arguments.length);
+ if (defaultDescription) {
+ assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = defaultDescription;
+ }
+ if (typeof value === 'function') {
+ assertSingleKey(key, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
+ if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key])
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] =
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").functionDescription(value);
+ value = value.call();
+ }
+ this[kPopulateParserHintSingleValueDictionary](this.default.bind(this), 'default', key, value);
+ return this;
+ }
+ defaults(key, value, defaultDescription) {
+ return this.default(key, value, defaultDescription);
+ }
+ demandCommand(min = 1, max, minMsg, maxMsg) {
+ argsert('[number] [number|string] [string|null|undefined] [string|null|undefined]', [min, max, minMsg, maxMsg], arguments.length);
+ if (typeof max !== 'number') {
+ minMsg = max;
+ max = Infinity;
+ }
+ this.global('_', false);
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands._ = {
+ min,
+ max,
+ minMsg,
+ maxMsg,
+ };
+ return this;
+ }
+ demand(keys, max, msg) {
+ if (Array.isArray(max)) {
+ max.forEach(key => {
+ assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
+ this.demandOption(key, msg);
+ });
+ max = Infinity;
+ }
+ else if (typeof max !== 'number') {
+ msg = max;
+ max = Infinity;
+ }
+ if (typeof keys === 'number') {
+ assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
+ this.demandCommand(keys, max, msg, msg);
+ }
+ else if (Array.isArray(keys)) {
+ keys.forEach(key => {
+ assertNotStrictEqual(msg, true, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
+ this.demandOption(key, msg);
+ });
+ }
+ else {
+ if (typeof msg === 'string') {
+ this.demandOption(keys, msg);
+ }
+ else if (msg === true || typeof msg === 'undefined') {
+ this.demandOption(keys);
+ }
+ }
+ return this;
+ }
+ demandOption(keys, msg) {
+ argsert('<object|string|array> [string]', [keys, msg], arguments.length);
+ this[kPopulateParserHintSingleValueDictionary](this.demandOption.bind(this), 'demandedOptions', keys, msg);
+ return this;
+ }
+ deprecateOption(option, message) {
+ argsert('<string> [string|boolean]', [option, message], arguments.length);
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions[option] = message;
+ return this;
+ }
+ describe(keys, description) {
+ argsert('<object|string|array> [string]', [keys, description], arguments.length);
+ this[kSetKey](keys, true);
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").describe(keys, description);
+ return this;
+ }
+ detectLocale(detect) {
+ argsert('<boolean>', [detect], arguments.length);
+ __classPrivateFieldSet(this, _YargsInstance_detectLocale, detect, "f");
+ return this;
+ }
+ env(prefix) {
+ argsert('[string|boolean]', [prefix], arguments.length);
+ if (prefix === false)
+ delete __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix;
+ else
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix = prefix || '';
+ return this;
+ }
+ epilogue(msg) {
+ argsert('<string>', [msg], arguments.length);
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").epilog(msg);
+ return this;
+ }
+ epilog(msg) {
+ return this.epilogue(msg);
+ }
+ example(cmd, description) {
+ argsert('<string|array> [string]', [cmd, description], arguments.length);
+ if (Array.isArray(cmd)) {
+ cmd.forEach(exampleParams => this.example(...exampleParams));
+ }
+ else {
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").example(cmd, description);
+ }
+ return this;
+ }
+ exit(code, err) {
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
+ __classPrivateFieldSet(this, _YargsInstance_exitError, err, "f");
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"))
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.exit(code);
+ }
+ exitProcess(enabled = true) {
+ argsert('[boolean]', [enabled], arguments.length);
+ __classPrivateFieldSet(this, _YargsInstance_exitProcess, enabled, "f");
+ return this;
+ }
+ fail(f) {
+ argsert('<function|boolean>', [f], arguments.length);
+ if (typeof f === 'boolean' && f !== false) {
+ throw new YError("Invalid first argument. Expected function or boolean 'false'");
+ }
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").failFn(f);
+ return this;
+ }
+ getAliases() {
+ return this.parsed ? this.parsed.aliases : {};
+ }
+ async getCompletion(args, done) {
+ argsert('<array> [function]', [args, done], arguments.length);
+ if (!done) {
+ return new Promise((resolve, reject) => {
+ __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, (err, completions) => {
+ if (err)
+ reject(err);
+ else
+ resolve(completions);
+ });
+ });
+ }
+ else {
+ return __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(args, done);
+ }
+ }
+ getDemandedOptions() {
+ argsert([], 0);
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedOptions;
+ }
+ getDemandedCommands() {
+ argsert([], 0);
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f").demandedCommands;
+ }
+ getDeprecatedOptions() {
+ argsert([], 0);
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f").deprecatedOptions;
+ }
+ getDetectLocale() {
+ return __classPrivateFieldGet(this, _YargsInstance_detectLocale, "f");
+ }
+ getExitProcess() {
+ return __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f");
+ }
+ getGroups() {
+ return Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_groups, "f"), __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"));
+ }
+ getHelp() {
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
+ if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
+ if (!this.parsed) {
+ const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), undefined, undefined, 0, true);
+ if (isPromise(parse)) {
+ return parse.then(() => {
+ return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help();
+ });
+ }
+ }
+ const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this);
+ if (isPromise(builderResponse)) {
+ return builderResponse.then(() => {
+ return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help();
+ });
+ }
+ }
+ return Promise.resolve(__classPrivateFieldGet(this, _YargsInstance_usage, "f").help());
+ }
+ getOptions() {
+ return __classPrivateFieldGet(this, _YargsInstance_options, "f");
+ }
+ getStrict() {
+ return __classPrivateFieldGet(this, _YargsInstance_strict, "f");
+ }
+ getStrictCommands() {
+ return __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f");
+ }
+ getStrictOptions() {
+ return __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f");
+ }
+ global(globals, global) {
+ argsert('<string|array> [boolean]', [globals, global], arguments.length);
+ globals = [].concat(globals);
+ if (global !== false) {
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local.filter(l => globals.indexOf(l) === -1);
+ }
+ else {
+ globals.forEach(g => {
+ if (!__classPrivateFieldGet(this, _YargsInstance_options, "f").local.includes(g))
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").local.push(g);
+ });
+ }
+ return this;
+ }
+ group(opts, groupName) {
+ argsert('<string|array> <string>', [opts, groupName], arguments.length);
+ const existing = __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName] || __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName];
+ if (__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName]) {
+ delete __classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f")[groupName];
+ }
+ const seen = {};
+ __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName] = (existing || []).concat(opts).filter(key => {
+ if (seen[key])
+ return false;
+ return (seen[key] = true);
+ });
+ return this;
+ }
+ hide(key) {
+ argsert('<string>', [key], arguments.length);
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").hiddenOptions.push(key);
+ return this;
+ }
+ implies(key, value) {
+ argsert('<string|object> [number|string|array]', [key, value], arguments.length);
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").implies(key, value);
+ return this;
+ }
+ locale(locale) {
+ argsert('[string]', [locale], arguments.length);
+ if (locale === undefined) {
+ this[kGuessLocale]();
+ return __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.getLocale();
+ }
+ __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f");
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.setLocale(locale);
+ return this;
+ }
+ middleware(callback, applyBeforeValidation, global) {
+ return __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").addMiddleware(callback, !!applyBeforeValidation, global);
+ }
+ nargs(key, value) {
+ argsert('<string|object|array> [number]', [key, value], arguments.length);
+ this[kPopulateParserHintSingleValueDictionary](this.nargs.bind(this), 'narg', key, value);
+ return this;
+ }
+ normalize(keys) {
+ argsert('<array|string>', [keys], arguments.length);
+ this[kPopulateParserHintArray]('normalize', keys);
+ return this;
+ }
+ number(keys) {
+ argsert('<array|string>', [keys], arguments.length);
+ this[kPopulateParserHintArray]('number', keys);
+ this[kTrackManuallySetKeys](keys);
+ return this;
+ }
+ option(key, opt) {
+ argsert('<string|object> [object]', [key, opt], arguments.length);
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(k => {
+ this.options(k, key[k]);
+ });
+ }
+ else {
+ if (typeof opt !== 'object') {
+ opt = {};
+ }
+ this[kTrackManuallySetKeys](key);
+ if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && (key === 'version' || (opt === null || opt === void 0 ? void 0 : opt.alias) === 'version')) {
+ this[kEmitWarning]([
+ '"version" is a reserved word.',
+ 'Please do one of the following:',
+ '- Disable version with `yargs.version(false)` if using "version" as an option',
+ '- Use the built-in `yargs.version` method instead (if applicable)',
+ '- Use a different option key',
+ 'https://yargs.js.org/docs/#api-reference-version',
+ ].join('\n'), undefined, 'versionWarning');
+ }
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").key[key] = true;
+ if (opt.alias)
+ this.alias(key, opt.alias);
+ const deprecate = opt.deprecate || opt.deprecated;
+ if (deprecate) {
+ this.deprecateOption(key, deprecate);
+ }
+ const demand = opt.demand || opt.required || opt.require;
+ if (demand) {
+ this.demand(key, demand);
+ }
+ if (opt.demandOption) {
+ this.demandOption(key, typeof opt.demandOption === 'string' ? opt.demandOption : undefined);
+ }
+ if (opt.conflicts) {
+ this.conflicts(key, opt.conflicts);
+ }
+ if ('default' in opt) {
+ this.default(key, opt.default);
+ }
+ if (opt.implies !== undefined) {
+ this.implies(key, opt.implies);
+ }
+ if (opt.nargs !== undefined) {
+ this.nargs(key, opt.nargs);
+ }
+ if (opt.config) {
+ this.config(key, opt.configParser);
+ }
+ if (opt.normalize) {
+ this.normalize(key);
+ }
+ if (opt.choices) {
+ this.choices(key, opt.choices);
+ }
+ if (opt.coerce) {
+ this.coerce(key, opt.coerce);
+ }
+ if (opt.group) {
+ this.group(key, opt.group);
+ }
+ if (opt.boolean || opt.type === 'boolean') {
+ this.boolean(key);
+ if (opt.alias)
+ this.boolean(opt.alias);
+ }
+ if (opt.array || opt.type === 'array') {
+ this.array(key);
+ if (opt.alias)
+ this.array(opt.alias);
+ }
+ if (opt.number || opt.type === 'number') {
+ this.number(key);
+ if (opt.alias)
+ this.number(opt.alias);
+ }
+ if (opt.string || opt.type === 'string') {
+ this.string(key);
+ if (opt.alias)
+ this.string(opt.alias);
+ }
+ if (opt.count || opt.type === 'count') {
+ this.count(key);
+ }
+ if (typeof opt.global === 'boolean') {
+ this.global(key, opt.global);
+ }
+ if (opt.defaultDescription) {
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").defaultDescription[key] = opt.defaultDescription;
+ }
+ if (opt.skipValidation) {
+ this.skipValidation(key);
+ }
+ const desc = opt.describe || opt.description || opt.desc;
+ const descriptions = __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions();
+ if (!Object.prototype.hasOwnProperty.call(descriptions, key) ||
+ typeof desc === 'string') {
+ this.describe(key, desc);
+ }
+ if (opt.hidden) {
+ this.hide(key);
+ }
+ if (opt.requiresArg) {
+ this.requiresArg(key);
+ }
+ }
+ return this;
+ }
+ options(key, opt) {
+ return this.option(key, opt);
+ }
+ parse(args, shortCircuit, _parseFn) {
+ argsert('[string|array] [function|boolean|object] [function]', [args, shortCircuit, _parseFn], arguments.length);
+ this[kFreeze]();
+ if (typeof args === 'undefined') {
+ args = __classPrivateFieldGet(this, _YargsInstance_processArgs, "f");
+ }
+ if (typeof shortCircuit === 'object') {
+ __classPrivateFieldSet(this, _YargsInstance_parseContext, shortCircuit, "f");
+ shortCircuit = _parseFn;
+ }
+ if (typeof shortCircuit === 'function') {
+ __classPrivateFieldSet(this, _YargsInstance_parseFn, shortCircuit, "f");
+ shortCircuit = false;
+ }
+ if (!shortCircuit)
+ __classPrivateFieldSet(this, _YargsInstance_processArgs, args, "f");
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f"))
+ __classPrivateFieldSet(this, _YargsInstance_exitProcess, false, "f");
+ const parsed = this[kRunYargsParserAndExecuteCommands](args, !!shortCircuit);
+ const tmpParsed = this.parsed;
+ __classPrivateFieldGet(this, _YargsInstance_completion, "f").setParsed(this.parsed);
+ if (isPromise(parsed)) {
+ return parsed
+ .then(argv => {
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f"))
+ __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), argv, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
+ return argv;
+ })
+ .catch(err => {
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f")) {
+ __classPrivateFieldGet(this, _YargsInstance_parseFn, "f")(err, this.parsed.argv, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
+ }
+ throw err;
+ })
+ .finally(() => {
+ this[kUnfreeze]();
+ this.parsed = tmpParsed;
+ });
+ }
+ else {
+ if (__classPrivateFieldGet(this, _YargsInstance_parseFn, "f"))
+ __classPrivateFieldGet(this, _YargsInstance_parseFn, "f").call(this, __classPrivateFieldGet(this, _YargsInstance_exitError, "f"), parsed, __classPrivateFieldGet(this, _YargsInstance_output, "f"));
+ this[kUnfreeze]();
+ this.parsed = tmpParsed;
+ }
+ return parsed;
+ }
+ parseAsync(args, shortCircuit, _parseFn) {
+ const maybePromise = this.parse(args, shortCircuit, _parseFn);
+ return !isPromise(maybePromise)
+ ? Promise.resolve(maybePromise)
+ : maybePromise;
+ }
+ parseSync(args, shortCircuit, _parseFn) {
+ const maybePromise = this.parse(args, shortCircuit, _parseFn);
+ if (isPromise(maybePromise)) {
+ throw new YError('.parseSync() must not be used with asynchronous builders, handlers, or middleware');
+ }
+ return maybePromise;
+ }
+ parserConfiguration(config) {
+ argsert('<object>', [config], arguments.length);
+ __classPrivateFieldSet(this, _YargsInstance_parserConfig, config, "f");
+ return this;
+ }
+ pkgConf(key, rootPath) {
+ argsert('<string> [string]', [key, rootPath], arguments.length);
+ let conf = null;
+ const obj = this[kPkgUp](rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"));
+ if (obj[key] && typeof obj[key] === 'object') {
+ conf = applyExtends(obj[key], rootPath || __classPrivateFieldGet(this, _YargsInstance_cwd, "f"), this[kGetParserConfiguration]()['deep-merge-config'] || false, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = (__classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || []).concat(conf);
+ }
+ return this;
+ }
+ positional(key, opts) {
+ argsert('<string> <object>', [key, opts], arguments.length);
+ const supportedOpts = [
+ 'default',
+ 'defaultDescription',
+ 'implies',
+ 'normalize',
+ 'choices',
+ 'conflicts',
+ 'coerce',
+ 'type',
+ 'describe',
+ 'desc',
+ 'description',
+ 'alias',
+ ];
+ opts = objFilter(opts, (k, v) => {
+ if (k === 'type' && !['string', 'number', 'boolean'].includes(v))
+ return false;
+ return supportedOpts.includes(k);
+ });
+ const fullCommand = __classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands[__classPrivateFieldGet(this, _YargsInstance_context, "f").fullCommands.length - 1];
+ const parseOptions = fullCommand
+ ? __classPrivateFieldGet(this, _YargsInstance_command, "f").cmdToParseOptions(fullCommand)
+ : {
+ array: [],
+ alias: {},
+ default: {},
+ demand: {},
+ };
+ objectKeys(parseOptions).forEach(pk => {
+ const parseOption = parseOptions[pk];
+ if (Array.isArray(parseOption)) {
+ if (parseOption.indexOf(key) !== -1)
+ opts[pk] = true;
+ }
+ else {
+ if (parseOption[key] && !(pk in opts))
+ opts[pk] = parseOption[key];
+ }
+ });
+ this.group(key, __classPrivateFieldGet(this, _YargsInstance_usage, "f").getPositionalGroupName());
+ return this.option(key, opts);
+ }
+ recommendCommands(recommend = true) {
+ argsert('[boolean]', [recommend], arguments.length);
+ __classPrivateFieldSet(this, _YargsInstance_recommendCommands, recommend, "f");
+ return this;
+ }
+ required(keys, max, msg) {
+ return this.demand(keys, max, msg);
+ }
+ require(keys, max, msg) {
+ return this.demand(keys, max, msg);
+ }
+ requiresArg(keys) {
+ argsert('<array|string|object> [number]', [keys], arguments.length);
+ if (typeof keys === 'string' && __classPrivateFieldGet(this, _YargsInstance_options, "f").narg[keys]) {
+ return this;
+ }
+ else {
+ this[kPopulateParserHintSingleValueDictionary](this.requiresArg.bind(this), 'narg', keys, NaN);
+ }
+ return this;
+ }
+ showCompletionScript($0, cmd) {
+ argsert('[string] [string]', [$0, cmd], arguments.length);
+ $0 = $0 || this.$0;
+ __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(__classPrivateFieldGet(this, _YargsInstance_completion, "f").generateCompletionScript($0, cmd || __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") || 'completion'));
+ return this;
+ }
+ showHelp(level) {
+ argsert('[string|function]', [level], arguments.length);
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
+ if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
+ if (!this.parsed) {
+ const parse = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), undefined, undefined, 0, true);
+ if (isPromise(parse)) {
+ parse.then(() => {
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
+ });
+ return this;
+ }
+ }
+ const builderResponse = __classPrivateFieldGet(this, _YargsInstance_command, "f").runDefaultBuilderOn(this);
+ if (isPromise(builderResponse)) {
+ builderResponse.then(() => {
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
+ });
+ return this;
+ }
+ }
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
+ return this;
+ }
+ scriptName(scriptName) {
+ this.customScriptName = true;
+ this.$0 = scriptName;
+ return this;
+ }
+ showHelpOnFail(enabled, message) {
+ argsert('[boolean|string] [string]', [enabled, message], arguments.length);
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelpOnFail(enabled, message);
+ return this;
+ }
+ showVersion(level) {
+ argsert('[string|function]', [level], arguments.length);
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion(level);
+ return this;
+ }
+ skipValidation(keys) {
+ argsert('<array|string>', [keys], arguments.length);
+ this[kPopulateParserHintArray]('skipValidation', keys);
+ return this;
+ }
+ strict(enabled) {
+ argsert('[boolean]', [enabled], arguments.length);
+ __classPrivateFieldSet(this, _YargsInstance_strict, enabled !== false, "f");
+ return this;
+ }
+ strictCommands(enabled) {
+ argsert('[boolean]', [enabled], arguments.length);
+ __classPrivateFieldSet(this, _YargsInstance_strictCommands, enabled !== false, "f");
+ return this;
+ }
+ strictOptions(enabled) {
+ argsert('[boolean]', [enabled], arguments.length);
+ __classPrivateFieldSet(this, _YargsInstance_strictOptions, enabled !== false, "f");
+ return this;
+ }
+ string(keys) {
+ argsert('<array|string>', [keys], arguments.length);
+ this[kPopulateParserHintArray]('string', keys);
+ this[kTrackManuallySetKeys](keys);
+ return this;
+ }
+ terminalWidth() {
+ argsert([], 0);
+ return __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.stdColumns;
+ }
+ updateLocale(obj) {
+ return this.updateStrings(obj);
+ }
+ updateStrings(obj) {
+ argsert('<object>', [obj], arguments.length);
+ __classPrivateFieldSet(this, _YargsInstance_detectLocale, false, "f");
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.updateLocale(obj);
+ return this;
+ }
+ usage(msg, description, builder, handler) {
+ argsert('<string|null|undefined> [string|boolean] [function|object] [function]', [msg, description, builder, handler], arguments.length);
+ if (description !== undefined) {
+ assertNotStrictEqual(msg, null, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
+ if ((msg || '').match(/^\$0( |$)/)) {
+ return this.command(msg, description, builder, handler);
+ }
+ else {
+ throw new YError('.usage() description must start with $0 if being used as alias for .command()');
+ }
+ }
+ else {
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").usage(msg);
+ return this;
+ }
+ }
+ usageConfiguration(config) {
+ argsert('<object>', [config], arguments.length);
+ __classPrivateFieldSet(this, _YargsInstance_usageConfig, config, "f");
+ return this;
+ }
+ version(opt, msg, ver) {
+ const defaultVersionOpt = 'version';
+ argsert('[boolean|string] [string] [string]', [opt, msg, ver], arguments.length);
+ if (__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f")) {
+ this[kDeleteFromParserHintObject](__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"));
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(undefined);
+ __classPrivateFieldSet(this, _YargsInstance_versionOpt, null, "f");
+ }
+ if (arguments.length === 0) {
+ ver = this[kGuessVersion]();
+ opt = defaultVersionOpt;
+ }
+ else if (arguments.length === 1) {
+ if (opt === false) {
+ return this;
+ }
+ ver = opt;
+ opt = defaultVersionOpt;
+ }
+ else if (arguments.length === 2) {
+ ver = msg;
+ msg = undefined;
+ }
+ __classPrivateFieldSet(this, _YargsInstance_versionOpt, typeof opt === 'string' ? opt : defaultVersionOpt, "f");
+ msg = msg || __classPrivateFieldGet(this, _YargsInstance_usage, "f").deferY18nLookup('Show version number');
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").version(ver || undefined);
+ this.boolean(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"));
+ this.describe(__classPrivateFieldGet(this, _YargsInstance_versionOpt, "f"), msg);
+ return this;
+ }
+ wrap(cols) {
+ argsert('<number|null|undefined>', [cols], arguments.length);
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").wrap(cols);
+ return this;
+ }
+ [(_YargsInstance_command = new WeakMap(), _YargsInstance_cwd = new WeakMap(), _YargsInstance_context = new WeakMap(), _YargsInstance_completion = new WeakMap(), _YargsInstance_completionCommand = new WeakMap(), _YargsInstance_defaultShowHiddenOpt = new WeakMap(), _YargsInstance_exitError = new WeakMap(), _YargsInstance_detectLocale = new WeakMap(), _YargsInstance_emittedWarnings = new WeakMap(), _YargsInstance_exitProcess = new WeakMap(), _YargsInstance_frozens = new WeakMap(), _YargsInstance_globalMiddleware = new WeakMap(), _YargsInstance_groups = new WeakMap(), _YargsInstance_hasOutput = new WeakMap(), _YargsInstance_helpOpt = new WeakMap(), _YargsInstance_isGlobalContext = new WeakMap(), _YargsInstance_logger = new WeakMap(), _YargsInstance_output = new WeakMap(), _YargsInstance_options = new WeakMap(), _YargsInstance_parentRequire = new WeakMap(), _YargsInstance_parserConfig = new WeakMap(), _YargsInstance_parseFn = new WeakMap(), _YargsInstance_parseContext = new WeakMap(), _YargsInstance_pkgs = new WeakMap(), _YargsInstance_preservedGroups = new WeakMap(), _YargsInstance_processArgs = new WeakMap(), _YargsInstance_recommendCommands = new WeakMap(), _YargsInstance_shim = new WeakMap(), _YargsInstance_strict = new WeakMap(), _YargsInstance_strictCommands = new WeakMap(), _YargsInstance_strictOptions = new WeakMap(), _YargsInstance_usage = new WeakMap(), _YargsInstance_usageConfig = new WeakMap(), _YargsInstance_versionOpt = new WeakMap(), _YargsInstance_validation = new WeakMap(), kCopyDoubleDash)](argv) {
+ if (!argv._ || !argv['--'])
+ return argv;
+ argv._.push.apply(argv._, argv['--']);
+ try {
+ delete argv['--'];
+ }
+ catch (_err) { }
+ return argv;
+ }
+ [kCreateLogger]() {
+ return {
+ log: (...args) => {
+ if (!this[kHasParseCallback]())
+ console.log(...args);
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
+ if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length)
+ __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + '\n', "f");
+ __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(' '), "f");
+ },
+ error: (...args) => {
+ if (!this[kHasParseCallback]())
+ console.error(...args);
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
+ if (__classPrivateFieldGet(this, _YargsInstance_output, "f").length)
+ __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + '\n', "f");
+ __classPrivateFieldSet(this, _YargsInstance_output, __classPrivateFieldGet(this, _YargsInstance_output, "f") + args.join(' '), "f");
+ },
+ };
+ }
+ [kDeleteFromParserHintObject](optionKey) {
+ objectKeys(__classPrivateFieldGet(this, _YargsInstance_options, "f")).forEach((hintKey) => {
+ if (((key) => key === 'configObjects')(hintKey))
+ return;
+ const hint = __classPrivateFieldGet(this, _YargsInstance_options, "f")[hintKey];
+ if (Array.isArray(hint)) {
+ if (hint.includes(optionKey))
+ hint.splice(hint.indexOf(optionKey), 1);
+ }
+ else if (typeof hint === 'object') {
+ delete hint[optionKey];
+ }
+ });
+ delete __classPrivateFieldGet(this, _YargsInstance_usage, "f").getDescriptions()[optionKey];
+ }
+ [kEmitWarning](warning, type, deduplicationId) {
+ if (!__classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId]) {
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.emitWarning(warning, type);
+ __classPrivateFieldGet(this, _YargsInstance_emittedWarnings, "f")[deduplicationId] = true;
+ }
+ }
+ [kFreeze]() {
+ __classPrivateFieldGet(this, _YargsInstance_frozens, "f").push({
+ options: __classPrivateFieldGet(this, _YargsInstance_options, "f"),
+ configObjects: __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects.slice(0),
+ exitProcess: __classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"),
+ groups: __classPrivateFieldGet(this, _YargsInstance_groups, "f"),
+ strict: __classPrivateFieldGet(this, _YargsInstance_strict, "f"),
+ strictCommands: __classPrivateFieldGet(this, _YargsInstance_strictCommands, "f"),
+ strictOptions: __classPrivateFieldGet(this, _YargsInstance_strictOptions, "f"),
+ completionCommand: __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f"),
+ output: __classPrivateFieldGet(this, _YargsInstance_output, "f"),
+ exitError: __classPrivateFieldGet(this, _YargsInstance_exitError, "f"),
+ hasOutput: __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f"),
+ parsed: this.parsed,
+ parseFn: __classPrivateFieldGet(this, _YargsInstance_parseFn, "f"),
+ parseContext: __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"),
+ });
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").freeze();
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").freeze();
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").freeze();
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").freeze();
+ }
+ [kGetDollarZero]() {
+ let $0 = '';
+ let default$0;
+ if (/\b(node|iojs|electron)(\.exe)?$/.test(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv()[0])) {
+ default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(1, 2);
+ }
+ else {
+ default$0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f").process.argv().slice(0, 1);
+ }
+ $0 = default$0
+ .map(x => {
+ const b = this[kRebase](__classPrivateFieldGet(this, _YargsInstance_cwd, "f"), x);
+ return x.match(/^(\/|([a-zA-Z]:)?\\)/) && b.length < x.length ? b : x;
+ })
+ .join(' ')
+ .trim();
+ if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('_') &&
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").getProcessArgvBin() === __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('_')) {
+ $0 = __classPrivateFieldGet(this, _YargsInstance_shim, "f")
+ .getEnv('_')
+ .replace(`${__classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(__classPrivateFieldGet(this, _YargsInstance_shim, "f").process.execPath())}/`, '');
+ }
+ return $0;
+ }
+ [kGetParserConfiguration]() {
+ return __classPrivateFieldGet(this, _YargsInstance_parserConfig, "f");
+ }
+ [kGetUsageConfiguration]() {
+ return __classPrivateFieldGet(this, _YargsInstance_usageConfig, "f");
+ }
+ [kGuessLocale]() {
+ if (!__classPrivateFieldGet(this, _YargsInstance_detectLocale, "f"))
+ return;
+ const locale = __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LC_ALL') ||
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LC_MESSAGES') ||
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LANG') ||
+ __classPrivateFieldGet(this, _YargsInstance_shim, "f").getEnv('LANGUAGE') ||
+ 'en_US';
+ this.locale(locale.replace(/[.:].*/, ''));
+ }
+ [kGuessVersion]() {
+ const obj = this[kPkgUp]();
+ return obj.version || 'unknown';
+ }
+ [kParsePositionalNumbers](argv) {
+ const args = argv['--'] ? argv['--'] : argv._;
+ for (let i = 0, arg; (arg = args[i]) !== undefined; i++) {
+ if (__classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.looksLikeNumber(arg) &&
+ Number.isSafeInteger(Math.floor(parseFloat(`${arg}`)))) {
+ args[i] = Number(arg);
+ }
+ }
+ return argv;
+ }
+ [kPkgUp](rootPath) {
+ const npath = rootPath || '*';
+ if (__classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath])
+ return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath];
+ let obj = {};
+ try {
+ let startDir = rootPath || __classPrivateFieldGet(this, _YargsInstance_shim, "f").mainFilename;
+ if (!rootPath && __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.extname(startDir)) {
+ startDir = __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.dirname(startDir);
+ }
+ const pkgJsonPath = __classPrivateFieldGet(this, _YargsInstance_shim, "f").findUp(startDir, (dir, names) => {
+ if (names.includes('package.json')) {
+ return 'package.json';
+ }
+ else {
+ return undefined;
+ }
+ });
+ assertNotStrictEqual(pkgJsonPath, undefined, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
+ obj = JSON.parse(__classPrivateFieldGet(this, _YargsInstance_shim, "f").readFileSync(pkgJsonPath, 'utf8'));
+ }
+ catch (_noop) { }
+ __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath] = obj || {};
+ return __classPrivateFieldGet(this, _YargsInstance_pkgs, "f")[npath];
+ }
+ [kPopulateParserHintArray](type, keys) {
+ keys = [].concat(keys);
+ keys.forEach(key => {
+ key = this[kSanitizeKey](key);
+ __classPrivateFieldGet(this, _YargsInstance_options, "f")[type].push(key);
+ });
+ }
+ [kPopulateParserHintSingleValueDictionary](builder, type, key, value) {
+ this[kPopulateParserHintDictionary](builder, type, key, value, (type, key, value) => {
+ __classPrivateFieldGet(this, _YargsInstance_options, "f")[type][key] = value;
+ });
+ }
+ [kPopulateParserHintArrayDictionary](builder, type, key, value) {
+ this[kPopulateParserHintDictionary](builder, type, key, value, (type, key, value) => {
+ __classPrivateFieldGet(this, _YargsInstance_options, "f")[type][key] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[type][key] || []).concat(value);
+ });
+ }
+ [kPopulateParserHintDictionary](builder, type, key, value, singleKeyHandler) {
+ if (Array.isArray(key)) {
+ key.forEach(k => {
+ builder(k, value);
+ });
+ }
+ else if (((key) => typeof key === 'object')(key)) {
+ for (const k of objectKeys(key)) {
+ builder(k, key[k]);
+ }
+ }
+ else {
+ singleKeyHandler(type, this[kSanitizeKey](key), value);
+ }
+ }
+ [kSanitizeKey](key) {
+ if (key === '__proto__')
+ return '___proto___';
+ return key;
+ }
+ [kSetKey](key, set) {
+ this[kPopulateParserHintSingleValueDictionary](this[kSetKey].bind(this), 'key', key, set);
+ return this;
+ }
+ [kUnfreeze]() {
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
+ const frozen = __classPrivateFieldGet(this, _YargsInstance_frozens, "f").pop();
+ assertNotStrictEqual(frozen, undefined, __classPrivateFieldGet(this, _YargsInstance_shim, "f"));
+ let configObjects;
+ (_a = this, _b = this, _c = this, _d = this, _e = this, _f = this, _g = this, _h = this, _j = this, _k = this, _l = this, _m = this, {
+ options: ({ set value(_o) { __classPrivateFieldSet(_a, _YargsInstance_options, _o, "f"); } }).value,
+ configObjects,
+ exitProcess: ({ set value(_o) { __classPrivateFieldSet(_b, _YargsInstance_exitProcess, _o, "f"); } }).value,
+ groups: ({ set value(_o) { __classPrivateFieldSet(_c, _YargsInstance_groups, _o, "f"); } }).value,
+ output: ({ set value(_o) { __classPrivateFieldSet(_d, _YargsInstance_output, _o, "f"); } }).value,
+ exitError: ({ set value(_o) { __classPrivateFieldSet(_e, _YargsInstance_exitError, _o, "f"); } }).value,
+ hasOutput: ({ set value(_o) { __classPrivateFieldSet(_f, _YargsInstance_hasOutput, _o, "f"); } }).value,
+ parsed: this.parsed,
+ strict: ({ set value(_o) { __classPrivateFieldSet(_g, _YargsInstance_strict, _o, "f"); } }).value,
+ strictCommands: ({ set value(_o) { __classPrivateFieldSet(_h, _YargsInstance_strictCommands, _o, "f"); } }).value,
+ strictOptions: ({ set value(_o) { __classPrivateFieldSet(_j, _YargsInstance_strictOptions, _o, "f"); } }).value,
+ completionCommand: ({ set value(_o) { __classPrivateFieldSet(_k, _YargsInstance_completionCommand, _o, "f"); } }).value,
+ parseFn: ({ set value(_o) { __classPrivateFieldSet(_l, _YargsInstance_parseFn, _o, "f"); } }).value,
+ parseContext: ({ set value(_o) { __classPrivateFieldSet(_m, _YargsInstance_parseContext, _o, "f"); } }).value,
+ } = frozen);
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects = configObjects;
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").unfreeze();
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").unfreeze();
+ __classPrivateFieldGet(this, _YargsInstance_command, "f").unfreeze();
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").unfreeze();
+ }
+ [kValidateAsync](validation, argv) {
+ return maybeAsyncResult(argv, result => {
+ validation(result);
+ return result;
+ });
+ }
+ getInternalMethods() {
+ return {
+ getCommandInstance: this[kGetCommandInstance].bind(this),
+ getContext: this[kGetContext].bind(this),
+ getHasOutput: this[kGetHasOutput].bind(this),
+ getLoggerInstance: this[kGetLoggerInstance].bind(this),
+ getParseContext: this[kGetParseContext].bind(this),
+ getParserConfiguration: this[kGetParserConfiguration].bind(this),
+ getUsageConfiguration: this[kGetUsageConfiguration].bind(this),
+ getUsageInstance: this[kGetUsageInstance].bind(this),
+ getValidationInstance: this[kGetValidationInstance].bind(this),
+ hasParseCallback: this[kHasParseCallback].bind(this),
+ isGlobalContext: this[kIsGlobalContext].bind(this),
+ postProcess: this[kPostProcess].bind(this),
+ reset: this[kReset].bind(this),
+ runValidation: this[kRunValidation].bind(this),
+ runYargsParserAndExecuteCommands: this[kRunYargsParserAndExecuteCommands].bind(this),
+ setHasOutput: this[kSetHasOutput].bind(this),
+ };
+ }
+ [kGetCommandInstance]() {
+ return __classPrivateFieldGet(this, _YargsInstance_command, "f");
+ }
+ [kGetContext]() {
+ return __classPrivateFieldGet(this, _YargsInstance_context, "f");
+ }
+ [kGetHasOutput]() {
+ return __classPrivateFieldGet(this, _YargsInstance_hasOutput, "f");
+ }
+ [kGetLoggerInstance]() {
+ return __classPrivateFieldGet(this, _YargsInstance_logger, "f");
+ }
+ [kGetParseContext]() {
+ return __classPrivateFieldGet(this, _YargsInstance_parseContext, "f") || {};
+ }
+ [kGetUsageInstance]() {
+ return __classPrivateFieldGet(this, _YargsInstance_usage, "f");
+ }
+ [kGetValidationInstance]() {
+ return __classPrivateFieldGet(this, _YargsInstance_validation, "f");
+ }
+ [kHasParseCallback]() {
+ return !!__classPrivateFieldGet(this, _YargsInstance_parseFn, "f");
+ }
+ [kIsGlobalContext]() {
+ return __classPrivateFieldGet(this, _YargsInstance_isGlobalContext, "f");
+ }
+ [kPostProcess](argv, populateDoubleDash, calledFromCommand, runGlobalMiddleware) {
+ if (calledFromCommand)
+ return argv;
+ if (isPromise(argv))
+ return argv;
+ if (!populateDoubleDash) {
+ argv = this[kCopyDoubleDash](argv);
+ }
+ const parsePositionalNumbers = this[kGetParserConfiguration]()['parse-positional-numbers'] ||
+ this[kGetParserConfiguration]()['parse-positional-numbers'] === undefined;
+ if (parsePositionalNumbers) {
+ argv = this[kParsePositionalNumbers](argv);
+ }
+ if (runGlobalMiddleware) {
+ argv = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
+ }
+ return argv;
+ }
+ [kReset](aliases = {}) {
+ __classPrivateFieldSet(this, _YargsInstance_options, __classPrivateFieldGet(this, _YargsInstance_options, "f") || {}, "f");
+ const tmpOptions = {};
+ tmpOptions.local = __classPrivateFieldGet(this, _YargsInstance_options, "f").local || [];
+ tmpOptions.configObjects = __classPrivateFieldGet(this, _YargsInstance_options, "f").configObjects || [];
+ const localLookup = {};
+ tmpOptions.local.forEach(l => {
+ localLookup[l] = true;
+ (aliases[l] || []).forEach(a => {
+ localLookup[a] = true;
+ });
+ });
+ Object.assign(__classPrivateFieldGet(this, _YargsInstance_preservedGroups, "f"), Object.keys(__classPrivateFieldGet(this, _YargsInstance_groups, "f")).reduce((acc, groupName) => {
+ const keys = __classPrivateFieldGet(this, _YargsInstance_groups, "f")[groupName].filter(key => !(key in localLookup));
+ if (keys.length > 0) {
+ acc[groupName] = keys;
+ }
+ return acc;
+ }, {}));
+ __classPrivateFieldSet(this, _YargsInstance_groups, {}, "f");
+ const arrayOptions = [
+ 'array',
+ 'boolean',
+ 'string',
+ 'skipValidation',
+ 'count',
+ 'normalize',
+ 'number',
+ 'hiddenOptions',
+ ];
+ const objectOptions = [
+ 'narg',
+ 'key',
+ 'alias',
+ 'default',
+ 'defaultDescription',
+ 'config',
+ 'choices',
+ 'demandedOptions',
+ 'demandedCommands',
+ 'deprecatedOptions',
+ ];
+ arrayOptions.forEach(k => {
+ tmpOptions[k] = (__classPrivateFieldGet(this, _YargsInstance_options, "f")[k] || []).filter((k) => !localLookup[k]);
+ });
+ objectOptions.forEach((k) => {
+ tmpOptions[k] = objFilter(__classPrivateFieldGet(this, _YargsInstance_options, "f")[k], k => !localLookup[k]);
+ });
+ tmpOptions.envPrefix = __classPrivateFieldGet(this, _YargsInstance_options, "f").envPrefix;
+ __classPrivateFieldSet(this, _YargsInstance_options, tmpOptions, "f");
+ __classPrivateFieldSet(this, _YargsInstance_usage, __classPrivateFieldGet(this, _YargsInstance_usage, "f")
+ ? __classPrivateFieldGet(this, _YargsInstance_usage, "f").reset(localLookup)
+ : Usage(this, __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
+ __classPrivateFieldSet(this, _YargsInstance_validation, __classPrivateFieldGet(this, _YargsInstance_validation, "f")
+ ? __classPrivateFieldGet(this, _YargsInstance_validation, "f").reset(localLookup)
+ : Validation(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
+ __classPrivateFieldSet(this, _YargsInstance_command, __classPrivateFieldGet(this, _YargsInstance_command, "f")
+ ? __classPrivateFieldGet(this, _YargsInstance_command, "f").reset()
+ : Command(__classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_validation, "f"), __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
+ if (!__classPrivateFieldGet(this, _YargsInstance_completion, "f"))
+ __classPrivateFieldSet(this, _YargsInstance_completion, Completion(this, __classPrivateFieldGet(this, _YargsInstance_usage, "f"), __classPrivateFieldGet(this, _YargsInstance_command, "f"), __classPrivateFieldGet(this, _YargsInstance_shim, "f")), "f");
+ __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").reset();
+ __classPrivateFieldSet(this, _YargsInstance_completionCommand, null, "f");
+ __classPrivateFieldSet(this, _YargsInstance_output, '', "f");
+ __classPrivateFieldSet(this, _YargsInstance_exitError, null, "f");
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, false, "f");
+ this.parsed = false;
+ return this;
+ }
+ [kRebase](base, dir) {
+ return __classPrivateFieldGet(this, _YargsInstance_shim, "f").path.relative(base, dir);
+ }
+ [kRunYargsParserAndExecuteCommands](args, shortCircuit, calledFromCommand, commandIndex = 0, helpOnly = false) {
+ let skipValidation = !!calledFromCommand || helpOnly;
+ args = args || __classPrivateFieldGet(this, _YargsInstance_processArgs, "f");
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
+ const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration['populate--'];
+ const config = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
+ 'populate--': true,
+ });
+ const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
+ configuration: { 'parse-positional-numbers': false, ...config },
+ }));
+ const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
+ let argvPromise = undefined;
+ const aliases = parsed.aliases;
+ let helpOptSet = false;
+ let versionOptSet = false;
+ Object.keys(argv).forEach(key => {
+ if (key === __classPrivateFieldGet(this, _YargsInstance_helpOpt, "f") && argv[key]) {
+ helpOptSet = true;
+ }
+ else if (key === __classPrivateFieldGet(this, _YargsInstance_versionOpt, "f") && argv[key]) {
+ versionOptSet = true;
+ }
+ });
+ argv.$0 = this.$0;
+ this.parsed = parsed;
+ if (commandIndex === 0) {
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").clearCachedHelpMessage();
+ }
+ try {
+ this[kGuessLocale]();
+ if (shortCircuit) {
+ return this[kPostProcess](argv, populateDoubleDash, !!calledFromCommand, false);
+ }
+ if (__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")) {
+ const helpCmds = [__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")]
+ .concat(aliases[__classPrivateFieldGet(this, _YargsInstance_helpOpt, "f")] || [])
+ .filter(k => k.length > 1);
+ if (helpCmds.includes('' + argv._[argv._.length - 1])) {
+ argv._.pop();
+ helpOptSet = true;
+ }
+ }
+ __classPrivateFieldSet(this, _YargsInstance_isGlobalContext, false, "f");
+ const handlerKeys = __classPrivateFieldGet(this, _YargsInstance_command, "f").getCommands();
+ const requestCompletions = __classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey in argv;
+ const skipRecommendation = helpOptSet || requestCompletions || helpOnly;
+ if (argv._.length) {
+ if (handlerKeys.length) {
+ let firstUnknownCommand;
+ for (let i = commandIndex || 0, cmd; argv._[i] !== undefined; i++) {
+ cmd = String(argv._[i]);
+ if (handlerKeys.includes(cmd) && cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) {
+ const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(cmd, this, parsed, i + 1, helpOnly, helpOptSet || versionOptSet || helpOnly);
+ return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
+ }
+ else if (!firstUnknownCommand &&
+ cmd !== __classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) {
+ firstUnknownCommand = cmd;
+ break;
+ }
+ }
+ if (!__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() &&
+ __classPrivateFieldGet(this, _YargsInstance_recommendCommands, "f") &&
+ firstUnknownCommand &&
+ !skipRecommendation) {
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").recommendCommands(firstUnknownCommand, handlerKeys);
+ }
+ }
+ if (__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f") &&
+ argv._.includes(__classPrivateFieldGet(this, _YargsInstance_completionCommand, "f")) &&
+ !requestCompletions) {
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"))
+ setBlocking(true);
+ this.showCompletionScript();
+ this.exit(0);
+ }
+ }
+ if (__classPrivateFieldGet(this, _YargsInstance_command, "f").hasDefaultCommand() && !skipRecommendation) {
+ const innerArgv = __classPrivateFieldGet(this, _YargsInstance_command, "f").runCommand(null, this, parsed, 0, helpOnly, helpOptSet || versionOptSet || helpOnly);
+ return this[kPostProcess](innerArgv, populateDoubleDash, !!calledFromCommand, false);
+ }
+ if (requestCompletions) {
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"))
+ setBlocking(true);
+ args = [].concat(args);
+ const completionArgs = args.slice(args.indexOf(`--${__classPrivateFieldGet(this, _YargsInstance_completion, "f").completionKey}`) + 1);
+ __classPrivateFieldGet(this, _YargsInstance_completion, "f").getCompletion(completionArgs, (err, completions) => {
+ if (err)
+ throw new YError(err.message);
+ (completions || []).forEach(completion => {
+ __classPrivateFieldGet(this, _YargsInstance_logger, "f").log(completion);
+ });
+ this.exit(0);
+ });
+ return this[kPostProcess](argv, !populateDoubleDash, !!calledFromCommand, false);
+ }
+ if (!__classPrivateFieldGet(this, _YargsInstance_hasOutput, "f")) {
+ if (helpOptSet) {
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"))
+ setBlocking(true);
+ skipValidation = true;
+ this.showHelp('log');
+ this.exit(0);
+ }
+ else if (versionOptSet) {
+ if (__classPrivateFieldGet(this, _YargsInstance_exitProcess, "f"))
+ setBlocking(true);
+ skipValidation = true;
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").showVersion('log');
+ this.exit(0);
+ }
+ }
+ if (!skipValidation && __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.length > 0) {
+ skipValidation = Object.keys(argv).some(key => __classPrivateFieldGet(this, _YargsInstance_options, "f").skipValidation.indexOf(key) >= 0 && argv[key] === true);
+ }
+ if (!skipValidation) {
+ if (parsed.error)
+ throw new YError(parsed.error.message);
+ if (!requestCompletions) {
+ const validation = this[kRunValidation](aliases, {}, parsed.error);
+ if (!calledFromCommand) {
+ argvPromise = applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), true);
+ }
+ argvPromise = this[kValidateAsync](validation, argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv);
+ if (isPromise(argvPromise) && !calledFromCommand) {
+ argvPromise = argvPromise.then(() => {
+ return applyMiddleware(argv, this, __classPrivateFieldGet(this, _YargsInstance_globalMiddleware, "f").getMiddleware(), false);
+ });
+ }
+ }
+ }
+ }
+ catch (err) {
+ if (err instanceof YError)
+ __classPrivateFieldGet(this, _YargsInstance_usage, "f").fail(err.message, err);
+ else
+ throw err;
+ }
+ return this[kPostProcess](argvPromise !== null && argvPromise !== void 0 ? argvPromise : argv, populateDoubleDash, !!calledFromCommand, true);
+ }
+ [kRunValidation](aliases, positionalMap, parseErrors, isDefaultCommand) {
+ const demandedOptions = { ...this.getDemandedOptions() };
+ return (argv) => {
+ if (parseErrors)
+ throw new YError(parseErrors.message);
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").nonOptionCount(argv);
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").requiredArguments(argv, demandedOptions);
+ let failedStrictCommands = false;
+ if (__classPrivateFieldGet(this, _YargsInstance_strictCommands, "f")) {
+ failedStrictCommands = __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownCommands(argv);
+ }
+ if (__classPrivateFieldGet(this, _YargsInstance_strict, "f") && !failedStrictCommands) {
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, positionalMap, !!isDefaultCommand);
+ }
+ else if (__classPrivateFieldGet(this, _YargsInstance_strictOptions, "f")) {
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").unknownArguments(argv, aliases, {}, false, false);
+ }
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").limitedChoices(argv);
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").implications(argv);
+ __classPrivateFieldGet(this, _YargsInstance_validation, "f").conflicting(argv);
+ };
+ }
+ [kSetHasOutput]() {
+ __classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
+ }
+ [kTrackManuallySetKeys](keys) {
+ if (typeof keys === 'string') {
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").key[keys] = true;
+ }
+ else {
+ for (const k of keys) {
+ __classPrivateFieldGet(this, _YargsInstance_options, "f").key[k] = true;
+ }
+ }
+ }
+}
+export function isYargsInstance(y) {
+ return !!y && typeof y.getInternalMethods === 'function';
+}
diff --git a/node_modules/yargs/build/lib/yerror.js b/node_modules/yargs/build/lib/yerror.js
new file mode 100644
index 0000000..7a36684
--- /dev/null
+++ b/node_modules/yargs/build/lib/yerror.js
@@ -0,0 +1,9 @@
+export class YError extends Error {
+ constructor(msg) {
+ super(msg || 'yargs error');
+ this.name = 'YError';
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, YError);
+ }
+ }
+}
diff --git a/node_modules/yargs/helpers/helpers.mjs b/node_modules/yargs/helpers/helpers.mjs
new file mode 100644
index 0000000..3f96b3d
--- /dev/null
+++ b/node_modules/yargs/helpers/helpers.mjs
@@ -0,0 +1,10 @@
+import {applyExtends as _applyExtends} from '../build/lib/utils/apply-extends.js';
+import {hideBin} from '../build/lib/utils/process-argv.js';
+import Parser from 'yargs-parser';
+import shim from '../lib/platform-shims/esm.mjs';
+
+const applyExtends = (config, cwd, mergeExtends) => {
+ return _applyExtends(config, cwd, mergeExtends, shim);
+};
+
+export {applyExtends, hideBin, Parser};
diff --git a/node_modules/yargs/helpers/index.js b/node_modules/yargs/helpers/index.js
new file mode 100644
index 0000000..8ab79a3
--- /dev/null
+++ b/node_modules/yargs/helpers/index.js
@@ -0,0 +1,14 @@
+const {
+ applyExtends,
+ cjsPlatformShim,
+ Parser,
+ processArgv,
+} = require('../build/index.cjs');
+
+module.exports = {
+ applyExtends: (config, cwd, mergeExtends) => {
+ return applyExtends(config, cwd, mergeExtends, cjsPlatformShim);
+ },
+ hideBin: processArgv.hideBin,
+ Parser,
+};
diff --git a/node_modules/yargs/helpers/package.json b/node_modules/yargs/helpers/package.json
new file mode 100644
index 0000000..5bbefff
--- /dev/null
+++ b/node_modules/yargs/helpers/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "commonjs"
+}
diff --git a/node_modules/yargs/index.cjs b/node_modules/yargs/index.cjs
new file mode 100644
index 0000000..d1eee82
--- /dev/null
+++ b/node_modules/yargs/index.cjs
@@ -0,0 +1,53 @@
+'use strict';
+// classic singleton yargs API, to use yargs
+// without running as a singleton do:
+// require('yargs/yargs')(process.argv.slice(2))
+const {Yargs, processArgv} = require('./build/index.cjs');
+
+Argv(processArgv.hideBin(process.argv));
+
+module.exports = Argv;
+
+function Argv(processArgs, cwd) {
+ const argv = Yargs(processArgs, cwd, require);
+ singletonify(argv);
+ // TODO(bcoe): warn if argv.parse() or argv.argv is used directly.
+ return argv;
+}
+
+function defineGetter(obj, key, getter) {
+ Object.defineProperty(obj, key, {
+ configurable: true,
+ enumerable: true,
+ get: getter,
+ });
+}
+function lookupGetter(obj, key) {
+ const desc = Object.getOwnPropertyDescriptor(obj, key);
+ if (typeof desc !== 'undefined') {
+ return desc.get;
+ }
+}
+
+/* Hack an instance of Argv with process.argv into Argv
+ so people can do
+ require('yargs')(['--beeble=1','-z','zizzle']).argv
+ to parse a list of args and
+ require('yargs').argv
+ to get a parsed version of process.argv.
+*/
+function singletonify(inst) {
+ [
+ ...Object.keys(inst),
+ ...Object.getOwnPropertyNames(inst.constructor.prototype),
+ ].forEach(key => {
+ if (key === 'argv') {
+ defineGetter(Argv, key, lookupGetter(inst, key));
+ } else if (typeof inst[key] === 'function') {
+ Argv[key] = inst[key].bind(inst);
+ } else {
+ defineGetter(Argv, '$0', () => inst.$0);
+ defineGetter(Argv, 'parsed', () => inst.parsed);
+ }
+ });
+}
diff --git a/node_modules/yargs/index.mjs b/node_modules/yargs/index.mjs
new file mode 100644
index 0000000..c6440b9
--- /dev/null
+++ b/node_modules/yargs/index.mjs
@@ -0,0 +1,8 @@
+'use strict';
+
+// Bootstraps yargs for ESM:
+import esmPlatformShim from './lib/platform-shims/esm.mjs';
+import {YargsFactory} from './build/lib/yargs-factory.js';
+
+const Yargs = YargsFactory(esmPlatformShim);
+export default Yargs;
diff --git a/node_modules/yargs/lib/platform-shims/browser.mjs b/node_modules/yargs/lib/platform-shims/browser.mjs
new file mode 100644
index 0000000..5f8ec61
--- /dev/null
+++ b/node_modules/yargs/lib/platform-shims/browser.mjs
@@ -0,0 +1,95 @@
+/* eslint-disable no-unused-vars */
+'use strict';
+
+import cliui from 'https://unpkg.com/cliui@7.0.1/index.mjs'; // eslint-disable-line
+import Parser from 'https://unpkg.com/yargs-parser@19.0.0/browser.js'; // eslint-disable-line
+import {getProcessArgvBin} from '../../build/lib/utils/process-argv.js';
+import {YError} from '../../build/lib/yerror.js';
+
+const REQUIRE_ERROR = 'require is not supported in browser';
+const REQUIRE_DIRECTORY_ERROR =
+ 'loading a directory of commands is not supported in browser';
+
+export default {
+ assert: {
+ notStrictEqual: (a, b) => {
+ // noop.
+ },
+ strictEqual: (a, b) => {
+ // noop.
+ },
+ },
+ cliui,
+ findUp: () => undefined,
+ getEnv: key => {
+ // There is no environment in browser:
+ return undefined;
+ },
+ inspect: console.log,
+ getCallerFile: () => {
+ throw new YError(REQUIRE_DIRECTORY_ERROR);
+ },
+ getProcessArgvBin,
+ mainFilename: 'yargs',
+ Parser,
+ path: {
+ basename: str => str,
+ dirname: str => str,
+ extname: str => str,
+ relative: str => str,
+ },
+ process: {
+ argv: () => [],
+ cwd: () => '',
+ emitWarning: (warning, name) => {},
+ execPath: () => '',
+ // exit is noop browser:
+ exit: () => {},
+ nextTick: cb => {
+ // eslint-disable-next-line no-undef
+ window.setTimeout(cb, 1);
+ },
+ stdColumns: 80,
+ },
+ readFileSync: () => {
+ return '';
+ },
+ require: () => {
+ throw new YError(REQUIRE_ERROR);
+ },
+ requireDirectory: () => {
+ throw new YError(REQUIRE_DIRECTORY_ERROR);
+ },
+ stringWidth: str => {
+ return [...str].length;
+ },
+ // TODO: replace this with y18n once it's ported to ESM:
+ y18n: {
+ __: (...str) => {
+ if (str.length === 0) return '';
+ const args = str.slice(1);
+ return sprintf(str[0], ...args);
+ },
+ __n: (str1, str2, count, ...args) => {
+ if (count === 1) {
+ return sprintf(str1, ...args);
+ } else {
+ return sprintf(str2, ...args);
+ }
+ },
+ getLocale: () => {
+ return 'en_US';
+ },
+ setLocale: () => {},
+ updateLocale: () => {},
+ },
+};
+
+function sprintf(_str, ...args) {
+ let str = '';
+ const split = _str.split('%s');
+ split.forEach((token, i) => {
+ str += `${token}${split[i + 1] !== undefined && args[i] ? args[i] : ''}`;
+ });
+ return str;
+}
diff --git a/node_modules/yargs/lib/platform-shims/esm.mjs b/node_modules/yargs/lib/platform-shims/esm.mjs
new file mode 100644
index 0000000..c25baa5
--- /dev/null
+++ b/node_modules/yargs/lib/platform-shims/esm.mjs
@@ -0,0 +1,73 @@
+'use strict'
+
+import { notStrictEqual, strictEqual } from 'assert'
+import cliui from 'cliui'
+import escalade from 'escalade/sync'
+import { inspect } from 'util'
+import { readFileSync } from 'fs'
+import { fileURLToPath } from 'url';
+import Parser from 'yargs-parser'
+import { basename, dirname, extname, relative, resolve } from 'path'
+import { getProcessArgvBin } from '../../build/lib/utils/process-argv.js'
+import { YError } from '../../build/lib/yerror.js'
+import y18n from 'y18n'
+
+const REQUIRE_ERROR = 'require is not supported by ESM'
+const REQUIRE_DIRECTORY_ERROR = 'loading a directory of commands is not supported yet for ESM'
+
+let __dirname;
+try {
+ __dirname = fileURLToPath(import.meta.url);
+} catch (e) {
+ __dirname = process.cwd();
+}
+const mainFilename = __dirname.substring(0, __dirname.lastIndexOf('node_modules'));
+
+export default {
+ assert: {
+ notStrictEqual,
+ strictEqual
+ },
+ cliui,
+ findUp: escalade,
+ getEnv: (key) => {
+ return process.env[key]
+ },
+ inspect,
+ getCallerFile: () => {
+ throw new YError(REQUIRE_DIRECTORY_ERROR)
+ },
+ getProcessArgvBin,
+ mainFilename: mainFilename || process.cwd(),
+ Parser,
+ path: {
+ basename,
+ dirname,
+ extname,
+ relative,
+ resolve
+ },
+ process: {
+ argv: () => process.argv,
+ cwd: process.cwd,
+ emitWarning: (warning, type) => process.emitWarning(warning, type),
+ execPath: () => process.execPath,
+ exit: process.exit,
+ nextTick: process.nextTick,
+ stdColumns: typeof process.stdout.columns !== 'undefined' ? process.stdout.columns : null
+ },
+ readFileSync,
+ require: () => {
+ throw new YError(REQUIRE_ERROR)
+ },
+ requireDirectory: () => {
+ throw new YError(REQUIRE_DIRECTORY_ERROR)
+ },
+ stringWidth: (str) => {
+ return [...str].length
+ },
+ y18n: y18n({
+ directory: resolve(__dirname, '../../../locales'),
+ updateFiles: false
+ })
+}
diff --git a/node_modules/yargs/locales/be.json b/node_modules/yargs/locales/be.json
new file mode 100644
index 0000000..e28fa30
--- /dev/null
+++ b/node_modules/yargs/locales/be.json
@@ -0,0 +1,46 @@
+{
+ "Commands:": "Каманды:",
+ "Options:": "Опцыі:",
+ "Examples:": "Прыклады:",
+ "boolean": "булевы тып",
+ "count": "падлік",
+ "string": "радковы тып",
+ "number": "лік",
+ "array": "масіў",
+ "required": "неабходна",
+ "default": "па змаўчанні",
+ "default:": "па змаўчанні:",
+ "choices:": "магчымасці:",
+ "aliases:": "аліасы:",
+ "generated-value": "згенераванае значэнне",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s",
+ "other": "Недастаткова неапцыйных аргументаў: ёсць %s, трэба як мінімум %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s",
+ "other": "Занадта шмат неапцыйных аргументаў: ёсць %s, максімум дапушчальна %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Не хапае значэння аргументу: %s",
+ "other": "Не хапае значэнняў аргументаў: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Не хапае неабходнага аргументу: %s",
+ "other": "Не хапае неабходных аргументаў: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Невядомы аргумент: %s",
+ "other": "Невядомыя аргументы: %s"
+ },
+ "Invalid values:": "Несапраўдныя значэння:",
+ "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Дадзенае значэнне: %s, Магчымасці: %s",
+ "Argument check failed: %s": "Праверка аргументаў не ўдалася: %s",
+ "Implications failed:": "Дадзены аргумент патрабуе наступны дадатковы аргумент:",
+ "Not enough arguments following: %s": "Недастаткова наступных аргументаў: %s",
+ "Invalid JSON config file: %s": "Несапраўдны файл канфігурацыі JSON: %s",
+ "Path to JSON config file": "Шлях да файла канфігурацыі JSON",
+ "Show help": "Паказаць дапамогу",
+ "Show version number": "Паказаць нумар версіі",
+ "Did you mean %s?": "Вы мелі на ўвазе %s?"
+}
diff --git a/node_modules/yargs/locales/cs.json b/node_modules/yargs/locales/cs.json
new file mode 100644
index 0000000..6394875
--- /dev/null
+++ b/node_modules/yargs/locales/cs.json
@@ -0,0 +1,51 @@
+{
+ "Commands:": "Příkazy:",
+ "Options:": "Možnosti:",
+ "Examples:": "Příklady:",
+ "boolean": "logická hodnota",
+ "count": "počet",
+ "string": "řetězec",
+ "number": "číslo",
+ "array": "pole",
+ "required": "povinné",
+ "default": "výchozí",
+ "default:": "výchozí:",
+ "choices:": "volby:",
+ "aliases:": "aliasy:",
+ "generated-value": "generovaná-hodnota",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Nedostatek argumentů: zadáno %s, je potřeba alespoň %s",
+ "other": "Nedostatek argumentů: zadáno %s, je potřeba alespoň %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Příliš mnoho argumentů: zadáno %s, maximálně %s",
+ "other": "Příliš mnoho argumentů: zadáno %s, maximálně %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Chybí hodnota argumentu: %s",
+ "other": "Chybí hodnoty argumentů: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Chybí požadovaný argument: %s",
+ "other": "Chybí požadované argumenty: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Neznámý argument: %s",
+ "other": "Neznámé argumenty: %s"
+ },
+ "Invalid values:": "Neplatné hodnoty:",
+ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Zadáno: %s, Možnosti: %s",
+ "Argument check failed: %s": "Kontrola argumentů se nezdařila: %s",
+ "Implications failed:": "Chybí závislé argumenty:",
+ "Not enough arguments following: %s": "Následuje nedostatek argumentů: %s",
+ "Invalid JSON config file: %s": "Neplatný konfigurační soubor JSON: %s",
+ "Path to JSON config file": "Cesta ke konfiguračnímu souboru JSON",
+ "Show help": "Zobrazit nápovědu",
+ "Show version number": "Zobrazit číslo verze",
+ "Did you mean %s?": "Měl jste na mysli %s?",
+ "Arguments %s and %s are mutually exclusive" : "Argumenty %s a %s se vzájemně vylučují",
+ "Positionals:": "Poziční:",
+ "command": "příkaz",
+ "deprecated": "zastaralé",
+ "deprecated: %s": "zastaralé: %s"
+}
diff --git a/node_modules/yargs/locales/de.json b/node_modules/yargs/locales/de.json
new file mode 100644
index 0000000..dc73ec3
--- /dev/null
+++ b/node_modules/yargs/locales/de.json
@@ -0,0 +1,46 @@
+{
+ "Commands:": "Kommandos:",
+ "Options:": "Optionen:",
+ "Examples:": "Beispiele:",
+ "boolean": "boolean",
+ "count": "Zähler",
+ "string": "string",
+ "number": "Zahl",
+ "array": "array",
+ "required": "erforderlich",
+ "default": "Standard",
+ "default:": "Standard:",
+ "choices:": "Möglichkeiten:",
+ "aliases:": "Aliase:",
+ "generated-value": "Generierter-Wert",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt",
+ "other": "Nicht genügend Argumente ohne Optionen: %s vorhanden, mindestens %s benötigt"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt",
+ "other": "Zu viele Argumente ohne Optionen: %s vorhanden, maximal %s erlaubt"
+ },
+ "Missing argument value: %s": {
+ "one": "Fehlender Argumentwert: %s",
+ "other": "Fehlende Argumentwerte: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Fehlendes Argument: %s",
+ "other": "Fehlende Argumente: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Unbekanntes Argument: %s",
+ "other": "Unbekannte Argumente: %s"
+ },
+ "Invalid values:": "Unzulässige Werte:",
+ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeben: %s, Möglichkeiten: %s",
+ "Argument check failed: %s": "Argumente-Check fehlgeschlagen: %s",
+ "Implications failed:": "Fehlende abhängige Argumente:",
+ "Not enough arguments following: %s": "Nicht genügend Argumente nach: %s",
+ "Invalid JSON config file: %s": "Fehlerhafte JSON-Config Datei: %s",
+ "Path to JSON config file": "Pfad zur JSON-Config Datei",
+ "Show help": "Hilfe anzeigen",
+ "Show version number": "Version anzeigen",
+ "Did you mean %s?": "Meintest du %s?"
+}
diff --git a/node_modules/yargs/locales/en.json b/node_modules/yargs/locales/en.json
new file mode 100644
index 0000000..af096a1
--- /dev/null
+++ b/node_modules/yargs/locales/en.json
@@ -0,0 +1,55 @@
+{
+ "Commands:": "Commands:",
+ "Options:": "Options:",
+ "Examples:": "Examples:",
+ "boolean": "boolean",
+ "count": "count",
+ "string": "string",
+ "number": "number",
+ "array": "array",
+ "required": "required",
+ "default": "default",
+ "default:": "default:",
+ "choices:": "choices:",
+ "aliases:": "aliases:",
+ "generated-value": "generated-value",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Not enough non-option arguments: got %s, need at least %s",
+ "other": "Not enough non-option arguments: got %s, need at least %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Too many non-option arguments: got %s, maximum of %s",
+ "other": "Too many non-option arguments: got %s, maximum of %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Missing argument value: %s",
+ "other": "Missing argument values: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Missing required argument: %s",
+ "other": "Missing required arguments: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Unknown argument: %s",
+ "other": "Unknown arguments: %s"
+ },
+ "Unknown command: %s": {
+ "one": "Unknown command: %s",
+ "other": "Unknown commands: %s"
+ },
+ "Invalid values:": "Invalid values:",
+ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Given: %s, Choices: %s",
+ "Argument check failed: %s": "Argument check failed: %s",
+ "Implications failed:": "Missing dependent arguments:",
+ "Not enough arguments following: %s": "Not enough arguments following: %s",
+ "Invalid JSON config file: %s": "Invalid JSON config file: %s",
+ "Path to JSON config file": "Path to JSON config file",
+ "Show help": "Show help",
+ "Show version number": "Show version number",
+ "Did you mean %s?": "Did you mean %s?",
+ "Arguments %s and %s are mutually exclusive" : "Arguments %s and %s are mutually exclusive",
+ "Positionals:": "Positionals:",
+ "command": "command",
+ "deprecated": "deprecated",
+ "deprecated: %s": "deprecated: %s"
+}
diff --git a/node_modules/yargs/locales/es.json b/node_modules/yargs/locales/es.json
new file mode 100644
index 0000000..d77b461
--- /dev/null
+++ b/node_modules/yargs/locales/es.json
@@ -0,0 +1,46 @@
+{
+ "Commands:": "Comandos:",
+ "Options:": "Opciones:",
+ "Examples:": "Ejemplos:",
+ "boolean": "booleano",
+ "count": "cuenta",
+ "string": "cadena de caracteres",
+ "number": "número",
+ "array": "tabla",
+ "required": "requerido",
+ "default": "defecto",
+ "default:": "defecto:",
+ "choices:": "selección:",
+ "aliases:": "alias:",
+ "generated-value": "valor-generado",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s",
+ "other": "Hacen falta argumentos no-opcionales: Número recibido %s, necesita por lo menos %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s",
+ "other": "Demasiados argumentos no-opcionales: Número recibido %s, máximo es %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Falta argumento: %s",
+ "other": "Faltan argumentos: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Falta argumento requerido: %s",
+ "other": "Faltan argumentos requeridos: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Argumento desconocido: %s",
+ "other": "Argumentos desconocidos: %s"
+ },
+ "Invalid values:": "Valores inválidos:",
+ "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Recibido: %s, Seleccionados: %s",
+ "Argument check failed: %s": "Verificación de argumento ha fallado: %s",
+ "Implications failed:": "Implicaciones fallidas:",
+ "Not enough arguments following: %s": "No hay suficientes argumentos después de: %s",
+ "Invalid JSON config file: %s": "Archivo de configuración JSON inválido: %s",
+ "Path to JSON config file": "Ruta al archivo de configuración JSON",
+ "Show help": "Muestra ayuda",
+ "Show version number": "Muestra número de versión",
+ "Did you mean %s?": "Quisiste decir %s?"
+}
diff --git a/node_modules/yargs/locales/fi.json b/node_modules/yargs/locales/fi.json
new file mode 100644
index 0000000..481feb7
--- /dev/null
+++ b/node_modules/yargs/locales/fi.json
@@ -0,0 +1,49 @@
+{
+ "Commands:": "Komennot:",
+ "Options:": "Valinnat:",
+ "Examples:": "Esimerkkejä:",
+ "boolean": "totuusarvo",
+ "count": "lukumäärä",
+ "string": "merkkijono",
+ "number": "numero",
+ "array": "taulukko",
+ "required": "pakollinen",
+ "default": "oletusarvo",
+ "default:": "oletusarvo:",
+ "choices:": "vaihtoehdot:",
+ "aliases:": "aliakset:",
+ "generated-value": "generoitu-arvo",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s",
+ "other": "Liian vähän argumentteja, jotka eivät ole valintoja: annettu %s, vaaditaan vähintään %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s",
+ "other": "Liikaa argumentteja, jotka eivät ole valintoja: annettu %s, sallitaan enintään %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Argumentin arvo puuttuu: %s",
+ "other": "Argumentin arvot puuttuvat: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Pakollinen argumentti puuttuu: %s",
+ "other": "Pakollisia argumentteja puuttuu: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Tuntematon argumentti: %s",
+ "other": "Tuntemattomia argumentteja: %s"
+ },
+ "Invalid values:": "Virheelliset arvot:",
+ "Argument: %s, Given: %s, Choices: %s": "Argumentti: %s, Annettu: %s, Vaihtoehdot: %s",
+ "Argument check failed: %s": "Argumentin tarkistus epäonnistui: %s",
+ "Implications failed:": "Riippuvia argumentteja puuttuu:",
+ "Not enough arguments following: %s": "Argumentin perässä ei ole tarpeeksi argumentteja: %s",
+ "Invalid JSON config file: %s": "Epävalidi JSON-asetustiedosto: %s",
+ "Path to JSON config file": "JSON-asetustiedoston polku",
+ "Show help": "Näytä ohje",
+ "Show version number": "Näytä versionumero",
+ "Did you mean %s?": "Tarkoititko %s?",
+ "Arguments %s and %s are mutually exclusive" : "Argumentit %s ja %s eivät ole yhteensopivat",
+ "Positionals:": "Sijaintiparametrit:",
+ "command": "komento"
+}
diff --git a/node_modules/yargs/locales/fr.json b/node_modules/yargs/locales/fr.json
new file mode 100644
index 0000000..edd743f
--- /dev/null
+++ b/node_modules/yargs/locales/fr.json
@@ -0,0 +1,53 @@
+{
+ "Commands:": "Commandes :",
+ "Options:": "Options :",
+ "Examples:": "Exemples :",
+ "boolean": "booléen",
+ "count": "compteur",
+ "string": "chaîne de caractères",
+ "number": "nombre",
+ "array": "tableau",
+ "required": "requis",
+ "default": "défaut",
+ "default:": "défaut :",
+ "choices:": "choix :",
+ "aliases:": "alias :",
+ "generated-value": "valeur générée",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Pas assez d'arguments (hors options) : reçu %s, besoin d'au moins %s",
+ "other": "Pas assez d'arguments (hors options) : reçus %s, besoin d'au moins %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Trop d'arguments (hors options) : reçu %s, maximum de %s",
+ "other": "Trop d'arguments (hors options) : reçus %s, maximum de %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Argument manquant : %s",
+ "other": "Arguments manquants : %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Argument requis manquant : %s",
+ "other": "Arguments requis manquants : %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Argument inconnu : %s",
+ "other": "Arguments inconnus : %s"
+ },
+ "Unknown command: %s": {
+ "one": "Commande inconnue : %s",
+ "other": "Commandes inconnues : %s"
+ },
+ "Invalid values:": "Valeurs invalides :",
+ "Argument: %s, Given: %s, Choices: %s": "Argument : %s, donné : %s, choix : %s",
+ "Argument check failed: %s": "Echec de la vérification de l'argument : %s",
+ "Implications failed:": "Arguments dépendants manquants :",
+ "Not enough arguments following: %s": "Pas assez d'arguments après : %s",
+ "Invalid JSON config file: %s": "Fichier de configuration JSON invalide : %s",
+ "Path to JSON config file": "Chemin du fichier de configuration JSON",
+ "Show help": "Affiche l'aide",
+ "Show version number": "Affiche le numéro de version",
+ "Did you mean %s?": "Vouliez-vous dire %s ?",
+ "Arguments %s and %s are mutually exclusive" : "Les arguments %s et %s sont mutuellement exclusifs",
+ "Positionals:": "Arguments positionnels :",
+ "command": "commande"
+}
diff --git a/node_modules/yargs/locales/hi.json b/node_modules/yargs/locales/hi.json
new file mode 100644
index 0000000..a9de77c
--- /dev/null
+++ b/node_modules/yargs/locales/hi.json
@@ -0,0 +1,49 @@
+{
+ "Commands:": "आदेश:",
+ "Options:": "विकल्प:",
+ "Examples:": "उदाहरण:",
+ "boolean": "सत्यता",
+ "count": "संख्या",
+ "string": "वर्णों का तार ",
+ "number": "अंक",
+ "array": "सरणी",
+ "required": "आवश्यक",
+ "default": "डिफॉल्ट",
+ "default:": "डिफॉल्ट:",
+ "choices:": "विकल्प:",
+ "aliases:": "उपनाम:",
+ "generated-value": "उत्पन्न-मूल्य",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है",
+ "other": "पर्याप्त गैर-विकल्प तर्क प्राप्त नहीं: %s प्राप्त, कम से कम %s की आवश्यकता है"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य",
+ "other": "बहुत सारे गैर-विकल्प तर्क: %s प्राप्त, अधिकतम %s मान्य"
+ },
+ "Missing argument value: %s": {
+ "one": "कुछ तर्को के मूल्य गुम हैं: %s",
+ "other": "कुछ तर्को के मूल्य गुम हैं: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "आवश्यक तर्क गुम हैं: %s",
+ "other": "आवश्यक तर्क गुम हैं: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "अज्ञात तर्क प्राप्त: %s",
+ "other": "अज्ञात तर्क प्राप्त: %s"
+ },
+ "Invalid values:": "अमान्य मूल्य:",
+ "Argument: %s, Given: %s, Choices: %s": "तर्क: %s, प्राप्त: %s, विकल्प: %s",
+ "Argument check failed: %s": "तर्क जांच विफल: %s",
+ "Implications failed:": "दिए गए तर्क के लिए अतिरिक्त तर्क की अपेक्षा है:",
+ "Not enough arguments following: %s": "निम्नलिखित के बाद पर्याप्त तर्क नहीं प्राप्त: %s",
+ "Invalid JSON config file: %s": "अमान्य JSON config फाइल: %s",
+ "Path to JSON config file": "JSON config फाइल का पथ",
+ "Show help": "सहायता दिखाएँ",
+ "Show version number": "Version संख्या दिखाएँ",
+ "Did you mean %s?": "क्या आपका मतलब है %s?",
+ "Arguments %s and %s are mutually exclusive" : "तर्क %s और %s परस्पर अनन्य हैं",
+ "Positionals:": "स्थानीय:",
+ "command": "आदेश"
+}
diff --git a/node_modules/yargs/locales/hu.json b/node_modules/yargs/locales/hu.json
new file mode 100644
index 0000000..21492d0
--- /dev/null
+++ b/node_modules/yargs/locales/hu.json
@@ -0,0 +1,46 @@
+{
+ "Commands:": "Parancsok:",
+ "Options:": "Opciók:",
+ "Examples:": "Példák:",
+ "boolean": "boolean",
+ "count": "számláló",
+ "string": "szöveg",
+ "number": "szám",
+ "array": "tömb",
+ "required": "kötelező",
+ "default": "alapértelmezett",
+ "default:": "alapértelmezett:",
+ "choices:": "lehetőségek:",
+ "aliases:": "aliaszok:",
+ "generated-value": "generált-érték",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell",
+ "other": "Nincs elég nem opcionális argumentum: %s van, legalább %s kell"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet",
+ "other": "Túl sok nem opciánlis argumentum van: %s van, maximum %s lehet"
+ },
+ "Missing argument value: %s": {
+ "one": "Hiányzó argumentum érték: %s",
+ "other": "Hiányzó argumentum értékek: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Hiányzó kötelező argumentum: %s",
+ "other": "Hiányzó kötelező argumentumok: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Ismeretlen argumentum: %s",
+ "other": "Ismeretlen argumentumok: %s"
+ },
+ "Invalid values:": "Érvénytelen érték:",
+ "Argument: %s, Given: %s, Choices: %s": "Argumentum: %s, Megadott: %s, Lehetőségek: %s",
+ "Argument check failed: %s": "Argumentum ellenőrzés sikertelen: %s",
+ "Implications failed:": "Implikációk sikertelenek:",
+ "Not enough arguments following: %s": "Nem elég argumentum követi: %s",
+ "Invalid JSON config file: %s": "Érvénytelen JSON konfigurációs file: %s",
+ "Path to JSON config file": "JSON konfigurációs file helye",
+ "Show help": "Súgo megjelenítése",
+ "Show version number": "Verziószám megjelenítése",
+ "Did you mean %s?": "Erre gondoltál %s?"
+}
diff --git a/node_modules/yargs/locales/id.json b/node_modules/yargs/locales/id.json
new file mode 100644
index 0000000..125867c
--- /dev/null
+++ b/node_modules/yargs/locales/id.json
@@ -0,0 +1,50 @@
+
+{
+ "Commands:": "Perintah:",
+ "Options:": "Pilihan:",
+ "Examples:": "Contoh:",
+ "boolean": "boolean",
+ "count": "jumlah",
+ "number": "nomor",
+ "string": "string",
+ "array": "larik",
+ "required": "diperlukan",
+ "default": "bawaan",
+ "default:": "bawaan:",
+ "aliases:": "istilah lain:",
+ "choices:": "pilihan:",
+ "generated-value": "nilai-yang-dihasilkan",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Argumen wajib kurang: hanya %s, minimal %s",
+ "other": "Argumen wajib kurang: hanya %s, minimal %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Terlalu banyak argumen wajib: ada %s, maksimal %s",
+ "other": "Terlalu banyak argumen wajib: ada %s, maksimal %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Kurang argumen: %s",
+ "other": "Kurang argumen: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Kurang argumen wajib: %s",
+ "other": "Kurang argumen wajib: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Argumen tak diketahui: %s",
+ "other": "Argumen tak diketahui: %s"
+ },
+ "Invalid values:": "Nilai-nilai tidak valid:",
+ "Argument: %s, Given: %s, Choices: %s": "Argumen: %s, Diberikan: %s, Pilihan: %s",
+ "Argument check failed: %s": "Pemeriksaan argument gagal: %s",
+ "Implications failed:": "Implikasi gagal:",
+ "Not enough arguments following: %s": "Kurang argumen untuk: %s",
+ "Invalid JSON config file: %s": "Berkas konfigurasi JSON tidak valid: %s",
+ "Path to JSON config file": "Alamat berkas konfigurasi JSON",
+ "Show help": "Lihat bantuan",
+ "Show version number": "Lihat nomor versi",
+ "Did you mean %s?": "Maksud Anda: %s?",
+ "Arguments %s and %s are mutually exclusive" : "Argumen %s dan %s saling eksklusif",
+ "Positionals:": "Posisional-posisional:",
+ "command": "perintah"
+}
diff --git a/node_modules/yargs/locales/it.json b/node_modules/yargs/locales/it.json
new file mode 100644
index 0000000..fde5756
--- /dev/null
+++ b/node_modules/yargs/locales/it.json
@@ -0,0 +1,46 @@
+{
+ "Commands:": "Comandi:",
+ "Options:": "Opzioni:",
+ "Examples:": "Esempi:",
+ "boolean": "booleano",
+ "count": "contatore",
+ "string": "stringa",
+ "number": "numero",
+ "array": "vettore",
+ "required": "richiesto",
+ "default": "predefinito",
+ "default:": "predefinito:",
+ "choices:": "scelte:",
+ "aliases:": "alias:",
+ "generated-value": "valore generato",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s",
+ "other": "Numero insufficiente di argomenti non opzione: inseriti %s, richiesti almeno %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s",
+ "other": "Troppi argomenti non opzione: inseriti %s, massimo possibile %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Argomento mancante: %s",
+ "other": "Argomenti mancanti: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Argomento richiesto mancante: %s",
+ "other": "Argomenti richiesti mancanti: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Argomento sconosciuto: %s",
+ "other": "Argomenti sconosciuti: %s"
+ },
+ "Invalid values:": "Valori non validi:",
+ "Argument: %s, Given: %s, Choices: %s": "Argomento: %s, Richiesto: %s, Scelte: %s",
+ "Argument check failed: %s": "Controllo dell'argomento fallito: %s",
+ "Implications failed:": "Argomenti dipendenti mancanti:",
+ "Not enough arguments following: %s": "Argomenti insufficienti dopo: %s",
+ "Invalid JSON config file: %s": "File di configurazione JSON non valido: %s",
+ "Path to JSON config file": "Percorso del file di configurazione JSON",
+ "Show help": "Mostra la schermata di aiuto",
+ "Show version number": "Mostra il numero di versione",
+ "Did you mean %s?": "Intendi forse %s?"
+}
diff --git a/node_modules/yargs/locales/ja.json b/node_modules/yargs/locales/ja.json
new file mode 100644
index 0000000..3954ae6
--- /dev/null
+++ b/node_modules/yargs/locales/ja.json
@@ -0,0 +1,51 @@
+{
+ "Commands:": "コマンド:",
+ "Options:": "オプション:",
+ "Examples:": "例:",
+ "boolean": "真偽",
+ "count": "カウント",
+ "string": "文字列",
+ "number": "数値",
+ "array": "配列",
+ "required": "必須",
+ "default": "デフォルト",
+ "default:": "デフォルト:",
+ "choices:": "選択してください:",
+ "aliases:": "エイリアス:",
+ "generated-value": "生成された値",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:",
+ "other": "オプションではない引数が %s 個では不足しています。少なくとも %s 個の引数が必要です:"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:",
+ "other": "オプションではない引数が %s 個では多すぎます。最大で %s 個までです:"
+ },
+ "Missing argument value: %s": {
+ "one": "引数の値が見つかりません: %s",
+ "other": "引数の値が見つかりません: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "必須の引数が見つかりません: %s",
+ "other": "必須の引数が見つかりません: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "未知の引数です: %s",
+ "other": "未知の引数です: %s"
+ },
+ "Invalid values:": "不正な値です:",
+ "Argument: %s, Given: %s, Choices: %s": "引数は %s です。与えられた値: %s, 選択してください: %s",
+ "Argument check failed: %s": "引数のチェックに失敗しました: %s",
+ "Implications failed:": "オプションの組み合わせで不正が生じました:",
+ "Not enough arguments following: %s": "次の引数が不足しています。: %s",
+ "Invalid JSON config file: %s": "JSONの設定ファイルが不正です: %s",
+ "Path to JSON config file": "JSONの設定ファイルまでのpath",
+ "Show help": "ヘルプを表示",
+ "Show version number": "バージョンを表示",
+ "Did you mean %s?": "もしかして %s?",
+ "Arguments %s and %s are mutually exclusive" : "引数 %s と %s は同時に指定できません",
+ "Positionals:": "位置:",
+ "command": "コマンド",
+ "deprecated": "非推奨",
+ "deprecated: %s": "非推奨: %s"
+}
diff --git a/node_modules/yargs/locales/ko.json b/node_modules/yargs/locales/ko.json
new file mode 100644
index 0000000..746bc89
--- /dev/null
+++ b/node_modules/yargs/locales/ko.json
@@ -0,0 +1,49 @@
+{
+ "Commands:": "명령:",
+ "Options:": "옵션:",
+ "Examples:": "예시:",
+ "boolean": "불리언",
+ "count": "개수",
+ "string": "문자열",
+ "number": "숫자",
+ "array": "배열",
+ "required": "필수",
+ "default": "기본값",
+ "default:": "기본값:",
+ "choices:": "선택지:",
+ "aliases:": "별칭:",
+ "generated-value": "생성된 값",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "옵션이 아닌 인수가 충분하지 않습니다: %s개 입력받음, 최소 %s개 입력 필요",
+ "other": "옵션이 아닌 인수가 충분하지 않습니다: %s개 입력받음, 최소 %s개 입력 필요"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "옵션이 아닌 인수가 너무 많습니다: %s개 입력받음, 최대 %s개 입력 가능",
+ "other": "옵션이 아닌 인수가 너무 많습니다: %s개 입력받음, 최대 %s개 입력 가능"
+ },
+ "Missing argument value: %s": {
+ "one": "인수가 주어지지 않았습니다: %s",
+ "other": "인수가 주어지지 않았습니다: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "필수 인수가 주어지지 않았습니다: %s",
+ "other": "필수 인수가 주어지지 않았습니다: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "알 수 없는 인수입니다: %s",
+ "other": "알 수 없는 인수입니다: %s"
+ },
+ "Invalid values:": "유효하지 않은 값:",
+ "Argument: %s, Given: %s, Choices: %s": "인수: %s, 주어진 값: %s, 선택지: %s",
+ "Argument check failed: %s": "인수 체크에 실패했습니다: %s",
+ "Implications failed:": "주어진 인수에 필요한 추가 인수가 주어지지 않았습니다:",
+ "Not enough arguments following: %s": "다음 인수가 주어지지 않았습니다: %s",
+ "Invalid JSON config file: %s": "유효하지 않은 JSON 설정 파일: %s",
+ "Path to JSON config file": "JSON 설정 파일 경로",
+ "Show help": "도움말 표시",
+ "Show version number": "버전 표시",
+ "Did you mean %s?": "%s을(를) 찾으시나요?",
+ "Arguments %s and %s are mutually exclusive" : "인수 %s과(와) %s은(는) 동시에 지정할 수 없습니다",
+ "Positionals:": "위치:",
+ "command": "명령"
+}
diff --git a/node_modules/yargs/locales/nb.json b/node_modules/yargs/locales/nb.json
new file mode 100644
index 0000000..6f410ed
--- /dev/null
+++ b/node_modules/yargs/locales/nb.json
@@ -0,0 +1,44 @@
+{
+ "Commands:": "Kommandoer:",
+ "Options:": "Alternativer:",
+ "Examples:": "Eksempler:",
+ "boolean": "boolsk",
+ "count": "antall",
+ "string": "streng",
+ "number": "nummer",
+ "array": "matrise",
+ "required": "obligatorisk",
+ "default": "standard",
+ "default:": "standard:",
+ "choices:": "valg:",
+ "generated-value": "generert-verdi",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s",
+ "other": "Ikke nok ikke-alternativ argumenter: fikk %s, trenger minst %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s",
+ "other": "For mange ikke-alternativ argumenter: fikk %s, maksimum %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Mangler argument verdi: %s",
+ "other": "Mangler argument verdier: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Mangler obligatorisk argument: %s",
+ "other": "Mangler obligatoriske argumenter: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Ukjent argument: %s",
+ "other": "Ukjente argumenter: %s"
+ },
+ "Invalid values:": "Ugyldige verdier:",
+ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gitt: %s, Valg: %s",
+ "Argument check failed: %s": "Argumentsjekk mislyktes: %s",
+ "Implications failed:": "Konsekvensene mislyktes:",
+ "Not enough arguments following: %s": "Ikke nok følgende argumenter: %s",
+ "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s",
+ "Path to JSON config file": "Bane til JSON konfigurasjonsfil",
+ "Show help": "Vis hjelp",
+ "Show version number": "Vis versjonsnummer"
+}
diff --git a/node_modules/yargs/locales/nl.json b/node_modules/yargs/locales/nl.json
new file mode 100644
index 0000000..9ff95c5
--- /dev/null
+++ b/node_modules/yargs/locales/nl.json
@@ -0,0 +1,49 @@
+{
+ "Commands:": "Commando's:",
+ "Options:": "Opties:",
+ "Examples:": "Voorbeelden:",
+ "boolean": "booleaans",
+ "count": "aantal",
+ "string": "string",
+ "number": "getal",
+ "array": "lijst",
+ "required": "verplicht",
+ "default": "standaard",
+ "default:": "standaard:",
+ "choices:": "keuzes:",
+ "aliases:": "aliassen:",
+ "generated-value": "gegenereerde waarde",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig",
+ "other": "Niet genoeg niet-optie-argumenten: %s gekregen, minstens %s nodig"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s",
+ "other": "Te veel niet-optie-argumenten: %s gekregen, maximum is %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Missende argumentwaarde: %s",
+ "other": "Missende argumentwaarden: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Missend verplicht argument: %s",
+ "other": "Missende verplichte argumenten: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Onbekend argument: %s",
+ "other": "Onbekende argumenten: %s"
+ },
+ "Invalid values:": "Ongeldige waarden:",
+ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gegeven: %s, Keuzes: %s",
+ "Argument check failed: %s": "Argumentcontrole mislukt: %s",
+ "Implications failed:": "Ontbrekende afhankelijke argumenten:",
+ "Not enough arguments following: %s": "Niet genoeg argumenten na: %s",
+ "Invalid JSON config file: %s": "Ongeldig JSON-config-bestand: %s",
+ "Path to JSON config file": "Pad naar JSON-config-bestand",
+ "Show help": "Toon help",
+ "Show version number": "Toon versienummer",
+ "Did you mean %s?": "Bedoelde u misschien %s?",
+ "Arguments %s and %s are mutually exclusive": "Argumenten %s en %s kunnen niet tegelijk gebruikt worden",
+ "Positionals:": "Positie-afhankelijke argumenten",
+ "command": "commando"
+}
diff --git a/node_modules/yargs/locales/nn.json b/node_modules/yargs/locales/nn.json
new file mode 100644
index 0000000..24479ac
--- /dev/null
+++ b/node_modules/yargs/locales/nn.json
@@ -0,0 +1,44 @@
+{
+ "Commands:": "Kommandoar:",
+ "Options:": "Alternativ:",
+ "Examples:": "Døme:",
+ "boolean": "boolsk",
+ "count": "mengd",
+ "string": "streng",
+ "number": "nummer",
+ "array": "matrise",
+ "required": "obligatorisk",
+ "default": "standard",
+ "default:": "standard:",
+ "choices:": "val:",
+ "generated-value": "generert-verdi",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s",
+ "other": "Ikkje nok ikkje-alternativ argument: fekk %s, treng minst %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "For mange ikkje-alternativ argument: fekk %s, maksimum %s",
+ "other": "For mange ikkje-alternativ argument: fekk %s, maksimum %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Manglar argumentverdi: %s",
+ "other": "Manglar argumentverdiar: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Manglar obligatorisk argument: %s",
+ "other": "Manglar obligatoriske argument: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Ukjent argument: %s",
+ "other": "Ukjende argument: %s"
+ },
+ "Invalid values:": "Ugyldige verdiar:",
+ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Gjeve: %s, Val: %s",
+ "Argument check failed: %s": "Argumentsjekk mislukkast: %s",
+ "Implications failed:": "Konsekvensane mislukkast:",
+ "Not enough arguments following: %s": "Ikkje nok fylgjande argument: %s",
+ "Invalid JSON config file: %s": "Ugyldig JSON konfigurasjonsfil: %s",
+ "Path to JSON config file": "Bane til JSON konfigurasjonsfil",
+ "Show help": "Vis hjelp",
+ "Show version number": "Vis versjonsnummer"
+}
diff --git a/node_modules/yargs/locales/pirate.json b/node_modules/yargs/locales/pirate.json
new file mode 100644
index 0000000..dcb5cb7
--- /dev/null
+++ b/node_modules/yargs/locales/pirate.json
@@ -0,0 +1,13 @@
+{
+ "Commands:": "Choose yer command:",
+ "Options:": "Options for me hearties!",
+ "Examples:": "Ex. marks the spot:",
+ "required": "requi-yar-ed",
+ "Missing required argument: %s": {
+ "one": "Ye be havin' to set the followin' argument land lubber: %s",
+ "other": "Ye be havin' to set the followin' arguments land lubber: %s"
+ },
+ "Show help": "Parlay this here code of conduct",
+ "Show version number": "'Tis the version ye be askin' fer",
+ "Arguments %s and %s are mutually exclusive" : "Yon scurvy dogs %s and %s be as bad as rum and a prudish wench"
+}
diff --git a/node_modules/yargs/locales/pl.json b/node_modules/yargs/locales/pl.json
new file mode 100644
index 0000000..a41d4bd
--- /dev/null
+++ b/node_modules/yargs/locales/pl.json
@@ -0,0 +1,49 @@
+{
+ "Commands:": "Polecenia:",
+ "Options:": "Opcje:",
+ "Examples:": "Przykłady:",
+ "boolean": "boolean",
+ "count": "ilość",
+ "string": "ciąg znaków",
+ "number": "liczba",
+ "array": "tablica",
+ "required": "wymagany",
+ "default": "domyślny",
+ "default:": "domyślny:",
+ "choices:": "dostępne:",
+ "aliases:": "aliasy:",
+ "generated-value": "wygenerowana-wartość",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s",
+ "other": "Niewystarczająca ilość argumentów: otrzymano %s, wymagane co najmniej %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s",
+ "other": "Zbyt duża ilość argumentów: otrzymano %s, wymagane co najwyżej %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Brak wartości dla argumentu: %s",
+ "other": "Brak wartości dla argumentów: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Brak wymaganego argumentu: %s",
+ "other": "Brak wymaganych argumentów: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Nieznany argument: %s",
+ "other": "Nieznane argumenty: %s"
+ },
+ "Invalid values:": "Nieprawidłowe wartości:",
+ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Otrzymano: %s, Dostępne: %s",
+ "Argument check failed: %s": "Weryfikacja argumentów nie powiodła się: %s",
+ "Implications failed:": "Założenia nie zostały spełnione:",
+ "Not enough arguments following: %s": "Niewystarczająca ilość argumentów następujących po: %s",
+ "Invalid JSON config file: %s": "Nieprawidłowy plik konfiguracyjny JSON: %s",
+ "Path to JSON config file": "Ścieżka do pliku konfiguracyjnego JSON",
+ "Show help": "Pokaż pomoc",
+ "Show version number": "Pokaż numer wersji",
+ "Did you mean %s?": "Czy chodziło Ci o %s?",
+ "Arguments %s and %s are mutually exclusive": "Argumenty %s i %s wzajemnie się wykluczają",
+ "Positionals:": "Pozycyjne:",
+ "command": "polecenie"
+}
diff --git a/node_modules/yargs/locales/pt.json b/node_modules/yargs/locales/pt.json
new file mode 100644
index 0000000..0c8ac99
--- /dev/null
+++ b/node_modules/yargs/locales/pt.json
@@ -0,0 +1,45 @@
+{
+ "Commands:": "Comandos:",
+ "Options:": "Opções:",
+ "Examples:": "Exemplos:",
+ "boolean": "boolean",
+ "count": "contagem",
+ "string": "cadeia de caracteres",
+ "number": "número",
+ "array": "arranjo",
+ "required": "requerido",
+ "default": "padrão",
+ "default:": "padrão:",
+ "choices:": "escolhas:",
+ "generated-value": "valor-gerado",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s",
+ "other": "Argumentos insuficientes não opcionais: Argumento %s, necessário pelo menos %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Excesso de argumentos não opcionais: recebido %s, máximo de %s",
+ "other": "Excesso de argumentos não opcionais: recebido %s, máximo de %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Falta valor de argumento: %s",
+ "other": "Falta valores de argumento: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Falta argumento obrigatório: %s",
+ "other": "Faltando argumentos obrigatórios: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Argumento desconhecido: %s",
+ "other": "Argumentos desconhecidos: %s"
+ },
+ "Invalid values:": "Valores inválidos:",
+ "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Escolhas: %s",
+ "Argument check failed: %s": "Verificação de argumento falhou: %s",
+ "Implications failed:": "Implicações falharam:",
+ "Not enough arguments following: %s": "Insuficientes argumentos a seguir: %s",
+ "Invalid JSON config file: %s": "Arquivo de configuração em JSON esta inválido: %s",
+ "Path to JSON config file": "Caminho para o arquivo de configuração em JSON",
+ "Show help": "Mostra ajuda",
+ "Show version number": "Mostra número de versão",
+ "Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos"
+}
diff --git a/node_modules/yargs/locales/pt_BR.json b/node_modules/yargs/locales/pt_BR.json
new file mode 100644
index 0000000..eae1ec6
--- /dev/null
+++ b/node_modules/yargs/locales/pt_BR.json
@@ -0,0 +1,48 @@
+{
+ "Commands:": "Comandos:",
+ "Options:": "Opções:",
+ "Examples:": "Exemplos:",
+ "boolean": "booleano",
+ "count": "contagem",
+ "string": "string",
+ "number": "número",
+ "array": "array",
+ "required": "obrigatório",
+ "default:": "padrão:",
+ "choices:": "opções:",
+ "aliases:": "sinônimos:",
+ "generated-value": "valor-gerado",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s",
+ "other": "Argumentos insuficientes: Argumento %s, necessário pelo menos %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Excesso de argumentos: recebido %s, máximo de %s",
+ "other": "Excesso de argumentos: recebido %s, máximo de %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Falta valor de argumento: %s",
+ "other": "Falta valores de argumento: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Falta argumento obrigatório: %s",
+ "other": "Faltando argumentos obrigatórios: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Argumento desconhecido: %s",
+ "other": "Argumentos desconhecidos: %s"
+ },
+ "Invalid values:": "Valores inválidos:",
+ "Argument: %s, Given: %s, Choices: %s": "Argumento: %s, Dado: %s, Opções: %s",
+ "Argument check failed: %s": "Verificação de argumento falhou: %s",
+ "Implications failed:": "Implicações falharam:",
+ "Not enough arguments following: %s": "Argumentos insuficientes a seguir: %s",
+ "Invalid JSON config file: %s": "Arquivo JSON de configuração inválido: %s",
+ "Path to JSON config file": "Caminho para o arquivo JSON de configuração",
+ "Show help": "Exibe ajuda",
+ "Show version number": "Exibe a versão",
+ "Did you mean %s?": "Você quis dizer %s?",
+ "Arguments %s and %s are mutually exclusive" : "Argumentos %s e %s são mutualmente exclusivos",
+ "Positionals:": "Posicionais:",
+ "command": "comando"
+}
diff --git a/node_modules/yargs/locales/ru.json b/node_modules/yargs/locales/ru.json
new file mode 100644
index 0000000..d5c9e32
--- /dev/null
+++ b/node_modules/yargs/locales/ru.json
@@ -0,0 +1,51 @@
+{
+ "Commands:": "Команды:",
+ "Options:": "Опции:",
+ "Examples:": "Примеры:",
+ "boolean": "булевый тип",
+ "count": "подсчет",
+ "string": "строковой тип",
+ "number": "число",
+ "array": "массив",
+ "required": "необходимо",
+ "default": "по умолчанию",
+ "default:": "по умолчанию:",
+ "choices:": "возможности:",
+ "aliases:": "алиасы:",
+ "generated-value": "генерированное значение",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s",
+ "other": "Недостаточно неопционных аргументов: есть %s, нужно как минимум %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s",
+ "other": "Слишком много неопционных аргументов: есть %s, максимум допустимо %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Не хватает значения аргумента: %s",
+ "other": "Не хватает значений аргументов: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Не хватает необходимого аргумента: %s",
+ "other": "Не хватает необходимых аргументов: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Неизвестный аргумент: %s",
+ "other": "Неизвестные аргументы: %s"
+ },
+ "Invalid values:": "Недействительные значения:",
+ "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Данное значение: %s, Возможности: %s",
+ "Argument check failed: %s": "Проверка аргументов не удалась: %s",
+ "Implications failed:": "Данный аргумент требует следующий дополнительный аргумент:",
+ "Not enough arguments following: %s": "Недостаточно следующих аргументов: %s",
+ "Invalid JSON config file: %s": "Недействительный файл конфигурации JSON: %s",
+ "Path to JSON config file": "Путь к файлу конфигурации JSON",
+ "Show help": "Показать помощь",
+ "Show version number": "Показать номер версии",
+ "Did you mean %s?": "Вы имели в виду %s?",
+ "Arguments %s and %s are mutually exclusive": "Аргументы %s и %s являются взаимоисключающими",
+ "Positionals:": "Позиционные аргументы:",
+ "command": "команда",
+ "deprecated": "устар.",
+ "deprecated: %s": "устар.: %s"
+}
diff --git a/node_modules/yargs/locales/th.json b/node_modules/yargs/locales/th.json
new file mode 100644
index 0000000..33b048e
--- /dev/null
+++ b/node_modules/yargs/locales/th.json
@@ -0,0 +1,46 @@
+{
+ "Commands:": "คอมมาน",
+ "Options:": "ออฟชั่น",
+ "Examples:": "ตัวอย่าง",
+ "boolean": "บูลีน",
+ "count": "นับ",
+ "string": "สตริง",
+ "number": "ตัวเลข",
+ "array": "อาเรย์",
+ "required": "จำเป็น",
+ "default": "ค่าเริ่มต้",
+ "default:": "ค่าเริ่มต้น",
+ "choices:": "ตัวเลือก",
+ "aliases:": "เอเลียส",
+ "generated-value": "ค่าที่ถูกสร้างขึ้น",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า",
+ "other": "ใส่อาร์กิวเมนต์ไม่ครบตามจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการอย่างน้อย %s ค่า"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า",
+ "other": "ใส่อาร์กิวเมนต์เกินจำนวนที่กำหนด: ใส่ค่ามาจำนวน %s ค่า, แต่ต้องการมากที่สุด %s ค่า"
+ },
+ "Missing argument value: %s": {
+ "one": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s",
+ "other": "ค่าอาร์กิวเมนต์ที่ขาดไป: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s",
+ "other": "อาร์กิวเมนต์จำเป็นที่ขาดไป: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s",
+ "other": "อาร์กิวเมนต์ที่ไม่รู้จัก: %s"
+ },
+ "Invalid values:": "ค่าไม่ถูกต้อง:",
+ "Argument: %s, Given: %s, Choices: %s": "อาร์กิวเมนต์: %s, ได้รับ: %s, ตัวเลือก: %s",
+ "Argument check failed: %s": "ตรวจสอบพบอาร์กิวเมนต์ที่ไม่ถูกต้อง: %s",
+ "Implications failed:": "Implications ไม่สำเร็จ:",
+ "Not enough arguments following: %s": "ใส่อาร์กิวเมนต์ไม่ครบ: %s",
+ "Invalid JSON config file: %s": "ไฟล์คอนฟิค JSON ไม่ถูกต้อง: %s",
+ "Path to JSON config file": "พาทไฟล์คอนฟิค JSON",
+ "Show help": "ขอความช่วยเหลือ",
+ "Show version number": "แสดงตัวเลขเวอร์ชั่น",
+ "Did you mean %s?": "คุณหมายถึง %s?"
+}
diff --git a/node_modules/yargs/locales/tr.json b/node_modules/yargs/locales/tr.json
new file mode 100644
index 0000000..0d0d2cc
--- /dev/null
+++ b/node_modules/yargs/locales/tr.json
@@ -0,0 +1,48 @@
+{
+ "Commands:": "Komutlar:",
+ "Options:": "Seçenekler:",
+ "Examples:": "Örnekler:",
+ "boolean": "boolean",
+ "count": "sayı",
+ "string": "string",
+ "number": "numara",
+ "array": "array",
+ "required": "zorunlu",
+ "default": "varsayılan",
+ "default:": "varsayılan:",
+ "choices:": "seçimler:",
+ "aliases:": "takma adlar:",
+ "generated-value": "oluşturulan-değer",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli",
+ "other": "Seçenek dışı argümanlar yetersiz: %s bulundu, %s gerekli"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s",
+ "other": "Seçenek dışı argümanlar gereğinden fazla: %s bulundu, azami %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Eksik argüman değeri: %s",
+ "other": "Eksik argüman değerleri: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Eksik zorunlu argüman: %s",
+ "other": "Eksik zorunlu argümanlar: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Bilinmeyen argüman: %s",
+ "other": "Bilinmeyen argümanlar: %s"
+ },
+ "Invalid values:": "Geçersiz değerler:",
+ "Argument: %s, Given: %s, Choices: %s": "Argüman: %s, Verilen: %s, Seçimler: %s",
+ "Argument check failed: %s": "Argüman kontrolü başarısız oldu: %s",
+ "Implications failed:": "Sonuçlar başarısız oldu:",
+ "Not enough arguments following: %s": "%s için yeterli argüman bulunamadı",
+ "Invalid JSON config file: %s": "Geçersiz JSON yapılandırma dosyası: %s",
+ "Path to JSON config file": "JSON yapılandırma dosya konumu",
+ "Show help": "Yardım detaylarını göster",
+ "Show version number": "Versiyon detaylarını göster",
+ "Did you mean %s?": "Bunu mu demek istediniz: %s?",
+ "Positionals:": "Sıralılar:",
+ "command": "komut"
+}
diff --git a/node_modules/yargs/locales/uk_UA.json b/node_modules/yargs/locales/uk_UA.json
new file mode 100644
index 0000000..0af0e99
--- /dev/null
+++ b/node_modules/yargs/locales/uk_UA.json
@@ -0,0 +1,51 @@
+{
+ "Commands:": "Команди:",
+ "Options:": "Опції:",
+ "Examples:": "Приклади:",
+ "boolean": "boolean",
+ "count": "кількість",
+ "string": "строка",
+ "number": "число",
+ "array": "масива",
+ "required": "обов'язково",
+ "default": "за замовчуванням",
+ "default:": "за замовчуванням:",
+ "choices:": "доступні варіанти:",
+ "aliases:": "псевдоніми:",
+ "generated-value": "згенероване значення",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "Недостатньо аргументів: наразі %s, потрібно %s або більше",
+ "other": "Недостатньо аргументів: наразі %s, потрібно %s або більше"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "Забагато аргументів: наразі %s, максимум %s",
+ "other": "Too many non-option arguments: наразі %s, максимум of %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Відсутнє значення для аргументу: %s",
+ "other": "Відсутні значення для аргументу: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Відсутній обов'язковий аргумент: %s",
+ "other": "Відсутні обов'язкові аргументи: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Аргумент %s не підтримується",
+ "other": "Аргументи %s не підтримуються"
+ },
+ "Invalid values:": "Некоректні значення:",
+ "Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Введено: %s, Доступні варіанти: %s",
+ "Argument check failed: %s": "Аргумент не пройшов перевірку: %s",
+ "Implications failed:": "Відсутні залежні аргументи:",
+ "Not enough arguments following: %s": "Не достатньо аргументів після: %s",
+ "Invalid JSON config file: %s": "Некоректний JSON-файл конфігурації: %s",
+ "Path to JSON config file": "Шлях до JSON-файлу конфігурації",
+ "Show help": "Показати довідку",
+ "Show version number": "Показати версію",
+ "Did you mean %s?": "Можливо, ви мали на увазі %s?",
+ "Arguments %s and %s are mutually exclusive" : "Аргументи %s та %s взаємовиключні",
+ "Positionals:": "Позиційні:",
+ "command": "команда",
+ "deprecated": "застарілий",
+ "deprecated: %s": "застарілий: %s"
+}
diff --git a/node_modules/yargs/locales/uz.json b/node_modules/yargs/locales/uz.json
new file mode 100644
index 0000000..0d07168
--- /dev/null
+++ b/node_modules/yargs/locales/uz.json
@@ -0,0 +1,52 @@
+{
+ "Commands:": "Buyruqlar:",
+ "Options:": "Imkoniyatlar:",
+ "Examples:": "Misollar:",
+ "boolean": "boolean",
+ "count": "sanoq",
+ "string": "satr",
+ "number": "raqam",
+ "array": "massiv",
+ "required": "majburiy",
+ "default": "boshlang'ich",
+ "default:": "boshlang'ich:",
+ "choices:": "tanlovlar:",
+ "aliases:": "taxalluslar:",
+ "generated-value": "yaratilgan-qiymat",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "No-imkoniyat argumentlar yetarli emas: berilgan %s, minimum %s",
+ "other": "No-imkoniyat argumentlar yetarli emas: berilgan %s, minimum %s"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "No-imkoniyat argumentlar juda ko'p: berilgan %s, maksimum %s",
+ "other": "No-imkoniyat argumentlar juda ko'p: got %s, maksimum %s"
+ },
+ "Missing argument value: %s": {
+ "one": "Argument qiymati berilmagan: %s",
+ "other": "Argument qiymatlari berilmagan: %s"
+ },
+ "Missing required argument: %s": {
+ "one": "Majburiy argument berilmagan: %s",
+ "other": "Majburiy argumentlar berilmagan: %s"
+ },
+ "Unknown argument: %s": {
+ "one": "Noma'lum argument berilmagan: %s",
+ "other": "Noma'lum argumentlar berilmagan: %s"
+ },
+ "Invalid values:": "Nosoz qiymatlar:",
+ "Argument: %s, Given: %s, Choices: %s": "Argument: %s, Berilgan: %s, Tanlovlar: %s",
+ "Argument check failed: %s": "Muvaffaqiyatsiz argument tekshiruvi: %s",
+ "Implications failed:": "Bog'liq argumentlar berilmagan:",
+ "Not enough arguments following: %s": "Quyidagi argumentlar yetarli emas: %s",
+ "Invalid JSON config file: %s": "Nosoz JSON konfiguratsiya fayli: %s",
+ "Path to JSON config file": "JSON konfiguratsiya fayli joylashuvi",
+ "Show help": "Yordam ko'rsatish",
+ "Show version number": "Versiyani ko'rsatish",
+ "Did you mean %s?": "%s ni nazarda tutyapsizmi?",
+ "Arguments %s and %s are mutually exclusive" : "%s va %s argumentlari alohida",
+ "Positionals:": "Positsionallar:",
+ "command": "buyruq",
+ "deprecated": "eskirgan",
+ "deprecated: %s": "eskirgan: %s"
+ }
+ \ No newline at end of file
diff --git a/node_modules/yargs/locales/zh_CN.json b/node_modules/yargs/locales/zh_CN.json
new file mode 100644
index 0000000..257d26b
--- /dev/null
+++ b/node_modules/yargs/locales/zh_CN.json
@@ -0,0 +1,48 @@
+{
+ "Commands:": "命令:",
+ "Options:": "选项:",
+ "Examples:": "示例:",
+ "boolean": "布尔",
+ "count": "计数",
+ "string": "字符串",
+ "number": "数字",
+ "array": "数组",
+ "required": "必需",
+ "default": "默认值",
+ "default:": "默认值:",
+ "choices:": "可选值:",
+ "generated-value": "生成的值",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个",
+ "other": "缺少 non-option 参数:传入了 %s 个, 至少需要 %s 个"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个",
+ "other": "non-option 参数过多:传入了 %s 个, 最大允许 %s 个"
+ },
+ "Missing argument value: %s": {
+ "one": "没有给此选项指定值:%s",
+ "other": "没有给这些选项指定值:%s"
+ },
+ "Missing required argument: %s": {
+ "one": "缺少必须的选项:%s",
+ "other": "缺少这些必须的选项:%s"
+ },
+ "Unknown argument: %s": {
+ "one": "无法识别的选项:%s",
+ "other": "无法识别这些选项:%s"
+ },
+ "Invalid values:": "无效的选项值:",
+ "Argument: %s, Given: %s, Choices: %s": "选项名称: %s, 传入的值: %s, 可选的值:%s",
+ "Argument check failed: %s": "选项值验证失败:%s",
+ "Implications failed:": "缺少依赖的选项:",
+ "Not enough arguments following: %s": "没有提供足够的值给此选项:%s",
+ "Invalid JSON config file: %s": "无效的 JSON 配置文件:%s",
+ "Path to JSON config file": "JSON 配置文件的路径",
+ "Show help": "显示帮助信息",
+ "Show version number": "显示版本号",
+ "Did you mean %s?": "是指 %s?",
+ "Arguments %s and %s are mutually exclusive" : "选项 %s 和 %s 是互斥的",
+ "Positionals:": "位置:",
+ "command": "命令"
+}
diff --git a/node_modules/yargs/locales/zh_TW.json b/node_modules/yargs/locales/zh_TW.json
new file mode 100644
index 0000000..e38495d
--- /dev/null
+++ b/node_modules/yargs/locales/zh_TW.json
@@ -0,0 +1,51 @@
+{
+ "Commands:": "命令:",
+ "Options:": "選項:",
+ "Examples:": "範例:",
+ "boolean": "布林",
+ "count": "次數",
+ "string": "字串",
+ "number": "數字",
+ "array": "陣列",
+ "required": "必填",
+ "default": "預設值",
+ "default:": "預設值:",
+ "choices:": "可選值:",
+ "aliases:": "別名:",
+ "generated-value": "生成的值",
+ "Not enough non-option arguments: got %s, need at least %s": {
+ "one": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個",
+ "other": "non-option 引數不足:只傳入了 %s 個, 至少要 %s 個"
+ },
+ "Too many non-option arguments: got %s, maximum of %s": {
+ "one": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個",
+ "other": "non-option 引數過多:傳入了 %s 個, 但最多 %s 個"
+ },
+ "Missing argument value: %s": {
+ "one": "此引數無指定值:%s",
+ "other": "這些引數無指定值:%s"
+ },
+ "Missing required argument: %s": {
+ "one": "缺少必須的引數:%s",
+ "other": "缺少這些必須的引數:%s"
+ },
+ "Unknown argument: %s": {
+ "one": "未知的引數:%s",
+ "other": "未知的引數:%s"
+ },
+ "Invalid values:": "無效的選項值:",
+ "Argument: %s, Given: %s, Choices: %s": "引數名稱: %s, 傳入的值: %s, 可選的值:%s",
+ "Argument check failed: %s": "引數驗證失敗:%s",
+ "Implications failed:": "缺少依賴引數:",
+ "Not enough arguments following: %s": "沒有提供足夠的值給此引數:%s",
+ "Invalid JSON config file: %s": "無效的 JSON 設置文件:%s",
+ "Path to JSON config file": "JSON 設置文件的路徑",
+ "Show help": "顯示說明",
+ "Show version number": "顯示版本",
+ "Did you mean %s?": "您是指 %s 嗎?",
+ "Arguments %s and %s are mutually exclusive" : "引數 %s 和 %s 互斥",
+ "Positionals:": "位置:",
+ "command": "命令",
+ "deprecated": "已淘汰",
+ "deprecated: %s": "已淘汰:%s"
+ }
diff --git a/node_modules/yargs/package.json b/node_modules/yargs/package.json
new file mode 100644
index 0000000..389cc6b
--- /dev/null
+++ b/node_modules/yargs/package.json
@@ -0,0 +1,123 @@
+{
+ "name": "yargs",
+ "version": "17.7.2",
+ "description": "yargs the modern, pirate-themed, successor to optimist.",
+ "main": "./index.cjs",
+ "exports": {
+ "./package.json": "./package.json",
+ ".": [
+ {
+ "import": "./index.mjs",
+ "require": "./index.cjs"
+ },
+ "./index.cjs"
+ ],
+ "./helpers": {
+ "import": "./helpers/helpers.mjs",
+ "require": "./helpers/index.js"
+ },
+ "./browser": {
+ "import": "./browser.mjs",
+ "types": "./browser.d.ts"
+ },
+ "./yargs": [
+ {
+ "import": "./yargs.mjs",
+ "require": "./yargs"
+ },
+ "./yargs"
+ ]
+ },
+ "type": "module",
+ "module": "./index.mjs",
+ "contributors": [
+ {
+ "name": "Yargs Contributors",
+ "url": "https://github.com/yargs/yargs/graphs/contributors"
+ }
+ ],
+ "files": [
+ "browser.mjs",
+ "browser.d.ts",
+ "index.cjs",
+ "helpers/*.js",
+ "helpers/*",
+ "index.mjs",
+ "yargs",
+ "yargs.mjs",
+ "build",
+ "locales",
+ "LICENSE",
+ "lib/platform-shims/*.mjs",
+ "!*.d.ts",
+ "!**/*.d.ts"
+ ],
+ "dependencies": {
+ "cliui": "^8.0.1",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.3",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^21.1.1"
+ },
+ "devDependencies": {
+ "@types/chai": "^4.2.11",
+ "@types/mocha": "^9.0.0",
+ "@types/node": "^18.0.0",
+ "c8": "^7.7.0",
+ "chai": "^4.2.0",
+ "chalk": "^4.0.0",
+ "coveralls": "^3.0.9",
+ "cpr": "^3.0.1",
+ "cross-env": "^7.0.2",
+ "cross-spawn": "^7.0.0",
+ "eslint": "^7.23.0",
+ "gts": "^3.0.0",
+ "hashish": "0.0.4",
+ "mocha": "^9.0.0",
+ "rimraf": "^3.0.2",
+ "rollup": "^2.23.0",
+ "rollup-plugin-cleanup": "^3.1.1",
+ "rollup-plugin-terser": "^7.0.2",
+ "rollup-plugin-ts": "^2.0.4",
+ "typescript": "^4.0.2",
+ "which": "^2.0.0",
+ "yargs-test-extends": "^1.0.1"
+ },
+ "scripts": {
+ "fix": "gts fix && npm run fix:js",
+ "fix:js": "eslint . --ext cjs --ext mjs --ext js --fix",
+ "posttest": "npm run check",
+ "test": "c8 mocha --enable-source-maps ./test/*.cjs --require ./test/before.cjs --timeout=12000 --check-leaks",
+ "test:esm": "c8 mocha --enable-source-maps ./test/esm/*.mjs --check-leaks",
+ "coverage": "c8 report --check-coverage",
+ "prepare": "npm run compile",
+ "pretest": "npm run compile -- -p tsconfig.test.json && cross-env NODE_ENV=test npm run build:cjs",
+ "compile": "rimraf build && tsc",
+ "postcompile": "npm run build:cjs",
+ "build:cjs": "rollup -c rollup.config.cjs",
+ "postbuild:cjs": "rimraf ./build/index.cjs.d.ts",
+ "check": "gts lint && npm run check:js",
+ "check:js": "eslint . --ext cjs --ext mjs --ext js",
+ "clean": "gts clean"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/yargs/yargs.git"
+ },
+ "homepage": "https://yargs.js.org/",
+ "keywords": [
+ "argument",
+ "args",
+ "option",
+ "parser",
+ "parsing",
+ "cli",
+ "command"
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ }
+}
diff --git a/node_modules/yargs/yargs b/node_modules/yargs/yargs
new file mode 100644
index 0000000..8460d10
--- /dev/null
+++ b/node_modules/yargs/yargs
@@ -0,0 +1,9 @@
+// TODO: consolidate on using a helpers file at some point in the future, which
+// is the approach currently used to export Parser and applyExtends for ESM:
+const {applyExtends, cjsPlatformShim, Parser, Yargs, processArgv} = require('./build/index.cjs')
+Yargs.applyExtends = (config, cwd, mergeExtends) => {
+ return applyExtends(config, cwd, mergeExtends, cjsPlatformShim)
+}
+Yargs.hideBin = processArgv.hideBin
+Yargs.Parser = Parser
+module.exports = Yargs
diff --git a/node_modules/yargs/yargs.mjs b/node_modules/yargs/yargs.mjs
new file mode 100644
index 0000000..6d9f390
--- /dev/null
+++ b/node_modules/yargs/yargs.mjs
@@ -0,0 +1,10 @@
+// TODO: consolidate on using a helpers file at some point in the future, which
+// is the approach currently used to export Parser and applyExtends for ESM:
+import pkg from './build/index.cjs';
+const {applyExtends, cjsPlatformShim, Parser, processArgv, Yargs} = pkg;
+Yargs.applyExtends = (config, cwd, mergeExtends) => {
+ return applyExtends(config, cwd, mergeExtends, cjsPlatformShim);
+};
+Yargs.hideBin = processArgv.hideBin;
+Yargs.Parser = Parser;
+export default Yargs;
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..4f5f713
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,217 @@
+{
+ "name": "unicornshell",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "dependencies": {
+ "chalk": "^4.1.2",
+ "fuse.js": "^6.6.2",
+ "yargs": "^17.7.2"
+ }
+ },
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/cliui": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
+ "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.1",
+ "wrap-ansi": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
+ },
+ "node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="
+ },
+ "node_modules/escalade": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/fuse.js": {
+ "version": "6.6.2",
+ "resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-6.6.2.tgz",
+ "integrity": "sha512-cJaJkxCCxC8qIIcPBF9yGxY0W/tVZS3uEISDxhYIdtk8OL93pe+6Zj7LjCqVV4dzbqcriOZ+kQ/NE4RXZHsIGA==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "engines": {
+ "node": "6.* || 8.* || >= 10.*"
+ }
+ },
+ "node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/yargs": {
+ "version": "17.7.2",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
+ "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
+ "dependencies": {
+ "cliui": "^8.0.1",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.3",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^21.1.1"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/yargs-parser": {
+ "version": "21.1.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
+ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
+ "engines": {
+ "node": ">=12"
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..edb3253
--- /dev/null
+++ b/package.json
@@ -0,0 +1,7 @@
+{
+ "dependencies": {
+ "chalk": "^4.1.2",
+ "fuse.js": "^6.6.2",
+ "yargs": "^17.7.2"
+ }
+}
diff --git a/unish b/unish
new file mode 100755
index 0000000..aaf958c
--- /dev/null
+++ b/unish
@@ -0,0 +1,2 @@
+#!/bin/bash
+exec -a unish /usr/local/bin/node /Volumes/Projects/unicornshell/index.js $@ \ No newline at end of file