import { s as __toESM } from "./chunk-BNovOVIE.js";
import { g as cn, h as Events } from "./button-Dj4BTre0.js";
import { t as require_react } from "./react-DA-nE2FX.js";
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
import { n as Copy, r as toast, t as copyToClipboard } from "./copy-DLf4aN7I.js";
import { t as Check } from "./check-BcUIXnUT.js";
import { t as require_jsx_runtime } from "./jsx-runtime-COBk7ree.js";
import { t as Tooltip } from "./tooltip-DRaMBu06.js";
import { $ as ViewPlugin, A as indentString, Bt as combineConfig, Ct as ChangeSet, D as getIndentation, E as getIndentUnit, Et as EditorSelection, Ft as StateField, H as NodeProp, Ht as findClusterBreak, I as syntaxTree, It as Text, Lt as Transaction, Mt as RangeSetBuilder, N as matchBrackets, Ot as Facet, Pt as StateEffect, St as ChangeDesc, Vt as countColumn, X as Direction, Y as Decoration, Z as EditorView, bt as crelt, et as WidgetType, it as getPanel, j as indentUnit, jt as RangeSet, o as IndentContext, pt as logException, ut as hoverTooltip, vt as showPanel, xt as Annotation } from "./dist-CCADb07R.js";
var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1);
const CopyClipboardIcon = (e5) => {
  let M = (0, import_compiler_runtime.c)(14), { value: N, className: R, buttonClassName: B, tooltip: V, toastTitle: H, ariaLabel: U } = e5, [W, G] = (0, import_react.useState)(false), K;
  M[0] !== H || M[1] !== N ? (K = Events.stopPropagation(async (e6) => {
    await copyToClipboard(typeof N == "function" ? N(e6) : N).then(() => {
      G(true), setTimeout(() => G(false), 2e3), H && toast({ title: H });
    });
  }), M[0] = H, M[1] = N, M[2] = K) : K = M[2];
  let q = K, J = U ?? "Copy to clipboard", Y;
  M[3] !== R || M[4] !== W ? (Y = W ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { className: cn(R, "text-(--grass-11)") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Copy, { className: R }), M[3] = R, M[4] = W, M[5] = Y) : Y = M[5];
  let X;
  M[6] !== B || M[7] !== q || M[8] !== J || M[9] !== Y ? (X = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
    type: "button",
    onClick: q,
    "aria-label": J,
    className: B,
    children: Y
  }), M[6] = B, M[7] = q, M[8] = J, M[9] = Y, M[10] = X) : X = M[10];
  let Z = X;
  if (V === false) return Z;
  let Q = W ? "Copied!" : V ?? "Copy to clipboard", $;
  return M[11] !== Z || M[12] !== Q ? ($ = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tooltip, {
    content: Q,
    delayDuration: 400,
    children: Z
  }), M[11] = Z, M[12] = Q, M[13] = $) : $ = M[13], $;
};
var toggleComment = (e5) => {
  let { state: A } = e5, j = A.doc.lineAt(A.selection.main.from), M = getConfig(e5.state, j.from);
  return M.line ? toggleLineComment(e5) : M.block ? toggleBlockCommentByLine(e5) : false;
};
function command(e5, A) {
  return ({ state: j, dispatch: M }) => {
    if (j.readOnly) return false;
    let N = e5(A, j);
    return N ? (M(j.update(N)), true) : false;
  };
}
var toggleLineComment = /* @__PURE__ */ command(changeLineComment, 0), toggleBlockComment = /* @__PURE__ */ command(changeBlockComment, 0), toggleBlockCommentByLine = /* @__PURE__ */ command((e5, A) => changeBlockComment(e5, A, selectedLineRanges(A)), 0);
function getConfig(e5, A) {
  let j = e5.languageDataAt("commentTokens", A, 1);
  return j.length ? j[0] : {};
}
var SearchMargin = 50;
function findBlockComment(e5, { open: A, close: j }, M, N) {
  let P = e5.sliceDoc(M - SearchMargin, M), F = e5.sliceDoc(N, N + SearchMargin), I = /\s*$/.exec(P)[0].length, L = /^\s*/.exec(F)[0].length, R = P.length - I;
  if (P.slice(R - A.length, R) == A && F.slice(L, L + j.length) == j) return {
    open: {
      pos: M - I,
      margin: I && 1
    },
    close: {
      pos: N + L,
      margin: L && 1
    }
  };
  let z, B;
  N - M <= 2 * SearchMargin ? z = B = e5.sliceDoc(M, N) : (z = e5.sliceDoc(M, M + SearchMargin), B = e5.sliceDoc(N - SearchMargin, N));
  let V = /^\s*/.exec(z)[0].length, H = /\s*$/.exec(B)[0].length, U = B.length - H - j.length;
  return z.slice(V, V + A.length) == A && B.slice(U, U + j.length) == j ? {
    open: {
      pos: M + V + A.length,
      margin: /\s/.test(z.charAt(V + A.length)) ? 1 : 0
    },
    close: {
      pos: N - H - j.length,
      margin: /\s/.test(B.charAt(U - 1)) ? 1 : 0
    }
  } : null;
}
function selectedLineRanges(e5) {
  let A = [];
  for (let j of e5.selection.ranges) {
    let M = e5.doc.lineAt(j.from), N = j.to <= M.to ? M : e5.doc.lineAt(j.to);
    N.from > M.from && N.from == j.to && (N = j.to == M.to + 1 ? M : e5.doc.lineAt(j.to - 1));
    let P = A.length - 1;
    P >= 0 && A[P].to > M.from ? A[P].to = N.to : A.push({
      from: M.from + /^\s*/.exec(M.text)[0].length,
      to: N.to
    });
  }
  return A;
}
function changeBlockComment(e5, A, j = A.selection.ranges) {
  let M = j.map((e6) => getConfig(A, e6.from).block);
  if (!M.every((e6) => e6)) return null;
  let N = j.map((e6, j2) => findBlockComment(A, M[j2], e6.from, e6.to));
  if (e5 != 2 && !N.every((e6) => e6)) return { changes: A.changes(j.map((e6, A2) => N[A2] ? [] : [{
    from: e6.from,
    insert: M[A2].open + " "
  }, {
    from: e6.to,
    insert: " " + M[A2].close
  }])) };
  if (e5 != 1 && N.some((e6) => e6)) {
    let e6 = [];
    for (let A2 = 0, j2; A2 < N.length; A2++) if (j2 = N[A2]) {
      let N2 = M[A2], { open: P, close: F } = j2;
      e6.push({
        from: P.pos - N2.open.length,
        to: P.pos + P.margin
      }, {
        from: F.pos - F.margin,
        to: F.pos + N2.close.length
      });
    }
    return { changes: e6 };
  }
  return null;
}
function changeLineComment(e5, A, j = A.selection.ranges) {
  let M = [], N = -1;
  ranges: for (let { from: e6, to: P } of j) {
    let j2 = M.length, F = 1e9, I;
    for (let j3 = e6; j3 <= P; ) {
      let L = A.doc.lineAt(j3);
      if (I == null && (I = getConfig(A, L.from).line, !I)) continue ranges;
      if (L.from > N && (e6 == P || P > L.from)) {
        N = L.from;
        let e7 = /^\s*/.exec(L.text)[0].length, A2 = e7 == L.length, j4 = L.text.slice(e7, e7 + I.length) == I ? e7 : -1;
        e7 < L.text.length && e7 < F && (F = e7), M.push({
          line: L,
          comment: j4,
          token: I,
          indent: e7,
          empty: A2,
          single: false
        });
      }
      j3 = L.to + 1;
    }
    if (F < 1e9) for (let e7 = j2; e7 < M.length; e7++) M[e7].indent < M[e7].line.text.length && (M[e7].indent = F);
    M.length == j2 + 1 && (M[j2].single = true);
  }
  if (e5 != 2 && M.some((e6) => e6.comment < 0 && (!e6.empty || e6.single))) {
    let e6 = [];
    for (let { line: A2, token: j3, indent: N2, empty: P, single: F } of M) (F || !P) && e6.push({
      from: A2.from + N2,
      insert: j3 + " "
    });
    let j2 = A.changes(e6);
    return {
      changes: j2,
      selection: A.selection.map(j2, 1)
    };
  } else if (e5 != 1 && M.some((e6) => e6.comment >= 0)) {
    let e6 = [];
    for (let { line: A2, comment: j2, token: N2 } of M) if (j2 >= 0) {
      let M2 = A2.from + j2, P = M2 + N2.length;
      A2.text[P - A2.from] == " " && P++, e6.push({
        from: M2,
        to: P
      });
    }
    return { changes: e6 };
  }
  return null;
}
var fromHistory = /* @__PURE__ */ Annotation.define(), isolateHistory = /* @__PURE__ */ Annotation.define(), invertedEffects = /* @__PURE__ */ Facet.define(), historyConfig = /* @__PURE__ */ Facet.define({ combine(e5) {
  return combineConfig(e5, {
    minDepth: 100,
    newGroupDelay: 500,
    joinToEvent: (e6, A) => A
  }, {
    minDepth: Math.max,
    newGroupDelay: Math.min,
    joinToEvent: (e6, A) => (j, M) => e6(j, M) || A(j, M)
  });
} }), historyField_ = /* @__PURE__ */ StateField.define({
  create() {
    return HistoryState.empty;
  },
  update(e5, A) {
    let j = A.state.facet(historyConfig), M = A.annotation(fromHistory);
    if (M) {
      let N2 = HistEvent.fromTransaction(A, M.selection), P2 = M.side, F2 = P2 == 0 ? e5.undone : e5.done;
      return F2 = N2 ? updateBranch(F2, F2.length, j.minDepth, N2) : addSelection(F2, A.startState.selection), new HistoryState(P2 == 0 ? M.rest : F2, P2 == 0 ? F2 : M.rest);
    }
    let N = A.annotation(isolateHistory);
    if ((N == "full" || N == "before") && (e5 = e5.isolate()), A.annotation(Transaction.addToHistory) === false) return A.changes.empty ? e5 : e5.addMapping(A.changes.desc);
    let P = HistEvent.fromTransaction(A), F = A.annotation(Transaction.time), I = A.annotation(Transaction.userEvent);
    return P ? e5 = e5.addChanges(P, F, I, j, A) : A.selection && (e5 = e5.addSelection(A.startState.selection, F, I, j.newGroupDelay)), (N == "full" || N == "after") && (e5 = e5.isolate()), e5;
  },
  toJSON(e5) {
    return {
      done: e5.done.map((e6) => e6.toJSON()),
      undone: e5.undone.map((e6) => e6.toJSON())
    };
  },
  fromJSON(e5) {
    return new HistoryState(e5.done.map(HistEvent.fromJSON), e5.undone.map(HistEvent.fromJSON));
  }
});
function history(e5 = {}) {
  return [
    historyField_,
    historyConfig.of(e5),
    EditorView.domEventHandlers({ beforeinput(e6, A) {
      let j = e6.inputType == "historyUndo" ? undo : e6.inputType == "historyRedo" ? redo : null;
      return j ? (e6.preventDefault(), j(A)) : false;
    } })
  ];
}
var historyField = historyField_;
function cmd(e5, A) {
  return function({ state: j, dispatch: M }) {
    if (!A && j.readOnly) return false;
    let N = j.field(historyField_, false);
    if (!N) return false;
    let P = N.pop(e5, j, A);
    return P ? (M(P), true) : false;
  };
}
var undo = /* @__PURE__ */ cmd(0, false), redo = /* @__PURE__ */ cmd(1, false), undoSelection = /* @__PURE__ */ cmd(0, true), redoSelection = /* @__PURE__ */ cmd(1, true), HistEvent = class e {
  constructor(e5, A, j, M, N) {
    this.changes = e5, this.effects = A, this.mapped = j, this.startSelection = M, this.selectionsAfter = N;
  }
  setSelAfter(A) {
    return new e(this.changes, this.effects, this.mapped, this.startSelection, A);
  }
  toJSON() {
    var _a, _b, _c;
    return {
      changes: (_a = this.changes) == null ? void 0 : _a.toJSON(),
      mapped: (_b = this.mapped) == null ? void 0 : _b.toJSON(),
      startSelection: (_c = this.startSelection) == null ? void 0 : _c.toJSON(),
      selectionsAfter: this.selectionsAfter.map((e5) => e5.toJSON())
    };
  }
  static fromJSON(A) {
    return new e(A.changes && ChangeSet.fromJSON(A.changes), [], A.mapped && ChangeDesc.fromJSON(A.mapped), A.startSelection && EditorSelection.fromJSON(A.startSelection), A.selectionsAfter.map(EditorSelection.fromJSON));
  }
  static fromTransaction(A, j) {
    let M = none;
    for (let e5 of A.startState.facet(invertedEffects)) {
      let j2 = e5(A);
      j2.length && (M = M.concat(j2));
    }
    return !M.length && A.changes.empty ? null : new e(A.changes.invert(A.startState.doc), M, void 0, j || A.startState.selection, none);
  }
  static selection(A) {
    return new e(void 0, none, void 0, void 0, A);
  }
};
function updateBranch(e5, A, j, M) {
  let N = A + 1 > j + 20 ? A - j - 1 : 0, P = e5.slice(N, A);
  return P.push(M), P;
}
function isAdjacent(e5, A) {
  let j = [], M = false;
  return e5.iterChangedRanges((e6, A2) => j.push(e6, A2)), A.iterChangedRanges((e6, A2, N, P) => {
    for (let e7 = 0; e7 < j.length; ) {
      let A3 = j[e7++], F = j[e7++];
      P >= A3 && N <= F && (M = true);
    }
  }), M;
}
function eqSelectionShape(e5, A) {
  return e5.ranges.length == A.ranges.length && e5.ranges.filter((e6, j) => e6.empty != A.ranges[j].empty).length === 0;
}
function conc(e5, A) {
  return e5.length ? A.length ? e5.concat(A) : e5 : A;
}
var none = [], MaxSelectionsPerEvent = 200;
function addSelection(e5, A) {
  if (e5.length) {
    let j = e5[e5.length - 1], M = j.selectionsAfter.slice(Math.max(0, j.selectionsAfter.length - MaxSelectionsPerEvent));
    return M.length && M[M.length - 1].eq(A) ? e5 : (M.push(A), updateBranch(e5, e5.length - 1, 1e9, j.setSelAfter(M)));
  } else return [HistEvent.selection([A])];
}
function popSelection(e5) {
  let A = e5[e5.length - 1], j = e5.slice();
  return j[e5.length - 1] = A.setSelAfter(A.selectionsAfter.slice(0, A.selectionsAfter.length - 1)), j;
}
function addMappingToBranch(e5, A) {
  if (!e5.length) return e5;
  let j = e5.length, M = none;
  for (; j; ) {
    let N = mapEvent(e5[j - 1], A, M);
    if (N.changes && !N.changes.empty || N.effects.length) {
      let A2 = e5.slice(0, j);
      return A2[j - 1] = N, A2;
    } else A = N.mapped, j--, M = N.selectionsAfter;
  }
  return M.length ? [HistEvent.selection(M)] : none;
}
function mapEvent(e5, A, j) {
  let M = conc(e5.selectionsAfter.length ? e5.selectionsAfter.map((e6) => e6.map(A)) : none, j);
  if (!e5.changes) return HistEvent.selection(M);
  let N = e5.changes.map(A), P = A.mapDesc(e5.changes, true), F = e5.mapped ? e5.mapped.composeDesc(P) : P;
  return new HistEvent(N, StateEffect.mapEffects(e5.effects, A), F, e5.startSelection.map(P), M);
}
var joinableUserEvent = /^(input\.type|delete)($|\.)/, HistoryState = class e2 {
  constructor(e5, A, j = 0, M = void 0) {
    this.done = e5, this.undone = A, this.prevTime = j, this.prevUserEvent = M;
  }
  isolate() {
    return this.prevTime ? new e2(this.done, this.undone) : this;
  }
  addChanges(A, j, M, N, P) {
    let F = this.done, I = F[F.length - 1];
    return F = I && I.changes && !I.changes.empty && A.changes && (!M || joinableUserEvent.test(M)) && (!I.selectionsAfter.length && j - this.prevTime < N.newGroupDelay && N.joinToEvent(P, isAdjacent(I.changes, A.changes)) || M == "input.type.compose") ? updateBranch(F, F.length - 1, N.minDepth, new HistEvent(A.changes.compose(I.changes), conc(StateEffect.mapEffects(A.effects, I.changes), I.effects), I.mapped, I.startSelection, none)) : updateBranch(F, F.length, N.minDepth, A), new e2(F, none, j, M);
  }
  addSelection(A, j, M, N) {
    let P = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none;
    return P.length > 0 && j - this.prevTime < N && M == this.prevUserEvent && M && /^select($|\.)/.test(M) && eqSelectionShape(P[P.length - 1], A) ? this : new e2(addSelection(this.done, A), this.undone, j, M);
  }
  addMapping(A) {
    return new e2(addMappingToBranch(this.done, A), addMappingToBranch(this.undone, A), this.prevTime, this.prevUserEvent);
  }
  pop(e5, A, j) {
    let M = e5 == 0 ? this.done : this.undone;
    if (M.length == 0) return null;
    let N = M[M.length - 1], P = N.selectionsAfter[0] || (N.startSelection ? N.startSelection.map(N.changes.invertedDesc, 1) : A.selection);
    if (j && N.selectionsAfter.length) return A.update({
      selection: N.selectionsAfter[N.selectionsAfter.length - 1],
      annotations: fromHistory.of({
        side: e5,
        rest: popSelection(M),
        selection: P
      }),
      userEvent: e5 == 0 ? "select.undo" : "select.redo",
      scrollIntoView: true
    });
    if (N.changes) {
      let j2 = M.length == 1 ? none : M.slice(0, M.length - 1);
      return N.mapped && (j2 = addMappingToBranch(j2, N.mapped)), A.update({
        changes: N.changes,
        selection: N.startSelection,
        effects: N.effects,
        annotations: fromHistory.of({
          side: e5,
          rest: j2,
          selection: P
        }),
        filter: false,
        userEvent: e5 == 0 ? "undo" : "redo",
        scrollIntoView: true
      });
    } else return null;
  }
};
HistoryState.empty = /* @__PURE__ */ new HistoryState(none, none);
var historyKeymap = [
  {
    key: "Mod-z",
    run: undo,
    preventDefault: true
  },
  {
    key: "Mod-y",
    mac: "Mod-Shift-z",
    run: redo,
    preventDefault: true
  },
  {
    linux: "Ctrl-Shift-z",
    run: redo,
    preventDefault: true
  },
  {
    key: "Mod-u",
    run: undoSelection,
    preventDefault: true
  },
  {
    key: "Alt-u",
    mac: "Mod-Shift-u",
    run: redoSelection,
    preventDefault: true
  }
];
function updateSel(e5, A) {
  return EditorSelection.create(e5.ranges.map(A), e5.mainIndex);
}
function setSel(e5, A) {
  return e5.update({
    selection: A,
    scrollIntoView: true,
    userEvent: "select"
  });
}
function moveSel({ state: e5, dispatch: A }, j) {
  let M = updateSel(e5.selection, j);
  return M.eq(e5.selection, true) ? false : (A(setSel(e5, M)), true);
}
function rangeEnd(e5, A) {
  return EditorSelection.cursor(A ? e5.to : e5.from);
}
function cursorByChar(e5, A) {
  return moveSel(e5, (j) => j.empty ? e5.moveByChar(j, A) : rangeEnd(j, A));
}
function ltrAtCursor(e5) {
  return e5.textDirectionAt(e5.state.selection.main.head) == Direction.LTR;
}
var cursorCharLeft = (e5) => cursorByChar(e5, !ltrAtCursor(e5)), cursorCharRight = (e5) => cursorByChar(e5, ltrAtCursor(e5));
function cursorByGroup(e5, A) {
  return moveSel(e5, (j) => j.empty ? e5.moveByGroup(j, A) : rangeEnd(j, A));
}
var cursorGroupLeft = (e5) => cursorByGroup(e5, !ltrAtCursor(e5)), cursorGroupRight = (e5) => cursorByGroup(e5, ltrAtCursor(e5));
typeof Intl < "u" && Intl.Segmenter;
function interestingNode(e5, A, j) {
  if (A.type.prop(j)) return true;
  let M = A.to - A.from;
  return M && (M > 2 || /[^\s,.;:]/.test(e5.sliceDoc(A.from, A.to))) || A.firstChild;
}
function moveBySyntax(e5, A, j) {
  let M = syntaxTree(e5).resolveInner(A.head), N = j ? NodeProp.closedBy : NodeProp.openedBy;
  for (let P2 = A.head; ; ) {
    let A2 = j ? M.childAfter(P2) : M.childBefore(P2);
    if (!A2) break;
    interestingNode(e5, A2, N) ? M = A2 : P2 = j ? A2.to : A2.from;
  }
  let P = M.type.prop(N), F, I;
  return I = P && (F = j ? matchBrackets(e5, M.from, 1) : matchBrackets(e5, M.to, -1)) && F.matched ? j ? F.end.to : F.end.from : j ? M.to : M.from, EditorSelection.cursor(I, j ? -1 : 1);
}
var cursorSyntaxLeft = (e5) => moveSel(e5, (A) => moveBySyntax(e5.state, A, !ltrAtCursor(e5))), cursorSyntaxRight = (e5) => moveSel(e5, (A) => moveBySyntax(e5.state, A, ltrAtCursor(e5)));
function cursorByLine(e5, A) {
  return moveSel(e5, (j) => {
    if (!j.empty) return rangeEnd(j, A);
    let M = e5.moveVertically(j, A);
    return M.head == j.head ? e5.moveToLineBoundary(j, A) : M;
  });
}
var cursorLineUp = (e5) => cursorByLine(e5, false), cursorLineDown = (e5) => cursorByLine(e5, true);
function pageInfo(e5) {
  let A = e5.scrollDOM.clientHeight < e5.scrollDOM.scrollHeight - 2, j = 0, M = 0, N;
  if (A) {
    for (let A2 of e5.state.facet(EditorView.scrollMargins)) {
      let N2 = A2(e5);
      (N2 == null ? void 0 : N2.top) && (j = Math.max(N2 == null ? void 0 : N2.top, j)), (N2 == null ? void 0 : N2.bottom) && (M = Math.max(N2 == null ? void 0 : N2.bottom, M));
    }
    N = e5.scrollDOM.clientHeight - j - M;
  } else N = (e5.dom.ownerDocument.defaultView || window).innerHeight;
  return {
    marginTop: j,
    marginBottom: M,
    selfScroll: A,
    height: Math.max(e5.defaultLineHeight, N - 5)
  };
}
function cursorByPage(e5, A) {
  let j = pageInfo(e5), { state: M } = e5, N = updateSel(M.selection, (M2) => M2.empty ? e5.moveVertically(M2, A, j.height) : rangeEnd(M2, A));
  if (N.eq(M.selection)) return false;
  let P;
  if (j.selfScroll) {
    let A2 = e5.coordsAtPos(M.selection.main.head), F = e5.scrollDOM.getBoundingClientRect(), I = F.top + j.marginTop, L = F.bottom - j.marginBottom;
    A2 && A2.top > I && A2.bottom < L && (P = EditorView.scrollIntoView(N.main.head, {
      y: "start",
      yMargin: A2.top - I
    }));
  }
  return e5.dispatch(setSel(M, N), { effects: P }), true;
}
var cursorPageUp = (e5) => cursorByPage(e5, false), cursorPageDown = (e5) => cursorByPage(e5, true);
function moveByLineBoundary(e5, A, j) {
  let M = e5.lineBlockAt(A.head), N = e5.moveToLineBoundary(A, j);
  if (N.head == A.head && N.head != (j ? M.to : M.from) && (N = e5.moveToLineBoundary(A, j, false)), !j && N.head == M.from && M.length) {
    let j2 = /^\s*/.exec(e5.state.sliceDoc(M.from, Math.min(M.from + 100, M.to)))[0].length;
    j2 && A.head != M.from + j2 && (N = EditorSelection.cursor(M.from + j2));
  }
  return N;
}
var cursorLineBoundaryForward = (e5) => moveSel(e5, (A) => moveByLineBoundary(e5, A, true)), cursorLineBoundaryBackward = (e5) => moveSel(e5, (A) => moveByLineBoundary(e5, A, false)), cursorLineBoundaryLeft = (e5) => moveSel(e5, (A) => moveByLineBoundary(e5, A, !ltrAtCursor(e5))), cursorLineBoundaryRight = (e5) => moveSel(e5, (A) => moveByLineBoundary(e5, A, ltrAtCursor(e5))), cursorLineStart = (e5) => moveSel(e5, (A) => EditorSelection.cursor(e5.lineBlockAt(A.head).from, 1)), cursorLineEnd = (e5) => moveSel(e5, (A) => EditorSelection.cursor(e5.lineBlockAt(A.head).to, -1));
function toMatchingBracket(e5, A, j) {
  let M = false, N = updateSel(e5.selection, (A2) => {
    let N2 = matchBrackets(e5, A2.head, -1) || matchBrackets(e5, A2.head, 1) || A2.head > 0 && matchBrackets(e5, A2.head - 1, 1) || A2.head < e5.doc.length && matchBrackets(e5, A2.head + 1, -1);
    if (!N2 || !N2.end) return A2;
    M = true;
    let P = N2.start.from == A2.head ? N2.end.to : N2.end.from;
    return j ? EditorSelection.range(A2.anchor, P) : EditorSelection.cursor(P);
  });
  return M ? (A(setSel(e5, N)), true) : false;
}
var cursorMatchingBracket = ({ state: e5, dispatch: A }) => toMatchingBracket(e5, A, false);
function extendSel(e5, A) {
  let j = updateSel(e5.state.selection, (e6) => {
    let j2 = A(e6);
    return EditorSelection.range(e6.anchor, j2.head, j2.goalColumn, j2.bidiLevel || void 0, j2.assoc);
  });
  return j.eq(e5.state.selection) ? false : (e5.dispatch(setSel(e5.state, j)), true);
}
function selectByChar(e5, A) {
  return extendSel(e5, (j) => e5.moveByChar(j, A));
}
var selectCharLeft = (e5) => selectByChar(e5, !ltrAtCursor(e5)), selectCharRight = (e5) => selectByChar(e5, ltrAtCursor(e5));
function selectByGroup(e5, A) {
  return extendSel(e5, (j) => e5.moveByGroup(j, A));
}
var selectGroupLeft = (e5) => selectByGroup(e5, !ltrAtCursor(e5)), selectGroupRight = (e5) => selectByGroup(e5, ltrAtCursor(e5)), selectSyntaxLeft = (e5) => extendSel(e5, (A) => moveBySyntax(e5.state, A, !ltrAtCursor(e5))), selectSyntaxRight = (e5) => extendSel(e5, (A) => moveBySyntax(e5.state, A, ltrAtCursor(e5)));
function selectByLine(e5, A) {
  return extendSel(e5, (j) => e5.moveVertically(j, A));
}
var selectLineUp = (e5) => selectByLine(e5, false), selectLineDown = (e5) => selectByLine(e5, true);
function selectByPage(e5, A) {
  return extendSel(e5, (j) => e5.moveVertically(j, A, pageInfo(e5).height));
}
var selectPageUp = (e5) => selectByPage(e5, false), selectPageDown = (e5) => selectByPage(e5, true), selectLineBoundaryForward = (e5) => extendSel(e5, (A) => moveByLineBoundary(e5, A, true)), selectLineBoundaryBackward = (e5) => extendSel(e5, (A) => moveByLineBoundary(e5, A, false)), selectLineBoundaryLeft = (e5) => extendSel(e5, (A) => moveByLineBoundary(e5, A, !ltrAtCursor(e5))), selectLineBoundaryRight = (e5) => extendSel(e5, (A) => moveByLineBoundary(e5, A, ltrAtCursor(e5))), selectLineStart = (e5) => extendSel(e5, (A) => EditorSelection.cursor(e5.lineBlockAt(A.head).from)), selectLineEnd = (e5) => extendSel(e5, (A) => EditorSelection.cursor(e5.lineBlockAt(A.head).to)), cursorDocStart = ({ state: e5, dispatch: A }) => (A(setSel(e5, { anchor: 0 })), true), cursorDocEnd = ({ state: e5, dispatch: A }) => (A(setSel(e5, { anchor: e5.doc.length })), true), selectDocStart = ({ state: e5, dispatch: A }) => (A(setSel(e5, {
  anchor: e5.selection.main.anchor,
  head: 0
})), true), selectDocEnd = ({ state: e5, dispatch: A }) => (A(setSel(e5, {
  anchor: e5.selection.main.anchor,
  head: e5.doc.length
})), true), selectAll = ({ state: e5, dispatch: A }) => (A(e5.update({
  selection: {
    anchor: 0,
    head: e5.doc.length
  },
  userEvent: "select"
})), true), selectLine = ({ state: e5, dispatch: A }) => {
  let j = selectedLineBlocks(e5).map(({ from: A2, to: j2 }) => EditorSelection.range(A2, Math.min(j2 + 1, e5.doc.length)));
  return A(e5.update({
    selection: EditorSelection.create(j),
    userEvent: "select"
  })), true;
}, selectParentSyntax = ({ state: e5, dispatch: A }) => {
  let j = updateSel(e5.selection, (A2) => {
    let j2 = syntaxTree(e5), M = j2.resolveStack(A2.from, 1);
    if (A2.empty) {
      let e6 = j2.resolveStack(A2.from, -1);
      e6.node.from >= M.node.from && e6.node.to <= M.node.to && (M = e6);
    }
    for (let e6 = M; e6; e6 = e6.next) {
      let { node: j3 } = e6;
      if ((j3.from < A2.from && j3.to >= A2.to || j3.to > A2.to && j3.from <= A2.from) && e6.next) return EditorSelection.range(j3.to, j3.from);
    }
    return A2;
  });
  return j.eq(e5.selection) ? false : (A(setSel(e5, j)), true);
};
function addCursorVertically(e5, A) {
  let { state: j } = e5, M = j.selection, N = j.selection.ranges.slice();
  for (let M2 of j.selection.ranges) {
    let P = j.doc.lineAt(M2.head);
    if (A ? P.to < e5.state.doc.length : P.from > 0) for (let j2 = M2; ; ) {
      let M3 = e5.moveVertically(j2, A);
      if (M3.head < P.from || M3.head > P.to) {
        N.some((e6) => e6.head == M3.head) || N.push(M3);
        break;
      } else if (M3.head == j2.head) break;
      else j2 = M3;
    }
  }
  return N.length == M.ranges.length ? false : (e5.dispatch(setSel(j, EditorSelection.create(N, N.length - 1))), true);
}
var addCursorAbove = (e5) => addCursorVertically(e5, false), addCursorBelow = (e5) => addCursorVertically(e5, true), simplifySelection = ({ state: e5, dispatch: A }) => {
  let j = e5.selection, M = null;
  return j.ranges.length > 1 ? M = EditorSelection.create([j.main]) : j.main.empty || (M = EditorSelection.create([EditorSelection.cursor(j.main.head)])), M ? (A(setSel(e5, M)), true) : false;
};
function deleteBy(e5, A) {
  if (e5.state.readOnly) return false;
  let j = "delete.selection", { state: M } = e5, N = M.changeByRange((M2) => {
    let { from: N2, to: P } = M2;
    if (N2 == P) {
      let F = A(M2);
      F < N2 ? (j = "delete.backward", F = skipAtomic(e5, F, false)) : F > N2 && (j = "delete.forward", F = skipAtomic(e5, F, true)), N2 = Math.min(N2, F), P = Math.max(P, F);
    } else N2 = skipAtomic(e5, N2, false), P = skipAtomic(e5, P, true);
    return N2 == P ? { range: M2 } : {
      changes: {
        from: N2,
        to: P
      },
      range: EditorSelection.cursor(N2, N2 < M2.head ? -1 : 1)
    };
  });
  return N.changes.empty ? false : (e5.dispatch(M.update(N, {
    scrollIntoView: true,
    userEvent: j,
    effects: j == "delete.selection" ? EditorView.announce.of(M.phrase("Selection deleted")) : void 0
  })), true);
}
function skipAtomic(e5, A, j) {
  if (e5 instanceof EditorView) for (let M of e5.state.facet(EditorView.atomicRanges).map((A2) => A2(e5))) M.between(A, A, (e6, M2) => {
    e6 < A && M2 > A && (A = j ? M2 : e6);
  });
  return A;
}
var deleteByChar = (e5, A, j) => deleteBy(e5, (M) => {
  let N = M.from, { state: P } = e5, F = P.doc.lineAt(N), I, L;
  if (j && !A && N > F.from && N < F.from + 200 && !/[^ \t]/.test(I = F.text.slice(0, N - F.from))) {
    if (I[I.length - 1] == "	") return N - 1;
    let e6 = countColumn(I, P.tabSize) % getIndentUnit(P) || getIndentUnit(P);
    for (let A2 = 0; A2 < e6 && I[I.length - 1 - A2] == " "; A2++) N--;
    L = N;
  } else L = findClusterBreak(F.text, N - F.from, A, A) + F.from, L == N && F.number != (A ? P.doc.lines : 1) ? L += A ? 1 : -1 : !A && /[\ufe00-\ufe0f]/.test(F.text.slice(L - F.from, N - F.from)) && (L = findClusterBreak(F.text, L - F.from, false, false) + F.from);
  return L;
}), deleteCharBackward = (e5) => deleteByChar(e5, false, true), deleteCharForward = (e5) => deleteByChar(e5, true, false), deleteByGroup = (e5, A) => deleteBy(e5, (j) => {
  let M = j.head, { state: N } = e5, P = N.doc.lineAt(M), F = N.charCategorizer(M);
  for (let e6 = null; ; ) {
    if (M == (A ? P.to : P.from)) {
      M == j.head && P.number != (A ? N.doc.lines : 1) && (M += A ? 1 : -1);
      break;
    }
    let I = findClusterBreak(P.text, M - P.from, A) + P.from, L = P.text.slice(Math.min(M, I) - P.from, Math.max(M, I) - P.from), R = F(L);
    if (e6 != null && R != e6) break;
    (L != " " || M != j.head) && (e6 = R), M = I;
  }
  return M;
}), deleteGroupBackward = (e5) => deleteByGroup(e5, false), deleteGroupForward = (e5) => deleteByGroup(e5, true), deleteToLineEnd = (e5) => deleteBy(e5, (A) => {
  let j = e5.lineBlockAt(A.head).to;
  return A.head < j ? j : Math.min(e5.state.doc.length, A.head + 1);
}), deleteLineBoundaryBackward = (e5) => deleteBy(e5, (A) => {
  let j = e5.moveToLineBoundary(A, false).head;
  return A.head > j ? j : Math.max(0, A.head - 1);
}), deleteLineBoundaryForward = (e5) => deleteBy(e5, (A) => {
  let j = e5.moveToLineBoundary(A, true).head;
  return A.head < j ? j : Math.min(e5.state.doc.length, A.head + 1);
}), splitLine = ({ state: e5, dispatch: A }) => {
  if (e5.readOnly) return false;
  let j = e5.changeByRange((e6) => ({
    changes: {
      from: e6.from,
      to: e6.to,
      insert: Text.of(["", ""])
    },
    range: EditorSelection.cursor(e6.from)
  }));
  return A(e5.update(j, {
    scrollIntoView: true,
    userEvent: "input"
  })), true;
}, transposeChars = ({ state: e5, dispatch: A }) => {
  if (e5.readOnly) return false;
  let j = e5.changeByRange((A2) => {
    if (!A2.empty || A2.from == 0 || A2.from == e5.doc.length) return { range: A2 };
    let j2 = A2.from, M = e5.doc.lineAt(j2), N = j2 == M.from ? j2 - 1 : findClusterBreak(M.text, j2 - M.from, false) + M.from, P = j2 == M.to ? j2 + 1 : findClusterBreak(M.text, j2 - M.from, true) + M.from;
    return {
      changes: {
        from: N,
        to: P,
        insert: e5.doc.slice(j2, P).append(e5.doc.slice(N, j2))
      },
      range: EditorSelection.cursor(P)
    };
  });
  return j.changes.empty ? false : (A(e5.update(j, {
    scrollIntoView: true,
    userEvent: "move.character"
  })), true);
};
function selectedLineBlocks(e5) {
  let A = [], j = -1;
  for (let M of e5.selection.ranges) {
    let N = e5.doc.lineAt(M.from), P = e5.doc.lineAt(M.to);
    if (!M.empty && M.to == P.from && (P = e5.doc.lineAt(M.to - 1)), j >= N.number) {
      let e6 = A[A.length - 1];
      e6.to = P.to, e6.ranges.push(M);
    } else A.push({
      from: N.from,
      to: P.to,
      ranges: [M]
    });
    j = P.number + 1;
  }
  return A;
}
function moveLine(e5, A, j) {
  if (e5.readOnly) return false;
  let M = [], N = [];
  for (let A2 of selectedLineBlocks(e5)) {
    if (j ? A2.to == e5.doc.length : A2.from == 0) continue;
    let P = e5.doc.lineAt(j ? A2.to + 1 : A2.from - 1), F = P.length + 1;
    if (j) {
      M.push({
        from: A2.to,
        to: P.to
      }, {
        from: A2.from,
        insert: P.text + e5.lineBreak
      });
      for (let j2 of A2.ranges) N.push(EditorSelection.range(Math.min(e5.doc.length, j2.anchor + F), Math.min(e5.doc.length, j2.head + F)));
    } else {
      M.push({
        from: P.from,
        to: A2.from
      }, {
        from: A2.to,
        insert: e5.lineBreak + P.text
      });
      for (let e6 of A2.ranges) N.push(EditorSelection.range(e6.anchor - F, e6.head - F));
    }
  }
  return M.length ? (A(e5.update({
    changes: M,
    scrollIntoView: true,
    selection: EditorSelection.create(N, e5.selection.mainIndex),
    userEvent: "move.line"
  })), true) : false;
}
var moveLineUp = ({ state: e5, dispatch: A }) => moveLine(e5, A, false), moveLineDown = ({ state: e5, dispatch: A }) => moveLine(e5, A, true);
function copyLine(e5, A, j) {
  if (e5.readOnly) return false;
  let M = [];
  for (let A2 of selectedLineBlocks(e5)) j ? M.push({
    from: A2.from,
    insert: e5.doc.slice(A2.from, A2.to) + e5.lineBreak
  }) : M.push({
    from: A2.to,
    insert: e5.lineBreak + e5.doc.slice(A2.from, A2.to)
  });
  let N = e5.changes(M);
  return A(e5.update({
    changes: N,
    selection: e5.selection.map(N, j ? 1 : -1),
    scrollIntoView: true,
    userEvent: "input.copyline"
  })), true;
}
var copyLineUp = ({ state: e5, dispatch: A }) => copyLine(e5, A, false), copyLineDown = ({ state: e5, dispatch: A }) => copyLine(e5, A, true), deleteLine = (e5) => {
  if (e5.state.readOnly) return false;
  let { state: A } = e5, j = A.changes(selectedLineBlocks(A).map(({ from: e6, to: j2 }) => (e6 > 0 ? e6-- : j2 < A.doc.length && j2++, {
    from: e6,
    to: j2
  }))), M = updateSel(A.selection, (A2) => {
    let j2;
    if (e5.lineWrapping) {
      let M2 = e5.lineBlockAt(A2.head), N = e5.coordsAtPos(A2.head, A2.assoc || 1);
      N && (j2 = M2.bottom + e5.documentTop - N.bottom + e5.defaultLineHeight / 2);
    }
    return e5.moveVertically(A2, true, j2);
  }).map(j);
  return e5.dispatch({
    changes: j,
    selection: M,
    scrollIntoView: true,
    userEvent: "delete.line"
  }), true;
};
function isBetweenBrackets(e5, A) {
  if (/\(\)|\[\]|\{\}/.test(e5.sliceDoc(A - 1, A + 1))) return {
    from: A,
    to: A
  };
  let j = syntaxTree(e5).resolveInner(A), M = j.childBefore(A), N = j.childAfter(A), P;
  return M && N && M.to <= A && N.from >= A && (P = M.type.prop(NodeProp.closedBy)) && P.indexOf(N.name) > -1 && e5.doc.lineAt(M.to).from == e5.doc.lineAt(N.from).from && !/\S/.test(e5.sliceDoc(M.to, N.from)) ? {
    from: M.to,
    to: N.from
  } : null;
}
var insertNewlineAndIndent = /* @__PURE__ */ newlineAndIndent(false), insertBlankLine = /* @__PURE__ */ newlineAndIndent(true);
function newlineAndIndent(e5) {
  return ({ state: A, dispatch: j }) => {
    if (A.readOnly) return false;
    let M = A.changeByRange((j2) => {
      let { from: M2, to: N } = j2, P = A.doc.lineAt(M2), F = !e5 && M2 == N && isBetweenBrackets(A, M2);
      e5 && (M2 = N = (N <= P.to ? P : A.doc.lineAt(N)).to);
      let I = new IndentContext(A, {
        simulateBreak: M2,
        simulateDoubleBreak: !!F
      }), L = getIndentation(I, M2);
      for (L ?? (L = countColumn(/^\s*/.exec(A.doc.lineAt(M2).text)[0], A.tabSize)); N < P.to && /\s/.test(P.text[N - P.from]); ) N++;
      F ? { from: M2, to: N } = F : M2 > P.from && M2 < P.from + 100 && !/\S/.test(P.text.slice(0, M2)) && (M2 = P.from);
      let R = ["", indentString(A, L)];
      return F && R.push(indentString(A, I.lineIndent(P.from, -1))), {
        changes: {
          from: M2,
          to: N,
          insert: Text.of(R)
        },
        range: EditorSelection.cursor(M2 + 1 + R[1].length)
      };
    });
    return j(A.update(M, {
      scrollIntoView: true,
      userEvent: "input"
    })), true;
  };
}
function changeBySelectedLine(e5, A) {
  let j = -1;
  return e5.changeByRange((M) => {
    let N = [];
    for (let P2 = M.from; P2 <= M.to; ) {
      let F = e5.doc.lineAt(P2);
      F.number > j && (M.empty || M.to > F.from) && (A(F, N, M), j = F.number), P2 = F.to + 1;
    }
    let P = e5.changes(N);
    return {
      changes: N,
      range: EditorSelection.range(P.mapPos(M.anchor, 1), P.mapPos(M.head, 1))
    };
  });
}
var indentSelection = ({ state: e5, dispatch: A }) => {
  if (e5.readOnly) return false;
  let j = /* @__PURE__ */ Object.create(null), M = new IndentContext(e5, { overrideIndentation: (e6) => j[e6] ?? -1 }), N = changeBySelectedLine(e5, (A2, N2, P) => {
    let F = getIndentation(M, A2.from);
    if (F == null) return;
    /\S/.test(A2.text) || (F = 0);
    let I = /^\s*/.exec(A2.text)[0], L = indentString(e5, F);
    (I != L || P.from < A2.from + I.length) && (j[A2.from] = F, N2.push({
      from: A2.from,
      to: A2.from + I.length,
      insert: L
    }));
  });
  return N.changes.empty || A(e5.update(N, { userEvent: "indent" })), true;
}, indentMore = ({ state: e5, dispatch: A }) => e5.readOnly ? false : (A(e5.update(changeBySelectedLine(e5, (A2, j) => {
  j.push({
    from: A2.from,
    insert: e5.facet(indentUnit)
  });
}), { userEvent: "input.indent" })), true), indentLess = ({ state: e5, dispatch: A }) => e5.readOnly ? false : (A(e5.update(changeBySelectedLine(e5, (A2, j) => {
  let M = /^\s*/.exec(A2.text)[0];
  if (!M) return;
  let N = countColumn(M, e5.tabSize), P = 0, F = indentString(e5, Math.max(0, N - getIndentUnit(e5)));
  for (; P < M.length && P < F.length && M.charCodeAt(P) == F.charCodeAt(P); ) P++;
  j.push({
    from: A2.from + P,
    to: A2.from + M.length,
    insert: F.slice(P)
  });
}), { userEvent: "delete.dedent" })), true), toggleTabFocusMode = (e5) => (e5.setTabFocusMode(), true), insertTab = ({ state: e5, dispatch: A }) => e5.selection.ranges.some((e6) => !e6.empty) ? indentMore({
  state: e5,
  dispatch: A
}) : (A(e5.update(e5.replaceSelection("	"), {
  scrollIntoView: true,
  userEvent: "input"
})), true), emacsStyleKeymap = [
  {
    key: "Ctrl-b",
    run: cursorCharLeft,
    shift: selectCharLeft,
    preventDefault: true
  },
  {
    key: "Ctrl-f",
    run: cursorCharRight,
    shift: selectCharRight
  },
  {
    key: "Ctrl-p",
    run: cursorLineUp,
    shift: selectLineUp
  },
  {
    key: "Ctrl-n",
    run: cursorLineDown,
    shift: selectLineDown
  },
  {
    key: "Ctrl-a",
    run: cursorLineStart,
    shift: selectLineStart
  },
  {
    key: "Ctrl-e",
    run: cursorLineEnd,
    shift: selectLineEnd
  },
  {
    key: "Ctrl-d",
    run: deleteCharForward
  },
  {
    key: "Ctrl-h",
    run: deleteCharBackward
  },
  {
    key: "Ctrl-k",
    run: deleteToLineEnd
  },
  {
    key: "Ctrl-Alt-h",
    run: deleteGroupBackward
  },
  {
    key: "Ctrl-o",
    run: splitLine
  },
  {
    key: "Ctrl-t",
    run: transposeChars
  },
  {
    key: "Ctrl-v",
    run: cursorPageDown
  }
], standardKeymap = /* @__PURE__ */ [
  {
    key: "ArrowLeft",
    run: cursorCharLeft,
    shift: selectCharLeft,
    preventDefault: true
  },
  {
    key: "Mod-ArrowLeft",
    mac: "Alt-ArrowLeft",
    run: cursorGroupLeft,
    shift: selectGroupLeft,
    preventDefault: true
  },
  {
    mac: "Cmd-ArrowLeft",
    run: cursorLineBoundaryLeft,
    shift: selectLineBoundaryLeft,
    preventDefault: true
  },
  {
    key: "ArrowRight",
    run: cursorCharRight,
    shift: selectCharRight,
    preventDefault: true
  },
  {
    key: "Mod-ArrowRight",
    mac: "Alt-ArrowRight",
    run: cursorGroupRight,
    shift: selectGroupRight,
    preventDefault: true
  },
  {
    mac: "Cmd-ArrowRight",
    run: cursorLineBoundaryRight,
    shift: selectLineBoundaryRight,
    preventDefault: true
  },
  {
    key: "ArrowUp",
    run: cursorLineUp,
    shift: selectLineUp,
    preventDefault: true
  },
  {
    mac: "Cmd-ArrowUp",
    run: cursorDocStart,
    shift: selectDocStart
  },
  {
    mac: "Ctrl-ArrowUp",
    run: cursorPageUp,
    shift: selectPageUp
  },
  {
    key: "ArrowDown",
    run: cursorLineDown,
    shift: selectLineDown,
    preventDefault: true
  },
  {
    mac: "Cmd-ArrowDown",
    run: cursorDocEnd,
    shift: selectDocEnd
  },
  {
    mac: "Ctrl-ArrowDown",
    run: cursorPageDown,
    shift: selectPageDown
  },
  {
    key: "PageUp",
    run: cursorPageUp,
    shift: selectPageUp
  },
  {
    key: "PageDown",
    run: cursorPageDown,
    shift: selectPageDown
  },
  {
    key: "Home",
    run: cursorLineBoundaryBackward,
    shift: selectLineBoundaryBackward,
    preventDefault: true
  },
  {
    key: "Mod-Home",
    run: cursorDocStart,
    shift: selectDocStart
  },
  {
    key: "End",
    run: cursorLineBoundaryForward,
    shift: selectLineBoundaryForward,
    preventDefault: true
  },
  {
    key: "Mod-End",
    run: cursorDocEnd,
    shift: selectDocEnd
  },
  {
    key: "Enter",
    run: insertNewlineAndIndent,
    shift: insertNewlineAndIndent
  },
  {
    key: "Mod-a",
    run: selectAll
  },
  {
    key: "Backspace",
    run: deleteCharBackward,
    shift: deleteCharBackward,
    preventDefault: true
  },
  {
    key: "Delete",
    run: deleteCharForward,
    preventDefault: true
  },
  {
    key: "Mod-Backspace",
    mac: "Alt-Backspace",
    run: deleteGroupBackward,
    preventDefault: true
  },
  {
    key: "Mod-Delete",
    mac: "Alt-Delete",
    run: deleteGroupForward,
    preventDefault: true
  },
  {
    mac: "Mod-Backspace",
    run: deleteLineBoundaryBackward,
    preventDefault: true
  },
  {
    mac: "Mod-Delete",
    run: deleteLineBoundaryForward,
    preventDefault: true
  }
].concat(/* @__PURE__ */ emacsStyleKeymap.map((e5) => ({
  mac: e5.key,
  run: e5.run,
  shift: e5.shift
}))), defaultKeymap = /* @__PURE__ */ [
  {
    key: "Alt-ArrowLeft",
    mac: "Ctrl-ArrowLeft",
    run: cursorSyntaxLeft,
    shift: selectSyntaxLeft
  },
  {
    key: "Alt-ArrowRight",
    mac: "Ctrl-ArrowRight",
    run: cursorSyntaxRight,
    shift: selectSyntaxRight
  },
  {
    key: "Alt-ArrowUp",
    run: moveLineUp
  },
  {
    key: "Shift-Alt-ArrowUp",
    run: copyLineUp
  },
  {
    key: "Alt-ArrowDown",
    run: moveLineDown
  },
  {
    key: "Shift-Alt-ArrowDown",
    run: copyLineDown
  },
  {
    key: "Mod-Alt-ArrowUp",
    run: addCursorAbove
  },
  {
    key: "Mod-Alt-ArrowDown",
    run: addCursorBelow
  },
  {
    key: "Escape",
    run: simplifySelection
  },
  {
    key: "Mod-Enter",
    run: insertBlankLine
  },
  {
    key: "Alt-l",
    mac: "Ctrl-l",
    run: selectLine
  },
  {
    key: "Mod-i",
    run: selectParentSyntax,
    preventDefault: true
  },
  {
    key: "Mod-[",
    run: indentLess
  },
  {
    key: "Mod-]",
    run: indentMore
  },
  {
    key: "Mod-Alt-\\",
    run: indentSelection
  },
  {
    key: "Shift-Mod-k",
    run: deleteLine
  },
  {
    key: "Shift-Mod-\\",
    run: cursorMatchingBracket
  },
  {
    key: "Mod-/",
    run: toggleComment
  },
  {
    key: "Alt-A",
    run: toggleBlockComment
  },
  {
    key: "Ctrl-m",
    mac: "Shift-Alt-m",
    run: toggleTabFocusMode
  }
].concat(standardKeymap), indentWithTab = {
  key: "Tab",
  run: indentMore,
  shift: indentLess
}, SelectedDiagnostic = class {
  constructor(e5, A, j) {
    this.from = e5, this.to = A, this.diagnostic = j;
  }
}, LintState = class e3 {
  constructor(e5, A, j) {
    this.diagnostics = e5, this.panel = A, this.selected = j;
  }
  static init(A, j, M) {
    let N = M.facet(lintConfig).markerFilter;
    N && (A = N(A, M));
    let P = A.slice().sort((e5, A2) => e5.from - A2.from || e5.to - A2.to), F = new RangeSetBuilder(), I = [], L = 0, R = M.doc.iter(), z = 0, B = M.doc.length;
    for (let e5 = 0; ; ) {
      let A2 = e5 == P.length ? null : P[e5];
      if (!A2 && !I.length) break;
      let j2, M2;
      if (I.length) j2 = L, M2 = I.reduce((e6, A3) => Math.min(e6, A3.to), A2 && A2.from > j2 ? A2.from : 1e8);
      else {
        if (j2 = A2.from, j2 > B) break;
        M2 = A2.to, I.push(A2), e5++;
      }
      for (; e5 < P.length; ) {
        let A3 = P[e5];
        if (A3.from == j2 && (A3.to > A3.from || A3.to == j2)) I.push(A3), e5++, M2 = Math.min(A3.to, M2);
        else {
          M2 = Math.min(A3.from, M2);
          break;
        }
      }
      M2 = Math.min(M2, B);
      let N2 = false;
      if (I.some((e6) => e6.from == j2 && (e6.to == M2 || M2 == B)) && (N2 = j2 == M2, !N2 && M2 - j2 < 10)) {
        let e6 = j2 - (z + R.value.length);
        e6 > 0 && (R.next(e6), z = j2);
        for (let e7 = j2; ; ) {
          if (e7 >= M2) {
            N2 = true;
            break;
          }
          if (!R.lineBreak && z + R.value.length > e7) break;
          e7 = z + R.value.length, z += R.value.length, R.next();
        }
      }
      let V2 = maxSeverity(I);
      if (N2) F.add(j2, j2, Decoration.widget({
        widget: new DiagnosticWidget(V2),
        diagnostics: I.slice()
      }));
      else {
        let e6 = I.reduce((e7, A3) => A3.markClass ? e7 + " " + A3.markClass : e7, "");
        F.add(j2, M2, Decoration.mark({
          class: "cm-lintRange cm-lintRange-" + V2 + e6,
          diagnostics: I.slice(),
          inclusiveEnd: I.some((e7) => e7.to > M2)
        }));
      }
      if (L = M2, L == B) break;
      for (let e6 = 0; e6 < I.length; e6++) I[e6].to <= L && I.splice(e6--, 1);
    }
    let V = F.finish();
    return new e3(V, j, findDiagnostic(V));
  }
};
function findDiagnostic(e5, A = null, j = 0) {
  let M = null;
  return e5.between(j, 1e9, (e6, j2, { spec: N }) => {
    if (!(A && N.diagnostics.indexOf(A) < 0)) if (!M) M = new SelectedDiagnostic(e6, j2, A || N.diagnostics[0]);
    else if (N.diagnostics.indexOf(M.diagnostic) < 0) return false;
    else M = new SelectedDiagnostic(M.from, j2, M.diagnostic);
  }), M;
}
function hideTooltip(e5, A) {
  let j = A.pos, M = A.end || j, N = e5.state.facet(lintConfig).hideOn(e5, j, M);
  if (N != null) return N;
  let P = e5.startState.doc.lineAt(A.pos);
  return !!(e5.effects.some((e6) => e6.is(setDiagnosticsEffect)) || e5.changes.touchesRange(P.from, Math.max(P.to, M)));
}
function maybeEnableLint(e5, A) {
  return e5.field(lintState, false) ? A : A.concat(StateEffect.appendConfig.of(lintExtensions));
}
function setDiagnostics(e5, A) {
  return { effects: maybeEnableLint(e5, [setDiagnosticsEffect.of(A)]) };
}
var setDiagnosticsEffect = /* @__PURE__ */ StateEffect.define(), togglePanel = /* @__PURE__ */ StateEffect.define(), movePanelSelection = /* @__PURE__ */ StateEffect.define(), lintState = /* @__PURE__ */ StateField.define({
  create() {
    return new LintState(Decoration.none, null, null);
  },
  update(e5, A) {
    if (A.docChanged && e5.diagnostics.size) {
      let j = e5.diagnostics.map(A.changes), M = null, N = e5.panel;
      if (e5.selected) {
        let N2 = A.changes.mapPos(e5.selected.from, 1);
        M = findDiagnostic(j, e5.selected.diagnostic, N2) || findDiagnostic(j, null, N2);
      }
      !j.size && N && A.state.facet(lintConfig).autoPanel && (N = null), e5 = new LintState(j, N, M);
    }
    for (let j of A.effects) if (j.is(setDiagnosticsEffect)) {
      let M = A.state.facet(lintConfig).autoPanel ? j.value.length ? LintPanel.open : null : e5.panel;
      e5 = LintState.init(j.value, M, A.state);
    } else j.is(togglePanel) ? e5 = new LintState(e5.diagnostics, j.value ? LintPanel.open : null, e5.selected) : j.is(movePanelSelection) && (e5 = new LintState(e5.diagnostics, e5.panel, j.value));
    return e5;
  },
  provide: (e5) => [showPanel.from(e5, (e6) => e6.panel), EditorView.decorations.from(e5, (e6) => e6.diagnostics)]
}), activeMark = /* @__PURE__ */ Decoration.mark({ class: "cm-lintRange cm-lintRange-active" });
function lintTooltip(e5, A, j) {
  let { diagnostics: M } = e5.state.field(lintState), N, P = -1, F = -1;
  M.between(A - (j < 0 ? 1 : 0), A + (j > 0 ? 1 : 0), (e6, M2, { spec: I2 }) => {
    if (A >= e6 && A <= M2 && (e6 == M2 || (A > e6 || j > 0) && (A < M2 || j < 0))) return N = I2.diagnostics, P = e6, F = M2, false;
  });
  let I = e5.state.facet(lintConfig).tooltipFilter;
  return N && I && (N = I(N, e5.state)), N ? {
    pos: P,
    end: F,
    above: e5.state.doc.lineAt(P).to < F,
    create() {
      return { dom: diagnosticsTooltip(e5, N) };
    }
  } : null;
}
function diagnosticsTooltip(e5, A) {
  return crelt("ul", { class: "cm-tooltip-lint" }, A.map((A2) => renderDiagnostic(e5, A2, false)));
}
var openLintPanel = (e5) => {
  let A = e5.state.field(lintState, false);
  (!A || !A.panel) && e5.dispatch({ effects: maybeEnableLint(e5.state, [togglePanel.of(true)]) });
  let j = getPanel(e5, LintPanel.open);
  return j && j.dom.querySelector(".cm-panel-lint ul").focus(), true;
}, closeLintPanel = (e5) => {
  let A = e5.state.field(lintState, false);
  return !A || !A.panel ? false : (e5.dispatch({ effects: togglePanel.of(false) }), true);
}, lintKeymap = [{
  key: "Mod-Shift-m",
  run: openLintPanel,
  preventDefault: true
}, {
  key: "F8",
  run: (e5) => {
    let A = e5.state.field(lintState, false);
    if (!A) return false;
    let j = e5.state.selection.main, M = findDiagnostic(A.diagnostics, null, j.to + 1);
    return !M && (M = findDiagnostic(A.diagnostics, null, 0), !M || M.from == j.from && M.to == j.to) ? false : (e5.dispatch({
      selection: {
        anchor: M.from,
        head: M.to
      },
      scrollIntoView: true
    }), true);
  }
}], lintPlugin = /* @__PURE__ */ ViewPlugin.fromClass(class {
  constructor(e5) {
    this.view = e5, this.timeout = -1, this.set = true;
    let { delay: A } = e5.state.facet(lintConfig);
    this.lintTime = Date.now() + A, this.run = this.run.bind(this), this.timeout = setTimeout(this.run, A);
  }
  run() {
    clearTimeout(this.timeout);
    let e5 = Date.now();
    if (e5 < this.lintTime - 10) this.timeout = setTimeout(this.run, this.lintTime - e5);
    else {
      this.set = false;
      let { state: e6 } = this.view, { sources: A } = e6.facet(lintConfig);
      A.length && batchResults(A.map((e7) => Promise.resolve(e7(this.view))), (A2) => {
        this.view.state.doc == e6.doc && this.view.dispatch(setDiagnostics(this.view.state, A2.reduce((e7, A3) => e7.concat(A3))));
      }, (e7) => {
        logException(this.view.state, e7);
      });
    }
  }
  update(e5) {
    let A = e5.state.facet(lintConfig);
    (e5.docChanged || A != e5.startState.facet(lintConfig) || A.needsRefresh && A.needsRefresh(e5)) && (this.lintTime = Date.now() + A.delay, this.set || (this.set = true, this.timeout = setTimeout(this.run, A.delay)));
  }
  force() {
    this.set && (this.lintTime = Date.now(), this.run());
  }
  destroy() {
    clearTimeout(this.timeout);
  }
});
function batchResults(e5, A, j) {
  let M = [], N = -1;
  for (let P of e5) P.then((j2) => {
    M.push(j2), clearTimeout(N), M.length == e5.length ? A(M) : N = setTimeout(() => A(M), 200);
  }, j);
}
var lintConfig = /* @__PURE__ */ Facet.define({ combine(e5) {
  return {
    sources: e5.map((e6) => e6.source).filter((e6) => e6 != null),
    ...combineConfig(e5.map((e6) => e6.config), {
      delay: 750,
      markerFilter: null,
      tooltipFilter: null,
      needsRefresh: null,
      hideOn: () => null
    }, {
      delay: Math.max,
      markerFilter: combineFilter,
      tooltipFilter: combineFilter,
      needsRefresh: (e6, A) => e6 ? A ? (j) => e6(j) || A(j) : e6 : A,
      hideOn: (e6, A) => e6 ? A ? (j, M, N) => e6(j, M, N) || A(j, M, N) : e6 : A,
      autoPanel: (e6, A) => e6 || A
    })
  };
} });
function combineFilter(e5, A) {
  return e5 ? A ? (j, M) => A(e5(j, M), M) : e5 : A;
}
function linter(e5, A = {}) {
  return [
    lintConfig.of({
      source: e5,
      config: A
    }),
    lintPlugin,
    lintExtensions
  ];
}
function assignKeys(e5) {
  let A = [];
  if (e5) actions: for (let { name: j } of e5) {
    for (let e6 = 0; e6 < j.length; e6++) {
      let M = j[e6];
      if (/[a-zA-Z]/.test(M) && !A.some((e7) => e7.toLowerCase() == M.toLowerCase())) {
        A.push(M);
        continue actions;
      }
    }
    A.push("");
  }
  return A;
}
function renderDiagnostic(e5, A, j) {
  var _a;
  let M = j ? assignKeys(A.actions) : [];
  return crelt("li", { class: "cm-diagnostic cm-diagnostic-" + A.severity }, crelt("span", { class: "cm-diagnosticText" }, A.renderMessage ? A.renderMessage(e5) : A.message), (_a = A.actions) == null ? void 0 : _a.map((j2, N) => {
    let P = false, F = (M2) => {
      if (M2.preventDefault(), P) return;
      P = true;
      let N2 = findDiagnostic(e5.state.field(lintState).diagnostics, A);
      N2 && j2.apply(e5, N2.from, N2.to);
    }, { name: I } = j2, L = M[N] ? I.indexOf(M[N]) : -1, R = L < 0 ? I : [
      I.slice(0, L),
      crelt("u", I.slice(L, L + 1)),
      I.slice(L + 1)
    ];
    return crelt("button", {
      type: "button",
      class: "cm-diagnosticAction" + (j2.markClass ? " " + j2.markClass : ""),
      onclick: F,
      onmousedown: F,
      "aria-label": ` Action: ${I}${L < 0 ? "" : ` (access key "${M[N]})"`}.`
    }, R);
  }), A.source && crelt("div", { class: "cm-diagnosticSource" }, A.source));
}
var DiagnosticWidget = class extends WidgetType {
  constructor(e5) {
    super(), this.sev = e5;
  }
  eq(e5) {
    return e5.sev == this.sev;
  }
  toDOM() {
    return crelt("span", { class: "cm-lintPoint cm-lintPoint-" + this.sev });
  }
}, PanelItem = class {
  constructor(e5, A) {
    this.diagnostic = A, this.id = "item_" + Math.floor(Math.random() * 4294967295).toString(16), this.dom = renderDiagnostic(e5, A, true), this.dom.id = this.id, this.dom.setAttribute("role", "option");
  }
}, LintPanel = class e4 {
  constructor(e5) {
    this.view = e5, this.items = [];
    let A = (A2) => {
      if (!(A2.ctrlKey || A2.altKey || A2.metaKey)) {
        if (A2.keyCode == 27) closeLintPanel(this.view), this.view.focus();
        else if (A2.keyCode == 38 || A2.keyCode == 33) this.moveSelection((this.selectedIndex - 1 + this.items.length) % this.items.length);
        else if (A2.keyCode == 40 || A2.keyCode == 34) this.moveSelection((this.selectedIndex + 1) % this.items.length);
        else if (A2.keyCode == 36) this.moveSelection(0);
        else if (A2.keyCode == 35) this.moveSelection(this.items.length - 1);
        else if (A2.keyCode == 13) this.view.focus();
        else if (A2.keyCode >= 65 && A2.keyCode <= 90 && this.selectedIndex >= 0) {
          let { diagnostic: j2 } = this.items[this.selectedIndex], M = assignKeys(j2.actions);
          for (let N = 0; N < M.length; N++) if (M[N].toUpperCase().charCodeAt(0) == A2.keyCode) {
            let A3 = findDiagnostic(this.view.state.field(lintState).diagnostics, j2);
            A3 && j2.actions[N].apply(e5, A3.from, A3.to);
          }
        } else return;
        A2.preventDefault();
      }
    }, j = (e6) => {
      for (let A2 = 0; A2 < this.items.length; A2++) this.items[A2].dom.contains(e6.target) && this.moveSelection(A2);
    };
    this.list = crelt("ul", {
      tabIndex: 0,
      role: "listbox",
      "aria-label": this.view.state.phrase("Diagnostics"),
      onkeydown: A,
      onclick: j
    }), this.dom = crelt("div", { class: "cm-panel-lint" }, this.list, crelt("button", {
      type: "button",
      name: "close",
      "aria-label": this.view.state.phrase("close"),
      onclick: () => closeLintPanel(this.view)
    }, "\xD7")), this.update();
  }
  get selectedIndex() {
    let e5 = this.view.state.field(lintState).selected;
    if (!e5) return -1;
    for (let A = 0; A < this.items.length; A++) if (this.items[A].diagnostic == e5.diagnostic) return A;
    return -1;
  }
  update() {
    let { diagnostics: e5, selected: A } = this.view.state.field(lintState), j = 0, M = false, N = null, P = /* @__PURE__ */ new Set();
    for (e5.between(0, this.view.state.doc.length, (e6, F, { spec: I }) => {
      for (let e7 of I.diagnostics) {
        if (P.has(e7)) continue;
        P.add(e7);
        let F2 = -1, I2;
        for (let A2 = j; A2 < this.items.length; A2++) if (this.items[A2].diagnostic == e7) {
          F2 = A2;
          break;
        }
        F2 < 0 ? (I2 = new PanelItem(this.view, e7), this.items.splice(j, 0, I2), M = true) : (I2 = this.items[F2], F2 > j && (this.items.splice(j, F2 - j), M = true)), A && I2.diagnostic == A.diagnostic ? I2.dom.hasAttribute("aria-selected") || (I2.dom.setAttribute("aria-selected", "true"), N = I2) : I2.dom.hasAttribute("aria-selected") && I2.dom.removeAttribute("aria-selected"), j++;
      }
    }); j < this.items.length && !(this.items.length == 1 && this.items[0].diagnostic.from < 0); ) M = true, this.items.pop();
    this.items.length == 0 && (this.items.push(new PanelItem(this.view, {
      from: -1,
      to: -1,
      severity: "info",
      message: this.view.state.phrase("No diagnostics")
    })), M = true), N ? (this.list.setAttribute("aria-activedescendant", N.id), this.view.requestMeasure({
      key: this,
      read: () => ({
        sel: N.dom.getBoundingClientRect(),
        panel: this.list.getBoundingClientRect()
      }),
      write: ({ sel: e6, panel: A2 }) => {
        let j2 = A2.height / this.list.offsetHeight;
        e6.top < A2.top ? this.list.scrollTop -= (A2.top - e6.top) / j2 : e6.bottom > A2.bottom && (this.list.scrollTop += (e6.bottom - A2.bottom) / j2);
      }
    })) : this.selectedIndex < 0 && this.list.removeAttribute("aria-activedescendant"), M && this.sync();
  }
  sync() {
    let e5 = this.list.firstChild;
    function A() {
      let A2 = e5;
      e5 = A2.nextSibling, A2.remove();
    }
    for (let j of this.items) if (j.dom.parentNode == this.list) {
      for (; e5 != j.dom; ) A();
      e5 = j.dom.nextSibling;
    } else this.list.insertBefore(j.dom, e5);
    for (; e5; ) A();
  }
  moveSelection(e5) {
    if (this.selectedIndex < 0) return;
    let A = findDiagnostic(this.view.state.field(lintState).diagnostics, this.items[e5].diagnostic);
    A && this.view.dispatch({
      selection: {
        anchor: A.from,
        head: A.to
      },
      scrollIntoView: true,
      effects: movePanelSelection.of(A)
    });
  }
  static open(A) {
    return new e4(A);
  }
};
function svg(e5, A = 'viewBox="0 0 40 40"') {
  return `url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${A}>${encodeURIComponent(e5)}</svg>')`;
}
function underline(e5) {
  return svg(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e5}" fill="none" stroke-width=".7"/>`, 'width="6" height="3"');
}
var baseTheme = /* @__PURE__ */ EditorView.baseTheme({
  ".cm-diagnostic": {
    padding: "3px 6px 3px 8px",
    marginLeft: "-1px",
    display: "block",
    whiteSpace: "pre-wrap"
  },
  ".cm-diagnostic-error": { borderLeft: "5px solid #d11" },
  ".cm-diagnostic-warning": { borderLeft: "5px solid orange" },
  ".cm-diagnostic-info": { borderLeft: "5px solid #999" },
  ".cm-diagnostic-hint": { borderLeft: "5px solid #66d" },
  ".cm-diagnosticAction": {
    font: "inherit",
    border: "none",
    padding: "2px 4px",
    backgroundColor: "#444",
    color: "white",
    borderRadius: "3px",
    marginLeft: "8px",
    cursor: "pointer"
  },
  ".cm-diagnosticSource": {
    fontSize: "70%",
    opacity: 0.7
  },
  ".cm-lintRange": {
    backgroundPosition: "left bottom",
    backgroundRepeat: "repeat-x",
    paddingBottom: "0.7px"
  },
  ".cm-lintRange-error": { backgroundImage: /* @__PURE__ */ underline("#d11") },
  ".cm-lintRange-warning": { backgroundImage: /* @__PURE__ */ underline("orange") },
  ".cm-lintRange-info": { backgroundImage: /* @__PURE__ */ underline("#999") },
  ".cm-lintRange-hint": { backgroundImage: /* @__PURE__ */ underline("#66d") },
  ".cm-lintRange-active": { backgroundColor: "#ffdd9980" },
  ".cm-tooltip-lint": {
    padding: 0,
    margin: 0
  },
  ".cm-lintPoint": {
    position: "relative",
    "&:after": {
      content: '""',
      position: "absolute",
      bottom: 0,
      left: "-2px",
      borderLeft: "3px solid transparent",
      borderRight: "3px solid transparent",
      borderBottom: "4px solid #d11"
    }
  },
  ".cm-lintPoint-warning": { "&:after": { borderBottomColor: "orange" } },
  ".cm-lintPoint-info": { "&:after": { borderBottomColor: "#999" } },
  ".cm-lintPoint-hint": { "&:after": { borderBottomColor: "#66d" } },
  ".cm-panel.cm-panel-lint": {
    position: "relative",
    "& ul": {
      maxHeight: "100px",
      overflowY: "auto",
      "& [aria-selected]": {
        backgroundColor: "#ddd",
        "& u": { textDecoration: "underline" }
      },
      "&:focus [aria-selected]": {
        background_fallback: "#bdf",
        backgroundColor: "Highlight",
        color_fallback: "white",
        color: "HighlightText"
      },
      "& u": { textDecoration: "none" },
      padding: 0,
      margin: 0
    },
    "& [name=close]": {
      position: "absolute",
      top: "0",
      right: "2px",
      background: "inherit",
      border: "none",
      font: "inherit",
      padding: 0,
      margin: 0
    }
  },
  "&dark .cm-lintRange-active": { backgroundColor: "#86714a80" },
  "&dark .cm-panel.cm-panel-lint ul": { "& [aria-selected]": { backgroundColor: "#2e343e" } }
});
function severityWeight(e5) {
  return e5 == "error" ? 4 : e5 == "warning" ? 3 : e5 == "info" ? 2 : 1;
}
function maxSeverity(e5) {
  let A = "hint", j = 1;
  for (let M of e5) {
    let e6 = severityWeight(M.severity);
    e6 > j && (j = e6, A = M.severity);
  }
  return A;
}
var lintExtensions = [
  lintState,
  /* @__PURE__ */ EditorView.decorations.compute([lintState], (e5) => {
    let { selected: A, panel: j } = e5.field(lintState);
    return !A || !j || A.from == A.to ? Decoration.none : Decoration.set([activeMark.range(A.from, A.to)]);
  }),
  /* @__PURE__ */ hoverTooltip(lintTooltip, { hideOn: hideTooltip }),
  baseTheme
];
function forEachDiagnostic(e5, A) {
  let j = e5.field(lintState, false);
  if (j && j.diagnostics.size) {
    let e6 = [], M = [], N = -1;
    for (let P = RangeSet.iter([j.diagnostics]); ; P.next()) {
      for (let j2 = 0; j2 < e6.length; j2++) (!P.value || P.value.spec.diagnostics.indexOf(e6[j2]) < 0) && (A(e6[j2], M[j2], N), e6.splice(j2, 1), M.splice(j2--, 1));
      if (!P.value) break;
      for (let A2 of P.value.spec.diagnostics) e6.indexOf(A2) < 0 && (e6.push(A2), M.push(P.from));
      N = P.to;
    }
  }
}
function _extends() {
  return _extends = Object.assign ? Object.assign.bind() : function(e5) {
    for (var A = 1; A < arguments.length; A++) {
      var j = arguments[A];
      for (var M in j) ({}).hasOwnProperty.call(j, M) && (e5[M] = j[M]);
    }
    return e5;
  }, _extends.apply(null, arguments);
}
export {
  setDiagnostics as a,
  historyField as c,
  insertTab as d,
  CopyClipboardIcon as f,
  linter as i,
  historyKeymap as l,
  forEachDiagnostic as n,
  defaultKeymap as o,
  lintKeymap as r,
  history as s,
  _extends as t,
  indentWithTab as u
};
