"use strict";
exports.id = "node_modules_yocto-spinner_index_js";
exports.ids = ["node_modules_yocto-spinner_index_js"];
exports.modules = {

/***/ "../../node_modules/yocto-spinner/index.js":
/*!*************************************************!*\
  !*** ../../node_modules/yocto-spinner/index.js ***!
  \*************************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ yoctoSpinner)
/* harmony export */ });
/* harmony import */ var node_process__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:process */ "node:process");
/* harmony import */ var yoctocolors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! yoctocolors */ "../../node_modules/yoctocolors/base.js");



const isUnicodeSupported = node_process__WEBPACK_IMPORTED_MODULE_0__.platform !== 'win32' || Boolean(node_process__WEBPACK_IMPORTED_MODULE_0__.env.WT_SESSION);

const isInteractive = stream => Boolean(
	stream.isTTY
	&& node_process__WEBPACK_IMPORTED_MODULE_0__.env.TERM !== 'dumb'
	&& !("CI" in node_process__WEBPACK_IMPORTED_MODULE_0__.env),
);

const infoSymbol = yoctocolors__WEBPACK_IMPORTED_MODULE_1__.blue(isUnicodeSupported ? 'ℹ' : 'i');
const successSymbol = yoctocolors__WEBPACK_IMPORTED_MODULE_1__.green(isUnicodeSupported ? '✔' : '√');
const warningSymbol = yoctocolors__WEBPACK_IMPORTED_MODULE_1__.yellow(isUnicodeSupported ? '⚠' : '‼');
const errorSymbol = yoctocolors__WEBPACK_IMPORTED_MODULE_1__.red(isUnicodeSupported ? '✖️' : '×');

const defaultSpinner = {
	frames: isUnicodeSupported
		? [
			'⠋',
			'⠙',
			'⠹',
			'⠸',
			'⠼',
			'⠴',
			'⠦',
			'⠧',
			'⠇',
			'⠏',
		]
		: [
			'-',
			'\\',
			'|',
			'/',
		],
	interval: 80,
};

class YoctoSpinner {
	#frames;
	#interval;
	#currentFrame = -1;
	#timer;
	#text;
	#stream;
	#color;
	#lines = 0;
	#exitHandlerBound;
	#isInteractive;
	#lastSpinnerFrameTime = 0;

	constructor(options = {}) {
		const spinner = options.spinner ?? defaultSpinner;
		this.#frames = spinner.frames;
		this.#interval = spinner.interval;
		this.#text = options.text ?? '';
		this.#stream = options.stream ?? node_process__WEBPACK_IMPORTED_MODULE_0__.stderr;
		this.#color = options.color ?? 'cyan';
		this.#isInteractive = isInteractive(this.#stream);
		this.#exitHandlerBound = this.#exitHandler.bind(this);
	}

	start(text) {
		if (text) {
			this.#text = text;
		}

		if (this.isSpinning) {
			return this;
		}

		this.#hideCursor();
		this.#render();
		this.#subscribeToProcessEvents();

		this.#timer = setInterval(() => {
			this.#render();
		}, this.#interval);

		return this;
	}

	stop(finalText) {
		if (!this.isSpinning) {
			return this;
		}

		clearInterval(this.#timer);
		this.#timer = undefined;
		this.#showCursor();
		this.clear();
		this.#unsubscribeFromProcessEvents();

		if (finalText) {
			this.#stream.write(`${finalText}\n`);
		}

		return this;
	}

	#symbolStop(symbol, text) {
		return this.stop(`${symbol} ${text ?? this.#text}`);
	}

	success(text) {
		return this.#symbolStop(successSymbol, text);
	}

	error(text) {
		return this.#symbolStop(errorSymbol, text);
	}

	warning(text) {
		return this.#symbolStop(warningSymbol, text);
	}

	info(text) {
		return this.#symbolStop(infoSymbol, text);
	}

	get isSpinning() {
		return this.#timer !== undefined;
	}

	get text() {
		return this.#text;
	}

	set text(value = '') {
		this.#text = value;
		this.#render();
	}

	get color() {
		return this.#color;
	}

	set color(value) {
		this.#color = value;
		this.#render();
	}

	clear() {
		if (!this.#isInteractive) {
			return this;
		}

		this.#stream.cursorTo(0);

		for (let index = 0; index < this.#lines; index++) {
			if (index > 0) {
				this.#stream.moveCursor(0, -1);
			}

			this.#stream.clearLine(1);
		}

		this.#lines = 0;

		return this;
	}

	#render() {
		// Ensure we only update the spinner frame at the wanted interval,
		// even if the frame method is called more often.
		const now = Date.now();
		if (this.#currentFrame === -1 || now - this.#lastSpinnerFrameTime >= this.#interval) {
			this.#currentFrame = ++this.#currentFrame % this.#frames.length;
			this.#lastSpinnerFrameTime = now;
		}

		const applyColor = yoctocolors__WEBPACK_IMPORTED_MODULE_1__[this.#color] ?? yoctocolors__WEBPACK_IMPORTED_MODULE_1__.cyan;
		const frame = this.#frames[this.#currentFrame];
		let string = `${applyColor(frame)} ${this.#text}`;

		if (!this.#isInteractive) {
			string += '\n';
		}

		this.clear();
		this.#write(string);

		if (this.#isInteractive) {
			this.#lines = this.#lineCount(string);
		}
	}

	#write(text) {
		this.#stream.write(text);
	}

	#lineCount(text) {
		const width = this.#stream.columns ?? 80;
		const lines = text.split('\n');

		let lineCount = 0;
		for (const line of lines) {
			lineCount += Math.max(1, Math.ceil(line.length / width));
		}

		return lineCount;
	}

	#hideCursor() {
		if (this.#isInteractive) {
			this.#write('\u001B[?25l');
		}
	}

	#showCursor() {
		if (this.#isInteractive) {
			this.#write('\u001B[?25h');
		}
	}

	#subscribeToProcessEvents() {
		node_process__WEBPACK_IMPORTED_MODULE_0__.once('SIGINT', this.#exitHandlerBound);
		node_process__WEBPACK_IMPORTED_MODULE_0__.once('SIGTERM', this.#exitHandlerBound);
	}

	#unsubscribeFromProcessEvents() {
		node_process__WEBPACK_IMPORTED_MODULE_0__.off('SIGINT', this.#exitHandlerBound);
		node_process__WEBPACK_IMPORTED_MODULE_0__.off('SIGTERM', this.#exitHandlerBound);
	}

	#exitHandler(signal) {
		if (this.isSpinning) {
			this.stop();
		}

		// SIGINT: 128 + 2
		// SIGTERM: 128 + 15
		const exitCode = signal === 'SIGINT' ? 130 : (signal === 'SIGTERM' ? 143 : 1);
		node_process__WEBPACK_IMPORTED_MODULE_0__.exit(exitCode);
	}
}

function yoctoSpinner(options) {
	return new YoctoSpinner(options);
}


/***/ }),

/***/ "../../node_modules/yoctocolors/base.js":
/*!**********************************************!*\
  !*** ../../node_modules/yoctocolors/base.js ***!
  \**********************************************/
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   bgBlack: () => (/* binding */ bgBlack),
/* harmony export */   bgBlue: () => (/* binding */ bgBlue),
/* harmony export */   bgBlueBright: () => (/* binding */ bgBlueBright),
/* harmony export */   bgCyan: () => (/* binding */ bgCyan),
/* harmony export */   bgCyanBright: () => (/* binding */ bgCyanBright),
/* harmony export */   bgGray: () => (/* binding */ bgGray),
/* harmony export */   bgGreen: () => (/* binding */ bgGreen),
/* harmony export */   bgGreenBright: () => (/* binding */ bgGreenBright),
/* harmony export */   bgMagenta: () => (/* binding */ bgMagenta),
/* harmony export */   bgMagentaBright: () => (/* binding */ bgMagentaBright),
/* harmony export */   bgRed: () => (/* binding */ bgRed),
/* harmony export */   bgRedBright: () => (/* binding */ bgRedBright),
/* harmony export */   bgWhite: () => (/* binding */ bgWhite),
/* harmony export */   bgWhiteBright: () => (/* binding */ bgWhiteBright),
/* harmony export */   bgYellow: () => (/* binding */ bgYellow),
/* harmony export */   bgYellowBright: () => (/* binding */ bgYellowBright),
/* harmony export */   black: () => (/* binding */ black),
/* harmony export */   blue: () => (/* binding */ blue),
/* harmony export */   blueBright: () => (/* binding */ blueBright),
/* harmony export */   bold: () => (/* binding */ bold),
/* harmony export */   cyan: () => (/* binding */ cyan),
/* harmony export */   cyanBright: () => (/* binding */ cyanBright),
/* harmony export */   dim: () => (/* binding */ dim),
/* harmony export */   gray: () => (/* binding */ gray),
/* harmony export */   green: () => (/* binding */ green),
/* harmony export */   greenBright: () => (/* binding */ greenBright),
/* harmony export */   hidden: () => (/* binding */ hidden),
/* harmony export */   inverse: () => (/* binding */ inverse),
/* harmony export */   italic: () => (/* binding */ italic),
/* harmony export */   magenta: () => (/* binding */ magenta),
/* harmony export */   magentaBright: () => (/* binding */ magentaBright),
/* harmony export */   overline: () => (/* binding */ overline),
/* harmony export */   red: () => (/* binding */ red),
/* harmony export */   redBright: () => (/* binding */ redBright),
/* harmony export */   reset: () => (/* binding */ reset),
/* harmony export */   strikethrough: () => (/* binding */ strikethrough),
/* harmony export */   underline: () => (/* binding */ underline),
/* harmony export */   white: () => (/* binding */ white),
/* harmony export */   whiteBright: () => (/* binding */ whiteBright),
/* harmony export */   yellow: () => (/* binding */ yellow),
/* harmony export */   yellowBright: () => (/* binding */ yellowBright)
/* harmony export */ });
/* harmony import */ var node_tty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! node:tty */ "node:tty");


// eslint-disable-next-line no-warning-comments
// TODO: Use a better method when it's added to Node.js (https://github.com/nodejs/node/pull/40240)
// Lots of optionals here to support Deno.
const hasColors = node_tty__WEBPACK_IMPORTED_MODULE_0__?.WriteStream?.prototype?.hasColors?.() ?? false;

const format = (open, close) => {
	if (!hasColors) {
		return input => input;
	}

	const openCode = `\u001B[${open}m`;
	const closeCode = `\u001B[${close}m`;

	return input => {
		const string = input + ''; // eslint-disable-line no-implicit-coercion -- This is faster.
		let index = string.indexOf(closeCode);

		if (index === -1) {
			// Note: Intentionally not using string interpolation for performance reasons.
			return openCode + string + closeCode;
		}

		// Handle nested colors.

		// We could have done this, but it's too slow (as of Node.js 22).
		// return openCode + string.replaceAll(closeCode, openCode) + closeCode;

		let result = openCode;
		let lastIndex = 0;

		while (index !== -1) {
			result += string.slice(lastIndex, index) + openCode;
			lastIndex = index + closeCode.length;
			index = string.indexOf(closeCode, lastIndex);
		}

		result += string.slice(lastIndex) + closeCode;

		return result;
	};
};

const reset = format(0, 0);
const bold = format(1, 22);
const dim = format(2, 22);
const italic = format(3, 23);
const underline = format(4, 24);
const overline = format(53, 55);
const inverse = format(7, 27);
const hidden = format(8, 28);
const strikethrough = format(9, 29);

const black = format(30, 39);
const red = format(31, 39);
const green = format(32, 39);
const yellow = format(33, 39);
const blue = format(34, 39);
const magenta = format(35, 39);
const cyan = format(36, 39);
const white = format(37, 39);
const gray = format(90, 39);

const bgBlack = format(40, 49);
const bgRed = format(41, 49);
const bgGreen = format(42, 49);
const bgYellow = format(43, 49);
const bgBlue = format(44, 49);
const bgMagenta = format(45, 49);
const bgCyan = format(46, 49);
const bgWhite = format(47, 49);
const bgGray = format(100, 49);

const redBright = format(91, 39);
const greenBright = format(92, 39);
const yellowBright = format(93, 39);
const blueBright = format(94, 39);
const magentaBright = format(95, 39);
const cyanBright = format(96, 39);
const whiteBright = format(97, 39);

const bgRedBright = format(101, 49);
const bgGreenBright = format(102, 49);
const bgYellowBright = format(103, 49);
const bgBlueBright = format(104, 49);
const bgMagentaBright = format(105, 49);
const bgCyanBright = format(106, 49);
const bgWhiteBright = format(107, 49);


/***/ })

};
;
//# sourceMappingURL=node_modules_yocto-spinner_index_js.index.js.map