/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
require("../../../_virtual/_rolldown/runtime.cjs");
const require_runtime$1 = require("../_virtual/_rolldown/runtime.cjs");
const require_plugin$1 = require("../node_modules/.bun/tailwindcss@3.4.19_7500dce058369e0a/node_modules/tailwindcss/plugin.cjs");
const require_index = require("../packages/palette/dist/index.cjs");
const require_index$1 = require("../packages/css-tokens/dist/index.cjs");
const require_mapValues = require("../packages/utils/dist/mapValues.cjs");
const require_parseTokens = require("../utils/parseTokens.cjs");
const require_index$2 = require("../packages/modes/dist/index.cjs");
const require_addColorModeVars = require("../base/addColorModeVars.cjs");
const require_addColorModeVarsV2 = require("../base/addColorModeVarsV2.cjs");
const require_getTailwindAsUdsColors = require("./getTailwindAsUdsColors.cjs");
let lodash_es = require("lodash-es");
//#region ../tailwind-internal/dist/plugins/colors.js
/*! © 2026 Yahoo, Inc. UDS Tailwind Internal v0.0.0-development */
var import_plugin = /* @__PURE__ */ require_runtime$1.__toESM(require_plugin$1.require_plugin(), 1);
const tailwindColorsAsUds = require_getTailwindAsUdsColors.getTailwindAsUdsColors();
const colorsPlugin = import_plugin.default.withOptions(({ config, enableSystemColorMode = false }) => (api) => {
	const tokens = require_parseTokens.parseTokens(config);
	if (enableSystemColorMode) require_addColorModeVarsV2.addColorModeVarsV2(tokens, api);
	else require_addColorModeVars.addColorModeVars(tokens, api);
}, ({ config }) => {
	const colorModeToken = require_parseTokens.parseTokens(config).colorMode[require_index$2.DEFAULT_COLOR_MODE].tailwindConfig;
	const spectrumWithTailwind = require_mapValues.mapValues(colorModeToken.spectrum, (hueConfig, hue) => {
		return {
			...hueConfig,
			...tailwindColorsAsUds[hue]
		};
	});
	const nestedNewAlwaysPalette = (0, lodash_es.mapKeys)(require_index.newAlwaysPalette, (_, key) => key.replace(require_index.ALWAYS_PREFIX, ""));
	const colors = {
		...tailwindColorsAsUds,
		...spectrumWithTailwind,
		...require_index.deprecatedAlwaysPalette,
		always: nestedNewAlwaysPalette
	};
	const textColors = colorModeToken.palette.foreground;
	const backgroundColors = colorModeToken.palette.background;
	const borderColors = colorModeToken.palette.line;
	const elevationBackgroundColors = config.elevation ? Object.fromEntries(Object.keys(config.elevation).map((level) => [`elevation-${level}`, `var(--${require_index$1.BACKGROUND_COLOR_PREFIX}-elevation-${level})`])) : {};
	return {
		darkMode: ["class", require_index$1.DARK_COLOR_MODE_CLASSNAME],
		safelist: [
			require_index$1.LIGHT_COLOR_MODE_CLASSNAME,
			require_index$1.DARK_COLOR_MODE_CLASSNAME,
			require_index$1.INVERT_COLOR_MODE_CLASSNAME,
			require_index$1.SYSTEM_COLOR_MODE_CLASSNAME
		],
		theme: { 
		/**
		* Preserve the default values from Tailwind, but also add new values
		* https://tailwindcss.com/docs/theme#extending-the-default-theme
		*/
extend: {
			/**
			* Colors object is included by default, but that does not include UDS semantic border colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L743
			*/
			outlineColor: {
				...borderColors,
				DEFAULT: colors.gray["15"]
			},
			/**
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L133
			*/
			colors,
			/**
			* Colors object is included by default, but that does not include UDS semantic background colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L42
			*/
			backgroundColor: backgroundColors,
			/**
			* Colors object is included by default, but that does not include UDS semantic text colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L889
			*/
			textColor: textColors,
			/**
			* Colors object is included by default, but that does not include UDS semantic border colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L82
			*/
			borderColor: borderColors,
			/**
			* Colors object is included by default, but that does not include UDS semantic background colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L253
			*/
			fill: backgroundColors,
			/**
			* Colors object is included by default, but that does not include UDS semantic text colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L132
			*/
			caretColor: textColors,
			/**
			* Colors object is included by default, but that does not include UDS semantic text colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L759
			*/
			placeholderColor: textColors,
			/**
			* Colors object is included by default, but that does not include UDS semantic text colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L890
			*/
			textDecorationColor: textColors,
			/**
			* Colors object is included by default, but that does not include UDS semantic border colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L241
			*/
			divideColor: borderColors,
			/**
			* Colors object is included by default, but that does not include UDS semantic border colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L761
			*/
			ringColor: borderColors,
			/**
			* Colors object is included by default, but that does not include UDS semantic border colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L765
			*/
			ringOffsetColor: borderColors,
			/**
			* Colors object is included by default, but that does not include UDS semantic border colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L878
			*/
			stroke: borderColors,
			/**
			* Gradient color stops object is included by default, but that does not include UDS palette background colors
			* https://github.com/tailwindlabs/tailwindcss/blob/main/stubs/config.full.js#L42
			*/
			gradientColorStops: {
				...backgroundColors,
				...elevationBackgroundColors,
				...colors
			}
		} }
	};
});
//#endregion
exports.colorsPlugin = colorsPlugin;
