
import { Color } from '../../../../../../base/common/color.js';
import { localize } from '../../../../../../nls.js';
import { registerColor, transparent, darken, lighten, asCssVariable } from '../../../../../../platform/theme/common/colorUtils.js';
import '../../../../../../platform/theme/common/colors/baseColors.js';
import '../../../../../../platform/theme/common/colors/chartsColors.js';
import { diffRemoved, diffInsertedLine, diffInserted, editorHoverStatusBarBackground, editorHoverBorder } from '../../../../../../platform/theme/common/colors/editorColors.js';
import { buttonForeground, buttonBackground, buttonSecondaryForeground, buttonSecondaryBackground } from '../../../../../../platform/theme/common/colors/inputColors.js';
import '../../../../../../platform/theme/common/colors/listColors.js';
import '../../../../../../platform/theme/common/colors/menuColors.js';
import '../../../../../../platform/theme/common/colors/minimapColors.js';
import '../../../../../../platform/theme/common/colors/miscColors.js';
import '../../../../../../platform/theme/common/colors/quickpickColors.js';
import '../../../../../../platform/theme/common/colors/searchColors.js';
import { InlineEditTabAction } from './utils/utils.js';

const originalBackgroundColor = registerColor('inlineEdit.originalBackground', Color.transparent, ( localize(1250, 'Background color for the original text in inline edits.')), true);
const modifiedBackgroundColor = registerColor('inlineEdit.modifiedBackground', Color.transparent, ( localize(1251, 'Background color for the modified text in inline edits.')), true);
registerColor('inlineEdit.originalChangedLineBackground', Color.transparent, ( localize(
    1252,
    'Background color for the changed lines in the original text of inline edits.'
)), true);
const originalChangedTextOverlayColor = registerColor('inlineEdit.originalChangedTextBackground', diffRemoved, ( localize(
    1253,
    'Overlay color for the changed text in the original text of inline edits.'
)), true);
const modifiedChangedLineBackgroundColor = registerColor('inlineEdit.modifiedChangedLineBackground', {
    light: ( transparent(diffInsertedLine, 0.5)),
    dark: ( transparent(diffInsertedLine, 0.5)),
    hcDark: diffInsertedLine,
    hcLight: diffInsertedLine
}, ( localize(
    1254,
    'Background color for the changed lines in the modified text of inline edits.'
)), true);
const modifiedChangedTextOverlayColor = registerColor('inlineEdit.modifiedChangedTextBackground', diffInserted, ( localize(
    1255,
    'Overlay color for the changed text in the modified text of inline edits.'
)), true);
const replacementViewBackground = registerColor('inlineEdit.wordReplacementView.background', {
    light: ( transparent(editorHoverStatusBarBackground, 0.1)),
    dark: ( transparent(editorHoverStatusBarBackground, 0.1)),
    hcLight: ( transparent(editorHoverStatusBarBackground, 0.1)),
    hcDark: ( transparent(editorHoverStatusBarBackground, 0.1)),
}, ( localize(1256, 'Background color for the inline edit word replacement view.')));
const inlineEditIndicatorPrimaryForeground = registerColor('inlineEdit.gutterIndicator.primaryForeground', buttonForeground, ( localize(1257, 'Foreground color for the primary inline edit gutter indicator.')));
const inlineEditIndicatorPrimaryBackground = registerColor('inlineEdit.gutterIndicator.primaryBackground', buttonBackground, ( localize(1258, 'Background color for the primary inline edit gutter indicator.')));
const inlineEditIndicatorSecondaryForeground = registerColor('inlineEdit.gutterIndicator.secondaryForeground', buttonSecondaryForeground, ( localize(1259, 'Foreground color for the secondary inline edit gutter indicator.')));
const inlineEditIndicatorSecondaryBackground = registerColor('inlineEdit.gutterIndicator.secondaryBackground', buttonSecondaryBackground, ( localize(1260, 'Background color for the secondary inline edit gutter indicator.')));
const inlineEditIndicatorsuccessfulForeground = registerColor('inlineEdit.gutterIndicator.successfulForeground', buttonForeground, ( localize(1261, 'Foreground color for the successful inline edit gutter indicator.')));
const inlineEditIndicatorsuccessfulBackground = registerColor('inlineEdit.gutterIndicator.successfulBackground', { light: '#2e825c', dark: '#2e825c', hcLight: '#2e825c', hcDark: '#2e825c' }, ( localize(1262, 'Background color for the successful inline edit gutter indicator.')));
const inlineEditIndicatorBackground = registerColor('inlineEdit.gutterIndicator.background', {
    hcDark: ( transparent('tab.inactiveBackground', 0.5)),
    hcLight: ( transparent('tab.inactiveBackground', 0.5)),
    dark: ( transparent('tab.inactiveBackground', 0.5)),
    light: '#5f5f5f18',
}, ( localize(1263, 'Background color for the inline edit gutter indicator.')));
const originalBorder = registerColor('inlineEdit.originalBorder', {
    light: editorHoverBorder,
    dark: editorHoverBorder,
    hcDark: editorHoverBorder,
    hcLight: editorHoverBorder
}, ( localize(1264, 'Border color for the original text in inline edits.')));
const modifiedBorder = registerColor('inlineEdit.modifiedBorder', {
    light: editorHoverBorder,
    dark: editorHoverBorder,
    hcDark: editorHoverBorder,
    hcLight: editorHoverBorder
}, ( localize(1265, 'Border color for the modified text in inline edits.')));
const tabWillAcceptModifiedBorder = registerColor('inlineEdit.tabWillAcceptBorder', {
    light: ( darken(modifiedBorder, 0.25)),
    dark: ( lighten(modifiedBorder, 0.25)),
    hcDark: ( lighten(modifiedBorder, 0.5)),
    hcLight: ( darken(modifiedBorder, 0.5))
}, ( localize(1266, 'Border color for the inline edits widget when tab will accept it.')));
const tabWillAcceptOriginalBorder = registerColor('inlineEdit.tabWillAcceptBorder', {
    light: ( darken(originalBorder, 0.25)),
    dark: ( lighten(originalBorder, 0.25)),
    hcDark: ( lighten(originalBorder, 0.5)),
    hcLight: ( darken(originalBorder, 0.5))
}, ( localize(
    1267,
    'Border color for the inline edits widget over the original text when tab will accept it.'
)));
function getModifiedBorderColor(tabAction) {
    return ( tabAction.map(
        a => asCssVariable(a === InlineEditTabAction.Accept ? tabWillAcceptModifiedBorder : modifiedBorder)
    ));
}
function getOriginalBorderColor(tabAction) {
    return ( tabAction.map(
        a => asCssVariable(a === InlineEditTabAction.Accept ? tabWillAcceptOriginalBorder : originalBorder)
    ));
}

export { getModifiedBorderColor, getOriginalBorderColor, inlineEditIndicatorBackground, inlineEditIndicatorPrimaryBackground, inlineEditIndicatorPrimaryForeground, inlineEditIndicatorSecondaryBackground, inlineEditIndicatorSecondaryForeground, inlineEditIndicatorsuccessfulBackground, inlineEditIndicatorsuccessfulForeground, modifiedBackgroundColor, modifiedChangedLineBackgroundColor, modifiedChangedTextOverlayColor, originalBackgroundColor, originalChangedTextOverlayColor, replacementViewBackground };
