"use strict";
const editorExtensions = require("../../../browser/editorExtensions.js");
const standaloneTheme = require("../../common/standaloneTheme.js");
const standaloneStrings = require("../../../common/standaloneStrings.js");
class ToggleHighContrast extends editorExtensions.EditorAction {
  constructor() {
    super({
      id: "editor.action.toggleHighContrast",
      label: standaloneStrings.ToggleHighContrastNLS.toggleHighContrast,
      alias: "Toggle High Contrast Theme",
      precondition: void 0
    });
    this._originalThemeName = null;
  }
  run(accessor, editor) {
    const standaloneThemeService = accessor.get(standaloneTheme.IStandaloneThemeService);
    if (this._originalThemeName) {
      standaloneThemeService.setTheme(this._originalThemeName);
      this._originalThemeName = null;
    } else {
      this._originalThemeName = standaloneThemeService.getColorTheme().themeName;
      standaloneThemeService.setTheme("hc-black");
    }
  }
}
editorExtensions.registerEditorAction(ToggleHighContrast);
