"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_error = require('../primordials/error.js');
const require_primordials_math = require('../primordials/math.js');
const require_primordials_array = require('../primordials/array.js');
const require_primordials_reflect = require('../primordials/reflect.js');
const require_strings_format = require('../strings/format.js');
const require_strings_predicates = require('../strings/predicates.js');
const require_themes_themes = require('../themes/themes.js');
const require_themes_context = require('../themes/context.js');
const require_logger__internal = require('./_internal.js');
const require_logger_symbols_builder = require('./symbols-builder.js');
const require_logger_symbols = require('./symbols.js');
const require_logger_console = require('./console.js');
let node_process = require("node:process");
node_process = require_runtime.__toESM(node_process);

//#region src/logger/node.ts
/**
* @file Node-side `Logger` class — owns the per-instance state (parent, bound
*   stream, indent buffers, theme), the symbol-prefixed semantic methods
*   (`success`, `fail`, `info`, ...), and the chainable wrappers around the
*   underlying `node:console` methods. The shared-default singleton lives in
*   `./default`; this file exports only the class. Consumers should import
*   `Logger` from `./logger` (auto-routed by the package.json `browser`
*   condition); `./node` is the explicit Node entry, useful for tests pinning
*   to one implementation. Console construction is deliberately lazy: the
*   constructor only stashes its args in `_internal.privateConstructorArgs`;
*   the actual `node:console` instance is built on first call to
*   `#getConsole()`. This lets the logger be imported during early Node.js
*   bootstrap before stdout is ready, avoiding `ERR_CONSOLE_WRITABLE_STREAM`.
*   Free helpers live in sibling leaves (per `socket-lib`'s
*   export-top-level-functions rule):
*
*   - color helpers — `./colors` (`applyColor`, `getYoctocolors`)
*   - log symbols + symbol getters — `./symbols`
*   - lazy console init + prototype mirror — `./console-init`
*   - shared private state — `./_internal`
*/
/**
* Enhanced console logger with indentation, colored symbols, and stream
* management.
*/
var Logger = class Logger {
	/**
	* Static reference to log symbols for convenience.
	*/
	static LOG_SYMBOLS = require_logger_symbols.LOG_SYMBOLS;
	#parent;
	#boundStream;
	#stderrLogger;
	#stdoutLogger;
	#stderrIndention = "";
	#stdoutIndention = "";
	#stderrLastWasBlank = false;
	#stdoutLastWasBlank = false;
	#logCallCount = 0;
	#options;
	#originalStdout;
	#theme;
	/**
	* Creates a new Logger instance.
	*
	* When called without arguments, creates a logger using the default
	* `process.stdout` and `process.stderr` streams. Can accept custom console
	* constructor arguments for advanced use cases.
	*
	* @param args - Optional console constructor arguments.
	*/
	constructor(...args) {
		require_logger__internal.privateConstructorArgs.set(this, args);
		const options = args["0"];
		if (typeof options === "object" && options !== null) {
			this.#options = {
				__proto__: null,
				...options
			};
			this.#originalStdout = options.stdout;
			const themeOption = options.theme;
			if (themeOption) if (typeof themeOption === "string") {
				const resolved = require_themes_themes.THEMES[themeOption];
				if (resolved) this.#theme = resolved;
			} else this.#theme = themeOption;
		} else this.#options = { __proto__: null };
	}
	/**
	* Apply a console method with indentation.
	*
	* @private
	*/
	#apply(methodName, args, stream) {
		const con = this.#getConsole();
		const text = require_primordials_array.ArrayPrototypeAt(args, 0);
		const hasText = typeof text === "string";
		const targetStream = stream || (methodName === "log" ? "stdout" : "stderr");
		const indent = this.#getIndent(targetStream);
		const logArgs = hasText ? [/* @__PURE__ */ require_strings_format.applyLinePrefix(text, { prefix: indent }), ...require_primordials_array.ArrayPrototypeSlice(args, 1)] : args;
		require_primordials_reflect.ReflectApply(con[methodName], con, logArgs);
		this[require_logger_symbols.lastWasBlankSymbol](hasText && /* @__PURE__ */ require_strings_predicates.isBlankString(logArgs[0]), targetStream);
		this[require_logger_symbols.incLogCallCountSymbol]();
		return this;
	}
	/**
	* Get the Console instance for this logger, creating it lazily on first
	* access.
	*
	* This lazy initialization allows the logger to be imported during early
	* Node.js bootstrap before stdout is ready, avoiding Console initialization
	* errors (ERR_CONSOLE_WRITABLE_STREAM).
	*
	* @private
	*/
	#getConsole() {
		require_logger_console.ensurePrototypeInitialized();
		let con = require_logger__internal.privateConsole.get(this);
		/* c8 ignore start */
		if (!con) {
			const ctorArgs = require_logger__internal.privateConstructorArgs.get(this) ?? [];
			if (ctorArgs.length) con = /* @__PURE__ */ require_logger_console.constructConsole(...ctorArgs);
			else {
				con = /* @__PURE__ */ require_logger_console.constructConsole({
					stdout: node_process.default.stdout,
					stderr: node_process.default.stderr
				});
				for (const { 0: key, 1: method } of require_logger__internal.boundConsoleEntries) con[key] = method;
			}
			require_logger__internal.privateConsole.set(this, con);
			require_logger__internal.privateConstructorArgs.delete(this);
		}
		/* c8 ignore stop */
		return con;
	}
	/**
	* Get indentation for a specific stream.
	*
	* @private
	*/
	#getIndent(stream) {
		const root = this.#getRoot();
		return stream === "stderr" ? root.#stderrIndention : root.#stdoutIndention;
	}
	/**
	* Get lastWasBlank state for a specific stream.
	*
	* @private
	*/
	#getLastWasBlank(stream) {
		const root = this.#getRoot();
		return stream === "stderr" ? root.#stderrLastWasBlank : root.#stdoutLastWasBlank;
	}
	/**
	* Get the root logger (for accessing shared indentation state).
	*
	* @private
	*/
	#getRoot() {
		return this.#parent || this;
	}
	/**
	* Get logger-specific symbols using the resolved theme.
	*
	* @private
	*/
	#getSymbols() {
		return require_logger_symbols_builder.buildLoggerSymbols(this.#getTheme());
	}
	/**
	* Get the target stream for this logger instance.
	*
	* @private
	*/
	#getTargetStream() {
		return this.#boundStream || "stderr";
	}
	/**
	* Get the resolved theme for this logger instance. Returns instance theme if
	* set, otherwise falls back to context theme.
	*
	* @private
	*/
	#getTheme() {
		return this.#theme ?? require_themes_context.getTheme();
	}
	/**
	* Set indentation for a specific stream.
	*
	* @private
	*/
	#setIndent(stream, value) {
		const root = this.#getRoot();
		if (stream === "stderr") root.#stderrIndention = value;
		else root.#stdoutIndention = value;
	}
	/**
	* Set lastWasBlank state for a specific stream.
	*
	* @private
	*/
	#setLastWasBlank(stream, value) {
		const root = this.#getRoot();
		if (stream === "stderr") root.#stderrLastWasBlank = value;
		else root.#stdoutLastWasBlank = value;
	}
	/**
	* Strip log symbols from the start of text.
	*
	* @private
	*/
	#stripSymbols(text) {
		return require_logger_symbols_builder.stripLoggerSymbols(text);
	}
	/**
	* Apply a method with a symbol prefix.
	*
	* @private
	*/
	#symbolApply(symbolType, args) {
		const con = this.#getConsole();
		let text = require_primordials_array.ArrayPrototypeAt(args, 0);
		let extras;
		/* c8 ignore start */
		if (typeof text === "string") {
			text = this.#stripSymbols(text);
			extras = require_primordials_array.ArrayPrototypeSlice(args, 1);
		} else {
			extras = args;
			text = "";
		}
		/* c8 ignore stop */
		const indent = this.#getIndent("stderr");
		const symbols = this.#getSymbols();
		con.error(/* @__PURE__ */ require_strings_format.applyLinePrefix(`${symbols[symbolType]} ${text}`, { prefix: indent }), ...extras);
		this[require_logger_symbols.lastWasBlankSymbol](false, "stderr");
		this[require_logger_symbols.incLogCallCountSymbol]();
		return this;
	}
	/**
	* Gets a logger instance bound exclusively to stderr.
	*
	* All logging operations on this instance will write to stderr only.
	* Indentation is tracked separately from stdout. The instance is cached and
	* reused on subsequent accesses.
	*
	* @returns A logger instance bound to stderr
	*/
	get stderr() {
		if (!this.#stderrLogger) {
			const instance = new Logger(...require_logger__internal.privateConstructorArgs.get(this) ?? []);
			instance.#parent = this;
			instance.#boundStream = "stderr";
			instance.#options = {
				__proto__: null,
				...this.#options
			};
			if (this.#theme) instance.#theme = this.#theme;
			this.#stderrLogger = instance;
		}
		return this.#stderrLogger;
	}
	/**
	* Gets a logger instance bound exclusively to stdout.
	*
	* All logging operations on this instance will write to stdout only.
	* Indentation is tracked separately from stderr. The instance is cached and
	* reused on subsequent accesses.
	*
	* @returns A logger instance bound to stdout
	*/
	get stdout() {
		if (!this.#stdoutLogger) {
			const instance = new Logger(...require_logger__internal.privateConstructorArgs.get(this) ?? []);
			instance.#parent = this;
			instance.#boundStream = "stdout";
			instance.#options = {
				__proto__: null,
				...this.#options
			};
			if (this.#theme) instance.#theme = this.#theme;
			this.#stdoutLogger = instance;
		}
		return this.#stdoutLogger;
	}
	/**
	* Gets the total number of log calls made on this logger instance.
	*
	* Tracks all logging method calls including `log()`, `error()`, `warn()`,
	* `success()`, `fail()`, etc. Useful for testing and monitoring logging
	* activity.
	*
	* @returns The number of times logging methods have been called
	*/
	get logCallCount() {
		return this.#getRoot().#logCallCount;
	}
	/**
	* Increments the internal log call counter.
	*
	* This is called automatically by logging methods and should not be called
	* directly in normal usage.
	*/
	[require_logger_symbols.incLogCallCountSymbol]() {
		const root = this.#getRoot();
		root.#logCallCount += 1;
		return this;
	}
	/**
	* Sets whether the last logged line was blank.
	*
	* Used internally to track blank lines and prevent duplicate spacing. This is
	* called automatically by logging methods.
	*
	* @param value - Whether the last line was blank.
	* @param stream - Optional stream to update (defaults to both streams if not
	*   bound, or target stream if bound)
	*/
	[require_logger_symbols.lastWasBlankSymbol](value, stream) {
		if (stream) this.#setLastWasBlank(stream, !!value);
		else if (this.#boundStream) this.#setLastWasBlank(this.#boundStream, !!value);
		else {
			this.#setLastWasBlank("stderr", !!value);
			this.#setLastWasBlank("stdout", !!value);
		}
		return this;
	}
	/**
	* Logs an assertion failure message if the value is falsy.
	*
	* Works like `console.assert()` but returns the logger for chaining. If the
	* value is truthy, nothing is logged. If falsy, logs an error message with an
	* assertion failure.
	*
	* @param value - The value to test.
	* @param message - Optional message and additional arguments to log.
	*/
	assert(value, ...message) {
		this.#getConsole().assert(value, message[0], ...message.slice(1));
		this[require_logger_symbols.lastWasBlankSymbol](false);
		return value ? this : this[require_logger_symbols.incLogCallCountSymbol]();
	}
	/**
	* Clears the current line in the terminal.
	*
	* Moves the cursor to the beginning of the line and clears all content. Works
	* in both TTY and non-TTY environments. Useful for clearing progress
	* indicators created with `progress()`.
	*
	* The stream to clear (stderr or stdout) depends on whether the logger is
	* stream-bound.
	*/
	clearLine() {
		const con = this.#getConsole();
		const streamObj = this.#getTargetStream() === "stderr" ? con["_stderr"] : con["_stdout"];
		if (streamObj.isTTY) {
			streamObj.cursorTo(0);
			streamObj.clearLine(0);
		} else streamObj.write("\r\x1B[K");
		return this;
	}
	/**
	* Clears the visible terminal screen.
	*
	* Only available on the main logger instance, not on stream-bound instances
	* (`.stderr` or `.stdout`). Resets the log call count and blank line tracking
	* if the output is a TTY.
	*
	* @throws {Error} If called on a stream-bound logger instance
	*/
	clearVisible() {
		/* c8 ignore start - clearVisible TTY-mode behavior; tests use
		non-TTY capture streams so the bound-stream throw and TTY
		clear branches aren't reached. */
		if (this.#boundStream) throw new require_primordials_error.ErrorCtor("clearVisible() is only available on the main logger instance, not on stream-bound instances");
		const con = this.#getConsole();
		con.clear();
		if (con._stdout.isTTY) {
			this[require_logger_symbols.lastWasBlankSymbol](true);
			this.#logCallCount = 0;
		}
		return this;
		/* c8 ignore stop */
	}
	/**
	* Increments and logs a counter for the given label.
	*
	* Each unique label maintains its own counter. Works like `console.count()`.
	*
	* @default 'default'
	*
	* @param label - Optional label for the counter.
	*/
	count(label) {
		this.#getConsole().count(label);
		this[require_logger_symbols.lastWasBlankSymbol](false);
		return this[require_logger_symbols.incLogCallCountSymbol]();
	}
	/**
	* Creates a task that logs start and completion messages automatically.
	*
	* Returns a task object with a `run()` method that executes the provided
	* function and logs "Starting task: {name}" before execution and "Completed
	* task: {name}" after completion.
	*
	* @param name - The name of the task.
	*
	* @returns A task object with a `run()` method
	*/
	createTask(name) {
		return { run: (f) => {
			this.log(`Starting task: ${name}`);
			const result = f();
			this.log(`Completed task: ${name}`);
			return result;
		} };
	}
	/**
	* Decreases the indentation level by removing spaces from the prefix.
	*
	* When called on the main logger, affects both stderr and stdout indentation.
	* When called on a stream-bound logger (`.stderr` or `.stdout`), affects only
	* that stream's indentation.
	*
	* @default 2
	*/
	dedent(spaces = 2) {
		if (this.#boundStream) {
			const current = this.#getIndent(this.#boundStream);
			this.#setIndent(this.#boundStream, current.slice(0, -spaces));
		} else {
			const stderrCurrent = this.#getIndent("stderr");
			const stdoutCurrent = this.#getIndent("stdout");
			this.#setIndent("stderr", stderrCurrent.slice(0, -spaces));
			this.#setIndent("stdout", stdoutCurrent.slice(0, -spaces));
		}
		return this;
	}
	/**
	* Displays an object's properties in a formatted way.
	*
	* Works like `console.dir()` with customizable options for depth, colors,
	* etc. Useful for inspecting complex objects.
	*
	* @param obj - The object to display.
	* @param options - Optional formatting options (Node.js inspect options)
	*/
	dir(obj, options) {
		this.#getConsole().dir(obj, options);
		this[require_logger_symbols.lastWasBlankSymbol](false);
		return this[require_logger_symbols.incLogCallCountSymbol]();
	}
	/**
	* Displays data as XML/HTML in a formatted way.
	*
	* Works like `console.dirxml()`. In Node.js, behaves the same as `dir()`.
	*
	* @param data - The data to display.
	*/
	dirxml(...data) {
		this.#getConsole().dirxml(data);
		this[require_logger_symbols.lastWasBlankSymbol](false);
		return this[require_logger_symbols.incLogCallCountSymbol]();
	}
	/**
	* Logs a completion message with a success symbol (alias for `success()`).
	*
	* Provides semantic clarity when marking something as "done". Does NOT
	* automatically clear the current line - call `clearLine()` first if needed
	* after using `progress()`.
	*/
	done(...args) {
		return this.#symbolApply("success", args);
	}
	/**
	* Logs an error message to stderr.
	*
	* Automatically applies current indentation. All arguments are formatted and
	* logged like `console.error()`.
	*/
	error(...args) {
		return this.#apply("error", args);
	}
	/**
	* Logs a newline to stderr only if the last line wasn't already blank.
	*
	* Prevents multiple consecutive blank lines. Useful for adding spacing
	* between sections without creating excessive whitespace.
	*/
	errorNewline() {
		return this.#getLastWasBlank("stderr") ? this : this.error("");
	}
	/**
	* Logs a failure message with a red colored fail symbol.
	*
	* Automatically prefixes the message with `LOG_SYMBOLS.fail` (red ✖). Always
	* outputs to stderr. If the message starts with an existing symbol, it will
	* be stripped and replaced.
	*/
	fail(...args) {
		return this.#symbolApply("fail", args);
	}
	/**
	* Starts a new indented log group.
	*
	* If a label is provided, it's logged before increasing indentation. Groups
	* can be nested. Each group increases indentation by the `kGroupIndentWidth`
	* (default 2 spaces). Call `groupEnd()` to close.
	*
	* @param label - Optional label to display before the group.
	*/
	group(...label) {
		const { length } = label;
		if (length) require_primordials_reflect.ReflectApply(this.log, this, label);
		this.indent(this[require_logger_symbols.getKGroupIndentationWidthSymbol()]);
		if (length) {
			this[require_logger_symbols.lastWasBlankSymbol](false);
			this[require_logger_symbols.incLogCallCountSymbol]();
		}
		return this;
	}
	/**
	* Starts a new collapsed log group (alias for `group()`).
	*
	* In browser consoles, this creates a collapsed group. In Node.js, it behaves
	* identically to `group()`.
	*
	* @param label - Optional label to display before the group.
	*/
	groupCollapsed(...label) {
		return require_primordials_reflect.ReflectApply(this.group, this, label);
	}
	/**
	* Ends the current log group and decreases indentation.
	*
	* Must be called once for each `group()` or `groupCollapsed()` call to
	* properly close the group and restore indentation.
	*/
	groupEnd() {
		this.dedent(this[require_logger_symbols.getKGroupIndentationWidthSymbol()]);
		return this;
	}
	/**
	* Increases the indentation level by adding spaces to the prefix.
	*
	* When called on the main logger, affects both stderr and stdout indentation.
	* When called on a stream-bound logger (`.stderr` or `.stdout`), affects only
	* that stream's indentation. Maximum indentation is 1000 spaces.
	*
	* @default 2
	*/
	indent(spaces = 2) {
		const spacesToAdd = " ".repeat(require_primordials_math.MathMin(spaces, require_logger__internal.maxIndentation));
		if (this.#boundStream) {
			const current = this.#getIndent(this.#boundStream);
			this.#setIndent(this.#boundStream, current + spacesToAdd);
		} else {
			const stderrCurrent = this.#getIndent("stderr");
			const stdoutCurrent = this.#getIndent("stdout");
			this.#setIndent("stderr", stderrCurrent + spacesToAdd);
			this.#setIndent("stdout", stdoutCurrent + spacesToAdd);
		}
		return this;
	}
	/**
	* Logs an informational message with a blue colored info symbol.
	*
	* Automatically prefixes the message with `LOG_SYMBOLS.info` (blue ℹ). Always
	* outputs to stderr. If the message starts with an existing symbol, it will
	* be stripped and replaced.
	*/
	info(...args) {
		return this.#symbolApply("info", args);
	}
	/**
	* Logs a message to stdout.
	*
	* Automatically applies current indentation. All arguments are formatted and
	* logged like `console.log()`. This is the primary method for standard
	* output.
	*/
	log(...args) {
		return this.#apply("log", args);
	}
	/**
	* Logs a newline to stdout only if the last line wasn't already blank.
	*
	* Prevents multiple consecutive blank lines. Useful for adding spacing
	* between sections without creating excessive whitespace.
	*/
	logNewline() {
		return this.#getLastWasBlank("stdout") ? this : this.log("");
	}
	/**
	* Shows a progress indicator that can be cleared with `clearLine()`.
	*
	* Displays a simple status message with a '∴' prefix. Does not include
	* animation or spinner. Intended to be cleared once the operation completes.
	* The output stream (stderr or stdout) depends on whether the logger is
	* stream-bound.
	*
	* Always clears the current line before writing so calling `progress(...)`
	* twice in a row redraws cleanly, and any partially-flushed prior output on
	* the same row gets overwritten. TTY path uses `cursorTo(0) + clearLine(0)`;
	* non-TTY path falls back to `\r\x1b[K` (which still works in CI logs).
	*
	* @param text - The progress message to display.
	*/
	progress(text) {
		const con = this.#getConsole();
		const streamObj = this.#getTargetStream() === "stderr" ? con["_stderr"] : con["_stdout"];
		if (streamObj.isTTY) {
			streamObj.cursorTo(0);
			streamObj.clearLine(0);
		} else streamObj.write("\r\x1B[K");
		const symbols = this.#getSymbols();
		streamObj.write(`${symbols.progress} ${text}`);
		this[require_logger_symbols.lastWasBlankSymbol](false);
		return this;
	}
	/**
	* Resets all indentation to zero.
	*
	* When called on the main logger, resets both stderr and stdout indentation.
	* When called on a stream-bound logger (`.stderr` or `.stdout`), resets only
	* that stream's indentation.
	*/
	resetIndent() {
		if (this.#boundStream) this.#setIndent(this.#boundStream, "");
		else {
			this.#setIndent("stderr", "");
			this.#setIndent("stdout", "");
		}
		return this;
	}
	/**
	* Logs a skip message with a cyan colored skip symbol.
	*
	* Automatically prefixes the message with `LOG_SYMBOLS.skip` (cyan ↻). Always
	* outputs to stderr. If the message starts with an existing symbol, it will
	* be stripped and replaced.
	*/
	skip(...args) {
		return this.#symbolApply("skip", args);
	}
	/**
	* Logs a main step message with a cyan arrow symbol and blank line before it.
	*
	* Automatically prefixes the message with `LOG_SYMBOLS.step` (cyan →) and
	* adds a blank line before the message unless the last line was already
	* blank. Useful for marking major steps in a process with clear visual
	* separation. Always outputs to stdout. If the message starts with an
	* existing symbol, it will be stripped and replaced.
	*
	* @param msg - The step message to log.
	* @param extras - Additional arguments to log.
	*/
	step(msg, ...extras) {
		if (!this.#getLastWasBlank("stdout")) this.log("");
		const text = this.#stripSymbols(msg);
		const indent = this.#getIndent("stdout");
		const symbols = this.#getSymbols();
		this.#getConsole().log(/* @__PURE__ */ require_strings_format.applyLinePrefix(`${symbols.step} ${text}`, { prefix: indent }), ...extras);
		this[require_logger_symbols.lastWasBlankSymbol](false, "stdout");
		this[require_logger_symbols.incLogCallCountSymbol]();
		return this;
	}
	/**
	* Logs an indented substep message (stateless).
	*
	* Adds a 2-space indent to the message without affecting the logger's
	* indentation state. Useful for showing sub-items under a main step.
	*
	* @param msg - The substep message to log.
	* @param extras - Additional arguments to log.
	*/
	substep(msg, ...extras) {
		const indentedMsg = `  ${msg}`;
		return this.log(indentedMsg, ...extras);
	}
	/**
	* Logs a success message with a green colored success symbol.
	*
	* Automatically prefixes the message with `LOG_SYMBOLS.success` (green ✔).
	* Always outputs to stderr. If the message starts with an existing symbol, it
	* will be stripped and replaced.
	*/
	success(...args) {
		return this.#symbolApply("success", args);
	}
	/**
	* Displays data in a table format.
	*
	* Works like `console.table()`. Accepts arrays of objects or objects with
	* nested objects. Optionally specify which properties to include in the
	* table.
	*
	* @param tabularData - The data to display as a table.
	* @param properties - Optional array of property names to include.
	*/
	table(tabularData, properties) {
		this.#getConsole().table(tabularData, properties);
		this[require_logger_symbols.lastWasBlankSymbol](false);
		return this[require_logger_symbols.incLogCallCountSymbol]();
	}
	/**
	* Starts a timer for measuring elapsed time.
	*
	* Creates a timer with the given label. Use `timeEnd()` with the same label
	* to stop the timer and log the elapsed time, or use `timeLog()` to check the
	* time without stopping the timer.
	*
	* @default 'default'
	*
	* @param label - Optional label for the timer.
	*/
	time(label) {
		this.#getConsole().time(label);
		return this;
	}
	/**
	* Ends a timer and logs the elapsed time.
	*
	* Logs the duration since `console.time()` or `logger.time()` was called with
	* the same label. The timer is stopped and removed.
	*
	* @default 'default'
	*
	* @param label - Optional label for the timer.
	*/
	timeEnd(label) {
		this.#getConsole().timeEnd(label);
		this[require_logger_symbols.lastWasBlankSymbol](false);
		return this[require_logger_symbols.incLogCallCountSymbol]();
	}
	/**
	* Logs the current value of a timer without stopping it.
	*
	* Logs the duration since `console.time()` was called with the same label,
	* but keeps the timer running. Can include additional data to log alongside
	* the time.
	*
	* @default 'default'
	*
	* @param label - Optional label for the timer.
	* @param data - Additional data to log with the time.
	*/
	timeLog(label, ...data) {
		this.#getConsole().timeLog(label, ...data);
		this[require_logger_symbols.lastWasBlankSymbol](false);
		return this[require_logger_symbols.incLogCallCountSymbol]();
	}
	/**
	* Logs a stack trace to the console.
	*
	* Works like `console.trace()`. Shows the call stack leading to where this
	* method was called. Useful for debugging.
	*
	* @param message - Optional message to display with the trace.
	* @param args - Additional arguments to log.
	*/
	trace(message, ...args) {
		this.#getConsole().trace(message, ...args);
		this[require_logger_symbols.lastWasBlankSymbol](false);
		return this[require_logger_symbols.incLogCallCountSymbol]();
	}
	/**
	* Logs a warning message with a yellow colored warning symbol.
	*
	* Automatically prefixes the message with `LOG_SYMBOLS.warn` (yellow ⚠).
	* Always outputs to stderr. If the message starts with an existing symbol, it
	* will be stripped and replaced.
	*/
	warn(...args) {
		return this.#symbolApply("warn", args);
	}
	/**
	* Writes text directly to stdout without a newline or indentation.
	*
	* Useful for progress indicators or custom formatting where you need
	* low-level control. Does not apply any indentation or formatting.
	*
	* @param text - The text to write.
	*/
	write(text) {
		const con = this.#getConsole();
		const ctorArgs = require_logger__internal.privateConstructorArgs.get(this) ?? [];
		/* c8 ignore stop */
		(this.#originalStdout || ctorArgs[0]?.stdout || con._stdout).write(text);
		this[require_logger_symbols.lastWasBlankSymbol](false);
		return this;
	}
};

//#endregion
exports.Logger = Logger;