From d70d8ea59b501b8f7f7e6cd1a836ecd0a40ce916 Mon Sep 17 00:00:00 2001 From: rwietter Date: Thu, 19 Oct 2023 23:15:47 -0300 Subject: [PATCH 01/42] chore: add package.json with libraries and scripts --- package.json | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 00000000..be582dc8 --- /dev/null +++ b/package.json @@ -0,0 +1,25 @@ +{ + "name": "diciotech", + "version": "1.0.0", + "main": "index.js", + "repository": "git@github.com:rwietter/diciotech.git", + "author": "rwietter ", + "license": "MIT", + "scripts": { + "dev": "tsx watch cli/index.ts --ignore node_modules", + "new": "node cli/build/bundle.js", + "inspect": "node --inspect cli/build/bundle.js", + "build": "webpack --config webpack.config.js --mode production" + }, + "dependencies": { + "enquirer": "^2.4.1" + }, + "devDependencies": { + "@types/node": "^20.8.7", + "ts-loader": "^9.5.0", + "tsx": "^3.14.0", + "typescript": "^5.2.2", + "webpack": "^5.89.0", + "webpack-cli": "^5.1.4" + } +} From 22dc58926adf9f71aa1d49292da580f6f23faf77 Mon Sep 17 00:00:00 2001 From: rwietter Date: Thu, 19 Oct 2023 23:18:00 -0300 Subject: [PATCH 02/42] chore: add the log tree generated by npm --- package-lock.json | 2042 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2042 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..39597aa4 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,2042 @@ +{ + "name": "diciotech", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "diciotech", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "enquirer": "^2.4.1" + }, + "devDependencies": { + "@types/node": "^20.8.7", + "ts-loader": "^9.5.0", + "tsx": "^3.14.0", + "typescript": "^5.2.2", + "webpack": "^5.89.0", + "webpack-cli": "^5.1.4" + } + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", + "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", + "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", + "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", + "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", + "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", + "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", + "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", + "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", + "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", + "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", + "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", + "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", + "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", + "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", + "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", + "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", + "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", + "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", + "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", + "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", + "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", + "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", + "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.0", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", + "dev": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@types/eslint": { + "version": "8.44.6", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.6.tgz", + "integrity": "sha512-P6bY56TVmX8y9J87jHNgQh43h6VVU+6H7oN7hgvivV81K2XY8qJZ5vqPy/HdUoVIelii2kChYVzQanlswPWVFw==", + "dev": true, + "dependencies": { + "@types/estree": "*", + "@types/json-schema": "*" + } + }, + "node_modules/@types/eslint-scope": { + "version": "3.7.6", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.6.tgz", + "integrity": "sha512-zfM4ipmxVKWdxtDaJ3MP3pBurDXOCoyjvlpE3u6Qzrmw4BPbfm4/ambIeTk/r/J0iq/+2/xp0Fmt+gFvXJY2PQ==", + "dev": true, + "dependencies": { + "@types/eslint": "*", + "@types/estree": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.3.tgz", + "integrity": "sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.14", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", + "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.8.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.7.tgz", + "integrity": "sha512-21TKHHh3eUHIi2MloeptJWALuCu5H7HQTdTrWIFReA8ad+aggoX+lRes3ex7/FtpC+sVUpFMQ+QTfYr74mruiQ==", + "dev": true, + "dependencies": { + "undici-types": "~5.25.1" + } + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", + "integrity": "sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==", + "dev": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz", + "integrity": "sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz", + "integrity": "sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.6.tgz", + "integrity": "sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz", + "integrity": "sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==", + "dev": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz", + "integrity": "sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.6.tgz", + "integrity": "sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz", + "integrity": "sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==", + "dev": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.11.6.tgz", + "integrity": "sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==", + "dev": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.11.6.tgz", + "integrity": "sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.6.tgz", + "integrity": "sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/helper-wasm-section": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-opt": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6", + "@webassemblyjs/wast-printer": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.6.tgz", + "integrity": "sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.6.tgz", + "integrity": "sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-buffer": "1.11.6", + "@webassemblyjs/wasm-gen": "1.11.6", + "@webassemblyjs/wasm-parser": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz", + "integrity": "sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@webassemblyjs/helper-api-error": "1.11.6", + "@webassemblyjs/helper-wasm-bytecode": "1.11.6", + "@webassemblyjs/ieee754": "1.11.6", + "@webassemblyjs/leb128": "1.11.6", + "@webassemblyjs/utf8": "1.11.6" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.11.6", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.11.6.tgz", + "integrity": "sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.11.6", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webpack-cli/configtest": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", + "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", + "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", + "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-import-assertions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "dev": true, + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==", + "dev": true, + "peerDependencies": { + "ajv": "^6.9.1" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "engines": { + "node": ">=6" + } + }, + "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==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", + "node-releases": "^2.0.13", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001551", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001551.tgz", + "integrity": "sha512-vtBAez47BoGMMzlbYhfXrMV1kvRF2WP/lqiMuDu1Sb4EE4LKEgjopFDSRtZfdVnslNRpOqV/woE+Xgrwj6VQlg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", + "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", + "dev": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "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==", + "dev": true, + "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==", + "dev": true + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.4.561", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.561.tgz", + "integrity": "sha512-eS5t4ulWOBfVHdq9SW2dxEaFarj1lPjvJ8PaYMOjY0DecBaj/t4ARziL2IPpDr4atyWwjLFGQ2vo/VCgQFezVQ==", + "dev": true + }, + "node_modules/enhanced-resolve": { + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.15.0.tgz", + "integrity": "sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.2.0" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/envinfo": { + "version": "7.10.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz", + "integrity": "sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/es-module-lexer": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.1.tgz", + "integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.18.20", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", + "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.20", + "@esbuild/android-arm64": "0.18.20", + "@esbuild/android-x64": "0.18.20", + "@esbuild/darwin-arm64": "0.18.20", + "@esbuild/darwin-x64": "0.18.20", + "@esbuild/freebsd-arm64": "0.18.20", + "@esbuild/freebsd-x64": "0.18.20", + "@esbuild/linux-arm": "0.18.20", + "@esbuild/linux-arm64": "0.18.20", + "@esbuild/linux-ia32": "0.18.20", + "@esbuild/linux-loong64": "0.18.20", + "@esbuild/linux-mips64el": "0.18.20", + "@esbuild/linux-ppc64": "0.18.20", + "@esbuild/linux-riscv64": "0.18.20", + "@esbuild/linux-s390x": "0.18.20", + "@esbuild/linux-x64": "0.18.20", + "@esbuild/netbsd-x64": "0.18.20", + "@esbuild/openbsd-x64": "0.18.20", + "@esbuild/sunos-x64": "0.18.20", + "@esbuild/win32-arm64": "0.18.20", + "@esbuild/win32-ia32": "0.18.20", + "@esbuild/win32-x64": "0.18.20" + } + }, + "node_modules/escalade": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "4.7.2", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-4.7.2.tgz", + "integrity": "sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==", + "dev": true, + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==", + "dev": true + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", + "dev": true, + "engines": { + "node": ">= 0.4.0" + } + }, + "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==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/interpret": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/is-core-module": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", + "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest-worker/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loader-runner": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz", + "integrity": "sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg==", + "dev": true, + "engines": { + "node": ">=6.11.5" + } + }, + "node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/node-releases": { + "version": "2.0.13", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", + "dev": true + }, + "node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/rechoir": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "dev": true, + "dependencies": { + "resolve": "^1.20.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "dev": true, + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/schema-utils": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.3.0.tgz", + "integrity": "sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.8", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", + "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "dev": true, + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/source-map": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", + "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-support/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "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==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/tapable": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/terser": { + "version": "5.22.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.22.0.tgz", + "integrity": "sha512-hHZVLgRA2z4NWcN6aS5rQDc+7Dcy58HOf2zbYwmFcQ+ua3h6eEFf5lIDKTzbWwlazPyOZsFQO8V80/IjVNExEw==", + "dev": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.8.2", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser-webpack-plugin": { + "version": "5.3.9", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.9.tgz", + "integrity": "sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.17", + "jest-worker": "^27.4.5", + "schema-utils": "^3.1.1", + "serialize-javascript": "^6.0.1", + "terser": "^5.16.8" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/ts-loader": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.5.0.tgz", + "integrity": "sha512-LLlB/pkB4q9mW2yLdFMnK3dEHbrBjeZTYguaaIfusyojBgAGf5kF+O6KcWqiGzWqHk0LBsoolrp4VftEURhybg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "enhanced-resolve": "^5.0.0", + "micromatch": "^4.0.0", + "semver": "^7.3.4", + "source-map": "^0.7.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "typescript": "*", + "webpack": "^5.0.0" + } + }, + "node_modules/tsx": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-3.14.0.tgz", + "integrity": "sha512-xHtFaKtHxM9LOklMmJdI3BEnQq/D5F73Of2E1GDrITi9sgoVkvIsrQUTY1G8FlmGtA+awCI4EBlTRRYxkL2sRg==", + "dev": true, + "dependencies": { + "esbuild": "~0.18.20", + "get-tsconfig": "^4.7.2", + "source-map-support": "^0.5.21" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.25.3", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.25.3.tgz", + "integrity": "sha512-Ga1jfYwRn7+cP9v8auvEXN1rX3sWqlayd4HP7OKk4mZWylEmu3KzXDUGrQUN6Ol7qo1gPvB2e5gX6udnyEPgdA==", + "dev": true + }, + "node_modules/update-browserslist-db": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.1.1", + "picocolors": "^1.0.0" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/watchpack": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", + "integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==", + "dev": true, + "dependencies": { + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack": { + "version": "5.89.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.89.0.tgz", + "integrity": "sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==", + "dev": true, + "dependencies": { + "@types/eslint-scope": "^3.7.3", + "@types/estree": "^1.0.0", + "@webassemblyjs/ast": "^1.11.5", + "@webassemblyjs/wasm-edit": "^1.11.5", + "@webassemblyjs/wasm-parser": "^1.11.5", + "acorn": "^8.7.1", + "acorn-import-assertions": "^1.9.0", + "browserslist": "^4.14.5", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.15.0", + "es-module-lexer": "^1.2.1", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "glob-to-regexp": "^0.4.1", + "graceful-fs": "^4.2.9", + "json-parse-even-better-errors": "^2.3.1", + "loader-runner": "^4.2.0", + "mime-types": "^2.1.27", + "neo-async": "^2.6.2", + "schema-utils": "^3.2.0", + "tapable": "^2.1.1", + "terser-webpack-plugin": "^5.3.7", + "watchpack": "^2.4.0", + "webpack-sources": "^3.2.3" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-cli": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", + "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", + "dev": true, + "dependencies": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^2.1.1", + "@webpack-cli/info": "^2.0.2", + "@webpack-cli/serve": "^2.0.5", + "colorette": "^2.0.14", + "commander": "^10.0.1", + "cross-spawn": "^7.0.3", + "envinfo": "^7.7.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^3.1.1", + "rechoir": "^0.8.0", + "webpack-merge": "^5.7.3" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/webpack-cli/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/webpack-merge": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", + "integrity": "sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==", + "dev": true, + "dependencies": { + "clone-deep": "^4.0.1", + "flat": "^5.0.2", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/webpack-sources": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz", + "integrity": "sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wildcard": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", + "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } +} From 256c03c9b83accce1e0c68d748cca6b5ec9ee1eb Mon Sep 17 00:00:00 2001 From: rwietter Date: Thu, 19 Oct 2023 23:18:22 -0300 Subject: [PATCH 03/42] chore: add tsconfig for typescript --- tsconfig.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tsconfig.json diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..7ee4114a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "outDir": "./cli", + "noImplicitAny": true, + "allowJs": false, + "moduleResolution": "node", + "target": "ES2016", + "module": "ES6", + "strict": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitThis": true, + "alwaysStrict": true, + "noUnusedLocals": true, + "skipLibCheck": true, + "allowSyntheticDefaultImports": true, + }, + "exclude": ["node_modules"] +} From de600c5c5a84233f92af0c2b5bb4f14c84d6bb1a Mon Sep 17 00:00:00 2001 From: rwietter Date: Thu, 19 Oct 2023 23:19:00 -0300 Subject: [PATCH 04/42] chore: add webpack to build bundle CLI --- webpack.config.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 webpack.config.js diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 00000000..b50aa251 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,23 @@ +const path = require('path'); + +module.exports = { + entry: './cli/index.ts', + target: 'node', + module: { + rules: [ + { + test: /\.ts?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + ], + }, + resolve: { + extensions: ['.ts', '.js'], + }, + output: { + filename: 'bundle.js', + path: path.resolve(__dirname, 'cli', 'build'), + }, + mode: 'production', +}; \ No newline at end of file From 3840546535994351ebe3780a4766034d4515bb9a Mon Sep 17 00:00:00 2001 From: rwietter Date: Thu, 19 Oct 2023 23:24:31 -0300 Subject: [PATCH 05/42] chore: update package.json with correctly informations about repository --- package.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index be582dc8..6435a774 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,20 @@ { "name": "diciotech", - "version": "1.0.0", - "main": "index.js", - "repository": "git@github.com:rwietter/diciotech.git", - "author": "rwietter ", - "license": "MIT", + "version": "0.0.1", + "main": "cli/build/bundle.js", + "repository": "https://github.com/levxyca/diciotech.git", + "author": "levxyca ", + "license": "GPL-3.0", + "description": "Um dicionário tech para pessoas que querem aprender mais sobre termos técnicos dentro da tecnologia 📖", "scripts": { "dev": "tsx watch cli/index.ts --ignore node_modules", "new": "node cli/build/bundle.js", "inspect": "node --inspect cli/build/bundle.js", "build": "webpack --config webpack.config.js --mode production" }, + "engines": { + "node": ">=18.17.1" + }, "dependencies": { "enquirer": "^2.4.1" }, From c0864075d19a95c9dbb9fe754ad9217c87a4dbca Mon Sep 17 00:00:00 2001 From: rwietter Date: Thu, 19 Oct 2023 23:25:17 -0300 Subject: [PATCH 06/42] chore: ignore node_modules --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 32d92197..814375f5 100644 --- a/.gitignore +++ b/.gitignore @@ -75,4 +75,7 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk +# Node.js +node_modules/ + # End of https://www.toptal.com/developers/gitignore/api/windows,macos,linux \ No newline at end of file From 5918ca8af6c29434df29514916adacf8a7331a79 Mon Sep 17 00:00:00 2001 From: rwietter Date: Thu, 19 Oct 2023 23:27:32 -0300 Subject: [PATCH 07/42] feat(cli): add functionality for creating new terms in diciotech --- cli/index.ts | 195 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 cli/index.ts diff --git a/cli/index.ts b/cli/index.ts new file mode 100644 index 00000000..85e02d8e --- /dev/null +++ b/cli/index.ts @@ -0,0 +1,195 @@ +import * as enquirer from "enquirer"; +import path from "path"; +const { MultiSelect } = require("enquirer"); +import fs from "node:fs"; +import crypto from "node:crypto"; + +const cardsPath = path.join( + __dirname, + "..", + "..", + "assets", + "data", + "cards_pt-br.json" +); + +type Questions = { + title: string; + description: string; + code: string; +}; + +type Term = { + id: string; + title: string; + description: string; + code: string; + tags: string[]; +}; + +const basePrompt = { + type: "input", + required: true, +}; + +const validations = { + title: (input: string) => { + const raw = input.trim(); + + if (raw.trim().length < 2) { + return "O título precisa ter pelo menos 3 caracteres."; + } + return true; + }, + description: (input: string) => { + const raw = input.trim(); + + if (raw.length < 10) { + return "A descrição precisa ter pelo menos 10 caracteres."; + } + + return true; + }, + tags: (input: string[]) => { + if (input.length < 1) { + return "Você precisa selecionar pelo menos uma tag."; + } + return true; + }, +}; + +/** + * Prompts the user for the term's information. + * @returns {Object} The term's information. + * @throws {Error} If the user doesn't provide the required information. + */ +const prompts = async () => { + const questions: Questions = await enquirer.prompt([ + { + ...basePrompt, + name: "title", + message: "Qual título o seu conceito tem ?", + validate: validations.title, + }, + { + ...basePrompt, + name: "description", + message: "Qual descrição o seu conceito tem ?", + validate: validations.description, + }, + { + type: "input", + name: "code", + message: "Seu conceito tem algum código ? (opcional)", + }, + ]); + + const availableTags = [ + "Back-end", + "Biblioteca", + "Conceito", + "Design", + "Ferramenta", + "Framework", + "Front-end", + "Mobile", + "Paradigma", + "Versionamento", + ]; + + const tags = new MultiSelect({ + name: "tags", + message: "Selecione as tags relacionadas ao seu conceito", + choices: availableTags, + validate: validations.tags, + }); + + const tagsPrompt: string[] = await tags.run(); + + const card = { + id: crypto.randomBytes(16).toString("hex"), + title: questions.title, + description: questions.description, + code: questions.code, + tags: tagsPrompt, + }; + + return card; +}; + +/** + * Reads the content of a file. + * + * @param {string} path - The path of the file to be read. + * @returns {string} The content of the read file. + */ +const readFileContents = (path: string) => fs.readFileSync(path, "utf8"); + +/** + * Parses terms from a JSON. + * + * @param {string} json - JSON containing the terms. + * @returns {Array} An array of terms. + */ +const parseJSONTerms = (json: string): Term[] => (Object.values(JSON.parse(json)) as Term[]).flat(); + +/** + * Adds a new term to an array of existing terms. + * + * @param {Array} terms - An array of existing terms. + * @param {Object} newTerm - The new term to be added. + * @returns {Array} The updated array of terms. + */ +const addNewTermToArray = (terms: Term[], newTerm: Term) => [...terms, newTerm]; + +/** + * Writes updated terms to a file. + * + * @param {string} path - The path of the file to be written. + * @param {Array} terms - An array of terms to be written to the file. + */ +const writeUpdatedTermsToFile = (path: string, terms: Term[]) => fs.writeFileSync(path, JSON.stringify({ cards: terms }, null, 2)); + +/** + * Compounds all the steps to write a new term to a file. + * + * @param {Object} newTerm - The term to be written to the file. + */ +const writeTermToFile = (newTerm: Term, filepath: string) => + writeUpdatedTermsToFile( + filepath, + addNewTermToArray(parseJSONTerms(readFileContents(filepath)), newTerm) + ); + +/** + * Repeats a character a given amount of times. + * @param {string} c - The character to be repeated. + * @param {number} qt - The amount of times the character should be repeated. + * @returns {string} The repeated character. + */ +const dash = (c: string) => (qt: number) => c.repeat(qt); + +const dasher = dash("—")(50) + +const main = async () => { + try { + writeTermToFile(await prompts(), cardsPath); + console.log(`\n${dasher}`); + console.log(`✔️ Novo termo adicionado com sucesso!`); + console.log(dasher); + } catch (error: unknown) { + console.log(`\n${dasher}`); + console.error("❌ Ocorreu um erro ao adicionar o novo termo."); + console.error("❌ Tente novamente seguindo as instruções."); + console.error( + "❌ Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues." + ); + console.log(dasher); + + if (error instanceof Error) { + console.error(`❌ ${error.message}\n`); + } + } +}; + +main(); From 5ad590784571cda5448e7db9b37debaf9155fdf7 Mon Sep 17 00:00:00 2001 From: rwietter Date: Thu, 19 Oct 2023 23:28:48 -0300 Subject: [PATCH 08/42] build(cli): bundle ready to run with Node.js, packaged with webpack --- cli/build/bundle.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 cli/build/bundle.js diff --git a/cli/build/bundle.js b/cli/build/bundle.js new file mode 100644 index 00000000..af82c1cc --- /dev/null +++ b/cli/build/bundle.js @@ -0,0 +1 @@ +(()=>{var t={730:(t,e,i)=>{"use strict";const s=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,r=()=>{const t={enabled:"undefined"!=typeof process&&"0"!==process.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},e=(t,e,i)=>"function"==typeof t?t(e):t.wrap(e,i),r=(i,s)=>{if(""===i||null==i)return"";if(!1===t.enabled)return i;if(!1===t.visible)return"";let r=""+i,n=r.includes("\n"),a=s.length;for(a>0&&s.includes("unstyle")&&(s=[...new Set(["unstyle",...s])].reverse());a-- >0;)r=e(t.styles[s[a]],r,n);return r},n=(e,i,s)=>{t.styles[e]=(t=>{let e=t.open=`[${t.codes[0]}m`,i=t.close=`[${t.codes[1]}m`,s=t.regex=new RegExp(`\\u001b\\[${t.codes[1]}m`,"g");return t.wrap=(t,r)=>{t.includes(i)&&(t=t.replace(s,i+e));let n=e+t+i;return r?n.replace(/\r*\n/g,`${i}$&${e}`):n},t})({name:e,codes:i}),(t.keys[s]||(t.keys[s]=[])).push(e),Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,set(i){t.alias(e,i)},get(){let i=t=>r(t,i.stack);return Reflect.setPrototypeOf(i,t),i.stack=this.stack?this.stack.concat(e):[e],i}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=s,t.hasColor=t.hasAnsi=e=>(t.ansiRegex.lastIndex=0,"string"==typeof e&&""!==e&&t.ansiRegex.test(e)),t.alias=(e,i)=>{let s="string"==typeof i?t[i]:i;if("function"!=typeof s)throw new TypeError("Expected alias to be the name of an existing color (string) or a function");s.stack||(Reflect.defineProperty(s,"name",{value:e}),t.styles[e]=s,s.stack=[e]),Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,set(i){t.alias(e,i)},get(){let e=t=>r(t,e.stack);return Reflect.setPrototypeOf(e,t),e.stack=this.stack?this.stack.concat(s.stack):s.stack,e}})},t.theme=e=>{if(null===(i=e)||"object"!=typeof i||Array.isArray(i))throw new TypeError("Expected theme to be an object");var i;for(let i of Object.keys(e))t.alias(i,e[i]);return t},t.alias("unstyle",(e=>"string"==typeof e&&""!==e?(t.ansiRegex.lastIndex=0,e.replace(t.ansiRegex,"")):"")),t.alias("noop",(t=>t)),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=i(142),t.define=n,t};t.exports=r(),t.exports.create=r},142:t=>{"use strict";const e="undefined"!=typeof process&&"Hyper"===process.env.TERM_PROGRAM,i="undefined"!=typeof process&&"win32"===process.platform,s="undefined"!=typeof process&&"linux"===process.platform,r={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},n=Object.assign({},r,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),a=Object.assign({},r,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:s?"▸":"❯",pointerSmall:s?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});t.exports=i&&!e?n:a,Reflect.defineProperty(t.exports,"common",{enumerable:!1,value:r}),Reflect.defineProperty(t.exports,"windows",{enumerable:!1,value:n}),Reflect.defineProperty(t.exports,"other",{enumerable:!1,value:a})},277:t=>{"use strict";t.exports=({onlyFirst:t=!1}={})=>{const e=["[\\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(e,t?void 0:"g")}},31:(t,e,i)=>{"use strict";const s=i(491),r=i(361),n=i(546);class a extends r{constructor(t,e){super(),this.options=n.merge({},t),this.answers={...e}}register(t,e){if(n.isObject(t)){for(let e of Object.keys(t))this.register(e,t[e]);return this}s.equal(typeof e,"function","expected a function");const i=t.toLowerCase();return e.prototype instanceof this.Prompt?this.prompts[i]=e:this.prompts[i]=e(this.Prompt,this),this}async prompt(t=[]){for(let e of[].concat(t))try{"function"==typeof e&&(e=await e.call(this)),await this.ask(n.merge({},this.options,e))}catch(t){return Promise.reject(t)}return this.answers}async ask(t){"function"==typeof t&&(t=await t.call(this));let e=n.merge({},this.options,t),{type:i,name:r}=t,{set:a,get:o}=n;if("function"==typeof i&&(i=await i.call(this,t,this.answers)),!i)return this.answers[r];"number"===i&&(i="numeral"),s(this.prompts[i],`Prompt "${i}" is not registered`);let l=new this.prompts[i](e),h=o(this.answers,r);l.state.answers=this.answers,l.enquirer=this,r&&l.on("submit",(t=>{this.emit("answer",r,t,l),a(this.answers,r,t)}));let u=l.emit.bind(l);return l.emit=(...t)=>(this.emit.call(this,...t),u(...t)),this.emit("prompt",l,this),e.autofill&&null!=h?(l.value=l.input=h,"show"===e.autofill&&await l.submit()):h=l.value=await l.run(),h}use(t){return t.call(this,this),this}set Prompt(t){this._Prompt=t}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(t){this._Prompt=t}static get Prompt(){return this._Prompt||i(232)}static get prompts(){return i(594)}static get types(){return i(920)}static get prompt(){const t=(e,...i)=>{let s=new this(...i),r=s.emit.bind(s);return s.emit=(...e)=>(t.emit(...e),r(...e)),s.prompt(e)};return n.mixinEmitter(t,new r),t}}n.mixinEmitter(a,new r);const o=a.prompts;for(let t of Object.keys(o)){let e=t.toLowerCase(),i=e=>new o[t](e).run();a.prompt[e]=i,a[e]=i,a[t]||Reflect.defineProperty(a,t,{get:()=>o[t]})}const l=t=>{n.defineExport(a,t,(()=>a.types[t]))};l("ArrayPrompt"),l("AuthPrompt"),l("BooleanPrompt"),l("NumberPrompt"),l("StringPrompt"),t.exports=a},907:(t,e,i)=>{"use strict";const s="Apple_Terminal"===process.env.TERM_PROGRAM,r=i(3),n=i(546),a=t.exports=e,o="[";let l=!1;const h=a.code={bell:"",beep:"",beginning:`${o}G`,down:`${o}J`,esc:o,getPosition:`${o}6n`,hide:`${o}?25l`,line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,restorePosition:o+(s?"8":"u"),savePosition:o+(s?"7":"s"),screen:`${o}2J`,show:`${o}?25h`,up:`${o}1J`},u=a.cursor={get hidden(){return l},hide:()=>(l=!0,h.hide),show:()=>(l=!1,h.show),forward:(t=1)=>`${o}${t}C`,backward:(t=1)=>`${o}${t}D`,nextLine:(t=1)=>`${o}E`.repeat(t),prevLine:(t=1)=>`${o}F`.repeat(t),up:(t=1)=>t?`${o}${t}A`:"",down:(t=1)=>t?`${o}${t}B`:"",right:(t=1)=>t?`${o}${t}C`:"",left:(t=1)=>t?`${o}${t}D`:"",to:(t,e)=>e?`${o}${e+1};${t+1}H`:`${o}${t+1}G`,move(t=0,e=0){let i="";return i+=t<0?u.left(-t):t>0?u.right(t):"",i+=e<0?u.up(-e):e>0?u.down(e):"",i},strLen(t){for(var e=0,i=t.length,s=-1,r=0;r=0&&s<=128?1:2;return e},restore(t={}){let{after:e,cursor:i,initial:s,input:r,prompt:o,size:l,value:h}=t;if(s=n.isPrimitive(s)?String(s):"",r=n.isPrimitive(r)?String(r):"",h=n.isPrimitive(h)?String(h):"",l){let t=a.cursor.up(l)+a.cursor.to(this.strLen(o)),e=r.length-i;return e>0&&(t+=a.cursor.left(e)),t}if(h||e){let t=!r&&s?-this.strLen(s):-this.strLen(r)+i;return e&&(t-=this.strLen(e)),""===r&&s&&!o.includes(s)&&(t+=this.strLen(s)),a.cursor.move(t)}}},c=a.erase={screen:h.screen,up:h.up,down:h.down,line:h.line,lineEnd:h.lineEnd,lineStart:h.lineStart,lines(t){let e="";for(let i=0;i{if(!e)return c.line+u.to(0);let i=t.split(/\r?\n/),s=0;for(let t of i)s+=1+Math.floor(Math.max([...r(t)].length-1,0)/e);return(c.line+u.prevLine()).repeat(s-1)+c.line+u.to(0)}},726:(t,e)=>{"use strict";e.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"},e.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"},e.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"},e.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"},e.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}},736:t=>{"use strict";const e=t=>(t=>t.filter(((e,i)=>t.lastIndexOf(e)===i)))(t).filter(Boolean);t.exports=(t,i={},s="")=>{let r,n,{past:a=[],present:o=""}=i;switch(t){case"prev":case"undo":return r=a.slice(0,a.length-1),n=a[a.length-1]||"",{past:e([s,...r]),present:n};case"next":case"redo":return r=a.slice(1),n=a[0]||"",{past:e([...r,s]),present:n};case"save":return{past:e([...a,s]),present:""};case"remove":return n=e(a.filter((t=>t!==s))),o="",n.length&&(o=n.pop()),{past:n,present:o};default:throw new Error(`Invalid action: "${t}"`)}}},189:(t,e,i)=>{"use strict";const s=i(3);class r{constructor(t){this.name=t.key,this.field=t.field||{},this.value=((t="")=>"string"==typeof t?t.replace(/^['"]|['"]$/g,""):"")(t.initial||this.field.initial||""),this.message=t.message||this.name,this.cursor=0,this.input="",this.lines=[]}}function n(t,e,i,s){return(i,r,n,a)=>"function"==typeof n.field[t]?n.field[t].call(e,i,r,n,a):[s,i].find((t=>e.isValue(t)))}t.exports=async t=>{let e=t.options,i=new Set(!0===e.required?[]:e.required||[]),a={...e.values,...e.initial},{tabstops:o,items:l,keys:h}=await(async(t={},e={},i=(t=>t))=>{let s=new Set,n=t.fields||[],a=t.template,o=[],l=[],h=[],u=1;"function"==typeof a&&(a=await a());let c=-1,d=()=>a[++c],p=()=>a[c+1],m=t=>{t.line=u,o.push(t)};for(m({type:"bos",value:""});ct.name===o.key));o.field=n.find((t=>t.name===o.key)),u||(u=new r(o),l.push(u)),u.lines.push(o.line-1);continue}let a=o[o.length-1];"text"===a.type&&a.line===u?a.value+=t:m({type:"text",value:t})}return m({type:"eos",value:""}),{input:a,tabstops:o,unique:s,keys:h,items:l}})(e,a),u=n("result",t),c=n("format",t),d=n("validate",t,0,!0),p=t.isValue.bind(t);return async(r={},n=!1)=>{let a=0;r.required=i,r.items=l,r.keys=h,r.output="";let m=async(t,e,i,s)=>{let r=await d(t,e,i,s);return!1===r?"Invalid field "+i.name:r};for(let i of o){let o=i.value,h=i.key;if("template"===i.type){if("template"===i.type){let d=l.find((t=>t.name===h));!0===e.required&&r.required.add(d.name);let f=[d.input,r.values[d.value],d.value,o].find(p),g=(d.field||{}).message||i.inner;if(n){let t=await m(r.values[h],r,d,a);if(t&&"string"==typeof t||!1===t){r.invalid.set(h,t);continue}r.invalid.delete(h);let e=await u(r.values[h],r,d,a);r.output+=s(e);continue}d.placeholder=!1;let y=o;o=await c(o,r,d,a),f!==o?(r.values[h]=f,o=t.styles.typing(f),r.missing.delete(g)):(r.values[h]=void 0,f=`<${g}>`,o=t.styles.primary(f),d.placeholder=!0,r.required.has(h)&&r.missing.add(g)),r.missing.has(g)&&r.validating&&(o=t.styles.warning(f)),r.invalid.has(h)&&r.validating&&(o=t.styles.danger(f)),a===r.index&&(o=y!==o?t.styles.underline(o):t.styles.heading(s(o))),a++}o&&(r.output+=o)}else o&&(r.output+=o)}let f=r.output.split("\n").map((t=>" "+t)),g=l.length,y=0;for(let e of l)r.invalid.has(e.name)&&e.lines.forEach((t=>{" "===f[t][0]&&(f[t]=r.styles.danger(r.symbols.bullet)+f[t].slice(1))})),t.isValue(r.values[e.name])&&y++;return r.completed=(y/g*100).toFixed(0),r.output=f.join("\n"),r.output}}},914:(t,e,i)=>{"use strict";const s=i(521),r=i(726),n=i(607),a=/^(?:\x1b)([a-zA-Z0-9])$/,o=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,l={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"},h=(t="",e={})=>{let i,s={name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:t,raw:t,...e};if(Buffer.isBuffer(t)?t[0]>127&&void 0===t[1]?(t[0]-=128,t=""+String(t)):t=String(t):void 0!==t&&"string"!=typeof t?t=String(t):t||(t=s.sequence||""),s.sequence=s.sequence||t||s.name,"\r"===t)s.raw=void 0,s.name="return";else if("\n"===t)s.name="enter";else if("\t"===t)s.name="tab";else if("\b"===t||""===t||""===t||"\b"===t)s.name="backspace",s.meta=""===t.charAt(0);else if(""===t||""===t)s.name="escape",s.meta=2===t.length;else if(" "===t||" "===t)s.name="space",s.meta=2===t.length;else if(t<="")s.name=String.fromCharCode(t.charCodeAt(0)+"a".charCodeAt(0)-1),s.ctrl=!0;else if(1===t.length&&t>="0"&&t<="9")s.name="number";else if(1===t.length&&t>="a"&&t<="z")s.name=t;else if(1===t.length&&t>="A"&&t<="Z")s.name=t.toLowerCase(),s.shift=!0;else if(i=a.exec(t))s.meta=!0,s.shift=/^[A-Z]$/.test(i[1]);else if(i=o.exec(t)){let e=[...t];""===e[0]&&""===e[1]&&(s.option=!0);let r=[i[1],i[2],i[4],i[6]].filter(Boolean).join(""),n=(i[3]||i[5]||1)-1;s.ctrl=!!(4&n),s.meta=!!(10&n),s.shift=!!(1&n),s.code=r,s.name=l[r],s.shift=function(t){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(t)}(r)||s.shift,s.ctrl=function(t){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(t)}(r)||s.ctrl}return s};h.listen=(t={},e)=>{let{stdin:i}=t;if(!i||i!==process.stdin&&!i.isTTY)throw new Error("Invalid stream passed");let r=s.createInterface({terminal:!0,input:i});s.emitKeypressEvents(i,r);const a=new n(((t,i)=>e(t,h(t,i),r)));let o=i.isRaw;return i.isTTY&&i.setRawMode(!0),i.on("keypress",a.enqueue),r.resume(),()=>{i.isTTY&&i.setRawMode(o),i.removeListener("keypress",a.enqueue),a.destroy(),r.pause(),r.close()}},h.action=(t,e,i)=>{let s={...r,...i};return e.ctrl?(e.action=s.ctrl[e.name],e):e.option&&s.option?(e.action=s.option[e.name],e):e.shift?(e.action=s.shift[e.name],e):(e.action=s.keys[e.name],e)},t.exports=h},786:(t,e,i)=>{"use strict";const s=i(546);t.exports=(t,e={})=>{t.cursorHide();let{input:i="",initial:r="",pos:n,showCursor:a=!0,color:o}=e,l=o||t.styles.placeholder,h=s.inverse(t.styles.primary),u=e=>h(t.styles.black(e)),c=i,d=u(" ");if(t.blink&&!0===t.blink.off&&(u=t=>t,d=""),a&&0===n&&""===r&&""===i)return u(" ");if(a&&0===n&&(i===r||""===i))return u(r[0])+l(r.slice(1));r=s.isPrimitive(r)?`${r}`:"",i=s.isPrimitive(i)?`${i}`:"";let p=r&&r.startsWith(i)&&r!==i,m=p?u(r[i.length]):d;if(n!==i.length&&!0===a&&(c=i.slice(0,n)+u(i[n])+i.slice(n+1),m=""),!1===a&&(m=""),p){let e=t.styles.unstyle(c+m);return c+m+l(r.slice(e.length))}return c+m}},232:(t,e,i)=>{"use strict";const s=i(361),r=i(3),n=i(914),a=i(940),o=i(873),l=i(227),h=i(546),u=i(907);class c extends s{constructor(t={}){super(),this.name=t.name,this.type=t.type,this.options=t,l(this),a(this),this.state=new o(this),this.initial=[t.initial,t.default].find((t=>null!=t)),this.stdout=t.stdout||process.stdout,this.stdin=t.stdin||process.stdin,this.scale=t.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=function(t){"number"==typeof t&&(t=[t,t,t,t]);let e=[].concat(t||[]),i=t=>t%2==0?"\n":" ",s=[];for(let t=0;t<4;t++){let r=i(t);e[t]?s.push(r.repeat(e[t])):s.push("")}return s}(this.options.margin),this.setMaxListeners(0),function(t){let e=e=>void 0===t[e]||"function"==typeof t[e],i=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],s=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let r of Object.keys(t.options)){if(i.includes(r))continue;if(/^on[A-Z]/.test(r))continue;let n=t.options[r];"function"==typeof n&&e(r)?s.includes(r)||(t[r]=n.bind(t)):"function"!=typeof t[r]&&(t[r]=n)}}(this)}async keypress(t,e={}){this.keypressed=!0;let i=n.action(t,n(t,e),this.options.actions);this.state.keypress=i,this.emit("keypress",t,i),this.emit("state",this.state.clone());const s=this.options[i.action]||this[i.action]||this.dispatch;if("function"==typeof s)return await s.call(this,t,i);this.alert()}alert(){delete this.state.alert,!1===this.options.show?this.emit("alert"):this.stdout.write(u.code.beep)}cursorHide(){this.stdout.write(u.cursor.hide());const t=h.onExit((()=>this.cursorShow()));this.on("close",(()=>{this.cursorShow(),t()}))}cursorShow(){this.stdout.write(u.cursor.show())}write(t){t&&(this.stdout&&!1!==this.state.show&&this.stdout.write(t),this.state.buffer+=t)}clear(t=0){let e=this.state.buffer;this.state.buffer="",(e||t)&&!1!==this.options.show&&this.stdout.write(u.cursor.down(t)+u.clear(e,this.width))}restore(){if(this.state.closed||!1===this.options.show)return;let{prompt:t,after:e,rest:i}=this.sections(),{cursor:s,initial:r="",input:n="",value:a=""}=this,o={after:e,cursor:s,initial:r,input:n,prompt:t,size:this.state.size=i.length,value:a},l=u.cursor.restore(o);l&&this.stdout.write(l)}sections(){let{buffer:t,input:e,prompt:i}=this.state;i=r(i);let s=r(t),n=s.indexOf(i),a=s.slice(0,n),o=s.slice(n).split("\n"),l=o[0],h=o[o.length-1],u=(i+(e?" "+e:"")).length,c=ut.call(this,this.value),this.result=()=>i.call(this,this.value),"function"==typeof e.initial&&(this.initial=await e.initial.call(this,this)),"function"==typeof e.onRun&&await e.onRun.call(this,this),"function"==typeof e.onSubmit){let t=e.onSubmit.bind(this),i=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await t(this.name,this.value,this),i())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise((async(t,e)=>{if(this.once("submit",t),this.once("cancel",e),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")}))}async element(t,e,i){let{options:s,state:r,symbols:n,timers:a}=this,o=a&&a[t];r.timer=o;let l=s[t]||r[t]||n[t],h=e&&null!=e[t]?e[t]:await l;if(""===h)return h;let u=await this.resolve(h,r,e,i);return!u&&e&&e[t]?this.resolve(l,r,e,i):u}async prefix(){let t=await this.element("prefix")||this.symbols,e=this.timers&&this.timers.prefix,i=this.state;return i.timer=e,h.isObject(t)&&(t=t[i.status]||t.pending),h.hasColor(t)?t:(this.styles[i.status]||this.styles.pending)(t)}async message(){let t=await this.element("message");return h.hasColor(t)?t:this.styles.strong(t)}async separator(){let t=await this.element("separator")||this.symbols,e=this.timers&&this.timers.separator,i=this.state;i.timer=e;let s=t[i.status]||t.pending||i.separator,r=await this.resolve(s,i);return h.isObject(r)&&(r=r[i.status]||r.pending),h.hasColor(r)?r:this.styles.muted(r)}async pointer(t,e){let i=await this.element("pointer",t,e);if("string"==typeof i&&h.hasColor(i))return i;if(i){let t=this.styles,s=this.index===e,r=s?t.primary:t=>t,n=await this.resolve(i[s?"on":"off"]||i,this.state),a=h.hasColor(n)?n:r(n);return s?a:" ".repeat(n.length)}}async indicator(t,e){let i=await this.element("indicator",t,e);if("string"==typeof i&&h.hasColor(i))return i;if(i){let e=this.styles,s=!0===t.enabled,r=s?e.success:e.dark,n=i[s?"on":"off"]||i;return h.hasColor(n)?n:r(n)}return""}body(){return null}footer(){if("pending"===this.state.status)return this.element("footer")}header(){if("pending"===this.state.status)return this.element("header")}async hint(){if("pending"===this.state.status&&!this.isValue(this.state.input)){let t=await this.element("hint");return h.hasColor(t)?t:this.styles.muted(t)}}error(t){return this.state.submitted?"":t||this.state.error}format(t){return t}result(t){return t}validate(t){return!0!==this.options.required||this.isValue(t)}isValue(t){return null!=t&&""!==t}resolve(t,...e){return h.resolve(this,t,...e)}get base(){return c.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||h.height(this.stdout,25)}get width(){return this.options.columns||h.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(t){this.state.cursor=t}get cursor(){return this.state.cursor}set input(t){this.state.input=t}get input(){return this.state.input}set value(t){this.state.value=t}get value(){let{input:t,value:e}=this.state,i=[e,t].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return t=>new this(t).run()}}t.exports=c},317:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){super(t),this.cursorShow()}moveCursor(t){this.state.cursor+=t}dispatch(t){return this.append(t)}space(t){return this.options.multiple?super.space(t):this.append(t)}append(t){let{cursor:e,input:i}=this.state;return this.input=i.slice(0,e)+t+i.slice(e),this.moveCursor(1),this.complete()}delete(){let{cursor:t,input:e}=this.state;return e?(this.input=e.slice(0,t-1)+e.slice(t),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:t,input:e}=this.state;return void 0===e[t]?this.alert():(this.input=`${e}`.slice(0,t)+`${e}`.slice(t+1),this.complete())}number(t){return this.append(t)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(t=this.input,e=this.state._choices){if("function"==typeof this.options.suggest)return this.options.suggest.call(this,t,e);let i=t.toLowerCase();return e.filter((t=>t.message.toLowerCase().includes(i)))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map((t=>this.styles.primary(t.message))).join(", ");if(this.state.submitted){let t=this.value=this.input=this.focused.value;return this.styles.primary(t)}return this.input}async render(){if("pending"!==this.state.status)return super.render();const t=this.options.highlight||this.styles.complement,e=((t,e)=>{const i=t?new RegExp(t,"ig"):/$^/;return s=>t?s.replace(i,(t=>e(t))):s})(this.input,((e,i)=>e?t.stack?t(e):t.call(this,e):e)),i=this.choices;this.choices=i.map((t=>({...t,message:e(t.message)}))),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map((t=>t.name))),super.submit()}}},186:(t,e,i)=>{"use strict";const s=i(926);function r(t,e){return t.username===this.options.username&&t.password===this.options.password}const n=(t=r)=>{const e=[{name:"username",message:"username"},{name:"password",message:"password",format(t){return this.options.showPassword?t:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(t.length))}}];class i extends(s.create(t)){constructor(t){super({...t,choices:e})}static create(t){return n(t)}}return i};t.exports=n()},291:(t,e,i)=>{"use strict";const s=i(838);t.exports=class extends s{constructor(t){super(t),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}}},848:(t,e,i)=>{"use strict";const s=i(466),r=i(826).prototype;t.exports=class extends s{constructor(t){super({...t,multiple:!0}),this.align=[this.options.align,"left"].find((t=>null!=t)),this.emptyError="",this.values={}}dispatch(t,e){let i=this.focused,s=i.parent||{};return i.editable||s.editable||"a"!==t&&"i"!==t?r.dispatch.call(this,t,e):super[t]()}append(t,e){return r.append.call(this,t,e)}delete(t,e){return r.delete.call(this,t,e)}space(t){return this.focused.editable?this.append(t):super.space()}number(t){return this.focused.editable?this.append(t):super.number(t)}next(){return this.focused.editable?r.next.call(this):super.next()}prev(){return this.focused.editable?r.prev.call(this):super.prev()}async indicator(t,e){let i=t.indicator||"",s=t.editable?i:super.indicator(t,e);return await this.resolve(s,this.state,t,e)||""}indent(t){return"heading"===t.role?"":t.editable?" ":" "}async renderChoice(t,e){return t.indent="",t.editable?r.renderChoice.call(this,t,e):super.renderChoice(t,e)}error(){return""}footer(){return this.state.error}async validate(){let t=!0;for(let e of this.choices){if("function"!=typeof e.validate)continue;if("heading"===e.role)continue;let i=e.parent?this.value[e.parent.name]:this.value;if(e.editable?i=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(i=!0===e.enabled),t=await e.validate(i,this.state),!0!==t)break}return!0!==t&&(this.state.error="string"==typeof t?t:"Invalid Input"),t}submit(){if(!0===this.focused.newChoice)return super.submit();if(this.choices.some((t=>t.newChoice)))return this.alert();this.value={};for(let t of this.choices){let e=t.parent?this.value[t.parent.name]:this.value;"heading"!==t.role?t.editable?e[t.name]=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(e[t.name]=!0===t.enabled):this.value[t.name]={}}return this.base.submit.call(this)}}},826:(t,e,i)=>{"use strict";const s=i(3),r=i(466),n=i(786);t.exports=class extends r{constructor(t){super({...t,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find((t=>null!=t)),this.emptyError="",this.values={}}async reset(t){return await super.reset(),!0===t&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach((t=>t.reset&&t.reset())),this.render()}dispatch(t){return!!t&&this.append(t)}append(t){let e=this.focused;if(!e)return this.alert();let{cursor:i,input:s}=e;return e.value=e.input=s.slice(0,i)+t+s.slice(i),e.cursor++,this.render()}delete(){let t=this.focused;if(!t||t.cursor<=0)return this.alert();let{cursor:e,input:i}=t;return t.value=t.input=i.slice(0,e-1)+i.slice(e),t.cursor--,this.render()}deleteForward(){let t=this.focused;if(!t)return this.alert();let{cursor:e,input:i}=t;if(void 0===i[e])return this.alert();let s=`${i}`.slice(0,e)+`${i}`.slice(e+1);return t.value=t.input=s,this.render()}right(){let t=this.focused;return t?t.cursor>=t.input.length?this.alert():(t.cursor++,this.render()):this.alert()}left(){let t=this.focused;return t?t.cursor<=0?this.alert():(t.cursor--,this.render()):this.alert()}space(t,e){return this.dispatch(t,e)}number(t,e){return this.dispatch(t,e)}next(){let t=this.focused;if(!t)return this.alert();let{initial:e,input:i}=t;return e&&e.startsWith(i)&&i!==e?(t.value=t.input=e,t.cursor=t.value.length,this.render()):super.next()}prev(){let t=this.focused;return t?0===t.cursor?super.prev():(t.value=t.input="",t.cursor=0,this.render()):this.alert()}separator(){return""}format(t){return this.state.submitted?"":super.format(t)}pointer(){return""}indicator(t){return t.input?"⦿":"⊙"}async choiceSeparator(t,e){let i=await this.resolve(t.separator,this.state,t,e)||":";return i?" "+this.styles.disabled(i):""}async renderChoice(t,e){await this.onChoice(t,e);let{state:i,styles:r}=this,{cursor:a,initial:o="",name:l,input:h=""}=t,{muted:u,submitted:c,primary:d,danger:p}=r,m=this.index===e,f=t.validate||(()=>!0),g=await this.choiceSeparator(t,e),y=t.message;"right"===this.align&&(y=y.padStart(this.longest+1," ")),"left"===this.align&&(y=y.padEnd(this.longest+1," "));let b=this.values[l]=h||o,w=h?"success":"dark";!0!==await f.call(t,b,this.state)&&(w="danger");let v=(0,r[w])(await this.indicator(t,e))+(t.pad||""),x=this.indent(t),k=()=>[x,v,y+g,h].filter(Boolean).join(" ");if(i.submitted)return y=s(y),h=c(h),k();if(t.format)h=await t.format.call(this,h,t,e);else{let t=this.styles.muted;h=n(this,{input:h,initial:o,pos:a,showCursor:m,color:t})}return this.isValue(h)||(h=this.styles.muted(this.symbols.ellipsis)),t.result&&(this.values[l]=await t.result.call(this,b,t,e)),m&&(y=d(y)),t.error?h+=(h?" ":"")+p(t.error.trim()):t.hint&&(h+=(h?" ":"")+u(t.hint.trim())),k()}async submit(){return this.value=this.values,super.base.submit.call(this)}}},594:(t,e,i)=>{"use strict";const s=i(546),r=(t,i)=>{s.defineExport(e,t,i),s.defineExport(e,t.toLowerCase(),i)};r("AutoComplete",(()=>i(317))),r("BasicAuth",(()=>i(186))),r("Confirm",(()=>i(291))),r("Editable",(()=>i(848))),r("Form",(()=>i(826))),r("Input",(()=>i(719))),r("Invisible",(()=>i(822))),r("List",(()=>i(795))),r("MultiSelect",(()=>i(56))),r("Numeral",(()=>i(403))),r("Password",(()=>i(847))),r("Scale",(()=>i(813))),r("Select",(()=>i(466))),r("Snippet",(()=>i(451))),r("Sort",(()=>i(144))),r("Survey",(()=>i(755))),r("Text",(()=>i(781))),r("Toggle",(()=>i(653))),r("Quiz",(()=>i(249)))},719:(t,e,i)=>{"use strict";const s=i(391),r=i(736);t.exports=class extends s{constructor(t){super(t);let e=this.options.history;if(e&&e.store){let t=e.values||this.initial;this.autosave=!!e.autosave,this.store=e.store,this.data=this.store.get("values")||{past:[],present:t},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(t){return this.store?(this.data=r(t,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=r("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&!0===this.autosave&&this.save(),super.submit()}}},822:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{format(){return""}}},795:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t={}){super(t),this.sep=this.options.separator||/, */,this.initial=t.initial||""}split(t=this.value){return t?String(t).split(this.sep):[]}format(){let t=this.state.submitted?this.styles.primary:t=>t;return this.list.map(t).join(", ")}async submit(t){let e=this.state.error||await this.validate(this.list,this.state);return!0!==e?(this.state.error=e,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}}},56:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){super({...t,multiple:!0})}}},403:(t,e,i)=>{t.exports=i(376)},847:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t){super(t),this.cursorShow()}format(t=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(t.length)):""}}},249:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){if(super(t),"number"!=typeof this.options.correctChoice||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(t,e){let i=await super.toChoices(t,e);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(t){return t.index===this.options.correctChoice}async result(t){return{selectedAnswer:t,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}}},813:(t,e,i)=>{"use strict";const s=i(3),r=i(575),n=i(546);t.exports=class extends r{constructor(t={}){super(t),this.widths=[].concat(t.messageWidth||50),this.align=[].concat(t.align||"left"),this.linebreak=t.linebreak||!1,this.edgeLength=t.edgeLength||3,this.newline=t.newline||"\n ";let e=t.startNumber||1;"number"==typeof this.scale&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map(((t,i)=>({name:i+e}))))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(!0===this.tableized)return;this.tableized=!0;let t=0;for(let e of this.choices){t=Math.max(t,e.message.length),e.scaleIndex=e.initial||2,e.scale=[];for(let t=0;t=this.scale.length-1?this.alert():(t.scaleIndex++,this.render())}left(){let t=this.focused;return t.scaleIndex<=0?this.alert():(t.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map((t=>this.styles.info(t.index))).join(", "):""}pointer(){return""}renderScaleKey(){return!1===this.scaleKey||this.state.submitted?"":["",...this.scale.map((t=>` ${t.name} - ${t.message}`))].map((t=>this.styles.muted(t))).join("\n")}renderScaleHeading(t){let e=this.scale.map((t=>t.name));"function"==typeof this.options.renderScaleHeading&&(e=this.options.renderScaleHeading.call(this,t));let i=this.scaleLength-e.join("").length,s=Math.round(i/(e.length-1)),r=e.map((t=>this.styles.strong(t))).join(" ".repeat(s)),n=" ".repeat(this.widths[0]);return this.margin[3]+n+this.margin[1]+r}scaleIndicator(t,e,i){if("function"==typeof this.options.scaleIndicator)return this.options.scaleIndicator.call(this,t,e,i);let s=t.scaleIndex===e.index;return e.disabled?this.styles.hint(this.symbols.radio.disabled):s?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(t,e){let i=t.scale.map((i=>this.scaleIndicator(t,i,e))),s="Hyper"===this.term?"":" ";return i.join(s+this.symbols.line.repeat(this.edgeLength))}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,r=await this.pointer(t,e),a=await t.hint;a&&!n.hasColor(a)&&(a=this.styles.muted(a));let o=t=>this.margin[3]+t.replace(/\s+$/,"").padEnd(this.widths[0]," "),l=this.newline,h=this.indent(t),u=await this.resolve(t.message,this.state,t,e),c=await this.renderScale(t,e),d=this.margin[1]+this.margin[3];this.scaleLength=s(c).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-d.length);let p=n.wordWrap(u,{width:this.widths[0],newline:l}).split("\n").map((t=>o(t)+this.margin[1]));return i&&(c=this.styles.info(c),p=p.map((t=>this.styles.info(t)))),p[0]+=c,this.linebreak&&p.push(""),[h+r,p.join("\n")].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t),i=await this.renderScaleHeading();return this.margin[0]+[i,...e.map((t=>t.join(" ")))].join("\n")}async render(){let{submitted:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=await this.message(),n="";!1!==this.options.promptLine&&(n=[i,r,s,""].join(" "),this.state.prompt=n);let a=await this.header(),o=await this.format(),l=await this.renderScaleKey(),h=await this.error()||await this.hint(),u=await this.renderChoices(),c=await this.footer(),d=this.emptyError;o&&(n+=o),h&&!n.includes(h)&&(n+=" "+h),t&&!o&&!u.trim()&&this.multiple&&null!=d&&(n+=this.styles.danger(d)),this.clear(e),this.write([a,n,l,u,c].filter(Boolean).join("\n")),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIndex;return this.base.submit.call(this)}}},466:(t,e,i)=>{"use strict";const s=i(575),r=i(546);t.exports=class extends s{constructor(t){super(t),this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(t,e){if(this.multiple)return this[e.name]?await this[e.name](t,e):await super.dispatch(t,e);this.alert()}separator(){if(this.options.separator)return super.separator();let t=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():t}pointer(t,e){return!this.multiple||this.options.pointer?super.pointer(t,e):""}indicator(t,e){return this.multiple?super.indicator(t,e):""}choiceMessage(t,e){let i=this.resolve(t.message,this.state,t,e);return"heading"!==t.role||r.hasColor(i)||(i=this.styles.strong(i)),this.resolve(i,this.state,t,e)}choiceSeparator(){return":"}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,s=await this.pointer(t,e),n=await this.indicator(t,e)+(t.pad||""),a=await this.resolve(t.hint,this.state,t,e);a&&!r.hasColor(a)&&(a=this.styles.muted(a));let o=this.indent(t),l=await this.choiceMessage(t,e),h=()=>[this.margin[3],o+s+n,l,this.margin[1],a].filter(Boolean).join(" ");return"heading"===t.role?h():t.disabled?(r.hasColor(l)||(l=this.styles.disabled(l)),h()):(i&&(l=this.styles.em(l)),h())}async renderChoices(){if("choices"===this.state.loading)return this.styles.warning("Loading choices");if(this.state.submitted)return"";let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t);e.length||e.push(this.styles.danger("No matching choices"));let i,s=this.margin[0]+e.join("\n");return this.options.choicesHeader&&(i=await this.resolve(this.options.choicesHeader,this.state)),[i,s].filter(Boolean).join("\n")}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map((t=>this.styles.primary(t.name))).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:t,size:e}=this.state,i="",s=await this.header(),r=await this.prefix(),n=await this.separator(),a=await this.message();!1!==this.options.promptLine&&(i=[r,a,n,""].join(" "),this.state.prompt=i);let o=await this.format(),l=await this.error()||await this.hint(),h=await this.renderChoices(),u=await this.footer();o&&(i+=o),l&&!i.includes(l)&&(i+=" "+l),t&&!o&&!h.trim()&&this.multiple&&null!=this.emptyError&&(i+=this.styles.danger(this.emptyError)),this.clear(e),this.write([s,i,h,u].filter(Boolean).join("\n")),this.write(this.margin[2]),this.restore()}}},451:(t,e,i)=>{"use strict";const s=i(3),r=i(189),n=i(232);t.exports=class extends n{constructor(t){super(t),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await r(this),await super.initialize()}async reset(t){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},!0!==t&&(await this.initialize(),await this.render())}moveCursor(t){let e=this.getItem();this.cursor+=t,e.cursor+=t}dispatch(t,e){e.code||e.ctrl||null==t||!this.getItem()?this.alert():this.append(t,e)}append(t,e){let i=this.getItem(),s=i.input.slice(0,this.cursor),r=i.input.slice(this.cursor);this.input=i.input=`${s}${t}${r}`,this.moveCursor(1),this.render()}delete(){let t=this.getItem();if(this.cursor<=0||!t.input)return this.alert();let e=t.input.slice(this.cursor),i=t.input.slice(0,this.cursor-1);this.input=t.input=`${i}${e}`,this.moveCursor(-1),this.render()}increment(t){return t>=this.state.keys.length-1?0:t+1}decrement(t){return t<=0?this.state.keys.length-1:t-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(t){let e=this.state.completed<100?this.styles.warning:this.styles.success;return!0===this.state.submitted&&100!==this.state.completed&&(e=this.styles.danger),e(`${this.state.completed}% completed`)}async render(){let{index:t,keys:e=[],submitted:i,size:s}=this.state,r=[this.options.newline,"\n"].find((t=>null!=t)),n=await this.prefix(),a=await this.separator(),o=[n,await this.message(),a].filter(Boolean).join(" ");this.state.prompt=o;let l=await this.header(),h=await this.error()||"",u=await this.hint()||"",c=i?"":await this.interpolate(this.state),d=this.state.key=e[t]||"",p=await this.format(d),m=await this.footer();p&&(o+=" "+p),u&&!p&&0===this.state.completed&&(o+=" "+u),this.clear(s);let f=[l,o,c,m,h.trim()];this.write(f.filter(Boolean).join(r)),this.restore()}getItem(t){let{items:e,keys:i,index:s}=this.state,r=e.find((t=>t.name===i[s]));return r&&null!=r.input&&(this.input=r.input,this.cursor=r.cursor),r}async submit(){"function"!=typeof this.interpolate&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:t,missing:e,output:i,values:r}=this.state;if(t.size){let e="";for(let[i,s]of t)e+=`Invalid ${i}: ${s}\n`;return this.state.error=e,super.submit()}if(e.size)return this.state.error="Required: "+[...e.keys()].join(", "),super.submit();let n=s(i).split("\n").map((t=>t.slice(1))).join("\n");return this.value={values:r,result:n},super.submit()}}},144:(t,e,i)=>{"use strict";const s="(Use + to sort)",r=i(466);t.exports=class extends r{constructor(t){super({...t,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,s].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(t,e){let i=await super.renderChoice(t,e),s=this.symbols.identicalTo+" ",r=this.index===e&&this.sorting?this.styles.muted(s):" ";return!1===this.options.drag&&(r=""),!0===this.options.numbered?r+`${e+1} - `+i:r+i}get selected(){return this.choices}submit(){return this.value=this.choices.map((t=>t.value)),super.submit()}}},755:(t,e,i)=>{"use strict";const s=i(575);function r(t,e={}){if(Array.isArray(e.scale))return e.scale.map((t=>({...t})));let i=[];for(let e=1;ethis.styles.muted(t))),this.state.header=t.join("\n ")}}async toChoices(...t){if(this.createdScales)return!1;this.createdScales=!0;let e=await super.toChoices(...t);for(let t of e)t.scale=r(5,this.options),t.scaleIdx=2;return e}dispatch(){this.alert()}space(){let t=this.focused,e=t.scale[t.scaleIdx],i=e.selected;return t.scale.forEach((t=>t.selected=!1)),e.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let t=this.focused;return t.scaleIdx>=t.scale.length-1?this.alert():(t.scaleIdx++,this.render())}left(){let t=this.focused;return t.scaleIdx<=0?this.alert():(t.scaleIdx--,this.render())}indent(){return" "}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,s="Hyper"===this.term,r=s?9:8,n=s?"":" ",a=this.symbols.line.repeat(r),o=" ".repeat(r+(s?0:1)),l=t=>(t?this.styles.success("◉"):"◯")+n,h=e+1+".",u=i?this.styles.heading:this.styles.noop,c=await this.resolve(t.message,this.state,t,e),d=this.indent(t),p=d+t.scale.map(((e,i)=>l(i===t.scaleIdx))).join(a),m=d+t.scale.map(((e,i)=>(e=>e===t.scaleIdx?u(e):e)(i))).join(o);return i&&(p=this.styles.cyan(p),m=this.styles.cyan(m)),[[h,c].filter(Boolean).join(" "),p,m," "].filter(Boolean).join("\n")}async renderChoices(){if(this.state.submitted)return"";let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t);return e.length||e.push(this.styles.danger("No matching choices")),e.join("\n")}format(){return this.state.submitted?this.choices.map((t=>this.styles.info(t.scaleIdx))).join(", "):""}async render(){let{submitted:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=[i,await this.message(),s].filter(Boolean).join(" ");this.state.prompt=r;let n=await this.header(),a=await this.format(),o=await this.error()||await this.hint(),l=await this.renderChoices(),h=await this.footer();!a&&o||(r+=" "+a),o&&!r.includes(o)&&(r+=" "+o),t&&!a&&!l&&this.multiple&&"form"!==this.type&&(r+=this.styles.danger(this.emptyError)),this.clear(e),this.write([r,n,l,h].filter(Boolean).join("\n")),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIdx;return this.base.submit.call(this)}}},781:(t,e,i)=>{t.exports=i(719)},653:(t,e,i)=>{"use strict";const s=i(838);t.exports=class extends s{async initialize(){await super.initialize(),this.value=this.initial=this.resolve(this.options.initial),this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(!0===this.value)return this.alert();this.value=!0,this.render()}disable(){if(!1===this.value)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(t="",e){switch(t.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let t=t=>this.styles.primary.underline(t);return[this.value?this.disabled:t(this.disabled),this.value?t(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:t}=this.state,e=await this.header(),i=await this.prefix(),s=await this.separator(),r=await this.message(),n=await this.format(),a=await this.error()||await this.hint(),o=await this.footer(),l=[i,r,s,n].join(" ");this.state.prompt=l,a&&!l.includes(a)&&(l+=" "+a),this.clear(t),this.write([e,l,o].filter(Boolean).join("\n")),this.write(this.margin[2]),this.restore()}}},607:t=>{"use strict";t.exports=class{_queue=[];_executing=!1;_jobRunner=null;constructor(t){this._jobRunner=t}enqueue=(...t)=>{this._queue.push(t),this._dequeue()};destroy(){this._queue.length=0,this._jobRunner=null}_dequeue(){!this._executing&&this._queue.length&&(this._executing=!0,this._jobRunner(...this._queue.shift()),setTimeout((()=>{this._executing=!1,this._dequeue()})))}}},502:(t,e,i)=>{"use strict";const s=i(546),r={default:(t,e)=>e,checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading:(t,e)=>(e.disabled="",e.indicator=[e.indicator," "].find((t=>null!=t)),e.message=e.message||"",e),input(t,e){throw new Error("input role is not implemented yet")},option:(t,e)=>r.default(t,e),radio(t,e){throw new Error("radio role is not implemented yet")},separator:(t,e)=>(e.disabled="",e.indicator=[e.indicator," "].find((t=>null!=t)),e.message=e.message||t.symbols.line.repeat(5),e),spacer:(t,e)=>e};t.exports=(t,e={})=>{let i=s.merge({},r,e.roles);return i[t]||i.default}},873:(t,e,i)=>{"use strict";const{define:s,width:r}=i(546);t.exports=class{constructor(t){let e=t.options;s(this,"_prompt",t),this.type=t.type,this.name=t.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=r(e.stdout||process.stdout),Object.assign(this,e),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=t.symbols,this.styles=t.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let t={...this};return t.status=this.status,t.buffer=Buffer.from(t.buffer),delete t.clone,t}set color(t){this._color=t}get color(){let t=this.prompt.styles;if(this.cancelled)return t.cancelled;if(this.submitted)return t.submitted;let e=this._color||t[this.status];return"function"==typeof e?e:t.pending}set loading(t){this._loading=t}get loading(){return"boolean"==typeof this._loading?this._loading:!!this.loadingChoices&&"choices"}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}}},217:(t,e,i)=>{"use strict";const s=i(546),r=i(730),n={default:r.noop,noop:r.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||s.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||s.complement(this.primary)},primary:r.cyan,success:r.green,danger:r.magenta,strong:r.bold,warning:r.yellow,muted:r.dim,disabled:r.gray,dark:r.dim.gray,underline:r.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},set placeholder(t){this._placeholder=t},get placeholder(){return this._placeholder||this.primary.dim},set highlight(t){this._highlight=t},get highlight(){return this._highlight||this.inverse},merge:(t={})=>{t.styles&&"boolean"==typeof t.styles.enabled&&(r.enabled=t.styles.enabled),t.styles&&"boolean"==typeof t.styles.visible&&(r.visible=t.styles.visible);let e=s.merge({},n,t.styles);delete e.merge;for(let t of Object.keys(r))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>r[t]});for(let t of Object.keys(r.styles))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>r[t]});return e}};t.exports=n},739:(t,e,i)=>{"use strict";const s="win32"===process.platform,r=i(730),n=i(546),a={...r.symbols,upDownDoubleArrow:"⇕",upDownDoubleArrow2:"⬍",upDownArrow:"↕",asterisk:"*",asterism:"⁂",bulletWhite:"◦",electricArrow:"⌁",ellipsisLarge:"⋯",ellipsisSmall:"…",fullBlock:"█",identicalTo:"≡",indicator:r.symbols.check,leftAngle:"‹",mark:"※",minus:"−",multiplication:"×",obelus:"÷",percent:"%",pilcrow:"¶",pilcrow2:"❡",pencilUpRight:"✐",pencilDownRight:"✎",pencilRight:"✏",plus:"+",plusMinus:"±",pointRight:"☞",rightAngle:"›",section:"§",hexagon:{off:"⬡",on:"⬢",disabled:"⬢"},ballot:{on:"☑",off:"☐",disabled:"☒"},stars:{on:"★",off:"☆",disabled:"☆"},folder:{on:"▼",off:"▶",disabled:"▶"},prefix:{pending:r.symbols.question,submitted:r.symbols.check,cancelled:r.symbols.cross},separator:{pending:r.symbols.pointerSmall,submitted:r.symbols.middot,cancelled:r.symbols.middot},radio:{off:s?"( )":"◯",on:s?"(*)":"◉",disabled:s?"(|)":"Ⓘ"},numbers:["⓪","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","㉑","㉒","㉓","㉔","㉕","㉖","㉗","㉘","㉙","㉚","㉛","㉜","㉝","㉞","㉟","㊱","㊲","㊳","㊴","㊵","㊶","㊷","㊸","㊹","㊺","㊻","㊼","㊽","㊾","㊿"]};a.merge=t=>{let e=n.merge({},r.symbols,a,t.symbols);return delete e.merge,e},t.exports=a},227:(t,e,i)=>{"use strict";const s=i(217),r=i(739),n=i(546);t.exports=t=>{t.options=n.merge({},t.options.theme,t.options),t.symbols=r.merge(t.options),t.styles=s.merge(t.options)}},940:t=>{"use strict";function e(t,e,i={}){let s=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},r=i.interval||120;s.frames=i.frames||[],s.loading=!0;let n=setInterval((()=>{s.ms=Date.now()-s.start,s.tick++,t.render()}),r);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,"interval",{value:n}),t.once("close",(()=>s.stop())),s.stop}t.exports=t=>{t.timers=t.timers||{};let i=t.options.timers;if(i)for(let s of Object.keys(i)){let r=i[s];"number"==typeof r&&(r={interval:r}),e(t,s,r)}}},575:(t,e,i)=>{"use strict";const s=i(3),r=i(232),n=i(502),a=i(546),{reorder:o,scrollUp:l,scrollDown:h,isObject:u,swap:c}=a;function d(t,e){if(e instanceof Promise)return e;if("function"==typeof e){if(a.isAsyncFn(e))return e;e=e.call(t,t)}for(let i of e){if(Array.isArray(i.choices)){let e=i.choices.filter((e=>!t.isDisabled(e)));i.enabled=e.every((t=>!0===t.enabled))}!0===t.isDisabled(i)&&delete i.enabled}return e}t.exports=class extends r{constructor(t){super(t),this.cursorHide(),this.maxSelected=t.maxSelected||1/0,this.multiple=t.multiple||!1,this.initial=t.initial||0,this.delay=t.delay||0,this.longest=0,this.num=""}async initialize(){"function"==typeof this.options.initial&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:t,initial:e,autofocus:i,suggest:s}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(t)),this.choices.forEach((t=>t.enabled=!1)),"function"!=typeof s&&0===this.selectable.length)throw new Error("At least one choice must be selectable");u(e)&&(e=Object.keys(e)),Array.isArray(e)?(null!=i&&(this.index=this.findIndex(i)),e.forEach((t=>this.enable(this.find(t)))),await this.render()):(null!=i&&(e=i),"string"==typeof e&&(e=this.findIndex(e)),"number"==typeof e&&e>-1&&(this.index=Math.max(0,Math.min(e,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(t,e){this.state.loadingChoices=!0;let i=[],s=0,r=async(t,e)=>{"function"==typeof t&&(t=await t.call(this)),t instanceof Promise&&(t=await t);for(let n=0;n(this.state.loadingChoices=!1,t)))}async toChoice(t,e,i){if("function"==typeof t&&(t=await t.call(this,this)),t instanceof Promise&&(t=await t),"string"==typeof t&&(t={name:t}),t.normalized)return t;t.normalized=!0;let r=t.value,o=n(t.role,this.options);if("string"!=typeof(t=o(this,t)).disabled||t.hint||(t.hint=t.disabled,t.disabled=!0),!0===t.disabled&&null==t.hint&&(t.hint="(disabled)"),null!=t.index)return t;t.name=t.name||t.key||t.title||t.value||t.message,t.message=t.message||t.name||"",t.value=[t.value,t.name].find(this.isValue.bind(this)),t.input="",t.index=e,t.cursor=0,a.define(t,"parent",i),t.level=i?i.level+1:1,null==t.indent&&(t.indent=i?i.indent+" ":t.indent||""),t.path=i?i.path+"."+t.name:t.name,t.enabled=!(!this.multiple||this.isDisabled(t)||!t.enabled&&!this.isSelected(t)),this.isDisabled(t)||(this.longest=Math.max(this.longest,s(t.message).length));let l={...t};return t.reset=(e=l.input,i=l.value)=>{for(let e of Object.keys(l))t[e]=l[e];t.input=e,t.value=i},null==r&&"function"==typeof t.initial&&(t.input=await t.initial.call(this,this.state,t,e)),t}async onChoice(t,e){this.emit("choice",t,e,this),"function"==typeof t.onChoice&&await t.onChoice.call(this,this.state,t,e)}async addChoice(t,e,i){let s=await this.toChoice(t,e,i);return this.choices.push(s),this.index=this.choices.length-1,this.limit=this.choices.length,s}async newItem(t,e,i){let s={name:"New choice name?",editable:!0,newChoice:!0,...t},r=await this.addChoice(s,e,i);return r.updateChoice=()=>{delete r.newChoice,r.name=r.message=r.input,r.input="",r.cursor=0},this.render()}indent(t){return null==t.indent?t.level>1?" ".repeat(t.level-1):"":t.indent}dispatch(t,e){if(this.multiple&&this[e.name])return this[e.name]();this.alert()}focus(t,e){return"boolean"!=typeof e&&(e=t.enabled),e&&!t.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=t.index,t.enabled=e&&!this.isDisabled(t),t)}space(){return this.multiple?this.focused?(this.toggle(this.focused),this.render()):void 0:this.alert()}a(){if(this.maxSelectedt.enabled));return this.choices.forEach((e=>e.enabled=!t)),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach((t=>t.enabled=!t.enabled)),this.render())}g(){if(!this.choices.some((t=>!!t.parent)))return this.a();const t=this.focused;return this.toggle(t.parent&&!t.choices?t.parent:t),this.render()}toggle(t,e){if(!t.enabled&&this.selected.length>=this.maxSelected)return this.alert();"boolean"!=typeof e&&(e=!t.enabled),t.enabled=e,t.choices&&t.choices.forEach((t=>this.toggle(t,e)));let i=t.parent;for(;i;){let t=i.choices.filter((t=>this.isDisabled(t)));i.enabled=t.every((t=>!0===t.enabled)),i=i.parent}return d(this,this.choices),this.emit("toggle",t,this),t}enable(t){return this.selected.length>=this.maxSelected?this.alert():(t.enabled=!this.isDisabled(t),t.choices&&t.choices.forEach(this.enable.bind(this)),t)}disable(t){return t.enabled=!1,t.choices&&t.choices.forEach(this.disable.bind(this)),t}number(t){this.num+=t;let e=t=>{let e=Number(t);if(e>this.choices.length-1)return this.alert();let i=this.focused,s=this.choices.find((t=>e===t.index));if(!s.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(-1===this.visible.indexOf(s)){let t=o(this.choices),e=t.indexOf(s);if(i.index>e){let i=t.slice(e,e+this.limit),s=t.filter((t=>!i.includes(t)));this.choices=i.concat(s)}else{let i=e-this.limit+1;this.choices=t.slice(i).concat(t.slice(0,i))}}return this.index=this.choices.indexOf(s),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise((t=>{let i=this.choices.length,s=this.num,r=(i=!1,r)=>{clearTimeout(this.numberTimeout),i&&(r=e(s)),this.num="",t(r)};return"0"===s||1===s.length&&Number(s+"0")>i?r(!0):Number(s)>i?r(!1,this.alert()):void(this.numberTimeout=setTimeout((()=>r(!0)),this.delay))}))}home(){return this.choices=o(this.choices),this.index=0,this.render()}end(){let t=this.choices.length-this.limit,e=o(this.choices);return this.choices=e.slice(t).concat(e.slice(0,t)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let t=this.choices.length,e=this.visible.length,i=this.index;return!1===this.options.scroll&&0===i?this.alert():t>e&&0===i?this.scrollUp():(this.index=(i-1%t+t)%t,this.isDisabled()&&!this.allChoicesAreDisabled()?this.up():this.render())}down(){let t=this.choices.length,e=this.visible.length,i=this.index;return!1===this.options.scroll&&i===e-1?this.alert():t>e&&i===e-1?this.scrollDown():(this.index=(i+1)%t,this.isDisabled()&&!this.allChoicesAreDisabled()?this.down():this.render())}scrollUp(t=0){return this.choices=l(this.choices),this.index=t,this.isDisabled()?this.up():this.render()}scrollDown(t=this.visible.length-1){return this.choices=h(this.choices),this.index=t,this.isDisabled()?this.down():this.render()}async shiftUp(){return!0===this.options.sort?(this.sorting=!0,this.swap(this.index-1),await this.up(),void(this.sorting=!1)):this.scrollUp(this.index)}async shiftDown(){return!0===this.options.sort?(this.sorting=!0,this.swap(this.index+1),await this.down(),void(this.sorting=!1)):this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(t){c(this.choices,this.index,t)}allChoicesAreDisabled(t=this.choices){return t.every((t=>this.isDisabled(t)))}isDisabled(t=this.focused){return!(!t||!["disabled","collapsed","hidden","completing","readonly"].some((e=>!0===t[e])))||t&&"heading"===t.role}isEnabled(t=this.focused){if(Array.isArray(t))return t.every((t=>this.isEnabled(t)));if(t.choices){let e=t.choices.filter((t=>!this.isDisabled(t)));return t.enabled&&e.every((t=>this.isEnabled(t)))}return t.enabled&&!this.isDisabled(t)}isChoice(t,e){return t.name===e||t.index===Number(e)}isSelected(t){return Array.isArray(this.initial)?this.initial.some((e=>this.isChoice(t,e))):this.isChoice(t,this.initial)}map(t=[],e="value"){return[].concat(t||[]).reduce(((t,i)=>(t[i]=this.find(i,e),t)),{})}filter(t,e){let i="function"==typeof t?t:(e,i)=>[e.name,i].includes(t),s=(this.options.multiple?this.state._choices:this.choices).filter(i);return e?s.map((t=>t[e])):s}find(t,e){if(u(t))return e?t[e]:t;let i="function"==typeof t?t:(e,i)=>[e.name,i].includes(t),s=this.choices.find(i);return s?e?s[e]:s:void 0}findIndex(t){return this.choices.indexOf(this.find(t))}async submit(){let t=this.focused;if(!t)return this.alert();if(t.newChoice)return t.input?(t.updateChoice(),this.render()):this.alert();if(this.choices.some((t=>t.newChoice)))return this.alert();let{reorder:e,sort:i}=this.options,s=!0===this.multiple,r=this.selected;return void 0===r?this.alert():(Array.isArray(r)&&!1!==e&&!0!==i&&(r=a.reorder(r)),this.value=s?r.map((t=>t.name)):r.name,super.submit())}set choices(t=[]){this.state._choices=this.state._choices||[],this.state.choices=t;for(let e of t)this.state._choices.some((t=>t.name===e.name))||this.state._choices.push(e);if(!this._initial&&this.options.initial){this._initial=!0;let t=this.initial;if("string"==typeof t||"number"==typeof t){let e=this.find(t);e&&(this.initial=e.index,this.focus(e,!0))}}}get choices(){return d(this,this.state.choices||[])}set visible(t){this.state.visible=t}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(t){this.state.limit=t}get limit(){let{state:t,options:e,choices:i}=this,s=t.limit||this._limit||e.limit||i.length;return Math.min(s,this.height)}set value(t){super.value=t}get value(){return"string"!=typeof super.value&&super.value===this.initial?this.input:super.value}set index(t){this.state.index=t}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let t=this.choices[this.index];return t&&this.state.submitted&&!0!==this.multiple&&(t.enabled=!0),t}get selectable(){return this.choices.filter((t=>!this.isDisabled(t)))}get selected(){return this.multiple?this.enabled:this.focused}}},926:(t,e,i)=>{"use strict";const s=i(826),r=()=>{throw new Error("expected prompt to have a custom authenticate method")},n=(t=r)=>class extends s{constructor(t){super(t)}async submit(){this.value=await t.call(this,this.values,this.state),super.base.submit.call(this)}static create(t){return n(t)}};t.exports=n()},838:(t,e,i)=>{"use strict";const s=i(232),{isPrimitive:r,hasColor:n}=i(546);t.exports=class extends s{constructor(t){super(t),this.cursorHide()}async initialize(){let t=await this.resolve(this.initial,this.state);this.input=await this.cast(t),await super.initialize()}dispatch(t){return this.isValue(t)?(this.input=t,this.submit()):this.alert()}format(t){let{styles:e,state:i}=this;return i.submitted?e.success(t):e.primary(t)}cast(t){return this.isTrue(t)}isTrue(t){return/^[ty1]/i.test(t)}isFalse(t){return/^[fn0]/i.test(t)}isValue(t){return r(t)&&(this.isTrue(t)||this.isFalse(t))}async hint(){if("pending"===this.state.status){let t=await this.element("hint");return n(t)?t:this.styles.muted(t)}}async render(){let{input:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=[i,await this.message(),this.styles.muted(this.default),s].filter(Boolean).join(" ");this.state.prompt=r;let n=await this.header(),a=this.value=this.cast(t),o=await this.format(a),l=await this.error()||await this.hint(),h=await this.footer();l&&!r.includes(l)&&(o+=" "+l),r+=" "+o,this.clear(e),this.write([n,r,h].filter(Boolean).join("\n")),this.restore()}set value(t){super.value=t}get value(){return this.cast(super.value)}}},920:(t,e,i)=>{t.exports={ArrayPrompt:i(575),AuthPrompt:i(926),BooleanPrompt:i(838),NumberPrompt:i(376),StringPrompt:i(391)}},376:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t={}){super({style:"number",...t}),this.min=this.isValue(t.min)?this.toNumber(t.min):-1/0,this.max=this.isValue(t.max)?this.toNumber(t.max):1/0,this.delay=null!=t.delay?t.delay:1e3,this.float=!1!==t.float,this.round=!0===t.round||!1===t.float,this.major=t.major||10,this.minor=t.minor||1,this.initial=null!=t.initial?t.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(t){return!/[-+.]/.test(t)||"."===t&&this.input.includes(".")?this.alert("invalid number"):super.append(t)}number(t){return super.append(t)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(t){let e=t||this.minor,i=this.toNumber(this.input);return i>this.max+e?this.alert():(this.input=`${i+e}`,this.render())}down(t){let e=t||this.minor,i=this.toNumber(this.input);return ithis.isValue(t)));return this.value=this.toNumber(t||0),super.submit()}}},391:(t,e,i)=>{"use strict";const s=i(232),r=i(914),n=i(786),{isPrimitive:a}=i(546);t.exports=class extends s{constructor(t){super(t),this.initial=a(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[],this.keypressTimeout=void 0!==this.options.keypressTimeout?this.options.keypressTimeout:null}async keypress(t,e=(t?r(t,{}):{})){const i=Date.now(),s=i-this.lastKeypress;this.lastKeypress=i;const n="return"===e.name||"enter"===e.name;let a,o=this.state.prevKeypress;if(this.state.prevKeypress=e,null!=this.keypressTimeout&&n){if(s=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(t){return!!t}async format(t=this.value){let e=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(t||e):n(this,{input:t,initial:e,pos:this.cursor})}async render(){let t=this.state.size,e=await this.prefix(),i=await this.separator(),s=[e,await this.message(),i].filter(Boolean).join(" ");this.state.prompt=s;let r=await this.header(),n=await this.format(),a=await this.error()||await this.hint(),o=await this.footer();a&&!n.includes(a)&&(n+=" "+a),s+=" "+n,this.clear(t),this.write([r,s,o].filter(Boolean).join("\n")),this.restore()}}},546:(t,e,i)=>{"use strict";const s=Object.prototype.toString,r=i(730);let n=!1,a=new Set;const o={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};e.longest=(t,e)=>t.reduce(((t,i)=>Math.max(t,e?i[e].length:i.length)),0),e.hasColor=t=>!!t&&r.hasColor(t);const l=e.isObject=t=>null!==t&&"object"==typeof t&&!Array.isArray(t);e.nativeType=t=>s.call(t).slice(8,-1).toLowerCase().replace(/\s/g,""),e.isAsyncFn=t=>"asyncfunction"===e.nativeType(t),e.isPrimitive=t=>null!=t&&"object"!=typeof t&&"function"!=typeof t,e.resolve=(t,e,...i)=>"function"==typeof e?e.call(t,...i):e,e.scrollDown=(t=[])=>[...t.slice(1),t[0]],e.scrollUp=(t=[])=>[t.pop(),...t],e.reorder=(t=[])=>{let e=t.slice();return e.sort(((t,e)=>t.index>e.index?1:t.index{let s=t.length,r=i===s?0:i<0?s-1:i,n=t[e];t[e]=t[r],t[r]=n},e.width=(t,e=80)=>{let i=t&&t.columns?t.columns:e;return t&&"function"==typeof t.getWindowSize&&(i=t.getWindowSize()[0]),"win32"===process.platform?i-1:i},e.height=(t,e=20)=>{let i=t&&t.rows?t.rows:e;return t&&"function"==typeof t.getWindowSize&&(i=t.getWindowSize()[1]),i},e.wordWrap=(t,e={})=>{if(!t)return t;"number"==typeof e&&(e={width:e});let{indent:i="",newline:s="\n"+i,width:r=80}=e,n=(s+i).match(/[^\S\n]/g)||[];r-=n.length;let a=`.{1,${r}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,o=t.trim(),l=new RegExp(a,"g"),h=o.match(l)||[];return h=h.map((t=>t.replace(/\n$/,""))),e.padEnd&&(h=h.map((t=>t.padEnd(r," ")))),e.padStart&&(h=h.map((t=>t.padStart(r," ")))),i+h.join(s)},e.unmute=t=>{let e=t.stack.find((t=>r.keys.color.includes(t)));return e?r[e]:t.stack.find((t=>"bg"===t.slice(2)))?r[e.slice(2)]:t=>t},e.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"",e.inverse=t=>{if(!t||!t.stack)return t;let i=t.stack.find((t=>r.keys.color.includes(t)));if(i){let s=r["bg"+e.pascal(i)];return s?s.black:t}let s=t.stack.find((t=>"bg"===t.slice(0,2)));return s?r[s.slice(2).toLowerCase()]||t:r.none},e.complement=t=>{if(!t||!t.stack)return t;let i=t.stack.find((t=>r.keys.color.includes(t))),s=t.stack.find((t=>"bg"===t.slice(0,2)));if(i&&!s)return r[o[i]||i];if(s){let i=s.slice(2).toLowerCase(),n=o[i];return n&&r["bg"+e.pascal(n)]||t}return r.none},e.meridiem=t=>{let e=t.getHours(),i=t.getMinutes(),s=e>=12?"pm":"am";return e%=12,(0===e?12:e)+":"+(i<10?"0"+i:i)+" "+s},e.set=(t={},i="",s)=>i.split(".").reduce(((t,i,r,n)=>{let a=n.length-1>r?t[i]||{}:s;return!e.isObject(a)&&r{let s=null==t[e]?e.split(".").reduce(((t,e)=>t&&t[e]),t):t[e];return null==s?i:s},e.mixin=(t,i)=>{if(!l(t))return i;if(!l(i))return t;for(let s of Object.keys(i)){let r=Object.getOwnPropertyDescriptor(i,s);if(hasOwnProperty.call(r,"value"))if(hasOwnProperty.call(t,s)&&l(r.value)){let n=Object.getOwnPropertyDescriptor(t,s);l(n.value)&&n.value!==r.value?t[s]=e.merge({},t[s],i[s]):Reflect.defineProperty(t,s,r)}else Reflect.defineProperty(t,s,r);else Reflect.defineProperty(t,s,r)}return t},e.merge=(...t)=>{let i={};for(let s of t)e.mixin(i,s);return i},e.mixinEmitter=(t,i)=>{let s=i.constructor.prototype;for(let r of Object.keys(s)){let n=s[r];"function"==typeof n?e.define(t,r,n.bind(i)):e.define(t,r,n)}};const h=(t,e)=>{n||(n=!0,a.forEach((t=>t())),!0===t&&process.exit(128+e))},u=h.bind(null,!0,15),c=h.bind(null,!0,2);e.onExit=t=>(0===a.size&&(process.once("SIGTERM",u),process.once("SIGINT",c),process.once("exit",h)),a.add(t),()=>{a.delete(t),0===a.size&&(process.off("SIGTERM",u),process.off("SIGINT",c),process.off("exit",h))}),e.define=(t,e,i)=>{Reflect.defineProperty(t,e,{value:i})},e.defineExport=(t,e,i)=>{let s;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(t){s=t},get:()=>s?s():i()})}},3:(t,e,i)=>{"use strict";const s=i(277);t.exports=t=>"string"==typeof t?t.replace(s(),""):t},491:t=>{"use strict";t.exports=require("assert")},361:t=>{"use strict";t.exports=require("events")},521:t=>{"use strict";t.exports=require("readline")}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(31);const e=require("path");var s=i.n(e);const r=require("node:fs");var n=i.n(r);const a=require("node:crypto");var o=i.n(a),l=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function a(t){try{l(s.next(t))}catch(t){n(t)}}function o(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};const{MultiSelect:h}=i(31),u=s().join(__dirname,"..","..","assets","data","cards_pt-br.json"),c={type:"input",required:!0},d={title:t=>!(t.trim().trim().length<2)||"O título precisa ter pelo menos 3 caracteres.",description:t=>!(t.trim().length<10)||"A descrição precisa ter pelo menos 10 caracteres.",tags:t=>!(t.length<1)||"Você precisa selecionar pelo menos uma tag."},p=("—",t=>"—".repeat(t))(50);l(void 0,void 0,void 0,(function*(){try{e=yield l(void 0,void 0,void 0,(function*(){const e=yield t.prompt([Object.assign(Object.assign({},c),{name:"title",message:"Qual título o seu conceito tem ?",validate:d.title}),Object.assign(Object.assign({},c),{name:"description",message:"Qual descrição o seu conceito tem ?",validate:d.description}),{type:"input",name:"code",message:"Seu conceito tem algum código ? (opcional)"}]),i=new h({name:"tags",message:"Selecione as tags relacionadas ao seu conceito",choices:["Back-end","Biblioteca","Conceito","Design","Ferramenta","Framework","Front-end","Mobile","Paradigma","Versionamento"],validate:d.tags}),s=yield i.run();return{id:o().randomBytes(16).toString("hex"),title:e.title,description:e.description,code:e.code,tags:s}})),((t,e)=>{n().writeFileSync(t,JSON.stringify({cards:e},null,2))})(i=u,((t,e)=>[...t,e])((r=i,s=n().readFileSync(r,"utf8"),Object.values(JSON.parse(s)).flat()),e)),console.log(`\n${p}`),console.log("✔️ Novo termo adicionado com sucesso!"),console.log(p)}catch(t){console.log(`\n${p}`),console.error("❌ Ocorreu um erro ao adicionar o novo termo."),console.error("❌ Tente novamente seguindo as instruções."),console.error("❌ Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues."),console.log(p),t instanceof Error&&console.error(`❌ ${t.message}\n`)}var e,i,s,r}))})()})(); \ No newline at end of file From 1efa6250a6e4ca69f5590acec8cc61436fc72dc8 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 13:05:46 -0300 Subject: [PATCH 09/42] chore(tsconfig): update include types --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index 7ee4114a..551361c8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,5 +15,6 @@ "skipLibCheck": true, "allowSyntheticDefaultImports": true, }, + "include": ["./cli/**/*.ts", "./cli/**/*.d.ts"], "exclude": ["node_modules"] } From 5d0bd64ddfed32bd59c6720e7e575b38c1bb4352 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 14:17:08 -0300 Subject: [PATCH 10/42] feat(cli): add types for questions and terms --- cli/index.ts | 20 +++++--------------- cli/types/index.ts | 2 ++ cli/types/questions.ts | 5 +++++ cli/types/term.d.ts | 13 +++++++++++++ 4 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 cli/types/index.ts create mode 100644 cli/types/questions.ts create mode 100644 cli/types/term.d.ts diff --git a/cli/index.ts b/cli/index.ts index 85e02d8e..eca5c307 100644 --- a/cli/index.ts +++ b/cli/index.ts @@ -4,6 +4,8 @@ const { MultiSelect } = require("enquirer"); import fs from "node:fs"; import crypto from "node:crypto"; +import { Questions, Term } from "./types"; + const cardsPath = path.join( __dirname, "..", @@ -13,20 +15,6 @@ const cardsPath = path.join( "cards_pt-br.json" ); -type Questions = { - title: string; - description: string; - code: string; -}; - -type Term = { - id: string; - title: string; - description: string; - code: string; - tags: string[]; -}; - const basePrompt = { type: "input", required: true, @@ -110,8 +98,10 @@ const prompts = async () => { id: crypto.randomBytes(16).toString("hex"), title: questions.title, description: questions.description, - code: questions.code, tags: tagsPrompt, + content: { + code: questions.code, + }, }; return card; diff --git a/cli/types/index.ts b/cli/types/index.ts new file mode 100644 index 00000000..ae3019da --- /dev/null +++ b/cli/types/index.ts @@ -0,0 +1,2 @@ +export * from './term' +export * from './questions' \ No newline at end of file diff --git a/cli/types/questions.ts b/cli/types/questions.ts new file mode 100644 index 00000000..03f19598 --- /dev/null +++ b/cli/types/questions.ts @@ -0,0 +1,5 @@ +export type Questions = { + title: string; + description: string; + code: string; +}; \ No newline at end of file diff --git a/cli/types/term.d.ts b/cli/types/term.d.ts new file mode 100644 index 00000000..21f4056a --- /dev/null +++ b/cli/types/term.d.ts @@ -0,0 +1,13 @@ +type Code = string; + +type Content = { + code: Code; +}; + +export type Term = { + id: string; + title: string; + description: string; + tags: string[]; + content: Content; +}; From 830776aafe688799635d3600ab730c80c3e1f392 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 23:32:57 -0300 Subject: [PATCH 11/42] chore: remove watch in dev script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6435a774..030e8330 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "license": "GPL-3.0", "description": "Um dicionário tech para pessoas que querem aprender mais sobre termos técnicos dentro da tecnologia 📖", "scripts": { - "dev": "tsx watch cli/index.ts --ignore node_modules", + "dev": "tsx cli/index.ts --ignore node_modules", "new": "node cli/build/bundle.js", "inspect": "node --inspect cli/build/bundle.js", "build": "webpack --config webpack.config.js --mode production" From 196abf6849727d6a1439a2bf6f7ac28781d99083 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 23:36:24 -0300 Subject: [PATCH 12/42] refactor(cli/types): add interfaces --- cli/types/available-tags.ts | 1 + cli/types/fs.ts | 4 ++++ cli/types/index.ts | 6 ++++-- cli/types/objective-questions.ts | 5 +++++ 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 cli/types/available-tags.ts create mode 100644 cli/types/fs.ts create mode 100644 cli/types/objective-questions.ts diff --git a/cli/types/available-tags.ts b/cli/types/available-tags.ts new file mode 100644 index 00000000..8feec63a --- /dev/null +++ b/cli/types/available-tags.ts @@ -0,0 +1 @@ +export type AvailableTags = string[]; diff --git a/cli/types/fs.ts b/cli/types/fs.ts new file mode 100644 index 00000000..a910b1bb --- /dev/null +++ b/cli/types/fs.ts @@ -0,0 +1,4 @@ +export interface IFileSystem { + writeToFile(path: string, data: string): void; + readFromFile(path: string): string; +} diff --git a/cli/types/index.ts b/cli/types/index.ts index ae3019da..26199e62 100644 --- a/cli/types/index.ts +++ b/cli/types/index.ts @@ -1,2 +1,4 @@ -export * from './term' -export * from './questions' \ No newline at end of file +export * from "./term"; +export * from "./objective-questions"; +export * from "./available-tags"; +export * from "./fs"; diff --git a/cli/types/objective-questions.ts b/cli/types/objective-questions.ts new file mode 100644 index 00000000..a97d3b86 --- /dev/null +++ b/cli/types/objective-questions.ts @@ -0,0 +1,5 @@ +export type ObjectiveQuestions = { + title: string; + description: string; + code: string; +}; From dfab61789ad6a082d245ada5cb0f3c08f17e9385 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 23:38:41 -0300 Subject: [PATCH 13/42] refactor(cli/config): resolve cards_pt-br path --- cli/config/cards_pt-br-path.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 cli/config/cards_pt-br-path.ts diff --git a/cli/config/cards_pt-br-path.ts b/cli/config/cards_pt-br-path.ts new file mode 100644 index 00000000..2c4dc140 --- /dev/null +++ b/cli/config/cards_pt-br-path.ts @@ -0,0 +1,10 @@ +import path from "node:path"; + +export const cardsPath = path.join( + __dirname, + "..", + "..", + "assets", + "data", + "cards_pt-br.json" +); From b84c92294a49d02ca5175c798dc4c234ab0074df Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 23:39:23 -0300 Subject: [PATCH 14/42] refactor(cli/utils): add dash prompt styles --- cli/utils/dash.ts | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 cli/utils/dash.ts diff --git a/cli/utils/dash.ts b/cli/utils/dash.ts new file mode 100644 index 00000000..5a1e5842 --- /dev/null +++ b/cli/utils/dash.ts @@ -0,0 +1,7 @@ +/** + * Repeats a character a given amount of times. + * @param {string} c - The character to be repeated. + * @param {number} qt - The amount of times the character should be repeated. + * @returns {string} The repeated character. + */ +export const dash = (c: string) => (qt: number) => c.repeat(qt); From 7cb6228e27f8ad4de6c45dcd0cda1bba5053a7a4 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 23:40:08 -0300 Subject: [PATCH 15/42] refactor(cli/core): add rules of domain application --- cli/core/available-tags.ts | 14 ++++++++++++++ cli/core/prompt-validations.ts | 25 +++++++++++++++++++++++++ cli/core/read-file-terms.ts | 9 +++++++++ cli/core/write-new-term.ts | 16 ++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 cli/core/available-tags.ts create mode 100644 cli/core/prompt-validations.ts create mode 100644 cli/core/read-file-terms.ts create mode 100644 cli/core/write-new-term.ts diff --git a/cli/core/available-tags.ts b/cli/core/available-tags.ts new file mode 100644 index 00000000..2361e52e --- /dev/null +++ b/cli/core/available-tags.ts @@ -0,0 +1,14 @@ +import { AvailableTags } from "../types"; + +export const availableTags: AvailableTags = [ + "Back-end", + "Biblioteca", + "Conceito", + "Design", + "Ferramenta", + "Framework", + "Front-end", + "Mobile", + "Paradigma", + "Versionamento", +]; \ No newline at end of file diff --git a/cli/core/prompt-validations.ts b/cli/core/prompt-validations.ts new file mode 100644 index 00000000..e06e6c5c --- /dev/null +++ b/cli/core/prompt-validations.ts @@ -0,0 +1,25 @@ +export const validations = { + title: (input: string) => { + const raw = input.trim(); + + if (raw.trim().length < 2) { + return "O título precisa ter pelo menos 3 caracteres."; + } + return true; + }, + description: (input: string) => { + const raw = input.trim(); + + if (raw.length < 10) { + return "A descrição precisa ter pelo menos 10 caracteres."; + } + + return true; + }, + tags: (input: string[]) => { + if (input.length < 1) { + return "Você precisa selecionar pelo menos uma tag."; + } + return true; + }, +}; diff --git a/cli/core/read-file-terms.ts b/cli/core/read-file-terms.ts new file mode 100644 index 00000000..e38bf5e8 --- /dev/null +++ b/cli/core/read-file-terms.ts @@ -0,0 +1,9 @@ +import { IFileSystem } from "../types"; + +/** + * Reads the content of a file. + * + * @param {string} path - The path of the file to be read. + * @returns {string} The content of the read file. + */ +export const readFileContents = (path: string, fs: IFileSystem) => fs.readFromFile(path); diff --git a/cli/core/write-new-term.ts b/cli/core/write-new-term.ts new file mode 100644 index 00000000..6cd89879 --- /dev/null +++ b/cli/core/write-new-term.ts @@ -0,0 +1,16 @@ +import { Term, IFileSystem } from "../types"; + +/** + * Writes updated terms to a file. + * + * @param {string} path - The path of the file to be written. + * @param {Array} terms - An array of terms to be written to the file. + */ +export const writeUpdatedTermsToFile = ( + path: string, + terms: Term[], + fs: IFileSystem +): void => { + fs.writeToFile(path, JSON.stringify({ cards: terms }, null, 2)); + return; +}; From 4ce049e2c731bb06573c993a7c6f3df95ffc885f Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 23:41:33 -0300 Subject: [PATCH 16/42] refactor(cli/core): add prompts and file system --- cli/io/base.ts | 4 ++++ cli/io/file-system.ts | 12 ++++++++++++ cli/io/multiselect-tags.ts | 11 +++++++++++ cli/io/objective-questions.ts | 31 +++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 cli/io/base.ts create mode 100644 cli/io/file-system.ts create mode 100644 cli/io/multiselect-tags.ts create mode 100644 cli/io/objective-questions.ts diff --git a/cli/io/base.ts b/cli/io/base.ts new file mode 100644 index 00000000..b95da26c --- /dev/null +++ b/cli/io/base.ts @@ -0,0 +1,4 @@ +export const basePrompt = { + type: "input", + required: true, +}; diff --git a/cli/io/file-system.ts b/cli/io/file-system.ts new file mode 100644 index 00000000..97da5bee --- /dev/null +++ b/cli/io/file-system.ts @@ -0,0 +1,12 @@ +import fs from "node:fs"; + +import { IFileSystem } from "../types"; + +export class FileSystem implements IFileSystem { + writeToFile(path: string, data: string): void { + fs.writeFileSync(path, data); + } + readFromFile(path: string): string { + return fs.readFileSync(path, "utf8"); + } +} diff --git a/cli/io/multiselect-tags.ts b/cli/io/multiselect-tags.ts new file mode 100644 index 00000000..8e746c5f --- /dev/null +++ b/cli/io/multiselect-tags.ts @@ -0,0 +1,11 @@ +const { MultiSelect } = require("enquirer"); + +import { availableTags } from "../core/available-tags"; +import { validations } from "../core/prompt-validations"; + +export const promptMultiSelectTags = new MultiSelect({ + name: "tags", + message: "Selecione as tags relacionadas ao seu conceito", + choices: availableTags, + validate: validations.tags, +}); diff --git a/cli/io/objective-questions.ts b/cli/io/objective-questions.ts new file mode 100644 index 00000000..6f841154 --- /dev/null +++ b/cli/io/objective-questions.ts @@ -0,0 +1,31 @@ +import Enquirer from "enquirer"; + +import { basePrompt } from "./base"; + +import { validations } from "../core/prompt-validations"; + +import { ObjectiveQuestions } from "../types"; + +export const objectiveQuestions = async (): Promise => { + const questions: ObjectiveQuestions = await Enquirer.prompt([ + { + ...basePrompt, + name: "title", + message: "Qual título o seu conceito tem ?", + validate: validations.title, + }, + { + ...basePrompt, + name: "description", + message: "Qual descrição o seu conceito tem ?", + validate: validations.description, + }, + { + type: "input", + name: "code", + message: "Seu conceito tem algum código ? (opcional)", + }, + ]); + + return questions; +}; From 46123cea7aa53b8bf1ccb1afc517d5e604b9883f Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 23:42:43 -0300 Subject: [PATCH 17/42] refactor(cli/commands): create runner for prompt --- cli/commands/new-term.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 cli/commands/new-term.ts diff --git a/cli/commands/new-term.ts b/cli/commands/new-term.ts new file mode 100644 index 00000000..0884988f --- /dev/null +++ b/cli/commands/new-term.ts @@ -0,0 +1,26 @@ +import crypto from "node:crypto"; + +import { promptMultiSelectTags } from "../io/multiselect-tags"; +import { objectiveQuestions } from "../io/objective-questions"; + +/** + * Prompts the user for the term's information. + * @returns {Object} The term's information. + * @throws {Error} If the user doesn't provide the required information. + */ +export const createNewTerm = async () => { + const questions = await objectiveQuestions(); + const tagsPrompt: string[] = await promptMultiSelectTags.run(); + + const card = { + id: crypto.randomBytes(16).toString("hex"), + title: questions.title, + description: questions.description, + tags: tagsPrompt, + content: { + code: questions.code, + }, + }; + + return card; +}; From 03896d5c32cf0f4ffd7765b311dd9a51be4ac430 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 23:44:00 -0300 Subject: [PATCH 18/42] refactor(cli/commands): remove questions interface --- cli/types/questions.ts | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 cli/types/questions.ts diff --git a/cli/types/questions.ts b/cli/types/questions.ts deleted file mode 100644 index 03f19598..00000000 --- a/cli/types/questions.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type Questions = { - title: string; - description: string; - code: string; -}; \ No newline at end of file From 1891eae5649d5ad3b4b6108271979f35ae51acf4 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 23:44:55 -0300 Subject: [PATCH 19/42] refactor(cli/commands): update entry point with new dependencies --- cli/index.ts | 161 ++++++++------------------------------------------- 1 file changed, 24 insertions(+), 137 deletions(-) diff --git a/cli/index.ts b/cli/index.ts index eca5c307..0cfd3537 100644 --- a/cli/index.ts +++ b/cli/index.ts @@ -1,119 +1,14 @@ -import * as enquirer from "enquirer"; -import path from "path"; -const { MultiSelect } = require("enquirer"); -import fs from "node:fs"; -import crypto from "node:crypto"; +import { readFileContents } from "./core/read-file-terms"; +import { writeUpdatedTermsToFile } from "./core/write-new-term"; -import { Questions, Term } from "./types"; +import { cardsPath } from "./config/cards_pt-br-path"; +import { createNewTerm } from "./commands/new-term"; -const cardsPath = path.join( - __dirname, - "..", - "..", - "assets", - "data", - "cards_pt-br.json" -); +import { FileSystem } from "./io/file-system"; -const basePrompt = { - type: "input", - required: true, -}; - -const validations = { - title: (input: string) => { - const raw = input.trim(); - - if (raw.trim().length < 2) { - return "O título precisa ter pelo menos 3 caracteres."; - } - return true; - }, - description: (input: string) => { - const raw = input.trim(); +import { dash } from "./utils/dash"; - if (raw.length < 10) { - return "A descrição precisa ter pelo menos 10 caracteres."; - } - - return true; - }, - tags: (input: string[]) => { - if (input.length < 1) { - return "Você precisa selecionar pelo menos uma tag."; - } - return true; - }, -}; - -/** - * Prompts the user for the term's information. - * @returns {Object} The term's information. - * @throws {Error} If the user doesn't provide the required information. - */ -const prompts = async () => { - const questions: Questions = await enquirer.prompt([ - { - ...basePrompt, - name: "title", - message: "Qual título o seu conceito tem ?", - validate: validations.title, - }, - { - ...basePrompt, - name: "description", - message: "Qual descrição o seu conceito tem ?", - validate: validations.description, - }, - { - type: "input", - name: "code", - message: "Seu conceito tem algum código ? (opcional)", - }, - ]); - - const availableTags = [ - "Back-end", - "Biblioteca", - "Conceito", - "Design", - "Ferramenta", - "Framework", - "Front-end", - "Mobile", - "Paradigma", - "Versionamento", - ]; - - const tags = new MultiSelect({ - name: "tags", - message: "Selecione as tags relacionadas ao seu conceito", - choices: availableTags, - validate: validations.tags, - }); - - const tagsPrompt: string[] = await tags.run(); - - const card = { - id: crypto.randomBytes(16).toString("hex"), - title: questions.title, - description: questions.description, - tags: tagsPrompt, - content: { - code: questions.code, - }, - }; - - return card; -}; - -/** - * Reads the content of a file. - * - * @param {string} path - The path of the file to be read. - * @returns {string} The content of the read file. - */ -const readFileContents = (path: string) => fs.readFileSync(path, "utf8"); +import { IFileSystem, Term } from "./types"; /** * Parses terms from a JSON. @@ -121,7 +16,8 @@ const readFileContents = (path: string) => fs.readFileSync(path, "utf8"); * @param {string} json - JSON containing the terms. * @returns {Array} An array of terms. */ -const parseJSONTerms = (json: string): Term[] => (Object.values(JSON.parse(json)) as Term[]).flat(); +const parseJSONTerms = (json: string): Term[] => + (Object.values(JSON.parse(json)) as Term[]).flat(); /** * Adds a new term to an array of existing terms. @@ -132,49 +28,40 @@ const parseJSONTerms = (json: string): Term[] => (Object.values(JSON.parse(json) */ const addNewTermToArray = (terms: Term[], newTerm: Term) => [...terms, newTerm]; -/** - * Writes updated terms to a file. - * - * @param {string} path - The path of the file to be written. - * @param {Array} terms - An array of terms to be written to the file. - */ -const writeUpdatedTermsToFile = (path: string, terms: Term[]) => fs.writeFileSync(path, JSON.stringify({ cards: terms }, null, 2)); - /** * Compounds all the steps to write a new term to a file. * * @param {Object} newTerm - The term to be written to the file. + * @param {string} filepath - The path of the file to be written. */ -const writeTermToFile = (newTerm: Term, filepath: string) => +const composeWriteTermToFile = ( + newTerm: Term, + afs: IFileSystem, + filepath: string +) => writeUpdatedTermsToFile( filepath, - addNewTermToArray(parseJSONTerms(readFileContents(filepath)), newTerm) + addNewTermToArray(parseJSONTerms(readFileContents(filepath, afs)), newTerm), + afs ); -/** - * Repeats a character a given amount of times. - * @param {string} c - The character to be repeated. - * @param {number} qt - The amount of times the character should be repeated. - * @returns {string} The repeated character. - */ -const dash = (c: string) => (qt: number) => c.repeat(qt); - -const dasher = dash("—")(50) +const dashed = dash("—")(50); const main = async () => { try { - writeTermToFile(await prompts(), cardsPath); - console.log(`\n${dasher}`); + const afs = new FileSystem(); + composeWriteTermToFile(await createNewTerm(), afs, cardsPath); + console.log(`\n${dashed}`); console.log(`✔️ Novo termo adicionado com sucesso!`); - console.log(dasher); + console.log(dashed); } catch (error: unknown) { - console.log(`\n${dasher}`); + console.log(`\n${dashed}`); console.error("❌ Ocorreu um erro ao adicionar o novo termo."); console.error("❌ Tente novamente seguindo as instruções."); console.error( "❌ Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues." ); - console.log(dasher); + console.log(dashed); if (error instanceof Error) { console.error(`❌ ${error.message}\n`); From 04af6baa1c637416647f195fff92188dc38c7f34 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 20 Oct 2023 23:47:40 -0300 Subject: [PATCH 20/42] build(cli): create update build bundle --- cli/build/bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/build/bundle.js b/cli/build/bundle.js index af82c1cc..8ca3ea24 100644 --- a/cli/build/bundle.js +++ b/cli/build/bundle.js @@ -1 +1 @@ -(()=>{var t={730:(t,e,i)=>{"use strict";const s=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,r=()=>{const t={enabled:"undefined"!=typeof process&&"0"!==process.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},e=(t,e,i)=>"function"==typeof t?t(e):t.wrap(e,i),r=(i,s)=>{if(""===i||null==i)return"";if(!1===t.enabled)return i;if(!1===t.visible)return"";let r=""+i,n=r.includes("\n"),a=s.length;for(a>0&&s.includes("unstyle")&&(s=[...new Set(["unstyle",...s])].reverse());a-- >0;)r=e(t.styles[s[a]],r,n);return r},n=(e,i,s)=>{t.styles[e]=(t=>{let e=t.open=`[${t.codes[0]}m`,i=t.close=`[${t.codes[1]}m`,s=t.regex=new RegExp(`\\u001b\\[${t.codes[1]}m`,"g");return t.wrap=(t,r)=>{t.includes(i)&&(t=t.replace(s,i+e));let n=e+t+i;return r?n.replace(/\r*\n/g,`${i}$&${e}`):n},t})({name:e,codes:i}),(t.keys[s]||(t.keys[s]=[])).push(e),Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,set(i){t.alias(e,i)},get(){let i=t=>r(t,i.stack);return Reflect.setPrototypeOf(i,t),i.stack=this.stack?this.stack.concat(e):[e],i}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=s,t.hasColor=t.hasAnsi=e=>(t.ansiRegex.lastIndex=0,"string"==typeof e&&""!==e&&t.ansiRegex.test(e)),t.alias=(e,i)=>{let s="string"==typeof i?t[i]:i;if("function"!=typeof s)throw new TypeError("Expected alias to be the name of an existing color (string) or a function");s.stack||(Reflect.defineProperty(s,"name",{value:e}),t.styles[e]=s,s.stack=[e]),Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,set(i){t.alias(e,i)},get(){let e=t=>r(t,e.stack);return Reflect.setPrototypeOf(e,t),e.stack=this.stack?this.stack.concat(s.stack):s.stack,e}})},t.theme=e=>{if(null===(i=e)||"object"!=typeof i||Array.isArray(i))throw new TypeError("Expected theme to be an object");var i;for(let i of Object.keys(e))t.alias(i,e[i]);return t},t.alias("unstyle",(e=>"string"==typeof e&&""!==e?(t.ansiRegex.lastIndex=0,e.replace(t.ansiRegex,"")):"")),t.alias("noop",(t=>t)),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=i(142),t.define=n,t};t.exports=r(),t.exports.create=r},142:t=>{"use strict";const e="undefined"!=typeof process&&"Hyper"===process.env.TERM_PROGRAM,i="undefined"!=typeof process&&"win32"===process.platform,s="undefined"!=typeof process&&"linux"===process.platform,r={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},n=Object.assign({},r,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),a=Object.assign({},r,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:s?"▸":"❯",pointerSmall:s?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});t.exports=i&&!e?n:a,Reflect.defineProperty(t.exports,"common",{enumerable:!1,value:r}),Reflect.defineProperty(t.exports,"windows",{enumerable:!1,value:n}),Reflect.defineProperty(t.exports,"other",{enumerable:!1,value:a})},277:t=>{"use strict";t.exports=({onlyFirst:t=!1}={})=>{const e=["[\\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(e,t?void 0:"g")}},31:(t,e,i)=>{"use strict";const s=i(491),r=i(361),n=i(546);class a extends r{constructor(t,e){super(),this.options=n.merge({},t),this.answers={...e}}register(t,e){if(n.isObject(t)){for(let e of Object.keys(t))this.register(e,t[e]);return this}s.equal(typeof e,"function","expected a function");const i=t.toLowerCase();return e.prototype instanceof this.Prompt?this.prompts[i]=e:this.prompts[i]=e(this.Prompt,this),this}async prompt(t=[]){for(let e of[].concat(t))try{"function"==typeof e&&(e=await e.call(this)),await this.ask(n.merge({},this.options,e))}catch(t){return Promise.reject(t)}return this.answers}async ask(t){"function"==typeof t&&(t=await t.call(this));let e=n.merge({},this.options,t),{type:i,name:r}=t,{set:a,get:o}=n;if("function"==typeof i&&(i=await i.call(this,t,this.answers)),!i)return this.answers[r];"number"===i&&(i="numeral"),s(this.prompts[i],`Prompt "${i}" is not registered`);let l=new this.prompts[i](e),h=o(this.answers,r);l.state.answers=this.answers,l.enquirer=this,r&&l.on("submit",(t=>{this.emit("answer",r,t,l),a(this.answers,r,t)}));let u=l.emit.bind(l);return l.emit=(...t)=>(this.emit.call(this,...t),u(...t)),this.emit("prompt",l,this),e.autofill&&null!=h?(l.value=l.input=h,"show"===e.autofill&&await l.submit()):h=l.value=await l.run(),h}use(t){return t.call(this,this),this}set Prompt(t){this._Prompt=t}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(t){this._Prompt=t}static get Prompt(){return this._Prompt||i(232)}static get prompts(){return i(594)}static get types(){return i(920)}static get prompt(){const t=(e,...i)=>{let s=new this(...i),r=s.emit.bind(s);return s.emit=(...e)=>(t.emit(...e),r(...e)),s.prompt(e)};return n.mixinEmitter(t,new r),t}}n.mixinEmitter(a,new r);const o=a.prompts;for(let t of Object.keys(o)){let e=t.toLowerCase(),i=e=>new o[t](e).run();a.prompt[e]=i,a[e]=i,a[t]||Reflect.defineProperty(a,t,{get:()=>o[t]})}const l=t=>{n.defineExport(a,t,(()=>a.types[t]))};l("ArrayPrompt"),l("AuthPrompt"),l("BooleanPrompt"),l("NumberPrompt"),l("StringPrompt"),t.exports=a},907:(t,e,i)=>{"use strict";const s="Apple_Terminal"===process.env.TERM_PROGRAM,r=i(3),n=i(546),a=t.exports=e,o="[";let l=!1;const h=a.code={bell:"",beep:"",beginning:`${o}G`,down:`${o}J`,esc:o,getPosition:`${o}6n`,hide:`${o}?25l`,line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,restorePosition:o+(s?"8":"u"),savePosition:o+(s?"7":"s"),screen:`${o}2J`,show:`${o}?25h`,up:`${o}1J`},u=a.cursor={get hidden(){return l},hide:()=>(l=!0,h.hide),show:()=>(l=!1,h.show),forward:(t=1)=>`${o}${t}C`,backward:(t=1)=>`${o}${t}D`,nextLine:(t=1)=>`${o}E`.repeat(t),prevLine:(t=1)=>`${o}F`.repeat(t),up:(t=1)=>t?`${o}${t}A`:"",down:(t=1)=>t?`${o}${t}B`:"",right:(t=1)=>t?`${o}${t}C`:"",left:(t=1)=>t?`${o}${t}D`:"",to:(t,e)=>e?`${o}${e+1};${t+1}H`:`${o}${t+1}G`,move(t=0,e=0){let i="";return i+=t<0?u.left(-t):t>0?u.right(t):"",i+=e<0?u.up(-e):e>0?u.down(e):"",i},strLen(t){for(var e=0,i=t.length,s=-1,r=0;r=0&&s<=128?1:2;return e},restore(t={}){let{after:e,cursor:i,initial:s,input:r,prompt:o,size:l,value:h}=t;if(s=n.isPrimitive(s)?String(s):"",r=n.isPrimitive(r)?String(r):"",h=n.isPrimitive(h)?String(h):"",l){let t=a.cursor.up(l)+a.cursor.to(this.strLen(o)),e=r.length-i;return e>0&&(t+=a.cursor.left(e)),t}if(h||e){let t=!r&&s?-this.strLen(s):-this.strLen(r)+i;return e&&(t-=this.strLen(e)),""===r&&s&&!o.includes(s)&&(t+=this.strLen(s)),a.cursor.move(t)}}},c=a.erase={screen:h.screen,up:h.up,down:h.down,line:h.line,lineEnd:h.lineEnd,lineStart:h.lineStart,lines(t){let e="";for(let i=0;i{if(!e)return c.line+u.to(0);let i=t.split(/\r?\n/),s=0;for(let t of i)s+=1+Math.floor(Math.max([...r(t)].length-1,0)/e);return(c.line+u.prevLine()).repeat(s-1)+c.line+u.to(0)}},726:(t,e)=>{"use strict";e.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"},e.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"},e.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"},e.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"},e.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}},736:t=>{"use strict";const e=t=>(t=>t.filter(((e,i)=>t.lastIndexOf(e)===i)))(t).filter(Boolean);t.exports=(t,i={},s="")=>{let r,n,{past:a=[],present:o=""}=i;switch(t){case"prev":case"undo":return r=a.slice(0,a.length-1),n=a[a.length-1]||"",{past:e([s,...r]),present:n};case"next":case"redo":return r=a.slice(1),n=a[0]||"",{past:e([...r,s]),present:n};case"save":return{past:e([...a,s]),present:""};case"remove":return n=e(a.filter((t=>t!==s))),o="",n.length&&(o=n.pop()),{past:n,present:o};default:throw new Error(`Invalid action: "${t}"`)}}},189:(t,e,i)=>{"use strict";const s=i(3);class r{constructor(t){this.name=t.key,this.field=t.field||{},this.value=((t="")=>"string"==typeof t?t.replace(/^['"]|['"]$/g,""):"")(t.initial||this.field.initial||""),this.message=t.message||this.name,this.cursor=0,this.input="",this.lines=[]}}function n(t,e,i,s){return(i,r,n,a)=>"function"==typeof n.field[t]?n.field[t].call(e,i,r,n,a):[s,i].find((t=>e.isValue(t)))}t.exports=async t=>{let e=t.options,i=new Set(!0===e.required?[]:e.required||[]),a={...e.values,...e.initial},{tabstops:o,items:l,keys:h}=await(async(t={},e={},i=(t=>t))=>{let s=new Set,n=t.fields||[],a=t.template,o=[],l=[],h=[],u=1;"function"==typeof a&&(a=await a());let c=-1,d=()=>a[++c],p=()=>a[c+1],m=t=>{t.line=u,o.push(t)};for(m({type:"bos",value:""});ct.name===o.key));o.field=n.find((t=>t.name===o.key)),u||(u=new r(o),l.push(u)),u.lines.push(o.line-1);continue}let a=o[o.length-1];"text"===a.type&&a.line===u?a.value+=t:m({type:"text",value:t})}return m({type:"eos",value:""}),{input:a,tabstops:o,unique:s,keys:h,items:l}})(e,a),u=n("result",t),c=n("format",t),d=n("validate",t,0,!0),p=t.isValue.bind(t);return async(r={},n=!1)=>{let a=0;r.required=i,r.items=l,r.keys=h,r.output="";let m=async(t,e,i,s)=>{let r=await d(t,e,i,s);return!1===r?"Invalid field "+i.name:r};for(let i of o){let o=i.value,h=i.key;if("template"===i.type){if("template"===i.type){let d=l.find((t=>t.name===h));!0===e.required&&r.required.add(d.name);let f=[d.input,r.values[d.value],d.value,o].find(p),g=(d.field||{}).message||i.inner;if(n){let t=await m(r.values[h],r,d,a);if(t&&"string"==typeof t||!1===t){r.invalid.set(h,t);continue}r.invalid.delete(h);let e=await u(r.values[h],r,d,a);r.output+=s(e);continue}d.placeholder=!1;let y=o;o=await c(o,r,d,a),f!==o?(r.values[h]=f,o=t.styles.typing(f),r.missing.delete(g)):(r.values[h]=void 0,f=`<${g}>`,o=t.styles.primary(f),d.placeholder=!0,r.required.has(h)&&r.missing.add(g)),r.missing.has(g)&&r.validating&&(o=t.styles.warning(f)),r.invalid.has(h)&&r.validating&&(o=t.styles.danger(f)),a===r.index&&(o=y!==o?t.styles.underline(o):t.styles.heading(s(o))),a++}o&&(r.output+=o)}else o&&(r.output+=o)}let f=r.output.split("\n").map((t=>" "+t)),g=l.length,y=0;for(let e of l)r.invalid.has(e.name)&&e.lines.forEach((t=>{" "===f[t][0]&&(f[t]=r.styles.danger(r.symbols.bullet)+f[t].slice(1))})),t.isValue(r.values[e.name])&&y++;return r.completed=(y/g*100).toFixed(0),r.output=f.join("\n"),r.output}}},914:(t,e,i)=>{"use strict";const s=i(521),r=i(726),n=i(607),a=/^(?:\x1b)([a-zA-Z0-9])$/,o=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,l={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"},h=(t="",e={})=>{let i,s={name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:t,raw:t,...e};if(Buffer.isBuffer(t)?t[0]>127&&void 0===t[1]?(t[0]-=128,t=""+String(t)):t=String(t):void 0!==t&&"string"!=typeof t?t=String(t):t||(t=s.sequence||""),s.sequence=s.sequence||t||s.name,"\r"===t)s.raw=void 0,s.name="return";else if("\n"===t)s.name="enter";else if("\t"===t)s.name="tab";else if("\b"===t||""===t||""===t||"\b"===t)s.name="backspace",s.meta=""===t.charAt(0);else if(""===t||""===t)s.name="escape",s.meta=2===t.length;else if(" "===t||" "===t)s.name="space",s.meta=2===t.length;else if(t<="")s.name=String.fromCharCode(t.charCodeAt(0)+"a".charCodeAt(0)-1),s.ctrl=!0;else if(1===t.length&&t>="0"&&t<="9")s.name="number";else if(1===t.length&&t>="a"&&t<="z")s.name=t;else if(1===t.length&&t>="A"&&t<="Z")s.name=t.toLowerCase(),s.shift=!0;else if(i=a.exec(t))s.meta=!0,s.shift=/^[A-Z]$/.test(i[1]);else if(i=o.exec(t)){let e=[...t];""===e[0]&&""===e[1]&&(s.option=!0);let r=[i[1],i[2],i[4],i[6]].filter(Boolean).join(""),n=(i[3]||i[5]||1)-1;s.ctrl=!!(4&n),s.meta=!!(10&n),s.shift=!!(1&n),s.code=r,s.name=l[r],s.shift=function(t){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(t)}(r)||s.shift,s.ctrl=function(t){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(t)}(r)||s.ctrl}return s};h.listen=(t={},e)=>{let{stdin:i}=t;if(!i||i!==process.stdin&&!i.isTTY)throw new Error("Invalid stream passed");let r=s.createInterface({terminal:!0,input:i});s.emitKeypressEvents(i,r);const a=new n(((t,i)=>e(t,h(t,i),r)));let o=i.isRaw;return i.isTTY&&i.setRawMode(!0),i.on("keypress",a.enqueue),r.resume(),()=>{i.isTTY&&i.setRawMode(o),i.removeListener("keypress",a.enqueue),a.destroy(),r.pause(),r.close()}},h.action=(t,e,i)=>{let s={...r,...i};return e.ctrl?(e.action=s.ctrl[e.name],e):e.option&&s.option?(e.action=s.option[e.name],e):e.shift?(e.action=s.shift[e.name],e):(e.action=s.keys[e.name],e)},t.exports=h},786:(t,e,i)=>{"use strict";const s=i(546);t.exports=(t,e={})=>{t.cursorHide();let{input:i="",initial:r="",pos:n,showCursor:a=!0,color:o}=e,l=o||t.styles.placeholder,h=s.inverse(t.styles.primary),u=e=>h(t.styles.black(e)),c=i,d=u(" ");if(t.blink&&!0===t.blink.off&&(u=t=>t,d=""),a&&0===n&&""===r&&""===i)return u(" ");if(a&&0===n&&(i===r||""===i))return u(r[0])+l(r.slice(1));r=s.isPrimitive(r)?`${r}`:"",i=s.isPrimitive(i)?`${i}`:"";let p=r&&r.startsWith(i)&&r!==i,m=p?u(r[i.length]):d;if(n!==i.length&&!0===a&&(c=i.slice(0,n)+u(i[n])+i.slice(n+1),m=""),!1===a&&(m=""),p){let e=t.styles.unstyle(c+m);return c+m+l(r.slice(e.length))}return c+m}},232:(t,e,i)=>{"use strict";const s=i(361),r=i(3),n=i(914),a=i(940),o=i(873),l=i(227),h=i(546),u=i(907);class c extends s{constructor(t={}){super(),this.name=t.name,this.type=t.type,this.options=t,l(this),a(this),this.state=new o(this),this.initial=[t.initial,t.default].find((t=>null!=t)),this.stdout=t.stdout||process.stdout,this.stdin=t.stdin||process.stdin,this.scale=t.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=function(t){"number"==typeof t&&(t=[t,t,t,t]);let e=[].concat(t||[]),i=t=>t%2==0?"\n":" ",s=[];for(let t=0;t<4;t++){let r=i(t);e[t]?s.push(r.repeat(e[t])):s.push("")}return s}(this.options.margin),this.setMaxListeners(0),function(t){let e=e=>void 0===t[e]||"function"==typeof t[e],i=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],s=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let r of Object.keys(t.options)){if(i.includes(r))continue;if(/^on[A-Z]/.test(r))continue;let n=t.options[r];"function"==typeof n&&e(r)?s.includes(r)||(t[r]=n.bind(t)):"function"!=typeof t[r]&&(t[r]=n)}}(this)}async keypress(t,e={}){this.keypressed=!0;let i=n.action(t,n(t,e),this.options.actions);this.state.keypress=i,this.emit("keypress",t,i),this.emit("state",this.state.clone());const s=this.options[i.action]||this[i.action]||this.dispatch;if("function"==typeof s)return await s.call(this,t,i);this.alert()}alert(){delete this.state.alert,!1===this.options.show?this.emit("alert"):this.stdout.write(u.code.beep)}cursorHide(){this.stdout.write(u.cursor.hide());const t=h.onExit((()=>this.cursorShow()));this.on("close",(()=>{this.cursorShow(),t()}))}cursorShow(){this.stdout.write(u.cursor.show())}write(t){t&&(this.stdout&&!1!==this.state.show&&this.stdout.write(t),this.state.buffer+=t)}clear(t=0){let e=this.state.buffer;this.state.buffer="",(e||t)&&!1!==this.options.show&&this.stdout.write(u.cursor.down(t)+u.clear(e,this.width))}restore(){if(this.state.closed||!1===this.options.show)return;let{prompt:t,after:e,rest:i}=this.sections(),{cursor:s,initial:r="",input:n="",value:a=""}=this,o={after:e,cursor:s,initial:r,input:n,prompt:t,size:this.state.size=i.length,value:a},l=u.cursor.restore(o);l&&this.stdout.write(l)}sections(){let{buffer:t,input:e,prompt:i}=this.state;i=r(i);let s=r(t),n=s.indexOf(i),a=s.slice(0,n),o=s.slice(n).split("\n"),l=o[0],h=o[o.length-1],u=(i+(e?" "+e:"")).length,c=ut.call(this,this.value),this.result=()=>i.call(this,this.value),"function"==typeof e.initial&&(this.initial=await e.initial.call(this,this)),"function"==typeof e.onRun&&await e.onRun.call(this,this),"function"==typeof e.onSubmit){let t=e.onSubmit.bind(this),i=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await t(this.name,this.value,this),i())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise((async(t,e)=>{if(this.once("submit",t),this.once("cancel",e),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")}))}async element(t,e,i){let{options:s,state:r,symbols:n,timers:a}=this,o=a&&a[t];r.timer=o;let l=s[t]||r[t]||n[t],h=e&&null!=e[t]?e[t]:await l;if(""===h)return h;let u=await this.resolve(h,r,e,i);return!u&&e&&e[t]?this.resolve(l,r,e,i):u}async prefix(){let t=await this.element("prefix")||this.symbols,e=this.timers&&this.timers.prefix,i=this.state;return i.timer=e,h.isObject(t)&&(t=t[i.status]||t.pending),h.hasColor(t)?t:(this.styles[i.status]||this.styles.pending)(t)}async message(){let t=await this.element("message");return h.hasColor(t)?t:this.styles.strong(t)}async separator(){let t=await this.element("separator")||this.symbols,e=this.timers&&this.timers.separator,i=this.state;i.timer=e;let s=t[i.status]||t.pending||i.separator,r=await this.resolve(s,i);return h.isObject(r)&&(r=r[i.status]||r.pending),h.hasColor(r)?r:this.styles.muted(r)}async pointer(t,e){let i=await this.element("pointer",t,e);if("string"==typeof i&&h.hasColor(i))return i;if(i){let t=this.styles,s=this.index===e,r=s?t.primary:t=>t,n=await this.resolve(i[s?"on":"off"]||i,this.state),a=h.hasColor(n)?n:r(n);return s?a:" ".repeat(n.length)}}async indicator(t,e){let i=await this.element("indicator",t,e);if("string"==typeof i&&h.hasColor(i))return i;if(i){let e=this.styles,s=!0===t.enabled,r=s?e.success:e.dark,n=i[s?"on":"off"]||i;return h.hasColor(n)?n:r(n)}return""}body(){return null}footer(){if("pending"===this.state.status)return this.element("footer")}header(){if("pending"===this.state.status)return this.element("header")}async hint(){if("pending"===this.state.status&&!this.isValue(this.state.input)){let t=await this.element("hint");return h.hasColor(t)?t:this.styles.muted(t)}}error(t){return this.state.submitted?"":t||this.state.error}format(t){return t}result(t){return t}validate(t){return!0!==this.options.required||this.isValue(t)}isValue(t){return null!=t&&""!==t}resolve(t,...e){return h.resolve(this,t,...e)}get base(){return c.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||h.height(this.stdout,25)}get width(){return this.options.columns||h.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(t){this.state.cursor=t}get cursor(){return this.state.cursor}set input(t){this.state.input=t}get input(){return this.state.input}set value(t){this.state.value=t}get value(){let{input:t,value:e}=this.state,i=[e,t].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return t=>new this(t).run()}}t.exports=c},317:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){super(t),this.cursorShow()}moveCursor(t){this.state.cursor+=t}dispatch(t){return this.append(t)}space(t){return this.options.multiple?super.space(t):this.append(t)}append(t){let{cursor:e,input:i}=this.state;return this.input=i.slice(0,e)+t+i.slice(e),this.moveCursor(1),this.complete()}delete(){let{cursor:t,input:e}=this.state;return e?(this.input=e.slice(0,t-1)+e.slice(t),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:t,input:e}=this.state;return void 0===e[t]?this.alert():(this.input=`${e}`.slice(0,t)+`${e}`.slice(t+1),this.complete())}number(t){return this.append(t)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(t=this.input,e=this.state._choices){if("function"==typeof this.options.suggest)return this.options.suggest.call(this,t,e);let i=t.toLowerCase();return e.filter((t=>t.message.toLowerCase().includes(i)))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map((t=>this.styles.primary(t.message))).join(", ");if(this.state.submitted){let t=this.value=this.input=this.focused.value;return this.styles.primary(t)}return this.input}async render(){if("pending"!==this.state.status)return super.render();const t=this.options.highlight||this.styles.complement,e=((t,e)=>{const i=t?new RegExp(t,"ig"):/$^/;return s=>t?s.replace(i,(t=>e(t))):s})(this.input,((e,i)=>e?t.stack?t(e):t.call(this,e):e)),i=this.choices;this.choices=i.map((t=>({...t,message:e(t.message)}))),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map((t=>t.name))),super.submit()}}},186:(t,e,i)=>{"use strict";const s=i(926);function r(t,e){return t.username===this.options.username&&t.password===this.options.password}const n=(t=r)=>{const e=[{name:"username",message:"username"},{name:"password",message:"password",format(t){return this.options.showPassword?t:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(t.length))}}];class i extends(s.create(t)){constructor(t){super({...t,choices:e})}static create(t){return n(t)}}return i};t.exports=n()},291:(t,e,i)=>{"use strict";const s=i(838);t.exports=class extends s{constructor(t){super(t),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}}},848:(t,e,i)=>{"use strict";const s=i(466),r=i(826).prototype;t.exports=class extends s{constructor(t){super({...t,multiple:!0}),this.align=[this.options.align,"left"].find((t=>null!=t)),this.emptyError="",this.values={}}dispatch(t,e){let i=this.focused,s=i.parent||{};return i.editable||s.editable||"a"!==t&&"i"!==t?r.dispatch.call(this,t,e):super[t]()}append(t,e){return r.append.call(this,t,e)}delete(t,e){return r.delete.call(this,t,e)}space(t){return this.focused.editable?this.append(t):super.space()}number(t){return this.focused.editable?this.append(t):super.number(t)}next(){return this.focused.editable?r.next.call(this):super.next()}prev(){return this.focused.editable?r.prev.call(this):super.prev()}async indicator(t,e){let i=t.indicator||"",s=t.editable?i:super.indicator(t,e);return await this.resolve(s,this.state,t,e)||""}indent(t){return"heading"===t.role?"":t.editable?" ":" "}async renderChoice(t,e){return t.indent="",t.editable?r.renderChoice.call(this,t,e):super.renderChoice(t,e)}error(){return""}footer(){return this.state.error}async validate(){let t=!0;for(let e of this.choices){if("function"!=typeof e.validate)continue;if("heading"===e.role)continue;let i=e.parent?this.value[e.parent.name]:this.value;if(e.editable?i=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(i=!0===e.enabled),t=await e.validate(i,this.state),!0!==t)break}return!0!==t&&(this.state.error="string"==typeof t?t:"Invalid Input"),t}submit(){if(!0===this.focused.newChoice)return super.submit();if(this.choices.some((t=>t.newChoice)))return this.alert();this.value={};for(let t of this.choices){let e=t.parent?this.value[t.parent.name]:this.value;"heading"!==t.role?t.editable?e[t.name]=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(e[t.name]=!0===t.enabled):this.value[t.name]={}}return this.base.submit.call(this)}}},826:(t,e,i)=>{"use strict";const s=i(3),r=i(466),n=i(786);t.exports=class extends r{constructor(t){super({...t,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find((t=>null!=t)),this.emptyError="",this.values={}}async reset(t){return await super.reset(),!0===t&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach((t=>t.reset&&t.reset())),this.render()}dispatch(t){return!!t&&this.append(t)}append(t){let e=this.focused;if(!e)return this.alert();let{cursor:i,input:s}=e;return e.value=e.input=s.slice(0,i)+t+s.slice(i),e.cursor++,this.render()}delete(){let t=this.focused;if(!t||t.cursor<=0)return this.alert();let{cursor:e,input:i}=t;return t.value=t.input=i.slice(0,e-1)+i.slice(e),t.cursor--,this.render()}deleteForward(){let t=this.focused;if(!t)return this.alert();let{cursor:e,input:i}=t;if(void 0===i[e])return this.alert();let s=`${i}`.slice(0,e)+`${i}`.slice(e+1);return t.value=t.input=s,this.render()}right(){let t=this.focused;return t?t.cursor>=t.input.length?this.alert():(t.cursor++,this.render()):this.alert()}left(){let t=this.focused;return t?t.cursor<=0?this.alert():(t.cursor--,this.render()):this.alert()}space(t,e){return this.dispatch(t,e)}number(t,e){return this.dispatch(t,e)}next(){let t=this.focused;if(!t)return this.alert();let{initial:e,input:i}=t;return e&&e.startsWith(i)&&i!==e?(t.value=t.input=e,t.cursor=t.value.length,this.render()):super.next()}prev(){let t=this.focused;return t?0===t.cursor?super.prev():(t.value=t.input="",t.cursor=0,this.render()):this.alert()}separator(){return""}format(t){return this.state.submitted?"":super.format(t)}pointer(){return""}indicator(t){return t.input?"⦿":"⊙"}async choiceSeparator(t,e){let i=await this.resolve(t.separator,this.state,t,e)||":";return i?" "+this.styles.disabled(i):""}async renderChoice(t,e){await this.onChoice(t,e);let{state:i,styles:r}=this,{cursor:a,initial:o="",name:l,input:h=""}=t,{muted:u,submitted:c,primary:d,danger:p}=r,m=this.index===e,f=t.validate||(()=>!0),g=await this.choiceSeparator(t,e),y=t.message;"right"===this.align&&(y=y.padStart(this.longest+1," ")),"left"===this.align&&(y=y.padEnd(this.longest+1," "));let b=this.values[l]=h||o,w=h?"success":"dark";!0!==await f.call(t,b,this.state)&&(w="danger");let v=(0,r[w])(await this.indicator(t,e))+(t.pad||""),x=this.indent(t),k=()=>[x,v,y+g,h].filter(Boolean).join(" ");if(i.submitted)return y=s(y),h=c(h),k();if(t.format)h=await t.format.call(this,h,t,e);else{let t=this.styles.muted;h=n(this,{input:h,initial:o,pos:a,showCursor:m,color:t})}return this.isValue(h)||(h=this.styles.muted(this.symbols.ellipsis)),t.result&&(this.values[l]=await t.result.call(this,b,t,e)),m&&(y=d(y)),t.error?h+=(h?" ":"")+p(t.error.trim()):t.hint&&(h+=(h?" ":"")+u(t.hint.trim())),k()}async submit(){return this.value=this.values,super.base.submit.call(this)}}},594:(t,e,i)=>{"use strict";const s=i(546),r=(t,i)=>{s.defineExport(e,t,i),s.defineExport(e,t.toLowerCase(),i)};r("AutoComplete",(()=>i(317))),r("BasicAuth",(()=>i(186))),r("Confirm",(()=>i(291))),r("Editable",(()=>i(848))),r("Form",(()=>i(826))),r("Input",(()=>i(719))),r("Invisible",(()=>i(822))),r("List",(()=>i(795))),r("MultiSelect",(()=>i(56))),r("Numeral",(()=>i(403))),r("Password",(()=>i(847))),r("Scale",(()=>i(813))),r("Select",(()=>i(466))),r("Snippet",(()=>i(451))),r("Sort",(()=>i(144))),r("Survey",(()=>i(755))),r("Text",(()=>i(781))),r("Toggle",(()=>i(653))),r("Quiz",(()=>i(249)))},719:(t,e,i)=>{"use strict";const s=i(391),r=i(736);t.exports=class extends s{constructor(t){super(t);let e=this.options.history;if(e&&e.store){let t=e.values||this.initial;this.autosave=!!e.autosave,this.store=e.store,this.data=this.store.get("values")||{past:[],present:t},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(t){return this.store?(this.data=r(t,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=r("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&!0===this.autosave&&this.save(),super.submit()}}},822:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{format(){return""}}},795:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t={}){super(t),this.sep=this.options.separator||/, */,this.initial=t.initial||""}split(t=this.value){return t?String(t).split(this.sep):[]}format(){let t=this.state.submitted?this.styles.primary:t=>t;return this.list.map(t).join(", ")}async submit(t){let e=this.state.error||await this.validate(this.list,this.state);return!0!==e?(this.state.error=e,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}}},56:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){super({...t,multiple:!0})}}},403:(t,e,i)=>{t.exports=i(376)},847:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t){super(t),this.cursorShow()}format(t=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(t.length)):""}}},249:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){if(super(t),"number"!=typeof this.options.correctChoice||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(t,e){let i=await super.toChoices(t,e);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(t){return t.index===this.options.correctChoice}async result(t){return{selectedAnswer:t,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}}},813:(t,e,i)=>{"use strict";const s=i(3),r=i(575),n=i(546);t.exports=class extends r{constructor(t={}){super(t),this.widths=[].concat(t.messageWidth||50),this.align=[].concat(t.align||"left"),this.linebreak=t.linebreak||!1,this.edgeLength=t.edgeLength||3,this.newline=t.newline||"\n ";let e=t.startNumber||1;"number"==typeof this.scale&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map(((t,i)=>({name:i+e}))))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(!0===this.tableized)return;this.tableized=!0;let t=0;for(let e of this.choices){t=Math.max(t,e.message.length),e.scaleIndex=e.initial||2,e.scale=[];for(let t=0;t=this.scale.length-1?this.alert():(t.scaleIndex++,this.render())}left(){let t=this.focused;return t.scaleIndex<=0?this.alert():(t.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map((t=>this.styles.info(t.index))).join(", "):""}pointer(){return""}renderScaleKey(){return!1===this.scaleKey||this.state.submitted?"":["",...this.scale.map((t=>` ${t.name} - ${t.message}`))].map((t=>this.styles.muted(t))).join("\n")}renderScaleHeading(t){let e=this.scale.map((t=>t.name));"function"==typeof this.options.renderScaleHeading&&(e=this.options.renderScaleHeading.call(this,t));let i=this.scaleLength-e.join("").length,s=Math.round(i/(e.length-1)),r=e.map((t=>this.styles.strong(t))).join(" ".repeat(s)),n=" ".repeat(this.widths[0]);return this.margin[3]+n+this.margin[1]+r}scaleIndicator(t,e,i){if("function"==typeof this.options.scaleIndicator)return this.options.scaleIndicator.call(this,t,e,i);let s=t.scaleIndex===e.index;return e.disabled?this.styles.hint(this.symbols.radio.disabled):s?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(t,e){let i=t.scale.map((i=>this.scaleIndicator(t,i,e))),s="Hyper"===this.term?"":" ";return i.join(s+this.symbols.line.repeat(this.edgeLength))}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,r=await this.pointer(t,e),a=await t.hint;a&&!n.hasColor(a)&&(a=this.styles.muted(a));let o=t=>this.margin[3]+t.replace(/\s+$/,"").padEnd(this.widths[0]," "),l=this.newline,h=this.indent(t),u=await this.resolve(t.message,this.state,t,e),c=await this.renderScale(t,e),d=this.margin[1]+this.margin[3];this.scaleLength=s(c).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-d.length);let p=n.wordWrap(u,{width:this.widths[0],newline:l}).split("\n").map((t=>o(t)+this.margin[1]));return i&&(c=this.styles.info(c),p=p.map((t=>this.styles.info(t)))),p[0]+=c,this.linebreak&&p.push(""),[h+r,p.join("\n")].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t),i=await this.renderScaleHeading();return this.margin[0]+[i,...e.map((t=>t.join(" ")))].join("\n")}async render(){let{submitted:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=await this.message(),n="";!1!==this.options.promptLine&&(n=[i,r,s,""].join(" "),this.state.prompt=n);let a=await this.header(),o=await this.format(),l=await this.renderScaleKey(),h=await this.error()||await this.hint(),u=await this.renderChoices(),c=await this.footer(),d=this.emptyError;o&&(n+=o),h&&!n.includes(h)&&(n+=" "+h),t&&!o&&!u.trim()&&this.multiple&&null!=d&&(n+=this.styles.danger(d)),this.clear(e),this.write([a,n,l,u,c].filter(Boolean).join("\n")),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIndex;return this.base.submit.call(this)}}},466:(t,e,i)=>{"use strict";const s=i(575),r=i(546);t.exports=class extends s{constructor(t){super(t),this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(t,e){if(this.multiple)return this[e.name]?await this[e.name](t,e):await super.dispatch(t,e);this.alert()}separator(){if(this.options.separator)return super.separator();let t=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():t}pointer(t,e){return!this.multiple||this.options.pointer?super.pointer(t,e):""}indicator(t,e){return this.multiple?super.indicator(t,e):""}choiceMessage(t,e){let i=this.resolve(t.message,this.state,t,e);return"heading"!==t.role||r.hasColor(i)||(i=this.styles.strong(i)),this.resolve(i,this.state,t,e)}choiceSeparator(){return":"}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,s=await this.pointer(t,e),n=await this.indicator(t,e)+(t.pad||""),a=await this.resolve(t.hint,this.state,t,e);a&&!r.hasColor(a)&&(a=this.styles.muted(a));let o=this.indent(t),l=await this.choiceMessage(t,e),h=()=>[this.margin[3],o+s+n,l,this.margin[1],a].filter(Boolean).join(" ");return"heading"===t.role?h():t.disabled?(r.hasColor(l)||(l=this.styles.disabled(l)),h()):(i&&(l=this.styles.em(l)),h())}async renderChoices(){if("choices"===this.state.loading)return this.styles.warning("Loading choices");if(this.state.submitted)return"";let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t);e.length||e.push(this.styles.danger("No matching choices"));let i,s=this.margin[0]+e.join("\n");return this.options.choicesHeader&&(i=await this.resolve(this.options.choicesHeader,this.state)),[i,s].filter(Boolean).join("\n")}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map((t=>this.styles.primary(t.name))).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:t,size:e}=this.state,i="",s=await this.header(),r=await this.prefix(),n=await this.separator(),a=await this.message();!1!==this.options.promptLine&&(i=[r,a,n,""].join(" "),this.state.prompt=i);let o=await this.format(),l=await this.error()||await this.hint(),h=await this.renderChoices(),u=await this.footer();o&&(i+=o),l&&!i.includes(l)&&(i+=" "+l),t&&!o&&!h.trim()&&this.multiple&&null!=this.emptyError&&(i+=this.styles.danger(this.emptyError)),this.clear(e),this.write([s,i,h,u].filter(Boolean).join("\n")),this.write(this.margin[2]),this.restore()}}},451:(t,e,i)=>{"use strict";const s=i(3),r=i(189),n=i(232);t.exports=class extends n{constructor(t){super(t),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await r(this),await super.initialize()}async reset(t){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},!0!==t&&(await this.initialize(),await this.render())}moveCursor(t){let e=this.getItem();this.cursor+=t,e.cursor+=t}dispatch(t,e){e.code||e.ctrl||null==t||!this.getItem()?this.alert():this.append(t,e)}append(t,e){let i=this.getItem(),s=i.input.slice(0,this.cursor),r=i.input.slice(this.cursor);this.input=i.input=`${s}${t}${r}`,this.moveCursor(1),this.render()}delete(){let t=this.getItem();if(this.cursor<=0||!t.input)return this.alert();let e=t.input.slice(this.cursor),i=t.input.slice(0,this.cursor-1);this.input=t.input=`${i}${e}`,this.moveCursor(-1),this.render()}increment(t){return t>=this.state.keys.length-1?0:t+1}decrement(t){return t<=0?this.state.keys.length-1:t-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(t){let e=this.state.completed<100?this.styles.warning:this.styles.success;return!0===this.state.submitted&&100!==this.state.completed&&(e=this.styles.danger),e(`${this.state.completed}% completed`)}async render(){let{index:t,keys:e=[],submitted:i,size:s}=this.state,r=[this.options.newline,"\n"].find((t=>null!=t)),n=await this.prefix(),a=await this.separator(),o=[n,await this.message(),a].filter(Boolean).join(" ");this.state.prompt=o;let l=await this.header(),h=await this.error()||"",u=await this.hint()||"",c=i?"":await this.interpolate(this.state),d=this.state.key=e[t]||"",p=await this.format(d),m=await this.footer();p&&(o+=" "+p),u&&!p&&0===this.state.completed&&(o+=" "+u),this.clear(s);let f=[l,o,c,m,h.trim()];this.write(f.filter(Boolean).join(r)),this.restore()}getItem(t){let{items:e,keys:i,index:s}=this.state,r=e.find((t=>t.name===i[s]));return r&&null!=r.input&&(this.input=r.input,this.cursor=r.cursor),r}async submit(){"function"!=typeof this.interpolate&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:t,missing:e,output:i,values:r}=this.state;if(t.size){let e="";for(let[i,s]of t)e+=`Invalid ${i}: ${s}\n`;return this.state.error=e,super.submit()}if(e.size)return this.state.error="Required: "+[...e.keys()].join(", "),super.submit();let n=s(i).split("\n").map((t=>t.slice(1))).join("\n");return this.value={values:r,result:n},super.submit()}}},144:(t,e,i)=>{"use strict";const s="(Use + to sort)",r=i(466);t.exports=class extends r{constructor(t){super({...t,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,s].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(t,e){let i=await super.renderChoice(t,e),s=this.symbols.identicalTo+" ",r=this.index===e&&this.sorting?this.styles.muted(s):" ";return!1===this.options.drag&&(r=""),!0===this.options.numbered?r+`${e+1} - `+i:r+i}get selected(){return this.choices}submit(){return this.value=this.choices.map((t=>t.value)),super.submit()}}},755:(t,e,i)=>{"use strict";const s=i(575);function r(t,e={}){if(Array.isArray(e.scale))return e.scale.map((t=>({...t})));let i=[];for(let e=1;ethis.styles.muted(t))),this.state.header=t.join("\n ")}}async toChoices(...t){if(this.createdScales)return!1;this.createdScales=!0;let e=await super.toChoices(...t);for(let t of e)t.scale=r(5,this.options),t.scaleIdx=2;return e}dispatch(){this.alert()}space(){let t=this.focused,e=t.scale[t.scaleIdx],i=e.selected;return t.scale.forEach((t=>t.selected=!1)),e.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let t=this.focused;return t.scaleIdx>=t.scale.length-1?this.alert():(t.scaleIdx++,this.render())}left(){let t=this.focused;return t.scaleIdx<=0?this.alert():(t.scaleIdx--,this.render())}indent(){return" "}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,s="Hyper"===this.term,r=s?9:8,n=s?"":" ",a=this.symbols.line.repeat(r),o=" ".repeat(r+(s?0:1)),l=t=>(t?this.styles.success("◉"):"◯")+n,h=e+1+".",u=i?this.styles.heading:this.styles.noop,c=await this.resolve(t.message,this.state,t,e),d=this.indent(t),p=d+t.scale.map(((e,i)=>l(i===t.scaleIdx))).join(a),m=d+t.scale.map(((e,i)=>(e=>e===t.scaleIdx?u(e):e)(i))).join(o);return i&&(p=this.styles.cyan(p),m=this.styles.cyan(m)),[[h,c].filter(Boolean).join(" "),p,m," "].filter(Boolean).join("\n")}async renderChoices(){if(this.state.submitted)return"";let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t);return e.length||e.push(this.styles.danger("No matching choices")),e.join("\n")}format(){return this.state.submitted?this.choices.map((t=>this.styles.info(t.scaleIdx))).join(", "):""}async render(){let{submitted:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=[i,await this.message(),s].filter(Boolean).join(" ");this.state.prompt=r;let n=await this.header(),a=await this.format(),o=await this.error()||await this.hint(),l=await this.renderChoices(),h=await this.footer();!a&&o||(r+=" "+a),o&&!r.includes(o)&&(r+=" "+o),t&&!a&&!l&&this.multiple&&"form"!==this.type&&(r+=this.styles.danger(this.emptyError)),this.clear(e),this.write([r,n,l,h].filter(Boolean).join("\n")),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIdx;return this.base.submit.call(this)}}},781:(t,e,i)=>{t.exports=i(719)},653:(t,e,i)=>{"use strict";const s=i(838);t.exports=class extends s{async initialize(){await super.initialize(),this.value=this.initial=this.resolve(this.options.initial),this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(!0===this.value)return this.alert();this.value=!0,this.render()}disable(){if(!1===this.value)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(t="",e){switch(t.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let t=t=>this.styles.primary.underline(t);return[this.value?this.disabled:t(this.disabled),this.value?t(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:t}=this.state,e=await this.header(),i=await this.prefix(),s=await this.separator(),r=await this.message(),n=await this.format(),a=await this.error()||await this.hint(),o=await this.footer(),l=[i,r,s,n].join(" ");this.state.prompt=l,a&&!l.includes(a)&&(l+=" "+a),this.clear(t),this.write([e,l,o].filter(Boolean).join("\n")),this.write(this.margin[2]),this.restore()}}},607:t=>{"use strict";t.exports=class{_queue=[];_executing=!1;_jobRunner=null;constructor(t){this._jobRunner=t}enqueue=(...t)=>{this._queue.push(t),this._dequeue()};destroy(){this._queue.length=0,this._jobRunner=null}_dequeue(){!this._executing&&this._queue.length&&(this._executing=!0,this._jobRunner(...this._queue.shift()),setTimeout((()=>{this._executing=!1,this._dequeue()})))}}},502:(t,e,i)=>{"use strict";const s=i(546),r={default:(t,e)=>e,checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading:(t,e)=>(e.disabled="",e.indicator=[e.indicator," "].find((t=>null!=t)),e.message=e.message||"",e),input(t,e){throw new Error("input role is not implemented yet")},option:(t,e)=>r.default(t,e),radio(t,e){throw new Error("radio role is not implemented yet")},separator:(t,e)=>(e.disabled="",e.indicator=[e.indicator," "].find((t=>null!=t)),e.message=e.message||t.symbols.line.repeat(5),e),spacer:(t,e)=>e};t.exports=(t,e={})=>{let i=s.merge({},r,e.roles);return i[t]||i.default}},873:(t,e,i)=>{"use strict";const{define:s,width:r}=i(546);t.exports=class{constructor(t){let e=t.options;s(this,"_prompt",t),this.type=t.type,this.name=t.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=r(e.stdout||process.stdout),Object.assign(this,e),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=t.symbols,this.styles=t.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let t={...this};return t.status=this.status,t.buffer=Buffer.from(t.buffer),delete t.clone,t}set color(t){this._color=t}get color(){let t=this.prompt.styles;if(this.cancelled)return t.cancelled;if(this.submitted)return t.submitted;let e=this._color||t[this.status];return"function"==typeof e?e:t.pending}set loading(t){this._loading=t}get loading(){return"boolean"==typeof this._loading?this._loading:!!this.loadingChoices&&"choices"}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}}},217:(t,e,i)=>{"use strict";const s=i(546),r=i(730),n={default:r.noop,noop:r.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||s.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||s.complement(this.primary)},primary:r.cyan,success:r.green,danger:r.magenta,strong:r.bold,warning:r.yellow,muted:r.dim,disabled:r.gray,dark:r.dim.gray,underline:r.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},set placeholder(t){this._placeholder=t},get placeholder(){return this._placeholder||this.primary.dim},set highlight(t){this._highlight=t},get highlight(){return this._highlight||this.inverse},merge:(t={})=>{t.styles&&"boolean"==typeof t.styles.enabled&&(r.enabled=t.styles.enabled),t.styles&&"boolean"==typeof t.styles.visible&&(r.visible=t.styles.visible);let e=s.merge({},n,t.styles);delete e.merge;for(let t of Object.keys(r))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>r[t]});for(let t of Object.keys(r.styles))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>r[t]});return e}};t.exports=n},739:(t,e,i)=>{"use strict";const s="win32"===process.platform,r=i(730),n=i(546),a={...r.symbols,upDownDoubleArrow:"⇕",upDownDoubleArrow2:"⬍",upDownArrow:"↕",asterisk:"*",asterism:"⁂",bulletWhite:"◦",electricArrow:"⌁",ellipsisLarge:"⋯",ellipsisSmall:"…",fullBlock:"█",identicalTo:"≡",indicator:r.symbols.check,leftAngle:"‹",mark:"※",minus:"−",multiplication:"×",obelus:"÷",percent:"%",pilcrow:"¶",pilcrow2:"❡",pencilUpRight:"✐",pencilDownRight:"✎",pencilRight:"✏",plus:"+",plusMinus:"±",pointRight:"☞",rightAngle:"›",section:"§",hexagon:{off:"⬡",on:"⬢",disabled:"⬢"},ballot:{on:"☑",off:"☐",disabled:"☒"},stars:{on:"★",off:"☆",disabled:"☆"},folder:{on:"▼",off:"▶",disabled:"▶"},prefix:{pending:r.symbols.question,submitted:r.symbols.check,cancelled:r.symbols.cross},separator:{pending:r.symbols.pointerSmall,submitted:r.symbols.middot,cancelled:r.symbols.middot},radio:{off:s?"( )":"◯",on:s?"(*)":"◉",disabled:s?"(|)":"Ⓘ"},numbers:["⓪","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","㉑","㉒","㉓","㉔","㉕","㉖","㉗","㉘","㉙","㉚","㉛","㉜","㉝","㉞","㉟","㊱","㊲","㊳","㊴","㊵","㊶","㊷","㊸","㊹","㊺","㊻","㊼","㊽","㊾","㊿"]};a.merge=t=>{let e=n.merge({},r.symbols,a,t.symbols);return delete e.merge,e},t.exports=a},227:(t,e,i)=>{"use strict";const s=i(217),r=i(739),n=i(546);t.exports=t=>{t.options=n.merge({},t.options.theme,t.options),t.symbols=r.merge(t.options),t.styles=s.merge(t.options)}},940:t=>{"use strict";function e(t,e,i={}){let s=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},r=i.interval||120;s.frames=i.frames||[],s.loading=!0;let n=setInterval((()=>{s.ms=Date.now()-s.start,s.tick++,t.render()}),r);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,"interval",{value:n}),t.once("close",(()=>s.stop())),s.stop}t.exports=t=>{t.timers=t.timers||{};let i=t.options.timers;if(i)for(let s of Object.keys(i)){let r=i[s];"number"==typeof r&&(r={interval:r}),e(t,s,r)}}},575:(t,e,i)=>{"use strict";const s=i(3),r=i(232),n=i(502),a=i(546),{reorder:o,scrollUp:l,scrollDown:h,isObject:u,swap:c}=a;function d(t,e){if(e instanceof Promise)return e;if("function"==typeof e){if(a.isAsyncFn(e))return e;e=e.call(t,t)}for(let i of e){if(Array.isArray(i.choices)){let e=i.choices.filter((e=>!t.isDisabled(e)));i.enabled=e.every((t=>!0===t.enabled))}!0===t.isDisabled(i)&&delete i.enabled}return e}t.exports=class extends r{constructor(t){super(t),this.cursorHide(),this.maxSelected=t.maxSelected||1/0,this.multiple=t.multiple||!1,this.initial=t.initial||0,this.delay=t.delay||0,this.longest=0,this.num=""}async initialize(){"function"==typeof this.options.initial&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:t,initial:e,autofocus:i,suggest:s}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(t)),this.choices.forEach((t=>t.enabled=!1)),"function"!=typeof s&&0===this.selectable.length)throw new Error("At least one choice must be selectable");u(e)&&(e=Object.keys(e)),Array.isArray(e)?(null!=i&&(this.index=this.findIndex(i)),e.forEach((t=>this.enable(this.find(t)))),await this.render()):(null!=i&&(e=i),"string"==typeof e&&(e=this.findIndex(e)),"number"==typeof e&&e>-1&&(this.index=Math.max(0,Math.min(e,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(t,e){this.state.loadingChoices=!0;let i=[],s=0,r=async(t,e)=>{"function"==typeof t&&(t=await t.call(this)),t instanceof Promise&&(t=await t);for(let n=0;n(this.state.loadingChoices=!1,t)))}async toChoice(t,e,i){if("function"==typeof t&&(t=await t.call(this,this)),t instanceof Promise&&(t=await t),"string"==typeof t&&(t={name:t}),t.normalized)return t;t.normalized=!0;let r=t.value,o=n(t.role,this.options);if("string"!=typeof(t=o(this,t)).disabled||t.hint||(t.hint=t.disabled,t.disabled=!0),!0===t.disabled&&null==t.hint&&(t.hint="(disabled)"),null!=t.index)return t;t.name=t.name||t.key||t.title||t.value||t.message,t.message=t.message||t.name||"",t.value=[t.value,t.name].find(this.isValue.bind(this)),t.input="",t.index=e,t.cursor=0,a.define(t,"parent",i),t.level=i?i.level+1:1,null==t.indent&&(t.indent=i?i.indent+" ":t.indent||""),t.path=i?i.path+"."+t.name:t.name,t.enabled=!(!this.multiple||this.isDisabled(t)||!t.enabled&&!this.isSelected(t)),this.isDisabled(t)||(this.longest=Math.max(this.longest,s(t.message).length));let l={...t};return t.reset=(e=l.input,i=l.value)=>{for(let e of Object.keys(l))t[e]=l[e];t.input=e,t.value=i},null==r&&"function"==typeof t.initial&&(t.input=await t.initial.call(this,this.state,t,e)),t}async onChoice(t,e){this.emit("choice",t,e,this),"function"==typeof t.onChoice&&await t.onChoice.call(this,this.state,t,e)}async addChoice(t,e,i){let s=await this.toChoice(t,e,i);return this.choices.push(s),this.index=this.choices.length-1,this.limit=this.choices.length,s}async newItem(t,e,i){let s={name:"New choice name?",editable:!0,newChoice:!0,...t},r=await this.addChoice(s,e,i);return r.updateChoice=()=>{delete r.newChoice,r.name=r.message=r.input,r.input="",r.cursor=0},this.render()}indent(t){return null==t.indent?t.level>1?" ".repeat(t.level-1):"":t.indent}dispatch(t,e){if(this.multiple&&this[e.name])return this[e.name]();this.alert()}focus(t,e){return"boolean"!=typeof e&&(e=t.enabled),e&&!t.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=t.index,t.enabled=e&&!this.isDisabled(t),t)}space(){return this.multiple?this.focused?(this.toggle(this.focused),this.render()):void 0:this.alert()}a(){if(this.maxSelectedt.enabled));return this.choices.forEach((e=>e.enabled=!t)),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach((t=>t.enabled=!t.enabled)),this.render())}g(){if(!this.choices.some((t=>!!t.parent)))return this.a();const t=this.focused;return this.toggle(t.parent&&!t.choices?t.parent:t),this.render()}toggle(t,e){if(!t.enabled&&this.selected.length>=this.maxSelected)return this.alert();"boolean"!=typeof e&&(e=!t.enabled),t.enabled=e,t.choices&&t.choices.forEach((t=>this.toggle(t,e)));let i=t.parent;for(;i;){let t=i.choices.filter((t=>this.isDisabled(t)));i.enabled=t.every((t=>!0===t.enabled)),i=i.parent}return d(this,this.choices),this.emit("toggle",t,this),t}enable(t){return this.selected.length>=this.maxSelected?this.alert():(t.enabled=!this.isDisabled(t),t.choices&&t.choices.forEach(this.enable.bind(this)),t)}disable(t){return t.enabled=!1,t.choices&&t.choices.forEach(this.disable.bind(this)),t}number(t){this.num+=t;let e=t=>{let e=Number(t);if(e>this.choices.length-1)return this.alert();let i=this.focused,s=this.choices.find((t=>e===t.index));if(!s.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(-1===this.visible.indexOf(s)){let t=o(this.choices),e=t.indexOf(s);if(i.index>e){let i=t.slice(e,e+this.limit),s=t.filter((t=>!i.includes(t)));this.choices=i.concat(s)}else{let i=e-this.limit+1;this.choices=t.slice(i).concat(t.slice(0,i))}}return this.index=this.choices.indexOf(s),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise((t=>{let i=this.choices.length,s=this.num,r=(i=!1,r)=>{clearTimeout(this.numberTimeout),i&&(r=e(s)),this.num="",t(r)};return"0"===s||1===s.length&&Number(s+"0")>i?r(!0):Number(s)>i?r(!1,this.alert()):void(this.numberTimeout=setTimeout((()=>r(!0)),this.delay))}))}home(){return this.choices=o(this.choices),this.index=0,this.render()}end(){let t=this.choices.length-this.limit,e=o(this.choices);return this.choices=e.slice(t).concat(e.slice(0,t)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let t=this.choices.length,e=this.visible.length,i=this.index;return!1===this.options.scroll&&0===i?this.alert():t>e&&0===i?this.scrollUp():(this.index=(i-1%t+t)%t,this.isDisabled()&&!this.allChoicesAreDisabled()?this.up():this.render())}down(){let t=this.choices.length,e=this.visible.length,i=this.index;return!1===this.options.scroll&&i===e-1?this.alert():t>e&&i===e-1?this.scrollDown():(this.index=(i+1)%t,this.isDisabled()&&!this.allChoicesAreDisabled()?this.down():this.render())}scrollUp(t=0){return this.choices=l(this.choices),this.index=t,this.isDisabled()?this.up():this.render()}scrollDown(t=this.visible.length-1){return this.choices=h(this.choices),this.index=t,this.isDisabled()?this.down():this.render()}async shiftUp(){return!0===this.options.sort?(this.sorting=!0,this.swap(this.index-1),await this.up(),void(this.sorting=!1)):this.scrollUp(this.index)}async shiftDown(){return!0===this.options.sort?(this.sorting=!0,this.swap(this.index+1),await this.down(),void(this.sorting=!1)):this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(t){c(this.choices,this.index,t)}allChoicesAreDisabled(t=this.choices){return t.every((t=>this.isDisabled(t)))}isDisabled(t=this.focused){return!(!t||!["disabled","collapsed","hidden","completing","readonly"].some((e=>!0===t[e])))||t&&"heading"===t.role}isEnabled(t=this.focused){if(Array.isArray(t))return t.every((t=>this.isEnabled(t)));if(t.choices){let e=t.choices.filter((t=>!this.isDisabled(t)));return t.enabled&&e.every((t=>this.isEnabled(t)))}return t.enabled&&!this.isDisabled(t)}isChoice(t,e){return t.name===e||t.index===Number(e)}isSelected(t){return Array.isArray(this.initial)?this.initial.some((e=>this.isChoice(t,e))):this.isChoice(t,this.initial)}map(t=[],e="value"){return[].concat(t||[]).reduce(((t,i)=>(t[i]=this.find(i,e),t)),{})}filter(t,e){let i="function"==typeof t?t:(e,i)=>[e.name,i].includes(t),s=(this.options.multiple?this.state._choices:this.choices).filter(i);return e?s.map((t=>t[e])):s}find(t,e){if(u(t))return e?t[e]:t;let i="function"==typeof t?t:(e,i)=>[e.name,i].includes(t),s=this.choices.find(i);return s?e?s[e]:s:void 0}findIndex(t){return this.choices.indexOf(this.find(t))}async submit(){let t=this.focused;if(!t)return this.alert();if(t.newChoice)return t.input?(t.updateChoice(),this.render()):this.alert();if(this.choices.some((t=>t.newChoice)))return this.alert();let{reorder:e,sort:i}=this.options,s=!0===this.multiple,r=this.selected;return void 0===r?this.alert():(Array.isArray(r)&&!1!==e&&!0!==i&&(r=a.reorder(r)),this.value=s?r.map((t=>t.name)):r.name,super.submit())}set choices(t=[]){this.state._choices=this.state._choices||[],this.state.choices=t;for(let e of t)this.state._choices.some((t=>t.name===e.name))||this.state._choices.push(e);if(!this._initial&&this.options.initial){this._initial=!0;let t=this.initial;if("string"==typeof t||"number"==typeof t){let e=this.find(t);e&&(this.initial=e.index,this.focus(e,!0))}}}get choices(){return d(this,this.state.choices||[])}set visible(t){this.state.visible=t}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(t){this.state.limit=t}get limit(){let{state:t,options:e,choices:i}=this,s=t.limit||this._limit||e.limit||i.length;return Math.min(s,this.height)}set value(t){super.value=t}get value(){return"string"!=typeof super.value&&super.value===this.initial?this.input:super.value}set index(t){this.state.index=t}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let t=this.choices[this.index];return t&&this.state.submitted&&!0!==this.multiple&&(t.enabled=!0),t}get selectable(){return this.choices.filter((t=>!this.isDisabled(t)))}get selected(){return this.multiple?this.enabled:this.focused}}},926:(t,e,i)=>{"use strict";const s=i(826),r=()=>{throw new Error("expected prompt to have a custom authenticate method")},n=(t=r)=>class extends s{constructor(t){super(t)}async submit(){this.value=await t.call(this,this.values,this.state),super.base.submit.call(this)}static create(t){return n(t)}};t.exports=n()},838:(t,e,i)=>{"use strict";const s=i(232),{isPrimitive:r,hasColor:n}=i(546);t.exports=class extends s{constructor(t){super(t),this.cursorHide()}async initialize(){let t=await this.resolve(this.initial,this.state);this.input=await this.cast(t),await super.initialize()}dispatch(t){return this.isValue(t)?(this.input=t,this.submit()):this.alert()}format(t){let{styles:e,state:i}=this;return i.submitted?e.success(t):e.primary(t)}cast(t){return this.isTrue(t)}isTrue(t){return/^[ty1]/i.test(t)}isFalse(t){return/^[fn0]/i.test(t)}isValue(t){return r(t)&&(this.isTrue(t)||this.isFalse(t))}async hint(){if("pending"===this.state.status){let t=await this.element("hint");return n(t)?t:this.styles.muted(t)}}async render(){let{input:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=[i,await this.message(),this.styles.muted(this.default),s].filter(Boolean).join(" ");this.state.prompt=r;let n=await this.header(),a=this.value=this.cast(t),o=await this.format(a),l=await this.error()||await this.hint(),h=await this.footer();l&&!r.includes(l)&&(o+=" "+l),r+=" "+o,this.clear(e),this.write([n,r,h].filter(Boolean).join("\n")),this.restore()}set value(t){super.value=t}get value(){return this.cast(super.value)}}},920:(t,e,i)=>{t.exports={ArrayPrompt:i(575),AuthPrompt:i(926),BooleanPrompt:i(838),NumberPrompt:i(376),StringPrompt:i(391)}},376:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t={}){super({style:"number",...t}),this.min=this.isValue(t.min)?this.toNumber(t.min):-1/0,this.max=this.isValue(t.max)?this.toNumber(t.max):1/0,this.delay=null!=t.delay?t.delay:1e3,this.float=!1!==t.float,this.round=!0===t.round||!1===t.float,this.major=t.major||10,this.minor=t.minor||1,this.initial=null!=t.initial?t.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(t){return!/[-+.]/.test(t)||"."===t&&this.input.includes(".")?this.alert("invalid number"):super.append(t)}number(t){return super.append(t)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(t){let e=t||this.minor,i=this.toNumber(this.input);return i>this.max+e?this.alert():(this.input=`${i+e}`,this.render())}down(t){let e=t||this.minor,i=this.toNumber(this.input);return ithis.isValue(t)));return this.value=this.toNumber(t||0),super.submit()}}},391:(t,e,i)=>{"use strict";const s=i(232),r=i(914),n=i(786),{isPrimitive:a}=i(546);t.exports=class extends s{constructor(t){super(t),this.initial=a(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[],this.keypressTimeout=void 0!==this.options.keypressTimeout?this.options.keypressTimeout:null}async keypress(t,e=(t?r(t,{}):{})){const i=Date.now(),s=i-this.lastKeypress;this.lastKeypress=i;const n="return"===e.name||"enter"===e.name;let a,o=this.state.prevKeypress;if(this.state.prevKeypress=e,null!=this.keypressTimeout&&n){if(s=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(t){return!!t}async format(t=this.value){let e=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(t||e):n(this,{input:t,initial:e,pos:this.cursor})}async render(){let t=this.state.size,e=await this.prefix(),i=await this.separator(),s=[e,await this.message(),i].filter(Boolean).join(" ");this.state.prompt=s;let r=await this.header(),n=await this.format(),a=await this.error()||await this.hint(),o=await this.footer();a&&!n.includes(a)&&(n+=" "+a),s+=" "+n,this.clear(t),this.write([r,s,o].filter(Boolean).join("\n")),this.restore()}}},546:(t,e,i)=>{"use strict";const s=Object.prototype.toString,r=i(730);let n=!1,a=new Set;const o={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};e.longest=(t,e)=>t.reduce(((t,i)=>Math.max(t,e?i[e].length:i.length)),0),e.hasColor=t=>!!t&&r.hasColor(t);const l=e.isObject=t=>null!==t&&"object"==typeof t&&!Array.isArray(t);e.nativeType=t=>s.call(t).slice(8,-1).toLowerCase().replace(/\s/g,""),e.isAsyncFn=t=>"asyncfunction"===e.nativeType(t),e.isPrimitive=t=>null!=t&&"object"!=typeof t&&"function"!=typeof t,e.resolve=(t,e,...i)=>"function"==typeof e?e.call(t,...i):e,e.scrollDown=(t=[])=>[...t.slice(1),t[0]],e.scrollUp=(t=[])=>[t.pop(),...t],e.reorder=(t=[])=>{let e=t.slice();return e.sort(((t,e)=>t.index>e.index?1:t.index{let s=t.length,r=i===s?0:i<0?s-1:i,n=t[e];t[e]=t[r],t[r]=n},e.width=(t,e=80)=>{let i=t&&t.columns?t.columns:e;return t&&"function"==typeof t.getWindowSize&&(i=t.getWindowSize()[0]),"win32"===process.platform?i-1:i},e.height=(t,e=20)=>{let i=t&&t.rows?t.rows:e;return t&&"function"==typeof t.getWindowSize&&(i=t.getWindowSize()[1]),i},e.wordWrap=(t,e={})=>{if(!t)return t;"number"==typeof e&&(e={width:e});let{indent:i="",newline:s="\n"+i,width:r=80}=e,n=(s+i).match(/[^\S\n]/g)||[];r-=n.length;let a=`.{1,${r}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,o=t.trim(),l=new RegExp(a,"g"),h=o.match(l)||[];return h=h.map((t=>t.replace(/\n$/,""))),e.padEnd&&(h=h.map((t=>t.padEnd(r," ")))),e.padStart&&(h=h.map((t=>t.padStart(r," ")))),i+h.join(s)},e.unmute=t=>{let e=t.stack.find((t=>r.keys.color.includes(t)));return e?r[e]:t.stack.find((t=>"bg"===t.slice(2)))?r[e.slice(2)]:t=>t},e.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"",e.inverse=t=>{if(!t||!t.stack)return t;let i=t.stack.find((t=>r.keys.color.includes(t)));if(i){let s=r["bg"+e.pascal(i)];return s?s.black:t}let s=t.stack.find((t=>"bg"===t.slice(0,2)));return s?r[s.slice(2).toLowerCase()]||t:r.none},e.complement=t=>{if(!t||!t.stack)return t;let i=t.stack.find((t=>r.keys.color.includes(t))),s=t.stack.find((t=>"bg"===t.slice(0,2)));if(i&&!s)return r[o[i]||i];if(s){let i=s.slice(2).toLowerCase(),n=o[i];return n&&r["bg"+e.pascal(n)]||t}return r.none},e.meridiem=t=>{let e=t.getHours(),i=t.getMinutes(),s=e>=12?"pm":"am";return e%=12,(0===e?12:e)+":"+(i<10?"0"+i:i)+" "+s},e.set=(t={},i="",s)=>i.split(".").reduce(((t,i,r,n)=>{let a=n.length-1>r?t[i]||{}:s;return!e.isObject(a)&&r{let s=null==t[e]?e.split(".").reduce(((t,e)=>t&&t[e]),t):t[e];return null==s?i:s},e.mixin=(t,i)=>{if(!l(t))return i;if(!l(i))return t;for(let s of Object.keys(i)){let r=Object.getOwnPropertyDescriptor(i,s);if(hasOwnProperty.call(r,"value"))if(hasOwnProperty.call(t,s)&&l(r.value)){let n=Object.getOwnPropertyDescriptor(t,s);l(n.value)&&n.value!==r.value?t[s]=e.merge({},t[s],i[s]):Reflect.defineProperty(t,s,r)}else Reflect.defineProperty(t,s,r);else Reflect.defineProperty(t,s,r)}return t},e.merge=(...t)=>{let i={};for(let s of t)e.mixin(i,s);return i},e.mixinEmitter=(t,i)=>{let s=i.constructor.prototype;for(let r of Object.keys(s)){let n=s[r];"function"==typeof n?e.define(t,r,n.bind(i)):e.define(t,r,n)}};const h=(t,e)=>{n||(n=!0,a.forEach((t=>t())),!0===t&&process.exit(128+e))},u=h.bind(null,!0,15),c=h.bind(null,!0,2);e.onExit=t=>(0===a.size&&(process.once("SIGTERM",u),process.once("SIGINT",c),process.once("exit",h)),a.add(t),()=>{a.delete(t),0===a.size&&(process.off("SIGTERM",u),process.off("SIGINT",c),process.off("exit",h))}),e.define=(t,e,i)=>{Reflect.defineProperty(t,e,{value:i})},e.defineExport=(t,e,i)=>{let s;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(t){s=t},get:()=>s?s():i()})}},3:(t,e,i)=>{"use strict";const s=i(277);t.exports=t=>"string"==typeof t?t.replace(s(),""):t},491:t=>{"use strict";t.exports=require("assert")},361:t=>{"use strict";t.exports=require("events")},521:t=>{"use strict";t.exports=require("readline")}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=i(31);const e=require("path");var s=i.n(e);const r=require("node:fs");var n=i.n(r);const a=require("node:crypto");var o=i.n(a),l=function(t,e,i,s){return new(i||(i=Promise))((function(r,n){function a(t){try{l(s.next(t))}catch(t){n(t)}}function o(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};const{MultiSelect:h}=i(31),u=s().join(__dirname,"..","..","assets","data","cards_pt-br.json"),c={type:"input",required:!0},d={title:t=>!(t.trim().trim().length<2)||"O título precisa ter pelo menos 3 caracteres.",description:t=>!(t.trim().length<10)||"A descrição precisa ter pelo menos 10 caracteres.",tags:t=>!(t.length<1)||"Você precisa selecionar pelo menos uma tag."},p=("—",t=>"—".repeat(t))(50);l(void 0,void 0,void 0,(function*(){try{e=yield l(void 0,void 0,void 0,(function*(){const e=yield t.prompt([Object.assign(Object.assign({},c),{name:"title",message:"Qual título o seu conceito tem ?",validate:d.title}),Object.assign(Object.assign({},c),{name:"description",message:"Qual descrição o seu conceito tem ?",validate:d.description}),{type:"input",name:"code",message:"Seu conceito tem algum código ? (opcional)"}]),i=new h({name:"tags",message:"Selecione as tags relacionadas ao seu conceito",choices:["Back-end","Biblioteca","Conceito","Design","Ferramenta","Framework","Front-end","Mobile","Paradigma","Versionamento"],validate:d.tags}),s=yield i.run();return{id:o().randomBytes(16).toString("hex"),title:e.title,description:e.description,code:e.code,tags:s}})),((t,e)=>{n().writeFileSync(t,JSON.stringify({cards:e},null,2))})(i=u,((t,e)=>[...t,e])((r=i,s=n().readFileSync(r,"utf8"),Object.values(JSON.parse(s)).flat()),e)),console.log(`\n${p}`),console.log("✔️ Novo termo adicionado com sucesso!"),console.log(p)}catch(t){console.log(`\n${p}`),console.error("❌ Ocorreu um erro ao adicionar o novo termo."),console.error("❌ Tente novamente seguindo as instruções."),console.error("❌ Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues."),console.log(p),t instanceof Error&&console.error(`❌ ${t.message}\n`)}var e,i,s,r}))})()})(); \ No newline at end of file +(()=>{var t={730:(t,e,i)=>{"use strict";const s=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,r=()=>{const t={enabled:"undefined"!=typeof process&&"0"!==process.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},e=(t,e,i)=>"function"==typeof t?t(e):t.wrap(e,i),r=(i,s)=>{if(""===i||null==i)return"";if(!1===t.enabled)return i;if(!1===t.visible)return"";let r=""+i,n=r.includes("\n"),a=s.length;for(a>0&&s.includes("unstyle")&&(s=[...new Set(["unstyle",...s])].reverse());a-- >0;)r=e(t.styles[s[a]],r,n);return r},n=(e,i,s)=>{t.styles[e]=(t=>{let e=t.open=`[${t.codes[0]}m`,i=t.close=`[${t.codes[1]}m`,s=t.regex=new RegExp(`\\u001b\\[${t.codes[1]}m`,"g");return t.wrap=(t,r)=>{t.includes(i)&&(t=t.replace(s,i+e));let n=e+t+i;return r?n.replace(/\r*\n/g,`${i}$&${e}`):n},t})({name:e,codes:i}),(t.keys[s]||(t.keys[s]=[])).push(e),Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,set(i){t.alias(e,i)},get(){let i=t=>r(t,i.stack);return Reflect.setPrototypeOf(i,t),i.stack=this.stack?this.stack.concat(e):[e],i}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=s,t.hasColor=t.hasAnsi=e=>(t.ansiRegex.lastIndex=0,"string"==typeof e&&""!==e&&t.ansiRegex.test(e)),t.alias=(e,i)=>{let s="string"==typeof i?t[i]:i;if("function"!=typeof s)throw new TypeError("Expected alias to be the name of an existing color (string) or a function");s.stack||(Reflect.defineProperty(s,"name",{value:e}),t.styles[e]=s,s.stack=[e]),Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,set(i){t.alias(e,i)},get(){let e=t=>r(t,e.stack);return Reflect.setPrototypeOf(e,t),e.stack=this.stack?this.stack.concat(s.stack):s.stack,e}})},t.theme=e=>{if(null===(i=e)||"object"!=typeof i||Array.isArray(i))throw new TypeError("Expected theme to be an object");var i;for(let i of Object.keys(e))t.alias(i,e[i]);return t},t.alias("unstyle",(e=>"string"==typeof e&&""!==e?(t.ansiRegex.lastIndex=0,e.replace(t.ansiRegex,"")):"")),t.alias("noop",(t=>t)),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=i(142),t.define=n,t};t.exports=r(),t.exports.create=r},142:t=>{"use strict";const e="undefined"!=typeof process&&"Hyper"===process.env.TERM_PROGRAM,i="undefined"!=typeof process&&"win32"===process.platform,s="undefined"!=typeof process&&"linux"===process.platform,r={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},n=Object.assign({},r,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),a=Object.assign({},r,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:s?"▸":"❯",pointerSmall:s?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});t.exports=i&&!e?n:a,Reflect.defineProperty(t.exports,"common",{enumerable:!1,value:r}),Reflect.defineProperty(t.exports,"windows",{enumerable:!1,value:n}),Reflect.defineProperty(t.exports,"other",{enumerable:!1,value:a})},277:t=>{"use strict";t.exports=({onlyFirst:t=!1}={})=>{const e=["[\\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(e,t?void 0:"g")}},31:(t,e,i)=>{"use strict";const s=i(491),r=i(361),n=i(546);class a extends r{constructor(t,e){super(),this.options=n.merge({},t),this.answers={...e}}register(t,e){if(n.isObject(t)){for(let e of Object.keys(t))this.register(e,t[e]);return this}s.equal(typeof e,"function","expected a function");const i=t.toLowerCase();return e.prototype instanceof this.Prompt?this.prompts[i]=e:this.prompts[i]=e(this.Prompt,this),this}async prompt(t=[]){for(let e of[].concat(t))try{"function"==typeof e&&(e=await e.call(this)),await this.ask(n.merge({},this.options,e))}catch(t){return Promise.reject(t)}return this.answers}async ask(t){"function"==typeof t&&(t=await t.call(this));let e=n.merge({},this.options,t),{type:i,name:r}=t,{set:a,get:o}=n;if("function"==typeof i&&(i=await i.call(this,t,this.answers)),!i)return this.answers[r];"number"===i&&(i="numeral"),s(this.prompts[i],`Prompt "${i}" is not registered`);let l=new this.prompts[i](e),h=o(this.answers,r);l.state.answers=this.answers,l.enquirer=this,r&&l.on("submit",(t=>{this.emit("answer",r,t,l),a(this.answers,r,t)}));let c=l.emit.bind(l);return l.emit=(...t)=>(this.emit.call(this,...t),c(...t)),this.emit("prompt",l,this),e.autofill&&null!=h?(l.value=l.input=h,"show"===e.autofill&&await l.submit()):h=l.value=await l.run(),h}use(t){return t.call(this,this),this}set Prompt(t){this._Prompt=t}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(t){this._Prompt=t}static get Prompt(){return this._Prompt||i(232)}static get prompts(){return i(594)}static get types(){return i(920)}static get prompt(){const t=(e,...i)=>{let s=new this(...i),r=s.emit.bind(s);return s.emit=(...e)=>(t.emit(...e),r(...e)),s.prompt(e)};return n.mixinEmitter(t,new r),t}}n.mixinEmitter(a,new r);const o=a.prompts;for(let t of Object.keys(o)){let e=t.toLowerCase(),i=e=>new o[t](e).run();a.prompt[e]=i,a[e]=i,a[t]||Reflect.defineProperty(a,t,{get:()=>o[t]})}const l=t=>{n.defineExport(a,t,(()=>a.types[t]))};l("ArrayPrompt"),l("AuthPrompt"),l("BooleanPrompt"),l("NumberPrompt"),l("StringPrompt"),t.exports=a},907:(t,e,i)=>{"use strict";const s="Apple_Terminal"===process.env.TERM_PROGRAM,r=i(3),n=i(546),a=t.exports=e,o="[";let l=!1;const h=a.code={bell:"",beep:"",beginning:`${o}G`,down:`${o}J`,esc:o,getPosition:`${o}6n`,hide:`${o}?25l`,line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,restorePosition:o+(s?"8":"u"),savePosition:o+(s?"7":"s"),screen:`${o}2J`,show:`${o}?25h`,up:`${o}1J`},c=a.cursor={get hidden(){return l},hide:()=>(l=!0,h.hide),show:()=>(l=!1,h.show),forward:(t=1)=>`${o}${t}C`,backward:(t=1)=>`${o}${t}D`,nextLine:(t=1)=>`${o}E`.repeat(t),prevLine:(t=1)=>`${o}F`.repeat(t),up:(t=1)=>t?`${o}${t}A`:"",down:(t=1)=>t?`${o}${t}B`:"",right:(t=1)=>t?`${o}${t}C`:"",left:(t=1)=>t?`${o}${t}D`:"",to:(t,e)=>e?`${o}${e+1};${t+1}H`:`${o}${t+1}G`,move(t=0,e=0){let i="";return i+=t<0?c.left(-t):t>0?c.right(t):"",i+=e<0?c.up(-e):e>0?c.down(e):"",i},strLen(t){for(var e=0,i=t.length,s=-1,r=0;r=0&&s<=128?1:2;return e},restore(t={}){let{after:e,cursor:i,initial:s,input:r,prompt:o,size:l,value:h}=t;if(s=n.isPrimitive(s)?String(s):"",r=n.isPrimitive(r)?String(r):"",h=n.isPrimitive(h)?String(h):"",l){let t=a.cursor.up(l)+a.cursor.to(this.strLen(o)),e=r.length-i;return e>0&&(t+=a.cursor.left(e)),t}if(h||e){let t=!r&&s?-this.strLen(s):-this.strLen(r)+i;return e&&(t-=this.strLen(e)),""===r&&s&&!o.includes(s)&&(t+=this.strLen(s)),a.cursor.move(t)}}},u=a.erase={screen:h.screen,up:h.up,down:h.down,line:h.line,lineEnd:h.lineEnd,lineStart:h.lineStart,lines(t){let e="";for(let i=0;i{if(!e)return u.line+c.to(0);let i=t.split(/\r?\n/),s=0;for(let t of i)s+=1+Math.floor(Math.max([...r(t)].length-1,0)/e);return(u.line+c.prevLine()).repeat(s-1)+u.line+c.to(0)}},726:(t,e)=>{"use strict";e.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"},e.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"},e.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"},e.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"},e.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}},736:t=>{"use strict";const e=t=>(t=>t.filter(((e,i)=>t.lastIndexOf(e)===i)))(t).filter(Boolean);t.exports=(t,i={},s="")=>{let r,n,{past:a=[],present:o=""}=i;switch(t){case"prev":case"undo":return r=a.slice(0,a.length-1),n=a[a.length-1]||"",{past:e([s,...r]),present:n};case"next":case"redo":return r=a.slice(1),n=a[0]||"",{past:e([...r,s]),present:n};case"save":return{past:e([...a,s]),present:""};case"remove":return n=e(a.filter((t=>t!==s))),o="",n.length&&(o=n.pop()),{past:n,present:o};default:throw new Error(`Invalid action: "${t}"`)}}},189:(t,e,i)=>{"use strict";const s=i(3);class r{constructor(t){this.name=t.key,this.field=t.field||{},this.value=((t="")=>"string"==typeof t?t.replace(/^['"]|['"]$/g,""):"")(t.initial||this.field.initial||""),this.message=t.message||this.name,this.cursor=0,this.input="",this.lines=[]}}function n(t,e,i,s){return(i,r,n,a)=>"function"==typeof n.field[t]?n.field[t].call(e,i,r,n,a):[s,i].find((t=>e.isValue(t)))}t.exports=async t=>{let e=t.options,i=new Set(!0===e.required?[]:e.required||[]),a={...e.values,...e.initial},{tabstops:o,items:l,keys:h}=await(async(t={},e={},i=(t=>t))=>{let s=new Set,n=t.fields||[],a=t.template,o=[],l=[],h=[],c=1;"function"==typeof a&&(a=await a());let u=-1,d=()=>a[++u],p=()=>a[u+1],m=t=>{t.line=c,o.push(t)};for(m({type:"bos",value:""});ut.name===o.key));o.field=n.find((t=>t.name===o.key)),c||(c=new r(o),l.push(c)),c.lines.push(o.line-1);continue}let a=o[o.length-1];"text"===a.type&&a.line===c?a.value+=t:m({type:"text",value:t})}return m({type:"eos",value:""}),{input:a,tabstops:o,unique:s,keys:h,items:l}})(e,a),c=n("result",t),u=n("format",t),d=n("validate",t,0,!0),p=t.isValue.bind(t);return async(r={},n=!1)=>{let a=0;r.required=i,r.items=l,r.keys=h,r.output="";let m=async(t,e,i,s)=>{let r=await d(t,e,i,s);return!1===r?"Invalid field "+i.name:r};for(let i of o){let o=i.value,h=i.key;if("template"===i.type){if("template"===i.type){let d=l.find((t=>t.name===h));!0===e.required&&r.required.add(d.name);let f=[d.input,r.values[d.value],d.value,o].find(p),g=(d.field||{}).message||i.inner;if(n){let t=await m(r.values[h],r,d,a);if(t&&"string"==typeof t||!1===t){r.invalid.set(h,t);continue}r.invalid.delete(h);let e=await c(r.values[h],r,d,a);r.output+=s(e);continue}d.placeholder=!1;let y=o;o=await u(o,r,d,a),f!==o?(r.values[h]=f,o=t.styles.typing(f),r.missing.delete(g)):(r.values[h]=void 0,f=`<${g}>`,o=t.styles.primary(f),d.placeholder=!0,r.required.has(h)&&r.missing.add(g)),r.missing.has(g)&&r.validating&&(o=t.styles.warning(f)),r.invalid.has(h)&&r.validating&&(o=t.styles.danger(f)),a===r.index&&(o=y!==o?t.styles.underline(o):t.styles.heading(s(o))),a++}o&&(r.output+=o)}else o&&(r.output+=o)}let f=r.output.split("\n").map((t=>" "+t)),g=l.length,y=0;for(let e of l)r.invalid.has(e.name)&&e.lines.forEach((t=>{" "===f[t][0]&&(f[t]=r.styles.danger(r.symbols.bullet)+f[t].slice(1))})),t.isValue(r.values[e.name])&&y++;return r.completed=(y/g*100).toFixed(0),r.output=f.join("\n"),r.output}}},914:(t,e,i)=>{"use strict";const s=i(521),r=i(726),n=i(607),a=/^(?:\x1b)([a-zA-Z0-9])$/,o=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,l={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"},h=(t="",e={})=>{let i,s={name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:t,raw:t,...e};if(Buffer.isBuffer(t)?t[0]>127&&void 0===t[1]?(t[0]-=128,t=""+String(t)):t=String(t):void 0!==t&&"string"!=typeof t?t=String(t):t||(t=s.sequence||""),s.sequence=s.sequence||t||s.name,"\r"===t)s.raw=void 0,s.name="return";else if("\n"===t)s.name="enter";else if("\t"===t)s.name="tab";else if("\b"===t||""===t||""===t||"\b"===t)s.name="backspace",s.meta=""===t.charAt(0);else if(""===t||""===t)s.name="escape",s.meta=2===t.length;else if(" "===t||" "===t)s.name="space",s.meta=2===t.length;else if(t<="")s.name=String.fromCharCode(t.charCodeAt(0)+"a".charCodeAt(0)-1),s.ctrl=!0;else if(1===t.length&&t>="0"&&t<="9")s.name="number";else if(1===t.length&&t>="a"&&t<="z")s.name=t;else if(1===t.length&&t>="A"&&t<="Z")s.name=t.toLowerCase(),s.shift=!0;else if(i=a.exec(t))s.meta=!0,s.shift=/^[A-Z]$/.test(i[1]);else if(i=o.exec(t)){let e=[...t];""===e[0]&&""===e[1]&&(s.option=!0);let r=[i[1],i[2],i[4],i[6]].filter(Boolean).join(""),n=(i[3]||i[5]||1)-1;s.ctrl=!!(4&n),s.meta=!!(10&n),s.shift=!!(1&n),s.code=r,s.name=l[r],s.shift=function(t){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(t)}(r)||s.shift,s.ctrl=function(t){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(t)}(r)||s.ctrl}return s};h.listen=(t={},e)=>{let{stdin:i}=t;if(!i||i!==process.stdin&&!i.isTTY)throw new Error("Invalid stream passed");let r=s.createInterface({terminal:!0,input:i});s.emitKeypressEvents(i,r);const a=new n(((t,i)=>e(t,h(t,i),r)));let o=i.isRaw;return i.isTTY&&i.setRawMode(!0),i.on("keypress",a.enqueue),r.resume(),()=>{i.isTTY&&i.setRawMode(o),i.removeListener("keypress",a.enqueue),a.destroy(),r.pause(),r.close()}},h.action=(t,e,i)=>{let s={...r,...i};return e.ctrl?(e.action=s.ctrl[e.name],e):e.option&&s.option?(e.action=s.option[e.name],e):e.shift?(e.action=s.shift[e.name],e):(e.action=s.keys[e.name],e)},t.exports=h},786:(t,e,i)=>{"use strict";const s=i(546);t.exports=(t,e={})=>{t.cursorHide();let{input:i="",initial:r="",pos:n,showCursor:a=!0,color:o}=e,l=o||t.styles.placeholder,h=s.inverse(t.styles.primary),c=e=>h(t.styles.black(e)),u=i,d=c(" ");if(t.blink&&!0===t.blink.off&&(c=t=>t,d=""),a&&0===n&&""===r&&""===i)return c(" ");if(a&&0===n&&(i===r||""===i))return c(r[0])+l(r.slice(1));r=s.isPrimitive(r)?`${r}`:"",i=s.isPrimitive(i)?`${i}`:"";let p=r&&r.startsWith(i)&&r!==i,m=p?c(r[i.length]):d;if(n!==i.length&&!0===a&&(u=i.slice(0,n)+c(i[n])+i.slice(n+1),m=""),!1===a&&(m=""),p){let e=t.styles.unstyle(u+m);return u+m+l(r.slice(e.length))}return u+m}},232:(t,e,i)=>{"use strict";const s=i(361),r=i(3),n=i(914),a=i(940),o=i(873),l=i(227),h=i(546),c=i(907);class u extends s{constructor(t={}){super(),this.name=t.name,this.type=t.type,this.options=t,l(this),a(this),this.state=new o(this),this.initial=[t.initial,t.default].find((t=>null!=t)),this.stdout=t.stdout||process.stdout,this.stdin=t.stdin||process.stdin,this.scale=t.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=function(t){"number"==typeof t&&(t=[t,t,t,t]);let e=[].concat(t||[]),i=t=>t%2==0?"\n":" ",s=[];for(let t=0;t<4;t++){let r=i(t);e[t]?s.push(r.repeat(e[t])):s.push("")}return s}(this.options.margin),this.setMaxListeners(0),function(t){let e=e=>void 0===t[e]||"function"==typeof t[e],i=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],s=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let r of Object.keys(t.options)){if(i.includes(r))continue;if(/^on[A-Z]/.test(r))continue;let n=t.options[r];"function"==typeof n&&e(r)?s.includes(r)||(t[r]=n.bind(t)):"function"!=typeof t[r]&&(t[r]=n)}}(this)}async keypress(t,e={}){this.keypressed=!0;let i=n.action(t,n(t,e),this.options.actions);this.state.keypress=i,this.emit("keypress",t,i),this.emit("state",this.state.clone());const s=this.options[i.action]||this[i.action]||this.dispatch;if("function"==typeof s)return await s.call(this,t,i);this.alert()}alert(){delete this.state.alert,!1===this.options.show?this.emit("alert"):this.stdout.write(c.code.beep)}cursorHide(){this.stdout.write(c.cursor.hide());const t=h.onExit((()=>this.cursorShow()));this.on("close",(()=>{this.cursorShow(),t()}))}cursorShow(){this.stdout.write(c.cursor.show())}write(t){t&&(this.stdout&&!1!==this.state.show&&this.stdout.write(t),this.state.buffer+=t)}clear(t=0){let e=this.state.buffer;this.state.buffer="",(e||t)&&!1!==this.options.show&&this.stdout.write(c.cursor.down(t)+c.clear(e,this.width))}restore(){if(this.state.closed||!1===this.options.show)return;let{prompt:t,after:e,rest:i}=this.sections(),{cursor:s,initial:r="",input:n="",value:a=""}=this,o={after:e,cursor:s,initial:r,input:n,prompt:t,size:this.state.size=i.length,value:a},l=c.cursor.restore(o);l&&this.stdout.write(l)}sections(){let{buffer:t,input:e,prompt:i}=this.state;i=r(i);let s=r(t),n=s.indexOf(i),a=s.slice(0,n),o=s.slice(n).split("\n"),l=o[0],h=o[o.length-1],c=(i+(e?" "+e:"")).length,u=ct.call(this,this.value),this.result=()=>i.call(this,this.value),"function"==typeof e.initial&&(this.initial=await e.initial.call(this,this)),"function"==typeof e.onRun&&await e.onRun.call(this,this),"function"==typeof e.onSubmit){let t=e.onSubmit.bind(this),i=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await t(this.name,this.value,this),i())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise((async(t,e)=>{if(this.once("submit",t),this.once("cancel",e),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")}))}async element(t,e,i){let{options:s,state:r,symbols:n,timers:a}=this,o=a&&a[t];r.timer=o;let l=s[t]||r[t]||n[t],h=e&&null!=e[t]?e[t]:await l;if(""===h)return h;let c=await this.resolve(h,r,e,i);return!c&&e&&e[t]?this.resolve(l,r,e,i):c}async prefix(){let t=await this.element("prefix")||this.symbols,e=this.timers&&this.timers.prefix,i=this.state;return i.timer=e,h.isObject(t)&&(t=t[i.status]||t.pending),h.hasColor(t)?t:(this.styles[i.status]||this.styles.pending)(t)}async message(){let t=await this.element("message");return h.hasColor(t)?t:this.styles.strong(t)}async separator(){let t=await this.element("separator")||this.symbols,e=this.timers&&this.timers.separator,i=this.state;i.timer=e;let s=t[i.status]||t.pending||i.separator,r=await this.resolve(s,i);return h.isObject(r)&&(r=r[i.status]||r.pending),h.hasColor(r)?r:this.styles.muted(r)}async pointer(t,e){let i=await this.element("pointer",t,e);if("string"==typeof i&&h.hasColor(i))return i;if(i){let t=this.styles,s=this.index===e,r=s?t.primary:t=>t,n=await this.resolve(i[s?"on":"off"]||i,this.state),a=h.hasColor(n)?n:r(n);return s?a:" ".repeat(n.length)}}async indicator(t,e){let i=await this.element("indicator",t,e);if("string"==typeof i&&h.hasColor(i))return i;if(i){let e=this.styles,s=!0===t.enabled,r=s?e.success:e.dark,n=i[s?"on":"off"]||i;return h.hasColor(n)?n:r(n)}return""}body(){return null}footer(){if("pending"===this.state.status)return this.element("footer")}header(){if("pending"===this.state.status)return this.element("header")}async hint(){if("pending"===this.state.status&&!this.isValue(this.state.input)){let t=await this.element("hint");return h.hasColor(t)?t:this.styles.muted(t)}}error(t){return this.state.submitted?"":t||this.state.error}format(t){return t}result(t){return t}validate(t){return!0!==this.options.required||this.isValue(t)}isValue(t){return null!=t&&""!==t}resolve(t,...e){return h.resolve(this,t,...e)}get base(){return u.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||h.height(this.stdout,25)}get width(){return this.options.columns||h.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(t){this.state.cursor=t}get cursor(){return this.state.cursor}set input(t){this.state.input=t}get input(){return this.state.input}set value(t){this.state.value=t}get value(){let{input:t,value:e}=this.state,i=[e,t].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return t=>new this(t).run()}}t.exports=u},317:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){super(t),this.cursorShow()}moveCursor(t){this.state.cursor+=t}dispatch(t){return this.append(t)}space(t){return this.options.multiple?super.space(t):this.append(t)}append(t){let{cursor:e,input:i}=this.state;return this.input=i.slice(0,e)+t+i.slice(e),this.moveCursor(1),this.complete()}delete(){let{cursor:t,input:e}=this.state;return e?(this.input=e.slice(0,t-1)+e.slice(t),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:t,input:e}=this.state;return void 0===e[t]?this.alert():(this.input=`${e}`.slice(0,t)+`${e}`.slice(t+1),this.complete())}number(t){return this.append(t)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(t=this.input,e=this.state._choices){if("function"==typeof this.options.suggest)return this.options.suggest.call(this,t,e);let i=t.toLowerCase();return e.filter((t=>t.message.toLowerCase().includes(i)))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map((t=>this.styles.primary(t.message))).join(", ");if(this.state.submitted){let t=this.value=this.input=this.focused.value;return this.styles.primary(t)}return this.input}async render(){if("pending"!==this.state.status)return super.render();const t=this.options.highlight||this.styles.complement,e=((t,e)=>{const i=t?new RegExp(t,"ig"):/$^/;return s=>t?s.replace(i,(t=>e(t))):s})(this.input,((e,i)=>e?t.stack?t(e):t.call(this,e):e)),i=this.choices;this.choices=i.map((t=>({...t,message:e(t.message)}))),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map((t=>t.name))),super.submit()}}},186:(t,e,i)=>{"use strict";const s=i(926);function r(t,e){return t.username===this.options.username&&t.password===this.options.password}const n=(t=r)=>{const e=[{name:"username",message:"username"},{name:"password",message:"password",format(t){return this.options.showPassword?t:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(t.length))}}];class i extends(s.create(t)){constructor(t){super({...t,choices:e})}static create(t){return n(t)}}return i};t.exports=n()},291:(t,e,i)=>{"use strict";const s=i(838);t.exports=class extends s{constructor(t){super(t),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}}},848:(t,e,i)=>{"use strict";const s=i(466),r=i(826).prototype;t.exports=class extends s{constructor(t){super({...t,multiple:!0}),this.align=[this.options.align,"left"].find((t=>null!=t)),this.emptyError="",this.values={}}dispatch(t,e){let i=this.focused,s=i.parent||{};return i.editable||s.editable||"a"!==t&&"i"!==t?r.dispatch.call(this,t,e):super[t]()}append(t,e){return r.append.call(this,t,e)}delete(t,e){return r.delete.call(this,t,e)}space(t){return this.focused.editable?this.append(t):super.space()}number(t){return this.focused.editable?this.append(t):super.number(t)}next(){return this.focused.editable?r.next.call(this):super.next()}prev(){return this.focused.editable?r.prev.call(this):super.prev()}async indicator(t,e){let i=t.indicator||"",s=t.editable?i:super.indicator(t,e);return await this.resolve(s,this.state,t,e)||""}indent(t){return"heading"===t.role?"":t.editable?" ":" "}async renderChoice(t,e){return t.indent="",t.editable?r.renderChoice.call(this,t,e):super.renderChoice(t,e)}error(){return""}footer(){return this.state.error}async validate(){let t=!0;for(let e of this.choices){if("function"!=typeof e.validate)continue;if("heading"===e.role)continue;let i=e.parent?this.value[e.parent.name]:this.value;if(e.editable?i=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(i=!0===e.enabled),t=await e.validate(i,this.state),!0!==t)break}return!0!==t&&(this.state.error="string"==typeof t?t:"Invalid Input"),t}submit(){if(!0===this.focused.newChoice)return super.submit();if(this.choices.some((t=>t.newChoice)))return this.alert();this.value={};for(let t of this.choices){let e=t.parent?this.value[t.parent.name]:this.value;"heading"!==t.role?t.editable?e[t.name]=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(e[t.name]=!0===t.enabled):this.value[t.name]={}}return this.base.submit.call(this)}}},826:(t,e,i)=>{"use strict";const s=i(3),r=i(466),n=i(786);t.exports=class extends r{constructor(t){super({...t,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find((t=>null!=t)),this.emptyError="",this.values={}}async reset(t){return await super.reset(),!0===t&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach((t=>t.reset&&t.reset())),this.render()}dispatch(t){return!!t&&this.append(t)}append(t){let e=this.focused;if(!e)return this.alert();let{cursor:i,input:s}=e;return e.value=e.input=s.slice(0,i)+t+s.slice(i),e.cursor++,this.render()}delete(){let t=this.focused;if(!t||t.cursor<=0)return this.alert();let{cursor:e,input:i}=t;return t.value=t.input=i.slice(0,e-1)+i.slice(e),t.cursor--,this.render()}deleteForward(){let t=this.focused;if(!t)return this.alert();let{cursor:e,input:i}=t;if(void 0===i[e])return this.alert();let s=`${i}`.slice(0,e)+`${i}`.slice(e+1);return t.value=t.input=s,this.render()}right(){let t=this.focused;return t?t.cursor>=t.input.length?this.alert():(t.cursor++,this.render()):this.alert()}left(){let t=this.focused;return t?t.cursor<=0?this.alert():(t.cursor--,this.render()):this.alert()}space(t,e){return this.dispatch(t,e)}number(t,e){return this.dispatch(t,e)}next(){let t=this.focused;if(!t)return this.alert();let{initial:e,input:i}=t;return e&&e.startsWith(i)&&i!==e?(t.value=t.input=e,t.cursor=t.value.length,this.render()):super.next()}prev(){let t=this.focused;return t?0===t.cursor?super.prev():(t.value=t.input="",t.cursor=0,this.render()):this.alert()}separator(){return""}format(t){return this.state.submitted?"":super.format(t)}pointer(){return""}indicator(t){return t.input?"⦿":"⊙"}async choiceSeparator(t,e){let i=await this.resolve(t.separator,this.state,t,e)||":";return i?" "+this.styles.disabled(i):""}async renderChoice(t,e){await this.onChoice(t,e);let{state:i,styles:r}=this,{cursor:a,initial:o="",name:l,input:h=""}=t,{muted:c,submitted:u,primary:d,danger:p}=r,m=this.index===e,f=t.validate||(()=>!0),g=await this.choiceSeparator(t,e),y=t.message;"right"===this.align&&(y=y.padStart(this.longest+1," ")),"left"===this.align&&(y=y.padEnd(this.longest+1," "));let b=this.values[l]=h||o,w=h?"success":"dark";!0!==await f.call(t,b,this.state)&&(w="danger");let v=(0,r[w])(await this.indicator(t,e))+(t.pad||""),x=this.indent(t),k=()=>[x,v,y+g,h].filter(Boolean).join(" ");if(i.submitted)return y=s(y),h=u(h),k();if(t.format)h=await t.format.call(this,h,t,e);else{let t=this.styles.muted;h=n(this,{input:h,initial:o,pos:a,showCursor:m,color:t})}return this.isValue(h)||(h=this.styles.muted(this.symbols.ellipsis)),t.result&&(this.values[l]=await t.result.call(this,b,t,e)),m&&(y=d(y)),t.error?h+=(h?" ":"")+p(t.error.trim()):t.hint&&(h+=(h?" ":"")+c(t.hint.trim())),k()}async submit(){return this.value=this.values,super.base.submit.call(this)}}},594:(t,e,i)=>{"use strict";const s=i(546),r=(t,i)=>{s.defineExport(e,t,i),s.defineExport(e,t.toLowerCase(),i)};r("AutoComplete",(()=>i(317))),r("BasicAuth",(()=>i(186))),r("Confirm",(()=>i(291))),r("Editable",(()=>i(848))),r("Form",(()=>i(826))),r("Input",(()=>i(719))),r("Invisible",(()=>i(822))),r("List",(()=>i(795))),r("MultiSelect",(()=>i(56))),r("Numeral",(()=>i(403))),r("Password",(()=>i(847))),r("Scale",(()=>i(813))),r("Select",(()=>i(466))),r("Snippet",(()=>i(451))),r("Sort",(()=>i(144))),r("Survey",(()=>i(755))),r("Text",(()=>i(781))),r("Toggle",(()=>i(653))),r("Quiz",(()=>i(249)))},719:(t,e,i)=>{"use strict";const s=i(391),r=i(736);t.exports=class extends s{constructor(t){super(t);let e=this.options.history;if(e&&e.store){let t=e.values||this.initial;this.autosave=!!e.autosave,this.store=e.store,this.data=this.store.get("values")||{past:[],present:t},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(t){return this.store?(this.data=r(t,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=r("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&!0===this.autosave&&this.save(),super.submit()}}},822:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{format(){return""}}},795:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t={}){super(t),this.sep=this.options.separator||/, */,this.initial=t.initial||""}split(t=this.value){return t?String(t).split(this.sep):[]}format(){let t=this.state.submitted?this.styles.primary:t=>t;return this.list.map(t).join(", ")}async submit(t){let e=this.state.error||await this.validate(this.list,this.state);return!0!==e?(this.state.error=e,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}}},56:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){super({...t,multiple:!0})}}},403:(t,e,i)=>{t.exports=i(376)},847:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t){super(t),this.cursorShow()}format(t=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(t.length)):""}}},249:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){if(super(t),"number"!=typeof this.options.correctChoice||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(t,e){let i=await super.toChoices(t,e);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(t){return t.index===this.options.correctChoice}async result(t){return{selectedAnswer:t,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}}},813:(t,e,i)=>{"use strict";const s=i(3),r=i(575),n=i(546);t.exports=class extends r{constructor(t={}){super(t),this.widths=[].concat(t.messageWidth||50),this.align=[].concat(t.align||"left"),this.linebreak=t.linebreak||!1,this.edgeLength=t.edgeLength||3,this.newline=t.newline||"\n ";let e=t.startNumber||1;"number"==typeof this.scale&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map(((t,i)=>({name:i+e}))))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(!0===this.tableized)return;this.tableized=!0;let t=0;for(let e of this.choices){t=Math.max(t,e.message.length),e.scaleIndex=e.initial||2,e.scale=[];for(let t=0;t=this.scale.length-1?this.alert():(t.scaleIndex++,this.render())}left(){let t=this.focused;return t.scaleIndex<=0?this.alert():(t.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map((t=>this.styles.info(t.index))).join(", "):""}pointer(){return""}renderScaleKey(){return!1===this.scaleKey||this.state.submitted?"":["",...this.scale.map((t=>` ${t.name} - ${t.message}`))].map((t=>this.styles.muted(t))).join("\n")}renderScaleHeading(t){let e=this.scale.map((t=>t.name));"function"==typeof this.options.renderScaleHeading&&(e=this.options.renderScaleHeading.call(this,t));let i=this.scaleLength-e.join("").length,s=Math.round(i/(e.length-1)),r=e.map((t=>this.styles.strong(t))).join(" ".repeat(s)),n=" ".repeat(this.widths[0]);return this.margin[3]+n+this.margin[1]+r}scaleIndicator(t,e,i){if("function"==typeof this.options.scaleIndicator)return this.options.scaleIndicator.call(this,t,e,i);let s=t.scaleIndex===e.index;return e.disabled?this.styles.hint(this.symbols.radio.disabled):s?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(t,e){let i=t.scale.map((i=>this.scaleIndicator(t,i,e))),s="Hyper"===this.term?"":" ";return i.join(s+this.symbols.line.repeat(this.edgeLength))}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,r=await this.pointer(t,e),a=await t.hint;a&&!n.hasColor(a)&&(a=this.styles.muted(a));let o=t=>this.margin[3]+t.replace(/\s+$/,"").padEnd(this.widths[0]," "),l=this.newline,h=this.indent(t),c=await this.resolve(t.message,this.state,t,e),u=await this.renderScale(t,e),d=this.margin[1]+this.margin[3];this.scaleLength=s(u).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-d.length);let p=n.wordWrap(c,{width:this.widths[0],newline:l}).split("\n").map((t=>o(t)+this.margin[1]));return i&&(u=this.styles.info(u),p=p.map((t=>this.styles.info(t)))),p[0]+=u,this.linebreak&&p.push(""),[h+r,p.join("\n")].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t),i=await this.renderScaleHeading();return this.margin[0]+[i,...e.map((t=>t.join(" ")))].join("\n")}async render(){let{submitted:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=await this.message(),n="";!1!==this.options.promptLine&&(n=[i,r,s,""].join(" "),this.state.prompt=n);let a=await this.header(),o=await this.format(),l=await this.renderScaleKey(),h=await this.error()||await this.hint(),c=await this.renderChoices(),u=await this.footer(),d=this.emptyError;o&&(n+=o),h&&!n.includes(h)&&(n+=" "+h),t&&!o&&!c.trim()&&this.multiple&&null!=d&&(n+=this.styles.danger(d)),this.clear(e),this.write([a,n,l,c,u].filter(Boolean).join("\n")),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIndex;return this.base.submit.call(this)}}},466:(t,e,i)=>{"use strict";const s=i(575),r=i(546);t.exports=class extends s{constructor(t){super(t),this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(t,e){if(this.multiple)return this[e.name]?await this[e.name](t,e):await super.dispatch(t,e);this.alert()}separator(){if(this.options.separator)return super.separator();let t=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():t}pointer(t,e){return!this.multiple||this.options.pointer?super.pointer(t,e):""}indicator(t,e){return this.multiple?super.indicator(t,e):""}choiceMessage(t,e){let i=this.resolve(t.message,this.state,t,e);return"heading"!==t.role||r.hasColor(i)||(i=this.styles.strong(i)),this.resolve(i,this.state,t,e)}choiceSeparator(){return":"}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,s=await this.pointer(t,e),n=await this.indicator(t,e)+(t.pad||""),a=await this.resolve(t.hint,this.state,t,e);a&&!r.hasColor(a)&&(a=this.styles.muted(a));let o=this.indent(t),l=await this.choiceMessage(t,e),h=()=>[this.margin[3],o+s+n,l,this.margin[1],a].filter(Boolean).join(" ");return"heading"===t.role?h():t.disabled?(r.hasColor(l)||(l=this.styles.disabled(l)),h()):(i&&(l=this.styles.em(l)),h())}async renderChoices(){if("choices"===this.state.loading)return this.styles.warning("Loading choices");if(this.state.submitted)return"";let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t);e.length||e.push(this.styles.danger("No matching choices"));let i,s=this.margin[0]+e.join("\n");return this.options.choicesHeader&&(i=await this.resolve(this.options.choicesHeader,this.state)),[i,s].filter(Boolean).join("\n")}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map((t=>this.styles.primary(t.name))).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:t,size:e}=this.state,i="",s=await this.header(),r=await this.prefix(),n=await this.separator(),a=await this.message();!1!==this.options.promptLine&&(i=[r,a,n,""].join(" "),this.state.prompt=i);let o=await this.format(),l=await this.error()||await this.hint(),h=await this.renderChoices(),c=await this.footer();o&&(i+=o),l&&!i.includes(l)&&(i+=" "+l),t&&!o&&!h.trim()&&this.multiple&&null!=this.emptyError&&(i+=this.styles.danger(this.emptyError)),this.clear(e),this.write([s,i,h,c].filter(Boolean).join("\n")),this.write(this.margin[2]),this.restore()}}},451:(t,e,i)=>{"use strict";const s=i(3),r=i(189),n=i(232);t.exports=class extends n{constructor(t){super(t),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await r(this),await super.initialize()}async reset(t){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},!0!==t&&(await this.initialize(),await this.render())}moveCursor(t){let e=this.getItem();this.cursor+=t,e.cursor+=t}dispatch(t,e){e.code||e.ctrl||null==t||!this.getItem()?this.alert():this.append(t,e)}append(t,e){let i=this.getItem(),s=i.input.slice(0,this.cursor),r=i.input.slice(this.cursor);this.input=i.input=`${s}${t}${r}`,this.moveCursor(1),this.render()}delete(){let t=this.getItem();if(this.cursor<=0||!t.input)return this.alert();let e=t.input.slice(this.cursor),i=t.input.slice(0,this.cursor-1);this.input=t.input=`${i}${e}`,this.moveCursor(-1),this.render()}increment(t){return t>=this.state.keys.length-1?0:t+1}decrement(t){return t<=0?this.state.keys.length-1:t-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(t){let e=this.state.completed<100?this.styles.warning:this.styles.success;return!0===this.state.submitted&&100!==this.state.completed&&(e=this.styles.danger),e(`${this.state.completed}% completed`)}async render(){let{index:t,keys:e=[],submitted:i,size:s}=this.state,r=[this.options.newline,"\n"].find((t=>null!=t)),n=await this.prefix(),a=await this.separator(),o=[n,await this.message(),a].filter(Boolean).join(" ");this.state.prompt=o;let l=await this.header(),h=await this.error()||"",c=await this.hint()||"",u=i?"":await this.interpolate(this.state),d=this.state.key=e[t]||"",p=await this.format(d),m=await this.footer();p&&(o+=" "+p),c&&!p&&0===this.state.completed&&(o+=" "+c),this.clear(s);let f=[l,o,u,m,h.trim()];this.write(f.filter(Boolean).join(r)),this.restore()}getItem(t){let{items:e,keys:i,index:s}=this.state,r=e.find((t=>t.name===i[s]));return r&&null!=r.input&&(this.input=r.input,this.cursor=r.cursor),r}async submit(){"function"!=typeof this.interpolate&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:t,missing:e,output:i,values:r}=this.state;if(t.size){let e="";for(let[i,s]of t)e+=`Invalid ${i}: ${s}\n`;return this.state.error=e,super.submit()}if(e.size)return this.state.error="Required: "+[...e.keys()].join(", "),super.submit();let n=s(i).split("\n").map((t=>t.slice(1))).join("\n");return this.value={values:r,result:n},super.submit()}}},144:(t,e,i)=>{"use strict";const s="(Use + to sort)",r=i(466);t.exports=class extends r{constructor(t){super({...t,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,s].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(t,e){let i=await super.renderChoice(t,e),s=this.symbols.identicalTo+" ",r=this.index===e&&this.sorting?this.styles.muted(s):" ";return!1===this.options.drag&&(r=""),!0===this.options.numbered?r+`${e+1} - `+i:r+i}get selected(){return this.choices}submit(){return this.value=this.choices.map((t=>t.value)),super.submit()}}},755:(t,e,i)=>{"use strict";const s=i(575);function r(t,e={}){if(Array.isArray(e.scale))return e.scale.map((t=>({...t})));let i=[];for(let e=1;ethis.styles.muted(t))),this.state.header=t.join("\n ")}}async toChoices(...t){if(this.createdScales)return!1;this.createdScales=!0;let e=await super.toChoices(...t);for(let t of e)t.scale=r(5,this.options),t.scaleIdx=2;return e}dispatch(){this.alert()}space(){let t=this.focused,e=t.scale[t.scaleIdx],i=e.selected;return t.scale.forEach((t=>t.selected=!1)),e.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let t=this.focused;return t.scaleIdx>=t.scale.length-1?this.alert():(t.scaleIdx++,this.render())}left(){let t=this.focused;return t.scaleIdx<=0?this.alert():(t.scaleIdx--,this.render())}indent(){return" "}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,s="Hyper"===this.term,r=s?9:8,n=s?"":" ",a=this.symbols.line.repeat(r),o=" ".repeat(r+(s?0:1)),l=t=>(t?this.styles.success("◉"):"◯")+n,h=e+1+".",c=i?this.styles.heading:this.styles.noop,u=await this.resolve(t.message,this.state,t,e),d=this.indent(t),p=d+t.scale.map(((e,i)=>l(i===t.scaleIdx))).join(a),m=d+t.scale.map(((e,i)=>(e=>e===t.scaleIdx?c(e):e)(i))).join(o);return i&&(p=this.styles.cyan(p),m=this.styles.cyan(m)),[[h,u].filter(Boolean).join(" "),p,m," "].filter(Boolean).join("\n")}async renderChoices(){if(this.state.submitted)return"";let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t);return e.length||e.push(this.styles.danger("No matching choices")),e.join("\n")}format(){return this.state.submitted?this.choices.map((t=>this.styles.info(t.scaleIdx))).join(", "):""}async render(){let{submitted:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=[i,await this.message(),s].filter(Boolean).join(" ");this.state.prompt=r;let n=await this.header(),a=await this.format(),o=await this.error()||await this.hint(),l=await this.renderChoices(),h=await this.footer();!a&&o||(r+=" "+a),o&&!r.includes(o)&&(r+=" "+o),t&&!a&&!l&&this.multiple&&"form"!==this.type&&(r+=this.styles.danger(this.emptyError)),this.clear(e),this.write([r,n,l,h].filter(Boolean).join("\n")),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIdx;return this.base.submit.call(this)}}},781:(t,e,i)=>{t.exports=i(719)},653:(t,e,i)=>{"use strict";const s=i(838);t.exports=class extends s{async initialize(){await super.initialize(),this.value=this.initial=this.resolve(this.options.initial),this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(!0===this.value)return this.alert();this.value=!0,this.render()}disable(){if(!1===this.value)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(t="",e){switch(t.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let t=t=>this.styles.primary.underline(t);return[this.value?this.disabled:t(this.disabled),this.value?t(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:t}=this.state,e=await this.header(),i=await this.prefix(),s=await this.separator(),r=await this.message(),n=await this.format(),a=await this.error()||await this.hint(),o=await this.footer(),l=[i,r,s,n].join(" ");this.state.prompt=l,a&&!l.includes(a)&&(l+=" "+a),this.clear(t),this.write([e,l,o].filter(Boolean).join("\n")),this.write(this.margin[2]),this.restore()}}},607:t=>{"use strict";t.exports=class{_queue=[];_executing=!1;_jobRunner=null;constructor(t){this._jobRunner=t}enqueue=(...t)=>{this._queue.push(t),this._dequeue()};destroy(){this._queue.length=0,this._jobRunner=null}_dequeue(){!this._executing&&this._queue.length&&(this._executing=!0,this._jobRunner(...this._queue.shift()),setTimeout((()=>{this._executing=!1,this._dequeue()})))}}},502:(t,e,i)=>{"use strict";const s=i(546),r={default:(t,e)=>e,checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading:(t,e)=>(e.disabled="",e.indicator=[e.indicator," "].find((t=>null!=t)),e.message=e.message||"",e),input(t,e){throw new Error("input role is not implemented yet")},option:(t,e)=>r.default(t,e),radio(t,e){throw new Error("radio role is not implemented yet")},separator:(t,e)=>(e.disabled="",e.indicator=[e.indicator," "].find((t=>null!=t)),e.message=e.message||t.symbols.line.repeat(5),e),spacer:(t,e)=>e};t.exports=(t,e={})=>{let i=s.merge({},r,e.roles);return i[t]||i.default}},873:(t,e,i)=>{"use strict";const{define:s,width:r}=i(546);t.exports=class{constructor(t){let e=t.options;s(this,"_prompt",t),this.type=t.type,this.name=t.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=r(e.stdout||process.stdout),Object.assign(this,e),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=t.symbols,this.styles=t.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let t={...this};return t.status=this.status,t.buffer=Buffer.from(t.buffer),delete t.clone,t}set color(t){this._color=t}get color(){let t=this.prompt.styles;if(this.cancelled)return t.cancelled;if(this.submitted)return t.submitted;let e=this._color||t[this.status];return"function"==typeof e?e:t.pending}set loading(t){this._loading=t}get loading(){return"boolean"==typeof this._loading?this._loading:!!this.loadingChoices&&"choices"}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}}},217:(t,e,i)=>{"use strict";const s=i(546),r=i(730),n={default:r.noop,noop:r.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||s.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||s.complement(this.primary)},primary:r.cyan,success:r.green,danger:r.magenta,strong:r.bold,warning:r.yellow,muted:r.dim,disabled:r.gray,dark:r.dim.gray,underline:r.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},set placeholder(t){this._placeholder=t},get placeholder(){return this._placeholder||this.primary.dim},set highlight(t){this._highlight=t},get highlight(){return this._highlight||this.inverse},merge:(t={})=>{t.styles&&"boolean"==typeof t.styles.enabled&&(r.enabled=t.styles.enabled),t.styles&&"boolean"==typeof t.styles.visible&&(r.visible=t.styles.visible);let e=s.merge({},n,t.styles);delete e.merge;for(let t of Object.keys(r))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>r[t]});for(let t of Object.keys(r.styles))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>r[t]});return e}};t.exports=n},739:(t,e,i)=>{"use strict";const s="win32"===process.platform,r=i(730),n=i(546),a={...r.symbols,upDownDoubleArrow:"⇕",upDownDoubleArrow2:"⬍",upDownArrow:"↕",asterisk:"*",asterism:"⁂",bulletWhite:"◦",electricArrow:"⌁",ellipsisLarge:"⋯",ellipsisSmall:"…",fullBlock:"█",identicalTo:"≡",indicator:r.symbols.check,leftAngle:"‹",mark:"※",minus:"−",multiplication:"×",obelus:"÷",percent:"%",pilcrow:"¶",pilcrow2:"❡",pencilUpRight:"✐",pencilDownRight:"✎",pencilRight:"✏",plus:"+",plusMinus:"±",pointRight:"☞",rightAngle:"›",section:"§",hexagon:{off:"⬡",on:"⬢",disabled:"⬢"},ballot:{on:"☑",off:"☐",disabled:"☒"},stars:{on:"★",off:"☆",disabled:"☆"},folder:{on:"▼",off:"▶",disabled:"▶"},prefix:{pending:r.symbols.question,submitted:r.symbols.check,cancelled:r.symbols.cross},separator:{pending:r.symbols.pointerSmall,submitted:r.symbols.middot,cancelled:r.symbols.middot},radio:{off:s?"( )":"◯",on:s?"(*)":"◉",disabled:s?"(|)":"Ⓘ"},numbers:["⓪","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","㉑","㉒","㉓","㉔","㉕","㉖","㉗","㉘","㉙","㉚","㉛","㉜","㉝","㉞","㉟","㊱","㊲","㊳","㊴","㊵","㊶","㊷","㊸","㊹","㊺","㊻","㊼","㊽","㊾","㊿"]};a.merge=t=>{let e=n.merge({},r.symbols,a,t.symbols);return delete e.merge,e},t.exports=a},227:(t,e,i)=>{"use strict";const s=i(217),r=i(739),n=i(546);t.exports=t=>{t.options=n.merge({},t.options.theme,t.options),t.symbols=r.merge(t.options),t.styles=s.merge(t.options)}},940:t=>{"use strict";function e(t,e,i={}){let s=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},r=i.interval||120;s.frames=i.frames||[],s.loading=!0;let n=setInterval((()=>{s.ms=Date.now()-s.start,s.tick++,t.render()}),r);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,"interval",{value:n}),t.once("close",(()=>s.stop())),s.stop}t.exports=t=>{t.timers=t.timers||{};let i=t.options.timers;if(i)for(let s of Object.keys(i)){let r=i[s];"number"==typeof r&&(r={interval:r}),e(t,s,r)}}},575:(t,e,i)=>{"use strict";const s=i(3),r=i(232),n=i(502),a=i(546),{reorder:o,scrollUp:l,scrollDown:h,isObject:c,swap:u}=a;function d(t,e){if(e instanceof Promise)return e;if("function"==typeof e){if(a.isAsyncFn(e))return e;e=e.call(t,t)}for(let i of e){if(Array.isArray(i.choices)){let e=i.choices.filter((e=>!t.isDisabled(e)));i.enabled=e.every((t=>!0===t.enabled))}!0===t.isDisabled(i)&&delete i.enabled}return e}t.exports=class extends r{constructor(t){super(t),this.cursorHide(),this.maxSelected=t.maxSelected||1/0,this.multiple=t.multiple||!1,this.initial=t.initial||0,this.delay=t.delay||0,this.longest=0,this.num=""}async initialize(){"function"==typeof this.options.initial&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:t,initial:e,autofocus:i,suggest:s}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(t)),this.choices.forEach((t=>t.enabled=!1)),"function"!=typeof s&&0===this.selectable.length)throw new Error("At least one choice must be selectable");c(e)&&(e=Object.keys(e)),Array.isArray(e)?(null!=i&&(this.index=this.findIndex(i)),e.forEach((t=>this.enable(this.find(t)))),await this.render()):(null!=i&&(e=i),"string"==typeof e&&(e=this.findIndex(e)),"number"==typeof e&&e>-1&&(this.index=Math.max(0,Math.min(e,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(t,e){this.state.loadingChoices=!0;let i=[],s=0,r=async(t,e)=>{"function"==typeof t&&(t=await t.call(this)),t instanceof Promise&&(t=await t);for(let n=0;n(this.state.loadingChoices=!1,t)))}async toChoice(t,e,i){if("function"==typeof t&&(t=await t.call(this,this)),t instanceof Promise&&(t=await t),"string"==typeof t&&(t={name:t}),t.normalized)return t;t.normalized=!0;let r=t.value,o=n(t.role,this.options);if("string"!=typeof(t=o(this,t)).disabled||t.hint||(t.hint=t.disabled,t.disabled=!0),!0===t.disabled&&null==t.hint&&(t.hint="(disabled)"),null!=t.index)return t;t.name=t.name||t.key||t.title||t.value||t.message,t.message=t.message||t.name||"",t.value=[t.value,t.name].find(this.isValue.bind(this)),t.input="",t.index=e,t.cursor=0,a.define(t,"parent",i),t.level=i?i.level+1:1,null==t.indent&&(t.indent=i?i.indent+" ":t.indent||""),t.path=i?i.path+"."+t.name:t.name,t.enabled=!(!this.multiple||this.isDisabled(t)||!t.enabled&&!this.isSelected(t)),this.isDisabled(t)||(this.longest=Math.max(this.longest,s(t.message).length));let l={...t};return t.reset=(e=l.input,i=l.value)=>{for(let e of Object.keys(l))t[e]=l[e];t.input=e,t.value=i},null==r&&"function"==typeof t.initial&&(t.input=await t.initial.call(this,this.state,t,e)),t}async onChoice(t,e){this.emit("choice",t,e,this),"function"==typeof t.onChoice&&await t.onChoice.call(this,this.state,t,e)}async addChoice(t,e,i){let s=await this.toChoice(t,e,i);return this.choices.push(s),this.index=this.choices.length-1,this.limit=this.choices.length,s}async newItem(t,e,i){let s={name:"New choice name?",editable:!0,newChoice:!0,...t},r=await this.addChoice(s,e,i);return r.updateChoice=()=>{delete r.newChoice,r.name=r.message=r.input,r.input="",r.cursor=0},this.render()}indent(t){return null==t.indent?t.level>1?" ".repeat(t.level-1):"":t.indent}dispatch(t,e){if(this.multiple&&this[e.name])return this[e.name]();this.alert()}focus(t,e){return"boolean"!=typeof e&&(e=t.enabled),e&&!t.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=t.index,t.enabled=e&&!this.isDisabled(t),t)}space(){return this.multiple?this.focused?(this.toggle(this.focused),this.render()):void 0:this.alert()}a(){if(this.maxSelectedt.enabled));return this.choices.forEach((e=>e.enabled=!t)),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach((t=>t.enabled=!t.enabled)),this.render())}g(){if(!this.choices.some((t=>!!t.parent)))return this.a();const t=this.focused;return this.toggle(t.parent&&!t.choices?t.parent:t),this.render()}toggle(t,e){if(!t.enabled&&this.selected.length>=this.maxSelected)return this.alert();"boolean"!=typeof e&&(e=!t.enabled),t.enabled=e,t.choices&&t.choices.forEach((t=>this.toggle(t,e)));let i=t.parent;for(;i;){let t=i.choices.filter((t=>this.isDisabled(t)));i.enabled=t.every((t=>!0===t.enabled)),i=i.parent}return d(this,this.choices),this.emit("toggle",t,this),t}enable(t){return this.selected.length>=this.maxSelected?this.alert():(t.enabled=!this.isDisabled(t),t.choices&&t.choices.forEach(this.enable.bind(this)),t)}disable(t){return t.enabled=!1,t.choices&&t.choices.forEach(this.disable.bind(this)),t}number(t){this.num+=t;let e=t=>{let e=Number(t);if(e>this.choices.length-1)return this.alert();let i=this.focused,s=this.choices.find((t=>e===t.index));if(!s.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(-1===this.visible.indexOf(s)){let t=o(this.choices),e=t.indexOf(s);if(i.index>e){let i=t.slice(e,e+this.limit),s=t.filter((t=>!i.includes(t)));this.choices=i.concat(s)}else{let i=e-this.limit+1;this.choices=t.slice(i).concat(t.slice(0,i))}}return this.index=this.choices.indexOf(s),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise((t=>{let i=this.choices.length,s=this.num,r=(i=!1,r)=>{clearTimeout(this.numberTimeout),i&&(r=e(s)),this.num="",t(r)};return"0"===s||1===s.length&&Number(s+"0")>i?r(!0):Number(s)>i?r(!1,this.alert()):void(this.numberTimeout=setTimeout((()=>r(!0)),this.delay))}))}home(){return this.choices=o(this.choices),this.index=0,this.render()}end(){let t=this.choices.length-this.limit,e=o(this.choices);return this.choices=e.slice(t).concat(e.slice(0,t)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let t=this.choices.length,e=this.visible.length,i=this.index;return!1===this.options.scroll&&0===i?this.alert():t>e&&0===i?this.scrollUp():(this.index=(i-1%t+t)%t,this.isDisabled()&&!this.allChoicesAreDisabled()?this.up():this.render())}down(){let t=this.choices.length,e=this.visible.length,i=this.index;return!1===this.options.scroll&&i===e-1?this.alert():t>e&&i===e-1?this.scrollDown():(this.index=(i+1)%t,this.isDisabled()&&!this.allChoicesAreDisabled()?this.down():this.render())}scrollUp(t=0){return this.choices=l(this.choices),this.index=t,this.isDisabled()?this.up():this.render()}scrollDown(t=this.visible.length-1){return this.choices=h(this.choices),this.index=t,this.isDisabled()?this.down():this.render()}async shiftUp(){return!0===this.options.sort?(this.sorting=!0,this.swap(this.index-1),await this.up(),void(this.sorting=!1)):this.scrollUp(this.index)}async shiftDown(){return!0===this.options.sort?(this.sorting=!0,this.swap(this.index+1),await this.down(),void(this.sorting=!1)):this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(t){u(this.choices,this.index,t)}allChoicesAreDisabled(t=this.choices){return t.every((t=>this.isDisabled(t)))}isDisabled(t=this.focused){return!(!t||!["disabled","collapsed","hidden","completing","readonly"].some((e=>!0===t[e])))||t&&"heading"===t.role}isEnabled(t=this.focused){if(Array.isArray(t))return t.every((t=>this.isEnabled(t)));if(t.choices){let e=t.choices.filter((t=>!this.isDisabled(t)));return t.enabled&&e.every((t=>this.isEnabled(t)))}return t.enabled&&!this.isDisabled(t)}isChoice(t,e){return t.name===e||t.index===Number(e)}isSelected(t){return Array.isArray(this.initial)?this.initial.some((e=>this.isChoice(t,e))):this.isChoice(t,this.initial)}map(t=[],e="value"){return[].concat(t||[]).reduce(((t,i)=>(t[i]=this.find(i,e),t)),{})}filter(t,e){let i="function"==typeof t?t:(e,i)=>[e.name,i].includes(t),s=(this.options.multiple?this.state._choices:this.choices).filter(i);return e?s.map((t=>t[e])):s}find(t,e){if(c(t))return e?t[e]:t;let i="function"==typeof t?t:(e,i)=>[e.name,i].includes(t),s=this.choices.find(i);return s?e?s[e]:s:void 0}findIndex(t){return this.choices.indexOf(this.find(t))}async submit(){let t=this.focused;if(!t)return this.alert();if(t.newChoice)return t.input?(t.updateChoice(),this.render()):this.alert();if(this.choices.some((t=>t.newChoice)))return this.alert();let{reorder:e,sort:i}=this.options,s=!0===this.multiple,r=this.selected;return void 0===r?this.alert():(Array.isArray(r)&&!1!==e&&!0!==i&&(r=a.reorder(r)),this.value=s?r.map((t=>t.name)):r.name,super.submit())}set choices(t=[]){this.state._choices=this.state._choices||[],this.state.choices=t;for(let e of t)this.state._choices.some((t=>t.name===e.name))||this.state._choices.push(e);if(!this._initial&&this.options.initial){this._initial=!0;let t=this.initial;if("string"==typeof t||"number"==typeof t){let e=this.find(t);e&&(this.initial=e.index,this.focus(e,!0))}}}get choices(){return d(this,this.state.choices||[])}set visible(t){this.state.visible=t}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(t){this.state.limit=t}get limit(){let{state:t,options:e,choices:i}=this,s=t.limit||this._limit||e.limit||i.length;return Math.min(s,this.height)}set value(t){super.value=t}get value(){return"string"!=typeof super.value&&super.value===this.initial?this.input:super.value}set index(t){this.state.index=t}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let t=this.choices[this.index];return t&&this.state.submitted&&!0!==this.multiple&&(t.enabled=!0),t}get selectable(){return this.choices.filter((t=>!this.isDisabled(t)))}get selected(){return this.multiple?this.enabled:this.focused}}},926:(t,e,i)=>{"use strict";const s=i(826),r=()=>{throw new Error("expected prompt to have a custom authenticate method")},n=(t=r)=>class extends s{constructor(t){super(t)}async submit(){this.value=await t.call(this,this.values,this.state),super.base.submit.call(this)}static create(t){return n(t)}};t.exports=n()},838:(t,e,i)=>{"use strict";const s=i(232),{isPrimitive:r,hasColor:n}=i(546);t.exports=class extends s{constructor(t){super(t),this.cursorHide()}async initialize(){let t=await this.resolve(this.initial,this.state);this.input=await this.cast(t),await super.initialize()}dispatch(t){return this.isValue(t)?(this.input=t,this.submit()):this.alert()}format(t){let{styles:e,state:i}=this;return i.submitted?e.success(t):e.primary(t)}cast(t){return this.isTrue(t)}isTrue(t){return/^[ty1]/i.test(t)}isFalse(t){return/^[fn0]/i.test(t)}isValue(t){return r(t)&&(this.isTrue(t)||this.isFalse(t))}async hint(){if("pending"===this.state.status){let t=await this.element("hint");return n(t)?t:this.styles.muted(t)}}async render(){let{input:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=[i,await this.message(),this.styles.muted(this.default),s].filter(Boolean).join(" ");this.state.prompt=r;let n=await this.header(),a=this.value=this.cast(t),o=await this.format(a),l=await this.error()||await this.hint(),h=await this.footer();l&&!r.includes(l)&&(o+=" "+l),r+=" "+o,this.clear(e),this.write([n,r,h].filter(Boolean).join("\n")),this.restore()}set value(t){super.value=t}get value(){return this.cast(super.value)}}},920:(t,e,i)=>{t.exports={ArrayPrompt:i(575),AuthPrompt:i(926),BooleanPrompt:i(838),NumberPrompt:i(376),StringPrompt:i(391)}},376:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t={}){super({style:"number",...t}),this.min=this.isValue(t.min)?this.toNumber(t.min):-1/0,this.max=this.isValue(t.max)?this.toNumber(t.max):1/0,this.delay=null!=t.delay?t.delay:1e3,this.float=!1!==t.float,this.round=!0===t.round||!1===t.float,this.major=t.major||10,this.minor=t.minor||1,this.initial=null!=t.initial?t.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(t){return!/[-+.]/.test(t)||"."===t&&this.input.includes(".")?this.alert("invalid number"):super.append(t)}number(t){return super.append(t)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(t){let e=t||this.minor,i=this.toNumber(this.input);return i>this.max+e?this.alert():(this.input=`${i+e}`,this.render())}down(t){let e=t||this.minor,i=this.toNumber(this.input);return ithis.isValue(t)));return this.value=this.toNumber(t||0),super.submit()}}},391:(t,e,i)=>{"use strict";const s=i(232),r=i(914),n=i(786),{isPrimitive:a}=i(546);t.exports=class extends s{constructor(t){super(t),this.initial=a(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[],this.keypressTimeout=void 0!==this.options.keypressTimeout?this.options.keypressTimeout:null}async keypress(t,e=(t?r(t,{}):{})){const i=Date.now(),s=i-this.lastKeypress;this.lastKeypress=i;const n="return"===e.name||"enter"===e.name;let a,o=this.state.prevKeypress;if(this.state.prevKeypress=e,null!=this.keypressTimeout&&n){if(s=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(t){return!!t}async format(t=this.value){let e=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(t||e):n(this,{input:t,initial:e,pos:this.cursor})}async render(){let t=this.state.size,e=await this.prefix(),i=await this.separator(),s=[e,await this.message(),i].filter(Boolean).join(" ");this.state.prompt=s;let r=await this.header(),n=await this.format(),a=await this.error()||await this.hint(),o=await this.footer();a&&!n.includes(a)&&(n+=" "+a),s+=" "+n,this.clear(t),this.write([r,s,o].filter(Boolean).join("\n")),this.restore()}}},546:(t,e,i)=>{"use strict";const s=Object.prototype.toString,r=i(730);let n=!1,a=new Set;const o={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};e.longest=(t,e)=>t.reduce(((t,i)=>Math.max(t,e?i[e].length:i.length)),0),e.hasColor=t=>!!t&&r.hasColor(t);const l=e.isObject=t=>null!==t&&"object"==typeof t&&!Array.isArray(t);e.nativeType=t=>s.call(t).slice(8,-1).toLowerCase().replace(/\s/g,""),e.isAsyncFn=t=>"asyncfunction"===e.nativeType(t),e.isPrimitive=t=>null!=t&&"object"!=typeof t&&"function"!=typeof t,e.resolve=(t,e,...i)=>"function"==typeof e?e.call(t,...i):e,e.scrollDown=(t=[])=>[...t.slice(1),t[0]],e.scrollUp=(t=[])=>[t.pop(),...t],e.reorder=(t=[])=>{let e=t.slice();return e.sort(((t,e)=>t.index>e.index?1:t.index{let s=t.length,r=i===s?0:i<0?s-1:i,n=t[e];t[e]=t[r],t[r]=n},e.width=(t,e=80)=>{let i=t&&t.columns?t.columns:e;return t&&"function"==typeof t.getWindowSize&&(i=t.getWindowSize()[0]),"win32"===process.platform?i-1:i},e.height=(t,e=20)=>{let i=t&&t.rows?t.rows:e;return t&&"function"==typeof t.getWindowSize&&(i=t.getWindowSize()[1]),i},e.wordWrap=(t,e={})=>{if(!t)return t;"number"==typeof e&&(e={width:e});let{indent:i="",newline:s="\n"+i,width:r=80}=e,n=(s+i).match(/[^\S\n]/g)||[];r-=n.length;let a=`.{1,${r}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,o=t.trim(),l=new RegExp(a,"g"),h=o.match(l)||[];return h=h.map((t=>t.replace(/\n$/,""))),e.padEnd&&(h=h.map((t=>t.padEnd(r," ")))),e.padStart&&(h=h.map((t=>t.padStart(r," ")))),i+h.join(s)},e.unmute=t=>{let e=t.stack.find((t=>r.keys.color.includes(t)));return e?r[e]:t.stack.find((t=>"bg"===t.slice(2)))?r[e.slice(2)]:t=>t},e.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"",e.inverse=t=>{if(!t||!t.stack)return t;let i=t.stack.find((t=>r.keys.color.includes(t)));if(i){let s=r["bg"+e.pascal(i)];return s?s.black:t}let s=t.stack.find((t=>"bg"===t.slice(0,2)));return s?r[s.slice(2).toLowerCase()]||t:r.none},e.complement=t=>{if(!t||!t.stack)return t;let i=t.stack.find((t=>r.keys.color.includes(t))),s=t.stack.find((t=>"bg"===t.slice(0,2)));if(i&&!s)return r[o[i]||i];if(s){let i=s.slice(2).toLowerCase(),n=o[i];return n&&r["bg"+e.pascal(n)]||t}return r.none},e.meridiem=t=>{let e=t.getHours(),i=t.getMinutes(),s=e>=12?"pm":"am";return e%=12,(0===e?12:e)+":"+(i<10?"0"+i:i)+" "+s},e.set=(t={},i="",s)=>i.split(".").reduce(((t,i,r,n)=>{let a=n.length-1>r?t[i]||{}:s;return!e.isObject(a)&&r{let s=null==t[e]?e.split(".").reduce(((t,e)=>t&&t[e]),t):t[e];return null==s?i:s},e.mixin=(t,i)=>{if(!l(t))return i;if(!l(i))return t;for(let s of Object.keys(i)){let r=Object.getOwnPropertyDescriptor(i,s);if(hasOwnProperty.call(r,"value"))if(hasOwnProperty.call(t,s)&&l(r.value)){let n=Object.getOwnPropertyDescriptor(t,s);l(n.value)&&n.value!==r.value?t[s]=e.merge({},t[s],i[s]):Reflect.defineProperty(t,s,r)}else Reflect.defineProperty(t,s,r);else Reflect.defineProperty(t,s,r)}return t},e.merge=(...t)=>{let i={};for(let s of t)e.mixin(i,s);return i},e.mixinEmitter=(t,i)=>{let s=i.constructor.prototype;for(let r of Object.keys(s)){let n=s[r];"function"==typeof n?e.define(t,r,n.bind(i)):e.define(t,r,n)}};const h=(t,e)=>{n||(n=!0,a.forEach((t=>t())),!0===t&&process.exit(128+e))},c=h.bind(null,!0,15),u=h.bind(null,!0,2);e.onExit=t=>(0===a.size&&(process.once("SIGTERM",c),process.once("SIGINT",u),process.once("exit",h)),a.add(t),()=>{a.delete(t),0===a.size&&(process.off("SIGTERM",c),process.off("SIGINT",u),process.off("exit",h))}),e.define=(t,e,i)=>{Reflect.defineProperty(t,e,{value:i})},e.defineExport=(t,e,i)=>{let s;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(t){s=t},get:()=>s?s():i()})}},3:(t,e,i)=>{"use strict";const s=i(277);t.exports=t=>"string"==typeof t?t.replace(s(),""):t},491:t=>{"use strict";t.exports=require("assert")},361:t=>{"use strict";t.exports=require("events")},521:t=>{"use strict";t.exports=require("readline")}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=require("node:path"),e=i.n(t)().join(__dirname,"..","..","assets","data","cards_pt-br.json"),s=require("node:crypto");var r=i.n(s);const n={title:t=>!(t.trim().trim().length<2)||"O título precisa ter pelo menos 3 caracteres.",description:t=>!(t.trim().length<10)||"A descrição precisa ter pelo menos 10 caracteres.",tags:t=>!(t.length<1)||"Você precisa selecionar pelo menos uma tag."},{MultiSelect:a}=i(31),o=new a({name:"tags",message:"Selecione as tags relacionadas ao seu conceito",choices:["Back-end","Biblioteca","Conceito","Design","Ferramenta","Framework","Front-end","Mobile","Paradigma","Versionamento"],validate:n.tags});var l=i(31),h=i.n(l);const c={type:"input",required:!0};const u=()=>{return t=void 0,e=void 0,s=function*(){const t=yield(i=void 0,s=void 0,a=void 0,l=function*(){return yield h().prompt([Object.assign(Object.assign({},c),{name:"title",message:"Qual título o seu conceito tem ?",validate:n.title}),Object.assign(Object.assign({},c),{name:"description",message:"Qual descrição o seu conceito tem ?",validate:n.description}),{type:"input",name:"code",message:"Seu conceito tem algum código ? (opcional)"}])},new(a||(a=Promise))((function(t,e){function r(t){try{o(l.next(t))}catch(t){e(t)}}function n(t){try{o(l.throw(t))}catch(t){e(t)}}function o(e){var i;e.done?t(e.value):(i=e.value,i instanceof a?i:new a((function(t){t(i)}))).then(r,n)}o((l=l.apply(i,s||[])).next())}))),e=yield o.run();var i,s,a,l;return{id:r().randomBytes(16).toString("hex"),title:t.title,description:t.description,tags:e,content:{code:t.code}}},new((i=void 0)||(i=Promise))((function(r,n){function a(t){try{l(s.next(t))}catch(t){n(t)}}function o(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}));var t,e,i,s},d=require("node:fs");var p=i.n(d);class m{writeToFile(t,e){p().writeFileSync(t,e)}readFromFile(t){return p().readFileSync(t,"utf8")}}const f=("—",t=>"—".repeat(t))(50);var g,y,b,w;g=void 0,y=void 0,w=function*(){try{const t=new m;((t,e,i)=>{return((t,e,i)=>{i.writeToFile(t,JSON.stringify({cards:e},null,2))})(i,((t,e)=>[...t,e])((r=i,s=e.readFromFile(r),Object.values(JSON.parse(s)).flat()),t),e);var s,r})(yield u(),t,e),console.log(`\n${f}`),console.log("✔️ Novo termo adicionado com sucesso!"),console.log(f)}catch(t){console.log(`\n${f}`),console.error("❌ Ocorreu um erro ao adicionar o novo termo."),console.error("❌ Tente novamente seguindo as instruções."),console.error("❌ Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues."),console.log(f),t instanceof Error&&console.error(`❌ ${t.message}\n`)}},new((b=void 0)||(b=Promise))((function(t,e){function i(t){try{r(w.next(t))}catch(t){e(t)}}function s(t){try{r(w.throw(t))}catch(t){e(t)}}function r(e){var r;e.done?t(e.value):(r=e.value,r instanceof b?r:new b((function(t){t(r)}))).then(i,s)}r((w=w.apply(g,y||[])).next())}))})()})(); \ No newline at end of file From df11de0fc9cf4bb18fbb63e474b41e0b254bea34 Mon Sep 17 00:00:00 2001 From: rwietter Date: Sat, 21 Oct 2023 20:48:40 -0300 Subject: [PATCH 21/42] refactor: replace objective-questions with subjective-questions --- cli/commands/new-term.ts | 4 ++-- cli/io/{objective-questions.ts => subjective-questions.ts} | 6 +++--- cli/types/index.ts | 2 +- .../{objective-questions.ts => subjective-questions.ts} | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) rename cli/io/{objective-questions.ts => subjective-questions.ts} (75%) rename cli/types/{objective-questions.ts => subjective-questions.ts} (62%) diff --git a/cli/commands/new-term.ts b/cli/commands/new-term.ts index 0884988f..573d6ce6 100644 --- a/cli/commands/new-term.ts +++ b/cli/commands/new-term.ts @@ -1,7 +1,7 @@ import crypto from "node:crypto"; import { promptMultiSelectTags } from "../io/multiselect-tags"; -import { objectiveQuestions } from "../io/objective-questions"; +import { subjectiveQuestions } from "../io/subjective-questions"; /** * Prompts the user for the term's information. @@ -9,7 +9,7 @@ import { objectiveQuestions } from "../io/objective-questions"; * @throws {Error} If the user doesn't provide the required information. */ export const createNewTerm = async () => { - const questions = await objectiveQuestions(); + const questions = await subjectiveQuestions(); const tagsPrompt: string[] = await promptMultiSelectTags.run(); const card = { diff --git a/cli/io/objective-questions.ts b/cli/io/subjective-questions.ts similarity index 75% rename from cli/io/objective-questions.ts rename to cli/io/subjective-questions.ts index 6f841154..c9cd8225 100644 --- a/cli/io/objective-questions.ts +++ b/cli/io/subjective-questions.ts @@ -4,10 +4,10 @@ import { basePrompt } from "./base"; import { validations } from "../core/prompt-validations"; -import { ObjectiveQuestions } from "../types"; +import { SubjectiveQuestions } from "../types"; -export const objectiveQuestions = async (): Promise => { - const questions: ObjectiveQuestions = await Enquirer.prompt([ +export const subjectiveQuestions = async (): Promise => { + const questions: SubjectiveQuestions = await Enquirer.prompt([ { ...basePrompt, name: "title", diff --git a/cli/types/index.ts b/cli/types/index.ts index 26199e62..7d84404b 100644 --- a/cli/types/index.ts +++ b/cli/types/index.ts @@ -1,4 +1,4 @@ export * from "./term"; -export * from "./objective-questions"; +export * from "./subjective-questions"; export * from "./available-tags"; export * from "./fs"; diff --git a/cli/types/objective-questions.ts b/cli/types/subjective-questions.ts similarity index 62% rename from cli/types/objective-questions.ts rename to cli/types/subjective-questions.ts index a97d3b86..5e803d9e 100644 --- a/cli/types/objective-questions.ts +++ b/cli/types/subjective-questions.ts @@ -1,4 +1,4 @@ -export type ObjectiveQuestions = { +export type SubjectiveQuestions = { title: string; description: string; code: string; From c4885b3f5ace164e2402ae850dc40b46bbdbdf9a Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:13:19 -0300 Subject: [PATCH 22/42] chore: remove enquirer and add clack --- package-lock.json | 85 ++++++++++++++++++++++++++--------------------- package.json | 3 +- 2 files changed, 50 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 39597aa4..d8c68b6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,16 @@ { "name": "diciotech", - "version": "1.0.0", + "version": "0.0.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "diciotech", - "version": "1.0.0", - "license": "MIT", + "version": "0.0.1", + "license": "GPL-3.0", "dependencies": { - "enquirer": "^2.4.1" + "@clack/prompts": "^0.7.0", + "ansi-colors": "^4.1.3" }, "devDependencies": { "@types/node": "^20.8.7", @@ -18,6 +19,43 @@ "typescript": "^5.2.2", "webpack": "^5.89.0", "webpack-cli": "^5.1.4" + }, + "engines": { + "node": ">=18.17.1" + } + }, + "node_modules/@clack/core": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@clack/core/-/core-0.3.3.tgz", + "integrity": "sha512-5ZGyb75BUBjlll6eOa1m/IZBxwk91dooBWhPSL67sWcLS0zt9SnswRL0l26TVdBhb0wnWORRxUn//uH6n4z7+A==", + "dependencies": { + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + } + }, + "node_modules/@clack/prompts": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-0.7.0.tgz", + "integrity": "sha512-0MhX9/B4iL6Re04jPrttDm+BsP8y6mS7byuv0BvXgdXhbV5PdlsHt55dvNsuBCPZ7xq1oTAOOuotR9NFbQyMSA==", + "bundleDependencies": [ + "is-unicode-supported" + ], + "dependencies": { + "@clack/core": "^0.3.3", + "is-unicode-supported": "*", + "picocolors": "^1.0.0", + "sisteransi": "^1.0.5" + } + }, + "node_modules/@clack/prompts/node_modules/is-unicode-supported": { + "version": "1.3.0", + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/@discoveryjs/json-ext": { @@ -736,14 +774,6 @@ "node": ">=6" } }, - "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", @@ -931,18 +961,6 @@ "node": ">=10.13.0" } }, - "node_modules/enquirer": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", - "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", - "dependencies": { - "ansi-colors": "^4.1.1", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8.6" - } - }, "node_modules/envinfo": { "version": "7.10.0", "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz", @@ -1444,8 +1462,7 @@ "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -1643,6 +1660,11 @@ "node": ">=8" } }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + }, "node_modules/source-map": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", @@ -1671,17 +1693,6 @@ "node": ">=0.10.0" } }, - "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", diff --git a/package.json b/package.json index 030e8330..f15f2d54 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "node": ">=18.17.1" }, "dependencies": { - "enquirer": "^2.4.1" + "@clack/prompts": "^0.7.0", + "ansi-colors": "^4.1.3" }, "devDependencies": { "@types/node": "^20.8.7", From 690c65a281011a32e852792aee00a2e8eea8fbb1 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:14:24 -0300 Subject: [PATCH 23/42] feat: update types --- cli/types/available-tags.ts | 6 +++++- cli/types/index.ts | 3 +-- cli/types/subjective-question.ts | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 cli/types/subjective-question.ts diff --git a/cli/types/available-tags.ts b/cli/types/available-tags.ts index 8feec63a..1a40fca4 100644 --- a/cli/types/available-tags.ts +++ b/cli/types/available-tags.ts @@ -1 +1,5 @@ -export type AvailableTags = string[]; +export type AvailableTags = { + value: string; + label: string; + hint?: string; +}; diff --git a/cli/types/index.ts b/cli/types/index.ts index 7d84404b..6c26b526 100644 --- a/cli/types/index.ts +++ b/cli/types/index.ts @@ -1,4 +1,3 @@ export * from "./term"; -export * from "./subjective-questions"; +export * from "./subjective-question"; export * from "./available-tags"; -export * from "./fs"; diff --git a/cli/types/subjective-question.ts b/cli/types/subjective-question.ts new file mode 100644 index 00000000..95fe6a2c --- /dev/null +++ b/cli/types/subjective-question.ts @@ -0,0 +1 @@ +export type SubjectiveQuestion = symbol | string; From b7267f9e6aa529c2f608d8d5067987b9df52e3f8 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:15:02 -0300 Subject: [PATCH 24/42] feat: update domain rules --- cli/core/available-tags.ts | 24 ++++++++++++------------ cli/core/prompt-validations.ts | 12 ++++-------- cli/core/questions.ts | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+), 20 deletions(-) create mode 100644 cli/core/questions.ts diff --git a/cli/core/available-tags.ts b/cli/core/available-tags.ts index 2361e52e..fbeb06ee 100644 --- a/cli/core/available-tags.ts +++ b/cli/core/available-tags.ts @@ -1,14 +1,14 @@ import { AvailableTags } from "../types"; -export const availableTags: AvailableTags = [ - "Back-end", - "Biblioteca", - "Conceito", - "Design", - "Ferramenta", - "Framework", - "Front-end", - "Mobile", - "Paradigma", - "Versionamento", -]; \ No newline at end of file +export const availableTags: AvailableTags[] = [ + { value: "Back-end", label: "Back-end" }, + { value: "Biblioteca", label: "Biblioteca" }, + { value: "Conceito", label: "Conceito", hint: "recommended" }, + { value: "Design", label: "Design" }, + { value: "Ferramenta", label: "Ferramenta" }, + { value: "Framework", label: "Framework" }, + { value: "Front-end", label: "Front-end" }, + { value: "Mobile", label: "Mobile" }, + { value: "Paradigma", label: "Paradigma" }, + { value: "Versionamento", label: "Versionamento" }, +]; diff --git a/cli/core/prompt-validations.ts b/cli/core/prompt-validations.ts index e06e6c5c..8f75b611 100644 --- a/cli/core/prompt-validations.ts +++ b/cli/core/prompt-validations.ts @@ -2,24 +2,20 @@ export const validations = { title: (input: string) => { const raw = input.trim(); - if (raw.trim().length < 2) { - return "O título precisa ter pelo menos 3 caracteres."; + if (raw.trim().length < 1) { + return `O título precisa ter pelo menos 1 caracteres. Você digitou ${raw.length} caracteres.` } - return true; }, description: (input: string) => { const raw = input.trim(); if (raw.length < 10) { - return "A descrição precisa ter pelo menos 10 caracteres."; + return `A descrição precisa ter pelo menos 10 caracteres. Você digitou ${raw.length} caracteres.`; } - - return true; }, tags: (input: string[]) => { if (input.length < 1) { - return "Você precisa selecionar pelo menos uma tag."; + return `Você precisa selecionar pelo menos uma tag. Você selecionou ${input.length} opções.` } - return true; }, }; diff --git a/cli/core/questions.ts b/cli/core/questions.ts new file mode 100644 index 00000000..f19c3b6e --- /dev/null +++ b/cli/core/questions.ts @@ -0,0 +1,18 @@ +import { validations } from "./prompt-validations"; + +export const inputBase = { + required: true, +}; + +export const subjectivePromptQuestions = [ + { + message: "Digite o nome do conceito", + validation: validations.title, + required: true, + }, + { + ...inputBase, + message: "Digite a descrição do conceito", + validation: validations.description + }, +]; From da38239224af1a84aa4137ef3077a3f38686b899 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:18:14 -0300 Subject: [PATCH 25/42] feat: add path to the code file where code snippets for new terms will be placed --- cli/config/code-path.ts | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 cli/config/code-path.ts diff --git a/cli/config/code-path.ts b/cli/config/code-path.ts new file mode 100644 index 00000000..d113bcd6 --- /dev/null +++ b/cli/config/code-path.ts @@ -0,0 +1,3 @@ +import path from "path"; + +export const codePath = path.join(__dirname, "..", "..", "code"); From 3ea95d841089c077d68e35f30d101486c73cabb8 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:22:07 -0300 Subject: [PATCH 26/42] feat: add merge, clack cancel and parse-terms --- cli/utils/handle-cancel.ts | 12 ++++++++++++ cli/utils/merge-item.ts | 4 ++++ cli/utils/parse-terms.ts | 10 ++++++++++ 3 files changed, 26 insertions(+) create mode 100644 cli/utils/handle-cancel.ts create mode 100644 cli/utils/merge-item.ts create mode 100644 cli/utils/parse-terms.ts diff --git a/cli/utils/handle-cancel.ts b/cli/utils/handle-cancel.ts new file mode 100644 index 00000000..efa5470a --- /dev/null +++ b/cli/utils/handle-cancel.ts @@ -0,0 +1,12 @@ +import { cancel, isCancel } from "@clack/prompts"; + +/** + * Handle the user cancelation in the CLI. + */ +export function handleCancelation(value: unknown) { + if (!value) return; + if (isCancel(value)) { + cancel(' Operação cancelada. '); + process.exit(0); + } +} \ No newline at end of file diff --git a/cli/utils/merge-item.ts b/cli/utils/merge-item.ts new file mode 100644 index 00000000..4ccc0d89 --- /dev/null +++ b/cli/utils/merge-item.ts @@ -0,0 +1,4 @@ +/** + * Merge an item into an array of items. + */ +export const merge = (terms: T[], newTerm: T) => [...terms, newTerm]; \ No newline at end of file diff --git a/cli/utils/parse-terms.ts b/cli/utils/parse-terms.ts new file mode 100644 index 00000000..a679656d --- /dev/null +++ b/cli/utils/parse-terms.ts @@ -0,0 +1,10 @@ +import { Term } from "../types"; + +/** + * Parses terms from a JSON and flattens them. + */ +export const parseJSONTerms = (json: string): Term[] => { + const parsedJSON = JSON.parse(json); + const values: Term[] = Object.values(parsedJSON); + return values.flat(); +} \ No newline at end of file From 49b6c31167533d99586c88464ca89706bfc67934 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:23:27 -0300 Subject: [PATCH 27/42] feat: replace enquirer prompts with clack prompts --- cli/io/prompts/confirm.ts | 18 ++++++++++++++++++ cli/io/prompts/multiselect.ts | 26 ++++++++++++++++++++++++++ cli/io/prompts/note.ts | 6 ++++++ cli/io/prompts/text.ts | 21 +++++++++++++++++++++ cli/io/read-file-sync.ts | 6 ++++++ cli/io/write-to-file.ts | 9 +++++++++ 6 files changed, 86 insertions(+) create mode 100644 cli/io/prompts/confirm.ts create mode 100644 cli/io/prompts/multiselect.ts create mode 100644 cli/io/prompts/note.ts create mode 100644 cli/io/prompts/text.ts create mode 100644 cli/io/read-file-sync.ts create mode 100644 cli/io/write-to-file.ts diff --git a/cli/io/prompts/confirm.ts b/cli/io/prompts/confirm.ts new file mode 100644 index 00000000..b6399902 --- /dev/null +++ b/cli/io/prompts/confirm.ts @@ -0,0 +1,18 @@ +import { confirm } from "@clack/prompts"; + +import { handleCancelation } from "../../utils/handle-cancel"; + +/** + * Generic multiselect prompt. Prompts the user for multiple options. + */ +export const confirmPrompt = async (message: string): Promise => { + const shouldContinue = await confirm({ + message: message, + active: 'Sim', + inactive: 'Não', + initialValue: true, + }); + + handleCancelation(shouldContinue); // handle the user cancelation + return shouldContinue; +}; diff --git a/cli/io/prompts/multiselect.ts b/cli/io/prompts/multiselect.ts new file mode 100644 index 00000000..49216099 --- /dev/null +++ b/cli/io/prompts/multiselect.ts @@ -0,0 +1,26 @@ +import c from "ansi-colors"; +import { multiselect } from "@clack/prompts"; + +import { handleCancelation } from "../../utils/handle-cancel"; + +import { AvailableTags } from "../../types"; + + +/** + * Generic multiselect prompt. Prompts the user for multiple options. + */ +export const multiSelect = async ( + message: string, + availableTags: AvailableTags[], + cb: Function +): Promise => { + const tags = await multiselect({ + message: c.cyanBright(message), + options: availableTags, + required: true, + }); + + cb(tags); // callback to validate the tags + handleCancelation(tags); // handle the user cancelation + return tags; +}; diff --git a/cli/io/prompts/note.ts b/cli/io/prompts/note.ts new file mode 100644 index 00000000..529617af --- /dev/null +++ b/cli/io/prompts/note.ts @@ -0,0 +1,6 @@ +import { note as prompt } from "@clack/prompts" + +export const notePrompt = (message: string, title: string) => { + const note = prompt(message, title) + return note +} \ No newline at end of file diff --git a/cli/io/prompts/text.ts b/cli/io/prompts/text.ts new file mode 100644 index 00000000..74e259cb --- /dev/null +++ b/cli/io/prompts/text.ts @@ -0,0 +1,21 @@ + +import { text } from "@clack/prompts"; + +import { handleCancelation } from "../../utils/handle-cancel"; + +import { SubjectiveQuestion } from "../../types"; + +interface QuestionProps { + message: string; + validation: (value: string) => void | string; +} + +export const subjectiveQuestion = async (props: QuestionProps): Promise => { + const prompt = await text({ + message: props.message, + validate: props.validation + }); + + handleCancelation(prompt); + return prompt; +}; \ No newline at end of file diff --git a/cli/io/read-file-sync.ts b/cli/io/read-file-sync.ts new file mode 100644 index 00000000..1b88e3b5 --- /dev/null +++ b/cli/io/read-file-sync.ts @@ -0,0 +1,6 @@ +import fs from 'node:fs'; + +/** + * Reads the content of a file. + */ +export const readFileContents = (path: string) => fs.readFileSync(path).toString(); diff --git a/cli/io/write-to-file.ts b/cli/io/write-to-file.ts new file mode 100644 index 00000000..4b88c33a --- /dev/null +++ b/cli/io/write-to-file.ts @@ -0,0 +1,9 @@ +import fs from 'node:fs'; + +/** + * Writes updated terms to a file. + */ +export const writeToFile = (path: string, content: string): void => { + fs.writeFileSync(path, content); + return; +}; From d67695f4bbcaca4a5033674f02769340f5f843da Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:24:04 -0300 Subject: [PATCH 28/42] feat: file to add code snippet --- code | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 code diff --git a/code b/code new file mode 100644 index 00000000..e69de29b From 44414a791adb376e5efcd352c7d0d39de6e8512e Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:24:53 -0300 Subject: [PATCH 29/42] refactor: move new-term to commands --- cli/index.ts | 71 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 69 deletions(-) diff --git a/cli/index.ts b/cli/index.ts index 0cfd3537..e746c3ff 100644 --- a/cli/index.ts +++ b/cli/index.ts @@ -1,72 +1,5 @@ -import { readFileContents } from "./core/read-file-terms"; -import { writeUpdatedTermsToFile } from "./core/write-new-term"; +import { newTerm } from "./commands/new-term"; -import { cardsPath } from "./config/cards_pt-br-path"; -import { createNewTerm } from "./commands/new-term"; - -import { FileSystem } from "./io/file-system"; - -import { dash } from "./utils/dash"; - -import { IFileSystem, Term } from "./types"; - -/** - * Parses terms from a JSON. - * - * @param {string} json - JSON containing the terms. - * @returns {Array} An array of terms. - */ -const parseJSONTerms = (json: string): Term[] => - (Object.values(JSON.parse(json)) as Term[]).flat(); - -/** - * Adds a new term to an array of existing terms. - * - * @param {Array} terms - An array of existing terms. - * @param {Object} newTerm - The new term to be added. - * @returns {Array} The updated array of terms. - */ -const addNewTermToArray = (terms: Term[], newTerm: Term) => [...terms, newTerm]; - -/** - * Compounds all the steps to write a new term to a file. - * - * @param {Object} newTerm - The term to be written to the file. - * @param {string} filepath - The path of the file to be written. - */ -const composeWriteTermToFile = ( - newTerm: Term, - afs: IFileSystem, - filepath: string -) => - writeUpdatedTermsToFile( - filepath, - addNewTermToArray(parseJSONTerms(readFileContents(filepath, afs)), newTerm), - afs - ); - -const dashed = dash("—")(50); - -const main = async () => { - try { - const afs = new FileSystem(); - composeWriteTermToFile(await createNewTerm(), afs, cardsPath); - console.log(`\n${dashed}`); - console.log(`✔️ Novo termo adicionado com sucesso!`); - console.log(dashed); - } catch (error: unknown) { - console.log(`\n${dashed}`); - console.error("❌ Ocorreu um erro ao adicionar o novo termo."); - console.error("❌ Tente novamente seguindo as instruções."); - console.error( - "❌ Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues." - ); - console.log(dashed); - - if (error instanceof Error) { - console.error(`❌ ${error.message}\n`); - } - } -}; +const main = () => newTerm(); main(); From 64dde14216b6989760ef3fbbf5be0c5a689626e1 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:26:34 -0300 Subject: [PATCH 30/42] feat: create the command to generate a new concept based on the Clack library --- cli/commands/new-term.ts | 136 +++++++++++++++++++++++++++++++++++---- 1 file changed, 125 insertions(+), 11 deletions(-) diff --git a/cli/commands/new-term.ts b/cli/commands/new-term.ts index 573d6ce6..7ca5d7ef 100644 --- a/cli/commands/new-term.ts +++ b/cli/commands/new-term.ts @@ -1,26 +1,140 @@ +import { intro, outro } from '@clack/prompts'; import crypto from "node:crypto"; +import c from 'ansi-colors'; -import { promptMultiSelectTags } from "../io/multiselect-tags"; -import { subjectiveQuestions } from "../io/subjective-questions"; +import { subjectivePromptQuestions } from "../core/questions"; +import { availableTags } from "../core/available-tags"; + +import { multiSelect } from "../io/prompts/multiselect"; +import { subjectiveQuestion } from "../io/prompts/text"; +import { readFileContents } from "../io/read-file-sync"; +import { confirmPrompt } from "../io/prompts/confirm"; +import { writeToFile } from "../io/write-to-file"; +import { notePrompt } from "../io/prompts/note"; + +import { cardsPath } from "../config/cards_pt-br-path"; +import { codePath } from "../config/code-path"; + +import { parseJSONTerms } from "../utils/parse-terms"; +import { merge } from "../utils/merge-item"; + +import { Term } from "../types"; +import fs from "node:fs"; /** * Prompts the user for the term's information. - * @returns {Object} The term's information. - * @throws {Error} If the user doesn't provide the required information. */ -export const createNewTerm = async () => { - const questions = await subjectiveQuestions(); - const tagsPrompt: string[] = await promptMultiSelectTags.run(); +export const createNewTerm = async (): Promise => { + intro(c.bold.bgCyanBright.black(" Olá, boas-vindas ao Diciotech CLI! ")) + + fs.stat(codePath, (err) => { + if (err) { + fs.writeFileSync(codePath, "") + } + }) + + notePrompt( + c.cyanBright(`Antes de começar, precisamos saber se o seu conceito ${c.bold.yellow("possui algum trecho de código")}.\nSe sim, você pode ${c.bold.yellow("escrever o código no arquivo")} ${c.bold.magenta(codePath)}.\nCaso contrário, ${c.bold.yellow("apenas ignore isso e continue")}.`), + c.bold.bgYellow.black(" Importante ") + ) + + const [promptTitle, promptDescription] = subjectivePromptQuestions + + const title = await subjectiveQuestion({ + message: c.cyanBright(promptTitle.message), + validation: promptTitle.validation, + }) + const description = await subjectiveQuestion({ + message: c.cyanBright(promptDescription.message), + validation: promptDescription.validation, + }) + + const tags = await multiSelect( + "Selecione a(s) (tag)s relacionada(s) ao conceito", + availableTags, + (tags: symbol | string[]) => { + if (typeof tags !== 'symbol' && tags.length < 1) { + outro(c.bgRed.black(" Você precisa selecionar pelo menos uma tag. Tente novamente. ")) + process.exit(0); + } + } + ) + + const code = readFileContents(codePath) const card = { id: crypto.randomBytes(16).toString("hex"), - title: questions.title, - description: questions.description, - tags: tagsPrompt, + title: title.toString(), + description: description.toString(), + tags: Array.isArray(tags) ? tags as string[] : [], content: { - code: questions.code, + code: code?.trim(), }, }; + const shouldVisualizeTerm = await confirmPrompt( + c.cyanBright(`Deseja ${c.bold("visualizar")} o novo termo ?`) + ); + + const descriptionVisualized = card.description.length > 60 ? `${card.description.slice(0, 60)}...` : card.description + + if (shouldVisualizeTerm) { + notePrompt( + JSON.stringify({ + title: card.title, + description: descriptionVisualized, + tags: card.tags, + content: { + code: card.content.code.split("\n").filter(line => line !== "") + } + }, null, 2), + c.bold.bgCyanBright.black(" Termo ") + ) + } + + const shouldContinue = await confirmPrompt( + c.cyanBright(`Show! Agora vamos gravar o conceito. ${c.bold("Deseja continuar")} ?`) + ) + + if (!shouldContinue) { + outro(c.bgYellow.black(` Tudo bem! Se quiser tentar novamente, é só rodar o comando ${c.bold('npm run new')}. `)) + process.exit(0); + } + return card; }; + +/** + * Compounds all the steps to write a new term to a file. + */ +const compose = ( + newTerm: Term, + filepath: string +) => + writeToFile( + filepath, + JSON.stringify({ + cards: merge(parseJSONTerms(readFileContents(filepath)), newTerm) + }, null, 2) + ); + +export const newTerm = async () => { + try { + const newTerm = await createNewTerm(); + compose(newTerm, cardsPath); + + writeToFile(codePath, ""); // clear code file + + notePrompt(c.cyanBright(`Se você quiser adicionar mais termos, é só rodar o comando ${c.bold('npm run new')}`), c.bold.bgGreen.black(" Feito ")); + outro(c.green(`Tudo certo! você pode abrir um ${c.bold("Pull Request")} em <${c.bold("https://github.com/levxyca/diciotech/pulls")}>`)) + } catch (error: unknown) { + notePrompt( + c.italic.red(`- Ocorreu um erro ao adicionar o novo termo.\n- Tente novamente seguindo as instruções.\n- Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues.`), + c.bold.bgRedBright.black(" Eita! Algo deu errado :( ") + ) + + if (error instanceof Error) { + outro(c.red(`❌ ${error.message}`)); + } + } +}; \ No newline at end of file From caee84a03be45e3bd689810766c6fb74957d2494 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:29:55 -0300 Subject: [PATCH 31/42] build: generate bundle to run with node --- cli/build/bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/build/bundle.js b/cli/build/bundle.js index 8ca3ea24..c27fecc3 100644 --- a/cli/build/bundle.js +++ b/cli/build/bundle.js @@ -1 +1 @@ -(()=>{var t={730:(t,e,i)=>{"use strict";const s=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,r=()=>{const t={enabled:"undefined"!=typeof process&&"0"!==process.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},e=(t,e,i)=>"function"==typeof t?t(e):t.wrap(e,i),r=(i,s)=>{if(""===i||null==i)return"";if(!1===t.enabled)return i;if(!1===t.visible)return"";let r=""+i,n=r.includes("\n"),a=s.length;for(a>0&&s.includes("unstyle")&&(s=[...new Set(["unstyle",...s])].reverse());a-- >0;)r=e(t.styles[s[a]],r,n);return r},n=(e,i,s)=>{t.styles[e]=(t=>{let e=t.open=`[${t.codes[0]}m`,i=t.close=`[${t.codes[1]}m`,s=t.regex=new RegExp(`\\u001b\\[${t.codes[1]}m`,"g");return t.wrap=(t,r)=>{t.includes(i)&&(t=t.replace(s,i+e));let n=e+t+i;return r?n.replace(/\r*\n/g,`${i}$&${e}`):n},t})({name:e,codes:i}),(t.keys[s]||(t.keys[s]=[])).push(e),Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,set(i){t.alias(e,i)},get(){let i=t=>r(t,i.stack);return Reflect.setPrototypeOf(i,t),i.stack=this.stack?this.stack.concat(e):[e],i}})};return n("reset",[0,0],"modifier"),n("bold",[1,22],"modifier"),n("dim",[2,22],"modifier"),n("italic",[3,23],"modifier"),n("underline",[4,24],"modifier"),n("inverse",[7,27],"modifier"),n("hidden",[8,28],"modifier"),n("strikethrough",[9,29],"modifier"),n("black",[30,39],"color"),n("red",[31,39],"color"),n("green",[32,39],"color"),n("yellow",[33,39],"color"),n("blue",[34,39],"color"),n("magenta",[35,39],"color"),n("cyan",[36,39],"color"),n("white",[37,39],"color"),n("gray",[90,39],"color"),n("grey",[90,39],"color"),n("bgBlack",[40,49],"bg"),n("bgRed",[41,49],"bg"),n("bgGreen",[42,49],"bg"),n("bgYellow",[43,49],"bg"),n("bgBlue",[44,49],"bg"),n("bgMagenta",[45,49],"bg"),n("bgCyan",[46,49],"bg"),n("bgWhite",[47,49],"bg"),n("blackBright",[90,39],"bright"),n("redBright",[91,39],"bright"),n("greenBright",[92,39],"bright"),n("yellowBright",[93,39],"bright"),n("blueBright",[94,39],"bright"),n("magentaBright",[95,39],"bright"),n("cyanBright",[96,39],"bright"),n("whiteBright",[97,39],"bright"),n("bgBlackBright",[100,49],"bgBright"),n("bgRedBright",[101,49],"bgBright"),n("bgGreenBright",[102,49],"bgBright"),n("bgYellowBright",[103,49],"bgBright"),n("bgBlueBright",[104,49],"bgBright"),n("bgMagentaBright",[105,49],"bgBright"),n("bgCyanBright",[106,49],"bgBright"),n("bgWhiteBright",[107,49],"bgBright"),t.ansiRegex=s,t.hasColor=t.hasAnsi=e=>(t.ansiRegex.lastIndex=0,"string"==typeof e&&""!==e&&t.ansiRegex.test(e)),t.alias=(e,i)=>{let s="string"==typeof i?t[i]:i;if("function"!=typeof s)throw new TypeError("Expected alias to be the name of an existing color (string) or a function");s.stack||(Reflect.defineProperty(s,"name",{value:e}),t.styles[e]=s,s.stack=[e]),Reflect.defineProperty(t,e,{configurable:!0,enumerable:!0,set(i){t.alias(e,i)},get(){let e=t=>r(t,e.stack);return Reflect.setPrototypeOf(e,t),e.stack=this.stack?this.stack.concat(s.stack):s.stack,e}})},t.theme=e=>{if(null===(i=e)||"object"!=typeof i||Array.isArray(i))throw new TypeError("Expected theme to be an object");var i;for(let i of Object.keys(e))t.alias(i,e[i]);return t},t.alias("unstyle",(e=>"string"==typeof e&&""!==e?(t.ansiRegex.lastIndex=0,e.replace(t.ansiRegex,"")):"")),t.alias("noop",(t=>t)),t.none=t.clear=t.noop,t.stripColor=t.unstyle,t.symbols=i(142),t.define=n,t};t.exports=r(),t.exports.create=r},142:t=>{"use strict";const e="undefined"!=typeof process&&"Hyper"===process.env.TERM_PROGRAM,i="undefined"!=typeof process&&"win32"===process.platform,s="undefined"!=typeof process&&"linux"===process.platform,r={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},n=Object.assign({},r,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),a=Object.assign({},r,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:s?"▸":"❯",pointerSmall:s?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});t.exports=i&&!e?n:a,Reflect.defineProperty(t.exports,"common",{enumerable:!1,value:r}),Reflect.defineProperty(t.exports,"windows",{enumerable:!1,value:n}),Reflect.defineProperty(t.exports,"other",{enumerable:!1,value:a})},277:t=>{"use strict";t.exports=({onlyFirst:t=!1}={})=>{const e=["[\\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(e,t?void 0:"g")}},31:(t,e,i)=>{"use strict";const s=i(491),r=i(361),n=i(546);class a extends r{constructor(t,e){super(),this.options=n.merge({},t),this.answers={...e}}register(t,e){if(n.isObject(t)){for(let e of Object.keys(t))this.register(e,t[e]);return this}s.equal(typeof e,"function","expected a function");const i=t.toLowerCase();return e.prototype instanceof this.Prompt?this.prompts[i]=e:this.prompts[i]=e(this.Prompt,this),this}async prompt(t=[]){for(let e of[].concat(t))try{"function"==typeof e&&(e=await e.call(this)),await this.ask(n.merge({},this.options,e))}catch(t){return Promise.reject(t)}return this.answers}async ask(t){"function"==typeof t&&(t=await t.call(this));let e=n.merge({},this.options,t),{type:i,name:r}=t,{set:a,get:o}=n;if("function"==typeof i&&(i=await i.call(this,t,this.answers)),!i)return this.answers[r];"number"===i&&(i="numeral"),s(this.prompts[i],`Prompt "${i}" is not registered`);let l=new this.prompts[i](e),h=o(this.answers,r);l.state.answers=this.answers,l.enquirer=this,r&&l.on("submit",(t=>{this.emit("answer",r,t,l),a(this.answers,r,t)}));let c=l.emit.bind(l);return l.emit=(...t)=>(this.emit.call(this,...t),c(...t)),this.emit("prompt",l,this),e.autofill&&null!=h?(l.value=l.input=h,"show"===e.autofill&&await l.submit()):h=l.value=await l.run(),h}use(t){return t.call(this,this),this}set Prompt(t){this._Prompt=t}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(t){this._Prompt=t}static get Prompt(){return this._Prompt||i(232)}static get prompts(){return i(594)}static get types(){return i(920)}static get prompt(){const t=(e,...i)=>{let s=new this(...i),r=s.emit.bind(s);return s.emit=(...e)=>(t.emit(...e),r(...e)),s.prompt(e)};return n.mixinEmitter(t,new r),t}}n.mixinEmitter(a,new r);const o=a.prompts;for(let t of Object.keys(o)){let e=t.toLowerCase(),i=e=>new o[t](e).run();a.prompt[e]=i,a[e]=i,a[t]||Reflect.defineProperty(a,t,{get:()=>o[t]})}const l=t=>{n.defineExport(a,t,(()=>a.types[t]))};l("ArrayPrompt"),l("AuthPrompt"),l("BooleanPrompt"),l("NumberPrompt"),l("StringPrompt"),t.exports=a},907:(t,e,i)=>{"use strict";const s="Apple_Terminal"===process.env.TERM_PROGRAM,r=i(3),n=i(546),a=t.exports=e,o="[";let l=!1;const h=a.code={bell:"",beep:"",beginning:`${o}G`,down:`${o}J`,esc:o,getPosition:`${o}6n`,hide:`${o}?25l`,line:`${o}2K`,lineEnd:`${o}K`,lineStart:`${o}1K`,restorePosition:o+(s?"8":"u"),savePosition:o+(s?"7":"s"),screen:`${o}2J`,show:`${o}?25h`,up:`${o}1J`},c=a.cursor={get hidden(){return l},hide:()=>(l=!0,h.hide),show:()=>(l=!1,h.show),forward:(t=1)=>`${o}${t}C`,backward:(t=1)=>`${o}${t}D`,nextLine:(t=1)=>`${o}E`.repeat(t),prevLine:(t=1)=>`${o}F`.repeat(t),up:(t=1)=>t?`${o}${t}A`:"",down:(t=1)=>t?`${o}${t}B`:"",right:(t=1)=>t?`${o}${t}C`:"",left:(t=1)=>t?`${o}${t}D`:"",to:(t,e)=>e?`${o}${e+1};${t+1}H`:`${o}${t+1}G`,move(t=0,e=0){let i="";return i+=t<0?c.left(-t):t>0?c.right(t):"",i+=e<0?c.up(-e):e>0?c.down(e):"",i},strLen(t){for(var e=0,i=t.length,s=-1,r=0;r=0&&s<=128?1:2;return e},restore(t={}){let{after:e,cursor:i,initial:s,input:r,prompt:o,size:l,value:h}=t;if(s=n.isPrimitive(s)?String(s):"",r=n.isPrimitive(r)?String(r):"",h=n.isPrimitive(h)?String(h):"",l){let t=a.cursor.up(l)+a.cursor.to(this.strLen(o)),e=r.length-i;return e>0&&(t+=a.cursor.left(e)),t}if(h||e){let t=!r&&s?-this.strLen(s):-this.strLen(r)+i;return e&&(t-=this.strLen(e)),""===r&&s&&!o.includes(s)&&(t+=this.strLen(s)),a.cursor.move(t)}}},u=a.erase={screen:h.screen,up:h.up,down:h.down,line:h.line,lineEnd:h.lineEnd,lineStart:h.lineStart,lines(t){let e="";for(let i=0;i{if(!e)return u.line+c.to(0);let i=t.split(/\r?\n/),s=0;for(let t of i)s+=1+Math.floor(Math.max([...r(t)].length-1,0)/e);return(u.line+c.prevLine()).repeat(s-1)+u.line+c.to(0)}},726:(t,e)=>{"use strict";e.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"},e.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"},e.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"},e.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"},e.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}},736:t=>{"use strict";const e=t=>(t=>t.filter(((e,i)=>t.lastIndexOf(e)===i)))(t).filter(Boolean);t.exports=(t,i={},s="")=>{let r,n,{past:a=[],present:o=""}=i;switch(t){case"prev":case"undo":return r=a.slice(0,a.length-1),n=a[a.length-1]||"",{past:e([s,...r]),present:n};case"next":case"redo":return r=a.slice(1),n=a[0]||"",{past:e([...r,s]),present:n};case"save":return{past:e([...a,s]),present:""};case"remove":return n=e(a.filter((t=>t!==s))),o="",n.length&&(o=n.pop()),{past:n,present:o};default:throw new Error(`Invalid action: "${t}"`)}}},189:(t,e,i)=>{"use strict";const s=i(3);class r{constructor(t){this.name=t.key,this.field=t.field||{},this.value=((t="")=>"string"==typeof t?t.replace(/^['"]|['"]$/g,""):"")(t.initial||this.field.initial||""),this.message=t.message||this.name,this.cursor=0,this.input="",this.lines=[]}}function n(t,e,i,s){return(i,r,n,a)=>"function"==typeof n.field[t]?n.field[t].call(e,i,r,n,a):[s,i].find((t=>e.isValue(t)))}t.exports=async t=>{let e=t.options,i=new Set(!0===e.required?[]:e.required||[]),a={...e.values,...e.initial},{tabstops:o,items:l,keys:h}=await(async(t={},e={},i=(t=>t))=>{let s=new Set,n=t.fields||[],a=t.template,o=[],l=[],h=[],c=1;"function"==typeof a&&(a=await a());let u=-1,d=()=>a[++u],p=()=>a[u+1],m=t=>{t.line=c,o.push(t)};for(m({type:"bos",value:""});ut.name===o.key));o.field=n.find((t=>t.name===o.key)),c||(c=new r(o),l.push(c)),c.lines.push(o.line-1);continue}let a=o[o.length-1];"text"===a.type&&a.line===c?a.value+=t:m({type:"text",value:t})}return m({type:"eos",value:""}),{input:a,tabstops:o,unique:s,keys:h,items:l}})(e,a),c=n("result",t),u=n("format",t),d=n("validate",t,0,!0),p=t.isValue.bind(t);return async(r={},n=!1)=>{let a=0;r.required=i,r.items=l,r.keys=h,r.output="";let m=async(t,e,i,s)=>{let r=await d(t,e,i,s);return!1===r?"Invalid field "+i.name:r};for(let i of o){let o=i.value,h=i.key;if("template"===i.type){if("template"===i.type){let d=l.find((t=>t.name===h));!0===e.required&&r.required.add(d.name);let f=[d.input,r.values[d.value],d.value,o].find(p),g=(d.field||{}).message||i.inner;if(n){let t=await m(r.values[h],r,d,a);if(t&&"string"==typeof t||!1===t){r.invalid.set(h,t);continue}r.invalid.delete(h);let e=await c(r.values[h],r,d,a);r.output+=s(e);continue}d.placeholder=!1;let y=o;o=await u(o,r,d,a),f!==o?(r.values[h]=f,o=t.styles.typing(f),r.missing.delete(g)):(r.values[h]=void 0,f=`<${g}>`,o=t.styles.primary(f),d.placeholder=!0,r.required.has(h)&&r.missing.add(g)),r.missing.has(g)&&r.validating&&(o=t.styles.warning(f)),r.invalid.has(h)&&r.validating&&(o=t.styles.danger(f)),a===r.index&&(o=y!==o?t.styles.underline(o):t.styles.heading(s(o))),a++}o&&(r.output+=o)}else o&&(r.output+=o)}let f=r.output.split("\n").map((t=>" "+t)),g=l.length,y=0;for(let e of l)r.invalid.has(e.name)&&e.lines.forEach((t=>{" "===f[t][0]&&(f[t]=r.styles.danger(r.symbols.bullet)+f[t].slice(1))})),t.isValue(r.values[e.name])&&y++;return r.completed=(y/g*100).toFixed(0),r.output=f.join("\n"),r.output}}},914:(t,e,i)=>{"use strict";const s=i(521),r=i(726),n=i(607),a=/^(?:\x1b)([a-zA-Z0-9])$/,o=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,l={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"},h=(t="",e={})=>{let i,s={name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:t,raw:t,...e};if(Buffer.isBuffer(t)?t[0]>127&&void 0===t[1]?(t[0]-=128,t=""+String(t)):t=String(t):void 0!==t&&"string"!=typeof t?t=String(t):t||(t=s.sequence||""),s.sequence=s.sequence||t||s.name,"\r"===t)s.raw=void 0,s.name="return";else if("\n"===t)s.name="enter";else if("\t"===t)s.name="tab";else if("\b"===t||""===t||""===t||"\b"===t)s.name="backspace",s.meta=""===t.charAt(0);else if(""===t||""===t)s.name="escape",s.meta=2===t.length;else if(" "===t||" "===t)s.name="space",s.meta=2===t.length;else if(t<="")s.name=String.fromCharCode(t.charCodeAt(0)+"a".charCodeAt(0)-1),s.ctrl=!0;else if(1===t.length&&t>="0"&&t<="9")s.name="number";else if(1===t.length&&t>="a"&&t<="z")s.name=t;else if(1===t.length&&t>="A"&&t<="Z")s.name=t.toLowerCase(),s.shift=!0;else if(i=a.exec(t))s.meta=!0,s.shift=/^[A-Z]$/.test(i[1]);else if(i=o.exec(t)){let e=[...t];""===e[0]&&""===e[1]&&(s.option=!0);let r=[i[1],i[2],i[4],i[6]].filter(Boolean).join(""),n=(i[3]||i[5]||1)-1;s.ctrl=!!(4&n),s.meta=!!(10&n),s.shift=!!(1&n),s.code=r,s.name=l[r],s.shift=function(t){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(t)}(r)||s.shift,s.ctrl=function(t){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(t)}(r)||s.ctrl}return s};h.listen=(t={},e)=>{let{stdin:i}=t;if(!i||i!==process.stdin&&!i.isTTY)throw new Error("Invalid stream passed");let r=s.createInterface({terminal:!0,input:i});s.emitKeypressEvents(i,r);const a=new n(((t,i)=>e(t,h(t,i),r)));let o=i.isRaw;return i.isTTY&&i.setRawMode(!0),i.on("keypress",a.enqueue),r.resume(),()=>{i.isTTY&&i.setRawMode(o),i.removeListener("keypress",a.enqueue),a.destroy(),r.pause(),r.close()}},h.action=(t,e,i)=>{let s={...r,...i};return e.ctrl?(e.action=s.ctrl[e.name],e):e.option&&s.option?(e.action=s.option[e.name],e):e.shift?(e.action=s.shift[e.name],e):(e.action=s.keys[e.name],e)},t.exports=h},786:(t,e,i)=>{"use strict";const s=i(546);t.exports=(t,e={})=>{t.cursorHide();let{input:i="",initial:r="",pos:n,showCursor:a=!0,color:o}=e,l=o||t.styles.placeholder,h=s.inverse(t.styles.primary),c=e=>h(t.styles.black(e)),u=i,d=c(" ");if(t.blink&&!0===t.blink.off&&(c=t=>t,d=""),a&&0===n&&""===r&&""===i)return c(" ");if(a&&0===n&&(i===r||""===i))return c(r[0])+l(r.slice(1));r=s.isPrimitive(r)?`${r}`:"",i=s.isPrimitive(i)?`${i}`:"";let p=r&&r.startsWith(i)&&r!==i,m=p?c(r[i.length]):d;if(n!==i.length&&!0===a&&(u=i.slice(0,n)+c(i[n])+i.slice(n+1),m=""),!1===a&&(m=""),p){let e=t.styles.unstyle(u+m);return u+m+l(r.slice(e.length))}return u+m}},232:(t,e,i)=>{"use strict";const s=i(361),r=i(3),n=i(914),a=i(940),o=i(873),l=i(227),h=i(546),c=i(907);class u extends s{constructor(t={}){super(),this.name=t.name,this.type=t.type,this.options=t,l(this),a(this),this.state=new o(this),this.initial=[t.initial,t.default].find((t=>null!=t)),this.stdout=t.stdout||process.stdout,this.stdin=t.stdin||process.stdin,this.scale=t.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=function(t){"number"==typeof t&&(t=[t,t,t,t]);let e=[].concat(t||[]),i=t=>t%2==0?"\n":" ",s=[];for(let t=0;t<4;t++){let r=i(t);e[t]?s.push(r.repeat(e[t])):s.push("")}return s}(this.options.margin),this.setMaxListeners(0),function(t){let e=e=>void 0===t[e]||"function"==typeof t[e],i=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],s=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let r of Object.keys(t.options)){if(i.includes(r))continue;if(/^on[A-Z]/.test(r))continue;let n=t.options[r];"function"==typeof n&&e(r)?s.includes(r)||(t[r]=n.bind(t)):"function"!=typeof t[r]&&(t[r]=n)}}(this)}async keypress(t,e={}){this.keypressed=!0;let i=n.action(t,n(t,e),this.options.actions);this.state.keypress=i,this.emit("keypress",t,i),this.emit("state",this.state.clone());const s=this.options[i.action]||this[i.action]||this.dispatch;if("function"==typeof s)return await s.call(this,t,i);this.alert()}alert(){delete this.state.alert,!1===this.options.show?this.emit("alert"):this.stdout.write(c.code.beep)}cursorHide(){this.stdout.write(c.cursor.hide());const t=h.onExit((()=>this.cursorShow()));this.on("close",(()=>{this.cursorShow(),t()}))}cursorShow(){this.stdout.write(c.cursor.show())}write(t){t&&(this.stdout&&!1!==this.state.show&&this.stdout.write(t),this.state.buffer+=t)}clear(t=0){let e=this.state.buffer;this.state.buffer="",(e||t)&&!1!==this.options.show&&this.stdout.write(c.cursor.down(t)+c.clear(e,this.width))}restore(){if(this.state.closed||!1===this.options.show)return;let{prompt:t,after:e,rest:i}=this.sections(),{cursor:s,initial:r="",input:n="",value:a=""}=this,o={after:e,cursor:s,initial:r,input:n,prompt:t,size:this.state.size=i.length,value:a},l=c.cursor.restore(o);l&&this.stdout.write(l)}sections(){let{buffer:t,input:e,prompt:i}=this.state;i=r(i);let s=r(t),n=s.indexOf(i),a=s.slice(0,n),o=s.slice(n).split("\n"),l=o[0],h=o[o.length-1],c=(i+(e?" "+e:"")).length,u=ct.call(this,this.value),this.result=()=>i.call(this,this.value),"function"==typeof e.initial&&(this.initial=await e.initial.call(this,this)),"function"==typeof e.onRun&&await e.onRun.call(this,this),"function"==typeof e.onSubmit){let t=e.onSubmit.bind(this),i=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await t(this.name,this.value,this),i())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise((async(t,e)=>{if(this.once("submit",t),this.once("cancel",e),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")}))}async element(t,e,i){let{options:s,state:r,symbols:n,timers:a}=this,o=a&&a[t];r.timer=o;let l=s[t]||r[t]||n[t],h=e&&null!=e[t]?e[t]:await l;if(""===h)return h;let c=await this.resolve(h,r,e,i);return!c&&e&&e[t]?this.resolve(l,r,e,i):c}async prefix(){let t=await this.element("prefix")||this.symbols,e=this.timers&&this.timers.prefix,i=this.state;return i.timer=e,h.isObject(t)&&(t=t[i.status]||t.pending),h.hasColor(t)?t:(this.styles[i.status]||this.styles.pending)(t)}async message(){let t=await this.element("message");return h.hasColor(t)?t:this.styles.strong(t)}async separator(){let t=await this.element("separator")||this.symbols,e=this.timers&&this.timers.separator,i=this.state;i.timer=e;let s=t[i.status]||t.pending||i.separator,r=await this.resolve(s,i);return h.isObject(r)&&(r=r[i.status]||r.pending),h.hasColor(r)?r:this.styles.muted(r)}async pointer(t,e){let i=await this.element("pointer",t,e);if("string"==typeof i&&h.hasColor(i))return i;if(i){let t=this.styles,s=this.index===e,r=s?t.primary:t=>t,n=await this.resolve(i[s?"on":"off"]||i,this.state),a=h.hasColor(n)?n:r(n);return s?a:" ".repeat(n.length)}}async indicator(t,e){let i=await this.element("indicator",t,e);if("string"==typeof i&&h.hasColor(i))return i;if(i){let e=this.styles,s=!0===t.enabled,r=s?e.success:e.dark,n=i[s?"on":"off"]||i;return h.hasColor(n)?n:r(n)}return""}body(){return null}footer(){if("pending"===this.state.status)return this.element("footer")}header(){if("pending"===this.state.status)return this.element("header")}async hint(){if("pending"===this.state.status&&!this.isValue(this.state.input)){let t=await this.element("hint");return h.hasColor(t)?t:this.styles.muted(t)}}error(t){return this.state.submitted?"":t||this.state.error}format(t){return t}result(t){return t}validate(t){return!0!==this.options.required||this.isValue(t)}isValue(t){return null!=t&&""!==t}resolve(t,...e){return h.resolve(this,t,...e)}get base(){return u.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||h.height(this.stdout,25)}get width(){return this.options.columns||h.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(t){this.state.cursor=t}get cursor(){return this.state.cursor}set input(t){this.state.input=t}get input(){return this.state.input}set value(t){this.state.value=t}get value(){let{input:t,value:e}=this.state,i=[e,t].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return t=>new this(t).run()}}t.exports=u},317:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){super(t),this.cursorShow()}moveCursor(t){this.state.cursor+=t}dispatch(t){return this.append(t)}space(t){return this.options.multiple?super.space(t):this.append(t)}append(t){let{cursor:e,input:i}=this.state;return this.input=i.slice(0,e)+t+i.slice(e),this.moveCursor(1),this.complete()}delete(){let{cursor:t,input:e}=this.state;return e?(this.input=e.slice(0,t-1)+e.slice(t),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:t,input:e}=this.state;return void 0===e[t]?this.alert():(this.input=`${e}`.slice(0,t)+`${e}`.slice(t+1),this.complete())}number(t){return this.append(t)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(t=this.input,e=this.state._choices){if("function"==typeof this.options.suggest)return this.options.suggest.call(this,t,e);let i=t.toLowerCase();return e.filter((t=>t.message.toLowerCase().includes(i)))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map((t=>this.styles.primary(t.message))).join(", ");if(this.state.submitted){let t=this.value=this.input=this.focused.value;return this.styles.primary(t)}return this.input}async render(){if("pending"!==this.state.status)return super.render();const t=this.options.highlight||this.styles.complement,e=((t,e)=>{const i=t?new RegExp(t,"ig"):/$^/;return s=>t?s.replace(i,(t=>e(t))):s})(this.input,((e,i)=>e?t.stack?t(e):t.call(this,e):e)),i=this.choices;this.choices=i.map((t=>({...t,message:e(t.message)}))),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map((t=>t.name))),super.submit()}}},186:(t,e,i)=>{"use strict";const s=i(926);function r(t,e){return t.username===this.options.username&&t.password===this.options.password}const n=(t=r)=>{const e=[{name:"username",message:"username"},{name:"password",message:"password",format(t){return this.options.showPassword?t:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(t.length))}}];class i extends(s.create(t)){constructor(t){super({...t,choices:e})}static create(t){return n(t)}}return i};t.exports=n()},291:(t,e,i)=>{"use strict";const s=i(838);t.exports=class extends s{constructor(t){super(t),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}}},848:(t,e,i)=>{"use strict";const s=i(466),r=i(826).prototype;t.exports=class extends s{constructor(t){super({...t,multiple:!0}),this.align=[this.options.align,"left"].find((t=>null!=t)),this.emptyError="",this.values={}}dispatch(t,e){let i=this.focused,s=i.parent||{};return i.editable||s.editable||"a"!==t&&"i"!==t?r.dispatch.call(this,t,e):super[t]()}append(t,e){return r.append.call(this,t,e)}delete(t,e){return r.delete.call(this,t,e)}space(t){return this.focused.editable?this.append(t):super.space()}number(t){return this.focused.editable?this.append(t):super.number(t)}next(){return this.focused.editable?r.next.call(this):super.next()}prev(){return this.focused.editable?r.prev.call(this):super.prev()}async indicator(t,e){let i=t.indicator||"",s=t.editable?i:super.indicator(t,e);return await this.resolve(s,this.state,t,e)||""}indent(t){return"heading"===t.role?"":t.editable?" ":" "}async renderChoice(t,e){return t.indent="",t.editable?r.renderChoice.call(this,t,e):super.renderChoice(t,e)}error(){return""}footer(){return this.state.error}async validate(){let t=!0;for(let e of this.choices){if("function"!=typeof e.validate)continue;if("heading"===e.role)continue;let i=e.parent?this.value[e.parent.name]:this.value;if(e.editable?i=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(i=!0===e.enabled),t=await e.validate(i,this.state),!0!==t)break}return!0!==t&&(this.state.error="string"==typeof t?t:"Invalid Input"),t}submit(){if(!0===this.focused.newChoice)return super.submit();if(this.choices.some((t=>t.newChoice)))return this.alert();this.value={};for(let t of this.choices){let e=t.parent?this.value[t.parent.name]:this.value;"heading"!==t.role?t.editable?e[t.name]=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(e[t.name]=!0===t.enabled):this.value[t.name]={}}return this.base.submit.call(this)}}},826:(t,e,i)=>{"use strict";const s=i(3),r=i(466),n=i(786);t.exports=class extends r{constructor(t){super({...t,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find((t=>null!=t)),this.emptyError="",this.values={}}async reset(t){return await super.reset(),!0===t&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach((t=>t.reset&&t.reset())),this.render()}dispatch(t){return!!t&&this.append(t)}append(t){let e=this.focused;if(!e)return this.alert();let{cursor:i,input:s}=e;return e.value=e.input=s.slice(0,i)+t+s.slice(i),e.cursor++,this.render()}delete(){let t=this.focused;if(!t||t.cursor<=0)return this.alert();let{cursor:e,input:i}=t;return t.value=t.input=i.slice(0,e-1)+i.slice(e),t.cursor--,this.render()}deleteForward(){let t=this.focused;if(!t)return this.alert();let{cursor:e,input:i}=t;if(void 0===i[e])return this.alert();let s=`${i}`.slice(0,e)+`${i}`.slice(e+1);return t.value=t.input=s,this.render()}right(){let t=this.focused;return t?t.cursor>=t.input.length?this.alert():(t.cursor++,this.render()):this.alert()}left(){let t=this.focused;return t?t.cursor<=0?this.alert():(t.cursor--,this.render()):this.alert()}space(t,e){return this.dispatch(t,e)}number(t,e){return this.dispatch(t,e)}next(){let t=this.focused;if(!t)return this.alert();let{initial:e,input:i}=t;return e&&e.startsWith(i)&&i!==e?(t.value=t.input=e,t.cursor=t.value.length,this.render()):super.next()}prev(){let t=this.focused;return t?0===t.cursor?super.prev():(t.value=t.input="",t.cursor=0,this.render()):this.alert()}separator(){return""}format(t){return this.state.submitted?"":super.format(t)}pointer(){return""}indicator(t){return t.input?"⦿":"⊙"}async choiceSeparator(t,e){let i=await this.resolve(t.separator,this.state,t,e)||":";return i?" "+this.styles.disabled(i):""}async renderChoice(t,e){await this.onChoice(t,e);let{state:i,styles:r}=this,{cursor:a,initial:o="",name:l,input:h=""}=t,{muted:c,submitted:u,primary:d,danger:p}=r,m=this.index===e,f=t.validate||(()=>!0),g=await this.choiceSeparator(t,e),y=t.message;"right"===this.align&&(y=y.padStart(this.longest+1," ")),"left"===this.align&&(y=y.padEnd(this.longest+1," "));let b=this.values[l]=h||o,w=h?"success":"dark";!0!==await f.call(t,b,this.state)&&(w="danger");let v=(0,r[w])(await this.indicator(t,e))+(t.pad||""),x=this.indent(t),k=()=>[x,v,y+g,h].filter(Boolean).join(" ");if(i.submitted)return y=s(y),h=u(h),k();if(t.format)h=await t.format.call(this,h,t,e);else{let t=this.styles.muted;h=n(this,{input:h,initial:o,pos:a,showCursor:m,color:t})}return this.isValue(h)||(h=this.styles.muted(this.symbols.ellipsis)),t.result&&(this.values[l]=await t.result.call(this,b,t,e)),m&&(y=d(y)),t.error?h+=(h?" ":"")+p(t.error.trim()):t.hint&&(h+=(h?" ":"")+c(t.hint.trim())),k()}async submit(){return this.value=this.values,super.base.submit.call(this)}}},594:(t,e,i)=>{"use strict";const s=i(546),r=(t,i)=>{s.defineExport(e,t,i),s.defineExport(e,t.toLowerCase(),i)};r("AutoComplete",(()=>i(317))),r("BasicAuth",(()=>i(186))),r("Confirm",(()=>i(291))),r("Editable",(()=>i(848))),r("Form",(()=>i(826))),r("Input",(()=>i(719))),r("Invisible",(()=>i(822))),r("List",(()=>i(795))),r("MultiSelect",(()=>i(56))),r("Numeral",(()=>i(403))),r("Password",(()=>i(847))),r("Scale",(()=>i(813))),r("Select",(()=>i(466))),r("Snippet",(()=>i(451))),r("Sort",(()=>i(144))),r("Survey",(()=>i(755))),r("Text",(()=>i(781))),r("Toggle",(()=>i(653))),r("Quiz",(()=>i(249)))},719:(t,e,i)=>{"use strict";const s=i(391),r=i(736);t.exports=class extends s{constructor(t){super(t);let e=this.options.history;if(e&&e.store){let t=e.values||this.initial;this.autosave=!!e.autosave,this.store=e.store,this.data=this.store.get("values")||{past:[],present:t},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(t){return this.store?(this.data=r(t,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=r("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&!0===this.autosave&&this.save(),super.submit()}}},822:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{format(){return""}}},795:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t={}){super(t),this.sep=this.options.separator||/, */,this.initial=t.initial||""}split(t=this.value){return t?String(t).split(this.sep):[]}format(){let t=this.state.submitted?this.styles.primary:t=>t;return this.list.map(t).join(", ")}async submit(t){let e=this.state.error||await this.validate(this.list,this.state);return!0!==e?(this.state.error=e,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}}},56:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){super({...t,multiple:!0})}}},403:(t,e,i)=>{t.exports=i(376)},847:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t){super(t),this.cursorShow()}format(t=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(t.length)):""}}},249:(t,e,i)=>{"use strict";const s=i(466);t.exports=class extends s{constructor(t){if(super(t),"number"!=typeof this.options.correctChoice||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(t,e){let i=await super.toChoices(t,e);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}check(t){return t.index===this.options.correctChoice}async result(t){return{selectedAnswer:t,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}}},813:(t,e,i)=>{"use strict";const s=i(3),r=i(575),n=i(546);t.exports=class extends r{constructor(t={}){super(t),this.widths=[].concat(t.messageWidth||50),this.align=[].concat(t.align||"left"),this.linebreak=t.linebreak||!1,this.edgeLength=t.edgeLength||3,this.newline=t.newline||"\n ";let e=t.startNumber||1;"number"==typeof this.scale&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map(((t,i)=>({name:i+e}))))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(!0===this.tableized)return;this.tableized=!0;let t=0;for(let e of this.choices){t=Math.max(t,e.message.length),e.scaleIndex=e.initial||2,e.scale=[];for(let t=0;t=this.scale.length-1?this.alert():(t.scaleIndex++,this.render())}left(){let t=this.focused;return t.scaleIndex<=0?this.alert():(t.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map((t=>this.styles.info(t.index))).join(", "):""}pointer(){return""}renderScaleKey(){return!1===this.scaleKey||this.state.submitted?"":["",...this.scale.map((t=>` ${t.name} - ${t.message}`))].map((t=>this.styles.muted(t))).join("\n")}renderScaleHeading(t){let e=this.scale.map((t=>t.name));"function"==typeof this.options.renderScaleHeading&&(e=this.options.renderScaleHeading.call(this,t));let i=this.scaleLength-e.join("").length,s=Math.round(i/(e.length-1)),r=e.map((t=>this.styles.strong(t))).join(" ".repeat(s)),n=" ".repeat(this.widths[0]);return this.margin[3]+n+this.margin[1]+r}scaleIndicator(t,e,i){if("function"==typeof this.options.scaleIndicator)return this.options.scaleIndicator.call(this,t,e,i);let s=t.scaleIndex===e.index;return e.disabled?this.styles.hint(this.symbols.radio.disabled):s?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(t,e){let i=t.scale.map((i=>this.scaleIndicator(t,i,e))),s="Hyper"===this.term?"":" ";return i.join(s+this.symbols.line.repeat(this.edgeLength))}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,r=await this.pointer(t,e),a=await t.hint;a&&!n.hasColor(a)&&(a=this.styles.muted(a));let o=t=>this.margin[3]+t.replace(/\s+$/,"").padEnd(this.widths[0]," "),l=this.newline,h=this.indent(t),c=await this.resolve(t.message,this.state,t,e),u=await this.renderScale(t,e),d=this.margin[1]+this.margin[3];this.scaleLength=s(u).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-d.length);let p=n.wordWrap(c,{width:this.widths[0],newline:l}).split("\n").map((t=>o(t)+this.margin[1]));return i&&(u=this.styles.info(u),p=p.map((t=>this.styles.info(t)))),p[0]+=u,this.linebreak&&p.push(""),[h+r,p.join("\n")].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t),i=await this.renderScaleHeading();return this.margin[0]+[i,...e.map((t=>t.join(" ")))].join("\n")}async render(){let{submitted:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=await this.message(),n="";!1!==this.options.promptLine&&(n=[i,r,s,""].join(" "),this.state.prompt=n);let a=await this.header(),o=await this.format(),l=await this.renderScaleKey(),h=await this.error()||await this.hint(),c=await this.renderChoices(),u=await this.footer(),d=this.emptyError;o&&(n+=o),h&&!n.includes(h)&&(n+=" "+h),t&&!o&&!c.trim()&&this.multiple&&null!=d&&(n+=this.styles.danger(d)),this.clear(e),this.write([a,n,l,c,u].filter(Boolean).join("\n")),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIndex;return this.base.submit.call(this)}}},466:(t,e,i)=>{"use strict";const s=i(575),r=i(546);t.exports=class extends s{constructor(t){super(t),this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(t,e){if(this.multiple)return this[e.name]?await this[e.name](t,e):await super.dispatch(t,e);this.alert()}separator(){if(this.options.separator)return super.separator();let t=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():t}pointer(t,e){return!this.multiple||this.options.pointer?super.pointer(t,e):""}indicator(t,e){return this.multiple?super.indicator(t,e):""}choiceMessage(t,e){let i=this.resolve(t.message,this.state,t,e);return"heading"!==t.role||r.hasColor(i)||(i=this.styles.strong(i)),this.resolve(i,this.state,t,e)}choiceSeparator(){return":"}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,s=await this.pointer(t,e),n=await this.indicator(t,e)+(t.pad||""),a=await this.resolve(t.hint,this.state,t,e);a&&!r.hasColor(a)&&(a=this.styles.muted(a));let o=this.indent(t),l=await this.choiceMessage(t,e),h=()=>[this.margin[3],o+s+n,l,this.margin[1],a].filter(Boolean).join(" ");return"heading"===t.role?h():t.disabled?(r.hasColor(l)||(l=this.styles.disabled(l)),h()):(i&&(l=this.styles.em(l)),h())}async renderChoices(){if("choices"===this.state.loading)return this.styles.warning("Loading choices");if(this.state.submitted)return"";let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t);e.length||e.push(this.styles.danger("No matching choices"));let i,s=this.margin[0]+e.join("\n");return this.options.choicesHeader&&(i=await this.resolve(this.options.choicesHeader,this.state)),[i,s].filter(Boolean).join("\n")}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map((t=>this.styles.primary(t.name))).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:t,size:e}=this.state,i="",s=await this.header(),r=await this.prefix(),n=await this.separator(),a=await this.message();!1!==this.options.promptLine&&(i=[r,a,n,""].join(" "),this.state.prompt=i);let o=await this.format(),l=await this.error()||await this.hint(),h=await this.renderChoices(),c=await this.footer();o&&(i+=o),l&&!i.includes(l)&&(i+=" "+l),t&&!o&&!h.trim()&&this.multiple&&null!=this.emptyError&&(i+=this.styles.danger(this.emptyError)),this.clear(e),this.write([s,i,h,c].filter(Boolean).join("\n")),this.write(this.margin[2]),this.restore()}}},451:(t,e,i)=>{"use strict";const s=i(3),r=i(189),n=i(232);t.exports=class extends n{constructor(t){super(t),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await r(this),await super.initialize()}async reset(t){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},!0!==t&&(await this.initialize(),await this.render())}moveCursor(t){let e=this.getItem();this.cursor+=t,e.cursor+=t}dispatch(t,e){e.code||e.ctrl||null==t||!this.getItem()?this.alert():this.append(t,e)}append(t,e){let i=this.getItem(),s=i.input.slice(0,this.cursor),r=i.input.slice(this.cursor);this.input=i.input=`${s}${t}${r}`,this.moveCursor(1),this.render()}delete(){let t=this.getItem();if(this.cursor<=0||!t.input)return this.alert();let e=t.input.slice(this.cursor),i=t.input.slice(0,this.cursor-1);this.input=t.input=`${i}${e}`,this.moveCursor(-1),this.render()}increment(t){return t>=this.state.keys.length-1?0:t+1}decrement(t){return t<=0?this.state.keys.length-1:t-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(t){let e=this.state.completed<100?this.styles.warning:this.styles.success;return!0===this.state.submitted&&100!==this.state.completed&&(e=this.styles.danger),e(`${this.state.completed}% completed`)}async render(){let{index:t,keys:e=[],submitted:i,size:s}=this.state,r=[this.options.newline,"\n"].find((t=>null!=t)),n=await this.prefix(),a=await this.separator(),o=[n,await this.message(),a].filter(Boolean).join(" ");this.state.prompt=o;let l=await this.header(),h=await this.error()||"",c=await this.hint()||"",u=i?"":await this.interpolate(this.state),d=this.state.key=e[t]||"",p=await this.format(d),m=await this.footer();p&&(o+=" "+p),c&&!p&&0===this.state.completed&&(o+=" "+c),this.clear(s);let f=[l,o,u,m,h.trim()];this.write(f.filter(Boolean).join(r)),this.restore()}getItem(t){let{items:e,keys:i,index:s}=this.state,r=e.find((t=>t.name===i[s]));return r&&null!=r.input&&(this.input=r.input,this.cursor=r.cursor),r}async submit(){"function"!=typeof this.interpolate&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:t,missing:e,output:i,values:r}=this.state;if(t.size){let e="";for(let[i,s]of t)e+=`Invalid ${i}: ${s}\n`;return this.state.error=e,super.submit()}if(e.size)return this.state.error="Required: "+[...e.keys()].join(", "),super.submit();let n=s(i).split("\n").map((t=>t.slice(1))).join("\n");return this.value={values:r,result:n},super.submit()}}},144:(t,e,i)=>{"use strict";const s="(Use + to sort)",r=i(466);t.exports=class extends r{constructor(t){super({...t,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,s].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(t,e){let i=await super.renderChoice(t,e),s=this.symbols.identicalTo+" ",r=this.index===e&&this.sorting?this.styles.muted(s):" ";return!1===this.options.drag&&(r=""),!0===this.options.numbered?r+`${e+1} - `+i:r+i}get selected(){return this.choices}submit(){return this.value=this.choices.map((t=>t.value)),super.submit()}}},755:(t,e,i)=>{"use strict";const s=i(575);function r(t,e={}){if(Array.isArray(e.scale))return e.scale.map((t=>({...t})));let i=[];for(let e=1;ethis.styles.muted(t))),this.state.header=t.join("\n ")}}async toChoices(...t){if(this.createdScales)return!1;this.createdScales=!0;let e=await super.toChoices(...t);for(let t of e)t.scale=r(5,this.options),t.scaleIdx=2;return e}dispatch(){this.alert()}space(){let t=this.focused,e=t.scale[t.scaleIdx],i=e.selected;return t.scale.forEach((t=>t.selected=!1)),e.selected=!i,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let t=this.focused;return t.scaleIdx>=t.scale.length-1?this.alert():(t.scaleIdx++,this.render())}left(){let t=this.focused;return t.scaleIdx<=0?this.alert():(t.scaleIdx--,this.render())}indent(){return" "}async renderChoice(t,e){await this.onChoice(t,e);let i=this.index===e,s="Hyper"===this.term,r=s?9:8,n=s?"":" ",a=this.symbols.line.repeat(r),o=" ".repeat(r+(s?0:1)),l=t=>(t?this.styles.success("◉"):"◯")+n,h=e+1+".",c=i?this.styles.heading:this.styles.noop,u=await this.resolve(t.message,this.state,t,e),d=this.indent(t),p=d+t.scale.map(((e,i)=>l(i===t.scaleIdx))).join(a),m=d+t.scale.map(((e,i)=>(e=>e===t.scaleIdx?c(e):e)(i))).join(o);return i&&(p=this.styles.cyan(p),m=this.styles.cyan(m)),[[h,u].filter(Boolean).join(" "),p,m," "].filter(Boolean).join("\n")}async renderChoices(){if(this.state.submitted)return"";let t=this.visible.map((async(t,e)=>await this.renderChoice(t,e))),e=await Promise.all(t);return e.length||e.push(this.styles.danger("No matching choices")),e.join("\n")}format(){return this.state.submitted?this.choices.map((t=>this.styles.info(t.scaleIdx))).join(", "):""}async render(){let{submitted:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=[i,await this.message(),s].filter(Boolean).join(" ");this.state.prompt=r;let n=await this.header(),a=await this.format(),o=await this.error()||await this.hint(),l=await this.renderChoices(),h=await this.footer();!a&&o||(r+=" "+a),o&&!r.includes(o)&&(r+=" "+o),t&&!a&&!l&&this.multiple&&"form"!==this.type&&(r+=this.styles.danger(this.emptyError)),this.clear(e),this.write([r,n,l,h].filter(Boolean).join("\n")),this.restore()}submit(){this.value={};for(let t of this.choices)this.value[t.name]=t.scaleIdx;return this.base.submit.call(this)}}},781:(t,e,i)=>{t.exports=i(719)},653:(t,e,i)=>{"use strict";const s=i(838);t.exports=class extends s{async initialize(){await super.initialize(),this.value=this.initial=this.resolve(this.options.initial),this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(!0===this.value)return this.alert();this.value=!0,this.render()}disable(){if(!1===this.value)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(t="",e){switch(t.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let t=t=>this.styles.primary.underline(t);return[this.value?this.disabled:t(this.disabled),this.value?t(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:t}=this.state,e=await this.header(),i=await this.prefix(),s=await this.separator(),r=await this.message(),n=await this.format(),a=await this.error()||await this.hint(),o=await this.footer(),l=[i,r,s,n].join(" ");this.state.prompt=l,a&&!l.includes(a)&&(l+=" "+a),this.clear(t),this.write([e,l,o].filter(Boolean).join("\n")),this.write(this.margin[2]),this.restore()}}},607:t=>{"use strict";t.exports=class{_queue=[];_executing=!1;_jobRunner=null;constructor(t){this._jobRunner=t}enqueue=(...t)=>{this._queue.push(t),this._dequeue()};destroy(){this._queue.length=0,this._jobRunner=null}_dequeue(){!this._executing&&this._queue.length&&(this._executing=!0,this._jobRunner(...this._queue.shift()),setTimeout((()=>{this._executing=!1,this._dequeue()})))}}},502:(t,e,i)=>{"use strict";const s=i(546),r={default:(t,e)=>e,checkbox(t,e){throw new Error("checkbox role is not implemented yet")},editable(t,e){throw new Error("editable role is not implemented yet")},expandable(t,e){throw new Error("expandable role is not implemented yet")},heading:(t,e)=>(e.disabled="",e.indicator=[e.indicator," "].find((t=>null!=t)),e.message=e.message||"",e),input(t,e){throw new Error("input role is not implemented yet")},option:(t,e)=>r.default(t,e),radio(t,e){throw new Error("radio role is not implemented yet")},separator:(t,e)=>(e.disabled="",e.indicator=[e.indicator," "].find((t=>null!=t)),e.message=e.message||t.symbols.line.repeat(5),e),spacer:(t,e)=>e};t.exports=(t,e={})=>{let i=s.merge({},r,e.roles);return i[t]||i.default}},873:(t,e,i)=>{"use strict";const{define:s,width:r}=i(546);t.exports=class{constructor(t){let e=t.options;s(this,"_prompt",t),this.type=t.type,this.name=t.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=r(e.stdout||process.stdout),Object.assign(this,e),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=t.symbols,this.styles=t.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let t={...this};return t.status=this.status,t.buffer=Buffer.from(t.buffer),delete t.clone,t}set color(t){this._color=t}get color(){let t=this.prompt.styles;if(this.cancelled)return t.cancelled;if(this.submitted)return t.submitted;let e=this._color||t[this.status];return"function"==typeof e?e:t.pending}set loading(t){this._loading=t}get loading(){return"boolean"==typeof this._loading?this._loading:!!this.loadingChoices&&"choices"}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}}},217:(t,e,i)=>{"use strict";const s=i(546),r=i(730),n={default:r.noop,noop:r.noop,set inverse(t){this._inverse=t},get inverse(){return this._inverse||s.inverse(this.primary)},set complement(t){this._complement=t},get complement(){return this._complement||s.complement(this.primary)},primary:r.cyan,success:r.green,danger:r.magenta,strong:r.bold,warning:r.yellow,muted:r.dim,disabled:r.gray,dark:r.dim.gray,underline:r.underline,set info(t){this._info=t},get info(){return this._info||this.primary},set em(t){this._em=t},get em(){return this._em||this.primary.underline},set heading(t){this._heading=t},get heading(){return this._heading||this.muted.underline},set pending(t){this._pending=t},get pending(){return this._pending||this.primary},set submitted(t){this._submitted=t},get submitted(){return this._submitted||this.success},set cancelled(t){this._cancelled=t},get cancelled(){return this._cancelled||this.danger},set typing(t){this._typing=t},get typing(){return this._typing||this.dim},set placeholder(t){this._placeholder=t},get placeholder(){return this._placeholder||this.primary.dim},set highlight(t){this._highlight=t},get highlight(){return this._highlight||this.inverse},merge:(t={})=>{t.styles&&"boolean"==typeof t.styles.enabled&&(r.enabled=t.styles.enabled),t.styles&&"boolean"==typeof t.styles.visible&&(r.visible=t.styles.visible);let e=s.merge({},n,t.styles);delete e.merge;for(let t of Object.keys(r))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>r[t]});for(let t of Object.keys(r.styles))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>r[t]});return e}};t.exports=n},739:(t,e,i)=>{"use strict";const s="win32"===process.platform,r=i(730),n=i(546),a={...r.symbols,upDownDoubleArrow:"⇕",upDownDoubleArrow2:"⬍",upDownArrow:"↕",asterisk:"*",asterism:"⁂",bulletWhite:"◦",electricArrow:"⌁",ellipsisLarge:"⋯",ellipsisSmall:"…",fullBlock:"█",identicalTo:"≡",indicator:r.symbols.check,leftAngle:"‹",mark:"※",minus:"−",multiplication:"×",obelus:"÷",percent:"%",pilcrow:"¶",pilcrow2:"❡",pencilUpRight:"✐",pencilDownRight:"✎",pencilRight:"✏",plus:"+",plusMinus:"±",pointRight:"☞",rightAngle:"›",section:"§",hexagon:{off:"⬡",on:"⬢",disabled:"⬢"},ballot:{on:"☑",off:"☐",disabled:"☒"},stars:{on:"★",off:"☆",disabled:"☆"},folder:{on:"▼",off:"▶",disabled:"▶"},prefix:{pending:r.symbols.question,submitted:r.symbols.check,cancelled:r.symbols.cross},separator:{pending:r.symbols.pointerSmall,submitted:r.symbols.middot,cancelled:r.symbols.middot},radio:{off:s?"( )":"◯",on:s?"(*)":"◉",disabled:s?"(|)":"Ⓘ"},numbers:["⓪","①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","㉑","㉒","㉓","㉔","㉕","㉖","㉗","㉘","㉙","㉚","㉛","㉜","㉝","㉞","㉟","㊱","㊲","㊳","㊴","㊵","㊶","㊷","㊸","㊹","㊺","㊻","㊼","㊽","㊾","㊿"]};a.merge=t=>{let e=n.merge({},r.symbols,a,t.symbols);return delete e.merge,e},t.exports=a},227:(t,e,i)=>{"use strict";const s=i(217),r=i(739),n=i(546);t.exports=t=>{t.options=n.merge({},t.options.theme,t.options),t.symbols=r.merge(t.options),t.styles=s.merge(t.options)}},940:t=>{"use strict";function e(t,e,i={}){let s=t.timers[e]={name:e,start:Date.now(),ms:0,tick:0},r=i.interval||120;s.frames=i.frames||[],s.loading=!0;let n=setInterval((()=>{s.ms=Date.now()-s.start,s.tick++,t.render()}),r);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,"interval",{value:n}),t.once("close",(()=>s.stop())),s.stop}t.exports=t=>{t.timers=t.timers||{};let i=t.options.timers;if(i)for(let s of Object.keys(i)){let r=i[s];"number"==typeof r&&(r={interval:r}),e(t,s,r)}}},575:(t,e,i)=>{"use strict";const s=i(3),r=i(232),n=i(502),a=i(546),{reorder:o,scrollUp:l,scrollDown:h,isObject:c,swap:u}=a;function d(t,e){if(e instanceof Promise)return e;if("function"==typeof e){if(a.isAsyncFn(e))return e;e=e.call(t,t)}for(let i of e){if(Array.isArray(i.choices)){let e=i.choices.filter((e=>!t.isDisabled(e)));i.enabled=e.every((t=>!0===t.enabled))}!0===t.isDisabled(i)&&delete i.enabled}return e}t.exports=class extends r{constructor(t){super(t),this.cursorHide(),this.maxSelected=t.maxSelected||1/0,this.multiple=t.multiple||!1,this.initial=t.initial||0,this.delay=t.delay||0,this.longest=0,this.num=""}async initialize(){"function"==typeof this.options.initial&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:t,initial:e,autofocus:i,suggest:s}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(t)),this.choices.forEach((t=>t.enabled=!1)),"function"!=typeof s&&0===this.selectable.length)throw new Error("At least one choice must be selectable");c(e)&&(e=Object.keys(e)),Array.isArray(e)?(null!=i&&(this.index=this.findIndex(i)),e.forEach((t=>this.enable(this.find(t)))),await this.render()):(null!=i&&(e=i),"string"==typeof e&&(e=this.findIndex(e)),"number"==typeof e&&e>-1&&(this.index=Math.max(0,Math.min(e,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(t,e){this.state.loadingChoices=!0;let i=[],s=0,r=async(t,e)=>{"function"==typeof t&&(t=await t.call(this)),t instanceof Promise&&(t=await t);for(let n=0;n(this.state.loadingChoices=!1,t)))}async toChoice(t,e,i){if("function"==typeof t&&(t=await t.call(this,this)),t instanceof Promise&&(t=await t),"string"==typeof t&&(t={name:t}),t.normalized)return t;t.normalized=!0;let r=t.value,o=n(t.role,this.options);if("string"!=typeof(t=o(this,t)).disabled||t.hint||(t.hint=t.disabled,t.disabled=!0),!0===t.disabled&&null==t.hint&&(t.hint="(disabled)"),null!=t.index)return t;t.name=t.name||t.key||t.title||t.value||t.message,t.message=t.message||t.name||"",t.value=[t.value,t.name].find(this.isValue.bind(this)),t.input="",t.index=e,t.cursor=0,a.define(t,"parent",i),t.level=i?i.level+1:1,null==t.indent&&(t.indent=i?i.indent+" ":t.indent||""),t.path=i?i.path+"."+t.name:t.name,t.enabled=!(!this.multiple||this.isDisabled(t)||!t.enabled&&!this.isSelected(t)),this.isDisabled(t)||(this.longest=Math.max(this.longest,s(t.message).length));let l={...t};return t.reset=(e=l.input,i=l.value)=>{for(let e of Object.keys(l))t[e]=l[e];t.input=e,t.value=i},null==r&&"function"==typeof t.initial&&(t.input=await t.initial.call(this,this.state,t,e)),t}async onChoice(t,e){this.emit("choice",t,e,this),"function"==typeof t.onChoice&&await t.onChoice.call(this,this.state,t,e)}async addChoice(t,e,i){let s=await this.toChoice(t,e,i);return this.choices.push(s),this.index=this.choices.length-1,this.limit=this.choices.length,s}async newItem(t,e,i){let s={name:"New choice name?",editable:!0,newChoice:!0,...t},r=await this.addChoice(s,e,i);return r.updateChoice=()=>{delete r.newChoice,r.name=r.message=r.input,r.input="",r.cursor=0},this.render()}indent(t){return null==t.indent?t.level>1?" ".repeat(t.level-1):"":t.indent}dispatch(t,e){if(this.multiple&&this[e.name])return this[e.name]();this.alert()}focus(t,e){return"boolean"!=typeof e&&(e=t.enabled),e&&!t.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=t.index,t.enabled=e&&!this.isDisabled(t),t)}space(){return this.multiple?this.focused?(this.toggle(this.focused),this.render()):void 0:this.alert()}a(){if(this.maxSelectedt.enabled));return this.choices.forEach((e=>e.enabled=!t)),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach((t=>t.enabled=!t.enabled)),this.render())}g(){if(!this.choices.some((t=>!!t.parent)))return this.a();const t=this.focused;return this.toggle(t.parent&&!t.choices?t.parent:t),this.render()}toggle(t,e){if(!t.enabled&&this.selected.length>=this.maxSelected)return this.alert();"boolean"!=typeof e&&(e=!t.enabled),t.enabled=e,t.choices&&t.choices.forEach((t=>this.toggle(t,e)));let i=t.parent;for(;i;){let t=i.choices.filter((t=>this.isDisabled(t)));i.enabled=t.every((t=>!0===t.enabled)),i=i.parent}return d(this,this.choices),this.emit("toggle",t,this),t}enable(t){return this.selected.length>=this.maxSelected?this.alert():(t.enabled=!this.isDisabled(t),t.choices&&t.choices.forEach(this.enable.bind(this)),t)}disable(t){return t.enabled=!1,t.choices&&t.choices.forEach(this.disable.bind(this)),t}number(t){this.num+=t;let e=t=>{let e=Number(t);if(e>this.choices.length-1)return this.alert();let i=this.focused,s=this.choices.find((t=>e===t.index));if(!s.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(-1===this.visible.indexOf(s)){let t=o(this.choices),e=t.indexOf(s);if(i.index>e){let i=t.slice(e,e+this.limit),s=t.filter((t=>!i.includes(t)));this.choices=i.concat(s)}else{let i=e-this.limit+1;this.choices=t.slice(i).concat(t.slice(0,i))}}return this.index=this.choices.indexOf(s),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise((t=>{let i=this.choices.length,s=this.num,r=(i=!1,r)=>{clearTimeout(this.numberTimeout),i&&(r=e(s)),this.num="",t(r)};return"0"===s||1===s.length&&Number(s+"0")>i?r(!0):Number(s)>i?r(!1,this.alert()):void(this.numberTimeout=setTimeout((()=>r(!0)),this.delay))}))}home(){return this.choices=o(this.choices),this.index=0,this.render()}end(){let t=this.choices.length-this.limit,e=o(this.choices);return this.choices=e.slice(t).concat(e.slice(0,t)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let t=this.choices.length,e=this.visible.length,i=this.index;return!1===this.options.scroll&&0===i?this.alert():t>e&&0===i?this.scrollUp():(this.index=(i-1%t+t)%t,this.isDisabled()&&!this.allChoicesAreDisabled()?this.up():this.render())}down(){let t=this.choices.length,e=this.visible.length,i=this.index;return!1===this.options.scroll&&i===e-1?this.alert():t>e&&i===e-1?this.scrollDown():(this.index=(i+1)%t,this.isDisabled()&&!this.allChoicesAreDisabled()?this.down():this.render())}scrollUp(t=0){return this.choices=l(this.choices),this.index=t,this.isDisabled()?this.up():this.render()}scrollDown(t=this.visible.length-1){return this.choices=h(this.choices),this.index=t,this.isDisabled()?this.down():this.render()}async shiftUp(){return!0===this.options.sort?(this.sorting=!0,this.swap(this.index-1),await this.up(),void(this.sorting=!1)):this.scrollUp(this.index)}async shiftDown(){return!0===this.options.sort?(this.sorting=!0,this.swap(this.index+1),await this.down(),void(this.sorting=!1)):this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(t){u(this.choices,this.index,t)}allChoicesAreDisabled(t=this.choices){return t.every((t=>this.isDisabled(t)))}isDisabled(t=this.focused){return!(!t||!["disabled","collapsed","hidden","completing","readonly"].some((e=>!0===t[e])))||t&&"heading"===t.role}isEnabled(t=this.focused){if(Array.isArray(t))return t.every((t=>this.isEnabled(t)));if(t.choices){let e=t.choices.filter((t=>!this.isDisabled(t)));return t.enabled&&e.every((t=>this.isEnabled(t)))}return t.enabled&&!this.isDisabled(t)}isChoice(t,e){return t.name===e||t.index===Number(e)}isSelected(t){return Array.isArray(this.initial)?this.initial.some((e=>this.isChoice(t,e))):this.isChoice(t,this.initial)}map(t=[],e="value"){return[].concat(t||[]).reduce(((t,i)=>(t[i]=this.find(i,e),t)),{})}filter(t,e){let i="function"==typeof t?t:(e,i)=>[e.name,i].includes(t),s=(this.options.multiple?this.state._choices:this.choices).filter(i);return e?s.map((t=>t[e])):s}find(t,e){if(c(t))return e?t[e]:t;let i="function"==typeof t?t:(e,i)=>[e.name,i].includes(t),s=this.choices.find(i);return s?e?s[e]:s:void 0}findIndex(t){return this.choices.indexOf(this.find(t))}async submit(){let t=this.focused;if(!t)return this.alert();if(t.newChoice)return t.input?(t.updateChoice(),this.render()):this.alert();if(this.choices.some((t=>t.newChoice)))return this.alert();let{reorder:e,sort:i}=this.options,s=!0===this.multiple,r=this.selected;return void 0===r?this.alert():(Array.isArray(r)&&!1!==e&&!0!==i&&(r=a.reorder(r)),this.value=s?r.map((t=>t.name)):r.name,super.submit())}set choices(t=[]){this.state._choices=this.state._choices||[],this.state.choices=t;for(let e of t)this.state._choices.some((t=>t.name===e.name))||this.state._choices.push(e);if(!this._initial&&this.options.initial){this._initial=!0;let t=this.initial;if("string"==typeof t||"number"==typeof t){let e=this.find(t);e&&(this.initial=e.index,this.focus(e,!0))}}}get choices(){return d(this,this.state.choices||[])}set visible(t){this.state.visible=t}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(t){this.state.limit=t}get limit(){let{state:t,options:e,choices:i}=this,s=t.limit||this._limit||e.limit||i.length;return Math.min(s,this.height)}set value(t){super.value=t}get value(){return"string"!=typeof super.value&&super.value===this.initial?this.input:super.value}set index(t){this.state.index=t}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let t=this.choices[this.index];return t&&this.state.submitted&&!0!==this.multiple&&(t.enabled=!0),t}get selectable(){return this.choices.filter((t=>!this.isDisabled(t)))}get selected(){return this.multiple?this.enabled:this.focused}}},926:(t,e,i)=>{"use strict";const s=i(826),r=()=>{throw new Error("expected prompt to have a custom authenticate method")},n=(t=r)=>class extends s{constructor(t){super(t)}async submit(){this.value=await t.call(this,this.values,this.state),super.base.submit.call(this)}static create(t){return n(t)}};t.exports=n()},838:(t,e,i)=>{"use strict";const s=i(232),{isPrimitive:r,hasColor:n}=i(546);t.exports=class extends s{constructor(t){super(t),this.cursorHide()}async initialize(){let t=await this.resolve(this.initial,this.state);this.input=await this.cast(t),await super.initialize()}dispatch(t){return this.isValue(t)?(this.input=t,this.submit()):this.alert()}format(t){let{styles:e,state:i}=this;return i.submitted?e.success(t):e.primary(t)}cast(t){return this.isTrue(t)}isTrue(t){return/^[ty1]/i.test(t)}isFalse(t){return/^[fn0]/i.test(t)}isValue(t){return r(t)&&(this.isTrue(t)||this.isFalse(t))}async hint(){if("pending"===this.state.status){let t=await this.element("hint");return n(t)?t:this.styles.muted(t)}}async render(){let{input:t,size:e}=this.state,i=await this.prefix(),s=await this.separator(),r=[i,await this.message(),this.styles.muted(this.default),s].filter(Boolean).join(" ");this.state.prompt=r;let n=await this.header(),a=this.value=this.cast(t),o=await this.format(a),l=await this.error()||await this.hint(),h=await this.footer();l&&!r.includes(l)&&(o+=" "+l),r+=" "+o,this.clear(e),this.write([n,r,h].filter(Boolean).join("\n")),this.restore()}set value(t){super.value=t}get value(){return this.cast(super.value)}}},920:(t,e,i)=>{t.exports={ArrayPrompt:i(575),AuthPrompt:i(926),BooleanPrompt:i(838),NumberPrompt:i(376),StringPrompt:i(391)}},376:(t,e,i)=>{"use strict";const s=i(391);t.exports=class extends s{constructor(t={}){super({style:"number",...t}),this.min=this.isValue(t.min)?this.toNumber(t.min):-1/0,this.max=this.isValue(t.max)?this.toNumber(t.max):1/0,this.delay=null!=t.delay?t.delay:1e3,this.float=!1!==t.float,this.round=!0===t.round||!1===t.float,this.major=t.major||10,this.minor=t.minor||1,this.initial=null!=t.initial?t.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(t){return!/[-+.]/.test(t)||"."===t&&this.input.includes(".")?this.alert("invalid number"):super.append(t)}number(t){return super.append(t)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(t){let e=t||this.minor,i=this.toNumber(this.input);return i>this.max+e?this.alert():(this.input=`${i+e}`,this.render())}down(t){let e=t||this.minor,i=this.toNumber(this.input);return ithis.isValue(t)));return this.value=this.toNumber(t||0),super.submit()}}},391:(t,e,i)=>{"use strict";const s=i(232),r=i(914),n=i(786),{isPrimitive:a}=i(546);t.exports=class extends s{constructor(t){super(t),this.initial=a(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[],this.keypressTimeout=void 0!==this.options.keypressTimeout?this.options.keypressTimeout:null}async keypress(t,e=(t?r(t,{}):{})){const i=Date.now(),s=i-this.lastKeypress;this.lastKeypress=i;const n="return"===e.name||"enter"===e.name;let a,o=this.state.prevKeypress;if(this.state.prevKeypress=e,null!=this.keypressTimeout&&n){if(s=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(t){return!!t}async format(t=this.value){let e=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(t||e):n(this,{input:t,initial:e,pos:this.cursor})}async render(){let t=this.state.size,e=await this.prefix(),i=await this.separator(),s=[e,await this.message(),i].filter(Boolean).join(" ");this.state.prompt=s;let r=await this.header(),n=await this.format(),a=await this.error()||await this.hint(),o=await this.footer();a&&!n.includes(a)&&(n+=" "+a),s+=" "+n,this.clear(t),this.write([r,s,o].filter(Boolean).join("\n")),this.restore()}}},546:(t,e,i)=>{"use strict";const s=Object.prototype.toString,r=i(730);let n=!1,a=new Set;const o={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};e.longest=(t,e)=>t.reduce(((t,i)=>Math.max(t,e?i[e].length:i.length)),0),e.hasColor=t=>!!t&&r.hasColor(t);const l=e.isObject=t=>null!==t&&"object"==typeof t&&!Array.isArray(t);e.nativeType=t=>s.call(t).slice(8,-1).toLowerCase().replace(/\s/g,""),e.isAsyncFn=t=>"asyncfunction"===e.nativeType(t),e.isPrimitive=t=>null!=t&&"object"!=typeof t&&"function"!=typeof t,e.resolve=(t,e,...i)=>"function"==typeof e?e.call(t,...i):e,e.scrollDown=(t=[])=>[...t.slice(1),t[0]],e.scrollUp=(t=[])=>[t.pop(),...t],e.reorder=(t=[])=>{let e=t.slice();return e.sort(((t,e)=>t.index>e.index?1:t.index{let s=t.length,r=i===s?0:i<0?s-1:i,n=t[e];t[e]=t[r],t[r]=n},e.width=(t,e=80)=>{let i=t&&t.columns?t.columns:e;return t&&"function"==typeof t.getWindowSize&&(i=t.getWindowSize()[0]),"win32"===process.platform?i-1:i},e.height=(t,e=20)=>{let i=t&&t.rows?t.rows:e;return t&&"function"==typeof t.getWindowSize&&(i=t.getWindowSize()[1]),i},e.wordWrap=(t,e={})=>{if(!t)return t;"number"==typeof e&&(e={width:e});let{indent:i="",newline:s="\n"+i,width:r=80}=e,n=(s+i).match(/[^\S\n]/g)||[];r-=n.length;let a=`.{1,${r}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,o=t.trim(),l=new RegExp(a,"g"),h=o.match(l)||[];return h=h.map((t=>t.replace(/\n$/,""))),e.padEnd&&(h=h.map((t=>t.padEnd(r," ")))),e.padStart&&(h=h.map((t=>t.padStart(r," ")))),i+h.join(s)},e.unmute=t=>{let e=t.stack.find((t=>r.keys.color.includes(t)));return e?r[e]:t.stack.find((t=>"bg"===t.slice(2)))?r[e.slice(2)]:t=>t},e.pascal=t=>t?t[0].toUpperCase()+t.slice(1):"",e.inverse=t=>{if(!t||!t.stack)return t;let i=t.stack.find((t=>r.keys.color.includes(t)));if(i){let s=r["bg"+e.pascal(i)];return s?s.black:t}let s=t.stack.find((t=>"bg"===t.slice(0,2)));return s?r[s.slice(2).toLowerCase()]||t:r.none},e.complement=t=>{if(!t||!t.stack)return t;let i=t.stack.find((t=>r.keys.color.includes(t))),s=t.stack.find((t=>"bg"===t.slice(0,2)));if(i&&!s)return r[o[i]||i];if(s){let i=s.slice(2).toLowerCase(),n=o[i];return n&&r["bg"+e.pascal(n)]||t}return r.none},e.meridiem=t=>{let e=t.getHours(),i=t.getMinutes(),s=e>=12?"pm":"am";return e%=12,(0===e?12:e)+":"+(i<10?"0"+i:i)+" "+s},e.set=(t={},i="",s)=>i.split(".").reduce(((t,i,r,n)=>{let a=n.length-1>r?t[i]||{}:s;return!e.isObject(a)&&r{let s=null==t[e]?e.split(".").reduce(((t,e)=>t&&t[e]),t):t[e];return null==s?i:s},e.mixin=(t,i)=>{if(!l(t))return i;if(!l(i))return t;for(let s of Object.keys(i)){let r=Object.getOwnPropertyDescriptor(i,s);if(hasOwnProperty.call(r,"value"))if(hasOwnProperty.call(t,s)&&l(r.value)){let n=Object.getOwnPropertyDescriptor(t,s);l(n.value)&&n.value!==r.value?t[s]=e.merge({},t[s],i[s]):Reflect.defineProperty(t,s,r)}else Reflect.defineProperty(t,s,r);else Reflect.defineProperty(t,s,r)}return t},e.merge=(...t)=>{let i={};for(let s of t)e.mixin(i,s);return i},e.mixinEmitter=(t,i)=>{let s=i.constructor.prototype;for(let r of Object.keys(s)){let n=s[r];"function"==typeof n?e.define(t,r,n.bind(i)):e.define(t,r,n)}};const h=(t,e)=>{n||(n=!0,a.forEach((t=>t())),!0===t&&process.exit(128+e))},c=h.bind(null,!0,15),u=h.bind(null,!0,2);e.onExit=t=>(0===a.size&&(process.once("SIGTERM",c),process.once("SIGINT",u),process.once("exit",h)),a.add(t),()=>{a.delete(t),0===a.size&&(process.off("SIGTERM",c),process.off("SIGINT",u),process.off("exit",h))}),e.define=(t,e,i)=>{Reflect.defineProperty(t,e,{value:i})},e.defineExport=(t,e,i)=>{let s;Reflect.defineProperty(t,e,{enumerable:!0,configurable:!0,set(t){s=t},get:()=>s?s():i()})}},3:(t,e,i)=>{"use strict";const s=i(277);t.exports=t=>"string"==typeof t?t.replace(s(),""):t},491:t=>{"use strict";t.exports=require("assert")},361:t=>{"use strict";t.exports=require("events")},521:t=>{"use strict";t.exports=require("readline")}},e={};function i(s){var r=e[s];if(void 0!==r)return r.exports;var n=e[s]={exports:{}};return t[s](n,n.exports,i),n.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=require("node:path"),e=i.n(t)().join(__dirname,"..","..","assets","data","cards_pt-br.json"),s=require("node:crypto");var r=i.n(s);const n={title:t=>!(t.trim().trim().length<2)||"O título precisa ter pelo menos 3 caracteres.",description:t=>!(t.trim().length<10)||"A descrição precisa ter pelo menos 10 caracteres.",tags:t=>!(t.length<1)||"Você precisa selecionar pelo menos uma tag."},{MultiSelect:a}=i(31),o=new a({name:"tags",message:"Selecione as tags relacionadas ao seu conceito",choices:["Back-end","Biblioteca","Conceito","Design","Ferramenta","Framework","Front-end","Mobile","Paradigma","Versionamento"],validate:n.tags});var l=i(31),h=i.n(l);const c={type:"input",required:!0};const u=()=>{return t=void 0,e=void 0,s=function*(){const t=yield(i=void 0,s=void 0,a=void 0,l=function*(){return yield h().prompt([Object.assign(Object.assign({},c),{name:"title",message:"Qual título o seu conceito tem ?",validate:n.title}),Object.assign(Object.assign({},c),{name:"description",message:"Qual descrição o seu conceito tem ?",validate:n.description}),{type:"input",name:"code",message:"Seu conceito tem algum código ? (opcional)"}])},new(a||(a=Promise))((function(t,e){function r(t){try{o(l.next(t))}catch(t){e(t)}}function n(t){try{o(l.throw(t))}catch(t){e(t)}}function o(e){var i;e.done?t(e.value):(i=e.value,i instanceof a?i:new a((function(t){t(i)}))).then(r,n)}o((l=l.apply(i,s||[])).next())}))),e=yield o.run();var i,s,a,l;return{id:r().randomBytes(16).toString("hex"),title:t.title,description:t.description,tags:e,content:{code:t.code}}},new((i=void 0)||(i=Promise))((function(r,n){function a(t){try{l(s.next(t))}catch(t){n(t)}}function o(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}));var t,e,i,s},d=require("node:fs");var p=i.n(d);class m{writeToFile(t,e){p().writeFileSync(t,e)}readFromFile(t){return p().readFileSync(t,"utf8")}}const f=("—",t=>"—".repeat(t))(50);var g,y,b,w;g=void 0,y=void 0,w=function*(){try{const t=new m;((t,e,i)=>{return((t,e,i)=>{i.writeToFile(t,JSON.stringify({cards:e},null,2))})(i,((t,e)=>[...t,e])((r=i,s=e.readFromFile(r),Object.values(JSON.parse(s)).flat()),t),e);var s,r})(yield u(),t,e),console.log(`\n${f}`),console.log("✔️ Novo termo adicionado com sucesso!"),console.log(f)}catch(t){console.log(`\n${f}`),console.error("❌ Ocorreu um erro ao adicionar o novo termo."),console.error("❌ Tente novamente seguindo as instruções."),console.error("❌ Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues."),console.log(f),t instanceof Error&&console.error(`❌ ${t.message}\n`)}},new((b=void 0)||(b=Promise))((function(t,e){function i(t){try{r(w.next(t))}catch(t){e(t)}}function s(t){try{r(w.throw(t))}catch(t){e(t)}}function r(e){var r;e.done?t(e.value):(r=e.value,r instanceof b?r:new b((function(t){t(r)}))).then(i,s)}r((w=w.apply(g,y||[])).next())}))})()})(); \ No newline at end of file +(()=>{var u={730:(u,D,e)=>{"use strict";const t=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,r=()=>{const u={enabled:"undefined"!=typeof process&&"0"!==process.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},D=(u,D,e)=>"function"==typeof u?u(D):u.wrap(D,e),r=(e,t)=>{if(""===e||null==e)return"";if(!1===u.enabled)return e;if(!1===u.visible)return"";let r=""+e,i=r.includes("\n"),n=t.length;for(n>0&&t.includes("unstyle")&&(t=[...new Set(["unstyle",...t])].reverse());n-- >0;)r=D(u.styles[t[n]],r,i);return r},i=(D,e,t)=>{u.styles[D]=(u=>{let D=u.open=`[${u.codes[0]}m`,e=u.close=`[${u.codes[1]}m`,t=u.regex=new RegExp(`\\u001b\\[${u.codes[1]}m`,"g");return u.wrap=(u,r)=>{u.includes(e)&&(u=u.replace(t,e+D));let i=D+u+e;return r?i.replace(/\r*\n/g,`${e}$&${D}`):i},u})({name:D,codes:e}),(u.keys[t]||(u.keys[t]=[])).push(D),Reflect.defineProperty(u,D,{configurable:!0,enumerable:!0,set(e){u.alias(D,e)},get(){let e=u=>r(u,e.stack);return Reflect.setPrototypeOf(e,u),e.stack=this.stack?this.stack.concat(D):[D],e}})};return i("reset",[0,0],"modifier"),i("bold",[1,22],"modifier"),i("dim",[2,22],"modifier"),i("italic",[3,23],"modifier"),i("underline",[4,24],"modifier"),i("inverse",[7,27],"modifier"),i("hidden",[8,28],"modifier"),i("strikethrough",[9,29],"modifier"),i("black",[30,39],"color"),i("red",[31,39],"color"),i("green",[32,39],"color"),i("yellow",[33,39],"color"),i("blue",[34,39],"color"),i("magenta",[35,39],"color"),i("cyan",[36,39],"color"),i("white",[37,39],"color"),i("gray",[90,39],"color"),i("grey",[90,39],"color"),i("bgBlack",[40,49],"bg"),i("bgRed",[41,49],"bg"),i("bgGreen",[42,49],"bg"),i("bgYellow",[43,49],"bg"),i("bgBlue",[44,49],"bg"),i("bgMagenta",[45,49],"bg"),i("bgCyan",[46,49],"bg"),i("bgWhite",[47,49],"bg"),i("blackBright",[90,39],"bright"),i("redBright",[91,39],"bright"),i("greenBright",[92,39],"bright"),i("yellowBright",[93,39],"bright"),i("blueBright",[94,39],"bright"),i("magentaBright",[95,39],"bright"),i("cyanBright",[96,39],"bright"),i("whiteBright",[97,39],"bright"),i("bgBlackBright",[100,49],"bgBright"),i("bgRedBright",[101,49],"bgBright"),i("bgGreenBright",[102,49],"bgBright"),i("bgYellowBright",[103,49],"bgBright"),i("bgBlueBright",[104,49],"bgBright"),i("bgMagentaBright",[105,49],"bgBright"),i("bgCyanBright",[106,49],"bgBright"),i("bgWhiteBright",[107,49],"bgBright"),u.ansiRegex=t,u.hasColor=u.hasAnsi=D=>(u.ansiRegex.lastIndex=0,"string"==typeof D&&""!==D&&u.ansiRegex.test(D)),u.alias=(D,e)=>{let t="string"==typeof e?u[e]:e;if("function"!=typeof t)throw new TypeError("Expected alias to be the name of an existing color (string) or a function");t.stack||(Reflect.defineProperty(t,"name",{value:D}),u.styles[D]=t,t.stack=[D]),Reflect.defineProperty(u,D,{configurable:!0,enumerable:!0,set(e){u.alias(D,e)},get(){let D=u=>r(u,D.stack);return Reflect.setPrototypeOf(D,u),D.stack=this.stack?this.stack.concat(t.stack):t.stack,D}})},u.theme=D=>{if(null===(e=D)||"object"!=typeof e||Array.isArray(e))throw new TypeError("Expected theme to be an object");var e;for(let e of Object.keys(D))u.alias(e,D[e]);return u},u.alias("unstyle",(D=>"string"==typeof D&&""!==D?(u.ansiRegex.lastIndex=0,D.replace(u.ansiRegex,"")):"")),u.alias("noop",(u=>u)),u.none=u.clear=u.noop,u.stripColor=u.unstyle,u.symbols=e(142),u.define=i,u};u.exports=r(),u.exports.create=r},142:u=>{"use strict";const D="undefined"!=typeof process&&"Hyper"===process.env.TERM_PROGRAM,e="undefined"!=typeof process&&"win32"===process.platform,t="undefined"!=typeof process&&"linux"===process.platform,r={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},i=Object.assign({},r,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),n=Object.assign({},r,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:t?"▸":"❯",pointerSmall:t?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});u.exports=e&&!D?i:n,Reflect.defineProperty(u.exports,"common",{enumerable:!1,value:r}),Reflect.defineProperty(u.exports,"windows",{enumerable:!1,value:i}),Reflect.defineProperty(u.exports,"other",{enumerable:!1,value:n})},901:(u,D,e)=>{let t=e(224),r=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||t.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),i=(u,D,e=u)=>t=>{let r=""+t,i=r.indexOf(D,u.length);return~i?u+n(r,D,e,i)+D:u+r+D},n=(u,D,e,t)=>{let r=u.substring(0,t)+e,i=u.substring(t+D.length),s=i.indexOf(D);return~s?r+n(i,D,e,s):r+i},s=(u=r)=>({isColorSupported:u,reset:u?u=>`${u}`:String,bold:u?i("","",""):String,dim:u?i("","",""):String,italic:u?i("",""):String,underline:u?i("",""):String,inverse:u?i("",""):String,hidden:u?i("",""):String,strikethrough:u?i("",""):String,black:u?i("",""):String,red:u?i("",""):String,green:u?i("",""):String,yellow:u?i("",""):String,blue:u?i("",""):String,magenta:u?i("",""):String,cyan:u?i("",""):String,white:u?i("",""):String,gray:u?i("",""):String,bgBlack:u?i("",""):String,bgRed:u?i("",""):String,bgGreen:u?i("",""):String,bgYellow:u?i("",""):String,bgBlue:u?i("",""):String,bgMagenta:u?i("",""):String,bgCyan:u?i("",""):String,bgWhite:u?i("",""):String});u.exports=s(),u.exports.createColors=s},698:u=>{"use strict";const D="[",e={to:(u,e)=>e?`${D}${e+1};${u+1}H`:`${D}${u+1}G`,move(u,e){let t="";return u<0?t+=`${D}${-u}D`:u>0&&(t+=`${D}${u}C`),e<0?t+=`${D}${-e}A`:e>0&&(t+=`${D}${e}B`),t},up:(u=1)=>`${D}${u}A`,down:(u=1)=>`${D}${u}B`,forward:(u=1)=>`${D}${u}C`,backward:(u=1)=>`${D}${u}D`,nextLine:(u=1)=>`${D}E`.repeat(u),prevLine:(u=1)=>`${D}F`.repeat(u),left:`${D}G`,hide:`${D}?25l`,show:`${D}?25h`,save:"7",restore:"8"},t={up:(u=1)=>`${D}S`.repeat(u),down:(u=1)=>`${D}T`.repeat(u)},r={screen:`${D}2J`,up:(u=1)=>`${D}1J`.repeat(u),down:(u=1)=>`${D}J`.repeat(u),line:`${D}2K`,lineEnd:`${D}K`,lineStart:`${D}1K`,lines(u){let D="";for(let t=0;t{"use strict";u.exports=require("tty")}},D={};function e(t){var r=D[t];if(void 0!==r)return r.exports;var i=D[t]={exports:{}};return u[t](i,i.exports,e),i.exports}e.n=u=>{var D=u&&u.__esModule?()=>u.default:()=>u;return e.d(D,{a:D}),D},e.d=(u,D)=>{for(var t in D)e.o(D,t)&&!e.o(u,t)&&Object.defineProperty(u,t,{enumerable:!0,get:D[t]})},e.o=(u,D)=>Object.prototype.hasOwnProperty.call(u,D),(()=>{"use strict";var u=e(698);const D=require("node:process"),t=require("node:readline"),r=require("node:tty");var i=e(901);function n(u){if("string"!=typeof u)throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(function({onlyFirst:u=!1}={}){const D=["[\\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(D,u?void 0:"g")}(),"")}var s={};!function(u){var D={};function e(u){return u.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.exports=D,D.eastAsianWidth=function(u){var D=u.charCodeAt(0),e=2==u.length?u.charCodeAt(1):0,t=D;return 55296<=D&&D<=56319&&56320<=e&&e<=57343&&(t=(D&=1023)<<10|(e&=1023),t+=65536),12288==t||65281<=t&&t<=65376||65504<=t&&t<=65510?"F":8361==t||65377<=t&&t<=65470||65474<=t&&t<=65479||65482<=t&&t<=65487||65490<=t&&t<=65495||65498<=t&&t<=65500||65512<=t&&t<=65518?"H":4352<=t&&t<=4447||4515<=t&&t<=4519||4602<=t&&t<=4607||9001<=t&&t<=9002||11904<=t&&t<=11929||11931<=t&&t<=12019||12032<=t&&t<=12245||12272<=t&&t<=12283||12289<=t&&t<=12350||12353<=t&&t<=12438||12441<=t&&t<=12543||12549<=t&&t<=12589||12593<=t&&t<=12686||12688<=t&&t<=12730||12736<=t&&t<=12771||12784<=t&&t<=12830||12832<=t&&t<=12871||12880<=t&&t<=13054||13056<=t&&t<=19903||19968<=t&&t<=42124||42128<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||55216<=t&&t<=55238||55243<=t&&t<=55291||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65106||65108<=t&&t<=65126||65128<=t&&t<=65131||110592<=t&&t<=110593||127488<=t&&t<=127490||127504<=t&&t<=127546||127552<=t&&t<=127560||127568<=t&&t<=127569||131072<=t&&t<=194367||177984<=t&&t<=196605||196608<=t&&t<=262141?"W":32<=t&&t<=126||162<=t&&t<=163||165<=t&&t<=166||172==t||175==t||10214<=t&&t<=10221||10629<=t&&t<=10630?"Na":161==t||164==t||167<=t&&t<=168||170==t||173<=t&&t<=174||176<=t&&t<=180||182<=t&&t<=186||188<=t&&t<=191||198==t||208==t||215<=t&&t<=216||222<=t&&t<=225||230==t||232<=t&&t<=234||236<=t&&t<=237||240==t||242<=t&&t<=243||247<=t&&t<=250||252==t||254==t||257==t||273==t||275==t||283==t||294<=t&&t<=295||299==t||305<=t&&t<=307||312==t||319<=t&&t<=322||324==t||328<=t&&t<=331||333==t||338<=t&&t<=339||358<=t&&t<=359||363==t||462==t||464==t||466==t||468==t||470==t||472==t||474==t||476==t||593==t||609==t||708==t||711==t||713<=t&&t<=715||717==t||720==t||728<=t&&t<=731||733==t||735==t||768<=t&&t<=879||913<=t&&t<=929||931<=t&&t<=937||945<=t&&t<=961||963<=t&&t<=969||1025==t||1040<=t&&t<=1103||1105==t||8208==t||8211<=t&&t<=8214||8216<=t&&t<=8217||8220<=t&&t<=8221||8224<=t&&t<=8226||8228<=t&&t<=8231||8240==t||8242<=t&&t<=8243||8245==t||8251==t||8254==t||8308==t||8319==t||8321<=t&&t<=8324||8364==t||8451==t||8453==t||8457==t||8467==t||8470==t||8481<=t&&t<=8482||8486==t||8491==t||8531<=t&&t<=8532||8539<=t&&t<=8542||8544<=t&&t<=8555||8560<=t&&t<=8569||8585==t||8592<=t&&t<=8601||8632<=t&&t<=8633||8658==t||8660==t||8679==t||8704==t||8706<=t&&t<=8707||8711<=t&&t<=8712||8715==t||8719==t||8721==t||8725==t||8730==t||8733<=t&&t<=8736||8739==t||8741==t||8743<=t&&t<=8748||8750==t||8756<=t&&t<=8759||8764<=t&&t<=8765||8776==t||8780==t||8786==t||8800<=t&&t<=8801||8804<=t&&t<=8807||8810<=t&&t<=8811||8814<=t&&t<=8815||8834<=t&&t<=8835||8838<=t&&t<=8839||8853==t||8857==t||8869==t||8895==t||8978==t||9312<=t&&t<=9449||9451<=t&&t<=9547||9552<=t&&t<=9587||9600<=t&&t<=9615||9618<=t&&t<=9621||9632<=t&&t<=9633||9635<=t&&t<=9641||9650<=t&&t<=9651||9654<=t&&t<=9655||9660<=t&&t<=9661||9664<=t&&t<=9665||9670<=t&&t<=9672||9675==t||9678<=t&&t<=9681||9698<=t&&t<=9701||9711==t||9733<=t&&t<=9734||9737==t||9742<=t&&t<=9743||9748<=t&&t<=9749||9756==t||9758==t||9792==t||9794==t||9824<=t&&t<=9825||9827<=t&&t<=9829||9831<=t&&t<=9834||9836<=t&&t<=9837||9839==t||9886<=t&&t<=9887||9918<=t&&t<=9919||9924<=t&&t<=9933||9935<=t&&t<=9953||9955==t||9960<=t&&t<=9983||10045==t||10071==t||10102<=t&&t<=10111||11093<=t&&t<=11097||12872<=t&&t<=12879||57344<=t&&t<=63743||65024<=t&&t<=65039||65533==t||127232<=t&&t<=127242||127248<=t&&t<=127277||127280<=t&&t<=127337||127344<=t&&t<=127386||917760<=t&&t<=917999||983040<=t&&t<=1048573||1048576<=t&&t<=1114109?"A":"N"},D.characterLength=function(u){var D=this.eastAsianWidth(u);return"F"==D||"W"==D||"A"==D?2:1},D.length=function(u){for(var D=e(u),t=0,r=0;r=t-(2==a?1:0)){if(!(n+a<=r))break;i+=F}n+=a}return i}}({get exports(){return s},set exports(u){s=u}});const o=s;function F(u,D={}){if("string"!=typeof u||0===u.length||(D={ambiguousIsNarrow:!0,...D},0===(u=n(u)).length))return 0;u=u.replace(/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g," ");const e=D.ambiguousIsNarrow?1:2;let t=0;for(const D of u){const u=D.codePointAt(0);if(!(u<=31||u>=127&&u<=159||u>=768&&u<=879))switch(o.eastAsianWidth(D)){case"F":case"W":t+=2;break;case"A":t+=e;break;default:t+=1}}return t}const a=(u=0)=>D=>`[${D+u}m`,C=(u=0)=>D=>`[${38+u};5;${D}m`,l=(u=0)=>(D,e,t)=>`[${38+u};2;${D};${e};${t}m`,c={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(c.modifier),Object.keys(c.color),Object.keys(c.bgColor);const E=function(){const u=new Map;for(const[D,e]of Object.entries(c)){for(const[D,t]of Object.entries(e))c[D]={open:`[${t[0]}m`,close:`[${t[1]}m`},e[D]=c[D],u.set(t[0],t[1]);Object.defineProperty(c,D,{value:e,enumerable:!1})}return Object.defineProperty(c,"codes",{value:u,enumerable:!1}),c.color.close="",c.bgColor.close="",c.color.ansi=a(),c.color.ansi256=C(),c.color.ansi16m=l(),c.bgColor.ansi=a(10),c.bgColor.ansi256=C(10),c.bgColor.ansi16m=l(10),Object.defineProperties(c,{rgbToAnsi256:{value:(u,D,e)=>u===D&&D===e?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(D/255*5)+Math.round(e/255*5),enumerable:!1},hexToRgb:{value:u=>{const D=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!D)return[0,0,0];let[e]=D;3===e.length&&(e=[...e].map((u=>u+u)).join(""));const t=Number.parseInt(e,16);return[t>>16&255,t>>8&255,255&t]},enumerable:!1},hexToAnsi256:{value:u=>c.rgbToAnsi256(...c.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return u-8+90;let D,e,t;if(u>=232)D=(10*(u-232)+8)/255,e=D,t=D;else{const r=(u-=16)%36;D=Math.floor(u/36)/5,e=Math.floor(r/6)/5,t=r%6/5}const r=2*Math.max(D,e,t);if(0===r)return 30;let i=30+(Math.round(t)<<2|Math.round(e)<<1|Math.round(D));return 2===r&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(u,D,e)=>c.ansi256ToAnsi(c.rgbToAnsi256(u,D,e)),enumerable:!1},hexToAnsi:{value:u=>c.ansi256ToAnsi(c.hexToAnsi256(u)),enumerable:!1}}),c}(),h=new Set(["","›"]),B="]8;;",g=u=>`${h.values().next().value}[${u}m`,d=u=>`${h.values().next().value}${B}${u}`,p=(u,D,e)=>{const t=[...D];let r=!1,i=!1,s=F(n(u[u.length-1]));for(const[D,n]of t.entries()){const o=F(n);s+o<=e?u[u.length-1]+=n:(u.push(n),s=0),h.has(n)&&(r=!0,i=t.slice(D+1).join("").startsWith(B)),r?i?""===n&&(r=!1,i=!1):"m"===n&&(r=!1):(s+=o,s===e&&D0&&u.length>1&&(u[u.length-2]+=u.pop())};function m(u,D,e){return String(u).normalize().replace(/\r\n/g,"\n").split("\n").map((u=>((u,D,e={})=>{if(!1!==e.trim&&""===u.trim())return"";let t,r,i="";const n=(u=>u.split(" ").map((u=>F(u))))(u);let s=[""];for(const[t,r]of u.split(" ").entries()){!1!==e.trim&&(s[s.length-1]=s[s.length-1].trimStart());let u=F(s[s.length-1]);if(0!==t&&(u>=D&&(!1===e.wordWrap||!1===e.trim)&&(s.push(""),u=0),(u>0||!1===e.trim)&&(s[s.length-1]+=" ",u++)),e.hard&&n[t]>D){const e=D-u,i=1+Math.floor((n[t]-e-1)/D);Math.floor((n[t]-1)/D)D&&u>0&&n[t]>0){if(!1===e.wordWrap&&uD&&!1===e.wordWrap?p(s,r,D):s[s.length-1]+=r}}!1!==e.trim&&(s=s.map((u=>(u=>{const D=u.split(" ");let e=D.length;for(;e>0&&!(F(D[e-1])>0);)e--;return e===D.length?u:D.slice(0,e).join(" ")+D.slice(e).join("")})(u))));const o=[...s.join("\n")];for(const[u,D]of o.entries()){if(i+=D,h.has(D)){const{groups:D}=new RegExp(`(?:\\[(?\\d+)m|\\${B}(?.*))`).exec(o.slice(u).join(""))||{groups:{}};if(void 0!==D.code){const u=Number.parseFloat(D.code);t=39===u?void 0:u}else void 0!==D.uri&&(r=0===D.uri.length?void 0:D.uri)}const e=E.codes.get(Number(t));"\n"===o[u+1]?(r&&(i+=d("")),t&&e&&(i+=g(e))):"\n"===D&&(t&&e&&(i+=g(t)),r&&(i+=d(r)))}return i})(u,D,e))).join("\n")}const b=Symbol("clack:cancel");function A(u,D){u.isTTY&&u.setRawMode(D)}const v=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),f=new Set(["up","down","left","right","space","enter"]);class y{constructor({render:u,input:e=D.stdin,output:t=D.stdout,...r},i=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=u.bind(this),this._track=i,this.input=e,this.output=t}prompt(){const D=new r.WriteStream(0);return D._write=(u,D,e)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),e()},this.input.pipe(D),this.rl=t.createInterface({input:this.input,output:D,tabSize:2,prompt:"",escapeCodeTimeout:50}),t.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),void 0!==this.opts.initialValue&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),A(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise(((D,e)=>{this.once("submit",(()=>{this.output.write(u.cursor.show),this.output.off("resize",this.render),A(this.input,!1),D(this.value)})),this.once("cancel",(()=>{this.output.write(u.cursor.show),this.output.off("resize",this.render),A(this.input,!1),D(b)}))}))}on(u,D){const e=this.subscribers.get(u)??[];e.push({cb:D}),this.subscribers.set(u,e)}once(u,D){const e=this.subscribers.get(u)??[];e.push({cb:D,once:!0}),this.subscribers.set(u,e)}emit(u,...D){const e=this.subscribers.get(u)??[],t=[];for(const u of e)u.cb(...D),u.once&&t.push((()=>e.splice(e.indexOf(u),1)));for(const u of t)u()}unsubscribe(){this.subscribers.clear()}onKeypress(u,D){if("error"===this.state&&(this.state="active"),D?.name&&!this._track&&v.has(D.name)&&this.emit("cursor",v.get(D.name)),D?.name&&f.has(D.name)&&this.emit("cursor",D.name),u&&("y"===u.toLowerCase()||"n"===u.toLowerCase())&&this.emit("confirm","y"===u.toLowerCase()),u&&this.emit("key",u.toLowerCase()),"return"===D?.name){if(this.opts.validate){const u=this.opts.validate(this.value);u&&(this.error=u,this.state="error",this.rl.write(this.value))}"error"!==this.state&&(this.state="submit")}""===u&&(this.state="cancel"),("submit"===this.state||"cancel"===this.state)&&this.emit("finalize"),this.render(),("submit"===this.state||"cancel"===this.state)&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write("\n"),A(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const D=m(this._prevFrame,process.stdout.columns,{hard:!0}).split("\n").length-1;this.output.write(u.cursor.move(-999,-1*D))}render(){const D=m(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if("initial"===this.state)this.output.write(u.cursor.hide);else{const e=function(u,D){if(u===D)return;const e=u.split("\n"),t=D.split("\n"),r=[];for(let u=0;u1){const t=e[0];this.output.write(u.cursor.move(0,t)),this.output.write(u.erase.down());const r=D.split("\n").slice(t);return this.output.write(r.join("\n")),void(this._prevFrame=D)}this.output.write(u.erase.down())}this.output.write(D),"initial"===this.state&&(this.state="active"),this._prevFrame=D}}}class $ extends y{get cursor(){return this.value?0:1}get _value(){return 0===this.cursor}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",(()=>{this.value=this._value})),this.on("confirm",(D=>{this.output.write(u.cursor.move(0,-1)),this.value=D,this.state="submit",this.close()})),this.on("cursor",(()=>{this.value=!this.value}))}}class w extends y{constructor(u){super(u,!1),this.cursor=0,this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex((({value:D})=>D===u.cursorAt)),0),this.on("key",(u=>{"a"===u&&this.toggleAll()})),this.on("cursor",(u=>{switch(u){case"left":case"up":this.cursor=0===this.cursor?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue()}}))}get _value(){return this.options[this.cursor].value}toggleAll(){const u=this.value.length===this.options.length;this.value=u?[]:this.options.map((u=>u.value))}toggleValue(){const u=this.value.includes(this._value);this.value=u?this.value.filter((u=>u!==this._value)):[...this.value,this._value]}}class x extends y{constructor(u){super(u),this.valueWithCursor="",this.on("finalize",(()=>{this.value||(this.value=u.defaultValue),this.valueWithCursor=this.value})),this.on("value",(()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${i.inverse(i.hidden("_"))}`;else{const u=this.value.slice(0,this.cursor),D=this.value.slice(this.cursor);this.valueWithCursor=`${u}${i.inverse(D[0])}${D.slice(1)}`}}))}get cursor(){return this._cursor}}const k="win32"!==D.platform?"linux"!==D.env.TERM:Boolean(D.env.CI)||Boolean(D.env.WT_SESSION)||Boolean(D.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===D.env.ConEmuTask||"Terminus-Sublime"===D.env.TERM_PROGRAM||"vscode"===D.env.TERM_PROGRAM||"xterm-256color"===D.env.TERM||"alacritty"===D.env.TERM||"JetBrains-JediTerm"===D.env.TERMINAL_EMULATOR,S=(u,D)=>k?u:D,R=S("◆","*"),O=S("■","x"),_=S("▲","x"),M=S("◇","o"),T=S("┌","T"),j=S("│","|"),P=S("└","—"),W=S("●",">"),q=S("○"," "),V=S("◻","[•]"),L=S("◼","[+]"),N=S("◻","[ ]"),I=(S("▪","•"),S("─","-")),z=S("╮","+"),G=S("├","+"),K=S("╯","+"),Y=(S("●","•"),S("◆","*"),S("▲","!"),S("■","x"),u=>{switch(u){case"initial":case"active":return i.cyan(R);case"cancel":return i.red(O);case"error":return i.yellow(_);case"submit":return i.green(M)}}),Z=u=>new x({validate:u.validate,placeholder:u.placeholder,defaultValue:u.defaultValue,initialValue:u.initialValue,render(){const D=`${i.gray(j)}\n${Y(this.state)} ${u.message}\n`,e=u.placeholder?i.inverse(u.placeholder[0])+i.dim(u.placeholder.slice(1)):i.inverse(i.hidden("_")),t=this.value?this.valueWithCursor:e;switch(this.state){case"error":return`${D.trim()}\n${i.yellow(j)} ${t}\n${i.yellow(P)} ${i.yellow(this.error)}\n`;case"submit":return`${D}${i.gray(j)} ${i.dim(this.value||u.placeholder)}`;case"cancel":return`${D}${i.gray(j)} ${i.strikethrough(i.dim(this.value??""))}${this.value?.trim()?"\n"+i.gray(j):""}`;default:return`${D}${i.cyan(j)} ${t}\n${i.cyan(P)}\n`}}}).prompt(),J=u=>{const D=u.active??"Yes",e=u.inactive??"No";return new $({active:D,inactive:e,initialValue:u.initialValue??!0,render(){const t=`${i.gray(j)}\n${Y(this.state)} ${u.message}\n`,r=this.value?D:e;switch(this.state){case"submit":return`${t}${i.gray(j)} ${i.dim(r)}`;case"cancel":return`${t}${i.gray(j)} ${i.strikethrough(i.dim(r))}\n${i.gray(j)}`;default:return`${t}${i.cyan(j)} ${this.value?`${i.green(W)} ${D}`:`${i.dim(q)} ${i.dim(D)}`} ${i.dim("/")} ${this.value?`${i.dim(q)} ${i.dim(e)}`:`${i.green(W)} ${e}`}\n${i.cyan(P)}\n`}}}).prompt()},U=u=>{const D=(u,D)=>{const e=u.label??String(u.value);return"active"===D?`${i.cyan(V)} ${e} ${u.hint?i.dim(`(${u.hint})`):""}`:"selected"===D?`${i.green(L)} ${i.dim(e)}`:"cancelled"===D?`${i.strikethrough(i.dim(e))}`:"active-selected"===D?`${i.green(L)} ${e} ${u.hint?i.dim(`(${u.hint})`):""}`:"submitted"===D?`${i.dim(e)}`:`${i.dim(N)} ${i.dim(e)}`};return new w({options:u.options,initialValues:u.initialValues,required:u.required??!0,cursorAt:u.cursorAt,validate(u){if(this.required&&0===u.length)return`Please select at least one option.\n${i.reset(i.dim(`Press ${i.gray(i.bgWhite(i.inverse(" space ")))} to select, ${i.gray(i.bgWhite(i.inverse(" enter ")))} to submit`))}`},render(){let e=`${i.gray(j)}\n${Y(this.state)} ${u.message}\n`;switch(this.state){case"submit":return`${e}${i.gray(j)} ${this.options.filter((({value:u})=>this.value.includes(u))).map((u=>D(u,"submitted"))).join(i.dim(", "))||i.dim("none")}`;case"cancel":{const u=this.options.filter((({value:u})=>this.value.includes(u))).map((u=>D(u,"cancelled"))).join(i.dim(", "));return`${e}${i.gray(j)} ${u.trim()?`${u}\n${i.gray(j)}`:""}`}case"error":{const u=this.error.split("\n").map(((u,D)=>0===D?`${i.yellow(P)} ${i.yellow(u)}`:` ${u}`)).join("\n");return e+i.yellow(j)+" "+this.options.map(((u,e)=>{const t=this.value.includes(u.value),r=e===this.cursor;return D(u,r&&t?"active-selected":t?"selected":r?"active":"inactive")})).join(`\n${i.yellow(j)} `)+"\n"+u+"\n"}default:return`${e}${i.cyan(j)} ${this.options.map(((u,e)=>{const t=this.value.includes(u.value),r=e===this.cursor;return D(u,r&&t?"active-selected":t?"selected":r?"active":"inactive")})).join(`\n${i.cyan(j)} `)}\n${i.cyan(P)}\n`}}}).prompt()},H=u=>u.replace(function(){const u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(u,"g")}(),""),Q=(u="")=>{process.stdout.write(`${i.gray(j)}\n${i.gray(P)} ${u}\n\n`)},X=require("node:crypto");var uu=e.n(X),Du=e(730),eu=e.n(Du);const tu={title:u=>{const D=u.trim();if(D.trim().length<1)return`O título precisa ter pelo menos 1 caracteres. Você digitou ${D.length} caracteres.`},description:u=>{const D=u.trim();if(D.length<10)return`A descrição precisa ter pelo menos 10 caracteres. Você digitou ${D.length} caracteres.`},tags:u=>{if(u.length<1)return`Você precisa selecionar pelo menos uma tag. Você selecionou ${u.length} opções.`}},ru=[{message:"Digite o nome do conceito",validation:tu.title,required:!0},Object.assign(Object.assign({},{required:!0}),{message:"Digite a descrição do conceito",validation:tu.description})],iu=[{value:"Back-end",label:"Back-end"},{value:"Biblioteca",label:"Biblioteca"},{value:"Conceito",label:"Conceito",hint:"recommended"},{value:"Design",label:"Design"},{value:"Ferramenta",label:"Ferramenta"},{value:"Framework",label:"Framework"},{value:"Front-end",label:"Front-end"},{value:"Mobile",label:"Mobile"},{value:"Paradigma",label:"Paradigma"},{value:"Versionamento",label:"Versionamento"}];function nu(u){u&&u===b&&(((u="")=>{process.stdout.write(`${i.gray(P)} ${i.red(u)}\n\n`)})(" Operação cancelada. "),process.exit(0))}const su=u=>function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))}(void 0,void 0,void 0,(function*(){const D=yield Z({message:u.message,validate:u.validation});return nu(D),D})),ou=require("node:fs");var Fu=e.n(ou);const au=u=>Fu().readFileSync(u).toString();const Cu=u=>function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))}(void 0,void 0,void 0,(function*(){const D=yield J({message:u,active:"Sim",inactive:"Não",initialValue:!0});return nu(D),D})),lu=(u,D)=>{Fu().writeFileSync(u,D)},cu=(u,D)=>{const e=((u="",D="")=>{const e=`\n${u}\n`.split("\n"),t=H(D).length,r=Math.max(e.reduce(((u,D)=>(D=H(D)).length>u?D.length:u),0),t)+2,n=e.map((u=>`${i.gray(j)} ${i.dim(u)}${" ".repeat(r-H(u).length)}${i.gray(j)}`)).join("\n");process.stdout.write(`${i.gray(j)}\n${i.green(M)} ${i.reset(D)} ${i.gray(I.repeat(Math.max(r-t-1,1))+z)}\n${n}\n${i.gray(G+I.repeat(r+2)+K)}\n`)})(u,D);return e},Eu=require("node:path"),hu=e.n(Eu)().join(__dirname,"..","..","assets","data","cards_pt-br.json"),Bu=require("path"),gu=e.n(Bu)().join(__dirname,"..","..","code"),du=u=>{const D=JSON.parse(u);return Object.values(D).flat()},pu=(u,D)=>[...u,D];var mu=function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))};const bu=()=>mu(void 0,void 0,void 0,(function*(){((u="")=>{process.stdout.write(`${i.gray(T)} ${u}\n`)})(eu().bold.bgCyanBright.black(" Olá, boas-vindas ao Diciotech CLI! ")),Fu().stat(gu,(u=>{u&&Fu().writeFileSync(gu,"")})),cu(eu().cyanBright(`Antes de começar, precisamos saber se o seu conceito ${eu().bold.yellow("possui algum trecho de código")}.\nSe sim, você pode ${eu().bold.yellow("escrever o código no arquivo")} ${eu().bold.magenta(gu)}.\nCaso contrário, ${eu().bold.yellow("apenas ignore isso e continue")}.`),eu().bold.bgYellow.black(" Importante "));const[u,D]=ru,e=yield su({message:eu().cyanBright(u.message),validation:u.validation}),t=yield su({message:eu().cyanBright(D.message),validation:D.validation}),r=yield((u,D,e)=>function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))}(void 0,void 0,void 0,(function*(){const u=yield U({message:eu().cyanBright("Selecione a(s) (tag)s relacionada(s) ao conceito"),options:D,required:!0});return(u=>{"symbol"!=typeof u&&u.length<1&&(Q(eu().bgRed.black(" Você precisa selecionar pelo menos uma tag. Tente novamente. ")),process.exit(0))})(u),nu(u),u})))(0,iu),n=au(gu),s={id:uu().randomBytes(16).toString("hex"),title:e.toString(),description:t.toString(),tags:Array.isArray(r)?r:[],content:{code:null==n?void 0:n.trim()}},o=yield Cu(eu().cyanBright(`Deseja ${eu().bold("visualizar")} o novo termo ?`)),F=s.description.length>60?`${s.description.slice(0,60)}...`:s.description;return o&&cu(JSON.stringify({title:s.title,description:F,tags:s.tags,content:{code:s.content.code.split("\n").filter((u=>""!==u))}},null,2),eu().bold.bgCyanBright.black(" Termo ")),(yield Cu(eu().cyanBright(`Show! Agora vamos gravar o conceito. ${eu().bold("Deseja continuar")} ?`)))||(Q(eu().bgYellow.black(` Tudo bem! Se quiser tentar novamente, é só rodar o comando ${eu().bold("npm run new")}. `)),process.exit(0)),s}));mu(void 0,void 0,void 0,(function*(){try{u=yield bu(),lu(D=hu,JSON.stringify({cards:pu(du(au(D)),u)},null,2)),lu(gu,""),cu(eu().cyanBright(`Se você quiser adicionar mais termos, é só rodar o comando ${eu().bold("npm run new")}`),eu().bold.bgGreen.black(" Feito ")),Q(eu().green(`Tudo certo! você pode abrir um ${eu().bold("Pull Request")} em <${eu().bold("https://github.com/levxyca/diciotech/pulls")}>`))}catch(u){cu(eu().italic.red("- Ocorreu um erro ao adicionar o novo termo.\n- Tente novamente seguindo as instruções.\n- Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues."),eu().bold.bgRedBright.black(" Eita! Algo deu errado :( ")),u instanceof Error&&Q(eu().red(`❌ ${u.message}`))}var u,D}))})()})(); \ No newline at end of file From 4f6fc03b8ba5b078257d524ec8f218dc0e33258b Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:33:45 -0300 Subject: [PATCH 32/42] fix: remove unused code and files --- cli/core/read-file-terms.ts | 9 --------- cli/core/write-new-term.ts | 16 ---------------- cli/io/base.ts | 4 ---- cli/io/file-system.ts | 12 ------------ cli/io/multiselect-tags.ts | 11 ----------- cli/io/subjective-questions.ts | 31 ------------------------------- cli/types/fs.ts | 4 ---- cli/types/subjective-questions.ts | 5 ----- cli/utils/dash.ts | 7 ------- 9 files changed, 99 deletions(-) delete mode 100644 cli/core/read-file-terms.ts delete mode 100644 cli/core/write-new-term.ts delete mode 100644 cli/io/base.ts delete mode 100644 cli/io/file-system.ts delete mode 100644 cli/io/multiselect-tags.ts delete mode 100644 cli/io/subjective-questions.ts delete mode 100644 cli/types/fs.ts delete mode 100644 cli/types/subjective-questions.ts delete mode 100644 cli/utils/dash.ts diff --git a/cli/core/read-file-terms.ts b/cli/core/read-file-terms.ts deleted file mode 100644 index e38bf5e8..00000000 --- a/cli/core/read-file-terms.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { IFileSystem } from "../types"; - -/** - * Reads the content of a file. - * - * @param {string} path - The path of the file to be read. - * @returns {string} The content of the read file. - */ -export const readFileContents = (path: string, fs: IFileSystem) => fs.readFromFile(path); diff --git a/cli/core/write-new-term.ts b/cli/core/write-new-term.ts deleted file mode 100644 index 6cd89879..00000000 --- a/cli/core/write-new-term.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Term, IFileSystem } from "../types"; - -/** - * Writes updated terms to a file. - * - * @param {string} path - The path of the file to be written. - * @param {Array} terms - An array of terms to be written to the file. - */ -export const writeUpdatedTermsToFile = ( - path: string, - terms: Term[], - fs: IFileSystem -): void => { - fs.writeToFile(path, JSON.stringify({ cards: terms }, null, 2)); - return; -}; diff --git a/cli/io/base.ts b/cli/io/base.ts deleted file mode 100644 index b95da26c..00000000 --- a/cli/io/base.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const basePrompt = { - type: "input", - required: true, -}; diff --git a/cli/io/file-system.ts b/cli/io/file-system.ts deleted file mode 100644 index 97da5bee..00000000 --- a/cli/io/file-system.ts +++ /dev/null @@ -1,12 +0,0 @@ -import fs from "node:fs"; - -import { IFileSystem } from "../types"; - -export class FileSystem implements IFileSystem { - writeToFile(path: string, data: string): void { - fs.writeFileSync(path, data); - } - readFromFile(path: string): string { - return fs.readFileSync(path, "utf8"); - } -} diff --git a/cli/io/multiselect-tags.ts b/cli/io/multiselect-tags.ts deleted file mode 100644 index 8e746c5f..00000000 --- a/cli/io/multiselect-tags.ts +++ /dev/null @@ -1,11 +0,0 @@ -const { MultiSelect } = require("enquirer"); - -import { availableTags } from "../core/available-tags"; -import { validations } from "../core/prompt-validations"; - -export const promptMultiSelectTags = new MultiSelect({ - name: "tags", - message: "Selecione as tags relacionadas ao seu conceito", - choices: availableTags, - validate: validations.tags, -}); diff --git a/cli/io/subjective-questions.ts b/cli/io/subjective-questions.ts deleted file mode 100644 index c9cd8225..00000000 --- a/cli/io/subjective-questions.ts +++ /dev/null @@ -1,31 +0,0 @@ -import Enquirer from "enquirer"; - -import { basePrompt } from "./base"; - -import { validations } from "../core/prompt-validations"; - -import { SubjectiveQuestions } from "../types"; - -export const subjectiveQuestions = async (): Promise => { - const questions: SubjectiveQuestions = await Enquirer.prompt([ - { - ...basePrompt, - name: "title", - message: "Qual título o seu conceito tem ?", - validate: validations.title, - }, - { - ...basePrompt, - name: "description", - message: "Qual descrição o seu conceito tem ?", - validate: validations.description, - }, - { - type: "input", - name: "code", - message: "Seu conceito tem algum código ? (opcional)", - }, - ]); - - return questions; -}; diff --git a/cli/types/fs.ts b/cli/types/fs.ts deleted file mode 100644 index a910b1bb..00000000 --- a/cli/types/fs.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IFileSystem { - writeToFile(path: string, data: string): void; - readFromFile(path: string): string; -} diff --git a/cli/types/subjective-questions.ts b/cli/types/subjective-questions.ts deleted file mode 100644 index 5e803d9e..00000000 --- a/cli/types/subjective-questions.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type SubjectiveQuestions = { - title: string; - description: string; - code: string; -}; diff --git a/cli/utils/dash.ts b/cli/utils/dash.ts deleted file mode 100644 index 5a1e5842..00000000 --- a/cli/utils/dash.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Repeats a character a given amount of times. - * @param {string} c - The character to be repeated. - * @param {number} qt - The amount of times the character should be repeated. - * @returns {string} The repeated character. - */ -export const dash = (c: string) => (qt: number) => c.repeat(qt); From 1cd254460f7b120dc8f0cf7390dbf3681bb23b26 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:53:49 -0300 Subject: [PATCH 33/42] fix: word in title validation --- cli/core/prompt-validations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/core/prompt-validations.ts b/cli/core/prompt-validations.ts index 8f75b611..289961db 100644 --- a/cli/core/prompt-validations.ts +++ b/cli/core/prompt-validations.ts @@ -3,7 +3,7 @@ export const validations = { const raw = input.trim(); if (raw.trim().length < 1) { - return `O título precisa ter pelo menos 1 caracteres. Você digitou ${raw.length} caracteres.` + return `O título precisa ter pelo menos 1 caractere. Você digitou ${raw.length} caracteres.` } }, description: (input: string) => { From e9d9ac6c9234dad2d04b99c4af02290cc4723a52 Mon Sep 17 00:00:00 2001 From: rwietter Date: Fri, 27 Oct 2023 20:55:12 -0300 Subject: [PATCH 34/42] build: generate bundle to run with node --- cli/build/bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/build/bundle.js b/cli/build/bundle.js index c27fecc3..03e37cb0 100644 --- a/cli/build/bundle.js +++ b/cli/build/bundle.js @@ -1 +1 @@ -(()=>{var u={730:(u,D,e)=>{"use strict";const t=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,r=()=>{const u={enabled:"undefined"!=typeof process&&"0"!==process.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},D=(u,D,e)=>"function"==typeof u?u(D):u.wrap(D,e),r=(e,t)=>{if(""===e||null==e)return"";if(!1===u.enabled)return e;if(!1===u.visible)return"";let r=""+e,i=r.includes("\n"),n=t.length;for(n>0&&t.includes("unstyle")&&(t=[...new Set(["unstyle",...t])].reverse());n-- >0;)r=D(u.styles[t[n]],r,i);return r},i=(D,e,t)=>{u.styles[D]=(u=>{let D=u.open=`[${u.codes[0]}m`,e=u.close=`[${u.codes[1]}m`,t=u.regex=new RegExp(`\\u001b\\[${u.codes[1]}m`,"g");return u.wrap=(u,r)=>{u.includes(e)&&(u=u.replace(t,e+D));let i=D+u+e;return r?i.replace(/\r*\n/g,`${e}$&${D}`):i},u})({name:D,codes:e}),(u.keys[t]||(u.keys[t]=[])).push(D),Reflect.defineProperty(u,D,{configurable:!0,enumerable:!0,set(e){u.alias(D,e)},get(){let e=u=>r(u,e.stack);return Reflect.setPrototypeOf(e,u),e.stack=this.stack?this.stack.concat(D):[D],e}})};return i("reset",[0,0],"modifier"),i("bold",[1,22],"modifier"),i("dim",[2,22],"modifier"),i("italic",[3,23],"modifier"),i("underline",[4,24],"modifier"),i("inverse",[7,27],"modifier"),i("hidden",[8,28],"modifier"),i("strikethrough",[9,29],"modifier"),i("black",[30,39],"color"),i("red",[31,39],"color"),i("green",[32,39],"color"),i("yellow",[33,39],"color"),i("blue",[34,39],"color"),i("magenta",[35,39],"color"),i("cyan",[36,39],"color"),i("white",[37,39],"color"),i("gray",[90,39],"color"),i("grey",[90,39],"color"),i("bgBlack",[40,49],"bg"),i("bgRed",[41,49],"bg"),i("bgGreen",[42,49],"bg"),i("bgYellow",[43,49],"bg"),i("bgBlue",[44,49],"bg"),i("bgMagenta",[45,49],"bg"),i("bgCyan",[46,49],"bg"),i("bgWhite",[47,49],"bg"),i("blackBright",[90,39],"bright"),i("redBright",[91,39],"bright"),i("greenBright",[92,39],"bright"),i("yellowBright",[93,39],"bright"),i("blueBright",[94,39],"bright"),i("magentaBright",[95,39],"bright"),i("cyanBright",[96,39],"bright"),i("whiteBright",[97,39],"bright"),i("bgBlackBright",[100,49],"bgBright"),i("bgRedBright",[101,49],"bgBright"),i("bgGreenBright",[102,49],"bgBright"),i("bgYellowBright",[103,49],"bgBright"),i("bgBlueBright",[104,49],"bgBright"),i("bgMagentaBright",[105,49],"bgBright"),i("bgCyanBright",[106,49],"bgBright"),i("bgWhiteBright",[107,49],"bgBright"),u.ansiRegex=t,u.hasColor=u.hasAnsi=D=>(u.ansiRegex.lastIndex=0,"string"==typeof D&&""!==D&&u.ansiRegex.test(D)),u.alias=(D,e)=>{let t="string"==typeof e?u[e]:e;if("function"!=typeof t)throw new TypeError("Expected alias to be the name of an existing color (string) or a function");t.stack||(Reflect.defineProperty(t,"name",{value:D}),u.styles[D]=t,t.stack=[D]),Reflect.defineProperty(u,D,{configurable:!0,enumerable:!0,set(e){u.alias(D,e)},get(){let D=u=>r(u,D.stack);return Reflect.setPrototypeOf(D,u),D.stack=this.stack?this.stack.concat(t.stack):t.stack,D}})},u.theme=D=>{if(null===(e=D)||"object"!=typeof e||Array.isArray(e))throw new TypeError("Expected theme to be an object");var e;for(let e of Object.keys(D))u.alias(e,D[e]);return u},u.alias("unstyle",(D=>"string"==typeof D&&""!==D?(u.ansiRegex.lastIndex=0,D.replace(u.ansiRegex,"")):"")),u.alias("noop",(u=>u)),u.none=u.clear=u.noop,u.stripColor=u.unstyle,u.symbols=e(142),u.define=i,u};u.exports=r(),u.exports.create=r},142:u=>{"use strict";const D="undefined"!=typeof process&&"Hyper"===process.env.TERM_PROGRAM,e="undefined"!=typeof process&&"win32"===process.platform,t="undefined"!=typeof process&&"linux"===process.platform,r={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},i=Object.assign({},r,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),n=Object.assign({},r,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:t?"▸":"❯",pointerSmall:t?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});u.exports=e&&!D?i:n,Reflect.defineProperty(u.exports,"common",{enumerable:!1,value:r}),Reflect.defineProperty(u.exports,"windows",{enumerable:!1,value:i}),Reflect.defineProperty(u.exports,"other",{enumerable:!1,value:n})},901:(u,D,e)=>{let t=e(224),r=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||t.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),i=(u,D,e=u)=>t=>{let r=""+t,i=r.indexOf(D,u.length);return~i?u+n(r,D,e,i)+D:u+r+D},n=(u,D,e,t)=>{let r=u.substring(0,t)+e,i=u.substring(t+D.length),s=i.indexOf(D);return~s?r+n(i,D,e,s):r+i},s=(u=r)=>({isColorSupported:u,reset:u?u=>`${u}`:String,bold:u?i("","",""):String,dim:u?i("","",""):String,italic:u?i("",""):String,underline:u?i("",""):String,inverse:u?i("",""):String,hidden:u?i("",""):String,strikethrough:u?i("",""):String,black:u?i("",""):String,red:u?i("",""):String,green:u?i("",""):String,yellow:u?i("",""):String,blue:u?i("",""):String,magenta:u?i("",""):String,cyan:u?i("",""):String,white:u?i("",""):String,gray:u?i("",""):String,bgBlack:u?i("",""):String,bgRed:u?i("",""):String,bgGreen:u?i("",""):String,bgYellow:u?i("",""):String,bgBlue:u?i("",""):String,bgMagenta:u?i("",""):String,bgCyan:u?i("",""):String,bgWhite:u?i("",""):String});u.exports=s(),u.exports.createColors=s},698:u=>{"use strict";const D="[",e={to:(u,e)=>e?`${D}${e+1};${u+1}H`:`${D}${u+1}G`,move(u,e){let t="";return u<0?t+=`${D}${-u}D`:u>0&&(t+=`${D}${u}C`),e<0?t+=`${D}${-e}A`:e>0&&(t+=`${D}${e}B`),t},up:(u=1)=>`${D}${u}A`,down:(u=1)=>`${D}${u}B`,forward:(u=1)=>`${D}${u}C`,backward:(u=1)=>`${D}${u}D`,nextLine:(u=1)=>`${D}E`.repeat(u),prevLine:(u=1)=>`${D}F`.repeat(u),left:`${D}G`,hide:`${D}?25l`,show:`${D}?25h`,save:"7",restore:"8"},t={up:(u=1)=>`${D}S`.repeat(u),down:(u=1)=>`${D}T`.repeat(u)},r={screen:`${D}2J`,up:(u=1)=>`${D}1J`.repeat(u),down:(u=1)=>`${D}J`.repeat(u),line:`${D}2K`,lineEnd:`${D}K`,lineStart:`${D}1K`,lines(u){let D="";for(let t=0;t{"use strict";u.exports=require("tty")}},D={};function e(t){var r=D[t];if(void 0!==r)return r.exports;var i=D[t]={exports:{}};return u[t](i,i.exports,e),i.exports}e.n=u=>{var D=u&&u.__esModule?()=>u.default:()=>u;return e.d(D,{a:D}),D},e.d=(u,D)=>{for(var t in D)e.o(D,t)&&!e.o(u,t)&&Object.defineProperty(u,t,{enumerable:!0,get:D[t]})},e.o=(u,D)=>Object.prototype.hasOwnProperty.call(u,D),(()=>{"use strict";var u=e(698);const D=require("node:process"),t=require("node:readline"),r=require("node:tty");var i=e(901);function n(u){if("string"!=typeof u)throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(function({onlyFirst:u=!1}={}){const D=["[\\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(D,u?void 0:"g")}(),"")}var s={};!function(u){var D={};function e(u){return u.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.exports=D,D.eastAsianWidth=function(u){var D=u.charCodeAt(0),e=2==u.length?u.charCodeAt(1):0,t=D;return 55296<=D&&D<=56319&&56320<=e&&e<=57343&&(t=(D&=1023)<<10|(e&=1023),t+=65536),12288==t||65281<=t&&t<=65376||65504<=t&&t<=65510?"F":8361==t||65377<=t&&t<=65470||65474<=t&&t<=65479||65482<=t&&t<=65487||65490<=t&&t<=65495||65498<=t&&t<=65500||65512<=t&&t<=65518?"H":4352<=t&&t<=4447||4515<=t&&t<=4519||4602<=t&&t<=4607||9001<=t&&t<=9002||11904<=t&&t<=11929||11931<=t&&t<=12019||12032<=t&&t<=12245||12272<=t&&t<=12283||12289<=t&&t<=12350||12353<=t&&t<=12438||12441<=t&&t<=12543||12549<=t&&t<=12589||12593<=t&&t<=12686||12688<=t&&t<=12730||12736<=t&&t<=12771||12784<=t&&t<=12830||12832<=t&&t<=12871||12880<=t&&t<=13054||13056<=t&&t<=19903||19968<=t&&t<=42124||42128<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||55216<=t&&t<=55238||55243<=t&&t<=55291||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65106||65108<=t&&t<=65126||65128<=t&&t<=65131||110592<=t&&t<=110593||127488<=t&&t<=127490||127504<=t&&t<=127546||127552<=t&&t<=127560||127568<=t&&t<=127569||131072<=t&&t<=194367||177984<=t&&t<=196605||196608<=t&&t<=262141?"W":32<=t&&t<=126||162<=t&&t<=163||165<=t&&t<=166||172==t||175==t||10214<=t&&t<=10221||10629<=t&&t<=10630?"Na":161==t||164==t||167<=t&&t<=168||170==t||173<=t&&t<=174||176<=t&&t<=180||182<=t&&t<=186||188<=t&&t<=191||198==t||208==t||215<=t&&t<=216||222<=t&&t<=225||230==t||232<=t&&t<=234||236<=t&&t<=237||240==t||242<=t&&t<=243||247<=t&&t<=250||252==t||254==t||257==t||273==t||275==t||283==t||294<=t&&t<=295||299==t||305<=t&&t<=307||312==t||319<=t&&t<=322||324==t||328<=t&&t<=331||333==t||338<=t&&t<=339||358<=t&&t<=359||363==t||462==t||464==t||466==t||468==t||470==t||472==t||474==t||476==t||593==t||609==t||708==t||711==t||713<=t&&t<=715||717==t||720==t||728<=t&&t<=731||733==t||735==t||768<=t&&t<=879||913<=t&&t<=929||931<=t&&t<=937||945<=t&&t<=961||963<=t&&t<=969||1025==t||1040<=t&&t<=1103||1105==t||8208==t||8211<=t&&t<=8214||8216<=t&&t<=8217||8220<=t&&t<=8221||8224<=t&&t<=8226||8228<=t&&t<=8231||8240==t||8242<=t&&t<=8243||8245==t||8251==t||8254==t||8308==t||8319==t||8321<=t&&t<=8324||8364==t||8451==t||8453==t||8457==t||8467==t||8470==t||8481<=t&&t<=8482||8486==t||8491==t||8531<=t&&t<=8532||8539<=t&&t<=8542||8544<=t&&t<=8555||8560<=t&&t<=8569||8585==t||8592<=t&&t<=8601||8632<=t&&t<=8633||8658==t||8660==t||8679==t||8704==t||8706<=t&&t<=8707||8711<=t&&t<=8712||8715==t||8719==t||8721==t||8725==t||8730==t||8733<=t&&t<=8736||8739==t||8741==t||8743<=t&&t<=8748||8750==t||8756<=t&&t<=8759||8764<=t&&t<=8765||8776==t||8780==t||8786==t||8800<=t&&t<=8801||8804<=t&&t<=8807||8810<=t&&t<=8811||8814<=t&&t<=8815||8834<=t&&t<=8835||8838<=t&&t<=8839||8853==t||8857==t||8869==t||8895==t||8978==t||9312<=t&&t<=9449||9451<=t&&t<=9547||9552<=t&&t<=9587||9600<=t&&t<=9615||9618<=t&&t<=9621||9632<=t&&t<=9633||9635<=t&&t<=9641||9650<=t&&t<=9651||9654<=t&&t<=9655||9660<=t&&t<=9661||9664<=t&&t<=9665||9670<=t&&t<=9672||9675==t||9678<=t&&t<=9681||9698<=t&&t<=9701||9711==t||9733<=t&&t<=9734||9737==t||9742<=t&&t<=9743||9748<=t&&t<=9749||9756==t||9758==t||9792==t||9794==t||9824<=t&&t<=9825||9827<=t&&t<=9829||9831<=t&&t<=9834||9836<=t&&t<=9837||9839==t||9886<=t&&t<=9887||9918<=t&&t<=9919||9924<=t&&t<=9933||9935<=t&&t<=9953||9955==t||9960<=t&&t<=9983||10045==t||10071==t||10102<=t&&t<=10111||11093<=t&&t<=11097||12872<=t&&t<=12879||57344<=t&&t<=63743||65024<=t&&t<=65039||65533==t||127232<=t&&t<=127242||127248<=t&&t<=127277||127280<=t&&t<=127337||127344<=t&&t<=127386||917760<=t&&t<=917999||983040<=t&&t<=1048573||1048576<=t&&t<=1114109?"A":"N"},D.characterLength=function(u){var D=this.eastAsianWidth(u);return"F"==D||"W"==D||"A"==D?2:1},D.length=function(u){for(var D=e(u),t=0,r=0;r=t-(2==a?1:0)){if(!(n+a<=r))break;i+=F}n+=a}return i}}({get exports(){return s},set exports(u){s=u}});const o=s;function F(u,D={}){if("string"!=typeof u||0===u.length||(D={ambiguousIsNarrow:!0,...D},0===(u=n(u)).length))return 0;u=u.replace(/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g," ");const e=D.ambiguousIsNarrow?1:2;let t=0;for(const D of u){const u=D.codePointAt(0);if(!(u<=31||u>=127&&u<=159||u>=768&&u<=879))switch(o.eastAsianWidth(D)){case"F":case"W":t+=2;break;case"A":t+=e;break;default:t+=1}}return t}const a=(u=0)=>D=>`[${D+u}m`,C=(u=0)=>D=>`[${38+u};5;${D}m`,l=(u=0)=>(D,e,t)=>`[${38+u};2;${D};${e};${t}m`,c={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(c.modifier),Object.keys(c.color),Object.keys(c.bgColor);const E=function(){const u=new Map;for(const[D,e]of Object.entries(c)){for(const[D,t]of Object.entries(e))c[D]={open:`[${t[0]}m`,close:`[${t[1]}m`},e[D]=c[D],u.set(t[0],t[1]);Object.defineProperty(c,D,{value:e,enumerable:!1})}return Object.defineProperty(c,"codes",{value:u,enumerable:!1}),c.color.close="",c.bgColor.close="",c.color.ansi=a(),c.color.ansi256=C(),c.color.ansi16m=l(),c.bgColor.ansi=a(10),c.bgColor.ansi256=C(10),c.bgColor.ansi16m=l(10),Object.defineProperties(c,{rgbToAnsi256:{value:(u,D,e)=>u===D&&D===e?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(D/255*5)+Math.round(e/255*5),enumerable:!1},hexToRgb:{value:u=>{const D=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!D)return[0,0,0];let[e]=D;3===e.length&&(e=[...e].map((u=>u+u)).join(""));const t=Number.parseInt(e,16);return[t>>16&255,t>>8&255,255&t]},enumerable:!1},hexToAnsi256:{value:u=>c.rgbToAnsi256(...c.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return u-8+90;let D,e,t;if(u>=232)D=(10*(u-232)+8)/255,e=D,t=D;else{const r=(u-=16)%36;D=Math.floor(u/36)/5,e=Math.floor(r/6)/5,t=r%6/5}const r=2*Math.max(D,e,t);if(0===r)return 30;let i=30+(Math.round(t)<<2|Math.round(e)<<1|Math.round(D));return 2===r&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(u,D,e)=>c.ansi256ToAnsi(c.rgbToAnsi256(u,D,e)),enumerable:!1},hexToAnsi:{value:u=>c.ansi256ToAnsi(c.hexToAnsi256(u)),enumerable:!1}}),c}(),h=new Set(["","›"]),B="]8;;",g=u=>`${h.values().next().value}[${u}m`,d=u=>`${h.values().next().value}${B}${u}`,p=(u,D,e)=>{const t=[...D];let r=!1,i=!1,s=F(n(u[u.length-1]));for(const[D,n]of t.entries()){const o=F(n);s+o<=e?u[u.length-1]+=n:(u.push(n),s=0),h.has(n)&&(r=!0,i=t.slice(D+1).join("").startsWith(B)),r?i?""===n&&(r=!1,i=!1):"m"===n&&(r=!1):(s+=o,s===e&&D0&&u.length>1&&(u[u.length-2]+=u.pop())};function m(u,D,e){return String(u).normalize().replace(/\r\n/g,"\n").split("\n").map((u=>((u,D,e={})=>{if(!1!==e.trim&&""===u.trim())return"";let t,r,i="";const n=(u=>u.split(" ").map((u=>F(u))))(u);let s=[""];for(const[t,r]of u.split(" ").entries()){!1!==e.trim&&(s[s.length-1]=s[s.length-1].trimStart());let u=F(s[s.length-1]);if(0!==t&&(u>=D&&(!1===e.wordWrap||!1===e.trim)&&(s.push(""),u=0),(u>0||!1===e.trim)&&(s[s.length-1]+=" ",u++)),e.hard&&n[t]>D){const e=D-u,i=1+Math.floor((n[t]-e-1)/D);Math.floor((n[t]-1)/D)D&&u>0&&n[t]>0){if(!1===e.wordWrap&&uD&&!1===e.wordWrap?p(s,r,D):s[s.length-1]+=r}}!1!==e.trim&&(s=s.map((u=>(u=>{const D=u.split(" ");let e=D.length;for(;e>0&&!(F(D[e-1])>0);)e--;return e===D.length?u:D.slice(0,e).join(" ")+D.slice(e).join("")})(u))));const o=[...s.join("\n")];for(const[u,D]of o.entries()){if(i+=D,h.has(D)){const{groups:D}=new RegExp(`(?:\\[(?\\d+)m|\\${B}(?.*))`).exec(o.slice(u).join(""))||{groups:{}};if(void 0!==D.code){const u=Number.parseFloat(D.code);t=39===u?void 0:u}else void 0!==D.uri&&(r=0===D.uri.length?void 0:D.uri)}const e=E.codes.get(Number(t));"\n"===o[u+1]?(r&&(i+=d("")),t&&e&&(i+=g(e))):"\n"===D&&(t&&e&&(i+=g(t)),r&&(i+=d(r)))}return i})(u,D,e))).join("\n")}const b=Symbol("clack:cancel");function A(u,D){u.isTTY&&u.setRawMode(D)}const v=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),f=new Set(["up","down","left","right","space","enter"]);class y{constructor({render:u,input:e=D.stdin,output:t=D.stdout,...r},i=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=u.bind(this),this._track=i,this.input=e,this.output=t}prompt(){const D=new r.WriteStream(0);return D._write=(u,D,e)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),e()},this.input.pipe(D),this.rl=t.createInterface({input:this.input,output:D,tabSize:2,prompt:"",escapeCodeTimeout:50}),t.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),void 0!==this.opts.initialValue&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),A(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise(((D,e)=>{this.once("submit",(()=>{this.output.write(u.cursor.show),this.output.off("resize",this.render),A(this.input,!1),D(this.value)})),this.once("cancel",(()=>{this.output.write(u.cursor.show),this.output.off("resize",this.render),A(this.input,!1),D(b)}))}))}on(u,D){const e=this.subscribers.get(u)??[];e.push({cb:D}),this.subscribers.set(u,e)}once(u,D){const e=this.subscribers.get(u)??[];e.push({cb:D,once:!0}),this.subscribers.set(u,e)}emit(u,...D){const e=this.subscribers.get(u)??[],t=[];for(const u of e)u.cb(...D),u.once&&t.push((()=>e.splice(e.indexOf(u),1)));for(const u of t)u()}unsubscribe(){this.subscribers.clear()}onKeypress(u,D){if("error"===this.state&&(this.state="active"),D?.name&&!this._track&&v.has(D.name)&&this.emit("cursor",v.get(D.name)),D?.name&&f.has(D.name)&&this.emit("cursor",D.name),u&&("y"===u.toLowerCase()||"n"===u.toLowerCase())&&this.emit("confirm","y"===u.toLowerCase()),u&&this.emit("key",u.toLowerCase()),"return"===D?.name){if(this.opts.validate){const u=this.opts.validate(this.value);u&&(this.error=u,this.state="error",this.rl.write(this.value))}"error"!==this.state&&(this.state="submit")}""===u&&(this.state="cancel"),("submit"===this.state||"cancel"===this.state)&&this.emit("finalize"),this.render(),("submit"===this.state||"cancel"===this.state)&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write("\n"),A(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const D=m(this._prevFrame,process.stdout.columns,{hard:!0}).split("\n").length-1;this.output.write(u.cursor.move(-999,-1*D))}render(){const D=m(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if("initial"===this.state)this.output.write(u.cursor.hide);else{const e=function(u,D){if(u===D)return;const e=u.split("\n"),t=D.split("\n"),r=[];for(let u=0;u1){const t=e[0];this.output.write(u.cursor.move(0,t)),this.output.write(u.erase.down());const r=D.split("\n").slice(t);return this.output.write(r.join("\n")),void(this._prevFrame=D)}this.output.write(u.erase.down())}this.output.write(D),"initial"===this.state&&(this.state="active"),this._prevFrame=D}}}class $ extends y{get cursor(){return this.value?0:1}get _value(){return 0===this.cursor}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",(()=>{this.value=this._value})),this.on("confirm",(D=>{this.output.write(u.cursor.move(0,-1)),this.value=D,this.state="submit",this.close()})),this.on("cursor",(()=>{this.value=!this.value}))}}class w extends y{constructor(u){super(u,!1),this.cursor=0,this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex((({value:D})=>D===u.cursorAt)),0),this.on("key",(u=>{"a"===u&&this.toggleAll()})),this.on("cursor",(u=>{switch(u){case"left":case"up":this.cursor=0===this.cursor?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue()}}))}get _value(){return this.options[this.cursor].value}toggleAll(){const u=this.value.length===this.options.length;this.value=u?[]:this.options.map((u=>u.value))}toggleValue(){const u=this.value.includes(this._value);this.value=u?this.value.filter((u=>u!==this._value)):[...this.value,this._value]}}class x extends y{constructor(u){super(u),this.valueWithCursor="",this.on("finalize",(()=>{this.value||(this.value=u.defaultValue),this.valueWithCursor=this.value})),this.on("value",(()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${i.inverse(i.hidden("_"))}`;else{const u=this.value.slice(0,this.cursor),D=this.value.slice(this.cursor);this.valueWithCursor=`${u}${i.inverse(D[0])}${D.slice(1)}`}}))}get cursor(){return this._cursor}}const k="win32"!==D.platform?"linux"!==D.env.TERM:Boolean(D.env.CI)||Boolean(D.env.WT_SESSION)||Boolean(D.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===D.env.ConEmuTask||"Terminus-Sublime"===D.env.TERM_PROGRAM||"vscode"===D.env.TERM_PROGRAM||"xterm-256color"===D.env.TERM||"alacritty"===D.env.TERM||"JetBrains-JediTerm"===D.env.TERMINAL_EMULATOR,S=(u,D)=>k?u:D,R=S("◆","*"),O=S("■","x"),_=S("▲","x"),M=S("◇","o"),T=S("┌","T"),j=S("│","|"),P=S("└","—"),W=S("●",">"),q=S("○"," "),V=S("◻","[•]"),L=S("◼","[+]"),N=S("◻","[ ]"),I=(S("▪","•"),S("─","-")),z=S("╮","+"),G=S("├","+"),K=S("╯","+"),Y=(S("●","•"),S("◆","*"),S("▲","!"),S("■","x"),u=>{switch(u){case"initial":case"active":return i.cyan(R);case"cancel":return i.red(O);case"error":return i.yellow(_);case"submit":return i.green(M)}}),Z=u=>new x({validate:u.validate,placeholder:u.placeholder,defaultValue:u.defaultValue,initialValue:u.initialValue,render(){const D=`${i.gray(j)}\n${Y(this.state)} ${u.message}\n`,e=u.placeholder?i.inverse(u.placeholder[0])+i.dim(u.placeholder.slice(1)):i.inverse(i.hidden("_")),t=this.value?this.valueWithCursor:e;switch(this.state){case"error":return`${D.trim()}\n${i.yellow(j)} ${t}\n${i.yellow(P)} ${i.yellow(this.error)}\n`;case"submit":return`${D}${i.gray(j)} ${i.dim(this.value||u.placeholder)}`;case"cancel":return`${D}${i.gray(j)} ${i.strikethrough(i.dim(this.value??""))}${this.value?.trim()?"\n"+i.gray(j):""}`;default:return`${D}${i.cyan(j)} ${t}\n${i.cyan(P)}\n`}}}).prompt(),J=u=>{const D=u.active??"Yes",e=u.inactive??"No";return new $({active:D,inactive:e,initialValue:u.initialValue??!0,render(){const t=`${i.gray(j)}\n${Y(this.state)} ${u.message}\n`,r=this.value?D:e;switch(this.state){case"submit":return`${t}${i.gray(j)} ${i.dim(r)}`;case"cancel":return`${t}${i.gray(j)} ${i.strikethrough(i.dim(r))}\n${i.gray(j)}`;default:return`${t}${i.cyan(j)} ${this.value?`${i.green(W)} ${D}`:`${i.dim(q)} ${i.dim(D)}`} ${i.dim("/")} ${this.value?`${i.dim(q)} ${i.dim(e)}`:`${i.green(W)} ${e}`}\n${i.cyan(P)}\n`}}}).prompt()},U=u=>{const D=(u,D)=>{const e=u.label??String(u.value);return"active"===D?`${i.cyan(V)} ${e} ${u.hint?i.dim(`(${u.hint})`):""}`:"selected"===D?`${i.green(L)} ${i.dim(e)}`:"cancelled"===D?`${i.strikethrough(i.dim(e))}`:"active-selected"===D?`${i.green(L)} ${e} ${u.hint?i.dim(`(${u.hint})`):""}`:"submitted"===D?`${i.dim(e)}`:`${i.dim(N)} ${i.dim(e)}`};return new w({options:u.options,initialValues:u.initialValues,required:u.required??!0,cursorAt:u.cursorAt,validate(u){if(this.required&&0===u.length)return`Please select at least one option.\n${i.reset(i.dim(`Press ${i.gray(i.bgWhite(i.inverse(" space ")))} to select, ${i.gray(i.bgWhite(i.inverse(" enter ")))} to submit`))}`},render(){let e=`${i.gray(j)}\n${Y(this.state)} ${u.message}\n`;switch(this.state){case"submit":return`${e}${i.gray(j)} ${this.options.filter((({value:u})=>this.value.includes(u))).map((u=>D(u,"submitted"))).join(i.dim(", "))||i.dim("none")}`;case"cancel":{const u=this.options.filter((({value:u})=>this.value.includes(u))).map((u=>D(u,"cancelled"))).join(i.dim(", "));return`${e}${i.gray(j)} ${u.trim()?`${u}\n${i.gray(j)}`:""}`}case"error":{const u=this.error.split("\n").map(((u,D)=>0===D?`${i.yellow(P)} ${i.yellow(u)}`:` ${u}`)).join("\n");return e+i.yellow(j)+" "+this.options.map(((u,e)=>{const t=this.value.includes(u.value),r=e===this.cursor;return D(u,r&&t?"active-selected":t?"selected":r?"active":"inactive")})).join(`\n${i.yellow(j)} `)+"\n"+u+"\n"}default:return`${e}${i.cyan(j)} ${this.options.map(((u,e)=>{const t=this.value.includes(u.value),r=e===this.cursor;return D(u,r&&t?"active-selected":t?"selected":r?"active":"inactive")})).join(`\n${i.cyan(j)} `)}\n${i.cyan(P)}\n`}}}).prompt()},H=u=>u.replace(function(){const u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(u,"g")}(),""),Q=(u="")=>{process.stdout.write(`${i.gray(j)}\n${i.gray(P)} ${u}\n\n`)},X=require("node:crypto");var uu=e.n(X),Du=e(730),eu=e.n(Du);const tu={title:u=>{const D=u.trim();if(D.trim().length<1)return`O título precisa ter pelo menos 1 caracteres. Você digitou ${D.length} caracteres.`},description:u=>{const D=u.trim();if(D.length<10)return`A descrição precisa ter pelo menos 10 caracteres. Você digitou ${D.length} caracteres.`},tags:u=>{if(u.length<1)return`Você precisa selecionar pelo menos uma tag. Você selecionou ${u.length} opções.`}},ru=[{message:"Digite o nome do conceito",validation:tu.title,required:!0},Object.assign(Object.assign({},{required:!0}),{message:"Digite a descrição do conceito",validation:tu.description})],iu=[{value:"Back-end",label:"Back-end"},{value:"Biblioteca",label:"Biblioteca"},{value:"Conceito",label:"Conceito",hint:"recommended"},{value:"Design",label:"Design"},{value:"Ferramenta",label:"Ferramenta"},{value:"Framework",label:"Framework"},{value:"Front-end",label:"Front-end"},{value:"Mobile",label:"Mobile"},{value:"Paradigma",label:"Paradigma"},{value:"Versionamento",label:"Versionamento"}];function nu(u){u&&u===b&&(((u="")=>{process.stdout.write(`${i.gray(P)} ${i.red(u)}\n\n`)})(" Operação cancelada. "),process.exit(0))}const su=u=>function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))}(void 0,void 0,void 0,(function*(){const D=yield Z({message:u.message,validate:u.validation});return nu(D),D})),ou=require("node:fs");var Fu=e.n(ou);const au=u=>Fu().readFileSync(u).toString();const Cu=u=>function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))}(void 0,void 0,void 0,(function*(){const D=yield J({message:u,active:"Sim",inactive:"Não",initialValue:!0});return nu(D),D})),lu=(u,D)=>{Fu().writeFileSync(u,D)},cu=(u,D)=>{const e=((u="",D="")=>{const e=`\n${u}\n`.split("\n"),t=H(D).length,r=Math.max(e.reduce(((u,D)=>(D=H(D)).length>u?D.length:u),0),t)+2,n=e.map((u=>`${i.gray(j)} ${i.dim(u)}${" ".repeat(r-H(u).length)}${i.gray(j)}`)).join("\n");process.stdout.write(`${i.gray(j)}\n${i.green(M)} ${i.reset(D)} ${i.gray(I.repeat(Math.max(r-t-1,1))+z)}\n${n}\n${i.gray(G+I.repeat(r+2)+K)}\n`)})(u,D);return e},Eu=require("node:path"),hu=e.n(Eu)().join(__dirname,"..","..","assets","data","cards_pt-br.json"),Bu=require("path"),gu=e.n(Bu)().join(__dirname,"..","..","code"),du=u=>{const D=JSON.parse(u);return Object.values(D).flat()},pu=(u,D)=>[...u,D];var mu=function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))};const bu=()=>mu(void 0,void 0,void 0,(function*(){((u="")=>{process.stdout.write(`${i.gray(T)} ${u}\n`)})(eu().bold.bgCyanBright.black(" Olá, boas-vindas ao Diciotech CLI! ")),Fu().stat(gu,(u=>{u&&Fu().writeFileSync(gu,"")})),cu(eu().cyanBright(`Antes de começar, precisamos saber se o seu conceito ${eu().bold.yellow("possui algum trecho de código")}.\nSe sim, você pode ${eu().bold.yellow("escrever o código no arquivo")} ${eu().bold.magenta(gu)}.\nCaso contrário, ${eu().bold.yellow("apenas ignore isso e continue")}.`),eu().bold.bgYellow.black(" Importante "));const[u,D]=ru,e=yield su({message:eu().cyanBright(u.message),validation:u.validation}),t=yield su({message:eu().cyanBright(D.message),validation:D.validation}),r=yield((u,D,e)=>function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))}(void 0,void 0,void 0,(function*(){const u=yield U({message:eu().cyanBright("Selecione a(s) (tag)s relacionada(s) ao conceito"),options:D,required:!0});return(u=>{"symbol"!=typeof u&&u.length<1&&(Q(eu().bgRed.black(" Você precisa selecionar pelo menos uma tag. Tente novamente. ")),process.exit(0))})(u),nu(u),u})))(0,iu),n=au(gu),s={id:uu().randomBytes(16).toString("hex"),title:e.toString(),description:t.toString(),tags:Array.isArray(r)?r:[],content:{code:null==n?void 0:n.trim()}},o=yield Cu(eu().cyanBright(`Deseja ${eu().bold("visualizar")} o novo termo ?`)),F=s.description.length>60?`${s.description.slice(0,60)}...`:s.description;return o&&cu(JSON.stringify({title:s.title,description:F,tags:s.tags,content:{code:s.content.code.split("\n").filter((u=>""!==u))}},null,2),eu().bold.bgCyanBright.black(" Termo ")),(yield Cu(eu().cyanBright(`Show! Agora vamos gravar o conceito. ${eu().bold("Deseja continuar")} ?`)))||(Q(eu().bgYellow.black(` Tudo bem! Se quiser tentar novamente, é só rodar o comando ${eu().bold("npm run new")}. `)),process.exit(0)),s}));mu(void 0,void 0,void 0,(function*(){try{u=yield bu(),lu(D=hu,JSON.stringify({cards:pu(du(au(D)),u)},null,2)),lu(gu,""),cu(eu().cyanBright(`Se você quiser adicionar mais termos, é só rodar o comando ${eu().bold("npm run new")}`),eu().bold.bgGreen.black(" Feito ")),Q(eu().green(`Tudo certo! você pode abrir um ${eu().bold("Pull Request")} em <${eu().bold("https://github.com/levxyca/diciotech/pulls")}>`))}catch(u){cu(eu().italic.red("- Ocorreu um erro ao adicionar o novo termo.\n- Tente novamente seguindo as instruções.\n- Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues."),eu().bold.bgRedBright.black(" Eita! Algo deu errado :( ")),u instanceof Error&&Q(eu().red(`❌ ${u.message}`))}var u,D}))})()})(); \ No newline at end of file +(()=>{var u={730:(u,D,e)=>{"use strict";const t=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,r=()=>{const u={enabled:"undefined"!=typeof process&&"0"!==process.env.FORCE_COLOR,visible:!0,styles:{},keys:{}},D=(u,D,e)=>"function"==typeof u?u(D):u.wrap(D,e),r=(e,t)=>{if(""===e||null==e)return"";if(!1===u.enabled)return e;if(!1===u.visible)return"";let r=""+e,i=r.includes("\n"),n=t.length;for(n>0&&t.includes("unstyle")&&(t=[...new Set(["unstyle",...t])].reverse());n-- >0;)r=D(u.styles[t[n]],r,i);return r},i=(D,e,t)=>{u.styles[D]=(u=>{let D=u.open=`[${u.codes[0]}m`,e=u.close=`[${u.codes[1]}m`,t=u.regex=new RegExp(`\\u001b\\[${u.codes[1]}m`,"g");return u.wrap=(u,r)=>{u.includes(e)&&(u=u.replace(t,e+D));let i=D+u+e;return r?i.replace(/\r*\n/g,`${e}$&${D}`):i},u})({name:D,codes:e}),(u.keys[t]||(u.keys[t]=[])).push(D),Reflect.defineProperty(u,D,{configurable:!0,enumerable:!0,set(e){u.alias(D,e)},get(){let e=u=>r(u,e.stack);return Reflect.setPrototypeOf(e,u),e.stack=this.stack?this.stack.concat(D):[D],e}})};return i("reset",[0,0],"modifier"),i("bold",[1,22],"modifier"),i("dim",[2,22],"modifier"),i("italic",[3,23],"modifier"),i("underline",[4,24],"modifier"),i("inverse",[7,27],"modifier"),i("hidden",[8,28],"modifier"),i("strikethrough",[9,29],"modifier"),i("black",[30,39],"color"),i("red",[31,39],"color"),i("green",[32,39],"color"),i("yellow",[33,39],"color"),i("blue",[34,39],"color"),i("magenta",[35,39],"color"),i("cyan",[36,39],"color"),i("white",[37,39],"color"),i("gray",[90,39],"color"),i("grey",[90,39],"color"),i("bgBlack",[40,49],"bg"),i("bgRed",[41,49],"bg"),i("bgGreen",[42,49],"bg"),i("bgYellow",[43,49],"bg"),i("bgBlue",[44,49],"bg"),i("bgMagenta",[45,49],"bg"),i("bgCyan",[46,49],"bg"),i("bgWhite",[47,49],"bg"),i("blackBright",[90,39],"bright"),i("redBright",[91,39],"bright"),i("greenBright",[92,39],"bright"),i("yellowBright",[93,39],"bright"),i("blueBright",[94,39],"bright"),i("magentaBright",[95,39],"bright"),i("cyanBright",[96,39],"bright"),i("whiteBright",[97,39],"bright"),i("bgBlackBright",[100,49],"bgBright"),i("bgRedBright",[101,49],"bgBright"),i("bgGreenBright",[102,49],"bgBright"),i("bgYellowBright",[103,49],"bgBright"),i("bgBlueBright",[104,49],"bgBright"),i("bgMagentaBright",[105,49],"bgBright"),i("bgCyanBright",[106,49],"bgBright"),i("bgWhiteBright",[107,49],"bgBright"),u.ansiRegex=t,u.hasColor=u.hasAnsi=D=>(u.ansiRegex.lastIndex=0,"string"==typeof D&&""!==D&&u.ansiRegex.test(D)),u.alias=(D,e)=>{let t="string"==typeof e?u[e]:e;if("function"!=typeof t)throw new TypeError("Expected alias to be the name of an existing color (string) or a function");t.stack||(Reflect.defineProperty(t,"name",{value:D}),u.styles[D]=t,t.stack=[D]),Reflect.defineProperty(u,D,{configurable:!0,enumerable:!0,set(e){u.alias(D,e)},get(){let D=u=>r(u,D.stack);return Reflect.setPrototypeOf(D,u),D.stack=this.stack?this.stack.concat(t.stack):t.stack,D}})},u.theme=D=>{if(null===(e=D)||"object"!=typeof e||Array.isArray(e))throw new TypeError("Expected theme to be an object");var e;for(let e of Object.keys(D))u.alias(e,D[e]);return u},u.alias("unstyle",(D=>"string"==typeof D&&""!==D?(u.ansiRegex.lastIndex=0,D.replace(u.ansiRegex,"")):"")),u.alias("noop",(u=>u)),u.none=u.clear=u.noop,u.stripColor=u.unstyle,u.symbols=e(142),u.define=i,u};u.exports=r(),u.exports.create=r},142:u=>{"use strict";const D="undefined"!=typeof process&&"Hyper"===process.env.TERM_PROGRAM,e="undefined"!=typeof process&&"win32"===process.platform,t="undefined"!=typeof process&&"linux"===process.platform,r={ballotDisabled:"☒",ballotOff:"☐",ballotOn:"☑",bullet:"•",bulletWhite:"◦",fullBlock:"█",heart:"❤",identicalTo:"≡",line:"─",mark:"※",middot:"·",minus:"-",multiplication:"×",obelus:"÷",pencilDownRight:"✎",pencilRight:"✏",pencilUpRight:"✐",percent:"%",pilcrow2:"❡",pilcrow:"¶",plusMinus:"±",question:"?",section:"§",starsOff:"☆",starsOn:"★",upDownArrow:"↕"},i=Object.assign({},r,{check:"√",cross:"×",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"»",radioOff:"( )",radioOn:"(*)",warning:"‼"}),n=Object.assign({},r,{ballotCross:"✘",check:"✔",cross:"✖",ellipsisLarge:"⋯",ellipsis:"…",info:"ℹ",questionFull:"?",questionSmall:"﹖",pointer:t?"▸":"❯",pointerSmall:t?"‣":"›",radioOff:"◯",radioOn:"◉",warning:"⚠"});u.exports=e&&!D?i:n,Reflect.defineProperty(u.exports,"common",{enumerable:!1,value:r}),Reflect.defineProperty(u.exports,"windows",{enumerable:!1,value:i}),Reflect.defineProperty(u.exports,"other",{enumerable:!1,value:n})},901:(u,D,e)=>{let t=e(224),r=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||"win32"===process.platform||t.isatty(1)&&"dumb"!==process.env.TERM||"CI"in process.env),i=(u,D,e=u)=>t=>{let r=""+t,i=r.indexOf(D,u.length);return~i?u+n(r,D,e,i)+D:u+r+D},n=(u,D,e,t)=>{let r=u.substring(0,t)+e,i=u.substring(t+D.length),s=i.indexOf(D);return~s?r+n(i,D,e,s):r+i},s=(u=r)=>({isColorSupported:u,reset:u?u=>`${u}`:String,bold:u?i("","",""):String,dim:u?i("","",""):String,italic:u?i("",""):String,underline:u?i("",""):String,inverse:u?i("",""):String,hidden:u?i("",""):String,strikethrough:u?i("",""):String,black:u?i("",""):String,red:u?i("",""):String,green:u?i("",""):String,yellow:u?i("",""):String,blue:u?i("",""):String,magenta:u?i("",""):String,cyan:u?i("",""):String,white:u?i("",""):String,gray:u?i("",""):String,bgBlack:u?i("",""):String,bgRed:u?i("",""):String,bgGreen:u?i("",""):String,bgYellow:u?i("",""):String,bgBlue:u?i("",""):String,bgMagenta:u?i("",""):String,bgCyan:u?i("",""):String,bgWhite:u?i("",""):String});u.exports=s(),u.exports.createColors=s},698:u=>{"use strict";const D="[",e={to:(u,e)=>e?`${D}${e+1};${u+1}H`:`${D}${u+1}G`,move(u,e){let t="";return u<0?t+=`${D}${-u}D`:u>0&&(t+=`${D}${u}C`),e<0?t+=`${D}${-e}A`:e>0&&(t+=`${D}${e}B`),t},up:(u=1)=>`${D}${u}A`,down:(u=1)=>`${D}${u}B`,forward:(u=1)=>`${D}${u}C`,backward:(u=1)=>`${D}${u}D`,nextLine:(u=1)=>`${D}E`.repeat(u),prevLine:(u=1)=>`${D}F`.repeat(u),left:`${D}G`,hide:`${D}?25l`,show:`${D}?25h`,save:"7",restore:"8"},t={up:(u=1)=>`${D}S`.repeat(u),down:(u=1)=>`${D}T`.repeat(u)},r={screen:`${D}2J`,up:(u=1)=>`${D}1J`.repeat(u),down:(u=1)=>`${D}J`.repeat(u),line:`${D}2K`,lineEnd:`${D}K`,lineStart:`${D}1K`,lines(u){let D="";for(let t=0;t{"use strict";u.exports=require("tty")}},D={};function e(t){var r=D[t];if(void 0!==r)return r.exports;var i=D[t]={exports:{}};return u[t](i,i.exports,e),i.exports}e.n=u=>{var D=u&&u.__esModule?()=>u.default:()=>u;return e.d(D,{a:D}),D},e.d=(u,D)=>{for(var t in D)e.o(D,t)&&!e.o(u,t)&&Object.defineProperty(u,t,{enumerable:!0,get:D[t]})},e.o=(u,D)=>Object.prototype.hasOwnProperty.call(u,D),(()=>{"use strict";var u=e(698);const D=require("node:process"),t=require("node:readline"),r=require("node:tty");var i=e(901);function n(u){if("string"!=typeof u)throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(function({onlyFirst:u=!1}={}){const D=["[\\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(D,u?void 0:"g")}(),"")}var s={};!function(u){var D={};function e(u){return u.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.exports=D,D.eastAsianWidth=function(u){var D=u.charCodeAt(0),e=2==u.length?u.charCodeAt(1):0,t=D;return 55296<=D&&D<=56319&&56320<=e&&e<=57343&&(t=(D&=1023)<<10|(e&=1023),t+=65536),12288==t||65281<=t&&t<=65376||65504<=t&&t<=65510?"F":8361==t||65377<=t&&t<=65470||65474<=t&&t<=65479||65482<=t&&t<=65487||65490<=t&&t<=65495||65498<=t&&t<=65500||65512<=t&&t<=65518?"H":4352<=t&&t<=4447||4515<=t&&t<=4519||4602<=t&&t<=4607||9001<=t&&t<=9002||11904<=t&&t<=11929||11931<=t&&t<=12019||12032<=t&&t<=12245||12272<=t&&t<=12283||12289<=t&&t<=12350||12353<=t&&t<=12438||12441<=t&&t<=12543||12549<=t&&t<=12589||12593<=t&&t<=12686||12688<=t&&t<=12730||12736<=t&&t<=12771||12784<=t&&t<=12830||12832<=t&&t<=12871||12880<=t&&t<=13054||13056<=t&&t<=19903||19968<=t&&t<=42124||42128<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||55216<=t&&t<=55238||55243<=t&&t<=55291||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65106||65108<=t&&t<=65126||65128<=t&&t<=65131||110592<=t&&t<=110593||127488<=t&&t<=127490||127504<=t&&t<=127546||127552<=t&&t<=127560||127568<=t&&t<=127569||131072<=t&&t<=194367||177984<=t&&t<=196605||196608<=t&&t<=262141?"W":32<=t&&t<=126||162<=t&&t<=163||165<=t&&t<=166||172==t||175==t||10214<=t&&t<=10221||10629<=t&&t<=10630?"Na":161==t||164==t||167<=t&&t<=168||170==t||173<=t&&t<=174||176<=t&&t<=180||182<=t&&t<=186||188<=t&&t<=191||198==t||208==t||215<=t&&t<=216||222<=t&&t<=225||230==t||232<=t&&t<=234||236<=t&&t<=237||240==t||242<=t&&t<=243||247<=t&&t<=250||252==t||254==t||257==t||273==t||275==t||283==t||294<=t&&t<=295||299==t||305<=t&&t<=307||312==t||319<=t&&t<=322||324==t||328<=t&&t<=331||333==t||338<=t&&t<=339||358<=t&&t<=359||363==t||462==t||464==t||466==t||468==t||470==t||472==t||474==t||476==t||593==t||609==t||708==t||711==t||713<=t&&t<=715||717==t||720==t||728<=t&&t<=731||733==t||735==t||768<=t&&t<=879||913<=t&&t<=929||931<=t&&t<=937||945<=t&&t<=961||963<=t&&t<=969||1025==t||1040<=t&&t<=1103||1105==t||8208==t||8211<=t&&t<=8214||8216<=t&&t<=8217||8220<=t&&t<=8221||8224<=t&&t<=8226||8228<=t&&t<=8231||8240==t||8242<=t&&t<=8243||8245==t||8251==t||8254==t||8308==t||8319==t||8321<=t&&t<=8324||8364==t||8451==t||8453==t||8457==t||8467==t||8470==t||8481<=t&&t<=8482||8486==t||8491==t||8531<=t&&t<=8532||8539<=t&&t<=8542||8544<=t&&t<=8555||8560<=t&&t<=8569||8585==t||8592<=t&&t<=8601||8632<=t&&t<=8633||8658==t||8660==t||8679==t||8704==t||8706<=t&&t<=8707||8711<=t&&t<=8712||8715==t||8719==t||8721==t||8725==t||8730==t||8733<=t&&t<=8736||8739==t||8741==t||8743<=t&&t<=8748||8750==t||8756<=t&&t<=8759||8764<=t&&t<=8765||8776==t||8780==t||8786==t||8800<=t&&t<=8801||8804<=t&&t<=8807||8810<=t&&t<=8811||8814<=t&&t<=8815||8834<=t&&t<=8835||8838<=t&&t<=8839||8853==t||8857==t||8869==t||8895==t||8978==t||9312<=t&&t<=9449||9451<=t&&t<=9547||9552<=t&&t<=9587||9600<=t&&t<=9615||9618<=t&&t<=9621||9632<=t&&t<=9633||9635<=t&&t<=9641||9650<=t&&t<=9651||9654<=t&&t<=9655||9660<=t&&t<=9661||9664<=t&&t<=9665||9670<=t&&t<=9672||9675==t||9678<=t&&t<=9681||9698<=t&&t<=9701||9711==t||9733<=t&&t<=9734||9737==t||9742<=t&&t<=9743||9748<=t&&t<=9749||9756==t||9758==t||9792==t||9794==t||9824<=t&&t<=9825||9827<=t&&t<=9829||9831<=t&&t<=9834||9836<=t&&t<=9837||9839==t||9886<=t&&t<=9887||9918<=t&&t<=9919||9924<=t&&t<=9933||9935<=t&&t<=9953||9955==t||9960<=t&&t<=9983||10045==t||10071==t||10102<=t&&t<=10111||11093<=t&&t<=11097||12872<=t&&t<=12879||57344<=t&&t<=63743||65024<=t&&t<=65039||65533==t||127232<=t&&t<=127242||127248<=t&&t<=127277||127280<=t&&t<=127337||127344<=t&&t<=127386||917760<=t&&t<=917999||983040<=t&&t<=1048573||1048576<=t&&t<=1114109?"A":"N"},D.characterLength=function(u){var D=this.eastAsianWidth(u);return"F"==D||"W"==D||"A"==D?2:1},D.length=function(u){for(var D=e(u),t=0,r=0;r=t-(2==a?1:0)){if(!(n+a<=r))break;i+=F}n+=a}return i}}({get exports(){return s},set exports(u){s=u}});const o=s;function F(u,D={}){if("string"!=typeof u||0===u.length||(D={ambiguousIsNarrow:!0,...D},0===(u=n(u)).length))return 0;u=u.replace(/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g," ");const e=D.ambiguousIsNarrow?1:2;let t=0;for(const D of u){const u=D.codePointAt(0);if(!(u<=31||u>=127&&u<=159||u>=768&&u<=879))switch(o.eastAsianWidth(D)){case"F":case"W":t+=2;break;case"A":t+=e;break;default:t+=1}}return t}const a=(u=0)=>D=>`[${D+u}m`,C=(u=0)=>D=>`[${38+u};5;${D}m`,l=(u=0)=>(D,e,t)=>`[${38+u};2;${D};${e};${t}m`,c={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(c.modifier),Object.keys(c.color),Object.keys(c.bgColor);const E=function(){const u=new Map;for(const[D,e]of Object.entries(c)){for(const[D,t]of Object.entries(e))c[D]={open:`[${t[0]}m`,close:`[${t[1]}m`},e[D]=c[D],u.set(t[0],t[1]);Object.defineProperty(c,D,{value:e,enumerable:!1})}return Object.defineProperty(c,"codes",{value:u,enumerable:!1}),c.color.close="",c.bgColor.close="",c.color.ansi=a(),c.color.ansi256=C(),c.color.ansi16m=l(),c.bgColor.ansi=a(10),c.bgColor.ansi256=C(10),c.bgColor.ansi16m=l(10),Object.defineProperties(c,{rgbToAnsi256:{value:(u,D,e)=>u===D&&D===e?u<8?16:u>248?231:Math.round((u-8)/247*24)+232:16+36*Math.round(u/255*5)+6*Math.round(D/255*5)+Math.round(e/255*5),enumerable:!1},hexToRgb:{value:u=>{const D=/[a-f\d]{6}|[a-f\d]{3}/i.exec(u.toString(16));if(!D)return[0,0,0];let[e]=D;3===e.length&&(e=[...e].map((u=>u+u)).join(""));const t=Number.parseInt(e,16);return[t>>16&255,t>>8&255,255&t]},enumerable:!1},hexToAnsi256:{value:u=>c.rgbToAnsi256(...c.hexToRgb(u)),enumerable:!1},ansi256ToAnsi:{value:u=>{if(u<8)return 30+u;if(u<16)return u-8+90;let D,e,t;if(u>=232)D=(10*(u-232)+8)/255,e=D,t=D;else{const r=(u-=16)%36;D=Math.floor(u/36)/5,e=Math.floor(r/6)/5,t=r%6/5}const r=2*Math.max(D,e,t);if(0===r)return 30;let i=30+(Math.round(t)<<2|Math.round(e)<<1|Math.round(D));return 2===r&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(u,D,e)=>c.ansi256ToAnsi(c.rgbToAnsi256(u,D,e)),enumerable:!1},hexToAnsi:{value:u=>c.ansi256ToAnsi(c.hexToAnsi256(u)),enumerable:!1}}),c}(),h=new Set(["","›"]),B="]8;;",g=u=>`${h.values().next().value}[${u}m`,d=u=>`${h.values().next().value}${B}${u}`,p=(u,D,e)=>{const t=[...D];let r=!1,i=!1,s=F(n(u[u.length-1]));for(const[D,n]of t.entries()){const o=F(n);s+o<=e?u[u.length-1]+=n:(u.push(n),s=0),h.has(n)&&(r=!0,i=t.slice(D+1).join("").startsWith(B)),r?i?""===n&&(r=!1,i=!1):"m"===n&&(r=!1):(s+=o,s===e&&D0&&u.length>1&&(u[u.length-2]+=u.pop())};function m(u,D,e){return String(u).normalize().replace(/\r\n/g,"\n").split("\n").map((u=>((u,D,e={})=>{if(!1!==e.trim&&""===u.trim())return"";let t,r,i="";const n=(u=>u.split(" ").map((u=>F(u))))(u);let s=[""];for(const[t,r]of u.split(" ").entries()){!1!==e.trim&&(s[s.length-1]=s[s.length-1].trimStart());let u=F(s[s.length-1]);if(0!==t&&(u>=D&&(!1===e.wordWrap||!1===e.trim)&&(s.push(""),u=0),(u>0||!1===e.trim)&&(s[s.length-1]+=" ",u++)),e.hard&&n[t]>D){const e=D-u,i=1+Math.floor((n[t]-e-1)/D);Math.floor((n[t]-1)/D)D&&u>0&&n[t]>0){if(!1===e.wordWrap&&uD&&!1===e.wordWrap?p(s,r,D):s[s.length-1]+=r}}!1!==e.trim&&(s=s.map((u=>(u=>{const D=u.split(" ");let e=D.length;for(;e>0&&!(F(D[e-1])>0);)e--;return e===D.length?u:D.slice(0,e).join(" ")+D.slice(e).join("")})(u))));const o=[...s.join("\n")];for(const[u,D]of o.entries()){if(i+=D,h.has(D)){const{groups:D}=new RegExp(`(?:\\[(?\\d+)m|\\${B}(?.*))`).exec(o.slice(u).join(""))||{groups:{}};if(void 0!==D.code){const u=Number.parseFloat(D.code);t=39===u?void 0:u}else void 0!==D.uri&&(r=0===D.uri.length?void 0:D.uri)}const e=E.codes.get(Number(t));"\n"===o[u+1]?(r&&(i+=d("")),t&&e&&(i+=g(e))):"\n"===D&&(t&&e&&(i+=g(t)),r&&(i+=d(r)))}return i})(u,D,e))).join("\n")}const b=Symbol("clack:cancel");function A(u,D){u.isTTY&&u.setRawMode(D)}const v=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),f=new Set(["up","down","left","right","space","enter"]);class y{constructor({render:u,input:e=D.stdin,output:t=D.stdout,...r},i=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=r,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=u.bind(this),this._track=i,this.input=e,this.output=t}prompt(){const D=new r.WriteStream(0);return D._write=(u,D,e)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),e()},this.input.pipe(D),this.rl=t.createInterface({input:this.input,output:D,tabSize:2,prompt:"",escapeCodeTimeout:50}),t.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),void 0!==this.opts.initialValue&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),A(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise(((D,e)=>{this.once("submit",(()=>{this.output.write(u.cursor.show),this.output.off("resize",this.render),A(this.input,!1),D(this.value)})),this.once("cancel",(()=>{this.output.write(u.cursor.show),this.output.off("resize",this.render),A(this.input,!1),D(b)}))}))}on(u,D){const e=this.subscribers.get(u)??[];e.push({cb:D}),this.subscribers.set(u,e)}once(u,D){const e=this.subscribers.get(u)??[];e.push({cb:D,once:!0}),this.subscribers.set(u,e)}emit(u,...D){const e=this.subscribers.get(u)??[],t=[];for(const u of e)u.cb(...D),u.once&&t.push((()=>e.splice(e.indexOf(u),1)));for(const u of t)u()}unsubscribe(){this.subscribers.clear()}onKeypress(u,D){if("error"===this.state&&(this.state="active"),D?.name&&!this._track&&v.has(D.name)&&this.emit("cursor",v.get(D.name)),D?.name&&f.has(D.name)&&this.emit("cursor",D.name),u&&("y"===u.toLowerCase()||"n"===u.toLowerCase())&&this.emit("confirm","y"===u.toLowerCase()),u&&this.emit("key",u.toLowerCase()),"return"===D?.name){if(this.opts.validate){const u=this.opts.validate(this.value);u&&(this.error=u,this.state="error",this.rl.write(this.value))}"error"!==this.state&&(this.state="submit")}""===u&&(this.state="cancel"),("submit"===this.state||"cancel"===this.state)&&this.emit("finalize"),this.render(),("submit"===this.state||"cancel"===this.state)&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write("\n"),A(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const D=m(this._prevFrame,process.stdout.columns,{hard:!0}).split("\n").length-1;this.output.write(u.cursor.move(-999,-1*D))}render(){const D=m(this._render(this)??"",process.stdout.columns,{hard:!0});if(D!==this._prevFrame){if("initial"===this.state)this.output.write(u.cursor.hide);else{const e=function(u,D){if(u===D)return;const e=u.split("\n"),t=D.split("\n"),r=[];for(let u=0;u1){const t=e[0];this.output.write(u.cursor.move(0,t)),this.output.write(u.erase.down());const r=D.split("\n").slice(t);return this.output.write(r.join("\n")),void(this._prevFrame=D)}this.output.write(u.erase.down())}this.output.write(D),"initial"===this.state&&(this.state="active"),this._prevFrame=D}}}class $ extends y{get cursor(){return this.value?0:1}get _value(){return 0===this.cursor}constructor(D){super(D,!1),this.value=!!D.initialValue,this.on("value",(()=>{this.value=this._value})),this.on("confirm",(D=>{this.output.write(u.cursor.move(0,-1)),this.value=D,this.state="submit",this.close()})),this.on("cursor",(()=>{this.value=!this.value}))}}class w extends y{constructor(u){super(u,!1),this.cursor=0,this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex((({value:D})=>D===u.cursorAt)),0),this.on("key",(u=>{"a"===u&&this.toggleAll()})),this.on("cursor",(u=>{switch(u){case"left":case"up":this.cursor=0===this.cursor?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue()}}))}get _value(){return this.options[this.cursor].value}toggleAll(){const u=this.value.length===this.options.length;this.value=u?[]:this.options.map((u=>u.value))}toggleValue(){const u=this.value.includes(this._value);this.value=u?this.value.filter((u=>u!==this._value)):[...this.value,this._value]}}class x extends y{constructor(u){super(u),this.valueWithCursor="",this.on("finalize",(()=>{this.value||(this.value=u.defaultValue),this.valueWithCursor=this.value})),this.on("value",(()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${i.inverse(i.hidden("_"))}`;else{const u=this.value.slice(0,this.cursor),D=this.value.slice(this.cursor);this.valueWithCursor=`${u}${i.inverse(D[0])}${D.slice(1)}`}}))}get cursor(){return this._cursor}}const k="win32"!==D.platform?"linux"!==D.env.TERM:Boolean(D.env.CI)||Boolean(D.env.WT_SESSION)||Boolean(D.env.TERMINUS_SUBLIME)||"{cmd::Cmder}"===D.env.ConEmuTask||"Terminus-Sublime"===D.env.TERM_PROGRAM||"vscode"===D.env.TERM_PROGRAM||"xterm-256color"===D.env.TERM||"alacritty"===D.env.TERM||"JetBrains-JediTerm"===D.env.TERMINAL_EMULATOR,S=(u,D)=>k?u:D,R=S("◆","*"),O=S("■","x"),_=S("▲","x"),M=S("◇","o"),T=S("┌","T"),j=S("│","|"),P=S("└","—"),W=S("●",">"),q=S("○"," "),V=S("◻","[•]"),L=S("◼","[+]"),N=S("◻","[ ]"),I=(S("▪","•"),S("─","-")),z=S("╮","+"),G=S("├","+"),K=S("╯","+"),Y=(S("●","•"),S("◆","*"),S("▲","!"),S("■","x"),u=>{switch(u){case"initial":case"active":return i.cyan(R);case"cancel":return i.red(O);case"error":return i.yellow(_);case"submit":return i.green(M)}}),Z=u=>new x({validate:u.validate,placeholder:u.placeholder,defaultValue:u.defaultValue,initialValue:u.initialValue,render(){const D=`${i.gray(j)}\n${Y(this.state)} ${u.message}\n`,e=u.placeholder?i.inverse(u.placeholder[0])+i.dim(u.placeholder.slice(1)):i.inverse(i.hidden("_")),t=this.value?this.valueWithCursor:e;switch(this.state){case"error":return`${D.trim()}\n${i.yellow(j)} ${t}\n${i.yellow(P)} ${i.yellow(this.error)}\n`;case"submit":return`${D}${i.gray(j)} ${i.dim(this.value||u.placeholder)}`;case"cancel":return`${D}${i.gray(j)} ${i.strikethrough(i.dim(this.value??""))}${this.value?.trim()?"\n"+i.gray(j):""}`;default:return`${D}${i.cyan(j)} ${t}\n${i.cyan(P)}\n`}}}).prompt(),J=u=>{const D=u.active??"Yes",e=u.inactive??"No";return new $({active:D,inactive:e,initialValue:u.initialValue??!0,render(){const t=`${i.gray(j)}\n${Y(this.state)} ${u.message}\n`,r=this.value?D:e;switch(this.state){case"submit":return`${t}${i.gray(j)} ${i.dim(r)}`;case"cancel":return`${t}${i.gray(j)} ${i.strikethrough(i.dim(r))}\n${i.gray(j)}`;default:return`${t}${i.cyan(j)} ${this.value?`${i.green(W)} ${D}`:`${i.dim(q)} ${i.dim(D)}`} ${i.dim("/")} ${this.value?`${i.dim(q)} ${i.dim(e)}`:`${i.green(W)} ${e}`}\n${i.cyan(P)}\n`}}}).prompt()},U=u=>{const D=(u,D)=>{const e=u.label??String(u.value);return"active"===D?`${i.cyan(V)} ${e} ${u.hint?i.dim(`(${u.hint})`):""}`:"selected"===D?`${i.green(L)} ${i.dim(e)}`:"cancelled"===D?`${i.strikethrough(i.dim(e))}`:"active-selected"===D?`${i.green(L)} ${e} ${u.hint?i.dim(`(${u.hint})`):""}`:"submitted"===D?`${i.dim(e)}`:`${i.dim(N)} ${i.dim(e)}`};return new w({options:u.options,initialValues:u.initialValues,required:u.required??!0,cursorAt:u.cursorAt,validate(u){if(this.required&&0===u.length)return`Please select at least one option.\n${i.reset(i.dim(`Press ${i.gray(i.bgWhite(i.inverse(" space ")))} to select, ${i.gray(i.bgWhite(i.inverse(" enter ")))} to submit`))}`},render(){let e=`${i.gray(j)}\n${Y(this.state)} ${u.message}\n`;switch(this.state){case"submit":return`${e}${i.gray(j)} ${this.options.filter((({value:u})=>this.value.includes(u))).map((u=>D(u,"submitted"))).join(i.dim(", "))||i.dim("none")}`;case"cancel":{const u=this.options.filter((({value:u})=>this.value.includes(u))).map((u=>D(u,"cancelled"))).join(i.dim(", "));return`${e}${i.gray(j)} ${u.trim()?`${u}\n${i.gray(j)}`:""}`}case"error":{const u=this.error.split("\n").map(((u,D)=>0===D?`${i.yellow(P)} ${i.yellow(u)}`:` ${u}`)).join("\n");return e+i.yellow(j)+" "+this.options.map(((u,e)=>{const t=this.value.includes(u.value),r=e===this.cursor;return D(u,r&&t?"active-selected":t?"selected":r?"active":"inactive")})).join(`\n${i.yellow(j)} `)+"\n"+u+"\n"}default:return`${e}${i.cyan(j)} ${this.options.map(((u,e)=>{const t=this.value.includes(u.value),r=e===this.cursor;return D(u,r&&t?"active-selected":t?"selected":r?"active":"inactive")})).join(`\n${i.cyan(j)} `)}\n${i.cyan(P)}\n`}}}).prompt()},H=u=>u.replace(function(){const u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(u,"g")}(),""),Q=(u="")=>{process.stdout.write(`${i.gray(j)}\n${i.gray(P)} ${u}\n\n`)},X=require("node:crypto");var uu=e.n(X),Du=e(730),eu=e.n(Du);const tu={title:u=>{const D=u.trim();if(D.trim().length<1)return`O título precisa ter pelo menos 1 caractere. Você digitou ${D.length} caracteres.`},description:u=>{const D=u.trim();if(D.length<10)return`A descrição precisa ter pelo menos 10 caracteres. Você digitou ${D.length} caracteres.`},tags:u=>{if(u.length<1)return`Você precisa selecionar pelo menos uma tag. Você selecionou ${u.length} opções.`}},ru=[{message:"Digite o nome do conceito",validation:tu.title,required:!0},Object.assign(Object.assign({},{required:!0}),{message:"Digite a descrição do conceito",validation:tu.description})],iu=[{value:"Back-end",label:"Back-end"},{value:"Biblioteca",label:"Biblioteca"},{value:"Conceito",label:"Conceito",hint:"recommended"},{value:"Design",label:"Design"},{value:"Ferramenta",label:"Ferramenta"},{value:"Framework",label:"Framework"},{value:"Front-end",label:"Front-end"},{value:"Mobile",label:"Mobile"},{value:"Paradigma",label:"Paradigma"},{value:"Versionamento",label:"Versionamento"}];function nu(u){u&&u===b&&(((u="")=>{process.stdout.write(`${i.gray(P)} ${i.red(u)}\n\n`)})(" Operação cancelada. "),process.exit(0))}const su=u=>function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))}(void 0,void 0,void 0,(function*(){const D=yield Z({message:u.message,validate:u.validation});return nu(D),D})),ou=require("node:fs");var Fu=e.n(ou);const au=u=>Fu().readFileSync(u).toString();const Cu=u=>function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))}(void 0,void 0,void 0,(function*(){const D=yield J({message:u,active:"Sim",inactive:"Não",initialValue:!0});return nu(D),D})),lu=(u,D)=>{Fu().writeFileSync(u,D)},cu=(u,D)=>{const e=((u="",D="")=>{const e=`\n${u}\n`.split("\n"),t=H(D).length,r=Math.max(e.reduce(((u,D)=>(D=H(D)).length>u?D.length:u),0),t)+2,n=e.map((u=>`${i.gray(j)} ${i.dim(u)}${" ".repeat(r-H(u).length)}${i.gray(j)}`)).join("\n");process.stdout.write(`${i.gray(j)}\n${i.green(M)} ${i.reset(D)} ${i.gray(I.repeat(Math.max(r-t-1,1))+z)}\n${n}\n${i.gray(G+I.repeat(r+2)+K)}\n`)})(u,D);return e},Eu=require("node:path"),hu=e.n(Eu)().join(__dirname,"..","..","assets","data","cards_pt-br.json"),Bu=require("path"),gu=e.n(Bu)().join(__dirname,"..","..","code"),du=u=>{const D=JSON.parse(u);return Object.values(D).flat()},pu=(u,D)=>[...u,D];var mu=function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))};const bu=()=>mu(void 0,void 0,void 0,(function*(){((u="")=>{process.stdout.write(`${i.gray(T)} ${u}\n`)})(eu().bold.bgCyanBright.black(" Olá, boas-vindas ao Diciotech CLI! ")),Fu().stat(gu,(u=>{u&&Fu().writeFileSync(gu,"")})),cu(eu().cyanBright(`Antes de começar, precisamos saber se o seu conceito ${eu().bold.yellow("possui algum trecho de código")}.\nSe sim, você pode ${eu().bold.yellow("escrever o código no arquivo")} ${eu().bold.magenta(gu)}.\nCaso contrário, ${eu().bold.yellow("apenas ignore isso e continue")}.`),eu().bold.bgYellow.black(" Importante "));const[u,D]=ru,e=yield su({message:eu().cyanBright(u.message),validation:u.validation}),t=yield su({message:eu().cyanBright(D.message),validation:D.validation}),r=yield((u,D,e)=>function(u,D,e,t){return new(e||(e=Promise))((function(r,i){function n(u){try{o(t.next(u))}catch(u){i(u)}}function s(u){try{o(t.throw(u))}catch(u){i(u)}}function o(u){var D;u.done?r(u.value):(D=u.value,D instanceof e?D:new e((function(u){u(D)}))).then(n,s)}o((t=t.apply(u,D||[])).next())}))}(void 0,void 0,void 0,(function*(){const u=yield U({message:eu().cyanBright("Selecione a(s) (tag)s relacionada(s) ao conceito"),options:D,required:!0});return(u=>{"symbol"!=typeof u&&u.length<1&&(Q(eu().bgRed.black(" Você precisa selecionar pelo menos uma tag. Tente novamente. ")),process.exit(0))})(u),nu(u),u})))(0,iu),n=au(gu),s={id:uu().randomBytes(16).toString("hex"),title:e.toString(),description:t.toString(),tags:Array.isArray(r)?r:[],content:{code:null==n?void 0:n.trim()}},o=yield Cu(eu().cyanBright(`Deseja ${eu().bold("visualizar")} o novo termo ?`)),F=s.description.length>60?`${s.description.slice(0,60)}...`:s.description;return o&&cu(JSON.stringify({title:s.title,description:F,tags:s.tags,content:{code:s.content.code.split("\n").filter((u=>""!==u))}},null,2),eu().bold.bgCyanBright.black(" Termo ")),(yield Cu(eu().cyanBright(`Show! Agora vamos gravar o conceito. ${eu().bold("Deseja continuar")} ?`)))||(Q(eu().bgYellow.black(` Tudo bem! Se quiser tentar novamente, é só rodar o comando ${eu().bold("npm run new")}. `)),process.exit(0)),s}));mu(void 0,void 0,void 0,(function*(){try{u=yield bu(),lu(D=hu,JSON.stringify({cards:pu(du(au(D)),u)},null,2)),lu(gu,""),cu(eu().cyanBright(`Se você quiser adicionar mais termos, é só rodar o comando ${eu().bold("npm run new")}`),eu().bold.bgGreen.black(" Feito ")),Q(eu().green(`Tudo certo! você pode abrir um ${eu().bold("Pull Request")} em <${eu().bold("https://github.com/levxyca/diciotech/pulls")}>`))}catch(u){cu(eu().italic.red("- Ocorreu um erro ao adicionar o novo termo.\n- Tente novamente seguindo as instruções.\n- Caso o erro persista, abra uma issue em https://github.com/levxyca/diciotech/issues."),eu().bold.bgRedBright.black(" Eita! Algo deu errado :( ")),u instanceof Error&&Q(eu().red(`❌ ${u.message}`))}var u,D}))})()})(); \ No newline at end of file From c7964653276cb0fd8a8cd98d92e7c648c5804e65 Mon Sep 17 00:00:00 2001 From: thiagofqs <39809188+thiagofqs@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:07:04 -0300 Subject: [PATCH 35/42] =?UTF-8?q?docs(CONTRIBUTING.md):=20adicionado=20a?= =?UTF-8?q?=20se=C3=A7=C3=A3o=20de=20adicionar=20uma=20nova=20tag=20e=20al?= =?UTF-8?q?terado=20a=20se=C3=A7=C3=A3o=20de=20adicionar=20um=20novo=20ter?= =?UTF-8?q?mo=20t=C3=A9cnico?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 74 ++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95e38eeb..875e2d96 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,6 +7,7 @@ Que bom que você resolveu contribuir conosco, obrigado 💙! Neste guia vamos e Existem diversas formas de contribuir com o projeto: - [Adicionando um novo termo técnico no Diciotech](#adicionando-um-novo-termo-técnico-no-diciotech) +- [Adicionando uma nova tag no Diciotech](#adicionando-uma-nova-tag-no-diciotech) - [Reportando bugs](#reportando-bugs) - [Indicando melhorias e pedindo funcionalidades](#indicando-melhorias-e-pedindo-funcionalidades) - [Discutindo as issues](#discutindo-as-issues) @@ -15,9 +16,9 @@ Existem diversas formas de contribuir com o projeto: ### Adicionando um novo termo técnico no Diciotech -Adicione mais conteúdo no Diciotech [abrindo um pull request](#fazendo-pull-requests) com o termo que deseja mostrar no site. Para adicionar um novo termo, você deve acessar o arquivo `assets/data/cards_pt-br.json` e inserir um novo item na lista. Por exemplo: +Adicione mais conteúdo no Diciotech [abrindo um pull request](#fazendo-pull-requests) com o termo que deseja que esteja presente no site. Para adicionar um novo termo, você deve acessar o arquivo `assets/data/cards_pt-br.json` e inserir um novo item na lista, seguindo a seguinte estrutura: -```javascript +```json { "title": "Termo técnico", "description": "Explicação sobre o termo", @@ -27,37 +28,59 @@ Adicione mais conteúdo no Diciotech [abrindo um pull request](#fazendo-pull-req ou -```javascript +```json { "title": "Termo técnico", "description": "Explicação sobre o termo", - "tags": ["Tag1", "Tag2"], "content": { "code": "Código de exemplo" - } + }, + "tags": ["Tag1", "Tag2"] } ``` -Tags disponíveis: +> **Observação:** caso a sua contribuição não se alinhe com qualquer uma das tags disponíveis, listadas na seção seguinte, verifique a seção [Adicionando uma nova tag no Diciotech](#adicionando-uma-nova-tag-no-diciotech). + +Antes de abrir o pull request, algumas **regras** e **requisitos** devem ser seguidos para uma maior organização e estabilidade do Diciotech. + +- Se o termo conter um código de exemplo, evite o escrever em uma linguagem de programação específica, faça isso **apenas** se realmente necessário; +- Um termo, de forma obrigatória, deve ser vinculado a, no mínimo, uma tag; +- Atribuir a um termo apenas as tags presentes nessa documentação, da exata mesma forma e escrita; +- Não pode haver duplicações de tags em um mesmo termo. Exemplo: `"tags": ["Conceito", "Conceito"]`; +- As tags atribuídas a um termo devem fazer total sentido com o mesmo. -- `Conceito` -- `Mobile` -- `Front-end` -- `Back-end` -- `Design` +### Adicionando uma nova tag no Diciotech + +Você pode contribuir com o projeto propondo uma nova tag e apresentando-a, como sugestão, por meio de uma [issue](https://github.com/levxyca/diciotech/issues) para que se possa abrir uma discussão a respeito, para uma futura adição através de pull request. A tags disponíveis **sempre** devem estar presentes nessa documentação. + +Tags disponíveis: -**Observação: caso a sua contribuição não se alinhe com qualquer uma das tags disponíveis ou deseje propor uma nova tag, você pode apresentar uma sugestão por meio do envio de uma [issue](https://github.com/levxyca/diciotech/issues) para que possamos abrir uma discussão a respeito.** +- `Back-end`; +- `Biblioteca`; +- `Conceito`; +- `Design`; +- `Ferramenta`; +- `Framework`; +- `Front-end`; +- `Mobile`; +- `Paradigma`; +- `Versionamento`. + +Antes de criar uma issue e abrir um PR, todas as tags devem seguir algumas regras e requisitos: + +- Todas as tags devem estar no singular; +- Atualmente, as tags são _case sensitivity_, então, por padrão, apenas a primeira letra da tag deve ser maiúscula. Exemplo: Back-end, Conceito, Paradigma; +- Para adicionar uma nova tag, primeiro deve ser aberto uma issue e, caso as pessoas usuárias concordem, um PR deve ser aberto, contendo a tag a ser acrescentada na documentação. A PR sendo aprovada, a nova tag poderá ser vinculada a um termo; +- As tags devem ser mais generalistas e categóricas, já que dispomos de um campo de pesquisa para uma busca mais específica e precisa. Exemplo de tags: Front-end, Design, Back-end; +- Não devem existir tags de linguagens de programação, bibliotecas e frameworks. Exemplo: JavaScript, C#, React.js. ### Reportando bugs Se encontrou um bug você pode reportá-lo usando a ferramenta de -[issues do GitHub](https://github.com/levxyca/diciotech/issues). Porém antes -de enviar seu bug é importante fazer as seguintes verificações: +[issues do GitHub](https://github.com/levxyca/diciotech/issues). Porém antes de enviar seu bug é importante fazer as seguintes verificações: -1. Atualize seu repositório local na branch `main` mais recente. Talvez seu - bug já tenha sido corrigido na versão mais recente; -2. Verifique se o bug já foi reportado por outra pessoa fazendo uma busca pelas - issues. +1. Atualize seu repositório local na branch `main` mais recente. Talvez seu bug já tenha sido corrigido na versão mais recente; +2. Verifique se o bug já foi reportado por outra pessoa fazendo uma busca pelas issues. Se o bug realmente não foi resolvido ou reportado, você pode [criar uma nova issue](https://github.com/levxyca/diciotech/issues/new). No @@ -69,19 +92,12 @@ label **bug** à issue. ### Indicando melhorias e pedindo funcionalidades -Outra ótima forma de contribuir é indicando melhorias ao código do projeto e em -como ele está estruturado ou pedindo funcionalidades novas. Se você tem qualquer ideia de como podemos melhorar -alguma abordagem na solução de problemas, refatoração de código, melhoria em -algum recurso ou qualquer outra coisa relacionada, siga estes passos: +Outra ótima forma de contribuir é indicando melhorias ao código do projeto e em como ele está estruturado ou pedindo funcionalidades novas. Se você tem qualquer ideia de como podemos melhorar alguma abordagem na solução de problemas, refatoração de código, melhoria em algum recurso ou qualquer outra coisa relacionada, siga estes passos: -1. Certifique-se de que sua ideia já não esteja sendo abordada em nosso - [roadmap](./ROADMAP.md); -2. Também verifique se a ideia já não está pressente em nossas - [issues do GitHub](https://github.com/levxyca/diciotech/issues); +1. Certifique-se de que sua ideia já não esteja sendo abordada em nosso [roadmap](./ROADMAP.md); +2. Também verifique se a ideia já não está pressente em nossas [issues do GitHub](https://github.com/levxyca/diciotech/issues); -Concluindo esses dois passos, você pode -[criar uma nova issue](https://github.com/levxyca/diciotech/issues/new) -descrevendo as melhorias e usando o label **feature**. +Concluindo esses dois passos, você pode [criar uma nova issue](https://github.com/levxyca/diciotech/issues/new) descrevendo as melhorias e usando o label **feature**. ### Discutindo as issues From a2dee6df2133485bf3f793af017a1ab0b111deee Mon Sep 17 00:00:00 2001 From: thiagofqs <39809188+thiagofqs@users.noreply.github.com> Date: Wed, 18 Oct 2023 08:14:05 -0300 Subject: [PATCH 36/42] =?UTF-8?q?docs:=20corre=C3=A7=C3=A3o=20de=20pontua?= =?UTF-8?q?=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 875e2d96..ed36364f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -51,7 +51,7 @@ Antes de abrir o pull request, algumas **regras** e **requisitos** devem ser seg ### Adicionando uma nova tag no Diciotech -Você pode contribuir com o projeto propondo uma nova tag e apresentando-a, como sugestão, por meio de uma [issue](https://github.com/levxyca/diciotech/issues) para que se possa abrir uma discussão a respeito, para uma futura adição através de pull request. A tags disponíveis **sempre** devem estar presentes nessa documentação. +Você pode contribuir com o projeto propondo uma nova tag e a apresentando, como sugestão, por meio de uma [issue](https://github.com/levxyca/diciotech/issues) para que se possa abrir uma discussão a respeito, para uma futura adição através de pull request. As tags disponíveis **sempre** devem estar presentes nessa documentação. Tags disponíveis: From 0277b4a40d8d7b93d265c63cfd771af41795346e Mon Sep 17 00:00:00 2001 From: thiagofqs <39809188+thiagofqs@users.noreply.github.com> Date: Thu, 19 Oct 2023 11:38:10 -0300 Subject: [PATCH 37/42] =?UTF-8?q?feat:=20altera=C3=A7=C3=B5es=20em=20texto?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 44 ++++++++++++++++++-------------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed36364f..6f2e9fe5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,8 @@ # 📖 Contribua com o Diciotech -Que bom que você resolveu contribuir conosco, obrigado 💙! Neste guia vamos explicar como funcionam os processos para que você possa contribuir com esse projeto. +Quer contribuir conosco?! Obrigado 💙 + +Neste guia vamos explicar como funcionam os processos para que você possa contribuir com o Diciotech. ## 🤔 Como contribuir @@ -33,7 +35,7 @@ ou "title": "Termo técnico", "description": "Explicação sobre o termo", "content": { - "code": "Código de exemplo" + "code": "Código de exemplo" }, "tags": ["Tag1", "Tag2"] } @@ -70,65 +72,55 @@ Antes de criar uma issue e abrir um PR, todas as tags devem seguir algumas regra - Todas as tags devem estar no singular; - Atualmente, as tags são _case sensitivity_, então, por padrão, apenas a primeira letra da tag deve ser maiúscula. Exemplo: Back-end, Conceito, Paradigma; -- Para adicionar uma nova tag, primeiro deve ser aberto uma issue e, caso as pessoas usuárias concordem, um PR deve ser aberto, contendo a tag a ser acrescentada na documentação. A PR sendo aprovada, a nova tag poderá ser vinculada a um termo; +- Para adicionar uma nova tag, primeiro deve criar uma issue e, caso as pessoas usuárias concordem, um pull request deve ser aberto, contendo a tag. A PR sendo aprovada, a nova tag poderá ser vinculada a um termo; - As tags devem ser mais generalistas e categóricas, já que dispomos de um campo de pesquisa para uma busca mais específica e precisa. Exemplo de tags: Front-end, Design, Back-end; - Não devem existir tags de linguagens de programação, bibliotecas e frameworks. Exemplo: JavaScript, C#, React.js. ### Reportando bugs -Se encontrou um bug você pode reportá-lo usando a ferramenta de -[issues do GitHub](https://github.com/levxyca/diciotech/issues). Porém antes de enviar seu bug é importante fazer as seguintes verificações: +Se encontraste um bug você pode reportá-lo usando a ferramenta de +[issues do GitHub](https://github.com/levxyca/diciotech/issues). Porém, antes de criar a issue com as informações sobre o bug, é importante fazer as seguintes verificações: 1. Atualize seu repositório local na branch `main` mais recente. Talvez seu bug já tenha sido corrigido na versão mais recente; -2. Verifique se o bug já foi reportado por outra pessoa fazendo uma busca pelas issues. +2. Verifique se o bug já foi reportado por outra pessoa, então faça uma busca pelas issues abertas. Se o bug realmente não foi resolvido ou reportado, você pode [criar uma nova issue](https://github.com/levxyca/diciotech/issues/new). No título da issue tente resumir da melhor forma o problema encontrado. -Se possível inclua imagens ou vídeos à descrição do bug para facilitar o -processo de reprodução. Você também deve adicionar o -label **bug** à issue. +Se possível inclua imagens ou vídeos à descrição do bug para facilitar o processo de reprodução. Você também deve adicionar o label **bug** à issue. ### Indicando melhorias e pedindo funcionalidades Outra ótima forma de contribuir é indicando melhorias ao código do projeto e em como ele está estruturado ou pedindo funcionalidades novas. Se você tem qualquer ideia de como podemos melhorar alguma abordagem na solução de problemas, refatoração de código, melhoria em algum recurso ou qualquer outra coisa relacionada, siga estes passos: 1. Certifique-se de que sua ideia já não esteja sendo abordada em nosso [roadmap](./ROADMAP.md); -2. Também verifique se a ideia já não está pressente em nossas [issues do GitHub](https://github.com/levxyca/diciotech/issues); +2. Verifique se a ideia já não está presente em nossas [issues do GitHub](https://github.com/levxyca/diciotech/issues). Concluindo esses dois passos, você pode [criar uma nova issue](https://github.com/levxyca/diciotech/issues/new) descrevendo as melhorias e usando o label **feature**. ### Discutindo as issues -Antes de partirmos para o código em si é muito importante discutirmos com a -comunidade como cada issue será abordada. +Antes de partirmos para o código em si é muito importante discutirmos com a comunidade como cada issue será abordada. -Issues que estão em processo de discussão devem receber o label **discussion** -indicando que aquela issue precisa dos inputs e feedbacks da -comunidade. +Issues que estão em processo de discussão devem receber o label **discussion**, indicando que aquela issue precisa de feedbacks da comunidade. ### Fazendo pull requests -Para isso faça um fork do projeto e trabalhe em cima de -um branch diferente de `main` implementando suas soluções. Para saber mais sobre -pull requests e como eles funcionam, veja -[este link](https://help.github.com/articles/about-pull-requests/). +Antes de abrir o seu PR, faça um fork do projeto e trabalhe em cima de um branch diferente da `main`, implementando suas soluções. Para saber mais sobre pull requests e como eles funcionam, veja [este link](https://help.github.com/articles/about-pull-requests/). Antes de abrir seu PR (pull request): -- Leia com atenção o [README](./README.md) do projeto -- Se atente para que tenha um issue aberta relacionada ao seu PR -- Caso não tenha, crie uma seguindo o guia de contribuição +- Leia com atenção o [README](./README.md) do projeto; +- Se atente para que tenha um issue aberta relacionada ao seu PR; +- Caso não tenha, crie uma seguindo o guia de contribuição. ### Outras formas de contribuir -Se você não trabalha com código mas quer ajudar o projeto, existe muitas outras -formas de contribuir: +Se você não trabalha com código mas quer ajudar o projeto, existe muitas outras formas de contribuir: - Ajude com a documentação do projeto; - Fale sobre o projeto nas suas redes sociais; -- Viu alguma discussão que te interessa e onde você pode acrescentar mesmo sem - conhecimento técnico? Não se acanhe e participe também nas issues do GitHub. +- Viu alguma discussão que te interessa e onde você pode acrescentar mesmo sem conhecimento técnico? Não se acanhe e participe também nas issues do GitHub. Pensou em alguma outra forma de contribuir? Compartilha com a gente! From 9f59bb2fb67075acd83f6ba3dd40b4284417f677 Mon Sep 17 00:00:00 2001 From: thiagofqs <39809188+thiagofqs@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:03:39 -0300 Subject: [PATCH 38/42] =?UTF-8?q?docs(README):=20reduzido=20quantidade=20m?= =?UTF-8?q?=C3=A1xima=20na=20listagem=20de=20pessoas=20contribuidoras?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 333db3f3..fdcd3eb3 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,14 @@ ## 🤝 Contribua -Sua ajuda é muito bem-vinda, independente da forma! Confira o arquivo [CONTRIBUTING.md](CONTRIBUTING.md) para conhecer todas as formas de contribuir com o projeto. Por exemplo, [sugerir uma nova funcionalidade](https://github.com/levxyca/diciotech/issues/new?assignees=&labels=&template=feature_request.md&title=), [reportar um problema/bug](https://github.com/levxyca/diciotech/issues/new?assignees=&labels=bug&template=bug_report.md&title=), [enviar um pull request](https://help.github.com/articles/about-pull-requests/), ou simplemente utilizar o projeto e comentar sua experiência. +Qualquer contribuição é muito bem-vinda! Confira a documentação [CONTRIBUTING.md](CONTRIBUTING.md) para conhecer todas as formas de contribuir com o projeto. Por exemplo, [sugerir uma nova funcionalidade](https://github.com/levxyca/diciotech/issues/new?assignees=&labels=&template=feature_request.md&title=), [reportar um problema/bug](https://github.com/levxyca/diciotech/issues/new?assignees=&labels=bug&template=bug_report.md&title=), [enviar um pull request](https://help.github.com/articles/about-pull-requests/) ou simplemente utilizar o projeto e comentar sua experiência. -Veja o arquivo [ROADMAP.md](ROADMAP.md) para ter uma ideia de como o projeto deve evoluir. +Verifique o arquivo [ROADMAP.md](ROADMAP.md) para se manter atualizado de como o projeto deve evoluir. -### Pessoas contribuidoras +**Trabalhando na sua primeira contribuição?** Confira também o artigo [Como Contribuir para o Open Source](https://opensource.guide/pt/how-to-contribute/). + +### Principais pessoas contribuidoras - Lista de contribuidores + Lista de contribuidores From 1570962a6c1d8990f532b6fc6e705bfdc965c42f Mon Sep 17 00:00:00 2001 From: thiagofqs <39809188+thiagofqs@users.noreply.github.com> Date: Wed, 25 Oct 2023 08:01:36 -0300 Subject: [PATCH 39/42] =?UTF-8?q?docs:=20alterado=20termos=20e=20frases=20?= =?UTF-8?q?em=20busca=20de=20palavras=20mais=20neutras=20e=20confort=C3=A1?= =?UTF-8?q?veis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 23 ++++++++++++++--------- README.md | 2 +- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6f2e9fe5..f2db3769 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # 📖 Contribua com o Diciotech -Quer contribuir conosco?! Obrigado 💙 +Quer contribuir conosco?! Gratidão 💙 Neste guia vamos explicar como funcionam os processos para que você possa contribuir com o Diciotech. @@ -43,17 +43,22 @@ ou > **Observação:** caso a sua contribuição não se alinhe com qualquer uma das tags disponíveis, listadas na seção seguinte, verifique a seção [Adicionando uma nova tag no Diciotech](#adicionando-uma-nova-tag-no-diciotech). -Antes de abrir o pull request, algumas **regras** e **requisitos** devem ser seguidos para uma maior organização e estabilidade do Diciotech. +Antes de abrir o pull request, algumas **boas práticas** devem ser seguidas para uma maior organização e estabilidade do Diciotech. + - Se o termo conter um código de exemplo, evite o escrever em uma linguagem de programação específica, faça isso **apenas** se realmente necessário; -- Um termo, de forma obrigatória, deve ser vinculado a, no mínimo, uma tag; +- Um termo, deve ser vinculado a, no mínimo, uma tag; + - Atribuir a um termo apenas as tags presentes nessa documentação, da exata mesma forma e escrita; -- Não pode haver duplicações de tags em um mesmo termo. Exemplo: `"tags": ["Conceito", "Conceito"]`; -- As tags atribuídas a um termo devem fazer total sentido com o mesmo. +- Evite duplicações de tags em um mesmo termo. Exemplo: `"tags": ["Conceito", "Conceito"]`; + +- Tome a cuidado para que as tags atribuídas a um termo façam sentido com o mesmo. + ### Adicionando uma nova tag no Diciotech -Você pode contribuir com o projeto propondo uma nova tag e a apresentando, como sugestão, por meio de uma [issue](https://github.com/levxyca/diciotech/issues) para que se possa abrir uma discussão a respeito, para uma futura adição através de pull request. As tags disponíveis **sempre** devem estar presentes nessa documentação. +Você pode contribuir com o projeto propondo uma nova tag e a apresentando, como sugestão, por meio de uma [issue](https://github.com/levxyca/diciotech/issues) para que se possa abrir uma discussão a respeito, para uma futura adição através de pull request. As tags disponíveis **sempre** vão estar presentes nessa documentação. + Tags disponíveis: @@ -68,13 +73,13 @@ Tags disponíveis: - `Paradigma`; - `Versionamento`. -Antes de criar uma issue e abrir um PR, todas as tags devem seguir algumas regras e requisitos: +Antes de criar uma issue e abrir um PR, todas as tags devem seguir algumas boas práticas: + - Todas as tags devem estar no singular; - Atualmente, as tags são _case sensitivity_, então, por padrão, apenas a primeira letra da tag deve ser maiúscula. Exemplo: Back-end, Conceito, Paradigma; - Para adicionar uma nova tag, primeiro deve criar uma issue e, caso as pessoas usuárias concordem, um pull request deve ser aberto, contendo a tag. A PR sendo aprovada, a nova tag poderá ser vinculada a um termo; -- As tags devem ser mais generalistas e categóricas, já que dispomos de um campo de pesquisa para uma busca mais específica e precisa. Exemplo de tags: Front-end, Design, Back-end; -- Não devem existir tags de linguagens de programação, bibliotecas e frameworks. Exemplo: JavaScript, C#, React.js. +- As tags devem ser mais generalistas e categóricas, já que dispomos de um campo de pesquisa para uma busca mais específica e precisa. Exemplo de tags: Front-end, Design, Back-end. ### Reportando bugs diff --git a/README.md b/README.md index fdcd3eb3..2640ac5f 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Qualquer contribuição é muito bem-vinda! Confira a documentação [CONTRIBUTING.md](CONTRIBUTING.md) para conhecer todas as formas de contribuir com o projeto. Por exemplo, [sugerir uma nova funcionalidade](https://github.com/levxyca/diciotech/issues/new?assignees=&labels=&template=feature_request.md&title=), [reportar um problema/bug](https://github.com/levxyca/diciotech/issues/new?assignees=&labels=bug&template=bug_report.md&title=), [enviar um pull request](https://help.github.com/articles/about-pull-requests/) ou simplemente utilizar o projeto e comentar sua experiência. -Verifique o arquivo [ROADMAP.md](ROADMAP.md) para se manter atualizado de como o projeto deve evoluir. +Verifique o arquivo [ROADMAP.md](ROADMAP.md) para se manter por dentro de como o projeto deve evoluir. **Trabalhando na sua primeira contribuição?** Confira também o artigo [Como Contribuir para o Open Source](https://opensource.guide/pt/how-to-contribute/). From d86e298b71ab5220d4853d8e8061d1a9d82af979 Mon Sep 17 00:00:00 2001 From: rwietter Date: Sat, 28 Oct 2023 13:54:09 -0300 Subject: [PATCH 40/42] chore: move webpack and tsconfig settings to cli --- tsconfig.json => cli/tsconfig.json | 3 +-- webpack.config.js => cli/webpack.config.js | 2 +- package.json | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) rename tsconfig.json => cli/tsconfig.json (85%) rename webpack.config.js => cli/webpack.config.js (87%) diff --git a/tsconfig.json b/cli/tsconfig.json similarity index 85% rename from tsconfig.json rename to cli/tsconfig.json index 551361c8..8b47d450 100644 --- a/tsconfig.json +++ b/cli/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "outDir": "./cli", + "outDir": "cli", "noImplicitAny": true, "allowJs": false, "moduleResolution": "node", @@ -15,6 +15,5 @@ "skipLibCheck": true, "allowSyntheticDefaultImports": true, }, - "include": ["./cli/**/*.ts", "./cli/**/*.d.ts"], "exclude": ["node_modules"] } diff --git a/webpack.config.js b/cli/webpack.config.js similarity index 87% rename from webpack.config.js rename to cli/webpack.config.js index b50aa251..d2805f4f 100644 --- a/webpack.config.js +++ b/cli/webpack.config.js @@ -17,7 +17,7 @@ module.exports = { }, output: { filename: 'bundle.js', - path: path.resolve(__dirname, 'cli', 'build'), + path: path.resolve(__dirname, 'build'), }, mode: 'production', }; \ No newline at end of file diff --git a/package.json b/package.json index f15f2d54..34886cc2 100644 --- a/package.json +++ b/package.json @@ -7,10 +7,10 @@ "license": "GPL-3.0", "description": "Um dicionário tech para pessoas que querem aprender mais sobre termos técnicos dentro da tecnologia 📖", "scripts": { - "dev": "tsx cli/index.ts --ignore node_modules", - "new": "node cli/build/bundle.js", - "inspect": "node --inspect cli/build/bundle.js", - "build": "webpack --config webpack.config.js --mode production" + "cli::dev": "tsx cli/index.ts --ignore node_modules", + "cli::inspect": "node --inspect cli/build/bundle.js", + "cli::build": "webpack --config cli/webpack.config.js --mode production", + "new": "node cli/build/bundle.js" }, "engines": { "node": ">=18.17.1" From fd7deeb52ab5cd8342c976c27c7476b70dd9292f Mon Sep 17 00:00:00 2001 From: rwietter Date: Sat, 28 Oct 2023 13:54:49 -0300 Subject: [PATCH 41/42] fix: rename variable --- cli/commands/new-term.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/commands/new-term.ts b/cli/commands/new-term.ts index 7ca5d7ef..eab52fe1 100644 --- a/cli/commands/new-term.ts +++ b/cli/commands/new-term.ts @@ -76,13 +76,13 @@ export const createNewTerm = async (): Promise => { c.cyanBright(`Deseja ${c.bold("visualizar")} o novo termo ?`) ); - const descriptionVisualized = card.description.length > 60 ? `${card.description.slice(0, 60)}...` : card.description + const truncatedDescription = card.description.length > 60 ? `${card.description.slice(0, 60)}...` : card.description if (shouldVisualizeTerm) { notePrompt( JSON.stringify({ title: card.title, - description: descriptionVisualized, + description: truncatedDescription, tags: card.tags, content: { code: card.content.code.split("\n").filter(line => line !== "") From 576319ce2f75769435b1f78c1f62032448e74fd0 Mon Sep 17 00:00:00 2001 From: rwietter Date: Sun, 30 Jun 2024 22:19:47 -0300 Subject: [PATCH 42/42] docs(cli/README.md): add documentation for CLI usage --- cli/README.md | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 cli/README.md diff --git a/cli/README.md b/cli/README.md new file mode 100644 index 00000000..ea5b004b --- /dev/null +++ b/cli/README.md @@ -0,0 +1,75 @@ +# Diciotech Command Line Interface (CLI) + +A **CLI do Diciotech** permite que você crie novos termos de forma interativa através de um terminal. Esta ferramenta foi desenvolvida usando o framework Node.js. Portanto, é necessário ter o Node.js instalado em sua máquina para utilizar a CLI. + +## Sumário + +- [Diciotech Command Line Interface (CLI)](#diciotech-command-line-interface-cli) + - [Sumário](#sumário) + - [Introdução](#introdução) + - [Instalação](#instalação) + - [Clonando o Repositório](#clonando-o-repositório) + - [Criando um novo termo](#criando-um-novo-termo) + - [Criando um novo termo com código](#criando-um-novo-termo-com-código) + - [Visualização](#visualização) + - [Contribuição](#contribuição) + +## Introdução + +A CLI do Diciotech é projetada para facilitar a criação e a gestão de termos de maneira eficiente. Este documento guiará você pelo processo de instalação, configuração e uso da ferramenta, garantindo que você possa contribuir com novos termos para o repositório do Diciotech. + +## Instalação + +Para começar, você precisa instalar o Node.js. Acesse o guia de instalação para diversos sistemas operacionais na [documentação oficial do Node.js](https://nodejs.org/en/download/) e instale uma versão a partir da `18.17.1`. + +## Clonando o Repositório + +Após instalar o Node.js, você precisa fazer um fork do projeto. Consulte o guia para [criar um fork de um repositório](https://docs.github.com/pt/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo). + +Feito isso, você pode clonar o fork do diciotech que está em seu perfil do GitHub e começar a contribuir com novos termos. Siga os passos abaixo para clonar o fork: + +1. Por exemplo, para clonar o fork, execute o seguinte comando em seu terminal (substitua `` pelo seu nome de usuário do GitHub): + ```bash + git clone https://github.com//diciotech.git + ``` + +2. Navegue até o diretório do projeto: + ```bash + cd diciotech + ``` + +3. Crie uma nova branch para adicionar o termo: + ```bash + git checkout -b my-branch-name # ou git switch -c my-branch-name + ``` + +## Criando um novo termo + +Para criar um novo termo, execute o comando `npm run new` em seu terminal. A CLI fará uma série de perguntas: + +1. Nome do termo que você deseja criar. +2. Definição que descreve o termo. +3. Categoria(s) do termo (tecla `Space` para selecionar). +4. Visualização prévia do termo antes de criá-lo. +5. Confirmação para gravar o termo. + +Após responder às perguntas, o termo será criado. Em seguida, você pode fazer um pull request para o repositório do [Diciotech](https://github.com/levxyca/diciotech.git). Consulte o guia [CONTRIBUTING](https://github.com/levxyca/diciotech/blob/main/CONTRIBUTING.md) para mais detalhes sobre como contribuir. + +## Criando um novo termo com código + +Para criar um novo termo com um exemplo de código: + +1. Localize o arquivo **code** na raiz do projeto. +2. Abra o arquivo e adicione o código que deseja incluir, devidamente indentado. +3. Execute o comando `npm run new` no seu terminal e siga os passos mencionados anteriormente. +4. Quando a CLI perguntar se você deseja visualizar o termo, selecione `Sim` para ver o termo com o código que você adicionou. + +## Visualização + + + +## Contribuição + +Quer contribuir para o Diciotech? Confira nosso guia de contribuição para aprender como você pode ajudar a melhorar e expandir o projeto. Seu feedback e suas contribuições são muito bem-vindos! + +Para mais informações, consulte o [guia de contribuição](https://github.com/levxyca/diciotech/blob/main/CONTRIBUTING.md). \ No newline at end of file