var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
  return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import './controllers/dark-mode-style-controller';
import { InjectVegaTelemetrySlimmer } from 'vega-slimmer/core';
import { createPublicAPIRuntimeMetricsSlimmer } from '../slimmers/runtime-metrics/create-public-api-runtime-metrics-slimmer';
import { ThemeManagerRuntimeMetricsPayloadDefinition } from '../../constants/runtime-metrics-payload-definition/public-api/ThemeManager/runtime-metrics-payload-definition';
import { VegaInternalThemeManager } from './internal-theme-manager';
/**
 * Vega components theme manager
 */
class ThemeManager {
  constructor() {
    this.vegaPublicAPIRuntimeMetricsSlimmer = createPublicAPIRuntimeMetricsSlimmer(ThemeManager, ['overrideColors', 'reset', 'toggleDarkMode', 'isDarkMode', 'applyBranding'], ThemeManagerRuntimeMetricsPayloadDefinition);
  }
  /**
   * It takes the colors you passed in, parses them into the correct format, and then applies them to the theme
   *
   * @param {VegaThemeOverrideColors} overrideColors - OverrideColors - This is the object that you pass to the function.
   * @vegaVersion 1.20.0
   */
  async overrideColors(overrideColors) {
    void VegaInternalThemeManager.overrideColors(overrideColors);
  }
  /**
   * It removes all the custom override theme styles from the DOM
   *
   * @vegaVersion 1.20.0
   */
  async reset() {
    void VegaInternalThemeManager.reset();
  }
  /**
   * This function toggles the dark mode of a webpage by adding or removing a 'dark' class to the HTML element.
   *
   * @param {boolean | undefined} darkMode - A boolean or undefined value that determines whether to enable or disable dark mode.
   * If it is true, dark mode is enabled.
   * If it is false, dark mode is disabled.
   * @vegaVersion 1.32.0
   */
  toggleDarkMode(darkMode) {
    VegaInternalThemeManager.toggleDarkMode(darkMode);
  }
  /**
   * The function checks if the HTML element has a class of "dark" and returns a boolean value accordingly.
   *
   * @returns {boolean} A boolean value indicating whether the HTML element has a class of "dark", which is
   * typically used to indicate that the website is in dark mode.
   * @vegaVersion 1.32.0
   */
  isDarkMode() {
    return VegaInternalThemeManager.isDarkMode();
  }
  /**
   * This function switches the Vega theme to a brand theme based on the provided options.
   *
   * @param {BrandOptions} options - The options includes 'gp', 'genius' and 'heartland' options
   * @vegaVersion 2.47.0
   */
  applyBranding(options) {
    VegaInternalThemeManager.applyBranding(options);
  }
}
__decorate([
  InjectVegaTelemetrySlimmer()
], ThemeManager.prototype, "vegaPublicAPIRuntimeMetricsSlimmer", void 0);
export const VegaThemeManager = new ThemeManager();
