open-webui/static/pyscript/codemirror-Dr2Hgejs.js.map
2024-05-16 17:49:28 -10:00

1 line
130 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"codemirror-Dr2Hgejs.js","sources":["../node_modules/crelt/index.js","../node_modules/@codemirror/search/dist/index.js","../node_modules/@codemirror/lint/dist/index.js","../node_modules/codemirror/dist/index.js"],"sourcesContent":["export default function crelt() {\n var elt = arguments[0]\n if (typeof elt == \"string\") elt = document.createElement(elt)\n var i = 1, next = arguments[1]\n if (next && typeof next == \"object\" && next.nodeType == null && !Array.isArray(next)) {\n for (var name in next) if (Object.prototype.hasOwnProperty.call(next, name)) {\n var value = next[name]\n if (typeof value == \"string\") elt.setAttribute(name, value)\n else if (value != null) elt[name] = value\n }\n i++\n }\n for (; i < arguments.length; i++) add(elt, arguments[i])\n return elt\n}\n\nfunction add(elt, child) {\n if (typeof child == \"string\") {\n elt.appendChild(document.createTextNode(child))\n } else if (child == null) {\n } else if (child.nodeType != null) {\n elt.appendChild(child)\n } else if (Array.isArray(child)) {\n for (var i = 0; i < child.length; i++) add(elt, child[i])\n } else {\n throw new RangeError(\"Unsupported child node: \" + child)\n }\n}\n","import { showPanel, EditorView, getPanel, Decoration, ViewPlugin, runScopeHandlers } from '@codemirror/view';\nimport { codePointAt, fromCodePoint, codePointSize, StateEffect, StateField, EditorSelection, Facet, combineConfig, CharCategory, RangeSetBuilder, Prec, EditorState, findClusterBreak } from '@codemirror/state';\nimport elt from 'crelt';\n\nconst basicNormalize = typeof String.prototype.normalize == \"function\"\n ? x => x.normalize(\"NFKD\") : x => x;\n/**\nA search cursor provides an iterator over text matches in a\ndocument.\n*/\nclass SearchCursor {\n /**\n Create a text cursor. The query is the search string, `from` to\n `to` provides the region to search.\n \n When `normalize` is given, it will be called, on both the query\n string and the content it is matched against, before comparing.\n You can, for example, create a case-insensitive search by\n passing `s => s.toLowerCase()`.\n \n Text is always normalized with\n [`.normalize(\"NFKD\")`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\n (when supported).\n */\n constructor(text, query, from = 0, to = text.length, normalize, test) {\n this.test = test;\n /**\n The current match (only holds a meaningful value after\n [`next`](https://codemirror.net/6/docs/ref/#search.SearchCursor.next) has been called and when\n `done` is false).\n */\n this.value = { from: 0, to: 0 };\n /**\n Whether the end of the iterated region has been reached.\n */\n this.done = false;\n this.matches = [];\n this.buffer = \"\";\n this.bufferPos = 0;\n this.iter = text.iterRange(from, to);\n this.bufferStart = from;\n this.normalize = normalize ? x => normalize(basicNormalize(x)) : basicNormalize;\n this.query = this.normalize(query);\n }\n peek() {\n if (this.bufferPos == this.buffer.length) {\n this.bufferStart += this.buffer.length;\n this.iter.next();\n if (this.iter.done)\n return -1;\n this.bufferPos = 0;\n this.buffer = this.iter.value;\n }\n return codePointAt(this.buffer, this.bufferPos);\n }\n /**\n Look for the next match. Updates the iterator's\n [`value`](https://codemirror.net/6/docs/ref/#search.SearchCursor.value) and\n [`done`](https://codemirror.net/6/docs/ref/#search.SearchCursor.done) properties. Should be called\n at least once before using the cursor.\n */\n next() {\n while (this.matches.length)\n this.matches.pop();\n return this.nextOverlapping();\n }\n /**\n The `next` method will ignore matches that partially overlap a\n previous match. This method behaves like `next`, but includes\n such matches.\n */\n nextOverlapping() {\n for (;;) {\n let next = this.peek();\n if (next < 0) {\n this.done = true;\n return this;\n }\n let str = fromCodePoint(next), start = this.bufferStart + this.bufferPos;\n this.bufferPos += codePointSize(next);\n let norm = this.normalize(str);\n for (let i = 0, pos = start;; i++) {\n let code = norm.charCodeAt(i);\n let match = this.match(code, pos, this.bufferPos + this.bufferStart);\n if (i == norm.length - 1) {\n if (match) {\n this.value = match;\n return this;\n }\n break;\n }\n if (pos == start && i < str.length && str.charCodeAt(i) == code)\n pos++;\n }\n }\n }\n match(code, pos, end) {\n let match = null;\n for (let i = 0; i < this.matches.length; i += 2) {\n let index = this.matches[i], keep = false;\n if (this.query.charCodeAt(index) == code) {\n if (index == this.query.length - 1) {\n match = { from: this.matches[i + 1], to: end };\n }\n else {\n this.matches[i]++;\n keep = true;\n }\n }\n if (!keep) {\n this.matches.splice(i, 2);\n i -= 2;\n }\n }\n if (this.query.charCodeAt(0) == code) {\n if (this.query.length == 1)\n match = { from: pos, to: end };\n else\n this.matches.push(1, pos);\n }\n if (match && this.test && !this.test(match.from, match.to, this.buffer, this.bufferStart))\n match = null;\n return match;\n }\n}\nif (typeof Symbol != \"undefined\")\n SearchCursor.prototype[Symbol.iterator] = function () { return this; };\n\nconst empty = { from: -1, to: -1, match: /*@__PURE__*//.*/.exec(\"\") };\nconst baseFlags = \"gm\" + (/x/.unicode == null ? \"\" : \"u\");\n/**\nThis class is similar to [`SearchCursor`](https://codemirror.net/6/docs/ref/#search.SearchCursor)\nbut searches for a regular expression pattern instead of a plain\nstring.\n*/\nclass RegExpCursor {\n /**\n Create a cursor that will search the given range in the given\n document. `query` should be the raw pattern (as you'd pass it to\n `new RegExp`).\n */\n constructor(text, query, options, from = 0, to = text.length) {\n this.text = text;\n this.to = to;\n this.curLine = \"\";\n /**\n Set to `true` when the cursor has reached the end of the search\n range.\n */\n this.done = false;\n /**\n Will contain an object with the extent of the match and the\n match object when [`next`](https://codemirror.net/6/docs/ref/#search.RegExpCursor.next)\n sucessfully finds a match.\n */\n this.value = empty;\n if (/\\\\[sWDnr]|\\n|\\r|\\[\\^/.test(query))\n return new MultilineRegExpCursor(text, query, options, from, to);\n this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? \"i\" : \"\"));\n this.test = options === null || options === void 0 ? void 0 : options.test;\n this.iter = text.iter();\n let startLine = text.lineAt(from);\n this.curLineStart = startLine.from;\n this.matchPos = toCharEnd(text, from);\n this.getLine(this.curLineStart);\n }\n getLine(skip) {\n this.iter.next(skip);\n if (this.iter.lineBreak) {\n this.curLine = \"\";\n }\n else {\n this.curLine = this.iter.value;\n if (this.curLineStart + this.curLine.length > this.to)\n this.curLine = this.curLine.slice(0, this.to - this.curLineStart);\n this.iter.next();\n }\n }\n nextLine() {\n this.curLineStart = this.curLineStart + this.curLine.length + 1;\n if (this.curLineStart > this.to)\n this.curLine = \"\";\n else\n this.getLine(0);\n }\n /**\n Move to the next match, if there is one.\n */\n next() {\n for (let off = this.matchPos - this.curLineStart;;) {\n this.re.lastIndex = off;\n let match = this.matchPos <= this.to && this.re.exec(this.curLine);\n if (match) {\n let from = this.curLineStart + match.index, to = from + match[0].length;\n this.matchPos = toCharEnd(this.text, to + (from == to ? 1 : 0));\n if (from == this.curLineStart + this.curLine.length)\n this.nextLine();\n if ((from < to || from > this.value.to) && (!this.test || this.test(from, to, match))) {\n this.value = { from, to, match };\n return this;\n }\n off = this.matchPos - this.curLineStart;\n }\n else if (this.curLineStart + this.curLine.length < this.to) {\n this.nextLine();\n off = 0;\n }\n else {\n this.done = true;\n return this;\n }\n }\n }\n}\nconst flattened = /*@__PURE__*/new WeakMap();\n// Reusable (partially) flattened document strings\nclass FlattenedDoc {\n constructor(from, text) {\n this.from = from;\n this.text = text;\n }\n get to() { return this.from + this.text.length; }\n static get(doc, from, to) {\n let cached = flattened.get(doc);\n if (!cached || cached.from >= to || cached.to <= from) {\n let flat = new FlattenedDoc(from, doc.sliceString(from, to));\n flattened.set(doc, flat);\n return flat;\n }\n if (cached.from == from && cached.to == to)\n return cached;\n let { text, from: cachedFrom } = cached;\n if (cachedFrom > from) {\n text = doc.sliceString(from, cachedFrom) + text;\n cachedFrom = from;\n }\n if (cached.to < to)\n text += doc.sliceString(cached.to, to);\n flattened.set(doc, new FlattenedDoc(cachedFrom, text));\n return new FlattenedDoc(from, text.slice(from - cachedFrom, to - cachedFrom));\n }\n}\nclass MultilineRegExpCursor {\n constructor(text, query, options, from, to) {\n this.text = text;\n this.to = to;\n this.done = false;\n this.value = empty;\n this.matchPos = toCharEnd(text, from);\n this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? \"i\" : \"\"));\n this.test = options === null || options === void 0 ? void 0 : options.test;\n this.flat = FlattenedDoc.get(text, from, this.chunkEnd(from + 5000 /* Chunk.Base */));\n }\n chunkEnd(pos) {\n return pos >= this.to ? this.to : this.text.lineAt(pos).to;\n }\n next() {\n for (;;) {\n let off = this.re.lastIndex = this.matchPos - this.flat.from;\n let match = this.re.exec(this.flat.text);\n // Skip empty matches directly after the last match\n if (match && !match[0] && match.index == off) {\n this.re.lastIndex = off + 1;\n match = this.re.exec(this.flat.text);\n }\n if (match) {\n let from = this.flat.from + match.index, to = from + match[0].length;\n // If a match goes almost to the end of a noncomplete chunk, try\n // again, since it'll likely be able to match more\n if ((this.flat.to >= this.to || match.index + match[0].length <= this.flat.text.length - 10) &&\n (!this.test || this.test(from, to, match))) {\n this.value = { from, to, match };\n this.matchPos = toCharEnd(this.text, to + (from == to ? 1 : 0));\n return this;\n }\n }\n if (this.flat.to == this.to) {\n this.done = true;\n return this;\n }\n // Grow the flattened doc\n this.flat = FlattenedDoc.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));\n }\n }\n}\nif (typeof Symbol != \"undefined\") {\n RegExpCursor.prototype[Symbol.iterator] = MultilineRegExpCursor.prototype[Symbol.iterator] =\n function () { return this; };\n}\nfunction validRegExp(source) {\n try {\n new RegExp(source, baseFlags);\n return true;\n }\n catch (_a) {\n return false;\n }\n}\nfunction toCharEnd(text, pos) {\n if (pos >= text.length)\n return pos;\n let line = text.lineAt(pos), next;\n while (pos < line.to && (next = line.text.charCodeAt(pos - line.from)) >= 0xDC00 && next < 0xE000)\n pos++;\n return pos;\n}\n\nfunction createLineDialog(view) {\n let line = String(view.state.doc.lineAt(view.state.selection.main.head).number);\n let input = elt(\"input\", { class: \"cm-textfield\", name: \"line\", value: line });\n let dom = elt(\"form\", {\n class: \"cm-gotoLine\",\n onkeydown: (event) => {\n if (event.keyCode == 27) { // Escape\n event.preventDefault();\n view.dispatch({ effects: dialogEffect.of(false) });\n view.focus();\n }\n else if (event.keyCode == 13) { // Enter\n event.preventDefault();\n go();\n }\n },\n onsubmit: (event) => {\n event.preventDefault();\n go();\n }\n }, elt(\"label\", view.state.phrase(\"Go to line\"), \": \", input), \" \", elt(\"button\", { class: \"cm-button\", type: \"submit\" }, view.state.phrase(\"go\")));\n function go() {\n let match = /^([+-])?(\\d+)?(:\\d+)?(%)?$/.exec(input.value);\n if (!match)\n return;\n let { state } = view, startLine = state.doc.lineAt(state.selection.main.head);\n let [, sign, ln, cl, percent] = match;\n let col = cl ? +cl.slice(1) : 0;\n let line = ln ? +ln : startLine.number;\n if (ln && percent) {\n let pc = line / 100;\n if (sign)\n pc = pc * (sign == \"-\" ? -1 : 1) + (startLine.number / state.doc.lines);\n line = Math.round(state.doc.lines * pc);\n }\n else if (ln && sign) {\n line = line * (sign == \"-\" ? -1 : 1) + startLine.number;\n }\n let docLine = state.doc.line(Math.max(1, Math.min(state.doc.lines, line)));\n let selection = EditorSelection.cursor(docLine.from + Math.max(0, Math.min(col, docLine.length)));\n view.dispatch({\n effects: [dialogEffect.of(false), EditorView.scrollIntoView(selection.from, { y: 'center' })],\n selection,\n });\n view.focus();\n }\n return { dom };\n}\nconst dialogEffect = /*@__PURE__*/StateEffect.define();\nconst dialogField = /*@__PURE__*/StateField.define({\n create() { return true; },\n update(value, tr) {\n for (let e of tr.effects)\n if (e.is(dialogEffect))\n value = e.value;\n return value;\n },\n provide: f => showPanel.from(f, val => val ? createLineDialog : null)\n});\n/**\nCommand that shows a dialog asking the user for a line number, and\nwhen a valid position is provided, moves the cursor to that line.\n\nSupports line numbers, relative line offsets prefixed with `+` or\n`-`, document percentages suffixed with `%`, and an optional\ncolumn position by adding `:` and a second number after the line\nnumber.\n*/\nconst gotoLine = view => {\n let panel = getPanel(view, createLineDialog);\n if (!panel) {\n let effects = [dialogEffect.of(true)];\n if (view.state.field(dialogField, false) == null)\n effects.push(StateEffect.appendConfig.of([dialogField, baseTheme$1]));\n view.dispatch({ effects });\n panel = getPanel(view, createLineDialog);\n }\n if (panel)\n panel.dom.querySelector(\"input\").select();\n return true;\n};\nconst baseTheme$1 = /*@__PURE__*/EditorView.baseTheme({\n \".cm-panel.cm-gotoLine\": {\n padding: \"2px 6px 4px\",\n \"& label\": { fontSize: \"80%\" }\n }\n});\n\nconst defaultHighlightOptions = {\n highlightWordAroundCursor: false,\n minSelectionLength: 1,\n maxMatches: 100,\n wholeWords: false\n};\nconst highlightConfig = /*@__PURE__*/Facet.define({\n combine(options) {\n return combineConfig(options, defaultHighlightOptions, {\n highlightWordAroundCursor: (a, b) => a || b,\n minSelectionLength: Math.min,\n maxMatches: Math.min\n });\n }\n});\n/**\nThis extension highlights text that matches the selection. It uses\nthe `\"cm-selectionMatch\"` class for the highlighting. When\n`highlightWordAroundCursor` is enabled, the word at the cursor\nitself will be highlighted with `\"cm-selectionMatch-main\"`.\n*/\nfunction highlightSelectionMatches(options) {\n let ext = [defaultTheme, matchHighlighter];\n if (options)\n ext.push(highlightConfig.of(options));\n return ext;\n}\nconst matchDeco = /*@__PURE__*/Decoration.mark({ class: \"cm-selectionMatch\" });\nconst mainMatchDeco = /*@__PURE__*/Decoration.mark({ class: \"cm-selectionMatch cm-selectionMatch-main\" });\n// Whether the characters directly outside the given positions are non-word characters\nfunction insideWordBoundaries(check, state, from, to) {\n return (from == 0 || check(state.sliceDoc(from - 1, from)) != CharCategory.Word) &&\n (to == state.doc.length || check(state.sliceDoc(to, to + 1)) != CharCategory.Word);\n}\n// Whether the characters directly at the given positions are word characters\nfunction insideWord(check, state, from, to) {\n return check(state.sliceDoc(from, from + 1)) == CharCategory.Word\n && check(state.sliceDoc(to - 1, to)) == CharCategory.Word;\n}\nconst matchHighlighter = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.decorations = this.getDeco(view);\n }\n update(update) {\n if (update.selectionSet || update.docChanged || update.viewportChanged)\n this.decorations = this.getDeco(update.view);\n }\n getDeco(view) {\n let conf = view.state.facet(highlightConfig);\n let { state } = view, sel = state.selection;\n if (sel.ranges.length > 1)\n return Decoration.none;\n let range = sel.main, query, check = null;\n if (range.empty) {\n if (!conf.highlightWordAroundCursor)\n return Decoration.none;\n let word = state.wordAt(range.head);\n if (!word)\n return Decoration.none;\n check = state.charCategorizer(range.head);\n query = state.sliceDoc(word.from, word.to);\n }\n else {\n let len = range.to - range.from;\n if (len < conf.minSelectionLength || len > 200)\n return Decoration.none;\n if (conf.wholeWords) {\n query = state.sliceDoc(range.from, range.to); // TODO: allow and include leading/trailing space?\n check = state.charCategorizer(range.head);\n if (!(insideWordBoundaries(check, state, range.from, range.to) &&\n insideWord(check, state, range.from, range.to)))\n return Decoration.none;\n }\n else {\n query = state.sliceDoc(range.from, range.to);\n if (!query)\n return Decoration.none;\n }\n }\n let deco = [];\n for (let part of view.visibleRanges) {\n let cursor = new SearchCursor(state.doc, query, part.from, part.to);\n while (!cursor.next().done) {\n let { from, to } = cursor.value;\n if (!check || insideWordBoundaries(check, state, from, to)) {\n if (range.empty && from <= range.from && to >= range.to)\n deco.push(mainMatchDeco.range(from, to));\n else if (from >= range.to || to <= range.from)\n deco.push(matchDeco.range(from, to));\n if (deco.length > conf.maxMatches)\n return Decoration.none;\n }\n }\n }\n return Decoration.set(deco);\n }\n}, {\n decorations: v => v.decorations\n});\nconst defaultTheme = /*@__PURE__*/EditorView.baseTheme({\n \".cm-selectionMatch\": { backgroundColor: \"#99ff7780\" },\n \".cm-searchMatch .cm-selectionMatch\": { backgroundColor: \"transparent\" }\n});\n// Select the words around the cursors.\nconst selectWord = ({ state, dispatch }) => {\n let { selection } = state;\n let newSel = EditorSelection.create(selection.ranges.map(range => state.wordAt(range.head) || EditorSelection.cursor(range.head)), selection.mainIndex);\n if (newSel.eq(selection))\n return false;\n dispatch(state.update({ selection: newSel }));\n return true;\n};\n// Find next occurrence of query relative to last cursor. Wrap around\n// the document if there are no more matches.\nfunction findNextOccurrence(state, query) {\n let { main, ranges } = state.selection;\n let word = state.wordAt(main.head), fullWord = word && word.from == main.from && word.to == main.to;\n for (let cycled = false, cursor = new SearchCursor(state.doc, query, ranges[ranges.length - 1].to);;) {\n cursor.next();\n if (cursor.done) {\n if (cycled)\n return null;\n cursor = new SearchCursor(state.doc, query, 0, Math.max(0, ranges[ranges.length - 1].from - 1));\n cycled = true;\n }\n else {\n if (cycled && ranges.some(r => r.from == cursor.value.from))\n continue;\n if (fullWord) {\n let word = state.wordAt(cursor.value.from);\n if (!word || word.from != cursor.value.from || word.to != cursor.value.to)\n continue;\n }\n return cursor.value;\n }\n }\n}\n/**\nSelect next occurrence of the current selection. Expand selection\nto the surrounding word when the selection is empty.\n*/\nconst selectNextOccurrence = ({ state, dispatch }) => {\n let { ranges } = state.selection;\n if (ranges.some(sel => sel.from === sel.to))\n return selectWord({ state, dispatch });\n let searchedText = state.sliceDoc(ranges[0].from, ranges[0].to);\n if (state.selection.ranges.some(r => state.sliceDoc(r.from, r.to) != searchedText))\n return false;\n let range = findNextOccurrence(state, searchedText);\n if (!range)\n return false;\n dispatch(state.update({\n selection: state.selection.addRange(EditorSelection.range(range.from, range.to), false),\n effects: EditorView.scrollIntoView(range.to)\n }));\n return true;\n};\n\nconst searchConfigFacet = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n top: false,\n caseSensitive: false,\n literal: false,\n regexp: false,\n wholeWord: false,\n createPanel: view => new SearchPanel(view),\n scrollToMatch: range => EditorView.scrollIntoView(range)\n });\n }\n});\n/**\nAdd search state to the editor configuration, and optionally\nconfigure the search extension.\n([`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) will automatically\nenable this if it isn't already on).\n*/\nfunction search(config) {\n return config ? [searchConfigFacet.of(config), searchExtensions] : searchExtensions;\n}\n/**\nA search query. Part of the editor's search state.\n*/\nclass SearchQuery {\n /**\n Create a query object.\n */\n constructor(config) {\n this.search = config.search;\n this.caseSensitive = !!config.caseSensitive;\n this.literal = !!config.literal;\n this.regexp = !!config.regexp;\n this.replace = config.replace || \"\";\n this.valid = !!this.search && (!this.regexp || validRegExp(this.search));\n this.unquoted = this.unquote(this.search);\n this.wholeWord = !!config.wholeWord;\n }\n /**\n @internal\n */\n unquote(text) {\n return this.literal ? text :\n text.replace(/\\\\([nrt\\\\])/g, (_, ch) => ch == \"n\" ? \"\\n\" : ch == \"r\" ? \"\\r\" : ch == \"t\" ? \"\\t\" : \"\\\\\");\n }\n /**\n Compare this query to another query.\n */\n eq(other) {\n return this.search == other.search && this.replace == other.replace &&\n this.caseSensitive == other.caseSensitive && this.regexp == other.regexp &&\n this.wholeWord == other.wholeWord;\n }\n /**\n @internal\n */\n create() {\n return this.regexp ? new RegExpQuery(this) : new StringQuery(this);\n }\n /**\n Get a search cursor for this query, searching through the given\n range in the given state.\n */\n getCursor(state, from = 0, to) {\n let st = state.doc ? state : EditorState.create({ doc: state });\n if (to == null)\n to = st.doc.length;\n return this.regexp ? regexpCursor(this, st, from, to) : stringCursor(this, st, from, to);\n }\n}\nclass QueryType {\n constructor(spec) {\n this.spec = spec;\n }\n}\nfunction stringCursor(spec, state, from, to) {\n return new SearchCursor(state.doc, spec.unquoted, from, to, spec.caseSensitive ? undefined : x => x.toLowerCase(), spec.wholeWord ? stringWordTest(state.doc, state.charCategorizer(state.selection.main.head)) : undefined);\n}\nfunction stringWordTest(doc, categorizer) {\n return (from, to, buf, bufPos) => {\n if (bufPos > from || bufPos + buf.length < to) {\n bufPos = Math.max(0, from - 2);\n buf = doc.sliceString(bufPos, Math.min(doc.length, to + 2));\n }\n return (categorizer(charBefore(buf, from - bufPos)) != CharCategory.Word ||\n categorizer(charAfter(buf, from - bufPos)) != CharCategory.Word) &&\n (categorizer(charAfter(buf, to - bufPos)) != CharCategory.Word ||\n categorizer(charBefore(buf, to - bufPos)) != CharCategory.Word);\n };\n}\nclass StringQuery extends QueryType {\n constructor(spec) {\n super(spec);\n }\n nextMatch(state, curFrom, curTo) {\n let cursor = stringCursor(this.spec, state, curTo, state.doc.length).nextOverlapping();\n if (cursor.done)\n cursor = stringCursor(this.spec, state, 0, curFrom).nextOverlapping();\n return cursor.done ? null : cursor.value;\n }\n // Searching in reverse is, rather than implementing an inverted search\n // cursor, done by scanning chunk after chunk forward.\n prevMatchInRange(state, from, to) {\n for (let pos = to;;) {\n let start = Math.max(from, pos - 10000 /* FindPrev.ChunkSize */ - this.spec.unquoted.length);\n let cursor = stringCursor(this.spec, state, start, pos), range = null;\n while (!cursor.nextOverlapping().done)\n range = cursor.value;\n if (range)\n return range;\n if (start == from)\n return null;\n pos -= 10000 /* FindPrev.ChunkSize */;\n }\n }\n prevMatch(state, curFrom, curTo) {\n return this.prevMatchInRange(state, 0, curFrom) ||\n this.prevMatchInRange(state, curTo, state.doc.length);\n }\n getReplacement(_result) { return this.spec.unquote(this.spec.replace); }\n matchAll(state, limit) {\n let cursor = stringCursor(this.spec, state, 0, state.doc.length), ranges = [];\n while (!cursor.next().done) {\n if (ranges.length >= limit)\n return null;\n ranges.push(cursor.value);\n }\n return ranges;\n }\n highlight(state, from, to, add) {\n let cursor = stringCursor(this.spec, state, Math.max(0, from - this.spec.unquoted.length), Math.min(to + this.spec.unquoted.length, state.doc.length));\n while (!cursor.next().done)\n add(cursor.value.from, cursor.value.to);\n }\n}\nfunction regexpCursor(spec, state, from, to) {\n return new RegExpCursor(state.doc, spec.search, {\n ignoreCase: !spec.caseSensitive,\n test: spec.wholeWord ? regexpWordTest(state.charCategorizer(state.selection.main.head)) : undefined\n }, from, to);\n}\nfunction charBefore(str, index) {\n return str.slice(findClusterBreak(str, index, false), index);\n}\nfunction charAfter(str, index) {\n return str.slice(index, findClusterBreak(str, index));\n}\nfunction regexpWordTest(categorizer) {\n return (_from, _to, match) => !match[0].length ||\n (categorizer(charBefore(match.input, match.index)) != CharCategory.Word ||\n categorizer(charAfter(match.input, match.index)) != CharCategory.Word) &&\n (categorizer(charAfter(match.input, match.index + match[0].length)) != CharCategory.Word ||\n categorizer(charBefore(match.input, match.index + match[0].length)) != CharCategory.Word);\n}\nclass RegExpQuery extends QueryType {\n nextMatch(state, curFrom, curTo) {\n let cursor = regexpCursor(this.spec, state, curTo, state.doc.length).next();\n if (cursor.done)\n cursor = regexpCursor(this.spec, state, 0, curFrom).next();\n return cursor.done ? null : cursor.value;\n }\n prevMatchInRange(state, from, to) {\n for (let size = 1;; size++) {\n let start = Math.max(from, to - size * 10000 /* FindPrev.ChunkSize */);\n let cursor = regexpCursor(this.spec, state, start, to), range = null;\n while (!cursor.next().done)\n range = cursor.value;\n if (range && (start == from || range.from > start + 10))\n return range;\n if (start == from)\n return null;\n }\n }\n prevMatch(state, curFrom, curTo) {\n return this.prevMatchInRange(state, 0, curFrom) ||\n this.prevMatchInRange(state, curTo, state.doc.length);\n }\n getReplacement(result) {\n return this.spec.unquote(this.spec.replace).replace(/\\$([$&\\d+])/g, (m, i) => i == \"$\" ? \"$\"\n : i == \"&\" ? result.match[0]\n : i != \"0\" && +i < result.match.length ? result.match[i]\n : m);\n }\n matchAll(state, limit) {\n let cursor = regexpCursor(this.spec, state, 0, state.doc.length), ranges = [];\n while (!cursor.next().done) {\n if (ranges.length >= limit)\n return null;\n ranges.push(cursor.value);\n }\n return ranges;\n }\n highlight(state, from, to, add) {\n let cursor = regexpCursor(this.spec, state, Math.max(0, from - 250 /* RegExp.HighlightMargin */), Math.min(to + 250 /* RegExp.HighlightMargin */, state.doc.length));\n while (!cursor.next().done)\n add(cursor.value.from, cursor.value.to);\n }\n}\n/**\nA state effect that updates the current search query. Note that\nthis only has an effect if the search state has been initialized\n(by including [`search`](https://codemirror.net/6/docs/ref/#search.search) in your configuration or\nby running [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) at least\nonce).\n*/\nconst setSearchQuery = /*@__PURE__*/StateEffect.define();\nconst togglePanel = /*@__PURE__*/StateEffect.define();\nconst searchState = /*@__PURE__*/StateField.define({\n create(state) {\n return new SearchState(defaultQuery(state).create(), null);\n },\n update(value, tr) {\n for (let effect of tr.effects) {\n if (effect.is(setSearchQuery))\n value = new SearchState(effect.value.create(), value.panel);\n else if (effect.is(togglePanel))\n value = new SearchState(value.query, effect.value ? createSearchPanel : null);\n }\n return value;\n },\n provide: f => showPanel.from(f, val => val.panel)\n});\n/**\nGet the current search query from an editor state.\n*/\nfunction getSearchQuery(state) {\n let curState = state.field(searchState, false);\n return curState ? curState.query.spec : defaultQuery(state);\n}\n/**\nQuery whether the search panel is open in the given editor state.\n*/\nfunction searchPanelOpen(state) {\n var _a;\n return ((_a = state.field(searchState, false)) === null || _a === void 0 ? void 0 : _a.panel) != null;\n}\nclass SearchState {\n constructor(query, panel) {\n this.query = query;\n this.panel = panel;\n }\n}\nconst matchMark = /*@__PURE__*/Decoration.mark({ class: \"cm-searchMatch\" }), selectedMatchMark = /*@__PURE__*/Decoration.mark({ class: \"cm-searchMatch cm-searchMatch-selected\" });\nconst searchHighlighter = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.decorations = this.highlight(view.state.field(searchState));\n }\n update(update) {\n let state = update.state.field(searchState);\n if (state != update.startState.field(searchState) || update.docChanged || update.selectionSet || update.viewportChanged)\n this.decorations = this.highlight(state);\n }\n highlight({ query, panel }) {\n if (!panel || !query.spec.valid)\n return Decoration.none;\n let { view } = this;\n let builder = new RangeSetBuilder();\n for (let i = 0, ranges = view.visibleRanges, l = ranges.length; i < l; i++) {\n let { from, to } = ranges[i];\n while (i < l - 1 && to > ranges[i + 1].from - 2 * 250 /* RegExp.HighlightMargin */)\n to = ranges[++i].to;\n query.highlight(view.state, from, to, (from, to) => {\n let selected = view.state.selection.ranges.some(r => r.from == from && r.to == to);\n builder.add(from, to, selected ? selectedMatchMark : matchMark);\n });\n }\n return builder.finish();\n }\n}, {\n decorations: v => v.decorations\n});\nfunction searchCommand(f) {\n return view => {\n let state = view.state.field(searchState, false);\n return state && state.query.spec.valid ? f(view, state) : openSearchPanel(view);\n };\n}\n/**\nOpen the search panel if it isn't already open, and move the\nselection to the first match after the current main selection.\nWill wrap around to the start of the document when it reaches the\nend.\n*/\nconst findNext = /*@__PURE__*/searchCommand((view, { query }) => {\n let { to } = view.state.selection.main;\n let next = query.nextMatch(view.state, to, to);\n if (!next)\n return false;\n let selection = EditorSelection.single(next.from, next.to);\n let config = view.state.facet(searchConfigFacet);\n view.dispatch({\n selection,\n effects: [announceMatch(view, next), config.scrollToMatch(selection.main, view)],\n userEvent: \"select.search\"\n });\n selectSearchInput(view);\n return true;\n});\n/**\nMove the selection to the previous instance of the search query,\nbefore the current main selection. Will wrap past the start\nof the document to start searching at the end again.\n*/\nconst findPrevious = /*@__PURE__*/searchCommand((view, { query }) => {\n let { state } = view, { from } = state.selection.main;\n let prev = query.prevMatch(state, from, from);\n if (!prev)\n return false;\n let selection = EditorSelection.single(prev.from, prev.to);\n let config = view.state.facet(searchConfigFacet);\n view.dispatch({\n selection,\n effects: [announceMatch(view, prev), config.scrollToMatch(selection.main, view)],\n userEvent: \"select.search\"\n });\n selectSearchInput(view);\n return true;\n});\n/**\nSelect all instances of the search query.\n*/\nconst selectMatches = /*@__PURE__*/searchCommand((view, { query }) => {\n let ranges = query.matchAll(view.state, 1000);\n if (!ranges || !ranges.length)\n return false;\n view.dispatch({\n selection: EditorSelection.create(ranges.map(r => EditorSelection.range(r.from, r.to))),\n userEvent: \"select.search.matches\"\n });\n return true;\n});\n/**\nSelect all instances of the currently selected text.\n*/\nconst selectSelectionMatches = ({ state, dispatch }) => {\n let sel = state.selection;\n if (sel.ranges.length > 1 || sel.main.empty)\n return false;\n let { from, to } = sel.main;\n let ranges = [], main = 0;\n for (let cur = new SearchCursor(state.doc, state.sliceDoc(from, to)); !cur.next().done;) {\n if (ranges.length > 1000)\n return false;\n if (cur.value.from == from)\n main = ranges.length;\n ranges.push(EditorSelection.range(cur.value.from, cur.value.to));\n }\n dispatch(state.update({\n selection: EditorSelection.create(ranges, main),\n userEvent: \"select.search.matches\"\n }));\n return true;\n};\n/**\nReplace the current match of the search query.\n*/\nconst replaceNext = /*@__PURE__*/searchCommand((view, { query }) => {\n let { state } = view, { from, to } = state.selection.main;\n if (state.readOnly)\n return false;\n let next = query.nextMatch(state, from, from);\n if (!next)\n return false;\n let changes = [], selection, replacement;\n let effects = [];\n if (next.from == from && next.to == to) {\n replacement = state.toText(query.getReplacement(next));\n changes.push({ from: next.from, to: next.to, insert: replacement });\n next = query.nextMatch(state, next.from, next.to);\n effects.push(EditorView.announce.of(state.phrase(\"replaced match on line $\", state.doc.lineAt(from).number) + \".\"));\n }\n if (next) {\n let off = changes.length == 0 || changes[0].from >= next.to ? 0 : next.to - next.from - replacement.length;\n selection = EditorSelection.single(next.from - off, next.to - off);\n effects.push(announceMatch(view, next));\n effects.push(state.facet(searchConfigFacet).scrollToMatch(selection.main, view));\n }\n view.dispatch({\n changes, selection, effects,\n userEvent: \"input.replace\"\n });\n return true;\n});\n/**\nReplace all instances of the search query with the given\nreplacement.\n*/\nconst replaceAll = /*@__PURE__*/searchCommand((view, { query }) => {\n if (view.state.readOnly)\n return false;\n let changes = query.matchAll(view.state, 1e9).map(match => {\n let { from, to } = match;\n return { from, to, insert: query.getReplacement(match) };\n });\n if (!changes.length)\n return false;\n let announceText = view.state.phrase(\"replaced $ matches\", changes.length) + \".\";\n view.dispatch({\n changes,\n effects: EditorView.announce.of(announceText),\n userEvent: \"input.replace.all\"\n });\n return true;\n});\nfunction createSearchPanel(view) {\n return view.state.facet(searchConfigFacet).createPanel(view);\n}\nfunction defaultQuery(state, fallback) {\n var _a, _b, _c, _d, _e;\n let sel = state.selection.main;\n let selText = sel.empty || sel.to > sel.from + 100 ? \"\" : state.sliceDoc(sel.from, sel.to);\n if (fallback && !selText)\n return fallback;\n let config = state.facet(searchConfigFacet);\n return new SearchQuery({\n search: ((_a = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _a !== void 0 ? _a : config.literal) ? selText : selText.replace(/\\n/g, \"\\\\n\"),\n caseSensitive: (_b = fallback === null || fallback === void 0 ? void 0 : fallback.caseSensitive) !== null && _b !== void 0 ? _b : config.caseSensitive,\n literal: (_c = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _c !== void 0 ? _c : config.literal,\n regexp: (_d = fallback === null || fallback === void 0 ? void 0 : fallback.regexp) !== null && _d !== void 0 ? _d : config.regexp,\n wholeWord: (_e = fallback === null || fallback === void 0 ? void 0 : fallback.wholeWord) !== null && _e !== void 0 ? _e : config.wholeWord\n });\n}\nfunction getSearchInput(view) {\n let panel = getPanel(view, createSearchPanel);\n return panel && panel.dom.querySelector(\"[main-field]\");\n}\nfunction selectSearchInput(view) {\n let input = getSearchInput(view);\n if (input && input == view.root.activeElement)\n input.select();\n}\n/**\nMake sure the search panel is open and focused.\n*/\nconst openSearchPanel = view => {\n let state = view.state.field(searchState, false);\n if (state && state.panel) {\n let searchInput = getSearchInput(view);\n if (searchInput && searchInput != view.root.activeElement) {\n let query = defaultQuery(view.state, state.query.spec);\n if (query.valid)\n view.dispatch({ effects: setSearchQuery.of(query) });\n searchInput.focus();\n searchInput.select();\n }\n }\n else {\n view.dispatch({ effects: [\n togglePanel.of(true),\n state ? setSearchQuery.of(defaultQuery(view.state, state.query.spec)) : StateEffect.appendConfig.of(searchExtensions)\n ] });\n }\n return true;\n};\n/**\nClose the search panel.\n*/\nconst closeSearchPanel = view => {\n let state = view.state.field(searchState, false);\n if (!state || !state.panel)\n return false;\n let panel = getPanel(view, createSearchPanel);\n if (panel && panel.dom.contains(view.root.activeElement))\n view.focus();\n view.dispatch({ effects: togglePanel.of(false) });\n return true;\n};\n/**\nDefault search-related key bindings.\n\n - Mod-f: [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel)\n - F3, Mod-g: [`findNext`](https://codemirror.net/6/docs/ref/#search.findNext)\n - Shift-F3, Shift-Mod-g: [`findPrevious`](https://codemirror.net/6/docs/ref/#search.findPrevious)\n - Mod-Alt-g: [`gotoLine`](https://codemirror.net/6/docs/ref/#search.gotoLine)\n - Mod-d: [`selectNextOccurrence`](https://codemirror.net/6/docs/ref/#search.selectNextOccurrence)\n*/\nconst searchKeymap = [\n { key: \"Mod-f\", run: openSearchPanel, scope: \"editor search-panel\" },\n { key: \"F3\", run: findNext, shift: findPrevious, scope: \"editor search-panel\", preventDefault: true },\n { key: \"Mod-g\", run: findNext, shift: findPrevious, scope: \"editor search-panel\", preventDefault: true },\n { key: \"Escape\", run: closeSearchPanel, scope: \"editor search-panel\" },\n { key: \"Mod-Shift-l\", run: selectSelectionMatches },\n { key: \"Mod-Alt-g\", run: gotoLine },\n { key: \"Mod-d\", run: selectNextOccurrence, preventDefault: true },\n];\nclass SearchPanel {\n constructor(view) {\n this.view = view;\n let query = this.query = view.state.field(searchState).query.spec;\n this.commit = this.commit.bind(this);\n this.searchField = elt(\"input\", {\n value: query.search,\n placeholder: phrase(view, \"Find\"),\n \"aria-label\": phrase(view, \"Find\"),\n class: \"cm-textfield\",\n name: \"search\",\n form: \"\",\n \"main-field\": \"true\",\n onchange: this.commit,\n onkeyup: this.commit\n });\n this.replaceField = elt(\"input\", {\n value: query.replace,\n placeholder: phrase(view, \"Replace\"),\n \"aria-label\": phrase(view, \"Replace\"),\n class: \"cm-textfield\",\n name: \"replace\",\n form: \"\",\n onchange: this.commit,\n onkeyup: this.commit\n });\n this.caseField = elt(\"input\", {\n type: \"checkbox\",\n name: \"case\",\n form: \"\",\n checked: query.caseSensitive,\n onchange: this.commit\n });\n this.reField = elt(\"input\", {\n type: \"checkbox\",\n name: \"re\",\n form: \"\",\n checked: query.regexp,\n onchange: this.commit\n });\n this.wordField = elt(\"input\", {\n type: \"checkbox\",\n name: \"word\",\n form: \"\",\n checked: query.wholeWord,\n onchange: this.commit\n });\n function button(name, onclick, content) {\n return elt(\"button\", { class: \"cm-button\", name, onclick, type: \"button\" }, content);\n }\n this.dom = elt(\"div\", { onkeydown: (e) => this.keydown(e), class: \"cm-search\" }, [\n this.searchField,\n button(\"next\", () => findNext(view), [phrase(view, \"next\")]),\n button(\"prev\", () => findPrevious(view), [phrase(view, \"previous\")]),\n button(\"select\", () => selectMatches(view), [phrase(view, \"all\")]),\n elt(\"label\", null, [this.caseField, phrase(view, \"match case\")]),\n elt(\"label\", null, [this.reField, phrase(view, \"regexp\")]),\n elt(\"label\", null, [this.wordField, phrase(view, \"by word\")]),\n ...view.state.readOnly ? [] : [\n elt(\"br\"),\n this.replaceField,\n button(\"replace\", () => replaceNext(view), [phrase(view, \"replace\")]),\n button(\"replaceAll\", () => replaceAll(view), [phrase(view, \"replace all\")])\n ],\n elt(\"button\", {\n name: \"close\",\n onclick: () => closeSearchPanel(view),\n \"aria-label\": phrase(view, \"close\"),\n type: \"button\"\n }, [\"×\"])\n ]);\n }\n commit() {\n let query = new SearchQuery({\n search: this.searchField.value,\n caseSensitive: this.caseField.checked,\n regexp: this.reField.checked,\n wholeWord: this.wordField.checked,\n replace: this.replaceField.value,\n });\n if (!query.eq(this.query)) {\n this.query = query;\n this.view.dispatch({ effects: setSearchQuery.of(query) });\n }\n }\n keydown(e) {\n if (runScopeHandlers(this.view, e, \"search-panel\")) {\n e.preventDefault();\n }\n else if (e.keyCode == 13 && e.target == this.searchField) {\n e.preventDefault();\n (e.shiftKey ? findPrevious : findNext)(this.view);\n }\n else if (e.keyCode == 13 && e.target == this.replaceField) {\n e.preventDefault();\n replaceNext(this.view);\n }\n }\n update(update) {\n for (let tr of update.transactions)\n for (let effect of tr.effects) {\n if (effect.is(setSearchQuery) && !effect.value.eq(this.query))\n this.setQuery(effect.value);\n }\n }\n setQuery(query) {\n this.query = query;\n this.searchField.value = query.search;\n this.replaceField.value = query.replace;\n this.caseField.checked = query.caseSensitive;\n this.reField.checked = query.regexp;\n this.wordField.checked = query.wholeWord;\n }\n mount() {\n this.searchField.select();\n }\n get pos() { return 80; }\n get top() { return this.view.state.facet(searchConfigFacet).top; }\n}\nfunction phrase(view, phrase) { return view.state.phrase(phrase); }\nconst AnnounceMargin = 30;\nconst Break = /[\\s\\.,:;?!]/;\nfunction announceMatch(view, { from, to }) {\n let line = view.state.doc.lineAt(from), lineEnd = view.state.doc.lineAt(to).to;\n let start = Math.max(line.from, from - AnnounceMargin), end = Math.min(lineEnd, to + AnnounceMargin);\n let text = view.state.sliceDoc(start, end);\n if (start != line.from) {\n for (let i = 0; i < AnnounceMargin; i++)\n if (!Break.test(text[i + 1]) && Break.test(text[i])) {\n text = text.slice(i);\n break;\n }\n }\n if (end != lineEnd) {\n for (let i = text.length - 1; i > text.length - AnnounceMargin; i--)\n if (!Break.test(text[i - 1]) && Break.test(text[i])) {\n text = text.slice(0, i);\n break;\n }\n }\n return EditorView.announce.of(`${view.state.phrase(\"current match\")}. ${text} ${view.state.phrase(\"on line\")} ${line.number}.`);\n}\nconst baseTheme = /*@__PURE__*/EditorView.baseTheme({\n \".cm-panel.cm-search\": {\n padding: \"2px 6px 4px\",\n position: \"relative\",\n \"& [name=close]\": {\n position: \"absolute\",\n top: \"0\",\n right: \"4px\",\n backgroundColor: \"inherit\",\n border: \"none\",\n font: \"inherit\",\n padding: 0,\n margin: 0\n },\n \"& input, & button, & label\": {\n margin: \".2em .6em .2em 0\"\n },\n \"& input[type=checkbox]\": {\n marginRight: \".2em\"\n },\n \"& label\": {\n fontSize: \"80%\",\n whiteSpace: \"pre\"\n }\n },\n \"&light .cm-searchMatch\": { backgroundColor: \"#ffff0054\" },\n \"&dark .cm-searchMatch\": { backgroundColor: \"#00ffff8a\" },\n \"&light .cm-searchMatch-selected\": { backgroundColor: \"#ff6a0054\" },\n \"&dark .cm-searchMatch-selected\": { backgroundColor: \"#ff00ff8a\" }\n});\nconst searchExtensions = [\n searchState,\n /*@__PURE__*/Prec.low(searchHighlighter),\n baseTheme\n];\n\nexport { RegExpCursor, SearchCursor, SearchQuery, closeSearchPanel, findNext, findPrevious, getSearchQuery, gotoLine, highlightSelectionMatches, openSearchPanel, replaceAll, replaceNext, search, searchKeymap, searchPanelOpen, selectMatches, selectNextOccurrence, selectSelectionMatches, setSearchQuery };\n","import { Decoration, showPanel, EditorView, ViewPlugin, logException, gutter, showTooltip, hoverTooltip, getPanel, WidgetType, GutterMarker } from '@codemirror/view';\nimport { StateEffect, StateField, Facet, combineConfig, RangeSet } from '@codemirror/state';\nimport elt from 'crelt';\n\nclass SelectedDiagnostic {\n constructor(from, to, diagnostic) {\n this.from = from;\n this.to = to;\n this.diagnostic = diagnostic;\n }\n}\nclass LintState {\n constructor(diagnostics, panel, selected) {\n this.diagnostics = diagnostics;\n this.panel = panel;\n this.selected = selected;\n }\n static init(diagnostics, panel, state) {\n // Filter the list of diagnostics for which to create markers\n let markedDiagnostics = diagnostics;\n let diagnosticFilter = state.facet(lintConfig).markerFilter;\n if (diagnosticFilter)\n markedDiagnostics = diagnosticFilter(markedDiagnostics, state);\n let ranges = Decoration.set(markedDiagnostics.map((d) => {\n // For zero-length ranges or ranges covering only a line break, create a widget\n return d.from == d.to || (d.from == d.to - 1 && state.doc.lineAt(d.from).to == d.from)\n ? Decoration.widget({\n widget: new DiagnosticWidget(d),\n diagnostic: d\n }).range(d.from)\n : Decoration.mark({\n attributes: { class: \"cm-lintRange cm-lintRange-\" + d.severity + (d.markClass ? \" \" + d.markClass : \"\") },\n diagnostic: d,\n inclusive: true\n }).range(d.from, d.to);\n }), true);\n return new LintState(ranges, panel, findDiagnostic(ranges));\n }\n}\nfunction findDiagnostic(diagnostics, diagnostic = null, after = 0) {\n let found = null;\n diagnostics.between(after, 1e9, (from, to, { spec }) => {\n if (diagnostic && spec.diagnostic != diagnostic)\n return;\n found = new SelectedDiagnostic(from, to, spec.diagnostic);\n return false;\n });\n return found;\n}\nfunction hideTooltip(tr, tooltip) {\n let line = tr.startState.doc.lineAt(tooltip.pos);\n return !!(tr.effects.some(e => e.is(setDiagnosticsEffect)) || tr.changes.touchesRange(line.from, line.to));\n}\nfunction maybeEnableLint(state, effects) {\n return state.field(lintState, false) ? effects : effects.concat(StateEffect.appendConfig.of(lintExtensions));\n}\n/**\nReturns a transaction spec which updates the current set of\ndiagnostics, and enables the lint extension if if wasn't already\nactive.\n*/\nfunction setDiagnostics(state, diagnostics) {\n return {\n effects: maybeEnableLint(state, [setDiagnosticsEffect.of(diagnostics)])\n };\n}\n/**\nThe state effect that updates the set of active diagnostics. Can\nbe useful when writing an extension that needs to track these.\n*/\nconst setDiagnosticsEffect = /*@__PURE__*/StateEffect.define();\nconst togglePanel = /*@__PURE__*/StateEffect.define();\nconst movePanelSelection = /*@__PURE__*/StateEffect.define();\nconst lintState = /*@__PURE__*/StateField.define({\n create() {\n return new LintState(Decoration.none, null, null);\n },\n update(value, tr) {\n if (tr.docChanged) {\n let mapped = value.diagnostics.map(tr.changes), selected = null;\n if (value.selected) {\n let selPos = tr.changes.mapPos(value.selected.from, 1);\n selected = findDiagnostic(mapped, value.selected.diagnostic, selPos) || findDiagnostic(mapped, null, selPos);\n }\n value = new LintState(mapped, value.panel, selected);\n }\n for (let effect of tr.effects) {\n if (effect.is(setDiagnosticsEffect)) {\n value = LintState.init(effect.value, value.panel, tr.state);\n }\n else if (effect.is(togglePanel)) {\n value = new LintState(value.diagnostics, effect.value ? LintPanel.open : null, value.selected);\n }\n else if (effect.is(movePanelSelection)) {\n value = new LintState(value.diagnostics, value.panel, effect.value);\n }\n }\n return value;\n },\n provide: f => [showPanel.from(f, val => val.panel),\n EditorView.decorations.from(f, s => s.diagnostics)]\n});\n/**\nReturns the number of active lint diagnostics in the given state.\n*/\nfunction diagnosticCount(state) {\n let lint = state.field(lintState, false);\n return lint ? lint.diagnostics.size : 0;\n}\nconst activeMark = /*@__PURE__*/Decoration.mark({ class: \"cm-lintRange cm-lintRange-active\", inclusive: true });\nfunction lintTooltip(view, pos, side) {\n let { diagnostics } = view.state.field(lintState);\n let found = [], stackStart = 2e8, stackEnd = 0;\n diagnostics.between(pos - (side < 0 ? 1 : 0), pos + (side > 0 ? 1 : 0), (from, to, { spec }) => {\n if (pos >= from && pos <= to &&\n (from == to || ((pos > from || side > 0) && (pos < to || side < 0)))) {\n found.push(spec.diagnostic);\n stackStart = Math.min(from, stackStart);\n stackEnd = Math.max(to, stackEnd);\n }\n });\n let diagnosticFilter = view.state.facet(lintConfig).tooltipFilter;\n if (diagnosticFilter)\n found = diagnosticFilter(found, view.state);\n if (!found.length)\n return null;\n return {\n pos: stackStart,\n end: stackEnd,\n above: view.state.doc.lineAt(stackStart).to < stackEnd,\n create() {\n return { dom: diagnosticsTooltip(view, found) };\n }\n };\n}\nfunction diagnosticsTooltip(view, diagnostics) {\n return elt(\"ul\", { class: \"cm-tooltip-lint\" }, diagnostics.map(d => renderDiagnostic(view, d, false)));\n}\n/**\nCommand to open and focus the lint panel.\n*/\nconst openLintPanel = (view) => {\n let field = view.state.field(lintState, false);\n if (!field || !field.panel)\n view.dispatch({ effects: maybeEnableLint(view.state, [togglePanel.of(true)]) });\n let panel = getPanel(view, LintPanel.open);\n if (panel)\n panel.dom.querySelector(\".cm-panel-lint ul\").focus();\n return true;\n};\n/**\nCommand to close the lint panel, when open.\n*/\nconst closeLintPanel = (view) => {\n let field = view.state.field(lintState, false);\n if (!field || !field.panel)\n return false;\n view.dispatch({ effects: togglePanel.of(false) });\n return true;\n};\n/**\nMove the selection to the next diagnostic.\n*/\nconst nextDiagnostic = (view) => {\n let field = view.state.field(lintState, false);\n if (!field)\n return false;\n let sel = view.state.selection.main, next = field.diagnostics.iter(sel.to + 1);\n if (!next.value) {\n next = field.diagnostics.iter(0);\n if (!next.value || next.from == sel.from && next.to == sel.to)\n return false;\n }\n view.dispatch({ selection: { anchor: next.from, head: next.to }, scrollIntoView: true });\n return true;\n};\n/**\nMove the selection to the previous diagnostic.\n*/\nconst previousDiagnostic = (view) => {\n let { state } = view, field = state.field(lintState, false);\n if (!field)\n return false;\n let sel = state.selection.main;\n let prevFrom, prevTo, lastFrom, lastTo;\n field.diagnostics.between(0, state.doc.length, (from, to) => {\n if (to < sel.to && (prevFrom == null || prevFrom < from)) {\n prevFrom = from;\n prevTo = to;\n }\n if (lastFrom == null || from > lastFrom) {\n lastFrom = from;\n lastTo = to;\n }\n });\n if (lastFrom == null || prevFrom == null && lastFrom == sel.from)\n return false;\n view.dispatch({ selection: { anchor: prevFrom !== null && prevFrom !== void 0 ? prevFrom : lastFrom, head: prevTo !== null && prevTo !== void 0 ? prevTo : lastTo }, scrollIntoView: true });\n return true;\n};\n/**\nA set of default key bindings for the lint functionality.\n\n- Ctrl-Shift-m (Cmd-Shift-m on macOS): [`openLintPanel`](https://codemirror.net/6/docs/ref/#lint.openLintPanel)\n- F8: [`nextDiagnostic`](https://codemirror.net/6/docs/ref/#lint.nextDiagnostic)\n*/\nconst lintKeymap = [\n { key: \"Mod-Shift-m\", run: openLintPanel, preventDefault: true },\n { key: \"F8\", run: nextDiagnostic }\n];\nconst lintPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.timeout = -1;\n this.set = true;\n let { delay } = view.state.facet(lintConfig);\n this.lintTime = Date.now() + delay;\n this.run = this.run.bind(this);\n this.timeout = setTimeout(this.run, delay);\n }\n run() {\n let now = Date.now();\n if (now < this.lintTime - 10) {\n this.timeout = setTimeout(this.run, this.lintTime - now);\n }\n else {\n this.set = false;\n let { state } = this.view, { sources } = state.facet(lintConfig);\n if (sources.length)\n Promise.all(sources.map(source => Promise.resolve(source(this.view)))).then(annotations => {\n let all = annotations.reduce((a, b) => a.concat(b));\n if (this.view.state.doc == state.doc)\n this.view.dispatch(setDiagnostics(this.view.state, all));\n }, error => { logException(this.view.state, error); });\n }\n }\n update(update) {\n let config = update.state.facet(lintConfig);\n if (update.docChanged || config != update.startState.facet(lintConfig) ||\n config.needsRefresh && config.needsRefresh(update)) {\n this.lintTime = Date.now() + config.delay;\n if (!this.set) {\n this.set = true;\n this.timeout = setTimeout(this.run, config.delay);\n }\n }\n }\n force() {\n if (this.set) {\n this.lintTime = Date.now();\n this.run();\n }\n }\n destroy() {\n clearTimeout(this.timeout);\n }\n});\nconst lintConfig = /*@__PURE__*/Facet.define({\n combine(input) {\n return Object.assign({ sources: input.map(i => i.source).filter(x => x != null) }, combineConfig(input.map(i => i.config), {\n delay: 750,\n markerFilter: null,\n tooltipFilter: null,\n needsRefresh: null\n }, {\n needsRefresh: (a, b) => !a ? b : !b ? a : u => a(u) || b(u)\n }));\n }\n});\n/**\nGiven a diagnostic source, this function returns an extension that\nenables linting with that source. It will be called whenever the\neditor is idle (after its content changed). If `null` is given as\nsource, this only configures the lint extension.\n*/\nfunction linter(source, config = {}) {\n return [\n lintConfig.of({ source, config }),\n lintPlugin,\n lintExtensions\n ];\n}\n/**\nForces any linters [configured](https://codemirror.net/6/docs/ref/#lint.linter) to run when the\neditor is idle to run right away.\n*/\nfunction forceLinting(view) {\n let plugin = view.plugin(lintPlugin);\n if (plugin)\n plugin.force();\n}\nfunction assignKeys(actions) {\n let assigned = [];\n if (actions)\n actions: for (let { name } of actions) {\n for (let i = 0; i < name.length; i++) {\n let ch = name[i];\n if (/[a-zA-Z]/.test(ch) && !assigned.some(c => c.toLowerCase() == ch.toLowerCase())) {\n assigned.push(ch);\n continue actions;\n }\n }\n assigned.push(\"\");\n }\n return assigned;\n}\nfunction renderDiagnostic(view, diagnostic, inPanel) {\n var _a;\n let keys = inPanel ? assignKeys(diagnostic.actions) : [];\n return elt(\"li\", { class: \"cm-diagnostic cm-diagnostic-\" + diagnostic.severity }, elt(\"span\", { class: \"cm-diagnosticText\" }, diagnostic.renderMessage ? diagnostic.renderMessage() : diagnostic.message), (_a = diagnostic.actions) === null || _a === void 0 ? void 0 : _a.map((action, i) => {\n let fired = false, click = (e) => {\n e.preventDefault();\n if (fired)\n return;\n fired = true;\n let found = findDiagnostic(view.state.field(lintState).diagnostics, diagnostic);\n if (found)\n action.apply(view, found.from, found.to);\n };\n let { name } = action, keyIndex = keys[i] ? name.indexOf(keys[i]) : -1;\n let nameElt = keyIndex < 0 ? name : [name.slice(0, keyIndex),\n elt(\"u\", name.slice(keyIndex, keyIndex + 1)),\n name.slice(keyIndex + 1)];\n return elt(\"button\", {\n type: \"button\",\n class: \"cm-diagnosticAction\",\n onclick: click,\n onmousedown: click,\n \"aria-label\": ` Action: ${name}${keyIndex < 0 ? \"\" : ` (access key \"${keys[i]})\"`}.`\n }, nameElt);\n }), diagnostic.source && elt(\"div\", { class: \"cm-diagnosticSource\" }, diagnostic.source));\n}\nclass DiagnosticWidget extends WidgetType {\n constructor(diagnostic) {\n super();\n this.diagnostic = diagnostic;\n }\n eq(other) { return other.diagnostic == this.diagnostic; }\n toDOM() {\n return elt(\"span\", { class: \"cm-lintPoint cm-lintPoint-\" + this.diagnostic.severity });\n }\n}\nclass PanelItem {\n constructor(view, diagnostic) {\n this.diagnostic = diagnostic;\n this.id = \"item_\" + Math.floor(Math.random() * 0xffffffff).toString(16);\n this.dom = renderDiagnostic(view, diagnostic, true);\n this.dom.id = this.id;\n this.dom.setAttribute(\"role\", \"option\");\n }\n}\nclass LintPanel {\n constructor(view) {\n this.view = view;\n this.items = [];\n let onkeydown = (event) => {\n if (event.keyCode == 27) { // Escape\n closeLintPanel(this.view);\n this.view.focus();\n }\n else if (event.keyCode == 38 || event.keyCode == 33) { // ArrowUp, PageUp\n this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);\n }\n else if (event.keyCode == 40 || event.keyCode == 34) { // ArrowDown, PageDown\n this.moveSelection((this.selectedIndex + 1) % this.items.length);\n }\n else if (event.keyCode == 36) { // Home\n this.moveSelection(0);\n }\n else if (event.keyCode == 35) { // End\n this.moveSelection(this.items.length - 1);\n }\n else if (event.keyCode == 13) { // Enter\n this.view.focus();\n }\n else if (event.keyCode >= 65 && event.keyCode <= 90 && this.selectedIndex >= 0) { // A-Z\n let { diagnostic } = this.items[this.selectedIndex], keys = assignKeys(diagnostic.actions);\n for (let i = 0; i < keys.length; i++)\n if (keys[i].toUpperCase().charCodeAt(0) == event.keyCode) {\n let found = findDiagnostic(this.view.state.field(lintState).diagnostics, diagnostic);\n if (found)\n diagnostic.actions[i].apply(view, found.from, found.to);\n }\n }\n else {\n return;\n }\n event.preventDefault();\n };\n let onclick = (event) => {\n for (let i = 0; i < this.items.length; i++) {\n if (this.items[i].dom.contains(event.target))\n this.moveSelection(i);\n }\n };\n this.list = elt(\"ul\", {\n tabIndex: 0,\n role: \"listbox\",\n \"aria-label\": this.view.state.phrase(\"Diagnostics\"),\n onkeydown,\n onclick\n });\n this.dom = elt(\"div\", { class: \"cm-panel-lint\" }, this.list, elt(\"button\", {\n type: \"button\",\n name: \"close\",\n \"aria-label\": this.view.state.phrase(\"close\"),\n onclick: () => closeLintPanel(this.view)\n }, \"×\"));\n this.update();\n }\n get selectedIndex() {\n let selected = this.view.state.field(lintState).selected;\n if (!selected)\n return -1;\n for (let i = 0; i < this.items.length; i++)\n if (this.items[i].diagnostic == selected.diagnostic)\n return i;\n return -1;\n }\n update() {\n let { diagnostics, selected } = this.view.state.field(lintState);\n let i = 0, needsSync = false, newSelectedItem = null;\n diagnostics.between(0, this.view.state.doc.length, (_start, _end, { spec }) => {\n let found = -1, item;\n for (let j = i; j < this.items.length; j++)\n if (this.items[j].diagnostic == spec.diagnostic) {\n found = j;\n break;\n }\n if (found < 0) {\n item = new PanelItem(this.view, spec.diagnostic);\n this.items.splice(i, 0, item);\n needsSync = true;\n }\n else {\n item = this.items[found];\n if (found > i) {\n this.items.splice(i, found - i);\n needsSync = true;\n }\n }\n if (selected && item.diagnostic == selected.diagnostic) {\n if (!item.dom.hasAttribute(\"aria-selected\")) {\n item.dom.setAttribute(\"aria-selected\", \"true\");\n newSelectedItem = item;\n }\n }\n else if (item.dom.hasAttribute(\"aria-selected\")) {\n item.dom.removeAttribute(\"aria-selected\");\n }\n i++;\n });\n while (i < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0)) {\n needsSync = true;\n this.items.pop();\n }\n if (this.items.length == 0) {\n this.items.push(new PanelItem(this.view, {\n from: -1, to: -1,\n severity: \"info\",\n message: this.view.state.phrase(\"No diagnostics\")\n }));\n needsSync = true;\n }\n if (newSelectedItem) {\n this.list.setAttribute(\"aria-activedescendant\", newSelectedItem.id);\n this.view.requestMeasure({\n key: this,\n read: () => ({ sel: newSelectedItem.dom.getBoundingClientRect(), panel: this.list.getBoundingClientRect() }),\n write: ({ sel, panel }) => {\n let scaleY = panel.height / this.list.offsetHeight;\n if (sel.top < panel.top)\n this.list.scrollTop -= (panel.top - sel.top) / scaleY;\n else if (sel.bottom > panel.bottom)\n this.list.scrollTop += (sel.bottom - panel.bottom) / scaleY;\n }\n });\n }\n else if (this.selectedIndex < 0) {\n this.list.removeAttribute(\"aria-activedescendant\");\n }\n if (needsSync)\n this.sync();\n }\n sync() {\n let domPos = this.list.firstChild;\n function rm() {\n let prev = domPos;\n domPos = prev.nextSibling;\n prev.remove();\n }\n for (let item of this.items) {\n if (item.dom.parentNode == this.list) {\n while (domPos != item.dom)\n rm();\n domPos = item.dom.nextSibling;\n }\n else {\n this.list.insertBefore(item.dom, domPos);\n }\n }\n while (domPos)\n rm();\n }\n moveSelection(selectedIndex) {\n if (this.selectedIndex < 0)\n return;\n let field = this.view.state.field(lintState);\n let selection = findDiagnostic(field.diagnostics, this.items[selectedIndex].diagnostic);\n if (!selection)\n return;\n this.view.dispatch({\n selection: { anchor: selection.from, head: selection.to },\n scrollIntoView: true,\n effects: movePanelSelection.of(selection)\n });\n }\n static open(view) { return new LintPanel(view); }\n}\nfunction svg(content, attrs = `viewBox=\"0 0 40 40\"`) {\n return `url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" ${attrs}>${encodeURIComponent(content)}</svg>')`;\n}\nfunction underline(color) {\n return svg(`<path d=\"m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0\" stroke=\"${color}\" fill=\"none\" stroke-width=\".7\"/>`, `width=\"6\" height=\"3\"`);\n}\nconst baseTheme = /*@__PURE__*/EditorView.baseTheme({\n \".cm-diagnostic\": {\n padding: \"3px 6px 3px 8px\",\n marginLeft: \"-1px\",\n display: \"block\",\n whiteSpace: \"pre-wrap\"\n },\n \".cm-diagnostic-error\": { borderLeft: \"5px solid #d11\" },\n \".cm-diagnostic-warning\": { borderLeft: \"5px solid orange\" },\n \".cm-diagnostic-info\": { borderLeft: \"5px solid #999\" },\n \".cm-diagnostic-hint\": { borderLeft: \"5px solid #66d\" },\n \".cm-diagnosticAction\": {\n font: \"inherit\",\n border: \"none\",\n padding: \"2px 4px\",\n backgroundColor: \"#444\",\n color: \"white\",\n borderRadius: \"3px\",\n marginLeft: \"8px\",\n cursor: \"pointer\"\n },\n \".cm-diagnosticSource\": {\n fontSize: \"70%\",\n opacity: .7\n },\n \".cm-lintRange\": {\n backgroundPosition: \"left bottom\",\n backgroundRepeat: \"repeat-x\",\n paddingBottom: \"0.7px\",\n },\n \".cm-lintRange-error\": { backgroundImage: /*@__PURE__*/underline(\"#d11\") },\n \".cm-lintRange-warning\": { backgroundImage: /*@__PURE__*/underline(\"orange\") },\n \".cm-lintRange-info\": { backgroundImage: /*@__PURE__*/underline(\"#999\") },\n \".cm-lintRange-hint\": { backgroundImage: /*@__PURE__*/underline(\"#66d\") },\n \".cm-lintRange-active\": { backgroundColor: \"#ffdd9980\" },\n \".cm-tooltip-lint\": {\n padding: 0,\n margin: 0\n },\n \".cm-lintPoint\": {\n position: \"relative\",\n \"&:after\": {\n content: '\"\"',\n position: \"absolute\",\n bottom: 0,\n left: \"-2px\",\n borderLeft: \"3px solid transparent\",\n borderRight: \"3px solid transparent\",\n borderBottom: \"4px solid #d11\"\n }\n },\n \".cm-lintPoint-warning\": {\n \"&:after\": { borderBottomColor: \"orange\" }\n },\n \".cm-lintPoint-info\": {\n \"&:after\": { borderBottomColor: \"#999\" }\n },\n \".cm-lintPoint-hint\": {\n \"&:after\": { borderBottomColor: \"#66d\" }\n },\n \".cm-panel.cm-panel-lint\": {\n position: \"relative\",\n \"& ul\": {\n maxHeight: \"100px\",\n overflowY: \"auto\",\n \"& [aria-selected]\": {\n backgroundColor: \"#ddd\",\n \"& u\": { textDecoration: \"underline\" }\n },\n \"&:focus [aria-selected]\": {\n background_fallback: \"#bdf\",\n backgroundColor: \"Highlight\",\n color_fallback: \"white\",\n color: \"HighlightText\"\n },\n \"& u\": { textDecoration: \"none\" },\n padding: 0,\n margin: 0\n },\n \"& [name=close]\": {\n position: \"absolute\",\n top: \"0\",\n right: \"2px\",\n background: \"inherit\",\n border: \"none\",\n font: \"inherit\",\n padding: 0,\n margin: 0\n }\n }\n});\nfunction severityWeight(sev) {\n return sev == \"error\" ? 4 : sev == \"warning\" ? 3 : sev == \"info\" ? 2 : 1;\n}\nclass LintGutterMarker extends GutterMarker {\n constructor(diagnostics) {\n super();\n this.diagnostics = diagnostics;\n this.severity = diagnostics.reduce((max, d) => severityWeight(max) < severityWeight(d.severity) ? d.severity : max, \"hint\");\n }\n toDOM(view) {\n let elt = document.createElement(\"div\");\n elt.className = \"cm-lint-marker cm-lint-marker-\" + this.severity;\n let diagnostics = this.diagnostics;\n let diagnosticsFilter = view.state.facet(lintGutterConfig).tooltipFilter;\n if (diagnosticsFilter)\n diagnostics = diagnosticsFilter(diagnostics, view.state);\n if (diagnostics.length)\n elt.onmouseover = () => gutterMarkerMouseOver(view, elt, diagnostics);\n return elt;\n }\n}\nfunction trackHoverOn(view, marker) {\n let mousemove = (event) => {\n let rect = marker.getBoundingClientRect();\n if (event.clientX > rect.left - 10 /* Hover.Margin */ && event.clientX < rect.right + 10 /* Hover.Margin */ &&\n event.clientY > rect.top - 10 /* Hover.Margin */ && event.clientY < rect.bottom + 10 /* Hover.Margin */)\n return;\n for (let target = event.target; target; target = target.parentNode) {\n if (target.nodeType == 1 && target.classList.contains(\"cm-tooltip-lint\"))\n return;\n }\n window.removeEventListener(\"mousemove\", mousemove);\n if (view.state.field(lintGutterTooltip))\n view.dispatch({ effects: setLintGutterTooltip.of(null) });\n };\n window.addEventListener(\"mousemove\", mousemove);\n}\nfunction gutterMarkerMouseOver(view, marker, diagnostics) {\n function hovered() {\n let line = view.elementAtHeight(marker.getBoundingClientRect().top + 5 - view.documentTop);\n const linePos = view.coordsAtPos(line.from);\n if (linePos) {\n view.dispatch({ effects: setLintGutterTooltip.of({\n pos: line.from,\n above: false,\n create() {\n return {\n dom: diagnosticsTooltip(view, diagnostics),\n getCoords: () => marker.getBoundingClientRect()\n };\n }\n }) });\n }\n marker.onmouseout = marker.onmousemove = null;\n trackHoverOn(view, marker);\n }\n let { hoverTime } = view.state.facet(lintGutterConfig);\n let hoverTimeout = setTimeout(hovered, hoverTime);\n marker.onmouseout = () => {\n clearTimeout(hoverTimeout);\n marker.onmouseout = marker.onmousemove = null;\n };\n marker.onmousemove = () => {\n clearTimeout(hoverTimeout);\n hoverTimeout = setTimeout(hovered, hoverTime);\n };\n}\nfunction markersForDiagnostics(doc, diagnostics) {\n let byLine = Object.create(null);\n for (let diagnostic of diagnostics) {\n let line = doc.lineAt(diagnostic.from);\n (byLine[line.from] || (byLine[line.from] = [])).push(diagnostic);\n }\n let markers = [];\n for (let line in byLine) {\n markers.push(new LintGutterMarker(byLine[line]).range(+line));\n }\n return RangeSet.of(markers, true);\n}\nconst lintGutterExtension = /*@__PURE__*/gutter({\n class: \"cm-gutter-lint\",\n markers: view => view.state.field(lintGutterMarkers),\n});\nconst lintGutterMarkers = /*@__PURE__*/StateField.define({\n create() {\n return RangeSet.empty;\n },\n update(markers, tr) {\n markers = markers.map(tr.changes);\n let diagnosticFilter = tr.state.facet(lintGutterConfig).markerFilter;\n for (let effect of tr.effects) {\n if (effect.is(setDiagnosticsEffect)) {\n let diagnostics = effect.value;\n if (diagnosticFilter)\n diagnostics = diagnosticFilter(diagnostics || [], tr.state);\n markers = markersForDiagnostics(tr.state.doc, diagnostics.slice(0));\n }\n }\n return markers;\n }\n});\nconst setLintGutterTooltip = /*@__PURE__*/StateEffect.define();\nconst lintGutterTooltip = /*@__PURE__*/StateField.define({\n create() { return null; },\n update(tooltip, tr) {\n if (tooltip && tr.docChanged)\n tooltip = hideTooltip(tr, tooltip) ? null : Object.assign(Object.assign({}, tooltip), { pos: tr.changes.mapPos(tooltip.pos) });\n return tr.effects.reduce((t, e) => e.is(setLintGutterTooltip) ? e.value : t, tooltip);\n },\n provide: field => showTooltip.from(field)\n});\nconst lintGutterTheme = /*@__PURE__*/EditorView.baseTheme({\n \".cm-gutter-lint\": {\n width: \"1.4em\",\n \"& .cm-gutterElement\": {\n padding: \".2em\"\n }\n },\n \".cm-lint-marker\": {\n width: \"1em\",\n height: \"1em\"\n },\n \".cm-lint-marker-info\": {\n content: /*@__PURE__*/svg(`<path fill=\"#aaf\" stroke=\"#77e\" stroke-width=\"6\" stroke-linejoin=\"round\" d=\"M5 5L35 5L35 35L5 35Z\"/>`)\n },\n \".cm-lint-marker-warning\": {\n content: /*@__PURE__*/svg(`<path fill=\"#fe8\" stroke=\"#fd7\" stroke-width=\"6\" stroke-linejoin=\"round\" d=\"M20 6L37 35L3 35Z\"/>`),\n },\n \".cm-lint-marker-error\": {\n content: /*@__PURE__*/svg(`<circle cx=\"20\" cy=\"20\" r=\"15\" fill=\"#f87\" stroke=\"#f43\" stroke-width=\"6\"/>`)\n },\n});\nconst lintExtensions = [\n lintState,\n /*@__PURE__*/EditorView.decorations.compute([lintState], state => {\n let { selected, panel } = state.field(lintState);\n return !selected || !panel || selected.from == selected.to ? Decoration.none : Decoration.set([\n activeMark.range(selected.from, selected.to)\n ]);\n }),\n /*@__PURE__*/hoverTooltip(lintTooltip, { hideOn: hideTooltip }),\n baseTheme\n];\nconst lintGutterConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n hoverTime: 300 /* Hover.Time */,\n markerFilter: null,\n tooltipFilter: null\n });\n }\n});\n/**\nReturns an extension that installs a gutter showing markers for\neach line that has diagnostics, which can be hovered over to see\nthe diagnostics.\n*/\nfunction lintGutter(config = {}) {\n return [lintGutterConfig.of(config), lintGutterMarkers, lintGutterExtension, lintGutterTheme, lintGutterTooltip];\n}\n/**\nIterate over the marked diagnostics for the given editor state,\ncalling `f` for each of them. Note that, if the document changed\nsince the diagnostics were created, the `Diagnostic` object will\nhold the original outdated position, whereas the `to` and `from`\narguments hold the diagnostic's current position.\n*/\nfunction forEachDiagnostic(state, f) {\n let lState = state.field(lintState, false);\n if (lState && lState.diagnostics.size)\n for (let iter = RangeSet.iter([lState.diagnostics]); iter.value; iter.next())\n f(iter.value.spec.diagnostic, iter.from, iter.to);\n}\n\nexport { closeLintPanel, diagnosticCount, forEachDiagnostic, forceLinting, lintGutter, lintKeymap, linter, nextDiagnostic, openLintPanel, previousDiagnostic, setDiagnostics, setDiagnosticsEffect };\n","import { lineNumbers, highlightActiveLineGutter, highlightSpecialChars, drawSelection, dropCursor, rectangularSelection, crosshairCursor, highlightActiveLine, keymap } from '@codemirror/view';\nexport { EditorView } from '@codemirror/view';\nimport { EditorState } from '@codemirror/state';\nimport { foldGutter, indentOnInput, syntaxHighlighting, defaultHighlightStyle, bracketMatching, foldKeymap } from '@codemirror/language';\nimport { history, defaultKeymap, historyKeymap } from '@codemirror/commands';\nimport { highlightSelectionMatches, searchKeymap } from '@codemirror/search';\nimport { closeBrackets, autocompletion, closeBracketsKeymap, completionKeymap } from '@codemirror/autocomplete';\nimport { lintKeymap } from '@codemirror/lint';\n\n// (The superfluous function calls around the list of extensions work\n// around current limitations in tree-shaking software.)\n/**\nThis is an extension value that just pulls together a number of\nextensions that you might want in a basic editor. It is meant as a\nconvenient helper to quickly set up CodeMirror without installing\nand importing a lot of separate packages.\n\nSpecifically, it includes...\n\n - [the default command bindings](https://codemirror.net/6/docs/ref/#commands.defaultKeymap)\n - [line numbers](https://codemirror.net/6/docs/ref/#view.lineNumbers)\n - [special character highlighting](https://codemirror.net/6/docs/ref/#view.highlightSpecialChars)\n - [the undo history](https://codemirror.net/6/docs/ref/#commands.history)\n - [a fold gutter](https://codemirror.net/6/docs/ref/#language.foldGutter)\n - [custom selection drawing](https://codemirror.net/6/docs/ref/#view.drawSelection)\n - [drop cursor](https://codemirror.net/6/docs/ref/#view.dropCursor)\n - [multiple selections](https://codemirror.net/6/docs/ref/#state.EditorState^allowMultipleSelections)\n - [reindentation on input](https://codemirror.net/6/docs/ref/#language.indentOnInput)\n - [the default highlight style](https://codemirror.net/6/docs/ref/#language.defaultHighlightStyle) (as fallback)\n - [bracket matching](https://codemirror.net/6/docs/ref/#language.bracketMatching)\n - [bracket closing](https://codemirror.net/6/docs/ref/#autocomplete.closeBrackets)\n - [autocompletion](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion)\n - [rectangular selection](https://codemirror.net/6/docs/ref/#view.rectangularSelection) and [crosshair cursor](https://codemirror.net/6/docs/ref/#view.crosshairCursor)\n - [active line highlighting](https://codemirror.net/6/docs/ref/#view.highlightActiveLine)\n - [active line gutter highlighting](https://codemirror.net/6/docs/ref/#view.highlightActiveLineGutter)\n - [selection match highlighting](https://codemirror.net/6/docs/ref/#search.highlightSelectionMatches)\n - [search](https://codemirror.net/6/docs/ref/#search.searchKeymap)\n - [linting](https://codemirror.net/6/docs/ref/#lint.lintKeymap)\n\n(You'll probably want to add some language package to your setup\ntoo.)\n\nThis extension does not allow customization. The idea is that,\nonce you decide you want to configure your editor more precisely,\nyou take this package's source (which is just a bunch of imports\nand an array literal), copy it into your own code, and adjust it\nas desired.\n*/\nconst basicSetup = /*@__PURE__*/(() => [\n lineNumbers(),\n highlightActiveLineGutter(),\n highlightSpecialChars(),\n history(),\n foldGutter(),\n drawSelection(),\n dropCursor(),\n EditorState.allowMultipleSelections.of(true),\n indentOnInput(),\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n bracketMatching(),\n closeBrackets(),\n autocompletion(),\n rectangularSelection(),\n crosshairCursor(),\n highlightActiveLine(),\n highlightSelectionMatches(),\n keymap.of([\n ...closeBracketsKeymap,\n ...defaultKeymap,\n ...searchKeymap,\n ...historyKeymap,\n ...foldKeymap,\n ...completionKeymap,\n ...lintKeymap\n ])\n])();\n/**\nA minimal set of extensions to create a functional editor. Only\nincludes [the default keymap](https://codemirror.net/6/docs/ref/#commands.defaultKeymap), [undo\nhistory](https://codemirror.net/6/docs/ref/#commands.history), [special character\nhighlighting](https://codemirror.net/6/docs/ref/#view.highlightSpecialChars), [custom selection\ndrawing](https://codemirror.net/6/docs/ref/#view.drawSelection), and [default highlight\nstyle](https://codemirror.net/6/docs/ref/#language.defaultHighlightStyle).\n*/\nconst minimalSetup = /*@__PURE__*/(() => [\n highlightSpecialChars(),\n history(),\n drawSelection(),\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n keymap.of([\n ...defaultKeymap,\n ...historyKeymap,\n ])\n])();\n\nexport { basicSetup, minimalSetup };\n"],"names":["crelt","elt","arguments","document","createElement","i","next","nodeType","Array","isArray","name","Object","prototype","hasOwnProperty","call","value","setAttribute","length","add","child","appendChild","createTextNode","RangeError","basicNormalize","String","normalize","x","SearchCursor","constructor","text","query","from","to","test","this","done","matches","buffer","bufferPos","iter","iterRange","bufferStart","peek","codePointAt","pop","nextOverlapping","str","fromCodePoint","start","codePointSize","norm","pos","code","charCodeAt","match","end","index","keep","splice","push","Symbol","iterator","empty","exec","baseFlags","unicode","RegExpCursor","options","curLine","MultilineRegExpCursor","re","RegExp","ignoreCase","startLine","lineAt","curLineStart","matchPos","toCharEnd","getLine","skip","lineBreak","slice","nextLine","off","lastIndex","flattened","WeakMap","FlattenedDoc","get","doc","cached","flat","sliceString","set","cachedFrom","chunkEnd","line","createLineDialog","view","input","class","state","selection","main","head","number","go","sign","ln","cl","percent","col","pc","lines","Math","round","docLine","max","min","EditorSelection","cursor","dispatch","effects","dialogEffect","of","EditorView","scrollIntoView","y","focus","dom","onkeydown","event","keyCode","preventDefault","onsubmit","phrase","type","StateEffect","define","dialogField","StateField","create","update","tr","e","is","provide","f","showPanel","val","baseTheme$1","baseTheme","padding","fontSize","defaultHighlightOptions","highlightWordAroundCursor","minSelectionLength","maxMatches","wholeWords","highlightConfig","Facet","combine","combineConfig","a","b","matchDeco","Decoration","mark","mainMatchDeco","insideWordBoundaries","check","sliceDoc","CharCategory","Word","matchHighlighter","ViewPlugin","fromClass","decorations","getDeco","selectionSet","docChanged","viewportChanged","conf","facet","sel","ranges","none","range","word","wordAt","charCategorizer","len","insideWord","deco","part","visibleRanges","v","defaultTheme","backgroundColor","searchConfigFacet","configs","top","caseSensitive","literal","regexp","wholeWord","createPanel","SearchPanel","scrollToMatch","SearchQuery","config","search","replace","valid","source","_a","validRegExp","unquoted","unquote","_","ch","eq","other","RegExpQuery","StringQuery","getCursor","st","EditorState","regexpCursor","stringCursor","QueryType","spec","undefined","toLowerCase","categorizer","buf","bufPos","charBefore","charAfter","super","nextMatch","curFrom","curTo","prevMatchInRange","prevMatch","getReplacement","_result","matchAll","limit","highlight","_from","_to","findClusterBreak","size","result","m","setSearchQuery","togglePanel","searchState","SearchState","defaultQuery","effect","panel","createSearchPanel","matchMark","selectedMatchMark","searchHighlighter","field","startState","builder","RangeSetBuilder","l","selected","some","r","finish","searchCommand","openSearchPanel","findNext","single","announceMatch","userEvent","selectSearchInput","findPrevious","prev","selectMatches","map","replaceNext","readOnly","replacement","changes","toText","insert","announce","replaceAll","announceText","fallback","_b","_c","_d","_e","selText","getSearchInput","getPanel","querySelector","root","activeElement","select","searchInput","appendConfig","searchExtensions","closeSearchPanel","contains","searchKeymap","key","run","scope","shift","cur","newSel","mainIndex","selectWord","searchedText","fullWord","cycled","findNextOccurrence","addRange","button","onclick","content","commit","bind","searchField","placeholder","form","onchange","onkeyup","replaceField","caseField","checked","reField","wordField","keydown","runScopeHandlers","target","shiftKey","transactions","setQuery","mount","AnnounceMargin","Break","lineEnd","position","right","border","font","margin","marginRight","whiteSpace","Prec","low","SelectedDiagnostic","diagnostic","LintState","diagnostics","init","markedDiagnostics","diagnosticFilter","lintConfig","markerFilter","d","widget","DiagnosticWidget","attributes","severity","markClass","inclusive","findDiagnostic","after","found","between","setDiagnosticsEffect","movePanelSelection","lintState","mapped","selPos","mapPos","LintPanel","open","s","activeMark","lintTooltip","side","stackStart","stackEnd","tooltipFilter","above","diagnosticsTooltip","renderDiagnostic","closeLintPanel","lintKeymap","concat","lintExtensions","anchor","assign","sources","filter","delay","needsRefresh","u","assignKeys","actions","assigned","c","inPanel","keys","renderMessage","message","action","fired","click","apply","keyIndex","indexOf","nameElt","onmousedown","WidgetType","toDOM","PanelItem","id","floor","random","toString","items","list","tabIndex","role","moveSelection","selectedIndex","toUpperCase","needsSync","newSelectedItem","_start","_end","item","j","hasAttribute","removeAttribute","requestMeasure","read","getBoundingClientRect","write","scaleY","height","offsetHeight","scrollTop","bottom","sync","domPos","firstChild","rm","nextSibling","remove","parentNode","insertBefore","underline","color","attrs","encodeURIComponent","svg","marginLeft","display","borderLeft","borderRadius","opacity","backgroundPosition","backgroundRepeat","paddingBottom","backgroundImage","left","borderRight","borderBottom","borderBottomColor","maxHeight","overflowY","textDecoration","background_fallback","color_fallback","background","compute","hoverTooltip","hideOn","tooltip","touchesRange","basicSetup","lineNumbers","highlightActiveLineGutter","highlightSpecialChars","history","foldGutter","drawSelection","dropCursor","allowMultipleSelections","indentOnInput","syntaxHighlighting","defaultHighlightStyle","bracketMatching","closeBrackets","autocompletion","rectangularSelection","crosshairCursor","highlightActiveLine","keymap","closeBracketsKeymap","defaultKeymap","historyKeymap","foldKeymap","completionKeymap","minimalSetup"],"mappings":"yqBAAe,SAASA,IACtB,IAAIC,EAAMC,UAAU,GACF,iBAAPD,IAAiBA,EAAME,SAASC,cAAcH,IACzD,IAAII,EAAI,EAAGC,EAAOJ,UAAU,GAC5B,GAAII,GAAuB,iBAARA,GAAqC,MAAjBA,EAAKC,WAAqBC,MAAMC,QAAQH,GAAO,CACpF,IAAK,IAAII,KAAQJ,EAAM,GAAIK,OAAOC,UAAUC,eAAeC,KAAKR,EAAMI,GAAO,CAC3E,IAAIK,EAAQT,EAAKI,GACG,iBAATK,EAAmBd,EAAIe,aAAaN,EAAMK,GACnC,MAATA,IAAed,EAAIS,GAAQK,EACrC,CACDV,GACD,CACD,KAAOA,EAAIH,UAAUe,OAAQZ,IAAKa,EAAIjB,EAAKC,UAA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