/**
 *
 * @ai-apps/angular v2.152.0 | _feature-flags.scss
 *
 * Copyright 2014, 2023 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


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

//-------------------------
// 🎌 Feature Flags
//-------------------------

/// Initialize the feature flag map with default values.
/// @access public
/// @type Map
/// @group feature-flags
/// @example
/// @example scss - Overriding defaults from the `$default-feature-flags` map
///   $feature-flags: (
///     ui-shell: false,
///     grid: true,
///     grid-columns-16: false,
///     grid--fallback: false,
///   );
$feature-flags: () !default;

/// Default feature flag values
/// @access private
/// @type Map
/// @group feature-flags
$default-feature-flags: (
  ui-shell: true,
  grid: true,
  grid-columns-16: false,
  grid--fallback: false,
  enable-css-custom-properties: false,
  enable-v11-release: false,
);

$feature-flags: map-merge($default-feature-flags, $feature-flags);

@if feature-flag-enabled('enable-v11-release') == true {
  @if variable-exists(css--disable-css-custom-properties) ==
    false or
    $css--disable-css-custom-properties ==
    false
  {
    $feature-flags: map-merge(
      $feature-flags,
      (
        enable-css-custom-properties: true,
      )
    );
  }
}

@if map-get($feature-flags, grid) != true {
  // We supported a flag for experimental grid in the past that we want to keep
  // supporting till our next major release. These two @if statements will assign
  // these values over into the map if they are defined.
  @if variable-exists(css--use-experimental-grid) == true {
    $feature-flags: map-merge(
      $feature-flags,
      (
        grid: $css--use-experimental-grid,
      )
    );
  }

  @if variable-exists(css--use-experimental-grid-fallback) == true {
    $feature-flags: map-merge(
      $feature-flags,
      (
        grid--fallback: $css--use-experimental-grid-fallback,
      )
    );
  }
}
