"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.vscodeDark = exports.defaultSettingsVscodeDark = void 0;
exports.vscodeDarkInit = vscodeDarkInit;
exports.vscodeDarkStyle = void 0;
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _highlight = require("@lezer/highlight");
var _codemirrorThemes = require("@uiw/codemirror-themes");
/**
 * https://github.com/uiwjs/react-codemirror/issues/409
 */

var defaultSettingsVscodeDark = exports.defaultSettingsVscodeDark = {
  background: '#1e1e1e',
  foreground: '#9cdcfe',
  caret: '#c6c6c6',
  selection: '#6199ff2f',
  selectionMatch: '#72a1ff59',
  lineHighlight: '#ffffff0f',
  gutterBackground: '#1e1e1e',
  gutterForeground: '#838383',
  gutterActiveForeground: '#fff',
  fontFamily: 'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace'
};
var vscodeDarkStyle = exports.vscodeDarkStyle = [{
  tag: [_highlight.tags.keyword, _highlight.tags.operatorKeyword, _highlight.tags.modifier, _highlight.tags.color, _highlight.tags.constant(_highlight.tags.name), _highlight.tags.standard(_highlight.tags.name), _highlight.tags.standard(_highlight.tags.tagName), _highlight.tags.special(_highlight.tags.brace), _highlight.tags.atom, _highlight.tags.bool, _highlight.tags.special(_highlight.tags.variableName)],
  color: '#569cd6'
}, {
  tag: [_highlight.tags.controlKeyword, _highlight.tags.moduleKeyword],
  color: '#c586c0'
}, {
  tag: [_highlight.tags.name, _highlight.tags.deleted, _highlight.tags.character, _highlight.tags.macroName, _highlight.tags.propertyName, _highlight.tags.variableName, _highlight.tags.labelName, _highlight.tags.definition(_highlight.tags.name)],
  color: '#9cdcfe'
}, {
  tag: _highlight.tags.heading,
  fontWeight: 'bold',
  color: '#9cdcfe'
}, {
  tag: [_highlight.tags.typeName, _highlight.tags.className, _highlight.tags.tagName, _highlight.tags.number, _highlight.tags.changed, _highlight.tags.annotation, _highlight.tags.self, _highlight.tags.namespace],
  color: '#4ec9b0'
}, {
  tag: [_highlight.tags["function"](_highlight.tags.variableName), _highlight.tags["function"](_highlight.tags.propertyName)],
  color: '#dcdcaa'
}, {
  tag: [_highlight.tags.number],
  color: '#b5cea8'
}, {
  tag: [_highlight.tags.operator, _highlight.tags.punctuation, _highlight.tags.separator, _highlight.tags.url, _highlight.tags.escape, _highlight.tags.regexp],
  color: '#d4d4d4'
}, {
  tag: [_highlight.tags.regexp],
  color: '#d16969'
}, {
  tag: [_highlight.tags.special(_highlight.tags.string), _highlight.tags.processingInstruction, _highlight.tags.string, _highlight.tags.inserted],
  color: '#ce9178'
}, {
  tag: [_highlight.tags.angleBracket],
  color: '#808080'
}, {
  tag: _highlight.tags.strong,
  fontWeight: 'bold'
}, {
  tag: _highlight.tags.emphasis,
  fontStyle: 'italic'
}, {
  tag: _highlight.tags.strikethrough,
  textDecoration: 'line-through'
}, {
  tag: [_highlight.tags.meta, _highlight.tags.comment],
  color: '#6a9955'
}, {
  tag: _highlight.tags.link,
  color: '#6a9955',
  textDecoration: 'underline'
}, {
  tag: _highlight.tags.invalid,
  color: '#ff0000'
}];
function vscodeDarkInit(options) {
  var _ref = options || {},
    _ref$theme = _ref.theme,
    theme = _ref$theme === void 0 ? 'dark' : _ref$theme,
    _ref$settings = _ref.settings,
    settings = _ref$settings === void 0 ? {} : _ref$settings,
    _ref$styles = _ref.styles,
    styles = _ref$styles === void 0 ? [] : _ref$styles;
  return (0, _codemirrorThemes.createTheme)({
    theme: theme,
    settings: (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, defaultSettingsVscodeDark), settings),
    styles: [].concat(vscodeDarkStyle, (0, _toConsumableArray2["default"])(styles))
  });
}
var vscodeDark = exports.vscodeDark = vscodeDarkInit();