"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../_virtual/_rolldown/runtime.js');
const require_primordials_array = require('../primordials/array.js');
const require_strings_format = require('../strings/format.js');
const require_logger_default = require('../logger/default.js');
let src_external_yoctocolors_cjs = require("../external/yoctocolors-cjs");
src_external_yoctocolors_cjs = require_runtime.__toESM(src_external_yoctocolors_cjs);

//#region src/stdio/header.ts
/**
* @file Console header/banner formatting utilities. Provides consistent header
*   formatting for CLI applications.
*/
const logger = require_logger_default.getDefaultLogger();
/**
* Create a formatted header/banner with borders and centered title. Useful for
* marking the start of CLI output or creating visual sections.
*
* @example
*   ;```ts
*   console.log(
*     createHeader('Socket Security Analysis', {
*       width: 70,
*       color: 'cyan',
*       bold: true,
*       padding: 2,
*     }),
*   )
*   // Output:
*   // ======================================================================
*   //
*   //                    Socket Security Analysis
*   //
*   // ======================================================================
*   ```
*
* @param title - Title text to display in header.
* @param options - Header formatting options.
*
* @returns Formatted header string with borders and centered title
*/
function createHeader(title, options) {
	const { bold = true, borderChar = "=", color = "cyan", padding = 1, width = 80 } = {
		__proto__: null,
		...options
	};
	const border = /* @__PURE__ */ require_strings_format.repeatString(borderChar, width);
	let formattedTitle = title;
	if (color && src_external_yoctocolors_cjs.default[color]) formattedTitle = src_external_yoctocolors_cjs.default[color](formattedTitle);
	if (bold && src_external_yoctocolors_cjs.default.bold) formattedTitle = src_external_yoctocolors_cjs.default.bold(formattedTitle);
	const centeredTitle = /* @__PURE__ */ require_strings_format.centerText(formattedTitle, width);
	const paddingLine = /* @__PURE__ */ require_strings_format.repeatString(" ", width);
	const lines = [border];
	for (let i = 0; i < padding; i++) require_primordials_array.ArrayPrototypePush(lines, paddingLine);
	require_primordials_array.ArrayPrototypePush(lines, centeredTitle);
	for (let i = 0; i < padding; i++) require_primordials_array.ArrayPrototypePush(lines, paddingLine);
	require_primordials_array.ArrayPrototypePush(lines, border);
	return lines.join("\n");
}
/**
* Create a simple section header without padding. A lighter-weight alternative
* to `createHeader()` for subsections.
*
* @example
*   ;```ts
*   console.log(
*     createSectionHeader('Dependencies', {
*       width: 50,
*       color: 'blue',
*     }),
*   )
*   // Output:
*   // --------------------------------------------------
*   //                   Dependencies
*   // --------------------------------------------------
*   ```
*
* @param title - Title text to display in header.
* @param options - Header formatting options.
*
* @returns Formatted section header string
*/
function createSectionHeader(title, options) {
	const { borderChar = "-", color = "blue", width = 60 } = {
		__proto__: null,
		...options
	};
	return createHeader(title, {
		width,
		borderChar,
		padding: 0,
		color,
		bold: false
	});
}
/**
* Print a header directly to stdout with standard formatting. Uses fixed width
* of 55 characters with `═` borders. Simpler alternative to `createHeader()`
* for quick headers.
*
* @example
*   ;```ts
*   printHeader('Package Analysis')
*   // Output:
*   // ═══════════════════════════════════════════════════
*   //   Package Analysis
*   // ═══════════════════════════════════════════════════
*   ```
*
* @param title - Title text to display.
*/
function printHeader(title) {
	const border = /* @__PURE__ */ require_strings_format.repeatString("═", 55);
	logger.log(border);
	logger.log(`  ${title}`);
	logger.log(border);
}

//#endregion
exports.createHeader = createHeader;
exports.createSectionHeader = createSectionHeader;
exports.printHeader = printHeader;