import { registerEditorAction, EditorAction2, EditorAction } from '../../../browser/editorExtensions.js';
import { localize2WithPath, localizeWithPath } from '../../../../nls.js';
import { StandaloneColorPickerController } from './standaloneColorPickerWidget.js';
import { EditorContextKeys } from '../../../common/editorContextKeys.js';
import { registerAction2, MenuId } from '../../../../platform/actions/common/actions.js';
import './colorPicker.css.js';
const _moduleId = "vs/editor/contrib/colorPicker/browser/standaloneColorPickerActions";
class ShowOrFocusStandaloneColorPicker extends EditorAction2 {
    constructor() {
        super({
            id: 'editor.action.showOrFocusStandaloneColorPicker',
            title: {
                ...( localize2WithPath(_moduleId, 0, "Show or Focus Standalone Color Picker")),
                mnemonicTitle: ( localizeWithPath(_moduleId, 1, "&&Show or Focus Standalone Color Picker")),
            },
            precondition: undefined,
            menu: [
                { id: MenuId.CommandPalette },
            ]
        });
    }
    runEditorCommand(_accessor, editor) {
        StandaloneColorPickerController.get(editor)?.showOrFocus();
    }
}
class HideStandaloneColorPicker extends EditorAction {
    constructor() {
        super({
            id: 'editor.action.hideColorPicker',
            label: ( localizeWithPath(_moduleId, 2, "Hide the Color Picker")),
            alias: 'Hide the Color Picker',
            precondition: ( (EditorContextKeys.standaloneColorPickerVisible.isEqualTo(true))),
            kbOpts: {
                primary: 9 ,
                weight: 100
            }
        });
    }
    run(_accessor, editor) {
        StandaloneColorPickerController.get(editor)?.hide();
    }
}
class InsertColorWithStandaloneColorPicker extends EditorAction {
    constructor() {
        super({
            id: 'editor.action.insertColorWithStandaloneColorPicker',
            label: ( localizeWithPath(_moduleId, 3, "Insert Color with Standalone Color Picker")),
            alias: 'Insert Color with Standalone Color Picker',
            precondition: ( (EditorContextKeys.standaloneColorPickerFocused.isEqualTo(true))),
            kbOpts: {
                primary: 3 ,
                weight: 100
            }
        });
    }
    run(_accessor, editor) {
        StandaloneColorPickerController.get(editor)?.insertColor();
    }
}
registerEditorAction(HideStandaloneColorPicker);
registerEditorAction(InsertColorWithStandaloneColorPicker);
registerAction2(ShowOrFocusStandaloneColorPicker);
export { ShowOrFocusStandaloneColorPicker };
