import chalk, { Chalk } from "chalk";

//#region src/terminal/palette.ts
const IRON_PALETTE = {
	accent: "#9CA3AF",
	accentBright: "#D1D5DB",
	accentDim: "#6B7280",
	info: "#93C5FD",
	success: "#34D399",
	warn: "#FBBF24",
	error: "#F87171",
	muted: "#6B7280"
};

//#endregion
//#region src/terminal/theme.ts
const hasForceColor = typeof process.env.FORCE_COLOR === "string" && process.env.FORCE_COLOR.trim().length > 0 && process.env.FORCE_COLOR.trim() !== "0";
const baseChalk = process.env.NO_COLOR && !hasForceColor ? new Chalk({ level: 0 }) : chalk;
const hex = (value) => baseChalk.hex(value);
const theme = {
	accent: hex(IRON_PALETTE.accent),
	accentBright: hex(IRON_PALETTE.accentBright),
	accentDim: hex(IRON_PALETTE.accentDim),
	info: hex(IRON_PALETTE.info),
	success: hex(IRON_PALETTE.success),
	warn: hex(IRON_PALETTE.warn),
	error: hex(IRON_PALETTE.error),
	muted: hex(IRON_PALETTE.muted),
	heading: baseChalk.bold.hex(IRON_PALETTE.accent),
	command: hex(IRON_PALETTE.accentBright),
	option: hex(IRON_PALETTE.warn)
};
const isRich = () => Boolean(baseChalk.level > 0);

//#endregion
export { theme as n, isRich as t };