/**
 * Copyright IBM Corp. 2026
 *
 * This source code is licensed under the Apache-2.0 license found in the
 * LICENSE file in the root directory of this source tree.
 */

//#region ../feature-flags/es/index.js
/**
* Copyright IBM Corp. 2015, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* Code generated by @carbon/feature-flags. DO NOT EDIT.
*
* Copyright IBM Corp. 2015, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const enabled$1 = {};
try {
	if (process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES) if (process.env.CARBON_ENABLE_CSS_CUSTOM_PROPERTIES === "true") enabled$1.enableCssCustomProperties = true;
	else enabled$1.enableCssCustomProperties = false;
	else enabled$1.enableCssCustomProperties = false;
	if (process.env.CARBON_ENABLE_CSS_GRID) if (process.env.CARBON_ENABLE_CSS_GRID === "true") enabled$1.enableCssGrid = true;
	else enabled$1.enableCssGrid = false;
	else enabled$1.enableCssGrid = false;
	if (process.env.CARBON_ENABLE_V11_RELEASE) if (process.env.CARBON_ENABLE_V11_RELEASE === "true") enabled$1.enableV11Release = true;
	else enabled$1.enableV11Release = false;
	else enabled$1.enableV11Release = true;
	if (process.env.CARBON_ENABLE_EXPERIMENTAL_TILE_CONTRAST) if (process.env.CARBON_ENABLE_EXPERIMENTAL_TILE_CONTRAST === "true") enabled$1.enableExperimentalTileContrast = true;
	else enabled$1.enableExperimentalTileContrast = false;
	else enabled$1.enableExperimentalTileContrast = false;
	if (process.env.CARBON_ENABLE_TILE_CONTRAST) if (process.env.CARBON_ENABLE_TILE_CONTRAST === "true") enabled$1.enableTileContrast = true;
	else enabled$1.enableTileContrast = false;
	else enabled$1.enableTileContrast = false;
	if (process.env.CARBON_ENABLE_V12_TILE_DEFAULT_ICONS) if (process.env.CARBON_ENABLE_V12_TILE_DEFAULT_ICONS === "true") enabled$1.enableV12TileDefaultIcons = true;
	else enabled$1.enableV12TileDefaultIcons = false;
	else enabled$1.enableV12TileDefaultIcons = false;
	if (process.env.CARBON_ENABLE_V12_TILE_RADIO_ICONS) if (process.env.CARBON_ENABLE_V12_TILE_RADIO_ICONS === "true") enabled$1.enableV12TileRadioIcons = true;
	else enabled$1.enableV12TileRadioIcons = false;
	else enabled$1.enableV12TileRadioIcons = false;
	if (process.env.CARBON_ENABLE_V12_OVERFLOWMENU) if (process.env.CARBON_ENABLE_V12_OVERFLOWMENU === "true") enabled$1.enableV12Overflowmenu = true;
	else enabled$1.enableV12Overflowmenu = false;
	else enabled$1.enableV12Overflowmenu = false;
	if (process.env.CARBON_ENABLE_TREEVIEW_CONTROLLABLE) if (process.env.CARBON_ENABLE_TREEVIEW_CONTROLLABLE === "true") enabled$1.enableTreeviewControllable = true;
	else enabled$1.enableTreeviewControllable = false;
	else enabled$1.enableTreeviewControllable = false;
	if (process.env.CARBON_ENABLE_V12_STRUCTURED_LIST_VISIBLE_ICONS) if (process.env.CARBON_ENABLE_V12_STRUCTURED_LIST_VISIBLE_ICONS === "true") enabled$1.enableV12StructuredListVisibleIcons = true;
	else enabled$1.enableV12StructuredListVisibleIcons = false;
	else enabled$1.enableV12StructuredListVisibleIcons = false;
	if (process.env.CARBON_ENABLE_EXPERIMENTAL_FOCUS_WRAP_WITHOUT_SENTINELS) if (process.env.CARBON_ENABLE_EXPERIMENTAL_FOCUS_WRAP_WITHOUT_SENTINELS === "true") enabled$1.enableExperimentalFocusWrapWithoutSentinels = true;
	else enabled$1.enableExperimentalFocusWrapWithoutSentinels = false;
	else enabled$1.enableExperimentalFocusWrapWithoutSentinels = false;
	if (process.env.CARBON_ENABLE_FOCUS_WRAP_WITHOUT_SENTINELS) if (process.env.CARBON_ENABLE_FOCUS_WRAP_WITHOUT_SENTINELS === "true") enabled$1.enableFocusWrapWithoutSentinels = true;
	else enabled$1.enableFocusWrapWithoutSentinels = false;
	else enabled$1.enableFocusWrapWithoutSentinels = false;
	if (process.env.CARBON_ENABLE_DIALOG_ELEMENT) if (process.env.CARBON_ENABLE_DIALOG_ELEMENT === "true") enabled$1.enableDialogElement = true;
	else enabled$1.enableDialogElement = false;
	else enabled$1.enableDialogElement = false;
	if (process.env.CARBON_ENABLE_V12_DYNAMIC_FLOATING_STYLES) if (process.env.CARBON_ENABLE_V12_DYNAMIC_FLOATING_STYLES === "true") enabled$1.enableV12DynamicFloatingStyles = true;
	else enabled$1.enableV12DynamicFloatingStyles = false;
	else enabled$1.enableV12DynamicFloatingStyles = false;
	if (process.env.CARBON_ENABLE_V12_TOGGLE_REDUCED_LABEL_SPACING) if (process.env.CARBON_ENABLE_V12_TOGGLE_REDUCED_LABEL_SPACING === "true") enabled$1.enableV12ToggleReducedLabelSpacing = true;
	else enabled$1.enableV12ToggleReducedLabelSpacing = false;
	else enabled$1.enableV12ToggleReducedLabelSpacing = false;
	if (process.env.CARBON_ENABLE_ENHANCED_FILE_UPLOADER) if (process.env.CARBON_ENABLE_ENHANCED_FILE_UPLOADER === "true") enabled$1.enableEnhancedFileUploader = true;
	else enabled$1.enableEnhancedFileUploader = false;
	else enabled$1.enableEnhancedFileUploader = false;
	if (process.env.CARBON_ENABLE_PRESENCE) if (process.env.CARBON_ENABLE_PRESENCE === "true") enabled$1.enablePresence = true;
	else enabled$1.enablePresence = false;
	else enabled$1.enablePresence = false;
} catch (error) {
	enabled$1.enableCssCustomProperties = false;
	enabled$1.enableCssGrid = false;
	enabled$1.enableV11Release = true;
	enabled$1.enableExperimentalTileContrast = false;
	enabled$1.enableTileContrast = false;
	enabled$1.enableV12TileDefaultIcons = false;
	enabled$1.enableV12TileRadioIcons = false;
	enabled$1.enableV12Overflowmenu = false;
	enabled$1.enableTreeviewControllable = false;
	enabled$1.enableV12StructuredListVisibleIcons = false;
	enabled$1.enableExperimentalFocusWrapWithoutSentinels = false;
	enabled$1.enableFocusWrapWithoutSentinels = false;
	enabled$1.enableDialogElement = false;
	enabled$1.enableV12DynamicFloatingStyles = false;
	enabled$1.enableV12ToggleReducedLabelSpacing = false;
	enabled$1.enableEnhancedFileUploader = false;
	enabled$1.enablePresence = false;
}
const featureFlagInfo = [
	{
		name: "enable-css-custom-properties",
		description: "Describe what the flag does",
		enabled: enabled$1.enableCssCustomProperties
	},
	{
		name: "enable-css-grid",
		description: "Enable CSS Grid Layout in the Grid and Column React components\n",
		enabled: enabled$1.enableCssGrid
	},
	{
		name: "enable-v11-release",
		description: "Enable the features and functionality for the v11 Release\n",
		enabled: enabled$1.enableV11Release
	},
	{
		name: "enable-experimental-tile-contrast",
		description: "Deprecated, use enable-tile-contrast instead\n",
		enabled: enabled$1.enableExperimentalTileContrast
	},
	{
		name: "enable-tile-contrast",
		description: "Enable the experimental tile improved contrast styles\n",
		enabled: enabled$1.enableTileContrast
	},
	{
		name: "enable-v12-tile-default-icons",
		description: "Enable rendering of default icons in the tile components\n",
		enabled: enabled$1.enableV12TileDefaultIcons
	},
	{
		name: "enable-v12-tile-radio-icons",
		description: "Enable rendering of radio icons in the RadioTile component\n",
		enabled: enabled$1.enableV12TileRadioIcons
	},
	{
		name: "enable-v12-overflowmenu",
		description: "Enable the use of the v12 OverflowMenu leveraging the Menu subcomponents\n",
		enabled: enabled$1.enableV12Overflowmenu
	},
	{
		name: "enable-treeview-controllable",
		description: "Enable the new TreeView controllable API\n",
		enabled: enabled$1.enableTreeviewControllable
	},
	{
		name: "enable-v12-structured-list-visible-icons",
		description: "Enable rendering of radio icons in the StructuredList component\n",
		enabled: enabled$1.enableV12StructuredListVisibleIcons
	},
	{
		name: "enable-experimental-focus-wrap-without-sentinels",
		description: "Deprecated, use enable-focus-wrap-without-sentinels instead\n",
		enabled: enabled$1.enableExperimentalFocusWrapWithoutSentinels
	},
	{
		name: "enable-focus-wrap-without-sentinels",
		description: "Enable the new focus wrap behavior that doesn't use sentinel nodes\n",
		enabled: enabled$1.enableFocusWrapWithoutSentinels
	},
	{
		name: "enable-dialog-element",
		description: "Enable components to utilize the native dialog element\n",
		enabled: enabled$1.enableDialogElement
	},
	{
		name: "enable-v12-dynamic-floating-styles",
		description: "Enable dynamic setting of floating styles for components like Popover, Tooltip, etc.\n",
		enabled: enabled$1.enableV12DynamicFloatingStyles
	},
	{
		name: "enable-v12-toggle-reduced-label-spacing",
		description: "Enable a reduced spacing between the toggle control and its label\n",
		enabled: enabled$1.enableV12ToggleReducedLabelSpacing
	},
	{
		name: "enable-enhanced-file-uploader",
		description: "Enable enhanced functionality for the FileUploader component, including richer callback data and expanded trigger events for onChange and onDelete.\n",
		enabled: enabled$1.enableEnhancedFileUploader
	},
	{
		name: "enable-presence",
		description: "Enable components to remain unmounted in closed state and mount in open state.\n",
		enabled: enabled$1.enablePresence
	}
];
var FeatureFlagScope = class {
	constructor(flags) {
		this.flags = /* @__PURE__ */ new Map();
		if (flags) Object.keys(flags).forEach((key) => {
			this.flags.set(key, flags[key]);
		});
	}
	/**
	* Check to see if a flag exists
	*/
	checkForFlag(name) {
		if (!this.flags.has(name)) throw new Error(`Unable to find a feature flag with the name: \`${name}\``);
	}
	/**
	* Add a feature flag
	*/
	add(name, enabled) {
		if (this.flags.has(name)) throw new Error(`The feature flag: ${name} already exists`);
		this.flags.set(name, enabled);
	}
	/**
	* Enable a feature flag
	*/
	enable(name) {
		this.checkForFlag(name);
		this.flags.set(name, true);
	}
	/**
	* Disable a feature flag
	*/
	disable(name) {
		this.checkForFlag(name);
		this.flags.set(name, false);
	}
	/**
	* Merge the given feature flags with the current set of feature flags.
	* Duplicate keys will be set to the value in the given feature flags.
	*/
	merge(flags) {
		Object.keys(flags).forEach((key) => {
			this.flags.set(key, flags[key]);
		});
	}
	mergeWithScope(scope) {
		for (const [key, value] of scope.flags) {
			if (this.flags.has(key)) continue;
			this.flags.set(key, value);
		}
	}
	/**
	* Check if a feature flag is enabled
	*/
	enabled(name) {
		this.checkForFlag(name);
		return this.flags.get(name) ?? false;
	}
};
/**
* Copyright IBM Corp. 2015, 2026
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const createScope = (flags) => new FeatureFlagScope(flags);
const createDefaultScope = () => {
	const scope = createScope();
	for (const featureFlag of featureFlagInfo) scope.add(featureFlag.name, featureFlag.enabled);
	return scope;
};
const FeatureFlags = createDefaultScope();
FeatureFlags.add.bind(FeatureFlags);
FeatureFlags.enable.bind(FeatureFlags);
FeatureFlags.disable.bind(FeatureFlags);
FeatureFlags.enabled.bind(FeatureFlags);
FeatureFlags.merge.bind(FeatureFlags);
//#endregion
export { FeatureFlags, createScope };

//# sourceMappingURL=index.js.map