
import { CommentThreadState } from '../../../../editor/common/languages.js';
import { peekViewTitleBackground } from '../../../../editor/contrib/peekView/browser/peekView.js';
import { localize } from '../../../../nls.js';
import { registerColor, transparent } from '../../../../platform/theme/common/colorUtils.js';
import { contrastBorder, disabledForeground } from '../../../../platform/theme/common/colors/baseColors.js';
import '../../../../platform/theme/common/colors/chartsColors.js';
import '../../../../platform/theme/common/colors/editorColors.js';
import '../../../../platform/theme/common/colors/inputColors.js';
import { listFocusOutline } from '../../../../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';

const resolvedCommentViewIcon = registerColor("commentsView.resolvedIcon", {
    dark: disabledForeground,
    light: disabledForeground,
    hcDark: contrastBorder,
    hcLight: contrastBorder
}, ( localize(8584, "Icon color for resolved comments.")));
const unresolvedCommentViewIcon = registerColor("commentsView.unresolvedIcon", {
    dark: listFocusOutline,
    light: listFocusOutline,
    hcDark: contrastBorder,
    hcLight: contrastBorder
}, ( localize(8585, "Icon color for unresolved comments.")));
registerColor(
    "editorCommentsWidget.replyInputBackground",
    peekViewTitleBackground,
    ( localize(8586, "Background color for comment reply input box."))
);
const resolvedCommentBorder = registerColor("editorCommentsWidget.resolvedBorder", {
    dark: resolvedCommentViewIcon,
    light: resolvedCommentViewIcon,
    hcDark: contrastBorder,
    hcLight: contrastBorder
}, ( localize(8587, "Color of borders and arrow for resolved comments.")));
const unresolvedCommentBorder = registerColor("editorCommentsWidget.unresolvedBorder", {
    dark: unresolvedCommentViewIcon,
    light: unresolvedCommentViewIcon,
    hcDark: contrastBorder,
    hcLight: contrastBorder
}, ( localize(8588, "Color of borders and arrow for unresolved comments.")));
registerColor("editorCommentsWidget.rangeBackground", ( transparent(unresolvedCommentBorder, .1)), ( localize(8589, "Color of background for comment ranges.")));
registerColor("editorCommentsWidget.rangeActiveBackground", ( transparent(unresolvedCommentBorder, .1)), ( localize(
    8590,
    "Color of background for currently selected or hovered comment range."
)));
const commentThreadStateBorderColors = ( new Map([
    [CommentThreadState.Unresolved, unresolvedCommentBorder],
    [CommentThreadState.Resolved, resolvedCommentBorder]
]));
const commentThreadStateIconColors = ( new Map([
    [CommentThreadState.Unresolved, unresolvedCommentViewIcon],
    [CommentThreadState.Resolved, resolvedCommentViewIcon]
]));
const commentThreadStateColorVar = "--comment-thread-state-color";
const commentViewThreadStateColorVar = "--comment-view-thread-state-color";
const commentThreadStateBackgroundColorVar = "--comment-thread-state-background-color";
function getCommentThreadStateColor(state, theme, map) {
    const colorId = (state !== undefined) ? map.get(state) : undefined;
    return (colorId !== undefined) ? theme.getColor(colorId) : undefined;
}
function getCommentThreadStateBorderColor(state, theme) {
    return getCommentThreadStateColor(state, theme, commentThreadStateBorderColors);
}
function getCommentThreadStateIconColor(state, theme) {
    return getCommentThreadStateColor(state, theme, commentThreadStateIconColors);
}

export { commentThreadStateBackgroundColorVar, commentThreadStateColorVar, commentViewThreadStateColorVar, getCommentThreadStateBorderColor, getCommentThreadStateIconColor };
