/*! © 2026 Yahoo, Inc. UDS Tailwind and Purger v0.0.0-development */
const require_runtime = require('../../_virtual/_rolldown/runtime.cjs');
const require_assertUnreachable = require('../../utils/assertUnreachable.cjs');
const require_entries = require('../../utils/entries.cjs');
const require_mapValues = require('../../utils/mapValues.cjs');
const require_composeTailwindPlugins = require('../utils/composeTailwindPlugins.cjs');
let tailwindcss_plugin_js = require("tailwindcss/plugin.js");
tailwindcss_plugin_js = require_runtime.__toESM(tailwindcss_plugin_js);

//#region src/tailwind/plugins/breakpoints.ts
const UDS_BREAKPOINTS_THEME_KEY = "udsBreakpoints";
const getScreensTheme = (config, mergeTokensIntoTailwindTheme) => {
	const breakpoints = require_mapValues.mapValues(config, (breakpoint) => {
		switch (breakpoint.type) {
			case "px": return `${breakpoint.value}px`;
		}
		return require_assertUnreachable.assertUnreachable(breakpoint.type);
	});
	if (!mergeTokensIntoTailwindTheme) return { [UDS_BREAKPOINTS_THEME_KEY]: breakpoints };
	return {
		[UDS_BREAKPOINTS_THEME_KEY]: breakpoints,
		screens: breakpoints
	};
};
const breakpointsPlugin = tailwindcss_plugin_js.default.withOptions(({ config }) => ({ addVariant }) => {
	const breakpoints = require_entries.entries(config.breakpoints).sort(([, { value: minWidthA }], [, { value: minWidthB }]) => minWidthA - minWidthB);
	for (const [name, { value: minWidth }] of breakpoints) addVariant(`uds-${name}`, `@media (min-width: ${minWidth}px)`);
}, ({ config, disableOverrideTailwindTheme }) => {
	const shouldNotMergeScreensTokensIntoTailwindTheme = require_composeTailwindPlugins.shouldNotMergeTokensIntoTailwindTheme(disableOverrideTailwindTheme, "screens");
	return { theme: { extend: { ...getScreensTheme(config.breakpoints, !shouldNotMergeScreensTokensIntoTailwindTheme) } } };
});

//#endregion
exports.breakpointsPlugin = breakpointsPlugin;