"use client";
const require_get_primary_shade = require("../color-functions/get-primary-shade/get-primary-shade.cjs");
const require_darken = require("../color-functions/darken/darken.cjs");
const require_rgba = require("../color-functions/rgba/rgba.cjs");
//#region packages/@mantine/core/src/core/MantineProvider/MantineCssVariables/get-css-color-variables.ts
function getCSSColorVariables({ theme, color, colorScheme, name = color, withColorValues = true }) {
	if (!theme.colors[color]) return {};
	if (colorScheme === "light") {
		const primaryShade = require_get_primary_shade.getPrimaryShade(theme, "light");
		const dynamicVariables = {
			[`--mantine-color-${name}-text`]: `var(--mantine-color-${name}-filled)`,
			[`--mantine-color-${name}-filled`]: `var(--mantine-color-${name}-${primaryShade})`,
			[`--mantine-color-${name}-filled-hover`]: `var(--mantine-color-${name}-${primaryShade === 9 ? 8 : primaryShade + 1})`,
			[`--mantine-color-${name}-light`]: `var(--mantine-color-${name}-1)`,
			[`--mantine-color-${name}-light-hover`]: `var(--mantine-color-${name}-2)`,
			[`--mantine-color-${name}-light-color`]: `var(--mantine-color-${name}-9)`,
			[`--mantine-color-${name}-outline`]: `var(--mantine-color-${name}-${primaryShade})`,
			[`--mantine-color-${name}-outline-hover`]: require_rgba.alpha(theme.colors[color][primaryShade], .05)
		};
		if (!withColorValues) return dynamicVariables;
		return {
			[`--mantine-color-${name}-0`]: theme.colors[color][0],
			[`--mantine-color-${name}-1`]: theme.colors[color][1],
			[`--mantine-color-${name}-2`]: theme.colors[color][2],
			[`--mantine-color-${name}-3`]: theme.colors[color][3],
			[`--mantine-color-${name}-4`]: theme.colors[color][4],
			[`--mantine-color-${name}-5`]: theme.colors[color][5],
			[`--mantine-color-${name}-6`]: theme.colors[color][6],
			[`--mantine-color-${name}-7`]: theme.colors[color][7],
			[`--mantine-color-${name}-8`]: theme.colors[color][8],
			[`--mantine-color-${name}-9`]: theme.colors[color][9],
			...dynamicVariables
		};
	}
	const primaryShade = require_get_primary_shade.getPrimaryShade(theme, "dark");
	const dynamicVariables = {
		[`--mantine-color-${name}-text`]: `var(--mantine-color-${name}-4)`,
		[`--mantine-color-${name}-filled`]: `var(--mantine-color-${name}-${primaryShade})`,
		[`--mantine-color-${name}-filled-hover`]: `var(--mantine-color-${name}-${primaryShade === 9 ? 8 : primaryShade + 1})`,
		[`--mantine-color-${name}-light`]: require_darken.darken(theme.colors[color][9], .5),
		[`--mantine-color-${name}-light-hover`]: require_darken.darken(theme.colors[color][9], .3),
		[`--mantine-color-${name}-light-color`]: `var(--mantine-color-${name}-0)`,
		[`--mantine-color-${name}-outline`]: `var(--mantine-color-${name}-${Math.max(primaryShade - 4, 0)})`,
		[`--mantine-color-${name}-outline-hover`]: require_rgba.alpha(theme.colors[color][Math.max(primaryShade - 4, 0)], .05)
	};
	if (!withColorValues) return dynamicVariables;
	return {
		[`--mantine-color-${name}-0`]: theme.colors[color][0],
		[`--mantine-color-${name}-1`]: theme.colors[color][1],
		[`--mantine-color-${name}-2`]: theme.colors[color][2],
		[`--mantine-color-${name}-3`]: theme.colors[color][3],
		[`--mantine-color-${name}-4`]: theme.colors[color][4],
		[`--mantine-color-${name}-5`]: theme.colors[color][5],
		[`--mantine-color-${name}-6`]: theme.colors[color][6],
		[`--mantine-color-${name}-7`]: theme.colors[color][7],
		[`--mantine-color-${name}-8`]: theme.colors[color][8],
		[`--mantine-color-${name}-9`]: theme.colors[color][9],
		...dynamicVariables
	};
}
//#endregion
exports.getCSSColorVariables = getCSSColorVariables;

//# sourceMappingURL=get-css-color-variables.cjs.map