@shell-shock/plugin-console 0.2.6 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2452,25 +2452,14 @@ function ConsoleBuiltin(props) {
|
|
|
2452
2452
|
description: "A collection of helper utilities to assist in generating content meant for display in the console.",
|
|
2453
2453
|
get imports() {
|
|
2454
2454
|
return (0, defu.defu)(imports, {
|
|
2455
|
-
"@shell-shock/plugin-theme/types/theme": [
|
|
2456
|
-
|
|
2457
|
-
type: true
|
|
2458
|
-
}, {
|
|
2459
|
-
name: "ThemeSpinnerResolvedConfig",
|
|
2460
|
-
type: true
|
|
2461
|
-
}],
|
|
2462
|
-
"@shell-shock/plugin-theme/helpers/spinners": [{
|
|
2463
|
-
name: "SpinnerPreset",
|
|
2464
|
-
type: true
|
|
2465
|
-
}, { name: "resolveSpinner" }],
|
|
2466
|
-
"node:buffer": ["WithImplicitCoercion"],
|
|
2455
|
+
"@shell-shock/plugin-theme/types/theme": ["ThemeSpinnerResolvedConfig"],
|
|
2456
|
+
"@shell-shock/plugin-theme/helpers/spinners": ["SpinnerPreset", "resolveSpinner"],
|
|
2467
2457
|
"node:util": ["stripVTControlCharacters"]
|
|
2468
2458
|
});
|
|
2469
2459
|
},
|
|
2470
2460
|
get builtinImports() {
|
|
2471
2461
|
return (0, defu.defu)(builtinImports, {
|
|
2472
2462
|
utils: [
|
|
2473
|
-
"isMinimal",
|
|
2474
2463
|
"isInteractive",
|
|
2475
2464
|
"isColorSupported",
|
|
2476
2465
|
"colorSupportLevels",
|
|
@@ -2450,25 +2450,14 @@ function ConsoleBuiltin(props) {
|
|
|
2450
2450
|
description: "A collection of helper utilities to assist in generating content meant for display in the console.",
|
|
2451
2451
|
get imports() {
|
|
2452
2452
|
return defu(imports, {
|
|
2453
|
-
"@shell-shock/plugin-theme/types/theme": [
|
|
2454
|
-
|
|
2455
|
-
type: true
|
|
2456
|
-
}, {
|
|
2457
|
-
name: "ThemeSpinnerResolvedConfig",
|
|
2458
|
-
type: true
|
|
2459
|
-
}],
|
|
2460
|
-
"@shell-shock/plugin-theme/helpers/spinners": [{
|
|
2461
|
-
name: "SpinnerPreset",
|
|
2462
|
-
type: true
|
|
2463
|
-
}, { name: "resolveSpinner" }],
|
|
2464
|
-
"node:buffer": ["WithImplicitCoercion"],
|
|
2453
|
+
"@shell-shock/plugin-theme/types/theme": ["ThemeSpinnerResolvedConfig"],
|
|
2454
|
+
"@shell-shock/plugin-theme/helpers/spinners": ["SpinnerPreset", "resolveSpinner"],
|
|
2465
2455
|
"node:util": ["stripVTControlCharacters"]
|
|
2466
2456
|
});
|
|
2467
2457
|
},
|
|
2468
2458
|
get builtinImports() {
|
|
2469
2459
|
return defu(builtinImports, {
|
|
2470
2460
|
utils: [
|
|
2471
|
-
"isMinimal",
|
|
2472
2461
|
"isInteractive",
|
|
2473
2462
|
"isColorSupported",
|
|
2474
2463
|
"colorSupportLevels",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console-builtin.mjs","names":[],"sources":["../../src/components/console-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, For, Show } from \"@alloy-js/core\";\nimport type { FunctionDeclarationProps } from \"@alloy-js/typescript\";\nimport {\n ElseClause,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n InterfaceMember,\n TypeDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport {\n ClassDeclaration,\n ClassField,\n ClassMethod,\n ClassPropertyGet,\n ClassPropertySet\n} from \"@powerlines/plugin-alloy/typescript\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocExample,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { IsNotDebug, IsNotVerbose } from \"@shell-shock/core/components/helpers\";\nimport type {\n ThemeMessageVariant,\n ThemeResolvedConfig\n} from \"@shell-shock/plugin-theme\";\nimport { useColors, useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport type { AnsiColorWrappers } from \"@shell-shock/plugin-theme/helpers/ansi-utils\";\nimport {\n colorKeys,\n modifierKeys\n} from \"@shell-shock/plugin-theme/helpers/ansi-utils\";\nimport { camelCase } from \"@stryke/string-format\";\nimport { getIndefiniteArticle } from \"@stryke/string-format/vowels\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { defu } from \"defu\";\n\nexport function AnsiHelpersDeclarations() {\n return (\n <>\n <VarDeclaration\n const\n export\n name=\"beep\"\n doc=\"The ASCII Bell character, which can be used to trigger a beep sound in the console.\">\n {code` \"\\\\u0007\"; `}\n </VarDeclaration>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"cursor\"\n doc=\"An object containing ANSI escape codes for controlling the console cursor.\">\n {code` {\n to(x: number, y?: number) {\n if (!y) {\n return \\`\\\\x1B[\\${x + 1}G\\`;\n }\n\n return \\`\\\\x1B[\\${y + 1};\\${x + 1}H\\`;\n },\n move(x: number, y: number) {\n let ret = '';\n\n if (x < 0) {\n ret += \\`\\\\x1B[\\${-x}D\\`;\n } else if (x > 0) {\n ret += \\`\\\\x1B[\\${x}C\\`;\n }\n\n if (y < 0) {\n ret += \\`\\\\x1B[\\${-y}A\\`;\n } else if (y > 0) {\n ret += \\`\\\\x1B[\\${y}B\\`;\n }\n\n return ret;\n },\n up: (count = 1) => \\`\\\\x1B[\\${count}A\\`,\n down: (count = 1) => \\`\\\\x1B[\\${count}B\\`,\n forward: (count = 1) => \\`\\\\x1B[\\${count}C\\`,\n backward: (count = 1) => \\`\\\\x1B[\\${count}D\\`,\n nextLine: (count = 1) => \"\\\\x1B[E\".repeat(count),\n prevLine: (count = 1) => \"\\\\x1B[F\".repeat(count),\n left: \"\\\\x1B[G\",\n hide: \"\\\\x1B[?25l\",\n show: \"\\\\x1B[?25h\",\n save: \"\\\\x1B7\",\n restore: \"\\\\x1B8\"\n } `}\n </VarDeclaration>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"erase\"\n doc=\"An object containing ANSI escape codes for erasing parts of the console.\">\n {code` {\n screen: \"\\\\x1B[2J\",\n up: (count = 1) => \"\\\\x1B[1J\".repeat(count),\n down: (count = 1) => \"\\\\x1B[J\".repeat(count),\n line: \"\\\\x1B[2K\",\n lineEnd: \"\\\\x1B[K\",\n lineStart: \"\\\\x1B[1K\",\n lines(count: number) {\n let lineClear = \"\";\n for (let i = 0; i < count; i++) {\n lineClear += this.line + (i < count - 1 ? cursor.up() : \"\");\n }\n\n if (count) {\n lineClear += cursor.left;\n }\n\n return lineClear;\n }\n } `}\n </VarDeclaration>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"scroll\"\n doc=\"An object containing ANSI escape codes for scrolling the console.\">\n {code` {\n up: (count = 1) => \"\\\\x1B[S\".repeat(count),\n down: (count = 1) => \"\\\\x1B[T\".repeat(count)\n } `}\n </VarDeclaration>\n <Spacing />\n <FunctionDeclaration\n export\n name=\"clear\"\n doc=\"A helper function to clear the console based on a count of lines\"\n parameters={[\n {\n name: \"current\",\n type: \"string\",\n doc: \"The current console output to be cleared\"\n },\n {\n name: \"consoleWidth\",\n type: \"number\",\n doc: \"The number of characters per line in the console\"\n }\n ]}>\n {code`if (!consoleWidth) {\n return erase.line + cursor.to(0);\n }\n\n let rows = 0;\n const lines = current.split(/\\\\r?\\\\n/);\n for (let line of lines) {\n rows += 1 + Math.floor(Math.max([...stripAnsi(line)].length - 1, 0) / consoleWidth);\n }\n\n return erase.lines(rows); `}\n </FunctionDeclaration>\n <Spacing />\n </>\n );\n}\n\ntype ColorFunctionProps = Record<\n \"ansi16\" | \"ansi256\" | \"ansi16m\",\n AnsiColorWrappers\n> & {\n skipBackground?: boolean;\n};\n\n/**\n * A component to generate a console message function in a Shell Shock project.\n */\nfunction ColorFunction({\n ansi16,\n ansi256,\n ansi16m,\n skipBackground = false\n}: ColorFunctionProps) {\n return code` (text: string | number | boolean | null | undefined${\n skipBackground ? \"\" : `, background = false`\n }): string => {\n try {\n if (text === undefined || text === null || text === \"\") {\n return \"\";\n }\n\n if (!isColorSupported) {\n return String(text);\n }\n\n if (colorSupportLevels.stdout === 1) {\n return wrapAnsi(String(text), ${\n skipBackground\n ? `\"${ansi16.open}\", \"${ansi16.close}\"`\n : `background ? \"${\n ansi16.background.open\n }\" : \"${ansi16.open}\", background ? \"${\n ansi16.background.close\n }\" : \"${ansi16.close}\"`\n });\n } else if (colorSupportLevels.stdout === 2) {\n return wrapAnsi(String(text), ${\n skipBackground\n ? `\"${ansi256.open}\", \"${ansi256.close}\"`\n : `background ? \"${\n ansi256.background.open\n }\" : \"${ansi256.open}\", background ? \"${\n ansi256.background.close\n }\" : \"${ansi256.close}\"`\n });\n }\n\n return wrapAnsi(String(text), ${\n skipBackground\n ? `\"${ansi16m.open}\", \"${ansi16m.close}\"`\n : `background ? \"${ansi16m.background.open}\" : \"${\n ansi16m.open\n }\", background ? \"${ansi16m.background.close}\" : \"${ansi16m.close}\"`\n });\n } catch {\n return String(text);\n }\n }\n`;\n}\n\ninterface ThemeColorNode {\n [key: string]: AnsiColorWrappers | ThemeColorNode;\n}\n\ninterface ThemeColorDefinitionProps {\n type: string;\n subType?: string;\n ansi16: ThemeColorNode;\n ansi256: ThemeColorNode;\n ansi16m: ThemeColorNode;\n}\n\nexport function ThemeColorTypeDefinition(props: ThemeColorDefinitionProps) {\n const { ansi16, ansi256, ansi16m, type, subType } = props;\n\n return (\n <For\n each={Object.entries(ansi16)}\n semicolon\n doubleHardline\n enderPunctuation>\n {([color, value]) => (\n <>\n <Show when={isSetObject(value)}>\n <Show\n when={\"open\" in value && \"close\" in value}\n fallback={\n <>\n <TSDoc\n heading={`An object containing various ${\n subType ? `${subType} ` : \"\"\n }${color}${\n type ? ` ${type}` : \"\"\n } theme coloring functions.`}></TSDoc>\n {code` ${camelCase(color)}: { `}\n <hbr />\n <ThemeColorTypeDefinition\n ansi16={ansi16[color] as ThemeColorNode}\n ansi256={ansi256[color] as ThemeColorNode}\n ansi16m={ansi16m[color] as ThemeColorNode}\n type={subType || type}\n subType={color}\n />\n <hbr />\n {code` }`}\n </>\n }>\n <TSDoc\n heading={`A function that applies ${getIndefiniteArticle(color)} ${\n color\n }${type ? ` ${type}` : \"\"}${\n subType ? ` ${subType}` : \"\"\n } color styling to provided console text.`}>\n <TSDocRemarks>\n {`This function takes a string and an optional boolean indicating whether to apply the color as a background. It returns the input string wrapped in the appropriate ANSI escape codes for ${\n color\n }${type ? ` ${type}` : \"\"}${\n subType ? ` ${subType}` : \"\"\n } color styling, based on the terminal's color support level. If colors are not supported, it simply returns the input text as a string.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The console text to which the ${color}${\n type ? ` ${type}` : \"\"\n }${subType ? ` ${subType}` : \"\"} color styling should be applied.`}\n </TSDocParam>\n <TSDocParam name=\"background\">\n {`A boolean indicating whether to apply the color as a background. Defaults to \\`false\\`.`}\n </TSDocParam>\n <TSDocReturns>\n {`A string with ANSI escape codes applied for ${color}${\n type ? ` ${type}` : \"\"\n }${\n subType ? ` ${subType}` : \"\"\n } color styling, or the original text if the style is not supported in the current terminal.`}\n </TSDocReturns>\n </TSDoc>\n {code`${camelCase(color)}: (text: string, background?: boolean) => string`}\n </Show>\n </Show>\n </>\n )}\n </For>\n );\n}\n\nexport function ThemeColorObjectDefinition(props: ThemeColorDefinitionProps) {\n const { ansi16, ansi256, ansi16m, type, subType } = props;\n\n return (\n <For each={Object.entries(ansi16)} comma doubleHardline enderPunctuation>\n {([color, value]) => (\n <>\n <Show when={isSetObject(value)}>\n <Show\n when={\"open\" in value && \"close\" in value}\n fallback={\n <>\n <TSDoc\n heading={`An object containing various ${\n subType ? `${subType} ` : \"\"\n }${color}${\n type ? ` ${type}` : \"\"\n } theme coloring functions.`}></TSDoc>\n {code` ${camelCase(color)}: { `}\n <hbr />\n <ThemeColorObjectDefinition\n ansi16={ansi16[color] as ThemeColorNode}\n ansi256={ansi256[color] as ThemeColorNode}\n ansi16m={ansi16m[color] as ThemeColorNode}\n type={subType || type}\n subType={color}\n />\n <hbr />\n {code` }`}\n </>\n }>\n <TSDoc\n heading={`A function that applies ${getIndefiniteArticle(color)} ${\n color\n }${type ? ` ${type}` : \"\"}${\n subType ? ` ${subType}` : \"\"\n } color styling to provided console text.`}>\n <TSDocRemarks>\n {`This function takes a string and an optional boolean indicating whether to apply the color as a background. It returns the input string wrapped in the appropriate ANSI escape codes for ${\n color\n }${type ? ` ${type}` : \"\"}${\n subType ? ` ${subType}` : \"\"\n } color styling, based on the terminal's color support level. If colors are not supported, it simply returns the input text as a string.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The console text to which the ${color}${\n type ? ` ${type}` : \"\"\n }${subType ? ` ${subType}` : \"\"} color styling should be applied.`}\n </TSDocParam>\n <TSDocParam name=\"background\">\n {`A boolean indicating whether to apply the color as a background. Defaults to \\`false\\`.`}\n </TSDocParam>\n <TSDocReturns>\n {`A string with ANSI escape codes applied for ${color}${\n type ? ` ${type}` : \"\"\n }${\n subType ? ` ${subType}` : \"\"\n } color styling, or the original text if the style is not supported in the current terminal.`}\n </TSDocReturns>\n </TSDoc>\n {code`${camelCase(color)}: `}\n <ColorFunction\n ansi16={ansi16[color] as AnsiColorWrappers}\n ansi256={ansi256[color] as AnsiColorWrappers}\n ansi16m={ansi16m[color] as AnsiColorWrappers}\n />\n </Show>\n </Show>\n </>\n )}\n </For>\n );\n}\n\n/**\n * A component to generate an object containing functions for coloring text in a Shell Shock project.\n */\nexport function AnsiStyleFunctionsDeclaration() {\n const colors = useColors();\n\n return (\n <>\n <For each={modifierKeys} semicolon doubleHardline enderPunctuation>\n {modifier => (\n <>\n <TSDoc\n heading={`A function that applies ${\n modifier\n } styling to provided console text.`}>\n <TSDocRemarks>\n {`This function takes a string and an optional boolean indicating whether to apply the color as a background. It returns the input string wrapped in the appropriate ANSI escape codes for the specified color, based on the terminal's color support level. If colors are not supported, it simply returns the input text as a string.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The console text to which the ${\n modifier\n } styling should be applied.`}\n </TSDocParam>\n <TSDocReturns>\n {`A string with ANSI escape codes applied for ${\n modifier\n } styling, or the original text if the style is not supported in the current terminal.`}\n </TSDocReturns>\n </TSDoc>\n <VarDeclaration\n const\n export\n name={camelCase(modifier)}\n initializer={\n <ColorFunction\n ansi16={\n colors.ansi16[\n modifier as keyof typeof colors.ansi16\n ] as AnsiColorWrappers\n }\n ansi256={\n colors.ansi256[\n modifier as keyof typeof colors.ansi256\n ] as AnsiColorWrappers\n }\n ansi16m={\n colors.ansi16m[\n modifier as keyof typeof colors.ansi16m\n ] as AnsiColorWrappers\n }\n skipBackground={true}\n />\n }\n />\n </>\n )}\n </For>\n <Spacing />\n <For each={colorKeys} semicolon doubleHardline enderPunctuation>\n {color => (\n <>\n <TSDoc\n heading={`A helper function to color the provided text as ${color}.`}>\n <TSDocRemarks>\n {`This function takes a string and an optional boolean indicating whether to apply the color as a background. It returns the input string wrapped in the appropriate ANSI escape codes for the specified color, based on the terminal's color support level. If colors are not supported, it simply returns the input text as a string.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The console text to which the ${color} color should be applied.`}\n </TSDocParam>\n <TSDocReturns>\n {`A string with ANSI escape codes applied for ${color} color, or the original text if the color is not supported in the current terminal.`}\n </TSDocReturns>\n </TSDoc>\n <VarDeclaration\n const\n export\n name={camelCase(color)}\n initializer={\n <ColorFunction\n ansi16={\n colors.ansi16[\n color as keyof typeof colors.ansi16\n ] as AnsiColorWrappers\n }\n ansi256={\n colors.ansi256[\n color as keyof typeof colors.ansi256\n ] as AnsiColorWrappers\n }\n ansi16m={\n colors.ansi16m[\n color as keyof typeof colors.ansi16m\n ] as AnsiColorWrappers\n }\n />\n }\n />\n </>\n )}\n </For>\n <Spacing />\n\n <For\n each={Object.keys(colors.ansi16.theme)}\n semicolon\n doubleHardline\n enderPunctuation>\n {type => (\n <>\n <TSDoc\n heading={`A nested object containing functions for applying ${\n type\n } theme colors to the console.`}\n />\n <VarDeclaration\n export\n name={`${camelCase(type)}Colors`}\n initializer={\n <>\n {code` {`}\n <hbr />\n <ThemeColorObjectDefinition\n ansi16={\n colors.ansi16.theme[\n type as keyof typeof colors.ansi16.theme\n ]\n }\n ansi256={\n colors.ansi256.theme[\n type as keyof typeof colors.ansi256.theme\n ]\n }\n ansi16m={\n colors.ansi16m.theme[\n type as keyof typeof colors.ansi16m.theme\n ]\n }\n type={type}\n />\n <hbr />\n {code`}`}\n </>\n }\n />\n </>\n )}\n </For>\n <Spacing />\n </>\n );\n}\n\n/**\n * A component to generate the `splitText` function in the `shell-shock:console` builtin module.\n */\nexport function SplitTextFunctionDeclaration() {\n return (\n <>\n <FunctionDeclaration\n name=\"adjustIndex\"\n parameters={[\n {\n name: \"line\",\n type: \"string\"\n },\n {\n name: \"index\",\n type: \"number\"\n }\n ]}\n returnType=\"number\">\n {code`let adjustedIndex = 0;\n\n const segments = line.match(/\\\\x1b\\\\[(\\\\d|;)+m.*\\\\x1b\\\\[(\\\\d|;)+m/gi);\n if (segments && segments.length > 0) {\n segments.reduce((count, matched) => {\n if (count < index) {\n const stripped = stripAnsi(matched);\n if (count + stripped.length < index) {\n count += stripped.length;\n adjustedIndex += matched.length;\n } else {\n adjustedIndex += index - count + (matched.slice(0, index - count).match(/\\\\x1b\\\\[(\\\\d|;)+m/g)?.join(\"\")?.length ?? 0);\n count = index;\n }\n }\n\n return count;\n }, 0);\n } else {\n adjustedIndex = index;\n }\n\n return adjustedIndex - (line.slice(0, adjustedIndex).match(/\\\\x1b\\\\[/g)?.length ?? 0); `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"breakLine\"\n parameters={[\n {\n name: \"line\",\n type: \"string\"\n },\n {\n name: \"index\",\n type: \"number\"\n }\n ]}\n returnType=\"[string, string]\">\n {code`const first = line.slice(0, index);\n const second = line.slice(index);\n\n // Match all ANSI escape sequences in the first string\n const ansiRegex = /[\\\\x1b\\\\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=><~]))/g;\n\n const openCodes: string[] = [];\n const closeCodes: string[] = [];\n let match: RegExpExecArray | null;\n\n while ((match = ansiRegex.exec(first)) !== null) {\n const code = match[0];\n // Check if this is a reset/close code (e.g., \\\\x1b[0m, \\\\x1b[39m, \\\\x1b[49m, etc.)\n if (/\\\\x1b\\\\[(?:0|22|23|24|27|28|29|39|49)m/.test(code)) {\n // A close/reset code cancels the last open code\n openCodes.pop();\n closeCodes.pop();\n } else {\n openCodes.push(code);\n // Derive a close code: map SGR open codes to their reset counterparts\n const sgrMatch = code.match(/\\\\x1b\\\\[(\\\\d+)m/);\n if (sgrMatch) {\n const n = parseInt(sgrMatch[1]!, 10);\n let closeCode: string;\n if (n >= 30 && n <= 37) closeCode = \"\\\\x1b[39m\";\n else if (n >= 40 && n <= 47) closeCode = \"\\\\x1b[49m\";\n else if (n >= 90 && n <= 97) closeCode = \"\\\\x1b[39m\";\n else if (n >= 100 && n <= 107) closeCode = \"\\\\x1b[49m\";\n else if (n === 1) closeCode = \"\\\\x1b[22m\";\n else if (n === 2) closeCode = \"\\\\x1b[22m\";\n else if (n === 3) closeCode = \"\\\\x1b[23m\";\n else if (n === 4) closeCode = \"\\\\x1b[24m\";\n else if (n === 7) closeCode = \"\\\\x1b[27m\";\n else if (n === 8) closeCode = \"\\\\x1b[28m\";\n else if (n === 9) closeCode = \"\\\\x1b[29m\";\n else closeCode = \"\\\\x1b[0m\";\n closeCodes.push(closeCode);\n } else {\n closeCodes.push(\"\\\\x1b[0m\");\n }\n }\n }\n\n // Append close codes to the end of \"first\" (in reverse order)\n const closeSequence = closeCodes.slice().reverse().join(\"\");\n // Prepend open codes to the start of \"second\"\n const openSequence = openCodes.join(\"\");\n\n return [first.replace(/^\\\\s+/, \"\").replace(/\\\\s+$/, \"\") + closeSequence, openSequence + second.replace(/^\\\\s+/, \"\").replace(/\\\\s+$/, \"\")]; `}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"Split text into multiple lines based on a maximum length.\">\n <TSDocRemarks>\n {`This function splits the provided text into multiple lines based on the specified maximum length, ensuring that words are not broken in the middle.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The text to split into multiple lines.`}\n </TSDocParam>\n <TSDocParam name=\"maxLength\">\n {`The maximum length of each line.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"splitText\"\n parameters={[\n {\n name: \"text\",\n type: \"string\"\n },\n {\n name: \"maxLength\",\n type: \"number | SizeToken\"\n }\n ]}>\n {code`\n let line = text;\n let result = [] as string[];\n\n const calculatedMaxLength = isSizeToken(maxLength) ? calculateWidth(maxLength) : maxLength;\n while (stripAnsi(line).length > calculatedMaxLength || line.indexOf(\"\\\\n\") !== -1) {\n if (line.indexOf(\"\\\\n\") !== -1) {\n result.push(...splitText(line.slice(0, line.indexOf(\"\\\\n\")).replace(/(\\\\r)?\\\\n/, \"\"), calculatedMaxLength));\n line = line.indexOf(\"\\\\n\") + 1 < line.length\n ? line.slice(line.indexOf(\"\\\\n\") + 1)\n : \"\";\n } else {\n const index = [\" \", \"/\", \".\", \",\", \"-\", \":\", \"|\", \"@\", \"+\"].reduce((ret, split) => {\n let current = ret;\n while (stripAnsi(line).indexOf(split, current + 1) !== -1 && stripAnsi(line).indexOf(split, current + 1) <= calculatedMaxLength) {\n current = line.indexOf(split, adjustIndex(line, current + 1));\n }\n\n return current;\n }, -1);\n if (index === -1) {\n break;\n }\n\n const lines = breakLine(line, index);\n result.push(lines[0]);\n line = lines[1];\n }\n }\n\n while (stripAnsi(line).length > calculatedMaxLength) {\n const lines = breakLine(line, calculatedMaxLength);\n result.push(lines[0]);\n line = lines[1];\n }\n\n result.push(line);\n return result;\n`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `write` function in the `shell-shock:console` builtin module.\n */\nexport function WriteFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"WriteOptions\"\n doc=\"Options for writing to the console.\">\n <TSDoc heading=\"Console function to use for writing to the console\">\n <TSDocRemarks>\n {`The console function to use for writing to the console. If not specified, the default console function \\`console.log\\` will be used.`}\n </TSDocRemarks>\n <hbr />\n <TSDocDefaultValue\n type={ReflectionKind.method}\n defaultValue={`\\`console.log\\``}\n />\n </TSDoc>\n <InterfaceMember\n name=\"consoleFn\"\n optional\n type=\"(text: string) => void\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Write to the console.\">\n <TSDocRemarks>\n {`This function writes to the console, applying the appropriate padding as defined in the current theme configuration and wrapping as needed.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The text to write to the console.`}\n </TSDocParam>\n <TSDocParam name=\"options\">{`The options to apply when writing to the console.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"write\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n },\n {\n name: \"options\",\n type: \"WriteOptions\",\n default: \"{}\"\n }\n ]}>\n {code`const consoleFn = options.consoleFn ?? console.log;\n if (text === undefined || text === null || text === \"\") {\n consoleFn(\"\");\n return;\n }\n\n consoleFn(String(text)); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `writeLine` function in the `shell-shock:console` builtin module.\n */\nexport function WriteLineFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"WriteLineOptions\"\n doc=\"Options for writing a line to the console.\"\n extends={[\"WriteOptions\"]}>\n <TSDoc heading=\"Padding to apply to the line\">\n <TSDocRemarks>\n {`The amount of padding (in spaces) to apply to the line when writing to the console. This value is applied to both the left and right sides of the line. If not specified, the default padding defined in the current theme configuration will be used.`}\n </TSDocRemarks>\n </TSDoc>\n <InterfaceMember name=\"padding\" optional type=\"number\" />\n <hbr />\n <TSDoc heading=\"Color of the line text\">\n <TSDocRemarks>\n {`The color to apply to the line text when writing to the console. This can be one of the predefined color themes: \"primary\", \"secondary\", or \"tertiary\". If not specified, no specific coloring will be applied to the text (the default/system terminal text color will likely be used).`}\n </TSDocRemarks>\n <hbr />\n </TSDoc>\n <InterfaceMember\n name=\"color\"\n optional\n type='\"primary\" | \"secondary\" | \"tertiary\"'\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Write a line to the console.\">\n <TSDocRemarks>\n {`This function writes a line to the console, applying the appropriate padding as defined in the current theme configuration and wrapping as needed.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The line text to write to the console.`}\n </TSDocParam>\n <TSDocParam name=\"options\">{`The options to apply when writing the line to the console.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"writeLine\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n },\n {\n name: \"options\",\n type: \"WriteLineOptions\",\n default: \"{}\"\n }\n ]}>\n {code`const color = options.color;\n if (text === undefined || text === null || text === \"\") {\n write(\"\", options);\n return;\n }\n\n write(\\`\\${\" \".repeat(Math.max(options.padding ?? ${\n theme.padding.app\n }, 0))}\\${color ? textColors.body[color](String(text)) : String(text)}\\`, options); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport type MessageFunctionDeclarationProps = Partial<\n Pick<FunctionDeclarationProps, \"parameters\">\n> & {\n type:\n | \"success\"\n | \"help\"\n | \"info\"\n | \"debug\"\n | \"verbose\"\n | \"warn\"\n | \"danger\"\n | \"error\";\n variant: ThemeMessageVariant;\n color?: ThemeMessageVariant;\n consoleFnName: \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\";\n description: string;\n prefix?: Children;\n timestamp?: boolean;\n};\n\n/**\n * A component to generate the message functions in the `shell-shock:console` builtin module.\n */\nexport function MessageFunctionDeclaration(\n props: MessageFunctionDeclarationProps\n) {\n const {\n type,\n variant,\n consoleFnName,\n description,\n prefix,\n parameters,\n timestamp,\n color = variant\n } = props;\n\n const theme = useTheme();\n\n return (\n <>\n <TSDoc\n heading={`Write ${getIndefiniteArticle(\n description\n )} ${description} message to the console.`}>\n <TSDocRemarks>\n {`This function initializes the Powerlines environment configuration object.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"message\">\n {`The message to write to the console.`}\n </TSDocParam>\n <TSDocParam name=\"header\">\n {`An optional header to display above the message. If not provided, a default header based on the message type and variant will be used if defined in the theme configuration; otherwise, no header will be displayed.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name={type}\n parameters={\n parameters ?? [\n {\n name: \"message\",\n type: \"string\",\n optional: false\n },\n {\n name: \"header\",\n type: \"string\",\n optional: true\n }\n ]\n }>\n <Show when={Boolean(prefix)}>\n {prefix}\n <hbr />\n <hbr />\n </Show>\n {code`\n if (!message) {\n return;\n }\n\n ${\n !theme.labels.message.footer[variant] && timestamp\n ? `const timestamp = \\`\\${textColors.message.footer.${\n color\n }(new Date().toLocaleDateString())} \\${borderColors.message.outline.${\n color\n }(\"${\n theme.borderStyles.message.outline[variant].bottom\n }\")} \\${textColors.message.footer.${\n color\n }(new Date().toLocaleTimeString())}\\`; `\n : \"\"\n }\n\n writeLine(borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].topLeft\n }\") + ${\n theme.labels.message.header[variant] ||\n theme.icons.message.header[variant]\n ? `borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].top\n }\".repeat(4)) + \" \" + ${\n theme.icons.message.header[variant]\n ? `borderColors.message.outline.${color}(\"${\n theme.icons.message.header[variant]\n }\") + \" \" +`\n : \"\"\n } bold(textColors.message.header.${color}(header || \"${\n theme.labels.message.header[variant]\n }\")) + \" \" + borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].top\n }\".repeat(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2 +\n theme.borderStyles.message.outline[variant].topLeft.length +\n 4 +\n (theme.icons.message.header[variant]\n ? 2 + (theme.labels.message.header[variant] ? 0 : 1)\n : 0) +\n (theme.labels.message.header[variant]\n ? theme.labels.message.header[variant].length + 2\n : 0) +\n theme.borderStyles.message.outline[variant].topRight.length\n }, 0)))`\n : `borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].top\n }\".repeat(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2 +\n theme.borderStyles.message.outline[variant].topLeft.length +\n theme.borderStyles.message.outline[variant].topRight.length\n }, 0)))`\n } + borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].topRight\n }\"), { consoleFn: console.${consoleFnName} });\n splitText(\n message,\n Math.max(getTerminalSize().columns - ${\n (Math.max(theme.padding.app, 0) +\n Math.max(theme.padding.message, 0)) *\n 2 +\n theme.borderStyles.message.outline[variant].left.length +\n theme.borderStyles.message.outline[variant].right.length\n }, 0)\n ).forEach((line) => {\n writeLine(borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].left +\n \" \".repeat(Math.max(theme.padding.message, 0))\n }\") + textColors.message.description.${color}(line) + \" \".repeat(Math.max(getTerminalSize().columns - (stripAnsi(line).length + ${\n Math.max(theme.padding.app, 0) * 2 +\n Math.max(theme.padding.message, 0) +\n theme.borderStyles.message.outline[variant].left.length +\n theme.borderStyles.message.outline[variant].right.length\n }), 0)) + borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} });\n });\n writeLine(borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].bottomLeft\n }\") + ${\n theme.labels.message.footer[variant] || timestamp\n ? `borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].bottom\n }\".repeat(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2 +\n 4 +\n (theme.labels.message.footer[variant]\n ? theme.labels.message.footer[variant].length + 2\n : 0) +\n theme.borderStyles.message.outline[variant].bottomLeft.length +\n theme.borderStyles.message.outline[variant].bottomRight.length\n }${\n !theme.labels.message.footer[variant] && timestamp\n ? \" - (stripAnsi(timestamp).length + 2)\"\n : \"\"\n }, 0))) + \" \" + ${`bold(textColors.message.footer.${color}(${\n theme.labels.message.footer[variant]\n ? `\"${theme.labels.message.footer[variant]}\"`\n : timestamp && \"timestamp\"\n }))`} + \" \" + borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].bottom\n }\".repeat(4))`\n : `borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].bottom\n }\".repeat(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2 +\n theme.borderStyles.message.outline[variant].bottomLeft.length +\n theme.borderStyles.message.outline[variant].bottomRight.length\n }, 0)))`\n } + borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].bottomRight\n }\"), { consoleFn: console.${consoleFnName} });\n`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `wrapAnsi` function in the `shell-shock:console` builtin module.\n */\nexport function WrapAnsiFunction() {\n return (\n <>\n <TSDoc heading=\"Applies ANSI escape codes to a string.\">\n <TSDocRemarks>\n {`Split text by /\\\\\\\\x1b[\\\\[|\\\\]][0-9;]*m/ and wrap non-ANSI parts with open/closing tags.`}\n </TSDocRemarks>\n\n <TSDocExample>\n {`const result = wrapAnsi(\"Hello\\\\\\\\x1b[31mWorld\\\\\\\\x1b[0mAgain\", \"\\\\\\\\x1b[36m\", \"\\\\\\\\x1b[39\");\\nconsole.log(result); // \"\\\\\\\\x1b[36mHello\\\\\\\\x1b[39\\\\\\\\x1b[31mWorld\\\\\\\\x1b[0m\\\\\\\\x1b[36mAgain\\\\\\\\x1b[39\"`}\n </TSDocExample>\n\n <TSDocParam name=\"text\">\n {`The text to apply ANSI codes to.`}\n </TSDocParam>\n <TSDocParam name=\"open\">{`The opening ANSI code.`}</TSDocParam>\n <TSDocParam name=\"close\">{`The closing ANSI code.`}</TSDocParam>\n <TSDocReturns>{`The text with ANSI codes applied.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"wrapAnsi\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number\",\n optional: false\n },\n {\n name: \"open\",\n type: \"string\",\n optional: false\n },\n { name: \"close\", type: \"string\", optional: false }\n ]}>\n {code`const str = String(text);\n const tokens = [] as string[];\n\n let last = 0;\n let match: RegExpExecArray | null;\n while ((match = /\\\\\\\\x1b[\\\\[|\\\\]][0-9;]*m/g.exec(str)) !== null) {\n if (match.index > last) tokens.push(str.slice(last, match.index));\n tokens.push(match[0]);\n last = match.index + match[0].length;\n }\n\n if (last < str.length) {\n tokens.push(str.slice(last));\n }\n\n let result = \"\";\n for (let i = 0; i < tokens.length; i++) {\n const seg = tokens[i]!;\n if (/^\\\\\\\\x1b[\\\\[|\\\\]][0-9;]*m$/.test(seg)) {\n result += seg;\n continue;\n }\n\n if (!seg) {\n continue;\n }\n\n result += i > 0 && /^\\\\\\\\x1b[\\\\[|\\\\]][0-9;]*m$/.test(tokens[i - 1]!) && i + 1 < tokens.length && /^\\\\\\\\x1b[\\\\[|\\\\]][0-9;]*m$/.test(tokens[i + 1]!)\n ? seg\n : \\`\\${open}\\${seg}\\${close}\\`;\n }\n\n return result;\n`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `stripAnsi` function in the `shell-shock:console` builtin module.\n */\nexport function StripAnsiFunctionDeclaration() {\n return (\n <>\n <TSDoc heading=\"Removes ANSI escape codes from a string.\">\n <TSDocExample>\n {`const result = stripAnsi(\"Hello\\\\\\\\x1b[31mWorld\\\\\\\\x1b[0mAgain\"); // \"HelloWorldAgain\"`}\n </TSDocExample>\n\n <TSDocParam name=\"text\">\n {`The text to strip ANSI codes from.`}\n </TSDocParam>\n <TSDocReturns>{`The text with ANSI codes removed.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"stripAnsi\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number\",\n optional: false\n }\n ]}>\n {code`return String(text).replace(new RegExp([\n String.raw\\`[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\\`,\n String.raw\\`(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))\\`\n ].join(\"|\"), \"g\"), \"\");`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `stripAnsi` function in the `shell-shock:console` builtin module.\n */\nexport function DividerFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"DividerOptions\"\n doc=\"Options for formatting the divider line written to console.\">\n <InterfaceMember\n name=\"width\"\n optional\n type=\"number\"\n doc=\"The width of the divider line. If not specified, the divider will span the full width of the console, minus the padding.\"\n />\n <hbr />\n <TSDoc heading=\"The border of the divider line. Can be 'primary', 'secondary', 'tertiary', or 'none'. If not specified, the default border style will be used.\">\n <TSDocRemarks>\n {`The value provided will determine the border style and color based on the current theme configuration.`}\n </TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"primary\"\n />\n </TSDoc>\n <InterfaceMember\n name=\"border\"\n optional\n type='\"primary\" | \"secondary\" | \"tertiary\"'\n doc=\"The border style/color of the divider line. Can be 'primary', 'secondary', 'tertiary', or 'none'. If not specified, the default border style will be used.\"\n />\n <hbr />\n <TSDoc heading=\"Padding to apply to the line\">\n <TSDocRemarks>\n {`The amount of padding (in spaces) to apply to the line when writing to the console. This value is applied to both the left and right sides of the line. If not specified, the default padding defined in the current theme configuration will be used.`}\n </TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.number}\n defaultValue={theme.padding.app * 4}\n />\n </TSDoc>\n <InterfaceMember name=\"padding\" optional type=\"number\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Write a horizontal divider line to the console.\">\n <TSDocExample>\n {`divider({ width: 50, border: \"primary\" }); // Writes a horizontal divider line of width 50 with primary border.`}\n </TSDocExample>\n <TSDocParam name=\"options\">\n {`Options for formatting the divider line.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"divider\"\n parameters={[\n {\n name: \"options\",\n type: \"DividerOptions\",\n optional: false\n }\n ]}>\n {code`const padding = options.padding ?? ${Math.max(theme.padding.app, 1) * 4};\n const width = options.width ?? (getTerminalSize().columns - (Math.max(padding, 0) * 2));\n const border = options.border === \"tertiary\" ? borderColors.app.divider.tertiary(\"${\n theme.borderStyles.app.divider.tertiary.top\n }\") : options.border === \"secondary\" ? borderColors.app.divider.secondary(\"${\n theme.borderStyles.app.divider.secondary.top\n }\") : borderColors.app.divider.primary(\"${\n theme.borderStyles.app.divider.primary.top\n }\");\n\n writeLine(\" \".repeat(Math.max(padding - ${theme.padding.app}, 0)) + border.repeat(Math.max(width / ${\n theme.borderStyles.app.divider.primary.top.length ?? 1\n }, 0)));\n `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `link` function in the `shell-shock:console` builtin module.\n */\nexport function LinkFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <TSDoc heading=\"Render a hyperlink in the console.\">\n <TSDocParam name=\"url\">\n {`The URL to render as a hyperlink.`}\n </TSDocParam>\n <TSDocParam name=\"textOrExternal\">\n {`The text to display for the link or a boolean indicating whether the link is external. If no text is provided, the URL will be used as the text. If a boolean is provided and is true, the URL will be used as the text and the link will be rendered as an external link.`}\n </TSDocParam>\n <TSDocParam name=\"external\">\n {`A boolean indicating whether the link is external. If true, the link will be rendered as an external link.`}\n </TSDocParam>\n <TSDocReturns>{`The formatted hyperlink string.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"link\"\n parameters={[\n {\n name: \"url\",\n type: \"string\",\n optional: false\n },\n { name: \"textOrExternal\", type: \"string | boolean\", optional: true },\n { name: \"external\", type: \"boolean\", optional: true }\n ]}>\n <IfStatement condition={code`isHyperlinkSupported()`}>\n {code`return \\`\\\\x1b]8;;\\${url}\\\\u0007\\${typeof textOrExternal === \"string\" && textOrExternal ? textOrExternal : url}\\\\x1b]8;;\\\\u0007\\${external === true || textOrExternal === true ? \"${\n theme.icons.link.external\n }\" : \"\"}\\`;`}\n </IfStatement>\n <hbr />\n <IfStatement condition={code`isColorSupported`}>\n {code`return \\`\\${underline(textColors.body.link(\\`\\${url}\\`))}\\${external === true || textOrExternal === true ? \"${\n theme.icons.link.external\n }\" : \"\"}\\`;`}\n </IfStatement>\n <hbr />\n {code`return \\`\\${url}\\${external === true || textOrExternal === true ? \"${\n theme.icons.link.external\n }\" : \"\"}\\`;`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `blockquote` function declaration\n */\nexport function BlockquoteFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <Spacing />\n <TSDoc\n heading={`Format a string with blockquote styling for display in console.`}>\n <TSDocParam name=\"text\">\n {`The text to format with blockquote styling.`}\n </TSDocParam>\n <TSDocReturns>{`The formatted string with blockquote styling.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"blockquote\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n }\n ]}\n returnType=\"string\">\n {code`if (text === undefined || text === null || text === \"\") {\n return \"\";\n }\n\n const lines = splitText(\n String(text),\n Math.max(getTerminalSize().columns, 20) - 6\n );\n\n return lines.map(line => \\`\\${borderColors.app.blockquote.primary(isUnicodeSupported() ? \"${\n theme.borderStyles.app.blockquote.primary.left\n }\" : \"|\")} \\${italic(line)} \\`).join(\"\\\\n\"); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `code` function declaration\n */\nexport function CodeFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <Spacing />\n <TSDoc heading={`Format a source code string for display in console.`}>\n <TSDocParam name=\"text\">\n {`The source code text to format with code styling.`}\n </TSDocParam>\n <TSDocReturns>{`The formatted string with code styling.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"code\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n },\n {\n name: \"language\",\n type: \"string\",\n optional: true\n }\n ]}\n returnType=\"string\">\n {code`if (text === undefined || text === null || text === \"\") {\n return \"\";\n }\n\n const lines = splitText(\n String(text),\n Math.max(getTerminalSize().columns, 20)\n );\n\n return \\` \\${borderColors.app.divider.primary(\"${\n theme.borderStyles.app.divider.primary.top\n }\".repeat(4))}\\${language ? \\` \\${borderColors.app.divider.primary(language)} \\` : \"\"}\\${borderColors.app.divider.primary(\"${\n theme.borderStyles.app.divider.primary.top\n }\".repeat(getTerminalSize().columns - (language ? language.length + 2 : 0) - 5))} \\\\n\\${lines.map((line, index) => \\` \\${\" \".repeat(String(lines.length).length - String(index + 1).length)}\\${textColors.body.tertiary(index + 1)} \\${textColors.body.primary(line)}\\`).join(\"\\\\n\")}\\`; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `inlineCode` function declaration\n */\nexport function InlineCodeFunctionDeclaration() {\n return (\n <>\n <Spacing />\n <TSDoc\n heading={`Format a string with inline code styling for display in console.`}>\n <TSDocParam name=\"text\">\n {`The text to format with inline code styling.`}\n </TSDocParam>\n <TSDocReturns>{`The formatted string with inline code styling.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"inlineCode\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n }\n ]}\n returnType=\"string\">\n {code`if (text === undefined || text === null || text === \"\") {\n return \"\";\n }\n\n return textColors.body.primary(inverse(\\` \\${text} \\`), true); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `spinner` function in the `shell-shock:console` builtin module.\n */\nexport function SpinnerFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <TypeDeclaration name=\"WriteStream\">\n {`NodeJS.WriteStream;`}\n </TypeDeclaration>\n <Spacing />\n <VarDeclaration\n const\n name=\"activeHooksPerStream\"\n initializer=\"new Set();\"\n />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"SpinnerOptions\"\n doc=\"Options for configuring the spinner.\">\n <InterfaceMember\n name=\"message\"\n optional\n type=\"string\"\n doc=\"The message text to display next to the spinner. Defaults to an empty string.\"\n />\n <hbr />\n <InterfaceMember\n name=\"stream\"\n optional\n type=\"WriteStream\"\n doc=\"The output stream to write the spinner to. Defaults to process.stderr.\"\n />\n <hbr />\n <InterfaceMember\n name=\"spinner\"\n optional\n type=\"ThemeSpinnerResolvedConfig | SpinnerPreset\"\n doc=\"The spinner animation to use. Should be an object with a 'frames' property (an array of strings representing each frame of the animation) and an 'interval' property (the time in milliseconds between each frame). If not specified, a default spinner animation will be used.\"\n />\n </InterfaceDeclaration>\n\n <Spacing />\n <ClassDeclaration name=\"Spinner\">\n <ClassField name=\"frames\" isPrivateMember type=\"string[]\" />\n <hbr />\n <ClassField name=\"interval\" isPrivateMember type=\"number\" />\n <hbr />\n <ClassField name=\"currentFrame\" isPrivateMember type=\"number\">\n {code`-1`}\n </ClassField>\n <hbr />\n <ClassField\n name=\"timer\"\n isPrivateMember\n optional\n type=\"NodeJS.Timeout\"\n />\n <hbr />\n <ClassField name=\"message\" isPrivateMember type=\"string\">\n {code`\"\"`}\n </ClassField>\n <hbr />\n <ClassField name=\"stream\" isPrivateMember type=\"WriteStream\">\n {code`process.stderr`}\n </ClassField>\n <hbr />\n <ClassField name=\"lines\" isPrivateMember type=\"number\">\n {code`0`}\n </ClassField>\n <hbr />\n <ClassField\n name=\"exitHandlerBound\"\n isPrivateMember\n type=\"(signal: any) => void\">\n {code`() => {}`}\n </ClassField>\n <hbr />\n <ClassField name=\"lastSpinnerFrameTime\" isPrivateMember type=\"number\">\n {code`0`}\n </ClassField>\n <hbr />\n <ClassField name=\"isSpinning\" isPrivateMember type=\"boolean\">\n {code`false`}\n </ClassField>\n <hbr />\n <ClassField\n name=\"hookedStreams\"\n isPrivateMember\n type='Map<WriteStream, { write?: WriteStream[\"write\"]; originalWrite: WriteStream[\"write\"]; hookedWrite: WriteStream[\"write\"] }>'>\n {code`new Map()`}\n </ClassField>\n <hbr />\n <ClassField name=\"isInternalWrite\" isPrivateMember type=\"boolean\">\n {code`false`}\n </ClassField>\n <hbr />\n <ClassField name=\"isDeferringRender\" isPrivateMember type=\"boolean\">\n {code`false`}\n </ClassField>\n <Spacing />\n {code`constructor(options: SpinnerOptions = {}) {\n const spinner = (typeof options.spinner === \"string\" ? resolveSpinner(options.spinner as SpinnerPreset) : options.spinner) ?? ${JSON.stringify(\n theme.spinner\n )};\n this.#frames = spinner.frames;\n this.#interval = spinner.interval;\n\n if (options.message) {\n this.#message = options.message;\n }\n if (options.stream) {\n this.#stream = options.stream;\n }\n\n this.#exitHandlerBound = this.#exitHandler.bind(this);\n }\n\n #internalWrite(action: () => unknown) {\n this.#isInternalWrite = true;\n try {\n return action();\n } finally {\n this.#isInternalWrite = false;\n }\n }\n\n #stringifyChunk(chunk: string | Uint8Array<ArrayBufferLike> | ArrayBufferLike) {\n if (chunk === undefined || chunk === null) {\n return \"\";\n }\n\n if (typeof chunk === \"string\") {\n return chunk;\n }\n\n if (Buffer.isBuffer(chunk) || ArrayBuffer.isView(chunk)) {\n return Buffer.from(chunk).toString(\"utf8\");\n }\n\n return String(chunk);\n }\n\n #withSynchronizedOutput(action: () => unknown) {\n if (!isInteractive) {\n return action();\n }\n\n try {\n this.#write(\"\\\\u001B[?2026h\");\n return action();\n } finally {\n this.#write(\"\\\\u001B[?2026l\");\n }\n }\n\n #hookStream(stream: WriteStream) {\n if (!stream || this.#hookedStreams.has(stream) || typeof stream.write !== \"function\") {\n return;\n }\n\n if (activeHooksPerStream.has(stream)) {\n return;\n }\n\n const originalWrite = stream.write;\n const hookedWrite = ((...writeArguments: Parameters<WriteStream[\"write\"]>) => this.#hookedWrite(stream, originalWrite, writeArguments)) as WriteStream[\"write\"];\n\n this.#hookedStreams.set(stream, {originalWrite, hookedWrite});\n activeHooksPerStream.add(stream);\n stream.write = hookedWrite;\n }\n\n #installHook() {\n if (!isInteractive || this.#hookedStreams.size > 0) {\n return;\n }\n\n const streamsToHook = new Set([this.#stream]);\n if (isInteractive && (this.#stream === process.stdout || this.#stream === process.stderr)) {\n streamsToHook.add(process.stdout);\n streamsToHook.add(process.stderr);\n }\n\n for (const stream of streamsToHook) {\n this.#hookStream(stream);\n }\n }\n\n #uninstallHook() {\n for (const [stream, hookInfo] of this.#hookedStreams) {\n if (stream.write === hookInfo.hookedWrite) {\n stream.write = hookInfo.originalWrite;\n }\n\n activeHooksPerStream.delete(stream);\n }\n\n this.#hookedStreams.clear();\n }\n\n #hookedWrite(stream: WriteStream, originalWrite: typeof stream.write, writeArguments: Parameters<typeof stream.write>) {\n const [chunk, callback] = writeArguments;\n\n if (this.#isInternalWrite || !this.isSpinning) {\n return originalWrite.call(stream, chunk);\n }\n\n if (this.#lines > 0) {\n this.clear();\n }\n\n const chunkString = this.#stringifyChunk(chunk);\n const chunkTerminatesLine = chunkString.at(-1) === \"\\\\n\";\n const writeResult = originalWrite.call(stream, chunk);\n\n if (chunkTerminatesLine) {\n this.#isDeferringRender = false;\n } else if (chunkString !== \"\") {\n this.#isDeferringRender = true;\n }\n\n if (this.isSpinning && !this.#isDeferringRender) {\n this.#render();\n }\n\n return writeResult;\n }\n\n #stopWithIcon(icon: string, message: string) {\n return this.stop(\\` \\${icon} \\${message ?? this.#message}\\`);\n }\n\n #render() {\n if (this.#isDeferringRender) {\n return;\n }\n\n if (this.#currentFrame === -1 || Date.now() - this.#lastSpinnerFrameTime >= this.#interval) {\n this.#currentFrame = ++this.#currentFrame % this.#frames.length;\n this.#lastSpinnerFrameTime = Date.now();\n }\n\n let display = \\`\\${textColors.spinner.icon.active(this.#frames[this.#currentFrame])} \\${textColors.spinner.message.active(this.#message)}\\`;\n if (!isInteractive) {\n display += \"\\\\n\";\n }\n\n if (isInteractive) {\n this.#withSynchronizedOutput(() => {\n this.clear();\n this.#write(display);\n });\n } else {\n this.#write(display);\n }\n\n if (isInteractive) {\n this.#lines = this.#lineCount(display);\n }\n }\n\n #write(message: string) {\n this.#internalWrite(() => {\n this.#stream.write(message);\n });\n }\n\n #lineCount(message: string) {\n const width = this.#stream.columns ?? 80;\n const lines = stripVTControlCharacters(message).split(\"\\\\n\");\n\n let lineCount = 0;\n for (const line of lines) {\n lineCount += Math.max(1, Math.ceil(line.length / width));\n }\n\n return lineCount;\n }\n\n #hideCursor() {\n if (isInteractive) {\n this.#write(\"\\\\u001B[?25l\");\n }\n }\n\n #showCursor() {\n if (isInteractive) {\n this.#write(\"\\\\u001B[?25h\");\n }\n }\n\n #subscribeToProcessEvents() {\n process.once(\"SIGINT\", this.#exitHandlerBound);\n process.once(\"SIGTERM\", this.#exitHandlerBound);\n }\n\n #unsubscribeFromProcessEvents() {\n process.off(\"SIGINT\", this.#exitHandlerBound);\n process.off(\"SIGTERM\", this.#exitHandlerBound);\n }\n\n #exitHandler(signal: any) {\n if (this.isSpinning) {\n this.stop();\n }\n\n process.exit(signal === \"SIGINT\" ? 130 : (signal === \"SIGTERM\" ? 143 : 1));\n } `}\n <ClassPropertyGet\n public\n name=\"isSpinning\"\n type=\"boolean\"\n doc=\"Whether the spinner is currently active and spinning.\">\n {code`return this.#isSpinning;`}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertySet\n public\n name=\"message\"\n type=\"string\"\n doc=\"Set the message displayed by the spinner.\">\n {code`this.#message = value;`}\n </ClassPropertySet>\n <Spacing />\n <ClassPropertyGet\n public\n name=\"message\"\n type=\"string\"\n doc=\"Get the message displayed by the spinner.\">\n {code`return this.#message;`}\n </ClassPropertyGet>\n <Spacing />\n <ClassMethod\n name=\"start\"\n doc=\"Start the spinner animation.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n <IfStatement condition={code`message !== undefined`}>\n {code`this.#message = message;`}\n </IfStatement>\n <IfStatement condition={code`this.isSpinning`}>\n {code`return this;`}\n </IfStatement>\n {code`this.#isSpinning = true;\n this.#hideCursor();\n this.#installHook();\n this.#render();\n this.#subscribeToProcessEvents();\n\n if (isInteractive) {\n this.#timer = setInterval(() => {\n this.#render();\n }, this.#interval);\n }\n\n return this;\n `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"stop\"\n doc=\"Stop the spinner animation.\"\n parameters={[\n { name: \"finalMessage\", optional: true, type: \"string\" }\n ]}>\n {code`if (!this.isSpinning) {\n return this;\n }\n\n const shouldWriteNewline = this.#isDeferringRender;\n this.#isSpinning = false;\n if (this.#timer) {\n clearInterval(this.#timer);\n this.#timer = undefined;\n }\n\n this.#isDeferringRender = false;\n this.#uninstallHook();\n this.#showCursor();\n this.clear();\n this.#unsubscribeFromProcessEvents();\n\n if (finalMessage) {\n const prefix = shouldWriteNewline ? \"\\\\n\" : \"\";\n this.#stream.write(\\`\\${prefix}\\${finalMessage}\\\\n\\`);\n }\n\n return this;\n\n `}\n </ClassMethod>\n <Spacing />\n <ClassMethod name=\"clear\" doc=\"Clear the spinner animation.\">\n {code`if (!isInteractive) {\n return this;\n }\n\n if (this.#lines === 0) {\n return this;\n }\n\n this.#internalWrite(() => {\n this.#stream.cursorTo(0);\n\n for (let index = 0; index < this.#lines; index++) {\n if (index > 0) {\n this.#stream.moveCursor(0, -1);\n }\n\n this.#stream.clearLine(1);\n }\n });\n\n this.#lines = 0;\n return this; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"success\"\n doc=\"Mark the spinner as successful.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n {code`return this.#stopWithIcon(textColors.spinner.icon.success(\"${\n theme.icons.spinner.success\n }\"), textColors.spinner.message.success(message)); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"error\"\n doc=\"Mark the spinner as failed.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n {code`return this.#stopWithIcon(textColors.spinner.icon.error(\"${\n theme.icons.spinner.error\n }\"), textColors.spinner.message.error(message)); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"warning\"\n doc=\"Mark the spinner as warning.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n {code`return this.#stopWithIcon(textColors.spinner.icon.warning(\"${\n theme.icons.spinner.warning\n }\"), textColors.spinner.message.warning(message)); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"info\"\n doc=\"Mark the spinner as informational.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n {code`return this.#stopWithIcon(textColors.spinner.icon.info(\"${\n theme.icons.spinner.info\n }\"), textColors.spinner.message.info(message)); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"help\"\n doc=\"Mark the spinner as help.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n {code`return this.#stopWithIcon(textColors.spinner.icon.help(\"${\n theme.icons.spinner.help\n }\"), textColors.spinner.message.help(message)); `}\n </ClassMethod>\n <Spacing />\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"Render a spinner in the console.\">\n <TSDocParam name=\"options\">\n {`Options for configuring the spinner, including the message to display, the output stream to write to, and the spinner animation to use.`}\n </TSDocParam>\n <TSDocReturns>{`An instance of the Spinner class, which can be used to control the spinner animation (e.g., start, stop, mark as success/error, etc.).`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"createSpinner\"\n parameters={[\n {\n name: \"options\",\n type: \"SpinnerOptions\",\n optional: true\n }\n ]}>\n {code`return new Spinner(options);`}\n </FunctionDeclaration>\n </>\n );\n}\n\nfunction extractBorderOptionsObject(\n direction:\n | \"top\"\n | \"right\"\n | \"bottom\"\n | \"left\"\n | \"topLeft\"\n | \"topRight\"\n | \"bottomLeft\"\n | \"bottomRight\",\n theme: ThemeResolvedConfig\n): string {\n return `borderOptions.${\n direction\n } === \"primary\" ? borderColors.app.table.primary(\"${\n theme.borderStyles.app.table.primary[direction]\n }\") : borderOptions.${\n direction\n } === \"secondary\" ? borderColors.app.table.secondary(\"${\n theme.borderStyles.app.table.secondary[direction]\n }\") : borderOptions.${\n direction\n } === \"tertiary\" ? borderColors.app.table.tertiary(\"${\n theme.borderStyles.app.table.tertiary[direction]\n }\") : !borderOptions.${direction} || borderOptions.${\n direction\n } === \"none\" ? \"\" : borderOptions.${direction}`;\n}\n\nfunction extractBorderOptionsString(\n direction:\n | \"top\"\n | \"right\"\n | \"bottom\"\n | \"left\"\n | \"topLeft\"\n | \"topRight\"\n | \"bottomLeft\"\n | \"bottomRight\",\n theme: ThemeResolvedConfig\n): string {\n return `borderOptions === \"primary\" ? borderColors.app.table.primary(\"${\n theme.borderStyles.app.table.primary[direction]\n }\") : borderOptions === \"secondary\" ? borderColors.app.table.secondary(\"${\n theme.borderStyles.app.table.secondary[direction]\n }\") : borderOptions === \"tertiary\" ? borderColors.app.table.tertiary(\"${\n theme.borderStyles.app.table.tertiary[direction]\n }\") : !borderOptions || borderOptions === \"none\" ? \"\" : borderOptions`;\n}\n\n/**\n * Props for the TableFunctionDeclaration component.\n */\nexport type TableFunctionDeclarationProps = Omit<\n FunctionDeclarationProps,\n \"parameters\" | \"name\"\n>;\n\n/**\n * A component to generate the table functions in the `shell-shock:console` builtin module.\n */\nexport function TableFunctionDeclaration(props: TableFunctionDeclarationProps) {\n const theme = useTheme();\n\n return (\n <>\n <TypeDeclaration\n export\n name=\"SizeToken\"\n doc=\"A type representing the width size of an item in the console.\">\n {code`\"full\" | \"1/1\" | \"1/2\" | \"1/3\" | \"1/4\" | \"1/5\" | \"1/6\" | \"1/12\" | \"1/24\" | \"100%\" | \"50%\" | \"33.33%\" | \"25%\" | \"20%\" | \"10%\" | \"5%\" | \"2.5%\"`}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Determine if a value is a valid size token.\">\n <TSDocRemarks>\n {`This function checks if the provided value is a valid size token, which can be one of the predefined strings representing common width sizes (e.g., \"full\", \"1/2\", \"1/3\", etc.) or percentage strings (e.g., \"50%\").`}\n </TSDocRemarks>\n <TSDocParam name=\"value\">{`The value to check for being a valid size token.`}</TSDocParam>\n <TSDocReturns>{`True if the value is a valid size token, false otherwise.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n doc=\"Determines if the provided value is a valid size token.\"\n name=\"isSizeToken\"\n parameters={[\n {\n name: \"value\",\n type: \"any\"\n }\n ]}\n returnType=\"value is SizeToken\">\n <IfStatement\n condition={code`[\"full\", \"1/1\", \"1/2\", \"1/3\", \"1/4\", \"1/5\", \"1/6\", \"1/12\", \"1/24\", \"100%\", \"50%\", \"33.33%\", \"25%\", \"20%\", \"10%\", \"5%\", \"2.5%\"].includes(value)`}>\n {code`return true; `}\n </IfStatement>\n {code`return false; `}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"Calculate the width in characters based on the provided width size.\">\n <TSDocRemarks>\n {`This function calculates the width in characters based on the provided width size, which can be a predefined string (e.g., \"full\", \"1/2\", \"1/3\", etc.) or a percentage string (e.g., \"50%\"). The calculation is based on the current width of the console (getTerminalSize().columns).`}\n </TSDocRemarks>\n <TSDocParam name=\"size\">\n {`The width size to calculate. This can be a predefined string (e.g., \"full\", \"1/2\", \"1/3\", etc.) or a percentage string (e.g., \"50%\").`}\n </TSDocParam>\n <TSDocReturns>{`The calculated width in characters.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"calculateWidth\"\n parameters={[\n {\n name: \"size\",\n type: \"SizeToken\",\n optional: false\n }\n ]}\n returnType=\"number\">\n <IfStatement condition={code`[\"full\", \"100%\", \"1/1\"]. includes(size)`}>\n {code`return getTerminalSize().columns;`}\n </IfStatement>\n <ElseIfClause condition={code`[\"1/2\", \"50%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 2);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/3\", \"33.33%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 3);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/4\", \"25%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 4);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/5\", \"20%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 5);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/6\", \"10%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 6);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/12\", \"5%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 12);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/24\", \"2.5%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 24);`}\n </ElseIfClause>\n <ElseClause>\n {code`\n const match = size.match(/(\\\\d+(\\\\.\\\\d+)?)%/);\n if (match) {\n return Math.round((getTerminalSize().columns * parseFloat(match[1])) / 100);\n }\n\n throw new Error(\\`Invalid width size: \\${size}\\`);\n `}\n </ElseClause>\n <Spacing />\n </FunctionDeclaration>\n\n <TypeDeclaration\n export\n name=\"BorderOption\"\n doc=\"The border options applied to table cells.\">\n {code`\"primary\" | \"secondary\" | \"tertiary\" | \"none\" | string; `}\n </TypeDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"TableOutputOptions\"\n doc=\"Options to customize the output of the {@link table} function.\">\n <TSDoc heading=\"Border variant for the table cell.\">\n <TSDocRemarks>\n {`The border variant to use for the table cell. This determines the color and style of the border around the cell.`}\n </TSDocRemarks>\n <hbr />\n <TSDocDefaultValue\n type={ReflectionKind.property}\n defaultValue=\"primary\"\n />\n </TSDoc>\n <InterfaceMember\n name=\"border\"\n optional\n type=\"BorderOption | { top?: BorderOption; right?: BorderOption; bottom?: BorderOption; left?: BorderOption; topLeft?: BorderOption; topRight?: BorderOption; bottomLeft?: BorderOption; bottomRight?: BorderOption; }\"\n />\n <hbr />\n <TSDoc heading=\"Padding for the table cell.\">\n <TSDocRemarks>\n {`The amount of padding (in spaces) to apply to the table cell. This value is applied to both the left and right sides of the cell. If not specified, the default table padding defined in the current theme configuration will be used.`}\n </TSDocRemarks>\n <hbr />\n <TSDocDefaultValue\n type={ReflectionKind.property}\n defaultValue={`\\`${theme.padding.table}\\``}\n />\n </TSDoc>\n <InterfaceMember name=\"padding\" optional type=\"number\" />\n <hbr />\n <TSDoc heading=\"Alignment for the table cell.\">\n <TSDocRemarks>\n {`The alignment for the table cell. This determines how the text within the cell is aligned. If not specified, the default alignment is \"left\".`}\n </TSDocRemarks>\n <hbr />\n <TSDocDefaultValue\n type={ReflectionKind.property}\n defaultValue=\"left\"\n />\n </TSDoc>\n <InterfaceMember\n name=\"align\"\n optional\n type='\"left\" | \"right\" | \"center\"'\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"TableCellOptions\"\n extends=\"TableOutputOptions\"\n doc=\"Options for a specific table cell provided to the {@link table} function.\">\n <InterfaceMember\n name=\"value\"\n optional\n type=\"string\"\n doc=\"The actual string value of the table cell.\"\n />\n <hbr />\n <TSDoc heading=\"Width of the table cell.\">\n <TSDocRemarks>\n {`The width of the table cell (where 1 is a single character in the terminal). If not specified, the width will be determined based on the content of the cell and the available space in the console.`}\n </TSDocRemarks>\n </TSDoc>\n <InterfaceMember\n name=\"maxWidth\"\n type=\"number | SizeToken | undefined\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"TableRowOptions\"\n extends=\"TableOutputOptions\"\n doc=\"Options for a specific table row provided to the {@link table} function.\">\n <InterfaceMember\n name=\"values\"\n optional\n type=\"(string | TableCellOptions)[]\"\n doc=\"The actual string values of the table row's cells.\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"TableOptions\"\n extends=\"TableOutputOptions\"\n doc=\"Options for a specific table cell provided to the {@link table} function.\">\n <InterfaceMember\n name=\"values\"\n optional\n type=\"(string | TableCellOptions)[][]\"\n doc=\"The actual string values of the table's rows' cells.\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"Dimensions\"\n doc=\"The height and width for a specific table/cell used internally in the {@link table} function.\">\n <InterfaceMember\n name=\"height\"\n type=\"number\"\n doc=\"The height of the row/cell (where 1 is a single line in the terminal).\"\n />\n <hbr />\n <InterfaceMember\n name=\"width\"\n type=\"number\"\n doc=\"The width of the row/cell (where 1 is a single character in the terminal).\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"TableCellBorder\"\n doc=\"The resolved complete border styles for a table cell.\">\n <InterfaceMember\n name=\"top\"\n type=\"string\"\n doc=\"The top border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"bottom\"\n type=\"string\"\n doc=\"The bottom border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"right\"\n type=\"string\"\n doc=\"The right border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"left\"\n type=\"string\"\n doc=\"The left border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"topLeft\"\n type=\"string\"\n doc=\"The top-left border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"topRight\"\n type=\"string\"\n doc=\"The top-right border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"bottomLeft\"\n type=\"string\"\n doc=\"The bottom-left border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"bottomRight\"\n type=\"string\"\n doc=\"The bottom-right border style of the table cell.\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <TypeDeclaration\n name=\"TableCell\"\n doc=\"The internal state of a formatted table cell in the {@link table} function.\">\n {code`Required<Omit<TableCellOptions, \"maxWidth\" | \"border\">> & Dimensions & {\n border: TableCellBorder;\n maxWidth?: number;\n };\n `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Write a table to the console.\">\n <TSDocRemarks>\n {`This function writes a table to the console, applying the appropriate padding as defined in the current theme configuration and wrapping as needed.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"options\">\n {`Options to customize the table output.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n {...props}\n name=\"table\"\n parameters={[\n {\n name: \"options\",\n type: \"TableOptions | TableRowOptions[] | TableCellOptions[][] | string[] | string[][]\",\n optional: false\n }\n ]}>\n <IfStatement\n condition={code`!options ||\n (!Array.isArray(options) && (typeof options !== \"object\" || !options.values || !Array.isArray(options.values) || options.values.length === 0)) ||\n (Array.isArray(options) && !options.every(item => typeof item === \"object\" || typeof item === \"string\" || Array.isArray(item))) `}>\n {code`return;`}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n let\n name=\"cells\"\n type={`TableCell[][]`}\n initializer={code`[];`}\n />\n <hbr />\n {code`\n const extractTableCell = (cell: string | TableCellOptions, columnIndex: number, rowLength: number, opts?: TableOutputOptions): TableCell => {\n if (typeof cell === \"string\") {\n const borderOptions = opts?.border || \"primary\";\n\n let border = {} as TableCellBorder;\n if (typeof borderOptions === \"object\") {\n border = {\n top: ${extractBorderOptionsObject(\"top\", theme)},\n bottom: ${extractBorderOptionsObject(\"bottom\", theme)},\n left: ${extractBorderOptionsObject(\"left\", theme)},\n right: ${extractBorderOptionsObject(\"right\", theme)},\n topLeft: ${extractBorderOptionsObject(\"topLeft\", theme)},\n topRight: ${extractBorderOptionsObject(\"topRight\", theme)},\n bottomLeft: ${extractBorderOptionsObject(\"bottomLeft\", theme)},\n bottomRight: ${extractBorderOptionsObject(\"bottomRight\", theme)},\n };\n } else {\n border.top = ${extractBorderOptionsString(\"top\", theme)};\n border.bottom = ${extractBorderOptionsString(\"bottom\", theme)};\n border.left = ${extractBorderOptionsString(\"left\", theme)};\n border.right = ${extractBorderOptionsString(\"right\", theme)};\n border.topLeft = ${extractBorderOptionsString(\"topLeft\", theme)};\n border.topRight = ${extractBorderOptionsString(\"topRight\", theme)};\n border.bottomLeft = ${extractBorderOptionsString(\"bottomLeft\", theme)};\n border.bottomRight = ${extractBorderOptionsString(\"bottomRight\", theme)};\n }\n\n const padding = Math.max(0, opts?.padding ?? ${theme.padding.table}) * (columnIndex === 0 || columnIndex === rowLength - 1 ? 2 : 1);\n const value = cell ?? \"\";\n const width = stripAnsi(value).length + padding * 2;\n\n return {\n value,\n height: 1,\n width,\n border,\n padding,\n align: opts?.align || \"left\",\n };\n } else {\n const borderOptions = cell.border || opts?.border || \"primary\";\n\n let border = {} as TableCellBorder;\n if (typeof borderOptions === \"object\") {\n border = {\n top: ${extractBorderOptionsObject(\"top\", theme)},\n bottom: ${extractBorderOptionsObject(\"bottom\", theme)},\n left: ${extractBorderOptionsObject(\"left\", theme)},\n right: ${extractBorderOptionsObject(\"right\", theme)},\n topLeft: ${extractBorderOptionsObject(\"topLeft\", theme)},\n topRight: ${extractBorderOptionsObject(\"topRight\", theme)},\n bottomLeft: ${extractBorderOptionsObject(\"bottomLeft\", theme)},\n bottomRight: ${extractBorderOptionsObject(\"bottomRight\", theme)},\n };\n } else {\n border.top = ${extractBorderOptionsString(\"top\", theme)};\n border.bottom = ${extractBorderOptionsString(\"bottom\", theme)};\n border.left = ${extractBorderOptionsString(\"left\", theme)};\n border.right = ${extractBorderOptionsString(\"right\", theme)};\n border.topLeft = ${extractBorderOptionsString(\"topLeft\", theme)};\n border.topRight = ${extractBorderOptionsString(\"topRight\", theme)};\n border.bottomLeft = ${extractBorderOptionsString(\"bottomLeft\", theme)};\n border.bottomRight = ${extractBorderOptionsString(\"bottomRight\", theme)};\n }\n\n const padding = Math.max(0, cell.padding ?? opts?.padding ?? ${\n theme.padding.table\n });\n const value = cell.value ?? \"\";\n const width = stripAnsi(value).length + padding * 2;\n const maxWidth = cell.maxWidth ? typeof cell.maxWidth === \"number\" ? cell.maxWidth : calculateWidth(cell.maxWidth) : undefined;\n\n return {\n value,\n height: 1,\n width,\n maxWidth,\n border,\n padding,\n align: cell.align || opts?.align || \"left\",\n };\n }\n };\n\n let colMaxWidths = [] as (number | undefined)[];\n `}\n <hbr />\n <IfStatement condition={code`Array.isArray(options)`}>\n <IfStatement\n condition={code`options.every(row => typeof row === \"string\" || (typeof row === \"object\" && !Array.isArray(row) && !(\"values\" in row)))`}>\n {code`cells.push(options.map((cell, index) => extractTableCell(cell as string | TableCellOptions, index, options.length)));`}\n </IfStatement>\n <ElseClause>\n {code`\n cells.push(\n ...options.map(row => Array.isArray(row)\n ? row.reduce((cellRow, cell, index) => {\n if (colMaxWidths.length <= index) {\n colMaxWidths.push(undefined);\n }\n const newCell = extractTableCell(cell, index, row.length);\n if (newCell.maxWidth && (!colMaxWidths[index] || newCell.maxWidth < colMaxWidths[index]!)) {\n colMaxWidths[index] = newCell.maxWidth;\n }\n cellRow.push(newCell);\n return cellRow;\n }, [] as TableCell[])\n : (row as TableRowOptions).values?.reduce((cellRow, cell, index) => {\n if (colMaxWidths.length <= index) {\n colMaxWidths.push(undefined);\n }\n const newCell = extractTableCell(cell, index, (row as TableRowOptions).values?.length ?? 1, row as TableRowOptions);\n if (newCell.maxWidth && (!colMaxWidths[index] || newCell.maxWidth < colMaxWidths[index]!)) {\n colMaxWidths[index] = newCell.maxWidth;\n }\n cellRow.push(newCell);\n return cellRow;\n }, [] as TableCell[]) ?? []\n )\n );\n `}\n </ElseClause>\n </IfStatement>\n <ElseClause>\n {code`\n cells.push(\n ...options.values!.map(row => Array.isArray(row)\n ? row.reduce((cellRow, cell, index) => {\n if (colMaxWidths.length <= index) {\n colMaxWidths.push(undefined);\n }\n const newCell = extractTableCell(cell, index, row.length);\n if (newCell.maxWidth && (!colMaxWidths[index] || newCell.maxWidth < colMaxWidths[index]!)) {\n colMaxWidths[index] = newCell.maxWidth;\n }\n cellRow.push(newCell);\n return cellRow;\n }, [] as TableCell[])\n : (row as TableRowOptions).values?.reduce((cellRow, cell, index) => {\n if (colMaxWidths.length <= index) {\n colMaxWidths.push(undefined);\n }\n const newCell = extractTableCell(cell, index, (row as TableRowOptions).values?.length ?? 1, options);\n if (newCell.maxWidth && (!colMaxWidths[index] || newCell.maxWidth < colMaxWidths[index]!)) {\n colMaxWidths[index] = newCell.maxWidth;\n }\n cellRow.push(newCell);\n return cellRow;\n }, [] as TableCell[]) ?? []\n )\n );\n\n `}\n </ElseClause>\n <hbr />\n {code`\ncells = cells.filter(row => row.length > 0);\nif (cells.length === 0) {\n return;\n}\n\ncells.forEach(row => row.forEach((cell, index) => {\n if (colMaxWidths[index] && cell.maxWidth !== colMaxWidths[index]!) {\n cell.maxWidth = colMaxWidths[index]!;\n }\n}));\n\n// Calculate table dimensions\nlet colWidths = [] as number[];\nlet rowDims = [] as Dimensions[];\n\nconst calculateRowDimensions = () => {\n colWidths = [];\n return cells.reduce((dims, row) => {\n dims.push(row.reduce((dim, cell, index) => {\n dim.width += cell.width;\n if (cell.height > dim.height) {\n dim.height = cell.height;\n }\n if (!colWidths[index] || cell.width > colWidths[index]!) {\n colWidths[index] = cell.width;\n }\n\n return dim;\n }, { width: 0, height: 0 } as Dimensions));\n\n return dims;\n }, [] as Dimensions[]);\n}\n\nlet recalculate!: boolean;\ndo {\n recalculate = false;\n rowDims = calculateRowDimensions();\n\n if (!recalculate && colWidths.some((colWidth, index) => colMaxWidths[index] && colWidth > colMaxWidths[index]!)) {\n (colWidths.map((colWidth, index) => colMaxWidths[index] && colWidth > colMaxWidths[index]! ? index : undefined).filter(colWidth => colWidth !== undefined) as number[]).forEach(index => {\n cells.forEach(row => {\n const cell = row[index]!;\n if (colMaxWidths[index] && cell.width > colMaxWidths[index]) {\n const lines = splitText(\n cell.value,\n colMaxWidths[index] - cell.padding * 2,\n );\n\n cell.value = lines.join(\"\\\\n\");\n cell.height = lines.length;\n cell.width = Math.max(...lines.map(line => stripAnsi(line).length)) + cell.padding * 2;\n\n recalculate = true;\n }\n });\n });\n }\n\n rowDims.forEach((row, rowIndex) => {\n if (!recalculate && row.width > Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2\n }, 0)) {\n const cell = cells[rowIndex]!.reduce((largestCell, cell) => {\n if (cell.width > largestCell.width) {\n return cell;\n }\n return largestCell;\n }, cells[rowIndex]![0]!);\n\n const lines = splitText(\n cell.value,\n Math.min(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2\n } - (row.width - (cell.width - cell.padding * 2)), 0),\n cell.maxWidth ?? Number.POSITIVE_INFINITY)\n );\n\n cell.value = lines.join(\"\\\\n\");\n cell.height = lines.length;\n cell.width = Math.max(...lines.map(line => stripAnsi(line).length)) + cell.padding * 2;\n\n recalculate = true;\n }\n });\n\n if (!recalculate && colWidths.reduce((a, b) => a + b, 0) > Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2\n }, 0)) {\n let colIndex = 0;\n const cell = cells.reduce((ret, row) => {\n return row.reduce((largest, current, index) => {\n if (largest.width < current.width) {\n colIndex = index;\n return current;\n }\n return largest;\n }, ret);\n }, cells[0]![0]!);\n\n const lines = splitText(\n cell.value,\n Math.min(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2\n } - (colWidths.filter((_, i) => i !== colIndex).reduce((a, b) => a + b, 0)) - cell.padding * 2, 0),\n cell.maxWidth ?? Number.POSITIVE_INFINITY)\n );\n\n cell.value = lines.join(\"\\\\n\");\n cell.height = lines.length;\n cell.width = Math.max(...lines.map(line => stripAnsi(line).length)) + cell.padding * 2;\n\n recalculate = true;\n }\n} while (recalculate);\n\n// Render table\ncells.forEach((row, rowIndex) => {\n const outputs = [] as string[][];\n row.forEach((cell, colIndex) => {\n const lines = cell.value.split(\"\\\\n\");\n while (lines.length < rowDims[rowIndex]!.height) {\n lines.push(\"\");\n }\n\n outputs.push(lines.map(line => {\n let paddedContent = \"\";\n switch (cell.align) {\n case \"right\":\n paddedContent = \" \".repeat(Math.max(colWidths[colIndex] - stripAnsi(line).length - cell.padding, 0)) + line + \" \".repeat(cell.padding);\n break;\n case \"center\":\n const leftPadding = Math.floor((colWidths[colIndex] - stripAnsi(line).length - cell.padding) / 2);\n const rightPadding = colWidths[colIndex] - stripAnsi(line).length - leftPadding;\n paddedContent = \" \".repeat(leftPadding) + line + \" \".repeat(rightPadding);\n break;\n case \"left\":\n default:\n paddedContent = \" \".repeat(cell.padding) + line + \" \".repeat(Math.max(colWidths[colIndex] - stripAnsi(line).length - cell.padding, 0));\n break;\n }\n\n if (colIndex === row.length - 1) {\n return cell.border.left + paddedContent + cell.border.right;\n } else {\n return cell.border.left + paddedContent;\n }\n }));\n });\n\n for (let index = 0; index < rowDims[rowIndex]!.height; index++) {\n writeLine(outputs.map(output => output[index] ?? \"\").join(\"\"));\n }\n});\n`}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport type ConsoleBuiltinProps = Pick<\n BuiltinFileProps,\n \"children\" | \"imports\" | \"builtinImports\"\n>;\n\n/**\n * A built-in console utilities module for Shell Shock.\n */\nexport function ConsoleBuiltin(props: ConsoleBuiltinProps) {\n const { children, imports, builtinImports } = props;\n\n return (\n <BuiltinFile\n id=\"console\"\n description=\"A collection of helper utilities to assist in generating content meant for display in the console.\"\n imports={defu(imports, {\n \"@shell-shock/plugin-theme/types/theme\": [\n { name: \"ThemeColorsResolvedConfig\", type: true },\n { name: \"ThemeSpinnerResolvedConfig\", type: true }\n ],\n \"@shell-shock/plugin-theme/helpers/spinners\": [\n { name: \"SpinnerPreset\", type: true },\n { name: \"resolveSpinner\" }\n ],\n \"node:buffer\": [\"WithImplicitCoercion\"],\n \"node:util\": [\"stripVTControlCharacters\"]\n })}\n builtinImports={defu(builtinImports, {\n utils: [\n \"isMinimal\",\n \"isInteractive\",\n \"isColorSupported\",\n \"colorSupportLevels\",\n \"isUnicodeSupported\",\n \"isHyperlinkSupported\",\n \"getTerminalSize\"\n ],\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n state: [\"hasFlag\"]\n })}>\n <AnsiHelpersDeclarations />\n <Spacing />\n <StripAnsiFunctionDeclaration />\n <Spacing />\n <WrapAnsiFunction />\n <Spacing />\n <AnsiStyleFunctionsDeclaration />\n <Spacing />\n <WriteFunctionDeclaration />\n <Spacing />\n <WriteLineFunctionDeclaration />\n <Spacing />\n <SplitTextFunctionDeclaration />\n <Spacing />\n <LinkFunctionDeclaration />\n <Spacing />\n <DividerFunctionDeclaration />\n <Spacing />\n <SpinnerFunctionDeclaration />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"help\"\n variant=\"help\"\n consoleFnName=\"log\"\n description=\"help\"\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"success\"\n variant=\"success\"\n consoleFnName=\"info\"\n description=\"success\"\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"info\"\n variant=\"info\"\n consoleFnName=\"info\"\n description=\"informational\"\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"debug\"\n variant=\"debug\"\n consoleFnName=\"debug\"\n description=\"debug\"\n timestamp\n prefix={\n <IfStatement condition={<IsNotDebug />}>{code`return; `}</IfStatement>\n }\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"verbose\"\n variant=\"info\"\n color=\"debug\"\n consoleFnName=\"debug\"\n description=\"verbose\"\n timestamp\n prefix={\n <IfStatement\n condition={<IsNotVerbose />}>{code`return; `}</IfStatement>\n }\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"warn\"\n variant=\"warning\"\n consoleFnName=\"warn\"\n description=\"warning\"\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"danger\"\n variant=\"danger\"\n consoleFnName=\"error\"\n description=\"destructive/danger\"\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"error\"\n variant=\"error\"\n consoleFnName=\"error\"\n description=\"error\"\n timestamp\n parameters={[\n {\n name: \"err\",\n type: \"string | Error\",\n optional: false\n },\n {\n name: \"header\",\n type: \"string\",\n optional: true\n }\n ]}\n prefix={\n <>\n <VarDeclaration let name=\"message\" type=\"string | undefined\" />\n <Spacing />\n <IfStatement condition={code`(err as Error)?.message`}>\n {code`message = (err as Error).message;`}\n </IfStatement>\n <ElseClause>{code`message = String(err);`}</ElseClause>\n <Spacing />\n <IfStatement condition={code`env.STACKTRACE`}>\n <IfStatement condition={code`(err as Error)?.stack`}>\n {code`message += \" \\\\n\\\\n\" + ((err as Error).stack || \"\");`}\n </IfStatement>\n <ElseClause>{code`message += \" \\\\n\\\\n\" + ((new Error(\" \")).stack || \"\").split(\"\\\\n\").slice(2).map(line => line.trim()).join(\"\\\\n\");`}</ElseClause>\n </IfStatement>\n </>\n }\n />\n <Spacing />\n <TableFunctionDeclaration />\n <Spacing />\n <BlockquoteFunctionDeclaration />\n <Spacing />\n <CodeFunctionDeclaration />\n <Spacing />\n <InlineCodeFunctionDeclaration />\n <Spacing />\n {children}\n <Spacing />\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsCA,SAAE,0BAAA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A;IAAK,gBAAA,4BAAA;KAClC,MAAK;KACL,SAAS;KACT,eAAU;;KAEV,WAAQ;KACR,YAAQ,CAAA;MACN,MAAI;MACJ,MAAM;MACN,UAAM;MACP,EAAE;MACD,MAAM;MACN,MAAM;MACN,UAAM;MACP,CAAC;KACF,IAAI,SAAI;AACN,aAAK;OAAA,gBAAA,gBAAA;QACH,OAAO;QACP,MAAE;QACF,MAAE;QACH,CAAC;OAAE,gBAAgB,SAAA,EAAA,CAAA;OAAA,gBAAkC,aAAQ;QAC5D,WAAS,IAAM;QACf,UAAS,IAAA;QACV,CAAC;OAAE,gBAAkB,YAAE,EACtB,UAAS,IAAA,0BACV,CAAC;OAAE,gBAAkB,SAAK,EAAA,CAAA;OAAA,gBAA2B,aAAa;QACjE,WAAA,IAAA;;AAEA,gBAAM,CAAA,gBAAsB,aAAa;UACvC,WAAa,IAAC;UACd,UAAA,IAAA;UACF,CAAA,EAAM,gBAAkB,YAAM,EAC9B,UAAc,IAAA,qHACd,CAAA,CAAK;;QAEN,CAAC;OAAA;;KAEL,CAAC;IAAE,gBAAa,SAAA,EAAA,CAAA;IAAA,gBAAA,0BAAA,EAAA,CAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,+BAAA,EAAA,CAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,yBAAA,EAAA,CAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA,gBAAA,+BAAA,EAAA,CAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA;IAAA,gBAAA,SAAA,EAAA,CAAA;IAAA;;EAEpB,CAAC"}
|
|
1
|
+
{"version":3,"file":"console-builtin.mjs","names":[],"sources":["../../src/components/console-builtin.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Shell Shock\n\n This code was released as part of the Shell Shock project. Shell Shock\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/shell-shock.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/shell-shock\n Documentation: https://docs.stormsoftware.com/projects/shell-shock\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, For, Show } from \"@alloy-js/core\";\nimport type { FunctionDeclarationProps } from \"@alloy-js/typescript\";\nimport {\n ElseClause,\n ElseIfClause,\n FunctionDeclaration,\n IfStatement,\n InterfaceDeclaration,\n InterfaceMember,\n TypeDeclaration,\n VarDeclaration\n} from \"@alloy-js/typescript\";\nimport { ReflectionKind } from \"@powerlines/deepkit/vendor/type\";\nimport { Spacing } from \"@powerlines/plugin-alloy/core/components/spacing\";\nimport {\n ClassDeclaration,\n ClassField,\n ClassMethod,\n ClassPropertyGet,\n ClassPropertySet\n} from \"@powerlines/plugin-alloy/typescript\";\nimport type { BuiltinFileProps } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport { BuiltinFile } from \"@powerlines/plugin-alloy/typescript/components/builtin-file\";\nimport {\n TSDoc,\n TSDocDefaultValue,\n TSDocExample,\n TSDocParam,\n TSDocRemarks,\n TSDocReturns\n} from \"@powerlines/plugin-alloy/typescript/components/tsdoc\";\nimport { IsNotDebug, IsNotVerbose } from \"@shell-shock/core/components/helpers\";\nimport type {\n ThemeMessageVariant,\n ThemeResolvedConfig\n} from \"@shell-shock/plugin-theme\";\nimport { useColors, useTheme } from \"@shell-shock/plugin-theme/contexts/theme\";\nimport type { AnsiColorWrappers } from \"@shell-shock/plugin-theme/helpers/ansi-utils\";\nimport {\n colorKeys,\n modifierKeys\n} from \"@shell-shock/plugin-theme/helpers/ansi-utils\";\nimport { camelCase } from \"@stryke/string-format\";\nimport { getIndefiniteArticle } from \"@stryke/string-format/vowels\";\nimport { isSetObject } from \"@stryke/type-checks/is-set-object\";\nimport { defu } from \"defu\";\n\nexport function AnsiHelpersDeclarations() {\n return (\n <>\n <VarDeclaration\n const\n export\n name=\"beep\"\n doc=\"The ASCII Bell character, which can be used to trigger a beep sound in the console.\">\n {code` \"\\\\u0007\"; `}\n </VarDeclaration>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"cursor\"\n doc=\"An object containing ANSI escape codes for controlling the console cursor.\">\n {code` {\n to(x: number, y?: number) {\n if (!y) {\n return \\`\\\\x1B[\\${x + 1}G\\`;\n }\n\n return \\`\\\\x1B[\\${y + 1};\\${x + 1}H\\`;\n },\n move(x: number, y: number) {\n let ret = '';\n\n if (x < 0) {\n ret += \\`\\\\x1B[\\${-x}D\\`;\n } else if (x > 0) {\n ret += \\`\\\\x1B[\\${x}C\\`;\n }\n\n if (y < 0) {\n ret += \\`\\\\x1B[\\${-y}A\\`;\n } else if (y > 0) {\n ret += \\`\\\\x1B[\\${y}B\\`;\n }\n\n return ret;\n },\n up: (count = 1) => \\`\\\\x1B[\\${count}A\\`,\n down: (count = 1) => \\`\\\\x1B[\\${count}B\\`,\n forward: (count = 1) => \\`\\\\x1B[\\${count}C\\`,\n backward: (count = 1) => \\`\\\\x1B[\\${count}D\\`,\n nextLine: (count = 1) => \"\\\\x1B[E\".repeat(count),\n prevLine: (count = 1) => \"\\\\x1B[F\".repeat(count),\n left: \"\\\\x1B[G\",\n hide: \"\\\\x1B[?25l\",\n show: \"\\\\x1B[?25h\",\n save: \"\\\\x1B7\",\n restore: \"\\\\x1B8\"\n } `}\n </VarDeclaration>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"erase\"\n doc=\"An object containing ANSI escape codes for erasing parts of the console.\">\n {code` {\n screen: \"\\\\x1B[2J\",\n up: (count = 1) => \"\\\\x1B[1J\".repeat(count),\n down: (count = 1) => \"\\\\x1B[J\".repeat(count),\n line: \"\\\\x1B[2K\",\n lineEnd: \"\\\\x1B[K\",\n lineStart: \"\\\\x1B[1K\",\n lines(count: number) {\n let lineClear = \"\";\n for (let i = 0; i < count; i++) {\n lineClear += this.line + (i < count - 1 ? cursor.up() : \"\");\n }\n\n if (count) {\n lineClear += cursor.left;\n }\n\n return lineClear;\n }\n } `}\n </VarDeclaration>\n <Spacing />\n <VarDeclaration\n const\n export\n name=\"scroll\"\n doc=\"An object containing ANSI escape codes for scrolling the console.\">\n {code` {\n up: (count = 1) => \"\\\\x1B[S\".repeat(count),\n down: (count = 1) => \"\\\\x1B[T\".repeat(count)\n } `}\n </VarDeclaration>\n <Spacing />\n <FunctionDeclaration\n export\n name=\"clear\"\n doc=\"A helper function to clear the console based on a count of lines\"\n parameters={[\n {\n name: \"current\",\n type: \"string\",\n doc: \"The current console output to be cleared\"\n },\n {\n name: \"consoleWidth\",\n type: \"number\",\n doc: \"The number of characters per line in the console\"\n }\n ]}>\n {code`if (!consoleWidth) {\n return erase.line + cursor.to(0);\n }\n\n let rows = 0;\n const lines = current.split(/\\\\r?\\\\n/);\n for (let line of lines) {\n rows += 1 + Math.floor(Math.max([...stripAnsi(line)].length - 1, 0) / consoleWidth);\n }\n\n return erase.lines(rows); `}\n </FunctionDeclaration>\n <Spacing />\n </>\n );\n}\n\ntype ColorFunctionProps = Record<\n \"ansi16\" | \"ansi256\" | \"ansi16m\",\n AnsiColorWrappers\n> & {\n skipBackground?: boolean;\n};\n\n/**\n * A component to generate a console message function in a Shell Shock project.\n */\nfunction ColorFunction({\n ansi16,\n ansi256,\n ansi16m,\n skipBackground = false\n}: ColorFunctionProps) {\n return code` (text: string | number | boolean | null | undefined${\n skipBackground ? \"\" : `, background = false`\n }): string => {\n try {\n if (text === undefined || text === null || text === \"\") {\n return \"\";\n }\n\n if (!isColorSupported) {\n return String(text);\n }\n\n if (colorSupportLevels.stdout === 1) {\n return wrapAnsi(String(text), ${\n skipBackground\n ? `\"${ansi16.open}\", \"${ansi16.close}\"`\n : `background ? \"${\n ansi16.background.open\n }\" : \"${ansi16.open}\", background ? \"${\n ansi16.background.close\n }\" : \"${ansi16.close}\"`\n });\n } else if (colorSupportLevels.stdout === 2) {\n return wrapAnsi(String(text), ${\n skipBackground\n ? `\"${ansi256.open}\", \"${ansi256.close}\"`\n : `background ? \"${\n ansi256.background.open\n }\" : \"${ansi256.open}\", background ? \"${\n ansi256.background.close\n }\" : \"${ansi256.close}\"`\n });\n }\n\n return wrapAnsi(String(text), ${\n skipBackground\n ? `\"${ansi16m.open}\", \"${ansi16m.close}\"`\n : `background ? \"${ansi16m.background.open}\" : \"${\n ansi16m.open\n }\", background ? \"${ansi16m.background.close}\" : \"${ansi16m.close}\"`\n });\n } catch {\n return String(text);\n }\n }\n`;\n}\n\ninterface ThemeColorNode {\n [key: string]: AnsiColorWrappers | ThemeColorNode;\n}\n\ninterface ThemeColorDefinitionProps {\n type: string;\n subType?: string;\n ansi16: ThemeColorNode;\n ansi256: ThemeColorNode;\n ansi16m: ThemeColorNode;\n}\n\nexport function ThemeColorTypeDefinition(props: ThemeColorDefinitionProps) {\n const { ansi16, ansi256, ansi16m, type, subType } = props;\n\n return (\n <For\n each={Object.entries(ansi16)}\n semicolon\n doubleHardline\n enderPunctuation>\n {([color, value]) => (\n <>\n <Show when={isSetObject(value)}>\n <Show\n when={\"open\" in value && \"close\" in value}\n fallback={\n <>\n <TSDoc\n heading={`An object containing various ${\n subType ? `${subType} ` : \"\"\n }${color}${\n type ? ` ${type}` : \"\"\n } theme coloring functions.`}></TSDoc>\n {code` ${camelCase(color)}: { `}\n <hbr />\n <ThemeColorTypeDefinition\n ansi16={ansi16[color] as ThemeColorNode}\n ansi256={ansi256[color] as ThemeColorNode}\n ansi16m={ansi16m[color] as ThemeColorNode}\n type={subType || type}\n subType={color}\n />\n <hbr />\n {code` }`}\n </>\n }>\n <TSDoc\n heading={`A function that applies ${getIndefiniteArticle(color)} ${\n color\n }${type ? ` ${type}` : \"\"}${\n subType ? ` ${subType}` : \"\"\n } color styling to provided console text.`}>\n <TSDocRemarks>\n {`This function takes a string and an optional boolean indicating whether to apply the color as a background. It returns the input string wrapped in the appropriate ANSI escape codes for ${\n color\n }${type ? ` ${type}` : \"\"}${\n subType ? ` ${subType}` : \"\"\n } color styling, based on the terminal's color support level. If colors are not supported, it simply returns the input text as a string.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The console text to which the ${color}${\n type ? ` ${type}` : \"\"\n }${subType ? ` ${subType}` : \"\"} color styling should be applied.`}\n </TSDocParam>\n <TSDocParam name=\"background\">\n {`A boolean indicating whether to apply the color as a background. Defaults to \\`false\\`.`}\n </TSDocParam>\n <TSDocReturns>\n {`A string with ANSI escape codes applied for ${color}${\n type ? ` ${type}` : \"\"\n }${\n subType ? ` ${subType}` : \"\"\n } color styling, or the original text if the style is not supported in the current terminal.`}\n </TSDocReturns>\n </TSDoc>\n {code`${camelCase(color)}: (text: string, background?: boolean) => string`}\n </Show>\n </Show>\n </>\n )}\n </For>\n );\n}\n\nexport function ThemeColorObjectDefinition(props: ThemeColorDefinitionProps) {\n const { ansi16, ansi256, ansi16m, type, subType } = props;\n\n return (\n <For each={Object.entries(ansi16)} comma doubleHardline enderPunctuation>\n {([color, value]) => (\n <>\n <Show when={isSetObject(value)}>\n <Show\n when={\"open\" in value && \"close\" in value}\n fallback={\n <>\n <TSDoc\n heading={`An object containing various ${\n subType ? `${subType} ` : \"\"\n }${color}${\n type ? ` ${type}` : \"\"\n } theme coloring functions.`}></TSDoc>\n {code` ${camelCase(color)}: { `}\n <hbr />\n <ThemeColorObjectDefinition\n ansi16={ansi16[color] as ThemeColorNode}\n ansi256={ansi256[color] as ThemeColorNode}\n ansi16m={ansi16m[color] as ThemeColorNode}\n type={subType || type}\n subType={color}\n />\n <hbr />\n {code` }`}\n </>\n }>\n <TSDoc\n heading={`A function that applies ${getIndefiniteArticle(color)} ${\n color\n }${type ? ` ${type}` : \"\"}${\n subType ? ` ${subType}` : \"\"\n } color styling to provided console text.`}>\n <TSDocRemarks>\n {`This function takes a string and an optional boolean indicating whether to apply the color as a background. It returns the input string wrapped in the appropriate ANSI escape codes for ${\n color\n }${type ? ` ${type}` : \"\"}${\n subType ? ` ${subType}` : \"\"\n } color styling, based on the terminal's color support level. If colors are not supported, it simply returns the input text as a string.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The console text to which the ${color}${\n type ? ` ${type}` : \"\"\n }${subType ? ` ${subType}` : \"\"} color styling should be applied.`}\n </TSDocParam>\n <TSDocParam name=\"background\">\n {`A boolean indicating whether to apply the color as a background. Defaults to \\`false\\`.`}\n </TSDocParam>\n <TSDocReturns>\n {`A string with ANSI escape codes applied for ${color}${\n type ? ` ${type}` : \"\"\n }${\n subType ? ` ${subType}` : \"\"\n } color styling, or the original text if the style is not supported in the current terminal.`}\n </TSDocReturns>\n </TSDoc>\n {code`${camelCase(color)}: `}\n <ColorFunction\n ansi16={ansi16[color] as AnsiColorWrappers}\n ansi256={ansi256[color] as AnsiColorWrappers}\n ansi16m={ansi16m[color] as AnsiColorWrappers}\n />\n </Show>\n </Show>\n </>\n )}\n </For>\n );\n}\n\n/**\n * A component to generate an object containing functions for coloring text in a Shell Shock project.\n */\nexport function AnsiStyleFunctionsDeclaration() {\n const colors = useColors();\n\n return (\n <>\n <For each={modifierKeys} semicolon doubleHardline enderPunctuation>\n {modifier => (\n <>\n <TSDoc\n heading={`A function that applies ${\n modifier\n } styling to provided console text.`}>\n <TSDocRemarks>\n {`This function takes a string and an optional boolean indicating whether to apply the color as a background. It returns the input string wrapped in the appropriate ANSI escape codes for the specified color, based on the terminal's color support level. If colors are not supported, it simply returns the input text as a string.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The console text to which the ${\n modifier\n } styling should be applied.`}\n </TSDocParam>\n <TSDocReturns>\n {`A string with ANSI escape codes applied for ${\n modifier\n } styling, or the original text if the style is not supported in the current terminal.`}\n </TSDocReturns>\n </TSDoc>\n <VarDeclaration\n const\n export\n name={camelCase(modifier)}\n initializer={\n <ColorFunction\n ansi16={\n colors.ansi16[\n modifier as keyof typeof colors.ansi16\n ] as AnsiColorWrappers\n }\n ansi256={\n colors.ansi256[\n modifier as keyof typeof colors.ansi256\n ] as AnsiColorWrappers\n }\n ansi16m={\n colors.ansi16m[\n modifier as keyof typeof colors.ansi16m\n ] as AnsiColorWrappers\n }\n skipBackground={true}\n />\n }\n />\n </>\n )}\n </For>\n <Spacing />\n <For each={colorKeys} semicolon doubleHardline enderPunctuation>\n {color => (\n <>\n <TSDoc\n heading={`A helper function to color the provided text as ${color}.`}>\n <TSDocRemarks>\n {`This function takes a string and an optional boolean indicating whether to apply the color as a background. It returns the input string wrapped in the appropriate ANSI escape codes for the specified color, based on the terminal's color support level. If colors are not supported, it simply returns the input text as a string.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The console text to which the ${color} color should be applied.`}\n </TSDocParam>\n <TSDocReturns>\n {`A string with ANSI escape codes applied for ${color} color, or the original text if the color is not supported in the current terminal.`}\n </TSDocReturns>\n </TSDoc>\n <VarDeclaration\n const\n export\n name={camelCase(color)}\n initializer={\n <ColorFunction\n ansi16={\n colors.ansi16[\n color as keyof typeof colors.ansi16\n ] as AnsiColorWrappers\n }\n ansi256={\n colors.ansi256[\n color as keyof typeof colors.ansi256\n ] as AnsiColorWrappers\n }\n ansi16m={\n colors.ansi16m[\n color as keyof typeof colors.ansi16m\n ] as AnsiColorWrappers\n }\n />\n }\n />\n </>\n )}\n </For>\n <Spacing />\n\n <For\n each={Object.keys(colors.ansi16.theme)}\n semicolon\n doubleHardline\n enderPunctuation>\n {type => (\n <>\n <TSDoc\n heading={`A nested object containing functions for applying ${\n type\n } theme colors to the console.`}\n />\n <VarDeclaration\n export\n name={`${camelCase(type)}Colors`}\n initializer={\n <>\n {code` {`}\n <hbr />\n <ThemeColorObjectDefinition\n ansi16={\n colors.ansi16.theme[\n type as keyof typeof colors.ansi16.theme\n ]\n }\n ansi256={\n colors.ansi256.theme[\n type as keyof typeof colors.ansi256.theme\n ]\n }\n ansi16m={\n colors.ansi16m.theme[\n type as keyof typeof colors.ansi16m.theme\n ]\n }\n type={type}\n />\n <hbr />\n {code`}`}\n </>\n }\n />\n </>\n )}\n </For>\n <Spacing />\n </>\n );\n}\n\n/**\n * A component to generate the `splitText` function in the `shell-shock:console` builtin module.\n */\nexport function SplitTextFunctionDeclaration() {\n return (\n <>\n <FunctionDeclaration\n name=\"adjustIndex\"\n parameters={[\n {\n name: \"line\",\n type: \"string\"\n },\n {\n name: \"index\",\n type: \"number\"\n }\n ]}\n returnType=\"number\">\n {code`let adjustedIndex = 0;\n\n const segments = line.match(/\\\\x1b\\\\[(\\\\d|;)+m.*\\\\x1b\\\\[(\\\\d|;)+m/gi);\n if (segments && segments.length > 0) {\n segments.reduce((count, matched) => {\n if (count < index) {\n const stripped = stripAnsi(matched);\n if (count + stripped.length < index) {\n count += stripped.length;\n adjustedIndex += matched.length;\n } else {\n adjustedIndex += index - count + (matched.slice(0, index - count).match(/\\\\x1b\\\\[(\\\\d|;)+m/g)?.join(\"\")?.length ?? 0);\n count = index;\n }\n }\n\n return count;\n }, 0);\n } else {\n adjustedIndex = index;\n }\n\n return adjustedIndex - (line.slice(0, adjustedIndex).match(/\\\\x1b\\\\[/g)?.length ?? 0); `}\n </FunctionDeclaration>\n <Spacing />\n <FunctionDeclaration\n name=\"breakLine\"\n parameters={[\n {\n name: \"line\",\n type: \"string\"\n },\n {\n name: \"index\",\n type: \"number\"\n }\n ]}\n returnType=\"[string, string]\">\n {code`const first = line.slice(0, index);\n const second = line.slice(index);\n\n // Match all ANSI escape sequences in the first string\n const ansiRegex = /[\\\\x1b\\\\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=><~]))/g;\n\n const openCodes: string[] = [];\n const closeCodes: string[] = [];\n let match: RegExpExecArray | null;\n\n while ((match = ansiRegex.exec(first)) !== null) {\n const code = match[0];\n // Check if this is a reset/close code (e.g., \\\\x1b[0m, \\\\x1b[39m, \\\\x1b[49m, etc.)\n if (/\\\\x1b\\\\[(?:0|22|23|24|27|28|29|39|49)m/.test(code)) {\n // A close/reset code cancels the last open code\n openCodes.pop();\n closeCodes.pop();\n } else {\n openCodes.push(code);\n // Derive a close code: map SGR open codes to their reset counterparts\n const sgrMatch = code.match(/\\\\x1b\\\\[(\\\\d+)m/);\n if (sgrMatch) {\n const n = parseInt(sgrMatch[1]!, 10);\n let closeCode: string;\n if (n >= 30 && n <= 37) closeCode = \"\\\\x1b[39m\";\n else if (n >= 40 && n <= 47) closeCode = \"\\\\x1b[49m\";\n else if (n >= 90 && n <= 97) closeCode = \"\\\\x1b[39m\";\n else if (n >= 100 && n <= 107) closeCode = \"\\\\x1b[49m\";\n else if (n === 1) closeCode = \"\\\\x1b[22m\";\n else if (n === 2) closeCode = \"\\\\x1b[22m\";\n else if (n === 3) closeCode = \"\\\\x1b[23m\";\n else if (n === 4) closeCode = \"\\\\x1b[24m\";\n else if (n === 7) closeCode = \"\\\\x1b[27m\";\n else if (n === 8) closeCode = \"\\\\x1b[28m\";\n else if (n === 9) closeCode = \"\\\\x1b[29m\";\n else closeCode = \"\\\\x1b[0m\";\n closeCodes.push(closeCode);\n } else {\n closeCodes.push(\"\\\\x1b[0m\");\n }\n }\n }\n\n // Append close codes to the end of \"first\" (in reverse order)\n const closeSequence = closeCodes.slice().reverse().join(\"\");\n // Prepend open codes to the start of \"second\"\n const openSequence = openCodes.join(\"\");\n\n return [first.replace(/^\\\\s+/, \"\").replace(/\\\\s+$/, \"\") + closeSequence, openSequence + second.replace(/^\\\\s+/, \"\").replace(/\\\\s+$/, \"\")]; `}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"Split text into multiple lines based on a maximum length.\">\n <TSDocRemarks>\n {`This function splits the provided text into multiple lines based on the specified maximum length, ensuring that words are not broken in the middle.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The text to split into multiple lines.`}\n </TSDocParam>\n <TSDocParam name=\"maxLength\">\n {`The maximum length of each line.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"splitText\"\n parameters={[\n {\n name: \"text\",\n type: \"string\"\n },\n {\n name: \"maxLength\",\n type: \"number | SizeToken\"\n }\n ]}>\n {code`\n let line = text;\n let result = [] as string[];\n\n const calculatedMaxLength = isSizeToken(maxLength) ? calculateWidth(maxLength) : maxLength;\n while (stripAnsi(line).length > calculatedMaxLength || line.indexOf(\"\\\\n\") !== -1) {\n if (line.indexOf(\"\\\\n\") !== -1) {\n result.push(...splitText(line.slice(0, line.indexOf(\"\\\\n\")).replace(/(\\\\r)?\\\\n/, \"\"), calculatedMaxLength));\n line = line.indexOf(\"\\\\n\") + 1 < line.length\n ? line.slice(line.indexOf(\"\\\\n\") + 1)\n : \"\";\n } else {\n const index = [\" \", \"/\", \".\", \",\", \"-\", \":\", \"|\", \"@\", \"+\"].reduce((ret, split) => {\n let current = ret;\n while (stripAnsi(line).indexOf(split, current + 1) !== -1 && stripAnsi(line).indexOf(split, current + 1) <= calculatedMaxLength) {\n current = line.indexOf(split, adjustIndex(line, current + 1));\n }\n\n return current;\n }, -1);\n if (index === -1) {\n break;\n }\n\n const lines = breakLine(line, index);\n result.push(lines[0]);\n line = lines[1];\n }\n }\n\n while (stripAnsi(line).length > calculatedMaxLength) {\n const lines = breakLine(line, calculatedMaxLength);\n result.push(lines[0]);\n line = lines[1];\n }\n\n result.push(line);\n return result;\n`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `write` function in the `shell-shock:console` builtin module.\n */\nexport function WriteFunctionDeclaration() {\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"WriteOptions\"\n doc=\"Options for writing to the console.\">\n <TSDoc heading=\"Console function to use for writing to the console\">\n <TSDocRemarks>\n {`The console function to use for writing to the console. If not specified, the default console function \\`console.log\\` will be used.`}\n </TSDocRemarks>\n <hbr />\n <TSDocDefaultValue\n type={ReflectionKind.method}\n defaultValue={`\\`console.log\\``}\n />\n </TSDoc>\n <InterfaceMember\n name=\"consoleFn\"\n optional\n type=\"(text: string) => void\"\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Write to the console.\">\n <TSDocRemarks>\n {`This function writes to the console, applying the appropriate padding as defined in the current theme configuration and wrapping as needed.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The text to write to the console.`}\n </TSDocParam>\n <TSDocParam name=\"options\">{`The options to apply when writing to the console.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"write\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n },\n {\n name: \"options\",\n type: \"WriteOptions\",\n default: \"{}\"\n }\n ]}>\n {code`const consoleFn = options.consoleFn ?? console.log;\n if (text === undefined || text === null || text === \"\") {\n consoleFn(\"\");\n return;\n }\n\n consoleFn(String(text)); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `writeLine` function in the `shell-shock:console` builtin module.\n */\nexport function WriteLineFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"WriteLineOptions\"\n doc=\"Options for writing a line to the console.\"\n extends={[\"WriteOptions\"]}>\n <TSDoc heading=\"Padding to apply to the line\">\n <TSDocRemarks>\n {`The amount of padding (in spaces) to apply to the line when writing to the console. This value is applied to both the left and right sides of the line. If not specified, the default padding defined in the current theme configuration will be used.`}\n </TSDocRemarks>\n </TSDoc>\n <InterfaceMember name=\"padding\" optional type=\"number\" />\n <hbr />\n <TSDoc heading=\"Color of the line text\">\n <TSDocRemarks>\n {`The color to apply to the line text when writing to the console. This can be one of the predefined color themes: \"primary\", \"secondary\", or \"tertiary\". If not specified, no specific coloring will be applied to the text (the default/system terminal text color will likely be used).`}\n </TSDocRemarks>\n <hbr />\n </TSDoc>\n <InterfaceMember\n name=\"color\"\n optional\n type='\"primary\" | \"secondary\" | \"tertiary\"'\n />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Write a line to the console.\">\n <TSDocRemarks>\n {`This function writes a line to the console, applying the appropriate padding as defined in the current theme configuration and wrapping as needed.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"text\">\n {`The line text to write to the console.`}\n </TSDocParam>\n <TSDocParam name=\"options\">{`The options to apply when writing the line to the console.`}</TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"writeLine\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n },\n {\n name: \"options\",\n type: \"WriteLineOptions\",\n default: \"{}\"\n }\n ]}>\n {code`const color = options.color;\n if (text === undefined || text === null || text === \"\") {\n write(\"\", options);\n return;\n }\n\n write(\\`\\${\" \".repeat(Math.max(options.padding ?? ${\n theme.padding.app\n }, 0))}\\${color ? textColors.body[color](String(text)) : String(text)}\\`, options); `}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport type MessageFunctionDeclarationProps = Partial<\n Pick<FunctionDeclarationProps, \"parameters\">\n> & {\n type:\n | \"success\"\n | \"help\"\n | \"info\"\n | \"debug\"\n | \"verbose\"\n | \"warn\"\n | \"danger\"\n | \"error\";\n variant: ThemeMessageVariant;\n color?: ThemeMessageVariant;\n consoleFnName: \"log\" | \"info\" | \"warn\" | \"error\" | \"debug\";\n description: string;\n prefix?: Children;\n timestamp?: boolean;\n};\n\n/**\n * A component to generate the message functions in the `shell-shock:console` builtin module.\n */\nexport function MessageFunctionDeclaration(\n props: MessageFunctionDeclarationProps\n) {\n const {\n type,\n variant,\n consoleFnName,\n description,\n prefix,\n parameters,\n timestamp,\n color = variant\n } = props;\n\n const theme = useTheme();\n\n return (\n <>\n <TSDoc\n heading={`Write ${getIndefiniteArticle(\n description\n )} ${description} message to the console.`}>\n <TSDocRemarks>\n {`This function initializes the Powerlines environment configuration object.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"message\">\n {`The message to write to the console.`}\n </TSDocParam>\n <TSDocParam name=\"header\">\n {`An optional header to display above the message. If not provided, a default header based on the message type and variant will be used if defined in the theme configuration; otherwise, no header will be displayed.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name={type}\n parameters={\n parameters ?? [\n {\n name: \"message\",\n type: \"string\",\n optional: false\n },\n {\n name: \"header\",\n type: \"string\",\n optional: true\n }\n ]\n }>\n <Show when={Boolean(prefix)}>\n {prefix}\n <hbr />\n <hbr />\n </Show>\n {code`\n if (!message) {\n return;\n }\n\n ${\n !theme.labels.message.footer[variant] && timestamp\n ? `const timestamp = \\`\\${textColors.message.footer.${\n color\n }(new Date().toLocaleDateString())} \\${borderColors.message.outline.${\n color\n }(\"${\n theme.borderStyles.message.outline[variant].bottom\n }\")} \\${textColors.message.footer.${\n color\n }(new Date().toLocaleTimeString())}\\`; `\n : \"\"\n }\n\n writeLine(borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].topLeft\n }\") + ${\n theme.labels.message.header[variant] ||\n theme.icons.message.header[variant]\n ? `borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].top\n }\".repeat(4)) + \" \" + ${\n theme.icons.message.header[variant]\n ? `borderColors.message.outline.${color}(\"${\n theme.icons.message.header[variant]\n }\") + \" \" +`\n : \"\"\n } bold(textColors.message.header.${color}(header || \"${\n theme.labels.message.header[variant]\n }\")) + \" \" + borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].top\n }\".repeat(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2 +\n theme.borderStyles.message.outline[variant].topLeft.length +\n 4 +\n (theme.icons.message.header[variant]\n ? 2 + (theme.labels.message.header[variant] ? 0 : 1)\n : 0) +\n (theme.labels.message.header[variant]\n ? theme.labels.message.header[variant].length + 2\n : 0) +\n theme.borderStyles.message.outline[variant].topRight.length\n }, 0)))`\n : `borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].top\n }\".repeat(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2 +\n theme.borderStyles.message.outline[variant].topLeft.length +\n theme.borderStyles.message.outline[variant].topRight.length\n }, 0)))`\n } + borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].topRight\n }\"), { consoleFn: console.${consoleFnName} });\n splitText(\n message,\n Math.max(getTerminalSize().columns - ${\n (Math.max(theme.padding.app, 0) +\n Math.max(theme.padding.message, 0)) *\n 2 +\n theme.borderStyles.message.outline[variant].left.length +\n theme.borderStyles.message.outline[variant].right.length\n }, 0)\n ).forEach((line) => {\n writeLine(borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].left +\n \" \".repeat(Math.max(theme.padding.message, 0))\n }\") + textColors.message.description.${color}(line) + \" \".repeat(Math.max(getTerminalSize().columns - (stripAnsi(line).length + ${\n Math.max(theme.padding.app, 0) * 2 +\n Math.max(theme.padding.message, 0) +\n theme.borderStyles.message.outline[variant].left.length +\n theme.borderStyles.message.outline[variant].right.length\n }), 0)) + borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].right\n }\"), { consoleFn: console.${consoleFnName} });\n });\n writeLine(borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].bottomLeft\n }\") + ${\n theme.labels.message.footer[variant] || timestamp\n ? `borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].bottom\n }\".repeat(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2 +\n 4 +\n (theme.labels.message.footer[variant]\n ? theme.labels.message.footer[variant].length + 2\n : 0) +\n theme.borderStyles.message.outline[variant].bottomLeft.length +\n theme.borderStyles.message.outline[variant].bottomRight.length\n }${\n !theme.labels.message.footer[variant] && timestamp\n ? \" - (stripAnsi(timestamp).length + 2)\"\n : \"\"\n }, 0))) + \" \" + ${`bold(textColors.message.footer.${color}(${\n theme.labels.message.footer[variant]\n ? `\"${theme.labels.message.footer[variant]}\"`\n : timestamp && \"timestamp\"\n }))`} + \" \" + borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].bottom\n }\".repeat(4))`\n : `borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].bottom\n }\".repeat(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2 +\n theme.borderStyles.message.outline[variant].bottomLeft.length +\n theme.borderStyles.message.outline[variant].bottomRight.length\n }, 0)))`\n } + borderColors.message.outline.${color}(\"${\n theme.borderStyles.message.outline[variant].bottomRight\n }\"), { consoleFn: console.${consoleFnName} });\n`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `wrapAnsi` function in the `shell-shock:console` builtin module.\n */\nexport function WrapAnsiFunction() {\n return (\n <>\n <TSDoc heading=\"Applies ANSI escape codes to a string.\">\n <TSDocRemarks>\n {`Split text by /\\\\\\\\x1b[\\\\[|\\\\]][0-9;]*m/ and wrap non-ANSI parts with open/closing tags.`}\n </TSDocRemarks>\n\n <TSDocExample>\n {`const result = wrapAnsi(\"Hello\\\\\\\\x1b[31mWorld\\\\\\\\x1b[0mAgain\", \"\\\\\\\\x1b[36m\", \"\\\\\\\\x1b[39\");\\nconsole.log(result); // \"\\\\\\\\x1b[36mHello\\\\\\\\x1b[39\\\\\\\\x1b[31mWorld\\\\\\\\x1b[0m\\\\\\\\x1b[36mAgain\\\\\\\\x1b[39\"`}\n </TSDocExample>\n\n <TSDocParam name=\"text\">\n {`The text to apply ANSI codes to.`}\n </TSDocParam>\n <TSDocParam name=\"open\">{`The opening ANSI code.`}</TSDocParam>\n <TSDocParam name=\"close\">{`The closing ANSI code.`}</TSDocParam>\n <TSDocReturns>{`The text with ANSI codes applied.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n name=\"wrapAnsi\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number\",\n optional: false\n },\n {\n name: \"open\",\n type: \"string\",\n optional: false\n },\n { name: \"close\", type: \"string\", optional: false }\n ]}>\n {code`const str = String(text);\n const tokens = [] as string[];\n\n let last = 0;\n let match: RegExpExecArray | null;\n while ((match = /\\\\\\\\x1b[\\\\[|\\\\]][0-9;]*m/g.exec(str)) !== null) {\n if (match.index > last) tokens.push(str.slice(last, match.index));\n tokens.push(match[0]);\n last = match.index + match[0].length;\n }\n\n if (last < str.length) {\n tokens.push(str.slice(last));\n }\n\n let result = \"\";\n for (let i = 0; i < tokens.length; i++) {\n const seg = tokens[i]!;\n if (/^\\\\\\\\x1b[\\\\[|\\\\]][0-9;]*m$/.test(seg)) {\n result += seg;\n continue;\n }\n\n if (!seg) {\n continue;\n }\n\n result += i > 0 && /^\\\\\\\\x1b[\\\\[|\\\\]][0-9;]*m$/.test(tokens[i - 1]!) && i + 1 < tokens.length && /^\\\\\\\\x1b[\\\\[|\\\\]][0-9;]*m$/.test(tokens[i + 1]!)\n ? seg\n : \\`\\${open}\\${seg}\\${close}\\`;\n }\n\n return result;\n`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `stripAnsi` function in the `shell-shock:console` builtin module.\n */\nexport function StripAnsiFunctionDeclaration() {\n return (\n <>\n <TSDoc heading=\"Removes ANSI escape codes from a string.\">\n <TSDocExample>\n {`const result = stripAnsi(\"Hello\\\\\\\\x1b[31mWorld\\\\\\\\x1b[0mAgain\"); // \"HelloWorldAgain\"`}\n </TSDocExample>\n\n <TSDocParam name=\"text\">\n {`The text to strip ANSI codes from.`}\n </TSDocParam>\n <TSDocReturns>{`The text with ANSI codes removed.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"stripAnsi\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number\",\n optional: false\n }\n ]}>\n {code`return String(text).replace(new RegExp([\n String.raw\\`[\\\\u001B\\\\u009B][[\\\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]+)*|[a-zA-Z\\\\d]+(?:;[-a-zA-Z\\\\d\\\\/#&.:=?%@~_]*)*)?\\\\u0007)\\`,\n String.raw\\`(?:(?:\\\\d{1,4}(?:;\\\\d{0,4})*)?[\\\\dA-PR-TZcf-nq-uy=><~]))\\`\n ].join(\"|\"), \"g\"), \"\");`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `stripAnsi` function in the `shell-shock:console` builtin module.\n */\nexport function DividerFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <InterfaceDeclaration\n export\n name=\"DividerOptions\"\n doc=\"Options for formatting the divider line written to console.\">\n <InterfaceMember\n name=\"width\"\n optional\n type=\"number\"\n doc=\"The width of the divider line. If not specified, the divider will span the full width of the console, minus the padding.\"\n />\n <hbr />\n <TSDoc heading=\"The border of the divider line. Can be 'primary', 'secondary', 'tertiary', or 'none'. If not specified, the default border style will be used.\">\n <TSDocRemarks>\n {`The value provided will determine the border style and color based on the current theme configuration.`}\n </TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.string}\n defaultValue=\"primary\"\n />\n </TSDoc>\n <InterfaceMember\n name=\"border\"\n optional\n type='\"primary\" | \"secondary\" | \"tertiary\"'\n doc=\"The border style/color of the divider line. Can be 'primary', 'secondary', 'tertiary', or 'none'. If not specified, the default border style will be used.\"\n />\n <hbr />\n <TSDoc heading=\"Padding to apply to the line\">\n <TSDocRemarks>\n {`The amount of padding (in spaces) to apply to the line when writing to the console. This value is applied to both the left and right sides of the line. If not specified, the default padding defined in the current theme configuration will be used.`}\n </TSDocRemarks>\n <TSDocDefaultValue\n type={ReflectionKind.number}\n defaultValue={theme.padding.app * 4}\n />\n </TSDoc>\n <InterfaceMember name=\"padding\" optional type=\"number\" />\n </InterfaceDeclaration>\n <Spacing />\n <TSDoc heading=\"Write a horizontal divider line to the console.\">\n <TSDocExample>\n {`divider({ width: 50, border: \"primary\" }); // Writes a horizontal divider line of width 50 with primary border.`}\n </TSDocExample>\n <TSDocParam name=\"options\">\n {`Options for formatting the divider line.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"divider\"\n parameters={[\n {\n name: \"options\",\n type: \"DividerOptions\",\n optional: false\n }\n ]}>\n {code`const padding = options.padding ?? ${Math.max(theme.padding.app, 1) * 4};\n const width = options.width ?? (getTerminalSize().columns - (Math.max(padding, 0) * 2));\n const border = options.border === \"tertiary\" ? borderColors.app.divider.tertiary(\"${\n theme.borderStyles.app.divider.tertiary.top\n }\") : options.border === \"secondary\" ? borderColors.app.divider.secondary(\"${\n theme.borderStyles.app.divider.secondary.top\n }\") : borderColors.app.divider.primary(\"${\n theme.borderStyles.app.divider.primary.top\n }\");\n\n writeLine(\" \".repeat(Math.max(padding - ${theme.padding.app}, 0)) + border.repeat(Math.max(width / ${\n theme.borderStyles.app.divider.primary.top.length ?? 1\n }, 0)));\n `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `link` function in the `shell-shock:console` builtin module.\n */\nexport function LinkFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <TSDoc heading=\"Render a hyperlink in the console.\">\n <TSDocParam name=\"url\">\n {`The URL to render as a hyperlink.`}\n </TSDocParam>\n <TSDocParam name=\"textOrExternal\">\n {`The text to display for the link or a boolean indicating whether the link is external. If no text is provided, the URL will be used as the text. If a boolean is provided and is true, the URL will be used as the text and the link will be rendered as an external link.`}\n </TSDocParam>\n <TSDocParam name=\"external\">\n {`A boolean indicating whether the link is external. If true, the link will be rendered as an external link.`}\n </TSDocParam>\n <TSDocReturns>{`The formatted hyperlink string.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"link\"\n parameters={[\n {\n name: \"url\",\n type: \"string\",\n optional: false\n },\n { name: \"textOrExternal\", type: \"string | boolean\", optional: true },\n { name: \"external\", type: \"boolean\", optional: true }\n ]}>\n <IfStatement condition={code`isHyperlinkSupported()`}>\n {code`return \\`\\\\x1b]8;;\\${url}\\\\u0007\\${typeof textOrExternal === \"string\" && textOrExternal ? textOrExternal : url}\\\\x1b]8;;\\\\u0007\\${external === true || textOrExternal === true ? \"${\n theme.icons.link.external\n }\" : \"\"}\\`;`}\n </IfStatement>\n <hbr />\n <IfStatement condition={code`isColorSupported`}>\n {code`return \\`\\${underline(textColors.body.link(\\`\\${url}\\`))}\\${external === true || textOrExternal === true ? \"${\n theme.icons.link.external\n }\" : \"\"}\\`;`}\n </IfStatement>\n <hbr />\n {code`return \\`\\${url}\\${external === true || textOrExternal === true ? \"${\n theme.icons.link.external\n }\" : \"\"}\\`;`}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `blockquote` function declaration\n */\nexport function BlockquoteFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <Spacing />\n <TSDoc\n heading={`Format a string with blockquote styling for display in console.`}>\n <TSDocParam name=\"text\">\n {`The text to format with blockquote styling.`}\n </TSDocParam>\n <TSDocReturns>{`The formatted string with blockquote styling.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"blockquote\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n }\n ]}\n returnType=\"string\">\n {code`if (text === undefined || text === null || text === \"\") {\n return \"\";\n }\n\n const lines = splitText(\n String(text),\n Math.max(getTerminalSize().columns, 20) - 6\n );\n\n return lines.map(line => \\`\\${borderColors.app.blockquote.primary(isUnicodeSupported() ? \"${\n theme.borderStyles.app.blockquote.primary.left\n }\" : \"|\")} \\${italic(line)} \\`).join(\"\\\\n\"); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `code` function declaration\n */\nexport function CodeFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <Spacing />\n <TSDoc heading={`Format a source code string for display in console.`}>\n <TSDocParam name=\"text\">\n {`The source code text to format with code styling.`}\n </TSDocParam>\n <TSDocReturns>{`The formatted string with code styling.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"code\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n },\n {\n name: \"language\",\n type: \"string\",\n optional: true\n }\n ]}\n returnType=\"string\">\n {code`if (text === undefined || text === null || text === \"\") {\n return \"\";\n }\n\n const lines = splitText(\n String(text),\n Math.max(getTerminalSize().columns, 20)\n );\n\n return \\` \\${borderColors.app.divider.primary(\"${\n theme.borderStyles.app.divider.primary.top\n }\".repeat(4))}\\${language ? \\` \\${borderColors.app.divider.primary(language)} \\` : \"\"}\\${borderColors.app.divider.primary(\"${\n theme.borderStyles.app.divider.primary.top\n }\".repeat(getTerminalSize().columns - (language ? language.length + 2 : 0) - 5))} \\\\n\\${lines.map((line, index) => \\` \\${\" \".repeat(String(lines.length).length - String(index + 1).length)}\\${textColors.body.tertiary(index + 1)} \\${textColors.body.primary(line)}\\`).join(\"\\\\n\")}\\`; `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `inlineCode` function declaration\n */\nexport function InlineCodeFunctionDeclaration() {\n return (\n <>\n <Spacing />\n <TSDoc\n heading={`Format a string with inline code styling for display in console.`}>\n <TSDocParam name=\"text\">\n {`The text to format with inline code styling.`}\n </TSDocParam>\n <TSDocReturns>{`The formatted string with inline code styling.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"inlineCode\"\n parameters={[\n {\n name: \"text\",\n type: \"string | number | boolean | null\",\n optional: true\n }\n ]}\n returnType=\"string\">\n {code`if (text === undefined || text === null || text === \"\") {\n return \"\";\n }\n\n return textColors.body.primary(inverse(\\` \\${text} \\`), true); `}\n </FunctionDeclaration>\n </>\n );\n}\n\n/**\n * A component to generate the `spinner` function in the `shell-shock:console` builtin module.\n */\nexport function SpinnerFunctionDeclaration() {\n const theme = useTheme();\n\n return (\n <>\n <TypeDeclaration name=\"WriteStream\">\n {`NodeJS.WriteStream;`}\n </TypeDeclaration>\n <Spacing />\n <VarDeclaration\n const\n name=\"activeHooksPerStream\"\n initializer=\"new Set();\"\n />\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"SpinnerOptions\"\n doc=\"Options for configuring the spinner.\">\n <InterfaceMember\n name=\"message\"\n optional\n type=\"string\"\n doc=\"The message text to display next to the spinner. Defaults to an empty string.\"\n />\n <hbr />\n <InterfaceMember\n name=\"stream\"\n optional\n type=\"WriteStream\"\n doc=\"The output stream to write the spinner to. Defaults to process.stderr.\"\n />\n <hbr />\n <InterfaceMember\n name=\"spinner\"\n optional\n type=\"ThemeSpinnerResolvedConfig | SpinnerPreset\"\n doc=\"The spinner animation to use. Should be an object with a 'frames' property (an array of strings representing each frame of the animation) and an 'interval' property (the time in milliseconds between each frame). If not specified, a default spinner animation will be used.\"\n />\n </InterfaceDeclaration>\n\n <Spacing />\n <ClassDeclaration name=\"Spinner\">\n <ClassField name=\"frames\" isPrivateMember type=\"string[]\" />\n <hbr />\n <ClassField name=\"interval\" isPrivateMember type=\"number\" />\n <hbr />\n <ClassField name=\"currentFrame\" isPrivateMember type=\"number\">\n {code`-1`}\n </ClassField>\n <hbr />\n <ClassField\n name=\"timer\"\n isPrivateMember\n optional\n type=\"NodeJS.Timeout\"\n />\n <hbr />\n <ClassField name=\"message\" isPrivateMember type=\"string\">\n {code`\"\"`}\n </ClassField>\n <hbr />\n <ClassField name=\"stream\" isPrivateMember type=\"WriteStream\">\n {code`process.stderr`}\n </ClassField>\n <hbr />\n <ClassField name=\"lines\" isPrivateMember type=\"number\">\n {code`0`}\n </ClassField>\n <hbr />\n <ClassField\n name=\"exitHandlerBound\"\n isPrivateMember\n type=\"(signal: any) => void\">\n {code`() => {}`}\n </ClassField>\n <hbr />\n <ClassField name=\"lastSpinnerFrameTime\" isPrivateMember type=\"number\">\n {code`0`}\n </ClassField>\n <hbr />\n <ClassField name=\"isSpinning\" isPrivateMember type=\"boolean\">\n {code`false`}\n </ClassField>\n <hbr />\n <ClassField\n name=\"hookedStreams\"\n isPrivateMember\n type='Map<WriteStream, { write?: WriteStream[\"write\"]; originalWrite: WriteStream[\"write\"]; hookedWrite: WriteStream[\"write\"] }>'>\n {code`new Map()`}\n </ClassField>\n <hbr />\n <ClassField name=\"isInternalWrite\" isPrivateMember type=\"boolean\">\n {code`false`}\n </ClassField>\n <hbr />\n <ClassField name=\"isDeferringRender\" isPrivateMember type=\"boolean\">\n {code`false`}\n </ClassField>\n <Spacing />\n {code`constructor(options: SpinnerOptions = {}) {\n const spinner = (typeof options.spinner === \"string\" ? resolveSpinner(options.spinner as SpinnerPreset) : options.spinner) ?? ${JSON.stringify(\n theme.spinner\n )};\n this.#frames = spinner.frames;\n this.#interval = spinner.interval;\n\n if (options.message) {\n this.#message = options.message;\n }\n if (options.stream) {\n this.#stream = options.stream;\n }\n\n this.#exitHandlerBound = this.#exitHandler.bind(this);\n }\n\n #internalWrite(action: () => unknown) {\n this.#isInternalWrite = true;\n try {\n return action();\n } finally {\n this.#isInternalWrite = false;\n }\n }\n\n #stringifyChunk(chunk: string | Uint8Array<ArrayBufferLike> | ArrayBufferLike) {\n if (chunk === undefined || chunk === null) {\n return \"\";\n }\n\n if (typeof chunk === \"string\") {\n return chunk;\n }\n\n if (Buffer.isBuffer(chunk) || ArrayBuffer.isView(chunk)) {\n return Buffer.from(chunk).toString(\"utf8\");\n }\n\n return String(chunk);\n }\n\n #withSynchronizedOutput(action: () => unknown) {\n if (!isInteractive) {\n return action();\n }\n\n try {\n this.#write(\"\\\\u001B[?2026h\");\n return action();\n } finally {\n this.#write(\"\\\\u001B[?2026l\");\n }\n }\n\n #hookStream(stream: WriteStream) {\n if (!stream || this.#hookedStreams.has(stream) || typeof stream.write !== \"function\") {\n return;\n }\n\n if (activeHooksPerStream.has(stream)) {\n return;\n }\n\n const originalWrite = stream.write;\n const hookedWrite = ((...writeArguments: Parameters<WriteStream[\"write\"]>) => this.#hookedWrite(stream, originalWrite, writeArguments)) as WriteStream[\"write\"];\n\n this.#hookedStreams.set(stream, {originalWrite, hookedWrite});\n activeHooksPerStream.add(stream);\n stream.write = hookedWrite;\n }\n\n #installHook() {\n if (!isInteractive || this.#hookedStreams.size > 0) {\n return;\n }\n\n const streamsToHook = new Set([this.#stream]);\n if (isInteractive && (this.#stream === process.stdout || this.#stream === process.stderr)) {\n streamsToHook.add(process.stdout);\n streamsToHook.add(process.stderr);\n }\n\n for (const stream of streamsToHook) {\n this.#hookStream(stream);\n }\n }\n\n #uninstallHook() {\n for (const [stream, hookInfo] of this.#hookedStreams) {\n if (stream.write === hookInfo.hookedWrite) {\n stream.write = hookInfo.originalWrite;\n }\n\n activeHooksPerStream.delete(stream);\n }\n\n this.#hookedStreams.clear();\n }\n\n #hookedWrite(stream: WriteStream, originalWrite: typeof stream.write, writeArguments: Parameters<typeof stream.write>) {\n const [chunk, callback] = writeArguments;\n\n if (this.#isInternalWrite || !this.isSpinning) {\n return originalWrite.call(stream, chunk);\n }\n\n if (this.#lines > 0) {\n this.clear();\n }\n\n const chunkString = this.#stringifyChunk(chunk);\n const chunkTerminatesLine = chunkString.at(-1) === \"\\\\n\";\n const writeResult = originalWrite.call(stream, chunk);\n\n if (chunkTerminatesLine) {\n this.#isDeferringRender = false;\n } else if (chunkString !== \"\") {\n this.#isDeferringRender = true;\n }\n\n if (this.isSpinning && !this.#isDeferringRender) {\n this.#render();\n }\n\n return writeResult;\n }\n\n #stopWithIcon(icon: string, message: string) {\n return this.stop(\\` \\${icon} \\${message ?? this.#message}\\`);\n }\n\n #render() {\n if (this.#isDeferringRender) {\n return;\n }\n\n if (this.#currentFrame === -1 || Date.now() - this.#lastSpinnerFrameTime >= this.#interval) {\n this.#currentFrame = ++this.#currentFrame % this.#frames.length;\n this.#lastSpinnerFrameTime = Date.now();\n }\n\n let display = \\`\\${textColors.spinner.icon.active(this.#frames[this.#currentFrame])} \\${textColors.spinner.message.active(this.#message)}\\`;\n if (!isInteractive) {\n display += \"\\\\n\";\n }\n\n if (isInteractive) {\n this.#withSynchronizedOutput(() => {\n this.clear();\n this.#write(display);\n });\n } else {\n this.#write(display);\n }\n\n if (isInteractive) {\n this.#lines = this.#lineCount(display);\n }\n }\n\n #write(message: string) {\n this.#internalWrite(() => {\n this.#stream.write(message);\n });\n }\n\n #lineCount(message: string) {\n const width = this.#stream.columns ?? 80;\n const lines = stripVTControlCharacters(message).split(\"\\\\n\");\n\n let lineCount = 0;\n for (const line of lines) {\n lineCount += Math.max(1, Math.ceil(line.length / width));\n }\n\n return lineCount;\n }\n\n #hideCursor() {\n if (isInteractive) {\n this.#write(\"\\\\u001B[?25l\");\n }\n }\n\n #showCursor() {\n if (isInteractive) {\n this.#write(\"\\\\u001B[?25h\");\n }\n }\n\n #subscribeToProcessEvents() {\n process.once(\"SIGINT\", this.#exitHandlerBound);\n process.once(\"SIGTERM\", this.#exitHandlerBound);\n }\n\n #unsubscribeFromProcessEvents() {\n process.off(\"SIGINT\", this.#exitHandlerBound);\n process.off(\"SIGTERM\", this.#exitHandlerBound);\n }\n\n #exitHandler(signal: any) {\n if (this.isSpinning) {\n this.stop();\n }\n\n process.exit(signal === \"SIGINT\" ? 130 : (signal === \"SIGTERM\" ? 143 : 1));\n } `}\n <ClassPropertyGet\n public\n name=\"isSpinning\"\n type=\"boolean\"\n doc=\"Whether the spinner is currently active and spinning.\">\n {code`return this.#isSpinning;`}\n </ClassPropertyGet>\n <Spacing />\n <ClassPropertySet\n public\n name=\"message\"\n type=\"string\"\n doc=\"Set the message displayed by the spinner.\">\n {code`this.#message = value;`}\n </ClassPropertySet>\n <Spacing />\n <ClassPropertyGet\n public\n name=\"message\"\n type=\"string\"\n doc=\"Get the message displayed by the spinner.\">\n {code`return this.#message;`}\n </ClassPropertyGet>\n <Spacing />\n <ClassMethod\n name=\"start\"\n doc=\"Start the spinner animation.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n <IfStatement condition={code`message !== undefined`}>\n {code`this.#message = message;`}\n </IfStatement>\n <IfStatement condition={code`this.isSpinning`}>\n {code`return this;`}\n </IfStatement>\n {code`this.#isSpinning = true;\n this.#hideCursor();\n this.#installHook();\n this.#render();\n this.#subscribeToProcessEvents();\n\n if (isInteractive) {\n this.#timer = setInterval(() => {\n this.#render();\n }, this.#interval);\n }\n\n return this;\n `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"stop\"\n doc=\"Stop the spinner animation.\"\n parameters={[\n { name: \"finalMessage\", optional: true, type: \"string\" }\n ]}>\n {code`if (!this.isSpinning) {\n return this;\n }\n\n const shouldWriteNewline = this.#isDeferringRender;\n this.#isSpinning = false;\n if (this.#timer) {\n clearInterval(this.#timer);\n this.#timer = undefined;\n }\n\n this.#isDeferringRender = false;\n this.#uninstallHook();\n this.#showCursor();\n this.clear();\n this.#unsubscribeFromProcessEvents();\n\n if (finalMessage) {\n const prefix = shouldWriteNewline ? \"\\\\n\" : \"\";\n this.#stream.write(\\`\\${prefix}\\${finalMessage}\\\\n\\`);\n }\n\n return this;\n\n `}\n </ClassMethod>\n <Spacing />\n <ClassMethod name=\"clear\" doc=\"Clear the spinner animation.\">\n {code`if (!isInteractive) {\n return this;\n }\n\n if (this.#lines === 0) {\n return this;\n }\n\n this.#internalWrite(() => {\n this.#stream.cursorTo(0);\n\n for (let index = 0; index < this.#lines; index++) {\n if (index > 0) {\n this.#stream.moveCursor(0, -1);\n }\n\n this.#stream.clearLine(1);\n }\n });\n\n this.#lines = 0;\n return this; `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"success\"\n doc=\"Mark the spinner as successful.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n {code`return this.#stopWithIcon(textColors.spinner.icon.success(\"${\n theme.icons.spinner.success\n }\"), textColors.spinner.message.success(message)); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"error\"\n doc=\"Mark the spinner as failed.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n {code`return this.#stopWithIcon(textColors.spinner.icon.error(\"${\n theme.icons.spinner.error\n }\"), textColors.spinner.message.error(message)); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"warning\"\n doc=\"Mark the spinner as warning.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n {code`return this.#stopWithIcon(textColors.spinner.icon.warning(\"${\n theme.icons.spinner.warning\n }\"), textColors.spinner.message.warning(message)); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"info\"\n doc=\"Mark the spinner as informational.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n {code`return this.#stopWithIcon(textColors.spinner.icon.info(\"${\n theme.icons.spinner.info\n }\"), textColors.spinner.message.info(message)); `}\n </ClassMethod>\n <Spacing />\n <ClassMethod\n name=\"help\"\n doc=\"Mark the spinner as help.\"\n parameters={[{ name: \"message\", type: \"string\" }]}>\n {code`return this.#stopWithIcon(textColors.spinner.icon.help(\"${\n theme.icons.spinner.help\n }\"), textColors.spinner.message.help(message)); `}\n </ClassMethod>\n <Spacing />\n </ClassDeclaration>\n <Spacing />\n <TSDoc heading=\"Render a spinner in the console.\">\n <TSDocParam name=\"options\">\n {`Options for configuring the spinner, including the message to display, the output stream to write to, and the spinner animation to use.`}\n </TSDocParam>\n <TSDocReturns>{`An instance of the Spinner class, which can be used to control the spinner animation (e.g., start, stop, mark as success/error, etc.).`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"createSpinner\"\n parameters={[\n {\n name: \"options\",\n type: \"SpinnerOptions\",\n optional: true\n }\n ]}>\n {code`return new Spinner(options);`}\n </FunctionDeclaration>\n </>\n );\n}\n\nfunction extractBorderOptionsObject(\n direction:\n | \"top\"\n | \"right\"\n | \"bottom\"\n | \"left\"\n | \"topLeft\"\n | \"topRight\"\n | \"bottomLeft\"\n | \"bottomRight\",\n theme: ThemeResolvedConfig\n): string {\n return `borderOptions.${\n direction\n } === \"primary\" ? borderColors.app.table.primary(\"${\n theme.borderStyles.app.table.primary[direction]\n }\") : borderOptions.${\n direction\n } === \"secondary\" ? borderColors.app.table.secondary(\"${\n theme.borderStyles.app.table.secondary[direction]\n }\") : borderOptions.${\n direction\n } === \"tertiary\" ? borderColors.app.table.tertiary(\"${\n theme.borderStyles.app.table.tertiary[direction]\n }\") : !borderOptions.${direction} || borderOptions.${\n direction\n } === \"none\" ? \"\" : borderOptions.${direction}`;\n}\n\nfunction extractBorderOptionsString(\n direction:\n | \"top\"\n | \"right\"\n | \"bottom\"\n | \"left\"\n | \"topLeft\"\n | \"topRight\"\n | \"bottomLeft\"\n | \"bottomRight\",\n theme: ThemeResolvedConfig\n): string {\n return `borderOptions === \"primary\" ? borderColors.app.table.primary(\"${\n theme.borderStyles.app.table.primary[direction]\n }\") : borderOptions === \"secondary\" ? borderColors.app.table.secondary(\"${\n theme.borderStyles.app.table.secondary[direction]\n }\") : borderOptions === \"tertiary\" ? borderColors.app.table.tertiary(\"${\n theme.borderStyles.app.table.tertiary[direction]\n }\") : !borderOptions || borderOptions === \"none\" ? \"\" : borderOptions`;\n}\n\n/**\n * Props for the TableFunctionDeclaration component.\n */\nexport type TableFunctionDeclarationProps = Omit<\n FunctionDeclarationProps,\n \"parameters\" | \"name\"\n>;\n\n/**\n * A component to generate the table functions in the `shell-shock:console` builtin module.\n */\nexport function TableFunctionDeclaration(props: TableFunctionDeclarationProps) {\n const theme = useTheme();\n\n return (\n <>\n <TypeDeclaration\n export\n name=\"SizeToken\"\n doc=\"A type representing the width size of an item in the console.\">\n {code`\"full\" | \"1/1\" | \"1/2\" | \"1/3\" | \"1/4\" | \"1/5\" | \"1/6\" | \"1/12\" | \"1/24\" | \"100%\" | \"50%\" | \"33.33%\" | \"25%\" | \"20%\" | \"10%\" | \"5%\" | \"2.5%\"`}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Determine if a value is a valid size token.\">\n <TSDocRemarks>\n {`This function checks if the provided value is a valid size token, which can be one of the predefined strings representing common width sizes (e.g., \"full\", \"1/2\", \"1/3\", etc.) or percentage strings (e.g., \"50%\").`}\n </TSDocRemarks>\n <TSDocParam name=\"value\">{`The value to check for being a valid size token.`}</TSDocParam>\n <TSDocReturns>{`True if the value is a valid size token, false otherwise.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n doc=\"Determines if the provided value is a valid size token.\"\n name=\"isSizeToken\"\n parameters={[\n {\n name: \"value\",\n type: \"any\"\n }\n ]}\n returnType=\"value is SizeToken\">\n <IfStatement\n condition={code`[\"full\", \"1/1\", \"1/2\", \"1/3\", \"1/4\", \"1/5\", \"1/6\", \"1/12\", \"1/24\", \"100%\", \"50%\", \"33.33%\", \"25%\", \"20%\", \"10%\", \"5%\", \"2.5%\"].includes(value)`}>\n {code`return true; `}\n </IfStatement>\n {code`return false; `}\n </FunctionDeclaration>\n <Spacing />\n <TSDoc heading=\"Calculate the width in characters based on the provided width size.\">\n <TSDocRemarks>\n {`This function calculates the width in characters based on the provided width size, which can be a predefined string (e.g., \"full\", \"1/2\", \"1/3\", etc.) or a percentage string (e.g., \"50%\"). The calculation is based on the current width of the console (getTerminalSize().columns).`}\n </TSDocRemarks>\n <TSDocParam name=\"size\">\n {`The width size to calculate. This can be a predefined string (e.g., \"full\", \"1/2\", \"1/3\", etc.) or a percentage string (e.g., \"50%\").`}\n </TSDocParam>\n <TSDocReturns>{`The calculated width in characters.`}</TSDocReturns>\n </TSDoc>\n <FunctionDeclaration\n export\n name=\"calculateWidth\"\n parameters={[\n {\n name: \"size\",\n type: \"SizeToken\",\n optional: false\n }\n ]}\n returnType=\"number\">\n <IfStatement condition={code`[\"full\", \"100%\", \"1/1\"]. includes(size)`}>\n {code`return getTerminalSize().columns;`}\n </IfStatement>\n <ElseIfClause condition={code`[\"1/2\", \"50%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 2);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/3\", \"33.33%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 3);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/4\", \"25%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 4);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/5\", \"20%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 5);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/6\", \"10%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 6);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/12\", \"5%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 12);`}\n </ElseIfClause>\n <ElseIfClause condition={code`[\"1/24\", \"2.5%\"].includes(size)`}>\n {code`return Math.round(getTerminalSize().columns / 24);`}\n </ElseIfClause>\n <ElseClause>\n {code`\n const match = size.match(/(\\\\d+(\\\\.\\\\d+)?)%/);\n if (match) {\n return Math.round((getTerminalSize().columns * parseFloat(match[1])) / 100);\n }\n\n throw new Error(\\`Invalid width size: \\${size}\\`);\n `}\n </ElseClause>\n <Spacing />\n </FunctionDeclaration>\n\n <TypeDeclaration\n export\n name=\"BorderOption\"\n doc=\"The border options applied to table cells.\">\n {code`\"primary\" | \"secondary\" | \"tertiary\" | \"none\" | string; `}\n </TypeDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"TableOutputOptions\"\n doc=\"Options to customize the output of the {@link table} function.\">\n <TSDoc heading=\"Border variant for the table cell.\">\n <TSDocRemarks>\n {`The border variant to use for the table cell. This determines the color and style of the border around the cell.`}\n </TSDocRemarks>\n <hbr />\n <TSDocDefaultValue\n type={ReflectionKind.property}\n defaultValue=\"primary\"\n />\n </TSDoc>\n <InterfaceMember\n name=\"border\"\n optional\n type=\"BorderOption | { top?: BorderOption; right?: BorderOption; bottom?: BorderOption; left?: BorderOption; topLeft?: BorderOption; topRight?: BorderOption; bottomLeft?: BorderOption; bottomRight?: BorderOption; }\"\n />\n <hbr />\n <TSDoc heading=\"Padding for the table cell.\">\n <TSDocRemarks>\n {`The amount of padding (in spaces) to apply to the table cell. This value is applied to both the left and right sides of the cell. If not specified, the default table padding defined in the current theme configuration will be used.`}\n </TSDocRemarks>\n <hbr />\n <TSDocDefaultValue\n type={ReflectionKind.property}\n defaultValue={`\\`${theme.padding.table}\\``}\n />\n </TSDoc>\n <InterfaceMember name=\"padding\" optional type=\"number\" />\n <hbr />\n <TSDoc heading=\"Alignment for the table cell.\">\n <TSDocRemarks>\n {`The alignment for the table cell. This determines how the text within the cell is aligned. If not specified, the default alignment is \"left\".`}\n </TSDocRemarks>\n <hbr />\n <TSDocDefaultValue\n type={ReflectionKind.property}\n defaultValue=\"left\"\n />\n </TSDoc>\n <InterfaceMember\n name=\"align\"\n optional\n type='\"left\" | \"right\" | \"center\"'\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"TableCellOptions\"\n extends=\"TableOutputOptions\"\n doc=\"Options for a specific table cell provided to the {@link table} function.\">\n <InterfaceMember\n name=\"value\"\n optional\n type=\"string\"\n doc=\"The actual string value of the table cell.\"\n />\n <hbr />\n <TSDoc heading=\"Width of the table cell.\">\n <TSDocRemarks>\n {`The width of the table cell (where 1 is a single character in the terminal). If not specified, the width will be determined based on the content of the cell and the available space in the console.`}\n </TSDocRemarks>\n </TSDoc>\n <InterfaceMember\n name=\"maxWidth\"\n type=\"number | SizeToken | undefined\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"TableRowOptions\"\n extends=\"TableOutputOptions\"\n doc=\"Options for a specific table row provided to the {@link table} function.\">\n <InterfaceMember\n name=\"values\"\n optional\n type=\"(string | TableCellOptions)[]\"\n doc=\"The actual string values of the table row's cells.\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n export\n name=\"TableOptions\"\n extends=\"TableOutputOptions\"\n doc=\"Options for a specific table cell provided to the {@link table} function.\">\n <InterfaceMember\n name=\"values\"\n optional\n type=\"(string | TableCellOptions)[][]\"\n doc=\"The actual string values of the table's rows' cells.\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"Dimensions\"\n doc=\"The height and width for a specific table/cell used internally in the {@link table} function.\">\n <InterfaceMember\n name=\"height\"\n type=\"number\"\n doc=\"The height of the row/cell (where 1 is a single line in the terminal).\"\n />\n <hbr />\n <InterfaceMember\n name=\"width\"\n type=\"number\"\n doc=\"The width of the row/cell (where 1 is a single character in the terminal).\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <InterfaceDeclaration\n name=\"TableCellBorder\"\n doc=\"The resolved complete border styles for a table cell.\">\n <InterfaceMember\n name=\"top\"\n type=\"string\"\n doc=\"The top border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"bottom\"\n type=\"string\"\n doc=\"The bottom border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"right\"\n type=\"string\"\n doc=\"The right border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"left\"\n type=\"string\"\n doc=\"The left border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"topLeft\"\n type=\"string\"\n doc=\"The top-left border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"topRight\"\n type=\"string\"\n doc=\"The top-right border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"bottomLeft\"\n type=\"string\"\n doc=\"The bottom-left border style of the table cell.\"\n />\n <hbr />\n <InterfaceMember\n name=\"bottomRight\"\n type=\"string\"\n doc=\"The bottom-right border style of the table cell.\"\n />\n <hbr />\n </InterfaceDeclaration>\n <Spacing />\n <TypeDeclaration\n name=\"TableCell\"\n doc=\"The internal state of a formatted table cell in the {@link table} function.\">\n {code`Required<Omit<TableCellOptions, \"maxWidth\" | \"border\">> & Dimensions & {\n border: TableCellBorder;\n maxWidth?: number;\n };\n `}\n </TypeDeclaration>\n <Spacing />\n <TSDoc heading=\"Write a table to the console.\">\n <TSDocRemarks>\n {`This function writes a table to the console, applying the appropriate padding as defined in the current theme configuration and wrapping as needed.`}\n </TSDocRemarks>\n <hbr />\n <TSDocParam name=\"options\">\n {`Options to customize the table output.`}\n </TSDocParam>\n </TSDoc>\n <FunctionDeclaration\n export\n {...props}\n name=\"table\"\n parameters={[\n {\n name: \"options\",\n type: \"TableOptions | TableRowOptions[] | TableCellOptions[][] | string[] | string[][]\",\n optional: false\n }\n ]}>\n <IfStatement\n condition={code`!options ||\n (!Array.isArray(options) && (typeof options !== \"object\" || !options.values || !Array.isArray(options.values) || options.values.length === 0)) ||\n (Array.isArray(options) && !options.every(item => typeof item === \"object\" || typeof item === \"string\" || Array.isArray(item))) `}>\n {code`return;`}\n </IfStatement>\n <Spacing />\n <VarDeclaration\n let\n name=\"cells\"\n type={`TableCell[][]`}\n initializer={code`[];`}\n />\n <hbr />\n {code`\n const extractTableCell = (cell: string | TableCellOptions, columnIndex: number, rowLength: number, opts?: TableOutputOptions): TableCell => {\n if (typeof cell === \"string\") {\n const borderOptions = opts?.border || \"primary\";\n\n let border = {} as TableCellBorder;\n if (typeof borderOptions === \"object\") {\n border = {\n top: ${extractBorderOptionsObject(\"top\", theme)},\n bottom: ${extractBorderOptionsObject(\"bottom\", theme)},\n left: ${extractBorderOptionsObject(\"left\", theme)},\n right: ${extractBorderOptionsObject(\"right\", theme)},\n topLeft: ${extractBorderOptionsObject(\"topLeft\", theme)},\n topRight: ${extractBorderOptionsObject(\"topRight\", theme)},\n bottomLeft: ${extractBorderOptionsObject(\"bottomLeft\", theme)},\n bottomRight: ${extractBorderOptionsObject(\"bottomRight\", theme)},\n };\n } else {\n border.top = ${extractBorderOptionsString(\"top\", theme)};\n border.bottom = ${extractBorderOptionsString(\"bottom\", theme)};\n border.left = ${extractBorderOptionsString(\"left\", theme)};\n border.right = ${extractBorderOptionsString(\"right\", theme)};\n border.topLeft = ${extractBorderOptionsString(\"topLeft\", theme)};\n border.topRight = ${extractBorderOptionsString(\"topRight\", theme)};\n border.bottomLeft = ${extractBorderOptionsString(\"bottomLeft\", theme)};\n border.bottomRight = ${extractBorderOptionsString(\"bottomRight\", theme)};\n }\n\n const padding = Math.max(0, opts?.padding ?? ${theme.padding.table}) * (columnIndex === 0 || columnIndex === rowLength - 1 ? 2 : 1);\n const value = cell ?? \"\";\n const width = stripAnsi(value).length + padding * 2;\n\n return {\n value,\n height: 1,\n width,\n border,\n padding,\n align: opts?.align || \"left\",\n };\n } else {\n const borderOptions = cell.border || opts?.border || \"primary\";\n\n let border = {} as TableCellBorder;\n if (typeof borderOptions === \"object\") {\n border = {\n top: ${extractBorderOptionsObject(\"top\", theme)},\n bottom: ${extractBorderOptionsObject(\"bottom\", theme)},\n left: ${extractBorderOptionsObject(\"left\", theme)},\n right: ${extractBorderOptionsObject(\"right\", theme)},\n topLeft: ${extractBorderOptionsObject(\"topLeft\", theme)},\n topRight: ${extractBorderOptionsObject(\"topRight\", theme)},\n bottomLeft: ${extractBorderOptionsObject(\"bottomLeft\", theme)},\n bottomRight: ${extractBorderOptionsObject(\"bottomRight\", theme)},\n };\n } else {\n border.top = ${extractBorderOptionsString(\"top\", theme)};\n border.bottom = ${extractBorderOptionsString(\"bottom\", theme)};\n border.left = ${extractBorderOptionsString(\"left\", theme)};\n border.right = ${extractBorderOptionsString(\"right\", theme)};\n border.topLeft = ${extractBorderOptionsString(\"topLeft\", theme)};\n border.topRight = ${extractBorderOptionsString(\"topRight\", theme)};\n border.bottomLeft = ${extractBorderOptionsString(\"bottomLeft\", theme)};\n border.bottomRight = ${extractBorderOptionsString(\"bottomRight\", theme)};\n }\n\n const padding = Math.max(0, cell.padding ?? opts?.padding ?? ${\n theme.padding.table\n });\n const value = cell.value ?? \"\";\n const width = stripAnsi(value).length + padding * 2;\n const maxWidth = cell.maxWidth ? typeof cell.maxWidth === \"number\" ? cell.maxWidth : calculateWidth(cell.maxWidth) : undefined;\n\n return {\n value,\n height: 1,\n width,\n maxWidth,\n border,\n padding,\n align: cell.align || opts?.align || \"left\",\n };\n }\n };\n\n let colMaxWidths = [] as (number | undefined)[];\n `}\n <hbr />\n <IfStatement condition={code`Array.isArray(options)`}>\n <IfStatement\n condition={code`options.every(row => typeof row === \"string\" || (typeof row === \"object\" && !Array.isArray(row) && !(\"values\" in row)))`}>\n {code`cells.push(options.map((cell, index) => extractTableCell(cell as string | TableCellOptions, index, options.length)));`}\n </IfStatement>\n <ElseClause>\n {code`\n cells.push(\n ...options.map(row => Array.isArray(row)\n ? row.reduce((cellRow, cell, index) => {\n if (colMaxWidths.length <= index) {\n colMaxWidths.push(undefined);\n }\n const newCell = extractTableCell(cell, index, row.length);\n if (newCell.maxWidth && (!colMaxWidths[index] || newCell.maxWidth < colMaxWidths[index]!)) {\n colMaxWidths[index] = newCell.maxWidth;\n }\n cellRow.push(newCell);\n return cellRow;\n }, [] as TableCell[])\n : (row as TableRowOptions).values?.reduce((cellRow, cell, index) => {\n if (colMaxWidths.length <= index) {\n colMaxWidths.push(undefined);\n }\n const newCell = extractTableCell(cell, index, (row as TableRowOptions).values?.length ?? 1, row as TableRowOptions);\n if (newCell.maxWidth && (!colMaxWidths[index] || newCell.maxWidth < colMaxWidths[index]!)) {\n colMaxWidths[index] = newCell.maxWidth;\n }\n cellRow.push(newCell);\n return cellRow;\n }, [] as TableCell[]) ?? []\n )\n );\n `}\n </ElseClause>\n </IfStatement>\n <ElseClause>\n {code`\n cells.push(\n ...options.values!.map(row => Array.isArray(row)\n ? row.reduce((cellRow, cell, index) => {\n if (colMaxWidths.length <= index) {\n colMaxWidths.push(undefined);\n }\n const newCell = extractTableCell(cell, index, row.length);\n if (newCell.maxWidth && (!colMaxWidths[index] || newCell.maxWidth < colMaxWidths[index]!)) {\n colMaxWidths[index] = newCell.maxWidth;\n }\n cellRow.push(newCell);\n return cellRow;\n }, [] as TableCell[])\n : (row as TableRowOptions).values?.reduce((cellRow, cell, index) => {\n if (colMaxWidths.length <= index) {\n colMaxWidths.push(undefined);\n }\n const newCell = extractTableCell(cell, index, (row as TableRowOptions).values?.length ?? 1, options);\n if (newCell.maxWidth && (!colMaxWidths[index] || newCell.maxWidth < colMaxWidths[index]!)) {\n colMaxWidths[index] = newCell.maxWidth;\n }\n cellRow.push(newCell);\n return cellRow;\n }, [] as TableCell[]) ?? []\n )\n );\n\n `}\n </ElseClause>\n <hbr />\n {code`\ncells = cells.filter(row => row.length > 0);\nif (cells.length === 0) {\n return;\n}\n\ncells.forEach(row => row.forEach((cell, index) => {\n if (colMaxWidths[index] && cell.maxWidth !== colMaxWidths[index]!) {\n cell.maxWidth = colMaxWidths[index]!;\n }\n}));\n\n// Calculate table dimensions\nlet colWidths = [] as number[];\nlet rowDims = [] as Dimensions[];\n\nconst calculateRowDimensions = () => {\n colWidths = [];\n return cells.reduce((dims, row) => {\n dims.push(row.reduce((dim, cell, index) => {\n dim.width += cell.width;\n if (cell.height > dim.height) {\n dim.height = cell.height;\n }\n if (!colWidths[index] || cell.width > colWidths[index]!) {\n colWidths[index] = cell.width;\n }\n\n return dim;\n }, { width: 0, height: 0 } as Dimensions));\n\n return dims;\n }, [] as Dimensions[]);\n}\n\nlet recalculate!: boolean;\ndo {\n recalculate = false;\n rowDims = calculateRowDimensions();\n\n if (!recalculate && colWidths.some((colWidth, index) => colMaxWidths[index] && colWidth > colMaxWidths[index]!)) {\n (colWidths.map((colWidth, index) => colMaxWidths[index] && colWidth > colMaxWidths[index]! ? index : undefined).filter(colWidth => colWidth !== undefined) as number[]).forEach(index => {\n cells.forEach(row => {\n const cell = row[index]!;\n if (colMaxWidths[index] && cell.width > colMaxWidths[index]) {\n const lines = splitText(\n cell.value,\n colMaxWidths[index] - cell.padding * 2,\n );\n\n cell.value = lines.join(\"\\\\n\");\n cell.height = lines.length;\n cell.width = Math.max(...lines.map(line => stripAnsi(line).length)) + cell.padding * 2;\n\n recalculate = true;\n }\n });\n });\n }\n\n rowDims.forEach((row, rowIndex) => {\n if (!recalculate && row.width > Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2\n }, 0)) {\n const cell = cells[rowIndex]!.reduce((largestCell, cell) => {\n if (cell.width > largestCell.width) {\n return cell;\n }\n return largestCell;\n }, cells[rowIndex]![0]!);\n\n const lines = splitText(\n cell.value,\n Math.min(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2\n } - (row.width - (cell.width - cell.padding * 2)), 0),\n cell.maxWidth ?? Number.POSITIVE_INFINITY)\n );\n\n cell.value = lines.join(\"\\\\n\");\n cell.height = lines.length;\n cell.width = Math.max(...lines.map(line => stripAnsi(line).length)) + cell.padding * 2;\n\n recalculate = true;\n }\n });\n\n if (!recalculate && colWidths.reduce((a, b) => a + b, 0) > Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2\n }, 0)) {\n let colIndex = 0;\n const cell = cells.reduce((ret, row) => {\n return row.reduce((largest, current, index) => {\n if (largest.width < current.width) {\n colIndex = index;\n return current;\n }\n return largest;\n }, ret);\n }, cells[0]![0]!);\n\n const lines = splitText(\n cell.value,\n Math.min(Math.max(getTerminalSize().columns - ${\n Math.max(theme.padding.app, 0) * 2\n } - (colWidths.filter((_, i) => i !== colIndex).reduce((a, b) => a + b, 0)) - cell.padding * 2, 0),\n cell.maxWidth ?? Number.POSITIVE_INFINITY)\n );\n\n cell.value = lines.join(\"\\\\n\");\n cell.height = lines.length;\n cell.width = Math.max(...lines.map(line => stripAnsi(line).length)) + cell.padding * 2;\n\n recalculate = true;\n }\n} while (recalculate);\n\n// Render table\ncells.forEach((row, rowIndex) => {\n const outputs = [] as string[][];\n row.forEach((cell, colIndex) => {\n const lines = cell.value.split(\"\\\\n\");\n while (lines.length < rowDims[rowIndex]!.height) {\n lines.push(\"\");\n }\n\n outputs.push(lines.map(line => {\n let paddedContent = \"\";\n switch (cell.align) {\n case \"right\":\n paddedContent = \" \".repeat(Math.max(colWidths[colIndex] - stripAnsi(line).length - cell.padding, 0)) + line + \" \".repeat(cell.padding);\n break;\n case \"center\":\n const leftPadding = Math.floor((colWidths[colIndex] - stripAnsi(line).length - cell.padding) / 2);\n const rightPadding = colWidths[colIndex] - stripAnsi(line).length - leftPadding;\n paddedContent = \" \".repeat(leftPadding) + line + \" \".repeat(rightPadding);\n break;\n case \"left\":\n default:\n paddedContent = \" \".repeat(cell.padding) + line + \" \".repeat(Math.max(colWidths[colIndex] - stripAnsi(line).length - cell.padding, 0));\n break;\n }\n\n if (colIndex === row.length - 1) {\n return cell.border.left + paddedContent + cell.border.right;\n } else {\n return cell.border.left + paddedContent;\n }\n }));\n });\n\n for (let index = 0; index < rowDims[rowIndex]!.height; index++) {\n writeLine(outputs.map(output => output[index] ?? \"\").join(\"\"));\n }\n});\n`}\n </FunctionDeclaration>\n </>\n );\n}\n\nexport type ConsoleBuiltinProps = Pick<\n BuiltinFileProps,\n \"children\" | \"imports\" | \"builtinImports\"\n>;\n\n/**\n * A built-in console utilities module for Shell Shock.\n */\nexport function ConsoleBuiltin(props: ConsoleBuiltinProps) {\n const { children, imports, builtinImports } = props;\n\n return (\n <BuiltinFile\n id=\"console\"\n description=\"A collection of helper utilities to assist in generating content meant for display in the console.\"\n imports={defu(imports, {\n \"@shell-shock/plugin-theme/types/theme\": [\"ThemeSpinnerResolvedConfig\"],\n \"@shell-shock/plugin-theme/helpers/spinners\": [\n \"SpinnerPreset\",\n \"resolveSpinner\"\n ],\n \"node:util\": [\"stripVTControlCharacters\"]\n })}\n builtinImports={defu(builtinImports, {\n utils: [\n \"isInteractive\",\n \"isColorSupported\",\n \"colorSupportLevels\",\n \"isUnicodeSupported\",\n \"isHyperlinkSupported\",\n \"getTerminalSize\"\n ],\n env: [\"env\", \"isDevelopment\", \"isDebug\"],\n state: [\"hasFlag\"]\n })}>\n <AnsiHelpersDeclarations />\n <Spacing />\n <StripAnsiFunctionDeclaration />\n <Spacing />\n <WrapAnsiFunction />\n <Spacing />\n <AnsiStyleFunctionsDeclaration />\n <Spacing />\n <WriteFunctionDeclaration />\n <Spacing />\n <WriteLineFunctionDeclaration />\n <Spacing />\n <SplitTextFunctionDeclaration />\n <Spacing />\n <LinkFunctionDeclaration />\n <Spacing />\n <DividerFunctionDeclaration />\n <Spacing />\n <SpinnerFunctionDeclaration />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"help\"\n variant=\"help\"\n consoleFnName=\"log\"\n description=\"help\"\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"success\"\n variant=\"success\"\n consoleFnName=\"info\"\n description=\"success\"\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"info\"\n variant=\"info\"\n consoleFnName=\"info\"\n description=\"informational\"\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"debug\"\n variant=\"debug\"\n consoleFnName=\"debug\"\n description=\"debug\"\n timestamp\n prefix={\n <IfStatement condition={<IsNotDebug />}>{code`return; `}</IfStatement>\n }\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"verbose\"\n variant=\"info\"\n color=\"debug\"\n consoleFnName=\"debug\"\n description=\"verbose\"\n timestamp\n prefix={\n <IfStatement\n condition={<IsNotVerbose />}>{code`return; `}</IfStatement>\n }\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"warn\"\n variant=\"warning\"\n consoleFnName=\"warn\"\n description=\"warning\"\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"danger\"\n variant=\"danger\"\n consoleFnName=\"error\"\n description=\"destructive/danger\"\n />\n <Spacing />\n <MessageFunctionDeclaration\n type=\"error\"\n variant=\"error\"\n consoleFnName=\"error\"\n description=\"error\"\n timestamp\n parameters={[\n {\n name: \"err\",\n type: \"string | Error\",\n optional: false\n },\n {\n name: \"header\",\n type: \"string\",\n optional: true\n }\n ]}\n prefix={\n <>\n <VarDeclaration let name=\"message\" type=\"string | undefined\" />\n <Spacing />\n <IfStatement condition={code`(err as Error)?.message`}>\n {code`message = (err as Error).message;`}\n </IfStatement>\n <ElseClause>{code`message = String(err);`}</ElseClause>\n <Spacing />\n <IfStatement condition={code`env.STACKTRACE`}>\n <IfStatement condition={code`(err as Error)?.stack`}>\n {code`message += \" \\\\n\\\\n\" + ((err as Error).stack || \"\");`}\n </IfStatement>\n <ElseClause>{code`message += \" \\\\n\\\\n\" + ((new Error(\" \")).stack || \"\").split(\"\\\\n\").slice(2).map(line => line.trim()).join(\"\\\\n\");`}</ElseClause>\n </IfStatement>\n </>\n }\n />\n <Spacing />\n <TableFunctionDeclaration />\n <Spacing />\n <BlockquoteFunctionDeclaration />\n <Spacing />\n <CodeFunctionDeclaration />\n <Spacing />\n <InlineCodeFunctionDeclaration />\n <Spacing />\n {children}\n <Spacing />\n </BuiltinFile>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAsCA,SAAE,0BAAA;AACA,QAAO;EAAA,gBAAkB,gBAAiB;GAC5C,SAAa;GACb,UAAS;GACT,MAAO;GACL,KAAK;GACL,UAAA,IAAA;GACA,CAAA;EAAA,gBAAY,SAAA,EAAA,CAAA;EAAA,gBAAA,gBAAA;GACZ,SAAU;GACV,UAAY;GACZ,MAAA;GACA,KAAO;GACT,UAAS,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCL,SAAQ;GACR,UAAO;GACP,MAAM;GACN,KAAK;;;;;;;;;;;;;;;;;;;;;GAqBN,CAAC;EAAE,gBAAe,SAAY,EAAE,CAAC;EAAE,gBAAc,gBAAM;GACtD,SAAM;GACN,UAAU;GACV,MAAM;GACN,KAAK;GACL,UAAM,IAAQ;;;;GAIf,CAAC;EAAE,gBAAC,SAAA,EAAA,CAAA;EAAA,gBAAA,qBAAA;GACH,UAAI;GACJ,MAAI;GACJ,KAAI;GACJ,YAAY,CAAA;IACV,MAAG;IACH,MAAI;IACJ,KAAI;IACL,EAAE;IACD,MAAI;IACJ,MAAI;IACJ,KAAI;IACL,CAAC;GACF,UAAQ,IAAI;;;;;;;;;;;GAWb,CAAC;EAAE,gBAAK,SAAA,EAAA,CAAA;EAAA;;;;;AASX,SAAS,cAAc,EACrB,QACA,SACA,SACA,iBAAc,SACT;AACL,QAAM,IAAA,uDAAA,iBAAA,KAAA,uBAAA;;;;;;;;;;;wCAWkB,iBAAA,IAAA,OAAA,KAAA,MAAA,OAAA,MAAA,KAAA,iBAAA,OAAA,WAAA,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
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Shell Shock plugin to generate the `console` built-in module.",
|
|
6
6
|
"keywords": [
|
|
@@ -125,18 +125,18 @@
|
|
|
125
125
|
"dependencies": {
|
|
126
126
|
"@alloy-js/core": "0.23.0-dev.8",
|
|
127
127
|
"@alloy-js/typescript": "0.23.0-dev.4",
|
|
128
|
-
"@powerlines/deepkit": "^0.
|
|
129
|
-
"@powerlines/plugin-alloy": "^0.26.
|
|
130
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
131
|
-
"@shell-shock/core": "^0.17.
|
|
132
|
-
"@shell-shock/plugin-theme": "^0.4.
|
|
128
|
+
"@powerlines/deepkit": "^0.8.0",
|
|
129
|
+
"@powerlines/plugin-alloy": "^0.26.15",
|
|
130
|
+
"@powerlines/plugin-plugin": "^0.12.347",
|
|
131
|
+
"@shell-shock/core": "^0.17.3",
|
|
132
|
+
"@shell-shock/plugin-theme": "^0.4.16",
|
|
133
133
|
"@stryke/string-format": "^0.17.9",
|
|
134
134
|
"@stryke/type-checks": "^0.6.1",
|
|
135
135
|
"defu": "^6.1.7",
|
|
136
|
-
"powerlines": "^0.42.
|
|
136
|
+
"powerlines": "^0.42.37"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
|
-
"@powerlines/plugin-deepkit": "^0.11.
|
|
139
|
+
"@powerlines/plugin-deepkit": "^0.11.277",
|
|
140
140
|
"@types/node": "^25.6.0"
|
|
141
141
|
},
|
|
142
142
|
"publishConfig": {
|
|
@@ -154,5 +154,5 @@
|
|
|
154
154
|
"./package.json": "./package.json"
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
|
-
"gitHead": "
|
|
157
|
+
"gitHead": "d6ec6746792a83206915332c4eb87c9da70a5148"
|
|
158
158
|
}
|