var qE = Object.defineProperty;
var sd = (t) => {
  throw TypeError(t);
};
var WE = (t, e, n) => e in t ? qE(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
var M = (t, e, n) => WE(t, typeof e != "symbol" ? e + "" : e, n), ld = (t, e, n) => e.has(t) || sd("Cannot " + n);
var Nr = (t, e, n) => (ld(t, e, "read from private field"), n ? n.call(t) : e.get(t)), cd = (t, e, n) => e.has(t) ? sd("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), ud = (t, e, n, r) => (ld(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n);
function Ze(t) {
  this.content = t;
}
Ze.prototype = {
  constructor: Ze,
  find: function(t) {
    for (var e = 0; e < this.content.length; e += 2)
      if (this.content[e] === t) return e;
    return -1;
  },
  // :: (string) → ?any
  // Retrieve the value stored under `key`, or return undefined when
  // no such key exists.
  get: function(t) {
    var e = this.find(t);
    return e == -1 ? void 0 : this.content[e + 1];
  },
  // :: (string, any, ?string) → OrderedMap
  // Create a new map by replacing the value of `key` with a new
  // value, or adding a binding to the end of the map. If `newKey` is
  // given, the key of the binding will be replaced with that key.
  update: function(t, e, n) {
    var r = n && n != t ? this.remove(n) : this, i = r.find(t), o = r.content.slice();
    return i == -1 ? o.push(n || t, e) : (o[i + 1] = e, n && (o[i] = n)), new Ze(o);
  },
  // :: (string) → OrderedMap
  // Return a map with the given key removed, if it existed.
  remove: function(t) {
    var e = this.find(t);
    if (e == -1) return this;
    var n = this.content.slice();
    return n.splice(e, 2), new Ze(n);
  },
  // :: (string, any) → OrderedMap
  // Add a new key to the start of the map.
  addToStart: function(t, e) {
    return new Ze([t, e].concat(this.remove(t).content));
  },
  // :: (string, any) → OrderedMap
  // Add a new key to the end of the map.
  addToEnd: function(t, e) {
    var n = this.remove(t).content.slice();
    return n.push(t, e), new Ze(n);
  },
  // :: (string, string, any) → OrderedMap
  // Add a key after the given key. If `place` is not found, the new
  // key is added to the end.
  addBefore: function(t, e, n) {
    var r = this.remove(e), i = r.content.slice(), o = r.find(t);
    return i.splice(o == -1 ? i.length : o, 0, e, n), new Ze(i);
  },
  // :: ((key: string, value: any))
  // Call the given function for each key/value pair in the map, in
  // order.
  forEach: function(t) {
    for (var e = 0; e < this.content.length; e += 2)
      t(this.content[e], this.content[e + 1]);
  },
  // :: (union<Object, OrderedMap>) → OrderedMap
  // Create a new map by prepending the keys in this map that don't
  // appear in `map` before the keys in `map`.
  prepend: function(t) {
    return t = Ze.from(t), t.size ? new Ze(t.content.concat(this.subtract(t).content)) : this;
  },
  // :: (union<Object, OrderedMap>) → OrderedMap
  // Create a new map by appending the keys in this map that don't
  // appear in `map` after the keys in `map`.
  append: function(t) {
    return t = Ze.from(t), t.size ? new Ze(this.subtract(t).content.concat(t.content)) : this;
  },
  // :: (union<Object, OrderedMap>) → OrderedMap
  // Create a map containing all the keys in this map that don't
  // appear in `map`.
  subtract: function(t) {
    var e = this;
    t = Ze.from(t);
    for (var n = 0; n < t.content.length; n += 2)
      e = e.remove(t.content[n]);
    return e;
  },
  // :: () → Object
  // Turn ordered map into a plain object.
  toObject: function() {
    var t = {};
    return this.forEach(function(e, n) {
      t[e] = n;
    }), t;
  },
  // :: number
  // The amount of keys in this map.
  get size() {
    return this.content.length >> 1;
  }
};
Ze.from = function(t) {
  if (t instanceof Ze) return t;
  var e = [];
  if (t) for (var n in t) e.push(n, t[n]);
  return new Ze(e);
};
function ym(t, e, n) {
  for (let r = 0; ; r++) {
    if (r == t.childCount || r == e.childCount)
      return t.childCount == e.childCount ? null : n;
    let i = t.child(r), o = e.child(r);
    if (i == o) {
      n += i.nodeSize;
      continue;
    }
    if (!i.sameMarkup(o))
      return n;
    if (i.isText && i.text != o.text) {
      for (let a = 0; i.text[a] == o.text[a]; a++)
        n++;
      return n;
    }
    if (i.content.size || o.content.size) {
      let a = ym(i.content, o.content, n + 1);
      if (a != null)
        return a;
    }
    n += i.nodeSize;
  }
}
function vm(t, e, n, r) {
  for (let i = t.childCount, o = e.childCount; ; ) {
    if (i == 0 || o == 0)
      return i == o ? null : { a: n, b: r };
    let a = t.child(--i), s = e.child(--o), l = a.nodeSize;
    if (a == s) {
      n -= l, r -= l;
      continue;
    }
    if (!a.sameMarkup(s))
      return { a: n, b: r };
    if (a.isText && a.text != s.text) {
      let c = 0, u = Math.min(a.text.length, s.text.length);
      for (; c < u && a.text[a.text.length - c - 1] == s.text[s.text.length - c - 1]; )
        c++, n--, r--;
      return { a: n, b: r };
    }
    if (a.content.size || s.content.size) {
      let c = vm(a.content, s.content, n - 1, r - 1);
      if (c)
        return c;
    }
    n -= l, r -= l;
  }
}
class L {
  /**
  @internal
  */
  constructor(e, n) {
    if (this.content = e, this.size = n || 0, n == null)
      for (let r = 0; r < e.length; r++)
        this.size += e[r].nodeSize;
  }
  /**
  Invoke a callback for all descendant nodes between the given two
  positions (relative to start of this fragment). Doesn't descend
  into a node when the callback returns `false`.
  */
  nodesBetween(e, n, r, i = 0, o) {
    for (let a = 0, s = 0; s < n; a++) {
      let l = this.content[a], c = s + l.nodeSize;
      if (c > e && r(l, i + s, o || null, a) !== !1 && l.content.size) {
        let u = s + 1;
        l.nodesBetween(Math.max(0, e - u), Math.min(l.content.size, n - u), r, i + u);
      }
      s = c;
    }
  }
  /**
  Call the given callback for every descendant node. `pos` will be
  relative to the start of the fragment. The callback may return
  `false` to prevent traversal of a given node's children.
  */
  descendants(e) {
    this.nodesBetween(0, this.size, e);
  }
  /**
  Extract the text between `from` and `to`. See the same method on
  [`Node`](https://prosemirror.net/docs/ref/#model.Node.textBetween).
  */
  textBetween(e, n, r, i) {
    let o = "", a = !0;
    return this.nodesBetween(e, n, (s, l) => {
      let c = s.isText ? s.text.slice(Math.max(e, l) - l, n - l) : s.isLeaf ? i ? typeof i == "function" ? i(s) : i : s.type.spec.leafText ? s.type.spec.leafText(s) : "" : "";
      s.isBlock && (s.isLeaf && c || s.isTextblock) && r && (a ? a = !1 : o += r), o += c;
    }, 0), o;
  }
  /**
  Create a new fragment containing the combined content of this
  fragment and the other.
  */
  append(e) {
    if (!e.size)
      return this;
    if (!this.size)
      return e;
    let n = this.lastChild, r = e.firstChild, i = this.content.slice(), o = 0;
    for (n.isText && n.sameMarkup(r) && (i[i.length - 1] = n.withText(n.text + r.text), o = 1); o < e.content.length; o++)
      i.push(e.content[o]);
    return new L(i, this.size + e.size);
  }
  /**
  Cut out the sub-fragment between the two given positions.
  */
  cut(e, n = this.size) {
    if (e == 0 && n == this.size)
      return this;
    let r = [], i = 0;
    if (n > e)
      for (let o = 0, a = 0; a < n; o++) {
        let s = this.content[o], l = a + s.nodeSize;
        l > e && ((a < e || l > n) && (s.isText ? s = s.cut(Math.max(0, e - a), Math.min(s.text.length, n - a)) : s = s.cut(Math.max(0, e - a - 1), Math.min(s.content.size, n - a - 1))), r.push(s), i += s.nodeSize), a = l;
      }
    return new L(r, i);
  }
  /**
  @internal
  */
  cutByIndex(e, n) {
    return e == n ? L.empty : e == 0 && n == this.content.length ? this : new L(this.content.slice(e, n));
  }
  /**
  Create a new fragment in which the node at the given index is
  replaced by the given node.
  */
  replaceChild(e, n) {
    let r = this.content[e];
    if (r == n)
      return this;
    let i = this.content.slice(), o = this.size + n.nodeSize - r.nodeSize;
    return i[e] = n, new L(i, o);
  }
  /**
  Create a new fragment by prepending the given node to this
  fragment.
  */
  addToStart(e) {
    return new L([e].concat(this.content), this.size + e.nodeSize);
  }
  /**
  Create a new fragment by appending the given node to this
  fragment.
  */
  addToEnd(e) {
    return new L(this.content.concat(e), this.size + e.nodeSize);
  }
  /**
  Compare this fragment to another one.
  */
  eq(e) {
    if (this.content.length != e.content.length)
      return !1;
    for (let n = 0; n < this.content.length; n++)
      if (!this.content[n].eq(e.content[n]))
        return !1;
    return !0;
  }
  /**
  The first child of the fragment, or `null` if it is empty.
  */
  get firstChild() {
    return this.content.length ? this.content[0] : null;
  }
  /**
  The last child of the fragment, or `null` if it is empty.
  */
  get lastChild() {
    return this.content.length ? this.content[this.content.length - 1] : null;
  }
  /**
  The number of child nodes in this fragment.
  */
  get childCount() {
    return this.content.length;
  }
  /**
  Get the child node at the given index. Raise an error when the
  index is out of range.
  */
  child(e) {
    let n = this.content[e];
    if (!n)
      throw new RangeError("Index " + e + " out of range for " + this);
    return n;
  }
  /**
  Get the child node at the given index, if it exists.
  */
  maybeChild(e) {
    return this.content[e] || null;
  }
  /**
  Call `f` for every child node, passing the node, its offset
  into this parent node, and its index.
  */
  forEach(e) {
    for (let n = 0, r = 0; n < this.content.length; n++) {
      let i = this.content[n];
      e(i, r, n), r += i.nodeSize;
    }
  }
  /**
  Find the first position at which this fragment and another
  fragment differ, or `null` if they are the same.
  */
  findDiffStart(e, n = 0) {
    return ym(this, e, n);
  }
  /**
  Find the first position, searching from the end, at which this
  fragment and the given fragment differ, or `null` if they are
  the same. Since this position will not be the same in both
  nodes, an object with two separate positions is returned.
  */
  findDiffEnd(e, n = this.size, r = e.size) {
    return vm(this, e, n, r);
  }
  /**
  Find the index and inner offset corresponding to a given relative
  position in this fragment. The result object will be reused
  (overwritten) the next time the function is called. @internal
  */
  findIndex(e, n = -1) {
    if (e == 0)
      return Io(0, e);
    if (e == this.size)
      return Io(this.content.length, e);
    if (e > this.size || e < 0)
      throw new RangeError(`Position ${e} outside of fragment (${this})`);
    for (let r = 0, i = 0; ; r++) {
      let o = this.child(r), a = i + o.nodeSize;
      if (a >= e)
        return a == e || n > 0 ? Io(r + 1, a) : Io(r, i);
      i = a;
    }
  }
  /**
  Return a debugging string that describes this fragment.
  */
  toString() {
    return "<" + this.toStringInner() + ">";
  }
  /**
  @internal
  */
  toStringInner() {
    return this.content.join(", ");
  }
  /**
  Create a JSON-serializeable representation of this fragment.
  */
  toJSON() {
    return this.content.length ? this.content.map((e) => e.toJSON()) : null;
  }
  /**
  Deserialize a fragment from its JSON representation.
  */
  static fromJSON(e, n) {
    if (!n)
      return L.empty;
    if (!Array.isArray(n))
      throw new RangeError("Invalid input for Fragment.fromJSON");
    return new L(n.map(e.nodeFromJSON));
  }
  /**
  Build a fragment from an array of nodes. Ensures that adjacent
  text nodes with the same marks are joined together.
  */
  static fromArray(e) {
    if (!e.length)
      return L.empty;
    let n, r = 0;
    for (let i = 0; i < e.length; i++) {
      let o = e[i];
      r += o.nodeSize, i && o.isText && e[i - 1].sameMarkup(o) ? (n || (n = e.slice(0, i)), n[n.length - 1] = o.withText(n[n.length - 1].text + o.text)) : n && n.push(o);
    }
    return new L(n || e, r);
  }
  /**
  Create a fragment from something that can be interpreted as a
  set of nodes. For `null`, it returns the empty fragment. For a
  fragment, the fragment itself. For a node or array of nodes, a
  fragment containing those nodes.
  */
  static from(e) {
    if (!e)
      return L.empty;
    if (e instanceof L)
      return e;
    if (Array.isArray(e))
      return this.fromArray(e);
    if (e.attrs)
      return new L([e], e.nodeSize);
    throw new RangeError("Can not convert " + e + " to a Fragment" + (e.nodesBetween ? " (looks like multiple versions of prosemirror-model were loaded)" : ""));
  }
}
L.empty = new L([], 0);
const qs = { index: 0, offset: 0 };
function Io(t, e) {
  return qs.index = t, qs.offset = e, qs;
}
function ua(t, e) {
  if (t === e)
    return !0;
  if (!(t && typeof t == "object") || !(e && typeof e == "object"))
    return !1;
  let n = Array.isArray(t);
  if (Array.isArray(e) != n)
    return !1;
  if (n) {
    if (t.length != e.length)
      return !1;
    for (let r = 0; r < t.length; r++)
      if (!ua(t[r], e[r]))
        return !1;
  } else {
    for (let r in t)
      if (!(r in e) || !ua(t[r], e[r]))
        return !1;
    for (let r in e)
      if (!(r in t))
        return !1;
  }
  return !0;
}
let Ne = class zl {
  /**
  @internal
  */
  constructor(e, n) {
    this.type = e, this.attrs = n;
  }
  /**
  Given a set of marks, create a new set which contains this one as
  well, in the right position. If this mark is already in the set,
  the set itself is returned. If any marks that are set to be
  [exclusive](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) with this mark are present,
  those are replaced by this one.
  */
  addToSet(e) {
    let n, r = !1;
    for (let i = 0; i < e.length; i++) {
      let o = e[i];
      if (this.eq(o))
        return e;
      if (this.type.excludes(o.type))
        n || (n = e.slice(0, i));
      else {
        if (o.type.excludes(this.type))
          return e;
        !r && o.type.rank > this.type.rank && (n || (n = e.slice(0, i)), n.push(this), r = !0), n && n.push(o);
      }
    }
    return n || (n = e.slice()), r || n.push(this), n;
  }
  /**
  Remove this mark from the given set, returning a new set. If this
  mark is not in the set, the set itself is returned.
  */
  removeFromSet(e) {
    for (let n = 0; n < e.length; n++)
      if (this.eq(e[n]))
        return e.slice(0, n).concat(e.slice(n + 1));
    return e;
  }
  /**
  Test whether this mark is in the given set of marks.
  */
  isInSet(e) {
    for (let n = 0; n < e.length; n++)
      if (this.eq(e[n]))
        return !0;
    return !1;
  }
  /**
  Test whether this mark has the same type and attributes as
  another mark.
  */
  eq(e) {
    return this == e || this.type == e.type && ua(this.attrs, e.attrs);
  }
  /**
  Convert this mark to a JSON-serializeable representation.
  */
  toJSON() {
    let e = { type: this.type.name };
    for (let n in this.attrs) {
      e.attrs = this.attrs;
      break;
    }
    return e;
  }
  /**
  Deserialize a mark from JSON.
  */
  static fromJSON(e, n) {
    if (!n)
      throw new RangeError("Invalid input for Mark.fromJSON");
    let r = e.marks[n.type];
    if (!r)
      throw new RangeError(`There is no mark type ${n.type} in this schema`);
    let i = r.create(n.attrs);
    return r.checkAttrs(i.attrs), i;
  }
  /**
  Test whether two sets of marks are identical.
  */
  static sameSet(e, n) {
    if (e == n)
      return !0;
    if (e.length != n.length)
      return !1;
    for (let r = 0; r < e.length; r++)
      if (!e[r].eq(n[r]))
        return !1;
    return !0;
  }
  /**
  Create a properly sorted mark set from null, a single mark, or an
  unsorted array of marks.
  */
  static setFrom(e) {
    if (!e || Array.isArray(e) && e.length == 0)
      return zl.none;
    if (e instanceof zl)
      return [e];
    let n = e.slice();
    return n.sort((r, i) => r.type.rank - i.type.rank), n;
  }
};
Ne.none = [];
class da extends Error {
}
class H {
  /**
  Create a slice. When specifying a non-zero open depth, you must
  make sure that there are nodes of at least that depth at the
  appropriate side of the fragment—i.e. if the fragment is an
  empty paragraph node, `openStart` and `openEnd` can't be greater
  than 1.
  
  It is not necessary for the content of open nodes to conform to
  the schema's content constraints, though it should be a valid
  start/end/middle for such a node, depending on which sides are
  open.
  */
  constructor(e, n, r) {
    this.content = e, this.openStart = n, this.openEnd = r;
  }
  /**
  The size this slice would add when inserted into a document.
  */
  get size() {
    return this.content.size - this.openStart - this.openEnd;
  }
  /**
  @internal
  */
  insertAt(e, n) {
    let r = Om(this.content, e + this.openStart, n);
    return r && new H(r, this.openStart, this.openEnd);
  }
  /**
  @internal
  */
  removeBetween(e, n) {
    return new H(Rm(this.content, e + this.openStart, n + this.openStart), this.openStart, this.openEnd);
  }
  /**
  Tests whether this slice is equal to another slice.
  */
  eq(e) {
    return this.content.eq(e.content) && this.openStart == e.openStart && this.openEnd == e.openEnd;
  }
  /**
  @internal
  */
  toString() {
    return this.content + "(" + this.openStart + "," + this.openEnd + ")";
  }
  /**
  Convert a slice to a JSON-serializable representation.
  */
  toJSON() {
    if (!this.content.size)
      return null;
    let e = { content: this.content.toJSON() };
    return this.openStart > 0 && (e.openStart = this.openStart), this.openEnd > 0 && (e.openEnd = this.openEnd), e;
  }
  /**
  Deserialize a slice from its JSON representation.
  */
  static fromJSON(e, n) {
    if (!n)
      return H.empty;
    let r = n.openStart || 0, i = n.openEnd || 0;
    if (typeof r != "number" || typeof i != "number")
      throw new RangeError("Invalid input for Slice.fromJSON");
    return new H(L.fromJSON(e, n.content), r, i);
  }
  /**
  Create a slice from a fragment by taking the maximum possible
  open value on both side of the fragment.
  */
  static maxOpen(e, n = !0) {
    let r = 0, i = 0;
    for (let o = e.firstChild; o && !o.isLeaf && (n || !o.type.spec.isolating); o = o.firstChild)
      r++;
    for (let o = e.lastChild; o && !o.isLeaf && (n || !o.type.spec.isolating); o = o.lastChild)
      i++;
    return new H(e, r, i);
  }
}
H.empty = new H(L.empty, 0, 0);
function Rm(t, e, n) {
  let { index: r, offset: i } = t.findIndex(e), o = t.maybeChild(r), { index: a, offset: s } = t.findIndex(n);
  if (i == e || o.isText) {
    if (s != n && !t.child(a).isText)
      throw new RangeError("Removing non-flat range");
    return t.cut(0, e).append(t.cut(n));
  }
  if (r != a)
    throw new RangeError("Removing non-flat range");
  return t.replaceChild(r, o.copy(Rm(o.content, e - i - 1, n - i - 1)));
}
function Om(t, e, n, r) {
  let { index: i, offset: o } = t.findIndex(e), a = t.maybeChild(i);
  if (o == e || a.isText)
    return t.cut(0, e).append(n).append(t.cut(e));
  let s = Om(a.content, e - o - 1, n);
  return s && t.replaceChild(i, a.copy(s));
}
function KE(t, e, n) {
  if (n.openStart > t.depth)
    throw new da("Inserted content deeper than insertion position");
  if (t.depth - n.openStart != e.depth - n.openEnd)
    throw new da("Inconsistent open depths");
  return Nm(t, e, n, 0);
}
function Nm(t, e, n, r) {
  let i = t.index(r), o = t.node(r);
  if (i == e.index(r) && r < t.depth - n.openStart) {
    let a = Nm(t, e, n, r + 1);
    return o.copy(o.content.replaceChild(i, a));
  } else if (n.content.size)
    if (!n.openStart && !n.openEnd && t.depth == r && e.depth == r) {
      let a = t.parent, s = a.content;
      return sr(a, s.cut(0, t.parentOffset).append(n.content).append(s.cut(e.parentOffset)));
    } else {
      let { start: a, end: s } = QE(n, t);
      return sr(o, Im(t, a, s, e, r));
    }
  else return sr(o, pa(t, e, r));
}
function Am(t, e) {
  if (!e.type.compatibleContent(t.type))
    throw new da("Cannot join " + e.type.name + " onto " + t.type.name);
}
function ql(t, e, n) {
  let r = t.node(n);
  return Am(r, e.node(n)), r;
}
function ar(t, e) {
  let n = e.length - 1;
  n >= 0 && t.isText && t.sameMarkup(e[n]) ? e[n] = t.withText(e[n].text + t.text) : e.push(t);
}
function xi(t, e, n, r) {
  let i = (e || t).node(n), o = 0, a = e ? e.index(n) : i.childCount;
  t && (o = t.index(n), t.depth > n ? o++ : t.textOffset && (ar(t.nodeAfter, r), o++));
  for (let s = o; s < a; s++)
    ar(i.child(s), r);
  e && e.depth == n && e.textOffset && ar(e.nodeBefore, r);
}
function sr(t, e) {
  return t.type.checkContent(e), t.copy(e);
}
function Im(t, e, n, r, i) {
  let o = t.depth > i && ql(t, e, i + 1), a = r.depth > i && ql(n, r, i + 1), s = [];
  return xi(null, t, i, s), o && a && e.index(i) == n.index(i) ? (Am(o, a), ar(sr(o, Im(t, e, n, r, i + 1)), s)) : (o && ar(sr(o, pa(t, e, i + 1)), s), xi(e, n, i, s), a && ar(sr(a, pa(n, r, i + 1)), s)), xi(r, null, i, s), new L(s);
}
function pa(t, e, n) {
  let r = [];
  if (xi(null, t, n, r), t.depth > n) {
    let i = ql(t, e, n + 1);
    ar(sr(i, pa(t, e, n + 1)), r);
  }
  return xi(e, null, n, r), new L(r);
}
function QE(t, e) {
  let n = e.depth - t.openStart, i = e.node(n).copy(t.content);
  for (let o = n - 1; o >= 0; o--)
    i = e.node(o).copy(L.from(i));
  return {
    start: i.resolveNoCache(t.openStart + n),
    end: i.resolveNoCache(i.content.size - t.openEnd - n)
  };
}
class $i {
  /**
  @internal
  */
  constructor(e, n, r) {
    this.pos = e, this.path = n, this.parentOffset = r, this.depth = n.length / 3 - 1;
  }
  /**
  @internal
  */
  resolveDepth(e) {
    return e == null ? this.depth : e < 0 ? this.depth + e : e;
  }
  /**
  The parent node that the position points into. Note that even if
  a position points into a text node, that node is not considered
  the parent—text nodes are ‘flat’ in this model, and have no content.
  */
  get parent() {
    return this.node(this.depth);
  }
  /**
  The root node in which the position was resolved.
  */
  get doc() {
    return this.node(0);
  }
  /**
  The ancestor node at the given level. `p.node(p.depth)` is the
  same as `p.parent`.
  */
  node(e) {
    return this.path[this.resolveDepth(e) * 3];
  }
  /**
  The index into the ancestor at the given level. If this points
  at the 3rd node in the 2nd paragraph on the top level, for
  example, `p.index(0)` is 1 and `p.index(1)` is 2.
  */
  index(e) {
    return this.path[this.resolveDepth(e) * 3 + 1];
  }
  /**
  The index pointing after this position into the ancestor at the
  given level.
  */
  indexAfter(e) {
    return e = this.resolveDepth(e), this.index(e) + (e == this.depth && !this.textOffset ? 0 : 1);
  }
  /**
  The (absolute) position at the start of the node at the given
  level.
  */
  start(e) {
    return e = this.resolveDepth(e), e == 0 ? 0 : this.path[e * 3 - 1] + 1;
  }
  /**
  The (absolute) position at the end of the node at the given
  level.
  */
  end(e) {
    return e = this.resolveDepth(e), this.start(e) + this.node(e).content.size;
  }
  /**
  The (absolute) position directly before the wrapping node at the
  given level, or, when `depth` is `this.depth + 1`, the original
  position.
  */
  before(e) {
    if (e = this.resolveDepth(e), !e)
      throw new RangeError("There is no position before the top-level node");
    return e == this.depth + 1 ? this.pos : this.path[e * 3 - 1];
  }
  /**
  The (absolute) position directly after the wrapping node at the
  given level, or the original position when `depth` is `this.depth + 1`.
  */
  after(e) {
    if (e = this.resolveDepth(e), !e)
      throw new RangeError("There is no position after the top-level node");
    return e == this.depth + 1 ? this.pos : this.path[e * 3 - 1] + this.path[e * 3].nodeSize;
  }
  /**
  When this position points into a text node, this returns the
  distance between the position and the start of the text node.
  Will be zero for positions that point between nodes.
  */
  get textOffset() {
    return this.pos - this.path[this.path.length - 1];
  }
  /**
  Get the node directly after the position, if any. If the position
  points into a text node, only the part of that node after the
  position is returned.
  */
  get nodeAfter() {
    let e = this.parent, n = this.index(this.depth);
    if (n == e.childCount)
      return null;
    let r = this.pos - this.path[this.path.length - 1], i = e.child(n);
    return r ? e.child(n).cut(r) : i;
  }
  /**
  Get the node directly before the position, if any. If the
  position points into a text node, only the part of that node
  before the position is returned.
  */
  get nodeBefore() {
    let e = this.index(this.depth), n = this.pos - this.path[this.path.length - 1];
    return n ? this.parent.child(e).cut(0, n) : e == 0 ? null : this.parent.child(e - 1);
  }
  /**
  Get the position at the given index in the parent node at the
  given depth (which defaults to `this.depth`).
  */
  posAtIndex(e, n) {
    n = this.resolveDepth(n);
    let r = this.path[n * 3], i = n == 0 ? 0 : this.path[n * 3 - 1] + 1;
    for (let o = 0; o < e; o++)
      i += r.child(o).nodeSize;
    return i;
  }
  /**
  Get the marks at this position, factoring in the surrounding
  marks' [`inclusive`](https://prosemirror.net/docs/ref/#model.MarkSpec.inclusive) property. If the
  position is at the start of a non-empty node, the marks of the
  node after it (if any) are returned.
  */
  marks() {
    let e = this.parent, n = this.index();
    if (e.content.size == 0)
      return Ne.none;
    if (this.textOffset)
      return e.child(n).marks;
    let r = e.maybeChild(n - 1), i = e.maybeChild(n);
    if (!r) {
      let s = r;
      r = i, i = s;
    }
    let o = r.marks;
    for (var a = 0; a < o.length; a++)
      o[a].type.spec.inclusive === !1 && (!i || !o[a].isInSet(i.marks)) && (o = o[a--].removeFromSet(o));
    return o;
  }
  /**
  Get the marks after the current position, if any, except those
  that are non-inclusive and not present at position `$end`. This
  is mostly useful for getting the set of marks to preserve after a
  deletion. Will return `null` if this position is at the end of
  its parent node or its parent node isn't a textblock (in which
  case no marks should be preserved).
  */
  marksAcross(e) {
    let n = this.parent.maybeChild(this.index());
    if (!n || !n.isInline)
      return null;
    let r = n.marks, i = e.parent.maybeChild(e.index());
    for (var o = 0; o < r.length; o++)
      r[o].type.spec.inclusive === !1 && (!i || !r[o].isInSet(i.marks)) && (r = r[o--].removeFromSet(r));
    return r;
  }
  /**
  The depth up to which this position and the given (non-resolved)
  position share the same parent nodes.
  */
  sharedDepth(e) {
    for (let n = this.depth; n > 0; n--)
      if (this.start(n) <= e && this.end(n) >= e)
        return n;
    return 0;
  }
  /**
  Returns a range based on the place where this position and the
  given position diverge around block content. If both point into
  the same textblock, for example, a range around that textblock
  will be returned. If they point into different blocks, the range
  around those blocks in their shared ancestor is returned. You can
  pass in an optional predicate that will be called with a parent
  node to see if a range into that parent is acceptable.
  */
  blockRange(e = this, n) {
    if (e.pos < this.pos)
      return e.blockRange(this);
    for (let r = this.depth - (this.parent.inlineContent || this.pos == e.pos ? 1 : 0); r >= 0; r--)
      if (e.pos <= this.end(r) && (!n || n(this.node(r))))
        return new _a(this, e, r);
    return null;
  }
  /**
  Query whether the given position shares the same parent node.
  */
  sameParent(e) {
    return this.pos - this.parentOffset == e.pos - e.parentOffset;
  }
  /**
  Return the greater of this and the given position.
  */
  max(e) {
    return e.pos > this.pos ? e : this;
  }
  /**
  Return the smaller of this and the given position.
  */
  min(e) {
    return e.pos < this.pos ? e : this;
  }
  /**
  @internal
  */
  toString() {
    let e = "";
    for (let n = 1; n <= this.depth; n++)
      e += (e ? "/" : "") + this.node(n).type.name + "_" + this.index(n - 1);
    return e + ":" + this.parentOffset;
  }
  /**
  @internal
  */
  static resolve(e, n) {
    if (!(n >= 0 && n <= e.content.size))
      throw new RangeError("Position " + n + " out of range");
    let r = [], i = 0, o = n;
    for (let a = e; ; ) {
      let { index: s, offset: l } = a.content.findIndex(o), c = o - l;
      if (r.push(a, s, i + l), !c || (a = a.child(s), a.isText))
        break;
      o = c - 1, i += l + 1;
    }
    return new $i(n, r, o);
  }
  /**
  @internal
  */
  static resolveCached(e, n) {
    let r = dd.get(e);
    if (r)
      for (let o = 0; o < r.elts.length; o++) {
        let a = r.elts[o];
        if (a.pos == n)
          return a;
      }
    else
      dd.set(e, r = new ZE());
    let i = r.elts[r.i] = $i.resolve(e, n);
    return r.i = (r.i + 1) % XE, i;
  }
}
class ZE {
  constructor() {
    this.elts = [], this.i = 0;
  }
}
const XE = 12, dd = /* @__PURE__ */ new WeakMap();
class _a {
  /**
  Construct a node range. `$from` and `$to` should point into the
  same node until at least the given `depth`, since a node range
  denotes an adjacent set of nodes in a single parent node.
  */
  constructor(e, n, r) {
    this.$from = e, this.$to = n, this.depth = r;
  }
  /**
  The position at the start of the range.
  */
  get start() {
    return this.$from.before(this.depth + 1);
  }
  /**
  The position at the end of the range.
  */
  get end() {
    return this.$to.after(this.depth + 1);
  }
  /**
  The parent node that the range points into.
  */
  get parent() {
    return this.$from.node(this.depth);
  }
  /**
  The start index of the range in the parent node.
  */
  get startIndex() {
    return this.$from.index(this.depth);
  }
  /**
  The end index of the range in the parent node.
  */
  get endIndex() {
    return this.$to.indexAfter(this.depth);
  }
}
const jE = /* @__PURE__ */ Object.create(null);
let Un = class Wl {
  /**
  @internal
  */
  constructor(e, n, r, i = Ne.none) {
    this.type = e, this.attrs = n, this.marks = i, this.content = r || L.empty;
  }
  /**
  The array of this node's child nodes.
  */
  get children() {
    return this.content.content;
  }
  /**
  The size of this node, as defined by the integer-based [indexing
  scheme](/docs/guide/#doc.indexing). For text nodes, this is the
  amount of characters. For other leaf nodes, it is one. For
  non-leaf nodes, it is the size of the content plus two (the
  start and end token).
  */
  get nodeSize() {
    return this.isLeaf ? 1 : 2 + this.content.size;
  }
  /**
  The number of children that the node has.
  */
  get childCount() {
    return this.content.childCount;
  }
  /**
  Get the child node at the given index. Raises an error when the
  index is out of range.
  */
  child(e) {
    return this.content.child(e);
  }
  /**
  Get the child node at the given index, if it exists.
  */
  maybeChild(e) {
    return this.content.maybeChild(e);
  }
  /**
  Call `f` for every child node, passing the node, its offset
  into this parent node, and its index.
  */
  forEach(e) {
    this.content.forEach(e);
  }
  /**
  Invoke a callback for all descendant nodes recursively between
  the given two positions that are relative to start of this
  node's content. The callback is invoked with the node, its
  position relative to the original node (method receiver),
  its parent node, and its child index. When the callback returns
  false for a given node, that node's children will not be
  recursed over. The last parameter can be used to specify a
  starting position to count from.
  */
  nodesBetween(e, n, r, i = 0) {
    this.content.nodesBetween(e, n, r, i, this);
  }
  /**
  Call the given callback for every descendant node. Doesn't
  descend into a node when the callback returns `false`.
  */
  descendants(e) {
    this.nodesBetween(0, this.content.size, e);
  }
  /**
  Concatenates all the text nodes found in this fragment and its
  children.
  */
  get textContent() {
    return this.isLeaf && this.type.spec.leafText ? this.type.spec.leafText(this) : this.textBetween(0, this.content.size, "");
  }
  /**
  Get all text between positions `from` and `to`. When
  `blockSeparator` is given, it will be inserted to separate text
  from different block nodes. If `leafText` is given, it'll be
  inserted for every non-text leaf node encountered, otherwise
  [`leafText`](https://prosemirror.net/docs/ref/#model.NodeSpec^leafText) will be used.
  */
  textBetween(e, n, r, i) {
    return this.content.textBetween(e, n, r, i);
  }
  /**
  Returns this node's first child, or `null` if there are no
  children.
  */
  get firstChild() {
    return this.content.firstChild;
  }
  /**
  Returns this node's last child, or `null` if there are no
  children.
  */
  get lastChild() {
    return this.content.lastChild;
  }
  /**
  Test whether two nodes represent the same piece of document.
  */
  eq(e) {
    return this == e || this.sameMarkup(e) && this.content.eq(e.content);
  }
  /**
  Compare the markup (type, attributes, and marks) of this node to
  those of another. Returns `true` if both have the same markup.
  */
  sameMarkup(e) {
    return this.hasMarkup(e.type, e.attrs, e.marks);
  }
  /**
  Check whether this node's markup correspond to the given type,
  attributes, and marks.
  */
  hasMarkup(e, n, r) {
    return this.type == e && ua(this.attrs, n || e.defaultAttrs || jE) && Ne.sameSet(this.marks, r || Ne.none);
  }
  /**
  Create a new node with the same markup as this node, containing
  the given content (or empty, if no content is given).
  */
  copy(e = null) {
    return e == this.content ? this : new Wl(this.type, this.attrs, e, this.marks);
  }
  /**
  Create a copy of this node, with the given set of marks instead
  of the node's own marks.
  */
  mark(e) {
    return e == this.marks ? this : new Wl(this.type, this.attrs, this.content, e);
  }
  /**
  Create a copy of this node with only the content between the
  given positions. If `to` is not given, it defaults to the end of
  the node.
  */
  cut(e, n = this.content.size) {
    return e == 0 && n == this.content.size ? this : this.copy(this.content.cut(e, n));
  }
  /**
  Cut out the part of the document between the given positions, and
  return it as a `Slice` object.
  */
  slice(e, n = this.content.size, r = !1) {
    if (e == n)
      return H.empty;
    let i = this.resolve(e), o = this.resolve(n), a = r ? 0 : i.sharedDepth(n), s = i.start(a), c = i.node(a).content.cut(i.pos - s, o.pos - s);
    return new H(c, i.depth - a, o.depth - a);
  }
  /**
  Replace the part of the document between the given positions with
  the given slice. The slice must 'fit', meaning its open sides
  must be able to connect to the surrounding content, and its
  content nodes must be valid children for the node they are placed
  into. If any of this is violated, an error of type
  [`ReplaceError`](https://prosemirror.net/docs/ref/#model.ReplaceError) is thrown.
  */
  replace(e, n, r) {
    return KE(this.resolve(e), this.resolve(n), r);
  }
  /**
  Find the node directly after the given position.
  */
  nodeAt(e) {
    for (let n = this; ; ) {
      let { index: r, offset: i } = n.content.findIndex(e);
      if (n = n.maybeChild(r), !n)
        return null;
      if (i == e || n.isText)
        return n;
      e -= i + 1;
    }
  }
  /**
  Find the (direct) child node after the given offset, if any,
  and return it along with its index and offset relative to this
  node.
  */
  childAfter(e) {
    let { index: n, offset: r } = this.content.findIndex(e);
    return { node: this.content.maybeChild(n), index: n, offset: r };
  }
  /**
  Find the (direct) child node before the given offset, if any,
  and return it along with its index and offset relative to this
  node.
  */
  childBefore(e) {
    if (e == 0)
      return { node: null, index: 0, offset: 0 };
    let { index: n, offset: r } = this.content.findIndex(e);
    if (r < e)
      return { node: this.content.child(n), index: n, offset: r };
    let i = this.content.child(n - 1);
    return { node: i, index: n - 1, offset: r - i.nodeSize };
  }
  /**
  Resolve the given position in the document, returning an
  [object](https://prosemirror.net/docs/ref/#model.ResolvedPos) with information about its context.
  */
  resolve(e) {
    return $i.resolveCached(this, e);
  }
  /**
  @internal
  */
  resolveNoCache(e) {
    return $i.resolve(this, e);
  }
  /**
  Test whether a given mark or mark type occurs in this document
  between the two given positions.
  */
  rangeHasMark(e, n, r) {
    let i = !1;
    return n > e && this.nodesBetween(e, n, (o) => (r.isInSet(o.marks) && (i = !0), !i)), i;
  }
  /**
  True when this is a block (non-inline node)
  */
  get isBlock() {
    return this.type.isBlock;
  }
  /**
  True when this is a textblock node, a block node with inline
  content.
  */
  get isTextblock() {
    return this.type.isTextblock;
  }
  /**
  True when this node allows inline content.
  */
  get inlineContent() {
    return this.type.inlineContent;
  }
  /**
  True when this is an inline node (a text node or a node that can
  appear among text).
  */
  get isInline() {
    return this.type.isInline;
  }
  /**
  True when this is a text node.
  */
  get isText() {
    return this.type.isText;
  }
  /**
  True when this is a leaf node.
  */
  get isLeaf() {
    return this.type.isLeaf;
  }
  /**
  True when this is an atom, i.e. when it does not have directly
  editable content. This is usually the same as `isLeaf`, but can
  be configured with the [`atom` property](https://prosemirror.net/docs/ref/#model.NodeSpec.atom)
  on a node's spec (typically used when the node is displayed as
  an uneditable [node view](https://prosemirror.net/docs/ref/#view.NodeView)).
  */
  get isAtom() {
    return this.type.isAtom;
  }
  /**
  Return a string representation of this node for debugging
  purposes.
  */
  toString() {
    if (this.type.spec.toDebugString)
      return this.type.spec.toDebugString(this);
    let e = this.type.name;
    return this.content.size && (e += "(" + this.content.toStringInner() + ")"), xm(this.marks, e);
  }
  /**
  Get the content match in this node at the given index.
  */
  contentMatchAt(e) {
    let n = this.type.contentMatch.matchFragment(this.content, 0, e);
    if (!n)
      throw new Error("Called contentMatchAt on a node with invalid content");
    return n;
  }
  /**
  Test whether replacing the range between `from` and `to` (by
  child index) with the given replacement fragment (which defaults
  to the empty fragment) would leave the node's content valid. You
  can optionally pass `start` and `end` indices into the
  replacement fragment.
  */
  canReplace(e, n, r = L.empty, i = 0, o = r.childCount) {
    let a = this.contentMatchAt(e).matchFragment(r, i, o), s = a && a.matchFragment(this.content, n);
    if (!s || !s.validEnd)
      return !1;
    for (let l = i; l < o; l++)
      if (!this.type.allowsMarks(r.child(l).marks))
        return !1;
    return !0;
  }
  /**
  Test whether replacing the range `from` to `to` (by index) with
  a node of the given type would leave the node's content valid.
  */
  canReplaceWith(e, n, r, i) {
    if (i && !this.type.allowsMarks(i))
      return !1;
    let o = this.contentMatchAt(e).matchType(r), a = o && o.matchFragment(this.content, n);
    return a ? a.validEnd : !1;
  }
  /**
  Test whether the given node's content could be appended to this
  node. If that node is empty, this will only return true if there
  is at least one node type that can appear in both nodes (to avoid
  merging completely incompatible nodes).
  */
  canAppend(e) {
    return e.content.size ? this.canReplace(this.childCount, this.childCount, e.content) : this.type.compatibleContent(e.type);
  }
  /**
  Check whether this node and its descendants conform to the
  schema, and raise an exception when they do not.
  */
  check() {
    this.type.checkContent(this.content), this.type.checkAttrs(this.attrs);
    let e = Ne.none;
    for (let n = 0; n < this.marks.length; n++) {
      let r = this.marks[n];
      r.type.checkAttrs(r.attrs), e = r.addToSet(e);
    }
    if (!Ne.sameSet(e, this.marks))
      throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map((n) => n.type.name)}`);
    this.content.forEach((n) => n.check());
  }
  /**
  Return a JSON-serializeable representation of this node.
  */
  toJSON() {
    let e = { type: this.type.name };
    for (let n in this.attrs) {
      e.attrs = this.attrs;
      break;
    }
    return this.content.size && (e.content = this.content.toJSON()), this.marks.length && (e.marks = this.marks.map((n) => n.toJSON())), e;
  }
  /**
  Deserialize a node from its JSON representation.
  */
  static fromJSON(e, n) {
    if (!n)
      throw new RangeError("Invalid input for Node.fromJSON");
    let r;
    if (n.marks) {
      if (!Array.isArray(n.marks))
        throw new RangeError("Invalid mark data for Node.fromJSON");
      r = n.marks.map(e.markFromJSON);
    }
    if (n.type == "text") {
      if (typeof n.text != "string")
        throw new RangeError("Invalid text node in JSON");
      return e.text(n.text, r);
    }
    let i = L.fromJSON(e, n.content), o = e.nodeType(n.type).create(n.attrs, i, r);
    return o.type.checkAttrs(o.attrs), o;
  }
};
Un.prototype.text = void 0;
class ma extends Un {
  /**
  @internal
  */
  constructor(e, n, r, i) {
    if (super(e, n, null, i), !r)
      throw new RangeError("Empty text nodes are not allowed");
    this.text = r;
  }
  toString() {
    return this.type.spec.toDebugString ? this.type.spec.toDebugString(this) : xm(this.marks, JSON.stringify(this.text));
  }
  get textContent() {
    return this.text;
  }
  textBetween(e, n) {
    return this.text.slice(e, n);
  }
  get nodeSize() {
    return this.text.length;
  }
  mark(e) {
    return e == this.marks ? this : new ma(this.type, this.attrs, this.text, e);
  }
  withText(e) {
    return e == this.text ? this : new ma(this.type, this.attrs, e, this.marks);
  }
  cut(e = 0, n = this.text.length) {
    return e == 0 && n == this.text.length ? this : this.withText(this.text.slice(e, n));
  }
  eq(e) {
    return this.sameMarkup(e) && this.text == e.text;
  }
  toJSON() {
    let e = super.toJSON();
    return e.text = this.text, e;
  }
}
function xm(t, e) {
  for (let n = t.length - 1; n >= 0; n--)
    e = t[n].type.name + "(" + e + ")";
  return e;
}
class mr {
  /**
  @internal
  */
  constructor(e) {
    this.validEnd = e, this.next = [], this.wrapCache = [];
  }
  /**
  @internal
  */
  static parse(e, n) {
    let r = new JE(e, n);
    if (r.next == null)
      return mr.empty;
    let i = Dm(r);
    r.next && r.err("Unexpected trailing text");
    let o = aS(oS(i));
    return sS(o, r), o;
  }
  /**
  Match a node type, returning a match after that node if
  successful.
  */
  matchType(e) {
    for (let n = 0; n < this.next.length; n++)
      if (this.next[n].type == e)
        return this.next[n].next;
    return null;
  }
  /**
  Try to match a fragment. Returns the resulting match when
  successful.
  */
  matchFragment(e, n = 0, r = e.childCount) {
    let i = this;
    for (let o = n; i && o < r; o++)
      i = i.matchType(e.child(o).type);
    return i;
  }
  /**
  @internal
  */
  get inlineContent() {
    return this.next.length != 0 && this.next[0].type.isInline;
  }
  /**
  Get the first matching node type at this match position that can
  be generated.
  */
  get defaultType() {
    for (let e = 0; e < this.next.length; e++) {
      let { type: n } = this.next[e];
      if (!(n.isText || n.hasRequiredAttrs()))
        return n;
    }
    return null;
  }
  /**
  @internal
  */
  compatible(e) {
    for (let n = 0; n < this.next.length; n++)
      for (let r = 0; r < e.next.length; r++)
        if (this.next[n].type == e.next[r].type)
          return !0;
    return !1;
  }
  /**
  Try to match the given fragment, and if that fails, see if it can
  be made to match by inserting nodes in front of it. When
  successful, return a fragment of inserted nodes (which may be
  empty if nothing had to be inserted). When `toEnd` is true, only
  return a fragment if the resulting match goes to the end of the
  content expression.
  */
  fillBefore(e, n = !1, r = 0) {
    let i = [this];
    function o(a, s) {
      let l = a.matchFragment(e, r);
      if (l && (!n || l.validEnd))
        return L.from(s.map((c) => c.createAndFill()));
      for (let c = 0; c < a.next.length; c++) {
        let { type: u, next: d } = a.next[c];
        if (!(u.isText || u.hasRequiredAttrs()) && i.indexOf(d) == -1) {
          i.push(d);
          let p = o(d, s.concat(u));
          if (p)
            return p;
        }
      }
      return null;
    }
    return o(this, []);
  }
  /**
  Find a set of wrapping node types that would allow a node of the
  given type to appear at this position. The result may be empty
  (when it fits directly) and will be null when no such wrapping
  exists.
  */
  findWrapping(e) {
    for (let r = 0; r < this.wrapCache.length; r += 2)
      if (this.wrapCache[r] == e)
        return this.wrapCache[r + 1];
    let n = this.computeWrapping(e);
    return this.wrapCache.push(e, n), n;
  }
  /**
  @internal
  */
  computeWrapping(e) {
    let n = /* @__PURE__ */ Object.create(null), r = [{ match: this, type: null, via: null }];
    for (; r.length; ) {
      let i = r.shift(), o = i.match;
      if (o.matchType(e)) {
        let a = [];
        for (let s = i; s.type; s = s.via)
          a.push(s.type);
        return a.reverse();
      }
      for (let a = 0; a < o.next.length; a++) {
        let { type: s, next: l } = o.next[a];
        !s.isLeaf && !s.hasRequiredAttrs() && !(s.name in n) && (!i.type || l.validEnd) && (r.push({ match: s.contentMatch, type: s, via: i }), n[s.name] = !0);
      }
    }
    return null;
  }
  /**
  The number of outgoing edges this node has in the finite
  automaton that describes the content expression.
  */
  get edgeCount() {
    return this.next.length;
  }
  /**
  Get the _n_​th outgoing edge from this node in the finite
  automaton that describes the content expression.
  */
  edge(e) {
    if (e >= this.next.length)
      throw new RangeError(`There's no ${e}th edge in this content match`);
    return this.next[e];
  }
  /**
  @internal
  */
  toString() {
    let e = [];
    function n(r) {
      e.push(r);
      for (let i = 0; i < r.next.length; i++)
        e.indexOf(r.next[i].next) == -1 && n(r.next[i].next);
    }
    return n(this), e.map((r, i) => {
      let o = i + (r.validEnd ? "*" : " ") + " ";
      for (let a = 0; a < r.next.length; a++)
        o += (a ? ", " : "") + r.next[a].type.name + "->" + e.indexOf(r.next[a].next);
      return o;
    }).join(`
`);
  }
}
mr.empty = new mr(!0);
class JE {
  constructor(e, n) {
    this.string = e, this.nodeTypes = n, this.inline = null, this.pos = 0, this.tokens = e.split(/\s*(?=\b|\W|$)/), this.tokens[this.tokens.length - 1] == "" && this.tokens.pop(), this.tokens[0] == "" && this.tokens.shift();
  }
  get next() {
    return this.tokens[this.pos];
  }
  eat(e) {
    return this.next == e && (this.pos++ || !0);
  }
  err(e) {
    throw new SyntaxError(e + " (in content expression '" + this.string + "')");
  }
}
function Dm(t) {
  let e = [];
  do
    e.push(eS(t));
  while (t.eat("|"));
  return e.length == 1 ? e[0] : { type: "choice", exprs: e };
}
function eS(t) {
  let e = [];
  do
    e.push(tS(t));
  while (t.next && t.next != ")" && t.next != "|");
  return e.length == 1 ? e[0] : { type: "seq", exprs: e };
}
function tS(t) {
  let e = iS(t);
  for (; ; )
    if (t.eat("+"))
      e = { type: "plus", expr: e };
    else if (t.eat("*"))
      e = { type: "star", expr: e };
    else if (t.eat("?"))
      e = { type: "opt", expr: e };
    else if (t.eat("{"))
      e = nS(t, e);
    else
      break;
  return e;
}
function pd(t) {
  /\D/.test(t.next) && t.err("Expected number, got '" + t.next + "'");
  let e = Number(t.next);
  return t.pos++, e;
}
function nS(t, e) {
  let n = pd(t), r = n;
  return t.eat(",") && (t.next != "}" ? r = pd(t) : r = -1), t.eat("}") || t.err("Unclosed braced range"), { type: "range", min: n, max: r, expr: e };
}
function rS(t, e) {
  let n = t.nodeTypes, r = n[e];
  if (r)
    return [r];
  let i = [];
  for (let o in n) {
    let a = n[o];
    a.isInGroup(e) && i.push(a);
  }
  return i.length == 0 && t.err("No node type or group '" + e + "' found"), i;
}
function iS(t) {
  if (t.eat("(")) {
    let e = Dm(t);
    return t.eat(")") || t.err("Missing closing paren"), e;
  } else if (/\W/.test(t.next))
    t.err("Unexpected token '" + t.next + "'");
  else {
    let e = rS(t, t.next).map((n) => (t.inline == null ? t.inline = n.isInline : t.inline != n.isInline && t.err("Mixing inline and block content"), { type: "name", value: n }));
    return t.pos++, e.length == 1 ? e[0] : { type: "choice", exprs: e };
  }
}
function oS(t) {
  let e = [[]];
  return i(o(t, 0), n()), e;
  function n() {
    return e.push([]) - 1;
  }
  function r(a, s, l) {
    let c = { term: l, to: s };
    return e[a].push(c), c;
  }
  function i(a, s) {
    a.forEach((l) => l.to = s);
  }
  function o(a, s) {
    if (a.type == "choice")
      return a.exprs.reduce((l, c) => l.concat(o(c, s)), []);
    if (a.type == "seq")
      for (let l = 0; ; l++) {
        let c = o(a.exprs[l], s);
        if (l == a.exprs.length - 1)
          return c;
        i(c, s = n());
      }
    else if (a.type == "star") {
      let l = n();
      return r(s, l), i(o(a.expr, l), l), [r(l)];
    } else if (a.type == "plus") {
      let l = n();
      return i(o(a.expr, s), l), i(o(a.expr, l), l), [r(l)];
    } else {
      if (a.type == "opt")
        return [r(s)].concat(o(a.expr, s));
      if (a.type == "range") {
        let l = s;
        for (let c = 0; c < a.min; c++) {
          let u = n();
          i(o(a.expr, l), u), l = u;
        }
        if (a.max == -1)
          i(o(a.expr, l), l);
        else
          for (let c = a.min; c < a.max; c++) {
            let u = n();
            r(l, u), i(o(a.expr, l), u), l = u;
          }
        return [r(l)];
      } else {
        if (a.type == "name")
          return [r(s, void 0, a.value)];
        throw new Error("Unknown expr type");
      }
    }
  }
}
function wm(t, e) {
  return e - t;
}
function _d(t, e) {
  let n = [];
  return r(e), n.sort(wm);
  function r(i) {
    let o = t[i];
    if (o.length == 1 && !o[0].term)
      return r(o[0].to);
    n.push(i);
    for (let a = 0; a < o.length; a++) {
      let { term: s, to: l } = o[a];
      !s && n.indexOf(l) == -1 && r(l);
    }
  }
}
function aS(t) {
  let e = /* @__PURE__ */ Object.create(null);
  return n(_d(t, 0));
  function n(r) {
    let i = [];
    r.forEach((a) => {
      t[a].forEach(({ term: s, to: l }) => {
        if (!s)
          return;
        let c;
        for (let u = 0; u < i.length; u++)
          i[u][0] == s && (c = i[u][1]);
        _d(t, l).forEach((u) => {
          c || i.push([s, c = []]), c.indexOf(u) == -1 && c.push(u);
        });
      });
    });
    let o = e[r.join(",")] = new mr(r.indexOf(t.length - 1) > -1);
    for (let a = 0; a < i.length; a++) {
      let s = i[a][1].sort(wm);
      o.next.push({ type: i[a][0], next: e[s.join(",")] || n(s) });
    }
    return o;
  }
}
function sS(t, e) {
  for (let n = 0, r = [t]; n < r.length; n++) {
    let i = r[n], o = !i.validEnd, a = [];
    for (let s = 0; s < i.next.length; s++) {
      let { type: l, next: c } = i.next[s];
      a.push(l.name), o && !(l.isText || l.hasRequiredAttrs()) && (o = !1), r.indexOf(c) == -1 && r.push(c);
    }
    o && e.err("Only non-generatable nodes (" + a.join(", ") + ") in a required position (see https://prosemirror.net/docs/guide/#generatable)");
  }
}
function Mm(t) {
  let e = /* @__PURE__ */ Object.create(null);
  for (let n in t) {
    let r = t[n];
    if (!r.hasDefault)
      return null;
    e[n] = r.default;
  }
  return e;
}
function Lm(t, e) {
  let n = /* @__PURE__ */ Object.create(null);
  for (let r in t) {
    let i = e && e[r];
    if (i === void 0) {
      let o = t[r];
      if (o.hasDefault)
        i = o.default;
      else
        throw new RangeError("No value supplied for attribute " + r);
    }
    n[r] = i;
  }
  return n;
}
function km(t, e, n, r) {
  for (let i in e)
    if (!(i in t))
      throw new RangeError(`Unsupported attribute ${i} for ${n} of type ${i}`);
  for (let i in t) {
    let o = t[i];
    o.validate && o.validate(e[i]);
  }
}
function Pm(t, e) {
  let n = /* @__PURE__ */ Object.create(null);
  if (e)
    for (let r in e)
      n[r] = new cS(t, r, e[r]);
  return n;
}
let md = class Fm {
  /**
  @internal
  */
  constructor(e, n, r) {
    this.name = e, this.schema = n, this.spec = r, this.markSet = null, this.groups = r.group ? r.group.split(" ") : [], this.attrs = Pm(e, r.attrs), this.defaultAttrs = Mm(this.attrs), this.contentMatch = null, this.inlineContent = null, this.isBlock = !(r.inline || e == "text"), this.isText = e == "text";
  }
  /**
  True if this is an inline type.
  */
  get isInline() {
    return !this.isBlock;
  }
  /**
  True if this is a textblock type, a block that contains inline
  content.
  */
  get isTextblock() {
    return this.isBlock && this.inlineContent;
  }
  /**
  True for node types that allow no content.
  */
  get isLeaf() {
    return this.contentMatch == mr.empty;
  }
  /**
  True when this node is an atom, i.e. when it does not have
  directly editable content.
  */
  get isAtom() {
    return this.isLeaf || !!this.spec.atom;
  }
  /**
  Return true when this node type is part of the given
  [group](https://prosemirror.net/docs/ref/#model.NodeSpec.group).
  */
  isInGroup(e) {
    return this.groups.indexOf(e) > -1;
  }
  /**
  The node type's [whitespace](https://prosemirror.net/docs/ref/#model.NodeSpec.whitespace) option.
  */
  get whitespace() {
    return this.spec.whitespace || (this.spec.code ? "pre" : "normal");
  }
  /**
  Tells you whether this node type has any required attributes.
  */
  hasRequiredAttrs() {
    for (let e in this.attrs)
      if (this.attrs[e].isRequired)
        return !0;
    return !1;
  }
  /**
  Indicates whether this node allows some of the same content as
  the given node type.
  */
  compatibleContent(e) {
    return this == e || this.contentMatch.compatible(e.contentMatch);
  }
  /**
  @internal
  */
  computeAttrs(e) {
    return !e && this.defaultAttrs ? this.defaultAttrs : Lm(this.attrs, e);
  }
  /**
  Create a `Node` of this type. The given attributes are
  checked and defaulted (you can pass `null` to use the type's
  defaults entirely, if no required attributes exist). `content`
  may be a `Fragment`, a node, an array of nodes, or
  `null`. Similarly `marks` may be `null` to default to the empty
  set of marks.
  */
  create(e = null, n, r) {
    if (this.isText)
      throw new Error("NodeType.create can't construct text nodes");
    return new Un(this, this.computeAttrs(e), L.from(n), Ne.setFrom(r));
  }
  /**
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but check the given content
  against the node type's content restrictions, and throw an error
  if it doesn't match.
  */
  createChecked(e = null, n, r) {
    return n = L.from(n), this.checkContent(n), new Un(this, this.computeAttrs(e), n, Ne.setFrom(r));
  }
  /**
  Like [`create`](https://prosemirror.net/docs/ref/#model.NodeType.create), but see if it is
  necessary to add nodes to the start or end of the given fragment
  to make it fit the node. If no fitting wrapping can be found,
  return null. Note that, due to the fact that required nodes can
  always be created, this will always succeed if you pass null or
  `Fragment.empty` as content.
  */
  createAndFill(e = null, n, r) {
    if (e = this.computeAttrs(e), n = L.from(n), n.size) {
      let a = this.contentMatch.fillBefore(n);
      if (!a)
        return null;
      n = a.append(n);
    }
    let i = this.contentMatch.matchFragment(n), o = i && i.fillBefore(L.empty, !0);
    return o ? new Un(this, e, n.append(o), Ne.setFrom(r)) : null;
  }
  /**
  Returns true if the given fragment is valid content for this node
  type.
  */
  validContent(e) {
    let n = this.contentMatch.matchFragment(e);
    if (!n || !n.validEnd)
      return !1;
    for (let r = 0; r < e.childCount; r++)
      if (!this.allowsMarks(e.child(r).marks))
        return !1;
    return !0;
  }
  /**
  Throws a RangeError if the given fragment is not valid content for this
  node type.
  @internal
  */
  checkContent(e) {
    if (!this.validContent(e))
      throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0, 50)}`);
  }
  /**
  @internal
  */
  checkAttrs(e) {
    km(this.attrs, e, "node", this.name);
  }
  /**
  Check whether the given mark type is allowed in this node.
  */
  allowsMarkType(e) {
    return this.markSet == null || this.markSet.indexOf(e) > -1;
  }
  /**
  Test whether the given set of marks are allowed in this node.
  */
  allowsMarks(e) {
    if (this.markSet == null)
      return !0;
    for (let n = 0; n < e.length; n++)
      if (!this.allowsMarkType(e[n].type))
        return !1;
    return !0;
  }
  /**
  Removes the marks that are not allowed in this node from the given set.
  */
  allowedMarks(e) {
    if (this.markSet == null)
      return e;
    let n;
    for (let r = 0; r < e.length; r++)
      this.allowsMarkType(e[r].type) ? n && n.push(e[r]) : n || (n = e.slice(0, r));
    return n ? n.length ? n : Ne.none : e;
  }
  /**
  @internal
  */
  static compile(e, n) {
    let r = /* @__PURE__ */ Object.create(null);
    e.forEach((o, a) => r[o] = new Fm(o, n, a));
    let i = n.spec.topNode || "doc";
    if (!r[i])
      throw new RangeError("Schema is missing its top node type ('" + i + "')");
    if (!r.text)
      throw new RangeError("Every schema needs a 'text' type");
    for (let o in r.text.attrs)
      throw new RangeError("The text node type should not have attributes");
    return r;
  }
};
function lS(t, e, n) {
  let r = n.split("|");
  return (i) => {
    let o = i === null ? "null" : typeof i;
    if (r.indexOf(o) < 0)
      throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${t}, got ${o}`);
  };
}
class cS {
  constructor(e, n, r) {
    this.hasDefault = Object.prototype.hasOwnProperty.call(r, "default"), this.default = r.default, this.validate = typeof r.validate == "string" ? lS(e, n, r.validate) : r.validate;
  }
  get isRequired() {
    return !this.hasDefault;
  }
}
class ms {
  /**
  @internal
  */
  constructor(e, n, r, i) {
    this.name = e, this.rank = n, this.schema = r, this.spec = i, this.attrs = Pm(e, i.attrs), this.excluded = null;
    let o = Mm(this.attrs);
    this.instance = o ? new Ne(this, o) : null;
  }
  /**
  Create a mark of this type. `attrs` may be `null` or an object
  containing only some of the mark's attributes. The others, if
  they have defaults, will be added.
  */
  create(e = null) {
    return !e && this.instance ? this.instance : new Ne(this, Lm(this.attrs, e));
  }
  /**
  @internal
  */
  static compile(e, n) {
    let r = /* @__PURE__ */ Object.create(null), i = 0;
    return e.forEach((o, a) => r[o] = new ms(o, i++, n, a)), r;
  }
  /**
  When there is a mark of this type in the given set, a new set
  without it is returned. Otherwise, the input set is returned.
  */
  removeFromSet(e) {
    for (var n = 0; n < e.length; n++)
      e[n].type == this && (e = e.slice(0, n).concat(e.slice(n + 1)), n--);
    return e;
  }
  /**
  Tests whether there is a mark of this type in the given set.
  */
  isInSet(e) {
    for (let n = 0; n < e.length; n++)
      if (e[n].type == this)
        return e[n];
  }
  /**
  @internal
  */
  checkAttrs(e) {
    km(this.attrs, e, "mark", this.name);
  }
  /**
  Queries whether a given mark type is
  [excluded](https://prosemirror.net/docs/ref/#model.MarkSpec.excludes) by this one.
  */
  excludes(e) {
    return this.excluded.indexOf(e) > -1;
  }
}
class Bm {
  /**
  Construct a schema from a schema [specification](https://prosemirror.net/docs/ref/#model.SchemaSpec).
  */
  constructor(e) {
    this.linebreakReplacement = null, this.cached = /* @__PURE__ */ Object.create(null);
    let n = this.spec = {};
    for (let i in e)
      n[i] = e[i];
    n.nodes = Ze.from(e.nodes), n.marks = Ze.from(e.marks || {}), this.nodes = md.compile(this.spec.nodes, this), this.marks = ms.compile(this.spec.marks, this);
    let r = /* @__PURE__ */ Object.create(null);
    for (let i in this.nodes) {
      if (i in this.marks)
        throw new RangeError(i + " can not be both a node and a mark");
      let o = this.nodes[i], a = o.spec.content || "", s = o.spec.marks;
      if (o.contentMatch = r[a] || (r[a] = mr.parse(a, this.nodes)), o.inlineContent = o.contentMatch.inlineContent, o.spec.linebreakReplacement) {
        if (this.linebreakReplacement)
          throw new RangeError("Multiple linebreak nodes defined");
        if (!o.isInline || !o.isLeaf)
          throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");
        this.linebreakReplacement = o;
      }
      o.markSet = s == "_" ? null : s ? fd(this, s.split(" ")) : s == "" || !o.inlineContent ? [] : null;
    }
    for (let i in this.marks) {
      let o = this.marks[i], a = o.spec.excludes;
      o.excluded = a == null ? [o] : a == "" ? [] : fd(this, a.split(" "));
    }
    this.nodeFromJSON = this.nodeFromJSON.bind(this), this.markFromJSON = this.markFromJSON.bind(this), this.topNodeType = this.nodes[this.spec.topNode || "doc"], this.cached.wrappings = /* @__PURE__ */ Object.create(null);
  }
  /**
  Create a node in this schema. The `type` may be a string or a
  `NodeType` instance. Attributes will be extended with defaults,
  `content` may be a `Fragment`, `null`, a `Node`, or an array of
  nodes.
  */
  node(e, n = null, r, i) {
    if (typeof e == "string")
      e = this.nodeType(e);
    else if (e instanceof md) {
      if (e.schema != this)
        throw new RangeError("Node type from different schema used (" + e.name + ")");
    } else throw new RangeError("Invalid node type: " + e);
    return e.createChecked(n, r, i);
  }
  /**
  Create a text node in the schema. Empty text nodes are not
  allowed.
  */
  text(e, n) {
    let r = this.nodes.text;
    return new ma(r, r.defaultAttrs, e, Ne.setFrom(n));
  }
  /**
  Create a mark with the given type and attributes.
  */
  mark(e, n) {
    return typeof e == "string" && (e = this.marks[e]), e.create(n);
  }
  /**
  Deserialize a node from its JSON representation. This method is
  bound.
  */
  nodeFromJSON(e) {
    return Un.fromJSON(this, e);
  }
  /**
  Deserialize a mark from its JSON representation. This method is
  bound.
  */
  markFromJSON(e) {
    return Ne.fromJSON(this, e);
  }
  /**
  @internal
  */
  nodeType(e) {
    let n = this.nodes[e];
    if (!n)
      throw new RangeError("Unknown node type: " + e);
    return n;
  }
}
function fd(t, e) {
  let n = [];
  for (let r = 0; r < e.length; r++) {
    let i = e[r], o = t.marks[i], a = o;
    if (o)
      n.push(o);
    else
      for (let s in t.marks) {
        let l = t.marks[s];
        (i == "_" || l.spec.group && l.spec.group.split(" ").indexOf(i) > -1) && n.push(a = l);
      }
    if (!a)
      throw new SyntaxError("Unknown mark type: '" + e[r] + "'");
  }
  return n;
}
function uS(t) {
  return t.tag != null;
}
function dS(t) {
  return t.style != null;
}
let $r = class Kl {
  /**
  Create a parser that targets the given schema, using the given
  parsing rules.
  */
  constructor(e, n) {
    this.schema = e, this.rules = n, this.tags = [], this.styles = [];
    let r = this.matchedStyles = [];
    n.forEach((i) => {
      if (uS(i))
        this.tags.push(i);
      else if (dS(i)) {
        let o = /[^=]*/.exec(i.style)[0];
        r.indexOf(o) < 0 && r.push(o), this.styles.push(i);
      }
    }), this.normalizeLists = !this.tags.some((i) => {
      if (!/^(ul|ol)\b/.test(i.tag) || !i.node)
        return !1;
      let o = e.nodes[i.node];
      return o.contentMatch.matchType(o);
    });
  }
  /**
  Parse a document from the content of a DOM node.
  */
  parse(e, n = {}) {
    let r = new hd(this, n, !1);
    return r.addAll(e, Ne.none, n.from, n.to), r.finish();
  }
  /**
  Parses the content of the given DOM node, like
  [`parse`](https://prosemirror.net/docs/ref/#model.DOMParser.parse), and takes the same set of
  options. But unlike that method, which produces a whole node,
  this one returns a slice that is open at the sides, meaning that
  the schema constraints aren't applied to the start of nodes to
  the left of the input and the end of nodes at the end.
  */
  parseSlice(e, n = {}) {
    let r = new hd(this, n, !0);
    return r.addAll(e, Ne.none, n.from, n.to), H.maxOpen(r.finish());
  }
  /**
  @internal
  */
  matchTag(e, n, r) {
    for (let i = r ? this.tags.indexOf(r) + 1 : 0; i < this.tags.length; i++) {
      let o = this.tags[i];
      if (mS(e, o.tag) && (o.namespace === void 0 || e.namespaceURI == o.namespace) && (!o.context || n.matchesContext(o.context))) {
        if (o.getAttrs) {
          let a = o.getAttrs(e);
          if (a === !1)
            continue;
          o.attrs = a || void 0;
        }
        return o;
      }
    }
  }
  /**
  @internal
  */
  matchStyle(e, n, r, i) {
    for (let o = i ? this.styles.indexOf(i) + 1 : 0; o < this.styles.length; o++) {
      let a = this.styles[o], s = a.style;
      if (!(s.indexOf(e) != 0 || a.context && !r.matchesContext(a.context) || // Test that the style string either precisely matches the prop,
      // or has an '=' sign after the prop, followed by the given
      // value.
      s.length > e.length && (s.charCodeAt(e.length) != 61 || s.slice(e.length + 1) != n))) {
        if (a.getAttrs) {
          let l = a.getAttrs(n);
          if (l === !1)
            continue;
          a.attrs = l || void 0;
        }
        return a;
      }
    }
  }
  /**
  @internal
  */
  static schemaRules(e) {
    let n = [];
    function r(i) {
      let o = i.priority == null ? 50 : i.priority, a = 0;
      for (; a < n.length; a++) {
        let s = n[a];
        if ((s.priority == null ? 50 : s.priority) < o)
          break;
      }
      n.splice(a, 0, i);
    }
    for (let i in e.marks) {
      let o = e.marks[i].spec.parseDOM;
      o && o.forEach((a) => {
        r(a = Ed(a)), a.mark || a.ignore || a.clearMark || (a.mark = i);
      });
    }
    for (let i in e.nodes) {
      let o = e.nodes[i].spec.parseDOM;
      o && o.forEach((a) => {
        r(a = Ed(a)), a.node || a.ignore || a.mark || (a.node = i);
      });
    }
    return n;
  }
  /**
  Construct a DOM parser using the parsing rules listed in a
  schema's [node specs](https://prosemirror.net/docs/ref/#model.NodeSpec.parseDOM), reordered by
  [priority](https://prosemirror.net/docs/ref/#model.ParseRule.priority).
  */
  static fromSchema(e) {
    return e.cached.domParser || (e.cached.domParser = new Kl(e, Kl.schemaRules(e)));
  }
};
const Um = {
  address: !0,
  article: !0,
  aside: !0,
  blockquote: !0,
  canvas: !0,
  dd: !0,
  div: !0,
  dl: !0,
  fieldset: !0,
  figcaption: !0,
  figure: !0,
  footer: !0,
  form: !0,
  h1: !0,
  h2: !0,
  h3: !0,
  h4: !0,
  h5: !0,
  h6: !0,
  header: !0,
  hgroup: !0,
  hr: !0,
  li: !0,
  noscript: !0,
  ol: !0,
  output: !0,
  p: !0,
  pre: !0,
  section: !0,
  table: !0,
  tfoot: !0,
  ul: !0
}, pS = {
  head: !0,
  noscript: !0,
  object: !0,
  script: !0,
  style: !0,
  title: !0
}, Hm = { ol: !0, ul: !0 }, zi = 1, Ql = 2, Di = 4;
function gd(t, e, n) {
  return e != null ? (e ? zi : 0) | (e === "full" ? Ql : 0) : t && t.whitespace == "pre" ? zi | Ql : n & ~Di;
}
class xo {
  constructor(e, n, r, i, o, a) {
    this.type = e, this.attrs = n, this.marks = r, this.solid = i, this.options = a, this.content = [], this.activeMarks = Ne.none, this.match = o || (a & Di ? null : e.contentMatch);
  }
  findWrapping(e) {
    if (!this.match) {
      if (!this.type)
        return [];
      let n = this.type.contentMatch.fillBefore(L.from(e));
      if (n)
        this.match = this.type.contentMatch.matchFragment(n);
      else {
        let r = this.type.contentMatch, i;
        return (i = r.findWrapping(e.type)) ? (this.match = r, i) : null;
      }
    }
    return this.match.findWrapping(e.type);
  }
  finish(e) {
    if (!(this.options & zi)) {
      let r = this.content[this.content.length - 1], i;
      if (r && r.isText && (i = /[ \t\r\n\u000c]+$/.exec(r.text))) {
        let o = r;
        r.text.length == i[0].length ? this.content.pop() : this.content[this.content.length - 1] = o.withText(o.text.slice(0, o.text.length - i[0].length));
      }
    }
    let n = L.from(this.content);
    return !e && this.match && (n = n.append(this.match.fillBefore(L.empty, !0))), this.type ? this.type.create(this.attrs, n, this.marks) : n;
  }
  inlineContext(e) {
    return this.type ? this.type.inlineContent : this.content.length ? this.content[0].isInline : e.parentNode && !Um.hasOwnProperty(e.parentNode.nodeName.toLowerCase());
  }
}
class hd {
  constructor(e, n, r) {
    this.parser = e, this.options = n, this.isOpen = r, this.open = 0, this.localPreserveWS = !1;
    let i = n.topNode, o, a = gd(null, n.preserveWhitespace, 0) | (r ? Di : 0);
    i ? o = new xo(i.type, i.attrs, Ne.none, !0, n.topMatch || i.type.contentMatch, a) : r ? o = new xo(null, null, Ne.none, !0, null, a) : o = new xo(e.schema.topNodeType, null, Ne.none, !0, null, a), this.nodes = [o], this.find = n.findPositions, this.needsBlock = !1;
  }
  get top() {
    return this.nodes[this.open];
  }
  // Add a DOM node to the content. Text is inserted as text node,
  // otherwise, the node is passed to `addElement` or, if it has a
  // `style` attribute, `addElementWithStyles`.
  addDOM(e, n) {
    e.nodeType == 3 ? this.addTextNode(e, n) : e.nodeType == 1 && this.addElement(e, n);
  }
  addTextNode(e, n) {
    let r = e.nodeValue, i = this.top, o = i.options & Ql ? "full" : this.localPreserveWS || (i.options & zi) > 0;
    if (o === "full" || i.inlineContext(e) || /[^ \t\r\n\u000c]/.test(r)) {
      if (o)
        o !== "full" ? r = r.replace(/\r?\n|\r/g, " ") : r = r.replace(/\r\n?/g, `
`);
      else if (r = r.replace(/[ \t\r\n\u000c]+/g, " "), /^[ \t\r\n\u000c]/.test(r) && this.open == this.nodes.length - 1) {
        let a = i.content[i.content.length - 1], s = e.previousSibling;
        (!a || s && s.nodeName == "BR" || a.isText && /[ \t\r\n\u000c]$/.test(a.text)) && (r = r.slice(1));
      }
      r && this.insertNode(this.parser.schema.text(r), n), this.findInText(e);
    } else
      this.findInside(e);
  }
  // Try to find a handler for the given tag and use that to parse. If
  // none is found, the element's content nodes are added directly.
  addElement(e, n, r) {
    let i = this.localPreserveWS, o = this.top;
    (e.tagName == "PRE" || /pre/.test(e.style && e.style.whiteSpace)) && (this.localPreserveWS = !0);
    let a = e.nodeName.toLowerCase(), s;
    Hm.hasOwnProperty(a) && this.parser.normalizeLists && _S(e);
    let l = this.options.ruleFromNode && this.options.ruleFromNode(e) || (s = this.parser.matchTag(e, this, r));
    e: if (l ? l.ignore : pS.hasOwnProperty(a))
      this.findInside(e), this.ignoreFallback(e, n);
    else if (!l || l.skip || l.closeParent) {
      l && l.closeParent ? this.open = Math.max(0, this.open - 1) : l && l.skip.nodeType && (e = l.skip);
      let c, u = this.needsBlock;
      if (Um.hasOwnProperty(a))
        o.content.length && o.content[0].isInline && this.open && (this.open--, o = this.top), c = !0, o.type || (this.needsBlock = !0);
      else if (!e.firstChild) {
        this.leafFallback(e, n);
        break e;
      }
      let d = l && l.skip ? n : this.readStyles(e, n);
      d && this.addAll(e, d), c && this.sync(o), this.needsBlock = u;
    } else {
      let c = this.readStyles(e, n);
      c && this.addElementByRule(e, l, c, l.consuming === !1 ? s : void 0);
    }
    this.localPreserveWS = i;
  }
  // Called for leaf DOM nodes that would otherwise be ignored
  leafFallback(e, n) {
    e.nodeName == "BR" && this.top.type && this.top.type.inlineContent && this.addTextNode(e.ownerDocument.createTextNode(`
`), n);
  }
  // Called for ignored nodes
  ignoreFallback(e, n) {
    e.nodeName == "BR" && (!this.top.type || !this.top.type.inlineContent) && this.findPlace(this.parser.schema.text("-"), n);
  }
  // Run any style parser associated with the node's styles. Either
  // return an updated array of marks, or null to indicate some of the
  // styles had a rule with `ignore` set.
  readStyles(e, n) {
    let r = e.style;
    if (r && r.length)
      for (let i = 0; i < this.parser.matchedStyles.length; i++) {
        let o = this.parser.matchedStyles[i], a = r.getPropertyValue(o);
        if (a)
          for (let s = void 0; ; ) {
            let l = this.parser.matchStyle(o, a, this, s);
            if (!l)
              break;
            if (l.ignore)
              return null;
            if (l.clearMark ? n = n.filter((c) => !l.clearMark(c)) : n = n.concat(this.parser.schema.marks[l.mark].create(l.attrs)), l.consuming === !1)
              s = l;
            else
              break;
          }
      }
    return n;
  }
  // Look up a handler for the given node. If none are found, return
  // false. Otherwise, apply it, use its return value to drive the way
  // the node's content is wrapped, and return true.
  addElementByRule(e, n, r, i) {
    let o, a;
    if (n.node)
      if (a = this.parser.schema.nodes[n.node], a.isLeaf)
        this.insertNode(a.create(n.attrs), r) || this.leafFallback(e, r);
      else {
        let l = this.enter(a, n.attrs || null, r, n.preserveWhitespace);
        l && (o = !0, r = l);
      }
    else {
      let l = this.parser.schema.marks[n.mark];
      r = r.concat(l.create(n.attrs));
    }
    let s = this.top;
    if (a && a.isLeaf)
      this.findInside(e);
    else if (i)
      this.addElement(e, r, i);
    else if (n.getContent)
      this.findInside(e), n.getContent(e, this.parser.schema).forEach((l) => this.insertNode(l, r));
    else {
      let l = e;
      typeof n.contentElement == "string" ? l = e.querySelector(n.contentElement) : typeof n.contentElement == "function" ? l = n.contentElement(e) : n.contentElement && (l = n.contentElement), this.findAround(e, l, !0), this.addAll(l, r), this.findAround(e, l, !1);
    }
    o && this.sync(s) && this.open--;
  }
  // Add all child nodes between `startIndex` and `endIndex` (or the
  // whole node, if not given). If `sync` is passed, use it to
  // synchronize after every block element.
  addAll(e, n, r, i) {
    let o = r || 0;
    for (let a = r ? e.childNodes[r] : e.firstChild, s = i == null ? null : e.childNodes[i]; a != s; a = a.nextSibling, ++o)
      this.findAtPoint(e, o), this.addDOM(a, n);
    this.findAtPoint(e, o);
  }
  // Try to find a way to fit the given node type into the current
  // context. May add intermediate wrappers and/or leave non-solid
  // nodes that we're in.
  findPlace(e, n) {
    let r, i;
    for (let o = this.open; o >= 0; o--) {
      let a = this.nodes[o], s = a.findWrapping(e);
      if (s && (!r || r.length > s.length) && (r = s, i = a, !s.length) || a.solid)
        break;
    }
    if (!r)
      return null;
    this.sync(i);
    for (let o = 0; o < r.length; o++)
      n = this.enterInner(r[o], null, n, !1);
    return n;
  }
  // Try to insert the given node, adjusting the context when needed.
  insertNode(e, n) {
    if (e.isInline && this.needsBlock && !this.top.type) {
      let i = this.textblockFromContext();
      i && (n = this.enterInner(i, null, n));
    }
    let r = this.findPlace(e, n);
    if (r) {
      this.closeExtra();
      let i = this.top;
      i.match && (i.match = i.match.matchType(e.type));
      let o = Ne.none;
      for (let a of r.concat(e.marks))
        (i.type ? i.type.allowsMarkType(a.type) : Sd(a.type, e.type)) && (o = a.addToSet(o));
      return i.content.push(e.mark(o)), !0;
    }
    return !1;
  }
  // Try to start a node of the given type, adjusting the context when
  // necessary.
  enter(e, n, r, i) {
    let o = this.findPlace(e.create(n), r);
    return o && (o = this.enterInner(e, n, r, !0, i)), o;
  }
  // Open a node of the given type
  enterInner(e, n, r, i = !1, o) {
    this.closeExtra();
    let a = this.top;
    a.match = a.match && a.match.matchType(e);
    let s = gd(e, o, a.options);
    a.options & Di && a.content.length == 0 && (s |= Di);
    let l = Ne.none;
    return r = r.filter((c) => (a.type ? a.type.allowsMarkType(c.type) : Sd(c.type, e)) ? (l = c.addToSet(l), !1) : !0), this.nodes.push(new xo(e, n, l, i, null, s)), this.open++, r;
  }
  // Make sure all nodes above this.open are finished and added to
  // their parents
  closeExtra(e = !1) {
    let n = this.nodes.length - 1;
    if (n > this.open) {
      for (; n > this.open; n--)
        this.nodes[n - 1].content.push(this.nodes[n].finish(e));
      this.nodes.length = this.open + 1;
    }
  }
  finish() {
    return this.open = 0, this.closeExtra(this.isOpen), this.nodes[0].finish(!!(this.isOpen || this.options.topOpen));
  }
  sync(e) {
    for (let n = this.open; n >= 0; n--) {
      if (this.nodes[n] == e)
        return this.open = n, !0;
      this.localPreserveWS && (this.nodes[n].options |= zi);
    }
    return !1;
  }
  get currentPos() {
    this.closeExtra();
    let e = 0;
    for (let n = this.open; n >= 0; n--) {
      let r = this.nodes[n].content;
      for (let i = r.length - 1; i >= 0; i--)
        e += r[i].nodeSize;
      n && e++;
    }
    return e;
  }
  findAtPoint(e, n) {
    if (this.find)
      for (let r = 0; r < this.find.length; r++)
        this.find[r].node == e && this.find[r].offset == n && (this.find[r].pos = this.currentPos);
  }
  findInside(e) {
    if (this.find)
      for (let n = 0; n < this.find.length; n++)
        this.find[n].pos == null && e.nodeType == 1 && e.contains(this.find[n].node) && (this.find[n].pos = this.currentPos);
  }
  findAround(e, n, r) {
    if (e != n && this.find)
      for (let i = 0; i < this.find.length; i++)
        this.find[i].pos == null && e.nodeType == 1 && e.contains(this.find[i].node) && n.compareDocumentPosition(this.find[i].node) & (r ? 2 : 4) && (this.find[i].pos = this.currentPos);
  }
  findInText(e) {
    if (this.find)
      for (let n = 0; n < this.find.length; n++)
        this.find[n].node == e && (this.find[n].pos = this.currentPos - (e.nodeValue.length - this.find[n].offset));
  }
  // Determines whether the given context string matches this context.
  matchesContext(e) {
    if (e.indexOf("|") > -1)
      return e.split(/\s*\|\s*/).some(this.matchesContext, this);
    let n = e.split("/"), r = this.options.context, i = !this.isOpen && (!r || r.parent.type == this.nodes[0].type), o = -(r ? r.depth + 1 : 0) + (i ? 0 : 1), a = (s, l) => {
      for (; s >= 0; s--) {
        let c = n[s];
        if (c == "") {
          if (s == n.length - 1 || s == 0)
            continue;
          for (; l >= o; l--)
            if (a(s - 1, l))
              return !0;
          return !1;
        } else {
          let u = l > 0 || l == 0 && i ? this.nodes[l].type : r && l >= o ? r.node(l - o).type : null;
          if (!u || u.name != c && !u.isInGroup(c))
            return !1;
          l--;
        }
      }
      return !0;
    };
    return a(n.length - 1, this.open);
  }
  textblockFromContext() {
    let e = this.options.context;
    if (e)
      for (let n = e.depth; n >= 0; n--) {
        let r = e.node(n).contentMatchAt(e.indexAfter(n)).defaultType;
        if (r && r.isTextblock && r.defaultAttrs)
          return r;
      }
    for (let n in this.parser.schema.nodes) {
      let r = this.parser.schema.nodes[n];
      if (r.isTextblock && r.defaultAttrs)
        return r;
    }
  }
}
function _S(t) {
  for (let e = t.firstChild, n = null; e; e = e.nextSibling) {
    let r = e.nodeType == 1 ? e.nodeName.toLowerCase() : null;
    r && Hm.hasOwnProperty(r) && n ? (n.appendChild(e), e = n) : r == "li" ? n = e : r && (n = null);
  }
}
function mS(t, e) {
  return (t.matches || t.msMatchesSelector || t.webkitMatchesSelector || t.mozMatchesSelector).call(t, e);
}
function Ed(t) {
  let e = {};
  for (let n in t)
    e[n] = t[n];
  return e;
}
function Sd(t, e) {
  let n = e.schema.nodes;
  for (let r in n) {
    let i = n[r];
    if (!i.allowsMarkType(t))
      continue;
    let o = [], a = (s) => {
      o.push(s);
      for (let l = 0; l < s.edgeCount; l++) {
        let { type: c, next: u } = s.edge(l);
        if (c == e || o.indexOf(u) < 0 && a(u))
          return !0;
      }
    };
    if (a(i.contentMatch))
      return !0;
  }
}
class Cr {
  /**
  Create a serializer. `nodes` should map node names to functions
  that take a node and return a description of the corresponding
  DOM. `marks` does the same for mark names, but also gets an
  argument that tells it whether the mark's content is block or
  inline content (for typical use, it'll always be inline). A mark
  serializer may be `null` to indicate that marks of that type
  should not be serialized.
  */
  constructor(e, n) {
    this.nodes = e, this.marks = n;
  }
  /**
  Serialize the content of this fragment to a DOM fragment. When
  not in the browser, the `document` option, containing a DOM
  document, should be passed so that the serializer can create
  nodes.
  */
  serializeFragment(e, n = {}, r) {
    r || (r = Ws(n).createDocumentFragment());
    let i = r, o = [];
    return e.forEach((a) => {
      if (o.length || a.marks.length) {
        let s = 0, l = 0;
        for (; s < o.length && l < a.marks.length; ) {
          let c = a.marks[l];
          if (!this.marks[c.type.name]) {
            l++;
            continue;
          }
          if (!c.eq(o[s][0]) || c.type.spec.spanning === !1)
            break;
          s++, l++;
        }
        for (; s < o.length; )
          i = o.pop()[1];
        for (; l < a.marks.length; ) {
          let c = a.marks[l++], u = this.serializeMark(c, a.isInline, n);
          u && (o.push([c, i]), i.appendChild(u.dom), i = u.contentDOM || u.dom);
        }
      }
      i.appendChild(this.serializeNodeInner(a, n));
    }), r;
  }
  /**
  @internal
  */
  serializeNodeInner(e, n) {
    let { dom: r, contentDOM: i } = na(Ws(n), this.nodes[e.type.name](e), null, e.attrs);
    if (i) {
      if (e.isLeaf)
        throw new RangeError("Content hole not allowed in a leaf node spec");
      this.serializeFragment(e.content, n, i);
    }
    return r;
  }
  /**
  Serialize this node to a DOM node. This can be useful when you
  need to serialize a part of a document, as opposed to the whole
  document. To serialize a whole document, use
  [`serializeFragment`](https://prosemirror.net/docs/ref/#model.DOMSerializer.serializeFragment) on
  its [content](https://prosemirror.net/docs/ref/#model.Node.content).
  */
  serializeNode(e, n = {}) {
    let r = this.serializeNodeInner(e, n);
    for (let i = e.marks.length - 1; i >= 0; i--) {
      let o = this.serializeMark(e.marks[i], e.isInline, n);
      o && ((o.contentDOM || o.dom).appendChild(r), r = o.dom);
    }
    return r;
  }
  /**
  @internal
  */
  serializeMark(e, n, r = {}) {
    let i = this.marks[e.type.name];
    return i && na(Ws(r), i(e, n), null, e.attrs);
  }
  static renderSpec(e, n, r = null, i) {
    return na(e, n, r, i);
  }
  /**
  Build a serializer using the [`toDOM`](https://prosemirror.net/docs/ref/#model.NodeSpec.toDOM)
  properties in a schema's node and mark specs.
  */
  static fromSchema(e) {
    return e.cached.domSerializer || (e.cached.domSerializer = new Cr(this.nodesFromSchema(e), this.marksFromSchema(e)));
  }
  /**
  Gather the serializers in a schema's node specs into an object.
  This can be useful as a base to build a custom serializer from.
  */
  static nodesFromSchema(e) {
    let n = bd(e.nodes);
    return n.text || (n.text = (r) => r.text), n;
  }
  /**
  Gather the serializers in a schema's mark specs into an object.
  */
  static marksFromSchema(e) {
    return bd(e.marks);
  }
}
function bd(t) {
  let e = {};
  for (let n in t) {
    let r = t[n].spec.toDOM;
    r && (e[n] = r);
  }
  return e;
}
function Ws(t) {
  return t.document || window.document;
}
const Td = /* @__PURE__ */ new WeakMap();
function fS(t) {
  let e = Td.get(t);
  return e === void 0 && Td.set(t, e = gS(t)), e;
}
function gS(t) {
  let e = null;
  function n(r) {
    if (r && typeof r == "object")
      if (Array.isArray(r))
        if (typeof r[0] == "string")
          e || (e = []), e.push(r);
        else
          for (let i = 0; i < r.length; i++)
            n(r[i]);
      else
        for (let i in r)
          n(r[i]);
  }
  return n(t), e;
}
function na(t, e, n, r) {
  if (typeof e == "string")
    return { dom: t.createTextNode(e) };
  if (e.nodeType != null)
    return { dom: e };
  if (e.dom && e.dom.nodeType != null)
    return e;
  let i = e[0], o;
  if (typeof i != "string")
    throw new RangeError("Invalid array passed to renderSpec");
  if (r && (o = fS(r)) && o.indexOf(e) > -1)
    throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");
  let a = i.indexOf(" ");
  a > 0 && (n = i.slice(0, a), i = i.slice(a + 1));
  let s, l = n ? t.createElementNS(n, i) : t.createElement(i), c = e[1], u = 1;
  if (c && typeof c == "object" && c.nodeType == null && !Array.isArray(c)) {
    u = 2;
    for (let d in c)
      if (c[d] != null) {
        let p = d.indexOf(" ");
        p > 0 ? l.setAttributeNS(d.slice(0, p), d.slice(p + 1), c[d]) : l.setAttribute(d, c[d]);
      }
  }
  for (let d = u; d < e.length; d++) {
    let p = e[d];
    if (p === 0) {
      if (d < e.length - 1 || d > u)
        throw new RangeError("Content hole must be the only child of its parent node");
      return { dom: l, contentDOM: l };
    } else {
      let { dom: _, contentDOM: m } = na(t, p, n, r);
      if (l.appendChild(_), m) {
        if (s)
          throw new RangeError("Multiple content holes");
        s = m;
      }
    }
  }
  return { dom: l, contentDOM: s };
}
const Gm = 65535, Vm = Math.pow(2, 16);
function hS(t, e) {
  return t + e * Vm;
}
function Cd(t) {
  return t & Gm;
}
function ES(t) {
  return (t - (t & Gm)) / Vm;
}
const Ym = 1, $m = 2, ra = 4, zm = 8;
class Zl {
  /**
  @internal
  */
  constructor(e, n, r) {
    this.pos = e, this.delInfo = n, this.recover = r;
  }
  /**
  Tells you whether the position was deleted, that is, whether the
  step removed the token on the side queried (via the `assoc`)
  argument from the document.
  */
  get deleted() {
    return (this.delInfo & zm) > 0;
  }
  /**
  Tells you whether the token before the mapped position was deleted.
  */
  get deletedBefore() {
    return (this.delInfo & (Ym | ra)) > 0;
  }
  /**
  True when the token after the mapped position was deleted.
  */
  get deletedAfter() {
    return (this.delInfo & ($m | ra)) > 0;
  }
  /**
  Tells whether any of the steps mapped through deletes across the
  position (including both the token before and after the
  position).
  */
  get deletedAcross() {
    return (this.delInfo & ra) > 0;
  }
}
class yt {
  /**
  Create a position map. The modifications to the document are
  represented as an array of numbers, in which each group of three
  represents a modified chunk as `[start, oldSize, newSize]`.
  */
  constructor(e, n = !1) {
    if (this.ranges = e, this.inverted = n, !e.length && yt.empty)
      return yt.empty;
  }
  /**
  @internal
  */
  recover(e) {
    let n = 0, r = Cd(e);
    if (!this.inverted)
      for (let i = 0; i < r; i++)
        n += this.ranges[i * 3 + 2] - this.ranges[i * 3 + 1];
    return this.ranges[r * 3] + n + ES(e);
  }
  mapResult(e, n = 1) {
    return this._map(e, n, !1);
  }
  map(e, n = 1) {
    return this._map(e, n, !0);
  }
  /**
  @internal
  */
  _map(e, n, r) {
    let i = 0, o = this.inverted ? 2 : 1, a = this.inverted ? 1 : 2;
    for (let s = 0; s < this.ranges.length; s += 3) {
      let l = this.ranges[s] - (this.inverted ? i : 0);
      if (l > e)
        break;
      let c = this.ranges[s + o], u = this.ranges[s + a], d = l + c;
      if (e <= d) {
        let p = c ? e == l ? -1 : e == d ? 1 : n : n, _ = l + i + (p < 0 ? 0 : u);
        if (r)
          return _;
        let m = e == (n < 0 ? l : d) ? null : hS(s / 3, e - l), f = e == l ? $m : e == d ? Ym : ra;
        return (n < 0 ? e != l : e != d) && (f |= zm), new Zl(_, f, m);
      }
      i += u - c;
    }
    return r ? e + i : new Zl(e + i, 0, null);
  }
  /**
  @internal
  */
  touches(e, n) {
    let r = 0, i = Cd(n), o = this.inverted ? 2 : 1, a = this.inverted ? 1 : 2;
    for (let s = 0; s < this.ranges.length; s += 3) {
      let l = this.ranges[s] - (this.inverted ? r : 0);
      if (l > e)
        break;
      let c = this.ranges[s + o], u = l + c;
      if (e <= u && s == i * 3)
        return !0;
      r += this.ranges[s + a] - c;
    }
    return !1;
  }
  /**
  Calls the given function on each of the changed ranges included in
  this map.
  */
  forEach(e) {
    let n = this.inverted ? 2 : 1, r = this.inverted ? 1 : 2;
    for (let i = 0, o = 0; i < this.ranges.length; i += 3) {
      let a = this.ranges[i], s = a - (this.inverted ? o : 0), l = a + (this.inverted ? 0 : o), c = this.ranges[i + n], u = this.ranges[i + r];
      e(s, s + c, l, l + u), o += u - c;
    }
  }
  /**
  Create an inverted version of this map. The result can be used to
  map positions in the post-step document to the pre-step document.
  */
  invert() {
    return new yt(this.ranges, !this.inverted);
  }
  /**
  @internal
  */
  toString() {
    return (this.inverted ? "-" : "") + JSON.stringify(this.ranges);
  }
  /**
  Create a map that moves all positions by offset `n` (which may be
  negative). This can be useful when applying steps meant for a
  sub-document to a larger document, or vice-versa.
  */
  static offset(e) {
    return e == 0 ? yt.empty : new yt(e < 0 ? [0, -e, 0] : [0, 0, e]);
  }
}
yt.empty = new yt([]);
class zr {
  /**
  Create a new mapping with the given position maps.
  */
  constructor(e = [], n, r = 0, i = e.length) {
    this.maps = e, this.mirror = n, this.from = r, this.to = i;
  }
  /**
  Create a mapping that maps only through a part of this one.
  */
  slice(e = 0, n = this.maps.length) {
    return new zr(this.maps, this.mirror, e, n);
  }
  /**
  @internal
  */
  copy() {
    return new zr(this.maps.slice(), this.mirror && this.mirror.slice(), this.from, this.to);
  }
  /**
  Add a step map to the end of this mapping. If `mirrors` is
  given, it should be the index of the step map that is the mirror
  image of this one.
  */
  appendMap(e, n) {
    this.to = this.maps.push(e), n != null && this.setMirror(this.maps.length - 1, n);
  }
  /**
  Add all the step maps in a given mapping to this one (preserving
  mirroring information).
  */
  appendMapping(e) {
    for (let n = 0, r = this.maps.length; n < e.maps.length; n++) {
      let i = e.getMirror(n);
      this.appendMap(e.maps[n], i != null && i < n ? r + i : void 0);
    }
  }
  /**
  Finds the offset of the step map that mirrors the map at the
  given offset, in this mapping (as per the second argument to
  `appendMap`).
  */
  getMirror(e) {
    if (this.mirror) {
      for (let n = 0; n < this.mirror.length; n++)
        if (this.mirror[n] == e)
          return this.mirror[n + (n % 2 ? -1 : 1)];
    }
  }
  /**
  @internal
  */
  setMirror(e, n) {
    this.mirror || (this.mirror = []), this.mirror.push(e, n);
  }
  /**
  Append the inverse of the given mapping to this one.
  */
  appendMappingInverted(e) {
    for (let n = e.maps.length - 1, r = this.maps.length + e.maps.length; n >= 0; n--) {
      let i = e.getMirror(n);
      this.appendMap(e.maps[n].invert(), i != null && i > n ? r - i - 1 : void 0);
    }
  }
  /**
  Create an inverted version of this mapping.
  */
  invert() {
    let e = new zr();
    return e.appendMappingInverted(this), e;
  }
  /**
  Map a position through this mapping.
  */
  map(e, n = 1) {
    if (this.mirror)
      return this._map(e, n, !0);
    for (let r = this.from; r < this.to; r++)
      e = this.maps[r].map(e, n);
    return e;
  }
  /**
  Map a position through this mapping, returning a mapping
  result.
  */
  mapResult(e, n = 1) {
    return this._map(e, n, !1);
  }
  /**
  @internal
  */
  _map(e, n, r) {
    let i = 0;
    for (let o = this.from; o < this.to; o++) {
      let a = this.maps[o], s = a.mapResult(e, n);
      if (s.recover != null) {
        let l = this.getMirror(o);
        if (l != null && l > o && l < this.to) {
          o = l, e = this.maps[l].recover(s.recover);
          continue;
        }
      }
      i |= s.delInfo, e = s.pos;
    }
    return r ? e : new Zl(e, i, null);
  }
}
const Ks = /* @__PURE__ */ Object.create(null);
class ot {
  /**
  Get the step map that represents the changes made by this step,
  and which can be used to transform between positions in the old
  and the new document.
  */
  getMap() {
    return yt.empty;
  }
  /**
  Try to merge this step with another one, to be applied directly
  after it. Returns the merged step when possible, null if the
  steps can't be merged.
  */
  merge(e) {
    return null;
  }
  /**
  Deserialize a step from its JSON representation. Will call
  through to the step class' own implementation of this method.
  */
  static fromJSON(e, n) {
    if (!n || !n.stepType)
      throw new RangeError("Invalid input for Step.fromJSON");
    let r = Ks[n.stepType];
    if (!r)
      throw new RangeError(`No step type ${n.stepType} defined`);
    return r.fromJSON(e, n);
  }
  /**
  To be able to serialize steps to JSON, each step needs a string
  ID to attach to its JSON representation. Use this method to
  register an ID for your step classes. Try to pick something
  that's unlikely to clash with steps from other modules.
  */
  static jsonID(e, n) {
    if (e in Ks)
      throw new RangeError("Duplicate use of step JSON ID " + e);
    return Ks[e] = n, n.prototype.jsonID = e, n;
  }
}
class Ue {
  /**
  @internal
  */
  constructor(e, n) {
    this.doc = e, this.failed = n;
  }
  /**
  Create a successful step result.
  */
  static ok(e) {
    return new Ue(e, null);
  }
  /**
  Create a failed step result.
  */
  static fail(e) {
    return new Ue(null, e);
  }
  /**
  Call [`Node.replace`](https://prosemirror.net/docs/ref/#model.Node.replace) with the given
  arguments. Create a successful result if it succeeds, and a
  failed one if it throws a `ReplaceError`.
  */
  static fromReplace(e, n, r, i) {
    try {
      return Ue.ok(e.replace(n, r, i));
    } catch (o) {
      if (o instanceof da)
        return Ue.fail(o.message);
      throw o;
    }
  }
}
function Gc(t, e, n) {
  let r = [];
  for (let i = 0; i < t.childCount; i++) {
    let o = t.child(i);
    o.content.size && (o = o.copy(Gc(o.content, e, o))), o.isInline && (o = e(o, n, i)), r.push(o);
  }
  return L.fromArray(r);
}
class wn extends ot {
  /**
  Create a mark step.
  */
  constructor(e, n, r) {
    super(), this.from = e, this.to = n, this.mark = r;
  }
  apply(e) {
    let n = e.slice(this.from, this.to), r = e.resolve(this.from), i = r.node(r.sharedDepth(this.to)), o = new H(Gc(n.content, (a, s) => !a.isAtom || !s.type.allowsMarkType(this.mark.type) ? a : a.mark(this.mark.addToSet(a.marks)), i), n.openStart, n.openEnd);
    return Ue.fromReplace(e, this.from, this.to, o);
  }
  invert() {
    return new Zt(this.from, this.to, this.mark);
  }
  map(e) {
    let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
    return n.deleted && r.deleted || n.pos >= r.pos ? null : new wn(n.pos, r.pos, this.mark);
  }
  merge(e) {
    return e instanceof wn && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new wn(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
  }
  toJSON() {
    return {
      stepType: "addMark",
      mark: this.mark.toJSON(),
      from: this.from,
      to: this.to
    };
  }
  /**
  @internal
  */
  static fromJSON(e, n) {
    if (typeof n.from != "number" || typeof n.to != "number")
      throw new RangeError("Invalid input for AddMarkStep.fromJSON");
    return new wn(n.from, n.to, e.markFromJSON(n.mark));
  }
}
ot.jsonID("addMark", wn);
class Zt extends ot {
  /**
  Create a mark-removing step.
  */
  constructor(e, n, r) {
    super(), this.from = e, this.to = n, this.mark = r;
  }
  apply(e) {
    let n = e.slice(this.from, this.to), r = new H(Gc(n.content, (i) => i.mark(this.mark.removeFromSet(i.marks)), e), n.openStart, n.openEnd);
    return Ue.fromReplace(e, this.from, this.to, r);
  }
  invert() {
    return new wn(this.from, this.to, this.mark);
  }
  map(e) {
    let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
    return n.deleted && r.deleted || n.pos >= r.pos ? null : new Zt(n.pos, r.pos, this.mark);
  }
  merge(e) {
    return e instanceof Zt && e.mark.eq(this.mark) && this.from <= e.to && this.to >= e.from ? new Zt(Math.min(this.from, e.from), Math.max(this.to, e.to), this.mark) : null;
  }
  toJSON() {
    return {
      stepType: "removeMark",
      mark: this.mark.toJSON(),
      from: this.from,
      to: this.to
    };
  }
  /**
  @internal
  */
  static fromJSON(e, n) {
    if (typeof n.from != "number" || typeof n.to != "number")
      throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");
    return new Zt(n.from, n.to, e.markFromJSON(n.mark));
  }
}
ot.jsonID("removeMark", Zt);
class Mn extends ot {
  /**
  Create a node mark step.
  */
  constructor(e, n) {
    super(), this.pos = e, this.mark = n;
  }
  apply(e) {
    let n = e.nodeAt(this.pos);
    if (!n)
      return Ue.fail("No node at mark step's position");
    let r = n.type.create(n.attrs, null, this.mark.addToSet(n.marks));
    return Ue.fromReplace(e, this.pos, this.pos + 1, new H(L.from(r), 0, n.isLeaf ? 0 : 1));
  }
  invert(e) {
    let n = e.nodeAt(this.pos);
    if (n) {
      let r = this.mark.addToSet(n.marks);
      if (r.length == n.marks.length) {
        for (let i = 0; i < n.marks.length; i++)
          if (!n.marks[i].isInSet(r))
            return new Mn(this.pos, n.marks[i]);
        return new Mn(this.pos, this.mark);
      }
    }
    return new Zr(this.pos, this.mark);
  }
  map(e) {
    let n = e.mapResult(this.pos, 1);
    return n.deletedAfter ? null : new Mn(n.pos, this.mark);
  }
  toJSON() {
    return { stepType: "addNodeMark", pos: this.pos, mark: this.mark.toJSON() };
  }
  /**
  @internal
  */
  static fromJSON(e, n) {
    if (typeof n.pos != "number")
      throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");
    return new Mn(n.pos, e.markFromJSON(n.mark));
  }
}
ot.jsonID("addNodeMark", Mn);
class Zr extends ot {
  /**
  Create a mark-removing step.
  */
  constructor(e, n) {
    super(), this.pos = e, this.mark = n;
  }
  apply(e) {
    let n = e.nodeAt(this.pos);
    if (!n)
      return Ue.fail("No node at mark step's position");
    let r = n.type.create(n.attrs, null, this.mark.removeFromSet(n.marks));
    return Ue.fromReplace(e, this.pos, this.pos + 1, new H(L.from(r), 0, n.isLeaf ? 0 : 1));
  }
  invert(e) {
    let n = e.nodeAt(this.pos);
    return !n || !this.mark.isInSet(n.marks) ? this : new Mn(this.pos, this.mark);
  }
  map(e) {
    let n = e.mapResult(this.pos, 1);
    return n.deletedAfter ? null : new Zr(n.pos, this.mark);
  }
  toJSON() {
    return { stepType: "removeNodeMark", pos: this.pos, mark: this.mark.toJSON() };
  }
  /**
  @internal
  */
  static fromJSON(e, n) {
    if (typeof n.pos != "number")
      throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");
    return new Zr(n.pos, e.markFromJSON(n.mark));
  }
}
ot.jsonID("removeNodeMark", Zr);
class He extends ot {
  /**
  The given `slice` should fit the 'gap' between `from` and
  `to`—the depths must line up, and the surrounding nodes must be
  able to be joined with the open sides of the slice. When
  `structure` is true, the step will fail if the content between
  from and to is not just a sequence of closing and then opening
  tokens (this is to guard against rebased replace steps
  overwriting something they weren't supposed to).
  */
  constructor(e, n, r, i = !1) {
    super(), this.from = e, this.to = n, this.slice = r, this.structure = i;
  }
  apply(e) {
    return this.structure && Xl(e, this.from, this.to) ? Ue.fail("Structure replace would overwrite content") : Ue.fromReplace(e, this.from, this.to, this.slice);
  }
  getMap() {
    return new yt([this.from, this.to - this.from, this.slice.size]);
  }
  invert(e) {
    return new He(this.from, this.from + this.slice.size, e.slice(this.from, this.to));
  }
  map(e) {
    let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1);
    return n.deletedAcross && r.deletedAcross ? null : new He(n.pos, Math.max(n.pos, r.pos), this.slice);
  }
  merge(e) {
    if (!(e instanceof He) || e.structure || this.structure)
      return null;
    if (this.from + this.slice.size == e.from && !this.slice.openEnd && !e.slice.openStart) {
      let n = this.slice.size + e.slice.size == 0 ? H.empty : new H(this.slice.content.append(e.slice.content), this.slice.openStart, e.slice.openEnd);
      return new He(this.from, this.to + (e.to - e.from), n, this.structure);
    } else if (e.to == this.from && !this.slice.openStart && !e.slice.openEnd) {
      let n = this.slice.size + e.slice.size == 0 ? H.empty : new H(e.slice.content.append(this.slice.content), e.slice.openStart, this.slice.openEnd);
      return new He(e.from, this.to, n, this.structure);
    } else
      return null;
  }
  toJSON() {
    let e = { stepType: "replace", from: this.from, to: this.to };
    return this.slice.size && (e.slice = this.slice.toJSON()), this.structure && (e.structure = !0), e;
  }
  /**
  @internal
  */
  static fromJSON(e, n) {
    if (typeof n.from != "number" || typeof n.to != "number")
      throw new RangeError("Invalid input for ReplaceStep.fromJSON");
    return new He(n.from, n.to, H.fromJSON(e, n.slice), !!n.structure);
  }
}
ot.jsonID("replace", He);
class $e extends ot {
  /**
  Create a replace-around step with the given range and gap.
  `insert` should be the point in the slice into which the content
  of the gap should be moved. `structure` has the same meaning as
  it has in the [`ReplaceStep`](https://prosemirror.net/docs/ref/#transform.ReplaceStep) class.
  */
  constructor(e, n, r, i, o, a, s = !1) {
    super(), this.from = e, this.to = n, this.gapFrom = r, this.gapTo = i, this.slice = o, this.insert = a, this.structure = s;
  }
  apply(e) {
    if (this.structure && (Xl(e, this.from, this.gapFrom) || Xl(e, this.gapTo, this.to)))
      return Ue.fail("Structure gap-replace would overwrite content");
    let n = e.slice(this.gapFrom, this.gapTo);
    if (n.openStart || n.openEnd)
      return Ue.fail("Gap is not a flat range");
    let r = this.slice.insertAt(this.insert, n.content);
    return r ? Ue.fromReplace(e, this.from, this.to, r) : Ue.fail("Content does not fit in gap");
  }
  getMap() {
    return new yt([
      this.from,
      this.gapFrom - this.from,
      this.insert,
      this.gapTo,
      this.to - this.gapTo,
      this.slice.size - this.insert
    ]);
  }
  invert(e) {
    let n = this.gapTo - this.gapFrom;
    return new $e(this.from, this.from + this.slice.size + n, this.from + this.insert, this.from + this.insert + n, e.slice(this.from, this.to).removeBetween(this.gapFrom - this.from, this.gapTo - this.from), this.gapFrom - this.from, this.structure);
  }
  map(e) {
    let n = e.mapResult(this.from, 1), r = e.mapResult(this.to, -1), i = this.from == this.gapFrom ? n.pos : e.map(this.gapFrom, -1), o = this.to == this.gapTo ? r.pos : e.map(this.gapTo, 1);
    return n.deletedAcross && r.deletedAcross || i < n.pos || o > r.pos ? null : new $e(n.pos, r.pos, i, o, this.slice, this.insert, this.structure);
  }
  toJSON() {
    let e = {
      stepType: "replaceAround",
      from: this.from,
      to: this.to,
      gapFrom: this.gapFrom,
      gapTo: this.gapTo,
      insert: this.insert
    };
    return this.slice.size && (e.slice = this.slice.toJSON()), this.structure && (e.structure = !0), e;
  }
  /**
  @internal
  */
  static fromJSON(e, n) {
    if (typeof n.from != "number" || typeof n.to != "number" || typeof n.gapFrom != "number" || typeof n.gapTo != "number" || typeof n.insert != "number")
      throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");
    return new $e(n.from, n.to, n.gapFrom, n.gapTo, H.fromJSON(e, n.slice), n.insert, !!n.structure);
  }
}
ot.jsonID("replaceAround", $e);
function Xl(t, e, n) {
  let r = t.resolve(e), i = n - e, o = r.depth;
  for (; i > 0 && o > 0 && r.indexAfter(o) == r.node(o).childCount; )
    o--, i--;
  if (i > 0) {
    let a = r.node(o).maybeChild(r.indexAfter(o));
    for (; i > 0; ) {
      if (!a || a.isLeaf)
        return !0;
      a = a.firstChild, i--;
    }
  }
  return !1;
}
function SS(t, e, n, r) {
  let i = [], o = [], a, s;
  t.doc.nodesBetween(e, n, (l, c, u) => {
    if (!l.isInline)
      return;
    let d = l.marks;
    if (!r.isInSet(d) && u.type.allowsMarkType(r.type)) {
      let p = Math.max(c, e), _ = Math.min(c + l.nodeSize, n), m = r.addToSet(d);
      for (let f = 0; f < d.length; f++)
        d[f].isInSet(m) || (a && a.to == p && a.mark.eq(d[f]) ? a.to = _ : i.push(a = new Zt(p, _, d[f])));
      s && s.to == p ? s.to = _ : o.push(s = new wn(p, _, r));
    }
  }), i.forEach((l) => t.step(l)), o.forEach((l) => t.step(l));
}
function bS(t, e, n, r) {
  let i = [], o = 0;
  t.doc.nodesBetween(e, n, (a, s) => {
    if (!a.isInline)
      return;
    o++;
    let l = null;
    if (r instanceof ms) {
      let c = a.marks, u;
      for (; u = r.isInSet(c); )
        (l || (l = [])).push(u), c = u.removeFromSet(c);
    } else r ? r.isInSet(a.marks) && (l = [r]) : l = a.marks;
    if (l && l.length) {
      let c = Math.min(s + a.nodeSize, n);
      for (let u = 0; u < l.length; u++) {
        let d = l[u], p;
        for (let _ = 0; _ < i.length; _++) {
          let m = i[_];
          m.step == o - 1 && d.eq(i[_].style) && (p = m);
        }
        p ? (p.to = c, p.step = o) : i.push({ style: d, from: Math.max(s, e), to: c, step: o });
      }
    }
  }), i.forEach((a) => t.step(new Zt(a.from, a.to, a.style)));
}
function Vc(t, e, n, r = n.contentMatch, i = !0) {
  let o = t.doc.nodeAt(e), a = [], s = e + 1;
  for (let l = 0; l < o.childCount; l++) {
    let c = o.child(l), u = s + c.nodeSize, d = r.matchType(c.type);
    if (!d)
      a.push(new He(s, u, H.empty));
    else {
      r = d;
      for (let p = 0; p < c.marks.length; p++)
        n.allowsMarkType(c.marks[p].type) || t.step(new Zt(s, u, c.marks[p]));
      if (i && c.isText && n.whitespace != "pre") {
        let p, _ = /\r?\n|\r/g, m;
        for (; p = _.exec(c.text); )
          m || (m = new H(L.from(n.schema.text(" ", n.allowedMarks(c.marks))), 0, 0)), a.push(new He(s + p.index, s + p.index + p[0].length, m));
      }
    }
    s = u;
  }
  if (!r.validEnd) {
    let l = r.fillBefore(L.empty, !0);
    t.replace(s, s, new H(l, 0, 0));
  }
  for (let l = a.length - 1; l >= 0; l--)
    t.step(a[l]);
}
function TS(t, e, n) {
  return (e == 0 || t.canReplace(e, t.childCount)) && (n == t.childCount || t.canReplace(0, n));
}
function di(t) {
  let n = t.parent.content.cutByIndex(t.startIndex, t.endIndex);
  for (let r = t.depth; ; --r) {
    let i = t.$from.node(r), o = t.$from.index(r), a = t.$to.indexAfter(r);
    if (r < t.depth && i.canReplace(o, a, n))
      return r;
    if (r == 0 || i.type.spec.isolating || !TS(i, o, a))
      break;
  }
  return null;
}
function CS(t, e, n) {
  let { $from: r, $to: i, depth: o } = e, a = r.before(o + 1), s = i.after(o + 1), l = a, c = s, u = L.empty, d = 0;
  for (let m = o, f = !1; m > n; m--)
    f || r.index(m) > 0 ? (f = !0, u = L.from(r.node(m).copy(u)), d++) : l--;
  let p = L.empty, _ = 0;
  for (let m = o, f = !1; m > n; m--)
    f || i.after(m + 1) < i.end(m) ? (f = !0, p = L.from(i.node(m).copy(p)), _++) : c++;
  t.step(new $e(l, c, a, s, new H(u.append(p), d, _), u.size - d, !0));
}
function Yc(t, e, n = null, r = t) {
  let i = yS(t, e), o = i && vS(r, e);
  return o ? i.map(yd).concat({ type: e, attrs: n }).concat(o.map(yd)) : null;
}
function yd(t) {
  return { type: t, attrs: null };
}
function yS(t, e) {
  let { parent: n, startIndex: r, endIndex: i } = t, o = n.contentMatchAt(r).findWrapping(e);
  if (!o)
    return null;
  let a = o.length ? o[0] : e;
  return n.canReplaceWith(r, i, a) ? o : null;
}
function vS(t, e) {
  let { parent: n, startIndex: r, endIndex: i } = t, o = n.child(r), a = e.contentMatch.findWrapping(o.type);
  if (!a)
    return null;
  let l = (a.length ? a[a.length - 1] : e).contentMatch;
  for (let c = r; l && c < i; c++)
    l = l.matchType(n.child(c).type);
  return !l || !l.validEnd ? null : a;
}
function RS(t, e, n) {
  let r = L.empty;
  for (let a = n.length - 1; a >= 0; a--) {
    if (r.size) {
      let s = n[a].type.contentMatch.matchFragment(r);
      if (!s || !s.validEnd)
        throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper");
    }
    r = L.from(n[a].type.create(n[a].attrs, r));
  }
  let i = e.start, o = e.end;
  t.step(new $e(i, o, i, o, new H(r, 0, 0), n.length, !0));
}
function OS(t, e, n, r, i) {
  if (!r.isTextblock)
    throw new RangeError("Type given to setBlockType should be a textblock");
  let o = t.steps.length;
  t.doc.nodesBetween(e, n, (a, s) => {
    let l = typeof i == "function" ? i(a) : i;
    if (a.isTextblock && !a.hasMarkup(r, l) && NS(t.doc, t.mapping.slice(o).map(s), r)) {
      let c = null;
      if (r.schema.linebreakReplacement) {
        let _ = r.whitespace == "pre", m = !!r.contentMatch.matchType(r.schema.linebreakReplacement);
        _ && !m ? c = !1 : !_ && m && (c = !0);
      }
      c === !1 && Wm(t, a, s, o), Vc(t, t.mapping.slice(o).map(s, 1), r, void 0, c === null);
      let u = t.mapping.slice(o), d = u.map(s, 1), p = u.map(s + a.nodeSize, 1);
      return t.step(new $e(d, p, d + 1, p - 1, new H(L.from(r.create(l, null, a.marks)), 0, 0), 1, !0)), c === !0 && qm(t, a, s, o), !1;
    }
  });
}
function qm(t, e, n, r) {
  e.forEach((i, o) => {
    if (i.isText) {
      let a, s = /\r?\n|\r/g;
      for (; a = s.exec(i.text); ) {
        let l = t.mapping.slice(r).map(n + 1 + o + a.index);
        t.replaceWith(l, l + 1, e.type.schema.linebreakReplacement.create());
      }
    }
  });
}
function Wm(t, e, n, r) {
  e.forEach((i, o) => {
    if (i.type == i.type.schema.linebreakReplacement) {
      let a = t.mapping.slice(r).map(n + 1 + o);
      t.replaceWith(a, a + 1, e.type.schema.text(`
`));
    }
  });
}
function NS(t, e, n) {
  let r = t.resolve(e), i = r.index();
  return r.parent.canReplaceWith(i, i + 1, n);
}
function AS(t, e, n, r, i) {
  let o = t.doc.nodeAt(e);
  if (!o)
    throw new RangeError("No node at given position");
  n || (n = o.type);
  let a = n.create(r, null, i || o.marks);
  if (o.isLeaf)
    return t.replaceWith(e, e + o.nodeSize, a);
  if (!n.validContent(o.content))
    throw new RangeError("Invalid content for node type " + n.name);
  t.step(new $e(e, e + o.nodeSize, e + 1, e + o.nodeSize - 1, new H(L.from(a), 0, 0), 1, !0));
}
function qr(t, e, n = 1, r) {
  let i = t.resolve(e), o = i.depth - n, a = r && r[r.length - 1] || i.parent;
  if (o < 0 || i.parent.type.spec.isolating || !i.parent.canReplace(i.index(), i.parent.childCount) || !a.type.validContent(i.parent.content.cutByIndex(i.index(), i.parent.childCount)))
    return !1;
  for (let c = i.depth - 1, u = n - 2; c > o; c--, u--) {
    let d = i.node(c), p = i.index(c);
    if (d.type.spec.isolating)
      return !1;
    let _ = d.content.cutByIndex(p, d.childCount), m = r && r[u + 1];
    m && (_ = _.replaceChild(0, m.type.create(m.attrs)));
    let f = r && r[u] || d;
    if (!d.canReplace(p + 1, d.childCount) || !f.type.validContent(_))
      return !1;
  }
  let s = i.indexAfter(o), l = r && r[0];
  return i.node(o).canReplaceWith(s, s, l ? l.type : i.node(o + 1).type);
}
function IS(t, e, n = 1, r) {
  let i = t.doc.resolve(e), o = L.empty, a = L.empty;
  for (let s = i.depth, l = i.depth - n, c = n - 1; s > l; s--, c--) {
    o = L.from(i.node(s).copy(o));
    let u = r && r[c];
    a = L.from(u ? u.type.create(u.attrs, a) : i.node(s).copy(a));
  }
  t.step(new He(e, e, new H(o.append(a), n, n), !0));
}
function Wn(t, e) {
  let n = t.resolve(e), r = n.index();
  return Km(n.nodeBefore, n.nodeAfter) && n.parent.canReplace(r, r + 1);
}
function xS(t, e) {
  e.content.size || t.type.compatibleContent(e.type);
  let n = t.contentMatchAt(t.childCount), { linebreakReplacement: r } = t.type.schema;
  for (let i = 0; i < e.childCount; i++) {
    let o = e.child(i), a = o.type == r ? t.type.schema.nodes.text : o.type;
    if (n = n.matchType(a), !n || !t.type.allowsMarks(o.marks))
      return !1;
  }
  return n.validEnd;
}
function Km(t, e) {
  return !!(t && e && !t.isLeaf && xS(t, e));
}
function fs(t, e, n = -1) {
  let r = t.resolve(e);
  for (let i = r.depth; ; i--) {
    let o, a, s = r.index(i);
    if (i == r.depth ? (o = r.nodeBefore, a = r.nodeAfter) : n > 0 ? (o = r.node(i + 1), s++, a = r.node(i).maybeChild(s)) : (o = r.node(i).maybeChild(s - 1), a = r.node(i + 1)), o && !o.isTextblock && Km(o, a) && r.node(i).canReplace(s, s + 1))
      return e;
    if (i == 0)
      break;
    e = n < 0 ? r.before(i) : r.after(i);
  }
}
function DS(t, e, n) {
  let r = null, { linebreakReplacement: i } = t.doc.type.schema, o = t.doc.resolve(e - n), a = o.node().type;
  if (i && a.inlineContent) {
    let u = a.whitespace == "pre", d = !!a.contentMatch.matchType(i);
    u && !d ? r = !1 : !u && d && (r = !0);
  }
  let s = t.steps.length;
  if (r === !1) {
    let u = t.doc.resolve(e + n);
    Wm(t, u.node(), u.before(), s);
  }
  a.inlineContent && Vc(t, e + n - 1, a, o.node().contentMatchAt(o.index()), r == null);
  let l = t.mapping.slice(s), c = l.map(e - n);
  if (t.step(new He(c, l.map(e + n, -1), H.empty, !0)), r === !0) {
    let u = t.doc.resolve(c);
    qm(t, u.node(), u.before(), t.steps.length);
  }
  return t;
}
function wS(t, e, n) {
  let r = t.resolve(e);
  if (r.parent.canReplaceWith(r.index(), r.index(), n))
    return e;
  if (r.parentOffset == 0)
    for (let i = r.depth - 1; i >= 0; i--) {
      let o = r.index(i);
      if (r.node(i).canReplaceWith(o, o, n))
        return r.before(i + 1);
      if (o > 0)
        return null;
    }
  if (r.parentOffset == r.parent.content.size)
    for (let i = r.depth - 1; i >= 0; i--) {
      let o = r.indexAfter(i);
      if (r.node(i).canReplaceWith(o, o, n))
        return r.after(i + 1);
      if (o < r.node(i).childCount)
        return null;
    }
  return null;
}
function Qm(t, e, n) {
  let r = t.resolve(e);
  if (!n.content.size)
    return e;
  let i = n.content;
  for (let o = 0; o < n.openStart; o++)
    i = i.firstChild.content;
  for (let o = 1; o <= (n.openStart == 0 && n.size ? 2 : 1); o++)
    for (let a = r.depth; a >= 0; a--) {
      let s = a == r.depth ? 0 : r.pos <= (r.start(a + 1) + r.end(a + 1)) / 2 ? -1 : 1, l = r.index(a) + (s > 0 ? 1 : 0), c = r.node(a), u = !1;
      if (o == 1)
        u = c.canReplace(l, l, i);
      else {
        let d = c.contentMatchAt(l).findWrapping(i.firstChild.type);
        u = d && c.canReplaceWith(l, l, d[0]);
      }
      if (u)
        return s == 0 ? r.pos : s < 0 ? r.before(a + 1) : r.after(a + 1);
    }
  return null;
}
function gs(t, e, n = e, r = H.empty) {
  if (e == n && !r.size)
    return null;
  let i = t.resolve(e), o = t.resolve(n);
  return Zm(i, o, r) ? new He(e, n, r) : new MS(i, o, r).fit();
}
function Zm(t, e, n) {
  return !n.openStart && !n.openEnd && t.start() == e.start() && t.parent.canReplace(t.index(), e.index(), n.content);
}
class MS {
  constructor(e, n, r) {
    this.$from = e, this.$to = n, this.unplaced = r, this.frontier = [], this.placed = L.empty;
    for (let i = 0; i <= e.depth; i++) {
      let o = e.node(i);
      this.frontier.push({
        type: o.type,
        match: o.contentMatchAt(e.indexAfter(i))
      });
    }
    for (let i = e.depth; i > 0; i--)
      this.placed = L.from(e.node(i).copy(this.placed));
  }
  get depth() {
    return this.frontier.length - 1;
  }
  fit() {
    for (; this.unplaced.size; ) {
      let c = this.findFittable();
      c ? this.placeNodes(c) : this.openMore() || this.dropNode();
    }
    let e = this.mustMoveInline(), n = this.placed.size - this.depth - this.$from.depth, r = this.$from, i = this.close(e < 0 ? this.$to : r.doc.resolve(e));
    if (!i)
      return null;
    let o = this.placed, a = r.depth, s = i.depth;
    for (; a && s && o.childCount == 1; )
      o = o.firstChild.content, a--, s--;
    let l = new H(o, a, s);
    return e > -1 ? new $e(r.pos, e, this.$to.pos, this.$to.end(), l, n) : l.size || r.pos != this.$to.pos ? new He(r.pos, i.pos, l) : null;
  }
  // Find a position on the start spine of `this.unplaced` that has
  // content that can be moved somewhere on the frontier. Returns two
  // depths, one for the slice and one for the frontier.
  findFittable() {
    let e = this.unplaced.openStart;
    for (let n = this.unplaced.content, r = 0, i = this.unplaced.openEnd; r < e; r++) {
      let o = n.firstChild;
      if (n.childCount > 1 && (i = 0), o.type.spec.isolating && i <= r) {
        e = r;
        break;
      }
      n = o.content;
    }
    for (let n = 1; n <= 2; n++)
      for (let r = n == 1 ? e : this.unplaced.openStart; r >= 0; r--) {
        let i, o = null;
        r ? (o = Qs(this.unplaced.content, r - 1).firstChild, i = o.content) : i = this.unplaced.content;
        let a = i.firstChild;
        for (let s = this.depth; s >= 0; s--) {
          let { type: l, match: c } = this.frontier[s], u, d = null;
          if (n == 1 && (a ? c.matchType(a.type) || (d = c.fillBefore(L.from(a), !1)) : o && l.compatibleContent(o.type)))
            return { sliceDepth: r, frontierDepth: s, parent: o, inject: d };
          if (n == 2 && a && (u = c.findWrapping(a.type)))
            return { sliceDepth: r, frontierDepth: s, parent: o, wrap: u };
          if (o && c.matchType(o.type))
            break;
        }
      }
  }
  openMore() {
    let { content: e, openStart: n, openEnd: r } = this.unplaced, i = Qs(e, n);
    return !i.childCount || i.firstChild.isLeaf ? !1 : (this.unplaced = new H(e, n + 1, Math.max(r, i.size + n >= e.size - r ? n + 1 : 0)), !0);
  }
  dropNode() {
    let { content: e, openStart: n, openEnd: r } = this.unplaced, i = Qs(e, n);
    if (i.childCount <= 1 && n > 0) {
      let o = e.size - n <= n + i.size;
      this.unplaced = new H(Oi(e, n - 1, 1), n - 1, o ? n - 1 : r);
    } else
      this.unplaced = new H(Oi(e, n, 1), n, r);
  }
  // Move content from the unplaced slice at `sliceDepth` to the
  // frontier node at `frontierDepth`. Close that frontier node when
  // applicable.
  placeNodes({ sliceDepth: e, frontierDepth: n, parent: r, inject: i, wrap: o }) {
    for (; this.depth > n; )
      this.closeFrontierNode();
    if (o)
      for (let f = 0; f < o.length; f++)
        this.openFrontierNode(o[f]);
    let a = this.unplaced, s = r ? r.content : a.content, l = a.openStart - e, c = 0, u = [], { match: d, type: p } = this.frontier[n];
    if (i) {
      for (let f = 0; f < i.childCount; f++)
        u.push(i.child(f));
      d = d.matchFragment(i);
    }
    let _ = s.size + e - (a.content.size - a.openEnd);
    for (; c < s.childCount; ) {
      let f = s.child(c), g = d.matchType(f.type);
      if (!g)
        break;
      c++, (c > 1 || l == 0 || f.content.size) && (d = g, u.push(Xm(f.mark(p.allowedMarks(f.marks)), c == 1 ? l : 0, c == s.childCount ? _ : -1)));
    }
    let m = c == s.childCount;
    m || (_ = -1), this.placed = Ni(this.placed, n, L.from(u)), this.frontier[n].match = d, m && _ < 0 && r && r.type == this.frontier[this.depth].type && this.frontier.length > 1 && this.closeFrontierNode();
    for (let f = 0, g = s; f < _; f++) {
      let S = g.lastChild;
      this.frontier.push({ type: S.type, match: S.contentMatchAt(S.childCount) }), g = S.content;
    }
    this.unplaced = m ? e == 0 ? H.empty : new H(Oi(a.content, e - 1, 1), e - 1, _ < 0 ? a.openEnd : e - 1) : new H(Oi(a.content, e, c), a.openStart, a.openEnd);
  }
  mustMoveInline() {
    if (!this.$to.parent.isTextblock)
      return -1;
    let e = this.frontier[this.depth], n;
    if (!e.type.isTextblock || !Zs(this.$to, this.$to.depth, e.type, e.match, !1) || this.$to.depth == this.depth && (n = this.findCloseLevel(this.$to)) && n.depth == this.depth)
      return -1;
    let { depth: r } = this.$to, i = this.$to.after(r);
    for (; r > 1 && i == this.$to.end(--r); )
      ++i;
    return i;
  }
  findCloseLevel(e) {
    e: for (let n = Math.min(this.depth, e.depth); n >= 0; n--) {
      let { match: r, type: i } = this.frontier[n], o = n < e.depth && e.end(n + 1) == e.pos + (e.depth - (n + 1)), a = Zs(e, n, i, r, o);
      if (a) {
        for (let s = n - 1; s >= 0; s--) {
          let { match: l, type: c } = this.frontier[s], u = Zs(e, s, c, l, !0);
          if (!u || u.childCount)
            continue e;
        }
        return { depth: n, fit: a, move: o ? e.doc.resolve(e.after(n + 1)) : e };
      }
    }
  }
  close(e) {
    let n = this.findCloseLevel(e);
    if (!n)
      return null;
    for (; this.depth > n.depth; )
      this.closeFrontierNode();
    n.fit.childCount && (this.placed = Ni(this.placed, n.depth, n.fit)), e = n.move;
    for (let r = n.depth + 1; r <= e.depth; r++) {
      let i = e.node(r), o = i.type.contentMatch.fillBefore(i.content, !0, e.index(r));
      this.openFrontierNode(i.type, i.attrs, o);
    }
    return e;
  }
  openFrontierNode(e, n = null, r) {
    let i = this.frontier[this.depth];
    i.match = i.match.matchType(e), this.placed = Ni(this.placed, this.depth, L.from(e.create(n, r))), this.frontier.push({ type: e, match: e.contentMatch });
  }
  closeFrontierNode() {
    let n = this.frontier.pop().match.fillBefore(L.empty, !0);
    n.childCount && (this.placed = Ni(this.placed, this.frontier.length, n));
  }
}
function Oi(t, e, n) {
  return e == 0 ? t.cutByIndex(n, t.childCount) : t.replaceChild(0, t.firstChild.copy(Oi(t.firstChild.content, e - 1, n)));
}
function Ni(t, e, n) {
  return e == 0 ? t.append(n) : t.replaceChild(t.childCount - 1, t.lastChild.copy(Ni(t.lastChild.content, e - 1, n)));
}
function Qs(t, e) {
  for (let n = 0; n < e; n++)
    t = t.firstChild.content;
  return t;
}
function Xm(t, e, n) {
  if (e <= 0)
    return t;
  let r = t.content;
  return e > 1 && (r = r.replaceChild(0, Xm(r.firstChild, e - 1, r.childCount == 1 ? n - 1 : 0))), e > 0 && (r = t.type.contentMatch.fillBefore(r).append(r), n <= 0 && (r = r.append(t.type.contentMatch.matchFragment(r).fillBefore(L.empty, !0)))), t.copy(r);
}
function Zs(t, e, n, r, i) {
  let o = t.node(e), a = i ? t.indexAfter(e) : t.index(e);
  if (a == o.childCount && !n.compatibleContent(o.type))
    return null;
  let s = r.fillBefore(o.content, !0, a);
  return s && !LS(n, o.content, a) ? s : null;
}
function LS(t, e, n) {
  for (let r = n; r < e.childCount; r++)
    if (!t.allowsMarks(e.child(r).marks))
      return !0;
  return !1;
}
function kS(t) {
  return t.spec.defining || t.spec.definingForContent;
}
function PS(t, e, n, r) {
  if (!r.size)
    return t.deleteRange(e, n);
  let i = t.doc.resolve(e), o = t.doc.resolve(n);
  if (Zm(i, o, r))
    return t.step(new He(e, n, r));
  let a = Jm(i, t.doc.resolve(n));
  a[a.length - 1] == 0 && a.pop();
  let s = -(i.depth + 1);
  a.unshift(s);
  for (let p = i.depth, _ = i.pos - 1; p > 0; p--, _--) {
    let m = i.node(p).type.spec;
    if (m.defining || m.definingAsContext || m.isolating)
      break;
    a.indexOf(p) > -1 ? s = p : i.before(p) == _ && a.splice(1, 0, -p);
  }
  let l = a.indexOf(s), c = [], u = r.openStart;
  for (let p = r.content, _ = 0; ; _++) {
    let m = p.firstChild;
    if (c.push(m), _ == r.openStart)
      break;
    p = m.content;
  }
  for (let p = u - 1; p >= 0; p--) {
    let _ = c[p], m = kS(_.type);
    if (m && !_.sameMarkup(i.node(Math.abs(s) - 1)))
      u = p;
    else if (m || !_.type.isTextblock)
      break;
  }
  for (let p = r.openStart; p >= 0; p--) {
    let _ = (p + u + 1) % (r.openStart + 1), m = c[_];
    if (m)
      for (let f = 0; f < a.length; f++) {
        let g = a[(f + l) % a.length], S = !0;
        g < 0 && (S = !1, g = -g);
        let E = i.node(g - 1), b = i.index(g - 1);
        if (E.canReplaceWith(b, b, m.type, m.marks))
          return t.replace(i.before(g), S ? o.after(g) : n, new H(jm(r.content, 0, r.openStart, _), _, r.openEnd));
      }
  }
  let d = t.steps.length;
  for (let p = a.length - 1; p >= 0 && (t.replace(e, n, r), !(t.steps.length > d)); p--) {
    let _ = a[p];
    _ < 0 || (e = i.before(_), n = o.after(_));
  }
}
function jm(t, e, n, r, i) {
  if (e < n) {
    let o = t.firstChild;
    t = t.replaceChild(0, o.copy(jm(o.content, e + 1, n, r, o)));
  }
  if (e > r) {
    let o = i.contentMatchAt(0), a = o.fillBefore(t).append(t);
    t = a.append(o.matchFragment(a).fillBefore(L.empty, !0));
  }
  return t;
}
function FS(t, e, n, r) {
  if (!r.isInline && e == n && t.doc.resolve(e).parent.content.size) {
    let i = wS(t.doc, e, r.type);
    i != null && (e = n = i);
  }
  t.replaceRange(e, n, new H(L.from(r), 0, 0));
}
function BS(t, e, n) {
  let r = t.doc.resolve(e), i = t.doc.resolve(n), o = Jm(r, i);
  for (let a = 0; a < o.length; a++) {
    let s = o[a], l = a == o.length - 1;
    if (l && s == 0 || r.node(s).type.contentMatch.validEnd)
      return t.delete(r.start(s), i.end(s));
    if (s > 0 && (l || r.node(s - 1).canReplace(r.index(s - 1), i.indexAfter(s - 1))))
      return t.delete(r.before(s), i.after(s));
  }
  for (let a = 1; a <= r.depth && a <= i.depth; a++)
    if (e - r.start(a) == r.depth - a && n > r.end(a) && i.end(a) - n != i.depth - a && r.start(a - 1) == i.start(a - 1) && r.node(a - 1).canReplace(r.index(a - 1), i.index(a - 1)))
      return t.delete(r.before(a), n);
  t.delete(e, n);
}
function Jm(t, e) {
  let n = [], r = Math.min(t.depth, e.depth);
  for (let i = r; i >= 0; i--) {
    let o = t.start(i);
    if (o < t.pos - (t.depth - i) || e.end(i) > e.pos + (e.depth - i) || t.node(i).type.spec.isolating || e.node(i).type.spec.isolating)
      break;
    (o == e.start(i) || i == t.depth && i == e.depth && t.parent.inlineContent && e.parent.inlineContent && i && e.start(i - 1) == o - 1) && n.push(i);
  }
  return n;
}
class Wr extends ot {
  /**
  Construct an attribute step.
  */
  constructor(e, n, r) {
    super(), this.pos = e, this.attr = n, this.value = r;
  }
  apply(e) {
    let n = e.nodeAt(this.pos);
    if (!n)
      return Ue.fail("No node at attribute step's position");
    let r = /* @__PURE__ */ Object.create(null);
    for (let o in n.attrs)
      r[o] = n.attrs[o];
    r[this.attr] = this.value;
    let i = n.type.create(r, null, n.marks);
    return Ue.fromReplace(e, this.pos, this.pos + 1, new H(L.from(i), 0, n.isLeaf ? 0 : 1));
  }
  getMap() {
    return yt.empty;
  }
  invert(e) {
    return new Wr(this.pos, this.attr, e.nodeAt(this.pos).attrs[this.attr]);
  }
  map(e) {
    let n = e.mapResult(this.pos, 1);
    return n.deletedAfter ? null : new Wr(n.pos, this.attr, this.value);
  }
  toJSON() {
    return { stepType: "attr", pos: this.pos, attr: this.attr, value: this.value };
  }
  static fromJSON(e, n) {
    if (typeof n.pos != "number" || typeof n.attr != "string")
      throw new RangeError("Invalid input for AttrStep.fromJSON");
    return new Wr(n.pos, n.attr, n.value);
  }
}
ot.jsonID("attr", Wr);
class qi extends ot {
  /**
  Construct an attribute step.
  */
  constructor(e, n) {
    super(), this.attr = e, this.value = n;
  }
  apply(e) {
    let n = /* @__PURE__ */ Object.create(null);
    for (let i in e.attrs)
      n[i] = e.attrs[i];
    n[this.attr] = this.value;
    let r = e.type.create(n, e.content, e.marks);
    return Ue.ok(r);
  }
  getMap() {
    return yt.empty;
  }
  invert(e) {
    return new qi(this.attr, e.attrs[this.attr]);
  }
  map(e) {
    return this;
  }
  toJSON() {
    return { stepType: "docAttr", attr: this.attr, value: this.value };
  }
  static fromJSON(e, n) {
    if (typeof n.attr != "string")
      throw new RangeError("Invalid input for DocAttrStep.fromJSON");
    return new qi(n.attr, n.value);
  }
}
ot.jsonID("docAttr", qi);
let Xr = class extends Error {
};
Xr = function t(e) {
  let n = Error.call(this, e);
  return n.__proto__ = t.prototype, n;
};
Xr.prototype = Object.create(Error.prototype);
Xr.prototype.constructor = Xr;
Xr.prototype.name = "TransformError";
class $c {
  /**
  Create a transform that starts with the given document.
  */
  constructor(e) {
    this.doc = e, this.steps = [], this.docs = [], this.mapping = new zr();
  }
  /**
  The starting document.
  */
  get before() {
    return this.docs.length ? this.docs[0] : this.doc;
  }
  /**
  Apply a new step in this transform, saving the result. Throws an
  error when the step fails.
  */
  step(e) {
    let n = this.maybeStep(e);
    if (n.failed)
      throw new Xr(n.failed);
    return this;
  }
  /**
  Try to apply a step in this transformation, ignoring it if it
  fails. Returns the step result.
  */
  maybeStep(e) {
    let n = e.apply(this.doc);
    return n.failed || this.addStep(e, n.doc), n;
  }
  /**
  True when the document has been changed (when there are any
  steps).
  */
  get docChanged() {
    return this.steps.length > 0;
  }
  /**
  @internal
  */
  addStep(e, n) {
    this.docs.push(this.doc), this.steps.push(e), this.mapping.appendMap(e.getMap()), this.doc = n;
  }
  /**
  Replace the part of the document between `from` and `to` with the
  given `slice`.
  */
  replace(e, n = e, r = H.empty) {
    let i = gs(this.doc, e, n, r);
    return i && this.step(i), this;
  }
  /**
  Replace the given range with the given content, which may be a
  fragment, node, or array of nodes.
  */
  replaceWith(e, n, r) {
    return this.replace(e, n, new H(L.from(r), 0, 0));
  }
  /**
  Delete the content between the given positions.
  */
  delete(e, n) {
    return this.replace(e, n, H.empty);
  }
  /**
  Insert the given content at the given position.
  */
  insert(e, n) {
    return this.replaceWith(e, e, n);
  }
  /**
  Replace a range of the document with a given slice, using
  `from`, `to`, and the slice's
  [`openStart`](https://prosemirror.net/docs/ref/#model.Slice.openStart) property as hints, rather
  than fixed start and end points. This method may grow the
  replaced area or close open nodes in the slice in order to get a
  fit that is more in line with WYSIWYG expectations, by dropping
  fully covered parent nodes of the replaced region when they are
  marked [non-defining as
  context](https://prosemirror.net/docs/ref/#model.NodeSpec.definingAsContext), or including an
  open parent node from the slice that _is_ marked as [defining
  its content](https://prosemirror.net/docs/ref/#model.NodeSpec.definingForContent).
  
  This is the method, for example, to handle paste. The similar
  [`replace`](https://prosemirror.net/docs/ref/#transform.Transform.replace) method is a more
  primitive tool which will _not_ move the start and end of its given
  range, and is useful in situations where you need more precise
  control over what happens.
  */
  replaceRange(e, n, r) {
    return PS(this, e, n, r), this;
  }
  /**
  Replace the given range with a node, but use `from` and `to` as
  hints, rather than precise positions. When from and to are the same
  and are at the start or end of a parent node in which the given
  node doesn't fit, this method may _move_ them out towards a parent
  that does allow the given node to be placed. When the given range
  completely covers a parent node, this method may completely replace
  that parent node.
  */
  replaceRangeWith(e, n, r) {
    return FS(this, e, n, r), this;
  }
  /**
  Delete the given range, expanding it to cover fully covered
  parent nodes until a valid replace is found.
  */
  deleteRange(e, n) {
    return BS(this, e, n), this;
  }
  /**
  Split the content in the given range off from its parent, if there
  is sibling content before or after it, and move it up the tree to
  the depth specified by `target`. You'll probably want to use
  [`liftTarget`](https://prosemirror.net/docs/ref/#transform.liftTarget) to compute `target`, to make
  sure the lift is valid.
  */
  lift(e, n) {
    return CS(this, e, n), this;
  }
  /**
  Join the blocks around the given position. If depth is 2, their
  last and first siblings are also joined, and so on.
  */
  join(e, n = 1) {
    return DS(this, e, n), this;
  }
  /**
  Wrap the given [range](https://prosemirror.net/docs/ref/#model.NodeRange) in the given set of wrappers.
  The wrappers are assumed to be valid in this position, and should
  probably be computed with [`findWrapping`](https://prosemirror.net/docs/ref/#transform.findWrapping).
  */
  wrap(e, n) {
    return RS(this, e, n), this;
  }
  /**
  Set the type of all textblocks (partly) between `from` and `to` to
  the given node type with the given attributes.
  */
  setBlockType(e, n = e, r, i = null) {
    return OS(this, e, n, r, i), this;
  }
  /**
  Change the type, attributes, and/or marks of the node at `pos`.
  When `type` isn't given, the existing node type is preserved,
  */
  setNodeMarkup(e, n, r = null, i) {
    return AS(this, e, n, r, i), this;
  }
  /**
  Set a single attribute on a given node to a new value.
  The `pos` addresses the document content. Use `setDocAttribute`
  to set attributes on the document itself.
  */
  setNodeAttribute(e, n, r) {
    return this.step(new Wr(e, n, r)), this;
  }
  /**
  Set a single attribute on the document to a new value.
  */
  setDocAttribute(e, n) {
    return this.step(new qi(e, n)), this;
  }
  /**
  Add a mark to the node at position `pos`.
  */
  addNodeMark(e, n) {
    return this.step(new Mn(e, n)), this;
  }
  /**
  Remove a mark (or a mark of the given type) from the node at
  position `pos`.
  */
  removeNodeMark(e, n) {
    if (!(n instanceof Ne)) {
      let r = this.doc.nodeAt(e);
      if (!r)
        throw new RangeError("No node at position " + e);
      if (n = n.isInSet(r.marks), !n)
        return this;
    }
    return this.step(new Zr(e, n)), this;
  }
  /**
  Split the node at the given position, and optionally, if `depth` is
  greater than one, any number of nodes above that. By default, the
  parts split off will inherit the node type of the original node.
  This can be changed by passing an array of types and attributes to
  use after the split.
  */
  split(e, n = 1, r) {
    return IS(this, e, n, r), this;
  }
  /**
  Add the given mark to the inline content between `from` and `to`.
  */
  addMark(e, n, r) {
    return SS(this, e, n, r), this;
  }
  /**
  Remove marks from inline nodes between `from` and `to`. When
  `mark` is a single mark, remove precisely that mark. When it is
  a mark type, remove all marks of that type. When it is null,
  remove all marks of any type.
  */
  removeMark(e, n, r) {
    return bS(this, e, n, r), this;
  }
  /**
  Removes all marks and nodes from the content of the node at
  `pos` that don't match the given new parent node type. Accepts
  an optional starting [content match](https://prosemirror.net/docs/ref/#model.ContentMatch) as
  third argument.
  */
  clearIncompatible(e, n, r) {
    return Vc(this, e, n, r), this;
  }
}
const Xs = /* @__PURE__ */ Object.create(null);
class ne {
  /**
  Initialize a selection with the head and anchor and ranges. If no
  ranges are given, constructs a single range across `$anchor` and
  `$head`.
  */
  constructor(e, n, r) {
    this.$anchor = e, this.$head = n, this.ranges = r || [new ef(e.min(n), e.max(n))];
  }
  /**
  The selection's anchor, as an unresolved position.
  */
  get anchor() {
    return this.$anchor.pos;
  }
  /**
  The selection's head.
  */
  get head() {
    return this.$head.pos;
  }
  /**
  The lower bound of the selection's main range.
  */
  get from() {
    return this.$from.pos;
  }
  /**
  The upper bound of the selection's main range.
  */
  get to() {
    return this.$to.pos;
  }
  /**
  The resolved lower  bound of the selection's main range.
  */
  get $from() {
    return this.ranges[0].$from;
  }
  /**
  The resolved upper bound of the selection's main range.
  */
  get $to() {
    return this.ranges[0].$to;
  }
  /**
  Indicates whether the selection contains any content.
  */
  get empty() {
    let e = this.ranges;
    for (let n = 0; n < e.length; n++)
      if (e[n].$from.pos != e[n].$to.pos)
        return !1;
    return !0;
  }
  /**
  Get the content of this selection as a slice.
  */
  content() {
    return this.$from.doc.slice(this.from, this.to, !0);
  }
  /**
  Replace the selection with a slice or, if no slice is given,
  delete the selection. Will append to the given transaction.
  */
  replace(e, n = H.empty) {
    let r = n.content.lastChild, i = null;
    for (let s = 0; s < n.openEnd; s++)
      i = r, r = r.lastChild;
    let o = e.steps.length, a = this.ranges;
    for (let s = 0; s < a.length; s++) {
      let { $from: l, $to: c } = a[s], u = e.mapping.slice(o);
      e.replaceRange(u.map(l.pos), u.map(c.pos), s ? H.empty : n), s == 0 && Od(e, o, (r ? r.isInline : i && i.isTextblock) ? -1 : 1);
    }
  }
  /**
  Replace the selection with the given node, appending the changes
  to the given transaction.
  */
  replaceWith(e, n) {
    let r = e.steps.length, i = this.ranges;
    for (let o = 0; o < i.length; o++) {
      let { $from: a, $to: s } = i[o], l = e.mapping.slice(r), c = l.map(a.pos), u = l.map(s.pos);
      o ? e.deleteRange(c, u) : (e.replaceRangeWith(c, u, n), Od(e, r, n.isInline ? -1 : 1));
    }
  }
  /**
  Find a valid cursor or leaf node selection starting at the given
  position and searching back if `dir` is negative, and forward if
  positive. When `textOnly` is true, only consider cursor
  selections. Will return null when no valid selection position is
  found.
  */
  static findFrom(e, n, r = !1) {
    let i = e.parent.inlineContent ? new K(e) : Pr(e.node(0), e.parent, e.pos, e.index(), n, r);
    if (i)
      return i;
    for (let o = e.depth - 1; o >= 0; o--) {
      let a = n < 0 ? Pr(e.node(0), e.node(o), e.before(o + 1), e.index(o), n, r) : Pr(e.node(0), e.node(o), e.after(o + 1), e.index(o) + 1, n, r);
      if (a)
        return a;
    }
    return null;
  }
  /**
  Find a valid cursor or leaf node selection near the given
  position. Searches forward first by default, but if `bias` is
  negative, it will search backwards first.
  */
  static near(e, n = 1) {
    return this.findFrom(e, n) || this.findFrom(e, -n) || new Ot(e.node(0));
  }
  /**
  Find the cursor or leaf node selection closest to the start of
  the given document. Will return an
  [`AllSelection`](https://prosemirror.net/docs/ref/#state.AllSelection) if no valid position
  exists.
  */
  static atStart(e) {
    return Pr(e, e, 0, 0, 1) || new Ot(e);
  }
  /**
  Find the cursor or leaf node selection closest to the end of the
  given document.
  */
  static atEnd(e) {
    return Pr(e, e, e.content.size, e.childCount, -1) || new Ot(e);
  }
  /**
  Deserialize the JSON representation of a selection. Must be
  implemented for custom classes (as a static class method).
  */
  static fromJSON(e, n) {
    if (!n || !n.type)
      throw new RangeError("Invalid input for Selection.fromJSON");
    let r = Xs[n.type];
    if (!r)
      throw new RangeError(`No selection type ${n.type} defined`);
    return r.fromJSON(e, n);
  }
  /**
  To be able to deserialize selections from JSON, custom selection
  classes must register themselves with an ID string, so that they
  can be disambiguated. Try to pick something that's unlikely to
  clash with classes from other modules.
  */
  static jsonID(e, n) {
    if (e in Xs)
      throw new RangeError("Duplicate use of selection JSON ID " + e);
    return Xs[e] = n, n.prototype.jsonID = e, n;
  }
  /**
  Get a [bookmark](https://prosemirror.net/docs/ref/#state.SelectionBookmark) for this selection,
  which is a value that can be mapped without having access to a
  current document, and later resolved to a real selection for a
  given document again. (This is used mostly by the history to
  track and restore old selections.) The default implementation of
  this method just converts the selection to a text selection and
  returns the bookmark for that.
  */
  getBookmark() {
    return K.between(this.$anchor, this.$head).getBookmark();
  }
}
ne.prototype.visible = !0;
class ef {
  /**
  Create a range.
  */
  constructor(e, n) {
    this.$from = e, this.$to = n;
  }
}
let vd = !1;
function Rd(t) {
  !vd && !t.parent.inlineContent && (vd = !0, console.warn("TextSelection endpoint not pointing into a node with inline content (" + t.parent.type.name + ")"));
}
class K extends ne {
  /**
  Construct a text selection between the given points.
  */
  constructor(e, n = e) {
    Rd(e), Rd(n), super(e, n);
  }
  /**
  Returns a resolved position if this is a cursor selection (an
  empty text selection), and null otherwise.
  */
  get $cursor() {
    return this.$anchor.pos == this.$head.pos ? this.$head : null;
  }
  map(e, n) {
    let r = e.resolve(n.map(this.head));
    if (!r.parent.inlineContent)
      return ne.near(r);
    let i = e.resolve(n.map(this.anchor));
    return new K(i.parent.inlineContent ? i : r, r);
  }
  replace(e, n = H.empty) {
    if (super.replace(e, n), n == H.empty) {
      let r = this.$from.marksAcross(this.$to);
      r && e.ensureMarks(r);
    }
  }
  eq(e) {
    return e instanceof K && e.anchor == this.anchor && e.head == this.head;
  }
  getBookmark() {
    return new hs(this.anchor, this.head);
  }
  toJSON() {
    return { type: "text", anchor: this.anchor, head: this.head };
  }
  /**
  @internal
  */
  static fromJSON(e, n) {
    if (typeof n.anchor != "number" || typeof n.head != "number")
      throw new RangeError("Invalid input for TextSelection.fromJSON");
    return new K(e.resolve(n.anchor), e.resolve(n.head));
  }
  /**
  Create a text selection from non-resolved positions.
  */
  static create(e, n, r = n) {
    let i = e.resolve(n);
    return new this(i, r == n ? i : e.resolve(r));
  }
  /**
  Return a text selection that spans the given positions or, if
  they aren't text positions, find a text selection near them.
  `bias` determines whether the method searches forward (default)
  or backwards (negative number) first. Will fall back to calling
  [`Selection.near`](https://prosemirror.net/docs/ref/#state.Selection^near) when the document
  doesn't contain a valid text position.
  */
  static between(e, n, r) {
    let i = e.pos - n.pos;
    if ((!r || i) && (r = i >= 0 ? 1 : -1), !n.parent.inlineContent) {
      let o = ne.findFrom(n, r, !0) || ne.findFrom(n, -r, !0);
      if (o)
        n = o.$head;
      else
        return ne.near(n, r);
    }
    return e.parent.inlineContent || (i == 0 ? e = n : (e = (ne.findFrom(e, -r, !0) || ne.findFrom(e, r, !0)).$anchor, e.pos < n.pos != i < 0 && (e = n))), new K(e, n);
  }
}
ne.jsonID("text", K);
class hs {
  constructor(e, n) {
    this.anchor = e, this.head = n;
  }
  map(e) {
    return new hs(e.map(this.anchor), e.map(this.head));
  }
  resolve(e) {
    return K.between(e.resolve(this.anchor), e.resolve(this.head));
  }
}
class ee extends ne {
  /**
  Create a node selection. Does not verify the validity of its
  argument.
  */
  constructor(e) {
    let n = e.nodeAfter, r = e.node(0).resolve(e.pos + n.nodeSize);
    super(e, r), this.node = n;
  }
  map(e, n) {
    let { deleted: r, pos: i } = n.mapResult(this.anchor), o = e.resolve(i);
    return r ? ne.near(o) : new ee(o);
  }
  content() {
    return new H(L.from(this.node), 0, 0);
  }
  eq(e) {
    return e instanceof ee && e.anchor == this.anchor;
  }
  toJSON() {
    return { type: "node", anchor: this.anchor };
  }
  getBookmark() {
    return new zc(this.anchor);
  }
  /**
  @internal
  */
  static fromJSON(e, n) {
    if (typeof n.anchor != "number")
      throw new RangeError("Invalid input for NodeSelection.fromJSON");
    return new ee(e.resolve(n.anchor));
  }
  /**
  Create a node selection from non-resolved positions.
  */
  static create(e, n) {
    return new ee(e.resolve(n));
  }
  /**
  Determines whether the given node may be selected as a node
  selection.
  */
  static isSelectable(e) {
    return !e.isText && e.type.spec.selectable !== !1;
  }
}
ee.prototype.visible = !1;
ne.jsonID("node", ee);
class zc {
  constructor(e) {
    this.anchor = e;
  }
  map(e) {
    let { deleted: n, pos: r } = e.mapResult(this.anchor);
    return n ? new hs(r, r) : new zc(r);
  }
  resolve(e) {
    let n = e.resolve(this.anchor), r = n.nodeAfter;
    return r && ee.isSelectable(r) ? new ee(n) : ne.near(n);
  }
}
class Ot extends ne {
  /**
  Create an all-selection over the given document.
  */
  constructor(e) {
    super(e.resolve(0), e.resolve(e.content.size));
  }
  replace(e, n = H.empty) {
    if (n == H.empty) {
      e.delete(0, e.doc.content.size);
      let r = ne.atStart(e.doc);
      r.eq(e.selection) || e.setSelection(r);
    } else
      super.replace(e, n);
  }
  toJSON() {
    return { type: "all" };
  }
  /**
  @internal
  */
  static fromJSON(e) {
    return new Ot(e);
  }
  map(e) {
    return new Ot(e);
  }
  eq(e) {
    return e instanceof Ot;
  }
  getBookmark() {
    return US;
  }
}
ne.jsonID("all", Ot);
const US = {
  map() {
    return this;
  },
  resolve(t) {
    return new Ot(t);
  }
};
function Pr(t, e, n, r, i, o = !1) {
  if (e.inlineContent)
    return K.create(t, n);
  for (let a = r - (i > 0 ? 0 : 1); i > 0 ? a < e.childCount : a >= 0; a += i) {
    let s = e.child(a);
    if (s.isAtom) {
      if (!o && ee.isSelectable(s))
        return ee.create(t, n - (i < 0 ? s.nodeSize : 0));
    } else {
      let l = Pr(t, s, n + i, i < 0 ? s.childCount : 0, i, o);
      if (l)
        return l;
    }
    n += s.nodeSize * i;
  }
  return null;
}
function Od(t, e, n) {
  let r = t.steps.length - 1;
  if (r < e)
    return;
  let i = t.steps[r];
  if (!(i instanceof He || i instanceof $e))
    return;
  let o = t.mapping.maps[r], a;
  o.forEach((s, l, c, u) => {
    a == null && (a = u);
  }), t.setSelection(ne.near(t.doc.resolve(a), n));
}
const Nd = 1, Do = 2, Ad = 4;
class HS extends $c {
  /**
  @internal
  */
  constructor(e) {
    super(e.doc), this.curSelectionFor = 0, this.updated = 0, this.meta = /* @__PURE__ */ Object.create(null), this.time = Date.now(), this.curSelection = e.selection, this.storedMarks = e.storedMarks;
  }
  /**
  The transaction's current selection. This defaults to the editor
  selection [mapped](https://prosemirror.net/docs/ref/#state.Selection.map) through the steps in the
  transaction, but can be overwritten with
  [`setSelection`](https://prosemirror.net/docs/ref/#state.Transaction.setSelection).
  */
  get selection() {
    return this.curSelectionFor < this.steps.length && (this.curSelection = this.curSelection.map(this.doc, this.mapping.slice(this.curSelectionFor)), this.curSelectionFor = this.steps.length), this.curSelection;
  }
  /**
  Update the transaction's current selection. Will determine the
  selection that the editor gets when the transaction is applied.
  */
  setSelection(e) {
    if (e.$from.doc != this.doc)
      throw new RangeError("Selection passed to setSelection must point at the current document");
    return this.curSelection = e, this.curSelectionFor = this.steps.length, this.updated = (this.updated | Nd) & ~Do, this.storedMarks = null, this;
  }
  /**
  Whether the selection was explicitly updated by this transaction.
  */
  get selectionSet() {
    return (this.updated & Nd) > 0;
  }
  /**
  Set the current stored marks.
  */
  setStoredMarks(e) {
    return this.storedMarks = e, this.updated |= Do, this;
  }
  /**
  Make sure the current stored marks or, if that is null, the marks
  at the selection, match the given set of marks. Does nothing if
  this is already the case.
  */
  ensureMarks(e) {
    return Ne.sameSet(this.storedMarks || this.selection.$from.marks(), e) || this.setStoredMarks(e), this;
  }
  /**
  Add a mark to the set of stored marks.
  */
  addStoredMark(e) {
    return this.ensureMarks(e.addToSet(this.storedMarks || this.selection.$head.marks()));
  }
  /**
  Remove a mark or mark type from the set of stored marks.
  */
  removeStoredMark(e) {
    return this.ensureMarks(e.removeFromSet(this.storedMarks || this.selection.$head.marks()));
  }
  /**
  Whether the stored marks were explicitly set for this transaction.
  */
  get storedMarksSet() {
    return (this.updated & Do) > 0;
  }
  /**
  @internal
  */
  addStep(e, n) {
    super.addStep(e, n), this.updated = this.updated & ~Do, this.storedMarks = null;
  }
  /**
  Update the timestamp for the transaction.
  */
  setTime(e) {
    return this.time = e, this;
  }
  /**
  Replace the current selection with the given slice.
  */
  replaceSelection(e) {
    return this.selection.replace(this, e), this;
  }
  /**
  Replace the selection with the given node. When `inheritMarks` is
  true and the content is inline, it inherits the marks from the
  place where it is inserted.
  */
  replaceSelectionWith(e, n = !0) {
    let r = this.selection;
    return n && (e = e.mark(this.storedMarks || (r.empty ? r.$from.marks() : r.$from.marksAcross(r.$to) || Ne.none))), r.replaceWith(this, e), this;
  }
  /**
  Delete the selection.
  */
  deleteSelection() {
    return this.selection.replace(this), this;
  }
  /**
  Replace the given range, or the selection if no range is given,
  with a text node containing the given string.
  */
  insertText(e, n, r) {
    let i = this.doc.type.schema;
    if (n == null)
      return e ? this.replaceSelectionWith(i.text(e), !0) : this.deleteSelection();
    {
      if (r == null && (r = n), r = r ?? n, !e)
        return this.deleteRange(n, r);
      let o = this.storedMarks;
      if (!o) {
        let a = this.doc.resolve(n);
        o = r == n ? a.marks() : a.marksAcross(this.doc.resolve(r));
      }
      return this.replaceRangeWith(n, r, i.text(e, o)), this.selection.empty || this.setSelection(ne.near(this.selection.$to)), this;
    }
  }
  /**
  Store a metadata property in this transaction, keyed either by
  name or by plugin.
  */
  setMeta(e, n) {
    return this.meta[typeof e == "string" ? e : e.key] = n, this;
  }
  /**
  Retrieve a metadata property for a given name or plugin.
  */
  getMeta(e) {
    return this.meta[typeof e == "string" ? e : e.key];
  }
  /**
  Returns true if this transaction doesn't contain any metadata,
  and can thus safely be extended.
  */
  get isGeneric() {
    for (let e in this.meta)
      return !1;
    return !0;
  }
  /**
  Indicate that the editor should scroll the selection into view
  when updated to the state produced by this transaction.
  */
  scrollIntoView() {
    return this.updated |= Ad, this;
  }
  /**
  True when this transaction has had `scrollIntoView` called on it.
  */
  get scrolledIntoView() {
    return (this.updated & Ad) > 0;
  }
}
function Id(t, e) {
  return !e || !t ? t : t.bind(e);
}
class Ai {
  constructor(e, n, r) {
    this.name = e, this.init = Id(n.init, r), this.apply = Id(n.apply, r);
  }
}
const GS = [
  new Ai("doc", {
    init(t) {
      return t.doc || t.schema.topNodeType.createAndFill();
    },
    apply(t) {
      return t.doc;
    }
  }),
  new Ai("selection", {
    init(t, e) {
      return t.selection || ne.atStart(e.doc);
    },
    apply(t) {
      return t.selection;
    }
  }),
  new Ai("storedMarks", {
    init(t) {
      return t.storedMarks || null;
    },
    apply(t, e, n, r) {
      return r.selection.$cursor ? t.storedMarks : null;
    }
  }),
  new Ai("scrollToSelection", {
    init() {
      return 0;
    },
    apply(t, e) {
      return t.scrolledIntoView ? e + 1 : e;
    }
  })
];
class js {
  constructor(e, n) {
    this.schema = e, this.plugins = [], this.pluginsByKey = /* @__PURE__ */ Object.create(null), this.fields = GS.slice(), n && n.forEach((r) => {
      if (this.pluginsByKey[r.key])
        throw new RangeError("Adding different instances of a keyed plugin (" + r.key + ")");
      this.plugins.push(r), this.pluginsByKey[r.key] = r, r.spec.state && this.fields.push(new Ai(r.key, r.spec.state, r));
    });
  }
}
class Vr {
  /**
  @internal
  */
  constructor(e) {
    this.config = e;
  }
  /**
  The schema of the state's document.
  */
  get schema() {
    return this.config.schema;
  }
  /**
  The plugins that are active in this state.
  */
  get plugins() {
    return this.config.plugins;
  }
  /**
  Apply the given transaction to produce a new state.
  */
  apply(e) {
    return this.applyTransaction(e).state;
  }
  /**
  @internal
  */
  filterTransaction(e, n = -1) {
    for (let r = 0; r < this.config.plugins.length; r++)
      if (r != n) {
        let i = this.config.plugins[r];
        if (i.spec.filterTransaction && !i.spec.filterTransaction.call(i, e, this))
          return !1;
      }
    return !0;
  }
  /**
  Verbose variant of [`apply`](https://prosemirror.net/docs/ref/#state.EditorState.apply) that
  returns the precise transactions that were applied (which might
  be influenced by the [transaction
  hooks](https://prosemirror.net/docs/ref/#state.PluginSpec.filterTransaction) of
  plugins) along with the new state.
  */
  applyTransaction(e) {
    if (!this.filterTransaction(e))
      return { state: this, transactions: [] };
    let n = [e], r = this.applyInner(e), i = null;
    for (; ; ) {
      let o = !1;
      for (let a = 0; a < this.config.plugins.length; a++) {
        let s = this.config.plugins[a];
        if (s.spec.appendTransaction) {
          let l = i ? i[a].n : 0, c = i ? i[a].state : this, u = l < n.length && s.spec.appendTransaction.call(s, l ? n.slice(l) : n, c, r);
          if (u && r.filterTransaction(u, a)) {
            if (u.setMeta("appendedTransaction", e), !i) {
              i = [];
              for (let d = 0; d < this.config.plugins.length; d++)
                i.push(d < a ? { state: r, n: n.length } : { state: this, n: 0 });
            }
            n.push(u), r = r.applyInner(u), o = !0;
          }
          i && (i[a] = { state: r, n: n.length });
        }
      }
      if (!o)
        return { state: r, transactions: n };
    }
  }
  /**
  @internal
  */
  applyInner(e) {
    if (!e.before.eq(this.doc))
      throw new RangeError("Applying a mismatched transaction");
    let n = new Vr(this.config), r = this.config.fields;
    for (let i = 0; i < r.length; i++) {
      let o = r[i];
      n[o.name] = o.apply(e, this[o.name], this, n);
    }
    return n;
  }
  /**
  Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
  */
  get tr() {
    return new HS(this);
  }
  /**
  Create a new state.
  */
  static create(e) {
    let n = new js(e.doc ? e.doc.type.schema : e.schema, e.plugins), r = new Vr(n);
    for (let i = 0; i < n.fields.length; i++)
      r[n.fields[i].name] = n.fields[i].init(e, r);
    return r;
  }
  /**
  Create a new state based on this one, but with an adjusted set
  of active plugins. State fields that exist in both sets of
  plugins are kept unchanged. Those that no longer exist are
  dropped, and those that are new are initialized using their
  [`init`](https://prosemirror.net/docs/ref/#state.StateField.init) method, passing in the new
  configuration object..
  */
  reconfigure(e) {
    let n = new js(this.schema, e.plugins), r = n.fields, i = new Vr(n);
    for (let o = 0; o < r.length; o++) {
      let a = r[o].name;
      i[a] = this.hasOwnProperty(a) ? this[a] : r[o].init(e, i);
    }
    return i;
  }
  /**
  Serialize this state to JSON. If you want to serialize the state
  of plugins, pass an object mapping property names to use in the
  resulting JSON object to plugin objects. The argument may also be
  a string or number, in which case it is ignored, to support the
  way `JSON.stringify` calls `toString` methods.
  */
  toJSON(e) {
    let n = { doc: this.doc.toJSON(), selection: this.selection.toJSON() };
    if (this.storedMarks && (n.storedMarks = this.storedMarks.map((r) => r.toJSON())), e && typeof e == "object")
      for (let r in e) {
        if (r == "doc" || r == "selection")
          throw new RangeError("The JSON fields `doc` and `selection` are reserved");
        let i = e[r], o = i.spec.state;
        o && o.toJSON && (n[r] = o.toJSON.call(i, this[i.key]));
      }
    return n;
  }
  /**
  Deserialize a JSON representation of a state. `config` should
  have at least a `schema` field, and should contain array of
  plugins to initialize the state with. `pluginFields` can be used
  to deserialize the state of plugins, by associating plugin
  instances with the property names they use in the JSON object.
  */
  static fromJSON(e, n, r) {
    if (!n)
      throw new RangeError("Invalid input for EditorState.fromJSON");
    if (!e.schema)
      throw new RangeError("Required config field 'schema' missing");
    let i = new js(e.schema, e.plugins), o = new Vr(i);
    return i.fields.forEach((a) => {
      if (a.name == "doc")
        o.doc = Un.fromJSON(e.schema, n.doc);
      else if (a.name == "selection")
        o.selection = ne.fromJSON(o.doc, n.selection);
      else if (a.name == "storedMarks")
        n.storedMarks && (o.storedMarks = n.storedMarks.map(e.schema.markFromJSON));
      else {
        if (r)
          for (let s in r) {
            let l = r[s], c = l.spec.state;
            if (l.key == a.name && c && c.fromJSON && Object.prototype.hasOwnProperty.call(n, s)) {
              o[a.name] = c.fromJSON.call(l, e, n[s], o);
              return;
            }
          }
        o[a.name] = a.init(e, o);
      }
    }), o;
  }
}
function tf(t, e, n) {
  for (let r in t) {
    let i = t[r];
    i instanceof Function ? i = i.bind(e) : r == "handleDOMEvents" && (i = tf(i, e, {})), n[r] = i;
  }
  return n;
}
class Te {
  /**
  Create a plugin.
  */
  constructor(e) {
    this.spec = e, this.props = {}, e.props && tf(e.props, this, this.props), this.key = e.key ? e.key.key : nf("plugin");
  }
  /**
  Extract the plugin's state field from an editor state.
  */
  getState(e) {
    return e[this.key];
  }
}
const Js = /* @__PURE__ */ Object.create(null);
function nf(t) {
  return t in Js ? t + "$" + ++Js[t] : (Js[t] = 0, t + "$");
}
class Oe {
  /**
  Create a plugin key.
  */
  constructor(e = "key") {
    this.key = nf(e);
  }
  /**
  Get the active plugin with this key, if any, from an editor
  state.
  */
  get(e) {
    return e.config.pluginsByKey[this.key];
  }
  /**
  Get the plugin's state from an editor state.
  */
  getState(e) {
    return e[this.key];
  }
}
const Xe = function(t) {
  for (var e = 0; ; e++)
    if (t = t.previousSibling, !t)
      return e;
}, Wi = function(t) {
  let e = t.assignedSlot || t.parentNode;
  return e && e.nodeType == 11 ? e.host : e;
};
let jl = null;
const _n = function(t, e, n) {
  let r = jl || (jl = document.createRange());
  return r.setEnd(t, n ?? t.nodeValue.length), r.setStart(t, e || 0), r;
}, VS = function() {
  jl = null;
}, fr = function(t, e, n, r) {
  return n && (xd(t, e, n, r, -1) || xd(t, e, n, r, 1));
}, YS = /^(img|br|input|textarea|hr)$/i;
function xd(t, e, n, r, i) {
  for (; ; ) {
    if (t == n && e == r)
      return !0;
    if (e == (i < 0 ? 0 : Mt(t))) {
      let o = t.parentNode;
      if (!o || o.nodeType != 1 || fo(t) || YS.test(t.nodeName) || t.contentEditable == "false")
        return !1;
      e = Xe(t) + (i < 0 ? 0 : 1), t = o;
    } else if (t.nodeType == 1) {
      if (t = t.childNodes[e + (i < 0 ? -1 : 0)], t.contentEditable == "false")
        return !1;
      e = i < 0 ? Mt(t) : 0;
    } else
      return !1;
  }
}
function Mt(t) {
  return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
}
function $S(t, e) {
  for (; ; ) {
    if (t.nodeType == 3 && e)
      return t;
    if (t.nodeType == 1 && e > 0) {
      if (t.contentEditable == "false")
        return null;
      t = t.childNodes[e - 1], e = Mt(t);
    } else if (t.parentNode && !fo(t))
      e = Xe(t), t = t.parentNode;
    else
      return null;
  }
}
function zS(t, e) {
  for (; ; ) {
    if (t.nodeType == 3 && e < t.nodeValue.length)
      return t;
    if (t.nodeType == 1 && e < t.childNodes.length) {
      if (t.contentEditable == "false")
        return null;
      t = t.childNodes[e], e = 0;
    } else if (t.parentNode && !fo(t))
      e = Xe(t) + 1, t = t.parentNode;
    else
      return null;
  }
}
function qS(t, e, n) {
  for (let r = e == 0, i = e == Mt(t); r || i; ) {
    if (t == n)
      return !0;
    let o = Xe(t);
    if (t = t.parentNode, !t)
      return !1;
    r = r && o == 0, i = i && o == Mt(t);
  }
}
function fo(t) {
  let e;
  for (let n = t; n && !(e = n.pmViewDesc); n = n.parentNode)
    ;
  return e && e.node && e.node.isBlock && (e.dom == t || e.contentDOM == t);
}
const Es = function(t) {
  return t.focusNode && fr(t.focusNode, t.focusOffset, t.anchorNode, t.anchorOffset);
};
function tr(t, e) {
  let n = document.createEvent("Event");
  return n.initEvent("keydown", !0, !0), n.keyCode = t, n.key = n.code = e, n;
}
function WS(t) {
  let e = t.activeElement;
  for (; e && e.shadowRoot; )
    e = e.shadowRoot.activeElement;
  return e;
}
function KS(t, e, n) {
  if (t.caretPositionFromPoint)
    try {
      let r = t.caretPositionFromPoint(e, n);
      if (r)
        return { node: r.offsetNode, offset: Math.min(Mt(r.offsetNode), r.offset) };
    } catch {
    }
  if (t.caretRangeFromPoint) {
    let r = t.caretRangeFromPoint(e, n);
    if (r)
      return { node: r.startContainer, offset: Math.min(Mt(r.startContainer), r.startOffset) };
  }
}
const tn = typeof navigator < "u" ? navigator : null, Dd = typeof document < "u" ? document : null, Kn = tn && tn.userAgent || "", Jl = /Edge\/(\d+)/.exec(Kn), rf = /MSIE \d/.exec(Kn), ec = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Kn), gt = !!(rf || ec || Jl), Hn = rf ? document.documentMode : ec ? +ec[1] : Jl ? +Jl[1] : 0, Vt = !gt && /gecko\/(\d+)/i.test(Kn);
Vt && +(/Firefox\/(\d+)/.exec(Kn) || [0, 0])[1];
const tc = !gt && /Chrome\/(\d+)/.exec(Kn), rt = !!tc, of = tc ? +tc[1] : 0, dt = !gt && !!tn && /Apple Computer/.test(tn.vendor), jr = dt && (/Mobile\/\w+/.test(Kn) || !!tn && tn.maxTouchPoints > 2), wt = jr || (tn ? /Mac/.test(tn.platform) : !1), QS = tn ? /Win/.test(tn.platform) : !1, gn = /Android \d/.test(Kn), go = !!Dd && "webkitFontSmoothing" in Dd.documentElement.style, ZS = go ? +(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent) || [0, 0])[1] : 0;
function XS(t) {
  let e = t.defaultView && t.defaultView.visualViewport;
  return e ? {
    left: 0,
    right: e.width,
    top: 0,
    bottom: e.height
  } : {
    left: 0,
    right: t.documentElement.clientWidth,
    top: 0,
    bottom: t.documentElement.clientHeight
  };
}
function ln(t, e) {
  return typeof t == "number" ? t : t[e];
}
function jS(t) {
  let e = t.getBoundingClientRect(), n = e.width / t.offsetWidth || 1, r = e.height / t.offsetHeight || 1;
  return {
    left: e.left,
    right: e.left + t.clientWidth * n,
    top: e.top,
    bottom: e.top + t.clientHeight * r
  };
}
function wd(t, e, n) {
  let r = t.someProp("scrollThreshold") || 0, i = t.someProp("scrollMargin") || 5, o = t.dom.ownerDocument;
  for (let a = n || t.dom; a; a = Wi(a)) {
    if (a.nodeType != 1)
      continue;
    let s = a, l = s == o.body, c = l ? XS(o) : jS(s), u = 0, d = 0;
    if (e.top < c.top + ln(r, "top") ? d = -(c.top - e.top + ln(i, "top")) : e.bottom > c.bottom - ln(r, "bottom") && (d = e.bottom - e.top > c.bottom - c.top ? e.top + ln(i, "top") - c.top : e.bottom - c.bottom + ln(i, "bottom")), e.left < c.left + ln(r, "left") ? u = -(c.left - e.left + ln(i, "left")) : e.right > c.right - ln(r, "right") && (u = e.right - c.right + ln(i, "right")), u || d)
      if (l)
        o.defaultView.scrollBy(u, d);
      else {
        let p = s.scrollLeft, _ = s.scrollTop;
        d && (s.scrollTop += d), u && (s.scrollLeft += u);
        let m = s.scrollLeft - p, f = s.scrollTop - _;
        e = { left: e.left - m, top: e.top - f, right: e.right - m, bottom: e.bottom - f };
      }
    if (l || /^(fixed|sticky)$/.test(getComputedStyle(a).position))
      break;
  }
}
function JS(t) {
  let e = t.dom.getBoundingClientRect(), n = Math.max(0, e.top), r, i;
  for (let o = (e.left + e.right) / 2, a = n + 1; a < Math.min(innerHeight, e.bottom); a += 5) {
    let s = t.root.elementFromPoint(o, a);
    if (!s || s == t.dom || !t.dom.contains(s))
      continue;
    let l = s.getBoundingClientRect();
    if (l.top >= n - 20) {
      r = s, i = l.top;
      break;
    }
  }
  return { refDOM: r, refTop: i, stack: af(t.dom) };
}
function af(t) {
  let e = [], n = t.ownerDocument;
  for (let r = t; r && (e.push({ dom: r, top: r.scrollTop, left: r.scrollLeft }), t != n); r = Wi(r))
    ;
  return e;
}
function eb({ refDOM: t, refTop: e, stack: n }) {
  let r = t ? t.getBoundingClientRect().top : 0;
  sf(n, r == 0 ? 0 : r - e);
}
function sf(t, e) {
  for (let n = 0; n < t.length; n++) {
    let { dom: r, top: i, left: o } = t[n];
    r.scrollTop != i + e && (r.scrollTop = i + e), r.scrollLeft != o && (r.scrollLeft = o);
  }
}
let Ar = null;
function tb(t) {
  if (t.setActive)
    return t.setActive();
  if (Ar)
    return t.focus(Ar);
  let e = af(t);
  t.focus(Ar == null ? {
    get preventScroll() {
      return Ar = { preventScroll: !0 }, !0;
    }
  } : void 0), Ar || (Ar = !1, sf(e, 0));
}
function lf(t, e) {
  let n, r = 2e8, i, o = 0, a = e.top, s = e.top, l, c;
  for (let u = t.firstChild, d = 0; u; u = u.nextSibling, d++) {
    let p;
    if (u.nodeType == 1)
      p = u.getClientRects();
    else if (u.nodeType == 3)
      p = _n(u).getClientRects();
    else
      continue;
    for (let _ = 0; _ < p.length; _++) {
      let m = p[_];
      if (m.top <= a && m.bottom >= s) {
        a = Math.max(m.bottom, a), s = Math.min(m.top, s);
        let f = m.left > e.left ? m.left - e.left : m.right < e.left ? e.left - m.right : 0;
        if (f < r) {
          n = u, r = f, i = f && n.nodeType == 3 ? {
            left: m.right < e.left ? m.right : m.left,
            top: e.top
          } : e, u.nodeType == 1 && f && (o = d + (e.left >= (m.left + m.right) / 2 ? 1 : 0));
          continue;
        }
      } else m.top > e.top && !l && m.left <= e.left && m.right >= e.left && (l = u, c = { left: Math.max(m.left, Math.min(m.right, e.left)), top: m.top });
      !n && (e.left >= m.right && e.top >= m.top || e.left >= m.left && e.top >= m.bottom) && (o = d + 1);
    }
  }
  return !n && l && (n = l, i = c, r = 0), n && n.nodeType == 3 ? nb(n, i) : !n || r && n.nodeType == 1 ? { node: t, offset: o } : lf(n, i);
}
function nb(t, e) {
  let n = t.nodeValue.length, r = document.createRange();
  for (let i = 0; i < n; i++) {
    r.setEnd(t, i + 1), r.setStart(t, i);
    let o = yn(r, 1);
    if (o.top != o.bottom && qc(e, o))
      return { node: t, offset: i + (e.left >= (o.left + o.right) / 2 ? 1 : 0) };
  }
  return { node: t, offset: 0 };
}
function qc(t, e) {
  return t.left >= e.left - 1 && t.left <= e.right + 1 && t.top >= e.top - 1 && t.top <= e.bottom + 1;
}
function rb(t, e) {
  let n = t.parentNode;
  return n && /^li$/i.test(n.nodeName) && e.left < t.getBoundingClientRect().left ? n : t;
}
function ib(t, e, n) {
  let { node: r, offset: i } = lf(e, n), o = -1;
  if (r.nodeType == 1 && !r.firstChild) {
    let a = r.getBoundingClientRect();
    o = a.left != a.right && n.left > (a.left + a.right) / 2 ? 1 : -1;
  }
  return t.docView.posFromDOM(r, i, o);
}
function ob(t, e, n, r) {
  let i = -1;
  for (let o = e, a = !1; o != t.dom; ) {
    let s = t.docView.nearestDesc(o, !0), l;
    if (!s)
      return null;
    if (s.dom.nodeType == 1 && (s.node.isBlock && s.parent || !s.contentDOM) && // Ignore elements with zero-size bounding rectangles
    ((l = s.dom.getBoundingClientRect()).width || l.height) && (s.node.isBlock && s.parent && (!a && l.left > r.left || l.top > r.top ? i = s.posBefore : (!a && l.right < r.left || l.bottom < r.top) && (i = s.posAfter), a = !0), !s.contentDOM && i < 0 && !s.node.isText))
      return (s.node.isBlock ? r.top < (l.top + l.bottom) / 2 : r.left < (l.left + l.right) / 2) ? s.posBefore : s.posAfter;
    o = s.dom.parentNode;
  }
  return i > -1 ? i : t.docView.posFromDOM(e, n, -1);
}
function cf(t, e, n) {
  let r = t.childNodes.length;
  if (r && n.top < n.bottom)
    for (let i = Math.max(0, Math.min(r - 1, Math.floor(r * (e.top - n.top) / (n.bottom - n.top)) - 2)), o = i; ; ) {
      let a = t.childNodes[o];
      if (a.nodeType == 1) {
        let s = a.getClientRects();
        for (let l = 0; l < s.length; l++) {
          let c = s[l];
          if (qc(e, c))
            return cf(a, e, c);
        }
      }
      if ((o = (o + 1) % r) == i)
        break;
    }
  return t;
}
function ab(t, e) {
  let n = t.dom.ownerDocument, r, i = 0, o = KS(n, e.left, e.top);
  o && ({ node: r, offset: i } = o);
  let a = (t.root.elementFromPoint ? t.root : n).elementFromPoint(e.left, e.top), s;
  if (!a || !t.dom.contains(a.nodeType != 1 ? a.parentNode : a)) {
    let c = t.dom.getBoundingClientRect();
    if (!qc(e, c) || (a = cf(t.dom, e, c), !a))
      return null;
  }
  if (dt)
    for (let c = a; r && c; c = Wi(c))
      c.draggable && (r = void 0);
  if (a = rb(a, e), r) {
    if (Vt && r.nodeType == 1 && (i = Math.min(i, r.childNodes.length), i < r.childNodes.length)) {
      let u = r.childNodes[i], d;
      u.nodeName == "IMG" && (d = u.getBoundingClientRect()).right <= e.left && d.bottom > e.top && i++;
    }
    let c;
    go && i && r.nodeType == 1 && (c = r.childNodes[i - 1]).nodeType == 1 && c.contentEditable == "false" && c.getBoundingClientRect().top >= e.top && i--, r == t.dom && i == r.childNodes.length - 1 && r.lastChild.nodeType == 1 && e.top > r.lastChild.getBoundingClientRect().bottom ? s = t.state.doc.content.size : (i == 0 || r.nodeType != 1 || r.childNodes[i - 1].nodeName != "BR") && (s = ob(t, r, i, e));
  }
  s == null && (s = ib(t, a, e));
  let l = t.docView.nearestDesc(a, !0);
  return { pos: s, inside: l ? l.posAtStart - l.border : -1 };
}
function Md(t) {
  return t.top < t.bottom || t.left < t.right;
}
function yn(t, e) {
  let n = t.getClientRects();
  if (n.length) {
    let r = n[e < 0 ? 0 : n.length - 1];
    if (Md(r))
      return r;
  }
  return Array.prototype.find.call(n, Md) || t.getBoundingClientRect();
}
const sb = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;
function uf(t, e, n) {
  let { node: r, offset: i, atom: o } = t.docView.domFromPos(e, n < 0 ? -1 : 1), a = go || Vt;
  if (r.nodeType == 3)
    if (a && (sb.test(r.nodeValue) || (n < 0 ? !i : i == r.nodeValue.length))) {
      let l = yn(_n(r, i, i), n);
      if (Vt && i && /\s/.test(r.nodeValue[i - 1]) && i < r.nodeValue.length) {
        let c = yn(_n(r, i - 1, i - 1), -1);
        if (c.top == l.top) {
          let u = yn(_n(r, i, i + 1), -1);
          if (u.top != l.top)
            return hi(u, u.left < c.left);
        }
      }
      return l;
    } else {
      let l = i, c = i, u = n < 0 ? 1 : -1;
      return n < 0 && !i ? (c++, u = -1) : n >= 0 && i == r.nodeValue.length ? (l--, u = 1) : n < 0 ? l-- : c++, hi(yn(_n(r, l, c), u), u < 0);
    }
  if (!t.state.doc.resolve(e - (o || 0)).parent.inlineContent) {
    if (o == null && i && (n < 0 || i == Mt(r))) {
      let l = r.childNodes[i - 1];
      if (l.nodeType == 1)
        return el(l.getBoundingClientRect(), !1);
    }
    if (o == null && i < Mt(r)) {
      let l = r.childNodes[i];
      if (l.nodeType == 1)
        return el(l.getBoundingClientRect(), !0);
    }
    return el(r.getBoundingClientRect(), n >= 0);
  }
  if (o == null && i && (n < 0 || i == Mt(r))) {
    let l = r.childNodes[i - 1], c = l.nodeType == 3 ? _n(l, Mt(l) - (a ? 0 : 1)) : l.nodeType == 1 && (l.nodeName != "BR" || !l.nextSibling) ? l : null;
    if (c)
      return hi(yn(c, 1), !1);
  }
  if (o == null && i < Mt(r)) {
    let l = r.childNodes[i];
    for (; l.pmViewDesc && l.pmViewDesc.ignoreForCoords; )
      l = l.nextSibling;
    let c = l ? l.nodeType == 3 ? _n(l, 0, a ? 0 : 1) : l.nodeType == 1 ? l : null : null;
    if (c)
      return hi(yn(c, -1), !0);
  }
  return hi(yn(r.nodeType == 3 ? _n(r) : r, -n), n >= 0);
}
function hi(t, e) {
  if (t.width == 0)
    return t;
  let n = e ? t.left : t.right;
  return { top: t.top, bottom: t.bottom, left: n, right: n };
}
function el(t, e) {
  if (t.height == 0)
    return t;
  let n = e ? t.top : t.bottom;
  return { top: n, bottom: n, left: t.left, right: t.right };
}
function df(t, e, n) {
  let r = t.state, i = t.root.activeElement;
  r != e && t.updateState(e), i != t.dom && t.focus();
  try {
    return n();
  } finally {
    r != e && t.updateState(r), i != t.dom && i && i.focus();
  }
}
function lb(t, e, n) {
  let r = e.selection, i = n == "up" ? r.$from : r.$to;
  return df(t, e, () => {
    let { node: o } = t.docView.domFromPos(i.pos, n == "up" ? -1 : 1);
    for (; ; ) {
      let s = t.docView.nearestDesc(o, !0);
      if (!s)
        break;
      if (s.node.isBlock) {
        o = s.contentDOM || s.dom;
        break;
      }
      o = s.dom.parentNode;
    }
    let a = uf(t, i.pos, 1);
    for (let s = o.firstChild; s; s = s.nextSibling) {
      let l;
      if (s.nodeType == 1)
        l = s.getClientRects();
      else if (s.nodeType == 3)
        l = _n(s, 0, s.nodeValue.length).getClientRects();
      else
        continue;
      for (let c = 0; c < l.length; c++) {
        let u = l[c];
        if (u.bottom > u.top + 1 && (n == "up" ? a.top - u.top > (u.bottom - a.top) * 2 : u.bottom - a.bottom > (a.bottom - u.top) * 2))
          return !1;
      }
    }
    return !0;
  });
}
const cb = /[\u0590-\u08ac]/;
function ub(t, e, n) {
  let { $head: r } = e.selection;
  if (!r.parent.isTextblock)
    return !1;
  let i = r.parentOffset, o = !i, a = i == r.parent.content.size, s = t.domSelection();
  return s ? !cb.test(r.parent.textContent) || !s.modify ? n == "left" || n == "backward" ? o : a : df(t, e, () => {
    let { focusNode: l, focusOffset: c, anchorNode: u, anchorOffset: d } = t.domSelectionRange(), p = s.caretBidiLevel;
    s.modify("move", n, "character");
    let _ = r.depth ? t.docView.domAfterPos(r.before()) : t.dom, { focusNode: m, focusOffset: f } = t.domSelectionRange(), g = m && !_.contains(m.nodeType == 1 ? m : m.parentNode) || l == m && c == f;
    try {
      s.collapse(u, d), l && (l != u || c != d) && s.extend && s.extend(l, c);
    } catch {
    }
    return p != null && (s.caretBidiLevel = p), g;
  }) : r.pos == r.start() || r.pos == r.end();
}
let Ld = null, kd = null, Pd = !1;
function db(t, e, n) {
  return Ld == e && kd == n ? Pd : (Ld = e, kd = n, Pd = n == "up" || n == "down" ? lb(t, e, n) : ub(t, e, n));
}
const Lt = 0, Fd = 1, rr = 2, nn = 3;
class ho {
  constructor(e, n, r, i) {
    this.parent = e, this.children = n, this.dom = r, this.contentDOM = i, this.dirty = Lt, r.pmViewDesc = this;
  }
  // Used to check whether a given description corresponds to a
  // widget/mark/node.
  matchesWidget(e) {
    return !1;
  }
  matchesMark(e) {
    return !1;
  }
  matchesNode(e, n, r) {
    return !1;
  }
  matchesHack(e) {
    return !1;
  }
  // When parsing in-editor content (in domchange.js), we allow
  // descriptions to determine the parse rules that should be used to
  // parse them.
  parseRule() {
    return null;
  }
  // Used by the editor's event handler to ignore events that come
  // from certain descs.
  stopEvent(e) {
    return !1;
  }
  // The size of the content represented by this desc.
  get size() {
    let e = 0;
    for (let n = 0; n < this.children.length; n++)
      e += this.children[n].size;
    return e;
  }
  // For block nodes, this represents the space taken up by their
  // start/end tokens.
  get border() {
    return 0;
  }
  destroy() {
    this.parent = void 0, this.dom.pmViewDesc == this && (this.dom.pmViewDesc = void 0);
    for (let e = 0; e < this.children.length; e++)
      this.children[e].destroy();
  }
  posBeforeChild(e) {
    for (let n = 0, r = this.posAtStart; ; n++) {
      let i = this.children[n];
      if (i == e)
        return r;
      r += i.size;
    }
  }
  get posBefore() {
    return this.parent.posBeforeChild(this);
  }
  get posAtStart() {
    return this.parent ? this.parent.posBeforeChild(this) + this.border : 0;
  }
  get posAfter() {
    return this.posBefore + this.size;
  }
  get posAtEnd() {
    return this.posAtStart + this.size - 2 * this.border;
  }
  localPosFromDOM(e, n, r) {
    if (this.contentDOM && this.contentDOM.contains(e.nodeType == 1 ? e : e.parentNode))
      if (r < 0) {
        let o, a;
        if (e == this.contentDOM)
          o = e.childNodes[n - 1];
        else {
          for (; e.parentNode != this.contentDOM; )
            e = e.parentNode;
          o = e.previousSibling;
        }
        for (; o && !((a = o.pmViewDesc) && a.parent == this); )
          o = o.previousSibling;
        return o ? this.posBeforeChild(a) + a.size : this.posAtStart;
      } else {
        let o, a;
        if (e == this.contentDOM)
          o = e.childNodes[n];
        else {
          for (; e.parentNode != this.contentDOM; )
            e = e.parentNode;
          o = e.nextSibling;
        }
        for (; o && !((a = o.pmViewDesc) && a.parent == this); )
          o = o.nextSibling;
        return o ? this.posBeforeChild(a) : this.posAtEnd;
      }
    let i;
    if (e == this.dom && this.contentDOM)
      i = n > Xe(this.contentDOM);
    else if (this.contentDOM && this.contentDOM != this.dom && this.dom.contains(this.contentDOM))
      i = e.compareDocumentPosition(this.contentDOM) & 2;
    else if (this.dom.firstChild) {
      if (n == 0)
        for (let o = e; ; o = o.parentNode) {
          if (o == this.dom) {
            i = !1;
            break;
          }
          if (o.previousSibling)
            break;
        }
      if (i == null && n == e.childNodes.length)
        for (let o = e; ; o = o.parentNode) {
          if (o == this.dom) {
            i = !0;
            break;
          }
          if (o.nextSibling)
            break;
        }
    }
    return i ?? r > 0 ? this.posAtEnd : this.posAtStart;
  }
  nearestDesc(e, n = !1) {
    for (let r = !0, i = e; i; i = i.parentNode) {
      let o = this.getDesc(i), a;
      if (o && (!n || o.node))
        if (r && (a = o.nodeDOM) && !(a.nodeType == 1 ? a.contains(e.nodeType == 1 ? e : e.parentNode) : a == e))
          r = !1;
        else
          return o;
    }
  }
  getDesc(e) {
    let n = e.pmViewDesc;
    for (let r = n; r; r = r.parent)
      if (r == this)
        return n;
  }
  posFromDOM(e, n, r) {
    for (let i = e; i; i = i.parentNode) {
      let o = this.getDesc(i);
      if (o)
        return o.localPosFromDOM(e, n, r);
    }
    return -1;
  }
  // Find the desc for the node after the given pos, if any. (When a
  // parent node overrode rendering, there might not be one.)
  descAt(e) {
    for (let n = 0, r = 0; n < this.children.length; n++) {
      let i = this.children[n], o = r + i.size;
      if (r == e && o != r) {
        for (; !i.border && i.children.length; )
          for (let a = 0; a < i.children.length; a++) {
            let s = i.children[a];
            if (s.size) {
              i = s;
              break;
            }
          }
        return i;
      }
      if (e < o)
        return i.descAt(e - r - i.border);
      r = o;
    }
  }
  domFromPos(e, n) {
    if (!this.contentDOM)
      return { node: this.dom, offset: 0, atom: e + 1 };
    let r = 0, i = 0;
    for (let o = 0; r < this.children.length; r++) {
      let a = this.children[r], s = o + a.size;
      if (s > e || a instanceof _f) {
        i = e - o;
        break;
      }
      o = s;
    }
    if (i)
      return this.children[r].domFromPos(i - this.children[r].border, n);
    for (let o; r && !(o = this.children[r - 1]).size && o instanceof pf && o.side >= 0; r--)
      ;
    if (n <= 0) {
      let o, a = !0;
      for (; o = r ? this.children[r - 1] : null, !(!o || o.dom.parentNode == this.contentDOM); r--, a = !1)
        ;
      return o && n && a && !o.border && !o.domAtom ? o.domFromPos(o.size, n) : { node: this.contentDOM, offset: o ? Xe(o.dom) + 1 : 0 };
    } else {
      let o, a = !0;
      for (; o = r < this.children.length ? this.children[r] : null, !(!o || o.dom.parentNode == this.contentDOM); r++, a = !1)
        ;
      return o && a && !o.border && !o.domAtom ? o.domFromPos(0, n) : { node: this.contentDOM, offset: o ? Xe(o.dom) : this.contentDOM.childNodes.length };
    }
  }
  // Used to find a DOM range in a single parent for a given changed
  // range.
  parseRange(e, n, r = 0) {
    if (this.children.length == 0)
      return { node: this.contentDOM, from: e, to: n, fromOffset: 0, toOffset: this.contentDOM.childNodes.length };
    let i = -1, o = -1;
    for (let a = r, s = 0; ; s++) {
      let l = this.children[s], c = a + l.size;
      if (i == -1 && e <= c) {
        let u = a + l.border;
        if (e >= u && n <= c - l.border && l.node && l.contentDOM && this.contentDOM.contains(l.contentDOM))
          return l.parseRange(e, n, u);
        e = a;
        for (let d = s; d > 0; d--) {
          let p = this.children[d - 1];
          if (p.size && p.dom.parentNode == this.contentDOM && !p.emptyChildAt(1)) {
            i = Xe(p.dom) + 1;
            break;
          }
          e -= p.size;
        }
        i == -1 && (i = 0);
      }
      if (i > -1 && (c > n || s == this.children.length - 1)) {
        n = c;
        for (let u = s + 1; u < this.children.length; u++) {
          let d = this.children[u];
          if (d.size && d.dom.parentNode == this.contentDOM && !d.emptyChildAt(-1)) {
            o = Xe(d.dom);
            break;
          }
          n += d.size;
        }
        o == -1 && (o = this.contentDOM.childNodes.length);
        break;
      }
      a = c;
    }
    return { node: this.contentDOM, from: e, to: n, fromOffset: i, toOffset: o };
  }
  emptyChildAt(e) {
    if (this.border || !this.contentDOM || !this.children.length)
      return !1;
    let n = this.children[e < 0 ? 0 : this.children.length - 1];
    return n.size == 0 || n.emptyChildAt(e);
  }
  domAfterPos(e) {
    let { node: n, offset: r } = this.domFromPos(e, 0);
    if (n.nodeType != 1 || r == n.childNodes.length)
      throw new RangeError("No node after pos " + e);
    return n.childNodes[r];
  }
  // View descs are responsible for setting any selection that falls
  // entirely inside of them, so that custom implementations can do
  // custom things with the selection. Note that this falls apart when
  // a selection starts in such a node and ends in another, in which
  // case we just use whatever domFromPos produces as a best effort.
  setSelection(e, n, r, i = !1) {
    let o = Math.min(e, n), a = Math.max(e, n);
    for (let _ = 0, m = 0; _ < this.children.length; _++) {
      let f = this.children[_], g = m + f.size;
      if (o > m && a < g)
        return f.setSelection(e - m - f.border, n - m - f.border, r, i);
      m = g;
    }
    let s = this.domFromPos(e, e ? -1 : 1), l = n == e ? s : this.domFromPos(n, n ? -1 : 1), c = r.root.getSelection(), u = r.domSelectionRange(), d = !1;
    if ((Vt || dt) && e == n) {
      let { node: _, offset: m } = s;
      if (_.nodeType == 3) {
        if (d = !!(m && _.nodeValue[m - 1] == `
`), d && m == _.nodeValue.length)
          for (let f = _, g; f; f = f.parentNode) {
            if (g = f.nextSibling) {
              g.nodeName == "BR" && (s = l = { node: g.parentNode, offset: Xe(g) + 1 });
              break;
            }
            let S = f.pmViewDesc;
            if (S && S.node && S.node.isBlock)
              break;
          }
      } else {
        let f = _.childNodes[m - 1];
        d = f && (f.nodeName == "BR" || f.contentEditable == "false");
      }
    }
    if (Vt && u.focusNode && u.focusNode != l.node && u.focusNode.nodeType == 1) {
      let _ = u.focusNode.childNodes[u.focusOffset];
      _ && _.contentEditable == "false" && (i = !0);
    }
    if (!(i || d && dt) && fr(s.node, s.offset, u.anchorNode, u.anchorOffset) && fr(l.node, l.offset, u.focusNode, u.focusOffset))
      return;
    let p = !1;
    if ((c.extend || e == n) && !d) {
      c.collapse(s.node, s.offset);
      try {
        e != n && c.extend(l.node, l.offset), p = !0;
      } catch {
      }
    }
    if (!p) {
      if (e > n) {
        let m = s;
        s = l, l = m;
      }
      let _ = document.createRange();
      _.setEnd(l.node, l.offset), _.setStart(s.node, s.offset), c.removeAllRanges(), c.addRange(_);
    }
  }
  ignoreMutation(e) {
    return !this.contentDOM && e.type != "selection";
  }
  get contentLost() {
    return this.contentDOM && this.contentDOM != this.dom && !this.dom.contains(this.contentDOM);
  }
  // Remove a subtree of the element tree that has been touched
  // by a DOM change, so that the next update will redraw it.
  markDirty(e, n) {
    for (let r = 0, i = 0; i < this.children.length; i++) {
      let o = this.children[i], a = r + o.size;
      if (r == a ? e <= a && n >= r : e < a && n > r) {
        let s = r + o.border, l = a - o.border;
        if (e >= s && n <= l) {
          this.dirty = e == r || n == a ? rr : Fd, e == s && n == l && (o.contentLost || o.dom.parentNode != this.contentDOM) ? o.dirty = nn : o.markDirty(e - s, n - s);
          return;
        } else
          o.dirty = o.dom == o.contentDOM && o.dom.parentNode == this.contentDOM && !o.children.length ? rr : nn;
      }
      r = a;
    }
    this.dirty = rr;
  }
  markParentsDirty() {
    let e = 1;
    for (let n = this.parent; n; n = n.parent, e++) {
      let r = e == 1 ? rr : Fd;
      n.dirty < r && (n.dirty = r);
    }
  }
  get domAtom() {
    return !1;
  }
  get ignoreForCoords() {
    return !1;
  }
  isText(e) {
    return !1;
  }
}
class pf extends ho {
  constructor(e, n, r, i) {
    let o, a = n.type.toDOM;
    if (typeof a == "function" && (a = a(r, () => {
      if (!o)
        return i;
      if (o.parent)
        return o.parent.posBeforeChild(o);
    })), !n.type.spec.raw) {
      if (a.nodeType != 1) {
        let s = document.createElement("span");
        s.appendChild(a), a = s;
      }
      a.contentEditable = "false", a.classList.add("ProseMirror-widget");
    }
    super(e, [], a, null), this.widget = n, this.widget = n, o = this;
  }
  matchesWidget(e) {
    return this.dirty == Lt && e.type.eq(this.widget.type);
  }
  parseRule() {
    return { ignore: !0 };
  }
  stopEvent(e) {
    let n = this.widget.spec.stopEvent;
    return n ? n(e) : !1;
  }
  ignoreMutation(e) {
    return e.type != "selection" || this.widget.spec.ignoreSelection;
  }
  destroy() {
    this.widget.type.destroy(this.dom), super.destroy();
  }
  get domAtom() {
    return !0;
  }
  get side() {
    return this.widget.type.side;
  }
}
class pb extends ho {
  constructor(e, n, r, i) {
    super(e, [], n, null), this.textDOM = r, this.text = i;
  }
  get size() {
    return this.text.length;
  }
  localPosFromDOM(e, n) {
    return e != this.textDOM ? this.posAtStart + (n ? this.size : 0) : this.posAtStart + n;
  }
  domFromPos(e) {
    return { node: this.textDOM, offset: e };
  }
  ignoreMutation(e) {
    return e.type === "characterData" && e.target.nodeValue == e.oldValue;
  }
}
class gr extends ho {
  constructor(e, n, r, i, o) {
    super(e, [], r, i), this.mark = n, this.spec = o;
  }
  static create(e, n, r, i) {
    let o = i.nodeViews[n.type.name], a = o && o(n, i, r);
    return (!a || !a.dom) && (a = Cr.renderSpec(document, n.type.spec.toDOM(n, r), null, n.attrs)), new gr(e, n, a.dom, a.contentDOM || a.dom, a);
  }
  parseRule() {
    return this.dirty & nn || this.mark.type.spec.reparseInView ? null : { mark: this.mark.type.name, attrs: this.mark.attrs, contentElement: this.contentDOM };
  }
  matchesMark(e) {
    return this.dirty != nn && this.mark.eq(e);
  }
  markDirty(e, n) {
    if (super.markDirty(e, n), this.dirty != Lt) {
      let r = this.parent;
      for (; !r.node; )
        r = r.parent;
      r.dirty < this.dirty && (r.dirty = this.dirty), this.dirty = Lt;
    }
  }
  slice(e, n, r) {
    let i = gr.create(this.parent, this.mark, !0, r), o = this.children, a = this.size;
    n < a && (o = rc(o, n, a, r)), e > 0 && (o = rc(o, 0, e, r));
    for (let s = 0; s < o.length; s++)
      o[s].parent = i;
    return i.children = o, i;
  }
  ignoreMutation(e) {
    return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
  }
  destroy() {
    this.spec.destroy && this.spec.destroy(), super.destroy();
  }
}
class Gn extends ho {
  constructor(e, n, r, i, o, a, s, l, c) {
    super(e, [], o, a), this.node = n, this.outerDeco = r, this.innerDeco = i, this.nodeDOM = s;
  }
  // By default, a node is rendered using the `toDOM` method from the
  // node type spec. But client code can use the `nodeViews` spec to
  // supply a custom node view, which can influence various aspects of
  // the way the node works.
  //
  // (Using subclassing for this was intentionally decided against,
  // since it'd require exposing a whole slew of finicky
  // implementation details to the user code that they probably will
  // never need.)
  static create(e, n, r, i, o, a) {
    let s = o.nodeViews[n.type.name], l, c = s && s(n, o, () => {
      if (!l)
        return a;
      if (l.parent)
        return l.parent.posBeforeChild(l);
    }, r, i), u = c && c.dom, d = c && c.contentDOM;
    if (n.isText) {
      if (!u)
        u = document.createTextNode(n.text);
      else if (u.nodeType != 3)
        throw new RangeError("Text must be rendered as a DOM text node");
    } else u || ({ dom: u, contentDOM: d } = Cr.renderSpec(document, n.type.spec.toDOM(n), null, n.attrs));
    !d && !n.isText && u.nodeName != "BR" && (u.hasAttribute("contenteditable") || (u.contentEditable = "false"), n.type.spec.draggable && (u.draggable = !0));
    let p = u;
    return u = gf(u, r, n), c ? l = new _b(e, n, r, i, u, d || null, p, c, o, a + 1) : n.isText ? new Ss(e, n, r, i, u, p, o) : new Gn(e, n, r, i, u, d || null, p, o, a + 1);
  }
  parseRule() {
    if (this.node.type.spec.reparseInView)
      return null;
    let e = { node: this.node.type.name, attrs: this.node.attrs };
    if (this.node.type.whitespace == "pre" && (e.preserveWhitespace = "full"), !this.contentDOM)
      e.getContent = () => this.node.content;
    else if (!this.contentLost)
      e.contentElement = this.contentDOM;
    else {
      for (let n = this.children.length - 1; n >= 0; n--) {
        let r = this.children[n];
        if (this.dom.contains(r.dom.parentNode)) {
          e.contentElement = r.dom.parentNode;
          break;
        }
      }
      e.contentElement || (e.getContent = () => L.empty);
    }
    return e;
  }
  matchesNode(e, n, r) {
    return this.dirty == Lt && e.eq(this.node) && fa(n, this.outerDeco) && r.eq(this.innerDeco);
  }
  get size() {
    return this.node.nodeSize;
  }
  get border() {
    return this.node.isLeaf ? 0 : 1;
  }
  // Syncs `this.children` to match `this.node.content` and the local
  // decorations, possibly introducing nesting for marks. Then, in a
  // separate step, syncs the DOM inside `this.contentDOM` to
  // `this.children`.
  updateChildren(e, n) {
    let r = this.node.inlineContent, i = n, o = e.composing ? this.localCompositionInfo(e, n) : null, a = o && o.pos > -1 ? o : null, s = o && o.pos < 0, l = new fb(this, a && a.node, e);
    Eb(this.node, this.innerDeco, (c, u, d) => {
      c.spec.marks ? l.syncToMarks(c.spec.marks, r, e) : c.type.side >= 0 && !d && l.syncToMarks(u == this.node.childCount ? Ne.none : this.node.child(u).marks, r, e), l.placeWidget(c, e, i);
    }, (c, u, d, p) => {
      l.syncToMarks(c.marks, r, e);
      let _;
      l.findNodeMatch(c, u, d, p) || s && e.state.selection.from > i && e.state.selection.to < i + c.nodeSize && (_ = l.findIndexWithChild(o.node)) > -1 && l.updateNodeAt(c, u, d, _, e) || l.updateNextNode(c, u, d, e, p, i) || l.addNode(c, u, d, e, i), i += c.nodeSize;
    }), l.syncToMarks([], r, e), this.node.isTextblock && l.addTextblockHacks(), l.destroyRest(), (l.changed || this.dirty == rr) && (a && this.protectLocalComposition(e, a), mf(this.contentDOM, this.children, e), jr && Sb(this.dom));
  }
  localCompositionInfo(e, n) {
    let { from: r, to: i } = e.state.selection;
    if (!(e.state.selection instanceof K) || r < n || i > n + this.node.content.size)
      return null;
    let o = e.input.compositionNode;
    if (!o || !this.dom.contains(o.parentNode))
      return null;
    if (this.node.inlineContent) {
      let a = o.nodeValue, s = bb(this.node.content, a, r - n, i - n);
      return s < 0 ? null : { node: o, pos: s, text: a };
    } else
      return { node: o, pos: -1, text: "" };
  }
  protectLocalComposition(e, { node: n, pos: r, text: i }) {
    if (this.getDesc(n))
      return;
    let o = n;
    for (; o.parentNode != this.contentDOM; o = o.parentNode) {
      for (; o.previousSibling; )
        o.parentNode.removeChild(o.previousSibling);
      for (; o.nextSibling; )
        o.parentNode.removeChild(o.nextSibling);
      o.pmViewDesc && (o.pmViewDesc = void 0);
    }
    let a = new pb(this, o, n, i);
    e.input.compositionNodes.push(a), this.children = rc(this.children, r, r + i.length, e, a);
  }
  // If this desc must be updated to match the given node decoration,
  // do so and return true.
  update(e, n, r, i) {
    return this.dirty == nn || !e.sameMarkup(this.node) ? !1 : (this.updateInner(e, n, r, i), !0);
  }
  updateInner(e, n, r, i) {
    this.updateOuterDeco(n), this.node = e, this.innerDeco = r, this.contentDOM && this.updateChildren(i, this.posAtStart), this.dirty = Lt;
  }
  updateOuterDeco(e) {
    if (fa(e, this.outerDeco))
      return;
    let n = this.nodeDOM.nodeType != 1, r = this.dom;
    this.dom = ff(this.dom, this.nodeDOM, nc(this.outerDeco, this.node, n), nc(e, this.node, n)), this.dom != r && (r.pmViewDesc = void 0, this.dom.pmViewDesc = this), this.outerDeco = e;
  }
  // Mark this node as being the selected node.
  selectNode() {
    this.nodeDOM.nodeType == 1 && this.nodeDOM.classList.add("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && (this.dom.draggable = !0);
  }
  // Remove selected node marking from this node.
  deselectNode() {
    this.nodeDOM.nodeType == 1 && (this.nodeDOM.classList.remove("ProseMirror-selectednode"), (this.contentDOM || !this.node.type.spec.draggable) && this.dom.removeAttribute("draggable"));
  }
  get domAtom() {
    return this.node.isAtom;
  }
}
function Bd(t, e, n, r, i) {
  gf(r, e, t);
  let o = new Gn(void 0, t, e, n, r, r, r, i, 0);
  return o.contentDOM && o.updateChildren(i, 0), o;
}
class Ss extends Gn {
  constructor(e, n, r, i, o, a, s) {
    super(e, n, r, i, o, null, a, s, 0);
  }
  parseRule() {
    let e = this.nodeDOM.parentNode;
    for (; e && e != this.dom && !e.pmIsDeco; )
      e = e.parentNode;
    return { skip: e || !0 };
  }
  update(e, n, r, i) {
    return this.dirty == nn || this.dirty != Lt && !this.inParent() || !e.sameMarkup(this.node) ? !1 : (this.updateOuterDeco(n), (this.dirty != Lt || e.text != this.node.text) && e.text != this.nodeDOM.nodeValue && (this.nodeDOM.nodeValue = e.text, i.trackWrites == this.nodeDOM && (i.trackWrites = null)), this.node = e, this.dirty = Lt, !0);
  }
  inParent() {
    let e = this.parent.contentDOM;
    for (let n = this.nodeDOM; n; n = n.parentNode)
      if (n == e)
        return !0;
    return !1;
  }
  domFromPos(e) {
    return { node: this.nodeDOM, offset: e };
  }
  localPosFromDOM(e, n, r) {
    return e == this.nodeDOM ? this.posAtStart + Math.min(n, this.node.text.length) : super.localPosFromDOM(e, n, r);
  }
  ignoreMutation(e) {
    return e.type != "characterData" && e.type != "selection";
  }
  slice(e, n, r) {
    let i = this.node.cut(e, n), o = document.createTextNode(i.text);
    return new Ss(this.parent, i, this.outerDeco, this.innerDeco, o, o, r);
  }
  markDirty(e, n) {
    super.markDirty(e, n), this.dom != this.nodeDOM && (e == 0 || n == this.nodeDOM.nodeValue.length) && (this.dirty = nn);
  }
  get domAtom() {
    return !1;
  }
  isText(e) {
    return this.node.text == e;
  }
}
class _f extends ho {
  parseRule() {
    return { ignore: !0 };
  }
  matchesHack(e) {
    return this.dirty == Lt && this.dom.nodeName == e;
  }
  get domAtom() {
    return !0;
  }
  get ignoreForCoords() {
    return this.dom.nodeName == "IMG";
  }
}
class _b extends Gn {
  constructor(e, n, r, i, o, a, s, l, c, u) {
    super(e, n, r, i, o, a, s, c, u), this.spec = l;
  }
  // A custom `update` method gets to decide whether the update goes
  // through. If it does, and there's a `contentDOM` node, our logic
  // updates the children.
  update(e, n, r, i) {
    if (this.dirty == nn)
      return !1;
    if (this.spec.update && (this.node.type == e.type || this.spec.multiType)) {
      let o = this.spec.update(e, n, r);
      return o && this.updateInner(e, n, r, i), o;
    } else return !this.contentDOM && !e.isLeaf ? !1 : super.update(e, n, r, i);
  }
  selectNode() {
    this.spec.selectNode ? this.spec.selectNode() : super.selectNode();
  }
  deselectNode() {
    this.spec.deselectNode ? this.spec.deselectNode() : super.deselectNode();
  }
  setSelection(e, n, r, i) {
    this.spec.setSelection ? this.spec.setSelection(e, n, r.root) : super.setSelection(e, n, r, i);
  }
  destroy() {
    this.spec.destroy && this.spec.destroy(), super.destroy();
  }
  stopEvent(e) {
    return this.spec.stopEvent ? this.spec.stopEvent(e) : !1;
  }
  ignoreMutation(e) {
    return this.spec.ignoreMutation ? this.spec.ignoreMutation(e) : super.ignoreMutation(e);
  }
}
function mf(t, e, n) {
  let r = t.firstChild, i = !1;
  for (let o = 0; o < e.length; o++) {
    let a = e[o], s = a.dom;
    if (s.parentNode == t) {
      for (; s != r; )
        r = Ud(r), i = !0;
      r = r.nextSibling;
    } else
      i = !0, t.insertBefore(s, r);
    if (a instanceof gr) {
      let l = r ? r.previousSibling : t.lastChild;
      mf(a.contentDOM, a.children, n), r = l ? l.nextSibling : t.firstChild;
    }
  }
  for (; r; )
    r = Ud(r), i = !0;
  i && n.trackWrites == t && (n.trackWrites = null);
}
const wi = function(t) {
  t && (this.nodeName = t);
};
wi.prototype = /* @__PURE__ */ Object.create(null);
const ir = [new wi()];
function nc(t, e, n) {
  if (t.length == 0)
    return ir;
  let r = n ? ir[0] : new wi(), i = [r];
  for (let o = 0; o < t.length; o++) {
    let a = t[o].type.attrs;
    if (a) {
      a.nodeName && i.push(r = new wi(a.nodeName));
      for (let s in a) {
        let l = a[s];
        l != null && (n && i.length == 1 && i.push(r = new wi(e.isInline ? "span" : "div")), s == "class" ? r.class = (r.class ? r.class + " " : "") + l : s == "style" ? r.style = (r.style ? r.style + ";" : "") + l : s != "nodeName" && (r[s] = l));
      }
    }
  }
  return i;
}
function ff(t, e, n, r) {
  if (n == ir && r == ir)
    return e;
  let i = e;
  for (let o = 0; o < r.length; o++) {
    let a = r[o], s = n[o];
    if (o) {
      let l;
      s && s.nodeName == a.nodeName && i != t && (l = i.parentNode) && l.nodeName.toLowerCase() == a.nodeName || (l = document.createElement(a.nodeName), l.pmIsDeco = !0, l.appendChild(i), s = ir[0]), i = l;
    }
    mb(i, s || ir[0], a);
  }
  return i;
}
function mb(t, e, n) {
  for (let r in e)
    r != "class" && r != "style" && r != "nodeName" && !(r in n) && t.removeAttribute(r);
  for (let r in n)
    r != "class" && r != "style" && r != "nodeName" && n[r] != e[r] && t.setAttribute(r, n[r]);
  if (e.class != n.class) {
    let r = e.class ? e.class.split(" ").filter(Boolean) : [], i = n.class ? n.class.split(" ").filter(Boolean) : [];
    for (let o = 0; o < r.length; o++)
      i.indexOf(r[o]) == -1 && t.classList.remove(r[o]);
    for (let o = 0; o < i.length; o++)
      r.indexOf(i[o]) == -1 && t.classList.add(i[o]);
    t.classList.length == 0 && t.removeAttribute("class");
  }
  if (e.style != n.style) {
    if (e.style) {
      let r = /\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g, i;
      for (; i = r.exec(e.style); )
        t.style.removeProperty(i[1]);
    }
    n.style && (t.style.cssText += n.style);
  }
}
function gf(t, e, n) {
  return ff(t, t, ir, nc(e, n, t.nodeType != 1));
}
function fa(t, e) {
  if (t.length != e.length)
    return !1;
  for (let n = 0; n < t.length; n++)
    if (!t[n].type.eq(e[n].type))
      return !1;
  return !0;
}
function Ud(t) {
  let e = t.nextSibling;
  return t.parentNode.removeChild(t), e;
}
class fb {
  constructor(e, n, r) {
    this.lock = n, this.view = r, this.index = 0, this.stack = [], this.changed = !1, this.top = e, this.preMatch = gb(e.node.content, e);
  }
  // Destroy and remove the children between the given indices in
  // `this.top`.
  destroyBetween(e, n) {
    if (e != n) {
      for (let r = e; r < n; r++)
        this.top.children[r].destroy();
      this.top.children.splice(e, n - e), this.changed = !0;
    }
  }
  // Destroy all remaining children in `this.top`.
  destroyRest() {
    this.destroyBetween(this.index, this.top.children.length);
  }
  // Sync the current stack of mark descs with the given array of
  // marks, reusing existing mark descs when possible.
  syncToMarks(e, n, r) {
    let i = 0, o = this.stack.length >> 1, a = Math.min(o, e.length);
    for (; i < a && (i == o - 1 ? this.top : this.stack[i + 1 << 1]).matchesMark(e[i]) && e[i].type.spec.spanning !== !1; )
      i++;
    for (; i < o; )
      this.destroyRest(), this.top.dirty = Lt, this.index = this.stack.pop(), this.top = this.stack.pop(), o--;
    for (; o < e.length; ) {
      this.stack.push(this.top, this.index + 1);
      let s = -1;
      for (let l = this.index; l < Math.min(this.index + 3, this.top.children.length); l++) {
        let c = this.top.children[l];
        if (c.matchesMark(e[o]) && !this.isLocked(c.dom)) {
          s = l;
          break;
        }
      }
      if (s > -1)
        s > this.index && (this.changed = !0, this.destroyBetween(this.index, s)), this.top = this.top.children[this.index];
      else {
        let l = gr.create(this.top, e[o], n, r);
        this.top.children.splice(this.index, 0, l), this.top = l, this.changed = !0;
      }
      this.index = 0, o++;
    }
  }
  // Try to find a node desc matching the given data. Skip over it and
  // return true when successful.
  findNodeMatch(e, n, r, i) {
    let o = -1, a;
    if (i >= this.preMatch.index && (a = this.preMatch.matches[i - this.preMatch.index]).parent == this.top && a.matchesNode(e, n, r))
      o = this.top.children.indexOf(a, this.index);
    else
      for (let s = this.index, l = Math.min(this.top.children.length, s + 5); s < l; s++) {
        let c = this.top.children[s];
        if (c.matchesNode(e, n, r) && !this.preMatch.matched.has(c)) {
          o = s;
          break;
        }
      }
    return o < 0 ? !1 : (this.destroyBetween(this.index, o), this.index++, !0);
  }
  updateNodeAt(e, n, r, i, o) {
    let a = this.top.children[i];
    return a.dirty == nn && a.dom == a.contentDOM && (a.dirty = rr), a.update(e, n, r, o) ? (this.destroyBetween(this.index, i), this.index++, !0) : !1;
  }
  findIndexWithChild(e) {
    for (; ; ) {
      let n = e.parentNode;
      if (!n)
        return -1;
      if (n == this.top.contentDOM) {
        let r = e.pmViewDesc;
        if (r) {
          for (let i = this.index; i < this.top.children.length; i++)
            if (this.top.children[i] == r)
              return i;
        }
        return -1;
      }
      e = n;
    }
  }
  // Try to update the next node, if any, to the given data. Checks
  // pre-matches to avoid overwriting nodes that could still be used.
  updateNextNode(e, n, r, i, o, a) {
    for (let s = this.index; s < this.top.children.length; s++) {
      let l = this.top.children[s];
      if (l instanceof Gn) {
        let c = this.preMatch.matched.get(l);
        if (c != null && c != o)
          return !1;
        let u = l.dom, d, p = this.isLocked(u) && !(e.isText && l.node && l.node.isText && l.nodeDOM.nodeValue == e.text && l.dirty != nn && fa(n, l.outerDeco));
        if (!p && l.update(e, n, r, i))
          return this.destroyBetween(this.index, s), l.dom != u && (this.changed = !0), this.index++, !0;
        if (!p && (d = this.recreateWrapper(l, e, n, r, i, a)))
          return this.destroyBetween(this.index, s), this.top.children[this.index] = d, d.contentDOM && (d.dirty = rr, d.updateChildren(i, a + 1), d.dirty = Lt), this.changed = !0, this.index++, !0;
        break;
      }
    }
    return !1;
  }
  // When a node with content is replaced by a different node with
  // identical content, move over its children.
  recreateWrapper(e, n, r, i, o, a) {
    if (e.dirty || n.isAtom || !e.children.length || !e.node.content.eq(n.content) || !fa(r, e.outerDeco) || !i.eq(e.innerDeco))
      return null;
    let s = Gn.create(this.top, n, r, i, o, a);
    if (s.contentDOM) {
      s.children = e.children, e.children = [];
      for (let l of s.children)
        l.parent = s;
    }
    return e.destroy(), s;
  }
  // Insert the node as a newly created node desc.
  addNode(e, n, r, i, o) {
    let a = Gn.create(this.top, e, n, r, i, o);
    a.contentDOM && a.updateChildren(i, o + 1), this.top.children.splice(this.index++, 0, a), this.changed = !0;
  }
  placeWidget(e, n, r) {
    let i = this.index < this.top.children.length ? this.top.children[this.index] : null;
    if (i && i.matchesWidget(e) && (e == i.widget || !i.widget.type.toDOM.parentNode))
      this.index++;
    else {
      let o = new pf(this.top, e, n, r);
      this.top.children.splice(this.index++, 0, o), this.changed = !0;
    }
  }
  // Make sure a textblock looks and behaves correctly in
  // contentEditable.
  addTextblockHacks() {
    let e = this.top.children[this.index - 1], n = this.top;
    for (; e instanceof gr; )
      n = e, e = n.children[n.children.length - 1];
    (!e || // Empty textblock
    !(e instanceof Ss) || /\n$/.test(e.node.text) || this.view.requiresGeckoHackNode && /\s$/.test(e.node.text)) && ((dt || rt) && e && e.dom.contentEditable == "false" && this.addHackNode("IMG", n), this.addHackNode("BR", this.top));
  }
  addHackNode(e, n) {
    if (n == this.top && this.index < n.children.length && n.children[this.index].matchesHack(e))
      this.index++;
    else {
      let r = document.createElement(e);
      e == "IMG" && (r.className = "ProseMirror-separator", r.alt = ""), e == "BR" && (r.className = "ProseMirror-trailingBreak");
      let i = new _f(this.top, [], r, null);
      n != this.top ? n.children.push(i) : n.children.splice(this.index++, 0, i), this.changed = !0;
    }
  }
  isLocked(e) {
    return this.lock && (e == this.lock || e.nodeType == 1 && e.contains(this.lock.parentNode));
  }
}
function gb(t, e) {
  let n = e, r = n.children.length, i = t.childCount, o = /* @__PURE__ */ new Map(), a = [];
  e: for (; i > 0; ) {
    let s;
    for (; ; )
      if (r) {
        let c = n.children[r - 1];
        if (c instanceof gr)
          n = c, r = c.children.length;
        else {
          s = c, r--;
          break;
        }
      } else {
        if (n == e)
          break e;
        r = n.parent.children.indexOf(n), n = n.parent;
      }
    let l = s.node;
    if (l) {
      if (l != t.child(i - 1))
        break;
      --i, o.set(s, i), a.push(s);
    }
  }
  return { index: i, matched: o, matches: a.reverse() };
}
function hb(t, e) {
  return t.type.side - e.type.side;
}
function Eb(t, e, n, r) {
  let i = e.locals(t), o = 0;
  if (i.length == 0) {
    for (let c = 0; c < t.childCount; c++) {
      let u = t.child(c);
      r(u, i, e.forChild(o, u), c), o += u.nodeSize;
    }
    return;
  }
  let a = 0, s = [], l = null;
  for (let c = 0; ; ) {
    let u, d;
    for (; a < i.length && i[a].to == o; ) {
      let g = i[a++];
      g.widget && (u ? (d || (d = [u])).push(g) : u = g);
    }
    if (u)
      if (d) {
        d.sort(hb);
        for (let g = 0; g < d.length; g++)
          n(d[g], c, !!l);
      } else
        n(u, c, !!l);
    let p, _;
    if (l)
      _ = -1, p = l, l = null;
    else if (c < t.childCount)
      _ = c, p = t.child(c++);
    else
      break;
    for (let g = 0; g < s.length; g++)
      s[g].to <= o && s.splice(g--, 1);
    for (; a < i.length && i[a].from <= o && i[a].to > o; )
      s.push(i[a++]);
    let m = o + p.nodeSize;
    if (p.isText) {
      let g = m;
      a < i.length && i[a].from < g && (g = i[a].from);
      for (let S = 0; S < s.length; S++)
        s[S].to < g && (g = s[S].to);
      g < m && (l = p.cut(g - o), p = p.cut(0, g - o), m = g, _ = -1);
    } else
      for (; a < i.length && i[a].to < m; )
        a++;
    let f = p.isInline && !p.isLeaf ? s.filter((g) => !g.inline) : s.slice();
    r(p, f, e.forChild(o, p), _), o = m;
  }
}
function Sb(t) {
  if (t.nodeName == "UL" || t.nodeName == "OL") {
    let e = t.style.cssText;
    t.style.cssText = e + "; list-style: square !important", window.getComputedStyle(t).listStyle, t.style.cssText = e;
  }
}
function bb(t, e, n, r) {
  for (let i = 0, o = 0; i < t.childCount && o <= r; ) {
    let a = t.child(i++), s = o;
    if (o += a.nodeSize, !a.isText)
      continue;
    let l = a.text;
    for (; i < t.childCount; ) {
      let c = t.child(i++);
      if (o += c.nodeSize, !c.isText)
        break;
      l += c.text;
    }
    if (o >= n) {
      if (o >= r && l.slice(r - e.length - s, r - s) == e)
        return r - e.length;
      let c = s < r ? l.lastIndexOf(e, r - s - 1) : -1;
      if (c >= 0 && c + e.length + s >= n)
        return s + c;
      if (n == r && l.length >= r + e.length - s && l.slice(r - s, r - s + e.length) == e)
        return r;
    }
  }
  return -1;
}
function rc(t, e, n, r, i) {
  let o = [];
  for (let a = 0, s = 0; a < t.length; a++) {
    let l = t[a], c = s, u = s += l.size;
    c >= n || u <= e ? o.push(l) : (c < e && o.push(l.slice(0, e - c, r)), i && (o.push(i), i = void 0), u > n && o.push(l.slice(n - c, l.size, r)));
  }
  return o;
}
function Wc(t, e = null) {
  let n = t.domSelectionRange(), r = t.state.doc;
  if (!n.focusNode)
    return null;
  let i = t.docView.nearestDesc(n.focusNode), o = i && i.size == 0, a = t.docView.posFromDOM(n.focusNode, n.focusOffset, 1);
  if (a < 0)
    return null;
  let s = r.resolve(a), l, c;
  if (Es(n)) {
    for (l = a; i && !i.node; )
      i = i.parent;
    let d = i.node;
    if (i && d.isAtom && ee.isSelectable(d) && i.parent && !(d.isInline && qS(n.focusNode, n.focusOffset, i.dom))) {
      let p = i.posBefore;
      c = new ee(a == p ? s : r.resolve(p));
    }
  } else {
    if (n instanceof t.dom.ownerDocument.defaultView.Selection && n.rangeCount > 1) {
      let d = a, p = a;
      for (let _ = 0; _ < n.rangeCount; _++) {
        let m = n.getRangeAt(_);
        d = Math.min(d, t.docView.posFromDOM(m.startContainer, m.startOffset, 1)), p = Math.max(p, t.docView.posFromDOM(m.endContainer, m.endOffset, -1));
      }
      if (d < 0)
        return null;
      [l, a] = p == t.state.selection.anchor ? [p, d] : [d, p], s = r.resolve(a);
    } else
      l = t.docView.posFromDOM(n.anchorNode, n.anchorOffset, 1);
    if (l < 0)
      return null;
  }
  let u = r.resolve(l);
  if (!c) {
    let d = e == "pointer" || t.state.selection.head < s.pos && !o ? 1 : -1;
    c = Kc(t, u, s, d);
  }
  return c;
}
function hf(t) {
  return t.editable ? t.hasFocus() : Sf(t) && document.activeElement && document.activeElement.contains(t.dom);
}
function En(t, e = !1) {
  let n = t.state.selection;
  if (Ef(t, n), !!hf(t)) {
    if (!e && t.input.mouseDown && t.input.mouseDown.allowDefault && rt) {
      let r = t.domSelectionRange(), i = t.domObserver.currentSelection;
      if (r.anchorNode && i.anchorNode && fr(r.anchorNode, r.anchorOffset, i.anchorNode, i.anchorOffset)) {
        t.input.mouseDown.delayedSelectionSync = !0, t.domObserver.setCurSelection();
        return;
      }
    }
    if (t.domObserver.disconnectSelection(), t.cursorWrapper)
      Cb(t);
    else {
      let { anchor: r, head: i } = n, o, a;
      Hd && !(n instanceof K) && (n.$from.parent.inlineContent || (o = Gd(t, n.from)), !n.empty && !n.$from.parent.inlineContent && (a = Gd(t, n.to))), t.docView.setSelection(r, i, t, e), Hd && (o && Vd(o), a && Vd(a)), n.visible ? t.dom.classList.remove("ProseMirror-hideselection") : (t.dom.classList.add("ProseMirror-hideselection"), "onselectionchange" in document && Tb(t));
    }
    t.domObserver.setCurSelection(), t.domObserver.connectSelection();
  }
}
const Hd = dt || rt && of < 63;
function Gd(t, e) {
  let { node: n, offset: r } = t.docView.domFromPos(e, 0), i = r < n.childNodes.length ? n.childNodes[r] : null, o = r ? n.childNodes[r - 1] : null;
  if (dt && i && i.contentEditable == "false")
    return tl(i);
  if ((!i || i.contentEditable == "false") && (!o || o.contentEditable == "false")) {
    if (i)
      return tl(i);
    if (o)
      return tl(o);
  }
}
function tl(t) {
  return t.contentEditable = "true", dt && t.draggable && (t.draggable = !1, t.wasDraggable = !0), t;
}
function Vd(t) {
  t.contentEditable = "false", t.wasDraggable && (t.draggable = !0, t.wasDraggable = null);
}
function Tb(t) {
  let e = t.dom.ownerDocument;
  e.removeEventListener("selectionchange", t.input.hideSelectionGuard);
  let n = t.domSelectionRange(), r = n.anchorNode, i = n.anchorOffset;
  e.addEventListener("selectionchange", t.input.hideSelectionGuard = () => {
    (n.anchorNode != r || n.anchorOffset != i) && (e.removeEventListener("selectionchange", t.input.hideSelectionGuard), setTimeout(() => {
      (!hf(t) || t.state.selection.visible) && t.dom.classList.remove("ProseMirror-hideselection");
    }, 20));
  });
}
function Cb(t) {
  let e = t.domSelection(), n = document.createRange();
  if (!e)
    return;
  let r = t.cursorWrapper.dom, i = r.nodeName == "IMG";
  i ? n.setStart(r.parentNode, Xe(r) + 1) : n.setStart(r, 0), n.collapse(!0), e.removeAllRanges(), e.addRange(n), !i && !t.state.selection.visible && gt && Hn <= 11 && (r.disabled = !0, r.disabled = !1);
}
function Ef(t, e) {
  if (e instanceof ee) {
    let n = t.docView.descAt(e.from);
    n != t.lastSelectedViewDesc && (Yd(t), n && n.selectNode(), t.lastSelectedViewDesc = n);
  } else
    Yd(t);
}
function Yd(t) {
  t.lastSelectedViewDesc && (t.lastSelectedViewDesc.parent && t.lastSelectedViewDesc.deselectNode(), t.lastSelectedViewDesc = void 0);
}
function Kc(t, e, n, r) {
  return t.someProp("createSelectionBetween", (i) => i(t, e, n)) || K.between(e, n, r);
}
function $d(t) {
  return t.editable && !t.hasFocus() ? !1 : Sf(t);
}
function Sf(t) {
  let e = t.domSelectionRange();
  if (!e.anchorNode)
    return !1;
  try {
    return t.dom.contains(e.anchorNode.nodeType == 3 ? e.anchorNode.parentNode : e.anchorNode) && (t.editable || t.dom.contains(e.focusNode.nodeType == 3 ? e.focusNode.parentNode : e.focusNode));
  } catch {
    return !1;
  }
}
function yb(t) {
  let e = t.docView.domFromPos(t.state.selection.anchor, 0), n = t.domSelectionRange();
  return fr(e.node, e.offset, n.anchorNode, n.anchorOffset);
}
function ic(t, e) {
  let { $anchor: n, $head: r } = t.selection, i = e > 0 ? n.max(r) : n.min(r), o = i.parent.inlineContent ? i.depth ? t.doc.resolve(e > 0 ? i.after() : i.before()) : null : i;
  return o && ne.findFrom(o, e);
}
function vn(t, e) {
  return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()), !0;
}
function zd(t, e, n) {
  let r = t.state.selection;
  if (r instanceof K)
    if (n.indexOf("s") > -1) {
      let { $head: i } = r, o = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter;
      if (!o || o.isText || !o.isLeaf)
        return !1;
      let a = t.state.doc.resolve(i.pos + o.nodeSize * (e < 0 ? -1 : 1));
      return vn(t, new K(r.$anchor, a));
    } else if (r.empty) {
      if (t.endOfTextblock(e > 0 ? "forward" : "backward")) {
        let i = ic(t.state, e);
        return i && i instanceof ee ? vn(t, i) : !1;
      } else if (!(wt && n.indexOf("m") > -1)) {
        let i = r.$head, o = i.textOffset ? null : e < 0 ? i.nodeBefore : i.nodeAfter, a;
        if (!o || o.isText)
          return !1;
        let s = e < 0 ? i.pos - o.nodeSize : i.pos;
        return o.isAtom || (a = t.docView.descAt(s)) && !a.contentDOM ? ee.isSelectable(o) ? vn(t, new ee(e < 0 ? t.state.doc.resolve(i.pos - o.nodeSize) : i)) : go ? vn(t, new K(t.state.doc.resolve(e < 0 ? s : s + o.nodeSize))) : !1 : !1;
      }
    } else return !1;
  else {
    if (r instanceof ee && r.node.isInline)
      return vn(t, new K(e > 0 ? r.$to : r.$from));
    {
      let i = ic(t.state, e);
      return i ? vn(t, i) : !1;
    }
  }
}
function ga(t) {
  return t.nodeType == 3 ? t.nodeValue.length : t.childNodes.length;
}
function Mi(t, e) {
  let n = t.pmViewDesc;
  return n && n.size == 0 && (e < 0 || t.nextSibling || t.nodeName != "BR");
}
function Ir(t, e) {
  return e < 0 ? vb(t) : Rb(t);
}
function vb(t) {
  let e = t.domSelectionRange(), n = e.focusNode, r = e.focusOffset;
  if (!n)
    return;
  let i, o, a = !1;
  for (Vt && n.nodeType == 1 && r < ga(n) && Mi(n.childNodes[r], -1) && (a = !0); ; )
    if (r > 0) {
      if (n.nodeType != 1)
        break;
      {
        let s = n.childNodes[r - 1];
        if (Mi(s, -1))
          i = n, o = --r;
        else if (s.nodeType == 3)
          n = s, r = n.nodeValue.length;
        else
          break;
      }
    } else {
      if (bf(n))
        break;
      {
        let s = n.previousSibling;
        for (; s && Mi(s, -1); )
          i = n.parentNode, o = Xe(s), s = s.previousSibling;
        if (s)
          n = s, r = ga(n);
        else {
          if (n = n.parentNode, n == t.dom)
            break;
          r = 0;
        }
      }
    }
  a ? oc(t, n, r) : i && oc(t, i, o);
}
function Rb(t) {
  let e = t.domSelectionRange(), n = e.focusNode, r = e.focusOffset;
  if (!n)
    return;
  let i = ga(n), o, a;
  for (; ; )
    if (r < i) {
      if (n.nodeType != 1)
        break;
      let s = n.childNodes[r];
      if (Mi(s, 1))
        o = n, a = ++r;
      else
        break;
    } else {
      if (bf(n))
        break;
      {
        let s = n.nextSibling;
        for (; s && Mi(s, 1); )
          o = s.parentNode, a = Xe(s) + 1, s = s.nextSibling;
        if (s)
          n = s, r = 0, i = ga(n);
        else {
          if (n = n.parentNode, n == t.dom)
            break;
          r = i = 0;
        }
      }
    }
  o && oc(t, o, a);
}
function bf(t) {
  let e = t.pmViewDesc;
  return e && e.node && e.node.isBlock;
}
function Ob(t, e) {
  for (; t && e == t.childNodes.length && !fo(t); )
    e = Xe(t) + 1, t = t.parentNode;
  for (; t && e < t.childNodes.length; ) {
    let n = t.childNodes[e];
    if (n.nodeType == 3)
      return n;
    if (n.nodeType == 1 && n.contentEditable == "false")
      break;
    t = n, e = 0;
  }
}
function Nb(t, e) {
  for (; t && !e && !fo(t); )
    e = Xe(t), t = t.parentNode;
  for (; t && e; ) {
    let n = t.childNodes[e - 1];
    if (n.nodeType == 3)
      return n;
    if (n.nodeType == 1 && n.contentEditable == "false")
      break;
    t = n, e = t.childNodes.length;
  }
}
function oc(t, e, n) {
  if (e.nodeType != 3) {
    let o, a;
    (a = Ob(e, n)) ? (e = a, n = 0) : (o = Nb(e, n)) && (e = o, n = o.nodeValue.length);
  }
  let r = t.domSelection();
  if (!r)
    return;
  if (Es(r)) {
    let o = document.createRange();
    o.setEnd(e, n), o.setStart(e, n), r.removeAllRanges(), r.addRange(o);
  } else r.extend && r.extend(e, n);
  t.domObserver.setCurSelection();
  let { state: i } = t;
  setTimeout(() => {
    t.state == i && En(t);
  }, 50);
}
function qd(t, e) {
  let n = t.state.doc.resolve(e);
  if (!(rt || QS) && n.parent.inlineContent) {
    let i = t.coordsAtPos(e);
    if (e > n.start()) {
      let o = t.coordsAtPos(e - 1), a = (o.top + o.bottom) / 2;
      if (a > i.top && a < i.bottom && Math.abs(o.left - i.left) > 1)
        return o.left < i.left ? "ltr" : "rtl";
    }
    if (e < n.end()) {
      let o = t.coordsAtPos(e + 1), a = (o.top + o.bottom) / 2;
      if (a > i.top && a < i.bottom && Math.abs(o.left - i.left) > 1)
        return o.left > i.left ? "ltr" : "rtl";
    }
  }
  return getComputedStyle(t.dom).direction == "rtl" ? "rtl" : "ltr";
}
function Wd(t, e, n) {
  let r = t.state.selection;
  if (r instanceof K && !r.empty || n.indexOf("s") > -1 || wt && n.indexOf("m") > -1)
    return !1;
  let { $from: i, $to: o } = r;
  if (!i.parent.inlineContent || t.endOfTextblock(e < 0 ? "up" : "down")) {
    let a = ic(t.state, e);
    if (a && a instanceof ee)
      return vn(t, a);
  }
  if (!i.parent.inlineContent) {
    let a = e < 0 ? i : o, s = r instanceof Ot ? ne.near(a, e) : ne.findFrom(a, e);
    return s ? vn(t, s) : !1;
  }
  return !1;
}
function Kd(t, e) {
  if (!(t.state.selection instanceof K))
    return !0;
  let { $head: n, $anchor: r, empty: i } = t.state.selection;
  if (!n.sameParent(r))
    return !0;
  if (!i)
    return !1;
  if (t.endOfTextblock(e > 0 ? "forward" : "backward"))
    return !0;
  let o = !n.textOffset && (e < 0 ? n.nodeBefore : n.nodeAfter);
  if (o && !o.isText) {
    let a = t.state.tr;
    return e < 0 ? a.delete(n.pos - o.nodeSize, n.pos) : a.delete(n.pos, n.pos + o.nodeSize), t.dispatch(a), !0;
  }
  return !1;
}
function Qd(t, e, n) {
  t.domObserver.stop(), e.contentEditable = n, t.domObserver.start();
}
function Ab(t) {
  if (!dt || t.state.selection.$head.parentOffset > 0)
    return !1;
  let { focusNode: e, focusOffset: n } = t.domSelectionRange();
  if (e && e.nodeType == 1 && n == 0 && e.firstChild && e.firstChild.contentEditable == "false") {
    let r = e.firstChild;
    Qd(t, r, "true"), setTimeout(() => Qd(t, r, "false"), 20);
  }
  return !1;
}
function Ib(t) {
  let e = "";
  return t.ctrlKey && (e += "c"), t.metaKey && (e += "m"), t.altKey && (e += "a"), t.shiftKey && (e += "s"), e;
}
function xb(t, e) {
  let n = e.keyCode, r = Ib(e);
  if (n == 8 || wt && n == 72 && r == "c")
    return Kd(t, -1) || Ir(t, -1);
  if (n == 46 && !e.shiftKey || wt && n == 68 && r == "c")
    return Kd(t, 1) || Ir(t, 1);
  if (n == 13 || n == 27)
    return !0;
  if (n == 37 || wt && n == 66 && r == "c") {
    let i = n == 37 ? qd(t, t.state.selection.from) == "ltr" ? -1 : 1 : -1;
    return zd(t, i, r) || Ir(t, i);
  } else if (n == 39 || wt && n == 70 && r == "c") {
    let i = n == 39 ? qd(t, t.state.selection.from) == "ltr" ? 1 : -1 : 1;
    return zd(t, i, r) || Ir(t, i);
  } else {
    if (n == 38 || wt && n == 80 && r == "c")
      return Wd(t, -1, r) || Ir(t, -1);
    if (n == 40 || wt && n == 78 && r == "c")
      return Ab(t) || Wd(t, 1, r) || Ir(t, 1);
    if (r == (wt ? "m" : "c") && (n == 66 || n == 73 || n == 89 || n == 90))
      return !0;
  }
  return !1;
}
function Tf(t, e) {
  t.someProp("transformCopied", (_) => {
    e = _(e, t);
  });
  let n = [], { content: r, openStart: i, openEnd: o } = e;
  for (; i > 1 && o > 1 && r.childCount == 1 && r.firstChild.childCount == 1; ) {
    i--, o--;
    let _ = r.firstChild;
    n.push(_.type.name, _.attrs != _.type.defaultAttrs ? _.attrs : null), r = _.content;
  }
  let a = t.someProp("clipboardSerializer") || Cr.fromSchema(t.state.schema), s = Nf(), l = s.createElement("div");
  l.appendChild(a.serializeFragment(r, { document: s }));
  let c = l.firstChild, u, d = 0;
  for (; c && c.nodeType == 1 && (u = Of[c.nodeName.toLowerCase()]); ) {
    for (let _ = u.length - 1; _ >= 0; _--) {
      let m = s.createElement(u[_]);
      for (; l.firstChild; )
        m.appendChild(l.firstChild);
      l.appendChild(m), d++;
    }
    c = l.firstChild;
  }
  c && c.nodeType == 1 && c.setAttribute("data-pm-slice", `${i} ${o}${d ? ` -${d}` : ""} ${JSON.stringify(n)}`);
  let p = t.someProp("clipboardTextSerializer", (_) => _(e, t)) || e.content.textBetween(0, e.content.size, `

`);
  return { dom: l, text: p, slice: e };
}
function Cf(t, e, n, r, i) {
  let o = i.parent.type.spec.code, a, s;
  if (!n && !e)
    return null;
  let l = e && (r || o || !n);
  if (l) {
    if (t.someProp("transformPastedText", (p) => {
      e = p(e, o || r, t);
    }), o)
      return e ? new H(L.from(t.state.schema.text(e.replace(/\r\n?/g, `
`))), 0, 0) : H.empty;
    let d = t.someProp("clipboardTextParser", (p) => p(e, i, r, t));
    if (d)
      s = d;
    else {
      let p = i.marks(), { schema: _ } = t.state, m = Cr.fromSchema(_);
      a = document.createElement("div"), e.split(/(?:\r\n?|\n)+/).forEach((f) => {
        let g = a.appendChild(document.createElement("p"));
        f && g.appendChild(m.serializeNode(_.text(f, p)));
      });
    }
  } else
    t.someProp("transformPastedHTML", (d) => {
      n = d(n, t);
    }), a = Lb(n), go && kb(a);
  let c = a && a.querySelector("[data-pm-slice]"), u = c && /^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice") || "");
  if (u && u[3])
    for (let d = +u[3]; d > 0; d--) {
      let p = a.firstChild;
      for (; p && p.nodeType != 1; )
        p = p.nextSibling;
      if (!p)
        break;
      a = p;
    }
  if (s || (s = (t.someProp("clipboardParser") || t.someProp("domParser") || $r.fromSchema(t.state.schema)).parseSlice(a, {
    preserveWhitespace: !!(l || u),
    context: i,
    ruleFromNode(p) {
      return p.nodeName == "BR" && !p.nextSibling && p.parentNode && !Db.test(p.parentNode.nodeName) ? { ignore: !0 } : null;
    }
  })), u)
    s = Pb(Zd(s, +u[1], +u[2]), u[4]);
  else if (s = H.maxOpen(wb(s.content, i), !0), s.openStart || s.openEnd) {
    let d = 0, p = 0;
    for (let _ = s.content.firstChild; d < s.openStart && !_.type.spec.isolating; d++, _ = _.firstChild)
      ;
    for (let _ = s.content.lastChild; p < s.openEnd && !_.type.spec.isolating; p++, _ = _.lastChild)
      ;
    s = Zd(s, d, p);
  }
  return t.someProp("transformPasted", (d) => {
    s = d(s, t);
  }), s;
}
const Db = /^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;
function wb(t, e) {
  if (t.childCount < 2)
    return t;
  for (let n = e.depth; n >= 0; n--) {
    let i = e.node(n).contentMatchAt(e.index(n)), o, a = [];
    if (t.forEach((s) => {
      if (!a)
        return;
      let l = i.findWrapping(s.type), c;
      if (!l)
        return a = null;
      if (c = a.length && o.length && vf(l, o, s, a[a.length - 1], 0))
        a[a.length - 1] = c;
      else {
        a.length && (a[a.length - 1] = Rf(a[a.length - 1], o.length));
        let u = yf(s, l);
        a.push(u), i = i.matchType(u.type), o = l;
      }
    }), a)
      return L.from(a);
  }
  return t;
}
function yf(t, e, n = 0) {
  for (let r = e.length - 1; r >= n; r--)
    t = e[r].create(null, L.from(t));
  return t;
}
function vf(t, e, n, r, i) {
  if (i < t.length && i < e.length && t[i] == e[i]) {
    let o = vf(t, e, n, r.lastChild, i + 1);
    if (o)
      return r.copy(r.content.replaceChild(r.childCount - 1, o));
    if (r.contentMatchAt(r.childCount).matchType(i == t.length - 1 ? n.type : t[i + 1]))
      return r.copy(r.content.append(L.from(yf(n, t, i + 1))));
  }
}
function Rf(t, e) {
  if (e == 0)
    return t;
  let n = t.content.replaceChild(t.childCount - 1, Rf(t.lastChild, e - 1)), r = t.contentMatchAt(t.childCount).fillBefore(L.empty, !0);
  return t.copy(n.append(r));
}
function ac(t, e, n, r, i, o) {
  let a = e < 0 ? t.firstChild : t.lastChild, s = a.content;
  return t.childCount > 1 && (o = 0), i < r - 1 && (s = ac(s, e, n, r, i + 1, o)), i >= n && (s = e < 0 ? a.contentMatchAt(0).fillBefore(s, o <= i).append(s) : s.append(a.contentMatchAt(a.childCount).fillBefore(L.empty, !0))), t.replaceChild(e < 0 ? 0 : t.childCount - 1, a.copy(s));
}
function Zd(t, e, n) {
  return e < t.openStart && (t = new H(ac(t.content, -1, e, t.openStart, 0, t.openEnd), e, t.openEnd)), n < t.openEnd && (t = new H(ac(t.content, 1, n, t.openEnd, 0, 0), t.openStart, n)), t;
}
const Of = {
  thead: ["table"],
  tbody: ["table"],
  tfoot: ["table"],
  caption: ["table"],
  colgroup: ["table"],
  col: ["table", "colgroup"],
  tr: ["table", "tbody"],
  td: ["table", "tbody", "tr"],
  th: ["table", "tbody", "tr"]
};
let Xd = null;
function Nf() {
  return Xd || (Xd = document.implementation.createHTMLDocument("title"));
}
let nl = null;
function Mb(t) {
  let e = window.trustedTypes;
  return e ? (nl || (nl = e.createPolicy("ProseMirrorClipboard", { createHTML: (n) => n })), nl.createHTML(t)) : t;
}
function Lb(t) {
  let e = /^(\s*<meta [^>]*>)*/.exec(t);
  e && (t = t.slice(e[0].length));
  let n = Nf().createElement("div"), r = /<([a-z][^>\s]+)/i.exec(t), i;
  if ((i = r && Of[r[1].toLowerCase()]) && (t = i.map((o) => "<" + o + ">").join("") + t + i.map((o) => "</" + o + ">").reverse().join("")), n.innerHTML = Mb(t), i)
    for (let o = 0; o < i.length; o++)
      n = n.querySelector(i[o]) || n;
  return n;
}
function kb(t) {
  let e = t.querySelectorAll(rt ? "span:not([class]):not([style])" : "span.Apple-converted-space");
  for (let n = 0; n < e.length; n++) {
    let r = e[n];
    r.childNodes.length == 1 && r.textContent == " " && r.parentNode && r.parentNode.replaceChild(t.ownerDocument.createTextNode(" "), r);
  }
}
function Pb(t, e) {
  if (!t.size)
    return t;
  let n = t.content.firstChild.type.schema, r;
  try {
    r = JSON.parse(e);
  } catch {
    return t;
  }
  let { content: i, openStart: o, openEnd: a } = t;
  for (let s = r.length - 2; s >= 0; s -= 2) {
    let l = n.nodes[r[s]];
    if (!l || l.hasRequiredAttrs())
      break;
    i = L.from(l.create(r[s + 1], i)), o++, a++;
  }
  return new H(i, o, a);
}
const pt = {}, _t = {}, Fb = { touchstart: !0, touchmove: !0 };
class Bb {
  constructor() {
    this.shiftKey = !1, this.mouseDown = null, this.lastKeyCode = null, this.lastKeyCodeTime = 0, this.lastClick = { time: 0, x: 0, y: 0, type: "" }, this.lastSelectionOrigin = null, this.lastSelectionTime = 0, this.lastIOSEnter = 0, this.lastIOSEnterFallbackTimeout = -1, this.lastFocus = 0, this.lastTouch = 0, this.lastChromeDelete = 0, this.composing = !1, this.compositionNode = null, this.composingTimeout = -1, this.compositionNodes = [], this.compositionEndedAt = -2e8, this.compositionID = 1, this.compositionPendingChanges = 0, this.domChangeCount = 0, this.eventHandlers = /* @__PURE__ */ Object.create(null), this.hideSelectionGuard = null;
  }
}
function Ub(t) {
  for (let e in pt) {
    let n = pt[e];
    t.dom.addEventListener(e, t.input.eventHandlers[e] = (r) => {
      Gb(t, r) && !Qc(t, r) && (t.editable || !(r.type in _t)) && n(t, r);
    }, Fb[e] ? { passive: !0 } : void 0);
  }
  dt && t.dom.addEventListener("input", () => null), sc(t);
}
function Ln(t, e) {
  t.input.lastSelectionOrigin = e, t.input.lastSelectionTime = Date.now();
}
function Hb(t) {
  t.domObserver.stop();
  for (let e in t.input.eventHandlers)
    t.dom.removeEventListener(e, t.input.eventHandlers[e]);
  clearTimeout(t.input.composingTimeout), clearTimeout(t.input.lastIOSEnterFallbackTimeout);
}
function sc(t) {
  t.someProp("handleDOMEvents", (e) => {
    for (let n in e)
      t.input.eventHandlers[n] || t.dom.addEventListener(n, t.input.eventHandlers[n] = (r) => Qc(t, r));
  });
}
function Qc(t, e) {
  return t.someProp("handleDOMEvents", (n) => {
    let r = n[e.type];
    return r ? r(t, e) || e.defaultPrevented : !1;
  });
}
function Gb(t, e) {
  if (!e.bubbles)
    return !0;
  if (e.defaultPrevented)
    return !1;
  for (let n = e.target; n != t.dom; n = n.parentNode)
    if (!n || n.nodeType == 11 || n.pmViewDesc && n.pmViewDesc.stopEvent(e))
      return !1;
  return !0;
}
function Vb(t, e) {
  !Qc(t, e) && pt[e.type] && (t.editable || !(e.type in _t)) && pt[e.type](t, e);
}
_t.keydown = (t, e) => {
  let n = e;
  if (t.input.shiftKey = n.keyCode == 16 || n.shiftKey, !If(t, n) && (t.input.lastKeyCode = n.keyCode, t.input.lastKeyCodeTime = Date.now(), !(gn && rt && n.keyCode == 13)))
    if (n.keyCode != 229 && t.domObserver.forceFlush(), jr && n.keyCode == 13 && !n.ctrlKey && !n.altKey && !n.metaKey) {
      let r = Date.now();
      t.input.lastIOSEnter = r, t.input.lastIOSEnterFallbackTimeout = setTimeout(() => {
        t.input.lastIOSEnter == r && (t.someProp("handleKeyDown", (i) => i(t, tr(13, "Enter"))), t.input.lastIOSEnter = 0);
      }, 200);
    } else t.someProp("handleKeyDown", (r) => r(t, n)) || xb(t, n) ? n.preventDefault() : Ln(t, "key");
};
_t.keyup = (t, e) => {
  e.keyCode == 16 && (t.input.shiftKey = !1);
};
_t.keypress = (t, e) => {
  let n = e;
  if (If(t, n) || !n.charCode || n.ctrlKey && !n.altKey || wt && n.metaKey)
    return;
  if (t.someProp("handleKeyPress", (i) => i(t, n))) {
    n.preventDefault();
    return;
  }
  let r = t.state.selection;
  if (!(r instanceof K) || !r.$from.sameParent(r.$to)) {
    let i = String.fromCharCode(n.charCode);
    !/[\r\n]/.test(i) && !t.someProp("handleTextInput", (o) => o(t, r.$from.pos, r.$to.pos, i)) && t.dispatch(t.state.tr.insertText(i).scrollIntoView()), n.preventDefault();
  }
};
function bs(t) {
  return { left: t.clientX, top: t.clientY };
}
function Yb(t, e) {
  let n = e.x - t.clientX, r = e.y - t.clientY;
  return n * n + r * r < 100;
}
function Zc(t, e, n, r, i) {
  if (r == -1)
    return !1;
  let o = t.state.doc.resolve(r);
  for (let a = o.depth + 1; a > 0; a--)
    if (t.someProp(e, (s) => a > o.depth ? s(t, n, o.nodeAfter, o.before(a), i, !0) : s(t, n, o.node(a), o.before(a), i, !1)))
      return !0;
  return !1;
}
function Kr(t, e, n) {
  if (t.focused || t.focus(), t.state.selection.eq(e))
    return;
  let r = t.state.tr.setSelection(e);
  r.setMeta("pointer", !0), t.dispatch(r);
}
function $b(t, e) {
  if (e == -1)
    return !1;
  let n = t.state.doc.resolve(e), r = n.nodeAfter;
  return r && r.isAtom && ee.isSelectable(r) ? (Kr(t, new ee(n)), !0) : !1;
}
function zb(t, e) {
  if (e == -1)
    return !1;
  let n = t.state.selection, r, i;
  n instanceof ee && (r = n.node);
  let o = t.state.doc.resolve(e);
  for (let a = o.depth + 1; a > 0; a--) {
    let s = a > o.depth ? o.nodeAfter : o.node(a);
    if (ee.isSelectable(s)) {
      r && n.$from.depth > 0 && a >= n.$from.depth && o.before(n.$from.depth + 1) == n.$from.pos ? i = o.before(n.$from.depth) : i = o.before(a);
      break;
    }
  }
  return i != null ? (Kr(t, ee.create(t.state.doc, i)), !0) : !1;
}
function qb(t, e, n, r, i) {
  return Zc(t, "handleClickOn", e, n, r) || t.someProp("handleClick", (o) => o(t, e, r)) || (i ? zb(t, n) : $b(t, n));
}
function Wb(t, e, n, r) {
  return Zc(t, "handleDoubleClickOn", e, n, r) || t.someProp("handleDoubleClick", (i) => i(t, e, r));
}
function Kb(t, e, n, r) {
  return Zc(t, "handleTripleClickOn", e, n, r) || t.someProp("handleTripleClick", (i) => i(t, e, r)) || Qb(t, n, r);
}
function Qb(t, e, n) {
  if (n.button != 0)
    return !1;
  let r = t.state.doc;
  if (e == -1)
    return r.inlineContent ? (Kr(t, K.create(r, 0, r.content.size)), !0) : !1;
  let i = r.resolve(e);
  for (let o = i.depth + 1; o > 0; o--) {
    let a = o > i.depth ? i.nodeAfter : i.node(o), s = i.before(o);
    if (a.inlineContent)
      Kr(t, K.create(r, s + 1, s + 1 + a.content.size));
    else if (ee.isSelectable(a))
      Kr(t, ee.create(r, s));
    else
      continue;
    return !0;
  }
}
function Xc(t) {
  return ha(t);
}
const Af = wt ? "metaKey" : "ctrlKey";
pt.mousedown = (t, e) => {
  let n = e;
  t.input.shiftKey = n.shiftKey;
  let r = Xc(t), i = Date.now(), o = "singleClick";
  i - t.input.lastClick.time < 500 && Yb(n, t.input.lastClick) && !n[Af] && (t.input.lastClick.type == "singleClick" ? o = "doubleClick" : t.input.lastClick.type == "doubleClick" && (o = "tripleClick")), t.input.lastClick = { time: i, x: n.clientX, y: n.clientY, type: o };
  let a = t.posAtCoords(bs(n));
  a && (o == "singleClick" ? (t.input.mouseDown && t.input.mouseDown.done(), t.input.mouseDown = new Zb(t, a, n, !!r)) : (o == "doubleClick" ? Wb : Kb)(t, a.pos, a.inside, n) ? n.preventDefault() : Ln(t, "pointer"));
};
class Zb {
  constructor(e, n, r, i) {
    this.view = e, this.pos = n, this.event = r, this.flushed = i, this.delayedSelectionSync = !1, this.mightDrag = null, this.startDoc = e.state.doc, this.selectNode = !!r[Af], this.allowDefault = r.shiftKey;
    let o, a;
    if (n.inside > -1)
      o = e.state.doc.nodeAt(n.inside), a = n.inside;
    else {
      let u = e.state.doc.resolve(n.pos);
      o = u.parent, a = u.depth ? u.before() : 0;
    }
    const s = i ? null : r.target, l = s ? e.docView.nearestDesc(s, !0) : null;
    this.target = l && l.dom.nodeType == 1 ? l.dom : null;
    let { selection: c } = e.state;
    (r.button == 0 && o.type.spec.draggable && o.type.spec.selectable !== !1 || c instanceof ee && c.from <= a && c.to > a) && (this.mightDrag = {
      node: o,
      pos: a,
      addAttr: !!(this.target && !this.target.draggable),
      setUneditable: !!(this.target && Vt && !this.target.hasAttribute("contentEditable"))
    }), this.target && this.mightDrag && (this.mightDrag.addAttr || this.mightDrag.setUneditable) && (this.view.domObserver.stop(), this.mightDrag.addAttr && (this.target.draggable = !0), this.mightDrag.setUneditable && setTimeout(() => {
      this.view.input.mouseDown == this && this.target.setAttribute("contentEditable", "false");
    }, 20), this.view.domObserver.start()), e.root.addEventListener("mouseup", this.up = this.up.bind(this)), e.root.addEventListener("mousemove", this.move = this.move.bind(this)), Ln(e, "pointer");
  }
  done() {
    this.view.root.removeEventListener("mouseup", this.up), this.view.root.removeEventListener("mousemove", this.move), this.mightDrag && this.target && (this.view.domObserver.stop(), this.mightDrag.addAttr && this.target.removeAttribute("draggable"), this.mightDrag.setUneditable && this.target.removeAttribute("contentEditable"), this.view.domObserver.start()), this.delayedSelectionSync && setTimeout(() => En(this.view)), this.view.input.mouseDown = null;
  }
  up(e) {
    if (this.done(), !this.view.dom.contains(e.target))
      return;
    let n = this.pos;
    this.view.state.doc != this.startDoc && (n = this.view.posAtCoords(bs(e))), this.updateAllowDefault(e), this.allowDefault || !n ? Ln(this.view, "pointer") : qb(this.view, n.pos, n.inside, e, this.selectNode) ? e.preventDefault() : e.button == 0 && (this.flushed || // Safari ignores clicks on draggable elements
    dt && this.mightDrag && !this.mightDrag.node.isAtom || // Chrome will sometimes treat a node selection as a
    // cursor, but still report that the node is selected
    // when asked through getSelection. You'll then get a
    // situation where clicking at the point where that
    // (hidden) cursor is doesn't change the selection, and
    // thus doesn't get a reaction from ProseMirror. This
    // works around that.
    rt && !this.view.state.selection.visible && Math.min(Math.abs(n.pos - this.view.state.selection.from), Math.abs(n.pos - this.view.state.selection.to)) <= 2) ? (Kr(this.view, ne.near(this.view.state.doc.resolve(n.pos))), e.preventDefault()) : Ln(this.view, "pointer");
  }
  move(e) {
    this.updateAllowDefault(e), Ln(this.view, "pointer"), e.buttons == 0 && this.done();
  }
  updateAllowDefault(e) {
    !this.allowDefault && (Math.abs(this.event.x - e.clientX) > 4 || Math.abs(this.event.y - e.clientY) > 4) && (this.allowDefault = !0);
  }
}
pt.touchstart = (t) => {
  t.input.lastTouch = Date.now(), Xc(t), Ln(t, "pointer");
};
pt.touchmove = (t) => {
  t.input.lastTouch = Date.now(), Ln(t, "pointer");
};
pt.contextmenu = (t) => Xc(t);
function If(t, e) {
  return t.composing ? !0 : dt && Math.abs(e.timeStamp - t.input.compositionEndedAt) < 500 ? (t.input.compositionEndedAt = -2e8, !0) : !1;
}
const Xb = gn ? 5e3 : -1;
_t.compositionstart = _t.compositionupdate = (t) => {
  if (!t.composing) {
    t.domObserver.flush();
    let { state: e } = t, n = e.selection.$to;
    if (e.selection instanceof K && (e.storedMarks || !n.textOffset && n.parentOffset && n.nodeBefore.marks.some((r) => r.type.spec.inclusive === !1)))
      t.markCursor = t.state.storedMarks || n.marks(), ha(t, !0), t.markCursor = null;
    else if (ha(t, !e.selection.empty), Vt && e.selection.empty && n.parentOffset && !n.textOffset && n.nodeBefore.marks.length) {
      let r = t.domSelectionRange();
      for (let i = r.focusNode, o = r.focusOffset; i && i.nodeType == 1 && o != 0; ) {
        let a = o < 0 ? i.lastChild : i.childNodes[o - 1];
        if (!a)
          break;
        if (a.nodeType == 3) {
          let s = t.domSelection();
          s && s.collapse(a, a.nodeValue.length);
          break;
        } else
          i = a, o = -1;
      }
    }
    t.input.composing = !0;
  }
  xf(t, Xb);
};
_t.compositionend = (t, e) => {
  t.composing && (t.input.composing = !1, t.input.compositionEndedAt = e.timeStamp, t.input.compositionPendingChanges = t.domObserver.pendingRecords().length ? t.input.compositionID : 0, t.input.compositionNode = null, t.input.compositionPendingChanges && Promise.resolve().then(() => t.domObserver.flush()), t.input.compositionID++, xf(t, 20));
};
function xf(t, e) {
  clearTimeout(t.input.composingTimeout), e > -1 && (t.input.composingTimeout = setTimeout(() => ha(t), e));
}
function Df(t) {
  for (t.composing && (t.input.composing = !1, t.input.compositionEndedAt = Jb()); t.input.compositionNodes.length > 0; )
    t.input.compositionNodes.pop().markParentsDirty();
}
function jb(t) {
  let e = t.domSelectionRange();
  if (!e.focusNode)
    return null;
  let n = $S(e.focusNode, e.focusOffset), r = zS(e.focusNode, e.focusOffset);
  if (n && r && n != r) {
    let i = r.pmViewDesc, o = t.domObserver.lastChangedTextNode;
    if (n == o || r == o)
      return o;
    if (!i || !i.isText(r.nodeValue))
      return r;
    if (t.input.compositionNode == r) {
      let a = n.pmViewDesc;
      if (!(!a || !a.isText(n.nodeValue)))
        return r;
    }
  }
  return n || r;
}
function Jb() {
  let t = document.createEvent("Event");
  return t.initEvent("event", !0, !0), t.timeStamp;
}
function ha(t, e = !1) {
  if (!(gn && t.domObserver.flushingSoon >= 0)) {
    if (t.domObserver.forceFlush(), Df(t), e || t.docView && t.docView.dirty) {
      let n = Wc(t);
      return n && !n.eq(t.state.selection) ? t.dispatch(t.state.tr.setSelection(n)) : (t.markCursor || e) && !t.state.selection.empty ? t.dispatch(t.state.tr.deleteSelection()) : t.updateState(t.state), !0;
    }
    return !1;
  }
}
function e0(t, e) {
  if (!t.dom.parentNode)
    return;
  let n = t.dom.parentNode.appendChild(document.createElement("div"));
  n.appendChild(e), n.style.cssText = "position: fixed; left: -10000px; top: 10px";
  let r = getSelection(), i = document.createRange();
  i.selectNodeContents(e), t.dom.blur(), r.removeAllRanges(), r.addRange(i), setTimeout(() => {
    n.parentNode && n.parentNode.removeChild(n), t.focus();
  }, 50);
}
const Ki = gt && Hn < 15 || jr && ZS < 604;
pt.copy = _t.cut = (t, e) => {
  let n = e, r = t.state.selection, i = n.type == "cut";
  if (r.empty)
    return;
  let o = Ki ? null : n.clipboardData, a = r.content(), { dom: s, text: l } = Tf(t, a);
  o ? (n.preventDefault(), o.clearData(), o.setData("text/html", s.innerHTML), o.setData("text/plain", l)) : e0(t, s), i && t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent", "cut"));
};
function t0(t) {
  return t.openStart == 0 && t.openEnd == 0 && t.content.childCount == 1 ? t.content.firstChild : null;
}
function n0(t, e) {
  if (!t.dom.parentNode)
    return;
  let n = t.input.shiftKey || t.state.selection.$from.parent.type.spec.code, r = t.dom.parentNode.appendChild(document.createElement(n ? "textarea" : "div"));
  n || (r.contentEditable = "true"), r.style.cssText = "position: fixed; left: -10000px; top: 10px", r.focus();
  let i = t.input.shiftKey && t.input.lastKeyCode != 45;
  setTimeout(() => {
    t.focus(), r.parentNode && r.parentNode.removeChild(r), n ? Qi(t, r.value, null, i, e) : Qi(t, r.textContent, r.innerHTML, i, e);
  }, 50);
}
function Qi(t, e, n, r, i) {
  let o = Cf(t, e, n, r, t.state.selection.$from);
  if (t.someProp("handlePaste", (l) => l(t, i, o || H.empty)))
    return !0;
  if (!o)
    return !1;
  let a = t0(o), s = a ? t.state.tr.replaceSelectionWith(a, r) : t.state.tr.replaceSelection(o);
  return t.dispatch(s.scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste")), !0;
}
function wf(t) {
  let e = t.getData("text/plain") || t.getData("Text");
  if (e)
    return e;
  let n = t.getData("text/uri-list");
  return n ? n.replace(/\r?\n/g, " ") : "";
}
_t.paste = (t, e) => {
  let n = e;
  if (t.composing && !gn)
    return;
  let r = Ki ? null : n.clipboardData, i = t.input.shiftKey && t.input.lastKeyCode != 45;
  r && Qi(t, wf(r), r.getData("text/html"), i, n) ? n.preventDefault() : n0(t, n);
};
class Mf {
  constructor(e, n, r) {
    this.slice = e, this.move = n, this.node = r;
  }
}
const Lf = wt ? "altKey" : "ctrlKey";
pt.dragstart = (t, e) => {
  let n = e, r = t.input.mouseDown;
  if (r && r.done(), !n.dataTransfer)
    return;
  let i = t.state.selection, o = i.empty ? null : t.posAtCoords(bs(n)), a;
  if (!(o && o.pos >= i.from && o.pos <= (i instanceof ee ? i.to - 1 : i.to))) {
    if (r && r.mightDrag)
      a = ee.create(t.state.doc, r.mightDrag.pos);
    else if (n.target && n.target.nodeType == 1) {
      let d = t.docView.nearestDesc(n.target, !0);
      d && d.node.type.spec.draggable && d != t.docView && (a = ee.create(t.state.doc, d.posBefore));
    }
  }
  let s = (a || t.state.selection).content(), { dom: l, text: c, slice: u } = Tf(t, s);
  (!n.dataTransfer.files.length || !rt || of > 120) && n.dataTransfer.clearData(), n.dataTransfer.setData(Ki ? "Text" : "text/html", l.innerHTML), n.dataTransfer.effectAllowed = "copyMove", Ki || n.dataTransfer.setData("text/plain", c), t.dragging = new Mf(u, !n[Lf], a);
};
pt.dragend = (t) => {
  let e = t.dragging;
  window.setTimeout(() => {
    t.dragging == e && (t.dragging = null);
  }, 50);
};
_t.dragover = _t.dragenter = (t, e) => e.preventDefault();
_t.drop = (t, e) => {
  let n = e, r = t.dragging;
  if (t.dragging = null, !n.dataTransfer)
    return;
  let i = t.posAtCoords(bs(n));
  if (!i)
    return;
  let o = t.state.doc.resolve(i.pos), a = r && r.slice;
  a ? t.someProp("transformPasted", (m) => {
    a = m(a, t);
  }) : a = Cf(t, wf(n.dataTransfer), Ki ? null : n.dataTransfer.getData("text/html"), !1, o);
  let s = !!(r && !n[Lf]);
  if (t.someProp("handleDrop", (m) => m(t, n, a || H.empty, s))) {
    n.preventDefault();
    return;
  }
  if (!a)
    return;
  n.preventDefault();
  let l = a ? Qm(t.state.doc, o.pos, a) : o.pos;
  l == null && (l = o.pos);
  let c = t.state.tr;
  if (s) {
    let { node: m } = r;
    m ? m.replace(c) : c.deleteSelection();
  }
  let u = c.mapping.map(l), d = a.openStart == 0 && a.openEnd == 0 && a.content.childCount == 1, p = c.doc;
  if (d ? c.replaceRangeWith(u, u, a.content.firstChild) : c.replaceRange(u, u, a), c.doc.eq(p))
    return;
  let _ = c.doc.resolve(u);
  if (d && ee.isSelectable(a.content.firstChild) && _.nodeAfter && _.nodeAfter.sameMarkup(a.content.firstChild))
    c.setSelection(new ee(_));
  else {
    let m = c.mapping.map(l);
    c.mapping.maps[c.mapping.maps.length - 1].forEach((f, g, S, E) => m = E), c.setSelection(Kc(t, _, c.doc.resolve(m)));
  }
  t.focus(), t.dispatch(c.setMeta("uiEvent", "drop"));
};
pt.focus = (t) => {
  t.input.lastFocus = Date.now(), t.focused || (t.domObserver.stop(), t.dom.classList.add("ProseMirror-focused"), t.domObserver.start(), t.focused = !0, setTimeout(() => {
    t.docView && t.hasFocus() && !t.domObserver.currentSelection.eq(t.domSelectionRange()) && En(t);
  }, 20));
};
pt.blur = (t, e) => {
  let n = e;
  t.focused && (t.domObserver.stop(), t.dom.classList.remove("ProseMirror-focused"), t.domObserver.start(), n.relatedTarget && t.dom.contains(n.relatedTarget) && t.domObserver.currentSelection.clear(), t.focused = !1);
};
pt.beforeinput = (t, e) => {
  if (rt && gn && e.inputType == "deleteContentBackward") {
    t.domObserver.flushSoon();
    let { domChangeCount: r } = t.input;
    setTimeout(() => {
      if (t.input.domChangeCount != r || (t.dom.blur(), t.focus(), t.someProp("handleKeyDown", (o) => o(t, tr(8, "Backspace")))))
        return;
      let { $cursor: i } = t.state.selection;
      i && i.pos > 0 && t.dispatch(t.state.tr.delete(i.pos - 1, i.pos).scrollIntoView());
    }, 50);
  }
};
for (let t in _t)
  pt[t] = _t[t];
function Zi(t, e) {
  if (t == e)
    return !0;
  for (let n in t)
    if (t[n] !== e[n])
      return !1;
  for (let n in e)
    if (!(n in t))
      return !1;
  return !0;
}
class Ea {
  constructor(e, n) {
    this.toDOM = e, this.spec = n || lr, this.side = this.spec.side || 0;
  }
  map(e, n, r, i) {
    let { pos: o, deleted: a } = e.mapResult(n.from + i, this.side < 0 ? -1 : 1);
    return a ? null : new Be(o - r, o - r, this);
  }
  valid() {
    return !0;
  }
  eq(e) {
    return this == e || e instanceof Ea && (this.spec.key && this.spec.key == e.spec.key || this.toDOM == e.toDOM && Zi(this.spec, e.spec));
  }
  destroy(e) {
    this.spec.destroy && this.spec.destroy(e);
  }
}
class Vn {
  constructor(e, n) {
    this.attrs = e, this.spec = n || lr;
  }
  map(e, n, r, i) {
    let o = e.map(n.from + i, this.spec.inclusiveStart ? -1 : 1) - r, a = e.map(n.to + i, this.spec.inclusiveEnd ? 1 : -1) - r;
    return o >= a ? null : new Be(o, a, this);
  }
  valid(e, n) {
    return n.from < n.to;
  }
  eq(e) {
    return this == e || e instanceof Vn && Zi(this.attrs, e.attrs) && Zi(this.spec, e.spec);
  }
  static is(e) {
    return e.type instanceof Vn;
  }
  destroy() {
  }
}
class jc {
  constructor(e, n) {
    this.attrs = e, this.spec = n || lr;
  }
  map(e, n, r, i) {
    let o = e.mapResult(n.from + i, 1);
    if (o.deleted)
      return null;
    let a = e.mapResult(n.to + i, -1);
    return a.deleted || a.pos <= o.pos ? null : new Be(o.pos - r, a.pos - r, this);
  }
  valid(e, n) {
    let { index: r, offset: i } = e.content.findIndex(n.from), o;
    return i == n.from && !(o = e.child(r)).isText && i + o.nodeSize == n.to;
  }
  eq(e) {
    return this == e || e instanceof jc && Zi(this.attrs, e.attrs) && Zi(this.spec, e.spec);
  }
  destroy() {
  }
}
class Be {
  /**
  @internal
  */
  constructor(e, n, r) {
    this.from = e, this.to = n, this.type = r;
  }
  /**
  @internal
  */
  copy(e, n) {
    return new Be(e, n, this.type);
  }
  /**
  @internal
  */
  eq(e, n = 0) {
    return this.type.eq(e.type) && this.from + n == e.from && this.to + n == e.to;
  }
  /**
  @internal
  */
  map(e, n, r) {
    return this.type.map(e, this, n, r);
  }
  /**
  Creates a widget decoration, which is a DOM node that's shown in
  the document at the given position. It is recommended that you
  delay rendering the widget by passing a function that will be
  called when the widget is actually drawn in a view, but you can
  also directly pass a DOM node. `getPos` can be used to find the
  widget's current document position.
  */
  static widget(e, n, r) {
    return new Be(e, e, new Ea(n, r));
  }
  /**
  Creates an inline decoration, which adds the given attributes to
  each inline node between `from` and `to`.
  */
  static inline(e, n, r, i) {
    return new Be(e, n, new Vn(r, i));
  }
  /**
  Creates a node decoration. `from` and `to` should point precisely
  before and after a node in the document. That node, and only that
  node, will receive the given attributes.
  */
  static node(e, n, r, i) {
    return new Be(e, n, new jc(r, i));
  }
  /**
  The spec provided when creating this decoration. Can be useful
  if you've stored extra information in that object.
  */
  get spec() {
    return this.type.spec;
  }
  /**
  @internal
  */
  get inline() {
    return this.type instanceof Vn;
  }
  /**
  @internal
  */
  get widget() {
    return this.type instanceof Ea;
  }
}
const Fr = [], lr = {};
class ye {
  /**
  @internal
  */
  constructor(e, n) {
    this.local = e.length ? e : Fr, this.children = n.length ? n : Fr;
  }
  /**
  Create a set of decorations, using the structure of the given
  document. This will consume (modify) the `decorations` array, so
  you must make a copy if you want need to preserve that.
  */
  static create(e, n) {
    return n.length ? Sa(n, e, 0, lr) : nt;
  }
  /**
  Find all decorations in this set which touch the given range
  (including decorations that start or end directly at the
  boundaries) and match the given predicate on their spec. When
  `start` and `end` are omitted, all decorations in the set are
  considered. When `predicate` isn't given, all decorations are
  assumed to match.
  */
  find(e, n, r) {
    let i = [];
    return this.findInner(e ?? 0, n ?? 1e9, i, 0, r), i;
  }
  findInner(e, n, r, i, o) {
    for (let a = 0; a < this.local.length; a++) {
      let s = this.local[a];
      s.from <= n && s.to >= e && (!o || o(s.spec)) && r.push(s.copy(s.from + i, s.to + i));
    }
    for (let a = 0; a < this.children.length; a += 3)
      if (this.children[a] < n && this.children[a + 1] > e) {
        let s = this.children[a] + 1;
        this.children[a + 2].findInner(e - s, n - s, r, i + s, o);
      }
  }
  /**
  Map the set of decorations in response to a change in the
  document.
  */
  map(e, n, r) {
    return this == nt || e.maps.length == 0 ? this : this.mapInner(e, n, 0, 0, r || lr);
  }
  /**
  @internal
  */
  mapInner(e, n, r, i, o) {
    let a;
    for (let s = 0; s < this.local.length; s++) {
      let l = this.local[s].map(e, r, i);
      l && l.type.valid(n, l) ? (a || (a = [])).push(l) : o.onRemove && o.onRemove(this.local[s].spec);
    }
    return this.children.length ? r0(this.children, a || [], e, n, r, i, o) : a ? new ye(a.sort(cr), Fr) : nt;
  }
  /**
  Add the given array of decorations to the ones in the set,
  producing a new set. Consumes the `decorations` array. Needs
  access to the current document to create the appropriate tree
  structure.
  */
  add(e, n) {
    return n.length ? this == nt ? ye.create(e, n) : this.addInner(e, n, 0) : this;
  }
  addInner(e, n, r) {
    let i, o = 0;
    e.forEach((s, l) => {
      let c = l + r, u;
      if (u = Pf(n, s, c)) {
        for (i || (i = this.children.slice()); o < i.length && i[o] < l; )
          o += 3;
        i[o] == l ? i[o + 2] = i[o + 2].addInner(s, u, c + 1) : i.splice(o, 0, l, l + s.nodeSize, Sa(u, s, c + 1, lr)), o += 3;
      }
    });
    let a = kf(o ? Ff(n) : n, -r);
    for (let s = 0; s < a.length; s++)
      a[s].type.valid(e, a[s]) || a.splice(s--, 1);
    return new ye(a.length ? this.local.concat(a).sort(cr) : this.local, i || this.children);
  }
  /**
  Create a new set that contains the decorations in this set, minus
  the ones in the given array.
  */
  remove(e) {
    return e.length == 0 || this == nt ? this : this.removeInner(e, 0);
  }
  removeInner(e, n) {
    let r = this.children, i = this.local;
    for (let o = 0; o < r.length; o += 3) {
      let a, s = r[o] + n, l = r[o + 1] + n;
      for (let u = 0, d; u < e.length; u++)
        (d = e[u]) && d.from > s && d.to < l && (e[u] = null, (a || (a = [])).push(d));
      if (!a)
        continue;
      r == this.children && (r = this.children.slice());
      let c = r[o + 2].removeInner(a, s + 1);
      c != nt ? r[o + 2] = c : (r.splice(o, 3), o -= 3);
    }
    if (i.length) {
      for (let o = 0, a; o < e.length; o++)
        if (a = e[o])
          for (let s = 0; s < i.length; s++)
            i[s].eq(a, n) && (i == this.local && (i = this.local.slice()), i.splice(s--, 1));
    }
    return r == this.children && i == this.local ? this : i.length || r.length ? new ye(i, r) : nt;
  }
  forChild(e, n) {
    if (this == nt)
      return this;
    if (n.isLeaf)
      return ye.empty;
    let r, i;
    for (let s = 0; s < this.children.length; s += 3)
      if (this.children[s] >= e) {
        this.children[s] == e && (r = this.children[s + 2]);
        break;
      }
    let o = e + 1, a = o + n.content.size;
    for (let s = 0; s < this.local.length; s++) {
      let l = this.local[s];
      if (l.from < a && l.to > o && l.type instanceof Vn) {
        let c = Math.max(o, l.from) - o, u = Math.min(a, l.to) - o;
        c < u && (i || (i = [])).push(l.copy(c, u));
      }
    }
    if (i) {
      let s = new ye(i.sort(cr), Fr);
      return r ? new An([s, r]) : s;
    }
    return r || nt;
  }
  /**
  @internal
  */
  eq(e) {
    if (this == e)
      return !0;
    if (!(e instanceof ye) || this.local.length != e.local.length || this.children.length != e.children.length)
      return !1;
    for (let n = 0; n < this.local.length; n++)
      if (!this.local[n].eq(e.local[n]))
        return !1;
    for (let n = 0; n < this.children.length; n += 3)
      if (this.children[n] != e.children[n] || this.children[n + 1] != e.children[n + 1] || !this.children[n + 2].eq(e.children[n + 2]))
        return !1;
    return !0;
  }
  /**
  @internal
  */
  locals(e) {
    return Jc(this.localsInner(e));
  }
  /**
  @internal
  */
  localsInner(e) {
    if (this == nt)
      return Fr;
    if (e.inlineContent || !this.local.some(Vn.is))
      return this.local;
    let n = [];
    for (let r = 0; r < this.local.length; r++)
      this.local[r].type instanceof Vn || n.push(this.local[r]);
    return n;
  }
  forEachSet(e) {
    e(this);
  }
}
ye.empty = new ye([], []);
ye.removeOverlap = Jc;
const nt = ye.empty;
class An {
  constructor(e) {
    this.members = e;
  }
  map(e, n) {
    const r = this.members.map((i) => i.map(e, n, lr));
    return An.from(r);
  }
  forChild(e, n) {
    if (n.isLeaf)
      return ye.empty;
    let r = [];
    for (let i = 0; i < this.members.length; i++) {
      let o = this.members[i].forChild(e, n);
      o != nt && (o instanceof An ? r = r.concat(o.members) : r.push(o));
    }
    return An.from(r);
  }
  eq(e) {
    if (!(e instanceof An) || e.members.length != this.members.length)
      return !1;
    for (let n = 0; n < this.members.length; n++)
      if (!this.members[n].eq(e.members[n]))
        return !1;
    return !0;
  }
  locals(e) {
    let n, r = !0;
    for (let i = 0; i < this.members.length; i++) {
      let o = this.members[i].localsInner(e);
      if (o.length)
        if (!n)
          n = o;
        else {
          r && (n = n.slice(), r = !1);
          for (let a = 0; a < o.length; a++)
            n.push(o[a]);
        }
    }
    return n ? Jc(r ? n : n.sort(cr)) : Fr;
  }
  // Create a group for the given array of decoration sets, or return
  // a single set when possible.
  static from(e) {
    switch (e.length) {
      case 0:
        return nt;
      case 1:
        return e[0];
      default:
        return new An(e.every((n) => n instanceof ye) ? e : e.reduce((n, r) => n.concat(r instanceof ye ? r : r.members), []));
    }
  }
  forEachSet(e) {
    for (let n = 0; n < this.members.length; n++)
      this.members[n].forEachSet(e);
  }
}
function r0(t, e, n, r, i, o, a) {
  let s = t.slice();
  for (let c = 0, u = o; c < n.maps.length; c++) {
    let d = 0;
    n.maps[c].forEach((p, _, m, f) => {
      let g = f - m - (_ - p);
      for (let S = 0; S < s.length; S += 3) {
        let E = s[S + 1];
        if (E < 0 || p > E + u - d)
          continue;
        let b = s[S] + u - d;
        _ >= b ? s[S + 1] = p <= b ? -2 : -1 : p >= u && g && (s[S] += g, s[S + 1] += g);
      }
      d += g;
    }), u = n.maps[c].map(u, -1);
  }
  let l = !1;
  for (let c = 0; c < s.length; c += 3)
    if (s[c + 1] < 0) {
      if (s[c + 1] == -2) {
        l = !0, s[c + 1] = -1;
        continue;
      }
      let u = n.map(t[c] + o), d = u - i;
      if (d < 0 || d >= r.content.size) {
        l = !0;
        continue;
      }
      let p = n.map(t[c + 1] + o, -1), _ = p - i, { index: m, offset: f } = r.content.findIndex(d), g = r.maybeChild(m);
      if (g && f == d && f + g.nodeSize == _) {
        let S = s[c + 2].mapInner(n, g, u + 1, t[c] + o + 1, a);
        S != nt ? (s[c] = d, s[c + 1] = _, s[c + 2] = S) : (s[c + 1] = -2, l = !0);
      } else
        l = !0;
    }
  if (l) {
    let c = i0(s, t, e, n, i, o, a), u = Sa(c, r, 0, a);
    e = u.local;
    for (let d = 0; d < s.length; d += 3)
      s[d + 1] < 0 && (s.splice(d, 3), d -= 3);
    for (let d = 0, p = 0; d < u.children.length; d += 3) {
      let _ = u.children[d];
      for (; p < s.length && s[p] < _; )
        p += 3;
      s.splice(p, 0, u.children[d], u.children[d + 1], u.children[d + 2]);
    }
  }
  return new ye(e.sort(cr), s);
}
function kf(t, e) {
  if (!e || !t.length)
    return t;
  let n = [];
  for (let r = 0; r < t.length; r++) {
    let i = t[r];
    n.push(new Be(i.from + e, i.to + e, i.type));
  }
  return n;
}
function i0(t, e, n, r, i, o, a) {
  function s(l, c) {
    for (let u = 0; u < l.local.length; u++) {
      let d = l.local[u].map(r, i, c);
      d ? n.push(d) : a.onRemove && a.onRemove(l.local[u].spec);
    }
    for (let u = 0; u < l.children.length; u += 3)
      s(l.children[u + 2], l.children[u] + c + 1);
  }
  for (let l = 0; l < t.length; l += 3)
    t[l + 1] == -1 && s(t[l + 2], e[l] + o + 1);
  return n;
}
function Pf(t, e, n) {
  if (e.isLeaf)
    return null;
  let r = n + e.nodeSize, i = null;
  for (let o = 0, a; o < t.length; o++)
    (a = t[o]) && a.from > n && a.to < r && ((i || (i = [])).push(a), t[o] = null);
  return i;
}
function Ff(t) {
  let e = [];
  for (let n = 0; n < t.length; n++)
    t[n] != null && e.push(t[n]);
  return e;
}
function Sa(t, e, n, r) {
  let i = [], o = !1;
  e.forEach((s, l) => {
    let c = Pf(t, s, l + n);
    if (c) {
      o = !0;
      let u = Sa(c, s, n + l + 1, r);
      u != nt && i.push(l, l + s.nodeSize, u);
    }
  });
  let a = kf(o ? Ff(t) : t, -n).sort(cr);
  for (let s = 0; s < a.length; s++)
    a[s].type.valid(e, a[s]) || (r.onRemove && r.onRemove(a[s].spec), a.splice(s--, 1));
  return a.length || i.length ? new ye(a, i) : nt;
}
function cr(t, e) {
  return t.from - e.from || t.to - e.to;
}
function Jc(t) {
  let e = t;
  for (let n = 0; n < e.length - 1; n++) {
    let r = e[n];
    if (r.from != r.to)
      for (let i = n + 1; i < e.length; i++) {
        let o = e[i];
        if (o.from == r.from) {
          o.to != r.to && (e == t && (e = t.slice()), e[i] = o.copy(o.from, r.to), jd(e, i + 1, o.copy(r.to, o.to)));
          continue;
        } else {
          o.from < r.to && (e == t && (e = t.slice()), e[n] = r.copy(r.from, o.from), jd(e, i, r.copy(o.from, r.to)));
          break;
        }
      }
  }
  return e;
}
function jd(t, e, n) {
  for (; e < t.length && cr(n, t[e]) > 0; )
    e++;
  t.splice(e, 0, n);
}
function rl(t) {
  let e = [];
  return t.someProp("decorations", (n) => {
    let r = n(t.state);
    r && r != nt && e.push(r);
  }), t.cursorWrapper && e.push(ye.create(t.state.doc, [t.cursorWrapper.deco])), An.from(e);
}
const o0 = {
  childList: !0,
  characterData: !0,
  characterDataOldValue: !0,
  attributes: !0,
  attributeOldValue: !0,
  subtree: !0
}, a0 = gt && Hn <= 11;
class s0 {
  constructor() {
    this.anchorNode = null, this.anchorOffset = 0, this.focusNode = null, this.focusOffset = 0;
  }
  set(e) {
    this.anchorNode = e.anchorNode, this.anchorOffset = e.anchorOffset, this.focusNode = e.focusNode, this.focusOffset = e.focusOffset;
  }
  clear() {
    this.anchorNode = this.focusNode = null;
  }
  eq(e) {
    return e.anchorNode == this.anchorNode && e.anchorOffset == this.anchorOffset && e.focusNode == this.focusNode && e.focusOffset == this.focusOffset;
  }
}
class l0 {
  constructor(e, n) {
    this.view = e, this.handleDOMChange = n, this.queue = [], this.flushingSoon = -1, this.observer = null, this.currentSelection = new s0(), this.onCharData = null, this.suppressingSelectionUpdates = !1, this.lastChangedTextNode = null, this.observer = window.MutationObserver && new window.MutationObserver((r) => {
      for (let i = 0; i < r.length; i++)
        this.queue.push(r[i]);
      gt && Hn <= 11 && r.some((i) => i.type == "childList" && i.removedNodes.length || i.type == "characterData" && i.oldValue.length > i.target.nodeValue.length) ? this.flushSoon() : this.flush();
    }), a0 && (this.onCharData = (r) => {
      this.queue.push({ target: r.target, type: "characterData", oldValue: r.prevValue }), this.flushSoon();
    }), this.onSelectionChange = this.onSelectionChange.bind(this);
  }
  flushSoon() {
    this.flushingSoon < 0 && (this.flushingSoon = window.setTimeout(() => {
      this.flushingSoon = -1, this.flush();
    }, 20));
  }
  forceFlush() {
    this.flushingSoon > -1 && (window.clearTimeout(this.flushingSoon), this.flushingSoon = -1, this.flush());
  }
  start() {
    this.observer && (this.observer.takeRecords(), this.observer.observe(this.view.dom, o0)), this.onCharData && this.view.dom.addEventListener("DOMCharacterDataModified", this.onCharData), this.connectSelection();
  }
  stop() {
    if (this.observer) {
      let e = this.observer.takeRecords();
      if (e.length) {
        for (let n = 0; n < e.length; n++)
          this.queue.push(e[n]);
        window.setTimeout(() => this.flush(), 20);
      }
      this.observer.disconnect();
    }
    this.onCharData && this.view.dom.removeEventListener("DOMCharacterDataModified", this.onCharData), this.disconnectSelection();
  }
  connectSelection() {
    this.view.dom.ownerDocument.addEventListener("selectionchange", this.onSelectionChange);
  }
  disconnectSelection() {
    this.view.dom.ownerDocument.removeEventListener("selectionchange", this.onSelectionChange);
  }
  suppressSelectionUpdates() {
    this.suppressingSelectionUpdates = !0, setTimeout(() => this.suppressingSelectionUpdates = !1, 50);
  }
  onSelectionChange() {
    if ($d(this.view)) {
      if (this.suppressingSelectionUpdates)
        return En(this.view);
      if (gt && Hn <= 11 && !this.view.state.selection.empty) {
        let e = this.view.domSelectionRange();
        if (e.focusNode && fr(e.focusNode, e.focusOffset, e.anchorNode, e.anchorOffset))
          return this.flushSoon();
      }
      this.flush();
    }
  }
  setCurSelection() {
    this.currentSelection.set(this.view.domSelectionRange());
  }
  ignoreSelectionChange(e) {
    if (!e.focusNode)
      return !0;
    let n = /* @__PURE__ */ new Set(), r;
    for (let o = e.focusNode; o; o = Wi(o))
      n.add(o);
    for (let o = e.anchorNode; o; o = Wi(o))
      if (n.has(o)) {
        r = o;
        break;
      }
    let i = r && this.view.docView.nearestDesc(r);
    if (i && i.ignoreMutation({
      type: "selection",
      target: r.nodeType == 3 ? r.parentNode : r
    }))
      return this.setCurSelection(), !0;
  }
  pendingRecords() {
    if (this.observer)
      for (let e of this.observer.takeRecords())
        this.queue.push(e);
    return this.queue;
  }
  flush() {
    let { view: e } = this;
    if (!e.docView || this.flushingSoon > -1)
      return;
    let n = this.pendingRecords();
    n.length && (this.queue = []);
    let r = e.domSelectionRange(), i = !this.suppressingSelectionUpdates && !this.currentSelection.eq(r) && $d(e) && !this.ignoreSelectionChange(r), o = -1, a = -1, s = !1, l = [];
    if (e.editable)
      for (let u = 0; u < n.length; u++) {
        let d = this.registerMutation(n[u], l);
        d && (o = o < 0 ? d.from : Math.min(d.from, o), a = a < 0 ? d.to : Math.max(d.to, a), d.typeOver && (s = !0));
      }
    if (Vt && l.length) {
      let u = l.filter((d) => d.nodeName == "BR");
      if (u.length == 2) {
        let [d, p] = u;
        d.parentNode && d.parentNode.parentNode == p.parentNode ? p.remove() : d.remove();
      } else {
        let { focusNode: d } = this.currentSelection;
        for (let p of u) {
          let _ = p.parentNode;
          _ && _.nodeName == "LI" && (!d || d0(e, d) != _) && p.remove();
        }
      }
    }
    let c = null;
    o < 0 && i && e.input.lastFocus > Date.now() - 200 && Math.max(e.input.lastTouch, e.input.lastClick.time) < Date.now() - 300 && Es(r) && (c = Wc(e)) && c.eq(ne.near(e.state.doc.resolve(0), 1)) ? (e.input.lastFocus = 0, En(e), this.currentSelection.set(r), e.scrollToSelection()) : (o > -1 || i) && (o > -1 && (e.docView.markDirty(o, a), c0(e)), this.handleDOMChange(o, a, s, l), e.docView && e.docView.dirty ? e.updateState(e.state) : this.currentSelection.eq(r) || En(e), this.currentSelection.set(r));
  }
  registerMutation(e, n) {
    if (n.indexOf(e.target) > -1)
      return null;
    let r = this.view.docView.nearestDesc(e.target);
    if (e.type == "attributes" && (r == this.view.docView || e.attributeName == "contenteditable" || // Firefox sometimes fires spurious events for null/empty styles
    e.attributeName == "style" && !e.oldValue && !e.target.getAttribute("style")) || !r || r.ignoreMutation(e))
      return null;
    if (e.type == "childList") {
      for (let u = 0; u < e.addedNodes.length; u++) {
        let d = e.addedNodes[u];
        n.push(d), d.nodeType == 3 && (this.lastChangedTextNode = d);
      }
      if (r.contentDOM && r.contentDOM != r.dom && !r.contentDOM.contains(e.target))
        return { from: r.posBefore, to: r.posAfter };
      let i = e.previousSibling, o = e.nextSibling;
      if (gt && Hn <= 11 && e.addedNodes.length)
        for (let u = 0; u < e.addedNodes.length; u++) {
          let { previousSibling: d, nextSibling: p } = e.addedNodes[u];
          (!d || Array.prototype.indexOf.call(e.addedNodes, d) < 0) && (i = d), (!p || Array.prototype.indexOf.call(e.addedNodes, p) < 0) && (o = p);
        }
      let a = i && i.parentNode == e.target ? Xe(i) + 1 : 0, s = r.localPosFromDOM(e.target, a, -1), l = o && o.parentNode == e.target ? Xe(o) : e.target.childNodes.length, c = r.localPosFromDOM(e.target, l, 1);
      return { from: s, to: c };
    } else return e.type == "attributes" ? { from: r.posAtStart - r.border, to: r.posAtEnd + r.border } : (this.lastChangedTextNode = e.target, {
      from: r.posAtStart,
      to: r.posAtEnd,
      // An event was generated for a text change that didn't change
      // any text. Mark the dom change to fall back to assuming the
      // selection was typed over with an identical value if it can't
      // find another change.
      typeOver: e.target.nodeValue == e.oldValue
    });
  }
}
let Jd = /* @__PURE__ */ new WeakMap(), ep = !1;
function c0(t) {
  if (!Jd.has(t) && (Jd.set(t, null), ["normal", "nowrap", "pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace) !== -1)) {
    if (t.requiresGeckoHackNode = Vt, ep)
      return;
    console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."), ep = !0;
  }
}
function tp(t, e) {
  let n = e.startContainer, r = e.startOffset, i = e.endContainer, o = e.endOffset, a = t.domAtPos(t.state.selection.anchor);
  return fr(a.node, a.offset, i, o) && ([n, r, i, o] = [i, o, n, r]), { anchorNode: n, anchorOffset: r, focusNode: i, focusOffset: o };
}
function u0(t, e) {
  if (e.getComposedRanges) {
    let i = e.getComposedRanges(t.root)[0];
    if (i)
      return tp(t, i);
  }
  let n;
  function r(i) {
    i.preventDefault(), i.stopImmediatePropagation(), n = i.getTargetRanges()[0];
  }
  return t.dom.addEventListener("beforeinput", r, !0), document.execCommand("indent"), t.dom.removeEventListener("beforeinput", r, !0), n ? tp(t, n) : null;
}
function d0(t, e) {
  for (let n = e.parentNode; n && n != t.dom; n = n.parentNode) {
    let r = t.docView.nearestDesc(n, !0);
    if (r && r.node.isBlock)
      return n;
  }
  return null;
}
function p0(t, e, n) {
  let { node: r, fromOffset: i, toOffset: o, from: a, to: s } = t.docView.parseRange(e, n), l = t.domSelectionRange(), c, u = l.anchorNode;
  if (u && t.dom.contains(u.nodeType == 1 ? u : u.parentNode) && (c = [{ node: u, offset: l.anchorOffset }], Es(l) || c.push({ node: l.focusNode, offset: l.focusOffset })), rt && t.input.lastKeyCode === 8)
    for (let g = o; g > i; g--) {
      let S = r.childNodes[g - 1], E = S.pmViewDesc;
      if (S.nodeName == "BR" && !E) {
        o = g;
        break;
      }
      if (!E || E.size)
        break;
    }
  let d = t.state.doc, p = t.someProp("domParser") || $r.fromSchema(t.state.schema), _ = d.resolve(a), m = null, f = p.parse(r, {
    topNode: _.parent,
    topMatch: _.parent.contentMatchAt(_.index()),
    topOpen: !0,
    from: i,
    to: o,
    preserveWhitespace: _.parent.type.whitespace == "pre" ? "full" : !0,
    findPositions: c,
    ruleFromNode: _0,
    context: _
  });
  if (c && c[0].pos != null) {
    let g = c[0].pos, S = c[1] && c[1].pos;
    S == null && (S = g), m = { anchor: g + a, head: S + a };
  }
  return { doc: f, sel: m, from: a, to: s };
}
function _0(t) {
  let e = t.pmViewDesc;
  if (e)
    return e.parseRule();
  if (t.nodeName == "BR" && t.parentNode) {
    if (dt && /^(ul|ol)$/i.test(t.parentNode.nodeName)) {
      let n = document.createElement("div");
      return n.appendChild(document.createElement("li")), { skip: n };
    } else if (t.parentNode.lastChild == t || dt && /^(tr|table)$/i.test(t.parentNode.nodeName))
      return { ignore: !0 };
  } else if (t.nodeName == "IMG" && t.getAttribute("mark-placeholder"))
    return { ignore: !0 };
  return null;
}
const m0 = /^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;
function f0(t, e, n, r, i) {
  let o = t.input.compositionPendingChanges || (t.composing ? t.input.compositionID : 0);
  if (t.input.compositionPendingChanges = 0, e < 0) {
    let N = t.input.lastSelectionTime > Date.now() - 50 ? t.input.lastSelectionOrigin : null, x = Wc(t, N);
    if (x && !t.state.selection.eq(x)) {
      if (rt && gn && t.input.lastKeyCode === 13 && Date.now() - 100 < t.input.lastKeyCodeTime && t.someProp("handleKeyDown", (Y) => Y(t, tr(13, "Enter"))))
        return;
      let P = t.state.tr.setSelection(x);
      N == "pointer" ? P.setMeta("pointer", !0) : N == "key" && P.scrollIntoView(), o && P.setMeta("composition", o), t.dispatch(P);
    }
    return;
  }
  let a = t.state.doc.resolve(e), s = a.sharedDepth(n);
  e = a.before(s + 1), n = t.state.doc.resolve(n).after(s + 1);
  let l = t.state.selection, c = p0(t, e, n), u = t.state.doc, d = u.slice(c.from, c.to), p, _;
  t.input.lastKeyCode === 8 && Date.now() - 100 < t.input.lastKeyCodeTime ? (p = t.state.selection.to, _ = "end") : (p = t.state.selection.from, _ = "start"), t.input.lastKeyCode = null;
  let m = E0(d.content, c.doc.content, c.from, p, _);
  if (m && t.input.domChangeCount++, (jr && t.input.lastIOSEnter > Date.now() - 225 || gn) && i.some((N) => N.nodeType == 1 && !m0.test(N.nodeName)) && (!m || m.endA >= m.endB) && t.someProp("handleKeyDown", (N) => N(t, tr(13, "Enter")))) {
    t.input.lastIOSEnter = 0;
    return;
  }
  if (!m)
    if (r && l instanceof K && !l.empty && l.$head.sameParent(l.$anchor) && !t.composing && !(c.sel && c.sel.anchor != c.sel.head))
      m = { start: l.from, endA: l.to, endB: l.to };
    else {
      if (c.sel) {
        let N = np(t, t.state.doc, c.sel);
        if (N && !N.eq(t.state.selection)) {
          let x = t.state.tr.setSelection(N);
          o && x.setMeta("composition", o), t.dispatch(x);
        }
      }
      return;
    }
  t.state.selection.from < t.state.selection.to && m.start == m.endB && t.state.selection instanceof K && (m.start > t.state.selection.from && m.start <= t.state.selection.from + 2 && t.state.selection.from >= c.from ? m.start = t.state.selection.from : m.endA < t.state.selection.to && m.endA >= t.state.selection.to - 2 && t.state.selection.to <= c.to && (m.endB += t.state.selection.to - m.endA, m.endA = t.state.selection.to)), gt && Hn <= 11 && m.endB == m.start + 1 && m.endA == m.start && m.start > c.from && c.doc.textBetween(m.start - c.from - 1, m.start - c.from + 1) == "  " && (m.start--, m.endA--, m.endB--);
  let f = c.doc.resolveNoCache(m.start - c.from), g = c.doc.resolveNoCache(m.endB - c.from), S = u.resolve(m.start), E = f.sameParent(g) && f.parent.inlineContent && S.end() >= m.endA, b;
  if ((jr && t.input.lastIOSEnter > Date.now() - 225 && (!E || i.some((N) => N.nodeName == "DIV" || N.nodeName == "P")) || !E && f.pos < c.doc.content.size && !f.sameParent(g) && (b = ne.findFrom(c.doc.resolve(f.pos + 1), 1, !0)) && b.head == g.pos) && t.someProp("handleKeyDown", (N) => N(t, tr(13, "Enter")))) {
    t.input.lastIOSEnter = 0;
    return;
  }
  if (t.state.selection.anchor > m.start && h0(u, m.start, m.endA, f, g) && t.someProp("handleKeyDown", (N) => N(t, tr(8, "Backspace")))) {
    gn && rt && t.domObserver.suppressSelectionUpdates();
    return;
  }
  rt && m.endB == m.start && (t.input.lastChromeDelete = Date.now()), gn && !E && f.start() != g.start() && g.parentOffset == 0 && f.depth == g.depth && c.sel && c.sel.anchor == c.sel.head && c.sel.head == m.endA && (m.endB -= 2, g = c.doc.resolveNoCache(m.endB - c.from), setTimeout(() => {
    t.someProp("handleKeyDown", function(N) {
      return N(t, tr(13, "Enter"));
    });
  }, 20));
  let h = m.start, T = m.endA, C, v, I;
  if (E) {
    if (f.pos == g.pos)
      gt && Hn <= 11 && f.parentOffset == 0 && (t.domObserver.suppressSelectionUpdates(), setTimeout(() => En(t), 20)), C = t.state.tr.delete(h, T), v = u.resolve(m.start).marksAcross(u.resolve(m.endA));
    else if (
      // Adding or removing a mark
      m.endA == m.endB && (I = g0(f.parent.content.cut(f.parentOffset, g.parentOffset), S.parent.content.cut(S.parentOffset, m.endA - S.start())))
    )
      C = t.state.tr, I.type == "add" ? C.addMark(h, T, I.mark) : C.removeMark(h, T, I.mark);
    else if (f.parent.child(f.index()).isText && f.index() == g.index() - (g.textOffset ? 0 : 1)) {
      let N = f.parent.textBetween(f.parentOffset, g.parentOffset);
      if (t.someProp("handleTextInput", (x) => x(t, h, T, N)))
        return;
      C = t.state.tr.insertText(N, h, T);
    }
  }
  if (C || (C = t.state.tr.replace(h, T, c.doc.slice(m.start - c.from, m.endB - c.from))), c.sel) {
    let N = np(t, C.doc, c.sel);
    N && !(rt && t.composing && N.empty && (m.start != m.endB || t.input.lastChromeDelete < Date.now() - 100) && (N.head == h || N.head == C.mapping.map(T) - 1) || gt && N.empty && N.head == h) && C.setSelection(N);
  }
  v && C.ensureMarks(v), o && C.setMeta("composition", o), t.dispatch(C.scrollIntoView());
}
function np(t, e, n) {
  return Math.max(n.anchor, n.head) > e.content.size ? null : Kc(t, e.resolve(n.anchor), e.resolve(n.head));
}
function g0(t, e) {
  let n = t.firstChild.marks, r = e.firstChild.marks, i = n, o = r, a, s, l;
  for (let u = 0; u < r.length; u++)
    i = r[u].removeFromSet(i);
  for (let u = 0; u < n.length; u++)
    o = n[u].removeFromSet(o);
  if (i.length == 1 && o.length == 0)
    s = i[0], a = "add", l = (u) => u.mark(s.addToSet(u.marks));
  else if (i.length == 0 && o.length == 1)
    s = o[0], a = "remove", l = (u) => u.mark(s.removeFromSet(u.marks));
  else
    return null;
  let c = [];
  for (let u = 0; u < e.childCount; u++)
    c.push(l(e.child(u)));
  if (L.from(c).eq(t))
    return { mark: s, type: a };
}
function h0(t, e, n, r, i) {
  if (
    // The content must have shrunk
    n - e <= i.pos - r.pos || // newEnd must point directly at or after the end of the block that newStart points into
    il(r, !0, !1) < i.pos
  )
    return !1;
  let o = t.resolve(e);
  if (!r.parent.isTextblock) {
    let s = o.nodeAfter;
    return s != null && n == e + s.nodeSize;
  }
  if (o.parentOffset < o.parent.content.size || !o.parent.isTextblock)
    return !1;
  let a = t.resolve(il(o, !0, !0));
  return !a.parent.isTextblock || a.pos > n || il(a, !0, !1) < n ? !1 : r.parent.content.cut(r.parentOffset).eq(a.parent.content);
}
function il(t, e, n) {
  let r = t.depth, i = e ? t.end() : t.pos;
  for (; r > 0 && (e || t.indexAfter(r) == t.node(r).childCount); )
    r--, i++, e = !1;
  if (n) {
    let o = t.node(r).maybeChild(t.indexAfter(r));
    for (; o && !o.isLeaf; )
      o = o.firstChild, i++;
  }
  return i;
}
function E0(t, e, n, r, i) {
  let o = t.findDiffStart(e, n);
  if (o == null)
    return null;
  let { a, b: s } = t.findDiffEnd(e, n + t.size, n + e.size);
  if (i == "end") {
    let l = Math.max(0, o - Math.min(a, s));
    r -= a + l - o;
  }
  if (a < o && t.size < e.size) {
    let l = r <= o && r >= a ? o - r : 0;
    o -= l, o && o < e.size && rp(e.textBetween(o - 1, o + 1)) && (o += l ? 1 : -1), s = o + (s - a), a = o;
  } else if (s < o) {
    let l = r <= o && r >= s ? o - r : 0;
    o -= l, o && o < t.size && rp(t.textBetween(o - 1, o + 1)) && (o += l ? 1 : -1), a = o + (a - s), s = o;
  }
  return { start: o, endA: a, endB: s };
}
function rp(t) {
  if (t.length != 2)
    return !1;
  let e = t.charCodeAt(0), n = t.charCodeAt(1);
  return e >= 56320 && e <= 57343 && n >= 55296 && n <= 56319;
}
class S0 {
  /**
  Create a view. `place` may be a DOM node that the editor should
  be appended to, a function that will place it into the document,
  or an object whose `mount` property holds the node to use as the
  document container. If it is `null`, the editor will not be
  added to the document.
  */
  constructor(e, n) {
    this._root = null, this.focused = !1, this.trackWrites = null, this.mounted = !1, this.markCursor = null, this.cursorWrapper = null, this.lastSelectedViewDesc = void 0, this.input = new Bb(), this.prevDirectPlugins = [], this.pluginViews = [], this.requiresGeckoHackNode = !1, this.dragging = null, this._props = n, this.state = n.state, this.directPlugins = n.plugins || [], this.directPlugins.forEach(lp), this.dispatch = this.dispatch.bind(this), this.dom = e && e.mount || document.createElement("div"), e && (e.appendChild ? e.appendChild(this.dom) : typeof e == "function" ? e(this.dom) : e.mount && (this.mounted = !0)), this.editable = ap(this), op(this), this.nodeViews = sp(this), this.docView = Bd(this.state.doc, ip(this), rl(this), this.dom, this), this.domObserver = new l0(this, (r, i, o, a) => f0(this, r, i, o, a)), this.domObserver.start(), Ub(this), this.updatePluginViews();
  }
  /**
  Holds `true` when a
  [composition](https://w3c.github.io/uievents/#events-compositionevents)
  is active.
  */
  get composing() {
    return this.input.composing;
  }
  /**
  The view's current [props](https://prosemirror.net/docs/ref/#view.EditorProps).
  */
  get props() {
    if (this._props.state != this.state) {
      let e = this._props;
      this._props = {};
      for (let n in e)
        this._props[n] = e[n];
      this._props.state = this.state;
    }
    return this._props;
  }
  /**
  Update the view's props. Will immediately cause an update to
  the DOM.
  */
  update(e) {
    e.handleDOMEvents != this._props.handleDOMEvents && sc(this);
    let n = this._props;
    this._props = e, e.plugins && (e.plugins.forEach(lp), this.directPlugins = e.plugins), this.updateStateInner(e.state, n);
  }
  /**
  Update the view by updating existing props object with the object
  given as argument. Equivalent to `view.update(Object.assign({},
  view.props, props))`.
  */
  setProps(e) {
    let n = {};
    for (let r in this._props)
      n[r] = this._props[r];
    n.state = this.state;
    for (let r in e)
      n[r] = e[r];
    this.update(n);
  }
  /**
  Update the editor's `state` prop, without touching any of the
  other props.
  */
  updateState(e) {
    this.updateStateInner(e, this._props);
  }
  updateStateInner(e, n) {
    var r;
    let i = this.state, o = !1, a = !1;
    e.storedMarks && this.composing && (Df(this), a = !0), this.state = e;
    let s = i.plugins != e.plugins || this._props.plugins != n.plugins;
    if (s || this._props.plugins != n.plugins || this._props.nodeViews != n.nodeViews) {
      let _ = sp(this);
      T0(_, this.nodeViews) && (this.nodeViews = _, o = !0);
    }
    (s || n.handleDOMEvents != this._props.handleDOMEvents) && sc(this), this.editable = ap(this), op(this);
    let l = rl(this), c = ip(this), u = i.plugins != e.plugins && !i.doc.eq(e.doc) ? "reset" : e.scrollToSelection > i.scrollToSelection ? "to selection" : "preserve", d = o || !this.docView.matchesNode(e.doc, c, l);
    (d || !e.selection.eq(i.selection)) && (a = !0);
    let p = u == "preserve" && a && this.dom.style.overflowAnchor == null && JS(this);
    if (a) {
      this.domObserver.stop();
      let _ = d && (gt || rt) && !this.composing && !i.selection.empty && !e.selection.empty && b0(i.selection, e.selection);
      if (d) {
        let m = rt ? this.trackWrites = this.domSelectionRange().focusNode : null;
        this.composing && (this.input.compositionNode = jb(this)), (o || !this.docView.update(e.doc, c, l, this)) && (this.docView.updateOuterDeco(c), this.docView.destroy(), this.docView = Bd(e.doc, c, l, this.dom, this)), m && !this.trackWrites && (_ = !0);
      }
      _ || !(this.input.mouseDown && this.domObserver.currentSelection.eq(this.domSelectionRange()) && yb(this)) ? En(this, _) : (Ef(this, e.selection), this.domObserver.setCurSelection()), this.domObserver.start();
    }
    this.updatePluginViews(i), !((r = this.dragging) === null || r === void 0) && r.node && !i.doc.eq(e.doc) && this.updateDraggedNode(this.dragging, i), u == "reset" ? this.dom.scrollTop = 0 : u == "to selection" ? this.scrollToSelection() : p && eb(p);
  }
  /**
  @internal
  */
  scrollToSelection() {
    let e = this.domSelectionRange().focusNode;
    if (!(!e || !this.dom.contains(e.nodeType == 1 ? e : e.parentNode))) {
      if (!this.someProp("handleScrollToSelection", (n) => n(this))) if (this.state.selection instanceof ee) {
        let n = this.docView.domAfterPos(this.state.selection.from);
        n.nodeType == 1 && wd(this, n.getBoundingClientRect(), e);
      } else
        wd(this, this.coordsAtPos(this.state.selection.head, 1), e);
    }
  }
  destroyPluginViews() {
    let e;
    for (; e = this.pluginViews.pop(); )
      e.destroy && e.destroy();
  }
  updatePluginViews(e) {
    if (!e || e.plugins != this.state.plugins || this.directPlugins != this.prevDirectPlugins) {
      this.prevDirectPlugins = this.directPlugins, this.destroyPluginViews();
      for (let n = 0; n < this.directPlugins.length; n++) {
        let r = this.directPlugins[n];
        r.spec.view && this.pluginViews.push(r.spec.view(this));
      }
      for (let n = 0; n < this.state.plugins.length; n++) {
        let r = this.state.plugins[n];
        r.spec.view && this.pluginViews.push(r.spec.view(this));
      }
    } else
      for (let n = 0; n < this.pluginViews.length; n++) {
        let r = this.pluginViews[n];
        r.update && r.update(this, e);
      }
  }
  updateDraggedNode(e, n) {
    let r = e.node, i = -1;
    if (this.state.doc.nodeAt(r.from) == r.node)
      i = r.from;
    else {
      let o = r.from + (this.state.doc.content.size - n.doc.content.size);
      (o > 0 && this.state.doc.nodeAt(o)) == r.node && (i = o);
    }
    this.dragging = new Mf(e.slice, e.move, i < 0 ? void 0 : ee.create(this.state.doc, i));
  }
  someProp(e, n) {
    let r = this._props && this._props[e], i;
    if (r != null && (i = n ? n(r) : r))
      return i;
    for (let a = 0; a < this.directPlugins.length; a++) {
      let s = this.directPlugins[a].props[e];
      if (s != null && (i = n ? n(s) : s))
        return i;
    }
    let o = this.state.plugins;
    if (o)
      for (let a = 0; a < o.length; a++) {
        let s = o[a].props[e];
        if (s != null && (i = n ? n(s) : s))
          return i;
      }
  }
  /**
  Query whether the view has focus.
  */
  hasFocus() {
    if (gt) {
      let e = this.root.activeElement;
      if (e == this.dom)
        return !0;
      if (!e || !this.dom.contains(e))
        return !1;
      for (; e && this.dom != e && this.dom.contains(e); ) {
        if (e.contentEditable == "false")
          return !1;
        e = e.parentElement;
      }
      return !0;
    }
    return this.root.activeElement == this.dom;
  }
  /**
  Focus the editor.
  */
  focus() {
    this.domObserver.stop(), this.editable && tb(this.dom), En(this), this.domObserver.start();
  }
  /**
  Get the document root in which the editor exists. This will
  usually be the top-level `document`, but might be a [shadow
  DOM](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Shadow_DOM)
  root if the editor is inside one.
  */
  get root() {
    let e = this._root;
    if (e == null) {
      for (let n = this.dom.parentNode; n; n = n.parentNode)
        if (n.nodeType == 9 || n.nodeType == 11 && n.host)
          return n.getSelection || (Object.getPrototypeOf(n).getSelection = () => n.ownerDocument.getSelection()), this._root = n;
    }
    return e || document;
  }
  /**
  When an existing editor view is moved to a new document or
  shadow tree, call this to make it recompute its root.
  */
  updateRoot() {
    this._root = null;
  }
  /**
  Given a pair of viewport coordinates, return the document
  position that corresponds to them. May return null if the given
  coordinates aren't inside of the editor. When an object is
  returned, its `pos` property is the position nearest to the
  coordinates, and its `inside` property holds the position of the
  inner node that the position falls inside of, or -1 if it is at
  the top level, not in any node.
  */
  posAtCoords(e) {
    return ab(this, e);
  }
  /**
  Returns the viewport rectangle at a given document position.
  `left` and `right` will be the same number, as this returns a
  flat cursor-ish rectangle. If the position is between two things
  that aren't directly adjacent, `side` determines which element
  is used. When < 0, the element before the position is used,
  otherwise the element after.
  */
  coordsAtPos(e, n = 1) {
    return uf(this, e, n);
  }
  /**
  Find the DOM position that corresponds to the given document
  position. When `side` is negative, find the position as close as
  possible to the content before the position. When positive,
  prefer positions close to the content after the position. When
  zero, prefer as shallow a position as possible.
  
  Note that you should **not** mutate the editor's internal DOM,
  only inspect it (and even that is usually not necessary).
  */
  domAtPos(e, n = 0) {
    return this.docView.domFromPos(e, n);
  }
  /**
  Find the DOM node that represents the document node after the
  given position. May return `null` when the position doesn't point
  in front of a node or if the node is inside an opaque node view.
  
  This is intended to be able to call things like
  `getBoundingClientRect` on that DOM node. Do **not** mutate the
  editor DOM directly, or add styling this way, since that will be
  immediately overriden by the editor as it redraws the node.
  */
  nodeDOM(e) {
    let n = this.docView.descAt(e);
    return n ? n.nodeDOM : null;
  }
  /**
  Find the document position that corresponds to a given DOM
  position. (Whenever possible, it is preferable to inspect the
  document structure directly, rather than poking around in the
  DOM, but sometimes—for example when interpreting an event
  target—you don't have a choice.)
  
  The `bias` parameter can be used to influence which side of a DOM
  node to use when the position is inside a leaf node.
  */
  posAtDOM(e, n, r = -1) {
    let i = this.docView.posFromDOM(e, n, r);
    if (i == null)
      throw new RangeError("DOM position not inside the editor");
    return i;
  }
  /**
  Find out whether the selection is at the end of a textblock when
  moving in a given direction. When, for example, given `"left"`,
  it will return true if moving left from the current cursor
  position would leave that position's parent textblock. Will apply
  to the view's current state by default, but it is possible to
  pass a different state.
  */
  endOfTextblock(e, n) {
    return db(this, n || this.state, e);
  }
  /**
  Run the editor's paste logic with the given HTML string. The
  `event`, if given, will be passed to the
  [`handlePaste`](https://prosemirror.net/docs/ref/#view.EditorProps.handlePaste) hook.
  */
  pasteHTML(e, n) {
    return Qi(this, "", e, !1, n || new ClipboardEvent("paste"));
  }
  /**
  Run the editor's paste logic with the given plain-text input.
  */
  pasteText(e, n) {
    return Qi(this, e, null, !0, n || new ClipboardEvent("paste"));
  }
  /**
  Removes the editor from the DOM and destroys all [node
  views](https://prosemirror.net/docs/ref/#view.NodeView).
  */
  destroy() {
    this.docView && (Hb(this), this.destroyPluginViews(), this.mounted ? (this.docView.update(this.state.doc, [], rl(this), this), this.dom.textContent = "") : this.dom.parentNode && this.dom.parentNode.removeChild(this.dom), this.docView.destroy(), this.docView = null, VS());
  }
  /**
  This is true when the view has been
  [destroyed](https://prosemirror.net/docs/ref/#view.EditorView.destroy) (and thus should not be
  used anymore).
  */
  get isDestroyed() {
    return this.docView == null;
  }
  /**
  Used for testing.
  */
  dispatchEvent(e) {
    return Vb(this, e);
  }
  /**
  Dispatch a transaction. Will call
  [`dispatchTransaction`](https://prosemirror.net/docs/ref/#view.DirectEditorProps.dispatchTransaction)
  when given, and otherwise defaults to applying the transaction to
  the current state and calling
  [`updateState`](https://prosemirror.net/docs/ref/#view.EditorView.updateState) with the result.
  This method is bound to the view instance, so that it can be
  easily passed around.
  */
  dispatch(e) {
    let n = this._props.dispatchTransaction;
    n ? n.call(this, e) : this.updateState(this.state.apply(e));
  }
  /**
  @internal
  */
  domSelectionRange() {
    let e = this.domSelection();
    return e ? dt && this.root.nodeType === 11 && WS(this.dom.ownerDocument) == this.dom && u0(this, e) || e : { focusNode: null, focusOffset: 0, anchorNode: null, anchorOffset: 0 };
  }
  /**
  @internal
  */
  domSelection() {
    return this.root.getSelection();
  }
}
function ip(t) {
  let e = /* @__PURE__ */ Object.create(null);
  return e.class = "ProseMirror", e.contenteditable = String(t.editable), t.someProp("attributes", (n) => {
    if (typeof n == "function" && (n = n(t.state)), n)
      for (let r in n)
        r == "class" ? e.class += " " + n[r] : r == "style" ? e.style = (e.style ? e.style + ";" : "") + n[r] : !e[r] && r != "contenteditable" && r != "nodeName" && (e[r] = String(n[r]));
  }), e.translate || (e.translate = "no"), [Be.node(0, t.state.doc.content.size, e)];
}
function op(t) {
  if (t.markCursor) {
    let e = document.createElement("img");
    e.className = "ProseMirror-separator", e.setAttribute("mark-placeholder", "true"), e.setAttribute("alt", ""), t.cursorWrapper = { dom: e, deco: Be.widget(t.state.selection.from, e, { raw: !0, marks: t.markCursor }) };
  } else
    t.cursorWrapper = null;
}
function ap(t) {
  return !t.someProp("editable", (e) => e(t.state) === !1);
}
function b0(t, e) {
  let n = Math.min(t.$anchor.sharedDepth(t.head), e.$anchor.sharedDepth(e.head));
  return t.$anchor.start(n) != e.$anchor.start(n);
}
function sp(t) {
  let e = /* @__PURE__ */ Object.create(null);
  function n(r) {
    for (let i in r)
      Object.prototype.hasOwnProperty.call(e, i) || (e[i] = r[i]);
  }
  return t.someProp("nodeViews", n), t.someProp("markViews", n), e;
}
function T0(t, e) {
  let n = 0, r = 0;
  for (let i in t) {
    if (t[i] != e[i])
      return !0;
    n++;
  }
  for (let i in e)
    r++;
  return n != r;
}
function lp(t) {
  if (t.spec.state || t.spec.filterTransaction || t.spec.appendTransaction)
    throw new RangeError("Plugins passed directly to the view must not have a state component");
}
var Yn = {
  8: "Backspace",
  9: "Tab",
  10: "Enter",
  12: "NumLock",
  13: "Enter",
  16: "Shift",
  17: "Control",
  18: "Alt",
  20: "CapsLock",
  27: "Escape",
  32: " ",
  33: "PageUp",
  34: "PageDown",
  35: "End",
  36: "Home",
  37: "ArrowLeft",
  38: "ArrowUp",
  39: "ArrowRight",
  40: "ArrowDown",
  44: "PrintScreen",
  45: "Insert",
  46: "Delete",
  59: ";",
  61: "=",
  91: "Meta",
  92: "Meta",
  106: "*",
  107: "+",
  108: ",",
  109: "-",
  110: ".",
  111: "/",
  144: "NumLock",
  145: "ScrollLock",
  160: "Shift",
  161: "Shift",
  162: "Control",
  163: "Control",
  164: "Alt",
  165: "Alt",
  173: "-",
  186: ";",
  187: "=",
  188: ",",
  189: "-",
  190: ".",
  191: "/",
  192: "`",
  219: "[",
  220: "\\",
  221: "]",
  222: "'"
}, ba = {
  48: ")",
  49: "!",
  50: "@",
  51: "#",
  52: "$",
  53: "%",
  54: "^",
  55: "&",
  56: "*",
  57: "(",
  59: ":",
  61: "+",
  173: "_",
  186: ":",
  187: "+",
  188: "<",
  189: "_",
  190: ">",
  191: "?",
  192: "~",
  219: "{",
  220: "|",
  221: "}",
  222: '"'
}, C0 = typeof navigator < "u" && /Mac/.test(navigator.platform), y0 = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
for (var je = 0; je < 10; je++) Yn[48 + je] = Yn[96 + je] = String(je);
for (var je = 1; je <= 24; je++) Yn[je + 111] = "F" + je;
for (var je = 65; je <= 90; je++)
  Yn[je] = String.fromCharCode(je + 32), ba[je] = String.fromCharCode(je);
for (var ol in Yn) ba.hasOwnProperty(ol) || (ba[ol] = Yn[ol]);
function v0(t) {
  var e = C0 && t.metaKey && t.shiftKey && !t.ctrlKey && !t.altKey || y0 && t.shiftKey && t.key && t.key.length == 1 || t.key == "Unidentified", n = !e && t.key || (t.shiftKey ? ba : Yn)[t.keyCode] || t.key || "Unidentified";
  return n == "Esc" && (n = "Escape"), n == "Del" && (n = "Delete"), n == "Left" && (n = "ArrowLeft"), n == "Up" && (n = "ArrowUp"), n == "Right" && (n = "ArrowRight"), n == "Down" && (n = "ArrowDown"), n;
}
const R0 = typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : !1;
function O0(t) {
  let e = t.split(/-(?!$)/), n = e[e.length - 1];
  n == "Space" && (n = " ");
  let r, i, o, a;
  for (let s = 0; s < e.length - 1; s++) {
    let l = e[s];
    if (/^(cmd|meta|m)$/i.test(l))
      a = !0;
    else if (/^a(lt)?$/i.test(l))
      r = !0;
    else if (/^(c|ctrl|control)$/i.test(l))
      i = !0;
    else if (/^s(hift)?$/i.test(l))
      o = !0;
    else if (/^mod$/i.test(l))
      R0 ? a = !0 : i = !0;
    else
      throw new Error("Unrecognized modifier name: " + l);
  }
  return r && (n = "Alt-" + n), i && (n = "Ctrl-" + n), a && (n = "Meta-" + n), o && (n = "Shift-" + n), n;
}
function N0(t) {
  let e = /* @__PURE__ */ Object.create(null);
  for (let n in t)
    e[O0(n)] = t[n];
  return e;
}
function al(t, e, n = !0) {
  return e.altKey && (t = "Alt-" + t), e.ctrlKey && (t = "Ctrl-" + t), e.metaKey && (t = "Meta-" + t), n && e.shiftKey && (t = "Shift-" + t), t;
}
function A0(t) {
  return new Te({ props: { handleKeyDown: eu(t) } });
}
function eu(t) {
  let e = N0(t);
  return function(n, r) {
    let i = v0(r), o, a = e[al(i, r)];
    if (a && a(n.state, n.dispatch, n))
      return !0;
    if (i.length == 1 && i != " ") {
      if (r.shiftKey) {
        let s = e[al(i, r, !1)];
        if (s && s(n.state, n.dispatch, n))
          return !0;
      }
      if ((r.shiftKey || r.altKey || r.metaKey || i.charCodeAt(0) > 127) && (o = Yn[r.keyCode]) && o != i) {
        let s = e[al(o, r)];
        if (s && s(n.state, n.dispatch, n))
          return !0;
      }
    }
    return !1;
  };
}
const I0 = (t, e) => t.selection.empty ? !1 : (e && e(t.tr.deleteSelection().scrollIntoView()), !0);
function Bf(t, e) {
  let { $cursor: n } = t.selection;
  return !n || (e ? !e.endOfTextblock("backward", t) : n.parentOffset > 0) ? null : n;
}
const x0 = (t, e, n) => {
  let r = Bf(t, n);
  if (!r)
    return !1;
  let i = tu(r);
  if (!i) {
    let a = r.blockRange(), s = a && di(a);
    return s == null ? !1 : (e && e(t.tr.lift(a, s).scrollIntoView()), !0);
  }
  let o = i.nodeBefore;
  if (Vf(t, i, e, -1))
    return !0;
  if (r.parent.content.size == 0 && (Jr(o, "end") || ee.isSelectable(o)))
    for (let a = r.depth; ; a--) {
      let s = gs(t.doc, r.before(a), r.after(a), H.empty);
      if (s && s.slice.size < s.to - s.from) {
        if (e) {
          let l = t.tr.step(s);
          l.setSelection(Jr(o, "end") ? ne.findFrom(l.doc.resolve(l.mapping.map(i.pos, -1)), -1) : ee.create(l.doc, i.pos - o.nodeSize)), e(l.scrollIntoView());
        }
        return !0;
      }
      if (a == 1 || r.node(a - 1).childCount > 1)
        break;
    }
  return o.isAtom && i.depth == r.depth - 1 ? (e && e(t.tr.delete(i.pos - o.nodeSize, i.pos).scrollIntoView()), !0) : !1;
}, D0 = (t, e, n) => {
  let r = Bf(t, n);
  if (!r)
    return !1;
  let i = tu(r);
  return i ? Uf(t, i, e) : !1;
}, w0 = (t, e, n) => {
  let r = Hf(t, n);
  if (!r)
    return !1;
  let i = nu(r);
  return i ? Uf(t, i, e) : !1;
};
function Uf(t, e, n) {
  let r = e.nodeBefore, i = r, o = e.pos - 1;
  for (; !i.isTextblock; o--) {
    if (i.type.spec.isolating)
      return !1;
    let u = i.lastChild;
    if (!u)
      return !1;
    i = u;
  }
  let a = e.nodeAfter, s = a, l = e.pos + 1;
  for (; !s.isTextblock; l++) {
    if (s.type.spec.isolating)
      return !1;
    let u = s.firstChild;
    if (!u)
      return !1;
    s = u;
  }
  let c = gs(t.doc, o, l, H.empty);
  if (!c || c.from != o || c instanceof He && c.slice.size >= l - o)
    return !1;
  if (n) {
    let u = t.tr.step(c);
    u.setSelection(K.create(u.doc, o)), n(u.scrollIntoView());
  }
  return !0;
}
function Jr(t, e, n = !1) {
  for (let r = t; r; r = e == "start" ? r.firstChild : r.lastChild) {
    if (r.isTextblock)
      return !0;
    if (n && r.childCount != 1)
      return !1;
  }
  return !1;
}
const M0 = (t, e, n) => {
  let { $head: r, empty: i } = t.selection, o = r;
  if (!i)
    return !1;
  if (r.parent.isTextblock) {
    if (n ? !n.endOfTextblock("backward", t) : r.parentOffset > 0)
      return !1;
    o = tu(r);
  }
  let a = o && o.nodeBefore;
  return !a || !ee.isSelectable(a) ? !1 : (e && e(t.tr.setSelection(ee.create(t.doc, o.pos - a.nodeSize)).scrollIntoView()), !0);
};
function tu(t) {
  if (!t.parent.type.spec.isolating)
    for (let e = t.depth - 1; e >= 0; e--) {
      if (t.index(e) > 0)
        return t.doc.resolve(t.before(e + 1));
      if (t.node(e).type.spec.isolating)
        break;
    }
  return null;
}
function Hf(t, e) {
  let { $cursor: n } = t.selection;
  return !n || (e ? !e.endOfTextblock("forward", t) : n.parentOffset < n.parent.content.size) ? null : n;
}
const L0 = (t, e, n) => {
  let r = Hf(t, n);
  if (!r)
    return !1;
  let i = nu(r);
  if (!i)
    return !1;
  let o = i.nodeAfter;
  if (Vf(t, i, e, 1))
    return !0;
  if (r.parent.content.size == 0 && (Jr(o, "start") || ee.isSelectable(o))) {
    let a = gs(t.doc, r.before(), r.after(), H.empty);
    if (a && a.slice.size < a.to - a.from) {
      if (e) {
        let s = t.tr.step(a);
        s.setSelection(Jr(o, "start") ? ne.findFrom(s.doc.resolve(s.mapping.map(i.pos)), 1) : ee.create(s.doc, s.mapping.map(i.pos))), e(s.scrollIntoView());
      }
      return !0;
    }
  }
  return o.isAtom && i.depth == r.depth - 1 ? (e && e(t.tr.delete(i.pos, i.pos + o.nodeSize).scrollIntoView()), !0) : !1;
}, k0 = (t, e, n) => {
  let { $head: r, empty: i } = t.selection, o = r;
  if (!i)
    return !1;
  if (r.parent.isTextblock) {
    if (n ? !n.endOfTextblock("forward", t) : r.parentOffset < r.parent.content.size)
      return !1;
    o = nu(r);
  }
  let a = o && o.nodeAfter;
  return !a || !ee.isSelectable(a) ? !1 : (e && e(t.tr.setSelection(ee.create(t.doc, o.pos)).scrollIntoView()), !0);
};
function nu(t) {
  if (!t.parent.type.spec.isolating)
    for (let e = t.depth - 1; e >= 0; e--) {
      let n = t.node(e);
      if (t.index(e) + 1 < n.childCount)
        return t.doc.resolve(t.after(e + 1));
      if (n.type.spec.isolating)
        break;
    }
  return null;
}
const P0 = (t, e) => {
  let n = t.selection, r = n instanceof ee, i;
  if (r) {
    if (n.node.isTextblock || !Wn(t.doc, n.from))
      return !1;
    i = n.from;
  } else if (i = fs(t.doc, n.from, -1), i == null)
    return !1;
  if (e) {
    let o = t.tr.join(i);
    r && o.setSelection(ee.create(o.doc, i - t.doc.resolve(i).nodeBefore.nodeSize)), e(o.scrollIntoView());
  }
  return !0;
}, F0 = (t, e) => {
  let n = t.selection, r;
  if (n instanceof ee) {
    if (n.node.isTextblock || !Wn(t.doc, n.to))
      return !1;
    r = n.to;
  } else if (r = fs(t.doc, n.to, 1), r == null)
    return !1;
  return e && e(t.tr.join(r).scrollIntoView()), !0;
}, B0 = (t, e) => {
  let { $from: n, $to: r } = t.selection, i = n.blockRange(r), o = i && di(i);
  return o == null ? !1 : (e && e(t.tr.lift(i, o).scrollIntoView()), !0);
}, U0 = (t, e) => {
  let { $head: n, $anchor: r } = t.selection;
  return !n.parent.type.spec.code || !n.sameParent(r) ? !1 : (e && e(t.tr.insertText(`
`).scrollIntoView()), !0);
};
function Gf(t) {
  for (let e = 0; e < t.edgeCount; e++) {
    let { type: n } = t.edge(e);
    if (n.isTextblock && !n.hasRequiredAttrs())
      return n;
  }
  return null;
}
const H0 = (t, e) => {
  let { $head: n, $anchor: r } = t.selection;
  if (!n.parent.type.spec.code || !n.sameParent(r))
    return !1;
  let i = n.node(-1), o = n.indexAfter(-1), a = Gf(i.contentMatchAt(o));
  if (!a || !i.canReplaceWith(o, o, a))
    return !1;
  if (e) {
    let s = n.after(), l = t.tr.replaceWith(s, s, a.createAndFill());
    l.setSelection(ne.near(l.doc.resolve(s), 1)), e(l.scrollIntoView());
  }
  return !0;
}, G0 = (t, e) => {
  let n = t.selection, { $from: r, $to: i } = n;
  if (n instanceof Ot || r.parent.inlineContent || i.parent.inlineContent)
    return !1;
  let o = Gf(i.parent.contentMatchAt(i.indexAfter()));
  if (!o || !o.isTextblock)
    return !1;
  if (e) {
    let a = (!r.parentOffset && i.index() < i.parent.childCount ? r : i).pos, s = t.tr.insert(a, o.createAndFill());
    s.setSelection(K.create(s.doc, a + 1)), e(s.scrollIntoView());
  }
  return !0;
}, V0 = (t, e) => {
  let { $cursor: n } = t.selection;
  if (!n || n.parent.content.size)
    return !1;
  if (n.depth > 1 && n.after() != n.end(-1)) {
    let o = n.before();
    if (qr(t.doc, o))
      return e && e(t.tr.split(o).scrollIntoView()), !0;
  }
  let r = n.blockRange(), i = r && di(r);
  return i == null ? !1 : (e && e(t.tr.lift(r, i).scrollIntoView()), !0);
}, Y0 = (t, e) => {
  let { $from: n, to: r } = t.selection, i, o = n.sharedDepth(r);
  return o == 0 ? !1 : (i = n.before(o), e && e(t.tr.setSelection(ee.create(t.doc, i))), !0);
};
function $0(t, e, n) {
  let r = e.nodeBefore, i = e.nodeAfter, o = e.index();
  return !r || !i || !r.type.compatibleContent(i.type) ? !1 : !r.content.size && e.parent.canReplace(o - 1, o) ? (n && n(t.tr.delete(e.pos - r.nodeSize, e.pos).scrollIntoView()), !0) : !e.parent.canReplace(o, o + 1) || !(i.isTextblock || Wn(t.doc, e.pos)) ? !1 : (n && n(t.tr.join(e.pos).scrollIntoView()), !0);
}
function Vf(t, e, n, r) {
  let i = e.nodeBefore, o = e.nodeAfter, a, s, l = i.type.spec.isolating || o.type.spec.isolating;
  if (!l && $0(t, e, n))
    return !0;
  let c = !l && e.parent.canReplace(e.index(), e.index() + 1);
  if (c && (a = (s = i.contentMatchAt(i.childCount)).findWrapping(o.type)) && s.matchType(a[0] || o.type).validEnd) {
    if (n) {
      let _ = e.pos + o.nodeSize, m = L.empty;
      for (let S = a.length - 1; S >= 0; S--)
        m = L.from(a[S].create(null, m));
      m = L.from(i.copy(m));
      let f = t.tr.step(new $e(e.pos - 1, _, e.pos, _, new H(m, 1, 0), a.length, !0)), g = f.doc.resolve(_ + 2 * a.length);
      g.nodeAfter && g.nodeAfter.type == i.type && Wn(f.doc, g.pos) && f.join(g.pos), n(f.scrollIntoView());
    }
    return !0;
  }
  let u = o.type.spec.isolating || r > 0 && l ? null : ne.findFrom(e, 1), d = u && u.$from.blockRange(u.$to), p = d && di(d);
  if (p != null && p >= e.depth)
    return n && n(t.tr.lift(d, p).scrollIntoView()), !0;
  if (c && Jr(o, "start", !0) && Jr(i, "end")) {
    let _ = i, m = [];
    for (; m.push(_), !_.isTextblock; )
      _ = _.lastChild;
    let f = o, g = 1;
    for (; !f.isTextblock; f = f.firstChild)
      g++;
    if (_.canReplace(_.childCount, _.childCount, f.content)) {
      if (n) {
        let S = L.empty;
        for (let b = m.length - 1; b >= 0; b--)
          S = L.from(m[b].copy(S));
        let E = t.tr.step(new $e(e.pos - m.length, e.pos + o.nodeSize, e.pos + g, e.pos + o.nodeSize - g, new H(S, m.length, 0), 0, !0));
        n(E.scrollIntoView());
      }
      return !0;
    }
  }
  return !1;
}
function Yf(t) {
  return function(e, n) {
    let r = e.selection, i = t < 0 ? r.$from : r.$to, o = i.depth;
    for (; i.node(o).isInline; ) {
      if (!o)
        return !1;
      o--;
    }
    return i.node(o).isTextblock ? (n && n(e.tr.setSelection(K.create(e.doc, t < 0 ? i.start(o) : i.end(o)))), !0) : !1;
  };
}
const z0 = Yf(-1), q0 = Yf(1);
function W0(t, e = null) {
  return function(n, r) {
    let { $from: i, $to: o } = n.selection, a = i.blockRange(o), s = a && Yc(a, t, e);
    return s ? (r && r(n.tr.wrap(a, s).scrollIntoView()), !0) : !1;
  };
}
function cp(t, e = null) {
  return function(n, r) {
    let i = !1;
    for (let o = 0; o < n.selection.ranges.length && !i; o++) {
      let { $from: { pos: a }, $to: { pos: s } } = n.selection.ranges[o];
      n.doc.nodesBetween(a, s, (l, c) => {
        if (i)
          return !1;
        if (!(!l.isTextblock || l.hasMarkup(t, e)))
          if (l.type == t)
            i = !0;
          else {
            let u = n.doc.resolve(c), d = u.index();
            i = u.parent.canReplaceWith(d, d + 1, t);
          }
      });
    }
    if (!i)
      return !1;
    if (r) {
      let o = n.tr;
      for (let a = 0; a < n.selection.ranges.length; a++) {
        let { $from: { pos: s }, $to: { pos: l } } = n.selection.ranges[a];
        o.setBlockType(s, l, t, e);
      }
      r(o.scrollIntoView());
    }
    return !0;
  };
}
typeof navigator < "u" ? /Mac|iP(hone|[oa]d)/.test(navigator.platform) : typeof os < "u" && os.platform && os.platform() == "darwin";
function K0(t, e = null) {
  return function(n, r) {
    let { $from: i, $to: o } = n.selection, a = i.blockRange(o), s = !1, l = a;
    if (!a)
      return !1;
    if (a.depth >= 2 && i.node(a.depth - 1).type.compatibleContent(t) && a.startIndex == 0) {
      if (i.index(a.depth - 1) == 0)
        return !1;
      let u = n.doc.resolve(a.start - 2);
      l = new _a(u, u, a.depth), a.endIndex < a.parent.childCount && (a = new _a(i, n.doc.resolve(o.end(a.depth)), a.depth)), s = !0;
    }
    let c = Yc(l, t, e, a);
    return c ? (r && r(Q0(n.tr, a, c, s, t).scrollIntoView()), !0) : !1;
  };
}
function Q0(t, e, n, r, i) {
  let o = L.empty;
  for (let u = n.length - 1; u >= 0; u--)
    o = L.from(n[u].type.create(n[u].attrs, o));
  t.step(new $e(e.start - (r ? 2 : 0), e.end, e.start, e.end, new H(o, 0, 0), n.length, !0));
  let a = 0;
  for (let u = 0; u < n.length; u++)
    n[u].type == i && (a = u + 1);
  let s = n.length - a, l = e.start + n.length - (r ? 2 : 0), c = e.parent;
  for (let u = e.startIndex, d = e.endIndex, p = !0; u < d; u++, p = !1)
    !p && qr(t.doc, l, s) && (t.split(l, s), l += 2 * s), l += c.child(u).nodeSize;
  return t;
}
function Z0(t) {
  return function(e, n) {
    let { $from: r, $to: i } = e.selection, o = r.blockRange(i, (a) => a.childCount > 0 && a.firstChild.type == t);
    return o ? n ? r.node(o.depth - 1).type == t ? X0(e, n, t, o) : j0(e, n, o) : !0 : !1;
  };
}
function X0(t, e, n, r) {
  let i = t.tr, o = r.end, a = r.$to.end(r.depth);
  o < a && (i.step(new $e(o - 1, a, o, a, new H(L.from(n.create(null, r.parent.copy())), 1, 0), 1, !0)), r = new _a(i.doc.resolve(r.$from.pos), i.doc.resolve(a), r.depth));
  const s = di(r);
  if (s == null)
    return !1;
  i.lift(r, s);
  let l = i.mapping.map(o, -1) - 1;
  return Wn(i.doc, l) && i.join(l), e(i.scrollIntoView()), !0;
}
function j0(t, e, n) {
  let r = t.tr, i = n.parent;
  for (let _ = n.end, m = n.endIndex - 1, f = n.startIndex; m > f; m--)
    _ -= i.child(m).nodeSize, r.delete(_ - 1, _ + 1);
  let o = r.doc.resolve(n.start), a = o.nodeAfter;
  if (r.mapping.map(n.end) != n.start + o.nodeAfter.nodeSize)
    return !1;
  let s = n.startIndex == 0, l = n.endIndex == i.childCount, c = o.node(-1), u = o.index(-1);
  if (!c.canReplace(u + (s ? 0 : 1), u + 1, a.content.append(l ? L.empty : L.from(i))))
    return !1;
  let d = o.pos, p = d + a.nodeSize;
  return r.step(new $e(d - (s ? 1 : 0), p + (l ? 1 : 0), d + 1, p - 1, new H((s ? L.empty : L.from(i.copy(L.empty))).append(l ? L.empty : L.from(i.copy(L.empty))), s ? 0 : 1, l ? 0 : 1), s ? 0 : 1)), e(r.scrollIntoView()), !0;
}
function J0(t) {
  return function(e, n) {
    let { $from: r, $to: i } = e.selection, o = r.blockRange(i, (c) => c.childCount > 0 && c.firstChild.type == t);
    if (!o)
      return !1;
    let a = o.startIndex;
    if (a == 0)
      return !1;
    let s = o.parent, l = s.child(a - 1);
    if (l.type != t)
      return !1;
    if (n) {
      let c = l.lastChild && l.lastChild.type == s.type, u = L.from(c ? t.create() : null), d = new H(L.from(t.create(null, L.from(s.type.create(null, u)))), c ? 3 : 1, 0), p = o.start, _ = o.end;
      n(e.tr.step(new $e(p - (c ? 3 : 1), _, p, _, d, 1, !0)).scrollIntoView());
    }
    return !0;
  };
}
function Ts(t) {
  const { state: e, transaction: n } = t;
  let { selection: r } = n, { doc: i } = n, { storedMarks: o } = n;
  return {
    ...e,
    apply: e.apply.bind(e),
    applyTransaction: e.applyTransaction.bind(e),
    plugins: e.plugins,
    schema: e.schema,
    reconfigure: e.reconfigure.bind(e),
    toJSON: e.toJSON.bind(e),
    get storedMarks() {
      return o;
    },
    get selection() {
      return r;
    },
    get doc() {
      return i;
    },
    get tr() {
      return r = n.selection, i = n.doc, o = n.storedMarks, n;
    }
  };
}
class Cs {
  constructor(e) {
    this.editor = e.editor, this.rawCommands = this.editor.extensionManager.commands, this.customState = e.state;
  }
  get hasCustomState() {
    return !!this.customState;
  }
  get state() {
    return this.customState || this.editor.state;
  }
  get commands() {
    const { rawCommands: e, editor: n, state: r } = this, { view: i } = n, { tr: o } = r, a = this.buildProps(o);
    return Object.fromEntries(Object.entries(e).map(([s, l]) => [s, (...u) => {
      const d = l(...u)(a);
      return !o.getMeta("preventDispatch") && !this.hasCustomState && i.dispatch(o), d;
    }]));
  }
  get chain() {
    return () => this.createChain();
  }
  get can() {
    return () => this.createCan();
  }
  createChain(e, n = !0) {
    const { rawCommands: r, editor: i, state: o } = this, { view: a } = i, s = [], l = !!e, c = e || o.tr, u = () => (!l && n && !c.getMeta("preventDispatch") && !this.hasCustomState && a.dispatch(c), s.every((p) => p === !0)), d = {
      ...Object.fromEntries(Object.entries(r).map(([p, _]) => [p, (...f) => {
        const g = this.buildProps(c, n), S = _(...f)(g);
        return s.push(S), d;
      }])),
      run: u
    };
    return d;
  }
  createCan(e) {
    const { rawCommands: n, state: r } = this, i = !1, o = e || r.tr, a = this.buildProps(o, i);
    return {
      ...Object.fromEntries(Object.entries(n).map(([l, c]) => [l, (...u) => c(...u)({ ...a, dispatch: void 0 })])),
      chain: () => this.createChain(o, i)
    };
  }
  buildProps(e, n = !0) {
    const { rawCommands: r, editor: i, state: o } = this, { view: a } = i, s = {
      tr: e,
      editor: i,
      view: a,
      state: Ts({
        state: o,
        transaction: e
      }),
      dispatch: n ? () => {
      } : void 0,
      chain: () => this.createChain(e, n),
      can: () => this.createCan(e),
      get commands() {
        return Object.fromEntries(Object.entries(r).map(([l, c]) => [l, (...u) => c(...u)(s)]));
      }
    };
    return s;
  }
}
let eT = class {
  constructor() {
    this.callbacks = {};
  }
  on(e, n) {
    return this.callbacks[e] || (this.callbacks[e] = []), this.callbacks[e].push(n), this;
  }
  emit(e, ...n) {
    const r = this.callbacks[e];
    return r && r.forEach((i) => i.apply(this, n)), this;
  }
  off(e, n) {
    const r = this.callbacks[e];
    return r && (n ? this.callbacks[e] = r.filter((i) => i !== n) : delete this.callbacks[e]), this;
  }
  once(e, n) {
    const r = (...i) => {
      this.off(e, r), n.apply(this, i);
    };
    return this.on(e, r);
  }
  removeAllListeners() {
    this.callbacks = {};
  }
};
function z(t, e, n) {
  return t.config[e] === void 0 && t.parent ? z(t.parent, e, n) : typeof t.config[e] == "function" ? t.config[e].bind({
    ...n,
    parent: t.parent ? z(t.parent, e, n) : null
  }) : t.config[e];
}
function ys(t) {
  const e = t.filter((i) => i.type === "extension"), n = t.filter((i) => i.type === "node"), r = t.filter((i) => i.type === "mark");
  return {
    baseExtensions: e,
    nodeExtensions: n,
    markExtensions: r
  };
}
function $f(t) {
  const e = [], { nodeExtensions: n, markExtensions: r } = ys(t), i = [...n, ...r], o = {
    default: null,
    rendered: !0,
    renderHTML: null,
    parseHTML: null,
    keepOnSplit: !0,
    isRequired: !1
  };
  return t.forEach((a) => {
    const s = {
      name: a.name,
      options: a.options,
      storage: a.storage,
      extensions: i
    }, l = z(a, "addGlobalAttributes", s);
    if (!l)
      return;
    l().forEach((u) => {
      u.types.forEach((d) => {
        Object.entries(u.attributes).forEach(([p, _]) => {
          e.push({
            type: d,
            name: p,
            attribute: {
              ...o,
              ..._
            }
          });
        });
      });
    });
  }), i.forEach((a) => {
    const s = {
      name: a.name,
      options: a.options,
      storage: a.storage
    }, l = z(a, "addAttributes", s);
    if (!l)
      return;
    const c = l();
    Object.entries(c).forEach(([u, d]) => {
      const p = {
        ...o,
        ...d
      };
      typeof (p == null ? void 0 : p.default) == "function" && (p.default = p.default()), p != null && p.isRequired && (p == null ? void 0 : p.default) === void 0 && delete p.default, e.push({
        type: a.name,
        name: u,
        attribute: p
      });
    });
  }), e;
}
function qe(t, e) {
  if (typeof t == "string") {
    if (!e.nodes[t])
      throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);
    return e.nodes[t];
  }
  return t;
}
function me(...t) {
  return t.filter((e) => !!e).reduce((e, n) => {
    const r = { ...e };
    return Object.entries(n).forEach(([i, o]) => {
      if (!r[i]) {
        r[i] = o;
        return;
      }
      if (i === "class") {
        const s = o ? String(o).split(" ") : [], l = r[i] ? r[i].split(" ") : [], c = s.filter((u) => !l.includes(u));
        r[i] = [...l, ...c].join(" ");
      } else if (i === "style") {
        const s = o ? o.split(";").map((u) => u.trim()).filter(Boolean) : [], l = r[i] ? r[i].split(";").map((u) => u.trim()).filter(Boolean) : [], c = /* @__PURE__ */ new Map();
        l.forEach((u) => {
          const [d, p] = u.split(":").map((_) => _.trim());
          c.set(d, p);
        }), s.forEach((u) => {
          const [d, p] = u.split(":").map((_) => _.trim());
          c.set(d, p);
        }), r[i] = Array.from(c.entries()).map(([u, d]) => `${u}: ${d}`).join("; ");
      } else
        r[i] = o;
    }), r;
  }, {});
}
function lc(t, e) {
  return e.filter((n) => n.type === t.type.name).filter((n) => n.attribute.rendered).map((n) => n.attribute.renderHTML ? n.attribute.renderHTML(t.attrs) || {} : {
    [n.name]: t.attrs[n.name]
  }).reduce((n, r) => me(n, r), {});
}
function zf(t) {
  return typeof t == "function";
}
function ce(t, e = void 0, ...n) {
  return zf(t) ? e ? t.bind(e)(...n) : t(...n) : t;
}
function tT(t = {}) {
  return Object.keys(t).length === 0 && t.constructor === Object;
}
function nT(t) {
  return typeof t != "string" ? t : t.match(/^[+-]?(?:\d*\.)?\d+$/) ? Number(t) : t === "true" ? !0 : t === "false" ? !1 : t;
}
function up(t, e) {
  return "style" in t ? t : {
    ...t,
    getAttrs: (n) => {
      const r = t.getAttrs ? t.getAttrs(n) : t.attrs;
      if (r === !1)
        return !1;
      const i = e.reduce((o, a) => {
        const s = a.attribute.parseHTML ? a.attribute.parseHTML(n) : nT(n.getAttribute(a.name));
        return s == null ? o : {
          ...o,
          [a.name]: s
        };
      }, {});
      return { ...r, ...i };
    }
  };
}
function dp(t) {
  return Object.fromEntries(
    // @ts-ignore
    Object.entries(t).filter(([e, n]) => e === "attrs" && tT(n) ? !1 : n != null)
  );
}
function rT(t, e) {
  var n;
  const r = $f(t), { nodeExtensions: i, markExtensions: o } = ys(t), a = (n = i.find((c) => z(c, "topNode"))) === null || n === void 0 ? void 0 : n.name, s = Object.fromEntries(i.map((c) => {
    const u = r.filter((S) => S.type === c.name), d = {
      name: c.name,
      options: c.options,
      storage: c.storage,
      editor: e
    }, p = t.reduce((S, E) => {
      const b = z(E, "extendNodeSchema", d);
      return {
        ...S,
        ...b ? b(c) : {}
      };
    }, {}), _ = dp({
      ...p,
      content: ce(z(c, "content", d)),
      marks: ce(z(c, "marks", d)),
      group: ce(z(c, "group", d)),
      inline: ce(z(c, "inline", d)),
      atom: ce(z(c, "atom", d)),
      selectable: ce(z(c, "selectable", d)),
      draggable: ce(z(c, "draggable", d)),
      code: ce(z(c, "code", d)),
      whitespace: ce(z(c, "whitespace", d)),
      linebreakReplacement: ce(z(c, "linebreakReplacement", d)),
      defining: ce(z(c, "defining", d)),
      isolating: ce(z(c, "isolating", d)),
      attrs: Object.fromEntries(u.map((S) => {
        var E;
        return [S.name, { default: (E = S == null ? void 0 : S.attribute) === null || E === void 0 ? void 0 : E.default }];
      }))
    }), m = ce(z(c, "parseHTML", d));
    m && (_.parseDOM = m.map((S) => up(S, u)));
    const f = z(c, "renderHTML", d);
    f && (_.toDOM = (S) => f({
      node: S,
      HTMLAttributes: lc(S, u)
    }));
    const g = z(c, "renderText", d);
    return g && (_.toText = g), [c.name, _];
  })), l = Object.fromEntries(o.map((c) => {
    const u = r.filter((g) => g.type === c.name), d = {
      name: c.name,
      options: c.options,
      storage: c.storage,
      editor: e
    }, p = t.reduce((g, S) => {
      const E = z(S, "extendMarkSchema", d);
      return {
        ...g,
        ...E ? E(c) : {}
      };
    }, {}), _ = dp({
      ...p,
      inclusive: ce(z(c, "inclusive", d)),
      excludes: ce(z(c, "excludes", d)),
      group: ce(z(c, "group", d)),
      spanning: ce(z(c, "spanning", d)),
      code: ce(z(c, "code", d)),
      attrs: Object.fromEntries(u.map((g) => {
        var S;
        return [g.name, { default: (S = g == null ? void 0 : g.attribute) === null || S === void 0 ? void 0 : S.default }];
      }))
    }), m = ce(z(c, "parseHTML", d));
    m && (_.parseDOM = m.map((g) => up(g, u)));
    const f = z(c, "renderHTML", d);
    return f && (_.toDOM = (g) => f({
      mark: g,
      HTMLAttributes: lc(g, u)
    })), [c.name, _];
  }));
  return new Bm({
    topNode: a,
    nodes: s,
    marks: l
  });
}
function sl(t, e) {
  return e.nodes[t] || e.marks[t] || null;
}
function pp(t, e) {
  return Array.isArray(e) ? e.some((n) => (typeof n == "string" ? n : n.name) === t.name) : e;
}
function ru(t, e) {
  const n = Cr.fromSchema(e).serializeFragment(t), i = document.implementation.createHTMLDocument().createElement("div");
  return i.appendChild(n), i.innerHTML;
}
const iT = (t, e = 500) => {
  let n = "";
  const r = t.parentOffset;
  return t.parent.nodesBetween(Math.max(0, r - e), r, (i, o, a, s) => {
    var l, c;
    const u = ((c = (l = i.type.spec).toText) === null || c === void 0 ? void 0 : c.call(l, {
      node: i,
      pos: o,
      parent: a,
      index: s
    })) || i.textContent || "%leaf%";
    n += i.isAtom && !i.isText ? u : u.slice(0, Math.max(0, r - o));
  }), n;
};
function iu(t) {
  return Object.prototype.toString.call(t) === "[object RegExp]";
}
class Eo {
  constructor(e) {
    this.find = e.find, this.handler = e.handler;
  }
}
const oT = (t, e) => {
  if (iu(e))
    return e.exec(t);
  const n = e(t);
  if (!n)
    return null;
  const r = [n.text];
  return r.index = n.index, r.input = t, r.data = n.data, n.replaceWith && (n.text.includes(n.replaceWith) || console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'), r.push(n.replaceWith)), r;
};
function wo(t) {
  var e;
  const { editor: n, from: r, to: i, text: o, rules: a, plugin: s } = t, { view: l } = n;
  if (l.composing)
    return !1;
  const c = l.state.doc.resolve(r);
  if (
    // check for code node
    c.parent.type.spec.code || !((e = c.nodeBefore || c.nodeAfter) === null || e === void 0) && e.marks.find((p) => p.type.spec.code)
  )
    return !1;
  let u = !1;
  const d = iT(c) + o;
  return a.forEach((p) => {
    if (u)
      return;
    const _ = oT(d, p.find);
    if (!_)
      return;
    const m = l.state.tr, f = Ts({
      state: l.state,
      transaction: m
    }), g = {
      from: r - (_[0].length - o.length),
      to: i
    }, { commands: S, chain: E, can: b } = new Cs({
      editor: n,
      state: f
    });
    p.handler({
      state: f,
      range: g,
      match: _,
      commands: S,
      chain: E,
      can: b
    }) === null || !m.steps.length || (m.setMeta(s, {
      transform: m,
      from: r,
      to: i,
      text: o
    }), l.dispatch(m), u = !0);
  }), u;
}
function aT(t) {
  const { editor: e, rules: n } = t, r = new Te({
    state: {
      init() {
        return null;
      },
      apply(i, o, a) {
        const s = i.getMeta(r);
        if (s)
          return s;
        const l = i.getMeta("applyInputRules");
        return !!l && setTimeout(() => {
          let { text: u } = l;
          typeof u == "string" ? u = u : u = ru(L.from(u), a.schema);
          const { from: d } = l, p = d + u.length;
          wo({
            editor: e,
            from: d,
            to: p,
            text: u,
            rules: n,
            plugin: r
          });
        }), i.selectionSet || i.docChanged ? null : o;
      }
    },
    props: {
      handleTextInput(i, o, a, s) {
        return wo({
          editor: e,
          from: o,
          to: a,
          text: s,
          rules: n,
          plugin: r
        });
      },
      handleDOMEvents: {
        compositionend: (i) => (setTimeout(() => {
          const { $cursor: o } = i.state.selection;
          o && wo({
            editor: e,
            from: o.pos,
            to: o.pos,
            text: "",
            rules: n,
            plugin: r
          });
        }), !1)
      },
      // add support for input rules to trigger on enter
      // this is useful for example for code blocks
      handleKeyDown(i, o) {
        if (o.key !== "Enter")
          return !1;
        const { $cursor: a } = i.state.selection;
        return a ? wo({
          editor: e,
          from: a.pos,
          to: a.pos,
          text: `
`,
          rules: n,
          plugin: r
        }) : !1;
      }
    },
    // @ts-ignore
    isInputRules: !0
  });
  return r;
}
function sT(t) {
  return Object.prototype.toString.call(t).slice(8, -1);
}
function Mo(t) {
  return sT(t) !== "Object" ? !1 : t.constructor === Object && Object.getPrototypeOf(t) === Object.prototype;
}
function vs(t, e) {
  const n = { ...t };
  return Mo(t) && Mo(e) && Object.keys(e).forEach((r) => {
    Mo(e[r]) && Mo(t[r]) ? n[r] = vs(t[r], e[r]) : n[r] = e[r];
  }), n;
}
class St {
  constructor(e = {}) {
    this.type = "mark", this.name = "mark", this.parent = null, this.child = null, this.config = {
      name: this.name,
      defaultOptions: {}
    }, this.config = {
      ...this.config,
      ...e
    }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = ce(z(this, "addOptions", {
      name: this.name
    }))), this.storage = ce(z(this, "addStorage", {
      name: this.name,
      options: this.options
    })) || {};
  }
  static create(e = {}) {
    return new St(e);
  }
  configure(e = {}) {
    const n = this.extend({
      ...this.config,
      addOptions: () => vs(this.options, e)
    });
    return n.name = this.name, n.parent = this.parent, n;
  }
  extend(e = {}) {
    const n = new St(e);
    return n.parent = this, this.child = n, n.name = e.name ? e.name : n.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = ce(z(n, "addOptions", {
      name: n.name
    })), n.storage = ce(z(n, "addStorage", {
      name: n.name,
      options: n.options
    })), n;
  }
  static handleExit({ editor: e, mark: n }) {
    const { tr: r } = e.state, i = e.state.selection.$from;
    if (i.pos === i.end()) {
      const a = i.marks();
      if (!!!a.find((c) => (c == null ? void 0 : c.type.name) === n.name))
        return !1;
      const l = a.find((c) => (c == null ? void 0 : c.type.name) === n.name);
      return l && r.removeStoredMark(l), r.insertText(" ", i.pos), e.view.dispatch(r), !0;
    }
    return !1;
  }
}
function lT(t) {
  return typeof t == "number";
}
class cT {
  constructor(e) {
    this.find = e.find, this.handler = e.handler;
  }
}
const uT = (t, e, n) => {
  if (iu(e))
    return [...t.matchAll(e)];
  const r = e(t, n);
  return r ? r.map((i) => {
    const o = [i.text];
    return o.index = i.index, o.input = t, o.data = i.data, i.replaceWith && (i.text.includes(i.replaceWith) || console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'), o.push(i.replaceWith)), o;
  }) : [];
};
function dT(t) {
  const { editor: e, state: n, from: r, to: i, rule: o, pasteEvent: a, dropEvent: s } = t, { commands: l, chain: c, can: u } = new Cs({
    editor: e,
    state: n
  }), d = [];
  return n.doc.nodesBetween(r, i, (_, m) => {
    if (!_.isTextblock || _.type.spec.code)
      return;
    const f = Math.max(r, m), g = Math.min(i, m + _.content.size), S = _.textBetween(f - m, g - m, void 0, "￼");
    uT(S, o.find, a).forEach((b) => {
      if (b.index === void 0)
        return;
      const h = f + b.index + 1, T = h + b[0].length, C = {
        from: n.tr.mapping.map(h),
        to: n.tr.mapping.map(T)
      }, v = o.handler({
        state: n,
        range: C,
        match: b,
        commands: l,
        chain: c,
        can: u,
        pasteEvent: a,
        dropEvent: s
      });
      d.push(v);
    });
  }), d.every((_) => _ !== null);
}
let Lo = null;
const pT = (t) => {
  var e;
  const n = new ClipboardEvent("paste", {
    clipboardData: new DataTransfer()
  });
  return (e = n.clipboardData) === null || e === void 0 || e.setData("text/html", t), n;
};
function _T(t) {
  const { editor: e, rules: n } = t;
  let r = null, i = !1, o = !1, a = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, s;
  try {
    s = typeof DragEvent < "u" ? new DragEvent("drop") : null;
  } catch {
    s = null;
  }
  const l = ({ state: u, from: d, to: p, rule: _, pasteEvt: m }) => {
    const f = u.tr, g = Ts({
      state: u,
      transaction: f
    });
    if (!(!dT({
      editor: e,
      state: g,
      from: Math.max(d - 1, 0),
      to: p.b - 1,
      rule: _,
      pasteEvent: m,
      dropEvent: s
    }) || !f.steps.length)) {
      try {
        s = typeof DragEvent < "u" ? new DragEvent("drop") : null;
      } catch {
        s = null;
      }
      return a = typeof ClipboardEvent < "u" ? new ClipboardEvent("paste") : null, f;
    }
  };
  return n.map((u) => new Te({
    // we register a global drag handler to track the current drag source element
    view(d) {
      const p = (m) => {
        var f;
        r = !((f = d.dom.parentElement) === null || f === void 0) && f.contains(m.target) ? d.dom.parentElement : null, r && (Lo = e);
      }, _ = () => {
        Lo && (Lo = null);
      };
      return window.addEventListener("dragstart", p), window.addEventListener("dragend", _), {
        destroy() {
          window.removeEventListener("dragstart", p), window.removeEventListener("dragend", _);
        }
      };
    },
    props: {
      handleDOMEvents: {
        drop: (d, p) => {
          if (o = r === d.dom.parentElement, s = p, !o) {
            const _ = Lo;
            _ && setTimeout(() => {
              const m = _.state.selection;
              m && _.commands.deleteRange({ from: m.from, to: m.to });
            }, 10);
          }
          return !1;
        },
        paste: (d, p) => {
          var _;
          const m = (_ = p.clipboardData) === null || _ === void 0 ? void 0 : _.getData("text/html");
          return a = p, i = !!(m != null && m.includes("data-pm-slice")), !1;
        }
      }
    },
    appendTransaction: (d, p, _) => {
      const m = d[0], f = m.getMeta("uiEvent") === "paste" && !i, g = m.getMeta("uiEvent") === "drop" && !o, S = m.getMeta("applyPasteRules"), E = !!S;
      if (!f && !g && !E)
        return;
      if (E) {
        let { text: T } = S;
        typeof T == "string" ? T = T : T = ru(L.from(T), _.schema);
        const { from: C } = S, v = C + T.length, I = pT(T);
        return l({
          rule: u,
          state: _,
          from: C,
          to: { b: v },
          pasteEvt: I
        });
      }
      const b = p.doc.content.findDiffStart(_.doc.content), h = p.doc.content.findDiffEnd(_.doc.content);
      if (!(!lT(b) || !h || b === h.b))
        return l({
          rule: u,
          state: _,
          from: b,
          to: h,
          pasteEvt: a
        });
    }
  }));
}
function mT(t) {
  const e = t.filter((n, r) => t.indexOf(n) !== r);
  return Array.from(new Set(e));
}
class Yr {
  constructor(e, n) {
    this.splittableMarks = [], this.editor = n, this.extensions = Yr.resolve(e), this.schema = rT(this.extensions, n), this.setupExtensions();
  }
  /**
   * Returns a flattened and sorted extension list while
   * also checking for duplicated extensions and warns the user.
   * @param extensions An array of Tiptap extensions
   * @returns An flattened and sorted array of Tiptap extensions
   */
  static resolve(e) {
    const n = Yr.sort(Yr.flatten(e)), r = mT(n.map((i) => i.name));
    return r.length && console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map((i) => `'${i}'`).join(", ")}]. This can lead to issues.`), n;
  }
  /**
   * Create a flattened array of extensions by traversing the `addExtensions` field.
   * @param extensions An array of Tiptap extensions
   * @returns A flattened array of Tiptap extensions
   */
  static flatten(e) {
    return e.map((n) => {
      const r = {
        name: n.name,
        options: n.options,
        storage: n.storage
      }, i = z(n, "addExtensions", r);
      return i ? [n, ...this.flatten(i())] : n;
    }).flat(10);
  }
  /**
   * Sort extensions by priority.
   * @param extensions An array of Tiptap extensions
   * @returns A sorted array of Tiptap extensions by priority
   */
  static sort(e) {
    return e.sort((r, i) => {
      const o = z(r, "priority") || 100, a = z(i, "priority") || 100;
      return o > a ? -1 : o < a ? 1 : 0;
    });
  }
  /**
   * Get all commands from the extensions.
   * @returns An object with all commands where the key is the command name and the value is the command function
   */
  get commands() {
    return this.extensions.reduce((e, n) => {
      const r = {
        name: n.name,
        options: n.options,
        storage: n.storage,
        editor: this.editor,
        type: sl(n.name, this.schema)
      }, i = z(n, "addCommands", r);
      return i ? {
        ...e,
        ...i()
      } : e;
    }, {});
  }
  /**
   * Get all registered Prosemirror plugins from the extensions.
   * @returns An array of Prosemirror plugins
   */
  get plugins() {
    const { editor: e } = this, n = Yr.sort([...this.extensions].reverse()), r = [], i = [], o = n.map((a) => {
      const s = {
        name: a.name,
        options: a.options,
        storage: a.storage,
        editor: e,
        type: sl(a.name, this.schema)
      }, l = [], c = z(a, "addKeyboardShortcuts", s);
      let u = {};
      if (a.type === "mark" && z(a, "exitable", s) && (u.ArrowRight = () => St.handleExit({ editor: e, mark: a })), c) {
        const f = Object.fromEntries(Object.entries(c()).map(([g, S]) => [g, () => S({ editor: e })]));
        u = { ...u, ...f };
      }
      const d = A0(u);
      l.push(d);
      const p = z(a, "addInputRules", s);
      pp(a, e.options.enableInputRules) && p && r.push(...p());
      const _ = z(a, "addPasteRules", s);
      pp(a, e.options.enablePasteRules) && _ && i.push(..._());
      const m = z(a, "addProseMirrorPlugins", s);
      if (m) {
        const f = m();
        l.push(...f);
      }
      return l;
    }).flat();
    return [
      aT({
        editor: e,
        rules: r
      }),
      ..._T({
        editor: e,
        rules: i
      }),
      ...o
    ];
  }
  /**
   * Get all attributes from the extensions.
   * @returns An array of attributes
   */
  get attributes() {
    return $f(this.extensions);
  }
  /**
   * Get all node views from the extensions.
   * @returns An object with all node views where the key is the node name and the value is the node view function
   */
  get nodeViews() {
    const { editor: e } = this, { nodeExtensions: n } = ys(this.extensions);
    return Object.fromEntries(n.filter((r) => !!z(r, "addNodeView")).map((r) => {
      const i = this.attributes.filter((l) => l.type === r.name), o = {
        name: r.name,
        options: r.options,
        storage: r.storage,
        editor: e,
        type: qe(r.name, this.schema)
      }, a = z(r, "addNodeView", o);
      if (!a)
        return [];
      const s = (l, c, u, d, p) => {
        const _ = lc(l, i);
        return a()({
          // pass-through
          node: l,
          view: c,
          getPos: u,
          decorations: d,
          innerDecorations: p,
          // tiptap-specific
          editor: e,
          extension: r,
          HTMLAttributes: _
        });
      };
      return [r.name, s];
    }));
  }
  /**
   * Go through all extensions, create extension storages & setup marks
   * & bind editor event listener.
   */
  setupExtensions() {
    this.extensions.forEach((e) => {
      var n;
      this.editor.extensionStorage[e.name] = e.storage;
      const r = {
        name: e.name,
        options: e.options,
        storage: e.storage,
        editor: this.editor,
        type: sl(e.name, this.schema)
      };
      e.type === "mark" && (!((n = ce(z(e, "keepOnSplit", r))) !== null && n !== void 0) || n) && this.splittableMarks.push(e.name);
      const i = z(e, "onBeforeCreate", r), o = z(e, "onCreate", r), a = z(e, "onUpdate", r), s = z(e, "onSelectionUpdate", r), l = z(e, "onTransaction", r), c = z(e, "onFocus", r), u = z(e, "onBlur", r), d = z(e, "onDestroy", r);
      i && this.editor.on("beforeCreate", i), o && this.editor.on("create", o), a && this.editor.on("update", a), s && this.editor.on("selectionUpdate", s), l && this.editor.on("transaction", l), c && this.editor.on("focus", c), u && this.editor.on("blur", u), d && this.editor.on("destroy", d);
    });
  }
}
class Se {
  constructor(e = {}) {
    this.type = "extension", this.name = "extension", this.parent = null, this.child = null, this.config = {
      name: this.name,
      defaultOptions: {}
    }, this.config = {
      ...this.config,
      ...e
    }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = ce(z(this, "addOptions", {
      name: this.name
    }))), this.storage = ce(z(this, "addStorage", {
      name: this.name,
      options: this.options
    })) || {};
  }
  static create(e = {}) {
    return new Se(e);
  }
  configure(e = {}) {
    const n = this.extend({
      ...this.config,
      addOptions: () => vs(this.options, e)
    });
    return n.name = this.name, n.parent = this.parent, n;
  }
  extend(e = {}) {
    const n = new Se({ ...this.config, ...e });
    return n.parent = this, this.child = n, n.name = e.name ? e.name : n.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = ce(z(n, "addOptions", {
      name: n.name
    })), n.storage = ce(z(n, "addStorage", {
      name: n.name,
      options: n.options
    })), n;
  }
}
function Rs(t, e, n) {
  const { from: r, to: i } = e, { blockSeparator: o = `

`, textSerializers: a = {} } = n || {};
  let s = "";
  return t.nodesBetween(r, i, (l, c, u, d) => {
    var p;
    l.isBlock && c > r && (s += o);
    const _ = a == null ? void 0 : a[l.type.name];
    if (_)
      return u && (s += _({
        node: l,
        pos: c,
        parent: u,
        index: d,
        range: e
      })), !1;
    l.isText && (s += (p = l == null ? void 0 : l.text) === null || p === void 0 ? void 0 : p.slice(Math.max(r, c) - c, i - c));
  }), s;
}
function qf(t) {
  return Object.fromEntries(Object.entries(t.nodes).filter(([, e]) => e.spec.toText).map(([e, n]) => [e, n.spec.toText]));
}
const fT = Se.create({
  name: "clipboardTextSerializer",
  addOptions() {
    return {
      blockSeparator: void 0
    };
  },
  addProseMirrorPlugins() {
    return [
      new Te({
        key: new Oe("clipboardTextSerializer"),
        props: {
          clipboardTextSerializer: () => {
            const { editor: t } = this, { state: e, schema: n } = t, { doc: r, selection: i } = e, { ranges: o } = i, a = Math.min(...o.map((u) => u.$from.pos)), s = Math.max(...o.map((u) => u.$to.pos)), l = qf(n);
            return Rs(r, { from: a, to: s }, {
              ...this.options.blockSeparator !== void 0 ? { blockSeparator: this.options.blockSeparator } : {},
              textSerializers: l
            });
          }
        }
      })
    ];
  }
}), gT = () => ({ editor: t, view: e }) => (requestAnimationFrame(() => {
  var n;
  t.isDestroyed || (e.dom.blur(), (n = window == null ? void 0 : window.getSelection()) === null || n === void 0 || n.removeAllRanges());
}), !0), hT = (t = !1) => ({ commands: e }) => e.setContent("", t), ET = () => ({ state: t, tr: e, dispatch: n }) => {
  const { selection: r } = e, { ranges: i } = r;
  return n && i.forEach(({ $from: o, $to: a }) => {
    t.doc.nodesBetween(o.pos, a.pos, (s, l) => {
      if (s.type.isText)
        return;
      const { doc: c, mapping: u } = e, d = c.resolve(u.map(l)), p = c.resolve(u.map(l + s.nodeSize)), _ = d.blockRange(p);
      if (!_)
        return;
      const m = di(_);
      if (s.type.isTextblock) {
        const { defaultType: f } = d.parent.contentMatchAt(d.index());
        e.setNodeMarkup(_.start, f);
      }
      (m || m === 0) && e.lift(_, m);
    });
  }), !0;
}, ST = (t) => (e) => t(e), bT = () => ({ state: t, dispatch: e }) => G0(t, e), TT = (t, e) => ({ editor: n, tr: r }) => {
  const { state: i } = n, o = i.doc.slice(t.from, t.to);
  r.deleteRange(t.from, t.to);
  const a = r.mapping.map(e);
  return r.insert(a, o.content), r.setSelection(new K(r.doc.resolve(a - 1))), !0;
}, CT = () => ({ tr: t, dispatch: e }) => {
  const { selection: n } = t, r = n.$anchor.node();
  if (r.content.size > 0)
    return !1;
  const i = t.selection.$anchor;
  for (let o = i.depth; o > 0; o -= 1)
    if (i.node(o).type === r.type) {
      if (e) {
        const s = i.before(o), l = i.after(o);
        t.delete(s, l).scrollIntoView();
      }
      return !0;
    }
  return !1;
}, yT = (t) => ({ tr: e, state: n, dispatch: r }) => {
  const i = qe(t, n.schema), o = e.selection.$anchor;
  for (let a = o.depth; a > 0; a -= 1)
    if (o.node(a).type === i) {
      if (r) {
        const l = o.before(a), c = o.after(a);
        e.delete(l, c).scrollIntoView();
      }
      return !0;
    }
  return !1;
}, vT = (t) => ({ tr: e, dispatch: n }) => {
  const { from: r, to: i } = t;
  return n && e.delete(r, i), !0;
}, RT = () => ({ state: t, dispatch: e }) => I0(t, e), OT = () => ({ commands: t }) => t.keyboardShortcut("Enter"), NT = () => ({ state: t, dispatch: e }) => H0(t, e);
function ei(t, e, n = { strict: !0 }) {
  const r = Object.keys(e);
  return r.length ? r.every((i) => n.strict ? e[i] === t[i] : iu(e[i]) ? e[i].test(t[i]) : e[i] === t[i]) : !0;
}
function Wf(t, e, n = {}) {
  return t.find((r) => r.type === e && ei(
    // Only check equality for the attributes that are provided
    Object.fromEntries(Object.keys(n).map((i) => [i, r.attrs[i]])),
    n
  ));
}
function _p(t, e, n = {}) {
  return !!Wf(t, e, n);
}
function ou(t, e, n) {
  var r;
  if (!t || !e)
    return;
  let i = t.parent.childAfter(t.parentOffset);
  if ((!i.node || !i.node.marks.some((u) => u.type === e)) && (i = t.parent.childBefore(t.parentOffset)), !i.node || !i.node.marks.some((u) => u.type === e) || (n = n || ((r = i.node.marks[0]) === null || r === void 0 ? void 0 : r.attrs), !Wf([...i.node.marks], e, n)))
    return;
  let a = i.index, s = t.start() + i.offset, l = a + 1, c = s + i.node.nodeSize;
  for (; a > 0 && _p([...t.parent.child(a - 1).marks], e, n); )
    a -= 1, s -= t.parent.child(a).nodeSize;
  for (; l < t.parent.childCount && _p([...t.parent.child(l).marks], e, n); )
    c += t.parent.child(l).nodeSize, l += 1;
  return {
    from: s,
    to: c
  };
}
function bn(t, e) {
  if (typeof t == "string") {
    if (!e.marks[t])
      throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);
    return e.marks[t];
  }
  return t;
}
const AT = (t, e = {}) => ({ tr: n, state: r, dispatch: i }) => {
  const o = bn(t, r.schema), { doc: a, selection: s } = n, { $from: l, from: c, to: u } = s;
  if (i) {
    const d = ou(l, o, e);
    if (d && d.from <= c && d.to >= u) {
      const p = K.create(a, d.from, d.to);
      n.setSelection(p);
    }
  }
  return !0;
}, IT = (t) => (e) => {
  const n = typeof t == "function" ? t(e) : t;
  for (let r = 0; r < n.length; r += 1)
    if (n[r](e))
      return !0;
  return !1;
};
function au(t) {
  return t instanceof K;
}
function hn(t = 0, e = 0, n = 0) {
  return Math.min(Math.max(t, e), n);
}
function Kf(t, e = null) {
  if (!e)
    return null;
  const n = ne.atStart(t), r = ne.atEnd(t);
  if (e === "start" || e === !0)
    return n;
  if (e === "end")
    return r;
  const i = n.from, o = r.to;
  return e === "all" ? K.create(t, hn(0, i, o), hn(t.content.size, i, o)) : K.create(t, hn(e, i, o), hn(e, i, o));
}
function xT() {
  return navigator.platform === "Android" || /android/i.test(navigator.userAgent);
}
function su() {
  return [
    "iPad Simulator",
    "iPhone Simulator",
    "iPod Simulator",
    "iPad",
    "iPhone",
    "iPod"
  ].includes(navigator.platform) || navigator.userAgent.includes("Mac") && "ontouchend" in document;
}
const DT = (t = null, e = {}) => ({ editor: n, view: r, tr: i, dispatch: o }) => {
  e = {
    scrollIntoView: !0,
    ...e
  };
  const a = () => {
    (su() || xT()) && r.dom.focus(), requestAnimationFrame(() => {
      n.isDestroyed || (r.focus(), e != null && e.scrollIntoView && n.commands.scrollIntoView());
    });
  };
  if (r.hasFocus() && t === null || t === !1)
    return !0;
  if (o && t === null && !au(n.state.selection))
    return a(), !0;
  const s = Kf(i.doc, t) || n.state.selection, l = n.state.selection.eq(s);
  return o && (l || i.setSelection(s), l && i.storedMarks && i.setStoredMarks(i.storedMarks), a()), !0;
}, wT = (t, e) => (n) => t.every((r, i) => e(r, { ...n, index: i })), MT = (t, e) => ({ tr: n, commands: r }) => r.insertContentAt({ from: n.selection.from, to: n.selection.to }, t, e), Qf = (t) => {
  const e = t.childNodes;
  for (let n = e.length - 1; n >= 0; n -= 1) {
    const r = e[n];
    r.nodeType === 3 && r.nodeValue && /^(\n\s\s|\n)$/.test(r.nodeValue) ? t.removeChild(r) : r.nodeType === 1 && Qf(r);
  }
  return t;
};
function ko(t) {
  const e = `<body>${t}</body>`, n = new window.DOMParser().parseFromString(e, "text/html").body;
  return Qf(n);
}
function Ta(t, e, n) {
  if (t instanceof Un || t instanceof L)
    return t;
  n = {
    slice: !0,
    parseOptions: {},
    ...n
  };
  const r = typeof t == "object" && t !== null, i = typeof t == "string";
  if (r)
    try {
      if (Array.isArray(t) && t.length > 0)
        return L.fromArray(t.map((s) => e.nodeFromJSON(s)));
      const a = e.nodeFromJSON(t);
      return n.errorOnInvalidContent && a.check(), a;
    } catch (o) {
      if (n.errorOnInvalidContent)
        throw new Error("[tiptap error]: Invalid JSON content", { cause: o });
      return console.warn("[tiptap warn]: Invalid content.", "Passed value:", t, "Error:", o), Ta("", e, n);
    }
  if (i) {
    if (n.errorOnInvalidContent) {
      let a = !1, s = "";
      const l = new Bm({
        topNode: e.spec.topNode,
        marks: e.spec.marks,
        // Prosemirror's schemas are executed such that: the last to execute, matches last
        // This means that we can add a catch-all node at the end of the schema to catch any content that we don't know how to handle
        nodes: e.spec.nodes.append({
          __tiptap__private__unknown__catch__all__node: {
            content: "inline*",
            group: "block",
            parseDOM: [
              {
                tag: "*",
                getAttrs: (c) => (a = !0, s = typeof c == "string" ? c : c.outerHTML, null)
              }
            ]
          }
        })
      });
      if (n.slice ? $r.fromSchema(l).parseSlice(ko(t), n.parseOptions) : $r.fromSchema(l).parse(ko(t), n.parseOptions), n.errorOnInvalidContent && a)
        throw new Error("[tiptap error]: Invalid HTML content", { cause: new Error(`Invalid element found: ${s}`) });
    }
    const o = $r.fromSchema(e);
    return n.slice ? o.parseSlice(ko(t), n.parseOptions).content : o.parse(ko(t), n.parseOptions);
  }
  return Ta("", e, n);
}
function LT(t, e, n) {
  const r = t.steps.length - 1;
  if (r < e)
    return;
  const i = t.steps[r];
  if (!(i instanceof He || i instanceof $e))
    return;
  const o = t.mapping.maps[r];
  let a = 0;
  o.forEach((s, l, c, u) => {
    a === 0 && (a = u);
  }), t.setSelection(ne.near(t.doc.resolve(a), n));
}
const kT = (t) => !("type" in t), PT = (t, e, n) => ({ tr: r, dispatch: i, editor: o }) => {
  var a;
  if (i) {
    n = {
      parseOptions: o.options.parseOptions,
      updateSelection: !0,
      applyInputRules: !1,
      applyPasteRules: !1,
      ...n
    };
    let s;
    try {
      s = Ta(e, o.schema, {
        parseOptions: {
          preserveWhitespace: "full",
          ...n.parseOptions
        },
        errorOnInvalidContent: (a = n.errorOnInvalidContent) !== null && a !== void 0 ? a : o.options.enableContentCheck
      });
    } catch (m) {
      return o.emit("contentError", {
        editor: o,
        error: m,
        disableCollaboration: () => {
          o.storage.collaboration && (o.storage.collaboration.isDisabled = !0);
        }
      }), !1;
    }
    let { from: l, to: c } = typeof t == "number" ? { from: t, to: t } : { from: t.from, to: t.to }, u = !0, d = !0;
    if ((kT(s) ? s : [s]).forEach((m) => {
      m.check(), u = u ? m.isText && m.marks.length === 0 : !1, d = d ? m.isBlock : !1;
    }), l === c && d) {
      const { parent: m } = r.doc.resolve(l);
      m.isTextblock && !m.type.spec.code && !m.childCount && (l -= 1, c += 1);
    }
    let _;
    if (u) {
      if (Array.isArray(e))
        _ = e.map((m) => m.text || "").join("");
      else if (e instanceof L) {
        let m = "";
        e.forEach((f) => {
          f.text && (m += f.text);
        }), _ = m;
      } else typeof e == "object" && e && e.text ? _ = e.text : _ = e;
      r.insertText(_, l, c);
    } else
      _ = s, r.replaceWith(l, c, _);
    n.updateSelection && LT(r, r.steps.length - 1, -1), n.applyInputRules && r.setMeta("applyInputRules", { from: l, text: _ }), n.applyPasteRules && r.setMeta("applyPasteRules", { from: l, text: _ });
  }
  return !0;
}, FT = () => ({ state: t, dispatch: e }) => P0(t, e), BT = () => ({ state: t, dispatch: e }) => F0(t, e), UT = () => ({ state: t, dispatch: e }) => x0(t, e), HT = () => ({ state: t, dispatch: e }) => L0(t, e), GT = () => ({ state: t, dispatch: e, tr: n }) => {
  try {
    const r = fs(t.doc, t.selection.$from.pos, -1);
    return r == null ? !1 : (n.join(r, 2), e && e(n), !0);
  } catch {
    return !1;
  }
}, VT = () => ({ state: t, dispatch: e, tr: n }) => {
  try {
    const r = fs(t.doc, t.selection.$from.pos, 1);
    return r == null ? !1 : (n.join(r, 2), e && e(n), !0);
  } catch {
    return !1;
  }
}, YT = () => ({ state: t, dispatch: e }) => D0(t, e), $T = () => ({ state: t, dispatch: e }) => w0(t, e);
function Zf() {
  return typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1;
}
function zT(t) {
  const e = t.split(/-(?!$)/);
  let n = e[e.length - 1];
  n === "Space" && (n = " ");
  let r, i, o, a;
  for (let s = 0; s < e.length - 1; s += 1) {
    const l = e[s];
    if (/^(cmd|meta|m)$/i.test(l))
      a = !0;
    else if (/^a(lt)?$/i.test(l))
      r = !0;
    else if (/^(c|ctrl|control)$/i.test(l))
      i = !0;
    else if (/^s(hift)?$/i.test(l))
      o = !0;
    else if (/^mod$/i.test(l))
      su() || Zf() ? a = !0 : i = !0;
    else
      throw new Error(`Unrecognized modifier name: ${l}`);
  }
  return r && (n = `Alt-${n}`), i && (n = `Ctrl-${n}`), a && (n = `Meta-${n}`), o && (n = `Shift-${n}`), n;
}
const qT = (t) => ({ editor: e, view: n, tr: r, dispatch: i }) => {
  const o = zT(t).split(/-(?!$)/), a = o.find((c) => !["Alt", "Ctrl", "Meta", "Shift"].includes(c)), s = new KeyboardEvent("keydown", {
    key: a === "Space" ? " " : a,
    altKey: o.includes("Alt"),
    ctrlKey: o.includes("Ctrl"),
    metaKey: o.includes("Meta"),
    shiftKey: o.includes("Shift"),
    bubbles: !0,
    cancelable: !0
  }), l = e.captureTransaction(() => {
    n.someProp("handleKeyDown", (c) => c(n, s));
  });
  return l == null || l.steps.forEach((c) => {
    const u = c.map(r.mapping);
    u && i && r.maybeStep(u);
  }), !0;
};
function hr(t, e, n = {}) {
  const { from: r, to: i, empty: o } = t.selection, a = e ? qe(e, t.schema) : null, s = [];
  t.doc.nodesBetween(r, i, (d, p) => {
    if (d.isText)
      return;
    const _ = Math.max(r, p), m = Math.min(i, p + d.nodeSize);
    s.push({
      node: d,
      from: _,
      to: m
    });
  });
  const l = i - r, c = s.filter((d) => a ? a.name === d.node.type.name : !0).filter((d) => ei(d.node.attrs, n, { strict: !1 }));
  return o ? !!c.length : c.reduce((d, p) => d + p.to - p.from, 0) >= l;
}
const WT = (t, e = {}) => ({ state: n, dispatch: r }) => {
  const i = qe(t, n.schema);
  return hr(n, i, e) ? B0(n, r) : !1;
}, KT = () => ({ state: t, dispatch: e }) => V0(t, e), QT = (t) => ({ state: e, dispatch: n }) => {
  const r = qe(t, e.schema);
  return Z0(r)(e, n);
}, ZT = () => ({ state: t, dispatch: e }) => U0(t, e);
function Os(t, e) {
  return e.nodes[t] ? "node" : e.marks[t] ? "mark" : null;
}
function mp(t, e) {
  const n = typeof e == "string" ? [e] : e;
  return Object.keys(t).reduce((r, i) => (n.includes(i) || (r[i] = t[i]), r), {});
}
const XT = (t, e) => ({ tr: n, state: r, dispatch: i }) => {
  let o = null, a = null;
  const s = Os(typeof t == "string" ? t : t.name, r.schema);
  return s ? (s === "node" && (o = qe(t, r.schema)), s === "mark" && (a = bn(t, r.schema)), i && n.selection.ranges.forEach((l) => {
    r.doc.nodesBetween(l.$from.pos, l.$to.pos, (c, u) => {
      o && o === c.type && n.setNodeMarkup(u, void 0, mp(c.attrs, e)), a && c.marks.length && c.marks.forEach((d) => {
        a === d.type && n.addMark(u, u + c.nodeSize, a.create(mp(d.attrs, e)));
      });
    });
  }), !0) : !1;
}, jT = () => ({ tr: t, dispatch: e }) => (e && t.scrollIntoView(), !0), JT = () => ({ tr: t, dispatch: e }) => {
  if (e) {
    const n = new Ot(t.doc);
    t.setSelection(n);
  }
  return !0;
}, eC = () => ({ state: t, dispatch: e }) => M0(t, e), tC = () => ({ state: t, dispatch: e }) => k0(t, e), nC = () => ({ state: t, dispatch: e }) => Y0(t, e), rC = () => ({ state: t, dispatch: e }) => q0(t, e), iC = () => ({ state: t, dispatch: e }) => z0(t, e);
function cc(t, e, n = {}, r = {}) {
  return Ta(t, e, {
    slice: !1,
    parseOptions: n,
    errorOnInvalidContent: r.errorOnInvalidContent
  });
}
const oC = (t, e = !1, n = {}, r = {}) => ({ editor: i, tr: o, dispatch: a, commands: s }) => {
  var l, c;
  const { doc: u } = o;
  if (n.preserveWhitespace !== "full") {
    const d = cc(t, i.schema, n, {
      errorOnInvalidContent: (l = r.errorOnInvalidContent) !== null && l !== void 0 ? l : i.options.enableContentCheck
    });
    return a && o.replaceWith(0, u.content.size, d).setMeta("preventUpdate", !e), !0;
  }
  return a && o.setMeta("preventUpdate", !e), s.insertContentAt({ from: 0, to: u.content.size }, t, {
    parseOptions: n,
    errorOnInvalidContent: (c = r.errorOnInvalidContent) !== null && c !== void 0 ? c : i.options.enableContentCheck
  });
};
function Xf(t, e) {
  const n = bn(e, t.schema), { from: r, to: i, empty: o } = t.selection, a = [];
  o ? (t.storedMarks && a.push(...t.storedMarks), a.push(...t.selection.$head.marks())) : t.doc.nodesBetween(r, i, (l) => {
    a.push(...l.marks);
  });
  const s = a.find((l) => l.type.name === n.name);
  return s ? { ...s.attrs } : {};
}
function aC(t, e) {
  const n = new $c(t);
  return e.forEach((r) => {
    r.steps.forEach((i) => {
      n.step(i);
    });
  }), n;
}
function sC(t) {
  for (let e = 0; e < t.edgeCount; e += 1) {
    const { type: n } = t.edge(e);
    if (n.isTextblock && !n.hasRequiredAttrs())
      return n;
  }
  return null;
}
function uc(t, e) {
  const n = [];
  return t.descendants((r, i) => {
    e(r) && n.push({
      node: r,
      pos: i
    });
  }), n;
}
function lC(t, e, n) {
  const r = [];
  return t.nodesBetween(e.from, e.to, (i, o) => {
    n(i) && r.push({
      node: i,
      pos: o
    });
  }), r;
}
function jf(t, e) {
  for (let n = t.depth; n > 0; n -= 1) {
    const r = t.node(n);
    if (e(r))
      return {
        pos: n > 0 ? t.before(n) : 0,
        start: t.start(n),
        depth: n,
        node: r
      };
  }
}
function Ns(t) {
  return (e) => jf(e.$from, t);
}
function cC(t, e) {
  const n = {
    from: 0,
    to: t.content.size
  };
  return Rs(t, n, e);
}
function uC(t, e) {
  const n = qe(e, t.schema), { from: r, to: i } = t.selection, o = [];
  t.doc.nodesBetween(r, i, (s) => {
    o.push(s);
  });
  const a = o.reverse().find((s) => s.type.name === n.name);
  return a ? { ...a.attrs } : {};
}
function Jf(t, e) {
  const n = Os(typeof e == "string" ? e : e.name, t.schema);
  return n === "node" ? uC(t, e) : n === "mark" ? Xf(t, e) : {};
}
function dC(t, e = JSON.stringify) {
  const n = {};
  return t.filter((r) => {
    const i = e(r);
    return Object.prototype.hasOwnProperty.call(n, i) ? !1 : n[i] = !0;
  });
}
function pC(t) {
  const e = dC(t);
  return e.length === 1 ? e : e.filter((n, r) => !e.filter((o, a) => a !== r).some((o) => n.oldRange.from >= o.oldRange.from && n.oldRange.to <= o.oldRange.to && n.newRange.from >= o.newRange.from && n.newRange.to <= o.newRange.to));
}
function _C(t) {
  const { mapping: e, steps: n } = t, r = [];
  return e.maps.forEach((i, o) => {
    const a = [];
    if (i.ranges.length)
      i.forEach((s, l) => {
        a.push({ from: s, to: l });
      });
    else {
      const { from: s, to: l } = n[o];
      if (s === void 0 || l === void 0)
        return;
      a.push({ from: s, to: l });
    }
    a.forEach(({ from: s, to: l }) => {
      const c = e.slice(o).map(s, -1), u = e.slice(o).map(l), d = e.invert().map(c, -1), p = e.invert().map(u);
      r.push({
        oldRange: {
          from: d,
          to: p
        },
        newRange: {
          from: c,
          to: u
        }
      });
    });
  }), pC(r);
}
function lu(t, e, n) {
  const r = [];
  return t === e ? n.resolve(t).marks().forEach((i) => {
    const o = n.resolve(t), a = ou(o, i.type);
    a && r.push({
      mark: i,
      ...a
    });
  }) : n.nodesBetween(t, e, (i, o) => {
    !i || (i == null ? void 0 : i.nodeSize) === void 0 || r.push(...i.marks.map((a) => ({
      from: o,
      to: o + i.nodeSize,
      mark: a
    })));
  }), r;
}
function ia(t, e, n) {
  return Object.fromEntries(Object.entries(n).filter(([r]) => {
    const i = t.find((o) => o.type === e && o.name === r);
    return i ? i.attribute.keepOnSplit : !1;
  }));
}
function dc(t, e, n = {}) {
  const { empty: r, ranges: i } = t.selection, o = e ? bn(e, t.schema) : null;
  if (r)
    return !!(t.storedMarks || t.selection.$from.marks()).filter((d) => o ? o.name === d.type.name : !0).find((d) => ei(d.attrs, n, { strict: !1 }));
  let a = 0;
  const s = [];
  if (i.forEach(({ $from: d, $to: p }) => {
    const _ = d.pos, m = p.pos;
    t.doc.nodesBetween(_, m, (f, g) => {
      if (!f.isText && !f.marks.length)
        return;
      const S = Math.max(_, g), E = Math.min(m, g + f.nodeSize), b = E - S;
      a += b, s.push(...f.marks.map((h) => ({
        mark: h,
        from: S,
        to: E
      })));
    });
  }), a === 0)
    return !1;
  const l = s.filter((d) => o ? o.name === d.mark.type.name : !0).filter((d) => ei(d.mark.attrs, n, { strict: !1 })).reduce((d, p) => d + p.to - p.from, 0), c = s.filter((d) => o ? d.mark.type !== o && d.mark.type.excludes(o) : !0).reduce((d, p) => d + p.to - p.from, 0);
  return (l > 0 ? l + c : l) >= a;
}
function mC(t, e, n = {}) {
  if (!e)
    return hr(t, null, n) || dc(t, null, n);
  const r = Os(e, t.schema);
  return r === "node" ? hr(t, e, n) : r === "mark" ? dc(t, e, n) : !1;
}
function fp(t, e) {
  const { nodeExtensions: n } = ys(e), r = n.find((a) => a.name === t);
  if (!r)
    return !1;
  const i = {
    name: r.name,
    options: r.options,
    storage: r.storage
  }, o = ce(z(r, "group", i));
  return typeof o != "string" ? !1 : o.split(" ").includes("list");
}
function As(t, { checkChildren: e = !0, ignoreWhitespace: n = !1 } = {}) {
  var r;
  if (n) {
    if (t.type.name === "hardBreak")
      return !0;
    if (t.isText)
      return /^\s*$/m.test((r = t.text) !== null && r !== void 0 ? r : "");
  }
  if (t.isText)
    return !t.text;
  if (t.isAtom || t.isLeaf)
    return !1;
  if (t.content.childCount === 0)
    return !0;
  if (e) {
    let i = !0;
    return t.content.forEach((o) => {
      i !== !1 && (As(o, { ignoreWhitespace: n, checkChildren: e }) || (i = !1));
    }), i;
  }
  return !1;
}
function eg(t) {
  return t instanceof ee;
}
function Xi(t, e, n) {
  const i = t.state.doc.content.size, o = hn(e, 0, i), a = hn(n, 0, i), s = t.coordsAtPos(o), l = t.coordsAtPos(a, -1), c = Math.min(s.top, l.top), u = Math.max(s.bottom, l.bottom), d = Math.min(s.left, l.left), p = Math.max(s.right, l.right), _ = p - d, m = u - c, S = {
    top: c,
    bottom: u,
    left: d,
    right: p,
    width: _,
    height: m,
    x: d,
    y: c
  };
  return {
    ...S,
    toJSON: () => S
  };
}
function fC(t, e, n) {
  var r;
  const { selection: i } = e;
  let o = null;
  if (au(i) && (o = i.$cursor), o) {
    const s = (r = t.storedMarks) !== null && r !== void 0 ? r : o.marks();
    return !!n.isInSet(s) || !s.some((l) => l.type.excludes(n));
  }
  const { ranges: a } = i;
  return a.some(({ $from: s, $to: l }) => {
    let c = s.depth === 0 ? t.doc.inlineContent && t.doc.type.allowsMarkType(n) : !1;
    return t.doc.nodesBetween(s.pos, l.pos, (u, d, p) => {
      if (c)
        return !1;
      if (u.isInline) {
        const _ = !p || p.type.allowsMarkType(n), m = !!n.isInSet(u.marks) || !u.marks.some((f) => f.type.excludes(n));
        c = _ && m;
      }
      return !c;
    }), c;
  });
}
const gC = (t, e = {}) => ({ tr: n, state: r, dispatch: i }) => {
  const { selection: o } = n, { empty: a, ranges: s } = o, l = bn(t, r.schema);
  if (i)
    if (a) {
      const c = Xf(r, l);
      n.addStoredMark(l.create({
        ...c,
        ...e
      }));
    } else
      s.forEach((c) => {
        const u = c.$from.pos, d = c.$to.pos;
        r.doc.nodesBetween(u, d, (p, _) => {
          const m = Math.max(_, u), f = Math.min(_ + p.nodeSize, d);
          p.marks.find((S) => S.type === l) ? p.marks.forEach((S) => {
            l === S.type && n.addMark(m, f, l.create({
              ...S.attrs,
              ...e
            }));
          }) : n.addMark(m, f, l.create(e));
        });
      });
  return fC(r, n, l);
}, hC = (t, e) => ({ tr: n }) => (n.setMeta(t, e), !0), EC = (t, e = {}) => ({ state: n, dispatch: r, chain: i }) => {
  const o = qe(t, n.schema);
  let a;
  return n.selection.$anchor.sameParent(n.selection.$head) && (a = n.selection.$anchor.parent.attrs), o.isTextblock ? i().command(({ commands: s }) => cp(o, { ...a, ...e })(n) ? !0 : s.clearNodes()).command(({ state: s }) => cp(o, { ...a, ...e })(s, r)).run() : (console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'), !1);
}, SC = (t) => ({ tr: e, dispatch: n }) => {
  if (n) {
    const { doc: r } = e, i = hn(t, 0, r.content.size), o = ee.create(r, i);
    e.setSelection(o);
  }
  return !0;
}, bC = (t) => ({ tr: e, dispatch: n }) => {
  if (n) {
    const { doc: r } = e, { from: i, to: o } = typeof t == "number" ? { from: t, to: t } : t, a = K.atStart(r).from, s = K.atEnd(r).to, l = hn(i, a, s), c = hn(o, a, s), u = K.create(r, l, c);
    e.setSelection(u);
  }
  return !0;
}, TC = (t) => ({ state: e, dispatch: n }) => {
  const r = qe(t, e.schema);
  return J0(r)(e, n);
};
function gp(t, e) {
  const n = t.storedMarks || t.selection.$to.parentOffset && t.selection.$from.marks();
  if (n) {
    const r = n.filter((i) => e == null ? void 0 : e.includes(i.type.name));
    t.tr.ensureMarks(r);
  }
}
const CC = ({ keepMarks: t = !0 } = {}) => ({ tr: e, state: n, dispatch: r, editor: i }) => {
  const { selection: o, doc: a } = e, { $from: s, $to: l } = o, c = i.extensionManager.attributes, u = ia(c, s.node().type.name, s.node().attrs);
  if (o instanceof ee && o.node.isBlock)
    return !s.parentOffset || !qr(a, s.pos) ? !1 : (r && (t && gp(n, i.extensionManager.splittableMarks), e.split(s.pos).scrollIntoView()), !0);
  if (!s.parent.isBlock)
    return !1;
  const d = l.parentOffset === l.parent.content.size, p = s.depth === 0 ? void 0 : sC(s.node(-1).contentMatchAt(s.indexAfter(-1)));
  let _ = d && p ? [
    {
      type: p,
      attrs: u
    }
  ] : void 0, m = qr(e.doc, e.mapping.map(s.pos), 1, _);
  if (!_ && !m && qr(e.doc, e.mapping.map(s.pos), 1, p ? [{ type: p }] : void 0) && (m = !0, _ = p ? [
    {
      type: p,
      attrs: u
    }
  ] : void 0), r) {
    if (m && (o instanceof K && e.deleteSelection(), e.split(e.mapping.map(s.pos), 1, _), p && !d && !s.parentOffset && s.parent.type !== p)) {
      const f = e.mapping.map(s.before()), g = e.doc.resolve(f);
      s.node(-1).canReplaceWith(g.index(), g.index() + 1, p) && e.setNodeMarkup(e.mapping.map(s.before()), p);
    }
    t && gp(n, i.extensionManager.splittableMarks), e.scrollIntoView();
  }
  return m;
}, yC = (t, e = {}) => ({ tr: n, state: r, dispatch: i, editor: o }) => {
  var a;
  const s = qe(t, r.schema), { $from: l, $to: c } = r.selection, u = r.selection.node;
  if (u && u.isBlock || l.depth < 2 || !l.sameParent(c))
    return !1;
  const d = l.node(-1);
  if (d.type !== s)
    return !1;
  const p = o.extensionManager.attributes;
  if (l.parent.content.size === 0 && l.node(-1).childCount === l.indexAfter(-1)) {
    if (l.depth === 2 || l.node(-3).type !== s || l.index(-2) !== l.node(-2).childCount - 1)
      return !1;
    if (i) {
      let S = L.empty;
      const E = l.index(-1) ? 1 : l.index(-2) ? 2 : 3;
      for (let I = l.depth - E; I >= l.depth - 3; I -= 1)
        S = L.from(l.node(I).copy(S));
      const b = l.indexAfter(-1) < l.node(-2).childCount ? 1 : l.indexAfter(-2) < l.node(-3).childCount ? 2 : 3, h = {
        ...ia(p, l.node().type.name, l.node().attrs),
        ...e
      }, T = ((a = s.contentMatch.defaultType) === null || a === void 0 ? void 0 : a.createAndFill(h)) || void 0;
      S = S.append(L.from(s.createAndFill(null, T) || void 0));
      const C = l.before(l.depth - (E - 1));
      n.replace(C, l.after(-b), new H(S, 4 - E, 0));
      let v = -1;
      n.doc.nodesBetween(C, n.doc.content.size, (I, N) => {
        if (v > -1)
          return !1;
        I.isTextblock && I.content.size === 0 && (v = N + 1);
      }), v > -1 && n.setSelection(K.near(n.doc.resolve(v))), n.scrollIntoView();
    }
    return !0;
  }
  const _ = c.pos === l.end() ? d.contentMatchAt(0).defaultType : null, m = {
    ...ia(p, d.type.name, d.attrs),
    ...e
  }, f = {
    ...ia(p, l.node().type.name, l.node().attrs),
    ...e
  };
  n.delete(l.pos, c.pos);
  const g = _ ? [
    { type: s, attrs: m },
    { type: _, attrs: f }
  ] : [{ type: s, attrs: m }];
  if (!qr(n.doc, l.pos, 2))
    return !1;
  if (i) {
    const { selection: S, storedMarks: E } = r, { splittableMarks: b } = o.extensionManager, h = E || S.$to.parentOffset && S.$from.marks();
    if (n.split(l.pos, 2, g).scrollIntoView(), !h || !i)
      return !0;
    const T = h.filter((C) => b.includes(C.type.name));
    n.ensureMarks(T);
  }
  return !0;
}, ll = (t, e) => {
  const n = Ns((a) => a.type === e)(t.selection);
  if (!n)
    return !0;
  const r = t.doc.resolve(Math.max(0, n.pos - 1)).before(n.depth);
  if (r === void 0)
    return !0;
  const i = t.doc.nodeAt(r);
  return n.node.type === (i == null ? void 0 : i.type) && Wn(t.doc, n.pos) && t.join(n.pos), !0;
}, cl = (t, e) => {
  const n = Ns((a) => a.type === e)(t.selection);
  if (!n)
    return !0;
  const r = t.doc.resolve(n.start).after(n.depth);
  if (r === void 0)
    return !0;
  const i = t.doc.nodeAt(r);
  return n.node.type === (i == null ? void 0 : i.type) && Wn(t.doc, r) && t.join(r), !0;
}, vC = (t, e, n, r = {}) => ({ editor: i, tr: o, state: a, dispatch: s, chain: l, commands: c, can: u }) => {
  const { extensions: d, splittableMarks: p } = i.extensionManager, _ = qe(t, a.schema), m = qe(e, a.schema), { selection: f, storedMarks: g } = a, { $from: S, $to: E } = f, b = S.blockRange(E), h = g || f.$to.parentOffset && f.$from.marks();
  if (!b)
    return !1;
  const T = Ns((C) => fp(C.type.name, d))(f);
  if (b.depth >= 1 && T && b.depth - T.depth <= 1) {
    if (T.node.type === _)
      return c.liftListItem(m);
    if (fp(T.node.type.name, d) && _.validContent(T.node.content) && s)
      return l().command(() => (o.setNodeMarkup(T.pos, _), !0)).command(() => ll(o, _)).command(() => cl(o, _)).run();
  }
  return !n || !h || !s ? l().command(() => u().wrapInList(_, r) ? !0 : c.clearNodes()).wrapInList(_, r).command(() => ll(o, _)).command(() => cl(o, _)).run() : l().command(() => {
    const C = u().wrapInList(_, r), v = h.filter((I) => p.includes(I.type.name));
    return o.ensureMarks(v), C ? !0 : c.clearNodes();
  }).wrapInList(_, r).command(() => ll(o, _)).command(() => cl(o, _)).run();
}, RC = (t, e = {}, n = {}) => ({ state: r, commands: i }) => {
  const { extendEmptyMarkRange: o = !1 } = n, a = bn(t, r.schema);
  return dc(r, a, e) ? i.unsetMark(a, { extendEmptyMarkRange: o }) : i.setMark(a, e);
}, OC = (t, e, n = {}) => ({ state: r, commands: i }) => {
  const o = qe(t, r.schema), a = qe(e, r.schema), s = hr(r, o, n);
  let l;
  return r.selection.$anchor.sameParent(r.selection.$head) && (l = r.selection.$anchor.parent.attrs), s ? i.setNode(a, l) : i.setNode(o, { ...l, ...n });
}, NC = (t, e = {}) => ({ state: n, commands: r }) => {
  const i = qe(t, n.schema);
  return hr(n, i, e) ? r.lift(i) : r.wrapIn(i, e);
}, AC = () => ({ state: t, dispatch: e }) => {
  const n = t.plugins;
  for (let r = 0; r < n.length; r += 1) {
    const i = n[r];
    let o;
    if (i.spec.isInputRules && (o = i.getState(t))) {
      if (e) {
        const a = t.tr, s = o.transform;
        for (let l = s.steps.length - 1; l >= 0; l -= 1)
          a.step(s.steps[l].invert(s.docs[l]));
        if (o.text) {
          const l = a.doc.resolve(o.from).marks();
          a.replaceWith(o.from, o.to, t.schema.text(o.text, l));
        } else
          a.delete(o.from, o.to);
      }
      return !0;
    }
  }
  return !1;
}, IC = () => ({ tr: t, dispatch: e }) => {
  const { selection: n } = t, { empty: r, ranges: i } = n;
  return r || e && i.forEach((o) => {
    t.removeMark(o.$from.pos, o.$to.pos);
  }), !0;
}, xC = (t, e = {}) => ({ tr: n, state: r, dispatch: i }) => {
  var o;
  const { extendEmptyMarkRange: a = !1 } = e, { selection: s } = n, l = bn(t, r.schema), { $from: c, empty: u, ranges: d } = s;
  if (!i)
    return !0;
  if (u && a) {
    let { from: p, to: _ } = s;
    const m = (o = c.marks().find((g) => g.type === l)) === null || o === void 0 ? void 0 : o.attrs, f = ou(c, l, m);
    f && (p = f.from, _ = f.to), n.removeMark(p, _, l);
  } else
    d.forEach((p) => {
      n.removeMark(p.$from.pos, p.$to.pos, l);
    });
  return n.removeStoredMark(l), !0;
}, DC = (t, e = {}) => ({ tr: n, state: r, dispatch: i }) => {
  let o = null, a = null;
  const s = Os(typeof t == "string" ? t : t.name, r.schema);
  return s ? (s === "node" && (o = qe(t, r.schema)), s === "mark" && (a = bn(t, r.schema)), i && n.selection.ranges.forEach((l) => {
    const c = l.$from.pos, u = l.$to.pos;
    let d, p, _, m;
    n.selection.empty ? r.doc.nodesBetween(c, u, (f, g) => {
      o && o === f.type && (_ = Math.max(g, c), m = Math.min(g + f.nodeSize, u), d = g, p = f);
    }) : r.doc.nodesBetween(c, u, (f, g) => {
      g < c && o && o === f.type && (_ = Math.max(g, c), m = Math.min(g + f.nodeSize, u), d = g, p = f), g >= c && g <= u && (o && o === f.type && n.setNodeMarkup(g, void 0, {
        ...f.attrs,
        ...e
      }), a && f.marks.length && f.marks.forEach((S) => {
        if (a === S.type) {
          const E = Math.max(g, c), b = Math.min(g + f.nodeSize, u);
          n.addMark(E, b, a.create({
            ...S.attrs,
            ...e
          }));
        }
      }));
    }), p && (d !== void 0 && n.setNodeMarkup(d, void 0, {
      ...p.attrs,
      ...e
    }), a && p.marks.length && p.marks.forEach((f) => {
      a === f.type && n.addMark(_, m, a.create({
        ...f.attrs,
        ...e
      }));
    }));
  }), !0) : !1;
}, wC = (t, e = {}) => ({ state: n, dispatch: r }) => {
  const i = qe(t, n.schema);
  return W0(i, e)(n, r);
}, MC = (t, e = {}) => ({ state: n, dispatch: r }) => {
  const i = qe(t, n.schema);
  return K0(i, e)(n, r);
};
var LC = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  blur: gT,
  clearContent: hT,
  clearNodes: ET,
  command: ST,
  createParagraphNear: bT,
  cut: TT,
  deleteCurrentNode: CT,
  deleteNode: yT,
  deleteRange: vT,
  deleteSelection: RT,
  enter: OT,
  exitCode: NT,
  extendMarkRange: AT,
  first: IT,
  focus: DT,
  forEach: wT,
  insertContent: MT,
  insertContentAt: PT,
  joinBackward: UT,
  joinDown: BT,
  joinForward: HT,
  joinItemBackward: GT,
  joinItemForward: VT,
  joinTextblockBackward: YT,
  joinTextblockForward: $T,
  joinUp: FT,
  keyboardShortcut: qT,
  lift: WT,
  liftEmptyBlock: KT,
  liftListItem: QT,
  newlineInCode: ZT,
  resetAttributes: XT,
  scrollIntoView: jT,
  selectAll: JT,
  selectNodeBackward: eC,
  selectNodeForward: tC,
  selectParentNode: nC,
  selectTextblockEnd: rC,
  selectTextblockStart: iC,
  setContent: oC,
  setMark: gC,
  setMeta: hC,
  setNode: EC,
  setNodeSelection: SC,
  setTextSelection: bC,
  sinkListItem: TC,
  splitBlock: CC,
  splitListItem: yC,
  toggleList: vC,
  toggleMark: RC,
  toggleNode: OC,
  toggleWrap: NC,
  undoInputRule: AC,
  unsetAllMarks: IC,
  unsetMark: xC,
  updateAttributes: DC,
  wrapIn: wC,
  wrapInList: MC
});
const kC = Se.create({
  name: "commands",
  addCommands() {
    return {
      ...LC
    };
  }
}), PC = Se.create({
  name: "drop",
  addProseMirrorPlugins() {
    return [
      new Te({
        key: new Oe("tiptapDrop"),
        props: {
          handleDrop: (t, e, n, r) => {
            this.editor.emit("drop", {
              editor: this.editor,
              event: e,
              slice: n,
              moved: r
            });
          }
        }
      })
    ];
  }
}), FC = Se.create({
  name: "editable",
  addProseMirrorPlugins() {
    return [
      new Te({
        key: new Oe("editable"),
        props: {
          editable: () => this.editor.options.editable
        }
      })
    ];
  }
}), BC = Se.create({
  name: "focusEvents",
  addProseMirrorPlugins() {
    const { editor: t } = this;
    return [
      new Te({
        key: new Oe("focusEvents"),
        props: {
          handleDOMEvents: {
            focus: (e, n) => {
              t.isFocused = !0;
              const r = t.state.tr.setMeta("focus", { event: n }).setMeta("addToHistory", !1);
              return e.dispatch(r), !1;
            },
            blur: (e, n) => {
              t.isFocused = !1;
              const r = t.state.tr.setMeta("blur", { event: n }).setMeta("addToHistory", !1);
              return e.dispatch(r), !1;
            }
          }
        }
      })
    ];
  }
}), UC = Se.create({
  name: "keymap",
  addKeyboardShortcuts() {
    const t = () => this.editor.commands.first(({ commands: a }) => [
      () => a.undoInputRule(),
      // maybe convert first text block node to default node
      () => a.command(({ tr: s }) => {
        const { selection: l, doc: c } = s, { empty: u, $anchor: d } = l, { pos: p, parent: _ } = d, m = d.parent.isTextblock && p > 0 ? s.doc.resolve(p - 1) : d, f = m.parent.type.spec.isolating, g = d.pos - d.parentOffset, S = f && m.parent.childCount === 1 ? g === d.pos : ne.atStart(c).from === p;
        return !u || !_.type.isTextblock || _.textContent.length || !S || S && d.parent.type.name === "paragraph" ? !1 : a.clearNodes();
      }),
      () => a.deleteSelection(),
      () => a.joinBackward(),
      () => a.selectNodeBackward()
    ]), e = () => this.editor.commands.first(({ commands: a }) => [
      () => a.deleteSelection(),
      () => a.deleteCurrentNode(),
      () => a.joinForward(),
      () => a.selectNodeForward()
    ]), r = {
      Enter: () => this.editor.commands.first(({ commands: a }) => [
        () => a.newlineInCode(),
        () => a.createParagraphNear(),
        () => a.liftEmptyBlock(),
        () => a.splitBlock()
      ]),
      "Mod-Enter": () => this.editor.commands.exitCode(),
      Backspace: t,
      "Mod-Backspace": t,
      "Shift-Backspace": t,
      Delete: e,
      "Mod-Delete": e,
      "Mod-a": () => this.editor.commands.selectAll()
    }, i = {
      ...r
    }, o = {
      ...r,
      "Ctrl-h": t,
      "Alt-Backspace": t,
      "Ctrl-d": e,
      "Ctrl-Alt-Backspace": e,
      "Alt-Delete": e,
      "Alt-d": e,
      "Ctrl-a": () => this.editor.commands.selectTextblockStart(),
      "Ctrl-e": () => this.editor.commands.selectTextblockEnd()
    };
    return su() || Zf() ? o : i;
  },
  addProseMirrorPlugins() {
    return [
      // With this plugin we check if the whole document was selected and deleted.
      // In this case we will additionally call `clearNodes()` to convert e.g. a heading
      // to a paragraph if necessary.
      // This is an alternative to ProseMirror's `AllSelection`, which doesn’t work well
      // with many other commands.
      new Te({
        key: new Oe("clearDocument"),
        appendTransaction: (t, e, n) => {
          if (t.some((f) => f.getMeta("composition")))
            return;
          const r = t.some((f) => f.docChanged) && !e.doc.eq(n.doc), i = t.some((f) => f.getMeta("preventClearDocument"));
          if (!r || i)
            return;
          const { empty: o, from: a, to: s } = e.selection, l = ne.atStart(e.doc).from, c = ne.atEnd(e.doc).to;
          if (o || !(a === l && s === c) || !As(n.doc))
            return;
          const p = n.tr, _ = Ts({
            state: n,
            transaction: p
          }), { commands: m } = new Cs({
            editor: this.editor,
            state: _
          });
          if (m.clearNodes(), !!p.steps.length)
            return p;
        }
      })
    ];
  }
}), HC = Se.create({
  name: "paste",
  addProseMirrorPlugins() {
    return [
      new Te({
        key: new Oe("tiptapPaste"),
        props: {
          handlePaste: (t, e, n) => {
            this.editor.emit("paste", {
              editor: this.editor,
              event: e,
              slice: n
            });
          }
        }
      })
    ];
  }
}), GC = Se.create({
  name: "tabindex",
  addProseMirrorPlugins() {
    return [
      new Te({
        key: new Oe("tabindex"),
        props: {
          attributes: () => this.editor.isEditable ? { tabindex: "0" } : {}
        }
      })
    ];
  }
});
class nr {
  get name() {
    return this.node.type.name;
  }
  constructor(e, n, r = !1, i = null) {
    this.currentNode = null, this.actualDepth = null, this.isBlock = r, this.resolvedPos = e, this.editor = n, this.currentNode = i;
  }
  get node() {
    return this.currentNode || this.resolvedPos.node();
  }
  get element() {
    return this.editor.view.domAtPos(this.pos).node;
  }
  get depth() {
    var e;
    return (e = this.actualDepth) !== null && e !== void 0 ? e : this.resolvedPos.depth;
  }
  get pos() {
    return this.resolvedPos.pos;
  }
  get content() {
    return this.node.content;
  }
  set content(e) {
    let n = this.from, r = this.to;
    if (this.isBlock) {
      if (this.content.size === 0) {
        console.error(`You can’t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);
        return;
      }
      n = this.from + 1, r = this.to - 1;
    }
    this.editor.commands.insertContentAt({ from: n, to: r }, e);
  }
  get attributes() {
    return this.node.attrs;
  }
  get textContent() {
    return this.node.textContent;
  }
  get size() {
    return this.node.nodeSize;
  }
  get from() {
    return this.isBlock ? this.pos : this.resolvedPos.start(this.resolvedPos.depth);
  }
  get range() {
    return {
      from: this.from,
      to: this.to
    };
  }
  get to() {
    return this.isBlock ? this.pos + this.size : this.resolvedPos.end(this.resolvedPos.depth) + (this.node.isText ? 0 : 1);
  }
  get parent() {
    if (this.depth === 0)
      return null;
    const e = this.resolvedPos.start(this.resolvedPos.depth - 1), n = this.resolvedPos.doc.resolve(e);
    return new nr(n, this.editor);
  }
  get before() {
    let e = this.resolvedPos.doc.resolve(this.from - (this.isBlock ? 1 : 2));
    return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.from - 3)), new nr(e, this.editor);
  }
  get after() {
    let e = this.resolvedPos.doc.resolve(this.to + (this.isBlock ? 2 : 1));
    return e.depth !== this.depth && (e = this.resolvedPos.doc.resolve(this.to + 3)), new nr(e, this.editor);
  }
  get children() {
    const e = [];
    return this.node.content.forEach((n, r) => {
      const i = n.isBlock && !n.isTextblock, o = n.isAtom && !n.isText, a = this.pos + r + (o ? 0 : 1), s = this.resolvedPos.doc.resolve(a);
      if (!i && s.depth <= this.depth)
        return;
      const l = new nr(s, this.editor, i, i ? n : null);
      i && (l.actualDepth = this.depth + 1), e.push(new nr(s, this.editor, i, i ? n : null));
    }), e;
  }
  get firstChild() {
    return this.children[0] || null;
  }
  get lastChild() {
    const e = this.children;
    return e[e.length - 1] || null;
  }
  closest(e, n = {}) {
    let r = null, i = this.parent;
    for (; i && !r; ) {
      if (i.node.type.name === e)
        if (Object.keys(n).length > 0) {
          const o = i.node.attrs, a = Object.keys(n);
          for (let s = 0; s < a.length; s += 1) {
            const l = a[s];
            if (o[l] !== n[l])
              break;
          }
        } else
          r = i;
      i = i.parent;
    }
    return r;
  }
  querySelector(e, n = {}) {
    return this.querySelectorAll(e, n, !0)[0] || null;
  }
  querySelectorAll(e, n = {}, r = !1) {
    let i = [];
    if (!this.children || this.children.length === 0)
      return i;
    const o = Object.keys(n);
    return this.children.forEach((a) => {
      r && i.length > 0 || (a.node.type.name === e && o.every((l) => n[l] === a.node.attrs[l]) && i.push(a), !(r && i.length > 0) && (i = i.concat(a.querySelectorAll(e, n, r))));
    }), i;
  }
  setAttribute(e) {
    const { tr: n } = this.editor.state;
    n.setNodeMarkup(this.from, void 0, {
      ...this.node.attrs,
      ...e
    }), this.editor.view.dispatch(n);
  }
}
const VC = `.ProseMirror {
  position: relative;
}

.ProseMirror {
  word-wrap: break-word;
  white-space: pre-wrap;
  white-space: break-spaces;
  -webkit-font-variant-ligatures: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}

.ProseMirror [contenteditable="false"] {
  white-space: normal;
}

.ProseMirror [contenteditable="false"] [contenteditable="true"] {
  white-space: pre-wrap;
}

.ProseMirror pre {
  white-space: pre-wrap;
}

img.ProseMirror-separator {
  display: inline !important;
  border: none !important;
  margin: 0 !important;
  width: 0 !important;
  height: 0 !important;
}

.ProseMirror-gapcursor {
  display: none;
  pointer-events: none;
  position: absolute;
  margin: 0;
}

.ProseMirror-gapcursor:after {
  content: "";
  display: block;
  position: absolute;
  top: -2px;
  width: 20px;
  border-top: 1px solid black;
  animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}

@keyframes ProseMirror-cursor-blink {
  to {
    visibility: hidden;
  }
}

.ProseMirror-hideselection *::selection {
  background: transparent;
}

.ProseMirror-hideselection *::-moz-selection {
  background: transparent;
}

.ProseMirror-hideselection * {
  caret-color: transparent;
}

.ProseMirror-focused .ProseMirror-gapcursor {
  display: block;
}

.tippy-box[data-animation=fade][data-state=hidden] {
  opacity: 0
}`;
function YC(t, e, n) {
  const r = document.querySelector("style[data-tiptap-style]");
  if (r !== null)
    return r;
  const i = document.createElement("style");
  return e && i.setAttribute("nonce", e), i.setAttribute("data-tiptap-style", ""), i.innerHTML = t, document.getElementsByTagName("head")[0].appendChild(i), i;
}
class $C extends eT {
  constructor(e = {}) {
    super(), this.isFocused = !1, this.isInitialized = !1, this.extensionStorage = {}, this.options = {
      element: document.createElement("div"),
      content: "",
      injectCSS: !0,
      injectNonce: void 0,
      extensions: [],
      autofocus: !1,
      editable: !0,
      editorProps: {},
      parseOptions: {},
      coreExtensionOptions: {},
      enableInputRules: !0,
      enablePasteRules: !0,
      enableCoreExtensions: !0,
      enableContentCheck: !1,
      onBeforeCreate: () => null,
      onCreate: () => null,
      onUpdate: () => null,
      onSelectionUpdate: () => null,
      onTransaction: () => null,
      onFocus: () => null,
      onBlur: () => null,
      onDestroy: () => null,
      onContentError: ({ error: n }) => {
        throw n;
      },
      onPaste: () => null,
      onDrop: () => null
    }, this.isCapturingTransaction = !1, this.capturedTransaction = null, this.setOptions(e), this.createExtensionManager(), this.createCommandManager(), this.createSchema(), this.on("beforeCreate", this.options.onBeforeCreate), this.emit("beforeCreate", { editor: this }), this.on("contentError", this.options.onContentError), this.createView(), this.injectCSS(), this.on("create", this.options.onCreate), this.on("update", this.options.onUpdate), this.on("selectionUpdate", this.options.onSelectionUpdate), this.on("transaction", this.options.onTransaction), this.on("focus", this.options.onFocus), this.on("blur", this.options.onBlur), this.on("destroy", this.options.onDestroy), this.on("drop", ({ event: n, slice: r, moved: i }) => this.options.onDrop(n, r, i)), this.on("paste", ({ event: n, slice: r }) => this.options.onPaste(n, r)), window.setTimeout(() => {
      this.isDestroyed || (this.commands.focus(this.options.autofocus), this.emit("create", { editor: this }), this.isInitialized = !0);
    }, 0);
  }
  /**
   * Returns the editor storage.
   */
  get storage() {
    return this.extensionStorage;
  }
  /**
   * An object of all registered commands.
   */
  get commands() {
    return this.commandManager.commands;
  }
  /**
   * Create a command chain to call multiple commands at once.
   */
  chain() {
    return this.commandManager.chain();
  }
  /**
   * Check if a command or a command chain can be executed. Without executing it.
   */
  can() {
    return this.commandManager.can();
  }
  /**
   * Inject CSS styles.
   */
  injectCSS() {
    this.options.injectCSS && document && (this.css = YC(VC, this.options.injectNonce));
  }
  /**
   * Update editor options.
   *
   * @param options A list of options
   */
  setOptions(e = {}) {
    this.options = {
      ...this.options,
      ...e
    }, !(!this.view || !this.state || this.isDestroyed) && (this.options.editorProps && this.view.setProps(this.options.editorProps), this.view.updateState(this.state));
  }
  /**
   * Update editable state of the editor.
   */
  setEditable(e, n = !0) {
    this.setOptions({ editable: e }), n && this.emit("update", { editor: this, transaction: this.state.tr });
  }
  /**
   * Returns whether the editor is editable.
   */
  get isEditable() {
    return this.options.editable && this.view && this.view.editable;
  }
  /**
   * Returns the editor state.
   */
  get state() {
    return this.view.state;
  }
  /**
   * Register a ProseMirror plugin.
   *
   * @param plugin A ProseMirror plugin
   * @param handlePlugins Control how to merge the plugin into the existing plugins.
   * @returns The new editor state
   */
  registerPlugin(e, n) {
    const r = zf(n) ? n(e, [...this.state.plugins]) : [...this.state.plugins, e], i = this.state.reconfigure({ plugins: r });
    return this.view.updateState(i), i;
  }
  /**
   * Unregister a ProseMirror plugin.
   *
   * @param nameOrPluginKeyToRemove The plugins name
   * @returns The new editor state or undefined if the editor is destroyed
   */
  unregisterPlugin(e) {
    if (this.isDestroyed)
      return;
    const n = this.state.plugins;
    let r = n;
    if ([].concat(e).forEach((o) => {
      const a = typeof o == "string" ? `${o}$` : o.key;
      r = n.filter((s) => !s.key.startsWith(a));
    }), n.length === r.length)
      return;
    const i = this.state.reconfigure({
      plugins: r
    });
    return this.view.updateState(i), i;
  }
  /**
   * Creates an extension manager.
   */
  createExtensionManager() {
    var e, n;
    const i = [...this.options.enableCoreExtensions ? [
      FC,
      fT.configure({
        blockSeparator: (n = (e = this.options.coreExtensionOptions) === null || e === void 0 ? void 0 : e.clipboardTextSerializer) === null || n === void 0 ? void 0 : n.blockSeparator
      }),
      kC,
      BC,
      UC,
      GC,
      PC,
      HC
    ].filter((o) => typeof this.options.enableCoreExtensions == "object" ? this.options.enableCoreExtensions[o.name] !== !1 : !0) : [], ...this.options.extensions].filter((o) => ["extension", "node", "mark"].includes(o == null ? void 0 : o.type));
    this.extensionManager = new Yr(i, this);
  }
  /**
   * Creates an command manager.
   */
  createCommandManager() {
    this.commandManager = new Cs({
      editor: this
    });
  }
  /**
   * Creates a ProseMirror schema.
   */
  createSchema() {
    this.schema = this.extensionManager.schema;
  }
  /**
   * Creates a ProseMirror view.
   */
  createView() {
    var e;
    let n;
    try {
      n = cc(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: this.options.enableContentCheck });
    } catch (a) {
      if (!(a instanceof Error) || !["[tiptap error]: Invalid JSON content", "[tiptap error]: Invalid HTML content"].includes(a.message))
        throw a;
      this.emit("contentError", {
        editor: this,
        error: a,
        disableCollaboration: () => {
          this.storage.collaboration && (this.storage.collaboration.isDisabled = !0), this.options.extensions = this.options.extensions.filter((s) => s.name !== "collaboration"), this.createExtensionManager();
        }
      }), n = cc(this.options.content, this.schema, this.options.parseOptions, { errorOnInvalidContent: !1 });
    }
    const r = Kf(n, this.options.autofocus);
    this.view = new S0(this.options.element, {
      ...this.options.editorProps,
      attributes: {
        // add `role="textbox"` to the editor element
        role: "textbox",
        ...(e = this.options.editorProps) === null || e === void 0 ? void 0 : e.attributes
      },
      dispatchTransaction: this.dispatchTransaction.bind(this),
      state: Vr.create({
        doc: n,
        selection: r || void 0
      })
    });
    const i = this.state.reconfigure({
      plugins: this.extensionManager.plugins
    });
    this.view.updateState(i), this.createNodeViews(), this.prependClass();
    const o = this.view.dom;
    o.editor = this;
  }
  /**
   * Creates all node views.
   */
  createNodeViews() {
    this.view.isDestroyed || this.view.setProps({
      nodeViews: this.extensionManager.nodeViews
    });
  }
  /**
   * Prepend class name to element.
   */
  prependClass() {
    this.view.dom.className = `tiptap ${this.view.dom.className}`;
  }
  captureTransaction(e) {
    this.isCapturingTransaction = !0, e(), this.isCapturingTransaction = !1;
    const n = this.capturedTransaction;
    return this.capturedTransaction = null, n;
  }
  /**
   * The callback over which to send transactions (state updates) produced by the view.
   *
   * @param transaction An editor state transaction
   */
  dispatchTransaction(e) {
    if (this.view.isDestroyed)
      return;
    if (this.isCapturingTransaction) {
      if (!this.capturedTransaction) {
        this.capturedTransaction = e;
        return;
      }
      e.steps.forEach((a) => {
        var s;
        return (s = this.capturedTransaction) === null || s === void 0 ? void 0 : s.step(a);
      });
      return;
    }
    const n = this.state.apply(e), r = !this.state.selection.eq(n.selection);
    this.emit("beforeTransaction", {
      editor: this,
      transaction: e,
      nextState: n
    }), this.view.updateState(n), this.emit("transaction", {
      editor: this,
      transaction: e
    }), r && this.emit("selectionUpdate", {
      editor: this,
      transaction: e
    });
    const i = e.getMeta("focus"), o = e.getMeta("blur");
    i && this.emit("focus", {
      editor: this,
      event: i.event,
      transaction: e
    }), o && this.emit("blur", {
      editor: this,
      event: o.event,
      transaction: e
    }), !(!e.docChanged || e.getMeta("preventUpdate")) && this.emit("update", {
      editor: this,
      transaction: e
    });
  }
  /**
   * Get attributes of the currently selected node or mark.
   */
  getAttributes(e) {
    return Jf(this.state, e);
  }
  isActive(e, n) {
    const r = typeof e == "string" ? e : null, i = typeof e == "string" ? n : e;
    return mC(this.state, r, i);
  }
  /**
   * Get the document as JSON.
   */
  getJSON() {
    return this.state.doc.toJSON();
  }
  /**
   * Get the document as HTML.
   */
  getHTML() {
    return ru(this.state.doc.content, this.schema);
  }
  /**
   * Get the document as text.
   */
  getText(e) {
    const { blockSeparator: n = `

`, textSerializers: r = {} } = e || {};
    return cC(this.state.doc, {
      blockSeparator: n,
      textSerializers: {
        ...qf(this.schema),
        ...r
      }
    });
  }
  /**
   * Check if there is no content.
   */
  get isEmpty() {
    return As(this.state.doc);
  }
  /**
   * Get the number of characters for the current document.
   *
   * @deprecated
   */
  getCharacterCount() {
    return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'), this.state.doc.content.size - 2;
  }
  /**
   * Destroy the editor.
   */
  destroy() {
    if (this.emit("destroy"), this.view) {
      const e = this.view.dom;
      e && e.editor && delete e.editor, this.view.destroy();
    }
    this.removeAllListeners();
  }
  /**
   * Check if the editor is already destroyed.
   */
  get isDestroyed() {
    var e;
    return !(!((e = this.view) === null || e === void 0) && e.docView);
  }
  $node(e, n) {
    var r;
    return ((r = this.$doc) === null || r === void 0 ? void 0 : r.querySelector(e, n)) || null;
  }
  $nodes(e, n) {
    var r;
    return ((r = this.$doc) === null || r === void 0 ? void 0 : r.querySelectorAll(e, n)) || null;
  }
  $pos(e) {
    const n = this.state.doc.resolve(e);
    return new nr(n, this);
  }
  get $doc() {
    return this.$pos(0);
  }
}
function Er(t) {
  return new Eo({
    find: t.find,
    handler: ({ state: e, range: n, match: r }) => {
      const i = ce(t.getAttributes, void 0, r);
      if (i === !1 || i === null)
        return null;
      const { tr: o } = e, a = r[r.length - 1], s = r[0];
      if (a) {
        const l = s.search(/\S/), c = n.from + s.indexOf(a), u = c + a.length;
        if (lu(n.from, n.to, e.doc).filter((_) => _.mark.type.excluded.find((f) => f === t.type && f !== _.mark.type)).filter((_) => _.to > c).length)
          return null;
        u < n.to && o.delete(u, n.to), c > n.from && o.delete(n.from + l, c);
        const p = n.from + l + a.length;
        o.addMark(n.from + l, p, t.type.create(i || {})), o.removeStoredMark(t.type);
      }
    }
  });
}
function cu(t) {
  return new Eo({
    find: t.find,
    handler: ({ state: e, range: n, match: r }) => {
      const i = ce(t.getAttributes, void 0, r) || {}, { tr: o } = e, a = n.from;
      let s = n.to;
      const l = t.type.create(i);
      if (r[1]) {
        const c = r[0].lastIndexOf(r[1]);
        let u = a + c;
        u > s ? u = s : s = u + r[1].length;
        const d = r[0][r[0].length - 1];
        o.insertText(d, a + r[0].length - 1), o.replaceWith(u, s, l);
      } else if (r[0]) {
        const c = t.type.isInline ? a : a - 1;
        o.insert(c, t.type.create(i)).delete(o.mapping.map(a), o.mapping.map(s));
      }
      o.scrollIntoView();
    }
  });
}
function pc(t) {
  return new Eo({
    find: t.find,
    handler: ({ state: e, range: n, match: r }) => {
      const i = e.doc.resolve(n.from), o = ce(t.getAttributes, void 0, r) || {};
      if (!i.node(-1).canReplaceWith(i.index(-1), i.indexAfter(-1), t.type))
        return null;
      e.tr.delete(n.from, n.to).setBlockType(n.from, n.from, t.type, o);
    }
  });
}
function Sr(t) {
  return new Eo({
    find: t.find,
    handler: ({ state: e, range: n, match: r, chain: i }) => {
      const o = ce(t.getAttributes, void 0, r) || {}, a = e.tr.delete(n.from, n.to), l = a.doc.resolve(n.from).blockRange(), c = l && Yc(l, t.type, o);
      if (!c)
        return null;
      if (a.wrap(l, c), t.keepMarks && t.editor) {
        const { selection: d, storedMarks: p } = e, { splittableMarks: _ } = t.editor.extensionManager, m = p || d.$to.parentOffset && d.$from.marks();
        if (m) {
          const f = m.filter((g) => _.includes(g.type.name));
          a.ensureMarks(f);
        }
      }
      if (t.keepAttributes) {
        const d = t.type.name === "bulletList" || t.type.name === "orderedList" ? "listItem" : "taskList";
        i().updateAttributes(d, o).run();
      }
      const u = a.doc.resolve(n.from - 1).nodeBefore;
      u && u.type === t.type && Wn(a.doc, n.from - 1) && (!t.joinPredicate || t.joinPredicate(r, u)) && a.join(n.from - 1);
    }
  });
}
let xe = class _c {
  constructor(e = {}) {
    this.type = "node", this.name = "node", this.parent = null, this.child = null, this.config = {
      name: this.name,
      defaultOptions: {}
    }, this.config = {
      ...this.config,
      ...e
    }, this.name = this.config.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`), this.options = this.config.defaultOptions, this.config.addOptions && (this.options = ce(z(this, "addOptions", {
      name: this.name
    }))), this.storage = ce(z(this, "addStorage", {
      name: this.name,
      options: this.options
    })) || {};
  }
  static create(e = {}) {
    return new _c(e);
  }
  configure(e = {}) {
    const n = this.extend({
      ...this.config,
      addOptions: () => vs(this.options, e)
    });
    return n.name = this.name, n.parent = this.parent, n;
  }
  extend(e = {}) {
    const n = new _c(e);
    return n.parent = this, this.child = n, n.name = e.name ? e.name : n.parent.name, e.defaultOptions && Object.keys(e.defaultOptions).length > 0 && console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${n.name}".`), n.options = ce(z(n, "addOptions", {
      name: n.name
    })), n.storage = ce(z(n, "addStorage", {
      name: n.name,
      options: n.options
    })), n;
  }
};
function $n(t) {
  return new cT({
    find: t.find,
    handler: ({ state: e, range: n, match: r, pasteEvent: i }) => {
      const o = ce(t.getAttributes, void 0, r, i);
      if (o === !1 || o === null)
        return null;
      const { tr: a } = e, s = r[r.length - 1], l = r[0];
      let c = n.to;
      if (s) {
        const u = l.search(/\S/), d = n.from + l.indexOf(s), p = d + s.length;
        if (lu(n.from, n.to, e.doc).filter((m) => m.mark.type.excluded.find((g) => g === t.type && g !== m.mark.type)).filter((m) => m.to > d).length)
          return null;
        p < n.to && a.delete(p, n.to), d > n.from && a.delete(n.from + u, d), c = n.from + u + s.length, a.addMark(n.from + u, c, t.type.create(o || {})), a.removeStoredMark(t.type);
      }
    }
  });
}
function zC(t) {
  return t.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
}
class fe extends HTMLElement {
  constructor() {
    super();
    M(this, "template", "");
    M(this, "editor");
    M(this, "options");
    M(this, "alwaysEnabledButtons", ["fullscreen", "printer"]);
  }
  registerClickListener() {
    this.addEventListener("click", () => {
      var r;
      const n = (r = this.editor) == null ? void 0 : r.chain();
      this.onClick(n), n == null || n.run();
    });
  }
  connectedCallback() {
    this.innerHTML = this.template;
  }
  // @ts-ignore
  onClick(n) {
  }
  onCreate(n, r) {
    this.editor = n.editor, this.options = r, this.alwaysEnabledButtons = Array.from(
      new Set(this.alwaysEnabledButtons.concat(r.alwaysEnabledToolbarKeys || []))
    );
  }
  onTransaction(n) {
    const r = this.querySelector("div");
    r && (this.onActive(n.editor) ? r.classList.add("active") : r.classList.remove("active"));
  }
  // @ts-ignore
  onActive(n) {
    return !1;
  }
  onEditableChange(n) {
    let r = this.tagName.slice(
      /*linwiteditor-*/
      4
    ).toLocaleLowerCase();
    r === "custom" && (r = this.getAttribute("id") || ""), !this.alwaysEnabledButtons.includes(r) && (n ? (this.style.pointerEvents = "", this.style.opacity = "") : (this.style.pointerEvents = "none", this.style.opacity = "0.5"));
  }
}
class qC extends fe {
  constructor() {
    super(), this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.82843 6.99955L8.36396 9.53509L6.94975 10.9493L2 5.99955L6.94975 1.0498L8.36396 2.46402L5.82843 4.99955H13C17.4183 4.99955 21 8.58127 21 12.9996C21 17.4178 17.4183 20.9996 13 20.9996H4V18.9996H13C16.3137 18.9996 19 16.3133 19 12.9996C19 9.68584 16.3137 6.99955 13 6.99955H5.82843Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.undo();
  }
}
class WC extends fe {
  constructor() {
    super(), this.template = `
         <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.1716 6.99955H11C7.68629 6.99955 5 9.68584 5 12.9996C5 16.3133 7.68629 18.9996 11 18.9996H20V20.9996H11C6.58172 20.9996 3 17.4178 3 12.9996C3 8.58127 6.58172 4.99955 11 4.99955H18.1716L15.636 2.46402L17.0503 1.0498L22 5.99955L17.0503 10.9493L15.636 9.53509L18.1716 6.99955Z"></path></svg>
         </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.redo();
  }
}
var ht = "top", Pt = "bottom", Ft = "right", Et = "left", uu = "auto", So = [ht, Pt, Ft, Et], ti = "start", ji = "end", KC = "clippingParents", tg = "viewport", Ei = "popper", QC = "reference", hp = /* @__PURE__ */ So.reduce(function(t, e) {
  return t.concat([e + "-" + ti, e + "-" + ji]);
}, []), ng = /* @__PURE__ */ [].concat(So, [uu]).reduce(function(t, e) {
  return t.concat([e, e + "-" + ti, e + "-" + ji]);
}, []), ZC = "beforeRead", XC = "read", jC = "afterRead", JC = "beforeMain", e1 = "main", t1 = "afterMain", n1 = "beforeWrite", r1 = "write", i1 = "afterWrite", o1 = [ZC, XC, jC, JC, e1, t1, n1, r1, i1];
function rn(t) {
  return t ? (t.nodeName || "").toLowerCase() : null;
}
function Nt(t) {
  if (t == null)
    return window;
  if (t.toString() !== "[object Window]") {
    var e = t.ownerDocument;
    return e && e.defaultView || window;
  }
  return t;
}
function br(t) {
  var e = Nt(t).Element;
  return t instanceof e || t instanceof Element;
}
function kt(t) {
  var e = Nt(t).HTMLElement;
  return t instanceof e || t instanceof HTMLElement;
}
function du(t) {
  if (typeof ShadowRoot > "u")
    return !1;
  var e = Nt(t).ShadowRoot;
  return t instanceof e || t instanceof ShadowRoot;
}
function a1(t) {
  var e = t.state;
  Object.keys(e.elements).forEach(function(n) {
    var r = e.styles[n] || {}, i = e.attributes[n] || {}, o = e.elements[n];
    !kt(o) || !rn(o) || (Object.assign(o.style, r), Object.keys(i).forEach(function(a) {
      var s = i[a];
      s === !1 ? o.removeAttribute(a) : o.setAttribute(a, s === !0 ? "" : s);
    }));
  });
}
function s1(t) {
  var e = t.state, n = {
    popper: {
      position: e.options.strategy,
      left: "0",
      top: "0",
      margin: "0"
    },
    arrow: {
      position: "absolute"
    },
    reference: {}
  };
  return Object.assign(e.elements.popper.style, n.popper), e.styles = n, e.elements.arrow && Object.assign(e.elements.arrow.style, n.arrow), function() {
    Object.keys(e.elements).forEach(function(r) {
      var i = e.elements[r], o = e.attributes[r] || {}, a = Object.keys(e.styles.hasOwnProperty(r) ? e.styles[r] : n[r]), s = a.reduce(function(l, c) {
        return l[c] = "", l;
      }, {});
      !kt(i) || !rn(i) || (Object.assign(i.style, s), Object.keys(o).forEach(function(l) {
        i.removeAttribute(l);
      }));
    });
  };
}
const rg = {
  name: "applyStyles",
  enabled: !0,
  phase: "write",
  fn: a1,
  effect: s1,
  requires: ["computeStyles"]
};
function en(t) {
  return t.split("-")[0];
}
var ur = Math.max, Ca = Math.min, ni = Math.round;
function mc() {
  var t = navigator.userAgentData;
  return t != null && t.brands && Array.isArray(t.brands) ? t.brands.map(function(e) {
    return e.brand + "/" + e.version;
  }).join(" ") : navigator.userAgent;
}
function ig() {
  return !/^((?!chrome|android).)*safari/i.test(mc());
}
function ri(t, e, n) {
  e === void 0 && (e = !1), n === void 0 && (n = !1);
  var r = t.getBoundingClientRect(), i = 1, o = 1;
  e && kt(t) && (i = t.offsetWidth > 0 && ni(r.width) / t.offsetWidth || 1, o = t.offsetHeight > 0 && ni(r.height) / t.offsetHeight || 1);
  var a = br(t) ? Nt(t) : window, s = a.visualViewport, l = !ig() && n, c = (r.left + (l && s ? s.offsetLeft : 0)) / i, u = (r.top + (l && s ? s.offsetTop : 0)) / o, d = r.width / i, p = r.height / o;
  return {
    width: d,
    height: p,
    top: u,
    right: c + d,
    bottom: u + p,
    left: c,
    x: c,
    y: u
  };
}
function pu(t) {
  var e = ri(t), n = t.offsetWidth, r = t.offsetHeight;
  return Math.abs(e.width - n) <= 1 && (n = e.width), Math.abs(e.height - r) <= 1 && (r = e.height), {
    x: t.offsetLeft,
    y: t.offsetTop,
    width: n,
    height: r
  };
}
function og(t, e) {
  var n = e.getRootNode && e.getRootNode();
  if (t.contains(e))
    return !0;
  if (n && du(n)) {
    var r = e;
    do {
      if (r && t.isSameNode(r))
        return !0;
      r = r.parentNode || r.host;
    } while (r);
  }
  return !1;
}
function Sn(t) {
  return Nt(t).getComputedStyle(t);
}
function l1(t) {
  return ["table", "td", "th"].indexOf(rn(t)) >= 0;
}
function Qn(t) {
  return ((br(t) ? t.ownerDocument : (
    // $FlowFixMe[prop-missing]
    t.document
  )) || window.document).documentElement;
}
function Is(t) {
  return rn(t) === "html" ? t : (
    // this is a quicker (but less type safe) way to save quite some bytes from the bundle
    // $FlowFixMe[incompatible-return]
    // $FlowFixMe[prop-missing]
    t.assignedSlot || // step into the shadow DOM of the parent of a slotted node
    t.parentNode || // DOM Element detected
    (du(t) ? t.host : null) || // ShadowRoot detected
    // $FlowFixMe[incompatible-call]: HTMLElement is a Node
    Qn(t)
  );
}
function Ep(t) {
  return !kt(t) || // https://github.com/popperjs/popper-core/issues/837
  Sn(t).position === "fixed" ? null : t.offsetParent;
}
function c1(t) {
  var e = /firefox/i.test(mc()), n = /Trident/i.test(mc());
  if (n && kt(t)) {
    var r = Sn(t);
    if (r.position === "fixed")
      return null;
  }
  var i = Is(t);
  for (du(i) && (i = i.host); kt(i) && ["html", "body"].indexOf(rn(i)) < 0; ) {
    var o = Sn(i);
    if (o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].indexOf(o.willChange) !== -1 || e && o.willChange === "filter" || e && o.filter && o.filter !== "none")
      return i;
    i = i.parentNode;
  }
  return null;
}
function bo(t) {
  for (var e = Nt(t), n = Ep(t); n && l1(n) && Sn(n).position === "static"; )
    n = Ep(n);
  return n && (rn(n) === "html" || rn(n) === "body" && Sn(n).position === "static") ? e : n || c1(t) || e;
}
function _u(t) {
  return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
}
function Li(t, e, n) {
  return ur(t, Ca(e, n));
}
function u1(t, e, n) {
  var r = Li(t, e, n);
  return r > n ? n : r;
}
function ag() {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
}
function sg(t) {
  return Object.assign({}, ag(), t);
}
function lg(t, e) {
  return e.reduce(function(n, r) {
    return n[r] = t, n;
  }, {});
}
var d1 = function(e, n) {
  return e = typeof e == "function" ? e(Object.assign({}, n.rects, {
    placement: n.placement
  })) : e, sg(typeof e != "number" ? e : lg(e, So));
};
function p1(t) {
  var e, n = t.state, r = t.name, i = t.options, o = n.elements.arrow, a = n.modifiersData.popperOffsets, s = en(n.placement), l = _u(s), c = [Et, Ft].indexOf(s) >= 0, u = c ? "height" : "width";
  if (!(!o || !a)) {
    var d = d1(i.padding, n), p = pu(o), _ = l === "y" ? ht : Et, m = l === "y" ? Pt : Ft, f = n.rects.reference[u] + n.rects.reference[l] - a[l] - n.rects.popper[u], g = a[l] - n.rects.reference[l], S = bo(o), E = S ? l === "y" ? S.clientHeight || 0 : S.clientWidth || 0 : 0, b = f / 2 - g / 2, h = d[_], T = E - p[u] - d[m], C = E / 2 - p[u] / 2 + b, v = Li(h, C, T), I = l;
    n.modifiersData[r] = (e = {}, e[I] = v, e.centerOffset = v - C, e);
  }
}
function _1(t) {
  var e = t.state, n = t.options, r = n.element, i = r === void 0 ? "[data-popper-arrow]" : r;
  i != null && (typeof i == "string" && (i = e.elements.popper.querySelector(i), !i) || og(e.elements.popper, i) && (e.elements.arrow = i));
}
const m1 = {
  name: "arrow",
  enabled: !0,
  phase: "main",
  fn: p1,
  effect: _1,
  requires: ["popperOffsets"],
  requiresIfExists: ["preventOverflow"]
};
function ii(t) {
  return t.split("-")[1];
}
var f1 = {
  top: "auto",
  right: "auto",
  bottom: "auto",
  left: "auto"
};
function g1(t, e) {
  var n = t.x, r = t.y, i = e.devicePixelRatio || 1;
  return {
    x: ni(n * i) / i || 0,
    y: ni(r * i) / i || 0
  };
}
function Sp(t) {
  var e, n = t.popper, r = t.popperRect, i = t.placement, o = t.variation, a = t.offsets, s = t.position, l = t.gpuAcceleration, c = t.adaptive, u = t.roundOffsets, d = t.isFixed, p = a.x, _ = p === void 0 ? 0 : p, m = a.y, f = m === void 0 ? 0 : m, g = typeof u == "function" ? u({
    x: _,
    y: f
  }) : {
    x: _,
    y: f
  };
  _ = g.x, f = g.y;
  var S = a.hasOwnProperty("x"), E = a.hasOwnProperty("y"), b = Et, h = ht, T = window;
  if (c) {
    var C = bo(n), v = "clientHeight", I = "clientWidth";
    if (C === Nt(n) && (C = Qn(n), Sn(C).position !== "static" && s === "absolute" && (v = "scrollHeight", I = "scrollWidth")), C = C, i === ht || (i === Et || i === Ft) && o === ji) {
      h = Pt;
      var N = d && C === T && T.visualViewport ? T.visualViewport.height : (
        // $FlowFixMe[prop-missing]
        C[v]
      );
      f -= N - r.height, f *= l ? 1 : -1;
    }
    if (i === Et || (i === ht || i === Pt) && o === ji) {
      b = Ft;
      var x = d && C === T && T.visualViewport ? T.visualViewport.width : (
        // $FlowFixMe[prop-missing]
        C[I]
      );
      _ -= x - r.width, _ *= l ? 1 : -1;
    }
  }
  var P = Object.assign({
    position: s
  }, c && f1), Y = u === !0 ? g1({
    x: _,
    y: f
  }, Nt(n)) : {
    x: _,
    y: f
  };
  if (_ = Y.x, f = Y.y, l) {
    var Z;
    return Object.assign({}, P, (Z = {}, Z[h] = E ? "0" : "", Z[b] = S ? "0" : "", Z.transform = (T.devicePixelRatio || 1) <= 1 ? "translate(" + _ + "px, " + f + "px)" : "translate3d(" + _ + "px, " + f + "px, 0)", Z));
  }
  return Object.assign({}, P, (e = {}, e[h] = E ? f + "px" : "", e[b] = S ? _ + "px" : "", e.transform = "", e));
}
function h1(t) {
  var e = t.state, n = t.options, r = n.gpuAcceleration, i = r === void 0 ? !0 : r, o = n.adaptive, a = o === void 0 ? !0 : o, s = n.roundOffsets, l = s === void 0 ? !0 : s, c = {
    placement: en(e.placement),
    variation: ii(e.placement),
    popper: e.elements.popper,
    popperRect: e.rects.popper,
    gpuAcceleration: i,
    isFixed: e.options.strategy === "fixed"
  };
  e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, Sp(Object.assign({}, c, {
    offsets: e.modifiersData.popperOffsets,
    position: e.options.strategy,
    adaptive: a,
    roundOffsets: l
  })))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, Sp(Object.assign({}, c, {
    offsets: e.modifiersData.arrow,
    position: "absolute",
    adaptive: !1,
    roundOffsets: l
  })))), e.attributes.popper = Object.assign({}, e.attributes.popper, {
    "data-popper-placement": e.placement
  });
}
const E1 = {
  name: "computeStyles",
  enabled: !0,
  phase: "beforeWrite",
  fn: h1,
  data: {}
};
var Po = {
  passive: !0
};
function S1(t) {
  var e = t.state, n = t.instance, r = t.options, i = r.scroll, o = i === void 0 ? !0 : i, a = r.resize, s = a === void 0 ? !0 : a, l = Nt(e.elements.popper), c = [].concat(e.scrollParents.reference, e.scrollParents.popper);
  return o && c.forEach(function(u) {
    u.addEventListener("scroll", n.update, Po);
  }), s && l.addEventListener("resize", n.update, Po), function() {
    o && c.forEach(function(u) {
      u.removeEventListener("scroll", n.update, Po);
    }), s && l.removeEventListener("resize", n.update, Po);
  };
}
const b1 = {
  name: "eventListeners",
  enabled: !0,
  phase: "write",
  fn: function() {
  },
  effect: S1,
  data: {}
};
var T1 = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
};
function oa(t) {
  return t.replace(/left|right|bottom|top/g, function(e) {
    return T1[e];
  });
}
var C1 = {
  start: "end",
  end: "start"
};
function bp(t) {
  return t.replace(/start|end/g, function(e) {
    return C1[e];
  });
}
function mu(t) {
  var e = Nt(t), n = e.pageXOffset, r = e.pageYOffset;
  return {
    scrollLeft: n,
    scrollTop: r
  };
}
function fu(t) {
  return ri(Qn(t)).left + mu(t).scrollLeft;
}
function y1(t, e) {
  var n = Nt(t), r = Qn(t), i = n.visualViewport, o = r.clientWidth, a = r.clientHeight, s = 0, l = 0;
  if (i) {
    o = i.width, a = i.height;
    var c = ig();
    (c || !c && e === "fixed") && (s = i.offsetLeft, l = i.offsetTop);
  }
  return {
    width: o,
    height: a,
    x: s + fu(t),
    y: l
  };
}
function v1(t) {
  var e, n = Qn(t), r = mu(t), i = (e = t.ownerDocument) == null ? void 0 : e.body, o = ur(n.scrollWidth, n.clientWidth, i ? i.scrollWidth : 0, i ? i.clientWidth : 0), a = ur(n.scrollHeight, n.clientHeight, i ? i.scrollHeight : 0, i ? i.clientHeight : 0), s = -r.scrollLeft + fu(t), l = -r.scrollTop;
  return Sn(i || n).direction === "rtl" && (s += ur(n.clientWidth, i ? i.clientWidth : 0) - o), {
    width: o,
    height: a,
    x: s,
    y: l
  };
}
function gu(t) {
  var e = Sn(t), n = e.overflow, r = e.overflowX, i = e.overflowY;
  return /auto|scroll|overlay|hidden/.test(n + i + r);
}
function cg(t) {
  return ["html", "body", "#document"].indexOf(rn(t)) >= 0 ? t.ownerDocument.body : kt(t) && gu(t) ? t : cg(Is(t));
}
function ki(t, e) {
  var n;
  e === void 0 && (e = []);
  var r = cg(t), i = r === ((n = t.ownerDocument) == null ? void 0 : n.body), o = Nt(r), a = i ? [o].concat(o.visualViewport || [], gu(r) ? r : []) : r, s = e.concat(a);
  return i ? s : (
    // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
    s.concat(ki(Is(a)))
  );
}
function fc(t) {
  return Object.assign({}, t, {
    left: t.x,
    top: t.y,
    right: t.x + t.width,
    bottom: t.y + t.height
  });
}
function R1(t, e) {
  var n = ri(t, !1, e === "fixed");
  return n.top = n.top + t.clientTop, n.left = n.left + t.clientLeft, n.bottom = n.top + t.clientHeight, n.right = n.left + t.clientWidth, n.width = t.clientWidth, n.height = t.clientHeight, n.x = n.left, n.y = n.top, n;
}
function Tp(t, e, n) {
  return e === tg ? fc(y1(t, n)) : br(e) ? R1(e, n) : fc(v1(Qn(t)));
}
function O1(t) {
  var e = ki(Is(t)), n = ["absolute", "fixed"].indexOf(Sn(t).position) >= 0, r = n && kt(t) ? bo(t) : t;
  return br(r) ? e.filter(function(i) {
    return br(i) && og(i, r) && rn(i) !== "body";
  }) : [];
}
function N1(t, e, n, r) {
  var i = e === "clippingParents" ? O1(t) : [].concat(e), o = [].concat(i, [n]), a = o[0], s = o.reduce(function(l, c) {
    var u = Tp(t, c, r);
    return l.top = ur(u.top, l.top), l.right = Ca(u.right, l.right), l.bottom = Ca(u.bottom, l.bottom), l.left = ur(u.left, l.left), l;
  }, Tp(t, a, r));
  return s.width = s.right - s.left, s.height = s.bottom - s.top, s.x = s.left, s.y = s.top, s;
}
function ug(t) {
  var e = t.reference, n = t.element, r = t.placement, i = r ? en(r) : null, o = r ? ii(r) : null, a = e.x + e.width / 2 - n.width / 2, s = e.y + e.height / 2 - n.height / 2, l;
  switch (i) {
    case ht:
      l = {
        x: a,
        y: e.y - n.height
      };
      break;
    case Pt:
      l = {
        x: a,
        y: e.y + e.height
      };
      break;
    case Ft:
      l = {
        x: e.x + e.width,
        y: s
      };
      break;
    case Et:
      l = {
        x: e.x - n.width,
        y: s
      };
      break;
    default:
      l = {
        x: e.x,
        y: e.y
      };
  }
  var c = i ? _u(i) : null;
  if (c != null) {
    var u = c === "y" ? "height" : "width";
    switch (o) {
      case ti:
        l[c] = l[c] - (e[u] / 2 - n[u] / 2);
        break;
      case ji:
        l[c] = l[c] + (e[u] / 2 - n[u] / 2);
        break;
    }
  }
  return l;
}
function Ji(t, e) {
  e === void 0 && (e = {});
  var n = e, r = n.placement, i = r === void 0 ? t.placement : r, o = n.strategy, a = o === void 0 ? t.strategy : o, s = n.boundary, l = s === void 0 ? KC : s, c = n.rootBoundary, u = c === void 0 ? tg : c, d = n.elementContext, p = d === void 0 ? Ei : d, _ = n.altBoundary, m = _ === void 0 ? !1 : _, f = n.padding, g = f === void 0 ? 0 : f, S = sg(typeof g != "number" ? g : lg(g, So)), E = p === Ei ? QC : Ei, b = t.rects.popper, h = t.elements[m ? E : p], T = N1(br(h) ? h : h.contextElement || Qn(t.elements.popper), l, u, a), C = ri(t.elements.reference), v = ug({
    reference: C,
    element: b,
    strategy: "absolute",
    placement: i
  }), I = fc(Object.assign({}, b, v)), N = p === Ei ? I : C, x = {
    top: T.top - N.top + S.top,
    bottom: N.bottom - T.bottom + S.bottom,
    left: T.left - N.left + S.left,
    right: N.right - T.right + S.right
  }, P = t.modifiersData.offset;
  if (p === Ei && P) {
    var Y = P[i];
    Object.keys(x).forEach(function(Z) {
      var q = [Ft, Pt].indexOf(Z) >= 0 ? 1 : -1, V = [ht, Pt].indexOf(Z) >= 0 ? "y" : "x";
      x[Z] += Y[V] * q;
    });
  }
  return x;
}
function A1(t, e) {
  e === void 0 && (e = {});
  var n = e, r = n.placement, i = n.boundary, o = n.rootBoundary, a = n.padding, s = n.flipVariations, l = n.allowedAutoPlacements, c = l === void 0 ? ng : l, u = ii(r), d = u ? s ? hp : hp.filter(function(m) {
    return ii(m) === u;
  }) : So, p = d.filter(function(m) {
    return c.indexOf(m) >= 0;
  });
  p.length === 0 && (p = d);
  var _ = p.reduce(function(m, f) {
    return m[f] = Ji(t, {
      placement: f,
      boundary: i,
      rootBoundary: o,
      padding: a
    })[en(f)], m;
  }, {});
  return Object.keys(_).sort(function(m, f) {
    return _[m] - _[f];
  });
}
function I1(t) {
  if (en(t) === uu)
    return [];
  var e = oa(t);
  return [bp(t), e, bp(e)];
}
function x1(t) {
  var e = t.state, n = t.options, r = t.name;
  if (!e.modifiersData[r]._skip) {
    for (var i = n.mainAxis, o = i === void 0 ? !0 : i, a = n.altAxis, s = a === void 0 ? !0 : a, l = n.fallbackPlacements, c = n.padding, u = n.boundary, d = n.rootBoundary, p = n.altBoundary, _ = n.flipVariations, m = _ === void 0 ? !0 : _, f = n.allowedAutoPlacements, g = e.options.placement, S = en(g), E = S === g, b = l || (E || !m ? [oa(g)] : I1(g)), h = [g].concat(b).reduce(function(pe, le) {
      return pe.concat(en(le) === uu ? A1(e, {
        placement: le,
        boundary: u,
        rootBoundary: d,
        padding: c,
        flipVariations: m,
        allowedAutoPlacements: f
      }) : le);
    }, []), T = e.rects.reference, C = e.rects.popper, v = /* @__PURE__ */ new Map(), I = !0, N = h[0], x = 0; x < h.length; x++) {
      var P = h[x], Y = en(P), Z = ii(P) === ti, q = [ht, Pt].indexOf(Y) >= 0, V = q ? "width" : "height", O = Ji(e, {
        placement: P,
        boundary: u,
        rootBoundary: d,
        altBoundary: p,
        padding: c
      }), y = q ? Z ? Ft : Et : Z ? Pt : ht;
      T[V] > C[V] && (y = oa(y));
      var R = oa(y), w = [];
      if (o && w.push(O[Y] <= 0), s && w.push(O[y] <= 0, O[R] <= 0), w.every(function(pe) {
        return pe;
      })) {
        N = P, I = !1;
        break;
      }
      v.set(P, w);
    }
    if (I)
      for (var B = m ? 3 : 1, $ = function(le) {
        var he = h.find(function(We) {
          var De = v.get(We);
          if (De)
            return De.slice(0, le).every(function(et) {
              return et;
            });
        });
        if (he)
          return N = he, "break";
      }, X = B; X > 0; X--) {
        var de = $(X);
        if (de === "break") break;
      }
    e.placement !== N && (e.modifiersData[r]._skip = !0, e.placement = N, e.reset = !0);
  }
}
const D1 = {
  name: "flip",
  enabled: !0,
  phase: "main",
  fn: x1,
  requiresIfExists: ["offset"],
  data: {
    _skip: !1
  }
};
function Cp(t, e, n) {
  return n === void 0 && (n = {
    x: 0,
    y: 0
  }), {
    top: t.top - e.height - n.y,
    right: t.right - e.width + n.x,
    bottom: t.bottom - e.height + n.y,
    left: t.left - e.width - n.x
  };
}
function yp(t) {
  return [ht, Ft, Pt, Et].some(function(e) {
    return t[e] >= 0;
  });
}
function w1(t) {
  var e = t.state, n = t.name, r = e.rects.reference, i = e.rects.popper, o = e.modifiersData.preventOverflow, a = Ji(e, {
    elementContext: "reference"
  }), s = Ji(e, {
    altBoundary: !0
  }), l = Cp(a, r), c = Cp(s, i, o), u = yp(l), d = yp(c);
  e.modifiersData[n] = {
    referenceClippingOffsets: l,
    popperEscapeOffsets: c,
    isReferenceHidden: u,
    hasPopperEscaped: d
  }, e.attributes.popper = Object.assign({}, e.attributes.popper, {
    "data-popper-reference-hidden": u,
    "data-popper-escaped": d
  });
}
const M1 = {
  name: "hide",
  enabled: !0,
  phase: "main",
  requiresIfExists: ["preventOverflow"],
  fn: w1
};
function L1(t, e, n) {
  var r = en(t), i = [Et, ht].indexOf(r) >= 0 ? -1 : 1, o = typeof n == "function" ? n(Object.assign({}, e, {
    placement: t
  })) : n, a = o[0], s = o[1];
  return a = a || 0, s = (s || 0) * i, [Et, Ft].indexOf(r) >= 0 ? {
    x: s,
    y: a
  } : {
    x: a,
    y: s
  };
}
function k1(t) {
  var e = t.state, n = t.options, r = t.name, i = n.offset, o = i === void 0 ? [0, 0] : i, a = ng.reduce(function(u, d) {
    return u[d] = L1(d, e.rects, o), u;
  }, {}), s = a[e.placement], l = s.x, c = s.y;
  e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += l, e.modifiersData.popperOffsets.y += c), e.modifiersData[r] = a;
}
const P1 = {
  name: "offset",
  enabled: !0,
  phase: "main",
  requires: ["popperOffsets"],
  fn: k1
};
function F1(t) {
  var e = t.state, n = t.name;
  e.modifiersData[n] = ug({
    reference: e.rects.reference,
    element: e.rects.popper,
    strategy: "absolute",
    placement: e.placement
  });
}
const B1 = {
  name: "popperOffsets",
  enabled: !0,
  phase: "read",
  fn: F1,
  data: {}
};
function U1(t) {
  return t === "x" ? "y" : "x";
}
function H1(t) {
  var e = t.state, n = t.options, r = t.name, i = n.mainAxis, o = i === void 0 ? !0 : i, a = n.altAxis, s = a === void 0 ? !1 : a, l = n.boundary, c = n.rootBoundary, u = n.altBoundary, d = n.padding, p = n.tether, _ = p === void 0 ? !0 : p, m = n.tetherOffset, f = m === void 0 ? 0 : m, g = Ji(e, {
    boundary: l,
    rootBoundary: c,
    padding: d,
    altBoundary: u
  }), S = en(e.placement), E = ii(e.placement), b = !E, h = _u(S), T = U1(h), C = e.modifiersData.popperOffsets, v = e.rects.reference, I = e.rects.popper, N = typeof f == "function" ? f(Object.assign({}, e.rects, {
    placement: e.placement
  })) : f, x = typeof N == "number" ? {
    mainAxis: N,
    altAxis: N
  } : Object.assign({
    mainAxis: 0,
    altAxis: 0
  }, N), P = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, Y = {
    x: 0,
    y: 0
  };
  if (C) {
    if (o) {
      var Z, q = h === "y" ? ht : Et, V = h === "y" ? Pt : Ft, O = h === "y" ? "height" : "width", y = C[h], R = y + g[q], w = y - g[V], B = _ ? -I[O] / 2 : 0, $ = E === ti ? v[O] : I[O], X = E === ti ? -I[O] : -v[O], de = e.elements.arrow, pe = _ && de ? pu(de) : {
        width: 0,
        height: 0
      }, le = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : ag(), he = le[q], We = le[V], De = Li(0, v[O], pe[O]), et = b ? v[O] / 2 - B - De - he - x.mainAxis : $ - De - he - x.mainAxis, Ke = b ? -v[O] / 2 + B + De + We + x.mainAxis : X + De + We + x.mainAxis, st = e.elements.arrow && bo(e.elements.arrow), Ut = st ? h === "y" ? st.clientTop || 0 : st.clientLeft || 0 : 0, lt = (Z = P == null ? void 0 : P[h]) != null ? Z : 0, ct = y + et - lt - Ut, Pe = y + Ke - lt, ae = Li(_ ? Ca(R, ct) : R, y, _ ? ur(w, Pe) : w);
      C[h] = ae, Y[h] = ae - y;
    }
    if (s) {
      var Qe, Q = h === "x" ? ht : Et, j = h === "x" ? Pt : Ft, Ee = C[T], J = T === "y" ? "height" : "width", _e = Ee + g[Q], Fe = Ee - g[j], Ge = [ht, Et].indexOf(S) !== -1, Tt = (Qe = P == null ? void 0 : P[T]) != null ? Qe : 0, U = Ge ? _e : Ee - v[J] - I[J] - Tt + x.altAxis, A = Ge ? Ee + v[J] + I[J] - Tt - x.altAxis : Fe, k = _ && Ge ? u1(U, Ee, A) : Li(_ ? U : _e, Ee, _ ? A : Fe);
      C[T] = k, Y[T] = k - Ee;
    }
    e.modifiersData[r] = Y;
  }
}
const G1 = {
  name: "preventOverflow",
  enabled: !0,
  phase: "main",
  fn: H1,
  requiresIfExists: ["offset"]
};
function V1(t) {
  return {
    scrollLeft: t.scrollLeft,
    scrollTop: t.scrollTop
  };
}
function Y1(t) {
  return t === Nt(t) || !kt(t) ? mu(t) : V1(t);
}
function $1(t) {
  var e = t.getBoundingClientRect(), n = ni(e.width) / t.offsetWidth || 1, r = ni(e.height) / t.offsetHeight || 1;
  return n !== 1 || r !== 1;
}
function z1(t, e, n) {
  n === void 0 && (n = !1);
  var r = kt(e), i = kt(e) && $1(e), o = Qn(e), a = ri(t, i, n), s = {
    scrollLeft: 0,
    scrollTop: 0
  }, l = {
    x: 0,
    y: 0
  };
  return (r || !r && !n) && ((rn(e) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
  gu(o)) && (s = Y1(e)), kt(e) ? (l = ri(e, !0), l.x += e.clientLeft, l.y += e.clientTop) : o && (l.x = fu(o))), {
    x: a.left + s.scrollLeft - l.x,
    y: a.top + s.scrollTop - l.y,
    width: a.width,
    height: a.height
  };
}
function q1(t) {
  var e = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = [];
  t.forEach(function(o) {
    e.set(o.name, o);
  });
  function i(o) {
    n.add(o.name);
    var a = [].concat(o.requires || [], o.requiresIfExists || []);
    a.forEach(function(s) {
      if (!n.has(s)) {
        var l = e.get(s);
        l && i(l);
      }
    }), r.push(o);
  }
  return t.forEach(function(o) {
    n.has(o.name) || i(o);
  }), r;
}
function W1(t) {
  var e = q1(t);
  return o1.reduce(function(n, r) {
    return n.concat(e.filter(function(i) {
      return i.phase === r;
    }));
  }, []);
}
function K1(t) {
  var e;
  return function() {
    return e || (e = new Promise(function(n) {
      Promise.resolve().then(function() {
        e = void 0, n(t());
      });
    })), e;
  };
}
function Q1(t) {
  var e = t.reduce(function(n, r) {
    var i = n[r.name];
    return n[r.name] = i ? Object.assign({}, i, r, {
      options: Object.assign({}, i.options, r.options),
      data: Object.assign({}, i.data, r.data)
    }) : r, n;
  }, {});
  return Object.keys(e).map(function(n) {
    return e[n];
  });
}
var vp = {
  placement: "bottom",
  modifiers: [],
  strategy: "absolute"
};
function Rp() {
  for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
    e[n] = arguments[n];
  return !e.some(function(r) {
    return !(r && typeof r.getBoundingClientRect == "function");
  });
}
function Z1(t) {
  t === void 0 && (t = {});
  var e = t, n = e.defaultModifiers, r = n === void 0 ? [] : n, i = e.defaultOptions, o = i === void 0 ? vp : i;
  return function(s, l, c) {
    c === void 0 && (c = o);
    var u = {
      placement: "bottom",
      orderedModifiers: [],
      options: Object.assign({}, vp, o),
      modifiersData: {},
      elements: {
        reference: s,
        popper: l
      },
      attributes: {},
      styles: {}
    }, d = [], p = !1, _ = {
      state: u,
      setOptions: function(S) {
        var E = typeof S == "function" ? S(u.options) : S;
        f(), u.options = Object.assign({}, o, u.options, E), u.scrollParents = {
          reference: br(s) ? ki(s) : s.contextElement ? ki(s.contextElement) : [],
          popper: ki(l)
        };
        var b = W1(Q1([].concat(r, u.options.modifiers)));
        return u.orderedModifiers = b.filter(function(h) {
          return h.enabled;
        }), m(), _.update();
      },
      // Sync update – it will always be executed, even if not necessary. This
      // is useful for low frequency updates where sync behavior simplifies the
      // logic.
      // For high frequency updates (e.g. `resize` and `scroll` events), always
      // prefer the async Popper#update method
      forceUpdate: function() {
        if (!p) {
          var S = u.elements, E = S.reference, b = S.popper;
          if (Rp(E, b)) {
            u.rects = {
              reference: z1(E, bo(b), u.options.strategy === "fixed"),
              popper: pu(b)
            }, u.reset = !1, u.placement = u.options.placement, u.orderedModifiers.forEach(function(x) {
              return u.modifiersData[x.name] = Object.assign({}, x.data);
            });
            for (var h = 0; h < u.orderedModifiers.length; h++) {
              if (u.reset === !0) {
                u.reset = !1, h = -1;
                continue;
              }
              var T = u.orderedModifiers[h], C = T.fn, v = T.options, I = v === void 0 ? {} : v, N = T.name;
              typeof C == "function" && (u = C({
                state: u,
                options: I,
                name: N,
                instance: _
              }) || u);
            }
          }
        }
      },
      // Async and optimistically optimized update – it will not be executed if
      // not necessary (debounced to run at most once-per-tick)
      update: K1(function() {
        return new Promise(function(g) {
          _.forceUpdate(), g(u);
        });
      }),
      destroy: function() {
        f(), p = !0;
      }
    };
    if (!Rp(s, l))
      return _;
    _.setOptions(c).then(function(g) {
      !p && c.onFirstUpdate && c.onFirstUpdate(g);
    });
    function m() {
      u.orderedModifiers.forEach(function(g) {
        var S = g.name, E = g.options, b = E === void 0 ? {} : E, h = g.effect;
        if (typeof h == "function") {
          var T = h({
            state: u,
            name: S,
            instance: _,
            options: b
          }), C = function() {
          };
          d.push(T || C);
        }
      });
    }
    function f() {
      d.forEach(function(g) {
        return g();
      }), d = [];
    }
    return _;
  };
}
var X1 = [b1, B1, E1, rg, P1, D1, G1, m1, M1], j1 = /* @__PURE__ */ Z1({
  defaultModifiers: X1
}), Dt = {}, J1 = "tippy-box", dg = "tippy-content", ey = "tippy-backdrop", pg = "tippy-arrow", _g = "tippy-svg-arrow", er = {
  passive: !0,
  capture: !0
}, mg = function() {
  return document.body;
};
function ty(t, e) {
  return {}.hasOwnProperty.call(t, e);
}
function ul(t, e, n) {
  if (Array.isArray(t)) {
    var r = t[e];
    return r ?? (Array.isArray(n) ? n[e] : n);
  }
  return t;
}
function hu(t, e) {
  var n = {}.toString.call(t);
  return n.indexOf("[object") === 0 && n.indexOf(e + "]") > -1;
}
function fg(t, e) {
  return typeof t == "function" ? t.apply(void 0, e) : t;
}
function Op(t, e) {
  if (e === 0)
    return t;
  var n;
  return function(r) {
    clearTimeout(n), n = setTimeout(function() {
      t(r);
    }, e);
  };
}
function ny(t, e) {
  var n = Object.assign({}, t);
  return e.forEach(function(r) {
    delete n[r];
  }), n;
}
function ry(t) {
  return t.split(/\s+/).filter(Boolean);
}
function Br(t) {
  return [].concat(t);
}
function Np(t, e) {
  t.indexOf(e) === -1 && t.push(e);
}
function iy(t) {
  return t.filter(function(e, n) {
    return t.indexOf(e) === n;
  });
}
function oy(t) {
  return t.split("-")[0];
}
function ya(t) {
  return [].slice.call(t);
}
function Ap(t) {
  return Object.keys(t).reduce(function(e, n) {
    return t[n] !== void 0 && (e[n] = t[n]), e;
  }, {});
}
function Pi() {
  return document.createElement("div");
}
function eo(t) {
  return ["Element", "Fragment"].some(function(e) {
    return hu(t, e);
  });
}
function ay(t) {
  return hu(t, "NodeList");
}
function sy(t) {
  return hu(t, "MouseEvent");
}
function ly(t) {
  return !!(t && t._tippy && t._tippy.reference === t);
}
function cy(t) {
  return eo(t) ? [t] : ay(t) ? ya(t) : Array.isArray(t) ? t : ya(document.querySelectorAll(t));
}
function dl(t, e) {
  t.forEach(function(n) {
    n && (n.style.transitionDuration = e + "ms");
  });
}
function Ip(t, e) {
  t.forEach(function(n) {
    n && n.setAttribute("data-state", e);
  });
}
function uy(t) {
  var e, n = Br(t), r = n[0];
  return r != null && (e = r.ownerDocument) != null && e.body ? r.ownerDocument : document;
}
function dy(t, e) {
  var n = e.clientX, r = e.clientY;
  return t.every(function(i) {
    var o = i.popperRect, a = i.popperState, s = i.props, l = s.interactiveBorder, c = oy(a.placement), u = a.modifiersData.offset;
    if (!u)
      return !0;
    var d = c === "bottom" ? u.top.y : 0, p = c === "top" ? u.bottom.y : 0, _ = c === "right" ? u.left.x : 0, m = c === "left" ? u.right.x : 0, f = o.top - r + d > l, g = r - o.bottom - p > l, S = o.left - n + _ > l, E = n - o.right - m > l;
    return f || g || S || E;
  });
}
function pl(t, e, n) {
  var r = e + "EventListener";
  ["transitionend", "webkitTransitionEnd"].forEach(function(i) {
    t[r](i, n);
  });
}
function xp(t, e) {
  for (var n = e; n; ) {
    var r;
    if (t.contains(n))
      return !0;
    n = n.getRootNode == null || (r = n.getRootNode()) == null ? void 0 : r.host;
  }
  return !1;
}
var Qt = {
  isTouch: !1
}, Dp = 0;
function py() {
  Qt.isTouch || (Qt.isTouch = !0, window.performance && document.addEventListener("mousemove", gg));
}
function gg() {
  var t = performance.now();
  t - Dp < 20 && (Qt.isTouch = !1, document.removeEventListener("mousemove", gg)), Dp = t;
}
function _y() {
  var t = document.activeElement;
  if (ly(t)) {
    var e = t._tippy;
    t.blur && !e.state.isVisible && t.blur();
  }
}
function my() {
  document.addEventListener("touchstart", py, er), window.addEventListener("blur", _y);
}
var fy = typeof window < "u" && typeof document < "u", gy = fy ? (
  // @ts-ignore
  !!window.msCrypto
) : !1;
function xr(t) {
  var e = t === "destroy" ? "n already-" : " ";
  return [t + "() was called on a" + e + "destroyed instance. This is a no-op but", "indicates a potential memory leak."].join(" ");
}
function wp(t) {
  var e = /[ \t]{2,}/g, n = /^[ \t]*/gm;
  return t.replace(e, " ").replace(n, "").trim();
}
function hy(t) {
  return wp(`
  %ctippy.js

  %c` + wp(t) + `

  %c👷‍ This is a development-only message. It will be removed in production.
  `);
}
function hg(t) {
  return [
    hy(t),
    // title
    "color: #00C584; font-size: 1.3em; font-weight: bold;",
    // message
    "line-height: 1.5",
    // footer
    "color: #a6a095;"
  ];
}
var to;
Dt.NODE_ENV !== "production" && Ey();
function Ey() {
  to = /* @__PURE__ */ new Set();
}
function mn(t, e) {
  if (t && !to.has(e)) {
    var n;
    to.add(e), (n = console).warn.apply(n, hg(e));
  }
}
function gc(t, e) {
  if (t && !to.has(e)) {
    var n;
    to.add(e), (n = console).error.apply(n, hg(e));
  }
}
function Sy(t) {
  var e = !t, n = Object.prototype.toString.call(t) === "[object Object]" && !t.addEventListener;
  gc(e, ["tippy() was passed", "`" + String(t) + "`", "as its targets (first) argument. Valid types are: String, Element,", "Element[], or NodeList."].join(" ")), gc(n, ["tippy() was passed a plain object which is not supported as an argument", "for virtual positioning. Use props.getReferenceClientRect instead."].join(" "));
}
var Eg = {
  animateFill: !1,
  followCursor: !1,
  inlinePositioning: !1,
  sticky: !1
}, by = {
  allowHTML: !1,
  animation: "fade",
  arrow: !0,
  content: "",
  inertia: !1,
  maxWidth: 350,
  role: "tooltip",
  theme: "",
  zIndex: 9999
}, vt = Object.assign({
  appendTo: mg,
  aria: {
    content: "auto",
    expanded: "auto"
  },
  delay: 0,
  duration: [300, 250],
  getReferenceClientRect: null,
  hideOnClick: !0,
  ignoreAttributes: !1,
  interactive: !1,
  interactiveBorder: 2,
  interactiveDebounce: 0,
  moveTransition: "",
  offset: [0, 10],
  onAfterUpdate: function() {
  },
  onBeforeUpdate: function() {
  },
  onCreate: function() {
  },
  onDestroy: function() {
  },
  onHidden: function() {
  },
  onHide: function() {
  },
  onMount: function() {
  },
  onShow: function() {
  },
  onShown: function() {
  },
  onTrigger: function() {
  },
  onUntrigger: function() {
  },
  onClickOutside: function() {
  },
  placement: "top",
  plugins: [],
  popperOptions: {},
  render: null,
  showOnCreate: !1,
  touch: !0,
  trigger: "mouseenter focus",
  triggerTarget: null
}, Eg, by), Ty = Object.keys(vt), Cy = function(e) {
  Dt.NODE_ENV !== "production" && bg(e, []);
  var n = Object.keys(e);
  n.forEach(function(r) {
    vt[r] = e[r];
  });
};
function Sg(t) {
  var e = t.plugins || [], n = e.reduce(function(r, i) {
    var o = i.name, a = i.defaultValue;
    if (o) {
      var s;
      r[o] = t[o] !== void 0 ? t[o] : (s = vt[o]) != null ? s : a;
    }
    return r;
  }, {});
  return Object.assign({}, t, n);
}
function yy(t, e) {
  var n = e ? Object.keys(Sg(Object.assign({}, vt, {
    plugins: e
  }))) : Ty, r = n.reduce(function(i, o) {
    var a = (t.getAttribute("data-tippy-" + o) || "").trim();
    if (!a)
      return i;
    if (o === "content")
      i[o] = a;
    else
      try {
        i[o] = JSON.parse(a);
      } catch {
        i[o] = a;
      }
    return i;
  }, {});
  return r;
}
function Mp(t, e) {
  var n = Object.assign({}, e, {
    content: fg(e.content, [t])
  }, e.ignoreAttributes ? {} : yy(t, e.plugins));
  return n.aria = Object.assign({}, vt.aria, n.aria), n.aria = {
    expanded: n.aria.expanded === "auto" ? e.interactive : n.aria.expanded,
    content: n.aria.content === "auto" ? e.interactive ? null : "describedby" : n.aria.content
  }, n;
}
function bg(t, e) {
  t === void 0 && (t = {}), e === void 0 && (e = []);
  var n = Object.keys(t);
  n.forEach(function(r) {
    var i = ny(vt, Object.keys(Eg)), o = !ty(i, r);
    o && (o = e.filter(function(a) {
      return a.name === r;
    }).length === 0), mn(o, ["`" + r + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", "a plugin, forgot to pass it in an array as props.plugins.", `

`, `All props: https://atomiks.github.io/tippyjs/v6/all-props/
`, "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "));
  });
}
var vy = function() {
  return "innerHTML";
};
function hc(t, e) {
  t[vy()] = e;
}
function Lp(t) {
  var e = Pi();
  return t === !0 ? e.className = pg : (e.className = _g, eo(t) ? e.appendChild(t) : hc(e, t)), e;
}
function kp(t, e) {
  eo(e.content) ? (hc(t, ""), t.appendChild(e.content)) : typeof e.content != "function" && (e.allowHTML ? hc(t, e.content) : t.textContent = e.content);
}
function Ec(t) {
  var e = t.firstElementChild, n = ya(e.children);
  return {
    box: e,
    content: n.find(function(r) {
      return r.classList.contains(dg);
    }),
    arrow: n.find(function(r) {
      return r.classList.contains(pg) || r.classList.contains(_g);
    }),
    backdrop: n.find(function(r) {
      return r.classList.contains(ey);
    })
  };
}
function Tg(t) {
  var e = Pi(), n = Pi();
  n.className = J1, n.setAttribute("data-state", "hidden"), n.setAttribute("tabindex", "-1");
  var r = Pi();
  r.className = dg, r.setAttribute("data-state", "hidden"), kp(r, t.props), e.appendChild(n), n.appendChild(r), i(t.props, t.props);
  function i(o, a) {
    var s = Ec(e), l = s.box, c = s.content, u = s.arrow;
    a.theme ? l.setAttribute("data-theme", a.theme) : l.removeAttribute("data-theme"), typeof a.animation == "string" ? l.setAttribute("data-animation", a.animation) : l.removeAttribute("data-animation"), a.inertia ? l.setAttribute("data-inertia", "") : l.removeAttribute("data-inertia"), l.style.maxWidth = typeof a.maxWidth == "number" ? a.maxWidth + "px" : a.maxWidth, a.role ? l.setAttribute("role", a.role) : l.removeAttribute("role"), (o.content !== a.content || o.allowHTML !== a.allowHTML) && kp(c, t.props), a.arrow ? u ? o.arrow !== a.arrow && (l.removeChild(u), l.appendChild(Lp(a.arrow))) : l.appendChild(Lp(a.arrow)) : u && l.removeChild(u);
  }
  return {
    popper: e,
    onUpdate: i
  };
}
Tg.$$tippy = !0;
var Ry = 1, Fo = [], _l = [];
function Oy(t, e) {
  var n = Mp(t, Object.assign({}, vt, Sg(Ap(e)))), r, i, o, a = !1, s = !1, l = !1, c = !1, u, d, p, _ = [], m = Op(ct, n.interactiveDebounce), f, g = Ry++, S = null, E = iy(n.plugins), b = {
    // Is the instance currently enabled?
    isEnabled: !0,
    // Is the tippy currently showing and not transitioning out?
    isVisible: !1,
    // Has the instance been destroyed?
    isDestroyed: !1,
    // Is the tippy currently mounted to the DOM?
    isMounted: !1,
    // Has the tippy finished transitioning in?
    isShown: !1
  }, h = {
    // properties
    id: g,
    reference: t,
    popper: Pi(),
    popperInstance: S,
    props: n,
    state: b,
    plugins: E,
    // methods
    clearDelayTimeouts: U,
    setProps: A,
    setContent: k,
    show: G,
    hide: re,
    hideWithInteractivity: Ce,
    enable: Ge,
    disable: Tt,
    unmount: mt,
    destroy: Or
  };
  if (!n.render)
    return Dt.NODE_ENV !== "production" && gc(!0, "render() function has not been supplied."), h;
  var T = n.render(h), C = T.popper, v = T.onUpdate;
  C.setAttribute("data-tippy-root", ""), C.id = "tippy-" + h.id, h.popper = C, t._tippy = h, C._tippy = h;
  var I = E.map(function(D) {
    return D.fn(h);
  }), N = t.hasAttribute("aria-expanded");
  return st(), B(), y(), R("onCreate", [h]), n.showOnCreate && _e(), C.addEventListener("mouseenter", function() {
    h.props.interactive && h.state.isVisible && h.clearDelayTimeouts();
  }), C.addEventListener("mouseleave", function() {
    h.props.interactive && h.props.trigger.indexOf("mouseenter") >= 0 && q().addEventListener("mousemove", m);
  }), h;
  function x() {
    var D = h.props.touch;
    return Array.isArray(D) ? D : [D, 0];
  }
  function P() {
    return x()[0] === "hold";
  }
  function Y() {
    var D;
    return !!((D = h.props.render) != null && D.$$tippy);
  }
  function Z() {
    return f || t;
  }
  function q() {
    var D = Z().parentNode;
    return D ? uy(D) : document;
  }
  function V() {
    return Ec(C);
  }
  function O(D) {
    return h.state.isMounted && !h.state.isVisible || Qt.isTouch || u && u.type === "focus" ? 0 : ul(h.props.delay, D ? 0 : 1, vt.delay);
  }
  function y(D) {
    D === void 0 && (D = !1), C.style.pointerEvents = h.props.interactive && !D ? "" : "none", C.style.zIndex = "" + h.props.zIndex;
  }
  function R(D, W, ie) {
    if (ie === void 0 && (ie = !0), I.forEach(function(ge) {
      ge[D] && ge[D].apply(ge, W);
    }), ie) {
      var be;
      (be = h.props)[D].apply(be, W);
    }
  }
  function w() {
    var D = h.props.aria;
    if (D.content) {
      var W = "aria-" + D.content, ie = C.id, be = Br(h.props.triggerTarget || t);
      be.forEach(function(ge) {
        var tt = ge.getAttribute(W);
        if (h.state.isVisible)
          ge.setAttribute(W, tt ? tt + " " + ie : ie);
        else {
          var Ct = tt && tt.replace(ie, "").trim();
          Ct ? ge.setAttribute(W, Ct) : ge.removeAttribute(W);
        }
      });
    }
  }
  function B() {
    if (!(N || !h.props.aria.expanded)) {
      var D = Br(h.props.triggerTarget || t);
      D.forEach(function(W) {
        h.props.interactive ? W.setAttribute("aria-expanded", h.state.isVisible && W === Z() ? "true" : "false") : W.removeAttribute("aria-expanded");
      });
    }
  }
  function $() {
    q().removeEventListener("mousemove", m), Fo = Fo.filter(function(D) {
      return D !== m;
    });
  }
  function X(D) {
    if (!(Qt.isTouch && (l || D.type === "mousedown"))) {
      var W = D.composedPath && D.composedPath()[0] || D.target;
      if (!(h.props.interactive && xp(C, W))) {
        if (Br(h.props.triggerTarget || t).some(function(ie) {
          return xp(ie, W);
        })) {
          if (Qt.isTouch || h.state.isVisible && h.props.trigger.indexOf("click") >= 0)
            return;
        } else
          R("onClickOutside", [h, D]);
        h.props.hideOnClick === !0 && (h.clearDelayTimeouts(), h.hide(), s = !0, setTimeout(function() {
          s = !1;
        }), h.state.isMounted || he());
      }
    }
  }
  function de() {
    l = !0;
  }
  function pe() {
    l = !1;
  }
  function le() {
    var D = q();
    D.addEventListener("mousedown", X, !0), D.addEventListener("touchend", X, er), D.addEventListener("touchstart", pe, er), D.addEventListener("touchmove", de, er);
  }
  function he() {
    var D = q();
    D.removeEventListener("mousedown", X, !0), D.removeEventListener("touchend", X, er), D.removeEventListener("touchstart", pe, er), D.removeEventListener("touchmove", de, er);
  }
  function We(D, W) {
    et(D, function() {
      !h.state.isVisible && C.parentNode && C.parentNode.contains(C) && W();
    });
  }
  function De(D, W) {
    et(D, W);
  }
  function et(D, W) {
    var ie = V().box;
    function be(ge) {
      ge.target === ie && (pl(ie, "remove", be), W());
    }
    if (D === 0)
      return W();
    pl(ie, "remove", d), pl(ie, "add", be), d = be;
  }
  function Ke(D, W, ie) {
    ie === void 0 && (ie = !1);
    var be = Br(h.props.triggerTarget || t);
    be.forEach(function(ge) {
      ge.addEventListener(D, W, ie), _.push({
        node: ge,
        eventType: D,
        handler: W,
        options: ie
      });
    });
  }
  function st() {
    P() && (Ke("touchstart", lt, {
      passive: !0
    }), Ke("touchend", Pe, {
      passive: !0
    })), ry(h.props.trigger).forEach(function(D) {
      if (D !== "manual")
        switch (Ke(D, lt), D) {
          case "mouseenter":
            Ke("mouseleave", Pe);
            break;
          case "focus":
            Ke(gy ? "focusout" : "blur", ae);
            break;
          case "focusin":
            Ke("focusout", ae);
            break;
        }
    });
  }
  function Ut() {
    _.forEach(function(D) {
      var W = D.node, ie = D.eventType, be = D.handler, ge = D.options;
      W.removeEventListener(ie, be, ge);
    }), _ = [];
  }
  function lt(D) {
    var W, ie = !1;
    if (!(!h.state.isEnabled || Qe(D) || s)) {
      var be = ((W = u) == null ? void 0 : W.type) === "focus";
      u = D, f = D.currentTarget, B(), !h.state.isVisible && sy(D) && Fo.forEach(function(ge) {
        return ge(D);
      }), D.type === "click" && (h.props.trigger.indexOf("mouseenter") < 0 || a) && h.props.hideOnClick !== !1 && h.state.isVisible ? ie = !0 : _e(D), D.type === "click" && (a = !ie), ie && !be && Fe(D);
    }
  }
  function ct(D) {
    var W = D.target, ie = Z().contains(W) || C.contains(W);
    if (!(D.type === "mousemove" && ie)) {
      var be = J().concat(C).map(function(ge) {
        var tt, Ct = ge._tippy, Zn = (tt = Ct.popperInstance) == null ? void 0 : tt.state;
        return Zn ? {
          popperRect: ge.getBoundingClientRect(),
          popperState: Zn,
          props: n
        } : null;
      }).filter(Boolean);
      dy(be, D) && ($(), Fe(D));
    }
  }
  function Pe(D) {
    var W = Qe(D) || h.props.trigger.indexOf("click") >= 0 && a;
    if (!W) {
      if (h.props.interactive) {
        h.hideWithInteractivity(D);
        return;
      }
      Fe(D);
    }
  }
  function ae(D) {
    h.props.trigger.indexOf("focusin") < 0 && D.target !== Z() || h.props.interactive && D.relatedTarget && C.contains(D.relatedTarget) || Fe(D);
  }
  function Qe(D) {
    return Qt.isTouch ? P() !== D.type.indexOf("touch") >= 0 : !1;
  }
  function Q() {
    j();
    var D = h.props, W = D.popperOptions, ie = D.placement, be = D.offset, ge = D.getReferenceClientRect, tt = D.moveTransition, Ct = Y() ? Ec(C).arrow : null, Zn = ge ? {
      getBoundingClientRect: ge,
      contextElement: ge.contextElement || Z()
    } : t, $s = {
      name: "$$tippy",
      enabled: !0,
      phase: "beforeWrite",
      requires: ["computeStyles"],
      fn: function(fi) {
        var Xn = fi.state;
        if (Y()) {
          var Ju = V(), No = Ju.box;
          ["placement", "reference-hidden", "escaped"].forEach(function(gi) {
            gi === "placement" ? No.setAttribute("data-placement", Xn.placement) : Xn.attributes.popper["data-popper-" + gi] ? No.setAttribute("data-" + gi, "") : No.removeAttribute("data-" + gi);
          }), Xn.attributes.popper = {};
        }
      }
    }, Tn = [{
      name: "offset",
      options: {
        offset: be
      }
    }, {
      name: "preventOverflow",
      options: {
        padding: {
          top: 2,
          bottom: 2,
          left: 5,
          right: 5
        }
      }
    }, {
      name: "flip",
      options: {
        padding: 5
      }
    }, {
      name: "computeStyles",
      options: {
        adaptive: !tt
      }
    }, $s];
    Y() && Ct && Tn.push({
      name: "arrow",
      options: {
        element: Ct,
        padding: 3
      }
    }), Tn.push.apply(Tn, (W == null ? void 0 : W.modifiers) || []), h.popperInstance = j1(Zn, C, Object.assign({}, W, {
      placement: ie,
      onFirstUpdate: p,
      modifiers: Tn
    }));
  }
  function j() {
    h.popperInstance && (h.popperInstance.destroy(), h.popperInstance = null);
  }
  function Ee() {
    var D = h.props.appendTo, W, ie = Z();
    h.props.interactive && D === mg || D === "parent" ? W = ie.parentNode : W = fg(D, [ie]), W.contains(C) || W.appendChild(C), h.state.isMounted = !0, Q(), Dt.NODE_ENV !== "production" && mn(h.props.interactive && D === vt.appendTo && ie.nextElementSibling !== C, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", `

`, "Using a wrapper <div> or <span> tag around the reference element", "solves this by creating a new parentNode context.", `

`, "Specifying `appendTo: document.body` silences this warning, but it", "assumes you are using a focus management solution to handle", "keyboard navigation.", `

`, "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "));
  }
  function J() {
    return ya(C.querySelectorAll("[data-tippy-root]"));
  }
  function _e(D) {
    h.clearDelayTimeouts(), D && R("onTrigger", [h, D]), le();
    var W = O(!0), ie = x(), be = ie[0], ge = ie[1];
    Qt.isTouch && be === "hold" && ge && (W = ge), W ? r = setTimeout(function() {
      h.show();
    }, W) : h.show();
  }
  function Fe(D) {
    if (h.clearDelayTimeouts(), R("onUntrigger", [h, D]), !h.state.isVisible) {
      he();
      return;
    }
    if (!(h.props.trigger.indexOf("mouseenter") >= 0 && h.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(D.type) >= 0 && a)) {
      var W = O(!1);
      W ? i = setTimeout(function() {
        h.state.isVisible && h.hide();
      }, W) : o = requestAnimationFrame(function() {
        h.hide();
      });
    }
  }
  function Ge() {
    h.state.isEnabled = !0;
  }
  function Tt() {
    h.hide(), h.state.isEnabled = !1;
  }
  function U() {
    clearTimeout(r), clearTimeout(i), cancelAnimationFrame(o);
  }
  function A(D) {
    if (Dt.NODE_ENV !== "production" && mn(h.state.isDestroyed, xr("setProps")), !h.state.isDestroyed) {
      R("onBeforeUpdate", [h, D]), Ut();
      var W = h.props, ie = Mp(t, Object.assign({}, W, Ap(D), {
        ignoreAttributes: !0
      }));
      h.props = ie, st(), W.interactiveDebounce !== ie.interactiveDebounce && ($(), m = Op(ct, ie.interactiveDebounce)), W.triggerTarget && !ie.triggerTarget ? Br(W.triggerTarget).forEach(function(be) {
        be.removeAttribute("aria-expanded");
      }) : ie.triggerTarget && t.removeAttribute("aria-expanded"), B(), y(), v && v(W, ie), h.popperInstance && (Q(), J().forEach(function(be) {
        requestAnimationFrame(be._tippy.popperInstance.forceUpdate);
      })), R("onAfterUpdate", [h, D]);
    }
  }
  function k(D) {
    h.setProps({
      content: D
    });
  }
  function G() {
    Dt.NODE_ENV !== "production" && mn(h.state.isDestroyed, xr("show"));
    var D = h.state.isVisible, W = h.state.isDestroyed, ie = !h.state.isEnabled, be = Qt.isTouch && !h.props.touch, ge = ul(h.props.duration, 0, vt.duration);
    if (!(D || W || ie || be) && !Z().hasAttribute("disabled") && (R("onShow", [h], !1), h.props.onShow(h) !== !1)) {
      if (h.state.isVisible = !0, Y() && (C.style.visibility = "visible"), y(), le(), h.state.isMounted || (C.style.transition = "none"), Y()) {
        var tt = V(), Ct = tt.box, Zn = tt.content;
        dl([Ct, Zn], 0);
      }
      p = function() {
        var Tn;
        if (!(!h.state.isVisible || c)) {
          if (c = !0, C.offsetHeight, C.style.transition = h.props.moveTransition, Y() && h.props.animation) {
            var Oo = V(), fi = Oo.box, Xn = Oo.content;
            dl([fi, Xn], ge), Ip([fi, Xn], "visible");
          }
          w(), B(), Np(_l, h), (Tn = h.popperInstance) == null || Tn.forceUpdate(), R("onMount", [h]), h.props.animation && Y() && De(ge, function() {
            h.state.isShown = !0, R("onShown", [h]);
          });
        }
      }, Ee();
    }
  }
  function re() {
    Dt.NODE_ENV !== "production" && mn(h.state.isDestroyed, xr("hide"));
    var D = !h.state.isVisible, W = h.state.isDestroyed, ie = !h.state.isEnabled, be = ul(h.props.duration, 1, vt.duration);
    if (!(D || W || ie) && (R("onHide", [h], !1), h.props.onHide(h) !== !1)) {
      if (h.state.isVisible = !1, h.state.isShown = !1, c = !1, a = !1, Y() && (C.style.visibility = "hidden"), $(), he(), y(!0), Y()) {
        var ge = V(), tt = ge.box, Ct = ge.content;
        h.props.animation && (dl([tt, Ct], be), Ip([tt, Ct], "hidden"));
      }
      w(), B(), h.props.animation ? Y() && We(be, h.unmount) : h.unmount();
    }
  }
  function Ce(D) {
    Dt.NODE_ENV !== "production" && mn(h.state.isDestroyed, xr("hideWithInteractivity")), q().addEventListener("mousemove", m), Np(Fo, m), m(D);
  }
  function mt() {
    Dt.NODE_ENV !== "production" && mn(h.state.isDestroyed, xr("unmount")), h.state.isVisible && h.hide(), h.state.isMounted && (j(), J().forEach(function(D) {
      D._tippy.unmount();
    }), C.parentNode && C.parentNode.removeChild(C), _l = _l.filter(function(D) {
      return D !== h;
    }), h.state.isMounted = !1, R("onHidden", [h]));
  }
  function Or() {
    Dt.NODE_ENV !== "production" && mn(h.state.isDestroyed, xr("destroy")), !h.state.isDestroyed && (h.clearDelayTimeouts(), h.unmount(), Ut(), delete t._tippy, h.state.isDestroyed = !0, R("onDestroy", [h]));
  }
}
function Me(t, e) {
  e === void 0 && (e = {});
  var n = vt.plugins.concat(e.plugins || []);
  Dt.NODE_ENV !== "production" && (Sy(t), bg(e, n)), my();
  var r = Object.assign({}, e, {
    plugins: n
  }), i = cy(t);
  if (Dt.NODE_ENV !== "production") {
    var o = eo(r.content), a = i.length > 1;
    mn(o && a, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", `

`, "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", `

`, `1) content: element.innerHTML
`, "2) content: () => element.cloneNode(true)"].join(" "));
  }
  var s = i.reduce(function(l, c) {
    var u = c && Oy(c, r);
    return u && l.push(u), l;
  }, []);
  return eo(t) ? s[0] : s;
}
Me.defaultProps = vt;
Me.setDefaultProps = Cy;
Me.currentInput = Qt;
Object.assign({}, rg, {
  effect: function(e) {
    var n = e.state, r = {
      popper: {
        position: n.options.strategy,
        left: "0",
        top: "0",
        margin: "0"
      },
      arrow: {
        position: "absolute"
      },
      reference: {}
    };
    Object.assign(n.elements.popper.style, r.popper), n.styles = r, n.elements.arrow && Object.assign(n.elements.arrow.style, r.arrow);
  }
});
Me.setDefaultProps({
  render: Tg
});
class pi extends fe {
  constructor() {
    super(...arguments);
    M(this, "tippyInstance");
    M(this, "tippyEl");
    M(this, "textEl");
    M(this, "menuData", []);
    M(this, "menuTextWidth", "fit-content");
    M(this, "defaultMenuIndex", 0);
    M(this, "refreshMenuText", !0);
    M(this, "width", "fit-content");
    M(this, "dropDivWith", "fit-content");
    M(this, "dropDivHeight", "fit-content");
    M(this, "showItemsTip", !1);
  }
  renderTemplate() {
    this.template = `
         <div>
         <div style="display: flex;align-items: center;padding: 0 4px;" id="tippy">
             <span style="display:flex;text-align:center;overflow: hidden;" id="text">
                ${this.onMenuTextRender(this.defaultMenuIndex)}
             </span>
             <div style="display: flex;justify-content: center;align-items: center;">
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                    <path fill="none" d="M0 0h24v24H0z"></path><path d="M12 14L8 10H16L12 14Z"></path>
                </svg>
             </div>
         </div>
         </div>
        `;
  }
  connectedCallback() {
    this.renderTemplate(), super.connectedCallback(), this.textEl = this.querySelector("#text"), this.tippyInstance = Me(this.querySelector("#tippy"), {
      content: this.createMenuElement(),
      appendTo: this.closest(".linwiteditor-container"),
      placement: "bottom",
      trigger: "click",
      interactive: !0,
      arrow: !1
    });
  }
  createMenuElement() {
    const n = document.createElement("div");
    n.style.height = this.dropDivHeight, n.style.width = this.dropDivWith, n.classList.add("linwiteditor-dropdown-container");
    for (let r = 0; r < this.menuData.length; r++) {
      const i = document.createElement("div");
      if (i.classList.add("linwiteditor-dropdown-item"), i.innerHTML = `
            <div class="red-dot-container" id="item${r}">
                <div class="${r == this.defaultMenuIndex ? "red-dot" : ""}"></div>
            </div>
            <div class="text">${this.onDropdownItemRender(r)}</div>
            `, i.addEventListener("click", (o) => {
        const a = this.menuData[r];
        a.onClick ? a.onClick(o, this.editor.linwitDocEditor) && this.tippyInstance.hide() : (this.onDropdownItemClick(r), this.tippyInstance.hide());
      }), this.showItemsTip) {
        const o = this.menuData[r];
        Me(i, {
          appendTo: () => this.closest(".linwiteditor-container"),
          content: o.tip || o.title,
          theme: "aietip",
          arrow: !0,
          placement: "right"
        });
      }
      n.appendChild(i);
    }
    return this.tippyEl = n, n;
  }
  onTransaction(n) {
    var o, a;
    const r = (o = this.tippyEl) == null ? void 0 : o.querySelector(".red-dot");
    r && r.classList.remove("red-dot");
    let i = this.defaultMenuIndex;
    for (let s = 0; s < this.menuData.length; s++)
      if (this.onDropdownActive(n.editor, s)) {
        i = s;
        break;
      }
    if ((a = this.tippyEl) == null || a.querySelector(`#item${i}`).children[0].classList.add("red-dot"), this.refreshMenuText && this.textEl) {
      const s = this.onMenuTextRender(i);
      typeof s == "string" ? this.textEl.innerHTML = s : (this.textEl.removeChild(this.textEl.firstChild), this.textEl.appendChild(s));
    }
  }
}
const se = (t) => typeof t == "string", Si = () => {
  let t, e;
  const n = new Promise((r, i) => {
    t = r, e = i;
  });
  return n.resolve = t, n.reject = e, n;
}, Pp = (t) => t == null ? "" : "" + t, Ny = (t, e, n) => {
  t.forEach((r) => {
    e[r] && (n[r] = e[r]);
  });
}, Ay = /###/g, Fp = (t) => t && t.indexOf("###") > -1 ? t.replace(Ay, ".") : t, Bp = (t) => !t || se(t), Fi = (t, e, n) => {
  const r = se(e) ? e.split(".") : e;
  let i = 0;
  for (; i < r.length - 1; ) {
    if (Bp(t)) return {};
    const o = Fp(r[i]);
    !t[o] && n && (t[o] = new n()), Object.prototype.hasOwnProperty.call(t, o) ? t = t[o] : t = {}, ++i;
  }
  return Bp(t) ? {} : {
    obj: t,
    k: Fp(r[i])
  };
}, Up = (t, e, n) => {
  const {
    obj: r,
    k: i
  } = Fi(t, e, Object);
  if (r !== void 0 || e.length === 1) {
    r[i] = n;
    return;
  }
  let o = e[e.length - 1], a = e.slice(0, e.length - 1), s = Fi(t, a, Object);
  for (; s.obj === void 0 && a.length; )
    o = `${a[a.length - 1]}.${o}`, a = a.slice(0, a.length - 1), s = Fi(t, a, Object), s && s.obj && typeof s.obj[`${s.k}.${o}`] < "u" && (s.obj = void 0);
  s.obj[`${s.k}.${o}`] = n;
}, Iy = (t, e, n, r) => {
  const {
    obj: i,
    k: o
  } = Fi(t, e, Object);
  i[o] = i[o] || [], i[o].push(n);
}, va = (t, e) => {
  const {
    obj: n,
    k: r
  } = Fi(t, e);
  if (n)
    return n[r];
}, xy = (t, e, n) => {
  const r = va(t, n);
  return r !== void 0 ? r : va(e, n);
}, Cg = (t, e, n) => {
  for (const r in e)
    r !== "__proto__" && r !== "constructor" && (r in t ? se(t[r]) || t[r] instanceof String || se(e[r]) || e[r] instanceof String ? n && (t[r] = e[r]) : Cg(t[r], e[r], n) : t[r] = e[r]);
  return t;
}, Dr = (t) => t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
var Dy = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;",
  "/": "&#x2F;"
};
const wy = (t) => se(t) ? t.replace(/[&<>"'\/]/g, (e) => Dy[e]) : t;
class My {
  constructor(e) {
    this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
  }
  getRegExp(e) {
    const n = this.regExpMap.get(e);
    if (n !== void 0)
      return n;
    const r = new RegExp(e);
    return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, r), this.regExpQueue.push(e), r;
  }
}
const Ly = [" ", ",", "?", "!", ";"], ky = new My(20), Py = (t, e, n) => {
  e = e || "", n = n || "";
  const r = Ly.filter((a) => e.indexOf(a) < 0 && n.indexOf(a) < 0);
  if (r.length === 0) return !0;
  const i = ky.getRegExp(`(${r.map((a) => a === "?" ? "\\?" : a).join("|")})`);
  let o = !i.test(t);
  if (!o) {
    const a = t.indexOf(n);
    a > 0 && !i.test(t.substring(0, a)) && (o = !0);
  }
  return o;
}, Sc = function(t, e) {
  let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ".";
  if (!t) return;
  if (t[e]) return t[e];
  const r = e.split(n);
  let i = t;
  for (let o = 0; o < r.length; ) {
    if (!i || typeof i != "object")
      return;
    let a, s = "";
    for (let l = o; l < r.length; ++l)
      if (l !== o && (s += n), s += r[l], a = i[s], a !== void 0) {
        if (["string", "number", "boolean"].indexOf(typeof a) > -1 && l < r.length - 1)
          continue;
        o += l - o + 1;
        break;
      }
    i = a;
  }
  return i;
}, Ra = (t) => t && t.replace("_", "-"), Fy = {
  type: "logger",
  log(t) {
    this.output("log", t);
  },
  warn(t) {
    this.output("warn", t);
  },
  error(t) {
    this.output("error", t);
  },
  output(t, e) {
    console && console[t] && console[t].apply(console, e);
  }
};
class Oa {
  constructor(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    this.init(e, n);
  }
  init(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    this.prefix = n.prefix || "i18next:", this.logger = e || Fy, this.options = n, this.debug = n.debug;
  }
  log() {
    for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
      n[r] = arguments[r];
    return this.forward(n, "log", "", !0);
  }
  warn() {
    for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
      n[r] = arguments[r];
    return this.forward(n, "warn", "", !0);
  }
  error() {
    for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
      n[r] = arguments[r];
    return this.forward(n, "error", "");
  }
  deprecate() {
    for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
      n[r] = arguments[r];
    return this.forward(n, "warn", "WARNING DEPRECATED: ", !0);
  }
  forward(e, n, r, i) {
    return i && !this.debug ? null : (se(e[0]) && (e[0] = `${r}${this.prefix} ${e[0]}`), this.logger[n](e));
  }
  create(e) {
    return new Oa(this.logger, {
      prefix: `${this.prefix}:${e}:`,
      ...this.options
    });
  }
  clone(e) {
    return e = e || this.options, e.prefix = e.prefix || this.prefix, new Oa(this.logger, e);
  }
}
var Xt = new Oa();
class xs {
  constructor() {
    this.observers = {};
  }
  on(e, n) {
    return e.split(" ").forEach((r) => {
      this.observers[r] || (this.observers[r] = /* @__PURE__ */ new Map());
      const i = this.observers[r].get(n) || 0;
      this.observers[r].set(n, i + 1);
    }), this;
  }
  off(e, n) {
    if (this.observers[e]) {
      if (!n) {
        delete this.observers[e];
        return;
      }
      this.observers[e].delete(n);
    }
  }
  emit(e) {
    for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++)
      r[i - 1] = arguments[i];
    this.observers[e] && Array.from(this.observers[e].entries()).forEach((a) => {
      let [s, l] = a;
      for (let c = 0; c < l; c++)
        s(...r);
    }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach((a) => {
      let [s, l] = a;
      for (let c = 0; c < l; c++)
        s.apply(s, [e, ...r]);
    });
  }
}
class Hp extends xs {
  constructor(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
      ns: ["translation"],
      defaultNS: "translation"
    };
    super(), this.data = e || {}, this.options = n, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
  }
  addNamespaces(e) {
    this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
  }
  removeNamespaces(e) {
    const n = this.options.ns.indexOf(e);
    n > -1 && this.options.ns.splice(n, 1);
  }
  getResource(e, n, r) {
    let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
    const o = i.keySeparator !== void 0 ? i.keySeparator : this.options.keySeparator, a = i.ignoreJSONStructure !== void 0 ? i.ignoreJSONStructure : this.options.ignoreJSONStructure;
    let s;
    e.indexOf(".") > -1 ? s = e.split(".") : (s = [e, n], r && (Array.isArray(r) ? s.push(...r) : se(r) && o ? s.push(...r.split(o)) : s.push(r)));
    const l = va(this.data, s);
    return !l && !n && !r && e.indexOf(".") > -1 && (e = s[0], n = s[1], r = s.slice(2).join(".")), l || !a || !se(r) ? l : Sc(this.data && this.data[e] && this.data[e][n], r, o);
  }
  addResource(e, n, r, i) {
    let o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : {
      silent: !1
    };
    const a = o.keySeparator !== void 0 ? o.keySeparator : this.options.keySeparator;
    let s = [e, n];
    r && (s = s.concat(a ? r.split(a) : r)), e.indexOf(".") > -1 && (s = e.split("."), i = n, n = s[1]), this.addNamespaces(n), Up(this.data, s, i), o.silent || this.emit("added", e, n, r, i);
  }
  addResources(e, n, r) {
    let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {
      silent: !1
    };
    for (const o in r)
      (se(r[o]) || Array.isArray(r[o])) && this.addResource(e, n, o, r[o], {
        silent: !0
      });
    i.silent || this.emit("added", e, n, r);
  }
  addResourceBundle(e, n, r, i, o) {
    let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {
      silent: !1,
      skipCopy: !1
    }, s = [e, n];
    e.indexOf(".") > -1 && (s = e.split("."), i = r, r = n, n = s[1]), this.addNamespaces(n);
    let l = va(this.data, s) || {};
    a.skipCopy || (r = JSON.parse(JSON.stringify(r))), i ? Cg(l, r, o) : l = {
      ...l,
      ...r
    }, Up(this.data, s, l), a.silent || this.emit("added", e, n, r);
  }
  removeResourceBundle(e, n) {
    this.hasResourceBundle(e, n) && delete this.data[e][n], this.removeNamespaces(n), this.emit("removed", e, n);
  }
  hasResourceBundle(e, n) {
    return this.getResource(e, n) !== void 0;
  }
  getResourceBundle(e, n) {
    return n || (n = this.options.defaultNS), this.options.compatibilityAPI === "v1" ? {
      ...this.getResource(e, n)
    } : this.getResource(e, n);
  }
  getDataByLanguage(e) {
    return this.data[e];
  }
  hasLanguageSomeTranslations(e) {
    const n = this.getDataByLanguage(e);
    return !!(n && Object.keys(n) || []).find((i) => n[i] && Object.keys(n[i]).length > 0);
  }
  toJSON() {
    return this.data;
  }
}
var yg = {
  processors: {},
  addPostProcessor(t) {
    this.processors[t.name] = t;
  },
  handle(t, e, n, r, i) {
    return t.forEach((o) => {
      this.processors[o] && (e = this.processors[o].process(e, n, r, i));
    }), e;
  }
};
const Gp = {};
class Na extends xs {
  constructor(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    super(), Ny(["resourceStore", "languageUtils", "pluralResolver", "interpolator", "backendConnector", "i18nFormat", "utils"], e, this), this.options = n, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = Xt.create("translator");
  }
  changeLanguage(e) {
    e && (this.language = e);
  }
  exists(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
      interpolation: {}
    };
    if (e == null)
      return !1;
    const r = this.resolve(e, n);
    return r && r.res !== void 0;
  }
  extractFromKey(e, n) {
    let r = n.nsSeparator !== void 0 ? n.nsSeparator : this.options.nsSeparator;
    r === void 0 && (r = ":");
    const i = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator;
    let o = n.ns || this.options.defaultNS || [];
    const a = r && e.indexOf(r) > -1, s = !this.options.userDefinedKeySeparator && !n.keySeparator && !this.options.userDefinedNsSeparator && !n.nsSeparator && !Py(e, r, i);
    if (a && !s) {
      const l = e.match(this.interpolator.nestingRegexp);
      if (l && l.length > 0)
        return {
          key: e,
          namespaces: se(o) ? [o] : o
        };
      const c = e.split(r);
      (r !== i || r === i && this.options.ns.indexOf(c[0]) > -1) && (o = c.shift()), e = c.join(i);
    }
    return {
      key: e,
      namespaces: se(o) ? [o] : o
    };
  }
  translate(e, n, r) {
    if (typeof n != "object" && this.options.overloadTranslationOptionHandler && (n = this.options.overloadTranslationOptionHandler(arguments)), typeof n == "object" && (n = {
      ...n
    }), n || (n = {}), e == null) return "";
    Array.isArray(e) || (e = [String(e)]);
    const i = n.returnDetails !== void 0 ? n.returnDetails : this.options.returnDetails, o = n.keySeparator !== void 0 ? n.keySeparator : this.options.keySeparator, {
      key: a,
      namespaces: s
    } = this.extractFromKey(e[e.length - 1], n), l = s[s.length - 1], c = n.lng || this.language, u = n.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
    if (c && c.toLowerCase() === "cimode") {
      if (u) {
        const h = n.nsSeparator || this.options.nsSeparator;
        return i ? {
          res: `${l}${h}${a}`,
          usedKey: a,
          exactUsedKey: a,
          usedLng: c,
          usedNS: l,
          usedParams: this.getUsedParamsDetails(n)
        } : `${l}${h}${a}`;
      }
      return i ? {
        res: a,
        usedKey: a,
        exactUsedKey: a,
        usedLng: c,
        usedNS: l,
        usedParams: this.getUsedParamsDetails(n)
      } : a;
    }
    const d = this.resolve(e, n);
    let p = d && d.res;
    const _ = d && d.usedKey || a, m = d && d.exactUsedKey || a, f = Object.prototype.toString.apply(p), g = ["[object Number]", "[object Function]", "[object RegExp]"], S = n.joinArrays !== void 0 ? n.joinArrays : this.options.joinArrays, E = !this.i18nFormat || this.i18nFormat.handleAsObject, b = !se(p) && typeof p != "boolean" && typeof p != "number";
    if (E && p && b && g.indexOf(f) < 0 && !(se(S) && Array.isArray(p))) {
      if (!n.returnObjects && !this.options.returnObjects) {
        this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
        const h = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(_, p, {
          ...n,
          ns: s
        }) : `key '${a} (${this.language})' returned an object instead of string.`;
        return i ? (d.res = h, d.usedParams = this.getUsedParamsDetails(n), d) : h;
      }
      if (o) {
        const h = Array.isArray(p), T = h ? [] : {}, C = h ? m : _;
        for (const v in p)
          if (Object.prototype.hasOwnProperty.call(p, v)) {
            const I = `${C}${o}${v}`;
            T[v] = this.translate(I, {
              ...n,
              joinArrays: !1,
              ns: s
            }), T[v] === I && (T[v] = p[v]);
          }
        p = T;
      }
    } else if (E && se(S) && Array.isArray(p))
      p = p.join(S), p && (p = this.extendTranslation(p, e, n, r));
    else {
      let h = !1, T = !1;
      const C = n.count !== void 0 && !se(n.count), v = Na.hasDefaultValue(n), I = C ? this.pluralResolver.getSuffix(c, n.count, n) : "", N = n.ordinal && C ? this.pluralResolver.getSuffix(c, n.count, {
        ordinal: !1
      }) : "", x = C && !n.ordinal && n.count === 0 && this.pluralResolver.shouldUseIntlApi(), P = x && n[`defaultValue${this.options.pluralSeparator}zero`] || n[`defaultValue${I}`] || n[`defaultValue${N}`] || n.defaultValue;
      !this.isValidLookup(p) && v && (h = !0, p = P), this.isValidLookup(p) || (T = !0, p = a);
      const Z = (n.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && T ? void 0 : p, q = v && P !== p && this.options.updateMissing;
      if (T || h || q) {
        if (this.logger.log(q ? "updateKey" : "missingKey", c, l, a, q ? P : p), o) {
          const R = this.resolve(a, {
            ...n,
            keySeparator: !1
          });
          R && R.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
        }
        let V = [];
        const O = this.languageUtils.getFallbackCodes(this.options.fallbackLng, n.lng || this.language);
        if (this.options.saveMissingTo === "fallback" && O && O[0])
          for (let R = 0; R < O.length; R++)
            V.push(O[R]);
        else this.options.saveMissingTo === "all" ? V = this.languageUtils.toResolveHierarchy(n.lng || this.language) : V.push(n.lng || this.language);
        const y = (R, w, B) => {
          const $ = v && B !== p ? B : Z;
          this.options.missingKeyHandler ? this.options.missingKeyHandler(R, l, w, $, q, n) : this.backendConnector && this.backendConnector.saveMissing && this.backendConnector.saveMissing(R, l, w, $, q, n), this.emit("missingKey", R, l, w, p);
        };
        this.options.saveMissing && (this.options.saveMissingPlurals && C ? V.forEach((R) => {
          const w = this.pluralResolver.getSuffixes(R, n);
          x && n[`defaultValue${this.options.pluralSeparator}zero`] && w.indexOf(`${this.options.pluralSeparator}zero`) < 0 && w.push(`${this.options.pluralSeparator}zero`), w.forEach((B) => {
            y([R], a + B, n[`defaultValue${B}`] || P);
          });
        }) : y(V, a, P));
      }
      p = this.extendTranslation(p, e, n, d, r), T && p === a && this.options.appendNamespaceToMissingKey && (p = `${l}:${a}`), (T || h) && this.options.parseMissingKeyHandler && (this.options.compatibilityAPI !== "v1" ? p = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${l}:${a}` : a, h ? p : void 0) : p = this.options.parseMissingKeyHandler(p));
    }
    return i ? (d.res = p, d.usedParams = this.getUsedParamsDetails(n), d) : p;
  }
  extendTranslation(e, n, r, i, o) {
    var a = this;
    if (this.i18nFormat && this.i18nFormat.parse)
      e = this.i18nFormat.parse(e, {
        ...this.options.interpolation.defaultVariables,
        ...r
      }, r.lng || this.language || i.usedLng, i.usedNS, i.usedKey, {
        resolved: i
      });
    else if (!r.skipInterpolation) {
      r.interpolation && this.interpolator.init({
        ...r,
        interpolation: {
          ...this.options.interpolation,
          ...r.interpolation
        }
      });
      const c = se(e) && (r && r.interpolation && r.interpolation.skipOnVariables !== void 0 ? r.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
      let u;
      if (c) {
        const p = e.match(this.interpolator.nestingRegexp);
        u = p && p.length;
      }
      let d = r.replace && !se(r.replace) ? r.replace : r;
      if (this.options.interpolation.defaultVariables && (d = {
        ...this.options.interpolation.defaultVariables,
        ...d
      }), e = this.interpolator.interpolate(e, d, r.lng || this.language || i.usedLng, r), c) {
        const p = e.match(this.interpolator.nestingRegexp), _ = p && p.length;
        u < _ && (r.nest = !1);
      }
      !r.lng && this.options.compatibilityAPI !== "v1" && i && i.res && (r.lng = this.language || i.usedLng), r.nest !== !1 && (e = this.interpolator.nest(e, function() {
        for (var p = arguments.length, _ = new Array(p), m = 0; m < p; m++)
          _[m] = arguments[m];
        return o && o[0] === _[0] && !r.context ? (a.logger.warn(`It seems you are nesting recursively key: ${_[0]} in key: ${n[0]}`), null) : a.translate(..._, n);
      }, r)), r.interpolation && this.interpolator.reset();
    }
    const s = r.postProcess || this.options.postProcess, l = se(s) ? [s] : s;
    return e != null && l && l.length && r.applyPostProcessor !== !1 && (e = yg.handle(l, e, n, this.options && this.options.postProcessPassResolved ? {
      i18nResolved: {
        ...i,
        usedParams: this.getUsedParamsDetails(r)
      },
      ...r
    } : r, this)), e;
  }
  resolve(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r, i, o, a, s;
    return se(e) && (e = [e]), e.forEach((l) => {
      if (this.isValidLookup(r)) return;
      const c = this.extractFromKey(l, n), u = c.key;
      i = u;
      let d = c.namespaces;
      this.options.fallbackNS && (d = d.concat(this.options.fallbackNS));
      const p = n.count !== void 0 && !se(n.count), _ = p && !n.ordinal && n.count === 0 && this.pluralResolver.shouldUseIntlApi(), m = n.context !== void 0 && (se(n.context) || typeof n.context == "number") && n.context !== "", f = n.lngs ? n.lngs : this.languageUtils.toResolveHierarchy(n.lng || this.language, n.fallbackLng);
      d.forEach((g) => {
        this.isValidLookup(r) || (s = g, !Gp[`${f[0]}-${g}`] && this.utils && this.utils.hasLoadedNamespace && !this.utils.hasLoadedNamespace(s) && (Gp[`${f[0]}-${g}`] = !0, this.logger.warn(`key "${i}" for languages "${f.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), f.forEach((S) => {
          if (this.isValidLookup(r)) return;
          a = S;
          const E = [u];
          if (this.i18nFormat && this.i18nFormat.addLookupKeys)
            this.i18nFormat.addLookupKeys(E, u, S, g, n);
          else {
            let h;
            p && (h = this.pluralResolver.getSuffix(S, n.count, n));
            const T = `${this.options.pluralSeparator}zero`, C = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
            if (p && (E.push(u + h), n.ordinal && h.indexOf(C) === 0 && E.push(u + h.replace(C, this.options.pluralSeparator)), _ && E.push(u + T)), m) {
              const v = `${u}${this.options.contextSeparator}${n.context}`;
              E.push(v), p && (E.push(v + h), n.ordinal && h.indexOf(C) === 0 && E.push(v + h.replace(C, this.options.pluralSeparator)), _ && E.push(v + T));
            }
          }
          let b;
          for (; b = E.pop(); )
            this.isValidLookup(r) || (o = b, r = this.getResource(S, g, b, n));
        }));
      });
    }), {
      res: r,
      usedKey: i,
      exactUsedKey: o,
      usedLng: a,
      usedNS: s
    };
  }
  isValidLookup(e) {
    return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
  }
  getResource(e, n, r) {
    let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
    return this.i18nFormat && this.i18nFormat.getResource ? this.i18nFormat.getResource(e, n, r, i) : this.resourceStore.getResource(e, n, r, i);
  }
  getUsedParamsDetails() {
    let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    const n = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"], r = e.replace && !se(e.replace);
    let i = r ? e.replace : e;
    if (r && typeof e.count < "u" && (i.count = e.count), this.options.interpolation.defaultVariables && (i = {
      ...this.options.interpolation.defaultVariables,
      ...i
    }), !r) {
      i = {
        ...i
      };
      for (const o of n)
        delete i[o];
    }
    return i;
  }
  static hasDefaultValue(e) {
    const n = "defaultValue";
    for (const r in e)
      if (Object.prototype.hasOwnProperty.call(e, r) && n === r.substring(0, n.length) && e[r] !== void 0)
        return !0;
    return !1;
  }
}
const ml = (t) => t.charAt(0).toUpperCase() + t.slice(1);
class Vp {
  constructor(e) {
    this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = Xt.create("languageUtils");
  }
  getScriptPartFromCode(e) {
    if (e = Ra(e), !e || e.indexOf("-") < 0) return null;
    const n = e.split("-");
    return n.length === 2 || (n.pop(), n[n.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(n.join("-"));
  }
  getLanguagePartFromCode(e) {
    if (e = Ra(e), !e || e.indexOf("-") < 0) return e;
    const n = e.split("-");
    return this.formatLanguageCode(n[0]);
  }
  formatLanguageCode(e) {
    if (se(e) && e.indexOf("-") > -1) {
      if (typeof Intl < "u" && typeof Intl.getCanonicalLocales < "u")
        try {
          let i = Intl.getCanonicalLocales(e)[0];
          if (i && this.options.lowerCaseLng && (i = i.toLowerCase()), i) return i;
        } catch {
        }
      const n = ["hans", "hant", "latn", "cyrl", "cans", "mong", "arab"];
      let r = e.split("-");
      return this.options.lowerCaseLng ? r = r.map((i) => i.toLowerCase()) : r.length === 2 ? (r[0] = r[0].toLowerCase(), r[1] = r[1].toUpperCase(), n.indexOf(r[1].toLowerCase()) > -1 && (r[1] = ml(r[1].toLowerCase()))) : r.length === 3 && (r[0] = r[0].toLowerCase(), r[1].length === 2 && (r[1] = r[1].toUpperCase()), r[0] !== "sgn" && r[2].length === 2 && (r[2] = r[2].toUpperCase()), n.indexOf(r[1].toLowerCase()) > -1 && (r[1] = ml(r[1].toLowerCase())), n.indexOf(r[2].toLowerCase()) > -1 && (r[2] = ml(r[2].toLowerCase()))), r.join("-");
    }
    return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
  }
  isSupportedCode(e) {
    return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
  }
  getBestMatchFromCodes(e) {
    if (!e) return null;
    let n;
    return e.forEach((r) => {
      if (n) return;
      const i = this.formatLanguageCode(r);
      (!this.options.supportedLngs || this.isSupportedCode(i)) && (n = i);
    }), !n && this.options.supportedLngs && e.forEach((r) => {
      if (n) return;
      const i = this.getLanguagePartFromCode(r);
      if (this.isSupportedCode(i)) return n = i;
      n = this.options.supportedLngs.find((o) => {
        if (o === i) return o;
        if (!(o.indexOf("-") < 0 && i.indexOf("-") < 0) && (o.indexOf("-") > 0 && i.indexOf("-") < 0 && o.substring(0, o.indexOf("-")) === i || o.indexOf(i) === 0 && i.length > 1))
          return o;
      });
    }), n || (n = this.getFallbackCodes(this.options.fallbackLng)[0]), n;
  }
  getFallbackCodes(e, n) {
    if (!e) return [];
    if (typeof e == "function" && (e = e(n)), se(e) && (e = [e]), Array.isArray(e)) return e;
    if (!n) return e.default || [];
    let r = e[n];
    return r || (r = e[this.getScriptPartFromCode(n)]), r || (r = e[this.formatLanguageCode(n)]), r || (r = e[this.getLanguagePartFromCode(n)]), r || (r = e.default), r || [];
  }
  toResolveHierarchy(e, n) {
    const r = this.getFallbackCodes(n || this.options.fallbackLng || [], e), i = [], o = (a) => {
      a && (this.isSupportedCode(a) ? i.push(a) : this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`));
    };
    return se(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && o(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && o(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && o(this.getLanguagePartFromCode(e))) : se(e) && o(this.formatLanguageCode(e)), r.forEach((a) => {
      i.indexOf(a) < 0 && o(this.formatLanguageCode(a));
    }), i;
  }
}
let By = [{
  lngs: ["ach", "ak", "am", "arn", "br", "fil", "gun", "ln", "mfe", "mg", "mi", "oc", "pt", "pt-BR", "tg", "tl", "ti", "tr", "uz", "wa"],
  nr: [1, 2],
  fc: 1
}, {
  lngs: ["af", "an", "ast", "az", "bg", "bn", "ca", "da", "de", "dev", "el", "en", "eo", "es", "et", "eu", "fi", "fo", "fur", "fy", "gl", "gu", "ha", "hi", "hu", "hy", "ia", "it", "kk", "kn", "ku", "lb", "mai", "ml", "mn", "mr", "nah", "nap", "nb", "ne", "nl", "nn", "no", "nso", "pa", "pap", "pms", "ps", "pt-PT", "rm", "sco", "se", "si", "so", "son", "sq", "sv", "sw", "ta", "te", "tk", "ur", "yo"],
  nr: [1, 2],
  fc: 2
}, {
  lngs: ["ay", "bo", "cgg", "fa", "ht", "id", "ja", "jbo", "ka", "km", "ko", "ky", "lo", "ms", "sah", "su", "th", "tt", "ug", "vi", "wo", "zh"],
  nr: [1],
  fc: 3
}, {
  lngs: ["be", "bs", "cnr", "dz", "hr", "ru", "sr", "uk"],
  nr: [1, 2, 5],
  fc: 4
}, {
  lngs: ["ar"],
  nr: [0, 1, 2, 3, 11, 100],
  fc: 5
}, {
  lngs: ["cs", "sk"],
  nr: [1, 2, 5],
  fc: 6
}, {
  lngs: ["csb", "pl"],
  nr: [1, 2, 5],
  fc: 7
}, {
  lngs: ["cy"],
  nr: [1, 2, 3, 8],
  fc: 8
}, {
  lngs: ["fr"],
  nr: [1, 2],
  fc: 9
}, {
  lngs: ["ga"],
  nr: [1, 2, 3, 7, 11],
  fc: 10
}, {
  lngs: ["gd"],
  nr: [1, 2, 3, 20],
  fc: 11
}, {
  lngs: ["is"],
  nr: [1, 2],
  fc: 12
}, {
  lngs: ["jv"],
  nr: [0, 1],
  fc: 13
}, {
  lngs: ["kw"],
  nr: [1, 2, 3, 4],
  fc: 14
}, {
  lngs: ["lt"],
  nr: [1, 2, 10],
  fc: 15
}, {
  lngs: ["lv"],
  nr: [1, 2, 0],
  fc: 16
}, {
  lngs: ["mk"],
  nr: [1, 2],
  fc: 17
}, {
  lngs: ["mnk"],
  nr: [0, 1, 2],
  fc: 18
}, {
  lngs: ["mt"],
  nr: [1, 2, 11, 20],
  fc: 19
}, {
  lngs: ["or"],
  nr: [2, 1],
  fc: 2
}, {
  lngs: ["ro"],
  nr: [1, 2, 20],
  fc: 20
}, {
  lngs: ["sl"],
  nr: [5, 1, 2, 3],
  fc: 21
}, {
  lngs: ["he", "iw"],
  nr: [1, 2, 20, 21],
  fc: 22
}], Uy = {
  1: (t) => +(t > 1),
  2: (t) => +(t != 1),
  3: (t) => 0,
  4: (t) => t % 10 == 1 && t % 100 != 11 ? 0 : t % 10 >= 2 && t % 10 <= 4 && (t % 100 < 10 || t % 100 >= 20) ? 1 : 2,
  5: (t) => t == 0 ? 0 : t == 1 ? 1 : t == 2 ? 2 : t % 100 >= 3 && t % 100 <= 10 ? 3 : t % 100 >= 11 ? 4 : 5,
  6: (t) => t == 1 ? 0 : t >= 2 && t <= 4 ? 1 : 2,
  7: (t) => t == 1 ? 0 : t % 10 >= 2 && t % 10 <= 4 && (t % 100 < 10 || t % 100 >= 20) ? 1 : 2,
  8: (t) => t == 1 ? 0 : t == 2 ? 1 : t != 8 && t != 11 ? 2 : 3,
  9: (t) => +(t >= 2),
  10: (t) => t == 1 ? 0 : t == 2 ? 1 : t < 7 ? 2 : t < 11 ? 3 : 4,
  11: (t) => t == 1 || t == 11 ? 0 : t == 2 || t == 12 ? 1 : t > 2 && t < 20 ? 2 : 3,
  12: (t) => +(t % 10 != 1 || t % 100 == 11),
  13: (t) => +(t !== 0),
  14: (t) => t == 1 ? 0 : t == 2 ? 1 : t == 3 ? 2 : 3,
  15: (t) => t % 10 == 1 && t % 100 != 11 ? 0 : t % 10 >= 2 && (t % 100 < 10 || t % 100 >= 20) ? 1 : 2,
  16: (t) => t % 10 == 1 && t % 100 != 11 ? 0 : t !== 0 ? 1 : 2,
  17: (t) => t == 1 || t % 10 == 1 && t % 100 != 11 ? 0 : 1,
  18: (t) => t == 0 ? 0 : t == 1 ? 1 : 2,
  19: (t) => t == 1 ? 0 : t == 0 || t % 100 > 1 && t % 100 < 11 ? 1 : t % 100 > 10 && t % 100 < 20 ? 2 : 3,
  20: (t) => t == 1 ? 0 : t == 0 || t % 100 > 0 && t % 100 < 20 ? 1 : 2,
  21: (t) => t % 100 == 1 ? 1 : t % 100 == 2 ? 2 : t % 100 == 3 || t % 100 == 4 ? 3 : 0,
  22: (t) => t == 1 ? 0 : t == 2 ? 1 : (t < 0 || t > 10) && t % 10 == 0 ? 2 : 3
};
const Hy = ["v1", "v2", "v3"], Gy = ["v4"], Yp = {
  zero: 0,
  one: 1,
  two: 2,
  few: 3,
  many: 4,
  other: 5
}, Vy = () => {
  const t = {};
  return By.forEach((e) => {
    e.lngs.forEach((n) => {
      t[n] = {
        numbers: e.nr,
        plurals: Uy[e.fc]
      };
    });
  }), t;
};
class Yy {
  constructor(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    this.languageUtils = e, this.options = n, this.logger = Xt.create("pluralResolver"), (!this.options.compatibilityJSON || Gy.includes(this.options.compatibilityJSON)) && (typeof Intl > "u" || !Intl.PluralRules) && (this.options.compatibilityJSON = "v3", this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")), this.rules = Vy(), this.pluralRulesCache = {};
  }
  addRule(e, n) {
    this.rules[e] = n;
  }
  clearCache() {
    this.pluralRulesCache = {};
  }
  getRule(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    if (this.shouldUseIntlApi()) {
      const r = Ra(e === "dev" ? "en" : e), i = n.ordinal ? "ordinal" : "cardinal", o = JSON.stringify({
        cleanedCode: r,
        type: i
      });
      if (o in this.pluralRulesCache)
        return this.pluralRulesCache[o];
      let a;
      try {
        a = new Intl.PluralRules(r, {
          type: i
        });
      } catch {
        if (!e.match(/-|_/)) return;
        const l = this.languageUtils.getLanguagePartFromCode(e);
        a = this.getRule(l, n);
      }
      return this.pluralRulesCache[o] = a, a;
    }
    return this.rules[e] || this.rules[this.languageUtils.getLanguagePartFromCode(e)];
  }
  needsPlural(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    const r = this.getRule(e, n);
    return this.shouldUseIntlApi() ? r && r.resolvedOptions().pluralCategories.length > 1 : r && r.numbers.length > 1;
  }
  getPluralFormsOfKey(e, n) {
    let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    return this.getSuffixes(e, r).map((i) => `${n}${i}`);
  }
  getSuffixes(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    const r = this.getRule(e, n);
    return r ? this.shouldUseIntlApi() ? r.resolvedOptions().pluralCategories.sort((i, o) => Yp[i] - Yp[o]).map((i) => `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${i}`) : r.numbers.map((i) => this.getSuffix(e, i, n)) : [];
  }
  getSuffix(e, n) {
    let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
    const i = this.getRule(e, r);
    return i ? this.shouldUseIntlApi() ? `${this.options.prepend}${r.ordinal ? `ordinal${this.options.prepend}` : ""}${i.select(n)}` : this.getSuffixRetroCompatible(i, n) : (this.logger.warn(`no plural rule found for: ${e}`), "");
  }
  getSuffixRetroCompatible(e, n) {
    const r = e.noAbs ? e.plurals(n) : e.plurals(Math.abs(n));
    let i = e.numbers[r];
    this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 && (i === 2 ? i = "plural" : i === 1 && (i = ""));
    const o = () => this.options.prepend && i.toString() ? this.options.prepend + i.toString() : i.toString();
    return this.options.compatibilityJSON === "v1" ? i === 1 ? "" : typeof i == "number" ? `_plural_${i.toString()}` : o() : this.options.compatibilityJSON === "v2" || this.options.simplifyPluralSuffix && e.numbers.length === 2 && e.numbers[0] === 1 ? o() : this.options.prepend && r.toString() ? this.options.prepend + r.toString() : r.toString();
  }
  shouldUseIntlApi() {
    return !Hy.includes(this.options.compatibilityJSON);
  }
}
const $p = function(t, e, n) {
  let r = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".", i = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !0, o = xy(t, e, n);
  return !o && i && se(n) && (o = Sc(t, n, r), o === void 0 && (o = Sc(e, n, r))), o;
}, fl = (t) => t.replace(/\$/g, "$$$$");
class $y {
  constructor() {
    let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    this.logger = Xt.create("interpolator"), this.options = e, this.format = e.interpolation && e.interpolation.format || ((n) => n), this.init(e);
  }
  init() {
    let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    e.interpolation || (e.interpolation = {
      escapeValue: !0
    });
    const {
      escape: n,
      escapeValue: r,
      useRawValueToEscape: i,
      prefix: o,
      prefixEscaped: a,
      suffix: s,
      suffixEscaped: l,
      formatSeparator: c,
      unescapeSuffix: u,
      unescapePrefix: d,
      nestingPrefix: p,
      nestingPrefixEscaped: _,
      nestingSuffix: m,
      nestingSuffixEscaped: f,
      nestingOptionsSeparator: g,
      maxReplaces: S,
      alwaysFormat: E
    } = e.interpolation;
    this.escape = n !== void 0 ? n : wy, this.escapeValue = r !== void 0 ? r : !0, this.useRawValueToEscape = i !== void 0 ? i : !1, this.prefix = o ? Dr(o) : a || "{{", this.suffix = s ? Dr(s) : l || "}}", this.formatSeparator = c || ",", this.unescapePrefix = u ? "" : d || "-", this.unescapeSuffix = this.unescapePrefix ? "" : u || "", this.nestingPrefix = p ? Dr(p) : _ || Dr("$t("), this.nestingSuffix = m ? Dr(m) : f || Dr(")"), this.nestingOptionsSeparator = g || ",", this.maxReplaces = S || 1e3, this.alwaysFormat = E !== void 0 ? E : !1, this.resetRegExp();
  }
  reset() {
    this.options && this.init(this.options);
  }
  resetRegExp() {
    const e = (n, r) => n && n.source === r ? (n.lastIndex = 0, n) : new RegExp(r, "g");
    this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}(.+?)${this.nestingSuffix}`);
  }
  interpolate(e, n, r, i) {
    let o, a, s;
    const l = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, c = (_) => {
      if (_.indexOf(this.formatSeparator) < 0) {
        const S = $p(n, l, _, this.options.keySeparator, this.options.ignoreJSONStructure);
        return this.alwaysFormat ? this.format(S, void 0, r, {
          ...i,
          ...n,
          interpolationkey: _
        }) : S;
      }
      const m = _.split(this.formatSeparator), f = m.shift().trim(), g = m.join(this.formatSeparator).trim();
      return this.format($p(n, l, f, this.options.keySeparator, this.options.ignoreJSONStructure), g, r, {
        ...i,
        ...n,
        interpolationkey: f
      });
    };
    this.resetRegExp();
    const u = i && i.missingInterpolationHandler || this.options.missingInterpolationHandler, d = i && i.interpolation && i.interpolation.skipOnVariables !== void 0 ? i.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
    return [{
      regex: this.regexpUnescape,
      safeValue: (_) => fl(_)
    }, {
      regex: this.regexp,
      safeValue: (_) => this.escapeValue ? fl(this.escape(_)) : fl(_)
    }].forEach((_) => {
      for (s = 0; o = _.regex.exec(e); ) {
        const m = o[1].trim();
        if (a = c(m), a === void 0)
          if (typeof u == "function") {
            const g = u(e, o, i);
            a = se(g) ? g : "";
          } else if (i && Object.prototype.hasOwnProperty.call(i, m))
            a = "";
          else if (d) {
            a = o[0];
            continue;
          } else
            this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`), a = "";
        else !se(a) && !this.useRawValueToEscape && (a = Pp(a));
        const f = _.safeValue(a);
        if (e = e.replace(o[0], f), d ? (_.regex.lastIndex += a.length, _.regex.lastIndex -= o[0].length) : _.regex.lastIndex = 0, s++, s >= this.maxReplaces)
          break;
      }
    }), e;
  }
  nest(e, n) {
    let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i, o, a;
    const s = (l, c) => {
      const u = this.nestingOptionsSeparator;
      if (l.indexOf(u) < 0) return l;
      const d = l.split(new RegExp(`${u}[ ]*{`));
      let p = `{${d[1]}`;
      l = d[0], p = this.interpolate(p, a);
      const _ = p.match(/'/g), m = p.match(/"/g);
      (_ && _.length % 2 === 0 && !m || m.length % 2 !== 0) && (p = p.replace(/'/g, '"'));
      try {
        a = JSON.parse(p), c && (a = {
          ...c,
          ...a
        });
      } catch (f) {
        return this.logger.warn(`failed parsing options string in nesting for key ${l}`, f), `${l}${u}${p}`;
      }
      return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, l;
    };
    for (; i = this.nestingRegexp.exec(e); ) {
      let l = [];
      a = {
        ...r
      }, a = a.replace && !se(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
      let c = !1;
      if (i[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(i[1])) {
        const u = i[1].split(this.formatSeparator).map((d) => d.trim());
        i[1] = u.shift(), l = u, c = !0;
      }
      if (o = n(s.call(this, i[1].trim(), a), a), o && i[0] === e && !se(o)) return o;
      se(o) || (o = Pp(o)), o || (this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`), o = ""), c && (o = l.reduce((u, d) => this.format(u, d, r.lng, {
        ...r,
        interpolationkey: i[1].trim()
      }), o.trim())), e = e.replace(i[0], o), this.regexp.lastIndex = 0;
    }
    return e;
  }
}
const zy = (t) => {
  let e = t.toLowerCase().trim();
  const n = {};
  if (t.indexOf("(") > -1) {
    const r = t.split("(");
    e = r[0].toLowerCase().trim();
    const i = r[1].substring(0, r[1].length - 1);
    e === "currency" && i.indexOf(":") < 0 ? n.currency || (n.currency = i.trim()) : e === "relativetime" && i.indexOf(":") < 0 ? n.range || (n.range = i.trim()) : i.split(";").forEach((a) => {
      if (a) {
        const [s, ...l] = a.split(":"), c = l.join(":").trim().replace(/^'+|'+$/g, ""), u = s.trim();
        n[u] || (n[u] = c), c === "false" && (n[u] = !1), c === "true" && (n[u] = !0), isNaN(c) || (n[u] = parseInt(c, 10));
      }
    });
  }
  return {
    formatName: e,
    formatOptions: n
  };
}, wr = (t) => {
  const e = {};
  return (n, r, i) => {
    let o = i;
    i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (o = {
      ...o,
      [i.interpolationkey]: void 0
    });
    const a = r + JSON.stringify(o);
    let s = e[a];
    return s || (s = t(Ra(r), i), e[a] = s), s(n);
  };
};
class qy {
  constructor() {
    let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    this.logger = Xt.create("formatter"), this.options = e, this.formats = {
      number: wr((n, r) => {
        const i = new Intl.NumberFormat(n, {
          ...r
        });
        return (o) => i.format(o);
      }),
      currency: wr((n, r) => {
        const i = new Intl.NumberFormat(n, {
          ...r,
          style: "currency"
        });
        return (o) => i.format(o);
      }),
      datetime: wr((n, r) => {
        const i = new Intl.DateTimeFormat(n, {
          ...r
        });
        return (o) => i.format(o);
      }),
      relativetime: wr((n, r) => {
        const i = new Intl.RelativeTimeFormat(n, {
          ...r
        });
        return (o) => i.format(o, r.range || "day");
      }),
      list: wr((n, r) => {
        const i = new Intl.ListFormat(n, {
          ...r
        });
        return (o) => i.format(o);
      })
    }, this.init(e);
  }
  init(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
      interpolation: {}
    };
    this.formatSeparator = n.interpolation.formatSeparator || ",";
  }
  add(e, n) {
    this.formats[e.toLowerCase().trim()] = n;
  }
  addCached(e, n) {
    this.formats[e.toLowerCase().trim()] = wr(n);
  }
  format(e, n, r) {
    let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
    const o = n.split(this.formatSeparator);
    if (o.length > 1 && o[0].indexOf("(") > 1 && o[0].indexOf(")") < 0 && o.find((s) => s.indexOf(")") > -1)) {
      const s = o.findIndex((l) => l.indexOf(")") > -1);
      o[0] = [o[0], ...o.splice(1, s)].join(this.formatSeparator);
    }
    return o.reduce((s, l) => {
      const {
        formatName: c,
        formatOptions: u
      } = zy(l);
      if (this.formats[c]) {
        let d = s;
        try {
          const p = i && i.formatParams && i.formatParams[i.interpolationkey] || {}, _ = p.locale || p.lng || i.locale || i.lng || r;
          d = this.formats[c](s, _, {
            ...u,
            ...i,
            ...p
          });
        } catch (p) {
          this.logger.warn(p);
        }
        return d;
      } else
        this.logger.warn(`there was no format function for ${c}`);
      return s;
    }, e);
  }
}
const Wy = (t, e) => {
  t.pending[e] !== void 0 && (delete t.pending[e], t.pendingCount--);
};
class Ky extends xs {
  constructor(e, n, r) {
    let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
    super(), this.backend = e, this.store = n, this.services = r, this.languageUtils = r.languageUtils, this.options = i, this.logger = Xt.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = i.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = i.maxRetries >= 0 ? i.maxRetries : 5, this.retryTimeout = i.retryTimeout >= 1 ? i.retryTimeout : 350, this.state = {}, this.queue = [], this.backend && this.backend.init && this.backend.init(r, i.backend, i);
  }
  queueLoad(e, n, r, i) {
    const o = {}, a = {}, s = {}, l = {};
    return e.forEach((c) => {
      let u = !0;
      n.forEach((d) => {
        const p = `${c}|${d}`;
        !r.reload && this.store.hasResourceBundle(c, d) ? this.state[p] = 2 : this.state[p] < 0 || (this.state[p] === 1 ? a[p] === void 0 && (a[p] = !0) : (this.state[p] = 1, u = !1, a[p] === void 0 && (a[p] = !0), o[p] === void 0 && (o[p] = !0), l[d] === void 0 && (l[d] = !0)));
      }), u || (s[c] = !0);
    }), (Object.keys(o).length || Object.keys(a).length) && this.queue.push({
      pending: a,
      pendingCount: Object.keys(a).length,
      loaded: {},
      errors: [],
      callback: i
    }), {
      toLoad: Object.keys(o),
      pending: Object.keys(a),
      toLoadLanguages: Object.keys(s),
      toLoadNamespaces: Object.keys(l)
    };
  }
  loaded(e, n, r) {
    const i = e.split("|"), o = i[0], a = i[1];
    n && this.emit("failedLoading", o, a, n), !n && r && this.store.addResourceBundle(o, a, r, void 0, void 0, {
      skipCopy: !0
    }), this.state[e] = n ? -1 : 2, n && r && (this.state[e] = 0);
    const s = {};
    this.queue.forEach((l) => {
      Iy(l.loaded, [o], a), Wy(l, e), n && l.errors.push(n), l.pendingCount === 0 && !l.done && (Object.keys(l.loaded).forEach((c) => {
        s[c] || (s[c] = {});
        const u = l.loaded[c];
        u.length && u.forEach((d) => {
          s[c][d] === void 0 && (s[c][d] = !0);
        });
      }), l.done = !0, l.errors.length ? l.callback(l.errors) : l.callback());
    }), this.emit("loaded", s), this.queue = this.queue.filter((l) => !l.done);
  }
  read(e, n, r) {
    let i = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : 0, o = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : this.retryTimeout, a = arguments.length > 5 ? arguments[5] : void 0;
    if (!e.length) return a(null, {});
    if (this.readingCalls >= this.maxParallelReads) {
      this.waitingReads.push({
        lng: e,
        ns: n,
        fcName: r,
        tried: i,
        wait: o,
        callback: a
      });
      return;
    }
    this.readingCalls++;
    const s = (c, u) => {
      if (this.readingCalls--, this.waitingReads.length > 0) {
        const d = this.waitingReads.shift();
        this.read(d.lng, d.ns, d.fcName, d.tried, d.wait, d.callback);
      }
      if (c && u && i < this.maxRetries) {
        setTimeout(() => {
          this.read.call(this, e, n, r, i + 1, o * 2, a);
        }, o);
        return;
      }
      a(c, u);
    }, l = this.backend[r].bind(this.backend);
    if (l.length === 2) {
      try {
        const c = l(e, n);
        c && typeof c.then == "function" ? c.then((u) => s(null, u)).catch(s) : s(null, c);
      } catch (c) {
        s(c);
      }
      return;
    }
    return l(e, n, s);
  }
  prepareLoading(e, n) {
    let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, i = arguments.length > 3 ? arguments[3] : void 0;
    if (!this.backend)
      return this.logger.warn("No backend was added via i18next.use. Will not load resources."), i && i();
    se(e) && (e = this.languageUtils.toResolveHierarchy(e)), se(n) && (n = [n]);
    const o = this.queueLoad(e, n, r, i);
    if (!o.toLoad.length)
      return o.pending.length || i(), null;
    o.toLoad.forEach((a) => {
      this.loadOne(a);
    });
  }
  load(e, n, r) {
    this.prepareLoading(e, n, {}, r);
  }
  reload(e, n, r) {
    this.prepareLoading(e, n, {
      reload: !0
    }, r);
  }
  loadOne(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
    const r = e.split("|"), i = r[0], o = r[1];
    this.read(i, o, "read", void 0, void 0, (a, s) => {
      a && this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`, a), !a && s && this.logger.log(`${n}loaded namespace ${o} for language ${i}`, s), this.loaded(e, a, s);
    });
  }
  saveMissing(e, n, r, i, o) {
    let a = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {}, s = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : () => {
    };
    if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(n)) {
      this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
      return;
    }
    if (!(r == null || r === "")) {
      if (this.backend && this.backend.create) {
        const l = {
          ...a,
          isUpdate: o
        }, c = this.backend.create.bind(this.backend);
        if (c.length < 6)
          try {
            let u;
            c.length === 5 ? u = c(e, n, r, i, l) : u = c(e, n, r, i), u && typeof u.then == "function" ? u.then((d) => s(null, d)).catch(s) : s(null, u);
          } catch (u) {
            s(u);
          }
        else
          c(e, n, r, i, s, l);
      }
      !e || !e[0] || this.store.addResource(e[0], n, r, i);
    }
  }
}
const zp = () => ({
  debug: !1,
  initImmediate: !0,
  ns: ["translation"],
  defaultNS: ["translation"],
  fallbackLng: ["dev"],
  fallbackNS: !1,
  supportedLngs: !1,
  nonExplicitSupportedLngs: !1,
  load: "all",
  preload: !1,
  simplifyPluralSuffix: !0,
  keySeparator: ".",
  nsSeparator: ":",
  pluralSeparator: "_",
  contextSeparator: "_",
  partialBundledLanguages: !1,
  saveMissing: !1,
  updateMissing: !1,
  saveMissingTo: "fallback",
  saveMissingPlurals: !0,
  missingKeyHandler: !1,
  missingInterpolationHandler: !1,
  postProcess: !1,
  postProcessPassResolved: !1,
  returnNull: !1,
  returnEmptyString: !0,
  returnObjects: !1,
  joinArrays: !1,
  returnedObjectHandler: !1,
  parseMissingKeyHandler: !1,
  appendNamespaceToMissingKey: !1,
  appendNamespaceToCIMode: !1,
  overloadTranslationOptionHandler: (t) => {
    let e = {};
    if (typeof t[1] == "object" && (e = t[1]), se(t[1]) && (e.defaultValue = t[1]), se(t[2]) && (e.tDescription = t[2]), typeof t[2] == "object" || typeof t[3] == "object") {
      const n = t[3] || t[2];
      Object.keys(n).forEach((r) => {
        e[r] = n[r];
      });
    }
    return e;
  },
  interpolation: {
    escapeValue: !0,
    format: (t) => t,
    prefix: "{{",
    suffix: "}}",
    formatSeparator: ",",
    unescapePrefix: "-",
    nestingPrefix: "$t(",
    nestingSuffix: ")",
    nestingOptionsSeparator: ",",
    maxReplaces: 1e3,
    skipOnVariables: !0
  }
}), qp = (t) => (se(t.ns) && (t.ns = [t.ns]), se(t.fallbackLng) && (t.fallbackLng = [t.fallbackLng]), se(t.fallbackNS) && (t.fallbackNS = [t.fallbackNS]), t.supportedLngs && t.supportedLngs.indexOf("cimode") < 0 && (t.supportedLngs = t.supportedLngs.concat(["cimode"])), t), Bo = () => {
}, Qy = (t) => {
  Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach((n) => {
    typeof t[n] == "function" && (t[n] = t[n].bind(t));
  });
};
class no extends xs {
  constructor() {
    let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
    if (super(), this.options = qp(e), this.services = {}, this.logger = Xt, this.modules = {
      external: []
    }, Qy(this), n && !this.isInitialized && !e.isClone) {
      if (!this.options.initImmediate)
        return this.init(e, n), this;
      setTimeout(() => {
        this.init(e, n);
      }, 0);
    }
  }
  init() {
    var e = this;
    let n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = arguments.length > 1 ? arguments[1] : void 0;
    this.isInitializing = !0, typeof n == "function" && (r = n, n = {}), !n.defaultNS && n.defaultNS !== !1 && n.ns && (se(n.ns) ? n.defaultNS = n.ns : n.ns.indexOf("translation") < 0 && (n.defaultNS = n.ns[0]));
    const i = zp();
    this.options = {
      ...i,
      ...this.options,
      ...qp(n)
    }, this.options.compatibilityAPI !== "v1" && (this.options.interpolation = {
      ...i.interpolation,
      ...this.options.interpolation
    }), n.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = n.keySeparator), n.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = n.nsSeparator);
    const o = (u) => u ? typeof u == "function" ? new u() : u : null;
    if (!this.options.isClone) {
      this.modules.logger ? Xt.init(o(this.modules.logger), this.options) : Xt.init(null, this.options);
      let u;
      this.modules.formatter ? u = this.modules.formatter : typeof Intl < "u" && (u = qy);
      const d = new Vp(this.options);
      this.store = new Hp(this.options.resources, this.options);
      const p = this.services;
      p.logger = Xt, p.resourceStore = this.store, p.languageUtils = d, p.pluralResolver = new Yy(d, {
        prepend: this.options.pluralSeparator,
        compatibilityJSON: this.options.compatibilityJSON,
        simplifyPluralSuffix: this.options.simplifyPluralSuffix
      }), u && (!this.options.interpolation.format || this.options.interpolation.format === i.interpolation.format) && (p.formatter = o(u), p.formatter.init(p, this.options), this.options.interpolation.format = p.formatter.format.bind(p.formatter)), p.interpolator = new $y(this.options), p.utils = {
        hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
      }, p.backendConnector = new Ky(o(this.modules.backend), p.resourceStore, p, this.options), p.backendConnector.on("*", function(_) {
        for (var m = arguments.length, f = new Array(m > 1 ? m - 1 : 0), g = 1; g < m; g++)
          f[g - 1] = arguments[g];
        e.emit(_, ...f);
      }), this.modules.languageDetector && (p.languageDetector = o(this.modules.languageDetector), p.languageDetector.init && p.languageDetector.init(p, this.options.detection, this.options)), this.modules.i18nFormat && (p.i18nFormat = o(this.modules.i18nFormat), p.i18nFormat.init && p.i18nFormat.init(this)), this.translator = new Na(this.services, this.options), this.translator.on("*", function(_) {
        for (var m = arguments.length, f = new Array(m > 1 ? m - 1 : 0), g = 1; g < m; g++)
          f[g - 1] = arguments[g];
        e.emit(_, ...f);
      }), this.modules.external.forEach((_) => {
        _.init && _.init(this);
      });
    }
    if (this.format = this.options.interpolation.format, r || (r = Bo), this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
      const u = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
      u.length > 0 && u[0] !== "dev" && (this.options.lng = u[0]);
    }
    !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), ["getResource", "hasResourceBundle", "getResourceBundle", "getDataByLanguage"].forEach((u) => {
      this[u] = function() {
        return e.store[u](...arguments);
      };
    }), ["addResource", "addResources", "addResourceBundle", "removeResourceBundle"].forEach((u) => {
      this[u] = function() {
        return e.store[u](...arguments), e;
      };
    });
    const l = Si(), c = () => {
      const u = (d, p) => {
        this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), l.resolve(p), r(d, p);
      };
      if (this.languages && this.options.compatibilityAPI !== "v1" && !this.isInitialized) return u(null, this.t.bind(this));
      this.changeLanguage(this.options.lng, u);
    };
    return this.options.resources || !this.options.initImmediate ? c() : setTimeout(c, 0), l;
  }
  loadResources(e) {
    let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bo;
    const i = se(e) ? e : this.language;
    if (typeof e == "function" && (r = e), !this.options.resources || this.options.partialBundledLanguages) {
      if (i && i.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return r();
      const o = [], a = (s) => {
        if (!s || s === "cimode") return;
        this.services.languageUtils.toResolveHierarchy(s).forEach((c) => {
          c !== "cimode" && o.indexOf(c) < 0 && o.push(c);
        });
      };
      i ? a(i) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((l) => a(l)), this.options.preload && this.options.preload.forEach((s) => a(s)), this.services.backendConnector.load(o, this.options.ns, (s) => {
        !s && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), r(s);
      });
    } else
      r(null);
  }
  reloadResources(e, n, r) {
    const i = Si();
    return typeof e == "function" && (r = e, e = void 0), typeof n == "function" && (r = n, n = void 0), e || (e = this.languages), n || (n = this.options.ns), r || (r = Bo), this.services.backendConnector.reload(e, n, (o) => {
      i.resolve(), r(o);
    }), i;
  }
  use(e) {
    if (!e) throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
    if (!e.type) throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
    return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && yg.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
  }
  setResolvedLanguage(e) {
    if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1))
      for (let n = 0; n < this.languages.length; n++) {
        const r = this.languages[n];
        if (!(["cimode", "dev"].indexOf(r) > -1) && this.store.hasLanguageSomeTranslations(r)) {
          this.resolvedLanguage = r;
          break;
        }
      }
  }
  changeLanguage(e, n) {
    var r = this;
    this.isLanguageChangingTo = e;
    const i = Si();
    this.emit("languageChanging", e);
    const o = (l) => {
      this.language = l, this.languages = this.services.languageUtils.toResolveHierarchy(l), this.resolvedLanguage = void 0, this.setResolvedLanguage(l);
    }, a = (l, c) => {
      c ? (o(c), this.translator.changeLanguage(c), this.isLanguageChangingTo = void 0, this.emit("languageChanged", c), this.logger.log("languageChanged", c)) : this.isLanguageChangingTo = void 0, i.resolve(function() {
        return r.t(...arguments);
      }), n && n(l, function() {
        return r.t(...arguments);
      });
    }, s = (l) => {
      !e && !l && this.services.languageDetector && (l = []);
      const c = se(l) ? l : this.services.languageUtils.getBestMatchFromCodes(l);
      c && (this.language || o(c), this.translator.language || this.translator.changeLanguage(c), this.services.languageDetector && this.services.languageDetector.cacheUserLanguage && this.services.languageDetector.cacheUserLanguage(c)), this.loadResources(c, (u) => {
        a(u, c);
      });
    };
    return !e && this.services.languageDetector && !this.services.languageDetector.async ? s(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(s) : this.services.languageDetector.detect(s) : s(e), i;
  }
  getFixedT(e, n, r) {
    var i = this;
    const o = function(a, s) {
      let l;
      if (typeof s != "object") {
        for (var c = arguments.length, u = new Array(c > 2 ? c - 2 : 0), d = 2; d < c; d++)
          u[d - 2] = arguments[d];
        l = i.options.overloadTranslationOptionHandler([a, s].concat(u));
      } else
        l = {
          ...s
        };
      l.lng = l.lng || o.lng, l.lngs = l.lngs || o.lngs, l.ns = l.ns || o.ns, l.keyPrefix !== "" && (l.keyPrefix = l.keyPrefix || r || o.keyPrefix);
      const p = i.options.keySeparator || ".";
      let _;
      return l.keyPrefix && Array.isArray(a) ? _ = a.map((m) => `${l.keyPrefix}${p}${m}`) : _ = l.keyPrefix ? `${l.keyPrefix}${p}${a}` : a, i.t(_, l);
    };
    return se(e) ? o.lng = e : o.lngs = e, o.ns = n, o.keyPrefix = r, o;
  }
  t() {
    return this.translator && this.translator.translate(...arguments);
  }
  exists() {
    return this.translator && this.translator.exists(...arguments);
  }
  setDefaultNamespace(e) {
    this.options.defaultNS = e;
  }
  hasLoadedNamespace(e) {
    let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
    if (!this.isInitialized)
      return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
    if (!this.languages || !this.languages.length)
      return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
    const r = n.lng || this.resolvedLanguage || this.languages[0], i = this.options ? this.options.fallbackLng : !1, o = this.languages[this.languages.length - 1];
    if (r.toLowerCase() === "cimode") return !0;
    const a = (s, l) => {
      const c = this.services.backendConnector.state[`${s}|${l}`];
      return c === -1 || c === 0 || c === 2;
    };
    if (n.precheck) {
      const s = n.precheck(this, a);
      if (s !== void 0) return s;
    }
    return !!(this.hasResourceBundle(r, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(r, e) && (!i || a(o, e)));
  }
  loadNamespaces(e, n) {
    const r = Si();
    return this.options.ns ? (se(e) && (e = [e]), e.forEach((i) => {
      this.options.ns.indexOf(i) < 0 && this.options.ns.push(i);
    }), this.loadResources((i) => {
      r.resolve(), n && n(i);
    }), r) : (n && n(), Promise.resolve());
  }
  loadLanguages(e, n) {
    const r = Si();
    se(e) && (e = [e]);
    const i = this.options.preload || [], o = e.filter((a) => i.indexOf(a) < 0 && this.services.languageUtils.isSupportedCode(a));
    return o.length ? (this.options.preload = i.concat(o), this.loadResources((a) => {
      r.resolve(), n && n(a);
    }), r) : (n && n(), Promise.resolve());
  }
  dir(e) {
    if (e || (e = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language)), !e) return "rtl";
    const n = ["ar", "shu", "sqr", "ssh", "xaa", "yhd", "yud", "aao", "abh", "abv", "acm", "acq", "acw", "acx", "acy", "adf", "ads", "aeb", "aec", "afb", "ajp", "apc", "apd", "arb", "arq", "ars", "ary", "arz", "auz", "avl", "ayh", "ayl", "ayn", "ayp", "bbz", "pga", "he", "iw", "ps", "pbt", "pbu", "pst", "prp", "prd", "ug", "ur", "ydd", "yds", "yih", "ji", "yi", "hbo", "men", "xmn", "fa", "jpr", "peo", "pes", "prs", "dv", "sam", "ckb"], r = this.services && this.services.languageUtils || new Vp(zp());
    return n.indexOf(r.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
  }
  static createInstance() {
    let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 ? arguments[1] : void 0;
    return new no(e, n);
  }
  cloneInstance() {
    let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Bo;
    const r = e.forkResourceStore;
    r && delete e.forkResourceStore;
    const i = {
      ...this.options,
      ...e,
      isClone: !0
    }, o = new no(i);
    return (e.debug !== void 0 || e.prefix !== void 0) && (o.logger = o.logger.clone(e)), ["store", "services", "language"].forEach((s) => {
      o[s] = this[s];
    }), o.services = {
      ...this.services
    }, o.services.utils = {
      hasLoadedNamespace: o.hasLoadedNamespace.bind(o)
    }, r && (o.store = new Hp(this.store.data, i), o.services.resourceStore = o.store), o.translator = new Na(o.services, i), o.translator.on("*", function(s) {
      for (var l = arguments.length, c = new Array(l > 1 ? l - 1 : 0), u = 1; u < l; u++)
        c[u - 1] = arguments[u];
      o.emit(s, ...c);
    }), o.init(i, n), o.translator.options = i, o.translator.backendConnector.services.utils = {
      hasLoadedNamespace: o.hasLoadedNamespace.bind(o)
    }, o;
  }
  toJSON() {
    return {
      options: this.options,
      store: this.store,
      language: this.language,
      languages: this.languages,
      resolvedLanguage: this.resolvedLanguage
    };
  }
}
const Je = no.createInstance();
Je.createInstance = no.createInstance;
Je.createInstance;
Je.dir;
Je.init;
Je.loadResources;
Je.reloadResources;
Je.use;
Je.changeLanguage;
Je.getFixedT;
const te = Je.t;
Je.exists;
Je.setDefaultNamespace;
Je.hasLoadedNamespace;
Je.loadNamespaces;
Je.loadLanguages;
const Zy = ["paragraph", "h1", "h2", "h3", "h4", "h5", "h6"];
let Xy = class extends pi {
  constructor() {
    super(), this.menuData = Zy.map((e) => te(e)), this.dropDivHeight = "265px", this.dropDivWith = "fit-content";
  }
  onDropdownActive(e, n) {
    return n == 0 ? e.isActive("paragraph") : e.isActive("heading", { level: n });
  }
  onDropdownItemClick(e) {
    e == 0 ? this.editor.chain().setParagraph().run() : this.editor.chain().setHeading({ level: e }).run();
  }
  onDropdownItemRender(e) {
    return e == 0 ? this.menuData[e] : `<h${e}>${this.menuData[e]}</h${e}>`;
  }
  onMenuTextRender(e) {
    return this.menuData[e].replace(" ", "");
  }
};
const jy = [
  { name: "宋体", value: "SimSun" },
  { name: "仿宋", value: "FangSong" },
  { name: "黑体", value: "SimHei" },
  { name: "楷体", value: "KaiTi" },
  { name: "微软雅黑", value: "Microsoft YaHei" },
  { name: "方正仿宋简体_GBK", value: "FangSong_GB2312" },
  { name: "Arial", value: "Arial" }
];
let Jy = class extends pi {
  constructor() {
    super(), this.width = "72px", this.menuTextWidth = "60px", this.dropDivWith = "150px";
  }
  onCreate(e, n) {
    var r;
    super.onCreate(e, n), this.menuData = ((r = n.fontFamily) == null ? void 0 : r.values) || jy, this.menuData = [
      { name: te("default-font-family"), value: "" }
    ].concat(this.menuData);
  }
  onDropdownActive(e, n) {
    return e.isActive("textStyle", { fontFamily: this.menuData[n].value });
  }
  onDropdownItemClick(e) {
    const n = this.menuData[e].value;
    n ? this.editor.chain().setFontFamily(n).run() : this.editor.chain().unsetFontFamily().run();
  }
  onDropdownItemRender(e) {
    return this.menuData[e].name;
  }
  onMenuTextRender(e) {
    return this.menuData[e].name;
  }
};
const ev = [
  { name: "9", value: 9 },
  { name: "10", value: 10 },
  { name: "11", value: 11 },
  { name: "12", value: 12 },
  { name: "14", value: 14 },
  { name: "18", value: 18 },
  { name: "20", value: 20 },
  { name: "22", value: 22 },
  { name: "24", value: 24 },
  { name: "26", value: 26 },
  { name: "28", value: 28 },
  { name: "30", value: 30 },
  { name: "36", value: 36 },
  { name: "42", value: 42 },
  { name: "48", value: 48 },
  { name: "56", value: 56 },
  { name: "72", value: 72 }
];
class tv extends pi {
  constructor() {
    super();
    M(this, "defaultValue", 14);
  }
  onCreate(n, r) {
    var i, o;
    super.onCreate(n, r), this.menuData = ((i = r.fontSize) == null ? void 0 : i.values) || ev, this.defaultValue = ((o = r.fontSize) == null ? void 0 : o.defaultValue) || this.defaultValue;
    for (let a = 0; a < this.menuData.length; a++)
      if (this.menuData[a].value == this.defaultValue) {
        this.defaultMenuIndex = a, this.menuData[a].name = `${this.defaultValue}（${te("default")}）`;
        break;
      }
  }
  onDropdownActive(n, r) {
    return n.isActive("textStyle", { fontSize: `${this.menuData[r].value}px` });
  }
  onDropdownItemClick(n) {
    var i, o;
    const r = this.menuData[n].value;
    r == this.defaultValue ? (i = this.editor) == null || i.chain().focus().unsetFontSize().run() : (o = this.editor) == null || o.chain().focus().setFontSize(`${r}px`).run();
  }
  onDropdownItemRender(n) {
    return this.menuData[n].name;
  }
  onMenuTextRender(n) {
    const r = this.menuData[n];
    return r.value == this.defaultValue ? te("default-font-size") : r.name;
  }
}
let nv = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 11H12.5C13.8807 11 15 9.88071 15 8.5C15 7.11929 13.8807 6 12.5 6H8V11ZM18 15.5C18 17.9853 15.9853 20 13.5 20H6V4H12.5C14.9853 4 17 6.01472 17 8.5C17 9.70431 16.5269 10.7981 15.7564 11.6058C17.0979 12.3847 18 13.837 18 15.5ZM8 13V18H13.5C14.8807 18 16 16.8807 16 15.5C16 14.1193 14.8807 13 13.5 13H8Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleBold();
  }
  onActive(e) {
    return e.isActive("bold");
  }
}, rv = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 20H7V18H9.92661L12.0425 6H9V4H17V6H14.0734L11.9575 18H15V20Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleItalic();
  }
  onActive(e) {
    return e.isActive("italic");
  }
}, iv = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 3V12C8 14.2091 9.79086 16 12 16C14.2091 16 16 14.2091 16 12V3H18V12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12V3H8ZM4 20H20V22H4V20Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleUnderline();
  }
  onActive(e) {
    return e.isActive("underline");
  }
}, ov = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.1538 14C17.3846 14.5161 17.5 15.0893 17.5 15.7196C17.5 17.0625 16.9762 18.1116 15.9286 18.867C14.8809 19.6223 13.4335 20 11.5862 20C9.94674 20 8.32335 19.6185 6.71592 18.8555V16.6009C8.23538 17.4783 9.7908 17.917 11.3822 17.917C13.9333 17.917 15.2128 17.1846 15.2208 15.7196C15.2208 15.0939 15.0049 14.5598 14.5731 14.1173C14.5339 14.0772 14.4939 14.0381 14.4531 14H3V12H21V14H17.1538ZM13.076 11H7.62908C7.4566 10.8433 7.29616 10.6692 7.14776 10.4778C6.71592 9.92084 6.5 9.24559 6.5 8.45207C6.5 7.21602 6.96583 6.165 7.89749 5.299C8.82916 4.43299 10.2706 4 12.2219 4C13.6934 4 15.1009 4.32808 16.4444 4.98426V7.13591C15.2448 6.44921 13.9293 6.10587 12.4978 6.10587C10.0187 6.10587 8.77917 6.88793 8.77917 8.45207C8.77917 8.87172 8.99709 9.23796 9.43293 9.55079C9.86878 9.86362 10.4066 10.1135 11.0463 10.3004C11.6665 10.4816 12.3431 10.7148 13.076 11H13.076Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleStrike();
  }
  onActive(e) {
    return e.isActive("strike");
  }
}, av = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.59567 4L10.5 9.92831L15.4043 4H18L11.7978 11.4971L18 18.9943V19H15.4091L10.5 13.0659L5.59092 19H3V18.9943L9.20216 11.4971L3 4H5.59567ZM21.8 16C21.8 15.5582 21.4418 15.2 21 15.2C20.5582 15.2 20.2 15.5582 20.2 16C20.2 16.0762 20.2107 16.15 20.2306 16.2198L19.0765 16.5496C19.0267 16.375 19 16.1906 19 16C19 14.8954 19.8954 14 21 14C22.1046 14 23 14.8954 23 16C23 16.5727 22.7593 17.0892 22.3735 17.4538L20.7441 19H23V20H19V19L21.5507 16.5803C21.7042 16.4345 21.8 16.2284 21.8 16Z"></path></svg>
         </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleSubscript();
  }
  onActive(e) {
    return e.isActive("subscript");
  }
}, sv = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.59567 5L10.5 10.9283L15.4043 5H18L11.7978 12.4971L18 19.9943V20H15.4091L10.5 14.0659L5.59092 20H3V19.9943L9.20216 12.4971L3 5H5.59567ZM21.5507 6.5803C21.7042 6.43453 21.8 6.22845 21.8 6C21.8 5.55817 21.4418 5.2 21 5.2C20.5582 5.2 20.2 5.55817 20.2 6C20.2 6.07624 20.2107 6.14999 20.2306 6.21983L19.0765 6.54958C19.0267 6.37497 19 6.1906 19 6C19 4.89543 19.8954 4 21 4C22.1046 4 23 4.89543 23 6C23 6.57273 22.7593 7.08923 22.3735 7.45384L20.7441 9H23V10H19V9L21.5507 6.5803V6.5803Z"></path></svg>
         </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleSuperscript();
  }
  onActive(e) {
    return e.isActive("superscript");
  }
};
const lv = [
  "ffffff",
  "000000",
  "e9d989",
  "2972f4",
  "609eec",
  "de3c36",
  "a1d533",
  "7334c5",
  "27b5d9",
  "ff8926",
  "f2f2f2",
  "7f7f7f",
  "ddd9c3",
  "c6d9f0",
  "dbe5f1",
  "f2dcdb",
  "ebf1dd",
  "e5e0ec",
  "dbeef3",
  "fdeada",
  "d8d8d8",
  "595959",
  "c4bd97",
  "8db3e2",
  "b8cce4",
  "e5b9b7",
  "d7e3bc",
  "ccc1d9",
  "b7dde8",
  "fbd5b5",
  "bfbfbf",
  "3f3f3f",
  "938953",
  "548dd4",
  "95b3d7",
  "d99694",
  "c3d69b",
  "b2a2c7",
  "92cddc",
  "fac08f",
  "a5a5a5",
  "262626",
  "494429",
  "17365d",
  "366092",
  "953734",
  "76923c",
  "5f497a",
  "31859b",
  "e36c09",
  "6e6e6e",
  "0c0c0c",
  "1d1b10",
  "0f243e",
  "244061",
  "632423",
  "4f6128",
  "3f3151",
  "205867",
  "974806"
], cv = ["c00000", "ff0000", "ffc000", "ffff00", "92d050", "00b050", "00b0f0", "0070c0", "002060", "7030a0"];
class vg extends fe {
  constructor() {
    super();
    M(this, "historyColorsKey", "historyColors");
    M(this, "historyColors", []);
    M(this, "iconSvg");
    M(this, "menuColorEL");
    M(this, "onColorItemClick");
    M(this, "onDefaultColorClick");
  }
  connectedCallback() {
    this.template = `
            <div class="colors-menu">
                <div class="currentColor">
                    <div class="colors-menu-icon">${this.iconSvg}</div>
                    <div class="colors-menu-status" id="menuColorEL"></div>
                </div>
                <div id="dropdown">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 14L8 10H16L12 14Z"></path></svg>
                </div>
            </div>
            `, super.connectedCallback();
    const n = localStorage.getItem(this.historyColorsKey);
    n && (this.historyColors = JSON.parse(n)), this.querySelector(".currentColor").addEventListener("click", () => {
      this.onColorItemClick(this.historyColors.length > 0 ? this.historyColors[0] : "#ccc");
    }), this.menuColorEL = this.querySelector("#menuColorEL"), this.historyColors && this.historyColors.length > 0 && (this.menuColorEL.style.background = this.historyColors[0]), Me(this.querySelector("#dropdown"), {
      content: this.createMenuElement(),
      placement: "bottom",
      trigger: "click",
      interactive: !0,
      arrow: !1
    });
  }
  createMenuElement() {
    const n = document.createElement("div");
    return n.style.height = "278px", n.style.width = "250px", n.classList.add("linwiteditor-dropdown-container"), n.innerHTML = `
        <div class="color-panel">
            <div class="color-panel-default-button" id="defaultColor">${te("default")}</div>
            <div style="display: flex;flex-wrap: wrap;padding-top: 5px">
                ${lv.map((r, i) => `<div class="color-item" data-color="#${r}" style="width: 18px;height:18px;margin:1px;padding:1px;border:1px solid #${i == 0 ? "efefef" : r};background: #${r}"></div>`).join(" ")}
            </div>
            <div class="color-panel-title">${te("standardColors")}</div>
            <div style="display: flex;flex-wrap: wrap;">
                ${cv.map((r) => `<div class="color-item" data-color="#${r}" style="width: 18px;height:18px;margin:1px;padding:1px;border:1px solid #${r};background: #${r}"></div>`).join(" ")}
            </div>
            <div class="color-panel-title">${te("historyColors")}</div>
            <div style="display: flex;flex-wrap: wrap;" id="history-colors">
               ${this.historyColors.map((r) => `<div class="history-color-item" data-color="${r}" style="width: 22px;height: 23px;margin: 1px;background: ${r}"></div>`).join(" ")}
            </div>
        </div>
        `, n.querySelector("#defaultColor").addEventListener("click", () => {
      this.onDefaultColorClick();
    }), n.querySelectorAll(".color-item").forEach((r) => {
      r.addEventListener("click", () => {
        this.invokeColorItemClick(n, r);
      }), r.addEventListener("mouseover", () => {
        r.style.border = "solid 1px #999";
      }), r.addEventListener("mouseout", () => {
        let i = r.getAttribute("data-color");
        i === "#ffffff" && (i = "#efefef"), r.style.border = `solid 1px ${i}`;
      });
    }), n.querySelector("#history-colors").addEventListener("click", (r) => {
      const i = r.target.closest(".history-color-item");
      i && this.invokeColorItemClick(n, i);
    }), n;
  }
  invokeColorItemClick(n, r) {
    const i = r.getAttribute("data-color");
    this.historyColors = this.historyColors.filter((o) => o !== i), this.historyColors.unshift(i), this.historyColors.length > 7 && (this.historyColors = this.historyColors.slice(0, 7)), n.querySelector("#history-colors").innerHTML = `
                ${this.historyColors.map((o) => `<div class="history-color-item" data-color="${o}" style="width: 22px;height: 23px;margin: 1px;background: ${o}"></div>`).join(" ")}
                `, localStorage.setItem(this.historyColorsKey, JSON.stringify(this.historyColors)), this.menuColorEL.style.background = i, this.onColorItemClick(i);
  }
}
let uv = class extends vg {
  constructor() {
    super(), this.historyColorsKey = "highlightHistoryColors", this.iconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.2427 4.51138L8.50547 11.2486L7.79836 13.3699L6.7574 14.4109L9.58583 17.2393L10.6268 16.1983L12.7481 15.4912L19.4853 8.75402L15.2427 4.51138ZM21.6066 8.04692C21.9972 8.43744 21.9972 9.0706 21.6066 9.46113L13.8285 17.2393L11.7071 17.9464L10.2929 19.3606C9.90241 19.7511 9.26925 19.7511 8.87872 19.3606L4.63608 15.118C4.24556 14.7275 4.24556 14.0943 4.63608 13.7038L6.0503 12.2896L6.7574 10.1682L14.5356 2.39006C14.9261 1.99954 15.5593 1.99954 15.9498 2.39006L21.6066 8.04692ZM15.2427 7.33981L16.6569 8.75402L11.7071 13.7038L10.2929 12.2896L15.2427 7.33981ZM4.28253 16.8858L7.11096 19.7142L5.69674 21.1284L1.4541 19.7142L4.28253 16.8858Z"></path></svg>', this.onDefaultColorClick = () => {
      var e;
      (e = this.editor) == null || e.chain().focus().unsetHighlight().run();
    }, this.onColorItemClick = (e) => {
      var n;
      (n = this.editor) == null || n.chain().focus().setHighlight({ color: e }).run();
    };
  }
  onActive(e) {
    return e.isActive("highlight");
  }
};
class dv extends vg {
  constructor() {
    super(), this.historyColorsKey = "fontHistoryColors", this.iconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.55446 22H3.40039L11.0004 3H13.0004L20.6004 22H18.4463L16.0463 16H7.95446L5.55446 22ZM8.75446 14H15.2463L12.0004 5.88517L8.75446 14Z"></path></svg>', this.onDefaultColorClick = () => {
      var e;
      (e = this.editor) == null || e.chain().focus().unsetColor().run();
    }, this.onColorItemClick = (e) => {
      var n;
      (n = this.editor) == null || n.chain().focus().setColor(e).run();
    };
  }
  onActive(e) {
    return e.isActive("textStyle");
  }
}
class pv extends fe {
  constructor() {
    super(), this.template = '<div no-hover style="width: 1px;display: flex"><div class="linwiteditor-menu-divider" /></div>';
  }
}
let _v = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
             <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 4H21V6H8V4ZM3 3.5H6V6.5H3V3.5ZM3 10.5H6V13.5H3V10.5ZM3 17.5H6V20.5H3V17.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleBulletList();
  }
  onActive(e) {
    return e.isActive("bulletList");
  }
}, mv = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
               <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 4H21V6H8V4ZM5 3V6H6V7H3V6H4V4H3V3H5ZM3 14V11.5H5V11H3V10H6V12.5H4V13H6V14H3ZM5 19.5H3V18.5H5V18H3V17H6V21H3V20H5V19.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleOrderedList();
  }
  onActive(e) {
    return e.isActive("orderedList");
  }
};
class fv extends fe {
  constructor() {
    super(), this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM3 12.5L7 9V16L3 12.5Z"></path></svg>
         </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.outdent();
  }
}
class gv extends fe {
  constructor() {
    super(), this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM3 19H21V21H3V19ZM11 14H21V16H11V14ZM11 9H21V11H11V9ZM7 12.5L3 16V9L7 12.5Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.indent();
  }
}
const hv = [
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z"></path></svg>',
    title: "align-left",
    value: "left"
  },
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z"></path></svg>',
    title: "align-center",
    value: "center"
  },
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM7 19H21V21H7V19ZM3 14H21V16H3V14ZM7 9H21V11H7V9Z"></path></svg>',
    title: "align-right",
    value: "right"
  },
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM3 19H21V21H3V19ZM3 14H21V16H3V14ZM3 9H21V11H3V9Z"></path></svg>',
    title: "align-justify",
    value: "justify"
  }
];
class Ev extends pi {
  constructor() {
    super(), this.menuData = hv.map((e) => ({ ...e, title: te(e.title) })), this.showItemsTip = !0;
  }
  onDropdownActive(e, n) {
    return e.isActive({ textAlign: this.menuData[n].value });
  }
  onDropdownItemClick(e) {
    this.editor.chain().focus().setTextAlign(this.menuData[e].value).run();
  }
  onDropdownItemRender(e) {
    return this.menuData[e].icon;
  }
  onMenuTextRender(e) {
    return this.menuData[e].icon;
  }
}
class To {
  constructor() {
    M(this, "tippyInstance");
    M(this, "content");
    M(this, "cancelText");
    M(this, "confirmText");
    M(this, "onConfirmClickFunc");
    M(this, "onCancelClickFunc");
    M(this, "onShowFunc");
  }
  setContent(e) {
    this.content = e;
  }
  onConfirmClick(e) {
    this.onConfirmClickFunc = e;
  }
  onCancelClick(e) {
    this.onCancelClickFunc = e;
  }
  onShow(e) {
    this.onShowFunc = e;
  }
  setTrigger(e, n = "bottom", r = "click") {
    this.tippyInstance = Me(e, {
      content: this.createContentElement(),
      appendTo: e.closest(".linwiteditor-container"),
      placement: n,
      trigger: r,
      interactive: !0,
      arrow: !1,
      onShow: (i) => {
        this.onShowFunc && this.onShowFunc(i);
      }
    });
  }
  show() {
    var e;
    (e = this.tippyInstance) == null || e.show();
  }
  hide() {
    var e;
    (e = this.tippyInstance) == null || e.hide();
  }
  createContentElement() {
    const e = `
            <div class="linwiteditor-popover">
              <div class="linwiteditor-popover-header">
               <svg class="linwiteditor-popover-header-close" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12.0007 10.5865L16.9504 5.63672L18.3646 7.05093L13.4149 12.0007L18.3646 16.9504L16.9504 18.3646L12.0007 13.4149L7.05093 18.3646L5.63672 16.9504L10.5865 12.0007L5.63672 7.05093L7.05093 5.63672L12.0007 10.5865Z"></path></svg>
              </div>
              <div class="linwiteditor-popover-content">${this.content}</div>
              <div class="linwiteditor-popover-footer">
              <button class="linwiteditor-popover-footer-cancel" type="button">${this.cancelText ? this.cancelText : te("cancel")}</button>
              <button class="linwiteditor-popover-footer-confirm" type="button">${this.confirmText ? this.confirmText : te("confirm")}</button>
              </div>
            </div>
        `, n = document.createElement("div");
    return n.innerHTML = e, n.querySelector(".linwiteditor-popover-header-close").addEventListener("click", () => {
      this.tippyInstance.hide();
    }), n.querySelector(".linwiteditor-popover-footer-confirm").addEventListener("click", () => {
      this.onConfirmClickFunc && this.onConfirmClickFunc(this.tippyInstance), this.tippyInstance.hide();
    }), n.querySelector(".linwiteditor-popover-footer-cancel").addEventListener("click", () => {
      this.onCancelClickFunc && this.onCancelClickFunc(this.tippyInstance), this.tippyInstance.hide();
    }), n;
  }
}
let Sv = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.6572 14.8282L16.2429 13.414L17.6572 11.9998C19.2193 10.4377 19.2193 7.90506 17.6572 6.34296C16.0951 4.78086 13.5624 4.78086 12.0003 6.34296L10.5861 7.75717L9.17188 6.34296L10.5861 4.92875C12.9292 2.5856 16.7282 2.5856 19.0714 4.92875C21.4145 7.27189 21.4145 11.0709 19.0714 13.414L17.6572 14.8282ZM14.8287 17.6567L13.4145 19.0709C11.0714 21.414 7.27238 21.414 4.92923 19.0709C2.58609 16.7277 2.58609 12.9287 4.92923 10.5856L6.34345 9.17139L7.75766 10.5856L6.34345 11.9998C4.78135 13.5619 4.78135 16.0946 6.34345 17.6567C7.90555 19.2188 10.4382 19.2188 12.0003 17.6567L13.4145 16.2425L14.8287 17.6567ZM14.8287 7.75717L16.2429 9.17139L9.17188 16.2425L7.75766 14.8282L14.8287 7.75717Z"></path></svg>
        </div>
        `;
  }
  connectedCallback() {
    super.connectedCallback();
    const e = new To();
    e.setContent(`
            <div style="width: 250px">${te("link-address")}</div>
             <div style="width: 250px">
             <input type="text" id="href" style="width: 250px">
            </div>
            
            <div style="margin-top: 10px">${te("link-open-type")}</div>
            <div>
            <select id="target" style="width: 250px">
               <option value="">${te("default")}</option>
               <option value="_blank">${te("link-open-blank")}</option>
            </select>
            </div>
        `), e.onConfirmClick((n) => {
      var o, a;
      const r = n.popper.querySelector("#href").value;
      if (r.trim() === "") {
        (o = this.editor) == null || o.chain().focus().extendMarkRange("link").unsetLink().run();
        return;
      }
      let i = n.popper.querySelector("#target").value;
      i.trim() === "" && (i = null), (a = this.editor) == null || a.chain().focus().extendMarkRange("link").setLink({
        href: r,
        target: i,
        rel: null
      }).run();
    }), e.onShow((n) => {
      var i;
      const r = (i = this.editor) == null ? void 0 : i.getAttributes("link");
      r && r.href ? n.popper.querySelector("#href").value = r.href : n.popper.querySelector("#href").value = "", r && r.target ? n.popper.querySelector("#target").value = r.target : n.popper.querySelector("#target").value = "";
    }), e.setTrigger(this.querySelector("div"), "bottom");
  }
  onActive(e) {
    return e.isActive("link");
  }
};
class bv extends fe {
  constructor() {
    super(), this.template = `
        <div>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M2 4C2 3.44772 2.44772 3 3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4ZM4 19H20V9H4V19ZM11 13H6V17H11V13Z"></path></svg>
        </div>
        `;
  }
  connectedCallback() {
    super.connectedCallback();
    const e = new To();
    e.setContent(`
            <div style="padding: 10px 10px 0 0;width: 850px;max-width: calc(100% - 10px);">
                <textarea id="source-code" style="width: 100%; height: 260px;"></textarea>
            </div>
        `), e.onConfirmClick((n) => {
      var i;
      const r = n.popper.querySelector("#source-code");
      (i = this.editor) == null || i.commands.setContent(r.value);
    }), e.onShow((n) => {
      var r;
      n.popper.querySelector("#source-code").value = ((r = this.editor) == null ? void 0 : r.getHTML()) || "";
    }), e.setTrigger(this.querySelector("div"), "bottom");
  }
}
class Tv extends fe {
  constructor() {
    super(), this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleTaskList();
  }
  onActive(e) {
    return e.isActive("taskList");
  }
}
const Cv = ["1.0", "1.25", "1.5", "2.0", "2.5", "3.0"];
class yv extends pi {
  constructor() {
    super(), this.refreshMenuText = !1, this.dropDivWith = "70px", this.width = "36px", this.menuTextWidth = "20px";
  }
  onCreate(e, n) {
    var r;
    super.onCreate(e, n), this.menuData = ((r = n.lineHeight) == null ? void 0 : r.values) || Cv;
  }
  onDropdownActive(e, n) {
    let r = null;
    return e.isActive("paragraph") ? r = e.getAttributes("paragraph").lineHeight : e.isActive("heading") && (r = e.getAttributes("heading").lineHeight), !!(r && r === `${(Number(this.menuData[n]) * 100).toFixed(0)}%`);
  }
  onDropdownItemClick(e) {
    const n = `${(Number(this.menuData[e]) * 100).toFixed(0)}%`;
    this.editor.chain().setLineHeight(n).run();
  }
  onDropdownItemRender(e) {
    return this.menuData[e];
  }
  onMenuTextRender(e) {
    return `
              <div style="width:18px;height: 18px;">
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 4H21V6H11V4ZM6 7V11H4V7H1L5 3L9 7H6ZM6 17H9L5 21L1 17H4V13H6V17ZM11 18H21V20H11V18ZM9 11H21V13H9V11Z"></path></svg>
              </div>
         `;
  }
}
class vv extends fe {
  constructor() {
    super(), this.template = `
        <div>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.58341 17.3211C3.55316 16.2275 3 15 3 13.0104C3 9.51092 5.45651 6.37372 9.03059 4.82324L9.92328 6.20085C6.58804 8.00545 5.93618 10.3461 5.67564 11.8221C6.21263 11.5444 6.91558 11.4467 7.60471 11.5106C9.40908 11.6778 10.8312 13.1591 10.8312 15C10.8312 16.933 9.26416 18.5 7.33116 18.5C6.2581 18.5 5.23196 18.0096 4.58341 17.3211ZM14.5834 17.3211C13.5532 16.2275 13 15 13 13.0104C13 9.51092 15.4565 6.37372 19.0306 4.82324L19.9233 6.20085C16.588 8.00545 15.9362 10.3461 15.6756 11.8221C16.2126 11.5444 16.9156 11.4467 17.6047 11.5106C19.4091 11.6778 20.8312 13.1591 20.8312 15C20.8312 16.933 19.2642 18.5 17.3312 18.5C16.2581 18.5 15.232 18.0096 14.5834 17.3211Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleBlockquote();
  }
  onActive(e) {
    return e.isActive("blockquote");
  }
}
let Rv = class extends fe {
  constructor() {
    super();
    M(this, "fileInput");
    this.template = `
        <div>
        <input type="file" accept="image/*" multiple  style="display: none">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.9918 21C2.44405 21 2 20.5551 2 20.0066V3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918ZM20 15V5H4V19L14 9L20 15ZM20 17.8284L14 11.8284L6.82843 19H20V17.8284ZM8 11C6.89543 11 6 10.1046 6 9C6 7.89543 6.89543 7 8 7C9.10457 7 10 7.89543 10 9C10 10.1046 9.10457 11 8 11Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  registerClickListener() {
    this.addEventListener("click", () => {
      var n, r, i;
      (r = (n = this.options) == null ? void 0 : n.image) != null && r.customMenuInvoke ? this.options.image.customMenuInvoke(this.editor.linwitDocEditor) : (i = this.fileInput) == null || i.click();
    });
  }
  connectedCallback() {
    var n, r;
    super.connectedCallback(), (r = (n = this.options) == null ? void 0 : n.image) != null && r.customMenuInvoke ? this.querySelector("input").remove() : (this.fileInput = this.querySelector("input"), this.fileInput.addEventListener("change", () => {
      var o, a;
      const i = (o = this.fileInput) == null ? void 0 : o.files;
      if (i && i.length > 0)
        for (let s of i)
          (a = this.editor) == null || a.commands.uploadImage(s);
      this.fileInput.value = "";
    }));
  }
};
class Ov extends fe {
  constructor() {
    super();
    M(this, "fileInput");
    this.template = `
        <div>
        <input type="file" accept="video/*" style="display: none">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M2 3.9934C2 3.44476 2.45531 3 2.9918 3H21.0082C21.556 3 22 3.44495 22 3.9934V20.0066C22 20.5552 21.5447 21 21.0082 21H2.9918C2.44405 21 2 20.5551 2 20.0066V3.9934ZM4 5V19H20V5H4ZM10.6219 8.41459L15.5008 11.6672C15.6846 11.7897 15.7343 12.0381 15.6117 12.2219C15.5824 12.2658 15.5447 12.3035 15.5008 12.3328L10.6219 15.5854C10.4381 15.708 10.1897 15.6583 10.0672 15.4745C10.0234 15.4088 10 15.3316 10 15.2526V8.74741C10 8.52649 10.1791 8.34741 10.4 8.34741C10.479 8.34741 10.5562 8.37078 10.6219 8.41459Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  connectedCallback() {
    var n, r;
    super.connectedCallback(), (r = (n = this.options) == null ? void 0 : n.video) != null && r.customMenuInvoke ? this.querySelector("input").remove() : (this.fileInput = this.querySelector("input"), this.fileInput.addEventListener("change", () => {
      var o, a;
      const i = (o = this.fileInput) == null ? void 0 : o.files;
      if (i && i.length > 0)
        for (let s of i)
          (a = this.editor) == null || a.commands.uploadVideo(s);
      this.fileInput.value = "";
    }));
  }
  // @ts-ignore
  onClick(n) {
    var r, i, o;
    (i = (r = this.options) == null ? void 0 : r.video) != null && i.customMenuInvoke ? this.options.video.customMenuInvoke(this.editor.linwitDocEditor) : (o = this.fileInput) == null || o.click();
  }
}
let Nv = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M23 11.9998L15.9289 19.0708L14.5147 17.6566L20.1716 11.9998L14.5147 6.34292L15.9289 4.92871L23 11.9998ZM3.82843 11.9998L9.48528 17.6566L8.07107 19.0708L1 11.9998L8.07107 4.92871L9.48528 6.34292L3.82843 11.9998Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleCode();
  }
  onActive(e) {
    return e.isActive("code");
  }
}, Av = class extends fe {
  constructor() {
    super(), this.template = `
        <div>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M3.41436 5.99995L5.70726 3.70706L4.29304 2.29285L0.585938 5.99995L4.29304 9.70706L5.70726 8.29285L3.41436 5.99995ZM9.58594 5.99995L7.29304 3.70706L8.70726 2.29285L12.4144 5.99995L8.70726 9.70706L7.29304 8.29285L9.58594 5.99995ZM14.0002 2.99995H21.0002C21.5524 2.99995 22.0002 3.44767 22.0002 3.99995V20C22.0002 20.5522 21.5524 21 21.0002 21H3.00015C2.44787 21 2.00015 20.5522 2.00015 20V12H4.00015V19H20.0002V4.99995H14.0002V2.99995Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.toggleCodeBlock();
  }
  onActive(e) {
    return e.isActive("codeBlock");
  }
};
class Iv extends fe {
  constructor() {
    super(), this.template = `
        <div>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.9999 18.9967H20.9999V20.9967H11.9999L8.00229 20.9992L1.51457 14.5115C1.12405 14.1209 1.12405 13.4878 1.51457 13.0972L12.1212 2.49065C12.5117 2.10012 13.1449 2.10012 13.5354 2.49065L21.3136 10.2688C21.7041 10.6593 21.7041 11.2925 21.3136 11.683L13.9999 18.9967ZM15.6567 14.5115L19.1922 10.9759L12.8283 4.61197L9.29275 8.1475L15.6567 14.5115Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.unsetAllMarks();
  }
}
class xv extends fe {
  constructor() {
    super(), this.template = `
        <div>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2 11H4V13H2V11ZM6 11H18V13H6V11ZM20 11H22V13H20V11Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.setHorizontalRule();
  }
}
let Dv = class extends fe {
  constructor() {
    super();
    M(this, "instance");
    this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 10H10V14H14V10ZM16 10V14H19V10H16ZM14 19V16H10V19H14ZM16 19H19V16H16V19ZM14 5H10V8H14V5ZM16 5V8H19V5H16ZM8 10H5V14H8V10ZM8 19V16H5V19H8ZM8 5H5V8H8V5ZM4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3Z"></path></svg>
        </div>
        `;
  }
  connectedCallback() {
    super.connectedCallback(), this.instance = Me(this.querySelector("svg"), {
      content: this.createMenuElement(),
      appendTo: this.closest(".linwiteditor-container"),
      placement: "bottom",
      trigger: "click",
      interactive: !0,
      arrow: !1
    });
  }
  createMenuElement() {
    const n = document.createElement("div");
    n.classList.add("linwiteditor-dropdown-container"), n.innerHTML = `
        <div style="margin: 5px">
            <div style="padding: 5px 0;font-size: 14px;display: flex"><span>${te("insertTable")}</span><span style="margin-left: auto" id="columnRows"></span></div>
            <div style="display: flex;flex-wrap: wrap;width: 240px;height: 200px" id="table-cells">
            ${[...Array(8).keys()].map((i, o) => [...Array(10).keys()].map((a, s) => `<div data-i="${o}" data-j="${s}" class="table-cell" style="width: 20px;height: 20px;margin:1px;"></div>`).join("")).join("")}
            </div>
        </div>
        `;
    const r = n.querySelector("#table-cells");
    return r.addEventListener("click", (i) => {
      var a, s;
      const o = i.target.closest(".table-cell");
      if (o) {
        let l = o.getAttribute("data-i"), c = o.getAttribute("data-j");
        (a = this.editor) == null || a.commands.insertTable({ rows: Number(l) + 1, cols: Number(c) + 1, withHeaderRow: !0 }), (s = this.instance) == null || s.hide();
      }
    }), r.addEventListener("mouseover", (i) => {
      const o = i.target.closest(".table-cell");
      if (o) {
        let a = Number(o.getAttribute("data-i")), s = Number(o.getAttribute("data-j"));
        const l = r.querySelectorAll("div"), c = n.querySelector("#columnRows");
        c.textContent = `${a + 1} ${te("row")} x ${s + 1} ${te("column")}`, l.forEach((u) => {
          let d = Number(u.getAttribute("data-i")), p = Number(u.getAttribute("data-j"));
          d <= a && p <= s ? u.classList.add("active") : u.classList.remove("active");
        });
      }
    }), r.addEventListener("mouseleave", () => {
      r.querySelectorAll("div").forEach((a) => {
        a.classList.remove("active");
      });
      const o = n.querySelector("#columnRows");
      o.textContent = "";
    }), n;
  }
};
class wv extends fe {
  constructor() {
    super(), this.template = `
        <div>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 18H16.5C17.8807 18 19 16.8807 19 15.5C19 14.1193 17.8807 13 16.5 13H3V11H16.5C18.9853 11 21 13.0147 21 15.5C21 17.9853 18.9853 20 16.5 20H15V22L11 19L15 16V18ZM3 4H21V6H3V4ZM9 18V20H3V18H9Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    e.setHardBreak();
  }
}
class Mv extends fe {
  constructor() {
    super();
    M(this, "fileInput");
    this.template = `
        <div>
        <input type="file" style="display: none">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.8287 7.7574L9.1718 13.4143C8.78127 13.8048 8.78127 14.4379 9.1718 14.8285C9.56232 15.219 10.1955 15.219 10.586 14.8285L16.2429 9.17161C17.4144 8.00004 17.4144 6.10055 16.2429 4.92897C15.0713 3.7574 13.1718 3.7574 12.0002 4.92897L6.34337 10.5858C4.39075 12.5384 4.39075 15.7043 6.34337 17.6569C8.29599 19.6095 11.4618 19.6095 13.4144 17.6569L19.0713 12L20.4855 13.4143L14.8287 19.0711C12.095 21.8048 7.66283 21.8048 4.92916 19.0711C2.19549 16.3374 2.19549 11.9053 4.92916 9.17161L10.586 3.51476C12.5386 1.56214 15.7045 1.56214 17.6571 3.51476C19.6097 5.46738 19.6097 8.63321 17.6571 10.5858L12.0002 16.2427C10.8287 17.4143 8.92916 17.4143 7.75759 16.2427C6.58601 15.0711 6.58601 13.1716 7.75759 12L13.4144 6.34319L14.8287 7.7574Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  connectedCallback() {
    var n, r;
    super.connectedCallback(), (r = (n = this.options) == null ? void 0 : n.attachment) != null && r.customMenuInvoke ? this.querySelector("input").remove() : (this.fileInput = this.querySelector("input"), this.fileInput.addEventListener("change", () => {
      var o, a;
      const i = (o = this.fileInput) == null ? void 0 : o.files;
      if (i && i.length > 0)
        for (let s of i)
          (a = this.editor) == null || a.commands.uploadAttachment(s);
      this.fileInput.value = "";
    }));
  }
  // @ts-ignore
  onClick(n) {
    var r, i, o;
    (i = (r = this.options) == null ? void 0 : r.attachment) != null && i.customMenuInvoke ? this.options.attachment.customMenuInvoke(this.editor.linwitDocEditor) : (o = this.fileInput) == null || o.click();
  }
}
class Lv extends fe {
  constructor() {
    super();
    M(this, "fullscreenSvg", '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 3V5H4V9H2V3H8ZM2 21V15H4V19H8V21H2ZM22 21H16V19H20V15H22V21ZM22 9H20V5H16V3H22V9Z"></path></svg>');
    M(this, "fullscreenExitSvg", '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 7H22V9H16V3H18V7ZM8 9H2V7H6V3H8V9ZM18 17V21H16V15H22V17H18ZM8 15V21H6V17H2V15H8Z"></path></svg>');
    M(this, "isFullscreen", !1);
    this.template = `
        <div>
        ${this.fullscreenSvg}
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(n) {
    var i;
    const r = this.closest(".linwiteditor-container");
    this.isFullscreen ? (r.style.height = "100%", r.style.width = "", r.style.background = "", r.style.position = "", r.style.top = "", r.style.left = "", r.style.zIndex = "") : (r.style.height = "calc(100vh - 2px)", r.style.width = "calc(100% - 2px)", r.style.position = "fixed", r.style.top = "0", r.style.left = "0", r.style.zIndex = "9999"), this.isFullscreen = !this.isFullscreen, this.querySelector("div").innerHTML = this.isFullscreen ? this.fullscreenExitSvg : this.fullscreenSvg, (i = this.options) != null && i.onFullscreen && this.options.onFullscreen(this.isFullscreen);
  }
}
class kv extends fe {
  constructor() {
    super(), this.template = `
        <div>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 2C17.5523 2 18 2.44772 18 3V7H21C21.5523 7 22 7.44772 22 8V18C22 18.5523 21.5523 19 21 19H18V21C18 21.5523 17.5523 22 17 22H7C6.44772 22 6 21.5523 6 21V19H3C2.44772 19 2 18.5523 2 18V8C2 7.44772 2.44772 7 3 7H6V3C6 2.44772 6.44772 2 7 2H17ZM16 17H8V20H16V17ZM20 9H4V17H6V16C6 15.4477 6.44772 15 7 15H17C17.5523 15 18 15.4477 18 16V17H20V9ZM8 10V12H5V10H8ZM16 4H8V7H16V4Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    let n = this.closest(".linwiteditor-container").querySelector(".linwiteditor-content").innerHTML;
    n = `<div class="linwiteditor-container" style="border: none;padding: 0;margin: 0"><div class="linwiteditor-content" style="border: none;height: auto;overflow: visible">${n}</div></div>`;
    const i = Array.from(document.querySelectorAll("style, link")).map((l) => l.outerHTML).join("") + n, o = document.createElement("iframe");
    o.id = "linwiteditor-print-iframe", o.setAttribute("style", "position: absolute; width: 0; height: 0; top: -10px; left: -10px;"), document.body.appendChild(o);
    const a = o.contentWindow, s = o.contentDocument || o.contentWindow && o.contentWindow.document;
    s && (s.open(), s.write(i), s.close()), a && (o.onload = function() {
      try {
        setTimeout(() => {
          a.focus();
          try {
            a.document.execCommand("print", !1) || a.print();
          } catch {
            a.print();
          }
          a.close();
        }, 10);
      } catch (l) {
        console.error(l);
      }
      setTimeout(function() {
        document.body.removeChild(o);
      }, 100);
    });
  }
}
const Wp = [
  "😀",
  "😃",
  "😄",
  "😁",
  "😆",
  "😅",
  "🤣",
  "😂",
  "🙂",
  "🙃",
  "😉",
  "😊",
  "😇",
  "🥰",
  "😍",
  "🤩",
  "😘",
  "😗",
  "😚",
  "😙",
  "🥲",
  "😋",
  "😛",
  "😜",
  "🤪",
  "😝",
  "🤑",
  "🤗",
  "🤭",
  "🤫",
  "🤔",
  "🤐",
  "🤨",
  "😐",
  "😑",
  "😶",
  "😶‍🌫",
  "😏",
  "😒",
  "🙄",
  "😬",
  "😮‍💨",
  "🤥",
  "😌",
  "😔",
  "😪",
  "🤤",
  "😴",
  "😷",
  "🤒",
  "🤕",
  "🤢",
  "🤮",
  "🤧",
  "🥵",
  "🥶",
  "🥴",
  "😵",
  "😵‍💫",
  "🤯",
  "🤠",
  "🥳",
  "🥸",
  "😎",
  "🤓",
  "🧐",
  "😕",
  "😟",
  "🙁",
  "😮",
  "😲",
  "😳",
  "🥺",
  "😦",
  "😧",
  "😨",
  "😰",
  "😥",
  "😢",
  "😭",
  "😱",
  "😖",
  "😣",
  "😞",
  "😓",
  "😩",
  "😫",
  "🥱",
  "😤",
  "😡",
  "😠",
  "🤬",
  "😈",
  "👿",
  "💀",
  "☠️",
  "💩",
  "🤡",
  "👹",
  "👺",
  "👻",
  "👽",
  "👾",
  "🤖",
  "😺",
  "😸",
  "😹",
  "😻",
  "😼",
  "😽",
  "🙀",
  "😿",
  "😾",
  "👍",
  "👎",
  "🙏",
  "🙈",
  "🙉",
  "🙊",
  "💌",
  "💘",
  "💝",
  "💖",
  "💗",
  "💓",
  "💞",
  "💕",
  "💟",
  "❣️",
  "💔",
  "💋",
  "💯",
  "💢",
  "💥",
  "💫",
  "💦",
  "💨",
  "💤"
];
class Pv extends fe {
  constructor() {
    super();
    M(this, "emojis", Wp);
    M(this, "tippy");
    this.template = `
        <div>
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM8 13H16C16 15.2091 14.2091 17 12 17C9.79086 17 8 15.2091 8 13ZM8 11C7.17157 11 6.5 10.3284 6.5 9.5C6.5 8.67157 7.17157 8 8 8C8.82843 8 9.5 8.67157 9.5 9.5C9.5 10.3284 8.82843 11 8 11ZM16 11C15.1716 11 14.5 10.3284 14.5 9.5C14.5 8.67157 15.1716 8 16 8C16.8284 8 17.5 8.67157 17.5 9.5C17.5 10.3284 16.8284 11 16 11Z"></path></svg>
        </div>
        `;
  }
  onCreate(n, r) {
    var i;
    super.onCreate(n, r), this.emojis = ((i = r.emoji) == null ? void 0 : i.values) || Wp;
  }
  connectedCallback() {
    super.connectedCallback(), this.tippy = Me(this.querySelector("svg"), {
      content: this.createMenuElement(),
      appendTo: this.closest(".linwiteditor-container"),
      placement: "bottom",
      trigger: "click",
      interactive: !0,
      arrow: !1
    });
  }
  createMenuElement() {
    const n = document.createElement("div");
    n.style.maxWidth = "450px", n.style.overflow = "hidden", n.style.display = "flex", n.style.justifyContent = "center";
    const r = this.getSize();
    return n.classList.add("linwiteditor-dropdown-container"), n.innerHTML = `
            <div class="emoji-cells">
            ${this.emojis.map((i) => `<div  class="emoji-cell" style="width: ${r}px;height: ${r}px;font-size: ${r - 2}px;"><span>${i}</span></div>`).join("")}
            </div>
        `, n.querySelector(".emoji-cells").addEventListener("click", (i) => {
      var a, s;
      const o = i.target.closest(".emoji-cell");
      o && ((a = this.editor) == null || a.commands.insertContent(o.querySelector("span").innerHTML), (s = this.tippy) == null || s.hide());
    }), n;
  }
  getSize() {
    const n = this.editor.linwitDocEditor.options;
    return n.toolbarSize === "large" ? 30 : n.toolbarSize === "medium" ? 25 : 20;
  }
}
class Fv extends fe {
  constructor() {
    super(), this.template = '<div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 4.99658V7.99658H19V4.99658H5ZM4 2.99658H20C20.5523 2.99658 21 3.4443 21 3.99658V8.99658C21 9.54887 20.5523 9.99658 20 9.99658H4C3.44772 9.99658 3 9.54887 3 8.99658V3.99658C3 3.4443 3.44772 2.99658 4 2.99658ZM6 11.9966H12C12.5523 11.9966 13 12.4443 13 12.9966V15.9966H14V21.9966H10V15.9966H11V13.9966H5C4.44772 13.9966 4 13.5489 4 12.9966V10.9966H6V11.9966ZM17.7322 13.7288L19.5 11.961L21.2678 13.7288C22.2441 14.7051 22.2441 16.288 21.2678 17.2643C20.2915 18.2407 18.7085 18.2407 17.7322 17.2643C16.7559 16.288 16.7559 14.7051 17.7322 13.7288Z"></path></svg></div>', this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    var n;
    e.setPainter((n = this.editor) == null ? void 0 : n.state.selection.$head.marks());
  }
}
class Co {
  constructor(e, n, r) {
    M(this, "editor");
    M(this, "globalConfig");
    M(this, "aiModelName");
    M(this, "aiModelConfig");
    this.editor = e, this.globalConfig = n, this.aiModelName = r, this.aiModelConfig = n.models[r];
  }
  chatWithPayload(e, n) {
    const r = (o) => {
      this.createAiClient(o, n).start(typeof e == "string" ? e : JSON.stringify(e));
    }, i = () => {
      n == null || n.onStop();
    };
    this.globalConfig.onCreateClientUrl ? this.globalConfig.onCreateClientUrl(this.aiModelName, this.aiModelConfig, r, i) : r(this.createAiClientUrl());
  }
  chat(e, n, r) {
    const i = (a) => {
      const s = this.createAiClient(a, r), l = n.includes("{content}") ? n.split("{content}").join(e) : `${e ? e + `
` : ""}${n}`, c = this.wrapPayload(l);
      s.start(typeof c == "string" ? c : JSON.stringify(c));
    }, o = () => {
      r == null || r.onStop();
    };
    this.globalConfig.onCreateClientUrl ? this.globalConfig.onCreateClientUrl(this.aiModelName, this.aiModelConfig, i, o) : i(this.createAiClientUrl());
  }
}
class Rg {
  constructor(e, n) {
    M(this, "isStop", !1);
    M(this, "url");
    M(this, "webSocket");
    M(this, "isOpen", !1);
    M(this, "payload");
    M(this, "listener");
    this.url = e, this.listener = n;
  }
  start(e) {
    this.listener.onStart(this), this.payload = e, this.webSocket = new WebSocket(this.url), this.webSocket.onopen = (n) => this.onOpen(n), this.webSocket.onmessage = (n) => this.onMessage(n), this.webSocket.onclose = (n) => this.onClose(n), this.webSocket.onerror = (n) => this.onError(n);
  }
  stop() {
    this.webSocket && (this.webSocket.close(), this.webSocket = void 0, this.isStop || (this.listener.onStop(), this.isStop = !0));
  }
  send(e) {
    this.webSocket && this.isOpen && this.webSocket.send(e);
  }
  onOpen(e) {
    this.isOpen = !0, this.send(this.payload);
  }
  onMessage(e) {
    this.listener.onMessage(e.data);
  }
  onClose(e) {
    this.isOpen = !1, this.isStop || (this.listener.onStop(), this.isStop = !0);
  }
  onError(e) {
    this.isOpen = !1, this.isStop || (this.listener.onStop(), this.isStop = !0);
  }
}
var kn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function Ds(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function Bv(t) {
  if (t.__esModule) return t;
  var e = t.default;
  if (typeof e == "function") {
    var n = function r() {
      return this instanceof r ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
    };
    n.prototype = e.prototype;
  } else n = {};
  return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(t).forEach(function(r) {
    var i = Object.getOwnPropertyDescriptor(t, r);
    Object.defineProperty(n, r, i.get ? i : {
      enumerable: !0,
      get: function() {
        return t[r];
      }
    });
  }), n;
}
var Og = { exports: {} };
function Uv(t) {
  throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var gl = { exports: {} };
const Hv = {}, Gv = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: Hv
}, Symbol.toStringTag, { value: "Module" })), Vv = /* @__PURE__ */ Bv(Gv);
var Kp;
function ws() {
  return Kp || (Kp = 1, function(t, e) {
    (function(n, r) {
      t.exports = r();
    })(kn, function() {
      var n = n || function(r, i) {
        var o;
        if (typeof window < "u" && window.crypto && (o = window.crypto), typeof self < "u" && self.crypto && (o = self.crypto), typeof globalThis < "u" && globalThis.crypto && (o = globalThis.crypto), !o && typeof window < "u" && window.msCrypto && (o = window.msCrypto), !o && typeof kn < "u" && kn.crypto && (o = kn.crypto), !o && typeof Uv == "function")
          try {
            o = Vv;
          } catch {
          }
        var a = function() {
          if (o) {
            if (typeof o.getRandomValues == "function")
              try {
                return o.getRandomValues(new Uint32Array(1))[0];
              } catch {
              }
            if (typeof o.randomBytes == "function")
              try {
                return o.randomBytes(4).readInt32LE();
              } catch {
              }
          }
          throw new Error("Native crypto module could not be used to get secure random number.");
        }, s = Object.create || /* @__PURE__ */ function() {
          function E() {
          }
          return function(b) {
            var h;
            return E.prototype = b, h = new E(), E.prototype = null, h;
          };
        }(), l = {}, c = l.lib = {}, u = c.Base = /* @__PURE__ */ function() {
          return {
            /**
             * Creates a new object that inherits from this object.
             *
             * @param {Object} overrides Properties to copy into the new object.
             *
             * @return {Object} The new object.
             *
             * @static
             *
             * @example
             *
             *     var MyType = CryptoJS.lib.Base.extend({
             *         field: 'value',
             *
             *         method: function () {
             *         }
             *     });
             */
            extend: function(E) {
              var b = s(this);
              return E && b.mixIn(E), (!b.hasOwnProperty("init") || this.init === b.init) && (b.init = function() {
                b.$super.init.apply(this, arguments);
              }), b.init.prototype = b, b.$super = this, b;
            },
            /**
             * Extends this object and runs the init method.
             * Arguments to create() will be passed to init().
             *
             * @return {Object} The new object.
             *
             * @static
             *
             * @example
             *
             *     var instance = MyType.create();
             */
            create: function() {
              var E = this.extend();
              return E.init.apply(E, arguments), E;
            },
            /**
             * Initializes a newly created object.
             * Override this method to add some logic when your objects are created.
             *
             * @example
             *
             *     var MyType = CryptoJS.lib.Base.extend({
             *         init: function () {
             *             // ...
             *         }
             *     });
             */
            init: function() {
            },
            /**
             * Copies properties into this object.
             *
             * @param {Object} properties The properties to mix in.
             *
             * @example
             *
             *     MyType.mixIn({
             *         field: 'value'
             *     });
             */
            mixIn: function(E) {
              for (var b in E)
                E.hasOwnProperty(b) && (this[b] = E[b]);
              E.hasOwnProperty("toString") && (this.toString = E.toString);
            },
            /**
             * Creates a copy of this object.
             *
             * @return {Object} The clone.
             *
             * @example
             *
             *     var clone = instance.clone();
             */
            clone: function() {
              return this.init.prototype.extend(this);
            }
          };
        }(), d = c.WordArray = u.extend({
          /**
           * Initializes a newly created word array.
           *
           * @param {Array} words (Optional) An array of 32-bit words.
           * @param {number} sigBytes (Optional) The number of significant bytes in the words.
           *
           * @example
           *
           *     var wordArray = CryptoJS.lib.WordArray.create();
           *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
           *     var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
           */
          init: function(E, b) {
            E = this.words = E || [], b != i ? this.sigBytes = b : this.sigBytes = E.length * 4;
          },
          /**
           * Converts this word array to a string.
           *
           * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
           *
           * @return {string} The stringified word array.
           *
           * @example
           *
           *     var string = wordArray + '';
           *     var string = wordArray.toString();
           *     var string = wordArray.toString(CryptoJS.enc.Utf8);
           */
          toString: function(E) {
            return (E || _).stringify(this);
          },
          /**
           * Concatenates a word array to this word array.
           *
           * @param {WordArray} wordArray The word array to append.
           *
           * @return {WordArray} This word array.
           *
           * @example
           *
           *     wordArray1.concat(wordArray2);
           */
          concat: function(E) {
            var b = this.words, h = E.words, T = this.sigBytes, C = E.sigBytes;
            if (this.clamp(), T % 4)
              for (var v = 0; v < C; v++) {
                var I = h[v >>> 2] >>> 24 - v % 4 * 8 & 255;
                b[T + v >>> 2] |= I << 24 - (T + v) % 4 * 8;
              }
            else
              for (var N = 0; N < C; N += 4)
                b[T + N >>> 2] = h[N >>> 2];
            return this.sigBytes += C, this;
          },
          /**
           * Removes insignificant bits.
           *
           * @example
           *
           *     wordArray.clamp();
           */
          clamp: function() {
            var E = this.words, b = this.sigBytes;
            E[b >>> 2] &= 4294967295 << 32 - b % 4 * 8, E.length = r.ceil(b / 4);
          },
          /**
           * Creates a copy of this word array.
           *
           * @return {WordArray} The clone.
           *
           * @example
           *
           *     var clone = wordArray.clone();
           */
          clone: function() {
            var E = u.clone.call(this);
            return E.words = this.words.slice(0), E;
          },
          /**
           * Creates a word array filled with random bytes.
           *
           * @param {number} nBytes The number of random bytes to generate.
           *
           * @return {WordArray} The random word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.lib.WordArray.random(16);
           */
          random: function(E) {
            for (var b = [], h = 0; h < E; h += 4)
              b.push(a());
            return new d.init(b, E);
          }
        }), p = l.enc = {}, _ = p.Hex = {
          /**
           * Converts a word array to a hex string.
           *
           * @param {WordArray} wordArray The word array.
           *
           * @return {string} The hex string.
           *
           * @static
           *
           * @example
           *
           *     var hexString = CryptoJS.enc.Hex.stringify(wordArray);
           */
          stringify: function(E) {
            for (var b = E.words, h = E.sigBytes, T = [], C = 0; C < h; C++) {
              var v = b[C >>> 2] >>> 24 - C % 4 * 8 & 255;
              T.push((v >>> 4).toString(16)), T.push((v & 15).toString(16));
            }
            return T.join("");
          },
          /**
           * Converts a hex string to a word array.
           *
           * @param {string} hexStr The hex string.
           *
           * @return {WordArray} The word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.enc.Hex.parse(hexString);
           */
          parse: function(E) {
            for (var b = E.length, h = [], T = 0; T < b; T += 2)
              h[T >>> 3] |= parseInt(E.substr(T, 2), 16) << 24 - T % 8 * 4;
            return new d.init(h, b / 2);
          }
        }, m = p.Latin1 = {
          /**
           * Converts a word array to a Latin1 string.
           *
           * @param {WordArray} wordArray The word array.
           *
           * @return {string} The Latin1 string.
           *
           * @static
           *
           * @example
           *
           *     var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
           */
          stringify: function(E) {
            for (var b = E.words, h = E.sigBytes, T = [], C = 0; C < h; C++) {
              var v = b[C >>> 2] >>> 24 - C % 4 * 8 & 255;
              T.push(String.fromCharCode(v));
            }
            return T.join("");
          },
          /**
           * Converts a Latin1 string to a word array.
           *
           * @param {string} latin1Str The Latin1 string.
           *
           * @return {WordArray} The word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
           */
          parse: function(E) {
            for (var b = E.length, h = [], T = 0; T < b; T++)
              h[T >>> 2] |= (E.charCodeAt(T) & 255) << 24 - T % 4 * 8;
            return new d.init(h, b);
          }
        }, f = p.Utf8 = {
          /**
           * Converts a word array to a UTF-8 string.
           *
           * @param {WordArray} wordArray The word array.
           *
           * @return {string} The UTF-8 string.
           *
           * @static
           *
           * @example
           *
           *     var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
           */
          stringify: function(E) {
            try {
              return decodeURIComponent(escape(m.stringify(E)));
            } catch {
              throw new Error("Malformed UTF-8 data");
            }
          },
          /**
           * Converts a UTF-8 string to a word array.
           *
           * @param {string} utf8Str The UTF-8 string.
           *
           * @return {WordArray} The word array.
           *
           * @static
           *
           * @example
           *
           *     var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
           */
          parse: function(E) {
            return m.parse(unescape(encodeURIComponent(E)));
          }
        }, g = c.BufferedBlockAlgorithm = u.extend({
          /**
           * Resets this block algorithm's data buffer to its initial state.
           *
           * @example
           *
           *     bufferedBlockAlgorithm.reset();
           */
          reset: function() {
            this._data = new d.init(), this._nDataBytes = 0;
          },
          /**
           * Adds new data to this block algorithm's buffer.
           *
           * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
           *
           * @example
           *
           *     bufferedBlockAlgorithm._append('data');
           *     bufferedBlockAlgorithm._append(wordArray);
           */
          _append: function(E) {
            typeof E == "string" && (E = f.parse(E)), this._data.concat(E), this._nDataBytes += E.sigBytes;
          },
          /**
           * Processes available data blocks.
           *
           * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
           *
           * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
           *
           * @return {WordArray} The processed data.
           *
           * @example
           *
           *     var processedData = bufferedBlockAlgorithm._process();
           *     var processedData = bufferedBlockAlgorithm._process(!!'flush');
           */
          _process: function(E) {
            var b, h = this._data, T = h.words, C = h.sigBytes, v = this.blockSize, I = v * 4, N = C / I;
            E ? N = r.ceil(N) : N = r.max((N | 0) - this._minBufferSize, 0);
            var x = N * v, P = r.min(x * 4, C);
            if (x) {
              for (var Y = 0; Y < x; Y += v)
                this._doProcessBlock(T, Y);
              b = T.splice(0, x), h.sigBytes -= P;
            }
            return new d.init(b, P);
          },
          /**
           * Creates a copy of this object.
           *
           * @return {Object} The clone.
           *
           * @example
           *
           *     var clone = bufferedBlockAlgorithm.clone();
           */
          clone: function() {
            var E = u.clone.call(this);
            return E._data = this._data.clone(), E;
          },
          _minBufferSize: 0
        });
        c.Hasher = g.extend({
          /**
           * Configuration options.
           */
          cfg: u.extend(),
          /**
           * Initializes a newly created hasher.
           *
           * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
           *
           * @example
           *
           *     var hasher = CryptoJS.algo.SHA256.create();
           */
          init: function(E) {
            this.cfg = this.cfg.extend(E), this.reset();
          },
          /**
           * Resets this hasher to its initial state.
           *
           * @example
           *
           *     hasher.reset();
           */
          reset: function() {
            g.reset.call(this), this._doReset();
          },
          /**
           * Updates this hasher with a message.
           *
           * @param {WordArray|string} messageUpdate The message to append.
           *
           * @return {Hasher} This hasher.
           *
           * @example
           *
           *     hasher.update('message');
           *     hasher.update(wordArray);
           */
          update: function(E) {
            return this._append(E), this._process(), this;
          },
          /**
           * Finalizes the hash computation.
           * Note that the finalize operation is effectively a destructive, read-once operation.
           *
           * @param {WordArray|string} messageUpdate (Optional) A final message update.
           *
           * @return {WordArray} The hash.
           *
           * @example
           *
           *     var hash = hasher.finalize();
           *     var hash = hasher.finalize('message');
           *     var hash = hasher.finalize(wordArray);
           */
          finalize: function(E) {
            E && this._append(E);
            var b = this._doFinalize();
            return b;
          },
          blockSize: 16,
          /**
           * Creates a shortcut function to a hasher's object interface.
           *
           * @param {Hasher} hasher The hasher to create a helper for.
           *
           * @return {Function} The shortcut function.
           *
           * @static
           *
           * @example
           *
           *     var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
           */
          _createHelper: function(E) {
            return function(b, h) {
              return new E.init(h).finalize(b);
            };
          },
          /**
           * Creates a shortcut function to the HMAC's object interface.
           *
           * @param {Hasher} hasher The hasher to use in this HMAC helper.
           *
           * @return {Function} The shortcut function.
           *
           * @static
           *
           * @example
           *
           *     var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
           */
          _createHmacHelper: function(E) {
            return function(b, h) {
              return new S.HMAC.init(E, h).finalize(b);
            };
          }
        });
        var S = l.algo = {};
        return l;
      }(Math);
      return n;
    });
  }(gl)), gl.exports;
}
var hl = { exports: {} }, Qp;
function Yv() {
  return Qp || (Qp = 1, function(t, e) {
    (function(n, r) {
      t.exports = r(ws());
    })(kn, function(n) {
      return function(r) {
        var i = n, o = i.lib, a = o.WordArray, s = o.Hasher, l = i.algo, c = [], u = [];
        (function() {
          function _(S) {
            for (var E = r.sqrt(S), b = 2; b <= E; b++)
              if (!(S % b))
                return !1;
            return !0;
          }
          function m(S) {
            return (S - (S | 0)) * 4294967296 | 0;
          }
          for (var f = 2, g = 0; g < 64; )
            _(f) && (g < 8 && (c[g] = m(r.pow(f, 1 / 2))), u[g] = m(r.pow(f, 1 / 3)), g++), f++;
        })();
        var d = [], p = l.SHA256 = s.extend({
          _doReset: function() {
            this._hash = new a.init(c.slice(0));
          },
          _doProcessBlock: function(_, m) {
            for (var f = this._hash.words, g = f[0], S = f[1], E = f[2], b = f[3], h = f[4], T = f[5], C = f[6], v = f[7], I = 0; I < 64; I++) {
              if (I < 16)
                d[I] = _[m + I] | 0;
              else {
                var N = d[I - 15], x = (N << 25 | N >>> 7) ^ (N << 14 | N >>> 18) ^ N >>> 3, P = d[I - 2], Y = (P << 15 | P >>> 17) ^ (P << 13 | P >>> 19) ^ P >>> 10;
                d[I] = x + d[I - 7] + Y + d[I - 16];
              }
              var Z = h & T ^ ~h & C, q = g & S ^ g & E ^ S & E, V = (g << 30 | g >>> 2) ^ (g << 19 | g >>> 13) ^ (g << 10 | g >>> 22), O = (h << 26 | h >>> 6) ^ (h << 21 | h >>> 11) ^ (h << 7 | h >>> 25), y = v + O + Z + u[I] + d[I], R = V + q;
              v = C, C = T, T = h, h = b + y | 0, b = E, E = S, S = g, g = y + R | 0;
            }
            f[0] = f[0] + g | 0, f[1] = f[1] + S | 0, f[2] = f[2] + E | 0, f[3] = f[3] + b | 0, f[4] = f[4] + h | 0, f[5] = f[5] + T | 0, f[6] = f[6] + C | 0, f[7] = f[7] + v | 0;
          },
          _doFinalize: function() {
            var _ = this._data, m = _.words, f = this._nDataBytes * 8, g = _.sigBytes * 8;
            return m[g >>> 5] |= 128 << 24 - g % 32, m[(g + 64 >>> 9 << 4) + 14] = r.floor(f / 4294967296), m[(g + 64 >>> 9 << 4) + 15] = f, _.sigBytes = m.length * 4, this._process(), this._hash;
          },
          clone: function() {
            var _ = s.clone.call(this);
            return _._hash = this._hash.clone(), _;
          }
        });
        i.SHA256 = s._createHelper(p), i.HmacSHA256 = s._createHmacHelper(p);
      }(Math), n.SHA256;
    });
  }(hl)), hl.exports;
}
var El = { exports: {} }, Zp;
function $v() {
  return Zp || (Zp = 1, function(t, e) {
    (function(n, r) {
      t.exports = r(ws());
    })(kn, function(n) {
      (function() {
        var r = n, i = r.lib, o = i.Base, a = r.enc, s = a.Utf8, l = r.algo;
        l.HMAC = o.extend({
          /**
           * Initializes a newly created HMAC.
           *
           * @param {Hasher} hasher The hash algorithm to use.
           * @param {WordArray|string} key The secret key.
           *
           * @example
           *
           *     var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
           */
          init: function(c, u) {
            c = this._hasher = new c.init(), typeof u == "string" && (u = s.parse(u));
            var d = c.blockSize, p = d * 4;
            u.sigBytes > p && (u = c.finalize(u)), u.clamp();
            for (var _ = this._oKey = u.clone(), m = this._iKey = u.clone(), f = _.words, g = m.words, S = 0; S < d; S++)
              f[S] ^= 1549556828, g[S] ^= 909522486;
            _.sigBytes = m.sigBytes = p, this.reset();
          },
          /**
           * Resets this HMAC to its initial state.
           *
           * @example
           *
           *     hmacHasher.reset();
           */
          reset: function() {
            var c = this._hasher;
            c.reset(), c.update(this._iKey);
          },
          /**
           * Updates this HMAC with a message.
           *
           * @param {WordArray|string} messageUpdate The message to append.
           *
           * @return {HMAC} This HMAC instance.
           *
           * @example
           *
           *     hmacHasher.update('message');
           *     hmacHasher.update(wordArray);
           */
          update: function(c) {
            return this._hasher.update(c), this;
          },
          /**
           * Finalizes the HMAC computation.
           * Note that the finalize operation is effectively a destructive, read-once operation.
           *
           * @param {WordArray|string} messageUpdate (Optional) A final message update.
           *
           * @return {WordArray} The HMAC.
           *
           * @example
           *
           *     var hmac = hmacHasher.finalize();
           *     var hmac = hmacHasher.finalize('message');
           *     var hmac = hmacHasher.finalize(wordArray);
           */
          finalize: function(c) {
            var u = this._hasher, d = u.finalize(c);
            u.reset();
            var p = u.finalize(this._oKey.clone().concat(d));
            return p;
          }
        });
      })();
    });
  }(El)), El.exports;
}
(function(t, e) {
  (function(n, r, i) {
    t.exports = r(ws(), Yv(), $v());
  })(kn, function(n) {
    return n.HmacSHA256;
  });
})(Og);
var zv = Og.exports;
const qv = /* @__PURE__ */ Ds(zv);
var Ng = { exports: {} };
(function(t, e) {
  (function(n, r) {
    t.exports = r(ws());
  })(kn, function(n) {
    return function() {
      var r = n, i = r.lib, o = i.WordArray, a = r.enc;
      a.Base64 = {
        /**
         * Converts a word array to a Base64 string.
         *
         * @param {WordArray} wordArray The word array.
         *
         * @return {string} The Base64 string.
         *
         * @static
         *
         * @example
         *
         *     var base64String = CryptoJS.enc.Base64.stringify(wordArray);
         */
        stringify: function(l) {
          var c = l.words, u = l.sigBytes, d = this._map;
          l.clamp();
          for (var p = [], _ = 0; _ < u; _ += 3)
            for (var m = c[_ >>> 2] >>> 24 - _ % 4 * 8 & 255, f = c[_ + 1 >>> 2] >>> 24 - (_ + 1) % 4 * 8 & 255, g = c[_ + 2 >>> 2] >>> 24 - (_ + 2) % 4 * 8 & 255, S = m << 16 | f << 8 | g, E = 0; E < 4 && _ + E * 0.75 < u; E++)
              p.push(d.charAt(S >>> 6 * (3 - E) & 63));
          var b = d.charAt(64);
          if (b)
            for (; p.length % 4; )
              p.push(b);
          return p.join("");
        },
        /**
         * Converts a Base64 string to a word array.
         *
         * @param {string} base64Str The Base64 string.
         *
         * @return {WordArray} The word array.
         *
         * @static
         *
         * @example
         *
         *     var wordArray = CryptoJS.enc.Base64.parse(base64String);
         */
        parse: function(l) {
          var c = l.length, u = this._map, d = this._reverseMap;
          if (!d) {
            d = this._reverseMap = [];
            for (var p = 0; p < u.length; p++)
              d[u.charCodeAt(p)] = p;
          }
          var _ = u.charAt(64);
          if (_) {
            var m = l.indexOf(_);
            m !== -1 && (c = m);
          }
          return s(l, c, d);
        },
        _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
      };
      function s(l, c, u) {
        for (var d = [], p = 0, _ = 0; _ < c; _++)
          if (_ % 4) {
            var m = u[l.charCodeAt(_ - 1)] << _ % 4 * 2, f = u[l.charCodeAt(_)] >>> 6 - _ % 4 * 2, g = m | f;
            d[p >>> 2] |= g << 24 - p % 4 * 8, p++;
          }
        return o.create(d, p);
      }
    }(), n.enc.Base64;
  });
})(Ng);
var Wv = Ng.exports;
const Kv = /* @__PURE__ */ Ds(Wv), Ms = () => "10000000-1000-4000-8000-100000000000".replace(
  /[018]/g,
  (t) => (t ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> t / 4).toString(16)
);
class Qv extends Co {
  constructor(e, n) {
    super(e, n, "spark"), this.aiModelConfig = {
      version: "v3.5",
      protocol: "wss",
      ...n.models.spark
    };
  }
  createAiClient(e, n) {
    return new Rg(e, {
      onStart: n.onStart,
      onStop: n.onStop,
      // 星火内容解析 https://www.xfyun.cn/doc/spark/Web.html#_1-%E6%8E%A5%E5%8F%A3%E8%AF%B4%E6%98%8E
      onMessage: (r) => {
        var o, a, s, l, c;
        const i = JSON.parse(r);
        i.payload && ((a = (o = i.payload.usage) == null ? void 0 : o.text) != null && a.total_tokens && this.globalConfig.onTokenConsume && this.globalConfig.onTokenConsume(this.aiModelName, this.aiModelConfig, (l = (s = i.payload.usage) == null ? void 0 : s.text) == null ? void 0 : l.total_tokens), (c = i.payload.choices) != null && c.text && i.payload.choices.text[0] && n.onMessage({
          ...i.payload.choices.text[0],
          status: i.payload.choices.status
        }));
      }
    });
  }
  wrapPayload(e) {
    const n = this.aiModelConfig, r = {
      header: {
        app_id: n.appId,
        uid: Ms().replace(/-/g, "")
      },
      parameter: {
        chat: {
          domain: this.getDomain(n),
          temperature: n.temperature || 0.5,
          max_tokens: n.maxTokens || 2048
        }
      },
      payload: {
        message: {
          text: [
            { role: "user", content: e }
          ]
        }
      }
    };
    return JSON.stringify(r);
  }
  getDomain(e) {
    switch (e.version) {
      case "v4.0":
        return "4.0Ultra";
      case "v3.5":
        return "generalv3.5";
      case "v3.1":
        return "generalv3";
      case "v2.1":
        return "generalv2";
      case "v1.1":
        return "lite";
      default:
        return "general";
    }
  }
  createAiClientUrl() {
    const e = this.aiModelConfig, n = (/* @__PURE__ */ new Date()).toUTCString().replace("GMT", "+0000");
    let r = `host: spark-api.xf-yun.com
`;
    r += "date: " + n + `
`, r += `GET /${e.version}/chat HTTP/1.1`;
    const i = qv(r, e.apiSecret), o = Kv.stringify(i), a = `api_key="${e.apiKey}", algorithm="hmac-sha256", headers="host date request-line", signature="${o}"`, s = btoa(a);
    return `${e.protocol}://spark-api.xf-yun.com/${e.version}/chat?authorization=${s}&date=${encodeURIComponent(n)}&host=spark-api.xf-yun.com`;
  }
}
class Ag {
  constructor(e, n) {
    M(this, "isStop", !1);
    M(this, "config");
    M(this, "fetch");
    M(this, "isOpen", !1);
    M(this, "payload");
    M(this, "listener");
    this.config = e, this.listener = n;
  }
  start(e) {
    this.payload = e, this.onOpen(), this.listener.onStart(this);
  }
  stop() {
    this.fetch && (this.fetch = void 0, this.isStop || (this.listener.onStop(), this.isStop = !0));
  }
  async send(e) {
    if (this.isOpen)
      try {
        this.fetch = await fetch(this.config.url, { method: this.config.method, headers: this.config.headers, body: e });
        const n = this.fetch;
        if (!n.body) throw new Error("response.body is none");
        const r = ({ done: a, value: s }) => {
          if (a) {
            this.onClose();
            return;
          }
          return this.onMessage(o.decode(s)), i.read().then(({ done: l, value: c }) => r({ done: l, value: c }));
        }, i = n.body.getReader(), o = new TextDecoder("utf-8");
        i.read().then(({ done: a, value: s }) => r({ done: a, value: s }));
      } catch {
        this.onError();
      }
  }
  onOpen() {
    this.isOpen = !0, this.send(this.payload);
  }
  onMessage(e) {
    this.listener.onMessage(e);
  }
  onClose() {
    this.isOpen = !1, this.isStop || (this.listener.onStop(), this.isStop = !0);
  }
  onError() {
    this.isOpen = !1, this.isStop || (this.listener.onStop(), this.isStop = !0);
  }
}
class Zv extends Co {
  constructor(e, n) {
    super(e, n, "wenxin"), this.aiModelConfig = {
      ...n.models.wenxin
    };
  }
  createAiClient(e, n) {
    return new Ag({ url: e, method: "POST" }, {
      onStart: n.onStart,
      onStop: n.onStop,
      onMessage: (r) => {
        const i = r.match(/data:([\s\S]*)$/);
        if (!i) return;
        const o = JSON.parse(i[1]);
        n.onMessage({
          status: o.is_end ? 2 : 1,
          role: "assistant",
          content: o.result || "",
          index: o.sentence_id
        });
      }
    });
  }
  wrapPayload(e) {
    const n = {
      messages: [
        {
          role: "user",
          content: e
        }
      ],
      stream: !0,
      max_tokens: this.aiModelConfig.maxTokens || null,
      temperature: this.aiModelConfig.temperature || null
    };
    return JSON.stringify(n);
  }
  createAiClientUrl() {
    return `https://aip.baidubce.com/rpc/2.0/ai_custom/v1/wenxinworkshop/chat/completions_pro?access_token=${this.aiModelConfig.access_token}`;
  }
}
var fn;
class Xv extends TransformStream {
  /** Constructs a new instance. */
  constructor(n = { allowCR: !1 }) {
    super({
      transform: (r, i) => {
        for (r = Nr(this, fn) + r; ; ) {
          const o = r.indexOf(`
`), a = n.allowCR ? r.indexOf("\r") : -1;
          if (a !== -1 && a !== r.length - 1 && (o === -1 || o - 1 > a)) {
            i.enqueue(r.slice(0, a)), r = r.slice(a + 1);
            continue;
          }
          if (o === -1)
            break;
          const s = r[o - 1] === "\r" ? o - 1 : o;
          i.enqueue(r.slice(0, s)), r = r.slice(o + 1);
        }
        ud(this, fn, r);
      },
      flush: (r) => {
        if (Nr(this, fn) === "")
          return;
        const i = n.allowCR && Nr(this, fn).endsWith("\r") ? Nr(this, fn).slice(0, -1) : Nr(this, fn);
        r.enqueue(i);
      }
    });
    cd(this, fn, "");
  }
}
fn = new WeakMap();
function jv(t) {
  let e = new TextDecoderStream(), n = new Xv({ allowCR: !0 });
  return t.pipeThrough(e).pipeThrough(n);
}
function Jv(t) {
  let n = /[:]\s*/.exec(t), r = n && n.index;
  if (r)
    return [
      t.substring(0, r),
      t.substring(r + n[0].length)
    ];
}
async function* eR(t, e) {
  if (!t.body)
    return;
  let n = jv(t.body), r, i = n.getReader(), o;
  for (; ; ) {
    if (e && e.aborted)
      return i.cancel();
    if (r = await i.read(), r.done)
      return;
    if (!r.value) {
      o && (yield o), o = void 0;
      continue;
    }
    let [a, s] = Jv(r.value) || [];
    a && (a === "data" ? (o || (o = {}), o[a] = o[a] ? o[a] + `
` + s : s) : a === "event" ? (o || (o = {}), o[a] = s) : a === "id" ? (o || (o = {}), o[a] = +s || s) : a === "retry" && (o || (o = {}), o[a] = +s || void 0));
  }
}
class Eu {
  constructor(e, n) {
    M(this, "isStop", !1);
    M(this, "config");
    M(this, "fetch");
    M(this, "isOpen", !1);
    M(this, "payload");
    M(this, "listener");
    M(this, "ctrl", new AbortController());
    this.config = e, this.listener = n;
  }
  start(e) {
    this.payload = e, this.onOpen(), this.listener.onStart(this);
  }
  stop() {
    this.fetch && (this.ctrl.abort(), this.isStop || (this.listener.onStop(), this.isStop = !0));
  }
  async send(e) {
    let n = await fetch(this.config.url, {
      method: this.config.method,
      signal: this.ctrl.signal,
      headers: this.config.headers,
      body: e
    });
    if (!n.ok) {
      this.onError();
      return;
    }
    try {
      let r = eR(n, this.ctrl.signal);
      for await (let i of r)
        i.data && i.data.trim() !== "[DONE]" && this.onMessage(i.data);
    } catch (r) {
      console.error("error", r), this.onError();
    } finally {
      this.onClose();
    }
  }
  onOpen() {
    this.isOpen = !0, this.send(this.payload);
  }
  onMessage(e) {
    this.listener.onMessage(e);
  }
  onClose() {
    this.isOpen = !1, this.isStop || (this.listener.onStop(), this.isStop = !0);
  }
  onError() {
    this.isOpen = !1, this.isStop || (this.listener.onStop(), this.isStop = !0);
  }
}
class tR extends Co {
  constructor(e, n) {
    super(e, n, "custom"), this.aiModelConfig = {
      protocol: "sse",
      ...n.models.custom
    };
  }
  createAiClient(e, n) {
    var a;
    const r = this.aiModelConfig, i = {
      onStart: n.onStart,
      onStop: n.onStop,
      onMessage: (s) => {
        var u;
        const l = this.aiModelConfig, c = (u = l.parseMessage) == null ? void 0 : u.call(l, s);
        c && n.onMessage(c);
      }
    }, o = {
      url: e,
      method: r.method || "post",
      headers: (a = r.headers) == null ? void 0 : a.call(r)
    };
    return r.protocol === "sse" ? new Eu(o, i) : r.protocol === "http" ? new Ag(o, i) : new Rg(e, i);
  }
  wrapPayload(e) {
    var r;
    const n = this.aiModelConfig;
    return (r = n.wrapPayload) == null ? void 0 : r.call(n, e);
  }
  createAiClientUrl() {
    var n;
    const e = this.aiModelConfig;
    return typeof e.url == "string" ? e.url : (n = e.url) == null ? void 0 : n.call(e);
  }
}
class nR extends Co {
  constructor(e, n) {
    super(e, n, "openai"), this.aiModelConfig = {
      endpoint: "https://api.openai.com",
      // model: "gpt-3.5-turbo",
      ...n.models.openai
    };
  }
  createAiClient(e, n) {
    const r = this.aiModelConfig, i = {
      "Content-Type": "application/json"
    };
    return r.apiKey && (i.Authorization = `Bearer ${r.apiKey}`), new Eu({
      url: e,
      method: "post",
      headers: i
    }, {
      onStart: n.onStart,
      onStop: n.onStop,
      onMessage: (o) => {
        var s, l;
        let a = null;
        try {
          a = JSON.parse(o);
        } catch (c) {
          console.error("error", c, o);
          return;
        }
        !a.choices || a.choices.length === 0 || (n.onMessage({
          status: a.choices[0].finish_reason === "stop" ? 2 : 1,
          role: "assistant",
          content: ((s = a.choices[0].delta) == null ? void 0 : s.content) || "",
          index: a.choices[0].index
        }), this.globalConfig.onTokenConsume && ((l = a.choices[0].usage) != null && l.total_tokens) && this.globalConfig.onTokenConsume(this.aiModelName, this.aiModelConfig, a.choices[0].usage.total_tokens));
      }
    });
  }
  wrapPayload(e) {
    const n = this.aiModelConfig, r = {
      // "model": config.model,
      messages: [
        {
          role: "user",
          content: e
        }
      ],
      max_tokens: n.maxTokens || null,
      temperature: n.temperature || null,
      stream: !0
    };
    return n.model && (r.model = n.model), JSON.stringify(r);
  }
  createAiClientUrl() {
    const e = this.aiModelConfig;
    if (e.customUrl) {
      if (typeof e.customUrl == "string")
        return e.customUrl;
      if (typeof e.customUrl == "function")
        return e.customUrl();
    }
    return `${e.endpoint}/v1/chat/completions`;
  }
}
class rR extends Co {
  constructor(e, n) {
    super(e, n, "gitee"), this.aiModelConfig = {
      top_p: 0.7,
      top_k: 50,
      ...n.models.gitee
    };
  }
  createAiClient(e, n) {
    const r = this.aiModelConfig;
    return new Eu({
      url: e,
      method: "post",
      headers: {
        "Content-Type": "application/json",
        Authorization: `Bearer ${r.apiKey}`
      }
    }, {
      onStart: n.onStart,
      onStop: n.onStop,
      onMessage: (i) => {
        var a, s;
        let o = null;
        try {
          o = JSON.parse(i);
        } catch (l) {
          console.error("error", l, i);
          return;
        }
        n.onMessage({
          status: o.choices[0].finish_reason === "stop" ? 2 : 1,
          role: "assistant",
          content: ((a = o.choices[0].delta) == null ? void 0 : a.content) || "",
          index: o.choices[0].index
        }), this.globalConfig.onTokenConsume && ((s = o.usage) != null && s.total_tokens) && this.globalConfig.onTokenConsume(this.aiModelName, this.aiModelConfig, o.usage.total_tokens);
      }
    });
  }
  wrapPayload(e) {
    const n = this.aiModelConfig, r = {
      messages: [
        {
          role: "user",
          content: e
        }
      ],
      stream: !0,
      max_tokens: n.maxTokens || null,
      temperature: n.temperature || null,
      top_p: n.top_p,
      top_k: n.top_k
    };
    return JSON.stringify(r);
  }
  createAiClientUrl() {
    const { endpoint: e } = this.aiModelConfig;
    return e;
  }
}
class zn {
  static init(e, n) {
    var r;
    if (n && n.models)
      for (let i of Object.keys(n.models))
        switch (i) {
          case "spark":
            this.set(i, new Qv(e, n));
            break;
          case "wenxin":
            this.set(i, new Zv(e, n));
            break;
          case "openai":
            this.set(i, new nR(e, n));
            break;
          case "gitee":
            this.set(i, new rR(e, n));
            break;
          case "custom":
            this.set(i, new tR(e, n));
            break;
          default:
            const o = (r = n.modelFactory) == null ? void 0 : r.create(i, e, n);
            o && this.set(i, o);
        }
  }
  static get(e) {
    return (!e || e === "auto") && (e = Object.keys(this.models)[0]), this.models[e];
  }
  static set(e, n) {
    this.models[e] = n;
  }
}
M(zn, "models", {});
const iR = (t) => {
  let e = "";
  return t.descendants((n) => {
    n.text && (e += n.text);
  }), e;
};
class Aa {
  constructor(e, n) {
    M(this, "editor");
    M(this, "from");
    M(this, "options");
    this.editor = e, this.from = e.view.state.selection.from, this.options = n || {
      markdownParseEnable: !0
    };
  }
  onStart() {
  }
  onStop() {
  }
  onMessage(e) {
    const { state: { tr: n }, view: r } = this.editor;
    if (r.dispatch(n.insertText(e.content)), e.status == 2 && this.options.markdownParseEnable) {
      const i = this.editor.state.selection.to, o = this.editor.state.doc.textBetween(this.from, i), { state: { tr: a }, view: s } = this.editor, l = this.editor.parseMarkdown(o);
      if (this.options.useMarkdownTextOnly) {
        const c = iR(l), u = this.editor.schema.text(c);
        s.dispatch(a.replaceWith(this.from, i, u).scrollIntoView());
      } else
        s.dispatch(a.replaceWith(this.from, i, l).scrollIntoView());
    }
    this.editor.commands.scrollIntoView();
  }
}
const oR = [
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M4 18.9997H20V13.9997H22V19.9997C22 20.552 21.5523 20.9997 21 20.9997H3C2.44772 20.9997 2 20.552 2 19.9997V13.9997H4V18.9997ZM16.1716 6.9997L12.2218 3.04996L13.636 1.63574L20 7.9997L13.636 14.3637L12.2218 12.9495L16.1716 8.9997H5V6.9997H16.1716Z"></path></svg>',
    name: "ai-continuation",
    prompt: `{content}

请帮我继续扩展以上这段文字的内容。
注意：你应该先判断一下这句话是中文还是英文，如果是中文，请给我返回中文的内容，如果是英文，请给我返回英文内容，只需要返回内容即可，不需要告知我是中文还是英文。`,
    text: "focusBefore",
    model: "auto"
  },
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M15 5.25C16.7949 5.25 18.25 3.79493 18.25 2H19.75C19.75 3.79493 21.2051 5.25 23 5.25V6.75C21.2051 6.75 19.75 8.20507 19.75 10H18.25C18.25 8.20507 16.7949 6.75 15 6.75V5.25ZM4 7C4 5.89543 4.89543 5 6 5H13V3H6C3.79086 3 2 4.79086 2 7V17C2 19.2091 3.79086 21 6 21H18C20.2091 21 22 19.2091 22 17V12H20V17C20 18.1046 19.1046 19 18 19H6C4.89543 19 4 18.1046 4 17V7Z"></path></svg>',
    name: "ai-optimization",
    prompt: `{content}

请帮我优化以上这段文字的内容，并返回结果
注意：你应该先判断一下这句话是中文还是英文，如果是中文，请给我返回中文的内容，如果是英文，请给我返回英文内容，只需要返回内容即可，不需要告知我是中文还是英文。`,
    text: "selected",
    model: "auto"
  },
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M17.934 3.0359L19.666 4.0359L18.531 6H21V8H19V12H21V14H19V21H17V14L13.9157 14.0004C13.5914 16.8623 12.3522 19.3936 10.5466 21.1933L8.98361 19.9233C10.5031 18.4847 11.5801 16.4008 11.9008 14.0009L10 14V12L12 11.999V8H10V6H12.467L11.334 4.0359L13.066 3.0359L14.777 6H16.221L17.934 3.0359ZM5 13.803L3 14.339V12.268L5 11.732V8H3V6H5V3H7V6H9V8H7V11.197L9 10.661V12.731L7 13.267V18.5C7 19.8807 5.88071 21 4.5 21H3V19H4.5C4.74546 19 4.94961 18.8231 4.99194 18.5899L5 18.5V13.803ZM17 8H14V12H17V8Z"></path></svg>',
    name: "ai-proofreading",
    prompt: `{content}

请帮我找出以上这段文字的错别字，把错别字修改后，并返回结果，不要解释或其他多余的内容
注意：你应该先判断一下这句话是中文还是英文，如果是中文，请给我返回中文的内容，如果是英文，请给我返回英文内容，只需要返回内容即可，不需要告知我是中文还是英文。`,
    text: "selected",
    model: "auto"
  },
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M5 15V17C5 18.0544 5.81588 18.9182 6.85074 18.9945L7 19H10V21H7C4.79086 21 3 19.2091 3 17V15H5ZM18 10L22.4 21H20.245L19.044 18H14.954L13.755 21H11.601L16 10H18ZM17 12.8852L15.753 16H18.245L17 12.8852ZM8 2V4H12V11H8V14H6V11H2V4H6V2H8ZM17 3C19.2091 3 21 4.79086 21 7V9H19V7C19 5.89543 18.1046 5 17 5H14V3H17ZM6 6H4V9H6V6ZM10 6H8V9H10V6Z"></path></svg>',
    name: "ai-translation",
    prompt: "请帮我翻译以上内容，在翻译之前，想先判断一下这个内容是不是中文，如果是中文，则翻译为英文，如果是其他语言，则需要翻译为中文，注意，你只需要返回翻译的结果，不需要对此进行任何解释，不需要除了翻译结果以外的其他任何内容。",
    text: "selected",
    model: "auto"
  }
];
class aR extends pi {
  constructor() {
    super();
    M(this, "aiMenus", oR.map((n) => ({
      ...n,
      name: `${te(n.name)}`
    })));
    this.dropDivHeight = "auto", this.dropDivWith = "fit-content", this.width = "36px", this.menuTextWidth = "20px";
  }
  onCreate(n, r) {
    var i;
    super.onCreate(n, r), this.menuData = ((i = r.ai) == null ? void 0 : i.menus) || this.aiMenus;
  }
  renderTemplate() {
    this.template = `
         <div style="width: ${this.width};">
         <div id="tippy" class="menu-ai" id="text">
             <span> AI </span>
             <div style="width: 18px;height: 18px;display: inline-block" >
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 14L8 10H16L12 14Z"></path></svg>
             </div>
         </div>
         </div>
        `;
  }
  createMenuElement() {
    const n = document.createElement("div");
    n.style.height = this.dropDivHeight, n.style.width = this.dropDivWith, n.classList.add("linwiteditor-dropdown-container");
    for (let r = 0; r < this.menuData.length; r++) {
      const i = document.createElement("div");
      i.classList.add("linwiteditor-dropdown-item"), i.innerHTML = `
            <div class="text" style="display: flex;padding: 5px 10px">${this.onDropdownItemRender(r)}</div>
            `, i.addEventListener("click", (o) => {
        const a = this.menuData[r];
        a.onClick ? (a.onClick(o, this.editor.linwitDocEditor), this.tippyInstance.hide()) : (this.onDropdownItemClick(r), this.tippyInstance.hide());
      }), n.appendChild(i);
    }
    return this.tippyEl = n, n;
  }
  onTransaction(n) {
  }
  onDropdownActive(n, r) {
    return !1;
  }
  getSelectedText(n) {
    if (n === "selected") {
      const { selection: r, doc: i } = this.editor.state;
      return i.textBetween(r.from, r.to);
    } else
      return this.editor.state.selection.$head.parent.textContent;
  }
  onDropdownItemClick(n) {
    const r = this.menuData[n], i = this.getSelectedText(r.text);
    if (i) {
      const o = zn.get(r.model);
      o ? o == null || o.chat(i, r.prompt, new Aa(this.editor)) : console.error("Ai model config error.");
    } else
      console.error("Can not get selected text.");
  }
  onDropdownItemRender(n) {
    return `<div style="width:18px;height: 18px;">${this.menuData[n].icon}</div><div style="margin-left: 10px">${this.menuData[n].name}</div>`;
  }
  onMenuTextRender(n) {
    return this.menuData[n].icon;
  }
}
class sR extends fe {
  constructor() {
    super(), this.template = `
        <div>
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M21 3C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM20 5H4V19H20V5ZM18 15V17H6V15H18Z"></path></svg>
        </div>
        `, this.registerClickListener();
  }
  // @ts-ignore
  onClick(e) {
    var n;
    (n = this.editor) != null && n.isActive("container") ? e.unsetContainer() : e.setContainer(""), e.focus();
  }
  onActive(e) {
    return e.isActive("container");
  }
}
class lR extends fe {
  constructor() {
    super();
    M(this, "config");
  }
  onConfig(n) {
    this.config = n, n.html ? this.template = n.html : n.icon && (this.template = `<div style="height: 16px">${n.icon}</div>`), this.addEventListener("click", (r) => {
      this.config && this.config.onClick && this.config.onClick(r, this.editor.linwitDocEditor);
    });
  }
}
const oe = (t, e) => {
  window.customElements.get(t) || window.customElements.define(t, e);
}, Ig = (t, e, n, r) => {
  for (let i of r)
    if (i)
      try {
        if (typeof i == "string") {
          i = i.trim(), i === "|" && (i = "divider");
          const o = document.createElement("linwiteditor-" + i);
          if (o.classList.add("linwiteditor-menu-item"), o.onCreate(t, e), o.onEditableChange(!!e.editable), i !== "divider") {
            const a = te(i);
            o.setAttribute("data-title", a), o.setAttribute("data-size", e.toolbarSize), a && Me(o, {
              appendTo: () => t.editor.view.dom.closest(".linwiteditor-container"),
              content: a,
              theme: "aietip",
              arrow: !0
              // trigger:"click",
              // interactive:true,
            });
          }
          n.push(o);
        } else if (i.toolbarKeys) {
          const o = i, a = document.createElement("linwiteditor-group");
          if (a.classList.add("linwiteditor-menu-item"), a.onCreate(t, e), a.init(t, e, o), a.onEditableChange(!!e.editable), o.title) {
            const s = te(o.title);
            s && Me(a, {
              appendTo: () => t.editor.view.dom.closest(".linwiteditor-container"),
              content: s,
              theme: "aietip",
              arrow: !0
              // trigger:"click",
              // interactive:true,
            });
          }
          n.push(a);
        } else {
          const o = i, a = document.createElement("linwiteditor-custom");
          if (a.classList.add("linwiteditor-menu-item"), o.id && a.setAttribute("id", o.id), o.className && a.classList.add(o.className), a.onCreate(t, e), a.onConfig(o), a.onEditableChange(!!e.editable), o.tip) {
            const s = te(o.tip);
            s && Me(a, {
              appendTo: () => t.editor.view.dom.closest(".linwiteditor-container"),
              content: s,
              theme: "aietip",
              arrow: !0
              // trigger:"click",
              // interactive:true,
            });
          }
          o.onCreate && o.onCreate(a, t.editor.linwitDocEditor), n.push(a);
        }
      } catch (o) {
        console.error(o, "Can not create toolbar by key: " + i);
      }
};
class cR extends fe {
  constructor() {
    super();
    M(this, "menuButtons", []);
    M(this, "tippyInstance");
    M(this, "tippyEl");
    M(this, "iconSvg", '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 3C11.175 3 10.5 3.675 10.5 4.5C10.5 5.325 11.175 6 12 6C12.825 6 13.5 5.325 13.5 4.5C13.5 3.675 12.825 3 12 3ZM12 18C11.175 18 10.5 18.675 10.5 19.5C10.5 20.325 11.175 21 12 21C12.825 21 13.5 20.325 13.5 19.5C13.5 18.675 12.825 18 12 18ZM12 10.5C11.175 10.5 10.5 11.175 10.5 12C10.5 12.825 11.175 13.5 12 13.5C12.825 13.5 13.5 12.825 13.5 12C13.5 11.175 12.825 10.5 12 10.5Z"></path></svg>');
  }
  onCreate(n, r) {
    super.onCreate(n, r);
  }
  init(n, r, i) {
    Ig(n, r, this.menuButtons, i.toolbarKeys), this.iconSvg = i.icon || this.iconSvg;
  }
  renderTemplate() {
    this.template = `<div id="tippy" >${this.iconSvg}</div>`;
  }
  onTransaction(n) {
    for (let r of this.menuButtons)
      r.onTransaction(n);
  }
  connectedCallback() {
    this.renderTemplate(), super.connectedCallback(), this.tippyInstance = Me(this.querySelector("#tippy"), {
      content: this.createMenuElement(),
      appendTo: this.closest(".linwiteditor-container"),
      placement: "bottom",
      trigger: "click",
      interactive: !0,
      arrow: !1
    });
  }
  createMenuElement() {
    const n = document.createElement("div");
    n.classList.add("linwiteditor-dropdown-container");
    for (let r = 0; r < this.menuButtons.length; r++) {
      const i = this.menuButtons[r], o = document.createElement("div");
      o.classList.add("linwiteditor-dropdown-item"), o.style.padding = "5px 10px", o.style.lineHeight = "16px", o.appendChild(i);
      const a = document.createElement("div");
      a.innerText = i.getAttribute("data-title"), a.style.marginLeft = "5px", o.appendChild(a), o.addEventListener("click", (s) => {
        if (s.target.closest(".linwiteditor-menu-item"))
          return;
        const c = o.querySelector("#tippy");
        if (c) {
          c.click();
          return;
        }
        const u = o.querySelector("#dropdown");
        if (u) {
          u.click();
          return;
        }
        i.click();
      }), n.appendChild(o);
    }
    return this.tippyEl = n, n;
  }
}
const uR = [
  "undo",
  "redo",
  "brush",
  "eraser",
  "divider",
  "heading",
  "font-family",
  "font-size",
  "divider",
  "bold",
  "italic",
  "underline",
  "strike",
  "link",
  "code",
  "subscript",
  "superscript",
  "hr",
  "todo",
  "emoji",
  "divider",
  "highlight",
  "font-color",
  "divider",
  "align",
  "line-height",
  "divider",
  "bullet-list",
  "ordered-list",
  "indent-decrease",
  "indent-increase",
  "break",
  "divider",
  "image",
  "video",
  "attachment",
  "quote",
  "container",
  "code-block",
  "table",
  "divider",
  "source-code",
  "printer",
  "fullscreen",
  "ai"
];
oe("linwiteditor-undo", qC);
oe("linwiteditor-redo", WC);
oe("linwiteditor-brush", Fv);
oe("linwiteditor-container", sR);
oe("linwiteditor-custom", lR);
oe("linwiteditor-eraser", Iv);
oe("linwiteditor-heading", Xy);
oe("linwiteditor-font-family", Jy);
oe("linwiteditor-font-size", tv);
oe("linwiteditor-bold", nv);
oe("linwiteditor-italic", rv);
oe("linwiteditor-underline", iv);
oe("linwiteditor-strike", ov);
oe("linwiteditor-link", Sv);
oe("linwiteditor-source-code", bv);
oe("linwiteditor-code", Nv);
oe("linwiteditor-subscript", av);
oe("linwiteditor-superscript", sv);
oe("linwiteditor-highlight", uv);
oe("linwiteditor-font-color", dv);
oe("linwiteditor-divider", pv);
oe("linwiteditor-bullet-list", _v);
oe("linwiteditor-ordered-list", mv);
oe("linwiteditor-indent-decrease", fv);
oe("linwiteditor-indent-increase", gv);
oe("linwiteditor-align", Ev);
oe("linwiteditor-todo", Tv);
oe("linwiteditor-line-height", yv);
oe("linwiteditor-break", wv);
oe("linwiteditor-quote", vv);
oe("linwiteditor-image", Rv);
oe("linwiteditor-video", Ov);
oe("linwiteditor-code-block", Av);
oe("linwiteditor-hr", xv);
oe("linwiteditor-table", Dv);
oe("linwiteditor-attachment", Mv);
oe("linwiteditor-fullscreen", Lv);
oe("linwiteditor-printer", kv);
oe("linwiteditor-emoji", Pv);
oe("linwiteditor-ai", aR);
oe("linwiteditor-group", cR);
class xg extends HTMLElement {
  constructor() {
    super();
    // template:string;
    M(this, "menuButtons", []);
  }
  connectedCallback() {
    if (this.children && this.children.length > 0)
      return;
    const n = document.createElement("div");
    for (let r of this.menuButtons)
      n.appendChild(r);
    n.style.display = "flex", n.style.flexWrap = "wrap", this.appendChild(n);
  }
  onCreate(n, r) {
    let i = r.toolbarKeys || uR;
    i = i.filter((o) => {
      var a;
      return typeof o == "string" ? !((a = r.toolbarExcludeKeys) != null && a.includes(o)) : !0;
    }).filter((o, a, s) => {
      const l = s[a - 1];
      if (typeof o == "string" && (typeof l == "string" || typeof l > "u")) {
        const c = ["divider", "|", void 0];
        return c.includes(o) ? !c.includes(l) : !0;
      }
      return !0;
    }), Ig(n, r, this.menuButtons, i);
  }
  onTransaction(n) {
    for (let r of this.menuButtons)
      r.onTransaction(n);
  }
  onEditableChange(n) {
    for (let r of this.menuButtons)
      r.onEditableChange(n);
  }
}
class Dg extends HTMLElement {
  constructor() {
    super();
    M(this, "count", 0);
    M(this, "draggable", !0);
  }
  initDraggable(n) {
    if (this.draggable = !!n, !this.draggable)
      return;
    let r, i, o = 300, a = 300, s, l, c;
    const u = (p) => {
      p.preventDefault(), document.removeEventListener("mouseup", u), document.removeEventListener("mousemove", d);
    }, d = (p) => {
      const _ = p.clientX - r, m = p.clientY - i;
      if (_ == 0 && m == 0) return;
      let f = s + _, g = l + m;
      f < o && (f = o), g < a && (g = a), c.style.width = `${f}px`, c.style.height = `${g}px`;
    };
    this.addEventListener("mousedown", (p) => {
      var m;
      p.target.closest("svg") && (p.preventDefault(), document.addEventListener("mouseup", u), document.addEventListener("mousemove", d), c = (m = p.target.closest(".linwiteditor-container")) == null ? void 0 : m.parentElement, s = c.clientWidth, l = c.clientHeight, r = p.clientX, i = p.clientY);
    }), this.addEventListener("mouseup", u);
  }
  updateCharacters() {
    this.draggable ? this.innerHTML = `<div style="display: flex"> 
                                <span> Powered by AiEditor, Characters: ${this.count} </span>
                                <div style="width: 20px;height: 20px;overflow: hidden">
                                    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 16L6 10H18L12 16Z"></path></svg>
                                </div>
                            </div>
                            ` : this.innerHTML = `<div style="display: flex;"> 
                                <span style="margin-right: 10px"> Powered by AiEditor, Characters: ${this.count} </span>
                            </div>
                            `;
  }
  onCreate(n, r) {
    this.count = n.editor.storage.characterCount.characters(), this.updateCharacters();
  }
  onTransaction(n) {
    const r = n.editor.storage.characterCount.characters();
    r != this.count && (this.count = r, this.updateCharacters());
  }
  // @ts-ignore
  onEditableChange(n) {
  }
}
const dR = /^\s*>\s$/, pR = xe.create({
  name: "blockquote",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  content: "block+",
  group: "block",
  defining: !0,
  parseHTML() {
    return [
      { tag: "blockquote" }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["blockquote", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setBlockquote: () => ({ commands: t }) => t.wrapIn(this.name),
      toggleBlockquote: () => ({ commands: t }) => t.toggleWrap(this.name),
      unsetBlockquote: () => ({ commands: t }) => t.lift(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-b": () => this.editor.commands.toggleBlockquote()
    };
  },
  addInputRules() {
    return [
      Sr({
        find: dR,
        type: this.type
      })
    ];
  }
}), _R = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/, mR = /(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g, fR = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/, gR = /(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g, hR = St.create({
  name: "bold",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  parseHTML() {
    return [
      {
        tag: "strong"
      },
      {
        tag: "b",
        getAttrs: (t) => t.style.fontWeight !== "normal" && null
      },
      {
        style: "font-weight=400",
        clearMark: (t) => t.type.name === this.name
      },
      {
        style: "font-weight",
        getAttrs: (t) => /^(bold(er)?|[5-9]\d{2,})$/.test(t) && null
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["strong", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setBold: () => ({ commands: t }) => t.setMark(this.name),
      toggleBold: () => ({ commands: t }) => t.toggleMark(this.name),
      unsetBold: () => ({ commands: t }) => t.unsetMark(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-b": () => this.editor.commands.toggleBold(),
      "Mod-B": () => this.editor.commands.toggleBold()
    };
  },
  addInputRules() {
    return [
      Er({
        find: _R,
        type: this.type
      }),
      Er({
        find: fR,
        type: this.type
      })
    ];
  },
  addPasteRules() {
    return [
      $n({
        find: mR,
        type: this.type
      }),
      $n({
        find: gR,
        type: this.type
      })
    ];
  }
}), ER = "listItem", Xp = "textStyle", jp = /^\s*([-+*])\s$/, SR = xe.create({
  name: "bulletList",
  addOptions() {
    return {
      itemTypeName: "listItem",
      HTMLAttributes: {},
      keepMarks: !1,
      keepAttributes: !1
    };
  },
  group: "block list",
  content() {
    return `${this.options.itemTypeName}+`;
  },
  parseHTML() {
    return [
      { tag: "ul" }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["ul", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      toggleBulletList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ER, this.editor.getAttributes(Xp)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-8": () => this.editor.commands.toggleBulletList()
    };
  },
  addInputRules() {
    let t = Sr({
      find: jp,
      type: this.type
    });
    return (this.options.keepMarks || this.options.keepAttributes) && (t = Sr({
      find: jp,
      type: this.type,
      keepMarks: this.options.keepMarks,
      keepAttributes: this.options.keepAttributes,
      getAttributes: () => this.editor.getAttributes(Xp),
      editor: this.editor
    })), [
      t
    ];
  }
}), bR = /(^|[^`])`([^`]+)`(?!`)/, TR = /(^|[^`])`([^`]+)`(?!`)/g, CR = St.create({
  name: "code",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  excludes: "_",
  code: !0,
  exitable: !0,
  parseHTML() {
    return [
      { tag: "code" }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["code", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setCode: () => ({ commands: t }) => t.setMark(this.name),
      toggleCode: () => ({ commands: t }) => t.toggleMark(this.name),
      unsetCode: () => ({ commands: t }) => t.unsetMark(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-e": () => this.editor.commands.toggleCode()
    };
  },
  addInputRules() {
    return [
      Er({
        find: bR,
        type: this.type
      })
    ];
  },
  addPasteRules() {
    return [
      $n({
        find: TR,
        type: this.type
      })
    ];
  }
}), yR = /^```([a-z]+)?[\s\n]$/, vR = /^~~~([a-z]+)?[\s\n]$/, wg = xe.create({
  name: "codeBlock",
  addOptions() {
    return {
      languageClassPrefix: "language-",
      exitOnTripleEnter: !0,
      exitOnArrowDown: !0,
      defaultLanguage: null,
      HTMLAttributes: {}
    };
  },
  content: "text*",
  marks: "",
  group: "block",
  code: !0,
  defining: !0,
  addAttributes() {
    return {
      language: {
        default: this.options.defaultLanguage,
        parseHTML: (t) => {
          var e;
          const { languageClassPrefix: n } = this.options, o = [...((e = t.firstElementChild) === null || e === void 0 ? void 0 : e.classList) || []].filter((a) => a.startsWith(n)).map((a) => a.replace(n, ""))[0];
          return o || null;
        },
        rendered: !1
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: "pre",
        preserveWhitespace: "full"
      }
    ];
  },
  renderHTML({ node: t, HTMLAttributes: e }) {
    return [
      "pre",
      me(this.options.HTMLAttributes, e),
      [
        "code",
        {
          class: t.attrs.language ? this.options.languageClassPrefix + t.attrs.language : null
        },
        0
      ]
    ];
  },
  addCommands() {
    return {
      setCodeBlock: (t) => ({ commands: e }) => e.setNode(this.name, t),
      toggleCodeBlock: (t) => ({ commands: e }) => e.toggleNode(this.name, "paragraph", t)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Alt-c": () => this.editor.commands.toggleCodeBlock(),
      // remove code block when at start of document or code block is empty
      Backspace: () => {
        const { empty: t, $anchor: e } = this.editor.state.selection, n = e.pos === 1;
        return !t || e.parent.type.name !== this.name ? !1 : n || !e.parent.textContent.length ? this.editor.commands.clearNodes() : !1;
      },
      // exit node on triple enter
      Enter: ({ editor: t }) => {
        if (!this.options.exitOnTripleEnter)
          return !1;
        const { state: e } = t, { selection: n } = e, { $from: r, empty: i } = n;
        if (!i || r.parent.type !== this.type)
          return !1;
        const o = r.parentOffset === r.parent.nodeSize - 2, a = r.parent.textContent.endsWith(`

`);
        return !o || !a ? !1 : t.chain().command(({ tr: s }) => (s.delete(r.pos - 2, r.pos), !0)).exitCode().run();
      },
      // exit node on arrow down
      ArrowDown: ({ editor: t }) => {
        if (!this.options.exitOnArrowDown)
          return !1;
        const { state: e } = t, { selection: n, doc: r } = e, { $from: i, empty: o } = n;
        if (!o || i.parent.type !== this.type || !(i.parentOffset === i.parent.nodeSize - 2))
          return !1;
        const s = i.after();
        return s === void 0 ? !1 : r.nodeAt(s) ? t.commands.command(({ tr: c }) => (c.setSelection(ne.near(r.resolve(s))), !0)) : t.commands.exitCode();
      }
    };
  },
  addInputRules() {
    return [
      pc({
        find: yR,
        type: this.type,
        getAttributes: (t) => ({
          language: t[1]
        })
      }),
      pc({
        find: vR,
        type: this.type,
        getAttributes: (t) => ({
          language: t[1]
        })
      })
    ];
  },
  addProseMirrorPlugins() {
    return [
      // this plugin creates a code block for pasted content from VS Code
      // we can also detect the copied code language
      new Te({
        key: new Oe("codeBlockVSCodeHandler"),
        props: {
          handlePaste: (t, e) => {
            if (!e.clipboardData || this.editor.isActive(this.type.name))
              return !1;
            const n = e.clipboardData.getData("text/plain"), r = e.clipboardData.getData("vscode-editor-data"), i = r ? JSON.parse(r) : void 0, o = i == null ? void 0 : i.mode;
            if (!n || !o)
              return !1;
            const { tr: a, schema: s } = t.state, l = s.text(n.replace(/\r\n?/g, `
`));
            return a.replaceSelectionWith(this.type.create({ language: o }, l)), a.selection.$from.parent.type !== this.type && a.setSelection(K.near(a.doc.resolve(Math.max(0, a.selection.from - 2)))), a.setMeta("paste", !0), t.dispatch(a), !0;
          }
        }
      })
    ];
  }
}), RR = xe.create({
  name: "doc",
  topNode: !0,
  content: "block+"
});
function OR(t = {}) {
  return new Te({
    view(e) {
      return new NR(e, t);
    }
  });
}
class NR {
  constructor(e, n) {
    var r;
    this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = (r = n.width) !== null && r !== void 0 ? r : 1, this.color = n.color === !1 ? void 0 : n.color || "black", this.class = n.class, this.handlers = ["dragover", "dragend", "drop", "dragleave"].map((i) => {
      let o = (a) => {
        this[i](a);
      };
      return e.dom.addEventListener(i, o), { name: i, handler: o };
    });
  }
  destroy() {
    this.handlers.forEach(({ name: e, handler: n }) => this.editorView.dom.removeEventListener(e, n));
  }
  update(e, n) {
    this.cursorPos != null && n.doc != e.state.doc && (this.cursorPos > e.state.doc.content.size ? this.setCursor(null) : this.updateOverlay());
  }
  setCursor(e) {
    e != this.cursorPos && (this.cursorPos = e, e == null ? (this.element.parentNode.removeChild(this.element), this.element = null) : this.updateOverlay());
  }
  updateOverlay() {
    let e = this.editorView.state.doc.resolve(this.cursorPos), n = !e.parent.inlineContent, r;
    if (n) {
      let s = e.nodeBefore, l = e.nodeAfter;
      if (s || l) {
        let c = this.editorView.nodeDOM(this.cursorPos - (s ? s.nodeSize : 0));
        if (c) {
          let u = c.getBoundingClientRect(), d = s ? u.bottom : u.top;
          s && l && (d = (d + this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top) / 2), r = { left: u.left, right: u.right, top: d - this.width / 2, bottom: d + this.width / 2 };
        }
      }
    }
    if (!r) {
      let s = this.editorView.coordsAtPos(this.cursorPos);
      r = { left: s.left - this.width / 2, right: s.left + this.width / 2, top: s.top, bottom: s.bottom };
    }
    let i = this.editorView.dom.offsetParent;
    this.element || (this.element = i.appendChild(document.createElement("div")), this.class && (this.element.className = this.class), this.element.style.cssText = "position: absolute; z-index: 50; pointer-events: none;", this.color && (this.element.style.backgroundColor = this.color)), this.element.classList.toggle("prosemirror-dropcursor-block", n), this.element.classList.toggle("prosemirror-dropcursor-inline", !n);
    let o, a;
    if (!i || i == document.body && getComputedStyle(i).position == "static")
      o = -pageXOffset, a = -pageYOffset;
    else {
      let s = i.getBoundingClientRect();
      o = s.left - i.scrollLeft, a = s.top - i.scrollTop;
    }
    this.element.style.left = r.left - o + "px", this.element.style.top = r.top - a + "px", this.element.style.width = r.right - r.left + "px", this.element.style.height = r.bottom - r.top + "px";
  }
  scheduleRemoval(e) {
    clearTimeout(this.timeout), this.timeout = setTimeout(() => this.setCursor(null), e);
  }
  dragover(e) {
    if (!this.editorView.editable)
      return;
    let n = this.editorView.posAtCoords({ left: e.clientX, top: e.clientY }), r = n && n.inside >= 0 && this.editorView.state.doc.nodeAt(n.inside), i = r && r.type.spec.disableDropCursor, o = typeof i == "function" ? i(this.editorView, n, e) : i;
    if (n && !o) {
      let a = n.pos;
      if (this.editorView.dragging && this.editorView.dragging.slice) {
        let s = Qm(this.editorView.state.doc, a, this.editorView.dragging.slice);
        s != null && (a = s);
      }
      this.setCursor(a), this.scheduleRemoval(5e3);
    }
  }
  dragend() {
    this.scheduleRemoval(20);
  }
  drop() {
    this.scheduleRemoval(20);
  }
  dragleave(e) {
    (e.target == this.editorView.dom || !this.editorView.dom.contains(e.relatedTarget)) && this.setCursor(null);
  }
}
const AR = Se.create({
  name: "dropCursor",
  addOptions() {
    return {
      color: "currentColor",
      width: 1,
      class: void 0
    };
  },
  addProseMirrorPlugins() {
    return [
      OR(this.options)
    ];
  }
});
class ke extends ne {
  /**
  Create a gap cursor.
  */
  constructor(e) {
    super(e, e);
  }
  map(e, n) {
    let r = e.resolve(n.map(this.head));
    return ke.valid(r) ? new ke(r) : ne.near(r);
  }
  content() {
    return H.empty;
  }
  eq(e) {
    return e instanceof ke && e.head == this.head;
  }
  toJSON() {
    return { type: "gapcursor", pos: this.head };
  }
  /**
  @internal
  */
  static fromJSON(e, n) {
    if (typeof n.pos != "number")
      throw new RangeError("Invalid input for GapCursor.fromJSON");
    return new ke(e.resolve(n.pos));
  }
  /**
  @internal
  */
  getBookmark() {
    return new Su(this.anchor);
  }
  /**
  @internal
  */
  static valid(e) {
    let n = e.parent;
    if (n.isTextblock || !IR(e) || !xR(e))
      return !1;
    let r = n.type.spec.allowGapCursor;
    if (r != null)
      return r;
    let i = n.contentMatchAt(e.index()).defaultType;
    return i && i.isTextblock;
  }
  /**
  @internal
  */
  static findGapCursorFrom(e, n, r = !1) {
    e: for (; ; ) {
      if (!r && ke.valid(e))
        return e;
      let i = e.pos, o = null;
      for (let a = e.depth; ; a--) {
        let s = e.node(a);
        if (n > 0 ? e.indexAfter(a) < s.childCount : e.index(a) > 0) {
          o = s.child(n > 0 ? e.indexAfter(a) : e.index(a) - 1);
          break;
        } else if (a == 0)
          return null;
        i += n;
        let l = e.doc.resolve(i);
        if (ke.valid(l))
          return l;
      }
      for (; ; ) {
        let a = n > 0 ? o.firstChild : o.lastChild;
        if (!a) {
          if (o.isAtom && !o.isText && !ee.isSelectable(o)) {
            e = e.doc.resolve(i + o.nodeSize * n), r = !1;
            continue e;
          }
          break;
        }
        o = a, i += n;
        let s = e.doc.resolve(i);
        if (ke.valid(s))
          return s;
      }
      return null;
    }
  }
}
ke.prototype.visible = !1;
ke.findFrom = ke.findGapCursorFrom;
ne.jsonID("gapcursor", ke);
class Su {
  constructor(e) {
    this.pos = e;
  }
  map(e) {
    return new Su(e.map(this.pos));
  }
  resolve(e) {
    let n = e.resolve(this.pos);
    return ke.valid(n) ? new ke(n) : ne.near(n);
  }
}
function IR(t) {
  for (let e = t.depth; e >= 0; e--) {
    let n = t.index(e), r = t.node(e);
    if (n == 0) {
      if (r.type.spec.isolating)
        return !0;
      continue;
    }
    for (let i = r.child(n - 1); ; i = i.lastChild) {
      if (i.childCount == 0 && !i.inlineContent || i.isAtom || i.type.spec.isolating)
        return !0;
      if (i.inlineContent)
        return !1;
    }
  }
  return !0;
}
function xR(t) {
  for (let e = t.depth; e >= 0; e--) {
    let n = t.indexAfter(e), r = t.node(e);
    if (n == r.childCount) {
      if (r.type.spec.isolating)
        return !0;
      continue;
    }
    for (let i = r.child(n); ; i = i.firstChild) {
      if (i.childCount == 0 && !i.inlineContent || i.isAtom || i.type.spec.isolating)
        return !0;
      if (i.inlineContent)
        return !1;
    }
  }
  return !0;
}
function DR() {
  return new Te({
    props: {
      decorations: kR,
      createSelectionBetween(t, e, n) {
        return e.pos == n.pos && ke.valid(n) ? new ke(n) : null;
      },
      handleClick: MR,
      handleKeyDown: wR,
      handleDOMEvents: { beforeinput: LR }
    }
  });
}
const wR = eu({
  ArrowLeft: Uo("horiz", -1),
  ArrowRight: Uo("horiz", 1),
  ArrowUp: Uo("vert", -1),
  ArrowDown: Uo("vert", 1)
});
function Uo(t, e) {
  const n = t == "vert" ? e > 0 ? "down" : "up" : e > 0 ? "right" : "left";
  return function(r, i, o) {
    let a = r.selection, s = e > 0 ? a.$to : a.$from, l = a.empty;
    if (a instanceof K) {
      if (!o.endOfTextblock(n) || s.depth == 0)
        return !1;
      l = !1, s = r.doc.resolve(e > 0 ? s.after() : s.before());
    }
    let c = ke.findGapCursorFrom(s, e, l);
    return c ? (i && i(r.tr.setSelection(new ke(c))), !0) : !1;
  };
}
function MR(t, e, n) {
  if (!t || !t.editable)
    return !1;
  let r = t.state.doc.resolve(e);
  if (!ke.valid(r))
    return !1;
  let i = t.posAtCoords({ left: n.clientX, top: n.clientY });
  return i && i.inside > -1 && ee.isSelectable(t.state.doc.nodeAt(i.inside)) ? !1 : (t.dispatch(t.state.tr.setSelection(new ke(r))), !0);
}
function LR(t, e) {
  if (e.inputType != "insertCompositionText" || !(t.state.selection instanceof ke))
    return !1;
  let { $from: n } = t.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);
  if (!r)
    return !1;
  let i = L.empty;
  for (let a = r.length - 1; a >= 0; a--)
    i = L.from(r[a].createAndFill(null, i));
  let o = t.state.tr.replace(n.pos, n.pos, new H(i, 0, 0));
  return o.setSelection(K.near(o.doc.resolve(n.pos + 1))), t.dispatch(o), !1;
}
function kR(t) {
  if (!(t.selection instanceof ke))
    return null;
  let e = document.createElement("div");
  return e.className = "ProseMirror-gapcursor", ye.create(t.doc, [Be.widget(t.selection.head, e, { key: "gapcursor" })]);
}
const PR = Se.create({
  name: "gapCursor",
  addProseMirrorPlugins() {
    return [
      DR()
    ];
  },
  extendNodeSchema(t) {
    var e;
    const n = {
      name: t.name,
      options: t.options,
      storage: t.storage
    };
    return {
      allowGapCursor: (e = ce(z(t, "allowGapCursor", n))) !== null && e !== void 0 ? e : null
    };
  }
}), FR = xe.create({
  name: "hardBreak",
  addOptions() {
    return {
      keepMarks: !0,
      HTMLAttributes: {}
    };
  },
  inline: !0,
  group: "inline",
  selectable: !1,
  linebreakReplacement: !0,
  parseHTML() {
    return [
      { tag: "br" }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["br", me(this.options.HTMLAttributes, t)];
  },
  renderText() {
    return `
`;
  },
  addCommands() {
    return {
      setHardBreak: () => ({ commands: t, chain: e, state: n, editor: r }) => t.first([
        () => t.exitCode(),
        () => t.command(() => {
          const { selection: i, storedMarks: o } = n;
          if (i.$from.parent.type.spec.isolating)
            return !1;
          const { keepMarks: a } = this.options, { splittableMarks: s } = r.extensionManager, l = o || i.$to.parentOffset && i.$from.marks();
          return e().insertContent({ type: this.name }).command(({ tr: c, dispatch: u }) => {
            if (u && l && a) {
              const d = l.filter((p) => s.includes(p.type.name));
              c.ensureMarks(d);
            }
            return !0;
          }).run();
        })
      ])
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Enter": () => this.editor.commands.setHardBreak(),
      "Shift-Enter": () => this.editor.commands.setHardBreak()
    };
  }
}), Mg = xe.create({
  name: "heading",
  addOptions() {
    return {
      levels: [1, 2, 3, 4, 5, 6],
      HTMLAttributes: {}
    };
  },
  content: "inline*",
  group: "block",
  defining: !0,
  addAttributes() {
    return {
      level: {
        default: 1,
        rendered: !1
      }
    };
  },
  parseHTML() {
    return this.options.levels.map((t) => ({
      tag: `h${t}`,
      attrs: { level: t }
    }));
  },
  renderHTML({ node: t, HTMLAttributes: e }) {
    return [`h${this.options.levels.includes(t.attrs.level) ? t.attrs.level : this.options.levels[0]}`, me(this.options.HTMLAttributes, e), 0];
  },
  addCommands() {
    return {
      setHeading: (t) => ({ commands: e }) => this.options.levels.includes(t.level) ? e.setNode(this.name, t) : !1,
      toggleHeading: (t) => ({ commands: e }) => this.options.levels.includes(t.level) ? e.toggleNode(this.name, "paragraph", t) : !1
    };
  },
  addKeyboardShortcuts() {
    return this.options.levels.reduce((t, e) => ({
      ...t,
      [`Mod-Alt-${e}`]: () => this.editor.commands.toggleHeading({ level: e })
    }), {});
  },
  addInputRules() {
    return this.options.levels.map((t) => pc({
      find: new RegExp(`^(#{${Math.min(...this.options.levels)},${t}})\\s$`),
      type: this.type,
      getAttributes: {
        level: t
      }
    }));
  }
});
var Ia = 200, ze = function() {
};
ze.prototype.append = function(e) {
  return e.length ? (e = ze.from(e), !this.length && e || e.length < Ia && this.leafAppend(e) || this.length < Ia && e.leafPrepend(this) || this.appendInner(e)) : this;
};
ze.prototype.prepend = function(e) {
  return e.length ? ze.from(e).append(this) : this;
};
ze.prototype.appendInner = function(e) {
  return new BR(this, e);
};
ze.prototype.slice = function(e, n) {
  return e === void 0 && (e = 0), n === void 0 && (n = this.length), e >= n ? ze.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, n));
};
ze.prototype.get = function(e) {
  if (!(e < 0 || e >= this.length))
    return this.getInner(e);
};
ze.prototype.forEach = function(e, n, r) {
  n === void 0 && (n = 0), r === void 0 && (r = this.length), n <= r ? this.forEachInner(e, n, r, 0) : this.forEachInvertedInner(e, n, r, 0);
};
ze.prototype.map = function(e, n, r) {
  n === void 0 && (n = 0), r === void 0 && (r = this.length);
  var i = [];
  return this.forEach(function(o, a) {
    return i.push(e(o, a));
  }, n, r), i;
};
ze.from = function(e) {
  return e instanceof ze ? e : e && e.length ? new Lg(e) : ze.empty;
};
var Lg = /* @__PURE__ */ function(t) {
  function e(r) {
    t.call(this), this.values = r;
  }
  t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e;
  var n = { length: { configurable: !0 }, depth: { configurable: !0 } };
  return e.prototype.flatten = function() {
    return this.values;
  }, e.prototype.sliceInner = function(i, o) {
    return i == 0 && o == this.length ? this : new e(this.values.slice(i, o));
  }, e.prototype.getInner = function(i) {
    return this.values[i];
  }, e.prototype.forEachInner = function(i, o, a, s) {
    for (var l = o; l < a; l++)
      if (i(this.values[l], s + l) === !1)
        return !1;
  }, e.prototype.forEachInvertedInner = function(i, o, a, s) {
    for (var l = o - 1; l >= a; l--)
      if (i(this.values[l], s + l) === !1)
        return !1;
  }, e.prototype.leafAppend = function(i) {
    if (this.length + i.length <= Ia)
      return new e(this.values.concat(i.flatten()));
  }, e.prototype.leafPrepend = function(i) {
    if (this.length + i.length <= Ia)
      return new e(i.flatten().concat(this.values));
  }, n.length.get = function() {
    return this.values.length;
  }, n.depth.get = function() {
    return 0;
  }, Object.defineProperties(e.prototype, n), e;
}(ze);
ze.empty = new Lg([]);
var BR = /* @__PURE__ */ function(t) {
  function e(n, r) {
    t.call(this), this.left = n, this.right = r, this.length = n.length + r.length, this.depth = Math.max(n.depth, r.depth) + 1;
  }
  return t && (e.__proto__ = t), e.prototype = Object.create(t && t.prototype), e.prototype.constructor = e, e.prototype.flatten = function() {
    return this.left.flatten().concat(this.right.flatten());
  }, e.prototype.getInner = function(r) {
    return r < this.left.length ? this.left.get(r) : this.right.get(r - this.left.length);
  }, e.prototype.forEachInner = function(r, i, o, a) {
    var s = this.left.length;
    if (i < s && this.left.forEachInner(r, i, Math.min(o, s), a) === !1 || o > s && this.right.forEachInner(r, Math.max(i - s, 0), Math.min(this.length, o) - s, a + s) === !1)
      return !1;
  }, e.prototype.forEachInvertedInner = function(r, i, o, a) {
    var s = this.left.length;
    if (i > s && this.right.forEachInvertedInner(r, i - s, Math.max(o, s) - s, a + s) === !1 || o < s && this.left.forEachInvertedInner(r, Math.min(i, s), o, a) === !1)
      return !1;
  }, e.prototype.sliceInner = function(r, i) {
    if (r == 0 && i == this.length)
      return this;
    var o = this.left.length;
    return i <= o ? this.left.slice(r, i) : r >= o ? this.right.slice(r - o, i - o) : this.left.slice(r, o).append(this.right.slice(0, i - o));
  }, e.prototype.leafAppend = function(r) {
    var i = this.right.leafAppend(r);
    if (i)
      return new e(this.left, i);
  }, e.prototype.leafPrepend = function(r) {
    var i = this.left.leafPrepend(r);
    if (i)
      return new e(i, this.right);
  }, e.prototype.appendInner = function(r) {
    return this.left.depth >= Math.max(this.right.depth, r.depth) + 1 ? new e(this.left, new e(this.right, r)) : new e(this, r);
  }, e;
}(ze);
const UR = 500;
class Gt {
  constructor(e, n) {
    this.items = e, this.eventCount = n;
  }
  // Pop the latest event off the branch's history and apply it
  // to a document transform.
  popEvent(e, n) {
    if (this.eventCount == 0)
      return null;
    let r = this.items.length;
    for (; ; r--)
      if (this.items.get(r - 1).selection) {
        --r;
        break;
      }
    let i, o;
    n && (i = this.remapping(r, this.items.length), o = i.maps.length);
    let a = e.tr, s, l, c = [], u = [];
    return this.items.forEach((d, p) => {
      if (!d.step) {
        i || (i = this.remapping(r, p + 1), o = i.maps.length), o--, u.push(d);
        return;
      }
      if (i) {
        u.push(new qt(d.map));
        let _ = d.step.map(i.slice(o)), m;
        _ && a.maybeStep(_).doc && (m = a.mapping.maps[a.mapping.maps.length - 1], c.push(new qt(m, void 0, void 0, c.length + u.length))), o--, m && i.appendMap(m, o);
      } else
        a.maybeStep(d.step);
      if (d.selection)
        return s = i ? d.selection.map(i.slice(o)) : d.selection, l = new Gt(this.items.slice(0, r).append(u.reverse().concat(c)), this.eventCount - 1), !1;
    }, this.items.length, 0), { remaining: l, transform: a, selection: s };
  }
  // Create a new branch with the given transform added.
  addTransform(e, n, r, i) {
    let o = [], a = this.eventCount, s = this.items, l = !i && s.length ? s.get(s.length - 1) : null;
    for (let u = 0; u < e.steps.length; u++) {
      let d = e.steps[u].invert(e.docs[u]), p = new qt(e.mapping.maps[u], d, n), _;
      (_ = l && l.merge(p)) && (p = _, u ? o.pop() : s = s.slice(0, s.length - 1)), o.push(p), n && (a++, n = void 0), i || (l = p);
    }
    let c = a - r.depth;
    return c > GR && (s = HR(s, c), a -= c), new Gt(s.append(o), a);
  }
  remapping(e, n) {
    let r = new zr();
    return this.items.forEach((i, o) => {
      let a = i.mirrorOffset != null && o - i.mirrorOffset >= e ? r.maps.length - i.mirrorOffset : void 0;
      r.appendMap(i.map, a);
    }, e, n), r;
  }
  addMaps(e) {
    return this.eventCount == 0 ? this : new Gt(this.items.append(e.map((n) => new qt(n))), this.eventCount);
  }
  // When the collab module receives remote changes, the history has
  // to know about those, so that it can adjust the steps that were
  // rebased on top of the remote changes, and include the position
  // maps for the remote changes in its array of items.
  rebased(e, n) {
    if (!this.eventCount)
      return this;
    let r = [], i = Math.max(0, this.items.length - n), o = e.mapping, a = e.steps.length, s = this.eventCount;
    this.items.forEach((p) => {
      p.selection && s--;
    }, i);
    let l = n;
    this.items.forEach((p) => {
      let _ = o.getMirror(--l);
      if (_ == null)
        return;
      a = Math.min(a, _);
      let m = o.maps[_];
      if (p.step) {
        let f = e.steps[_].invert(e.docs[_]), g = p.selection && p.selection.map(o.slice(l + 1, _));
        g && s++, r.push(new qt(m, f, g));
      } else
        r.push(new qt(m));
    }, i);
    let c = [];
    for (let p = n; p < a; p++)
      c.push(new qt(o.maps[p]));
    let u = this.items.slice(0, i).append(c).append(r), d = new Gt(u, s);
    return d.emptyItemCount() > UR && (d = d.compress(this.items.length - r.length)), d;
  }
  emptyItemCount() {
    let e = 0;
    return this.items.forEach((n) => {
      n.step || e++;
    }), e;
  }
  // Compressing a branch means rewriting it to push the air (map-only
  // items) out. During collaboration, these naturally accumulate
  // because each remote change adds one. The `upto` argument is used
  // to ensure that only the items below a given level are compressed,
  // because `rebased` relies on a clean, untouched set of items in
  // order to associate old items with rebased steps.
  compress(e = this.items.length) {
    let n = this.remapping(0, e), r = n.maps.length, i = [], o = 0;
    return this.items.forEach((a, s) => {
      if (s >= e)
        i.push(a), a.selection && o++;
      else if (a.step) {
        let l = a.step.map(n.slice(r)), c = l && l.getMap();
        if (r--, c && n.appendMap(c, r), l) {
          let u = a.selection && a.selection.map(n.slice(r));
          u && o++;
          let d = new qt(c.invert(), l, u), p, _ = i.length - 1;
          (p = i.length && i[_].merge(d)) ? i[_] = p : i.push(d);
        }
      } else a.map && r--;
    }, this.items.length, 0), new Gt(ze.from(i.reverse()), o);
  }
}
Gt.empty = new Gt(ze.empty, 0);
function HR(t, e) {
  let n;
  return t.forEach((r, i) => {
    if (r.selection && e-- == 0)
      return n = i, !1;
  }), t.slice(n);
}
class qt {
  constructor(e, n, r, i) {
    this.map = e, this.step = n, this.selection = r, this.mirrorOffset = i;
  }
  merge(e) {
    if (this.step && e.step && !e.selection) {
      let n = e.step.merge(this.step);
      if (n)
        return new qt(n.getMap().invert(), n, this.selection);
    }
  }
}
class Rn {
  constructor(e, n, r, i, o) {
    this.done = e, this.undone = n, this.prevRanges = r, this.prevTime = i, this.prevComposition = o;
  }
}
const GR = 20;
function VR(t, e, n, r) {
  let i = n.getMeta(dr), o;
  if (i)
    return i.historyState;
  n.getMeta(zR) && (t = new Rn(t.done, t.undone, null, 0, -1));
  let a = n.getMeta("appendedTransaction");
  if (n.steps.length == 0)
    return t;
  if (a && a.getMeta(dr))
    return a.getMeta(dr).redo ? new Rn(t.done.addTransform(n, void 0, r, aa(e)), t.undone, Jp(n.mapping.maps), t.prevTime, t.prevComposition) : new Rn(t.done, t.undone.addTransform(n, void 0, r, aa(e)), null, t.prevTime, t.prevComposition);
  if (n.getMeta("addToHistory") !== !1 && !(a && a.getMeta("addToHistory") === !1)) {
    let s = n.getMeta("composition"), l = t.prevTime == 0 || !a && t.prevComposition != s && (t.prevTime < (n.time || 0) - r.newGroupDelay || !YR(n, t.prevRanges)), c = a ? Sl(t.prevRanges, n.mapping) : Jp(n.mapping.maps);
    return new Rn(t.done.addTransform(n, l ? e.selection.getBookmark() : void 0, r, aa(e)), Gt.empty, c, n.time, s ?? t.prevComposition);
  } else return (o = n.getMeta("rebased")) ? new Rn(t.done.rebased(n, o), t.undone.rebased(n, o), Sl(t.prevRanges, n.mapping), t.prevTime, t.prevComposition) : new Rn(t.done.addMaps(n.mapping.maps), t.undone.addMaps(n.mapping.maps), Sl(t.prevRanges, n.mapping), t.prevTime, t.prevComposition);
}
function YR(t, e) {
  if (!e)
    return !1;
  if (!t.docChanged)
    return !0;
  let n = !1;
  return t.mapping.maps[0].forEach((r, i) => {
    for (let o = 0; o < e.length; o += 2)
      r <= e[o + 1] && i >= e[o] && (n = !0);
  }), n;
}
function Jp(t) {
  let e = [];
  for (let n = t.length - 1; n >= 0 && e.length == 0; n--)
    t[n].forEach((r, i, o, a) => e.push(o, a));
  return e;
}
function Sl(t, e) {
  if (!t)
    return null;
  let n = [];
  for (let r = 0; r < t.length; r += 2) {
    let i = e.map(t[r], 1), o = e.map(t[r + 1], -1);
    i <= o && n.push(i, o);
  }
  return n;
}
function $R(t, e, n) {
  let r = aa(e), i = dr.get(e).spec.config, o = (n ? t.undone : t.done).popEvent(e, r);
  if (!o)
    return null;
  let a = o.selection.resolve(o.transform.doc), s = (n ? t.done : t.undone).addTransform(o.transform, e.selection.getBookmark(), i, r), l = new Rn(n ? s : o.remaining, n ? o.remaining : s, null, 0, -1);
  return o.transform.setSelection(a).setMeta(dr, { redo: n, historyState: l });
}
let bl = !1, e_ = null;
function aa(t) {
  let e = t.plugins;
  if (e_ != e) {
    bl = !1, e_ = e;
    for (let n = 0; n < e.length; n++)
      if (e[n].spec.historyPreserveItems) {
        bl = !0;
        break;
      }
  }
  return bl;
}
const dr = new Oe("history"), zR = new Oe("closeHistory");
function qR(t = {}) {
  return t = {
    depth: t.depth || 100,
    newGroupDelay: t.newGroupDelay || 500
  }, new Te({
    key: dr,
    state: {
      init() {
        return new Rn(Gt.empty, Gt.empty, null, 0, -1);
      },
      apply(e, n, r) {
        return VR(n, r, e, t);
      }
    },
    config: t,
    props: {
      handleDOMEvents: {
        beforeinput(e, n) {
          let r = n.inputType, i = r == "historyUndo" ? Pg : r == "historyRedo" ? Fg : null;
          return i ? (n.preventDefault(), i(e.state, e.dispatch)) : !1;
        }
      }
    }
  });
}
function kg(t, e) {
  return (n, r) => {
    let i = dr.getState(n);
    if (!i || (t ? i.undone : i.done).eventCount == 0)
      return !1;
    if (r) {
      let o = $R(i, n, t);
      o && r(e ? o.scrollIntoView() : o);
    }
    return !0;
  };
}
const Pg = kg(!1, !0), Fg = kg(!0, !0), WR = Se.create({
  name: "history",
  addOptions() {
    return {
      depth: 100,
      newGroupDelay: 500
    };
  },
  addCommands() {
    return {
      undo: () => ({ state: t, dispatch: e }) => Pg(t, e),
      redo: () => ({ state: t, dispatch: e }) => Fg(t, e)
    };
  },
  addProseMirrorPlugins() {
    return [
      qR(this.options)
    ];
  },
  addKeyboardShortcuts() {
    return {
      "Mod-z": () => this.editor.commands.undo(),
      "Shift-Mod-z": () => this.editor.commands.redo(),
      "Mod-y": () => this.editor.commands.redo(),
      // Russian keyboard layouts
      "Mod-я": () => this.editor.commands.undo(),
      "Shift-Mod-я": () => this.editor.commands.redo()
    };
  }
}), KR = xe.create({
  name: "horizontalRule",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  group: "block",
  parseHTML() {
    return [{ tag: "hr" }];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["hr", me(this.options.HTMLAttributes, t)];
  },
  addCommands() {
    return {
      setHorizontalRule: () => ({ chain: t, state: e }) => {
        const { selection: n } = e, { $from: r, $to: i } = n, o = t();
        return r.parentOffset === 0 ? o.insertContentAt({
          from: Math.max(r.pos - 1, 0),
          to: i.pos
        }, {
          type: this.name
        }) : eg(n) ? o.insertContentAt(i.pos, {
          type: this.name
        }) : o.insertContent({ type: this.name }), o.command(({ tr: a, dispatch: s }) => {
          var l;
          if (s) {
            const { $to: c } = a.selection, u = c.end();
            if (c.nodeAfter)
              c.nodeAfter.isTextblock ? a.setSelection(K.create(a.doc, c.pos + 1)) : c.nodeAfter.isBlock ? a.setSelection(ee.create(a.doc, c.pos)) : a.setSelection(K.create(a.doc, c.pos));
            else {
              const d = (l = c.parent.type.contentMatch.defaultType) === null || l === void 0 ? void 0 : l.create();
              d && (a.insert(u, d), a.setSelection(K.create(a.doc, u + 1)));
            }
            a.scrollIntoView();
          }
          return !0;
        }).run();
      }
    };
  },
  addInputRules() {
    return [
      cu({
        find: /^(?:---|—-|___\s|\*\*\*\s)$/,
        type: this.type
      })
    ];
  }
}), QR = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/, ZR = /(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g, XR = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/, jR = /(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g, JR = St.create({
  name: "italic",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  parseHTML() {
    return [
      {
        tag: "em"
      },
      {
        tag: "i",
        getAttrs: (t) => t.style.fontStyle !== "normal" && null
      },
      {
        style: "font-style=normal",
        clearMark: (t) => t.type.name === this.name
      },
      {
        style: "font-style=italic"
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["em", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setItalic: () => ({ commands: t }) => t.setMark(this.name),
      toggleItalic: () => ({ commands: t }) => t.toggleMark(this.name),
      unsetItalic: () => ({ commands: t }) => t.unsetMark(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-i": () => this.editor.commands.toggleItalic(),
      "Mod-I": () => this.editor.commands.toggleItalic()
    };
  },
  addInputRules() {
    return [
      Er({
        find: QR,
        type: this.type
      }),
      Er({
        find: XR,
        type: this.type
      })
    ];
  },
  addPasteRules() {
    return [
      $n({
        find: ZR,
        type: this.type
      }),
      $n({
        find: jR,
        type: this.type
      })
    ];
  }
}), eO = xe.create({
  name: "listItem",
  addOptions() {
    return {
      HTMLAttributes: {},
      bulletListTypeName: "bulletList",
      orderedListTypeName: "orderedList"
    };
  },
  content: "paragraph block*",
  defining: !0,
  parseHTML() {
    return [
      {
        tag: "li"
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["li", me(this.options.HTMLAttributes, t), 0];
  },
  addKeyboardShortcuts() {
    return {
      Enter: () => this.editor.commands.splitListItem(this.name),
      Tab: () => this.editor.commands.sinkListItem(this.name),
      "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
    };
  }
}), tO = "listItem", t_ = "textStyle", n_ = /^(\d+)\.\s$/, nO = xe.create({
  name: "orderedList",
  addOptions() {
    return {
      itemTypeName: "listItem",
      HTMLAttributes: {},
      keepMarks: !1,
      keepAttributes: !1
    };
  },
  group: "block list",
  content() {
    return `${this.options.itemTypeName}+`;
  },
  addAttributes() {
    return {
      start: {
        default: 1,
        parseHTML: (t) => t.hasAttribute("start") ? parseInt(t.getAttribute("start") || "", 10) : 1
      },
      type: {
        default: void 0,
        parseHTML: (t) => t.getAttribute("type")
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: "ol"
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    const { start: e, ...n } = t;
    return e === 1 ? ["ol", me(this.options.HTMLAttributes, n), 0] : ["ol", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      toggleOrderedList: () => ({ commands: t, chain: e }) => this.options.keepAttributes ? e().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(tO, this.editor.getAttributes(t_)).run() : t.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-7": () => this.editor.commands.toggleOrderedList()
    };
  },
  addInputRules() {
    let t = Sr({
      find: n_,
      type: this.type,
      getAttributes: (e) => ({ start: +e[1] }),
      joinPredicate: (e, n) => n.childCount + n.attrs.start === +e[1]
    });
    return (this.options.keepMarks || this.options.keepAttributes) && (t = Sr({
      find: n_,
      type: this.type,
      keepMarks: this.options.keepMarks,
      keepAttributes: this.options.keepAttributes,
      getAttributes: (e) => ({ start: +e[1], ...this.editor.getAttributes(t_) }),
      joinPredicate: (e, n) => n.childCount + n.attrs.start === +e[1],
      editor: this.editor
    })), [
      t
    ];
  }
}), rO = xe.create({
  name: "paragraph",
  priority: 1e3,
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  group: "block",
  content: "inline*",
  parseHTML() {
    return [
      { tag: "p" }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["p", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setParagraph: () => ({ commands: t }) => t.setNode(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Alt-0": () => this.editor.commands.setParagraph()
    };
  }
}), iO = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/, oO = /(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g, aO = St.create({
  name: "strike",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  parseHTML() {
    return [
      {
        tag: "s"
      },
      {
        tag: "del"
      },
      {
        tag: "strike"
      },
      {
        style: "text-decoration",
        consuming: !1,
        getAttrs: (t) => t.includes("line-through") ? {} : !1
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["s", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setStrike: () => ({ commands: t }) => t.setMark(this.name),
      toggleStrike: () => ({ commands: t }) => t.toggleMark(this.name),
      unsetStrike: () => ({ commands: t }) => t.unsetMark(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-s": () => this.editor.commands.toggleStrike()
    };
  },
  addInputRules() {
    return [
      Er({
        find: iO,
        type: this.type
      })
    ];
  },
  addPasteRules() {
    return [
      $n({
        find: oO,
        type: this.type
      })
    ];
  }
}), sO = xe.create({
  name: "text",
  group: "inline"
}), lO = Se.create({
  name: "starterKit",
  addExtensions() {
    var t, e, n, r, i, o, a, s, l, c, u, d, p, _, m, f, g, S;
    const E = [];
    return this.options.bold !== !1 && E.push(hR.configure((t = this.options) === null || t === void 0 ? void 0 : t.bold)), this.options.blockquote !== !1 && E.push(pR.configure((e = this.options) === null || e === void 0 ? void 0 : e.blockquote)), this.options.bulletList !== !1 && E.push(SR.configure((n = this.options) === null || n === void 0 ? void 0 : n.bulletList)), this.options.code !== !1 && E.push(CR.configure((r = this.options) === null || r === void 0 ? void 0 : r.code)), this.options.codeBlock !== !1 && E.push(wg.configure((i = this.options) === null || i === void 0 ? void 0 : i.codeBlock)), this.options.document !== !1 && E.push(RR.configure((o = this.options) === null || o === void 0 ? void 0 : o.document)), this.options.dropcursor !== !1 && E.push(AR.configure((a = this.options) === null || a === void 0 ? void 0 : a.dropcursor)), this.options.gapcursor !== !1 && E.push(PR.configure((s = this.options) === null || s === void 0 ? void 0 : s.gapcursor)), this.options.hardBreak !== !1 && E.push(FR.configure((l = this.options) === null || l === void 0 ? void 0 : l.hardBreak)), this.options.heading !== !1 && E.push(Mg.configure((c = this.options) === null || c === void 0 ? void 0 : c.heading)), this.options.history !== !1 && E.push(WR.configure((u = this.options) === null || u === void 0 ? void 0 : u.history)), this.options.horizontalRule !== !1 && E.push(KR.configure((d = this.options) === null || d === void 0 ? void 0 : d.horizontalRule)), this.options.italic !== !1 && E.push(JR.configure((p = this.options) === null || p === void 0 ? void 0 : p.italic)), this.options.listItem !== !1 && E.push(eO.configure((_ = this.options) === null || _ === void 0 ? void 0 : _.listItem)), this.options.orderedList !== !1 && E.push(nO.configure((m = this.options) === null || m === void 0 ? void 0 : m.orderedList)), this.options.paragraph !== !1 && E.push(rO.configure((f = this.options) === null || f === void 0 ? void 0 : f.paragraph)), this.options.strike !== !1 && E.push(aO.configure((g = this.options) === null || g === void 0 ? void 0 : g.strike)), this.options.text !== !1 && E.push(sO.configure((S = this.options) === null || S === void 0 ? void 0 : S.text)), E;
  }
}), cO = St.create({
  name: "underline",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  parseHTML() {
    return [
      {
        tag: "u"
      },
      {
        style: "text-decoration",
        consuming: !1,
        getAttrs: (t) => t.includes("underline") ? {} : !1
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["u", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setUnderline: () => ({ commands: t }) => t.setMark(this.name),
      toggleUnderline: () => ({ commands: t }) => t.toggleMark(this.name),
      unsetUnderline: () => ({ commands: t }) => t.unsetMark(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-u": () => this.editor.commands.toggleUnderline(),
      "Mod-U": () => this.editor.commands.toggleUnderline()
    };
  }
}), uO = (t) => {
  if (!t.children.length)
    return;
  const e = t.querySelectorAll("span");
  e && e.forEach((n) => {
    var r, i;
    const o = n.getAttribute("style"), a = (i = (r = n.parentElement) === null || r === void 0 ? void 0 : r.closest("span")) === null || i === void 0 ? void 0 : i.getAttribute("style");
    n.setAttribute("style", `${a};${o}`);
  });
}, dO = St.create({
  name: "textStyle",
  priority: 101,
  addOptions() {
    return {
      HTMLAttributes: {},
      mergeNestedSpanStyles: !1
    };
  },
  parseHTML() {
    return [
      {
        tag: "span",
        getAttrs: (t) => t.hasAttribute("style") ? (this.options.mergeNestedSpanStyles && uO(t), {}) : !1
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["span", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      removeEmptyTextStyle: () => ({ tr: t }) => {
        const { selection: e } = t;
        return t.doc.nodesBetween(e.from, e.to, (n, r) => {
          if (n.isTextblock)
            return !0;
          n.marks.filter((i) => i.type === this.type).some((i) => Object.values(i.attrs).some((o) => !!o)) || t.removeMark(r, r + n.nodeSize, this.type);
        }), !0;
      }
    };
  }
}), pO = Se.create({
  name: "fontFamily",
  addOptions() {
    return {
      types: ["textStyle"]
    };
  },
  addGlobalAttributes() {
    return [
      {
        types: this.options.types,
        attributes: {
          fontFamily: {
            default: null,
            parseHTML: (t) => t.style.fontFamily,
            renderHTML: (t) => t.fontFamily ? {
              style: `font-family: ${t.fontFamily}`
            } : {}
          }
        }
      }
    ];
  },
  addCommands() {
    return {
      setFontFamily: (t) => ({ chain: e }) => e().setMark("textStyle", { fontFamily: t }).run(),
      unsetFontFamily: () => ({ chain: t }) => t().setMark("textStyle", { fontFamily: null }).removeEmptyTextStyle().run()
    };
  }
}), Bg = (t) => {
  const e = document.createElement("div");
  return e.classList.add("linwiteditor-loader-placeholder"), e.innerHTML = `
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path></svg>
    `, Be.widget(t.pos, e, { id: t.id });
}, _O = (t) => {
  const e = document.createElement("div");
  return e.classList.add("linwiteditor-loader-placeholder"), e.style.height = "20px", e.style.display = "inline-block", e.innerHTML = `
    <svg style="width: 16px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 3C16.9706 3 21 7.02944 21 12H19C19 8.13401 15.866 5 12 5V3Z"></path></svg>
   ${t.text}
    `, Be.widget(t.pos, e, { id: t.id });
}, mO = (t, e, n, r) => {
  const i = new FormData();
  return i.append(r, t), new Promise((o, a) => {
    fetch(e, {
      method: "post",
      headers: { Accept: "application/json", ...n },
      body: i
    }).then((s) => s.json()).then((s) => {
      o(s);
    }).catch((s) => {
      a(s);
    });
  });
}, fO = (t, e, n, r) => {
  let i = new FileReader();
  return new Promise((o, a) => {
    i.onload = () => o({ errorCode: 0, data: { src: i.result, href: t.name } }), i.onerror = () => a(i.error), setTimeout(() => i.readAsDataURL(t), 5e3 * Math.random());
  });
}, bu = (t) => t ? mO : fO, r_ = new Oe("linwiteditor-attachment-plugin"), bi = "attachment_action", gO = Se.create({
  name: "attachment",
  addOptions() {
    return {
      uploadUrl: "",
      uploadHeaders: {},
      HTMLAttributes: {}
    };
  },
  addCommands() {
    return {
      uploadAttachment: (t) => () => {
        const e = typeof this.options.uploadHeaders == "object" ? this.options.uploadHeaders : typeof this.options.uploadHeaders == "function" ? this.options.uploadHeaders() : {};
        if (this.options.uploaderEvent && this.options.uploaderEvent.onUploadBefore && this.options.uploaderEvent.onUploadBefore(t, this.options.uploadUrl, e) === !1)
          return !1;
        const n = Ms(), { state: { tr: r }, view: i, schema: o } = this.editor;
        r.selection.empty || r.deleteSelection(), i.dispatch(r.setMeta(bi, {
          type: "add",
          id: n,
          pos: r.selection.from,
          text: t.name
        }));
        const a = this.options.uploader || bu(this.options.uploadUrl), s = this.options.uploadFormName || "attachment";
        return a(t, this.options.uploadUrl, e, s).then((l) => {
          var c;
          if ((c = this.options.uploaderEvent) != null && c.onSuccess) {
            const u = this.options.uploaderEvent.onSuccess(t, l);
            if (typeof u == "boolean" && !u)
              return;
            typeof u == "object" && (l = u);
          }
          if (l.errorCode === 0 && l.data && l.data.href) {
            let d = r_.getState(this.editor.state).find(void 0, void 0, (_) => _.id == n);
            const p = l.data.fileName || t.name;
            i.dispatch(i.state.tr.insertText(` ${p} `, d[0].from).addMark(d[0].from + 1, p.length + d[0].from + 1, o.marks.link.create({
              href: l.data.href,
              target: "_blank"
            })).setMeta(bi, { type: "remove", id: n }));
          } else
            i.dispatch(r.setMeta(bi, { type: "remove", id: n })), this.options.uploaderEvent && this.options.uploaderEvent.onFailed && this.options.uploaderEvent.onFailed(t, l);
        }).catch((l) => {
          const { state: { tr: c }, view: u } = this.editor;
          u.dispatch(c.setMeta(bi, { type: "remove", id: n })), this.options.uploaderEvent && this.options.uploaderEvent.onError && this.options.uploaderEvent.onError(t, l);
        }), !0;
      }
    };
  },
  addProseMirrorPlugins() {
    const t = this.editor;
    return [
      new Te({
        key: r_,
        state: {
          init: () => ye.empty,
          apply: (e, n) => {
            const r = e.getMeta(bi);
            return n = n.map(e.mapping, e.doc), r && r.type === "add" ? n = n.add(e.doc, [_O(r)]) : r && r.type === "remove" && (n = n.remove(n.find(
              void 0,
              void 0,
              (i) => i.id == r.id
            ))), n;
          }
        },
        props: {
          decorations(e) {
            return this.getState(e);
          },
          handleDOMEvents: {
            drop(e, n) {
              if (!(n.dataTransfer && n.dataTransfer.files && n.dataTransfer.files.length)) return !1;
              const i = Array.from(n.dataTransfer.files).filter((o) => !/video/i.test(o.type) && !/image/i.test(o.type));
              return n.preventDefault(), i.forEach((o) => {
                t.commands.uploadAttachment(o);
              }), !0;
            }
          }
        }
      })
    ];
  }
}), hO = Se.create({
  name: "painter",
  addCommands() {
    return {
      setPainter: (t) => ({ view: { dispatch: e, state: { tr: n }, dom: r } }) => (r.style.cursor = "context-menu", e(n.setMeta("painterAction", { type: "start", marks: t })), !0)
    };
  },
  addProseMirrorPlugins() {
    return [
      new Te({
        key: new Oe("linwiteditor-painter"),
        state: {
          init: () => [],
          apply: (t, e) => {
            const n = t.getMeta("painterAction");
            return n && n.type === "start" ? e = n.marks : n && n.type === "end" && (e = []), e;
          }
        },
        props: {
          handleDOMEvents: {
            mousedown(t, e) {
              const n = this.getState(t.state);
              if (!n || n.length == 0)
                return !1;
              const r = () => {
                document.removeEventListener("mouseup", r);
                let { dispatch: i, state: { tr: o, selection: a }, dom: s } = t;
                s.style.cursor = "", o = o.removeMark(a.from, a.to);
                for (let l of n)
                  l.type.name != "link" && (o = o.addMark(a.from, a.to, l));
                i(o.setMeta("painterAction", { type: "end" }));
              };
              return document.addEventListener("mouseup", r), !0;
            }
          }
        }
      })
    ];
  }
}), EO = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, SO = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, bO = St.create({
  name: "highlight",
  addOptions() {
    return {
      multicolor: !1,
      HTMLAttributes: {}
    };
  },
  addAttributes() {
    return this.options.multicolor ? {
      color: {
        default: null,
        parseHTML: (t) => t.getAttribute("data-color") || t.style.backgroundColor,
        renderHTML: (t) => t.color ? {
          "data-color": t.color,
          style: `background-color: ${t.color}; color: inherit`
        } : {}
      }
    } : {};
  },
  parseHTML() {
    return [
      {
        tag: "mark"
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["mark", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setHighlight: (t) => ({ commands: e }) => e.setMark(this.name, t),
      toggleHighlight: (t) => ({ commands: e }) => e.toggleMark(this.name, t),
      unsetHighlight: () => ({ commands: t }) => t.unsetMark(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-h": () => this.editor.commands.toggleHighlight()
    };
  },
  addInputRules() {
    return [
      Er({
        find: EO,
        type: this.type
      })
    ];
  },
  addPasteRules() {
    return [
      $n({
        find: SO,
        type: this.type
      })
    ];
  }
}), TO = Se.create({
  name: "color",
  addOptions() {
    return {
      types: ["textStyle"]
    };
  },
  addGlobalAttributes() {
    return [
      {
        types: this.options.types,
        attributes: {
          color: {
            default: null,
            parseHTML: (t) => {
              var e;
              return (e = t.style.color) === null || e === void 0 ? void 0 : e.replace(/['"]+/g, "");
            },
            renderHTML: (t) => t.color ? {
              style: `color: ${t.color}`
            } : {}
          }
        }
      }
    ];
  },
  addCommands() {
    return {
      setColor: (t) => ({ chain: e }) => e().setMark("textStyle", { color: t }).run(),
      unsetColor: () => ({ chain: t }) => t().setMark("textStyle", { color: null }).removeEmptyTextStyle().run()
    };
  }
}), CO = Se.create({
  name: "fontSize",
  addOptions() {
    return {
      types: ["textStyle"]
    };
  },
  addGlobalAttributes() {
    return [
      {
        types: this.options.types,
        attributes: {
          fontSize: {
            default: null,
            parseHTML: (t) => {
              var e;
              return (e = t.style.fontSize) == null ? void 0 : e.replace(/['"]+/g, "");
            },
            renderHTML: (t) => t.fontSize ? {
              style: `font-size: ${t.fontSize}`
            } : {}
          }
        }
      }
    ];
  },
  addCommands() {
    return {
      setFontSize: (t) => ({ chain: e }) => e().setMark("textStyle", { fontSize: t }).run(),
      unsetFontSize: () => ({ chain: t }) => t().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run()
    };
  }
}), yO = Se.create({
  name: "lineHeight",
  addOptions() {
    return {
      types: ["heading", "paragraph"],
      defaultHeight: "100%"
    };
  },
  addGlobalAttributes() {
    return [
      {
        types: this.options.types,
        attributes: {
          lineHeight: {
            default: this.options.defaultHeight,
            parseHTML: (t) => t.style.lineHeight || this.options.defaultHeight,
            renderHTML: (t) => t.lineHeight === this.options.defaultHeight ? {} : { style: `line-height: ${t.lineHeight}` }
          }
        }
      }
    ];
  },
  addCommands() {
    return {
      setLineHeight: (t) => ({ commands: e }) => this.options.types.every(
        (n) => e.updateAttributes(n, { lineHeight: t })
      ),
      unsetLineHeight: () => ({ commands: t }) => this.options.types.every(
        (e) => t.resetAttributes(e, "lineHeight")
      )
    };
  }
}), vO = Se.create({
  name: "textAlign",
  addOptions() {
    return {
      types: [],
      alignments: ["left", "center", "right", "justify"],
      defaultAlignment: null
    };
  },
  addGlobalAttributes() {
    return [
      {
        types: this.options.types,
        attributes: {
          textAlign: {
            default: this.options.defaultAlignment,
            parseHTML: (t) => {
              const e = t.style.textAlign;
              return this.options.alignments.includes(e) ? e : this.options.defaultAlignment;
            },
            renderHTML: (t) => t.textAlign ? { style: `text-align: ${t.textAlign}` } : {}
          }
        }
      }
    ];
  },
  addCommands() {
    return {
      setTextAlign: (t) => ({ commands: e }) => this.options.alignments.includes(t) ? this.options.types.map((n) => e.updateAttributes(n, { textAlign: t })).every((n) => n) : !1,
      unsetTextAlign: () => ({ commands: t }) => this.options.types.map((e) => t.resetAttributes(e, "textAlign")).every((e) => e)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-l": () => this.editor.commands.setTextAlign("left"),
      "Mod-Shift-e": () => this.editor.commands.setTextAlign("center"),
      "Mod-Shift-r": () => this.editor.commands.setTextAlign("right"),
      "Mod-Shift-j": () => this.editor.commands.setTextAlign("justify")
    };
  }
}), RO = Se.create({
  name: "indent",
  // Fix tab key conflict with ordered lists
  priority: 99,
  addOptions() {
    return {
      types: ["listItem", "paragraph"],
      minLevel: 0,
      maxLevel: 8
    };
  },
  addGlobalAttributes() {
    return [
      {
        types: this.options.types,
        attributes: {
          indent: {
            default: 0,
            parseHTML: (t) => {
              const e = Number(t.getAttribute("data-indent"));
              return e && e > this.options.minLevel ? e : null;
            },
            renderHTML: (t) => t.indent ? {
              style: `text-indent: ${(t == null ? void 0 : t.indent) * 2}em`,
              "data-indent": t == null ? void 0 : t.indent
            } : {}
          }
        }
      }
    ];
  },
  addCommands() {
    const t = (r, i, o) => {
      var s;
      const a = (s = r == null ? void 0 : r.doc) == null ? void 0 : s.nodeAt(i);
      if (a) {
        const l = (a.attrs.indent || 0) + o, { minLevel: c, maxLevel: u } = this.options, d = l < c ? c : l > u ? u : l;
        if (d !== a.attrs.indent) {
          const { indent: p, ..._ } = a.attrs, m = d > c ? { ..._, indent: d } : _;
          return r.setNodeMarkup(i, a.type, m, a.marks);
        }
      }
      return r;
    }, e = (r, i) => {
      const { doc: o, selection: a } = r;
      if (o && a && (a instanceof K || a instanceof Ot)) {
        const { from: s, to: l } = a;
        o.nodesBetween(s, l, (c, u) => this.options.types.includes(c.type.name) ? (r = t(r, u, i), !1) : !0);
      }
      return r;
    }, n = (r) => () => ({ tr: i, state: o, dispatch: a }) => {
      const { selection: s } = o;
      return i = i.setSelection(s), i = e(i, r), i.docChanged ? (a == null || a(i), !0) : !1;
    };
    return {
      indent: n(1),
      outdent: n(-1)
    };
  },
  addKeyboardShortcuts() {
    return {
      Tab: () => this.editor.commands.indent(),
      "Shift-Tab": () => this.editor.commands.outdent()
    };
  }
}), OO = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/, NO = xe.create({
  name: "image",
  addOptions() {
    return {
      inline: !1,
      allowBase64: !1,
      HTMLAttributes: {}
    };
  },
  inline() {
    return this.options.inline;
  },
  group() {
    return this.options.inline ? "inline" : "block";
  },
  draggable: !0,
  addAttributes() {
    return {
      src: {
        default: null
      },
      alt: {
        default: null
      },
      title: {
        default: null
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: this.options.allowBase64 ? "img[src]" : 'img[src]:not([src^="data:"])'
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["img", me(this.options.HTMLAttributes, t)];
  },
  addCommands() {
    return {
      setImage: (t) => ({ commands: e }) => e.insertContent({
        type: this.name,
        attrs: t
      })
    };
  },
  addInputRules() {
    return [
      cu({
        find: OO,
        type: this.type,
        getAttributes: (t) => {
          const [, , e, n, r] = t;
          return { src: n, alt: e, title: r };
        }
      })
    ];
  }
}), Ug = (t, e, n) => {
  const r = t.querySelector(".resize-obj"), i = 10;
  let o, a, s, l;
  const c = (p) => {
    p.preventDefault(), e.addEventListener("mousemove", u), e.addEventListener("mouseup", d), e.addEventListener("mouseleave", d), o = p.clientX, a = Number(r.getAttribute("data-with")) || r.clientWidth, s = p.target.getAttribute("data-position"), l = e.clientWidth - 100;
  }, u = (p) => {
    const _ = p.clientX - o;
    if (_ == 0) return;
    const m = s === "right" ? _ > 0 : _ < 0;
    let f = a + Math.abs(_) * (m ? 1 : -1);
    f >= l && (f = l), f < i && (f = i), r.style.width = `${f}px`, r.setAttribute("data-width", f.toString()), r.parentElement.removeAttribute("style");
  }, d = () => {
    e.removeEventListener("mousemove", u), e.removeEventListener("mouseup", d), e.removeEventListener("mouseleave", d);
    const p = { width: Number(r.getAttribute("data-width")) };
    n(p);
  };
  for (let p of t.querySelector(".linwiteditor-resize").children)
    p.addEventListener("mousedown", c);
}, AO = (t) => typeof t == "number" || !isNaN(+t) ? `${t}px` : t, i_ = new Oe("linwiteditor-image-plugin"), Ti = "image_action", IO = NO.extend(
  {
    name: "image",
    draggable: !0,
    selectable: !0,
    addOptions() {
      var t;
      return {
        ...(t = this.parent) == null ? void 0 : t.call(this),
        uploadUrl: "",
        uploadHeaders: {},
        uploader: void 0,
        defaultSize: 350
      };
    },
    allowGapCursor() {
      return !this.options.inline;
    },
    addAttributes() {
      return {
        src: {
          default: "",
          parseHTML: (t) => `${t.getAttribute("src") ?? ""}`
        },
        alt: {
          default: "",
          parseHTML: (t) => `${t.getAttribute("alt") ?? ""}`,
          renderHTML: ({ alt: t }) => t ? { alt: t } : {}
        },
        title: {
          default: "",
          parseHTML: (t) => `${t.getAttribute("title") ?? ""}`,
          renderHTML: ({ title: t }) => t ? { title: t } : {}
        },
        width: {
          default: this.options.defaultSize,
          parseHTML: (t) => `${t.getAttribute("width") ?? ""}`,
          renderHTML: ({ width: t }) => t ? { width: t } : {}
        },
        height: {
          default: "auto",
          parseHTML: (t) => `${t.getAttribute("height") ?? ""}`,
          renderHTML: ({ height: t }) => t ? { height: t } : {}
        },
        align: {
          default: "left",
          parseHTML: (t) => t.getAttribute("data-align") || t.getAttribute("align"),
          renderHTML: ({ align: t }) => t ? { "data-align": t } : {}
        },
        href: {
          default: null,
          parseHTML: (t) => {
            var e;
            if (((e = t.parentElement) == null ? void 0 : e.tagName) === "A")
              return t.parentElement.getAttribute("href");
          }
        },
        target: {
          default: null,
          parseHTML: (t) => {
            var e;
            if (((e = t.parentElement) == null ? void 0 : e.tagName) === "A")
              return t.parentElement.getAttribute("target");
          }
        },
        "data-src": {
          default: null,
          parseHTML: (t) => `${t.getAttribute("data-src") ?? ""}`,
          renderHTML: (t) => t["data-src"] ? { "data-src": t["data-src"] } : {}
        },
        loading: {
          default: null,
          parseHTML: (t) => `${t.getAttribute("loading") ?? ""}`,
          renderHTML: ({ loading: t }) => t ? { loading: t } : {}
        }
      };
    },
    parseHTML() {
      return [
        {
          tag: this.options.allowBase64 ? "img[src]" : 'img[src]:not([src^="data:"])'
        }
      ];
    },
    renderHTML({ HTMLAttributes: t }) {
      const e = me(this.options.HTMLAttributes, t);
      return e.href ? [
        "div",
        { style: `text-align:${e["data-align"] || "left"}` },
        [
          "a",
          { href: e.href, target: e.target },
          ["img", { ...e, href: null, target: null }]
        ]
      ] : (e.target = null, [
        "div",
        { style: `text-align:${e["data-align"] || "left"}` },
        ["img", e]
      ]);
    },
    addCommands() {
      var t;
      return {
        ...(t = this.parent) == null ? void 0 : t.call(this),
        uploadImage: (e) => () => {
          const n = typeof this.options.uploadHeaders == "object" ? this.options.uploadHeaders : typeof this.options.uploadHeaders == "function" ? this.options.uploadHeaders() : {};
          if (this.options.uploaderEvent && this.options.uploaderEvent.onUploadBefore && this.options.uploaderEvent.onUploadBefore(e, this.options.uploadUrl, n) === !1)
            return !1;
          setTimeout(() => {
            this.editor.commands.deleteSelection();
          });
          const r = Ms(), { state: { tr: i }, view: o, schema: a } = this.editor;
          o.dispatch(i.setMeta(Ti, {
            type: "add",
            id: r,
            pos: i.selection.from
          }));
          const s = this.options.uploader || bu(this.options.uploadUrl), l = this.options.uploadFormName || "image";
          return s(e, this.options.uploadUrl, n, l).then((c) => {
            var u;
            if ((u = this.options.uploaderEvent) != null && u.onSuccess) {
              const d = this.options.uploaderEvent.onSuccess(e, c);
              if (typeof d == "boolean" && !d)
                return;
              typeof d == "object" && (c = d);
            }
            if (c.errorCode === 0 && c.data && c.data.src) {
              let p = i_.getState(this.editor.state).find(void 0, void 0, (_) => _.id == r);
              o.dispatch(o.state.tr.insert(p[0].from, a.nodes.image.create({
                src: c.data.src,
                alt: c.data.alt,
                align: c.data.align || "left",
                width: c.data.width || this.options.defaultSize,
                height: c.data.height || "auto",
                "data-src": c.data["data-src"],
                loading: c.data.loading,
                class: c.data.class
              })).setMeta(Ti, { type: "remove", id: r }));
            } else
              o.dispatch(i.setMeta(Ti, { type: "remove", id: r })), this.options.uploaderEvent && this.options.uploaderEvent.onFailed && this.options.uploaderEvent.onFailed(e, c);
          }).catch((c) => {
            const { state: { tr: u }, view: d } = this.editor;
            d.dispatch(u.setMeta(Ti, { type: "remove", id: r })), this.options.uploaderEvent && this.options.uploaderEvent.onError && this.options.uploaderEvent.onError(e, c);
          }), !0;
        }
      };
    },
    addNodeView() {
      return (t) => {
        const e = document.createElement("div"), { src: n, width: r, height: i, align: o, alt: a } = t.node.attrs, s = AO(r || this.options.defaultSize), l = s.indexOf("%") > 0 ? `style="width: ${s};"` : "", c = s.indexOf("%") > 0 ? "calc(100% - 2px)" : s;
        return e.classList.add(`align-${o}`), this.editor.isEditable ? (e.innerHTML = `
                <div class="linwiteditor-resize-wrapper" ${l}>
                    <div class="linwiteditor-resize">
                        <div class="linwiteditor-resize-btn-top-left" data-position="left" draggable="true"></div>
                        <div class="linwiteditor-resize-btn-top-right" data-position="right" draggable="true"></div>
                        <div class="linwiteditor-resize-btn-bottom-left" data-position="left" draggable="true"></div>
                        <div class="linwiteditor-resize-btn-bottom-right" data-position="right" draggable="true"></div>
                    </div>
                    <img alt="${a}" src="${t.node.attrs["data-src"] || n}" style="width: ${c}; height: ${i || "auto"}" class="align-${o} resize-obj">
                </div>
                `, Ug(e, this.editor.view.dom, (u) => this.editor.commands.updateAttributes("image", u)), {
          dom: e
        }) : (e.innerHTML = `<div class="linwiteditor-resize-wrapper" ${l}>
<img alt="${a}" src="${t.node.attrs["data-src"] || n}" style="width: ${c}; height: ${i || "auto"}" class="align-${o} resize-obj">
</div>`, {
          dom: e
        });
      };
    },
    addProseMirrorPlugins() {
      const t = this.editor;
      return [
        new Te({
          key: i_,
          state: {
            init: () => ye.empty,
            apply: (e, n) => {
              const r = e.getMeta(Ti);
              if (r) {
                let i = !1;
                const o = n.map(e.mapping, e.doc, {
                  onRemove: (a) => {
                    i = !0;
                  }
                });
                i || (n = o), r.type === "add" ? n = n.add(e.doc, [Bg(r)]) : r.type === "remove" && (n = n.remove(n.find(
                  void 0,
                  void 0,
                  (a) => a.id == r.id
                )));
              }
              return n;
            }
          },
          props: {
            decorations(e) {
              return this.getState(e);
            },
            handlePaste: (e, n) => {
              var o;
              const r = Array.from(((o = n.clipboardData) == null ? void 0 : o.items) || []);
              let i = !1;
              for (const a of r)
                if (a.type.indexOf("image") === 0) {
                  const s = a.getAsFile();
                  s && (n.preventDefault(), i = !0, this.editor.commands.uploadImage(s));
                }
              return i;
            },
            handleDOMEvents: {
              drop(e, n) {
                if (!(n.dataTransfer && n.dataTransfer.files && n.dataTransfer.files.length)) return !1;
                const i = Array.from(n.dataTransfer.files).filter((c) => /image/i.test(c.type));
                if (i.length === 0) return !1;
                n.preventDefault();
                const { state: { tr: o, doc: a }, dispatch: s } = e, l = e.posAtCoords({ left: n.clientX, top: n.clientY });
                return s(o.setSelection(K.create(a, l.pos)).scrollIntoView()), i.forEach((c) => {
                  t.commands.uploadImage(c);
                }), !0;
              }
            },
            transformPastedHTML(e) {
              const i = new DOMParser().parseFromString(e, "text/html").querySelector("body");
              if (i != null && i.children) {
                const o = i.querySelectorAll("p > img");
                for (const a of o) {
                  const s = a.parentNode, l = Array.prototype.indexOf.call(i.children, s);
                  i.insertBefore(a, i.children[l]);
                }
                return i.innerHTML;
              }
              return e;
            }
          }
        })
      ];
    }
  }
);
var bc, Tc;
if (typeof WeakMap < "u") {
  let t = /* @__PURE__ */ new WeakMap();
  bc = (e) => t.get(e), Tc = (e, n) => (t.set(e, n), n);
} else {
  const t = [];
  let n = 0;
  bc = (r) => {
    for (let i = 0; i < t.length; i += 2)
      if (t[i] == r) return t[i + 1];
  }, Tc = (r, i) => (n == 10 && (n = 0), t[n++] = r, t[n++] = i);
}
var we = class {
  constructor(t, e, n, r) {
    this.width = t, this.height = e, this.map = n, this.problems = r;
  }
  // Find the dimensions of the cell at the given position.
  findCell(t) {
    for (let e = 0; e < this.map.length; e++) {
      const n = this.map[e];
      if (n != t) continue;
      const r = e % this.width, i = e / this.width | 0;
      let o = r + 1, a = i + 1;
      for (let s = 1; o < this.width && this.map[e + s] == n; s++)
        o++;
      for (let s = 1; a < this.height && this.map[e + this.width * s] == n; s++)
        a++;
      return { left: r, top: i, right: o, bottom: a };
    }
    throw new RangeError(`No cell with offset ${t} found`);
  }
  // Find the left side of the cell at the given position.
  colCount(t) {
    for (let e = 0; e < this.map.length; e++)
      if (this.map[e] == t)
        return e % this.width;
    throw new RangeError(`No cell with offset ${t} found`);
  }
  // Find the next cell in the given direction, starting from the cell
  // at `pos`, if any.
  nextCell(t, e, n) {
    const { left: r, right: i, top: o, bottom: a } = this.findCell(t);
    return e == "horiz" ? (n < 0 ? r == 0 : i == this.width) ? null : this.map[o * this.width + (n < 0 ? r - 1 : i)] : (n < 0 ? o == 0 : a == this.height) ? null : this.map[r + this.width * (n < 0 ? o - 1 : a)];
  }
  // Get the rectangle spanning the two given cells.
  rectBetween(t, e) {
    const {
      left: n,
      right: r,
      top: i,
      bottom: o
    } = this.findCell(t), {
      left: a,
      right: s,
      top: l,
      bottom: c
    } = this.findCell(e);
    return {
      left: Math.min(n, a),
      top: Math.min(i, l),
      right: Math.max(r, s),
      bottom: Math.max(o, c)
    };
  }
  // Return the position of all cells that have the top left corner in
  // the given rectangle.
  cellsInRect(t) {
    const e = [], n = {};
    for (let r = t.top; r < t.bottom; r++)
      for (let i = t.left; i < t.right; i++) {
        const o = r * this.width + i, a = this.map[o];
        n[a] || (n[a] = !0, !(i == t.left && i && this.map[o - 1] == a || r == t.top && r && this.map[o - this.width] == a) && e.push(a));
      }
    return e;
  }
  // Return the position at which the cell at the given row and column
  // starts, or would start, if a cell started there.
  positionAt(t, e, n) {
    for (let r = 0, i = 0; ; r++) {
      const o = i + n.child(r).nodeSize;
      if (r == t) {
        let a = e + t * this.width;
        const s = (t + 1) * this.width;
        for (; a < s && this.map[a] < i; ) a++;
        return a == s ? o - 1 : this.map[a];
      }
      i = o;
    }
  }
  // Find the table map for the given table node.
  static get(t) {
    return bc(t) || Tc(t, xO(t));
  }
};
function xO(t) {
  if (t.type.spec.tableRole != "table")
    throw new RangeError("Not a table node: " + t.type.name);
  const e = DO(t), n = t.childCount, r = [];
  let i = 0, o = null;
  const a = [];
  for (let c = 0, u = e * n; c < u; c++) r[c] = 0;
  for (let c = 0, u = 0; c < n; c++) {
    const d = t.child(c);
    u++;
    for (let m = 0; ; m++) {
      for (; i < r.length && r[i] != 0; ) i++;
      if (m == d.childCount) break;
      const f = d.child(m), { colspan: g, rowspan: S, colwidth: E } = f.attrs;
      for (let b = 0; b < S; b++) {
        if (b + c >= n) {
          (o || (o = [])).push({
            type: "overlong_rowspan",
            pos: u,
            n: S - b
          });
          break;
        }
        const h = i + b * e;
        for (let T = 0; T < g; T++) {
          r[h + T] == 0 ? r[h + T] = u : (o || (o = [])).push({
            type: "collision",
            row: c,
            pos: u,
            n: g - T
          });
          const C = E && E[T];
          if (C) {
            const v = (h + T) % e * 2, I = a[v];
            I == null || I != C && a[v + 1] == 1 ? (a[v] = C, a[v + 1] = 1) : I == C && a[v + 1]++;
          }
        }
      }
      i += g, u += f.nodeSize;
    }
    const p = (c + 1) * e;
    let _ = 0;
    for (; i < p; ) r[i++] == 0 && _++;
    _ && (o || (o = [])).push({ type: "missing", row: c, n: _ }), u++;
  }
  (e === 0 || n === 0) && (o || (o = [])).push({ type: "zero_sized" });
  const s = new we(e, n, r, o);
  let l = !1;
  for (let c = 0; !l && c < a.length; c += 2)
    a[c] != null && a[c + 1] < n && (l = !0);
  return l && wO(s, a, t), s;
}
function DO(t) {
  let e = -1, n = !1;
  for (let r = 0; r < t.childCount; r++) {
    const i = t.child(r);
    let o = 0;
    if (n)
      for (let a = 0; a < r; a++) {
        const s = t.child(a);
        for (let l = 0; l < s.childCount; l++) {
          const c = s.child(l);
          a + c.attrs.rowspan > r && (o += c.attrs.colspan);
        }
      }
    for (let a = 0; a < i.childCount; a++) {
      const s = i.child(a);
      o += s.attrs.colspan, s.attrs.rowspan > 1 && (n = !0);
    }
    e == -1 ? e = o : e != o && (e = Math.max(e, o));
  }
  return e;
}
function wO(t, e, n) {
  t.problems || (t.problems = []);
  const r = {};
  for (let i = 0; i < t.map.length; i++) {
    const o = t.map[i];
    if (r[o]) continue;
    r[o] = !0;
    const a = n.nodeAt(o);
    if (!a)
      throw new RangeError(`No cell with offset ${o} found`);
    let s = null;
    const l = a.attrs;
    for (let c = 0; c < l.colspan; c++) {
      const u = (i + c) % t.width, d = e[u * 2];
      d != null && (!l.colwidth || l.colwidth[c] != d) && ((s || (s = MO(l)))[c] = d);
    }
    s && t.problems.unshift({
      type: "colwidth mismatch",
      pos: o,
      colwidth: s
    });
  }
}
function MO(t) {
  if (t.colwidth) return t.colwidth.slice();
  const e = [];
  for (let n = 0; n < t.colspan; n++) e.push(0);
  return e;
}
function it(t) {
  let e = t.cached.tableNodeTypes;
  if (!e) {
    e = t.cached.tableNodeTypes = {};
    for (const n in t.nodes) {
      const r = t.nodes[n], i = r.spec.tableRole;
      i && (e[i] = r);
    }
  }
  return e;
}
var In = new Oe("selectingCells");
function _i(t) {
  for (let e = t.depth - 1; e > 0; e--)
    if (t.node(e).type.spec.tableRole == "row")
      return t.node(0).resolve(t.before(e + 1));
  return null;
}
function LO(t) {
  for (let e = t.depth; e > 0; e--) {
    const n = t.node(e).type.spec.tableRole;
    if (n === "cell" || n === "header_cell") return t.node(e);
  }
  return null;
}
function Yt(t) {
  const e = t.selection.$head;
  for (let n = e.depth; n > 0; n--)
    if (e.node(n).type.spec.tableRole == "row") return !0;
  return !1;
}
function Ls(t) {
  const e = t.selection;
  if ("$anchorCell" in e && e.$anchorCell)
    return e.$anchorCell.pos > e.$headCell.pos ? e.$anchorCell : e.$headCell;
  if ("node" in e && e.node && e.node.type.spec.tableRole == "cell")
    return e.$anchor;
  const n = _i(e.$head) || kO(e.$head);
  if (n)
    return n;
  throw new RangeError(`No cell found around position ${e.head}`);
}
function kO(t) {
  for (let e = t.nodeAfter, n = t.pos; e; e = e.firstChild, n++) {
    const r = e.type.spec.tableRole;
    if (r == "cell" || r == "header_cell") return t.doc.resolve(n);
  }
  for (let e = t.nodeBefore, n = t.pos; e; e = e.lastChild, n--) {
    const r = e.type.spec.tableRole;
    if (r == "cell" || r == "header_cell")
      return t.doc.resolve(n - e.nodeSize);
  }
}
function Cc(t) {
  return t.parent.type.spec.tableRole == "row" && !!t.nodeAfter;
}
function PO(t) {
  return t.node(0).resolve(t.pos + t.nodeAfter.nodeSize);
}
function Tu(t, e) {
  return t.depth == e.depth && t.pos >= e.start(-1) && t.pos <= e.end(-1);
}
function Hg(t, e, n) {
  const r = t.node(-1), i = we.get(r), o = t.start(-1), a = i.nextCell(t.pos - o, e, n);
  return a == null ? null : t.node(0).resolve(o + a);
}
function Tr(t, e, n = 1) {
  const r = { ...t, colspan: t.colspan - n };
  return r.colwidth && (r.colwidth = r.colwidth.slice(), r.colwidth.splice(e, n), r.colwidth.some((i) => i > 0) || (r.colwidth = null)), r;
}
function Gg(t, e, n = 1) {
  const r = { ...t, colspan: t.colspan + n };
  if (r.colwidth) {
    r.colwidth = r.colwidth.slice();
    for (let i = 0; i < n; i++) r.colwidth.splice(e, 0, 0);
  }
  return r;
}
function FO(t, e, n) {
  const r = it(e.type.schema).header_cell;
  for (let i = 0; i < t.height; i++)
    if (e.nodeAt(t.map[n + i * t.width]).type != r)
      return !1;
  return !0;
}
var ve = class dn extends ne {
  // A table selection is identified by its anchor and head cells. The
  // positions given to this constructor should point _before_ two
  // cells in the same table. They may be the same, to select a single
  // cell.
  constructor(e, n = e) {
    const r = e.node(-1), i = we.get(r), o = e.start(-1), a = i.rectBetween(
      e.pos - o,
      n.pos - o
    ), s = e.node(0), l = i.cellsInRect(a).filter((u) => u != n.pos - o);
    l.unshift(n.pos - o);
    const c = l.map((u) => {
      const d = r.nodeAt(u);
      if (!d)
        throw RangeError(`No cell with offset ${u} found`);
      const p = o + u + 1;
      return new ef(
        s.resolve(p),
        s.resolve(p + d.content.size)
      );
    });
    super(c[0].$from, c[0].$to, c), this.$anchorCell = e, this.$headCell = n;
  }
  map(e, n) {
    const r = e.resolve(n.map(this.$anchorCell.pos)), i = e.resolve(n.map(this.$headCell.pos));
    if (Cc(r) && Cc(i) && Tu(r, i)) {
      const o = this.$anchorCell.node(-1) != r.node(-1);
      return o && this.isRowSelection() ? dn.rowSelection(r, i) : o && this.isColSelection() ? dn.colSelection(r, i) : new dn(r, i);
    }
    return K.between(r, i);
  }
  // Returns a rectangular slice of table rows containing the selected
  // cells.
  content() {
    const e = this.$anchorCell.node(-1), n = we.get(e), r = this.$anchorCell.start(-1), i = n.rectBetween(
      this.$anchorCell.pos - r,
      this.$headCell.pos - r
    ), o = {}, a = [];
    for (let l = i.top; l < i.bottom; l++) {
      const c = [];
      for (let u = l * n.width + i.left, d = i.left; d < i.right; d++, u++) {
        const p = n.map[u];
        if (o[p]) continue;
        o[p] = !0;
        const _ = n.findCell(p);
        let m = e.nodeAt(p);
        if (!m)
          throw RangeError(`No cell with offset ${p} found`);
        const f = i.left - _.left, g = _.right - i.right;
        if (f > 0 || g > 0) {
          let S = m.attrs;
          if (f > 0 && (S = Tr(S, 0, f)), g > 0 && (S = Tr(
            S,
            S.colspan - g,
            g
          )), _.left < i.left) {
            if (m = m.type.createAndFill(S), !m)
              throw RangeError(
                `Could not create cell with attrs ${JSON.stringify(S)}`
              );
          } else
            m = m.type.create(S, m.content);
        }
        if (_.top < i.top || _.bottom > i.bottom) {
          const S = {
            ...m.attrs,
            rowspan: Math.min(_.bottom, i.bottom) - Math.max(_.top, i.top)
          };
          _.top < i.top ? m = m.type.createAndFill(S) : m = m.type.create(S, m.content);
        }
        c.push(m);
      }
      a.push(e.child(l).copy(L.from(c)));
    }
    const s = this.isColSelection() && this.isRowSelection() ? e : a;
    return new H(L.from(s), 1, 1);
  }
  replace(e, n = H.empty) {
    const r = e.steps.length, i = this.ranges;
    for (let a = 0; a < i.length; a++) {
      const { $from: s, $to: l } = i[a], c = e.mapping.slice(r);
      e.replace(
        c.map(s.pos),
        c.map(l.pos),
        a ? H.empty : n
      );
    }
    const o = ne.findFrom(
      e.doc.resolve(e.mapping.slice(r).map(this.to)),
      -1
    );
    o && e.setSelection(o);
  }
  replaceWith(e, n) {
    this.replace(e, new H(L.from(n), 0, 0));
  }
  forEachCell(e) {
    const n = this.$anchorCell.node(-1), r = we.get(n), i = this.$anchorCell.start(-1), o = r.cellsInRect(
      r.rectBetween(
        this.$anchorCell.pos - i,
        this.$headCell.pos - i
      )
    );
    for (let a = 0; a < o.length; a++)
      e(n.nodeAt(o[a]), i + o[a]);
  }
  // True if this selection goes all the way from the top to the
  // bottom of the table.
  isColSelection() {
    const e = this.$anchorCell.index(-1), n = this.$headCell.index(-1);
    if (Math.min(e, n) > 0) return !1;
    const r = e + this.$anchorCell.nodeAfter.attrs.rowspan, i = n + this.$headCell.nodeAfter.attrs.rowspan;
    return Math.max(r, i) == this.$headCell.node(-1).childCount;
  }
  // Returns the smallest column selection that covers the given anchor
  // and head cell.
  static colSelection(e, n = e) {
    const r = e.node(-1), i = we.get(r), o = e.start(-1), a = i.findCell(e.pos - o), s = i.findCell(n.pos - o), l = e.node(0);
    return a.top <= s.top ? (a.top > 0 && (e = l.resolve(o + i.map[a.left])), s.bottom < i.height && (n = l.resolve(
      o + i.map[i.width * (i.height - 1) + s.right - 1]
    ))) : (s.top > 0 && (n = l.resolve(o + i.map[s.left])), a.bottom < i.height && (e = l.resolve(
      o + i.map[i.width * (i.height - 1) + a.right - 1]
    ))), new dn(e, n);
  }
  // True if this selection goes all the way from the left to the
  // right of the table.
  isRowSelection() {
    const e = this.$anchorCell.node(-1), n = we.get(e), r = this.$anchorCell.start(-1), i = n.colCount(this.$anchorCell.pos - r), o = n.colCount(this.$headCell.pos - r);
    if (Math.min(i, o) > 0) return !1;
    const a = i + this.$anchorCell.nodeAfter.attrs.colspan, s = o + this.$headCell.nodeAfter.attrs.colspan;
    return Math.max(a, s) == n.width;
  }
  eq(e) {
    return e instanceof dn && e.$anchorCell.pos == this.$anchorCell.pos && e.$headCell.pos == this.$headCell.pos;
  }
  // Returns the smallest row selection that covers the given anchor
  // and head cell.
  static rowSelection(e, n = e) {
    const r = e.node(-1), i = we.get(r), o = e.start(-1), a = i.findCell(e.pos - o), s = i.findCell(n.pos - o), l = e.node(0);
    return a.left <= s.left ? (a.left > 0 && (e = l.resolve(
      o + i.map[a.top * i.width]
    )), s.right < i.width && (n = l.resolve(
      o + i.map[i.width * (s.top + 1) - 1]
    ))) : (s.left > 0 && (n = l.resolve(o + i.map[s.top * i.width])), a.right < i.width && (e = l.resolve(
      o + i.map[i.width * (a.top + 1) - 1]
    ))), new dn(e, n);
  }
  toJSON() {
    return {
      type: "cell",
      anchor: this.$anchorCell.pos,
      head: this.$headCell.pos
    };
  }
  static fromJSON(e, n) {
    return new dn(e.resolve(n.anchor), e.resolve(n.head));
  }
  static create(e, n, r = n) {
    return new dn(e.resolve(n), e.resolve(r));
  }
  getBookmark() {
    return new BO(this.$anchorCell.pos, this.$headCell.pos);
  }
};
ve.prototype.visible = !1;
ne.jsonID("cell", ve);
var BO = class Vg {
  constructor(e, n) {
    this.anchor = e, this.head = n;
  }
  map(e) {
    return new Vg(e.map(this.anchor), e.map(this.head));
  }
  resolve(e) {
    const n = e.resolve(this.anchor), r = e.resolve(this.head);
    return n.parent.type.spec.tableRole == "row" && r.parent.type.spec.tableRole == "row" && n.index() < n.parent.childCount && r.index() < r.parent.childCount && Tu(n, r) ? new ve(n, r) : ne.near(r, 1);
  }
};
function UO(t) {
  if (!(t.selection instanceof ve)) return null;
  const e = [];
  return t.selection.forEachCell((n, r) => {
    e.push(
      Be.node(r, r + n.nodeSize, { class: "selectedCell" })
    );
  }), ye.create(t.doc, e);
}
function HO({ $from: t, $to: e }) {
  if (t.pos == e.pos || t.pos < e.pos - 6) return !1;
  let n = t.pos, r = e.pos, i = t.depth;
  for (; i >= 0 && !(t.after(i + 1) < t.end(i)); i--, n++)
    ;
  for (let o = e.depth; o >= 0 && !(e.before(o + 1) > e.start(o)); o--, r--)
    ;
  return n == r && /row|table/.test(t.node(i).type.spec.tableRole);
}
function GO({ $from: t, $to: e }) {
  let n, r;
  for (let i = t.depth; i > 0; i--) {
    const o = t.node(i);
    if (o.type.spec.tableRole === "cell" || o.type.spec.tableRole === "header_cell") {
      n = o;
      break;
    }
  }
  for (let i = e.depth; i > 0; i--) {
    const o = e.node(i);
    if (o.type.spec.tableRole === "cell" || o.type.spec.tableRole === "header_cell") {
      r = o;
      break;
    }
  }
  return n !== r && e.parentOffset === 0;
}
function VO(t, e, n) {
  const r = (e || t).selection, i = (e || t).doc;
  let o, a;
  if (r instanceof ee && (a = r.node.type.spec.tableRole)) {
    if (a == "cell" || a == "header_cell")
      o = ve.create(i, r.from);
    else if (a == "row") {
      const s = i.resolve(r.from + 1);
      o = ve.rowSelection(s, s);
    } else if (!n) {
      const s = we.get(r.node), l = r.from + 1, c = l + s.map[s.width * s.height - 1];
      o = ve.create(i, l + 1, c);
    }
  } else r instanceof K && HO(r) ? o = K.create(i, r.from) : r instanceof K && GO(r) && (o = K.create(i, r.$from.start(), r.$from.end()));
  return o && (e || (e = t.tr)).setSelection(o), e;
}
var YO = new Oe("fix-tables");
function Yg(t, e, n, r) {
  const i = t.childCount, o = e.childCount;
  e: for (let a = 0, s = 0; a < o; a++) {
    const l = e.child(a);
    for (let c = s, u = Math.min(i, a + 3); c < u; c++)
      if (t.child(c) == l) {
        s = c + 1, n += l.nodeSize;
        continue e;
      }
    r(l, n), s < i && t.child(s).sameMarkup(l) ? Yg(t.child(s), l, n + 1, r) : l.nodesBetween(0, l.content.size, r, n + 1), n += l.nodeSize;
  }
}
function $g(t, e) {
  let n;
  const r = (i, o) => {
    i.type.spec.tableRole == "table" && (n = $O(t, i, o, n));
  };
  return e ? e.doc != t.doc && Yg(e.doc, t.doc, 0, r) : t.doc.descendants(r), n;
}
function $O(t, e, n, r) {
  const i = we.get(e);
  if (!i.problems) return r;
  r || (r = t.tr);
  const o = [];
  for (let l = 0; l < i.height; l++) o.push(0);
  for (let l = 0; l < i.problems.length; l++) {
    const c = i.problems[l];
    if (c.type == "collision") {
      const u = e.nodeAt(c.pos);
      if (!u) continue;
      const d = u.attrs;
      for (let p = 0; p < d.rowspan; p++) o[c.row + p] += c.n;
      r.setNodeMarkup(
        r.mapping.map(n + 1 + c.pos),
        null,
        Tr(d, d.colspan - c.n, c.n)
      );
    } else if (c.type == "missing")
      o[c.row] += c.n;
    else if (c.type == "overlong_rowspan") {
      const u = e.nodeAt(c.pos);
      if (!u) continue;
      r.setNodeMarkup(r.mapping.map(n + 1 + c.pos), null, {
        ...u.attrs,
        rowspan: u.attrs.rowspan - c.n
      });
    } else if (c.type == "colwidth mismatch") {
      const u = e.nodeAt(c.pos);
      if (!u) continue;
      r.setNodeMarkup(r.mapping.map(n + 1 + c.pos), null, {
        ...u.attrs,
        colwidth: c.colwidth
      });
    } else if (c.type == "zero_sized") {
      const u = r.mapping.map(n);
      r.delete(u, u + e.nodeSize);
    }
  }
  let a, s;
  for (let l = 0; l < o.length; l++)
    o[l] && (a == null && (a = l), s = l);
  for (let l = 0, c = n + 1; l < i.height; l++) {
    const u = e.child(l), d = c + u.nodeSize, p = o[l];
    if (p > 0) {
      let _ = "cell";
      u.firstChild && (_ = u.firstChild.type.spec.tableRole);
      const m = [];
      for (let g = 0; g < p; g++) {
        const S = it(t.schema)[_].createAndFill();
        S && m.push(S);
      }
      const f = (l == 0 || a == l - 1) && s == l ? c + 1 : d - 1;
      r.insert(r.mapping.map(f), m);
    }
    c = d;
  }
  return r.setMeta(YO, { fixTables: !0 });
}
function on(t) {
  const e = t.selection, n = Ls(t), r = n.node(-1), i = n.start(-1), o = we.get(r);
  return { ...e instanceof ve ? o.rectBetween(
    e.$anchorCell.pos - i,
    e.$headCell.pos - i
  ) : o.findCell(n.pos - i), tableStart: i, map: o, table: r };
}
function zg(t, { map: e, tableStart: n, table: r }, i) {
  let o = i > 0 ? -1 : 0;
  FO(e, r, i + o) && (o = i == 0 || i == e.width ? null : 0);
  for (let a = 0; a < e.height; a++) {
    const s = a * e.width + i;
    if (i > 0 && i < e.width && e.map[s - 1] == e.map[s]) {
      const l = e.map[s], c = r.nodeAt(l);
      t.setNodeMarkup(
        t.mapping.map(n + l),
        null,
        Gg(c.attrs, i - e.colCount(l))
      ), a += c.attrs.rowspan - 1;
    } else {
      const l = o == null ? it(r.type.schema).cell : r.nodeAt(e.map[s + o]).type, c = e.positionAt(a, i, r);
      t.insert(t.mapping.map(n + c), l.createAndFill());
    }
  }
  return t;
}
function zO(t, e) {
  if (!Yt(t)) return !1;
  if (e) {
    const n = on(t);
    e(zg(t.tr, n, n.left));
  }
  return !0;
}
function qO(t, e) {
  if (!Yt(t)) return !1;
  if (e) {
    const n = on(t);
    e(zg(t.tr, n, n.right));
  }
  return !0;
}
function WO(t, { map: e, table: n, tableStart: r }, i) {
  const o = t.mapping.maps.length;
  for (let a = 0; a < e.height; ) {
    const s = a * e.width + i, l = e.map[s], c = n.nodeAt(l), u = c.attrs;
    if (i > 0 && e.map[s - 1] == l || i < e.width - 1 && e.map[s + 1] == l)
      t.setNodeMarkup(
        t.mapping.slice(o).map(r + l),
        null,
        Tr(u, i - e.colCount(l))
      );
    else {
      const d = t.mapping.slice(o).map(r + l);
      t.delete(d, d + c.nodeSize);
    }
    a += u.rowspan;
  }
}
function KO(t, e) {
  if (!Yt(t)) return !1;
  if (e) {
    const n = on(t), r = t.tr;
    if (n.left == 0 && n.right == n.map.width) return !1;
    for (let i = n.right - 1; WO(r, n, i), i != n.left; i--) {
      const o = n.tableStart ? r.doc.nodeAt(n.tableStart - 1) : r.doc;
      if (!o)
        throw RangeError("No table found");
      n.table = o, n.map = we.get(o);
    }
    e(r);
  }
  return !0;
}
function QO(t, e, n) {
  var r;
  const i = it(e.type.schema).header_cell;
  for (let o = 0; o < t.width; o++)
    if (((r = e.nodeAt(t.map[o + n * t.width])) == null ? void 0 : r.type) != i)
      return !1;
  return !0;
}
function qg(t, { map: e, tableStart: n, table: r }, i) {
  var o;
  let a = n;
  for (let c = 0; c < i; c++) a += r.child(c).nodeSize;
  const s = [];
  let l = i > 0 ? -1 : 0;
  QO(e, r, i + l) && (l = i == 0 || i == e.height ? null : 0);
  for (let c = 0, u = e.width * i; c < e.width; c++, u++)
    if (i > 0 && i < e.height && e.map[u] == e.map[u - e.width]) {
      const d = e.map[u], p = r.nodeAt(d).attrs;
      t.setNodeMarkup(n + d, null, {
        ...p,
        rowspan: p.rowspan + 1
      }), c += p.colspan - 1;
    } else {
      const d = l == null ? it(r.type.schema).cell : (o = r.nodeAt(e.map[u + l * e.width])) == null ? void 0 : o.type, p = d == null ? void 0 : d.createAndFill();
      p && s.push(p);
    }
  return t.insert(a, it(r.type.schema).row.create(null, s)), t;
}
function ZO(t, e) {
  if (!Yt(t)) return !1;
  if (e) {
    const n = on(t);
    e(qg(t.tr, n, n.top));
  }
  return !0;
}
function XO(t, e) {
  if (!Yt(t)) return !1;
  if (e) {
    const n = on(t);
    e(qg(t.tr, n, n.bottom));
  }
  return !0;
}
function jO(t, { map: e, table: n, tableStart: r }, i) {
  let o = 0;
  for (let c = 0; c < i; c++) o += n.child(c).nodeSize;
  const a = o + n.child(i).nodeSize, s = t.mapping.maps.length;
  t.delete(o + r, a + r);
  const l = /* @__PURE__ */ new Set();
  for (let c = 0, u = i * e.width; c < e.width; c++, u++) {
    const d = e.map[u];
    if (!l.has(d)) {
      if (l.add(d), i > 0 && d == e.map[u - e.width]) {
        const p = n.nodeAt(d).attrs;
        t.setNodeMarkup(t.mapping.slice(s).map(d + r), null, {
          ...p,
          rowspan: p.rowspan - 1
        }), c += p.colspan - 1;
      } else if (i < e.height && d == e.map[u + e.width]) {
        const p = n.nodeAt(d), _ = p.attrs, m = p.type.create(
          { ..._, rowspan: p.attrs.rowspan - 1 },
          p.content
        ), f = e.positionAt(i + 1, c, n);
        t.insert(t.mapping.slice(s).map(r + f), m), c += _.colspan - 1;
      }
    }
  }
}
function JO(t, e) {
  if (!Yt(t)) return !1;
  if (e) {
    const n = on(t), r = t.tr;
    if (n.top == 0 && n.bottom == n.map.height) return !1;
    for (let i = n.bottom - 1; jO(r, n, i), i != n.top; i--) {
      const o = n.tableStart ? r.doc.nodeAt(n.tableStart - 1) : r.doc;
      if (!o)
        throw RangeError("No table found");
      n.table = o, n.map = we.get(n.table);
    }
    e(r);
  }
  return !0;
}
function o_(t) {
  const e = t.content;
  return e.childCount == 1 && e.child(0).isTextblock && e.child(0).childCount == 0;
}
function eN({ width: t, height: e, map: n }, r) {
  let i = r.top * t + r.left, o = i, a = (r.bottom - 1) * t + r.left, s = i + (r.right - r.left - 1);
  for (let l = r.top; l < r.bottom; l++) {
    if (r.left > 0 && n[o] == n[o - 1] || r.right < t && n[s] == n[s + 1])
      return !0;
    o += t, s += t;
  }
  for (let l = r.left; l < r.right; l++) {
    if (r.top > 0 && n[i] == n[i - t] || r.bottom < e && n[a] == n[a + t])
      return !0;
    i++, a++;
  }
  return !1;
}
function a_(t, e) {
  const n = t.selection;
  if (!(n instanceof ve) || n.$anchorCell.pos == n.$headCell.pos)
    return !1;
  const r = on(t), { map: i } = r;
  if (eN(i, r)) return !1;
  if (e) {
    const o = t.tr, a = {};
    let s = L.empty, l, c;
    for (let u = r.top; u < r.bottom; u++)
      for (let d = r.left; d < r.right; d++) {
        const p = i.map[u * i.width + d], _ = r.table.nodeAt(p);
        if (!(a[p] || !_))
          if (a[p] = !0, l == null)
            l = p, c = _;
          else {
            o_(_) || (s = s.append(_.content));
            const m = o.mapping.map(p + r.tableStart);
            o.delete(m, m + _.nodeSize);
          }
      }
    if (l == null || c == null)
      return !0;
    if (o.setNodeMarkup(l + r.tableStart, null, {
      ...Gg(
        c.attrs,
        c.attrs.colspan,
        r.right - r.left - c.attrs.colspan
      ),
      rowspan: r.bottom - r.top
    }), s.size) {
      const u = l + 1 + c.content.size, d = o_(c) ? l + 1 : u;
      o.replaceWith(d + r.tableStart, u + r.tableStart, s);
    }
    o.setSelection(
      new ve(o.doc.resolve(l + r.tableStart))
    ), e(o);
  }
  return !0;
}
function s_(t, e) {
  const n = it(t.schema);
  return tN(({ node: r }) => n[r.type.spec.tableRole])(t, e);
}
function tN(t) {
  return (e, n) => {
    var r;
    const i = e.selection;
    let o, a;
    if (i instanceof ve) {
      if (i.$anchorCell.pos != i.$headCell.pos) return !1;
      o = i.$anchorCell.nodeAfter, a = i.$anchorCell.pos;
    } else {
      if (o = LO(i.$from), !o) return !1;
      a = (r = _i(i.$from)) == null ? void 0 : r.pos;
    }
    if (o == null || a == null || o.attrs.colspan == 1 && o.attrs.rowspan == 1)
      return !1;
    if (n) {
      let s = o.attrs;
      const l = [], c = s.colwidth;
      s.rowspan > 1 && (s = { ...s, rowspan: 1 }), s.colspan > 1 && (s = { ...s, colspan: 1 });
      const u = on(e), d = e.tr;
      for (let _ = 0; _ < u.right - u.left; _++)
        l.push(
          c ? {
            ...s,
            colwidth: c && c[_] ? [c[_]] : null
          } : s
        );
      let p;
      for (let _ = u.top; _ < u.bottom; _++) {
        let m = u.map.positionAt(_, u.left, u.table);
        _ == u.top && (m += o.nodeSize);
        for (let f = u.left, g = 0; f < u.right; f++, g++)
          f == u.left && _ == u.top || d.insert(
            p = d.mapping.map(m + u.tableStart, 1),
            t({ node: o, row: _, col: f }).createAndFill(l[g])
          );
      }
      d.setNodeMarkup(
        a,
        t({ node: o, row: u.top, col: u.left }),
        l[0]
      ), i instanceof ve && d.setSelection(
        new ve(
          d.doc.resolve(i.$anchorCell.pos),
          p ? d.doc.resolve(p) : void 0
        )
      ), n(d);
    }
    return !0;
  };
}
function nN(t, e) {
  return function(n, r) {
    if (!Yt(n)) return !1;
    const i = Ls(n);
    if (i.nodeAfter.attrs[t] === e) return !1;
    if (r) {
      const o = n.tr;
      n.selection instanceof ve ? n.selection.forEachCell((a, s) => {
        a.attrs[t] !== e && o.setNodeMarkup(s, null, {
          ...a.attrs,
          [t]: e
        });
      }) : o.setNodeMarkup(i.pos, null, {
        ...i.nodeAfter.attrs,
        [t]: e
      }), r(o);
    }
    return !0;
  };
}
function rN(t) {
  return function(e, n) {
    if (!Yt(e)) return !1;
    if (n) {
      const r = it(e.schema), i = on(e), o = e.tr, a = i.map.cellsInRect(
        t == "column" ? {
          left: i.left,
          top: 0,
          right: i.right,
          bottom: i.map.height
        } : t == "row" ? {
          left: 0,
          top: i.top,
          right: i.map.width,
          bottom: i.bottom
        } : i
      ), s = a.map((l) => i.table.nodeAt(l));
      for (let l = 0; l < a.length; l++)
        s[l].type == r.header_cell && o.setNodeMarkup(
          i.tableStart + a[l],
          r.cell,
          s[l].attrs
        );
      if (o.steps.length == 0)
        for (let l = 0; l < a.length; l++)
          o.setNodeMarkup(
            i.tableStart + a[l],
            r.header_cell,
            s[l].attrs
          );
      n(o);
    }
    return !0;
  };
}
function l_(t, e, n) {
  const r = e.map.cellsInRect({
    left: 0,
    top: 0,
    right: t == "row" ? e.map.width : 1,
    bottom: t == "column" ? e.map.height : 1
  });
  for (let i = 0; i < r.length; i++) {
    const o = e.table.nodeAt(r[i]);
    if (o && o.type !== n.header_cell)
      return !1;
  }
  return !0;
}
function ro(t, e) {
  return e = e || { useDeprecatedLogic: !1 }, e.useDeprecatedLogic ? rN(t) : function(n, r) {
    if (!Yt(n)) return !1;
    if (r) {
      const i = it(n.schema), o = on(n), a = n.tr, s = l_("row", o, i), l = l_(
        "column",
        o,
        i
      ), u = (t === "column" ? s : t === "row" ? l : !1) ? 1 : 0, d = t == "column" ? {
        left: 0,
        top: u,
        right: 1,
        bottom: o.map.height
      } : t == "row" ? {
        left: u,
        top: 0,
        right: o.map.width,
        bottom: 1
      } : o, p = t == "column" ? l ? i.cell : i.header_cell : t == "row" ? s ? i.cell : i.header_cell : i.cell;
      o.map.cellsInRect(d).forEach((_) => {
        const m = _ + o.tableStart, f = a.doc.nodeAt(m);
        f && a.setNodeMarkup(m, p, f.attrs);
      }), r(a);
    }
    return !0;
  };
}
ro("row", {
  useDeprecatedLogic: !0
});
ro("column", {
  useDeprecatedLogic: !0
});
var iN = ro("cell", {
  useDeprecatedLogic: !0
});
function oN(t, e) {
  if (e < 0) {
    const n = t.nodeBefore;
    if (n) return t.pos - n.nodeSize;
    for (let r = t.index(-1) - 1, i = t.before(); r >= 0; r--) {
      const o = t.node(-1).child(r), a = o.lastChild;
      if (a)
        return i - 1 - a.nodeSize;
      i -= o.nodeSize;
    }
  } else {
    if (t.index() < t.parent.childCount - 1)
      return t.pos + t.nodeAfter.nodeSize;
    const n = t.node(-1);
    for (let r = t.indexAfter(-1), i = t.after(); r < n.childCount; r++) {
      const o = n.child(r);
      if (o.childCount) return i + 1;
      i += o.nodeSize;
    }
  }
  return null;
}
function c_(t) {
  return function(e, n) {
    if (!Yt(e)) return !1;
    const r = oN(Ls(e), t);
    if (r == null) return !1;
    if (n) {
      const i = e.doc.resolve(r);
      n(
        e.tr.setSelection(K.between(i, PO(i))).scrollIntoView()
      );
    }
    return !0;
  };
}
function aN(t, e) {
  const n = t.selection.$anchor;
  for (let r = n.depth; r > 0; r--)
    if (n.node(r).type.spec.tableRole == "table")
      return e && e(
        t.tr.delete(n.before(r), n.after(r)).scrollIntoView()
      ), !0;
  return !1;
}
function Ho(t, e) {
  const n = t.selection;
  if (!(n instanceof ve)) return !1;
  if (e) {
    const r = t.tr, i = it(t.schema).cell.createAndFill().content;
    n.forEachCell((o, a) => {
      o.content.eq(i) || r.replace(
        r.mapping.map(a + 1),
        r.mapping.map(a + o.nodeSize - 1),
        new H(i, 0, 0)
      );
    }), r.docChanged && e(r);
  }
  return !0;
}
function sN(t) {
  if (!t.size) return null;
  let { content: e, openStart: n, openEnd: r } = t;
  for (; e.childCount == 1 && (n > 0 && r > 0 || e.child(0).type.spec.tableRole == "table"); )
    n--, r--, e = e.child(0).content;
  const i = e.child(0), o = i.type.spec.tableRole, a = i.type.schema, s = [];
  if (o == "row")
    for (let l = 0; l < e.childCount; l++) {
      let c = e.child(l).content;
      const u = l ? 0 : Math.max(0, n - 1), d = l < e.childCount - 1 ? 0 : Math.max(0, r - 1);
      (u || d) && (c = yc(
        it(a).row,
        new H(c, u, d)
      ).content), s.push(c);
    }
  else if (o == "cell" || o == "header_cell")
    s.push(
      n || r ? yc(
        it(a).row,
        new H(e, n, r)
      ).content : e
    );
  else
    return null;
  return lN(a, s);
}
function lN(t, e) {
  const n = [];
  for (let i = 0; i < e.length; i++) {
    const o = e[i];
    for (let a = o.childCount - 1; a >= 0; a--) {
      const { rowspan: s, colspan: l } = o.child(a).attrs;
      for (let c = i; c < i + s; c++)
        n[c] = (n[c] || 0) + l;
    }
  }
  let r = 0;
  for (let i = 0; i < n.length; i++) r = Math.max(r, n[i]);
  for (let i = 0; i < n.length; i++)
    if (i >= e.length && e.push(L.empty), n[i] < r) {
      const o = it(t).cell.createAndFill(), a = [];
      for (let s = n[i]; s < r; s++)
        a.push(o);
      e[i] = e[i].append(L.from(a));
    }
  return { height: e.length, width: r, rows: e };
}
function yc(t, e) {
  const n = t.createAndFill();
  return new $c(n).replace(0, n.content.size, e).doc;
}
function cN({ width: t, height: e, rows: n }, r, i) {
  if (t != r) {
    const o = [], a = [];
    for (let s = 0; s < n.length; s++) {
      const l = n[s], c = [];
      for (let u = o[s] || 0, d = 0; u < r; d++) {
        let p = l.child(d % l.childCount);
        u + p.attrs.colspan > r && (p = p.type.createChecked(
          Tr(
            p.attrs,
            p.attrs.colspan,
            u + p.attrs.colspan - r
          ),
          p.content
        )), c.push(p), u += p.attrs.colspan;
        for (let _ = 1; _ < p.attrs.rowspan; _++)
          o[s + _] = (o[s + _] || 0) + p.attrs.colspan;
      }
      a.push(L.from(c));
    }
    n = a, t = r;
  }
  if (e != i) {
    const o = [];
    for (let a = 0, s = 0; a < i; a++, s++) {
      const l = [], c = n[s % e];
      for (let u = 0; u < c.childCount; u++) {
        let d = c.child(u);
        a + d.attrs.rowspan > i && (d = d.type.create(
          {
            ...d.attrs,
            rowspan: Math.max(1, i - d.attrs.rowspan)
          },
          d.content
        )), l.push(d);
      }
      o.push(L.from(l));
    }
    n = o, e = i;
  }
  return { width: t, height: e, rows: n };
}
function uN(t, e, n, r, i, o, a) {
  const s = t.doc.type.schema, l = it(s);
  let c, u;
  if (i > e.width)
    for (let d = 0, p = 0; d < e.height; d++) {
      const _ = n.child(d);
      p += _.nodeSize;
      const m = [];
      let f;
      _.lastChild == null || _.lastChild.type == l.cell ? f = c || (c = l.cell.createAndFill()) : f = u || (u = l.header_cell.createAndFill());
      for (let g = e.width; g < i; g++) m.push(f);
      t.insert(t.mapping.slice(a).map(p - 1 + r), m);
    }
  if (o > e.height) {
    const d = [];
    for (let m = 0, f = (e.height - 1) * e.width; m < Math.max(e.width, i); m++) {
      const g = m >= e.width ? !1 : n.nodeAt(e.map[f + m]).type == l.header_cell;
      d.push(
        g ? u || (u = l.header_cell.createAndFill()) : c || (c = l.cell.createAndFill())
      );
    }
    const p = l.row.create(null, L.from(d)), _ = [];
    for (let m = e.height; m < o; m++) _.push(p);
    t.insert(t.mapping.slice(a).map(r + n.nodeSize - 2), _);
  }
  return !!(c || u);
}
function u_(t, e, n, r, i, o, a, s) {
  if (a == 0 || a == e.height) return !1;
  let l = !1;
  for (let c = i; c < o; c++) {
    const u = a * e.width + c, d = e.map[u];
    if (e.map[u - e.width] == d) {
      l = !0;
      const p = n.nodeAt(d), { top: _, left: m } = e.findCell(d);
      t.setNodeMarkup(t.mapping.slice(s).map(d + r), null, {
        ...p.attrs,
        rowspan: a - _
      }), t.insert(
        t.mapping.slice(s).map(e.positionAt(a, m, n)),
        p.type.createAndFill({
          ...p.attrs,
          rowspan: _ + p.attrs.rowspan - a
        })
      ), c += p.attrs.colspan - 1;
    }
  }
  return l;
}
function d_(t, e, n, r, i, o, a, s) {
  if (a == 0 || a == e.width) return !1;
  let l = !1;
  for (let c = i; c < o; c++) {
    const u = c * e.width + a, d = e.map[u];
    if (e.map[u - 1] == d) {
      l = !0;
      const p = n.nodeAt(d), _ = e.colCount(d), m = t.mapping.slice(s).map(d + r);
      t.setNodeMarkup(
        m,
        null,
        Tr(
          p.attrs,
          a - _,
          p.attrs.colspan - (a - _)
        )
      ), t.insert(
        m + p.nodeSize,
        p.type.createAndFill(
          Tr(p.attrs, 0, a - _)
        )
      ), c += p.attrs.rowspan - 1;
    }
  }
  return l;
}
function p_(t, e, n, r, i) {
  let o = n ? t.doc.nodeAt(n - 1) : t.doc;
  if (!o)
    throw new Error("No table found");
  let a = we.get(o);
  const { top: s, left: l } = r, c = l + i.width, u = s + i.height, d = t.tr;
  let p = 0;
  function _() {
    if (o = n ? d.doc.nodeAt(n - 1) : d.doc, !o)
      throw new Error("No table found");
    a = we.get(o), p = d.mapping.maps.length;
  }
  uN(d, a, o, n, c, u, p) && _(), u_(d, a, o, n, l, c, s, p) && _(), u_(d, a, o, n, l, c, u, p) && _(), d_(d, a, o, n, s, u, l, p) && _(), d_(d, a, o, n, s, u, c, p) && _();
  for (let m = s; m < u; m++) {
    const f = a.positionAt(m, l, o), g = a.positionAt(m, c, o);
    d.replace(
      d.mapping.slice(p).map(f + n),
      d.mapping.slice(p).map(g + n),
      new H(i.rows[m - s], 0, 0)
    );
  }
  _(), d.setSelection(
    new ve(
      d.doc.resolve(n + a.positionAt(s, l, o)),
      d.doc.resolve(n + a.positionAt(u - 1, c - 1, o))
    )
  ), e(d);
}
var dN = eu({
  ArrowLeft: Go("horiz", -1),
  ArrowRight: Go("horiz", 1),
  ArrowUp: Go("vert", -1),
  ArrowDown: Go("vert", 1),
  "Shift-ArrowLeft": Vo("horiz", -1),
  "Shift-ArrowRight": Vo("horiz", 1),
  "Shift-ArrowUp": Vo("vert", -1),
  "Shift-ArrowDown": Vo("vert", 1),
  Backspace: Ho,
  "Mod-Backspace": Ho,
  Delete: Ho,
  "Mod-Delete": Ho
});
function sa(t, e, n) {
  return n.eq(t.selection) ? !1 : (e && e(t.tr.setSelection(n).scrollIntoView()), !0);
}
function Go(t, e) {
  return (n, r, i) => {
    if (!i) return !1;
    const o = n.selection;
    if (o instanceof ve)
      return sa(
        n,
        r,
        ne.near(o.$headCell, e)
      );
    if (t != "horiz" && !o.empty) return !1;
    const a = Wg(i, t, e);
    if (a == null) return !1;
    if (t == "horiz")
      return sa(
        n,
        r,
        ne.near(n.doc.resolve(o.head + e), e)
      );
    {
      const s = n.doc.resolve(a), l = Hg(s, t, e);
      let c;
      return l ? c = ne.near(l, 1) : e < 0 ? c = ne.near(n.doc.resolve(s.before(-1)), -1) : c = ne.near(n.doc.resolve(s.after(-1)), 1), sa(n, r, c);
    }
  };
}
function Vo(t, e) {
  return (n, r, i) => {
    if (!i) return !1;
    const o = n.selection;
    let a;
    if (o instanceof ve)
      a = o;
    else {
      const l = Wg(i, t, e);
      if (l == null) return !1;
      a = new ve(n.doc.resolve(l));
    }
    const s = Hg(a.$headCell, t, e);
    return s ? sa(
      n,
      r,
      new ve(a.$anchorCell, s)
    ) : !1;
  };
}
function pN(t, e) {
  const n = t.state.doc, r = _i(n.resolve(e));
  return r ? (t.dispatch(t.state.tr.setSelection(new ve(r))), !0) : !1;
}
function _N(t, e, n) {
  if (!Yt(t.state)) return !1;
  let r = sN(n);
  const i = t.state.selection;
  if (i instanceof ve) {
    r || (r = {
      width: 1,
      height: 1,
      rows: [
        L.from(
          yc(it(t.state.schema).cell, n)
        )
      ]
    });
    const o = i.$anchorCell.node(-1), a = i.$anchorCell.start(-1), s = we.get(o).rectBetween(
      i.$anchorCell.pos - a,
      i.$headCell.pos - a
    );
    return r = cN(r, s.right - s.left, s.bottom - s.top), p_(t.state, t.dispatch, a, s, r), !0;
  } else if (r) {
    const o = Ls(t.state), a = o.start(-1);
    return p_(
      t.state,
      t.dispatch,
      a,
      we.get(o.node(-1)).findCell(o.pos - a),
      r
    ), !0;
  } else
    return !1;
}
function mN(t, e) {
  var n;
  if (e.ctrlKey || e.metaKey) return;
  const r = __(t, e.target);
  let i;
  if (e.shiftKey && t.state.selection instanceof ve)
    o(t.state.selection.$anchorCell, e), e.preventDefault();
  else if (e.shiftKey && r && (i = _i(t.state.selection.$anchor)) != null && ((n = Tl(t, e)) == null ? void 0 : n.pos) != i.pos)
    o(i, e), e.preventDefault();
  else if (!r)
    return;
  function o(l, c) {
    let u = Tl(t, c);
    const d = In.getState(t.state) == null;
    if (!u || !Tu(l, u))
      if (d) u = l;
      else return;
    const p = new ve(l, u);
    if (d || !t.state.selection.eq(p)) {
      const _ = t.state.tr.setSelection(p);
      d && _.setMeta(In, l.pos), t.dispatch(_);
    }
  }
  function a() {
    t.root.removeEventListener("mouseup", a), t.root.removeEventListener("dragstart", a), t.root.removeEventListener("mousemove", s), In.getState(t.state) != null && t.dispatch(t.state.tr.setMeta(In, -1));
  }
  function s(l) {
    const c = l, u = In.getState(t.state);
    let d;
    if (u != null)
      d = t.state.doc.resolve(u);
    else if (__(t, c.target) != r && (d = Tl(t, e), !d))
      return a();
    d && o(d, c);
  }
  t.root.addEventListener("mouseup", a), t.root.addEventListener("dragstart", a), t.root.addEventListener("mousemove", s);
}
function Wg(t, e, n) {
  if (!(t.state.selection instanceof K)) return null;
  const { $head: r } = t.state.selection;
  for (let i = r.depth - 1; i >= 0; i--) {
    const o = r.node(i);
    if ((n < 0 ? r.index(i) : r.indexAfter(i)) != (n < 0 ? 0 : o.childCount)) return null;
    if (o.type.spec.tableRole == "cell" || o.type.spec.tableRole == "header_cell") {
      const s = r.before(i), l = e == "vert" ? n > 0 ? "down" : "up" : n > 0 ? "right" : "left";
      return t.endOfTextblock(l) ? s : null;
    }
  }
  return null;
}
function __(t, e) {
  for (; e && e != t.dom; e = e.parentNode)
    if (e.nodeName == "TD" || e.nodeName == "TH")
      return e;
  return null;
}
function Tl(t, e) {
  const n = t.posAtCoords({
    left: e.clientX,
    top: e.clientY
  });
  return n && n ? _i(t.state.doc.resolve(n.pos)) : null;
}
var fN = class {
  constructor(e, n) {
    this.node = e, this.defaultCellMinWidth = n, this.dom = document.createElement("div"), this.dom.className = "tableWrapper", this.table = this.dom.appendChild(document.createElement("table")), this.table.style.setProperty(
      "--default-cell-min-width",
      `${n}px`
    ), this.colgroup = this.table.appendChild(document.createElement("colgroup")), vc(e, this.colgroup, this.table, n), this.contentDOM = this.table.appendChild(document.createElement("tbody"));
  }
  update(e) {
    return e.type != this.node.type ? !1 : (this.node = e, vc(
      e,
      this.colgroup,
      this.table,
      this.defaultCellMinWidth
    ), !0);
  }
  ignoreMutation(e) {
    return e.type == "attributes" && (e.target == this.table || this.colgroup.contains(e.target));
  }
};
function vc(t, e, n, r, i, o) {
  var a;
  let s = 0, l = !0, c = e.firstChild;
  const u = t.firstChild;
  if (u) {
    for (let d = 0, p = 0; d < u.childCount; d++) {
      const { colspan: _, colwidth: m } = u.child(d).attrs;
      for (let f = 0; f < _; f++, p++) {
        const g = i == p ? o : m && m[f], S = g ? g + "px" : "";
        if (s += g || r, g || (l = !1), c)
          c.style.width != S && (c.style.width = S), c = c.nextSibling;
        else {
          const E = document.createElement("col");
          E.style.width = S, e.appendChild(E);
        }
      }
    }
    for (; c; ) {
      const d = c.nextSibling;
      (a = c.parentNode) == null || a.removeChild(c), c = d;
    }
    l ? (n.style.width = s + "px", n.style.minWidth = "") : (n.style.width = "", n.style.minWidth = s + "px");
  }
}
var Rt = new Oe(
  "tableColumnResizing"
);
function gN({
  handleWidth: t = 5,
  cellMinWidth: e = 25,
  defaultCellMinWidth: n = 100,
  View: r = fN,
  lastColumnResizable: i = !0
} = {}) {
  const o = new Te({
    key: Rt,
    state: {
      init(a, s) {
        var l, c;
        const u = (c = (l = o.spec) == null ? void 0 : l.props) == null ? void 0 : c.nodeViews, d = it(s.schema).table.name;
        return r && u && (u[d] = (p, _) => new r(p, n, _)), new hN(-1, !1);
      },
      apply(a, s) {
        return s.apply(a);
      }
    },
    props: {
      attributes: (a) => {
        const s = Rt.getState(a);
        return s && s.activeHandle > -1 ? { class: "resize-cursor" } : {};
      },
      handleDOMEvents: {
        mousemove: (a, s) => {
          EN(a, s, t, i);
        },
        mouseleave: (a) => {
          SN(a);
        },
        mousedown: (a, s) => {
          bN(a, s, e, n);
        }
      },
      decorations: (a) => {
        const s = Rt.getState(a);
        if (s && s.activeHandle > -1)
          return RN(a, s.activeHandle);
      },
      nodeViews: {}
    }
  });
  return o;
}
var hN = class la {
  constructor(e, n) {
    this.activeHandle = e, this.dragging = n;
  }
  apply(e) {
    const n = this, r = e.getMeta(Rt);
    if (r && r.setHandle != null)
      return new la(r.setHandle, !1);
    if (r && r.setDragging !== void 0)
      return new la(n.activeHandle, r.setDragging);
    if (n.activeHandle > -1 && e.docChanged) {
      let i = e.mapping.map(n.activeHandle, -1);
      return Cc(e.doc.resolve(i)) || (i = -1), new la(i, n.dragging);
    }
    return n;
  }
};
function EN(t, e, n, r) {
  if (!t.editable) return;
  const i = Rt.getState(t.state);
  if (i && !i.dragging) {
    const o = CN(e.target);
    let a = -1;
    if (o) {
      const { left: s, right: l } = o.getBoundingClientRect();
      e.clientX - s <= n ? a = m_(t, e, "left", n) : l - e.clientX <= n && (a = m_(t, e, "right", n));
    }
    if (a != i.activeHandle) {
      if (!r && a !== -1) {
        const s = t.state.doc.resolve(a), l = s.node(-1), c = we.get(l), u = s.start(-1);
        if (c.colCount(s.pos - u) + s.nodeAfter.attrs.colspan - 1 == c.width - 1)
          return;
      }
      Kg(t, a);
    }
  }
}
function SN(t) {
  if (!t.editable) return;
  const e = Rt.getState(t.state);
  e && e.activeHandle > -1 && !e.dragging && Kg(t, -1);
}
function bN(t, e, n, r) {
  var i;
  if (!t.editable) return !1;
  const o = (i = t.dom.ownerDocument.defaultView) != null ? i : window, a = Rt.getState(t.state);
  if (!a || a.activeHandle == -1 || a.dragging)
    return !1;
  const s = t.state.doc.nodeAt(a.activeHandle), l = TN(t, a.activeHandle, s.attrs);
  t.dispatch(
    t.state.tr.setMeta(Rt, {
      setDragging: { startX: e.clientX, startWidth: l }
    })
  );
  function c(d) {
    o.removeEventListener("mouseup", c), o.removeEventListener("mousemove", u);
    const p = Rt.getState(t.state);
    p != null && p.dragging && (yN(
      t,
      p.activeHandle,
      f_(p.dragging, d, n)
    ), t.dispatch(
      t.state.tr.setMeta(Rt, { setDragging: null })
    ));
  }
  function u(d) {
    if (!d.which) return c(d);
    const p = Rt.getState(t.state);
    if (p && p.dragging) {
      const _ = f_(p.dragging, d, n);
      g_(
        t,
        p.activeHandle,
        _,
        r
      );
    }
  }
  return g_(
    t,
    a.activeHandle,
    l,
    r
  ), o.addEventListener("mouseup", c), o.addEventListener("mousemove", u), e.preventDefault(), !0;
}
function TN(t, e, { colspan: n, colwidth: r }) {
  const i = r && r[r.length - 1];
  if (i) return i;
  const o = t.domAtPos(e);
  let s = o.node.childNodes[o.offset].offsetWidth, l = n;
  if (r)
    for (let c = 0; c < n; c++)
      r[c] && (s -= r[c], l--);
  return s / l;
}
function CN(t) {
  for (; t && t.nodeName != "TD" && t.nodeName != "TH"; )
    t = t.classList && t.classList.contains("ProseMirror") ? null : t.parentNode;
  return t;
}
function m_(t, e, n, r) {
  const i = n == "right" ? -r : r, o = t.posAtCoords({
    left: e.clientX + i,
    top: e.clientY
  });
  if (!o) return -1;
  const { pos: a } = o, s = _i(t.state.doc.resolve(a));
  if (!s) return -1;
  if (n == "right") return s.pos;
  const l = we.get(s.node(-1)), c = s.start(-1), u = l.map.indexOf(s.pos - c);
  return u % l.width == 0 ? -1 : c + l.map[u - 1];
}
function f_(t, e, n) {
  const r = e.clientX - t.startX;
  return Math.max(n, t.startWidth + r);
}
function Kg(t, e) {
  t.dispatch(
    t.state.tr.setMeta(Rt, { setHandle: e })
  );
}
function yN(t, e, n) {
  const r = t.state.doc.resolve(e), i = r.node(-1), o = we.get(i), a = r.start(-1), s = o.colCount(r.pos - a) + r.nodeAfter.attrs.colspan - 1, l = t.state.tr;
  for (let c = 0; c < o.height; c++) {
    const u = c * o.width + s;
    if (c && o.map[u] == o.map[u - o.width]) continue;
    const d = o.map[u], p = i.nodeAt(d).attrs, _ = p.colspan == 1 ? 0 : s - o.colCount(d);
    if (p.colwidth && p.colwidth[_] == n) continue;
    const m = p.colwidth ? p.colwidth.slice() : vN(p.colspan);
    m[_] = n, l.setNodeMarkup(a + d, null, { ...p, colwidth: m });
  }
  l.docChanged && t.dispatch(l);
}
function g_(t, e, n, r) {
  const i = t.state.doc.resolve(e), o = i.node(-1), a = i.start(-1), s = we.get(o).colCount(i.pos - a) + i.nodeAfter.attrs.colspan - 1;
  let l = t.domAtPos(i.start(-1)).node;
  for (; l && l.nodeName != "TABLE"; )
    l = l.parentNode;
  l && vc(
    o,
    l.firstChild,
    l,
    r,
    s,
    n
  );
}
function vN(t) {
  return Array(t).fill(0);
}
function RN(t, e) {
  var n;
  const r = [], i = t.doc.resolve(e), o = i.node(-1);
  if (!o)
    return ye.empty;
  const a = we.get(o), s = i.start(-1), l = a.colCount(i.pos - s) + i.nodeAfter.attrs.colspan - 1;
  for (let c = 0; c < a.height; c++) {
    const u = l + c * a.width;
    if ((l == a.width - 1 || a.map[u] != a.map[u + 1]) && (c == 0 || a.map[u] != a.map[u - a.width])) {
      const d = a.map[u], p = s + d + o.nodeAt(d).nodeSize - 1, _ = document.createElement("div");
      _.className = "column-resize-handle", (n = Rt.getState(t)) != null && n.dragging && r.push(
        Be.node(
          s + d,
          s + d + o.nodeAt(d).nodeSize,
          {
            class: "column-resize-dragging"
          }
        )
      ), r.push(Be.widget(p, _));
    }
  }
  return ye.create(t.doc, r);
}
function ON({
  allowTableNodeSelection: t = !1
} = {}) {
  return new Te({
    key: In,
    // This piece of state is used to remember when a mouse-drag
    // cell-selection is happening, so that it can continue even as
    // transactions (which might move its anchor cell) come in.
    state: {
      init() {
        return null;
      },
      apply(e, n) {
        const r = e.getMeta(In);
        if (r != null) return r == -1 ? null : r;
        if (n == null || !e.docChanged) return n;
        const { deleted: i, pos: o } = e.mapping.mapResult(n);
        return i ? null : o;
      }
    },
    props: {
      decorations: UO,
      handleDOMEvents: {
        mousedown: mN
      },
      createSelectionBetween(e) {
        return In.getState(e.state) != null ? e.state.selection : null;
      },
      handleTripleClick: pN,
      handleKeyDown: dN,
      handlePaste: _N
    },
    appendTransaction(e, n, r) {
      return VO(
        r,
        $g(r, n),
        t
      );
    }
  });
}
function Rc(t, e) {
  return e ? ["width", `${Math.max(e, t)}px`] : ["min-width", `${t}px`];
}
function h_(t, e, n, r, i, o) {
  var a;
  let s = 0, l = !0, c = e.firstChild;
  const u = t.firstChild;
  if (u !== null)
    for (let d = 0, p = 0; d < u.childCount; d += 1) {
      const { colspan: _, colwidth: m } = u.child(d).attrs;
      for (let f = 0; f < _; f += 1, p += 1) {
        const g = i === p ? o : m && m[f], S = g ? `${g}px` : "";
        if (s += g || r, g || (l = !1), c) {
          if (c.style.width !== S) {
            const [E, b] = Rc(r, g);
            c.style.setProperty(E, b);
          }
          c = c.nextSibling;
        } else {
          const E = document.createElement("col"), [b, h] = Rc(r, g);
          E.style.setProperty(b, h), e.appendChild(E);
        }
      }
    }
  for (; c; ) {
    const d = c.nextSibling;
    (a = c.parentNode) === null || a === void 0 || a.removeChild(c), c = d;
  }
  l ? (n.style.width = `${s}px`, n.style.minWidth = "") : (n.style.width = "", n.style.minWidth = `${s}px`);
}
class NN {
  constructor(e, n) {
    this.node = e, this.cellMinWidth = n, this.dom = document.createElement("div"), this.dom.className = "tableWrapper", this.table = this.dom.appendChild(document.createElement("table")), this.colgroup = this.table.appendChild(document.createElement("colgroup")), h_(e, this.colgroup, this.table, n), this.contentDOM = this.table.appendChild(document.createElement("tbody"));
  }
  update(e) {
    return e.type !== this.node.type ? !1 : (this.node = e, h_(e, this.colgroup, this.table, this.cellMinWidth), !0);
  }
  ignoreMutation(e) {
    return e.type === "attributes" && (e.target === this.table || this.colgroup.contains(e.target));
  }
}
function AN(t, e, n, r) {
  let i = 0, o = !0;
  const a = [], s = t.firstChild;
  if (!s)
    return {};
  for (let d = 0, p = 0; d < s.childCount; d += 1) {
    const { colspan: _, colwidth: m } = s.child(d).attrs;
    for (let f = 0; f < _; f += 1, p += 1) {
      const g = n === p ? r : m && m[f];
      i += g || e, g || (o = !1);
      const [S, E] = Rc(e, g);
      a.push([
        "col",
        { style: `${S}: ${E}` }
      ]);
    }
  }
  const l = o ? `${i}px` : "", c = o ? "" : `${i}px`;
  return { colgroup: ["colgroup", {}, ...a], tableWidth: l, tableMinWidth: c };
}
function E_(t, e) {
  return t.createAndFill();
}
function IN(t) {
  if (t.cached.tableNodeTypes)
    return t.cached.tableNodeTypes;
  const e = {};
  return Object.keys(t.nodes).forEach((n) => {
    const r = t.nodes[n];
    r.spec.tableRole && (e[r.spec.tableRole] = r);
  }), t.cached.tableNodeTypes = e, e;
}
function xN(t, e, n, r, i) {
  const o = IN(t), a = [], s = [];
  for (let c = 0; c < n; c += 1) {
    const u = E_(o.cell);
    if (u && s.push(u), r) {
      const d = E_(o.header_cell);
      d && a.push(d);
    }
  }
  const l = [];
  for (let c = 0; c < e; c += 1)
    l.push(o.row.createChecked(null, r && c === 0 ? a : s));
  return o.table.createChecked(null, l);
}
function DN(t) {
  return t instanceof ve;
}
const Yo = ({ editor: t }) => {
  const { selection: e } = t.state;
  if (!DN(e))
    return !1;
  let n = 0;
  const r = jf(e.ranges[0].$from, (o) => o.type.name === "table");
  return r == null || r.node.descendants((o) => {
    if (o.type.name === "table")
      return !1;
    ["tableCell", "tableHeader"].includes(o.type.name) && (n += 1);
  }), n === e.ranges.length ? (t.commands.deleteTable(), !0) : !1;
}, wN = xe.create({
  name: "table",
  // @ts-ignore
  addOptions() {
    return {
      HTMLAttributes: {},
      resizable: !1,
      handleWidth: 5,
      cellMinWidth: 25,
      // TODO: fix
      View: NN,
      lastColumnResizable: !0,
      allowTableNodeSelection: !1
    };
  },
  content: "tableRow+",
  tableRole: "table",
  isolating: !0,
  group: "block",
  parseHTML() {
    return [{ tag: "table" }];
  },
  renderHTML({ node: t, HTMLAttributes: e }) {
    const { colgroup: n, tableWidth: r, tableMinWidth: i } = AN(t, this.options.cellMinWidth);
    return [
      "table",
      me(this.options.HTMLAttributes, e, {
        style: r ? `width: ${r}` : `min-width: ${i}`
      }),
      n,
      ["tbody", 0]
    ];
  },
  addCommands() {
    return {
      insertTable: ({ rows: t = 3, cols: e = 3, withHeaderRow: n = !0 } = {}) => ({ tr: r, dispatch: i, editor: o }) => {
        const a = xN(o.schema, t, e, n);
        if (i) {
          const s = r.selection.from + 1;
          r.replaceSelectionWith(a).scrollIntoView().setSelection(K.near(r.doc.resolve(s)));
        }
        return !0;
      },
      addColumnBefore: () => ({ state: t, dispatch: e }) => zO(t, e),
      addColumnAfter: () => ({ state: t, dispatch: e }) => qO(t, e),
      deleteColumn: () => ({ state: t, dispatch: e }) => KO(t, e),
      addRowBefore: () => ({ state: t, dispatch: e }) => ZO(t, e),
      addRowAfter: () => ({ state: t, dispatch: e }) => XO(t, e),
      deleteRow: () => ({ state: t, dispatch: e }) => JO(t, e),
      deleteTable: () => ({ state: t, dispatch: e }) => aN(t, e),
      mergeCells: () => ({ state: t, dispatch: e }) => a_(t, e),
      splitCell: () => ({ state: t, dispatch: e }) => s_(t, e),
      toggleHeaderColumn: () => ({ state: t, dispatch: e }) => ro("column")(t, e),
      toggleHeaderRow: () => ({ state: t, dispatch: e }) => ro("row")(t, e),
      toggleHeaderCell: () => ({ state: t, dispatch: e }) => iN(t, e),
      mergeOrSplit: () => ({ state: t, dispatch: e }) => a_(t, e) ? !0 : s_(t, e),
      setCellAttribute: (t, e) => ({ state: n, dispatch: r }) => nN(t, e)(n, r),
      goToNextCell: () => ({ state: t, dispatch: e }) => c_(1)(t, e),
      goToPreviousCell: () => ({ state: t, dispatch: e }) => c_(-1)(t, e),
      fixTables: () => ({ state: t, dispatch: e }) => (e && $g(t), !0),
      setCellSelection: (t) => ({ tr: e, dispatch: n }) => {
        if (n) {
          const r = ve.create(e.doc, t.anchorCell, t.headCell);
          e.setSelection(r);
        }
        return !0;
      }
    };
  },
  addKeyboardShortcuts() {
    return {
      Tab: () => this.editor.commands.goToNextCell() ? !0 : this.editor.can().addRowAfter() ? this.editor.chain().addRowAfter().goToNextCell().run() : !1,
      "Shift-Tab": () => this.editor.commands.goToPreviousCell(),
      Backspace: Yo,
      "Mod-Backspace": Yo,
      Delete: Yo,
      "Mod-Delete": Yo
    };
  },
  addProseMirrorPlugins() {
    return [
      ...this.options.resizable && this.editor.isEditable ? [
        gN({
          handleWidth: this.options.handleWidth,
          cellMinWidth: this.options.cellMinWidth,
          defaultCellMinWidth: this.options.cellMinWidth,
          View: this.options.View,
          lastColumnResizable: this.options.lastColumnResizable
        })
      ] : [],
      ON({
        allowTableNodeSelection: this.options.allowTableNodeSelection
      })
    ];
  },
  extendNodeSchema(t) {
    const e = {
      name: t.name,
      options: t.options,
      storage: t.storage
    };
    return {
      tableRole: ce(z(t, "tableRole", e))
    };
  }
}), MN = xe.create({
  name: "tableRow",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  content: "(tableCell | tableHeader)*",
  tableRole: "row",
  parseHTML() {
    return [
      { tag: "tr" }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["tr", me(this.options.HTMLAttributes, t), 0];
  }
}), LN = xe.create({
  name: "tableHeader",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  content: "block+",
  addAttributes() {
    return {
      colspan: {
        default: 1
      },
      rowspan: {
        default: 1
      },
      colwidth: {
        default: null,
        parseHTML: (t) => {
          const e = t.getAttribute("colwidth");
          return e ? e.split(",").map((r) => parseInt(r, 10)) : null;
        }
      }
    };
  },
  tableRole: "header_cell",
  isolating: !0,
  parseHTML() {
    return [
      { tag: "th" }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["th", me(this.options.HTMLAttributes, t), 0];
  }
}), kN = xe.create({
  name: "tableCell",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  content: "block+",
  addAttributes() {
    return {
      colspan: {
        default: 1
      },
      rowspan: {
        default: 1
      },
      colwidth: {
        default: null,
        parseHTML: (t) => {
          const e = t.getAttribute("colwidth");
          return e ? e.split(",").map((r) => parseInt(r, 10)) : null;
        }
      }
    };
  },
  tableRole: "cell",
  isolating: !0,
  parseHTML() {
    return [
      { tag: "td" }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["td", me(this.options.HTMLAttributes, t), 0];
  }
}), PN = Se.create({
  name: "characterCount",
  addOptions() {
    return {
      limit: null,
      mode: "textSize",
      textCounter: (t) => t.length,
      wordCounter: (t) => t.split(" ").filter((e) => e !== "").length
    };
  },
  addStorage() {
    return {
      characters: () => 0,
      words: () => 0
    };
  },
  onBeforeCreate() {
    this.storage.characters = (t) => {
      const e = (t == null ? void 0 : t.node) || this.editor.state.doc;
      if (((t == null ? void 0 : t.mode) || this.options.mode) === "textSize") {
        const r = e.textBetween(0, e.content.size, void 0, " ");
        return this.options.textCounter(r);
      }
      return e.nodeSize;
    }, this.storage.words = (t) => {
      const e = (t == null ? void 0 : t.node) || this.editor.state.doc, n = e.textBetween(0, e.content.size, " ", " ");
      return this.options.wordCounter(n);
    };
  },
  addProseMirrorPlugins() {
    let t = !1;
    return [
      new Te({
        key: new Oe("characterCount"),
        appendTransaction: (e, n, r) => {
          if (t)
            return;
          const i = this.options.limit;
          if (i == null || i === 0) {
            t = !0;
            return;
          }
          const o = this.storage.characters({ node: r.doc });
          if (o > i) {
            const a = o - i, s = 0, l = a;
            console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);
            const c = r.tr.deleteRange(s, l);
            return t = !0, c;
          }
          t = !0;
        },
        filterTransaction: (e, n) => {
          const r = this.options.limit;
          if (!e.docChanged || r === 0 || r === null || r === void 0)
            return !0;
          const i = this.storage.characters({ node: n.doc }), o = this.storage.characters({ node: e.doc });
          if (o <= r || i > r && o > r && o <= i)
            return !0;
          if (i > r && o > r && o > i || !e.getMeta("paste"))
            return !1;
          const s = e.selection.$head.pos, l = o - r, c = s - l, u = s;
          return e.deleteRange(c, u), !(this.storage.characters({ node: e.doc }) > r);
        }
      })
    ];
  }
}), FN = " ögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2", BN = "ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2", oi = (t, e) => {
  for (const n in e)
    t[n] = e[n];
  return t;
}, Oc = "numeric", Nc = "ascii", Ac = "alpha", Bi = "asciinumeric", Ii = "alphanumeric", Ic = "domain", Qg = "emoji", UN = "scheme", HN = "slashscheme", Cl = "whitespace";
function GN(t, e) {
  return t in e || (e[t] = []), e[t];
}
function or(t, e, n) {
  e[Oc] && (e[Bi] = !0, e[Ii] = !0), e[Nc] && (e[Bi] = !0, e[Ac] = !0), e[Bi] && (e[Ii] = !0), e[Ac] && (e[Ii] = !0), e[Ii] && (e[Ic] = !0), e[Qg] && (e[Ic] = !0);
  for (const r in e) {
    const i = GN(r, n);
    i.indexOf(t) < 0 && i.push(t);
  }
}
function VN(t, e) {
  const n = {};
  for (const r in e)
    e[r].indexOf(t) >= 0 && (n[r] = !0);
  return n;
}
function ft(t = null) {
  this.j = {}, this.jr = [], this.jd = null, this.t = t;
}
ft.groups = {};
ft.prototype = {
  accepts() {
    return !!this.t;
  },
  /**
   * Follow an existing transition from the given input to the next state.
   * Does not mutate.
   * @param {string} input character or token type to transition on
   * @returns {?State<T>} the next state, if any
   */
  go(t) {
    const e = this, n = e.j[t];
    if (n)
      return n;
    for (let r = 0; r < e.jr.length; r++) {
      const i = e.jr[r][0], o = e.jr[r][1];
      if (o && i.test(t))
        return o;
    }
    return e.jd;
  },
  /**
   * Whether the state has a transition for the given input. Set the second
   * argument to true to only look for an exact match (and not a default or
   * regular-expression-based transition)
   * @param {string} input
   * @param {boolean} exactOnly
   */
  has(t, e = !1) {
    return e ? t in this.j : !!this.go(t);
  },
  /**
   * Short for "transition all"; create a transition from the array of items
   * in the given list to the same final resulting state.
   * @param {string | string[]} inputs Group of inputs to transition on
   * @param {Transition<T> | State<T>} [next] Transition options
   * @param {Flags} [flags] Collections flags to add token to
   * @param {Collections<T>} [groups] Master list of token groups
   */
  ta(t, e, n, r) {
    for (let i = 0; i < t.length; i++)
      this.tt(t[i], e, n, r);
  },
  /**
   * Short for "take regexp transition"; defines a transition for this state
   * when it encounters a token which matches the given regular expression
   * @param {RegExp} regexp Regular expression transition (populate first)
   * @param {T | State<T>} [next] Transition options
   * @param {Flags} [flags] Collections flags to add token to
   * @param {Collections<T>} [groups] Master list of token groups
   * @returns {State<T>} taken after the given input
   */
  tr(t, e, n, r) {
    r = r || ft.groups;
    let i;
    return e && e.j ? i = e : (i = new ft(e), n && r && or(e, n, r)), this.jr.push([t, i]), i;
  },
  /**
   * Short for "take transitions", will take as many sequential transitions as
   * the length of the given input and returns the
   * resulting final state.
   * @param {string | string[]} input
   * @param {T | State<T>} [next] Transition options
   * @param {Flags} [flags] Collections flags to add token to
   * @param {Collections<T>} [groups] Master list of token groups
   * @returns {State<T>} taken after the given input
   */
  ts(t, e, n, r) {
    let i = this;
    const o = t.length;
    if (!o)
      return i;
    for (let a = 0; a < o - 1; a++)
      i = i.tt(t[a]);
    return i.tt(t[o - 1], e, n, r);
  },
  /**
   * Short for "take transition", this is a method for building/working with
   * state machines.
   *
   * If a state already exists for the given input, returns it.
   *
   * If a token is specified, that state will emit that token when reached by
   * the linkify engine.
   *
   * If no state exists, it will be initialized with some default transitions
   * that resemble existing default transitions.
   *
   * If a state is given for the second argument, that state will be
   * transitioned to on the given input regardless of what that input
   * previously did.
   *
   * Specify a token group flags to define groups that this token belongs to.
   * The token will be added to corresponding entires in the given groups
   * object.
   *
   * @param {string} input character, token type to transition on
   * @param {T | State<T>} [next] Transition options
   * @param {Flags} [flags] Collections flags to add token to
   * @param {Collections<T>} [groups] Master list of groups
   * @returns {State<T>} taken after the given input
   */
  tt(t, e, n, r) {
    r = r || ft.groups;
    const i = this;
    if (e && e.j)
      return i.j[t] = e, e;
    const o = e;
    let a, s = i.go(t);
    if (s ? (a = new ft(), oi(a.j, s.j), a.jr.push.apply(a.jr, s.jr), a.jd = s.jd, a.t = s.t) : a = new ft(), o) {
      if (r)
        if (a.t && typeof a.t == "string") {
          const l = oi(VN(a.t, r), n);
          or(o, l, r);
        } else n && or(o, n, r);
      a.t = o;
    }
    return i.j[t] = a, a;
  }
};
const ue = (t, e, n, r, i) => t.ta(e, n, r, i), Le = (t, e, n, r, i) => t.tr(e, n, r, i), S_ = (t, e, n, r, i) => t.ts(e, n, r, i), F = (t, e, n, r, i) => t.tt(e, n, r, i), pn = "WORD", xc = "UWORD", Zg = "ASCIINUMERICAL", Xg = "ALPHANUMERICAL", io = "LOCALHOST", Dc = "TLD", wc = "UTLD", ca = "SCHEME", Ur = "SLASH_SCHEME", Cu = "NUM", Mc = "WS", yu = "NL", Ui = "OPENBRACE", Hi = "CLOSEBRACE", xa = "OPENBRACKET", Da = "CLOSEBRACKET", wa = "OPENPAREN", Ma = "CLOSEPAREN", La = "OPENANGLEBRACKET", ka = "CLOSEANGLEBRACKET", Pa = "FULLWIDTHLEFTPAREN", Fa = "FULLWIDTHRIGHTPAREN", Ba = "LEFTCORNERBRACKET", Ua = "RIGHTCORNERBRACKET", Ha = "LEFTWHITECORNERBRACKET", Ga = "RIGHTWHITECORNERBRACKET", Va = "FULLWIDTHLESSTHAN", Ya = "FULLWIDTHGREATERTHAN", $a = "AMPERSAND", vu = "APOSTROPHE", za = "ASTERISK", On = "AT", qa = "BACKSLASH", Wa = "BACKTICK", Ka = "CARET", xn = "COLON", Ru = "COMMA", Qa = "DOLLAR", Wt = "DOT", Za = "EQUALS", Ou = "EXCLAMATION", xt = "HYPHEN", Gi = "PERCENT", Xa = "PIPE", ja = "PLUS", Ja = "POUND", Vi = "QUERY", Nu = "QUOTE", jg = "FULLWIDTHMIDDLEDOT", Au = "SEMI", Kt = "SLASH", Yi = "TILDE", es = "UNDERSCORE", Jg = "EMOJI", ts = "SYM";
var eh = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  WORD: pn,
  UWORD: xc,
  ASCIINUMERICAL: Zg,
  ALPHANUMERICAL: Xg,
  LOCALHOST: io,
  TLD: Dc,
  UTLD: wc,
  SCHEME: ca,
  SLASH_SCHEME: Ur,
  NUM: Cu,
  WS: Mc,
  NL: yu,
  OPENBRACE: Ui,
  CLOSEBRACE: Hi,
  OPENBRACKET: xa,
  CLOSEBRACKET: Da,
  OPENPAREN: wa,
  CLOSEPAREN: Ma,
  OPENANGLEBRACKET: La,
  CLOSEANGLEBRACKET: ka,
  FULLWIDTHLEFTPAREN: Pa,
  FULLWIDTHRIGHTPAREN: Fa,
  LEFTCORNERBRACKET: Ba,
  RIGHTCORNERBRACKET: Ua,
  LEFTWHITECORNERBRACKET: Ha,
  RIGHTWHITECORNERBRACKET: Ga,
  FULLWIDTHLESSTHAN: Va,
  FULLWIDTHGREATERTHAN: Ya,
  AMPERSAND: $a,
  APOSTROPHE: vu,
  ASTERISK: za,
  AT: On,
  BACKSLASH: qa,
  BACKTICK: Wa,
  CARET: Ka,
  COLON: xn,
  COMMA: Ru,
  DOLLAR: Qa,
  DOT: Wt,
  EQUALS: Za,
  EXCLAMATION: Ou,
  HYPHEN: xt,
  PERCENT: Gi,
  PIPE: Xa,
  PLUS: ja,
  POUND: Ja,
  QUERY: Vi,
  QUOTE: Nu,
  FULLWIDTHMIDDLEDOT: jg,
  SEMI: Au,
  SLASH: Kt,
  TILDE: Yi,
  UNDERSCORE: es,
  EMOJI: Jg,
  SYM: ts
});
const cn = /[a-z]/, Ci = new RegExp("\\p{L}", "u"), yl = new RegExp("\\p{Emoji}", "u"), un = /\d/, vl = /\s/, b_ = "\r", Rl = `
`, YN = "️", $N = "‍", Ol = "￼";
let $o = null, zo = null;
function zN(t = []) {
  const e = {};
  ft.groups = e;
  const n = new ft();
  $o == null && ($o = T_(FN)), zo == null && (zo = T_(BN)), F(n, "'", vu), F(n, "{", Ui), F(n, "}", Hi), F(n, "[", xa), F(n, "]", Da), F(n, "(", wa), F(n, ")", Ma), F(n, "<", La), F(n, ">", ka), F(n, "（", Pa), F(n, "）", Fa), F(n, "「", Ba), F(n, "」", Ua), F(n, "『", Ha), F(n, "』", Ga), F(n, "＜", Va), F(n, "＞", Ya), F(n, "&", $a), F(n, "*", za), F(n, "@", On), F(n, "`", Wa), F(n, "^", Ka), F(n, ":", xn), F(n, ",", Ru), F(n, "$", Qa), F(n, ".", Wt), F(n, "=", Za), F(n, "!", Ou), F(n, "-", xt), F(n, "%", Gi), F(n, "|", Xa), F(n, "+", ja), F(n, "#", Ja), F(n, "?", Vi), F(n, '"', Nu), F(n, "/", Kt), F(n, ";", Au), F(n, "~", Yi), F(n, "_", es), F(n, "\\", qa), F(n, "・", jg);
  const r = Le(n, un, Cu, {
    [Oc]: !0
  });
  Le(r, un, r);
  const i = Le(r, cn, Zg, {
    [Bi]: !0
  }), o = Le(r, Ci, Xg, {
    [Ii]: !0
  }), a = Le(n, cn, pn, {
    [Nc]: !0
  });
  Le(a, un, i), Le(a, cn, a), Le(i, un, i), Le(i, cn, i);
  const s = Le(n, Ci, xc, {
    [Ac]: !0
  });
  Le(s, cn), Le(s, un, o), Le(s, Ci, s), Le(o, un, o), Le(o, cn), Le(o, Ci, o);
  const l = F(n, Rl, yu, {
    [Cl]: !0
  }), c = F(n, b_, Mc, {
    [Cl]: !0
  }), u = Le(n, vl, Mc, {
    [Cl]: !0
  });
  F(n, Ol, u), F(c, Rl, l), F(c, Ol, u), Le(c, vl, u), F(u, b_), F(u, Rl), Le(u, vl, u), F(u, Ol, u);
  const d = Le(n, yl, Jg, {
    [Qg]: !0
  });
  F(d, "#"), Le(d, yl, d), F(d, YN, d);
  const p = F(d, $N);
  F(p, "#"), Le(p, yl, d);
  const _ = [[cn, a], [un, i]], m = [[cn, null], [Ci, s], [un, o]];
  for (let f = 0; f < $o.length; f++)
    Cn(n, $o[f], Dc, pn, _);
  for (let f = 0; f < zo.length; f++)
    Cn(n, zo[f], wc, xc, m);
  or(Dc, {
    tld: !0,
    ascii: !0
  }, e), or(wc, {
    utld: !0,
    alpha: !0
  }, e), Cn(n, "file", ca, pn, _), Cn(n, "mailto", ca, pn, _), Cn(n, "http", Ur, pn, _), Cn(n, "https", Ur, pn, _), Cn(n, "ftp", Ur, pn, _), Cn(n, "ftps", Ur, pn, _), or(ca, {
    scheme: !0,
    ascii: !0
  }, e), or(Ur, {
    slashscheme: !0,
    ascii: !0
  }, e), t = t.sort((f, g) => f[0] > g[0] ? 1 : -1);
  for (let f = 0; f < t.length; f++) {
    const g = t[f][0], E = t[f][1] ? {
      [UN]: !0
    } : {
      [HN]: !0
    };
    g.indexOf("-") >= 0 ? E[Ic] = !0 : cn.test(g) ? un.test(g) ? E[Bi] = !0 : E[Nc] = !0 : E[Oc] = !0, S_(n, g, g, E);
  }
  return S_(n, "localhost", io, {
    ascii: !0
  }), n.jd = new ft(ts), {
    start: n,
    tokens: oi({
      groups: e
    }, eh)
  };
}
function th(t, e) {
  const n = qN(e.replace(/[A-Z]/g, (s) => s.toLowerCase())), r = n.length, i = [];
  let o = 0, a = 0;
  for (; a < r; ) {
    let s = t, l = null, c = 0, u = null, d = -1, p = -1;
    for (; a < r && (l = s.go(n[a])); )
      s = l, s.accepts() ? (d = 0, p = 0, u = s) : d >= 0 && (d += n[a].length, p++), c += n[a].length, o += n[a].length, a++;
    o -= d, a -= p, c -= d, i.push({
      t: u.t,
      // token type/name
      v: e.slice(o - c, o),
      // string value
      s: o - c,
      // start index
      e: o
      // end index (excluding)
    });
  }
  return i;
}
function qN(t) {
  const e = [], n = t.length;
  let r = 0;
  for (; r < n; ) {
    let i = t.charCodeAt(r), o, a = i < 55296 || i > 56319 || r + 1 === n || (o = t.charCodeAt(r + 1)) < 56320 || o > 57343 ? t[r] : t.slice(r, r + 2);
    e.push(a), r += a.length;
  }
  return e;
}
function Cn(t, e, n, r, i) {
  let o;
  const a = e.length;
  for (let s = 0; s < a - 1; s++) {
    const l = e[s];
    t.j[l] ? o = t.j[l] : (o = new ft(r), o.jr = i.slice(), t.j[l] = o), t = o;
  }
  return o = new ft(n), o.jr = i.slice(), t.j[e[a - 1]] = o, o;
}
function T_(t) {
  const e = [], n = [];
  let r = 0, i = "0123456789";
  for (; r < t.length; ) {
    let o = 0;
    for (; i.indexOf(t[r + o]) >= 0; )
      o++;
    if (o > 0) {
      e.push(n.join(""));
      for (let a = parseInt(t.substring(r, r + o), 10); a > 0; a--)
        n.pop();
      r += o;
    } else
      n.push(t[r]), r++;
  }
  return e;
}
const oo = {
  defaultProtocol: "http",
  events: null,
  format: C_,
  formatHref: C_,
  nl2br: !1,
  tagName: "a",
  target: null,
  rel: null,
  validate: !0,
  truncate: 1 / 0,
  className: null,
  attributes: null,
  ignoreTags: [],
  render: null
};
function Iu(t, e = null) {
  let n = oi({}, oo);
  t && (n = oi(n, t instanceof Iu ? t.o : t));
  const r = n.ignoreTags, i = [];
  for (let o = 0; o < r.length; o++)
    i.push(r[o].toUpperCase());
  this.o = n, e && (this.defaultRender = e), this.ignoreTags = i;
}
Iu.prototype = {
  o: oo,
  /**
   * @type string[]
   */
  ignoreTags: [],
  /**
   * @param {IntermediateRepresentation} ir
   * @returns {any}
   */
  defaultRender(t) {
    return t;
  },
  /**
   * Returns true or false based on whether a token should be displayed as a
   * link based on the user options.
   * @param {MultiToken} token
   * @returns {boolean}
   */
  check(t) {
    return this.get("validate", t.toString(), t);
  },
  // Private methods
  /**
   * Resolve an option's value based on the value of the option and the given
   * params. If operator and token are specified and the target option is
   * callable, automatically calls the function with the given argument.
   * @template {keyof Opts} K
   * @param {K} key Name of option to use
   * @param {string} [operator] will be passed to the target option if it's a
   * function. If not specified, RAW function value gets returned
   * @param {MultiToken} [token] The token from linkify.tokenize
   * @returns {Opts[K] | any}
   */
  get(t, e, n) {
    const r = e != null;
    let i = this.o[t];
    return i && (typeof i == "object" ? (i = n.t in i ? i[n.t] : oo[t], typeof i == "function" && r && (i = i(e, n))) : typeof i == "function" && r && (i = i(e, n.t, n)), i);
  },
  /**
   * @template {keyof Opts} L
   * @param {L} key Name of options object to use
   * @param {string} [operator]
   * @param {MultiToken} [token]
   * @returns {Opts[L] | any}
   */
  getObj(t, e, n) {
    let r = this.o[t];
    return typeof r == "function" && e != null && (r = r(e, n.t, n)), r;
  },
  /**
   * Convert the given token to a rendered element that may be added to the
   * calling-interface's DOM
   * @param {MultiToken} token Token to render to an HTML element
   * @returns {any} Render result; e.g., HTML string, DOM element, React
   *   Component, etc.
   */
  render(t) {
    const e = t.render(this);
    return (this.get("render", null, t) || this.defaultRender)(e, t.t, t);
  }
};
function C_(t) {
  return t;
}
function nh(t, e) {
  this.t = "token", this.v = t, this.tk = e;
}
nh.prototype = {
  isLink: !1,
  /**
   * Return the string this token represents.
   * @return {string}
   */
  toString() {
    return this.v;
  },
  /**
   * What should the value for this token be in the `href` HTML attribute?
   * Returns the `.toString` value by default.
   * @param {string} [scheme]
   * @return {string}
   */
  toHref(t) {
    return this.toString();
  },
  /**
   * @param {Options} options Formatting options
   * @returns {string}
   */
  toFormattedString(t) {
    const e = this.toString(), n = t.get("truncate", e, this), r = t.get("format", e, this);
    return n && r.length > n ? r.substring(0, n) + "…" : r;
  },
  /**
   *
   * @param {Options} options
   * @returns {string}
   */
  toFormattedHref(t) {
    return t.get("formatHref", this.toHref(t.get("defaultProtocol")), this);
  },
  /**
   * The start index of this token in the original input string
   * @returns {number}
   */
  startIndex() {
    return this.tk[0].s;
  },
  /**
   * The end index of this token in the original input string (up to this
   * index but not including it)
   * @returns {number}
   */
  endIndex() {
    return this.tk[this.tk.length - 1].e;
  },
  /**
  	Returns an object  of relevant values for this token, which includes keys
  	* type - Kind of token ('url', 'email', etc.)
  	* value - Original text
  	* href - The value that should be added to the anchor tag's href
  		attribute
  		@method toObject
  	@param {string} [protocol] `'http'` by default
  */
  toObject(t = oo.defaultProtocol) {
    return {
      type: this.t,
      value: this.toString(),
      isLink: this.isLink,
      href: this.toHref(t),
      start: this.startIndex(),
      end: this.endIndex()
    };
  },
  /**
   *
   * @param {Options} options Formatting option
   */
  toFormattedObject(t) {
    return {
      type: this.t,
      value: this.toFormattedString(t),
      isLink: this.isLink,
      href: this.toFormattedHref(t),
      start: this.startIndex(),
      end: this.endIndex()
    };
  },
  /**
   * Whether this token should be rendered as a link according to the given options
   * @param {Options} options
   * @returns {boolean}
   */
  validate(t) {
    return t.get("validate", this.toString(), this);
  },
  /**
   * Return an object that represents how this link should be rendered.
   * @param {Options} options Formattinng options
   */
  render(t) {
    const e = this, n = this.toHref(t.get("defaultProtocol")), r = t.get("formatHref", n, this), i = t.get("tagName", n, e), o = this.toFormattedString(t), a = {}, s = t.get("className", n, e), l = t.get("target", n, e), c = t.get("rel", n, e), u = t.getObj("attributes", n, e), d = t.getObj("events", n, e);
    return a.href = r, s && (a.class = s), l && (a.target = l), c && (a.rel = c), u && oi(a, u), {
      tagName: i,
      attributes: a,
      content: o,
      eventListeners: d
    };
  }
};
function ks(t, e) {
  class n extends nh {
    constructor(i, o) {
      super(i, o), this.t = t;
    }
  }
  for (const r in e)
    n.prototype[r] = e[r];
  return n.t = t, n;
}
const y_ = ks("email", {
  isLink: !0,
  toHref() {
    return "mailto:" + this.toString();
  }
}), v_ = ks("text"), WN = ks("nl"), qo = ks("url", {
  isLink: !0,
  /**
  	Lowercases relevant parts of the domain and adds the protocol if
  	required. Note that this will not escape unsafe HTML characters in the
  	URL.
  		@param {string} [scheme] default scheme (e.g., 'https')
  	@return {string} the full href
  */
  toHref(t = oo.defaultProtocol) {
    return this.hasProtocol() ? this.v : `${t}://${this.v}`;
  },
  /**
   * Check whether this URL token has a protocol
   * @return {boolean}
   */
  hasProtocol() {
    const t = this.tk;
    return t.length >= 2 && t[0].t !== io && t[1].t === xn;
  }
}), It = (t) => new ft(t);
function KN({
  groups: t
}) {
  const e = t.domain.concat([$a, za, On, qa, Wa, Ka, Qa, Za, xt, Cu, Gi, Xa, ja, Ja, Kt, ts, Yi, es]), n = [xn, Ru, Wt, Ou, Gi, Vi, Nu, Au, La, ka, Ui, Hi, Da, xa, wa, Ma, Pa, Fa, Ba, Ua, Ha, Ga, Va, Ya], r = [$a, vu, za, qa, Wa, Ka, Qa, Za, xt, Ui, Hi, Gi, Xa, ja, Ja, Vi, Kt, ts, Yi, es], i = It(), o = F(i, Yi);
  ue(o, r, o), ue(o, t.domain, o);
  const a = It(), s = It(), l = It();
  ue(i, t.domain, a), ue(i, t.scheme, s), ue(i, t.slashscheme, l), ue(a, r, o), ue(a, t.domain, a);
  const c = F(a, On);
  F(o, On, c), F(s, On, c), F(l, On, c);
  const u = F(o, Wt);
  ue(u, r, o), ue(u, t.domain, o);
  const d = It();
  ue(c, t.domain, d), ue(d, t.domain, d);
  const p = F(d, Wt);
  ue(p, t.domain, d);
  const _ = It(y_);
  ue(p, t.tld, _), ue(p, t.utld, _), F(c, io, _);
  const m = F(d, xt);
  F(m, xt, m), ue(m, t.domain, d), ue(_, t.domain, d), F(_, Wt, p), F(_, xt, m);
  const f = F(_, xn);
  ue(f, t.numeric, y_);
  const g = F(a, xt), S = F(a, Wt);
  F(g, xt, g), ue(g, t.domain, a), ue(S, r, o), ue(S, t.domain, a);
  const E = It(qo);
  ue(S, t.tld, E), ue(S, t.utld, E), ue(E, t.domain, a), ue(E, r, o), F(E, Wt, S), F(E, xt, g), F(E, On, c);
  const b = F(E, xn), h = It(qo);
  ue(b, t.numeric, h);
  const T = It(qo), C = It();
  ue(T, e, T), ue(T, n, C), ue(C, e, T), ue(C, n, C), F(E, Kt, T), F(h, Kt, T);
  const v = F(s, xn), I = F(l, xn), N = F(I, Kt), x = F(N, Kt);
  ue(s, t.domain, a), F(s, Wt, S), F(s, xt, g), ue(l, t.domain, a), F(l, Wt, S), F(l, xt, g), ue(v, t.domain, T), F(v, Kt, T), F(v, Vi, T), ue(x, t.domain, T), ue(x, e, T), F(x, Kt, T);
  const P = [
    [Ui, Hi],
    // {}
    [xa, Da],
    // []
    [wa, Ma],
    // ()
    [La, ka],
    // <>
    [Pa, Fa],
    // （）
    [Ba, Ua],
    // 「」
    [Ha, Ga],
    // 『』
    [Va, Ya]
    // ＜＞
  ];
  for (let Y = 0; Y < P.length; Y++) {
    const [Z, q] = P[Y], V = F(T, Z);
    F(C, Z, V), F(V, q, T);
    const O = It(qo);
    ue(V, e, O);
    const y = It();
    ue(V, n), ue(O, e, O), ue(O, n, y), ue(y, e, O), ue(y, n, y), F(O, q, T), F(y, q, T);
  }
  return F(i, io, E), F(i, yu, WN), {
    start: i,
    tokens: eh
  };
}
function QN(t, e, n) {
  let r = n.length, i = 0, o = [], a = [];
  for (; i < r; ) {
    let s = t, l = null, c = null, u = 0, d = null, p = -1;
    for (; i < r && !(l = s.go(n[i].t)); )
      a.push(n[i++]);
    for (; i < r && (c = l || s.go(n[i].t)); )
      l = null, s = c, s.accepts() ? (p = 0, d = s) : p >= 0 && p++, i++, u++;
    if (p < 0)
      i -= u, i < r && (a.push(n[i]), i++);
    else {
      a.length > 0 && (o.push(Nl(v_, e, a)), a = []), i -= p, u -= p;
      const _ = d.t, m = n.slice(i - u, i);
      o.push(Nl(_, e, m));
    }
  }
  return a.length > 0 && o.push(Nl(v_, e, a)), o;
}
function Nl(t, e, n) {
  const r = n[0].s, i = n[n.length - 1].e, o = e.slice(r, i);
  return new t(o, n);
}
const ZN = typeof console < "u" && console && console.warn || (() => {
}), XN = "until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.", Ie = {
  scanner: null,
  parser: null,
  tokenQueue: [],
  pluginQueue: [],
  customSchemes: [],
  initialized: !1
};
function jN() {
  return ft.groups = {}, Ie.scanner = null, Ie.parser = null, Ie.tokenQueue = [], Ie.pluginQueue = [], Ie.customSchemes = [], Ie.initialized = !1, Ie;
}
function R_(t, e = !1) {
  if (Ie.initialized && ZN(`linkifyjs: already initialized - will not register custom scheme "${t}" ${XN}`), !/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))
    throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);
  Ie.customSchemes.push([t, e]);
}
function JN() {
  Ie.scanner = zN(Ie.customSchemes);
  for (let t = 0; t < Ie.tokenQueue.length; t++)
    Ie.tokenQueue[t][1]({
      scanner: Ie.scanner
    });
  Ie.parser = KN(Ie.scanner.tokens);
  for (let t = 0; t < Ie.pluginQueue.length; t++)
    Ie.pluginQueue[t][1]({
      scanner: Ie.scanner,
      parser: Ie.parser
    });
  return Ie.initialized = !0, Ie;
}
function xu(t) {
  return Ie.initialized || JN(), QN(Ie.parser.start, t, th(Ie.scanner.start, t));
}
xu.scan = th;
function rh(t, e = null, n = null) {
  if (e && typeof e == "object") {
    if (n)
      throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);
    n = e, e = null;
  }
  const r = new Iu(n), i = xu(t), o = [];
  for (let a = 0; a < i.length; a++) {
    const s = i[a];
    s.isLink && (!e || s.t === e) && r.check(s) && o.push(s.toFormattedObject(r));
  }
  return o;
}
function eA(t) {
  return t.length === 1 ? t[0].isLink : t.length === 3 && t[1].isLink ? ["()", "[]"].includes(t[0].value + t[2].value) : !1;
}
function tA(t) {
  return new Te({
    key: new Oe("autolink"),
    appendTransaction: (e, n, r) => {
      const i = e.some((c) => c.docChanged) && !n.doc.eq(r.doc), o = e.some((c) => c.getMeta("preventAutolink"));
      if (!i || o)
        return;
      const { tr: a } = r, s = aC(n.doc, [...e]);
      if (_C(s).forEach(({ newRange: c }) => {
        const u = lC(r.doc, c, (_) => _.isTextblock);
        let d, p;
        if (u.length > 1 ? (d = u[0], p = r.doc.textBetween(d.pos, d.pos + d.node.nodeSize, void 0, " ")) : u.length && r.doc.textBetween(c.from, c.to, " ", " ").endsWith(" ") && (d = u[0], p = r.doc.textBetween(d.pos, c.to, void 0, " ")), d && p) {
          const _ = p.split(" ").filter((S) => S !== "");
          if (_.length <= 0)
            return !1;
          const m = _[_.length - 1], f = d.pos + p.lastIndexOf(m);
          if (!m)
            return !1;
          const g = xu(m).map((S) => S.toObject(t.defaultProtocol));
          if (!eA(g))
            return !1;
          g.filter((S) => S.isLink).map((S) => ({
            ...S,
            from: f + S.start + 1,
            to: f + S.end + 1
          })).filter((S) => r.schema.marks.code ? !r.doc.rangeHasMark(S.from, S.to, r.schema.marks.code) : !0).filter((S) => t.validate(S.value)).filter((S) => t.shouldAutoLink(S.value)).forEach((S) => {
            lu(S.from, S.to, r.doc).some((E) => E.mark.type === t.type) || a.addMark(S.from, S.to, t.type.create({
              href: S.href
            }));
          });
        }
      }), !!a.steps.length)
        return a;
    }
  });
}
function nA(t) {
  return new Te({
    key: new Oe("handleClickLink"),
    props: {
      handleClick: (e, n, r) => {
        var i, o;
        if (r.button !== 0 || !e.editable)
          return !1;
        let a = r.target;
        const s = [];
        for (; a.nodeName !== "DIV"; )
          s.push(a), a = a.parentNode;
        if (!s.find((p) => p.nodeName === "A"))
          return !1;
        const l = Jf(e.state, t.type.name), c = r.target, u = (i = c == null ? void 0 : c.href) !== null && i !== void 0 ? i : l.href, d = (o = c == null ? void 0 : c.target) !== null && o !== void 0 ? o : l.target;
        return c && u ? (window.open(u, d), !0) : !1;
      }
    }
  });
}
function rA(t) {
  return new Te({
    key: new Oe("handlePasteLink"),
    props: {
      handlePaste: (e, n, r) => {
        const { state: i } = e, { selection: o } = i, { empty: a } = o;
        if (a)
          return !1;
        let s = "";
        r.content.forEach((c) => {
          s += c.textContent;
        });
        const l = rh(s, { defaultProtocol: t.defaultProtocol }).find((c) => c.isLink && c.value === s);
        return !s || !l ? !1 : t.editor.commands.setMark(t.type, {
          href: l.href
        });
      }
    }
  });
}
const iA = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;
function jn(t, e) {
  const n = [
    "http",
    "https",
    "ftp",
    "ftps",
    "mailto",
    "tel",
    "callto",
    "sms",
    "cid",
    "xmpp"
  ];
  return e && e.forEach((r) => {
    const i = typeof r == "string" ? r : r.scheme;
    i && n.push(i);
  }), !t || t.replace(iA, "").match(new RegExp(
    // eslint-disable-next-line no-useless-escape
    `^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,
    "i"
  ));
}
const oA = St.create({
  name: "link",
  priority: 1e3,
  keepOnSplit: !1,
  exitable: !0,
  onCreate() {
    this.options.validate && !this.options.shouldAutoLink && (this.options.shouldAutoLink = this.options.validate, console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")), this.options.protocols.forEach((t) => {
      if (typeof t == "string") {
        R_(t);
        return;
      }
      R_(t.scheme, t.optionalSlashes);
    });
  },
  onDestroy() {
    jN();
  },
  inclusive() {
    return this.options.autolink;
  },
  addOptions() {
    return {
      openOnClick: !0,
      linkOnPaste: !0,
      autolink: !0,
      protocols: [],
      defaultProtocol: "http",
      HTMLAttributes: {
        target: "_blank",
        rel: "noopener noreferrer nofollow",
        class: null
      },
      isAllowedUri: (t, e) => !!jn(t, e.protocols),
      validate: (t) => !!t,
      shouldAutoLink: (t) => !!t
    };
  },
  addAttributes() {
    return {
      href: {
        default: null,
        parseHTML(t) {
          return t.getAttribute("href");
        }
      },
      target: {
        default: this.options.HTMLAttributes.target
      },
      rel: {
        default: this.options.HTMLAttributes.rel
      },
      class: {
        default: this.options.HTMLAttributes.class
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: "a[href]",
        getAttrs: (t) => {
          const e = t.getAttribute("href");
          return !e || !this.options.isAllowedUri(e, {
            defaultValidate: (n) => !!jn(n, this.options.protocols),
            protocols: this.options.protocols,
            defaultProtocol: this.options.defaultProtocol
          }) ? !1 : null;
        }
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return this.options.isAllowedUri(t.href, {
      defaultValidate: (e) => !!jn(e, this.options.protocols),
      protocols: this.options.protocols,
      defaultProtocol: this.options.defaultProtocol
    }) ? ["a", me(this.options.HTMLAttributes, t), 0] : [
      "a",
      me(this.options.HTMLAttributes, { ...t, href: "" }),
      0
    ];
  },
  addCommands() {
    return {
      setLink: (t) => ({ chain: e }) => {
        const { href: n } = t;
        return this.options.isAllowedUri(n, {
          defaultValidate: (r) => !!jn(r, this.options.protocols),
          protocols: this.options.protocols,
          defaultProtocol: this.options.defaultProtocol
        }) ? e().setMark(this.name, t).setMeta("preventAutolink", !0).run() : !1;
      },
      toggleLink: (t) => ({ chain: e }) => {
        const { href: n } = t;
        return this.options.isAllowedUri(n, {
          defaultValidate: (r) => !!jn(r, this.options.protocols),
          protocols: this.options.protocols,
          defaultProtocol: this.options.defaultProtocol
        }) ? e().toggleMark(this.name, t, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run() : !1;
      },
      unsetLink: () => ({ chain: t }) => t().unsetMark(this.name, { extendEmptyMarkRange: !0 }).setMeta("preventAutolink", !0).run()
    };
  },
  addPasteRules() {
    return [
      $n({
        find: (t) => {
          const e = [];
          if (t) {
            const { protocols: n, defaultProtocol: r } = this.options, i = rh(t).filter((o) => o.isLink && this.options.isAllowedUri(o.value, {
              defaultValidate: (a) => !!jn(a, n),
              protocols: n,
              defaultProtocol: r
            }));
            i.length && i.forEach((o) => e.push({
              text: o.value,
              data: {
                href: o.href
              },
              index: o.start
            }));
          }
          return e;
        },
        type: this.type,
        getAttributes: (t) => {
          var e;
          return {
            href: (e = t.data) === null || e === void 0 ? void 0 : e.href
          };
        }
      })
    ];
  },
  addProseMirrorPlugins() {
    const t = [], { protocols: e, defaultProtocol: n } = this.options;
    return this.options.autolink && t.push(tA({
      type: this.type,
      defaultProtocol: this.options.defaultProtocol,
      validate: (r) => this.options.isAllowedUri(r, {
        defaultValidate: (i) => !!jn(i, e),
        protocols: e,
        defaultProtocol: n
      }),
      shouldAutoLink: this.options.shouldAutoLink
    })), this.options.openOnClick === !0 && t.push(nA({
      type: this.type
    })), this.options.linkOnPaste && t.push(rA({
      editor: this.editor,
      defaultProtocol: this.options.defaultProtocol,
      type: this.type
    })), t;
  }
}), aA = St.create({
  name: "superscript",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  parseHTML() {
    return [
      {
        tag: "sup"
      },
      {
        style: "vertical-align",
        getAttrs(t) {
          return t !== "super" ? !1 : null;
        }
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["sup", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setSuperscript: () => ({ commands: t }) => t.setMark(this.name),
      toggleSuperscript: () => ({ commands: t }) => t.toggleMark(this.name),
      unsetSuperscript: () => ({ commands: t }) => t.unsetMark(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-.": () => this.editor.commands.toggleSuperscript()
    };
  }
}), sA = St.create({
  name: "subscript",
  addOptions() {
    return {
      HTMLAttributes: {}
    };
  },
  parseHTML() {
    return [
      {
        tag: "sub"
      },
      {
        style: "vertical-align",
        getAttrs(t) {
          return t !== "sub" ? !1 : null;
        }
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["sub", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setSubscript: () => ({ commands: t }) => t.setMark(this.name),
      toggleSubscript: () => ({ commands: t }) => t.toggleMark(this.name),
      unsetSubscript: () => ({ commands: t }) => t.unsetMark(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-,": () => this.editor.commands.toggleSubscript()
    };
  }
}), lA = xe.create({
  name: "taskList",
  addOptions() {
    return {
      itemTypeName: "taskItem",
      HTMLAttributes: {}
    };
  },
  group: "block list",
  content() {
    return `${this.options.itemTypeName}+`;
  },
  parseHTML() {
    return [
      {
        tag: `ul[data-type="${this.name}"]`,
        priority: 51
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["ul", me(this.options.HTMLAttributes, t, { "data-type": this.name }), 0];
  },
  addCommands() {
    return {
      toggleTaskList: () => ({ commands: t }) => t.toggleList(this.name, this.options.itemTypeName)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-9": () => this.editor.commands.toggleTaskList()
    };
  }
}), cA = /^\s*(\[([( |x])?\])\s$/, uA = xe.create({
  name: "taskItem",
  addOptions() {
    return {
      nested: !1,
      HTMLAttributes: {},
      taskListTypeName: "taskList"
    };
  },
  content() {
    return this.options.nested ? "paragraph block*" : "paragraph+";
  },
  defining: !0,
  addAttributes() {
    return {
      checked: {
        default: !1,
        keepOnSplit: !1,
        parseHTML: (t) => {
          const e = t.getAttribute("data-checked");
          return e === "" || e === "true";
        },
        renderHTML: (t) => ({
          "data-checked": t.checked
        })
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: `li[data-type="${this.name}"]`,
        priority: 51
      }
    ];
  },
  renderHTML({ node: t, HTMLAttributes: e }) {
    return [
      "li",
      me(this.options.HTMLAttributes, e, {
        "data-type": this.name
      }),
      [
        "label",
        [
          "input",
          {
            type: "checkbox",
            checked: t.attrs.checked ? "checked" : null
          }
        ],
        ["span"]
      ],
      ["div", 0]
    ];
  },
  addKeyboardShortcuts() {
    const t = {
      Enter: () => this.editor.commands.splitListItem(this.name),
      "Shift-Tab": () => this.editor.commands.liftListItem(this.name)
    };
    return this.options.nested ? {
      ...t,
      Tab: () => this.editor.commands.sinkListItem(this.name)
    } : t;
  },
  addNodeView() {
    return ({ node: t, HTMLAttributes: e, getPos: n, editor: r }) => {
      const i = document.createElement("li"), o = document.createElement("label"), a = document.createElement("span"), s = document.createElement("input"), l = document.createElement("div");
      return o.contentEditable = "false", s.type = "checkbox", s.addEventListener("mousedown", (c) => c.preventDefault()), s.addEventListener("change", (c) => {
        if (!r.isEditable && !this.options.onReadOnlyChecked) {
          s.checked = !s.checked;
          return;
        }
        const { checked: u } = c.target;
        r.isEditable && typeof n == "function" && r.chain().focus(void 0, { scrollIntoView: !1 }).command(({ tr: d }) => {
          const p = n();
          if (typeof p != "number")
            return !1;
          const _ = d.doc.nodeAt(p);
          return d.setNodeMarkup(p, void 0, {
            ..._ == null ? void 0 : _.attrs,
            checked: u
          }), !0;
        }).run(), !r.isEditable && this.options.onReadOnlyChecked && (this.options.onReadOnlyChecked(t, u) || (s.checked = !s.checked));
      }), Object.entries(this.options.HTMLAttributes).forEach(([c, u]) => {
        i.setAttribute(c, u);
      }), i.dataset.checked = t.attrs.checked, s.checked = t.attrs.checked, o.append(s, a), i.append(o, l), Object.entries(e).forEach(([c, u]) => {
        i.setAttribute(c, u);
      }), {
        dom: i,
        contentDOM: l,
        update: (c) => c.type !== this.type ? !1 : (i.dataset.checked = c.attrs.checked, s.checked = c.attrs.checked, !0)
      };
    };
  },
  addInputRules() {
    return [
      Sr({
        find: cA,
        type: this.type,
        getAttributes: (t) => ({
          checked: t[t.length - 1] === "x"
        })
      })
    ];
  }
});
function dA(t) {
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
}
function ih(t) {
  return t instanceof Map ? t.clear = t.delete = t.set = function() {
    throw new Error("map is read-only");
  } : t instanceof Set && (t.add = t.clear = t.delete = function() {
    throw new Error("set is read-only");
  }), Object.freeze(t), Object.getOwnPropertyNames(t).forEach((e) => {
    const n = t[e], r = typeof n;
    (r === "object" || r === "function") && !Object.isFrozen(n) && ih(n);
  }), t;
}
let O_ = class {
  /**
   * @param {CompiledMode} mode
   */
  constructor(e) {
    e.data === void 0 && (e.data = {}), this.data = e.data, this.isMatchIgnored = !1;
  }
  ignoreMatch() {
    this.isMatchIgnored = !0;
  }
};
function oh(t) {
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
}
function Pn(t, ...e) {
  const n = /* @__PURE__ */ Object.create(null);
  for (const r in t)
    n[r] = t[r];
  return e.forEach(function(r) {
    for (const i in r)
      n[i] = r[i];
  }), /** @type {T} */
  n;
}
const pA = "</span>", N_ = (t) => !!t.scope, _A = (t, { prefix: e }) => {
  if (t.startsWith("language:"))
    return t.replace("language:", "language-");
  if (t.includes(".")) {
    const n = t.split(".");
    return [
      `${e}${n.shift()}`,
      ...n.map((r, i) => `${r}${"_".repeat(i + 1)}`)
    ].join(" ");
  }
  return `${e}${t}`;
};
let mA = class {
  /**
   * Creates a new HTMLRenderer
   *
   * @param {Tree} parseTree - the parse tree (must support `walk` API)
   * @param {{classPrefix: string}} options
   */
  constructor(e, n) {
    this.buffer = "", this.classPrefix = n.classPrefix, e.walk(this);
  }
  /**
   * Adds texts to the output stream
   *
   * @param {string} text */
  addText(e) {
    this.buffer += oh(e);
  }
  /**
   * Adds a node open to the output stream (if needed)
   *
   * @param {Node} node */
  openNode(e) {
    if (!N_(e)) return;
    const n = _A(
      e.scope,
      { prefix: this.classPrefix }
    );
    this.span(n);
  }
  /**
   * Adds a node close to the output stream (if needed)
   *
   * @param {Node} node */
  closeNode(e) {
    N_(e) && (this.buffer += pA);
  }
  /**
   * returns the accumulated buffer
  */
  value() {
    return this.buffer;
  }
  // helpers
  /**
   * Builds a span element
   *
   * @param {string} className */
  span(e) {
    this.buffer += `<span class="${e}">`;
  }
};
const A_ = (t = {}) => {
  const e = { children: [] };
  return Object.assign(e, t), e;
};
let fA = class ah {
  constructor() {
    this.rootNode = A_(), this.stack = [this.rootNode];
  }
  get top() {
    return this.stack[this.stack.length - 1];
  }
  get root() {
    return this.rootNode;
  }
  /** @param {Node} node */
  add(e) {
    this.top.children.push(e);
  }
  /** @param {string} scope */
  openNode(e) {
    const n = A_({ scope: e });
    this.add(n), this.stack.push(n);
  }
  closeNode() {
    if (this.stack.length > 1)
      return this.stack.pop();
  }
  closeAllNodes() {
    for (; this.closeNode(); ) ;
  }
  toJSON() {
    return JSON.stringify(this.rootNode, null, 4);
  }
  /**
   * @typedef { import("./html_renderer").Renderer } Renderer
   * @param {Renderer} builder
   */
  walk(e) {
    return this.constructor._walk(e, this.rootNode);
  }
  /**
   * @param {Renderer} builder
   * @param {Node} node
   */
  static _walk(e, n) {
    return typeof n == "string" ? e.addText(n) : n.children && (e.openNode(n), n.children.forEach((r) => this._walk(e, r)), e.closeNode(n)), e;
  }
  /**
   * @param {Node} node
   */
  static _collapse(e) {
    typeof e != "string" && e.children && (e.children.every((n) => typeof n == "string") ? e.children = [e.children.join("")] : e.children.forEach((n) => {
      ah._collapse(n);
    }));
  }
}, gA = class extends fA {
  /**
   * @param {*} options
   */
  constructor(e) {
    super(), this.options = e;
  }
  /**
   * @param {string} text
   */
  addText(e) {
    e !== "" && this.add(e);
  }
  /** @param {string} scope */
  startScope(e) {
    this.openNode(e);
  }
  endScope() {
    this.closeNode();
  }
  /**
   * @param {Emitter & {root: DataNode}} emitter
   * @param {string} name
   */
  __addSublanguage(e, n) {
    const r = e.root;
    n && (r.scope = `language:${n}`), this.add(r);
  }
  toHTML() {
    return new mA(this, this.options).value();
  }
  finalize() {
    return this.closeAllNodes(), !0;
  }
};
function ao(t) {
  return t ? typeof t == "string" ? t : t.source : null;
}
function sh(t) {
  return yr("(?=", t, ")");
}
function hA(t) {
  return yr("(?:", t, ")*");
}
function EA(t) {
  return yr("(?:", t, ")?");
}
function yr(...t) {
  return t.map((n) => ao(n)).join("");
}
function SA(t) {
  const e = t[t.length - 1];
  return typeof e == "object" && e.constructor === Object ? (t.splice(t.length - 1, 1), e) : {};
}
function Du(...t) {
  return "(" + (SA(t).capture ? "" : "?:") + t.map((r) => ao(r)).join("|") + ")";
}
function lh(t) {
  return new RegExp(t.toString() + "|").exec("").length - 1;
}
function bA(t, e) {
  const n = t && t.exec(e);
  return n && n.index === 0;
}
const TA = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
function wu(t, { joinWith: e }) {
  let n = 0;
  return t.map((r) => {
    n += 1;
    const i = n;
    let o = ao(r), a = "";
    for (; o.length > 0; ) {
      const s = TA.exec(o);
      if (!s) {
        a += o;
        break;
      }
      a += o.substring(0, s.index), o = o.substring(s.index + s[0].length), s[0][0] === "\\" && s[1] ? a += "\\" + String(Number(s[1]) + i) : (a += s[0], s[0] === "(" && n++);
    }
    return a;
  }).map((r) => `(${r})`).join(e);
}
const CA = /\b\B/, ch = "[a-zA-Z]\\w*", Mu = "[a-zA-Z_]\\w*", uh = "\\b\\d+(\\.\\d+)?", dh = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", ph = "\\b(0b[01]+)", yA = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", vA = (t = {}) => {
  const e = /^#![ ]*\//;
  return t.binary && (t.begin = yr(
    e,
    /.*\b/,
    t.binary,
    /\b.*/
  )), Pn({
    scope: "meta",
    begin: e,
    end: /$/,
    relevance: 0,
    /** @type {ModeCallback} */
    "on:begin": (n, r) => {
      n.index !== 0 && r.ignoreMatch();
    }
  }, t);
}, so = {
  begin: "\\\\[\\s\\S]",
  relevance: 0
}, RA = {
  scope: "string",
  begin: "'",
  end: "'",
  illegal: "\\n",
  contains: [so]
}, OA = {
  scope: "string",
  begin: '"',
  end: '"',
  illegal: "\\n",
  contains: [so]
}, NA = {
  begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
}, Ps = function(t, e, n = {}) {
  const r = Pn(
    {
      scope: "comment",
      begin: t,
      end: e,
      contains: []
    },
    n
  );
  r.contains.push({
    scope: "doctag",
    // hack to avoid the space from being included. the space is necessary to
    // match here to prevent the plain text rule below from gobbling up doctags
    begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
    end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
    excludeBegin: !0,
    relevance: 0
  });
  const i = Du(
    // list of common 1 and 2 letter words in English
    "I",
    "a",
    "is",
    "so",
    "us",
    "to",
    "at",
    "if",
    "in",
    "it",
    "on",
    // note: this is not an exhaustive list of contractions, just popular ones
    /[A-Za-z]+['](d|ve|re|ll|t|s|n)/,
    // contractions - can't we'd they're let's, etc
    /[A-Za-z]+[-][a-z]+/,
    // `no-way`, etc.
    /[A-Za-z][a-z]{2,}/
    // allow capitalized words at beginning of sentences
  );
  return r.contains.push(
    {
      // TODO: how to include ", (, ) without breaking grammars that use these for
      // comment delimiters?
      // begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/
      // ---
      // this tries to find sequences of 3 english words in a row (without any
      // "programming" type syntax) this gives us a strong signal that we've
      // TRULY found a comment - vs perhaps scanning with the wrong language.
      // It's possible to find something that LOOKS like the start of the
      // comment - but then if there is no readable text - good chance it is a
      // false match and not a comment.
      //
      // for a visual example please see:
      // https://github.com/highlightjs/highlight.js/issues/2827
      begin: yr(
        /[ ]+/,
        // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
        "(",
        i,
        /[.]?[:]?([.][ ]|[ ])/,
        "){3}"
      )
      // look for 3 words in a row
    }
  ), r;
}, AA = Ps("//", "$"), IA = Ps("/\\*", "\\*/"), xA = Ps("#", "$"), DA = {
  scope: "number",
  begin: uh,
  relevance: 0
}, wA = {
  scope: "number",
  begin: dh,
  relevance: 0
}, MA = {
  scope: "number",
  begin: ph,
  relevance: 0
}, LA = {
  scope: "regexp",
  begin: /\/(?=[^/\n]*\/)/,
  end: /\/[gimuy]*/,
  contains: [
    so,
    {
      begin: /\[/,
      end: /\]/,
      relevance: 0,
      contains: [so]
    }
  ]
}, kA = {
  scope: "title",
  begin: ch,
  relevance: 0
}, PA = {
  scope: "title",
  begin: Mu,
  relevance: 0
}, FA = {
  // excludes method names from keyword processing
  begin: "\\.\\s*" + Mu,
  relevance: 0
}, BA = function(t) {
  return Object.assign(
    t,
    {
      /** @type {ModeCallback} */
      "on:begin": (e, n) => {
        n.data._beginMatch = e[1];
      },
      /** @type {ModeCallback} */
      "on:end": (e, n) => {
        n.data._beginMatch !== e[1] && n.ignoreMatch();
      }
    }
  );
};
var Wo = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  APOS_STRING_MODE: RA,
  BACKSLASH_ESCAPE: so,
  BINARY_NUMBER_MODE: MA,
  BINARY_NUMBER_RE: ph,
  COMMENT: Ps,
  C_BLOCK_COMMENT_MODE: IA,
  C_LINE_COMMENT_MODE: AA,
  C_NUMBER_MODE: wA,
  C_NUMBER_RE: dh,
  END_SAME_AS_BEGIN: BA,
  HASH_COMMENT_MODE: xA,
  IDENT_RE: ch,
  MATCH_NOTHING_RE: CA,
  METHOD_GUARD: FA,
  NUMBER_MODE: DA,
  NUMBER_RE: uh,
  PHRASAL_WORDS_MODE: NA,
  QUOTE_STRING_MODE: OA,
  REGEXP_MODE: LA,
  RE_STARTERS_RE: yA,
  SHEBANG: vA,
  TITLE_MODE: kA,
  UNDERSCORE_IDENT_RE: Mu,
  UNDERSCORE_TITLE_MODE: PA
});
function UA(t, e) {
  t.input[t.index - 1] === "." && e.ignoreMatch();
}
function HA(t, e) {
  t.className !== void 0 && (t.scope = t.className, delete t.className);
}
function GA(t, e) {
  e && t.beginKeywords && (t.begin = "\\b(" + t.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", t.__beforeBegin = UA, t.keywords = t.keywords || t.beginKeywords, delete t.beginKeywords, t.relevance === void 0 && (t.relevance = 0));
}
function VA(t, e) {
  Array.isArray(t.illegal) && (t.illegal = Du(...t.illegal));
}
function YA(t, e) {
  if (t.match) {
    if (t.begin || t.end) throw new Error("begin & end are not supported with match");
    t.begin = t.match, delete t.match;
  }
}
function $A(t, e) {
  t.relevance === void 0 && (t.relevance = 1);
}
const zA = (t, e) => {
  if (!t.beforeMatch) return;
  if (t.starts) throw new Error("beforeMatch cannot be used with starts");
  const n = Object.assign({}, t);
  Object.keys(t).forEach((r) => {
    delete t[r];
  }), t.keywords = n.keywords, t.begin = yr(n.beforeMatch, sh(n.begin)), t.starts = {
    relevance: 0,
    contains: [
      Object.assign(n, { endsParent: !0 })
    ]
  }, t.relevance = 0, delete n.beforeMatch;
}, qA = [
  "of",
  "and",
  "for",
  "in",
  "not",
  "or",
  "if",
  "then",
  "parent",
  // common variable name
  "list",
  // common variable name
  "value"
  // common variable name
], WA = "keyword";
function _h(t, e, n = WA) {
  const r = /* @__PURE__ */ Object.create(null);
  return typeof t == "string" ? i(n, t.split(" ")) : Array.isArray(t) ? i(n, t) : Object.keys(t).forEach(function(o) {
    Object.assign(
      r,
      _h(t[o], e, o)
    );
  }), r;
  function i(o, a) {
    e && (a = a.map((s) => s.toLowerCase())), a.forEach(function(s) {
      const l = s.split("|");
      r[l[0]] = [o, KA(l[0], l[1])];
    });
  }
}
function KA(t, e) {
  return e ? Number(e) : QA(t) ? 0 : 1;
}
function QA(t) {
  return qA.includes(t.toLowerCase());
}
const I_ = {}, pr = (t) => {
  console.error(t);
}, x_ = (t, ...e) => {
  console.log(`WARN: ${t}`, ...e);
}, Mr = (t, e) => {
  I_[`${t}/${e}`] || (console.log(`Deprecated as of ${t}. ${e}`), I_[`${t}/${e}`] = !0);
}, ns = new Error();
function mh(t, e, { key: n }) {
  let r = 0;
  const i = t[n], o = {}, a = {};
  for (let s = 1; s <= e.length; s++)
    a[s + r] = i[s], o[s + r] = !0, r += lh(e[s - 1]);
  t[n] = a, t[n]._emit = o, t[n]._multi = !0;
}
function ZA(t) {
  if (Array.isArray(t.begin)) {
    if (t.skip || t.excludeBegin || t.returnBegin)
      throw pr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), ns;
    if (typeof t.beginScope != "object" || t.beginScope === null)
      throw pr("beginScope must be object"), ns;
    mh(t, t.begin, { key: "beginScope" }), t.begin = wu(t.begin, { joinWith: "" });
  }
}
function XA(t) {
  if (Array.isArray(t.end)) {
    if (t.skip || t.excludeEnd || t.returnEnd)
      throw pr("skip, excludeEnd, returnEnd not compatible with endScope: {}"), ns;
    if (typeof t.endScope != "object" || t.endScope === null)
      throw pr("endScope must be object"), ns;
    mh(t, t.end, { key: "endScope" }), t.end = wu(t.end, { joinWith: "" });
  }
}
function jA(t) {
  t.scope && typeof t.scope == "object" && t.scope !== null && (t.beginScope = t.scope, delete t.scope);
}
function JA(t) {
  jA(t), typeof t.beginScope == "string" && (t.beginScope = { _wrap: t.beginScope }), typeof t.endScope == "string" && (t.endScope = { _wrap: t.endScope }), ZA(t), XA(t);
}
function eI(t) {
  function e(a, s) {
    return new RegExp(
      ao(a),
      "m" + (t.case_insensitive ? "i" : "") + (t.unicodeRegex ? "u" : "") + (s ? "g" : "")
    );
  }
  class n {
    constructor() {
      this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
    }
    // @ts-ignore
    addRule(s, l) {
      l.position = this.position++, this.matchIndexes[this.matchAt] = l, this.regexes.push([l, s]), this.matchAt += lh(s) + 1;
    }
    compile() {
      this.regexes.length === 0 && (this.exec = () => null);
      const s = this.regexes.map((l) => l[1]);
      this.matcherRe = e(wu(s, { joinWith: "|" }), !0), this.lastIndex = 0;
    }
    /** @param {string} s */
    exec(s) {
      this.matcherRe.lastIndex = this.lastIndex;
      const l = this.matcherRe.exec(s);
      if (!l)
        return null;
      const c = l.findIndex((d, p) => p > 0 && d !== void 0), u = this.matchIndexes[c];
      return l.splice(0, c), Object.assign(l, u);
    }
  }
  class r {
    constructor() {
      this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
    }
    // @ts-ignore
    getMatcher(s) {
      if (this.multiRegexes[s]) return this.multiRegexes[s];
      const l = new n();
      return this.rules.slice(s).forEach(([c, u]) => l.addRule(c, u)), l.compile(), this.multiRegexes[s] = l, l;
    }
    resumingScanAtSamePosition() {
      return this.regexIndex !== 0;
    }
    considerAll() {
      this.regexIndex = 0;
    }
    // @ts-ignore
    addRule(s, l) {
      this.rules.push([s, l]), l.type === "begin" && this.count++;
    }
    /** @param {string} s */
    exec(s) {
      const l = this.getMatcher(this.regexIndex);
      l.lastIndex = this.lastIndex;
      let c = l.exec(s);
      if (this.resumingScanAtSamePosition() && !(c && c.index === this.lastIndex)) {
        const u = this.getMatcher(0);
        u.lastIndex = this.lastIndex + 1, c = u.exec(s);
      }
      return c && (this.regexIndex += c.position + 1, this.regexIndex === this.count && this.considerAll()), c;
    }
  }
  function i(a) {
    const s = new r();
    return a.contains.forEach((l) => s.addRule(l.begin, { rule: l, type: "begin" })), a.terminatorEnd && s.addRule(a.terminatorEnd, { type: "end" }), a.illegal && s.addRule(a.illegal, { type: "illegal" }), s;
  }
  function o(a, s) {
    const l = (
      /** @type CompiledMode */
      a
    );
    if (a.isCompiled) return l;
    [
      HA,
      // do this early so compiler extensions generally don't have to worry about
      // the distinction between match/begin
      YA,
      JA,
      zA
    ].forEach((u) => u(a, s)), t.compilerExtensions.forEach((u) => u(a, s)), a.__beforeBegin = null, [
      GA,
      // do this later so compiler extensions that come earlier have access to the
      // raw array if they wanted to perhaps manipulate it, etc.
      VA,
      // default to 1 relevance if not specified
      $A
    ].forEach((u) => u(a, s)), a.isCompiled = !0;
    let c = null;
    return typeof a.keywords == "object" && a.keywords.$pattern && (a.keywords = Object.assign({}, a.keywords), c = a.keywords.$pattern, delete a.keywords.$pattern), c = c || /\w+/, a.keywords && (a.keywords = _h(a.keywords, t.case_insensitive)), l.keywordPatternRe = e(c, !0), s && (a.begin || (a.begin = /\B|\b/), l.beginRe = e(l.begin), !a.end && !a.endsWithParent && (a.end = /\B|\b/), a.end && (l.endRe = e(l.end)), l.terminatorEnd = ao(l.end) || "", a.endsWithParent && s.terminatorEnd && (l.terminatorEnd += (a.end ? "|" : "") + s.terminatorEnd)), a.illegal && (l.illegalRe = e(
      /** @type {RegExp | string} */
      a.illegal
    )), a.contains || (a.contains = []), a.contains = [].concat(...a.contains.map(function(u) {
      return tI(u === "self" ? a : u);
    })), a.contains.forEach(function(u) {
      o(
        /** @type Mode */
        u,
        l
      );
    }), a.starts && o(a.starts, s), l.matcher = i(l), l;
  }
  if (t.compilerExtensions || (t.compilerExtensions = []), t.contains && t.contains.includes("self"))
    throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");
  return t.classNameAliases = Pn(t.classNameAliases || {}), o(
    /** @type Mode */
    t
  );
}
function fh(t) {
  return t ? t.endsWithParent || fh(t.starts) : !1;
}
function tI(t) {
  return t.variants && !t.cachedVariants && (t.cachedVariants = t.variants.map(function(e) {
    return Pn(t, { variants: null }, e);
  })), t.cachedVariants ? t.cachedVariants : fh(t) ? Pn(t, { starts: t.starts ? Pn(t.starts) : null }) : Object.isFrozen(t) ? Pn(t) : t;
}
var nI = "11.10.0";
let rI = class extends Error {
  constructor(e, n) {
    super(e), this.name = "HTMLInjectionError", this.html = n;
  }
};
const Al = oh, D_ = Pn, w_ = Symbol("nomatch"), iI = 7, gh = function(t) {
  const e = /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ Object.create(null), r = [];
  let i = !0;
  const o = "Could not find the language '{}', did you forget to load/include a language module?", a = { disableAutodetect: !0, name: "Plain text", contains: [] };
  let s = {
    ignoreUnescapedHTML: !1,
    throwUnescapedHTML: !1,
    noHighlightRe: /^(no-?highlight)$/i,
    languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
    classPrefix: "hljs-",
    cssSelector: "pre code",
    languages: null,
    // beta configuration options, subject to change, welcome to discuss
    // https://github.com/highlightjs/highlight.js/issues/1086
    __emitter: gA
  };
  function l(y) {
    return s.noHighlightRe.test(y);
  }
  function c(y) {
    let R = y.className + " ";
    R += y.parentNode ? y.parentNode.className : "";
    const w = s.languageDetectRe.exec(R);
    if (w) {
      const B = N(w[1]);
      return B || (x_(o.replace("{}", w[1])), x_("Falling back to no-highlight mode for this block.", y)), B ? w[1] : "no-highlight";
    }
    return R.split(/\s+/).find((B) => l(B) || N(B));
  }
  function u(y, R, w) {
    let B = "", $ = "";
    typeof R == "object" ? (B = y, w = R.ignoreIllegals, $ = R.language) : (Mr("10.7.0", "highlight(lang, code, ...args) has been deprecated."), Mr("10.7.0", `Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`), $ = y, B = R), w === void 0 && (w = !0);
    const X = {
      code: B,
      language: $
    };
    V("before:highlight", X);
    const de = X.result ? X.result : d(X.language, X.code, w);
    return de.code = X.code, V("after:highlight", de), de;
  }
  function d(y, R, w, B) {
    const $ = /* @__PURE__ */ Object.create(null);
    function X(A, k) {
      return A.keywords[k];
    }
    function de() {
      if (!j.keywords) {
        J.addText(_e);
        return;
      }
      let A = 0;
      j.keywordPatternRe.lastIndex = 0;
      let k = j.keywordPatternRe.exec(_e), G = "";
      for (; k; ) {
        G += _e.substring(A, k.index);
        const re = ae.case_insensitive ? k[0].toLowerCase() : k[0], Ce = X(j, re);
        if (Ce) {
          const [mt, Or] = Ce;
          if (J.addText(G), G = "", $[re] = ($[re] || 0) + 1, $[re] <= iI && (Fe += Or), mt.startsWith("_"))
            G += k[0];
          else {
            const D = ae.classNameAliases[mt] || mt;
            he(k[0], D);
          }
        } else
          G += k[0];
        A = j.keywordPatternRe.lastIndex, k = j.keywordPatternRe.exec(_e);
      }
      G += _e.substring(A), J.addText(G);
    }
    function pe() {
      if (_e === "") return;
      let A = null;
      if (typeof j.subLanguage == "string") {
        if (!e[j.subLanguage]) {
          J.addText(_e);
          return;
        }
        A = d(j.subLanguage, _e, !0, Ee[j.subLanguage]), Ee[j.subLanguage] = /** @type {CompiledMode} */
        A._top;
      } else
        A = _(_e, j.subLanguage.length ? j.subLanguage : null);
      j.relevance > 0 && (Fe += A.relevance), J.__addSublanguage(A._emitter, A.language);
    }
    function le() {
      j.subLanguage != null ? pe() : de(), _e = "";
    }
    function he(A, k) {
      A !== "" && (J.startScope(k), J.addText(A), J.endScope());
    }
    function We(A, k) {
      let G = 1;
      const re = k.length - 1;
      for (; G <= re; ) {
        if (!A._emit[G]) {
          G++;
          continue;
        }
        const Ce = ae.classNameAliases[A[G]] || A[G], mt = k[G];
        Ce ? he(mt, Ce) : (_e = mt, de(), _e = ""), G++;
      }
    }
    function De(A, k) {
      return A.scope && typeof A.scope == "string" && J.openNode(ae.classNameAliases[A.scope] || A.scope), A.beginScope && (A.beginScope._wrap ? (he(_e, ae.classNameAliases[A.beginScope._wrap] || A.beginScope._wrap), _e = "") : A.beginScope._multi && (We(A.beginScope, k), _e = "")), j = Object.create(A, { parent: { value: j } }), j;
    }
    function et(A, k, G) {
      let re = bA(A.endRe, G);
      if (re) {
        if (A["on:end"]) {
          const Ce = new O_(A);
          A["on:end"](k, Ce), Ce.isMatchIgnored && (re = !1);
        }
        if (re) {
          for (; A.endsParent && A.parent; )
            A = A.parent;
          return A;
        }
      }
      if (A.endsWithParent)
        return et(A.parent, k, G);
    }
    function Ke(A) {
      return j.matcher.regexIndex === 0 ? (_e += A[0], 1) : (U = !0, 0);
    }
    function st(A) {
      const k = A[0], G = A.rule, re = new O_(G), Ce = [G.__beforeBegin, G["on:begin"]];
      for (const mt of Ce)
        if (mt && (mt(A, re), re.isMatchIgnored))
          return Ke(k);
      return G.skip ? _e += k : (G.excludeBegin && (_e += k), le(), !G.returnBegin && !G.excludeBegin && (_e = k)), De(G, A), G.returnBegin ? 0 : k.length;
    }
    function Ut(A) {
      const k = A[0], G = R.substring(A.index), re = et(j, A, G);
      if (!re)
        return w_;
      const Ce = j;
      j.endScope && j.endScope._wrap ? (le(), he(k, j.endScope._wrap)) : j.endScope && j.endScope._multi ? (le(), We(j.endScope, A)) : Ce.skip ? _e += k : (Ce.returnEnd || Ce.excludeEnd || (_e += k), le(), Ce.excludeEnd && (_e = k));
      do
        j.scope && J.closeNode(), !j.skip && !j.subLanguage && (Fe += j.relevance), j = j.parent;
      while (j !== re.parent);
      return re.starts && De(re.starts, A), Ce.returnEnd ? 0 : k.length;
    }
    function lt() {
      const A = [];
      for (let k = j; k !== ae; k = k.parent)
        k.scope && A.unshift(k.scope);
      A.forEach((k) => J.openNode(k));
    }
    let ct = {};
    function Pe(A, k) {
      const G = k && k[0];
      if (_e += A, G == null)
        return le(), 0;
      if (ct.type === "begin" && k.type === "end" && ct.index === k.index && G === "") {
        if (_e += R.slice(k.index, k.index + 1), !i) {
          const re = new Error(`0 width match regex (${y})`);
          throw re.languageName = y, re.badRule = ct.rule, re;
        }
        return 1;
      }
      if (ct = k, k.type === "begin")
        return st(k);
      if (k.type === "illegal" && !w) {
        const re = new Error('Illegal lexeme "' + G + '" for mode "' + (j.scope || "<unnamed>") + '"');
        throw re.mode = j, re;
      } else if (k.type === "end") {
        const re = Ut(k);
        if (re !== w_)
          return re;
      }
      if (k.type === "illegal" && G === "")
        return 1;
      if (Tt > 1e5 && Tt > k.index * 3)
        throw new Error("potential infinite loop, way more iterations than matches");
      return _e += G, G.length;
    }
    const ae = N(y);
    if (!ae)
      throw pr(o.replace("{}", y)), new Error('Unknown language: "' + y + '"');
    const Qe = eI(ae);
    let Q = "", j = B || Qe;
    const Ee = {}, J = new s.__emitter(s);
    lt();
    let _e = "", Fe = 0, Ge = 0, Tt = 0, U = !1;
    try {
      if (ae.__emitTokens)
        ae.__emitTokens(R, J);
      else {
        for (j.matcher.considerAll(); ; ) {
          Tt++, U ? U = !1 : j.matcher.considerAll(), j.matcher.lastIndex = Ge;
          const A = j.matcher.exec(R);
          if (!A) break;
          const k = R.substring(Ge, A.index), G = Pe(k, A);
          Ge = A.index + G;
        }
        Pe(R.substring(Ge));
      }
      return J.finalize(), Q = J.toHTML(), {
        language: y,
        value: Q,
        relevance: Fe,
        illegal: !1,
        _emitter: J,
        _top: j
      };
    } catch (A) {
      if (A.message && A.message.includes("Illegal"))
        return {
          language: y,
          value: Al(R),
          illegal: !0,
          relevance: 0,
          _illegalBy: {
            message: A.message,
            index: Ge,
            context: R.slice(Ge - 100, Ge + 100),
            mode: A.mode,
            resultSoFar: Q
          },
          _emitter: J
        };
      if (i)
        return {
          language: y,
          value: Al(R),
          illegal: !1,
          relevance: 0,
          errorRaised: A,
          _emitter: J,
          _top: j
        };
      throw A;
    }
  }
  function p(y) {
    const R = {
      value: Al(y),
      illegal: !1,
      relevance: 0,
      _top: a,
      _emitter: new s.__emitter(s)
    };
    return R._emitter.addText(y), R;
  }
  function _(y, R) {
    R = R || s.languages || Object.keys(e);
    const w = p(y), B = R.filter(N).filter(P).map(
      (le) => d(le, y, !1)
    );
    B.unshift(w);
    const $ = B.sort((le, he) => {
      if (le.relevance !== he.relevance) return he.relevance - le.relevance;
      if (le.language && he.language) {
        if (N(le.language).supersetOf === he.language)
          return 1;
        if (N(he.language).supersetOf === le.language)
          return -1;
      }
      return 0;
    }), [X, de] = $, pe = X;
    return pe.secondBest = de, pe;
  }
  function m(y, R, w) {
    const B = R && n[R] || w;
    y.classList.add("hljs"), y.classList.add(`language-${B}`);
  }
  function f(y) {
    let R = null;
    const w = c(y);
    if (l(w)) return;
    if (V(
      "before:highlightElement",
      { el: y, language: w }
    ), y.dataset.highlighted) {
      console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", y);
      return;
    }
    if (y.children.length > 0 && (s.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(y)), s.throwUnescapedHTML))
      throw new rI(
        "One of your code blocks includes unescaped HTML.",
        y.innerHTML
      );
    R = y;
    const B = R.textContent, $ = w ? u(B, { language: w, ignoreIllegals: !0 }) : _(B);
    y.innerHTML = $.value, y.dataset.highlighted = "yes", m(y, w, $.language), y.result = {
      language: $.language,
      // TODO: remove with version 11.0
      re: $.relevance,
      relevance: $.relevance
    }, $.secondBest && (y.secondBest = {
      language: $.secondBest.language,
      relevance: $.secondBest.relevance
    }), V("after:highlightElement", { el: y, result: $, text: B });
  }
  function g(y) {
    s = D_(s, y);
  }
  const S = () => {
    h(), Mr("10.6.0", "initHighlighting() deprecated.  Use highlightAll() now.");
  };
  function E() {
    h(), Mr("10.6.0", "initHighlightingOnLoad() deprecated.  Use highlightAll() now.");
  }
  let b = !1;
  function h() {
    if (document.readyState === "loading") {
      b = !0;
      return;
    }
    document.querySelectorAll(s.cssSelector).forEach(f);
  }
  function T() {
    b && h();
  }
  typeof window < "u" && window.addEventListener && window.addEventListener("DOMContentLoaded", T, !1);
  function C(y, R) {
    let w = null;
    try {
      w = R(t);
    } catch (B) {
      if (pr("Language definition for '{}' could not be registered.".replace("{}", y)), i)
        pr(B);
      else
        throw B;
      w = a;
    }
    w.name || (w.name = y), e[y] = w, w.rawDefinition = R.bind(null, t), w.aliases && x(w.aliases, { languageName: y });
  }
  function v(y) {
    delete e[y];
    for (const R of Object.keys(n))
      n[R] === y && delete n[R];
  }
  function I() {
    return Object.keys(e);
  }
  function N(y) {
    return y = (y || "").toLowerCase(), e[y] || e[n[y]];
  }
  function x(y, { languageName: R }) {
    typeof y == "string" && (y = [y]), y.forEach((w) => {
      n[w.toLowerCase()] = R;
    });
  }
  function P(y) {
    const R = N(y);
    return R && !R.disableAutodetect;
  }
  function Y(y) {
    y["before:highlightBlock"] && !y["before:highlightElement"] && (y["before:highlightElement"] = (R) => {
      y["before:highlightBlock"](
        Object.assign({ block: R.el }, R)
      );
    }), y["after:highlightBlock"] && !y["after:highlightElement"] && (y["after:highlightElement"] = (R) => {
      y["after:highlightBlock"](
        Object.assign({ block: R.el }, R)
      );
    });
  }
  function Z(y) {
    Y(y), r.push(y);
  }
  function q(y) {
    const R = r.indexOf(y);
    R !== -1 && r.splice(R, 1);
  }
  function V(y, R) {
    const w = y;
    r.forEach(function(B) {
      B[w] && B[w](R);
    });
  }
  function O(y) {
    return Mr("10.7.0", "highlightBlock will be removed entirely in v12.0"), Mr("10.7.0", "Please use highlightElement now."), f(y);
  }
  Object.assign(t, {
    highlight: u,
    highlightAuto: _,
    highlightAll: h,
    highlightElement: f,
    // TODO: Remove with v12 API
    highlightBlock: O,
    configure: g,
    initHighlighting: S,
    initHighlightingOnLoad: E,
    registerLanguage: C,
    unregisterLanguage: v,
    listLanguages: I,
    getLanguage: N,
    registerAliases: x,
    autoDetection: P,
    inherit: D_,
    addPlugin: Z,
    removePlugin: q
  }), t.debugMode = function() {
    i = !1;
  }, t.safeMode = function() {
    i = !0;
  }, t.versionString = nI, t.regex = {
    concat: yr,
    lookahead: sh,
    either: Du,
    optional: EA,
    anyNumberOfTimes: hA
  };
  for (const y in Wo)
    typeof Wo[y] == "object" && ih(Wo[y]);
  return Object.assign(t, Wo), t;
}, ai = gh({});
ai.newInstance = () => gh({});
var oI = ai;
ai.HighlightJS = ai;
ai.default = ai;
var aI = /* @__PURE__ */ dA(oI);
function hh(t, e = []) {
  return t.map((n) => {
    const r = [...e, ...n.properties ? n.properties.className : []];
    return n.children ? hh(n.children, r) : {
      text: n.value,
      classes: r
    };
  }).flat();
}
function M_(t) {
  return t.value || t.children || [];
}
function sI(t) {
  return !!aI.getLanguage(t);
}
function L_({ doc: t, name: e, lowlight: n, defaultLanguage: r }) {
  const i = [];
  return uc(t, (o) => o.type.name === e).forEach((o) => {
    var a;
    let s = o.pos + 1;
    const l = o.node.attrs.language || r, c = n.listLanguages(), u = l && (c.includes(l) || sI(l) || !((a = n.registered) === null || a === void 0) && a.call(n, l)) ? M_(n.highlight(l, o.node.textContent)) : M_(n.highlightAuto(o.node.textContent));
    hh(u).forEach((d) => {
      const p = s + d.text.length;
      if (d.classes.length) {
        const _ = Be.inline(s, p, {
          class: d.classes.join(" ")
        });
        i.push(_);
      }
      s = p;
    });
  }), ye.create(t, i);
}
function lI(t) {
  return typeof t == "function";
}
function cI({ name: t, lowlight: e, defaultLanguage: n }) {
  if (!["highlight", "highlightAuto", "listLanguages"].every((i) => lI(e[i])))
    throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");
  const r = new Te({
    key: new Oe("lowlight"),
    state: {
      init: (i, { doc: o }) => L_({
        doc: o,
        name: t,
        lowlight: e,
        defaultLanguage: n
      }),
      apply: (i, o, a, s) => {
        const l = a.selection.$head.parent.type.name, c = s.selection.$head.parent.type.name, u = uc(a.doc, (p) => p.type.name === t), d = uc(s.doc, (p) => p.type.name === t);
        return i.docChanged && ([l, c].includes(t) || d.length !== u.length || i.steps.some((p) => (
          // @ts-ignore
          p.from !== void 0 && p.to !== void 0 && u.some((_) => (
            // @ts-ignore
            _.pos >= p.from && _.pos + _.node.nodeSize <= p.to
          ))
        ))) ? L_({
          doc: i.doc,
          name: t,
          lowlight: e,
          defaultLanguage: n
        }) : o.map(i.mapping, i.doc);
      }
    },
    props: {
      decorations(i) {
        return r.getState(i);
      }
    }
  });
  return r;
}
const uI = wg.extend({
  addOptions() {
    var t;
    return {
      ...(t = this.parent) === null || t === void 0 ? void 0 : t.call(this),
      lowlight: {},
      languageClassPrefix: "language-",
      exitOnTripleEnter: !0,
      exitOnArrowDown: !0,
      defaultLanguage: null,
      HTMLAttributes: {}
    };
  },
  addProseMirrorPlugins() {
    var t;
    return [
      ...((t = this.parent) === null || t === void 0 ? void 0 : t.call(this)) || [],
      cI({
        name: this.name,
        lowlight: this.options.lowlight,
        defaultLanguage: this.options.defaultLanguage
      })
    ];
  }
});
function k_(t, e, n = {}) {
  const { empty: r, ranges: i, from: o, to: a } = t.selection, s = e ? bn(e, t.schema) : null;
  if (r)
    return !!(t.storedMarks || t.selection.$from.marks()).filter((f) => s ? s.name === f.type.name : !0).find(
      (f) => ei(f.attrs, n, { strict: !1 })
    );
  let l = o, c = a;
  const u = [];
  i.forEach(({ $from: f, $to: g }) => {
    const S = f.pos, E = g.pos;
    l = Math.min(l, S), c = Math.max(l, E), t.doc.nodesBetween(S, E, (b, h) => {
      if (!b.isText && !b.marks.length)
        return;
      const T = Math.max(S, h), C = Math.min(E, h + b.nodeSize);
      u.push(
        ...b.marks.map((v) => ({
          mark: v,
          from: T,
          to: C
        }))
      );
    });
  });
  const d = c - l;
  if (d === 0)
    return !1;
  const p = u.filter((f) => s ? s.name === f.mark.type.name : !0).filter(
    (f) => ei(f.mark.attrs, n, { strict: !1 })
  ).reduce((f, g) => f + g.to - g.from, 0), _ = u.filter((f) => s ? f.mark.type !== s && f.mark.type.excludes(s) : !0).reduce((f, g) => f + g.to - g.from, 0);
  return (p > 0 ? p + _ : p) >= d;
}
function P_(t) {
  var e;
  return !!((e = t.spec.group) != null && e.split(" ").includes("list"));
}
function Il(t, e, n = {}) {
  if (!e)
    return hr(t, null, n) || k_(t, null, n);
  const r = t.schema.nodes[e];
  if (r) {
    if (P_(r)) {
      const o = Ns((a) => P_(a.type))(
        t.selection
      );
      return !!(o && o.node.type.name === e);
    }
    return hr(t, e, n);
  }
  return t.schema.marks[e] ? k_(t, e, n) : !1;
}
function F_(t) {
  return new Eo({
    find: t.find,
    handler: ({ state: e, range: n, match: r, commands: i }) => {
      const o = e.doc.resolve(n.from), a = ce(t.getAttributes, void 0, r) || {};
      if (!o.node(-1).canReplaceWith(o.index(-1), o.indexAfter(-1), t.type))
        return null;
      e.tr.delete(n.from, n.to).setBlockType(n.from, n.from, t.type, a), setTimeout(() => i.focus(!0), 0);
    }
  });
}
const Eh = [
  { name: "Auto", value: "auto" },
  { name: "Plain Text", value: "plaintext", alias: ["text", "txt"] },
  { name: "Bash", value: "bash", alias: ["sh"] },
  { name: "BASIC", value: "basic", alias: [] },
  { name: "C", value: "c", alias: ["h"] },
  { name: "Clojure", value: "clojure", alias: ["clj", "edn"] },
  { name: "CMake", value: "cmake", alias: ["cmake.in"] },
  {
    name: "CoffeeScript",
    value: "coffeescript",
    alias: ["coffee", "cson", "iced"]
  },
  {
    name: "C++",
    value: "cpp",
    alias: ["cc", "c++", "h++", "hpp", "hh", "hxx", "cxx"]
  },
  { name: "C#", value: "csharp", alias: ["cs", "c#"] },
  { name: "CSS", value: "css", alias: [] },
  { name: "Dart", value: "dart", alias: [] },
  { name: "Delphi", value: "delphi", alias: ["dpr", "dfm", "pas", "pascal"] },
  { name: "Dockerfile", value: "dockerfile", alias: ["docker"] },
  { name: "Erlang", value: "erlang", alias: ["erl"] },
  { name: "Go", value: "go", alias: ["golang"] },
  { name: "GraphQL", value: "graphql", alias: ["gql"] },
  { name: "Groovy", value: "groovy", alias: [] },
  { name: "Java", value: "java", alias: ["jsp"] },
  {
    name: "JavaScript",
    value: "javascript",
    alias: ["js", "jsx", "mjs", "cjs"]
  },
  { name: "JSON", value: "json", alias: [] },
  { name: "Kotlin", value: "kotlin", alias: ["kt", "kts"] },
  { name: "Lua", value: "lua", alias: [] },
  { name: "Makefile", value: "makefile", alias: ["mk", "mak", "make"] },
  { name: "Markdown", value: "markdown", alias: ["md", "mkdown", "mkd"] },
  { name: "Matlab", value: "matlab", alias: [] },
  {
    name: "Objective-C",
    value: "objectivec",
    alias: ["mm", "objc", "obj-c", "obj-c++", "objective-c++"]
  },
  { name: "PHP", value: "php", alias: [] },
  { name: "Properties", value: "properties", alias: [] },
  { name: "Python", value: "python", alias: ["py", "gyp", "ipython"] },
  {
    name: "Ruby",
    value: "ruby",
    alias: ["rb", "gemspec", "podspec", "thor", "irb"]
  },
  { name: "Rust", value: "rust", alias: ["rs"] },
  { name: "Scala", value: "scala", alias: [] },
  { name: "SCSS", value: "scss", alias: [] },
  { name: "Shell", value: "shell", alias: ["console", "shellsession"] },
  { name: "SQL", value: "sql", alias: [] },
  { name: "Swift", value: "swift", alias: [] },
  { name: "TypeScript", value: "typescript", alias: ["ts", "tsx"] },
  { name: "WebAssembly", value: "wasm", alias: [] },
  {
    name: "HTML, XML",
    value: "xml",
    alias: [
      "html",
      "xhtml",
      "rss",
      "atom",
      "xjb",
      "xsd",
      "xsl",
      "plist",
      "wsf",
      "svg"
    ]
  },
  { name: "YAML", value: "yaml", alias: ["yml"] }
], B_ = (t) => {
  if (!t)
    return null;
  const e = t.toLocaleLowerCase();
  return Eh.find(
    (r) => r.value === e || r.alias && r.alias.includes(e)
  );
};
function U_(t, e) {
  const { $from: n, from: r, to: i } = t, s = (e.textContent || "").split(`
`).reduce((_, m, f) => (_[f] = (_[f - 1] || 0) + m.length + (f === 0 ? 0 : 1), _), {}), l = n.parentOffset, c = n.parentOffset + i - r, u = Object.keys(s), d = u.find(
    (_) => s[_] >= l
  ), p = u.find(
    (_) => s[_] >= c
  );
  return {
    start: d,
    end: p
  };
}
const dI = /^[`·]{3}([a-z]+)?[\s\n]$/, pI = /^[~～]{3}([a-z]+)?[\s\n]$/, _I = uI.extend({
  addOptions() {
    var t;
    return {
      ...(t = this.parent) == null ? void 0 : t.call(this),
      lowlight: {},
      defaultLanguage: null,
      languages: []
    };
  },
  addCommands() {
    var t;
    return {
      ...(t = this.parent) == null ? void 0 : t.call(this),
      addCodeComments: (e, n) => ({ editor: r }) => {
        const { view: { dispatch: i }, state: { tr: o } } = r;
        return i(o.setSelection(ee.create(r.state.doc, n)).deleteSelection()), zn.get(this.options.codeCommentsAi.model).chat(e.textContent, this.options.codeCommentsAi.prompt, new Aa(r, {
          markdownParseEnable: !0,
          useMarkdownTextOnly: !0
        })), !0;
      },
      addCodeExplain: (e, n) => ({ editor: r }) => {
        const { view: { dispatch: i }, state: { tr: o } } = r, a = r.state.doc.nodeSize;
        a <= n + e.nodeSize + 2 ? (r.commands.insertContentAt(n + e.nodeSize + 1, "<p></p>"), i(o.setSelection(K.create(r.state.doc, a - 2)))) : i(o.setSelection(K.create(r.state.doc, n + e.nodeSize + 1)));
        const s = zn.get(this.options.codeExplainAi.model);
        return s == null || s.chat(e.textContent, this.options.codeExplainAi.prompt, new Aa(r)), !0;
      },
      toggleCodeBlock: (e) => ({ commands: n, editor: r, chain: i }) => {
        const { state: o } = r, { from: a, to: s } = o.selection;
        if (!Il(o, this.name) && !o.selection.empty) {
          let l = !0;
          const c = [];
          if (o.doc.nodesBetween(a, s, (u, d) => {
            if (u.isInline)
              return !1;
            if (u.type.name !== "paragraph")
              return d + 1 <= a && d + u.nodeSize - 1 >= s ? void 0 : (l = !1, !1);
            {
              const p = (u.textContent || "").slice(
                d + 1 > a ? 0 : a - d - 1,
                d + u.nodeSize - 1 < s ? u.nodeSize - 1 : s - d - 1
              );
              c.push(p || "");
            }
          }), l && c.length > 1)
            return i().command(({ state: u, tr: d }) => (d.replaceRangeWith(
              a,
              s,
              this.type.create(
                e,
                u.schema.text(c.join(`
`))
              )
            ), !0)).setTextSelection({
              from: a + 2,
              to: a + 2
            }).run();
        }
        return n.toggleNode(this.name, "paragraph", e);
      }
    };
  },
  addKeyboardShortcuts() {
    var t;
    return {
      ...(t = this.parent) == null ? void 0 : t.call(this),
      Tab: ({ editor: e }) => {
        const { state: n, view: r } = e;
        if (!Il(n, this.name))
          return !1;
        const { selection: i, tr: o } = n, a = "  ";
        if (i.empty)
          r.dispatch(o.insertText(a));
        else {
          const { $from: s, from: l, to: c } = i, u = s.node();
          if (u.type !== this.type)
            return !1;
          const { start: d, end: p } = U_(i, u);
          if (d === void 0 || p === void 0)
            return r.dispatch(o.replaceSelectionWith(n.schema.text(a))), !0;
          const f = (u.textContent || "").split(`
`).map((E, b) => b >= d && b <= p && E ? a + E : E), g = s.node(1), S = s.start(1);
          o.replaceWith(
            S,
            S + g.nodeSize - 2,
            n.schema.text(f.join(`
`))
          ), o.setSelection(
            K.between(
              o.doc.resolve(l + a.length),
              o.doc.resolve(
                c + (p - d + 1) * a.length
              )
            )
          ), r.dispatch(o);
        }
        return !0;
      },
      "Shift-Tab": ({ editor: e }) => {
        const { state: n, view: r } = e;
        if (!Il(n, this.name))
          return !1;
        const { selection: i, tr: o } = n, { $from: a, from: s, to: l } = i, c = a.node();
        if (c.type !== this.type)
          return !1;
        const { start: u, end: d } = U_(i, c);
        if (u === void 0 || d === void 0)
          return !1;
        const _ = (c.textContent || "").split(`
`);
        let m = s, f = l;
        const g = _.map((b, h) => {
          if (h >= u && h <= d && b)
            for (let T = 0; T < 2; T++)
              b.startsWith(" ") && (b = b.slice(1), h == u && m--, f--);
          return b;
        }), S = a.node(1), E = a.start(1);
        return o.replaceWith(
          E,
          E + S.nodeSize - 2,
          n.schema.text(g.join(`
`))
        ), o.setSelection(
          K.between(
            o.doc.resolve(m),
            o.doc.resolve(f)
          )
        ), r.dispatch(o), !0;
      }
    };
  },
  addInputRules() {
    return [
      F_({
        find: dI,
        type: this.type,
        getAttributes: (t) => {
          var e;
          return {
            language: ((e = B_(t[1])) == null ? void 0 : e.value) || this.options.defaultLanguage
          };
        }
      }),
      F_({
        find: pI,
        type: this.type,
        getAttributes: (t) => {
          var e;
          return {
            language: ((e = B_(t[1])) == null ? void 0 : e.value) || this.options.defaultLanguage
          };
        }
      })
    ];
  },
  addNodeView() {
    return (t) => {
      var o, a;
      const e = document.createElement("div");
      e.classList.add("linwiteditor-codeblock-wrapper");
      const { language: n } = t.node.attrs;
      if (!this.editor.isEditable)
        return e.innerHTML = `
                <div class="linwiteditor-codeblock-tools" contenteditable="false">
                    <div class="linwiteditor-codeblock-tools-lang" contenteditable="false" style="margin-right: 10px">${n || this.options.defaultLanguage}</div>
                </div>
                <pre class="hljs"><code></code></pre>
                `, {
          dom: e,
          contentDOM: e.querySelector("code")
        };
      e.innerHTML = `
                <div class="linwiteditor-codeblock-tools" contenteditable="false">
                    ${this.options.codeCommentsAi ? '<div class="linwiteditor-codeblock-tools-comments">' + te("codeblock-ai-auto-comment") + "</div>" : ""}
                    ${this.options.codeExplainAi ? '<div class="linwiteditor-codeblock-tools-explain">' + te("codeblock-ai-code-explain") + "</div>" : ""}
                    <div class="linwiteditor-codeblock-tools-lang" contenteditable="false"><span>${n || this.options.defaultLanguage}</span><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 16L6 10H18L12 16Z"></path></svg></div>
                </div>
                <pre class="hljs"><code></code></pre>
                `;
      const r = () => {
        var l;
        const s = document.createElement("div");
        return s.classList.add("linwiteditor-codeblock-langs"), s.innerHTML = `
                ${(l = this.options.languages) == null ? void 0 : l.map((c) => `<div class="linwiteditor-codeblock-langs-item" data-item="${c.value}">${c.name}</div>`).join("")}`, s.addEventListener("click", (c) => {
          const u = c.target.closest(".linwiteditor-codeblock-langs-item");
          if (u) {
            const d = u.getAttribute("data-item");
            t.editor.chain().setCodeBlock({ language: d }).run();
          }
        }), s;
      }, i = Me(e.querySelector(".linwiteditor-codeblock-tools-lang"), {
        content: r(),
        appendTo: t.editor.options.element,
        placement: "bottom-end",
        trigger: "click",
        interactive: !0,
        arrow: !1,
        aria: {
          content: null,
          expanded: !1
        }
      });
      return (o = e.querySelector(".linwiteditor-codeblock-tools-comments")) == null || o.addEventListener("click", (s) => {
        const l = t.editor.view.posAtCoords({ left: s.clientX, top: s.clientY }), c = t.editor.state.doc.resolve(l.pos).parent;
        t.editor.chain().addCodeComments(c, l.pos);
      }), (a = e.querySelector(".linwiteditor-codeblock-tools-explain")) == null || a.addEventListener("click", (s) => {
        const l = t.editor.view.posAtCoords({ left: s.clientX, top: s.clientY }), c = t.editor.state.doc.resolve(l.pos).parent;
        t.editor.chain().addCodeExplain(c, l.pos);
      }), {
        dom: e,
        contentDOM: e.querySelector("code"),
        destroy: () => {
          i.destroy();
        }
      };
    };
  }
});
function mI(t) {
  const e = "[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]+", i = "далее " + "возврат вызватьисключение выполнить для если и из или иначе иначеесли исключение каждого конецесли конецпопытки конеццикла не новый перейти перем по пока попытка прервать продолжить тогда цикл экспорт ", s = "загрузитьизфайла " + "вебклиент вместо внешнеесоединение клиент конецобласти мобильноеприложениеклиент мобильноеприложениесервер наклиенте наклиентенасервере наклиентенасерверебезконтекста насервере насерверебезконтекста область перед после сервер толстыйклиентобычноеприложение толстыйклиентуправляемоеприложение тонкийклиент ", p = "разделительстраниц разделительстрок символтабуляции " + "ansitooem oemtoansi ввестивидсубконто ввестиперечисление ввестипериод ввестиплансчетов выбранныйплансчетов датагод датамесяц датачисло заголовоксистемы значениевстроку значениеизстроки каталогиб каталогпользователя кодсимв конгода конецпериодаби конецрассчитанногопериодаби конецстандартногоинтервала конквартала конмесяца коннедели лог лог10 максимальноеколичествосубконто названиеинтерфейса названиенабораправ назначитьвид назначитьсчет найтиссылки началопериодаби началостандартногоинтервала начгода начквартала начмесяца начнедели номерднягода номерднянедели номернеделигода обработкаожидания основнойжурналрасчетов основнойплансчетов основнойязык очиститьокносообщений периодстр получитьвремята получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта получитьпустоезначение получитьта префиксавтонумерации пропись пустоезначение разм разобратьпозициюдокумента рассчитатьрегистрына рассчитатьрегистрыпо симв создатьобъект статусвозврата стрколичествострок сформироватьпозициюдокумента счетпокоду текущеевремя типзначения типзначениястр установитьтана установитьтапо фиксшаблон шаблон " + "acos asin atan base64значение base64строка cos exp log log10 pow sin sqrt tan xmlзначение xmlстрока xmlтип xmlтипзнч активноеокно безопасныйрежим безопасныйрежимразделенияданных булево ввестидату ввестизначение ввестистроку ввестичисло возможностьчтенияxml вопрос восстановитьзначение врег выгрузитьжурналрегистрации выполнитьобработкуоповещения выполнитьпроверкуправдоступа вычислить год данныеформывзначение дата день деньгода деньнедели добавитьмесяц заблокироватьданныедляредактирования заблокироватьработупользователя завершитьработусистемы загрузитьвнешнююкомпоненту закрытьсправку записатьjson записатьxml записатьдатуjson записьжурналарегистрации заполнитьзначениясвойств запроситьразрешениепользователя запуститьприложение запуститьсистему зафиксироватьтранзакцию значениевданныеформы значениевстрокувнутр значениевфайл значениезаполнено значениеизстрокивнутр значениеизфайла изxmlтипа импортмоделиxdto имякомпьютера имяпользователя инициализироватьпредопределенныеданные информацияобошибке каталогбиблиотекимобильногоустройства каталогвременныхфайлов каталогдокументов каталогпрограммы кодироватьстроку кодлокализацииинформационнойбазы кодсимвола командасистемы конецгода конецдня конецквартала конецмесяца конецминуты конецнедели конецчаса конфигурациябазыданныхизмененадинамически конфигурацияизменена копироватьданныеформы копироватьфайл краткоепредставлениеошибки лев макс местноевремя месяц мин минута монопольныйрежим найти найтинедопустимыесимволыxml найтиокнопонавигационнойссылке найтипомеченныенаудаление найтипоссылкам найтифайлы началогода началодня началоквартала началомесяца началоминуты началонедели началочаса начатьзапросразрешенияпользователя начатьзапускприложения начатькопированиефайла начатьперемещениефайла начатьподключениевнешнейкомпоненты начатьподключениерасширенияработыскриптографией начатьподключениерасширенияработысфайлами начатьпоискфайлов начатьполучениекаталогавременныхфайлов начатьполучениекаталогадокументов начатьполучениерабочегокаталогаданныхпользователя начатьполучениефайлов начатьпомещениефайла начатьпомещениефайлов начатьсозданиедвоичныхданныхизфайла начатьсозданиекаталога начатьтранзакцию начатьудалениефайлов начатьустановкувнешнейкомпоненты начатьустановкурасширенияработыскриптографией начатьустановкурасширенияработысфайлами неделягода необходимостьзавершениясоединения номерсеансаинформационнойбазы номерсоединенияинформационнойбазы нрег нстр обновитьинтерфейс обновитьнумерациюобъектов обновитьповторноиспользуемыезначения обработкапрерыванияпользователя объединитьфайлы окр описаниеошибки оповестить оповеститьобизменении отключитьобработчикзапросанастроекклиенталицензирования отключитьобработчикожидания отключитьобработчикоповещения открытьзначение открытьиндекссправки открытьсодержаниесправки открытьсправку открытьформу открытьформумодально отменитьтранзакцию очиститьжурналрегистрации очиститьнастройкипользователя очиститьсообщения параметрыдоступа перейтипонавигационнойссылке переместитьфайл подключитьвнешнююкомпоненту подключитьобработчикзапросанастроекклиенталицензирования подключитьобработчикожидания подключитьобработчикоповещения подключитьрасширениеработыскриптографией подключитьрасширениеработысфайлами подробноепредставлениеошибки показатьвводдаты показатьвводзначения показатьвводстроки показатьвводчисла показатьвопрос показатьзначение показатьинформациюобошибке показатьнакарте показатьоповещениепользователя показатьпредупреждение полноеимяпользователя получитьcomобъект получитьxmlтип получитьадреспоместоположению получитьблокировкусеансов получитьвремязавершенияспящегосеанса получитьвремязасыпанияпассивногосеанса получитьвремяожиданияблокировкиданных получитьданныевыбора получитьдополнительныйпараметрклиенталицензирования получитьдопустимыекодылокализации получитьдопустимыечасовыепояса получитьзаголовокклиентскогоприложения получитьзаголовоксистемы получитьзначенияотборажурналарегистрации получитьидентификаторконфигурации получитьизвременногохранилища получитьимявременногофайла получитьимяклиенталицензирования получитьинформациюэкрановклиента получитьиспользованиежурналарегистрации получитьиспользованиесобытияжурналарегистрации получитькраткийзаголовокприложения получитьмакетоформления получитьмаскувсефайлы получитьмаскувсефайлыклиента получитьмаскувсефайлысервера получитьместоположениепоадресу получитьминимальнуюдлинупаролейпользователей получитьнавигационнуюссылку получитьнавигационнуюссылкуинформационнойбазы получитьобновлениеконфигурациибазыданных получитьобновлениепредопределенныхданныхинформационнойбазы получитьобщиймакет получитьобщуюформу получитьокна получитьоперативнуюотметкувремени получитьотключениебезопасногорежима получитьпараметрыфункциональныхопцийинтерфейса получитьполноеимяпредопределенногозначения получитьпредставлениянавигационныхссылок получитьпроверкусложностипаролейпользователей получитьразделительпути получитьразделительпутиклиента получитьразделительпутисервера получитьсеансыинформационнойбазы получитьскоростьклиентскогосоединения получитьсоединенияинформационнойбазы получитьсообщенияпользователю получитьсоответствиеобъектаиформы получитьсоставстандартногоинтерфейсаodata получитьструктурухранениябазыданных получитьтекущийсеансинформационнойбазы получитьфайл получитьфайлы получитьформу получитьфункциональнуюопцию получитьфункциональнуюопциюинтерфейса получитьчасовойпоясинформационнойбазы пользователиос поместитьвовременноехранилище поместитьфайл поместитьфайлы прав праводоступа предопределенноезначение представлениекодалокализации представлениепериода представлениеправа представлениеприложения представлениесобытияжурналарегистрации представлениечасовогопояса предупреждение прекратитьработусистемы привилегированныйрежим продолжитьвызов прочитатьjson прочитатьxml прочитатьдатуjson пустаястрока рабочийкаталогданныхпользователя разблокироватьданныедляредактирования разделитьфайл разорватьсоединениесвнешнимисточникомданных раскодироватьстроку рольдоступна секунда сигнал символ скопироватьжурналрегистрации смещениелетнеговремени смещениестандартноговремени соединитьбуферыдвоичныхданных создатькаталог создатьфабрикуxdto сокрл сокрлп сокрп сообщить состояние сохранитьзначение сохранитьнастройкипользователя сред стрдлина стрзаканчиваетсяна стрзаменить стрнайти стрначинаетсяс строка строкасоединенияинформационнойбазы стрполучитьстроку стрразделить стрсоединить стрсравнить стрчисловхождений стрчислострок стршаблон текущаядата текущаядатасеанса текущаяуниверсальнаядата текущаяуниверсальнаядатавмиллисекундах текущийвариантинтерфейсаклиентскогоприложения текущийвариантосновногошрифтаклиентскогоприложения текущийкодлокализации текущийрежимзапуска текущийязык текущийязыксистемы тип типзнч транзакцияактивна трег удалитьданныеинформационнойбазы удалитьизвременногохранилища удалитьобъекты удалитьфайлы универсальноевремя установитьбезопасныйрежим установитьбезопасныйрежимразделенияданных установитьблокировкусеансов установитьвнешнююкомпоненту установитьвремязавершенияспящегосеанса установитьвремязасыпанияпассивногосеанса установитьвремяожиданияблокировкиданных установитьзаголовокклиентскогоприложения установитьзаголовоксистемы установитьиспользованиежурналарегистрации установитьиспользованиесобытияжурналарегистрации установитькраткийзаголовокприложения установитьминимальнуюдлинупаролейпользователей установитьмонопольныйрежим установитьнастройкиклиенталицензирования установитьобновлениепредопределенныхданныхинформационнойбазы установитьотключениебезопасногорежима установитьпараметрыфункциональныхопцийинтерфейса установитьпривилегированныйрежим установитьпроверкусложностипаролейпользователей установитьрасширениеработыскриптографией установитьрасширениеработысфайлами установитьсоединениесвнешнимисточникомданных установитьсоответствиеобъектаиформы установитьсоставстандартногоинтерфейсаodata установитьчасовойпоясинформационнойбазы установитьчасовойпояссеанса формат цел час часовойпояс часовойпояссеанса число числопрописью этоадресвременногохранилища " + "wsссылки библиотекакартинок библиотекамакетовоформлениякомпоновкиданных библиотекастилей бизнеспроцессы внешниеисточникиданных внешниеобработки внешниеотчеты встроенныепокупки главныйинтерфейс главныйстиль документы доставляемыеуведомления журналыдокументов задачи информацияобинтернетсоединении использованиерабочейдаты историяработыпользователя константы критерииотбора метаданные обработки отображениерекламы отправкадоставляемыхуведомлений отчеты панельзадачос параметрзапуска параметрысеанса перечисления планывидоврасчета планывидовхарактеристик планыобмена планысчетов полнотекстовыйпоиск пользователиинформационнойбазы последовательности проверкавстроенныхпокупок рабочаядата расширенияконфигурации регистрыбухгалтерии регистрынакопления регистрырасчета регистрысведений регламентныезадания сериализаторxdto справочники средствагеопозиционирования средствакриптографии средствамультимедиа средстваотображениярекламы средствапочты средствателефонии фабрикаxdto файловыепотоки фоновыезадания хранилищанастроек хранилищевариантовотчетов хранилищенастроекданныхформ хранилищеобщихнастроек хранилищепользовательскихнастроекдинамическихсписков хранилищепользовательскихнастроекотчетов хранилищесистемныхнастроек ", w = "webцвета windowsцвета windowsшрифты библиотекакартинок рамкистиля символы цветастиля шрифтыстиля " + "автоматическоесохранениеданныхформывнастройках автонумерациявформе автораздвижениесерий анимациядиаграммы вариантвыравниванияэлементовизаголовков вариантуправлениявысотойтаблицы вертикальнаяпрокруткаформы вертикальноеположение вертикальноеположениеэлемента видгруппыформы виддекорацииформы виддополненияэлементаформы видизмененияданных видкнопкиформы видпереключателя видподписейкдиаграмме видполяформы видфлажка влияниеразмеранапузырекдиаграммы горизонтальноеположение горизонтальноеположениеэлемента группировкаколонок группировкаподчиненныхэлементовформы группыиэлементы действиеперетаскивания дополнительныйрежимотображения допустимыедействияперетаскивания интервалмеждуэлементамиформы использованиевывода использованиеполосыпрокрутки используемоезначениеточкибиржевойдиаграммы историявыборапривводе источникзначенийоситочекдиаграммы источникзначенияразмерапузырькадиаграммы категориягруппыкоманд максимумсерий начальноеотображениедерева начальноеотображениесписка обновлениетекстаредактирования ориентациядендрограммы ориентациядиаграммы ориентацияметокдиаграммы ориентацияметоксводнойдиаграммы ориентацияэлементаформы отображениевдиаграмме отображениевлегендедиаграммы отображениегруппыкнопок отображениезаголовкашкалыдиаграммы отображениезначенийсводнойдиаграммы отображениезначенияизмерительнойдиаграммы отображениеинтерваладиаграммыганта отображениекнопки отображениекнопкивыбора отображениеобсужденийформы отображениеобычнойгруппы отображениеотрицательныхзначенийпузырьковойдиаграммы отображениепанелипоиска отображениеподсказки отображениепредупрежденияприредактировании отображениеразметкиполосырегулирования отображениестраницформы отображениетаблицы отображениетекстазначениядиаграммыганта отображениеуправленияобычнойгруппы отображениефигурыкнопки палитрацветовдиаграммы поведениеобычнойгруппы поддержкамасштабадендрограммы поддержкамасштабадиаграммыганта поддержкамасштабасводнойдиаграммы поисквтаблицепривводе положениезаголовкаэлементаформы положениекартинкикнопкиформы положениекартинкиэлементаграфическойсхемы положениекоманднойпанелиформы положениекоманднойпанелиэлементаформы положениеопорнойточкиотрисовки положениеподписейкдиаграмме положениеподписейшкалызначенийизмерительнойдиаграммы положениесостоянияпросмотра положениестрокипоиска положениетекстасоединительнойлинии положениеуправленияпоиском положениешкалывремени порядокотображенияточекгоризонтальнойгистограммы порядоксерийвлегендедиаграммы размеркартинки расположениезаголовкашкалыдиаграммы растягиваниеповертикалидиаграммыганта режимавтоотображениясостояния режимвводастроктаблицы режимвыборанезаполненного режимвыделениядаты режимвыделениястрокитаблицы режимвыделениятаблицы режимизмененияразмера режимизменениясвязанногозначения режимиспользованиядиалогапечати режимиспользованияпараметракоманды режиммасштабированияпросмотра режимосновногоокнаклиентскогоприложения режимоткрытияокнаформы режимотображениявыделения режимотображениягеографическойсхемы режимотображениязначенийсерии режимотрисовкисеткиграфическойсхемы режимполупрозрачностидиаграммы режимпробеловдиаграммы режимразмещениянастранице режимредактированияколонки режимсглаживаниядиаграммы режимсглаживанияиндикатора режимсписказадач сквозноевыравнивание сохранениеданныхформывнастройках способзаполнениятекстазаголовкашкалыдиаграммы способопределенияограничивающегозначениядиаграммы стандартнаягруппакоманд стандартноеоформление статусоповещенияпользователя стильстрелки типаппроксимациилиниитрендадиаграммы типдиаграммы типединицышкалывремени типимпортасерийслоягеографическойсхемы типлиниигеографическойсхемы типлиниидиаграммы типмаркерагеографическойсхемы типмаркерадиаграммы типобластиоформления типорганизацииисточникаданныхгеографическойсхемы типотображениясериислоягеографическойсхемы типотображенияточечногообъектагеографическойсхемы типотображенияшкалыэлементалегендыгеографическойсхемы типпоискаобъектовгеографическойсхемы типпроекциигеографическойсхемы типразмещенияизмерений типразмещенияреквизитовизмерений типрамкиэлементауправления типсводнойдиаграммы типсвязидиаграммыганта типсоединениязначенийпосериямдиаграммы типсоединенияточекдиаграммы типсоединительнойлинии типстороныэлементаграфическойсхемы типформыотчета типшкалырадарнойдиаграммы факторлиниитрендадиаграммы фигуракнопки фигурыграфическойсхемы фиксациявтаблице форматдняшкалывремени форматкартинки ширинаподчиненныхэлементовформы " + "виддвижениябухгалтерии виддвижениянакопления видпериодарегистрарасчета видсчета видточкимаршрутабизнеспроцесса использованиеагрегатарегистранакопления использованиегруппиэлементов использованиережимапроведения использованиесреза периодичностьагрегатарегистранакопления режимавтовремя режимзаписидокумента режимпроведениядокумента " + "авторегистрацияизменений допустимыйномерсообщения отправкаэлементаданных получениеэлементаданных " + "использованиерасшифровкитабличногодокумента ориентациястраницы положениеитоговколоноксводнойтаблицы положениеитоговстроксводнойтаблицы положениетекстаотносительнокартинки расположениезаголовкагруппировкитабличногодокумента способчтениязначенийтабличногодокумента типдвустороннейпечати типзаполненияобластитабличногодокумента типкурсоровтабличногодокумента типлиниирисункатабличногодокумента типлинииячейкитабличногодокумента типнаправленияпереходатабличногодокумента типотображениявыделениятабличногодокумента типотображениялинийсводнойтаблицы типразмещениятекстатабличногодокумента типрисункатабличногодокумента типсмещениятабличногодокумента типузоратабличногодокумента типфайлатабличногодокумента точностьпечати чередованиерасположениястраниц " + "отображениевремениэлементовпланировщика " + "типфайлаформатированногодокумента " + "обходрезультатазапроса типзаписизапроса " + "видзаполнениярасшифровкипостроителяотчета типдобавленияпредставлений типизмеренияпостроителяотчета типразмещенияитогов " + "доступкфайлу режимдиалогавыборафайла режимоткрытияфайла " + "типизмеренияпостроителязапроса " + "видданныханализа методкластеризации типединицыинтервалавременианализаданных типзаполнениятаблицырезультатаанализаданных типиспользованиячисловыхзначенийанализаданных типисточникаданныхпоискаассоциаций типколонкианализаданныхдереворешений типколонкианализаданныхкластеризация типколонкианализаданныхобщаястатистика типколонкианализаданныхпоискассоциаций типколонкианализаданныхпоискпоследовательностей типколонкимоделипрогноза типмерырасстоянияанализаданных типотсеченияправилассоциации типполяанализаданных типстандартизациианализаданных типупорядочиванияправилассоциациианализаданных типупорядочиванияшаблоновпоследовательностейанализаданных типупрощениядереварешений " + "wsнаправлениепараметра вариантxpathxs вариантзаписидатыjson вариантпростоготипаxs видгруппымоделиxs видфасетаxdto действиепостроителяdom завершенностьпростоготипаxs завершенностьсоставноготипаxs завершенностьсхемыxs запрещенныеподстановкиxs исключениягруппподстановкиxs категорияиспользованияатрибутаxs категорияограниченияидентичностиxs категорияограниченияпространствименxs методнаследованияxs модельсодержимогоxs назначениетипаxml недопустимыеподстановкиxs обработкапробельныхсимволовxs обработкасодержимогоxs ограничениезначенияxs параметрыотбораузловdom переносстрокjson позициявдокументеdom пробельныесимволыxml типатрибутаxml типзначенияjson типканоническогоxml типкомпонентыxs типпроверкиxml типрезультатаdomxpath типузлаdom типузлаxml формаxml формапредставленияxs форматдатыjson экранированиесимволовjson " + "видсравнениякомпоновкиданных действиеобработкирасшифровкикомпоновкиданных направлениесортировкикомпоновкиданных расположениевложенныхэлементоврезультатакомпоновкиданных расположениеитоговкомпоновкиданных расположениегруппировкикомпоновкиданных расположениеполейгруппировкикомпоновкиданных расположениеполякомпоновкиданных расположениереквизитовкомпоновкиданных расположениересурсовкомпоновкиданных типбухгалтерскогоостаткакомпоновкиданных типвыводатекстакомпоновкиданных типгруппировкикомпоновкиданных типгруппыэлементовотборакомпоновкиданных типдополненияпериодакомпоновкиданных типзаголовкаполейкомпоновкиданных типмакетагруппировкикомпоновкиданных типмакетаобластикомпоновкиданных типостаткакомпоновкиданных типпериодакомпоновкиданных типразмещениятекстакомпоновкиданных типсвязинаборовданныхкомпоновкиданных типэлементарезультатакомпоновкиданных расположениелегендыдиаграммыкомпоновкиданных типпримененияотборакомпоновкиданных режимотображенияэлементанастройкикомпоновкиданных режимотображениянастроеккомпоновкиданных состояниеэлементанастройкикомпоновкиданных способвосстановлениянастроеккомпоновкиданных режимкомпоновкирезультата использованиепараметракомпоновкиданных автопозицияресурсовкомпоновкиданных вариантиспользованиягруппировкикомпоновкиданных расположениересурсоввдиаграммекомпоновкиданных фиксациякомпоновкиданных использованиеусловногооформлениякомпоновкиданных " + "важностьинтернетпочтовогосообщения обработкатекстаинтернетпочтовогосообщения способкодированияинтернетпочтовоговложения способкодированиянеasciiсимволовинтернетпочтовогосообщения типтекстапочтовогосообщения протоколинтернетпочты статусразборапочтовогосообщения " + "режимтранзакциизаписижурналарегистрации статустранзакциизаписижурналарегистрации уровеньжурналарегистрации " + "расположениехранилищасертификатовкриптографии режимвключениясертификатовкриптографии режимпроверкисертификатакриптографии типхранилищасертификатовкриптографии " + "кодировкаименфайловвzipфайле методсжатияzip методшифрованияzip режимвосстановленияпутейфайловzip режимобработкиподкаталоговzip режимсохраненияпутейzip уровеньсжатияzip " + "звуковоеоповещение направлениепереходакстроке позициявпотоке порядокбайтов режимблокировкиданных режимуправленияблокировкойданных сервисвстроенныхпокупок состояниефоновогозадания типподписчикадоставляемыхуведомлений уровеньиспользованиязащищенногосоединенияftp " + "направлениепорядкасхемызапроса типдополненияпериодамисхемызапроса типконтрольнойточкисхемызапроса типобъединениясхемызапроса типпараметрадоступнойтаблицысхемызапроса типсоединениясхемызапроса " + "httpметод автоиспользованиеобщегореквизита автопрефиксномеразадачи вариантвстроенногоязыка видиерархии видрегистранакопления видтаблицывнешнегоисточникаданных записьдвиженийприпроведении заполнениепоследовательностей индексирование использованиебазыпланавидоврасчета использованиебыстроговыбора использованиеобщегореквизита использованиеподчинения использованиеполнотекстовогопоиска использованиеразделяемыхданныхобщегореквизита использованиереквизита назначениеиспользованияприложения назначениерасширенияконфигурации направлениепередачи обновлениепредопределенныхданных оперативноепроведение основноепредставлениевидарасчета основноепредставлениевидахарактеристики основноепредставлениезадачи основноепредставлениепланаобмена основноепредставлениесправочника основноепредставлениесчета перемещениеграницыприпроведении периодичностьномерабизнеспроцесса периодичностьномерадокумента периодичностьрегистрарасчета периодичностьрегистрасведений повторноеиспользованиевозвращаемыхзначений полнотекстовыйпоискпривводепостроке принадлежностьобъекта проведение разделениеаутентификацииобщегореквизита разделениеданныхобщегореквизита разделениерасширенийконфигурацииобщегореквизита режимавтонумерацииобъектов режимзаписирегистра режимиспользованиямодальности режимиспользованиясинхронныхвызововрасширенийплатформыивнешнихкомпонент режимповторногоиспользованиясеансов режимполученияданныхвыборапривводепостроке режимсовместимости режимсовместимостиинтерфейса режимуправленияблокировкойданныхпоумолчанию сериикодовпланавидовхарактеристик сериикодовпланасчетов сериикодовсправочника созданиепривводе способвыбора способпоискастрокипривводепостроке способредактирования типданныхтаблицывнешнегоисточникаданных типкодапланавидоврасчета типкодасправочника типмакета типномерабизнеспроцесса типномерадокумента типномеразадачи типформы удалениедвижений " + "важностьпроблемыприменениярасширенияконфигурации вариантинтерфейсаклиентскогоприложения вариантмасштабаформклиентскогоприложения вариантосновногошрифтаклиентскогоприложения вариантстандартногопериода вариантстандартнойдатыначала видграницы видкартинки видотображенияполнотекстовогопоиска видрамки видсравнения видцвета видчисловогозначения видшрифта допустимаядлина допустимыйзнак использованиеbyteordermark использованиеметаданныхполнотекстовогопоиска источникрасширенийконфигурации клавиша кодвозвратадиалога кодировкаxbase кодировкатекста направлениепоиска направлениесортировки обновлениепредопределенныхданных обновлениеприизмененииданных отображениепанелиразделов проверказаполнения режимдиалогавопрос режимзапускаклиентскогоприложения режимокругления режимоткрытияформприложения режимполнотекстовогопоиска скоростьклиентскогосоединения состояниевнешнегоисточникаданных состояниеобновленияконфигурациибазыданных способвыборасертификатаwindows способкодированиястроки статуссообщения типвнешнейкомпоненты типплатформы типповеденияклавишиenter типэлементаинформацииовыполненииобновленияконфигурациибазыданных уровеньизоляциитранзакций хешфункция частидаты", X = "comобъект ftpсоединение httpзапрос httpсервисответ httpсоединение wsопределения wsпрокси xbase анализданных аннотацияxs блокировкаданных буфердвоичныхданных включениеxs выражениекомпоновкиданных генераторслучайныхчисел географическаясхема географическиекоординаты графическаясхема группамоделиxs данныерасшифровкикомпоновкиданных двоичныеданные дендрограмма диаграмма диаграммаганта диалогвыборафайла диалогвыборацвета диалогвыборашрифта диалограсписаниярегламентногозадания диалогредактированиястандартногопериода диапазон документdom документhtml документацияxs доставляемоеуведомление записьdom записьfastinfoset записьhtml записьjson записьxml записьzipфайла записьданных записьтекста записьузловdom запрос защищенноесоединениеopenssl значенияполейрасшифровкикомпоновкиданных извлечениетекста импортxs интернетпочта интернетпочтовоесообщение интернетпочтовыйпрофиль интернетпрокси интернетсоединение информациядляприложенияxs использованиеатрибутаxs использованиесобытияжурналарегистрации источникдоступныхнастроеккомпоновкиданных итераторузловdom картинка квалификаторыдаты квалификаторыдвоичныхданных квалификаторыстроки квалификаторычисла компоновщикмакетакомпоновкиданных компоновщикнастроеккомпоновкиданных конструктормакетаоформлениякомпоновкиданных конструкторнастроеккомпоновкиданных конструкторформатнойстроки линия макеткомпоновкиданных макетобластикомпоновкиданных макетоформлениякомпоновкиданных маскаxs менеджеркриптографии наборсхемxml настройкикомпоновкиданных настройкисериализацииjson обработкакартинок обработкарасшифровкикомпоновкиданных обходдереваdom объявлениеатрибутаxs объявлениенотацииxs объявлениеэлементаxs описаниеиспользованиясобытиядоступжурналарегистрации описаниеиспользованиясобытияотказвдоступежурналарегистрации описаниеобработкирасшифровкикомпоновкиданных описаниепередаваемогофайла описаниетипов определениегруппыатрибутовxs определениегруппымоделиxs определениеограниченияидентичностиxs определениепростоготипаxs определениесоставноготипаxs определениетипадокументаdom определенияxpathxs отборкомпоновкиданных пакетотображаемыхдокументов параметрвыбора параметркомпоновкиданных параметрызаписиjson параметрызаписиxml параметрычтенияxml переопределениеxs планировщик полеанализаданных полекомпоновкиданных построительdom построительзапроса построительотчета построительотчетаанализаданных построительсхемxml поток потоквпамяти почта почтовоесообщение преобразованиеxsl преобразованиекканоническомуxml процессорвыводарезультатакомпоновкиданныхвколлекциюзначений процессорвыводарезультатакомпоновкиданныхвтабличныйдокумент процессоркомпоновкиданных разыменовательпространствименdom рамка расписаниерегламентногозадания расширенноеимяxml результатчтенияданных своднаядиаграмма связьпараметравыбора связьпотипу связьпотипукомпоновкиданных сериализаторxdto сертификатклиентаwindows сертификатклиентафайл сертификаткриптографии сертификатыудостоверяющихцентровwindows сертификатыудостоверяющихцентровфайл сжатиеданных системнаяинформация сообщениепользователю сочетаниеклавиш сравнениезначений стандартнаядатаначала стандартныйпериод схемаxml схемакомпоновкиданных табличныйдокумент текстовыйдокумент тестируемоеприложение типданныхxml уникальныйидентификатор фабрикаxdto файл файловыйпоток фасетдлиныxs фасетколичестваразрядовдробнойчастиxs фасетмаксимальноговключающегозначенияxs фасетмаксимальногоисключающегозначенияxs фасетмаксимальнойдлиныxs фасетминимальноговключающегозначенияxs фасетминимальногоисключающегозначенияxs фасетминимальнойдлиныxs фасетобразцаxs фасетобщегоколичестваразрядовxs фасетперечисленияxs фасетпробельныхсимволовxs фильтрузловdom форматированнаястрока форматированныйдокумент фрагментxs хешированиеданных хранилищезначения цвет чтениеfastinfoset чтениеhtml чтениеjson чтениеxml чтениеzipфайла чтениеданных чтениетекста чтениеузловdom шрифт элементрезультатакомпоновкиданных " + "comsafearray деревозначений массив соответствие списокзначений структура таблицазначений фиксированнаяструктура фиксированноесоответствие фиксированныймассив ", de = "null истина ложь неопределено", pe = t.inherit(t.NUMBER_MODE), le = {
    className: "string",
    begin: '"|\\|',
    end: '"|$',
    contains: [{ begin: '""' }]
  }, he = {
    begin: "'",
    end: "'",
    excludeBegin: !0,
    excludeEnd: !0,
    contains: [
      {
        className: "number",
        begin: "\\d{4}([\\.\\\\/:-]?\\d{2}){0,5}"
      }
    ]
  }, We = {
    match: /[;()+\-:=,]/,
    className: "punctuation",
    relevance: 0
  }, De = t.inherit(t.C_LINE_COMMENT_MODE), et = {
    className: "meta",
    begin: "#|&",
    end: "$",
    keywords: {
      $pattern: e,
      keyword: i + s
    },
    contains: [De]
  }, Ke = {
    className: "symbol",
    begin: "~",
    end: ";|:",
    excludeEnd: !0
  }, st = {
    className: "function",
    variants: [
      {
        begin: "процедура|функция",
        end: "\\)",
        keywords: "процедура функция"
      },
      {
        begin: "конецпроцедуры|конецфункции",
        keywords: "конецпроцедуры конецфункции"
      }
    ],
    contains: [
      {
        begin: "\\(",
        end: "\\)",
        endsParent: !0,
        contains: [
          {
            className: "params",
            begin: e,
            end: ",",
            excludeEnd: !0,
            endsWithParent: !0,
            keywords: {
              $pattern: e,
              keyword: "знач",
              literal: de
            },
            contains: [
              pe,
              le,
              he
            ]
          },
          De
        ]
      },
      t.inherit(t.TITLE_MODE, { begin: e })
    ]
  };
  return {
    name: "1C:Enterprise",
    case_insensitive: !0,
    keywords: {
      $pattern: e,
      keyword: i,
      built_in: p,
      class: w,
      type: X,
      literal: de
    },
    contains: [
      et,
      st,
      De,
      Ke,
      pe,
      le,
      he,
      We
    ]
  };
}
function fI(t) {
  const e = t.regex, n = /^[a-zA-Z][a-zA-Z0-9-]*/, r = [
    "ALPHA",
    "BIT",
    "CHAR",
    "CR",
    "CRLF",
    "CTL",
    "DIGIT",
    "DQUOTE",
    "HEXDIG",
    "HTAB",
    "LF",
    "LWSP",
    "OCTET",
    "SP",
    "VCHAR",
    "WSP"
  ], i = t.COMMENT(/;/, /$/), o = {
    scope: "symbol",
    match: /%b[0-1]+(-[0-1]+|(\.[0-1]+)+)?/
  }, a = {
    scope: "symbol",
    match: /%d[0-9]+(-[0-9]+|(\.[0-9]+)+)?/
  }, s = {
    scope: "symbol",
    match: /%x[0-9A-F]+(-[0-9A-F]+|(\.[0-9A-F]+)+)?/
  }, l = {
    scope: "symbol",
    match: /%[si](?=".*")/
  }, c = {
    scope: "attribute",
    match: e.concat(n, /(?=\s*=)/)
  };
  return {
    name: "Augmented Backus-Naur Form",
    illegal: /[!@#$^&',?+~`|:]/,
    keywords: r,
    contains: [
      {
        scope: "operator",
        match: /=\/?/
      },
      c,
      i,
      o,
      a,
      s,
      l,
      t.QUOTE_STRING_MODE,
      t.NUMBER_MODE
    ]
  };
}
function gI(t) {
  const e = t.regex, n = [
    "GET",
    "POST",
    "HEAD",
    "PUT",
    "DELETE",
    "CONNECT",
    "OPTIONS",
    "PATCH",
    "TRACE"
  ];
  return {
    name: "Apache Access Log",
    contains: [
      // IP
      {
        className: "number",
        begin: /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?\b/,
        relevance: 5
      },
      // Other numbers
      {
        className: "number",
        begin: /\b\d+\b/,
        relevance: 0
      },
      // Requests
      {
        className: "string",
        begin: e.concat(/"/, e.either(...n)),
        end: /"/,
        keywords: n,
        illegal: /\n/,
        relevance: 5,
        contains: [
          {
            begin: /HTTP\/[12]\.\d'/,
            relevance: 5
          }
        ]
      },
      // Dates
      {
        className: "string",
        // dates must have a certain length, this prevents matching
        // simple array accesses a[123] and [] and other common patterns
        // found in other languages
        begin: /\[\d[^\]\n]{8,}\]/,
        illegal: /\n/,
        relevance: 1
      },
      {
        className: "string",
        begin: /\[/,
        end: /\]/,
        illegal: /\n/,
        relevance: 0
      },
      // User agent / relevance boost
      {
        className: "string",
        begin: /"Mozilla\/\d\.\d \(/,
        end: /"/,
        illegal: /\n/,
        relevance: 3
      },
      // Strings
      {
        className: "string",
        begin: /"/,
        end: /"/,
        illegal: /\n/,
        relevance: 0
      }
    ]
  };
}
function hI(t) {
  const e = t.regex, n = /[a-zA-Z_$][a-zA-Z0-9_$]*/, r = e.concat(
    n,
    e.concat("(\\.", n, ")*")
  ), i = /([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)/, o = {
    className: "rest_arg",
    begin: /[.]{3}/,
    end: n,
    relevance: 10
  };
  return {
    name: "ActionScript",
    aliases: ["as"],
    keywords: {
      keyword: [
        "as",
        "break",
        "case",
        "catch",
        "class",
        "const",
        "continue",
        "default",
        "delete",
        "do",
        "dynamic",
        "each",
        "else",
        "extends",
        "final",
        "finally",
        "for",
        "function",
        "get",
        "if",
        "implements",
        "import",
        "in",
        "include",
        "instanceof",
        "interface",
        "internal",
        "is",
        "namespace",
        "native",
        "new",
        "override",
        "package",
        "private",
        "protected",
        "public",
        "return",
        "set",
        "static",
        "super",
        "switch",
        "this",
        "throw",
        "try",
        "typeof",
        "use",
        "var",
        "void",
        "while",
        "with"
      ],
      literal: [
        "true",
        "false",
        "null",
        "undefined"
      ]
    },
    contains: [
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.C_NUMBER_MODE,
      {
        match: [
          /\bpackage/,
          /\s+/,
          r
        ],
        className: {
          1: "keyword",
          3: "title.class"
        }
      },
      {
        match: [
          /\b(?:class|interface|extends|implements)/,
          /\s+/,
          n
        ],
        className: {
          1: "keyword",
          3: "title.class"
        }
      },
      {
        className: "meta",
        beginKeywords: "import include",
        end: /;/,
        keywords: { keyword: "import include" }
      },
      {
        beginKeywords: "function",
        end: /[{;]/,
        excludeEnd: !0,
        illegal: /\S/,
        contains: [
          t.inherit(t.TITLE_MODE, { className: "title.function" }),
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            contains: [
              t.APOS_STRING_MODE,
              t.QUOTE_STRING_MODE,
              t.C_LINE_COMMENT_MODE,
              t.C_BLOCK_COMMENT_MODE,
              o
            ]
          },
          { begin: e.concat(/:\s*/, i) }
        ]
      },
      t.METHOD_GUARD
    ],
    illegal: /#/
  };
}
function EI(t) {
  const e = "\\d(_|\\d)*", n = "[eE][-+]?" + e, r = e + "(\\." + e + ")?(" + n + ")?", i = "\\w+", a = "\\b(" + (e + "#" + i + "(\\." + i + ")?#(" + n + ")?") + "|" + r + ")", s = "[A-Za-z](_?[A-Za-z0-9.])*", l = `[]\\{\\}%#'"`, c = t.COMMENT("--", "$"), u = {
    // TODO: These spaces are not required by the Ada syntax
    // however, I have yet to see handwritten Ada code where
    // someone does not put spaces around :
    begin: "\\s+:\\s+",
    end: "\\s*(:=|;|\\)|=>|$)",
    // endsWithParent: true,
    // returnBegin: true,
    illegal: l,
    contains: [
      {
        // workaround to avoid highlighting
        // named loops and declare blocks
        beginKeywords: "loop for declare others",
        endsParent: !0
      },
      {
        // properly highlight all modifiers
        className: "keyword",
        beginKeywords: "not null constant access function procedure in out aliased exception"
      },
      {
        className: "type",
        begin: s,
        endsParent: !0,
        relevance: 0
      }
    ]
  };
  return {
    name: "Ada",
    case_insensitive: !0,
    keywords: {
      keyword: [
        "abort",
        "else",
        "new",
        "return",
        "abs",
        "elsif",
        "not",
        "reverse",
        "abstract",
        "end",
        "accept",
        "entry",
        "select",
        "access",
        "exception",
        "of",
        "separate",
        "aliased",
        "exit",
        "or",
        "some",
        "all",
        "others",
        "subtype",
        "and",
        "for",
        "out",
        "synchronized",
        "array",
        "function",
        "overriding",
        "at",
        "tagged",
        "generic",
        "package",
        "task",
        "begin",
        "goto",
        "pragma",
        "terminate",
        "body",
        "private",
        "then",
        "if",
        "procedure",
        "type",
        "case",
        "in",
        "protected",
        "constant",
        "interface",
        "is",
        "raise",
        "use",
        "declare",
        "range",
        "delay",
        "limited",
        "record",
        "when",
        "delta",
        "loop",
        "rem",
        "while",
        "digits",
        "renames",
        "with",
        "do",
        "mod",
        "requeue",
        "xor"
      ],
      literal: [
        "True",
        "False"
      ]
    },
    contains: [
      c,
      // strings "foobar"
      {
        className: "string",
        begin: /"/,
        end: /"/,
        contains: [
          {
            begin: /""/,
            relevance: 0
          }
        ]
      },
      // characters ''
      {
        // character literals always contain one char
        className: "string",
        begin: /'.'/
      },
      {
        // number literals
        className: "number",
        begin: a,
        relevance: 0
      },
      {
        // Attributes
        className: "symbol",
        begin: "'" + s
      },
      {
        // package definition, maybe inside generic
        className: "title",
        begin: "(\\bwith\\s+)?(\\bprivate\\s+)?\\bpackage\\s+(\\bbody\\s+)?",
        end: "(is|$)",
        keywords: "package body",
        excludeBegin: !0,
        excludeEnd: !0,
        illegal: l
      },
      {
        // function/procedure declaration/definition
        // maybe inside generic
        begin: "(\\b(with|overriding)\\s+)?\\b(function|procedure)\\s+",
        end: "(\\bis|\\bwith|\\brenames|\\)\\s*;)",
        keywords: "overriding function procedure with is renames return",
        // we need to re-match the 'function' keyword, so that
        // the title mode below matches only exactly once
        returnBegin: !0,
        contains: [
          c,
          {
            // name of the function/procedure
            className: "title",
            begin: "(\\bwith\\s+)?\\b(function|procedure)\\s+",
            end: "(\\(|\\s+|$)",
            excludeBegin: !0,
            excludeEnd: !0,
            illegal: l
          },
          // 'self'
          // // parameter types
          u,
          {
            // return type
            className: "type",
            begin: "\\breturn\\s+",
            end: "(\\s+|;|$)",
            keywords: "return",
            excludeBegin: !0,
            excludeEnd: !0,
            // we are done with functions
            endsParent: !0,
            illegal: l
          }
        ]
      },
      {
        // new type declarations
        // maybe inside generic
        className: "type",
        begin: "\\b(sub)?type\\s+",
        end: "\\s+",
        keywords: "type",
        excludeBegin: !0,
        illegal: l
      },
      // see comment above the definition
      u
      // no markup
      // relevance boosters for small snippets
      // {begin: '\\s*=>\\s*'},
      // {begin: '\\s*:=\\s*'},
      // {begin: '\\s+:=\\s+'},
    ]
  };
}
function SI(t) {
  const e = {
    className: "built_in",
    begin: "\\b(void|bool|int8|int16|int32|int64|int|uint8|uint16|uint32|uint64|uint|string|ref|array|double|float|auto|dictionary)"
  }, n = {
    className: "symbol",
    begin: "[a-zA-Z0-9_]+@"
  }, r = {
    className: "keyword",
    begin: "<",
    end: ">",
    contains: [
      e,
      n
    ]
  };
  return e.contains = [r], n.contains = [r], {
    name: "AngelScript",
    aliases: ["asc"],
    keywords: [
      "for",
      "in|0",
      "break",
      "continue",
      "while",
      "do|0",
      "return",
      "if",
      "else",
      "case",
      "switch",
      "namespace",
      "is",
      "cast",
      "or",
      "and",
      "xor",
      "not",
      "get|0",
      "in",
      "inout|10",
      "out",
      "override",
      "set|0",
      "private",
      "public",
      "const",
      "default|0",
      "final",
      "shared",
      "external",
      "mixin|10",
      "enum",
      "typedef",
      "funcdef",
      "this",
      "super",
      "import",
      "from",
      "interface",
      "abstract|0",
      "try",
      "catch",
      "protected",
      "explicit",
      "property"
    ],
    // avoid close detection with C# and JS
    illegal: "(^using\\s+[A-Za-z0-9_\\.]+;$|\\bfunction\\s*[^\\(])",
    contains: [
      {
        // 'strings'
        className: "string",
        begin: "'",
        end: "'",
        illegal: "\\n",
        contains: [t.BACKSLASH_ESCAPE],
        relevance: 0
      },
      // """heredoc strings"""
      {
        className: "string",
        begin: '"""',
        end: '"""'
      },
      {
        // "strings"
        className: "string",
        begin: '"',
        end: '"',
        illegal: "\\n",
        contains: [t.BACKSLASH_ESCAPE],
        relevance: 0
      },
      t.C_LINE_COMMENT_MODE,
      // single-line comments
      t.C_BLOCK_COMMENT_MODE,
      // comment blocks
      {
        // metadata
        className: "string",
        begin: "^\\s*\\[",
        end: "\\]"
      },
      {
        // interface or namespace declaration
        beginKeywords: "interface namespace",
        end: /\{/,
        illegal: "[;.\\-]",
        contains: [
          {
            // interface or namespace name
            className: "symbol",
            begin: "[a-zA-Z0-9_]+"
          }
        ]
      },
      {
        // class declaration
        beginKeywords: "class",
        end: /\{/,
        illegal: "[;.\\-]",
        contains: [
          {
            // class name
            className: "symbol",
            begin: "[a-zA-Z0-9_]+",
            contains: [
              {
                begin: "[:,]\\s*",
                contains: [
                  {
                    className: "symbol",
                    begin: "[a-zA-Z0-9_]+"
                  }
                ]
              }
            ]
          }
        ]
      },
      e,
      // built-in types
      n,
      // object handles
      {
        // literals
        className: "literal",
        begin: "\\b(null|true|false)"
      },
      {
        // numbers
        className: "number",
        relevance: 0,
        begin: "(-?)(\\b0[xXbBoOdD][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?f?|\\.\\d+f?)([eE][-+]?\\d+f?)?)"
      }
    ]
  };
}
function bI(t) {
  const e = {
    className: "number",
    begin: /[$%]\d+/
  }, n = {
    className: "number",
    begin: /\b\d+/
  }, r = {
    className: "number",
    begin: /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(:\d{1,5})?/
  }, i = {
    className: "number",
    begin: /:\d{1,5}/
  };
  return {
    name: "Apache config",
    aliases: ["apacheconf"],
    case_insensitive: !0,
    contains: [
      t.HASH_COMMENT_MODE,
      {
        className: "section",
        begin: /<\/?/,
        end: />/,
        contains: [
          r,
          i,
          // low relevance prevents us from claming XML/HTML where this rule would
          // match strings inside of XML tags
          t.inherit(t.QUOTE_STRING_MODE, { relevance: 0 })
        ]
      },
      {
        className: "attribute",
        begin: /\w+/,
        relevance: 0,
        // keywords aren’t needed for highlighting per se, they only boost relevance
        // for a very generally defined mode (starts with a word, ends with line-end
        keywords: { _: [
          "order",
          "deny",
          "allow",
          "setenv",
          "rewriterule",
          "rewriteengine",
          "rewritecond",
          "documentroot",
          "sethandler",
          "errordocument",
          "loadmodule",
          "options",
          "header",
          "listen",
          "serverroot",
          "servername"
        ] },
        starts: {
          end: /$/,
          relevance: 0,
          keywords: { literal: "on off all deny allow" },
          contains: [
            {
              scope: "punctuation",
              match: /\\\n/
            },
            {
              className: "meta",
              begin: /\s\[/,
              end: /\]$/
            },
            {
              className: "variable",
              begin: /[\$%]\{/,
              end: /\}/,
              contains: [
                "self",
                e
              ]
            },
            r,
            n,
            t.QUOTE_STRING_MODE
          ]
        }
      }
    ],
    illegal: /\S/
  };
}
function TI(t) {
  const e = t.regex, n = t.inherit(
    t.QUOTE_STRING_MODE,
    { illegal: null }
  ), r = {
    className: "params",
    begin: /\(/,
    end: /\)/,
    contains: [
      "self",
      t.C_NUMBER_MODE,
      n
    ]
  }, i = t.COMMENT(/--/, /$/), o = t.COMMENT(
    /\(\*/,
    /\*\)/,
    { contains: [
      "self",
      // allow nesting
      i
    ] }
  ), a = [
    i,
    o,
    t.HASH_COMMENT_MODE
  ], s = [
    /apart from/,
    /aside from/,
    /instead of/,
    /out of/,
    /greater than/,
    /isn't|(doesn't|does not) (equal|come before|come after|contain)/,
    /(greater|less) than( or equal)?/,
    /(starts?|ends|begins?) with/,
    /contained by/,
    /comes (before|after)/,
    /a (ref|reference)/,
    /POSIX (file|path)/,
    /(date|time) string/,
    /quoted form/
  ], l = [
    /clipboard info/,
    /the clipboard/,
    /info for/,
    /list (disks|folder)/,
    /mount volume/,
    /path to/,
    /(close|open for) access/,
    /(get|set) eof/,
    /current date/,
    /do shell script/,
    /get volume settings/,
    /random number/,
    /set volume/,
    /system attribute/,
    /system info/,
    /time to GMT/,
    /(load|run|store) script/,
    /scripting components/,
    /ASCII (character|number)/,
    /localized string/,
    /choose (application|color|file|file name|folder|from list|remote application|URL)/,
    /display (alert|dialog)/
  ];
  return {
    name: "AppleScript",
    aliases: ["osascript"],
    keywords: {
      keyword: "about above after against and around as at back before beginning behind below beneath beside between but by considering contain contains continue copy div does eighth else end equal equals error every exit fifth first for fourth from front get given global if ignoring in into is it its last local me middle mod my ninth not of on onto or over prop property put ref reference repeat returning script second set seventh since sixth some tell tenth that the|0 then third through thru timeout times to transaction try until where while whose with without",
      literal: "AppleScript false linefeed return pi quote result space tab true",
      built_in: "alias application boolean class constant date file integer list number real record string text activate beep count delay launch log offset read round run say summarize write character characters contents day frontmost id item length month name|0 paragraph paragraphs rest reverse running time version weekday word words year"
    },
    contains: [
      n,
      t.C_NUMBER_MODE,
      {
        className: "built_in",
        begin: e.concat(
          /\b/,
          e.either(...l),
          /\b/
        )
      },
      {
        className: "built_in",
        begin: /^\s*return\b/
      },
      {
        className: "literal",
        begin: /\b(text item delimiters|current application|missing value)\b/
      },
      {
        className: "keyword",
        begin: e.concat(
          /\b/,
          e.either(...s),
          /\b/
        )
      },
      {
        beginKeywords: "on",
        illegal: /[${=;\n]/,
        contains: [
          t.UNDERSCORE_TITLE_MODE,
          r
        ]
      },
      ...a
    ],
    illegal: /\/\/|->|=>|\[\[/
  };
}
function CI(t) {
  const e = t.regex, n = "[A-Za-z_][0-9A-Za-z_]*", r = {
    keyword: [
      "break",
      "case",
      "catch",
      "continue",
      "debugger",
      "do",
      "else",
      "export",
      "for",
      "function",
      "if",
      "import",
      "in",
      "new",
      "of",
      "return",
      "switch",
      "try",
      "var",
      "void",
      "while"
    ],
    literal: [
      "BackSlash",
      "DoubleQuote",
      "ForwardSlash",
      "Infinity",
      "NaN",
      "NewLine",
      "PI",
      "SingleQuote",
      "Tab",
      "TextFormatting",
      "false",
      "null",
      "true",
      "undefined"
    ],
    built_in: [
      "Abs",
      "Acos",
      "All",
      "Angle",
      "Any",
      "Area",
      "AreaGeodetic",
      "Array",
      "Asin",
      "Atan",
      "Atan2",
      "Attachments",
      "Average",
      "Back",
      "Bearing",
      "Boolean",
      "Buffer",
      "BufferGeodetic",
      "Ceil",
      "Centroid",
      "ChangeTimeZone",
      "Clip",
      "Concatenate",
      "Console",
      "Constrain",
      "Contains",
      "ConvertDirection",
      "ConvexHull",
      "Cos",
      "Count",
      "Crosses",
      "Cut",
      "Date|0",
      "DateAdd",
      "DateDiff",
      "DateOnly",
      "Day",
      "Decode",
      "DefaultValue",
      "Densify",
      "DensifyGeodetic",
      "Dictionary",
      "Difference",
      "Disjoint",
      "Distance",
      "DistanceGeodetic",
      "DistanceToCoordinate",
      "Distinct",
      "Domain",
      "DomainCode",
      "DomainName",
      "EnvelopeIntersects",
      "Equals",
      "Erase",
      "Exp",
      "Expects",
      "Extent",
      "Feature",
      "FeatureInFilter",
      "FeatureSet",
      "FeatureSetByAssociation",
      "FeatureSetById",
      "FeatureSetByName",
      "FeatureSetByPortalItem",
      "FeatureSetByRelationshipClass",
      "FeatureSetByRelationshipName",
      "Filter",
      "FilterBySubtypeCode",
      "Find",
      "First|0",
      "Floor",
      "FromCharCode",
      "FromCodePoint",
      "FromJSON",
      "Front",
      "GdbVersion",
      "Generalize",
      "Geometry",
      "GetEnvironment",
      "GetFeatureSet",
      "GetFeatureSetInfo",
      "GetUser",
      "GroupBy",
      "Guid",
      "HasKey",
      "HasValue",
      "Hash",
      "Hour",
      "IIf",
      "ISOMonth",
      "ISOWeek",
      "ISOWeekday",
      "ISOYear",
      "Includes",
      "IndexOf",
      "Insert",
      "Intersection",
      "Intersects",
      "IsEmpty",
      "IsNan",
      "IsSelfIntersecting",
      "IsSimple",
      "KnowledgeGraphByPortalItem",
      "Left|0",
      "Length",
      "Length3D",
      "LengthGeodetic",
      "Log",
      "Lower",
      "Map",
      "Max",
      "Mean",
      "MeasureToCoordinate",
      "Mid",
      "Millisecond",
      "Min",
      "Minute",
      "Month",
      "MultiPartToSinglePart",
      "Multipoint",
      "NearestCoordinate",
      "NearestVertex",
      "NextSequenceValue",
      "None",
      "Now",
      "Number",
      "Offset",
      "OrderBy",
      "Overlaps",
      "Point",
      "PointToCoordinate",
      "Polygon",
      "Polyline",
      "Pop",
      "Portal",
      "Pow",
      "Proper",
      "Push",
      "QueryGraph",
      "Random",
      "Reduce",
      "Relate",
      "Replace",
      "Resize",
      "Reverse",
      "Right|0",
      "RingIsClockwise",
      "Rotate",
      "Round",
      "Schema",
      "Second",
      "SetGeometry",
      "Simplify",
      "Sin",
      "Slice",
      "Sort",
      "Splice",
      "Split",
      "Sqrt",
      "StandardizeFilename",
      "StandardizeGuid",
      "Stdev",
      "SubtypeCode",
      "SubtypeName",
      "Subtypes",
      "Sum",
      "SymmetricDifference",
      "Tan",
      "Text",
      "Time",
      "TimeZone",
      "TimeZoneOffset",
      "Timestamp",
      "ToCharCode",
      "ToCodePoint",
      "ToHex",
      "ToLocal",
      "ToUTC",
      "Today",
      "Top|0",
      "Touches",
      "TrackAccelerationAt",
      "TrackAccelerationWindow",
      "TrackCurrentAcceleration",
      "TrackCurrentDistance",
      "TrackCurrentSpeed",
      "TrackCurrentTime",
      "TrackDistanceAt",
      "TrackDistanceWindow",
      "TrackDuration",
      "TrackFieldWindow",
      "TrackGeometryWindow",
      "TrackIndex",
      "TrackSpeedAt",
      "TrackSpeedWindow",
      "TrackStartTime",
      "TrackWindow",
      "Trim",
      "TypeOf",
      "Union",
      "Upper",
      "UrlEncode",
      "Variance",
      "Week",
      "Weekday",
      "When|0",
      "Within",
      "Year|0"
    ]
  }, i = [
    "aggregatedFeatures",
    "analytic",
    "config",
    "datapoint",
    "datastore",
    "editcontext",
    "feature",
    "featureSet",
    "feedfeature",
    "fencefeature",
    "fencenotificationtype",
    "graph",
    "join",
    "layer",
    "locationupdate",
    "map",
    "measure",
    "measure",
    "originalFeature",
    "record",
    "reference",
    "rowindex",
    "sourcedatastore",
    "sourcefeature",
    "sourcelayer",
    "target",
    "targetdatastore",
    "targetfeature",
    "targetlayer",
    "userInput",
    "value",
    "variables",
    "view"
  ], o = {
    className: "symbol",
    begin: "\\$" + e.either(...i)
  }, a = {
    className: "number",
    variants: [
      { begin: "\\b(0[bB][01]+)" },
      { begin: "\\b(0[oO][0-7]+)" },
      { begin: t.C_NUMBER_RE }
    ],
    relevance: 0
  }, s = {
    className: "subst",
    begin: "\\$\\{",
    end: "\\}",
    keywords: r,
    contains: []
    // defined later
  }, l = {
    className: "string",
    begin: "`",
    end: "`",
    contains: [
      t.BACKSLASH_ESCAPE,
      s
    ]
  };
  s.contains = [
    t.APOS_STRING_MODE,
    t.QUOTE_STRING_MODE,
    l,
    a,
    t.REGEXP_MODE
  ];
  const c = s.contains.concat([
    t.C_BLOCK_COMMENT_MODE,
    t.C_LINE_COMMENT_MODE
  ]);
  return {
    name: "ArcGIS Arcade",
    case_insensitive: !0,
    keywords: r,
    contains: [
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      l,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      o,
      a,
      {
        // object attr container
        begin: /[{,]\s*/,
        relevance: 0,
        contains: [
          {
            begin: n + "\\s*:",
            returnBegin: !0,
            relevance: 0,
            contains: [
              {
                className: "attr",
                begin: n,
                relevance: 0
              }
            ]
          }
        ]
      },
      {
        // "value" container
        begin: "(" + t.RE_STARTERS_RE + "|\\b(return)\\b)\\s*",
        keywords: "return",
        contains: [
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE,
          t.REGEXP_MODE,
          {
            className: "function",
            begin: "(\\(.*?\\)|" + n + ")\\s*=>",
            returnBegin: !0,
            end: "\\s*=>",
            contains: [
              {
                className: "params",
                variants: [
                  { begin: n },
                  { begin: /\(\s*\)/ },
                  {
                    begin: /\(/,
                    end: /\)/,
                    excludeBegin: !0,
                    excludeEnd: !0,
                    keywords: r,
                    contains: c
                  }
                ]
              }
            ]
          }
        ],
        relevance: 0
      },
      {
        beginKeywords: "function",
        end: /\{/,
        excludeEnd: !0,
        contains: [
          t.inherit(t.TITLE_MODE, {
            className: "title.function",
            begin: n
          }),
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            excludeBegin: !0,
            excludeEnd: !0,
            contains: c
          }
        ],
        illegal: /\[|%/
      },
      { begin: /\$[(.]/ }
    ],
    illegal: /#(?!!)/
  };
}
function yI(t) {
  const e = { variants: [
    t.COMMENT("^[ \\t]*(?=#)", "$", {
      relevance: 0,
      excludeBegin: !0
    }),
    t.COMMENT("[;@]", "$", { relevance: 0 }),
    t.C_LINE_COMMENT_MODE,
    t.C_BLOCK_COMMENT_MODE
  ] };
  return {
    name: "ARM Assembly",
    case_insensitive: !0,
    aliases: ["arm"],
    keywords: {
      $pattern: "\\.?" + t.IDENT_RE,
      meta: (
        // GNU preprocs
        ".2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .arm .thumb .code16 .code32 .force_thumb .thumb_func .ltorg ALIAS ALIGN ARM AREA ASSERT ATTR CN CODE CODE16 CODE32 COMMON CP DATA DCB DCD DCDU DCDO DCFD DCFDU DCI DCQ DCQU DCW DCWU DN ELIF ELSE END ENDFUNC ENDIF ENDP ENTRY EQU EXPORT EXPORTAS EXTERN FIELD FILL FUNCTION GBLA GBLL GBLS GET GLOBAL IF IMPORT INCBIN INCLUDE INFO KEEP LCLA LCLL LCLS LTORG MACRO MAP MEND MEXIT NOFP OPT PRESERVE8 PROC QN READONLY RELOC REQUIRE REQUIRE8 RLIST FN ROUT SETA SETL SETS SN SPACE SUBT THUMB THUMBX TTL WHILE WEND "
      ),
      built_in: "r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 w0 w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 w13 w14 w15 w16 w17 w18 w19 w20 w21 w22 w23 w24 w25 w26 w27 w28 w29 w30 x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24 x25 x26 x27 x28 x29 x30 pc lr sp ip sl sb fp a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 q0 q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 cpsr_c cpsr_x cpsr_s cpsr_f cpsr_cx cpsr_cxs cpsr_xs cpsr_xsf cpsr_sf cpsr_cxsf spsr_c spsr_x spsr_s spsr_f spsr_cx spsr_cxs spsr_xs spsr_xsf spsr_sf spsr_cxsf s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30 d31 {PC} {VAR} {TRUE} {FALSE} {OPT} {CONFIG} {ENDIAN} {CODESIZE} {CPU} {FPU} {ARCHITECTURE} {PCSTOREOFFSET} {ARMASM_VERSION} {INTER} {ROPI} {RWPI} {SWST} {NOSWST} . @"
    },
    contains: [
      {
        className: "keyword",
        begin: "\\b(adc|(qd?|sh?|u[qh]?)?add(8|16)?|usada?8|(q|sh?|u[qh]?)?(as|sa)x|and|adrl?|sbc|rs[bc]|asr|b[lx]?|blx|bxj|cbn?z|tb[bh]|bic|bfc|bfi|[su]bfx|bkpt|cdp2?|clz|clrex|cmp|cmn|cpsi[ed]|cps|setend|dbg|dmb|dsb|eor|isb|it[te]{0,3}|lsl|lsr|ror|rrx|ldm(([id][ab])|f[ds])?|ldr((s|ex)?[bhd])?|movt?|mvn|mra|mar|mul|[us]mull|smul[bwt][bt]|smu[as]d|smmul|smmla|mla|umlaal|smlal?([wbt][bt]|d)|mls|smlsl?[ds]|smc|svc|sev|mia([bt]{2}|ph)?|mrr?c2?|mcrr2?|mrs|msr|orr|orn|pkh(tb|bt)|rbit|rev(16|sh)?|sel|[su]sat(16)?|nop|pop|push|rfe([id][ab])?|stm([id][ab])?|str(ex)?[bhd]?|(qd?)?sub|(sh?|q|u[qh]?)?sub(8|16)|[su]xt(a?h|a?b(16)?)|srs([id][ab])?|swpb?|swi|smi|tst|teq|wfe|wfi|yield)(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo)?[sptrx]?(?=\\s)"
        // followed by space
      },
      e,
      t.QUOTE_STRING_MODE,
      {
        className: "string",
        begin: "'",
        end: "[^\\\\]'",
        relevance: 0
      },
      {
        className: "title",
        begin: "\\|",
        end: "\\|",
        illegal: "\\n",
        relevance: 0
      },
      {
        className: "number",
        variants: [
          {
            // hex
            begin: "[#$=]?0x[0-9a-f]+"
          },
          {
            // bin
            begin: "[#$=]?0b[01]+"
          },
          {
            // literal
            begin: "[#$=]\\d+"
          },
          {
            // bare number
            begin: "\\b\\d+"
          }
        ],
        relevance: 0
      },
      {
        className: "symbol",
        variants: [
          {
            // GNU ARM syntax
            begin: "^[ \\t]*[a-z_\\.\\$][a-z0-9_\\.\\$]+:"
          },
          {
            // ARM syntax
            begin: "^[a-z_\\.\\$][a-z0-9_\\.\\$]+"
          },
          {
            // label reference
            begin: "[=#]\\w+"
          }
        ],
        relevance: 0
      }
    ]
  };
}
function vI(t) {
  const e = t.regex, n = {
    begin: "^'{3,}[ \\t]*$",
    relevance: 10
  }, r = [
    // escaped constrained formatting marks (i.e., \* \_ or \`)
    { begin: /\\[*_`]/ },
    // escaped unconstrained formatting marks (i.e., \\** \\__ or \\``)
    // must ignore until the next formatting marks
    // this rule might not be 100% compliant with Asciidoctor 2.0 but we are entering undefined behavior territory...
    { begin: /\\\\\*{2}[^\n]*?\*{2}/ },
    { begin: /\\\\_{2}[^\n]*_{2}/ },
    { begin: /\\\\`{2}[^\n]*`{2}/ },
    // guard: constrained formatting mark may not be preceded by ":", ";" or
    // "}". match these so the constrained rule doesn't see them
    { begin: /[:;}][*_`](?![*_`])/ }
  ], i = [
    // inline unconstrained strong (single line)
    {
      className: "strong",
      begin: /\*{2}([^\n]+?)\*{2}/
    },
    // inline unconstrained strong (multi-line)
    {
      className: "strong",
      begin: e.concat(
        /\*\*/,
        /((\*(?!\*)|\\[^\n]|[^*\n\\])+\n)+/,
        /(\*(?!\*)|\\[^\n]|[^*\n\\])*/,
        /\*\*/
      ),
      relevance: 0
    },
    // inline constrained strong (single line)
    {
      className: "strong",
      // must not precede or follow a word character
      begin: /\B\*(\S|\S[^\n]*?\S)\*(?!\w)/
    },
    // inline constrained strong (multi-line)
    {
      className: "strong",
      // must not precede or follow a word character
      begin: /\*[^\s]([^\n]+\n)+([^\n]+)\*/
    }
  ], o = [
    // inline unconstrained emphasis (single line)
    {
      className: "emphasis",
      begin: /_{2}([^\n]+?)_{2}/
    },
    // inline unconstrained emphasis (multi-line)
    {
      className: "emphasis",
      begin: e.concat(
        /__/,
        /((_(?!_)|\\[^\n]|[^_\n\\])+\n)+/,
        /(_(?!_)|\\[^\n]|[^_\n\\])*/,
        /__/
      ),
      relevance: 0
    },
    // inline constrained emphasis (single line)
    {
      className: "emphasis",
      // must not precede or follow a word character
      begin: /\b_(\S|\S[^\n]*?\S)_(?!\w)/
    },
    // inline constrained emphasis (multi-line)
    {
      className: "emphasis",
      // must not precede or follow a word character
      begin: /_[^\s]([^\n]+\n)+([^\n]+)_/
    },
    // inline constrained emphasis using single quote (legacy)
    {
      className: "emphasis",
      // must not follow a word character or be followed by a single quote or space
      begin: "\\B'(?!['\\s])",
      end: "(\\n{2}|')",
      // allow escaped single quote followed by word char
      contains: [
        {
          begin: "\\\\'\\w",
          relevance: 0
        }
      ],
      relevance: 0
    }
  ], a = {
    className: "symbol",
    begin: "^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):\\s+",
    relevance: 10
  }, s = {
    className: "bullet",
    begin: "^(\\*+|-+|\\.+|[^\\n]+?::)\\s+"
  };
  return {
    name: "AsciiDoc",
    aliases: ["adoc"],
    contains: [
      // block comment
      t.COMMENT(
        "^/{4,}\\n",
        "\\n/{4,}$",
        // can also be done as...
        // '^/{4,}$',
        // '^/{4,}$',
        { relevance: 10 }
      ),
      // line comment
      t.COMMENT(
        "^//",
        "$",
        { relevance: 0 }
      ),
      // title
      {
        className: "title",
        begin: "^\\.\\w.*$"
      },
      // example, admonition & sidebar blocks
      {
        begin: "^[=\\*]{4,}\\n",
        end: "\\n^[=\\*]{4,}$",
        relevance: 10
      },
      // headings
      {
        className: "section",
        relevance: 10,
        variants: [
          { begin: "^(={1,6})[ 	].+?([ 	]\\1)?$" },
          { begin: "^[^\\[\\]\\n]+?\\n[=\\-~\\^\\+]{2,}$" }
        ]
      },
      // document attributes
      {
        className: "meta",
        begin: "^:.+?:",
        end: "\\s",
        excludeEnd: !0,
        relevance: 10
      },
      // block attributes
      {
        className: "meta",
        begin: "^\\[.+?\\]$",
        relevance: 0
      },
      // quoteblocks
      {
        className: "quote",
        begin: "^_{4,}\\n",
        end: "\\n_{4,}$",
        relevance: 10
      },
      // listing and literal blocks
      {
        className: "code",
        begin: "^[\\-\\.]{4,}\\n",
        end: "\\n[\\-\\.]{4,}$",
        relevance: 10
      },
      // passthrough blocks
      {
        begin: "^\\+{4,}\\n",
        end: "\\n\\+{4,}$",
        contains: [
          {
            begin: "<",
            end: ">",
            subLanguage: "xml",
            relevance: 0
          }
        ],
        relevance: 10
      },
      s,
      a,
      ...r,
      ...i,
      ...o,
      // inline smart quotes
      {
        className: "string",
        variants: [
          { begin: "``.+?''" },
          { begin: "`.+?'" }
        ]
      },
      // inline unconstrained emphasis
      {
        className: "code",
        begin: /`{2}/,
        end: /(\n{2}|`{2})/
      },
      // inline code snippets (TODO should get same treatment as strong and emphasis)
      {
        className: "code",
        begin: "(`.+?`|\\+.+?\\+)",
        relevance: 0
      },
      // indented literal block
      {
        className: "code",
        begin: "^[ \\t]",
        end: "$",
        relevance: 0
      },
      n,
      // images and links
      {
        begin: "(link:)?(http|https|ftp|file|irc|image:?):\\S+?\\[[^[]*?\\]",
        returnBegin: !0,
        contains: [
          {
            begin: "(link|image:?):",
            relevance: 0
          },
          {
            className: "link",
            begin: "\\w",
            end: "[^\\[]+",
            relevance: 0
          },
          {
            className: "string",
            begin: "\\[",
            end: "\\]",
            excludeBegin: !0,
            excludeEnd: !0,
            relevance: 0
          }
        ],
        relevance: 10
      }
    ]
  };
}
function RI(t) {
  const e = t.regex, n = [
    "false",
    "synchronized",
    "int",
    "abstract",
    "float",
    "private",
    "char",
    "boolean",
    "static",
    "null",
    "if",
    "const",
    "for",
    "true",
    "while",
    "long",
    "throw",
    "strictfp",
    "finally",
    "protected",
    "import",
    "native",
    "final",
    "return",
    "void",
    "enum",
    "else",
    "extends",
    "implements",
    "break",
    "transient",
    "new",
    "catch",
    "instanceof",
    "byte",
    "super",
    "volatile",
    "case",
    "assert",
    "short",
    "package",
    "default",
    "double",
    "public",
    "try",
    "this",
    "switch",
    "continue",
    "throws",
    "privileged",
    "aspectOf",
    "adviceexecution",
    "proceed",
    "cflowbelow",
    "cflow",
    "initialization",
    "preinitialization",
    "staticinitialization",
    "withincode",
    "target",
    "within",
    "execution",
    "getWithinTypeName",
    "handler",
    "thisJoinPoint",
    "thisJoinPointStaticPart",
    "thisEnclosingJoinPointStaticPart",
    "declare",
    "parents",
    "warning",
    "error",
    "soft",
    "precedence",
    "thisAspectInstance"
  ], r = [
    "get",
    "set",
    "args",
    "call"
  ];
  return {
    name: "AspectJ",
    keywords: n,
    illegal: /<\/|#/,
    contains: [
      t.COMMENT(
        /\/\*\*/,
        /\*\//,
        {
          relevance: 0,
          contains: [
            {
              // eat up @'s in emails to prevent them to be recognized as doctags
              begin: /\w+@/,
              relevance: 0
            },
            {
              className: "doctag",
              begin: /@[A-Za-z]+/
            }
          ]
        }
      ),
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      {
        className: "class",
        beginKeywords: "aspect",
        end: /[{;=]/,
        excludeEnd: !0,
        illegal: /[:;"\[\]]/,
        contains: [
          { beginKeywords: "extends implements pertypewithin perthis pertarget percflowbelow percflow issingleton" },
          t.UNDERSCORE_TITLE_MODE,
          {
            begin: /\([^\)]*/,
            end: /[)]+/,
            keywords: n.concat(r),
            excludeEnd: !1
          }
        ]
      },
      {
        className: "class",
        beginKeywords: "class interface",
        end: /[{;=]/,
        excludeEnd: !0,
        relevance: 0,
        keywords: "class interface",
        illegal: /[:"\[\]]/,
        contains: [
          { beginKeywords: "extends implements" },
          t.UNDERSCORE_TITLE_MODE
        ]
      },
      {
        // AspectJ Constructs
        beginKeywords: "pointcut after before around throwing returning",
        end: /[)]/,
        excludeEnd: !1,
        illegal: /["\[\]]/,
        contains: [
          {
            begin: e.concat(t.UNDERSCORE_IDENT_RE, /\s*\(/),
            returnBegin: !0,
            contains: [t.UNDERSCORE_TITLE_MODE]
          }
        ]
      },
      {
        begin: /[:]/,
        returnBegin: !0,
        end: /[{;]/,
        relevance: 0,
        excludeEnd: !1,
        keywords: n,
        illegal: /["\[\]]/,
        contains: [
          {
            begin: e.concat(t.UNDERSCORE_IDENT_RE, /\s*\(/),
            keywords: n.concat(r),
            relevance: 0
          },
          t.QUOTE_STRING_MODE
        ]
      },
      {
        // this prevents 'new Name(...), or throw ...' from being recognized as a function definition
        beginKeywords: "new throw",
        relevance: 0
      },
      {
        // the function class is a bit different for AspectJ compared to the Java language
        className: "function",
        begin: /\w+ +\w+(\.\w+)?\s*\([^\)]*\)\s*((throws)[\w\s,]+)?[\{;]/,
        returnBegin: !0,
        end: /[{;=]/,
        keywords: n,
        excludeEnd: !0,
        contains: [
          {
            begin: e.concat(t.UNDERSCORE_IDENT_RE, /\s*\(/),
            returnBegin: !0,
            relevance: 0,
            contains: [t.UNDERSCORE_TITLE_MODE]
          },
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            relevance: 0,
            keywords: n,
            contains: [
              t.APOS_STRING_MODE,
              t.QUOTE_STRING_MODE,
              t.C_NUMBER_MODE,
              t.C_BLOCK_COMMENT_MODE
            ]
          },
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      t.C_NUMBER_MODE,
      {
        // annotation is also used in this language
        className: "meta",
        begin: /@[A-Za-z]+/
      }
    ]
  };
}
function OI(t) {
  const e = { begin: "`[\\s\\S]" };
  return {
    name: "AutoHotkey",
    case_insensitive: !0,
    aliases: ["ahk"],
    keywords: {
      keyword: "Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group",
      literal: "true false NOT AND OR",
      built_in: "ComSpec Clipboard ClipboardAll ErrorLevel"
    },
    contains: [
      e,
      t.inherit(t.QUOTE_STRING_MODE, { contains: [e] }),
      t.COMMENT(";", "$", { relevance: 0 }),
      t.C_BLOCK_COMMENT_MODE,
      {
        className: "number",
        begin: t.NUMBER_RE,
        relevance: 0
      },
      {
        // subst would be the most accurate however fails the point of
        // highlighting. variable is comparably the most accurate that actually
        // has some effect
        className: "variable",
        begin: "%[a-zA-Z0-9#_$@]+%"
      },
      {
        className: "built_in",
        begin: "^\\s*\\w+\\s*(,|%)"
        // I don't really know if this is totally relevant
      },
      {
        // symbol would be most accurate however is highlighted just like
        // built_in and that makes up a lot of AutoHotkey code meaning that it
        // would fail to highlight anything
        className: "title",
        variants: [
          { begin: '^[^\\n";]+::(?!=)' },
          {
            begin: '^[^\\n";]+:(?!=)',
            // zero relevance as it catches a lot of things
            // followed by a single ':' in many languages
            relevance: 0
          }
        ]
      },
      {
        className: "meta",
        begin: "^\\s*#\\w+",
        end: "$",
        relevance: 0
      },
      {
        className: "built_in",
        begin: "A_[a-zA-Z0-9]+"
      },
      {
        // consecutive commas, not for highlighting but just for relevance
        begin: ",\\s*,"
      }
    ]
  };
}
function NI(t) {
  const e = "ByRef Case Const ContinueCase ContinueLoop Dim Do Else ElseIf EndFunc EndIf EndSelect EndSwitch EndWith Enum Exit ExitLoop For Func Global If In Local Next ReDim Return Select Static Step Switch Then To Until Volatile WEnd While With", n = [
    "EndRegion",
    "forcedef",
    "forceref",
    "ignorefunc",
    "include",
    "include-once",
    "NoTrayIcon",
    "OnAutoItStartRegister",
    "pragma",
    "Region",
    "RequireAdmin",
    "Tidy_Off",
    "Tidy_On",
    "Tidy_Parameters"
  ], r = "True False And Null Not Or Default", i = "Abs ACos AdlibRegister AdlibUnRegister Asc AscW ASin Assign ATan AutoItSetOption AutoItWinGetTitle AutoItWinSetTitle Beep Binary BinaryLen BinaryMid BinaryToString BitAND BitNOT BitOR BitRotate BitShift BitXOR BlockInput Break Call CDTray Ceiling Chr ChrW ClipGet ClipPut ConsoleRead ConsoleWrite ConsoleWriteError ControlClick ControlCommand ControlDisable ControlEnable ControlFocus ControlGetFocus ControlGetHandle ControlGetPos ControlGetText ControlHide ControlListView ControlMove ControlSend ControlSetText ControlShow ControlTreeView Cos Dec DirCopy DirCreate DirGetSize DirMove DirRemove DllCall DllCallAddress DllCallbackFree DllCallbackGetPtr DllCallbackRegister DllClose DllOpen DllStructCreate DllStructGetData DllStructGetPtr DllStructGetSize DllStructSetData DriveGetDrive DriveGetFileSystem DriveGetLabel DriveGetSerial DriveGetType DriveMapAdd DriveMapDel DriveMapGet DriveSetLabel DriveSpaceFree DriveSpaceTotal DriveStatus EnvGet EnvSet EnvUpdate Eval Execute Exp FileChangeDir FileClose FileCopy FileCreateNTFSLink FileCreateShortcut FileDelete FileExists FileFindFirstFile FileFindNextFile FileFlush FileGetAttrib FileGetEncoding FileGetLongName FileGetPos FileGetShortcut FileGetShortName FileGetSize FileGetTime FileGetVersion FileInstall FileMove FileOpen FileOpenDialog FileRead FileReadLine FileReadToArray FileRecycle FileRecycleEmpty FileSaveDialog FileSelectFolder FileSetAttrib FileSetEnd FileSetPos FileSetTime FileWrite FileWriteLine Floor FtpSetProxy FuncName GUICreate GUICtrlCreateAvi GUICtrlCreateButton GUICtrlCreateCheckbox GUICtrlCreateCombo GUICtrlCreateContextMenu GUICtrlCreateDate GUICtrlCreateDummy GUICtrlCreateEdit GUICtrlCreateGraphic GUICtrlCreateGroup GUICtrlCreateIcon GUICtrlCreateInput GUICtrlCreateLabel GUICtrlCreateList GUICtrlCreateListView GUICtrlCreateListViewItem GUICtrlCreateMenu GUICtrlCreateMenuItem GUICtrlCreateMonthCal GUICtrlCreateObj GUICtrlCreatePic GUICtrlCreateProgress GUICtrlCreateRadio GUICtrlCreateSlider GUICtrlCreateTab GUICtrlCreateTabItem GUICtrlCreateTreeView GUICtrlCreateTreeViewItem GUICtrlCreateUpdown GUICtrlDelete GUICtrlGetHandle GUICtrlGetState GUICtrlRead GUICtrlRecvMsg GUICtrlRegisterListViewSort GUICtrlSendMsg GUICtrlSendToDummy GUICtrlSetBkColor GUICtrlSetColor GUICtrlSetCursor GUICtrlSetData GUICtrlSetDefBkColor GUICtrlSetDefColor GUICtrlSetFont GUICtrlSetGraphic GUICtrlSetImage GUICtrlSetLimit GUICtrlSetOnEvent GUICtrlSetPos GUICtrlSetResizing GUICtrlSetState GUICtrlSetStyle GUICtrlSetTip GUIDelete GUIGetCursorInfo GUIGetMsg GUIGetStyle GUIRegisterMsg GUISetAccelerators GUISetBkColor GUISetCoord GUISetCursor GUISetFont GUISetHelp GUISetIcon GUISetOnEvent GUISetState GUISetStyle GUIStartGroup GUISwitch Hex HotKeySet HttpSetProxy HttpSetUserAgent HWnd InetClose InetGet InetGetInfo InetGetSize InetRead IniDelete IniRead IniReadSection IniReadSectionNames IniRenameSection IniWrite IniWriteSection InputBox Int IsAdmin IsArray IsBinary IsBool IsDeclared IsDllStruct IsFloat IsFunc IsHWnd IsInt IsKeyword IsNumber IsObj IsPtr IsString Log MemGetStats Mod MouseClick MouseClickDrag MouseDown MouseGetCursor MouseGetPos MouseMove MouseUp MouseWheel MsgBox Number ObjCreate ObjCreateInterface ObjEvent ObjGet ObjName OnAutoItExitRegister OnAutoItExitUnRegister Ping PixelChecksum PixelGetColor PixelSearch ProcessClose ProcessExists ProcessGetStats ProcessList ProcessSetPriority ProcessWait ProcessWaitClose ProgressOff ProgressOn ProgressSet Ptr Random RegDelete RegEnumKey RegEnumVal RegRead RegWrite Round Run RunAs RunAsWait RunWait Send SendKeepActive SetError SetExtended ShellExecute ShellExecuteWait Shutdown Sin Sleep SoundPlay SoundSetWaveVolume SplashImageOn SplashOff SplashTextOn Sqrt SRandom StatusbarGetText StderrRead StdinWrite StdioClose StdoutRead String StringAddCR StringCompare StringFormat StringFromASCIIArray StringInStr StringIsAlNum StringIsAlpha StringIsASCII StringIsDigit StringIsFloat StringIsInt StringIsLower StringIsSpace StringIsUpper StringIsXDigit StringLeft StringLen StringLower StringMid StringRegExp StringRegExpReplace StringReplace StringReverse StringRight StringSplit StringStripCR StringStripWS StringToASCIIArray StringToBinary StringTrimLeft StringTrimRight StringUpper Tan TCPAccept TCPCloseSocket TCPConnect TCPListen TCPNameToIP TCPRecv TCPSend TCPShutdown, UDPShutdown TCPStartup, UDPStartup TimerDiff TimerInit ToolTip TrayCreateItem TrayCreateMenu TrayGetMsg TrayItemDelete TrayItemGetHandle TrayItemGetState TrayItemGetText TrayItemSetOnEvent TrayItemSetState TrayItemSetText TraySetClick TraySetIcon TraySetOnEvent TraySetPauseIcon TraySetState TraySetToolTip TrayTip UBound UDPBind UDPCloseSocket UDPOpen UDPRecv UDPSend VarGetType WinActivate WinActive WinClose WinExists WinFlash WinGetCaretPos WinGetClassList WinGetClientSize WinGetHandle WinGetPos WinGetProcess WinGetState WinGetText WinGetTitle WinKill WinList WinMenuSelectItem WinMinimizeAll WinMinimizeAllUndo WinMove WinSetOnTop WinSetState WinSetTitle WinSetTrans WinWait WinWaitActive WinWaitClose WinWaitNotActive", o = { variants: [
    t.COMMENT(";", "$", { relevance: 0 }),
    t.COMMENT("#cs", "#ce"),
    t.COMMENT("#comments-start", "#comments-end")
  ] }, a = { begin: "\\$[A-z0-9_]+" }, s = {
    className: "string",
    variants: [
      {
        begin: /"/,
        end: /"/,
        contains: [
          {
            begin: /""/,
            relevance: 0
          }
        ]
      },
      {
        begin: /'/,
        end: /'/,
        contains: [
          {
            begin: /''/,
            relevance: 0
          }
        ]
      }
    ]
  }, l = { variants: [
    t.BINARY_NUMBER_MODE,
    t.C_NUMBER_MODE
  ] }, c = {
    className: "meta",
    begin: "#",
    end: "$",
    keywords: { keyword: n },
    contains: [
      {
        begin: /\\\n/,
        relevance: 0
      },
      {
        beginKeywords: "include",
        keywords: { keyword: "include" },
        end: "$",
        contains: [
          s,
          {
            className: "string",
            variants: [
              {
                begin: "<",
                end: ">"
              },
              {
                begin: /"/,
                end: /"/,
                contains: [
                  {
                    begin: /""/,
                    relevance: 0
                  }
                ]
              },
              {
                begin: /'/,
                end: /'/,
                contains: [
                  {
                    begin: /''/,
                    relevance: 0
                  }
                ]
              }
            ]
          }
        ]
      },
      s,
      o
    ]
  }, u = {
    className: "symbol",
    // begin: '@',
    // end: '$',
    // keywords: 'AppDataCommonDir AppDataDir AutoItExe AutoItPID AutoItVersion AutoItX64 COM_EventObj CommonFilesDir Compiled ComputerName ComSpec CPUArch CR CRLF DesktopCommonDir DesktopDepth DesktopDir DesktopHeight DesktopRefresh DesktopWidth DocumentsCommonDir error exitCode exitMethod extended FavoritesCommonDir FavoritesDir GUI_CtrlHandle GUI_CtrlId GUI_DragFile GUI_DragId GUI_DropId GUI_WinHandle HomeDrive HomePath HomeShare HotKeyPressed HOUR IPAddress1 IPAddress2 IPAddress3 IPAddress4 KBLayout LF LocalAppDataDir LogonDNSDomain LogonDomain LogonServer MDAY MIN MON MSEC MUILang MyDocumentsDir NumParams OSArch OSBuild OSLang OSServicePack OSType OSVersion ProgramFilesDir ProgramsCommonDir ProgramsDir ScriptDir ScriptFullPath ScriptLineNumber ScriptName SEC StartMenuCommonDir StartMenuDir StartupCommonDir StartupDir SW_DISABLE SW_ENABLE SW_HIDE SW_LOCK SW_MAXIMIZE SW_MINIMIZE SW_RESTORE SW_SHOW SW_SHOWDEFAULT SW_SHOWMAXIMIZED SW_SHOWMINIMIZED SW_SHOWMINNOACTIVE SW_SHOWNA SW_SHOWNOACTIVATE SW_SHOWNORMAL SW_UNLOCK SystemDir TAB TempDir TRAY_ID TrayIconFlashing TrayIconVisible UserName UserProfileDir WDAY WindowsDir WorkingDir YDAY YEAR',
    // relevance: 5
    begin: "@[A-z0-9_]+"
  }, d = {
    beginKeywords: "Func",
    end: "$",
    illegal: "\\$|\\[|%",
    contains: [
      t.inherit(t.UNDERSCORE_TITLE_MODE, { className: "title.function" }),
      {
        className: "params",
        begin: "\\(",
        end: "\\)",
        contains: [
          a,
          s,
          l
        ]
      }
    ]
  };
  return {
    name: "AutoIt",
    case_insensitive: !0,
    illegal: /\/\*/,
    keywords: {
      keyword: e,
      built_in: i,
      literal: r
    },
    contains: [
      o,
      a,
      s,
      l,
      c,
      u,
      d
    ]
  };
}
function AI(t) {
  return {
    name: "AVR Assembly",
    case_insensitive: !0,
    keywords: {
      $pattern: "\\.?" + t.IDENT_RE,
      keyword: (
        /* mnemonic */
        "adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub subi swap tst wdr"
      ),
      built_in: (
        /* general purpose registers */
        "r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf"
      ),
      meta: ".byte .cseg .db .def .device .dseg .dw .endmacro .equ .eseg .exit .include .list .listmac .macro .nolist .org .set"
    },
    contains: [
      t.C_BLOCK_COMMENT_MODE,
      t.COMMENT(
        ";",
        "$",
        { relevance: 0 }
      ),
      t.C_NUMBER_MODE,
      // 0x..., decimal, float
      t.BINARY_NUMBER_MODE,
      // 0b...
      {
        className: "number",
        begin: "\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)"
        // $..., 0o...
      },
      t.QUOTE_STRING_MODE,
      {
        className: "string",
        begin: "'",
        end: "[^\\\\]'",
        illegal: "[^\\\\][^']"
      },
      {
        className: "symbol",
        begin: "^[A-Za-z0-9_.$]+:"
      },
      {
        className: "meta",
        begin: "#",
        end: "$"
      },
      {
        // substitution within a macro
        className: "subst",
        begin: "@[0-9]+"
      }
    ]
  };
}
function II(t) {
  const e = {
    className: "variable",
    variants: [
      { begin: /\$[\w\d#@][\w\d_]*/ },
      { begin: /\$\{(.*?)\}/ }
    ]
  }, n = "BEGIN END if else while do for in break continue delete next nextfile function func exit|10", r = {
    className: "string",
    contains: [t.BACKSLASH_ESCAPE],
    variants: [
      {
        begin: /(u|b)?r?'''/,
        end: /'''/,
        relevance: 10
      },
      {
        begin: /(u|b)?r?"""/,
        end: /"""/,
        relevance: 10
      },
      {
        begin: /(u|r|ur)'/,
        end: /'/,
        relevance: 10
      },
      {
        begin: /(u|r|ur)"/,
        end: /"/,
        relevance: 10
      },
      {
        begin: /(b|br)'/,
        end: /'/
      },
      {
        begin: /(b|br)"/,
        end: /"/
      },
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE
    ]
  };
  return {
    name: "Awk",
    keywords: { keyword: n },
    contains: [
      e,
      r,
      t.REGEXP_MODE,
      t.HASH_COMMENT_MODE,
      t.NUMBER_MODE
    ]
  };
}
function xI(t) {
  const e = t.UNDERSCORE_IDENT_RE, o = {
    keyword: [
      "abstract",
      "as",
      "asc",
      "avg",
      "break",
      "breakpoint",
      "by",
      "byref",
      "case",
      "catch",
      "changecompany",
      "class",
      "client",
      "client",
      "common",
      "const",
      "continue",
      "count",
      "crosscompany",
      "delegate",
      "delete_from",
      "desc",
      "display",
      "div",
      "do",
      "edit",
      "else",
      "eventhandler",
      "exists",
      "extends",
      "final",
      "finally",
      "firstfast",
      "firstonly",
      "firstonly1",
      "firstonly10",
      "firstonly100",
      "firstonly1000",
      "flush",
      "for",
      "forceliterals",
      "forcenestedloop",
      "forceplaceholders",
      "forceselectorder",
      "forupdate",
      "from",
      "generateonly",
      "group",
      "hint",
      "if",
      "implements",
      "in",
      "index",
      "insert_recordset",
      "interface",
      "internal",
      "is",
      "join",
      "like",
      "maxof",
      "minof",
      "mod",
      "namespace",
      "new",
      "next",
      "nofetch",
      "notexists",
      "optimisticlock",
      "order",
      "outer",
      "pessimisticlock",
      "print",
      "private",
      "protected",
      "public",
      "readonly",
      "repeatableread",
      "retry",
      "return",
      "reverse",
      "select",
      "server",
      "setting",
      "static",
      "sum",
      "super",
      "switch",
      "this",
      "throw",
      "try",
      "ttsabort",
      "ttsbegin",
      "ttscommit",
      "unchecked",
      "update_recordset",
      "using",
      "validtimestate",
      "void",
      "where",
      "while"
    ],
    built_in: [
      "anytype",
      "boolean",
      "byte",
      "char",
      "container",
      "date",
      "double",
      "enum",
      "guid",
      "int",
      "int64",
      "long",
      "real",
      "short",
      "str",
      "utcdatetime",
      "var"
    ],
    literal: [
      "default",
      "false",
      "null",
      "true"
    ]
  }, a = {
    variants: [
      { match: [
        /(class|interface)\s+/,
        e,
        /\s+(extends|implements)\s+/,
        e
      ] },
      { match: [
        /class\s+/,
        e
      ] }
    ],
    scope: {
      2: "title.class",
      4: "title.class.inherited"
    },
    keywords: o
  };
  return {
    name: "X++",
    aliases: ["x++"],
    keywords: o,
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      t.C_NUMBER_MODE,
      {
        className: "meta",
        begin: "#",
        end: "$"
      },
      a
    ]
  };
}
function DI(t) {
  return {
    name: "BASIC",
    case_insensitive: !0,
    illegal: "^.",
    // Support explicitly typed variables that end with $%! or #.
    keywords: {
      $pattern: "[a-zA-Z][a-zA-Z0-9_$%!#]*",
      keyword: [
        "ABS",
        "ASC",
        "AND",
        "ATN",
        "AUTO|0",
        "BEEP",
        "BLOAD|10",
        "BSAVE|10",
        "CALL",
        "CALLS",
        "CDBL",
        "CHAIN",
        "CHDIR",
        "CHR$|10",
        "CINT",
        "CIRCLE",
        "CLEAR",
        "CLOSE",
        "CLS",
        "COLOR",
        "COM",
        "COMMON",
        "CONT",
        "COS",
        "CSNG",
        "CSRLIN",
        "CVD",
        "CVI",
        "CVS",
        "DATA",
        "DATE$",
        "DEFDBL",
        "DEFINT",
        "DEFSNG",
        "DEFSTR",
        "DEF|0",
        "SEG",
        "USR",
        "DELETE",
        "DIM",
        "DRAW",
        "EDIT",
        "END",
        "ENVIRON",
        "ENVIRON$",
        "EOF",
        "EQV",
        "ERASE",
        "ERDEV",
        "ERDEV$",
        "ERL",
        "ERR",
        "ERROR",
        "EXP",
        "FIELD",
        "FILES",
        "FIX",
        "FOR|0",
        "FRE",
        "GET",
        "GOSUB|10",
        "GOTO",
        "HEX$",
        "IF",
        "THEN",
        "ELSE|0",
        "INKEY$",
        "INP",
        "INPUT",
        "INPUT#",
        "INPUT$",
        "INSTR",
        "IMP",
        "INT",
        "IOCTL",
        "IOCTL$",
        "KEY",
        "ON",
        "OFF",
        "LIST",
        "KILL",
        "LEFT$",
        "LEN",
        "LET",
        "LINE",
        "LLIST",
        "LOAD",
        "LOC",
        "LOCATE",
        "LOF",
        "LOG",
        "LPRINT",
        "USING",
        "LSET",
        "MERGE",
        "MID$",
        "MKDIR",
        "MKD$",
        "MKI$",
        "MKS$",
        "MOD",
        "NAME",
        "NEW",
        "NEXT",
        "NOISE",
        "NOT",
        "OCT$",
        "ON",
        "OR",
        "PEN",
        "PLAY",
        "STRIG",
        "OPEN",
        "OPTION",
        "BASE",
        "OUT",
        "PAINT",
        "PALETTE",
        "PCOPY",
        "PEEK",
        "PMAP",
        "POINT",
        "POKE",
        "POS",
        "PRINT",
        "PRINT]",
        "PSET",
        "PRESET",
        "PUT",
        "RANDOMIZE",
        "READ",
        "REM",
        "RENUM",
        "RESET|0",
        "RESTORE",
        "RESUME",
        "RETURN|0",
        "RIGHT$",
        "RMDIR",
        "RND",
        "RSET",
        "RUN",
        "SAVE",
        "SCREEN",
        "SGN",
        "SHELL",
        "SIN",
        "SOUND",
        "SPACE$",
        "SPC",
        "SQR",
        "STEP",
        "STICK",
        "STOP",
        "STR$",
        "STRING$",
        "SWAP",
        "SYSTEM",
        "TAB",
        "TAN",
        "TIME$",
        "TIMER",
        "TROFF",
        "TRON",
        "TO",
        "USR",
        "VAL",
        "VARPTR",
        "VARPTR$",
        "VIEW",
        "WAIT",
        "WHILE",
        "WEND",
        "WIDTH",
        "WINDOW",
        "WRITE",
        "XOR"
      ]
    },
    contains: [
      {
        // Match strings that start with " and end with " or a line break
        scope: "string",
        begin: /"/,
        end: /"|$/,
        contains: [t.BACKSLASH_ESCAPE]
      },
      t.COMMENT("REM", "$", { relevance: 10 }),
      t.COMMENT("'", "$", { relevance: 0 }),
      {
        // Match line numbers
        className: "symbol",
        begin: "^[0-9]+ ",
        relevance: 10
      },
      {
        // Match typed numeric constants (1000, 12.34!, 1.2e5, 1.5#, 1.2D2)
        className: "number",
        begin: "\\b\\d+(\\.\\d+)?([edED]\\d+)?[#!]?",
        relevance: 0
      },
      {
        // Match hexadecimal numbers (&Hxxxx)
        className: "number",
        begin: "(&[hH][0-9a-fA-F]{1,4})"
      },
      {
        // Match octal numbers (&Oxxxxxx)
        className: "number",
        begin: "(&[oO][0-7]{1,6})"
      }
    ]
  };
}
function wI(t) {
  return {
    name: "Backus–Naur Form",
    contains: [
      // Attribute
      {
        className: "attribute",
        begin: /</,
        end: />/
      },
      // Specific
      {
        begin: /::=/,
        end: /$/,
        contains: [
          {
            begin: /</,
            end: />/
          },
          // Common
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE,
          t.APOS_STRING_MODE,
          t.QUOTE_STRING_MODE
        ]
      }
    ]
  };
}
function MI(t) {
  const e = {
    className: "literal",
    begin: /[+-]+/,
    relevance: 0
  };
  return {
    name: "Brainfuck",
    aliases: ["bf"],
    contains: [
      t.COMMENT(
        /[^\[\]\.,\+\-<> \r\n]/,
        /[\[\]\.,\+\-<> \r\n]/,
        {
          contains: [
            {
              match: /[ ]+[^\[\]\.,\+\-<> \r\n]/,
              relevance: 0
            }
          ],
          returnEnd: !0,
          relevance: 0
        }
      ),
      {
        className: "title",
        begin: "[\\[\\]]",
        relevance: 0
      },
      {
        className: "string",
        begin: "[\\.,]",
        relevance: 0
      },
      {
        // this mode works as the only relevance counter
        // it looks ahead to find the start of a run of literals
        // so only the runs are counted as relevant
        begin: /(?=\+\+|--)/,
        contains: [e]
      },
      e
    ]
  };
}
function LI(t) {
  const e = t.regex, n = [
    "div",
    "mod",
    "in",
    "and",
    "or",
    "not",
    "xor",
    "asserterror",
    "begin",
    "case",
    "do",
    "downto",
    "else",
    "end",
    "exit",
    "for",
    "local",
    "if",
    "of",
    "repeat",
    "then",
    "to",
    "until",
    "while",
    "with",
    "var"
  ], r = "false true", i = [
    t.C_LINE_COMMENT_MODE,
    t.COMMENT(
      /\{/,
      /\}/,
      { relevance: 0 }
    ),
    t.COMMENT(
      /\(\*/,
      /\*\)/,
      { relevance: 10 }
    )
  ], o = {
    className: "string",
    begin: /'/,
    end: /'/,
    contains: [{ begin: /''/ }]
  }, a = {
    className: "string",
    begin: /(#\d+)+/
  }, s = {
    className: "number",
    begin: "\\b\\d+(\\.\\d+)?(DT|D|T)",
    relevance: 0
  }, l = {
    className: "string",
    // not a string technically but makes sense to be highlighted in the same style
    begin: '"',
    end: '"'
  }, c = {
    match: [
      /procedure/,
      /\s+/,
      /[a-zA-Z_][\w@]*/,
      /\s*/
    ],
    scope: {
      1: "keyword",
      3: "title.function"
    },
    contains: [
      {
        className: "params",
        begin: /\(/,
        end: /\)/,
        keywords: n,
        contains: [
          o,
          a,
          t.NUMBER_MODE
        ]
      },
      ...i
    ]
  }, u = [
    "Table",
    "Form",
    "Report",
    "Dataport",
    "Codeunit",
    "XMLport",
    "MenuSuite",
    "Page",
    "Query"
  ], d = {
    match: [
      /OBJECT/,
      /\s+/,
      e.either(...u),
      /\s+/,
      /\d+/,
      /\s+(?=[^\s])/,
      /.*/,
      /$/
    ],
    relevance: 3,
    scope: {
      1: "keyword",
      3: "type",
      5: "number",
      7: "title"
    }
  };
  return {
    name: "C/AL",
    case_insensitive: !0,
    keywords: {
      keyword: n,
      literal: r
    },
    illegal: /\/\*/,
    contains: [
      {
        match: /[\w]+(?=\=)/,
        scope: "attribute",
        relevance: 0
      },
      o,
      a,
      s,
      l,
      t.NUMBER_MODE,
      d,
      c
    ]
  };
}
function kI(t) {
  const e = [
    "struct",
    "enum",
    "interface",
    "union",
    "group",
    "import",
    "using",
    "const",
    "annotation",
    "extends",
    "in",
    "of",
    "on",
    "as",
    "with",
    "from",
    "fixed"
  ], n = [
    "Void",
    "Bool",
    "Int8",
    "Int16",
    "Int32",
    "Int64",
    "UInt8",
    "UInt16",
    "UInt32",
    "UInt64",
    "Float32",
    "Float64",
    "Text",
    "Data",
    "AnyPointer",
    "AnyStruct",
    "Capability",
    "List"
  ], r = [
    "true",
    "false"
  ], i = {
    variants: [
      { match: [
        /(struct|enum|interface)/,
        /\s+/,
        t.IDENT_RE
      ] },
      { match: [
        /extends/,
        /\s*\(/,
        t.IDENT_RE,
        /\s*\)/
      ] }
    ],
    scope: {
      1: "keyword",
      3: "title.class"
    }
  };
  return {
    name: "Cap’n Proto",
    aliases: ["capnp"],
    keywords: {
      keyword: e,
      type: n,
      literal: r
    },
    contains: [
      t.QUOTE_STRING_MODE,
      t.NUMBER_MODE,
      t.HASH_COMMENT_MODE,
      {
        className: "meta",
        begin: /@0x[\w\d]{16};/,
        illegal: /\n/
      },
      {
        className: "symbol",
        begin: /@\d+\b/
      },
      i
    ]
  };
}
function PI(t) {
  const e = [
    "assembly",
    "module",
    "package",
    "import",
    "alias",
    "class",
    "interface",
    "object",
    "given",
    "value",
    "assign",
    "void",
    "function",
    "new",
    "of",
    "extends",
    "satisfies",
    "abstracts",
    "in",
    "out",
    "return",
    "break",
    "continue",
    "throw",
    "assert",
    "dynamic",
    "if",
    "else",
    "switch",
    "case",
    "for",
    "while",
    "try",
    "catch",
    "finally",
    "then",
    "let",
    "this",
    "outer",
    "super",
    "is",
    "exists",
    "nonempty"
  ], n = [
    "shared",
    "abstract",
    "formal",
    "default",
    "actual",
    "variable",
    "late",
    "native",
    "deprecated",
    "final",
    "sealed",
    "annotation",
    "suppressWarnings",
    "small"
  ], r = [
    "doc",
    "by",
    "license",
    "see",
    "throws",
    "tagged"
  ], i = {
    className: "subst",
    excludeBegin: !0,
    excludeEnd: !0,
    begin: /``/,
    end: /``/,
    keywords: e,
    relevance: 10
  }, o = [
    {
      // verbatim string
      className: "string",
      begin: '"""',
      end: '"""',
      relevance: 10
    },
    {
      // string literal or template
      className: "string",
      begin: '"',
      end: '"',
      contains: [i]
    },
    {
      // character literal
      className: "string",
      begin: "'",
      end: "'"
    },
    {
      // numeric literal
      className: "number",
      begin: "#[0-9a-fA-F_]+|\\$[01_]+|[0-9_]+(?:\\.[0-9_](?:[eE][+-]?\\d+)?)?[kMGTPmunpf]?",
      relevance: 0
    }
  ];
  return i.contains = o, {
    name: "Ceylon",
    keywords: {
      keyword: e.concat(n),
      meta: r
    },
    illegal: "\\$[^01]|#[^0-9a-fA-F]",
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.COMMENT("/\\*", "\\*/", { contains: ["self"] }),
      {
        // compiler annotation
        className: "meta",
        begin: '@[a-z]\\w*(?::"[^"]*")?'
      }
    ].concat(o)
  };
}
function FI(t) {
  return {
    name: "Clean",
    aliases: [
      "icl",
      "dcl"
    ],
    keywords: {
      keyword: [
        "if",
        "let",
        "in",
        "with",
        "where",
        "case",
        "of",
        "class",
        "instance",
        "otherwise",
        "implementation",
        "definition",
        "system",
        "module",
        "from",
        "import",
        "qualified",
        "as",
        "special",
        "code",
        "inline",
        "foreign",
        "export",
        "ccall",
        "stdcall",
        "generic",
        "derive",
        "infix",
        "infixl",
        "infixr"
      ],
      built_in: "Int Real Char Bool",
      literal: "True False"
    },
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      t.C_NUMBER_MODE,
      {
        // relevance booster
        begin: "->|<-[|:]?|#!?|>>=|\\{\\||\\|\\}|:==|=:|<>"
      }
    ]
  };
}
function BI(t) {
  const e = "a-zA-Z_\\-!.?+*=<>&'", n = "[#]?[" + e + "][" + e + "0-9/;:$#]*", r = "def defonce defprotocol defstruct defmulti defmethod defn- defn defmacro deftype defrecord", i = {
    $pattern: n,
    built_in: (
      // Clojure keywords
      r + " cond apply if-not if-let if not not= =|0 <|0 >|0 <=|0 >=|0 ==|0 +|0 /|0 *|0 -|0 rem quot neg? pos? delay? symbol? keyword? true? false? integer? empty? coll? list? set? ifn? fn? associative? sequential? sorted? counted? reversible? number? decimal? class? distinct? isa? float? rational? reduced? ratio? odd? even? char? seq? vector? string? map? nil? contains? zero? instance? not-every? not-any? libspec? -> ->> .. . inc compare do dotimes mapcat take remove take-while drop letfn drop-last take-last drop-while while intern condp case reduced cycle split-at split-with repeat replicate iterate range merge zipmap declare line-seq sort comparator sort-by dorun doall nthnext nthrest partition eval doseq await await-for let agent atom send send-off release-pending-sends add-watch mapv filterv remove-watch agent-error restart-agent set-error-handler error-handler set-error-mode! error-mode shutdown-agents quote var fn loop recur throw try monitor-enter monitor-exit macroexpand macroexpand-1 for dosync and or when when-not when-let comp juxt partial sequence memoize constantly complement identity assert peek pop doto proxy first rest cons cast coll last butlast sigs reify second ffirst fnext nfirst nnext meta with-meta ns in-ns create-ns import refer keys select-keys vals key val rseq name namespace promise into transient persistent! conj! assoc! dissoc! pop! disj! use class type num float double short byte boolean bigint biginteger bigdec print-method print-dup throw-if printf format load compile get-in update-in pr pr-on newline flush read slurp read-line subvec with-open memfn time re-find re-groups rand-int rand mod locking assert-valid-fdecl alias resolve ref deref refset swap! reset! set-validator! compare-and-set! alter-meta! reset-meta! commute get-validator alter ref-set ref-history-count ref-min-history ref-max-history ensure sync io! new next conj set! to-array future future-call into-array aset gen-class reduce map filter find empty hash-map hash-set sorted-map sorted-map-by sorted-set sorted-set-by vec vector seq flatten reverse assoc dissoc list disj get union difference intersection extend extend-type extend-protocol int nth delay count concat chunk chunk-buffer chunk-append chunk-first chunk-rest max min dec unchecked-inc-int unchecked-inc unchecked-dec-inc unchecked-dec unchecked-negate unchecked-add-int unchecked-add unchecked-subtract-int unchecked-subtract chunk-next chunk-cons chunked-seq? prn vary-meta lazy-seq spread list* str find-keyword keyword symbol gensym force rationalize"
    )
  }, o = {
    begin: n,
    relevance: 0
  }, a = {
    scope: "number",
    relevance: 0,
    variants: [
      { match: /[-+]?0[xX][0-9a-fA-F]+N?/ },
      // hexadecimal                 // 0x2a
      { match: /[-+]?0[0-7]+N?/ },
      // octal                       // 052
      { match: /[-+]?[1-9][0-9]?[rR][0-9a-zA-Z]+N?/ },
      // variable radix from 2 to 36 // 2r101010, 8r52, 36r16
      { match: /[-+]?[0-9]+\/[0-9]+N?/ },
      // ratio                       // 1/2
      { match: /[-+]?[0-9]+((\.[0-9]*([eE][+-]?[0-9]+)?M?)|([eE][+-]?[0-9]+M?|M))/ },
      // float        // 0.42 4.2E-1M 42E1 42M
      { match: /[-+]?([1-9][0-9]*|0)N?/ }
      // int (don't match leading 0) // 42 42N
    ]
  }, s = {
    scope: "character",
    variants: [
      { match: /\\o[0-3]?[0-7]{1,2}/ },
      // Unicode Octal 0 - 377
      { match: /\\u[0-9a-fA-F]{4}/ },
      // Unicode Hex 0000 - FFFF
      { match: /\\(newline|space|tab|formfeed|backspace|return)/ },
      // special characters
      {
        match: /\\\S/,
        relevance: 0
      }
      // any non-whitespace char
    ]
  }, l = {
    scope: "regex",
    begin: /#"/,
    end: /"/,
    contains: [t.BACKSLASH_ESCAPE]
  }, c = t.inherit(t.QUOTE_STRING_MODE, { illegal: null }), u = {
    scope: "punctuation",
    match: /,/,
    relevance: 0
  }, d = t.COMMENT(
    ";",
    "$",
    { relevance: 0 }
  ), p = {
    className: "literal",
    begin: /\b(true|false|nil)\b/
  }, _ = {
    begin: "\\[|(#::?" + n + ")?\\{",
    end: "[\\]\\}]",
    relevance: 0
  }, m = {
    className: "symbol",
    begin: "[:]{1,2}" + n
  }, f = {
    begin: "\\(",
    end: "\\)"
  }, g = {
    endsWithParent: !0,
    relevance: 0
  }, S = {
    keywords: i,
    className: "name",
    begin: n,
    relevance: 0,
    starts: g
  }, E = [
    u,
    f,
    s,
    l,
    c,
    d,
    m,
    _,
    a,
    p,
    o
  ], b = {
    beginKeywords: r,
    keywords: {
      $pattern: n,
      keyword: r
    },
    end: '(\\[|#|\\d|"|:|\\{|\\)|\\(|$)',
    contains: [
      {
        className: "title",
        begin: n,
        relevance: 0,
        excludeEnd: !0,
        // we can only have a single title
        endsParent: !0
      }
    ].concat(E)
  };
  return f.contains = [
    b,
    S,
    g
  ], g.contains = E, _.contains = E, {
    name: "Clojure",
    aliases: [
      "clj",
      "edn"
    ],
    illegal: /\S/,
    contains: [
      u,
      f,
      s,
      l,
      c,
      d,
      m,
      _,
      a,
      p
    ]
  };
}
function UI(t) {
  return {
    name: "Clojure REPL",
    contains: [
      {
        className: "meta.prompt",
        begin: /^([\w.-]+|\s*#_)?=>/,
        starts: {
          end: /$/,
          subLanguage: "clojure"
        }
      }
    ]
  };
}
function HI(t) {
  return {
    name: "CMake",
    aliases: ["cmake.in"],
    case_insensitive: !0,
    keywords: { keyword: (
      // scripting commands
      "break cmake_host_system_information cmake_minimum_required cmake_parse_arguments cmake_policy configure_file continue elseif else endforeach endfunction endif endmacro endwhile execute_process file find_file find_library find_package find_path find_program foreach function get_cmake_property get_directory_property get_filename_component get_property if include include_guard list macro mark_as_advanced math message option return separate_arguments set_directory_properties set_property set site_name string unset variable_watch while add_compile_definitions add_compile_options add_custom_command add_custom_target add_definitions add_dependencies add_executable add_library add_link_options add_subdirectory add_test aux_source_directory build_command create_test_sourcelist define_property enable_language enable_testing export fltk_wrap_ui get_source_file_property get_target_property get_test_property include_directories include_external_msproject include_regular_expression install link_directories link_libraries load_cache project qt_wrap_cpp qt_wrap_ui remove_definitions set_source_files_properties set_target_properties set_tests_properties source_group target_compile_definitions target_compile_features target_compile_options target_include_directories target_link_directories target_link_libraries target_link_options target_sources try_compile try_run ctest_build ctest_configure ctest_coverage ctest_empty_binary_directory ctest_memcheck ctest_read_custom_files ctest_run_script ctest_sleep ctest_start ctest_submit ctest_test ctest_update ctest_upload build_name exec_program export_library_dependencies install_files install_programs install_targets load_command make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file qt5_use_modules qt5_use_package qt5_wrap_cpp on off true false and or not command policy target test exists is_newer_than is_directory is_symlink is_absolute matches less greater equal less_equal greater_equal strless strgreater strequal strless_equal strgreater_equal version_less version_greater version_equal version_less_equal version_greater_equal in_list defined"
    ) },
    contains: [
      {
        className: "variable",
        begin: /\$\{/,
        end: /\}/
      },
      t.COMMENT(/#\[\[/, /]]/),
      t.HASH_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      t.NUMBER_MODE
    ]
  };
}
const GI = [
  "as",
  // for exports
  "in",
  "of",
  "if",
  "for",
  "while",
  "finally",
  "var",
  "new",
  "function",
  "do",
  "return",
  "void",
  "else",
  "break",
  "catch",
  "instanceof",
  "with",
  "throw",
  "case",
  "default",
  "try",
  "switch",
  "continue",
  "typeof",
  "delete",
  "let",
  "yield",
  "const",
  "class",
  // JS handles these with a special rule
  // "get",
  // "set",
  "debugger",
  "async",
  "await",
  "static",
  "import",
  "from",
  "export",
  "extends",
  // It's reached stage 3, which is "recommended for implementation":
  "using"
], VI = [
  "true",
  "false",
  "null",
  "undefined",
  "NaN",
  "Infinity"
], YI = [
  // Fundamental objects
  "Object",
  "Function",
  "Boolean",
  "Symbol",
  // numbers and dates
  "Math",
  "Date",
  "Number",
  "BigInt",
  // text
  "String",
  "RegExp",
  // Indexed collections
  "Array",
  "Float32Array",
  "Float64Array",
  "Int8Array",
  "Uint8Array",
  "Uint8ClampedArray",
  "Int16Array",
  "Int32Array",
  "Uint16Array",
  "Uint32Array",
  "BigInt64Array",
  "BigUint64Array",
  // Keyed collections
  "Set",
  "Map",
  "WeakSet",
  "WeakMap",
  // Structured data
  "ArrayBuffer",
  "SharedArrayBuffer",
  "Atomics",
  "DataView",
  "JSON",
  // Control abstraction objects
  "Promise",
  "Generator",
  "GeneratorFunction",
  "AsyncFunction",
  // Reflection
  "Reflect",
  "Proxy",
  // Internationalization
  "Intl",
  // WebAssembly
  "WebAssembly"
], $I = [
  "Error",
  "EvalError",
  "InternalError",
  "RangeError",
  "ReferenceError",
  "SyntaxError",
  "TypeError",
  "URIError"
], zI = [
  "setInterval",
  "setTimeout",
  "clearInterval",
  "clearTimeout",
  "require",
  "exports",
  "eval",
  "isFinite",
  "isNaN",
  "parseFloat",
  "parseInt",
  "decodeURI",
  "decodeURIComponent",
  "encodeURI",
  "encodeURIComponent",
  "escape",
  "unescape"
], qI = [].concat(
  zI,
  YI,
  $I
);
function WI(t) {
  const e = [
    "npm",
    "print"
  ], n = [
    "yes",
    "no",
    "on",
    "off"
  ], r = [
    "then",
    "unless",
    "until",
    "loop",
    "by",
    "when",
    "and",
    "or",
    "is",
    "isnt",
    "not"
  ], i = [
    "var",
    "const",
    "let",
    "function",
    "static"
  ], o = (m) => (f) => !m.includes(f), a = {
    keyword: GI.concat(r).filter(o(i)),
    literal: VI.concat(n),
    built_in: qI.concat(e)
  }, s = "[A-Za-z$_][0-9A-Za-z$_]*", l = {
    className: "subst",
    begin: /#\{/,
    end: /\}/,
    keywords: a
  }, c = [
    t.BINARY_NUMBER_MODE,
    t.inherit(t.C_NUMBER_MODE, { starts: {
      end: "(\\s*/)?",
      relevance: 0
    } }),
    // a number tries to eat the following slash to prevent treating it as a regexp
    {
      className: "string",
      variants: [
        {
          begin: /'''/,
          end: /'''/,
          contains: [t.BACKSLASH_ESCAPE]
        },
        {
          begin: /'/,
          end: /'/,
          contains: [t.BACKSLASH_ESCAPE]
        },
        {
          begin: /"""/,
          end: /"""/,
          contains: [
            t.BACKSLASH_ESCAPE,
            l
          ]
        },
        {
          begin: /"/,
          end: /"/,
          contains: [
            t.BACKSLASH_ESCAPE,
            l
          ]
        }
      ]
    },
    {
      className: "regexp",
      variants: [
        {
          begin: "///",
          end: "///",
          contains: [
            l,
            t.HASH_COMMENT_MODE
          ]
        },
        {
          begin: "//[gim]{0,3}(?=\\W)",
          relevance: 0
        },
        {
          // regex can't start with space to parse x / 2 / 3 as two divisions
          // regex can't start with *, and it supports an "illegal" in the main mode
          begin: /\/(?![ *]).*?(?![\\]).\/[gim]{0,3}(?=\W)/
        }
      ]
    },
    {
      begin: "@" + s
      // relevance booster
    },
    {
      subLanguage: "javascript",
      excludeBegin: !0,
      excludeEnd: !0,
      variants: [
        {
          begin: "```",
          end: "```"
        },
        {
          begin: "`",
          end: "`"
        }
      ]
    }
  ];
  l.contains = c;
  const u = t.inherit(t.TITLE_MODE, { begin: s }), d = "(\\(.*\\)\\s*)?\\B[-=]>", p = {
    className: "params",
    begin: "\\([^\\(]",
    returnBegin: !0,
    /* We need another contained nameless mode to not have every nested
    pair of parens to be called "params" */
    contains: [
      {
        begin: /\(/,
        end: /\)/,
        keywords: a,
        contains: ["self"].concat(c)
      }
    ]
  }, _ = {
    variants: [
      { match: [
        /class\s+/,
        s,
        /\s+extends\s+/,
        s
      ] },
      { match: [
        /class\s+/,
        s
      ] }
    ],
    scope: {
      2: "title.class",
      4: "title.class.inherited"
    },
    keywords: a
  };
  return {
    name: "CoffeeScript",
    aliases: [
      "coffee",
      "cson",
      "iced"
    ],
    keywords: a,
    illegal: /\/\*/,
    contains: [
      ...c,
      t.COMMENT("###", "###"),
      t.HASH_COMMENT_MODE,
      {
        className: "function",
        begin: "^\\s*" + s + "\\s*=\\s*" + d,
        end: "[-=]>",
        returnBegin: !0,
        contains: [
          u,
          p
        ]
      },
      {
        // anonymous function start
        begin: /[:\(,=]\s*/,
        relevance: 0,
        contains: [
          {
            className: "function",
            begin: d,
            end: "[-=]>",
            returnBegin: !0,
            contains: [p]
          }
        ]
      },
      _,
      {
        begin: s + ":",
        end: ":",
        returnBegin: !0,
        returnEnd: !0,
        relevance: 0
      }
    ]
  };
}
function KI(t) {
  return {
    name: "Coq",
    keywords: {
      keyword: [
        "_|0",
        "as",
        "at",
        "cofix",
        "else",
        "end",
        "exists",
        "exists2",
        "fix",
        "for",
        "forall",
        "fun",
        "if",
        "IF",
        "in",
        "let",
        "match",
        "mod",
        "Prop",
        "return",
        "Set",
        "then",
        "Type",
        "using",
        "where",
        "with",
        "Abort",
        "About",
        "Add",
        "Admit",
        "Admitted",
        "All",
        "Arguments",
        "Assumptions",
        "Axiom",
        "Back",
        "BackTo",
        "Backtrack",
        "Bind",
        "Blacklist",
        "Canonical",
        "Cd",
        "Check",
        "Class",
        "Classes",
        "Close",
        "Coercion",
        "Coercions",
        "CoFixpoint",
        "CoInductive",
        "Collection",
        "Combined",
        "Compute",
        "Conjecture",
        "Conjectures",
        "Constant",
        "constr",
        "Constraint",
        "Constructors",
        "Context",
        "Corollary",
        "CreateHintDb",
        "Cut",
        "Declare",
        "Defined",
        "Definition",
        "Delimit",
        "Dependencies",
        "Dependent",
        "Derive",
        "Drop",
        "eauto",
        "End",
        "Equality",
        "Eval",
        "Example",
        "Existential",
        "Existentials",
        "Existing",
        "Export",
        "exporting",
        "Extern",
        "Extract",
        "Extraction",
        "Fact",
        "Field",
        "Fields",
        "File",
        "Fixpoint",
        "Focus",
        "for",
        "From",
        "Function",
        "Functional",
        "Generalizable",
        "Global",
        "Goal",
        "Grab",
        "Grammar",
        "Graph",
        "Guarded",
        "Heap",
        "Hint",
        "HintDb",
        "Hints",
        "Hypotheses",
        "Hypothesis",
        "ident",
        "Identity",
        "If",
        "Immediate",
        "Implicit",
        "Import",
        "Include",
        "Inductive",
        "Infix",
        "Info",
        "Initial",
        "Inline",
        "Inspect",
        "Instance",
        "Instances",
        "Intro",
        "Intros",
        "Inversion",
        "Inversion_clear",
        "Language",
        "Left",
        "Lemma",
        "Let",
        "Libraries",
        "Library",
        "Load",
        "LoadPath",
        "Local",
        "Locate",
        "Ltac",
        "ML",
        "Mode",
        "Module",
        "Modules",
        "Monomorphic",
        "Morphism",
        "Next",
        "NoInline",
        "Notation",
        "Obligation",
        "Obligations",
        "Opaque",
        "Open",
        "Optimize",
        "Options",
        "Parameter",
        "Parameters",
        "Parametric",
        "Path",
        "Paths",
        "pattern",
        "Polymorphic",
        "Preterm",
        "Print",
        "Printing",
        "Program",
        "Projections",
        "Proof",
        "Proposition",
        "Pwd",
        "Qed",
        "Quit",
        "Rec",
        "Record",
        "Recursive",
        "Redirect",
        "Relation",
        "Remark",
        "Remove",
        "Require",
        "Reserved",
        "Reset",
        "Resolve",
        "Restart",
        "Rewrite",
        "Right",
        "Ring",
        "Rings",
        "Save",
        "Scheme",
        "Scope",
        "Scopes",
        "Script",
        "Search",
        "SearchAbout",
        "SearchHead",
        "SearchPattern",
        "SearchRewrite",
        "Section",
        "Separate",
        "Set",
        "Setoid",
        "Show",
        "Solve",
        "Sorted",
        "Step",
        "Strategies",
        "Strategy",
        "Structure",
        "SubClass",
        "Table",
        "Tables",
        "Tactic",
        "Term",
        "Test",
        "Theorem",
        "Time",
        "Timeout",
        "Transparent",
        "Type",
        "Typeclasses",
        "Types",
        "Undelimit",
        "Undo",
        "Unfocus",
        "Unfocused",
        "Unfold",
        "Universe",
        "Universes",
        "Unset",
        "Unshelve",
        "using",
        "Variable",
        "Variables",
        "Variant",
        "Verbose",
        "Visibility",
        "where",
        "with"
      ],
      built_in: [
        "abstract",
        "absurd",
        "admit",
        "after",
        "apply",
        "as",
        "assert",
        "assumption",
        "at",
        "auto",
        "autorewrite",
        "autounfold",
        "before",
        "bottom",
        "btauto",
        "by",
        "case",
        "case_eq",
        "cbn",
        "cbv",
        "change",
        "classical_left",
        "classical_right",
        "clear",
        "clearbody",
        "cofix",
        "compare",
        "compute",
        "congruence",
        "constr_eq",
        "constructor",
        "contradict",
        "contradiction",
        "cut",
        "cutrewrite",
        "cycle",
        "decide",
        "decompose",
        "dependent",
        "destruct",
        "destruction",
        "dintuition",
        "discriminate",
        "discrR",
        "do",
        "double",
        "dtauto",
        "eapply",
        "eassumption",
        "eauto",
        "ecase",
        "econstructor",
        "edestruct",
        "ediscriminate",
        "eelim",
        "eexact",
        "eexists",
        "einduction",
        "einjection",
        "eleft",
        "elim",
        "elimtype",
        "enough",
        "equality",
        "erewrite",
        "eright",
        "esimplify_eq",
        "esplit",
        "evar",
        "exact",
        "exactly_once",
        "exfalso",
        "exists",
        "f_equal",
        "fail",
        "field",
        "field_simplify",
        "field_simplify_eq",
        "first",
        "firstorder",
        "fix",
        "fold",
        "fourier",
        "functional",
        "generalize",
        "generalizing",
        "gfail",
        "give_up",
        "has_evar",
        "hnf",
        "idtac",
        "in",
        "induction",
        "injection",
        "instantiate",
        "intro",
        "intro_pattern",
        "intros",
        "intuition",
        "inversion",
        "inversion_clear",
        "is_evar",
        "is_var",
        "lapply",
        "lazy",
        "left",
        "lia",
        "lra",
        "move",
        "native_compute",
        "nia",
        "nsatz",
        "omega",
        "once",
        "pattern",
        "pose",
        "progress",
        "proof",
        "psatz",
        "quote",
        "record",
        "red",
        "refine",
        "reflexivity",
        "remember",
        "rename",
        "repeat",
        "replace",
        "revert",
        "revgoals",
        "rewrite",
        "rewrite_strat",
        "right",
        "ring",
        "ring_simplify",
        "rtauto",
        "set",
        "setoid_reflexivity",
        "setoid_replace",
        "setoid_rewrite",
        "setoid_symmetry",
        "setoid_transitivity",
        "shelve",
        "shelve_unifiable",
        "simpl",
        "simple",
        "simplify_eq",
        "solve",
        "specialize",
        "split",
        "split_Rabs",
        "split_Rmult",
        "stepl",
        "stepr",
        "subst",
        "sum",
        "swap",
        "symmetry",
        "tactic",
        "tauto",
        "time",
        "timeout",
        "top",
        "transitivity",
        "trivial",
        "try",
        "tryif",
        "unfold",
        "unify",
        "until",
        "using",
        "vm_compute",
        "with"
      ]
    },
    contains: [
      t.QUOTE_STRING_MODE,
      t.COMMENT("\\(\\*", "\\*\\)"),
      t.C_NUMBER_MODE,
      {
        className: "type",
        excludeBegin: !0,
        begin: "\\|\\s*",
        end: "\\w+"
      },
      {
        // relevance booster
        begin: /[-=]>/
      }
    ]
  };
}
function QI(t) {
  return {
    name: "Caché Object Script",
    case_insensitive: !0,
    aliases: ["cls"],
    keywords: "property parameter class classmethod clientmethod extends as break catch close continue do d|0 else elseif for goto halt hang h|0 if job j|0 kill k|0 lock l|0 merge new open quit q|0 read r|0 return set s|0 tcommit throw trollback try tstart use view while write w|0 xecute x|0 zkill znspace zn ztrap zwrite zw zzdump zzwrite print zbreak zinsert zload zprint zremove zsave zzprint mv mvcall mvcrt mvdim mvprint zquit zsync ascii",
    contains: [
      {
        className: "number",
        begin: "\\b(\\d+(\\.\\d*)?|\\.\\d+)",
        relevance: 0
      },
      {
        className: "string",
        variants: [
          {
            begin: '"',
            end: '"',
            contains: [
              {
                // escaped
                begin: '""',
                relevance: 0
              }
            ]
          }
        ]
      },
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      {
        className: "comment",
        begin: /;/,
        end: "$",
        relevance: 0
      },
      {
        // Functions and user-defined functions: write $ztime(60*60*3), $$myFunc(10), $$^Val(1)
        className: "built_in",
        begin: /(?:\$\$?|\.\.)\^?[a-zA-Z]+/
      },
      {
        // Macro command: quit $$$OK
        className: "built_in",
        begin: /\$\$\$[a-zA-Z]+/
      },
      {
        // Special (global) variables: write %request.Content; Built-in classes: %Library.Integer
        className: "built_in",
        begin: /%[a-z]+(?:\.[a-z]+)*/
      },
      {
        // Global variable: set ^globalName = 12 write ^globalName
        className: "symbol",
        begin: /\^%?[a-zA-Z][\w]*/
      },
      {
        // Some control constructions: do ##class(Package.ClassName).Method(), ##super()
        className: "keyword",
        begin: /##class|##super|#define|#dim/
      },
      // sub-languages: are not fully supported by hljs by 11/15/2015
      // left for the future implementation.
      {
        begin: /&sql\(/,
        end: /\)/,
        excludeBegin: !0,
        excludeEnd: !0,
        subLanguage: "sql"
      },
      {
        begin: /&(js|jscript|javascript)</,
        end: />/,
        excludeBegin: !0,
        excludeEnd: !0,
        subLanguage: "javascript"
      },
      {
        // this brakes first and last tag, but this is the only way to embed a valid html
        begin: /&html<\s*</,
        end: />\s*>/,
        subLanguage: "xml"
      }
    ]
  };
}
function ZI(t) {
  const e = "primitive rsc_template", n = "group clone ms master location colocation order fencing_topology rsc_ticket acl_target acl_group user role tag xml";
  return {
    name: "crmsh",
    aliases: [
      "crm",
      "pcmk"
    ],
    case_insensitive: !0,
    keywords: {
      keyword: "params meta operations op rule attributes utilization" + " " + "read write deny defined not_defined in_range date spec in ref reference attribute type xpath version and or lt gt tag lte gte eq ne \\" + " " + "number string",
      literal: "Master Started Slave Stopped start promote demote stop monitor true false"
    },
    contains: [
      t.HASH_COMMENT_MODE,
      {
        beginKeywords: "node",
        starts: {
          end: "\\s*([\\w_-]+:)?",
          starts: {
            className: "title",
            end: "\\s*[\\$\\w_][\\w_-]*"
          }
        }
      },
      {
        beginKeywords: e,
        starts: {
          className: "title",
          end: "\\s*[\\$\\w_][\\w_-]*",
          starts: { end: "\\s*@?[\\w_][\\w_\\.:-]*" }
        }
      },
      {
        begin: "\\b(" + n.split(" ").join("|") + ")\\s+",
        keywords: n,
        starts: {
          className: "title",
          end: "[\\$\\w_][\\w_-]*"
        }
      },
      {
        beginKeywords: "property rsc_defaults op_defaults",
        starts: {
          className: "title",
          end: "\\s*([\\w_-]+:)?"
        }
      },
      t.QUOTE_STRING_MODE,
      {
        className: "meta",
        begin: "(ocf|systemd|service|lsb):[\\w_:-]+",
        relevance: 0
      },
      {
        className: "number",
        begin: "\\b\\d+(\\.\\d+)?(ms|s|h|m)?",
        relevance: 0
      },
      {
        className: "literal",
        begin: "[-]?(infinity|inf)",
        relevance: 0
      },
      {
        className: "attr",
        begin: /([A-Za-z$_#][\w_-]+)=/,
        relevance: 0
      },
      {
        className: "tag",
        begin: "</?",
        end: "/?>",
        relevance: 0
      }
    ]
  };
}
function XI(t) {
  const e = "(_?[ui](8|16|32|64|128))?", n = "(_?f(32|64))?", r = "[a-zA-Z_]\\w*[!?=]?", i = "[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|[=!]~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~|]|//|//=|&[-+*]=?|&\\*\\*|\\[\\][=?]?", o = "[A-Za-z_]\\w*(::\\w+)*(\\?|!)?", a = {
    $pattern: r,
    keyword: "abstract alias annotation as as? asm begin break case class def do else elsif end ensure enum extend for fun if include instance_sizeof is_a? lib macro module next nil? of out pointerof private protected rescue responds_to? return require select self sizeof struct super then type typeof union uninitialized unless until verbatim when while with yield __DIR__ __END_LINE__ __FILE__ __LINE__",
    literal: "false nil true"
  }, s = {
    className: "subst",
    begin: /#\{/,
    end: /\}/,
    keywords: a
  }, l = {
    // negative-look forward attemps to prevent false matches like:
    // @ident@ or $ident$ that might indicate this is not ruby at all
    className: "variable",
    begin: "(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"
  }, c = {
    className: "template-variable",
    variants: [
      {
        begin: "\\{\\{",
        end: "\\}\\}"
      },
      {
        begin: "\\{%",
        end: "%\\}"
      }
    ],
    keywords: a
  };
  function u(S, E) {
    const b = [
      {
        begin: S,
        end: E
      }
    ];
    return b[0].contains = b, b;
  }
  const d = {
    className: "string",
    contains: [
      t.BACKSLASH_ESCAPE,
      s
    ],
    variants: [
      {
        begin: /'/,
        end: /'/
      },
      {
        begin: /"/,
        end: /"/
      },
      {
        begin: /`/,
        end: /`/
      },
      {
        begin: "%[Qwi]?\\(",
        end: "\\)",
        contains: u("\\(", "\\)")
      },
      {
        begin: "%[Qwi]?\\[",
        end: "\\]",
        contains: u("\\[", "\\]")
      },
      {
        begin: "%[Qwi]?\\{",
        end: /\}/,
        contains: u(/\{/, /\}/)
      },
      {
        begin: "%[Qwi]?<",
        end: ">",
        contains: u("<", ">")
      },
      {
        begin: "%[Qwi]?\\|",
        end: "\\|"
      },
      {
        begin: /<<-\w+$/,
        end: /^\s*\w+$/
      }
    ],
    relevance: 0
  }, p = {
    className: "string",
    variants: [
      {
        begin: "%q\\(",
        end: "\\)",
        contains: u("\\(", "\\)")
      },
      {
        begin: "%q\\[",
        end: "\\]",
        contains: u("\\[", "\\]")
      },
      {
        begin: "%q\\{",
        end: /\}/,
        contains: u(/\{/, /\}/)
      },
      {
        begin: "%q<",
        end: ">",
        contains: u("<", ">")
      },
      {
        begin: "%q\\|",
        end: "\\|"
      },
      {
        begin: /<<-'\w+'$/,
        end: /^\s*\w+$/
      }
    ],
    relevance: 0
  }, _ = {
    begin: "(?!%\\})(" + t.RE_STARTERS_RE + "|\\n|\\b(case|if|select|unless|until|when|while)\\b)\\s*",
    keywords: "case if select unless until when while",
    contains: [
      {
        className: "regexp",
        contains: [
          t.BACKSLASH_ESCAPE,
          s
        ],
        variants: [
          {
            begin: "//[a-z]*",
            relevance: 0
          },
          {
            begin: "/(?!\\/)",
            end: "/[a-z]*"
          }
        ]
      }
    ],
    relevance: 0
  }, m = {
    className: "regexp",
    contains: [
      t.BACKSLASH_ESCAPE,
      s
    ],
    variants: [
      {
        begin: "%r\\(",
        end: "\\)",
        contains: u("\\(", "\\)")
      },
      {
        begin: "%r\\[",
        end: "\\]",
        contains: u("\\[", "\\]")
      },
      {
        begin: "%r\\{",
        end: /\}/,
        contains: u(/\{/, /\}/)
      },
      {
        begin: "%r<",
        end: ">",
        contains: u("<", ">")
      },
      {
        begin: "%r\\|",
        end: "\\|"
      }
    ],
    relevance: 0
  }, f = {
    className: "meta",
    begin: "@\\[",
    end: "\\]",
    contains: [t.inherit(t.QUOTE_STRING_MODE, { className: "string" })]
  }, g = [
    c,
    d,
    p,
    m,
    _,
    f,
    l,
    t.HASH_COMMENT_MODE,
    {
      className: "class",
      beginKeywords: "class module struct",
      end: "$|;",
      illegal: /=/,
      contains: [
        t.HASH_COMMENT_MODE,
        t.inherit(t.TITLE_MODE, { begin: o }),
        {
          // relevance booster for inheritance
          begin: "<"
        }
      ]
    },
    {
      className: "class",
      beginKeywords: "lib enum union",
      end: "$|;",
      illegal: /=/,
      contains: [
        t.HASH_COMMENT_MODE,
        t.inherit(t.TITLE_MODE, { begin: o })
      ]
    },
    {
      beginKeywords: "annotation",
      end: "$|;",
      illegal: /=/,
      contains: [
        t.HASH_COMMENT_MODE,
        t.inherit(t.TITLE_MODE, { begin: o })
      ],
      relevance: 2
    },
    {
      className: "function",
      beginKeywords: "def",
      end: /\B\b/,
      contains: [
        t.inherit(t.TITLE_MODE, {
          begin: i,
          endsParent: !0
        })
      ]
    },
    {
      className: "function",
      beginKeywords: "fun macro",
      end: /\B\b/,
      contains: [
        t.inherit(t.TITLE_MODE, {
          begin: i,
          endsParent: !0
        })
      ],
      relevance: 2
    },
    {
      className: "symbol",
      begin: t.UNDERSCORE_IDENT_RE + "(!|\\?)?:",
      relevance: 0
    },
    {
      className: "symbol",
      begin: ":",
      contains: [
        d,
        { begin: i }
      ],
      relevance: 0
    },
    {
      className: "number",
      variants: [
        { begin: "\\b0b([01_]+)" + e },
        { begin: "\\b0o([0-7_]+)" + e },
        { begin: "\\b0x([A-Fa-f0-9_]+)" + e },
        { begin: "\\b([1-9][0-9_]*[0-9]|[0-9])(\\.[0-9][0-9_]*)?([eE]_?[-+]?[0-9_]*)?" + n + "(?!_)" },
        { begin: "\\b([1-9][0-9_]*|0)" + e }
      ],
      relevance: 0
    }
  ];
  return s.contains = g, c.contains = g.slice(1), {
    name: "Crystal",
    aliases: ["cr"],
    keywords: a,
    contains: g
  };
}
function jI(t) {
  return {
    name: "CSP",
    case_insensitive: !1,
    keywords: {
      $pattern: "[a-zA-Z][a-zA-Z0-9_-]*",
      keyword: [
        "base-uri",
        "child-src",
        "connect-src",
        "default-src",
        "font-src",
        "form-action",
        "frame-ancestors",
        "frame-src",
        "img-src",
        "manifest-src",
        "media-src",
        "object-src",
        "plugin-types",
        "report-uri",
        "sandbox",
        "script-src",
        "style-src",
        "trusted-types",
        "unsafe-hashes",
        "worker-src"
      ]
    },
    contains: [
      {
        className: "string",
        begin: "'",
        end: "'"
      },
      {
        className: "attribute",
        begin: "^Content",
        end: ":",
        excludeEnd: !0
      }
    ]
  };
}
function JI(t) {
  const e = {
    $pattern: t.UNDERSCORE_IDENT_RE,
    keyword: "abstract alias align asm assert auto body break byte case cast catch class const continue debug default delete deprecated do else enum export extern final finally for foreach foreach_reverse|10 goto if immutable import in inout int interface invariant is lazy macro mixin module new nothrow out override package pragma private protected public pure ref return scope shared static struct super switch synchronized template this throw try typedef typeid typeof union unittest version void volatile while with __FILE__ __LINE__ __gshared|10 __thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__",
    built_in: "bool cdouble cent cfloat char creal dchar delegate double dstring float function idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar wstring",
    literal: "false null true"
  }, n = "(0|[1-9][\\d_]*)", r = "(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)", i = "0[bB][01_]+", o = "([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)", a = "0[xX]" + o, s = "([eE][+-]?" + r + ")", l = "(" + r + "(\\.\\d*|" + s + ")|\\d+\\." + r + "|\\." + n + s + "?)", c = "(0[xX](" + o + "\\." + o + "|\\.?" + o + ")[pP][+-]?" + r + ")", u = "(" + n + "|" + i + "|" + a + ")", d = "(" + c + "|" + l + ")", p = `\\\\(['"\\?\\\\abfnrtv]|u[\\dA-Fa-f]{4}|[0-7]{1,3}|x[\\dA-Fa-f]{2}|U[\\dA-Fa-f]{8})|&[a-zA-Z\\d]{2,};`, _ = {
    className: "number",
    begin: "\\b" + u + "(L|u|U|Lu|LU|uL|UL)?",
    relevance: 0
  }, m = {
    className: "number",
    begin: "\\b(" + d + "([fF]|L|i|[fF]i|Li)?|" + u + "(i|[fF]i|Li))",
    relevance: 0
  }, f = {
    className: "string",
    begin: "'(" + p + "|.)",
    end: "'",
    illegal: "."
  }, S = {
    className: "string",
    begin: '"',
    contains: [{
      begin: p,
      relevance: 0
    }],
    end: '"[cwd]?'
  }, E = {
    className: "string",
    begin: '[rq]"',
    end: '"[cwd]?',
    relevance: 5
  }, b = {
    className: "string",
    begin: "`",
    end: "`[cwd]?"
  }, h = {
    className: "string",
    begin: 'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',
    relevance: 10
  }, T = {
    className: "string",
    begin: 'q"\\{',
    end: '\\}"'
  }, C = {
    className: "meta",
    begin: "^#!",
    end: "$",
    relevance: 5
  }, v = {
    className: "meta",
    begin: "#(line)",
    end: "$",
    relevance: 5
  }, I = {
    className: "keyword",
    begin: "@[a-zA-Z_][a-zA-Z_\\d]*"
  }, N = t.COMMENT(
    "\\/\\+",
    "\\+\\/",
    {
      contains: ["self"],
      relevance: 10
    }
  );
  return {
    name: "D",
    keywords: e,
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      N,
      h,
      S,
      E,
      b,
      T,
      m,
      _,
      f,
      C,
      v,
      I
    ]
  };
}
function ex(t) {
  const e = {
    className: "subst",
    variants: [{ begin: "\\$[A-Za-z0-9_]+" }]
  }, n = {
    className: "subst",
    variants: [
      {
        begin: /\$\{/,
        end: /\}/
      }
    ],
    keywords: "true false null this is new super"
  }, r = {
    className: "number",
    relevance: 0,
    variants: [
      { match: /\b[0-9][0-9_]*(\.[0-9][0-9_]*)?([eE][+-]?[0-9][0-9_]*)?\b/ },
      { match: /\b0[xX][0-9A-Fa-f][0-9A-Fa-f_]*\b/ }
    ]
  }, i = {
    className: "string",
    variants: [
      {
        begin: "r'''",
        end: "'''"
      },
      {
        begin: 'r"""',
        end: '"""'
      },
      {
        begin: "r'",
        end: "'",
        illegal: "\\n"
      },
      {
        begin: 'r"',
        end: '"',
        illegal: "\\n"
      },
      {
        begin: "'''",
        end: "'''",
        contains: [
          t.BACKSLASH_ESCAPE,
          e,
          n
        ]
      },
      {
        begin: '"""',
        end: '"""',
        contains: [
          t.BACKSLASH_ESCAPE,
          e,
          n
        ]
      },
      {
        begin: "'",
        end: "'",
        illegal: "\\n",
        contains: [
          t.BACKSLASH_ESCAPE,
          e,
          n
        ]
      },
      {
        begin: '"',
        end: '"',
        illegal: "\\n",
        contains: [
          t.BACKSLASH_ESCAPE,
          e,
          n
        ]
      }
    ]
  };
  n.contains = [
    r,
    i
  ];
  const o = [
    // dart:core
    "Comparable",
    "DateTime",
    "Duration",
    "Function",
    "Iterable",
    "Iterator",
    "List",
    "Map",
    "Match",
    "Object",
    "Pattern",
    "RegExp",
    "Set",
    "Stopwatch",
    "String",
    "StringBuffer",
    "StringSink",
    "Symbol",
    "Type",
    "Uri",
    "bool",
    "double",
    "int",
    "num",
    // dart:html
    "Element",
    "ElementList"
  ], a = o.map((c) => `${c}?`);
  return {
    name: "Dart",
    keywords: {
      keyword: [
        "abstract",
        "as",
        "assert",
        "async",
        "await",
        "base",
        "break",
        "case",
        "catch",
        "class",
        "const",
        "continue",
        "covariant",
        "default",
        "deferred",
        "do",
        "dynamic",
        "else",
        "enum",
        "export",
        "extends",
        "extension",
        "external",
        "factory",
        "false",
        "final",
        "finally",
        "for",
        "Function",
        "get",
        "hide",
        "if",
        "implements",
        "import",
        "in",
        "interface",
        "is",
        "late",
        "library",
        "mixin",
        "new",
        "null",
        "on",
        "operator",
        "part",
        "required",
        "rethrow",
        "return",
        "sealed",
        "set",
        "show",
        "static",
        "super",
        "switch",
        "sync",
        "this",
        "throw",
        "true",
        "try",
        "typedef",
        "var",
        "void",
        "when",
        "while",
        "with",
        "yield"
      ],
      built_in: o.concat(a).concat([
        // dart:core
        "Never",
        "Null",
        "dynamic",
        "print",
        // dart:html
        "document",
        "querySelector",
        "querySelectorAll",
        "window"
      ]),
      $pattern: /[A-Za-z][A-Za-z0-9_]*\??/
    },
    contains: [
      i,
      t.COMMENT(
        /\/\*\*(?!\/)/,
        /\*\//,
        {
          subLanguage: "markdown",
          relevance: 0
        }
      ),
      t.COMMENT(
        /\/{3,} ?/,
        /$/,
        { contains: [
          {
            subLanguage: "markdown",
            begin: ".",
            end: "$",
            relevance: 0
          }
        ] }
      ),
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      {
        className: "class",
        beginKeywords: "class interface",
        end: /\{/,
        excludeEnd: !0,
        contains: [
          { beginKeywords: "extends implements" },
          t.UNDERSCORE_TITLE_MODE
        ]
      },
      r,
      {
        className: "meta",
        begin: "@[A-Za-z]+"
      },
      {
        begin: "=>"
        // No markup, just a relevance booster
      }
    ]
  };
}
function tx(t) {
  const e = [
    "exports",
    "register",
    "file",
    "shl",
    "array",
    "record",
    "property",
    "for",
    "mod",
    "while",
    "set",
    "ally",
    "label",
    "uses",
    "raise",
    "not",
    "stored",
    "class",
    "safecall",
    "var",
    "interface",
    "or",
    "private",
    "static",
    "exit",
    "index",
    "inherited",
    "to",
    "else",
    "stdcall",
    "override",
    "shr",
    "asm",
    "far",
    "resourcestring",
    "finalization",
    "packed",
    "virtual",
    "out",
    "and",
    "protected",
    "library",
    "do",
    "xorwrite",
    "goto",
    "near",
    "function",
    "end",
    "div",
    "overload",
    "object",
    "unit",
    "begin",
    "string",
    "on",
    "inline",
    "repeat",
    "until",
    "destructor",
    "write",
    "message",
    "program",
    "with",
    "read",
    "initialization",
    "except",
    "default",
    "nil",
    "if",
    "case",
    "cdecl",
    "in",
    "downto",
    "threadvar",
    "of",
    "try",
    "pascal",
    "const",
    "external",
    "constructor",
    "type",
    "public",
    "then",
    "implementation",
    "finally",
    "published",
    "procedure",
    "absolute",
    "reintroduce",
    "operator",
    "as",
    "is",
    "abstract",
    "alias",
    "assembler",
    "bitpacked",
    "break",
    "continue",
    "cppdecl",
    "cvar",
    "enumerator",
    "experimental",
    "platform",
    "deprecated",
    "unimplemented",
    "dynamic",
    "export",
    "far16",
    "forward",
    "generic",
    "helper",
    "implements",
    "interrupt",
    "iochecks",
    "local",
    "name",
    "nodefault",
    "noreturn",
    "nostackframe",
    "oldfpccall",
    "otherwise",
    "saveregisters",
    "softfloat",
    "specialize",
    "strict",
    "unaligned",
    "varargs"
  ], n = [
    t.C_LINE_COMMENT_MODE,
    t.COMMENT(/\{/, /\}/, { relevance: 0 }),
    t.COMMENT(/\(\*/, /\*\)/, { relevance: 10 })
  ], r = {
    className: "meta",
    variants: [
      {
        begin: /\{\$/,
        end: /\}/
      },
      {
        begin: /\(\*\$/,
        end: /\*\)/
      }
    ]
  }, i = {
    className: "string",
    begin: /'/,
    end: /'/,
    contains: [{ begin: /''/ }]
  }, o = {
    className: "number",
    relevance: 0,
    // Source: https://www.freepascal.org/docs-html/ref/refse6.html
    variants: [
      {
        // Regular numbers, e.g., 123, 123.456.
        match: /\b\d[\d_]*(\.\d[\d_]*)?/
      },
      {
        // Hexadecimal notation, e.g., $7F.
        match: /\$[\dA-Fa-f_]+/
      },
      {
        // Hexadecimal literal with no digits
        match: /\$/,
        relevance: 0
      },
      {
        // Octal notation, e.g., &42.
        match: /&[0-7][0-7_]*/
      },
      {
        // Binary notation, e.g., %1010.
        match: /%[01_]+/
      },
      {
        // Binary literal with no digits
        match: /%/,
        relevance: 0
      }
    ]
  }, a = {
    className: "string",
    variants: [
      { match: /#\d[\d_]*/ },
      { match: /#\$[\dA-Fa-f][\dA-Fa-f_]*/ },
      { match: /#&[0-7][0-7_]*/ },
      { match: /#%[01][01_]*/ }
    ]
  }, s = {
    begin: t.IDENT_RE + "\\s*=\\s*class\\s*\\(",
    returnBegin: !0,
    contains: [t.TITLE_MODE]
  }, l = {
    className: "function",
    beginKeywords: "function constructor destructor procedure",
    end: /[:;]/,
    keywords: "function constructor|10 destructor|10 procedure|10",
    contains: [
      t.TITLE_MODE,
      {
        className: "params",
        begin: /\(/,
        end: /\)/,
        keywords: e,
        contains: [
          i,
          a,
          r
        ].concat(n)
      },
      r
    ].concat(n)
  };
  return {
    name: "Delphi",
    aliases: [
      "dpr",
      "dfm",
      "pas",
      "pascal"
    ],
    case_insensitive: !0,
    keywords: e,
    illegal: /"|\$[G-Zg-z]|\/\*|<\/|\|/,
    contains: [
      i,
      a,
      o,
      s,
      l,
      r
    ].concat(n)
  };
}
function nx(t) {
  const e = {
    begin: /\|[A-Za-z]+:?/,
    keywords: { name: "truncatewords removetags linebreaksbr yesno get_digit timesince random striptags filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort dictsortreversed default_if_none pluralize lower join center default truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize localtime utc timezone" },
    contains: [
      t.QUOTE_STRING_MODE,
      t.APOS_STRING_MODE
    ]
  };
  return {
    name: "Django",
    aliases: ["jinja"],
    case_insensitive: !0,
    subLanguage: "xml",
    contains: [
      t.COMMENT(/\{%\s*comment\s*%\}/, /\{%\s*endcomment\s*%\}/),
      t.COMMENT(/\{#/, /#\}/),
      {
        className: "template-tag",
        begin: /\{%/,
        end: /%\}/,
        contains: [
          {
            className: "name",
            begin: /\w+/,
            keywords: { name: "comment endcomment load templatetag ifchanged endifchanged if endif firstof for endfor ifnotequal endifnotequal widthratio extends include spaceless endspaceless regroup ifequal endifequal ssi now with cycle url filter endfilter debug block endblock else autoescape endautoescape csrf_token empty elif endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix plural get_current_language language get_available_languages get_current_language_bidi get_language_info get_language_info_list localize endlocalize localtime endlocaltime timezone endtimezone get_current_timezone verbatim" },
            starts: {
              endsWithParent: !0,
              keywords: "in by as",
              contains: [e],
              relevance: 0
            }
          }
        ]
      },
      {
        className: "template-variable",
        begin: /\{\{/,
        end: /\}\}/,
        contains: [e]
      }
    ]
  };
}
function rx(t) {
  return {
    name: "DNS Zone",
    aliases: [
      "bind",
      "zone"
    ],
    keywords: [
      "IN",
      "A",
      "AAAA",
      "AFSDB",
      "APL",
      "CAA",
      "CDNSKEY",
      "CDS",
      "CERT",
      "CNAME",
      "DHCID",
      "DLV",
      "DNAME",
      "DNSKEY",
      "DS",
      "HIP",
      "IPSECKEY",
      "KEY",
      "KX",
      "LOC",
      "MX",
      "NAPTR",
      "NS",
      "NSEC",
      "NSEC3",
      "NSEC3PARAM",
      "PTR",
      "RRSIG",
      "RP",
      "SIG",
      "SOA",
      "SRV",
      "SSHFP",
      "TA",
      "TKEY",
      "TLSA",
      "TSIG",
      "TXT"
    ],
    contains: [
      t.COMMENT(";", "$", { relevance: 0 }),
      {
        className: "meta",
        begin: /^\$(TTL|GENERATE|INCLUDE|ORIGIN)\b/
      },
      // IPv6
      {
        className: "number",
        begin: "((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))\\b"
      },
      // IPv4
      {
        className: "number",
        begin: "((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]).){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\b"
      },
      t.inherit(t.NUMBER_MODE, { begin: /\b\d+[dhwm]?/ })
    ]
  };
}
function ix(t) {
  return {
    name: "Dockerfile",
    aliases: ["docker"],
    case_insensitive: !0,
    keywords: [
      "from",
      "maintainer",
      "expose",
      "env",
      "arg",
      "user",
      "onbuild",
      "stopsignal"
    ],
    contains: [
      t.HASH_COMMENT_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      t.NUMBER_MODE,
      {
        beginKeywords: "run cmd entrypoint volume add copy workdir label healthcheck shell",
        starts: {
          end: /[^\\]$/,
          subLanguage: "bash"
        }
      }
    ],
    illegal: "</"
  };
}
function ox(t) {
  const e = t.COMMENT(
    /^\s*@?rem\b/,
    /$/,
    { relevance: 10 }
  );
  return {
    name: "Batch file (DOS)",
    aliases: [
      "bat",
      "cmd"
    ],
    case_insensitive: !0,
    illegal: /\/\*/,
    keywords: {
      keyword: [
        "if",
        "else",
        "goto",
        "for",
        "in",
        "do",
        "call",
        "exit",
        "not",
        "exist",
        "errorlevel",
        "defined",
        "equ",
        "neq",
        "lss",
        "leq",
        "gtr",
        "geq"
      ],
      built_in: [
        "prn",
        "nul",
        "lpt3",
        "lpt2",
        "lpt1",
        "con",
        "com4",
        "com3",
        "com2",
        "com1",
        "aux",
        "shift",
        "cd",
        "dir",
        "echo",
        "setlocal",
        "endlocal",
        "set",
        "pause",
        "copy",
        "append",
        "assoc",
        "at",
        "attrib",
        "break",
        "cacls",
        "cd",
        "chcp",
        "chdir",
        "chkdsk",
        "chkntfs",
        "cls",
        "cmd",
        "color",
        "comp",
        "compact",
        "convert",
        "date",
        "dir",
        "diskcomp",
        "diskcopy",
        "doskey",
        "erase",
        "fs",
        "find",
        "findstr",
        "format",
        "ftype",
        "graftabl",
        "help",
        "keyb",
        "label",
        "md",
        "mkdir",
        "mode",
        "more",
        "move",
        "path",
        "pause",
        "print",
        "popd",
        "pushd",
        "promt",
        "rd",
        "recover",
        "rem",
        "rename",
        "replace",
        "restore",
        "rmdir",
        "shift",
        "sort",
        "start",
        "subst",
        "time",
        "title",
        "tree",
        "type",
        "ver",
        "verify",
        "vol",
        // winutils
        "ping",
        "net",
        "ipconfig",
        "taskkill",
        "xcopy",
        "ren",
        "del"
      ]
    },
    contains: [
      {
        className: "variable",
        begin: /%%[^ ]|%[^ ]+?%|![^ ]+?!/
      },
      {
        className: "function",
        begin: {
          className: "symbol",
          begin: "^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)",
          relevance: 0
        }.begin,
        end: "goto:eof",
        contains: [
          t.inherit(t.TITLE_MODE, { begin: "([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*" }),
          e
        ]
      },
      {
        className: "number",
        begin: "\\b\\d+",
        relevance: 0
      },
      e
    ]
  };
}
function ax(t) {
  return {
    keywords: "dsconfig",
    contains: [
      {
        className: "keyword",
        begin: "^dsconfig",
        end: /\s/,
        excludeEnd: !0,
        relevance: 10
      },
      {
        className: "built_in",
        begin: /(list|create|get|set|delete)-(\w+)/,
        end: /\s/,
        excludeEnd: !0,
        illegal: "!@#$%^&*()",
        relevance: 10
      },
      {
        className: "built_in",
        begin: /--(\w+)/,
        end: /\s/,
        excludeEnd: !0
      },
      {
        className: "string",
        begin: /"/,
        end: /"/
      },
      {
        className: "string",
        begin: /'/,
        end: /'/
      },
      {
        className: "string",
        begin: /[\w\-?]+:\w+/,
        end: /\W/,
        relevance: 0
      },
      {
        className: "string",
        begin: /\w+(\-\w+)*/,
        end: /(?=\W)/,
        relevance: 0
      },
      t.HASH_COMMENT_MODE
    ]
  };
}
function sx(t) {
  const e = {
    className: "string",
    variants: [
      t.inherit(t.QUOTE_STRING_MODE, { begin: '((u8?|U)|L)?"' }),
      {
        begin: '(u8?|U)?R"',
        end: '"',
        contains: [t.BACKSLASH_ESCAPE]
      },
      {
        begin: "'\\\\?.",
        end: "'",
        illegal: "."
      }
    ]
  }, n = {
    className: "number",
    variants: [
      { begin: "\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)" },
      { begin: t.C_NUMBER_RE }
    ],
    relevance: 0
  }, r = {
    className: "meta",
    begin: "#",
    end: "$",
    keywords: { keyword: "if else elif endif define undef ifdef ifndef" },
    contains: [
      {
        begin: /\\\n/,
        relevance: 0
      },
      {
        beginKeywords: "include",
        end: "$",
        keywords: { keyword: "include" },
        contains: [
          t.inherit(e, { className: "string" }),
          {
            className: "string",
            begin: "<",
            end: ">",
            illegal: "\\n"
          }
        ]
      },
      e,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE
    ]
  }, i = {
    className: "variable",
    begin: /&[a-z\d_]*\b/
  }, o = {
    className: "keyword",
    begin: "/[a-z][a-z\\d-]*/"
  }, a = {
    className: "symbol",
    begin: "^\\s*[a-zA-Z_][a-zA-Z\\d_]*:"
  }, s = {
    className: "params",
    relevance: 0,
    begin: "<",
    end: ">",
    contains: [
      n,
      i
    ]
  }, l = {
    className: "title.class",
    begin: /[a-zA-Z_][a-zA-Z\d_@-]*(?=\s\{)/,
    relevance: 0.2
  }, c = {
    className: "title.class",
    begin: /^\/(?=\s*\{)/,
    relevance: 10
  }, u = {
    match: /[a-z][a-z-,]+(?=;)/,
    relevance: 0,
    scope: "attr"
  }, d = {
    relevance: 0,
    match: [
      /[a-z][a-z-,]+/,
      /\s*/,
      /=/
    ],
    scope: {
      1: "attr",
      3: "operator"
    }
  }, p = {
    scope: "punctuation",
    relevance: 0,
    // `};` combined is just to avoid tons of useless punctuation nodes
    match: /\};|[;{}]/
  };
  return {
    name: "Device Tree",
    contains: [
      c,
      i,
      o,
      a,
      l,
      d,
      u,
      s,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      n,
      e,
      r,
      p,
      {
        begin: t.IDENT_RE + "::",
        keywords: ""
      }
    ]
  };
}
function lx(t) {
  return {
    name: "Dust",
    aliases: ["dst"],
    case_insensitive: !0,
    subLanguage: "xml",
    contains: [
      {
        className: "template-tag",
        begin: /\{[#\/]/,
        end: /\}/,
        illegal: /;/,
        contains: [
          {
            className: "name",
            begin: /[a-zA-Z\.-]+/,
            starts: {
              endsWithParent: !0,
              relevance: 0,
              contains: [t.QUOTE_STRING_MODE]
            }
          }
        ]
      },
      {
        className: "template-variable",
        begin: /\{/,
        end: /\}/,
        illegal: /;/,
        keywords: "if eq ne lt lte gt gte select default math sep"
      }
    ]
  };
}
function cx(t) {
  const e = t.COMMENT(/\(\*/, /\*\)/), n = {
    className: "attribute",
    begin: /^[ ]*[a-zA-Z]+([\s_-]+[a-zA-Z]+)*/
  }, i = {
    begin: /=/,
    end: /[.;]/,
    contains: [
      e,
      {
        className: "meta",
        begin: /\?.*\?/
      },
      {
        // terminals
        className: "string",
        variants: [
          t.APOS_STRING_MODE,
          t.QUOTE_STRING_MODE,
          {
            begin: "`",
            end: "`"
          }
        ]
      }
    ]
  };
  return {
    name: "Extended Backus-Naur Form",
    illegal: /\S/,
    contains: [
      e,
      n,
      i
    ]
  };
}
function ux(t) {
  const e = t.regex, n = "[a-zA-Z_][a-zA-Z0-9_.]*(!|\\?)?", r = "[a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?", a = {
    $pattern: n,
    keyword: [
      "after",
      "alias",
      "and",
      "case",
      "catch",
      "cond",
      "defstruct",
      "defguard",
      "do",
      "else",
      "end",
      "fn",
      "for",
      "if",
      "import",
      "in",
      "not",
      "or",
      "quote",
      "raise",
      "receive",
      "require",
      "reraise",
      "rescue",
      "try",
      "unless",
      "unquote",
      "unquote_splicing",
      "use",
      "when",
      "with|0"
    ],
    literal: [
      "false",
      "nil",
      "true"
    ]
  }, s = {
    className: "subst",
    begin: /#\{/,
    end: /\}/,
    keywords: a
  }, l = {
    className: "number",
    begin: "(\\b0o[0-7_]+)|(\\b0b[01_]+)|(\\b0x[0-9a-fA-F_]+)|(-?\\b[0-9][0-9_]*(\\.[0-9_]+([eE][-+]?[0-9]+)?)?)",
    relevance: 0
  }, u = {
    match: /\\[\s\S]/,
    scope: "char.escape",
    relevance: 0
  }, d = `[/|([{<"']`, p = [
    {
      begin: /"/,
      end: /"/
    },
    {
      begin: /'/,
      end: /'/
    },
    {
      begin: /\//,
      end: /\//
    },
    {
      begin: /\|/,
      end: /\|/
    },
    {
      begin: /\(/,
      end: /\)/
    },
    {
      begin: /\[/,
      end: /\]/
    },
    {
      begin: /\{/,
      end: /\}/
    },
    {
      begin: /</,
      end: />/
    }
  ], _ = (T) => ({
    scope: "char.escape",
    begin: e.concat(/\\/, T),
    relevance: 0
  }), m = {
    className: "string",
    begin: "~[a-z](?=" + d + ")",
    contains: p.map((T) => t.inherit(
      T,
      { contains: [
        _(T.end),
        u,
        s
      ] }
    ))
  }, f = {
    className: "string",
    begin: "~[A-Z](?=" + d + ")",
    contains: p.map((T) => t.inherit(
      T,
      { contains: [_(T.end)] }
    ))
  }, g = {
    className: "regex",
    variants: [
      {
        begin: "~r(?=" + d + ")",
        contains: p.map((T) => t.inherit(
          T,
          {
            end: e.concat(T.end, /[uismxfU]{0,7}/),
            contains: [
              _(T.end),
              u,
              s
            ]
          }
        ))
      },
      {
        begin: "~R(?=" + d + ")",
        contains: p.map(
          (T) => t.inherit(
            T,
            {
              end: e.concat(T.end, /[uismxfU]{0,7}/),
              contains: [_(T.end)]
            }
          )
        )
      }
    ]
  }, S = {
    className: "string",
    contains: [
      t.BACKSLASH_ESCAPE,
      s
    ],
    variants: [
      {
        begin: /"""/,
        end: /"""/
      },
      {
        begin: /'''/,
        end: /'''/
      },
      {
        begin: /~S"""/,
        end: /"""/,
        contains: []
        // override default
      },
      {
        begin: /~S"/,
        end: /"/,
        contains: []
        // override default
      },
      {
        begin: /~S'''/,
        end: /'''/,
        contains: []
        // override default
      },
      {
        begin: /~S'/,
        end: /'/,
        contains: []
        // override default
      },
      {
        begin: /'/,
        end: /'/
      },
      {
        begin: /"/,
        end: /"/
      }
    ]
  }, E = {
    className: "function",
    beginKeywords: "def defp defmacro defmacrop",
    end: /\B\b/,
    // the mode is ended by the title
    contains: [
      t.inherit(t.TITLE_MODE, {
        begin: n,
        endsParent: !0
      })
    ]
  }, b = t.inherit(E, {
    className: "class",
    beginKeywords: "defimpl defmodule defprotocol defrecord",
    end: /\bdo\b|$|;/
  }), h = [
    S,
    g,
    f,
    m,
    t.HASH_COMMENT_MODE,
    b,
    E,
    { begin: "::" },
    {
      className: "symbol",
      begin: ":(?![\\s:])",
      contains: [
        S,
        { begin: r }
      ],
      relevance: 0
    },
    {
      className: "symbol",
      begin: n + ":(?!:)",
      relevance: 0
    },
    {
      // Usage of a module, struct, etc.
      className: "title.class",
      begin: /(\b[A-Z][a-zA-Z0-9_]+)/,
      relevance: 0
    },
    l,
    {
      className: "variable",
      begin: "(\\$\\W)|((\\$|@@?)(\\w+))"
    }
    // -> has been removed, capnproto always uses this grammar construct
  ];
  return s.contains = h, {
    name: "Elixir",
    aliases: [
      "ex",
      "exs"
    ],
    keywords: a,
    contains: h
  };
}
function dx(t) {
  const e = { variants: [
    t.COMMENT("--", "$"),
    t.COMMENT(
      /\{-/,
      /-\}/,
      { contains: ["self"] }
    )
  ] }, n = {
    className: "type",
    begin: "\\b[A-Z][\\w']*",
    // TODO: other constructors (built-in, infix).
    relevance: 0
  }, r = {
    begin: "\\(",
    end: "\\)",
    illegal: '"',
    contains: [
      {
        className: "type",
        begin: "\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"
      },
      e
    ]
  }, i = {
    begin: /\{/,
    end: /\}/,
    contains: r.contains
  }, o = {
    className: "string",
    begin: "'\\\\?.",
    end: "'",
    illegal: "."
  };
  return {
    name: "Elm",
    keywords: [
      "let",
      "in",
      "if",
      "then",
      "else",
      "case",
      "of",
      "where",
      "module",
      "import",
      "exposing",
      "type",
      "alias",
      "as",
      "infix",
      "infixl",
      "infixr",
      "port",
      "effect",
      "command",
      "subscription"
    ],
    contains: [
      // Top-level constructions.
      {
        beginKeywords: "port effect module",
        end: "exposing",
        keywords: "port effect module where command subscription exposing",
        contains: [
          r,
          e
        ],
        illegal: "\\W\\.|;"
      },
      {
        begin: "import",
        end: "$",
        keywords: "import as exposing",
        contains: [
          r,
          e
        ],
        illegal: "\\W\\.|;"
      },
      {
        begin: "type",
        end: "$",
        keywords: "type alias",
        contains: [
          n,
          r,
          i,
          e
        ]
      },
      {
        beginKeywords: "infix infixl infixr",
        end: "$",
        contains: [
          t.C_NUMBER_MODE,
          e
        ]
      },
      {
        begin: "port",
        end: "$",
        keywords: "port",
        contains: [e]
      },
      // Literals and names.
      o,
      t.QUOTE_STRING_MODE,
      t.C_NUMBER_MODE,
      n,
      t.inherit(t.TITLE_MODE, { begin: "^[_a-z][\\w']*" }),
      e,
      {
        // No markup, relevance booster
        begin: "->|<-"
      }
    ],
    illegal: /;/
  };
}
function px(t) {
  return {
    name: "ERB",
    subLanguage: "xml",
    contains: [
      t.COMMENT("<%#", "%>"),
      {
        begin: "<%[%=-]?",
        end: "[%-]?%>",
        subLanguage: "ruby",
        excludeBegin: !0,
        excludeEnd: !0
      }
    ]
  };
}
function _x(t) {
  const e = "[a-z'][a-zA-Z0-9_']*", n = "(" + e + ":" + e + "|" + e + ")", r = {
    keyword: "after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun if let not of orelse|10 query receive rem try when xor maybe else",
    literal: "false true"
  }, i = t.COMMENT("%", "$"), o = {
    className: "number",
    begin: "\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)",
    relevance: 0
  }, a = { begin: "fun\\s+" + e + "/\\d+" }, s = {
    begin: n + "\\(",
    end: "\\)",
    returnBegin: !0,
    relevance: 0,
    contains: [
      {
        begin: n,
        relevance: 0
      },
      {
        begin: "\\(",
        end: "\\)",
        endsWithParent: !0,
        returnEnd: !0,
        relevance: 0
        // "contains" defined later
      }
    ]
  }, l = {
    begin: /\{/,
    end: /\}/,
    relevance: 0
    // "contains" defined later
  }, c = {
    begin: "\\b_([A-Z][A-Za-z0-9_]*)?",
    relevance: 0
  }, u = {
    begin: "[A-Z][a-zA-Z0-9_]*",
    relevance: 0
  }, d = {
    begin: "#" + t.UNDERSCORE_IDENT_RE,
    relevance: 0,
    returnBegin: !0,
    contains: [
      {
        begin: "#" + t.UNDERSCORE_IDENT_RE,
        relevance: 0
      },
      {
        begin: /\{/,
        end: /\}/,
        relevance: 0
        // "contains" defined later
      }
    ]
  }, p = {
    scope: "string",
    match: /\$(\\([^0-9]|[0-9]{1,3}|)|.)/
  }, _ = {
    scope: "string",
    match: /"""("*)(?!")[\s\S]*?"""\1/
  }, m = {
    scope: "string",
    contains: [t.BACKSLASH_ESCAPE],
    variants: [
      { match: /~\w?"""("*)(?!")[\s\S]*?"""\1/ },
      { begin: /~\w?\(/, end: /\)/ },
      { begin: /~\w?\[/, end: /\]/ },
      { begin: /~\w?{/, end: /}/ },
      { begin: /~\w?</, end: />/ },
      { begin: /~\w?\//, end: /\// },
      { begin: /~\w?\|/, end: /\|/ },
      { begin: /~\w?'/, end: /'/ },
      { begin: /~\w?"/, end: /"/ },
      { begin: /~\w?`/, end: /`/ },
      { begin: /~\w?#/, end: /#/ }
    ]
  }, f = {
    beginKeywords: "fun receive if try case maybe",
    end: "end",
    keywords: r
  };
  f.contains = [
    i,
    a,
    t.inherit(t.APOS_STRING_MODE, { className: "" }),
    f,
    s,
    m,
    _,
    t.QUOTE_STRING_MODE,
    o,
    l,
    c,
    u,
    d,
    p
  ];
  const g = [
    i,
    a,
    f,
    s,
    m,
    _,
    t.QUOTE_STRING_MODE,
    o,
    l,
    c,
    u,
    d,
    p
  ];
  s.contains[1].contains = g, l.contains = g, d.contains[1].contains = g;
  const S = [
    "-module",
    "-record",
    "-undef",
    "-export",
    "-ifdef",
    "-ifndef",
    "-author",
    "-copyright",
    "-doc",
    "-moduledoc",
    "-vsn",
    "-import",
    "-include",
    "-include_lib",
    "-compile",
    "-define",
    "-else",
    "-endif",
    "-file",
    "-behaviour",
    "-behavior",
    "-spec",
    "-on_load",
    "-nifs"
  ], E = {
    className: "params",
    begin: "\\(",
    end: "\\)",
    contains: g
  };
  return {
    name: "Erlang",
    aliases: ["erl"],
    keywords: r,
    illegal: "(</|\\*=|\\+=|-=|/\\*|\\*/|\\(\\*|\\*\\))",
    contains: [
      {
        className: "function",
        begin: "^" + e + "\\s*\\(",
        end: "->",
        returnBegin: !0,
        illegal: "\\(|#|//|/\\*|\\\\|:|;",
        contains: [
          E,
          t.inherit(t.TITLE_MODE, { begin: e })
        ],
        starts: {
          end: ";|\\.",
          keywords: r,
          contains: g
        }
      },
      i,
      {
        begin: "^-",
        end: "\\.",
        relevance: 0,
        excludeEnd: !0,
        returnBegin: !0,
        keywords: {
          $pattern: "-" + t.IDENT_RE,
          keyword: S.map((b) => `${b}|1.5`).join(" ")
        },
        contains: [
          E,
          m,
          _,
          t.QUOTE_STRING_MODE
        ]
      },
      o,
      m,
      _,
      t.QUOTE_STRING_MODE,
      d,
      c,
      u,
      l,
      p,
      { begin: /\.$/ }
      // relevance booster
    ]
  };
}
function mx(t) {
  const e = t.regex;
  return {
    name: "Erlang REPL",
    keywords: {
      built_in: "spawn spawn_link self",
      keyword: "after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if let not of or orelse|10 query receive rem try when xor"
    },
    contains: [
      {
        className: "meta.prompt",
        begin: "^[0-9]+> ",
        relevance: 10
      },
      t.COMMENT("%", "$"),
      {
        className: "number",
        begin: "\\b(\\d+(_\\d+)*#[a-fA-F0-9]+(_[a-fA-F0-9]+)*|\\d+(_\\d+)*(\\.\\d+(_\\d+)*)?([eE][-+]?\\d+)?)",
        relevance: 0
      },
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      { begin: e.concat(
        /\?(::)?/,
        /([A-Z]\w*)/,
        // at least one identifier
        /((::)[A-Z]\w*)*/
        // perhaps more
      ) },
      { begin: "->" },
      { begin: "ok" },
      { begin: "!" },
      {
        begin: "(\\b[a-z'][a-zA-Z0-9_']*:[a-z'][a-zA-Z0-9_']*)|(\\b[a-z'][a-zA-Z0-9_']*)",
        relevance: 0
      },
      {
        begin: "[A-Z][a-zA-Z0-9_']*",
        relevance: 0
      }
    ]
  };
}
function fx(t) {
  return {
    name: "Excel formulae",
    aliases: [
      "xlsx",
      "xls"
    ],
    case_insensitive: !0,
    keywords: {
      $pattern: /[a-zA-Z][\w\.]*/,
      built_in: [
        "ABS",
        "ACCRINT",
        "ACCRINTM",
        "ACOS",
        "ACOSH",
        "ACOT",
        "ACOTH",
        "AGGREGATE",
        "ADDRESS",
        "AMORDEGRC",
        "AMORLINC",
        "AND",
        "ARABIC",
        "AREAS",
        "ARRAYTOTEXT",
        "ASC",
        "ASIN",
        "ASINH",
        "ATAN",
        "ATAN2",
        "ATANH",
        "AVEDEV",
        "AVERAGE",
        "AVERAGEA",
        "AVERAGEIF",
        "AVERAGEIFS",
        "BAHTTEXT",
        "BASE",
        "BESSELI",
        "BESSELJ",
        "BESSELK",
        "BESSELY",
        "BETADIST",
        "BETA.DIST",
        "BETAINV",
        "BETA.INV",
        "BIN2DEC",
        "BIN2HEX",
        "BIN2OCT",
        "BINOMDIST",
        "BINOM.DIST",
        "BINOM.DIST.RANGE",
        "BINOM.INV",
        "BITAND",
        "BITLSHIFT",
        "BITOR",
        "BITRSHIFT",
        "BITXOR",
        "BYCOL",
        "BYROW",
        "CALL",
        "CEILING",
        "CEILING.MATH",
        "CEILING.PRECISE",
        "CELL",
        "CHAR",
        "CHIDIST",
        "CHIINV",
        "CHITEST",
        "CHISQ.DIST",
        "CHISQ.DIST.RT",
        "CHISQ.INV",
        "CHISQ.INV.RT",
        "CHISQ.TEST",
        "CHOOSE",
        "CHOOSECOLS",
        "CHOOSEROWS",
        "CLEAN",
        "CODE",
        "COLUMN",
        "COLUMNS",
        "COMBIN",
        "COMBINA",
        "COMPLEX",
        "CONCAT",
        "CONCATENATE",
        "CONFIDENCE",
        "CONFIDENCE.NORM",
        "CONFIDENCE.T",
        "CONVERT",
        "CORREL",
        "COS",
        "COSH",
        "COT",
        "COTH",
        "COUNT",
        "COUNTA",
        "COUNTBLANK",
        "COUNTIF",
        "COUNTIFS",
        "COUPDAYBS",
        "COUPDAYS",
        "COUPDAYSNC",
        "COUPNCD",
        "COUPNUM",
        "COUPPCD",
        "COVAR",
        "COVARIANCE.P",
        "COVARIANCE.S",
        "CRITBINOM",
        "CSC",
        "CSCH",
        "CUBEKPIMEMBER",
        "CUBEMEMBER",
        "CUBEMEMBERPROPERTY",
        "CUBERANKEDMEMBER",
        "CUBESET",
        "CUBESETCOUNT",
        "CUBEVALUE",
        "CUMIPMT",
        "CUMPRINC",
        "DATE",
        "DATEDIF",
        "DATEVALUE",
        "DAVERAGE",
        "DAY",
        "DAYS",
        "DAYS360",
        "DB",
        "DBCS",
        "DCOUNT",
        "DCOUNTA",
        "DDB",
        "DEC2BIN",
        "DEC2HEX",
        "DEC2OCT",
        "DECIMAL",
        "DEGREES",
        "DELTA",
        "DEVSQ",
        "DGET",
        "DISC",
        "DMAX",
        "DMIN",
        "DOLLAR",
        "DOLLARDE",
        "DOLLARFR",
        "DPRODUCT",
        "DROP",
        "DSTDEV",
        "DSTDEVP",
        "DSUM",
        "DURATION",
        "DVAR",
        "DVARP",
        "EDATE",
        "EFFECT",
        "ENCODEURL",
        "EOMONTH",
        "ERF",
        "ERF.PRECISE",
        "ERFC",
        "ERFC.PRECISE",
        "ERROR.TYPE",
        "EUROCONVERT",
        "EVEN",
        "EXACT",
        "EXP",
        "EXPAND",
        "EXPON.DIST",
        "EXPONDIST",
        "FACT",
        "FACTDOUBLE",
        "FALSE",
        "F.DIST",
        "FDIST",
        "F.DIST.RT",
        "FILTER",
        "FILTERXML",
        "FIND",
        "FINDB",
        "F.INV",
        "F.INV.RT",
        "FINV",
        "FISHER",
        "FISHERINV",
        "FIXED",
        "FLOOR",
        "FLOOR.MATH",
        "FLOOR.PRECISE",
        "FORECAST",
        "FORECAST.ETS",
        "FORECAST.ETS.CONFINT",
        "FORECAST.ETS.SEASONALITY",
        "FORECAST.ETS.STAT",
        "FORECAST.LINEAR",
        "FORMULATEXT",
        "FREQUENCY",
        "F.TEST",
        "FTEST",
        "FV",
        "FVSCHEDULE",
        "GAMMA",
        "GAMMA.DIST",
        "GAMMADIST",
        "GAMMA.INV",
        "GAMMAINV",
        "GAMMALN",
        "GAMMALN.PRECISE",
        "GAUSS",
        "GCD",
        "GEOMEAN",
        "GESTEP",
        "GETPIVOTDATA",
        "GROWTH",
        "HARMEAN",
        "HEX2BIN",
        "HEX2DEC",
        "HEX2OCT",
        "HLOOKUP",
        "HOUR",
        "HSTACK",
        "HYPERLINK",
        "HYPGEOM.DIST",
        "HYPGEOMDIST",
        "IF",
        "IFERROR",
        "IFNA",
        "IFS",
        "IMABS",
        "IMAGE",
        "IMAGINARY",
        "IMARGUMENT",
        "IMCONJUGATE",
        "IMCOS",
        "IMCOSH",
        "IMCOT",
        "IMCSC",
        "IMCSCH",
        "IMDIV",
        "IMEXP",
        "IMLN",
        "IMLOG10",
        "IMLOG2",
        "IMPOWER",
        "IMPRODUCT",
        "IMREAL",
        "IMSEC",
        "IMSECH",
        "IMSIN",
        "IMSINH",
        "IMSQRT",
        "IMSUB",
        "IMSUM",
        "IMTAN",
        "INDEX",
        "INDIRECT",
        "INFO",
        "INT",
        "INTERCEPT",
        "INTRATE",
        "IPMT",
        "IRR",
        "ISBLANK",
        "ISERR",
        "ISERROR",
        "ISEVEN",
        "ISFORMULA",
        "ISLOGICAL",
        "ISNA",
        "ISNONTEXT",
        "ISNUMBER",
        "ISODD",
        "ISOMITTED",
        "ISREF",
        "ISTEXT",
        "ISO.CEILING",
        "ISOWEEKNUM",
        "ISPMT",
        "JIS",
        "KURT",
        "LAMBDA",
        "LARGE",
        "LCM",
        "LEFT",
        "LEFTB",
        "LEN",
        "LENB",
        "LET",
        "LINEST",
        "LN",
        "LOG",
        "LOG10",
        "LOGEST",
        "LOGINV",
        "LOGNORM.DIST",
        "LOGNORMDIST",
        "LOGNORM.INV",
        "LOOKUP",
        "LOWER",
        "MAKEARRAY",
        "MAP",
        "MATCH",
        "MAX",
        "MAXA",
        "MAXIFS",
        "MDETERM",
        "MDURATION",
        "MEDIAN",
        "MID",
        "MIDB",
        "MIN",
        "MINIFS",
        "MINA",
        "MINUTE",
        "MINVERSE",
        "MIRR",
        "MMULT",
        "MOD",
        "MODE",
        "MODE.MULT",
        "MODE.SNGL",
        "MONTH",
        "MROUND",
        "MULTINOMIAL",
        "MUNIT",
        "N",
        "NA",
        "NEGBINOM.DIST",
        "NEGBINOMDIST",
        "NETWORKDAYS",
        "NETWORKDAYS.INTL",
        "NOMINAL",
        "NORM.DIST",
        "NORMDIST",
        "NORMINV",
        "NORM.INV",
        "NORM.S.DIST",
        "NORMSDIST",
        "NORM.S.INV",
        "NORMSINV",
        "NOT",
        "NOW",
        "NPER",
        "NPV",
        "NUMBERVALUE",
        "OCT2BIN",
        "OCT2DEC",
        "OCT2HEX",
        "ODD",
        "ODDFPRICE",
        "ODDFYIELD",
        "ODDLPRICE",
        "ODDLYIELD",
        "OFFSET",
        "OR",
        "PDURATION",
        "PEARSON",
        "PERCENTILE.EXC",
        "PERCENTILE.INC",
        "PERCENTILE",
        "PERCENTRANK.EXC",
        "PERCENTRANK.INC",
        "PERCENTRANK",
        "PERMUT",
        "PERMUTATIONA",
        "PHI",
        "PHONETIC",
        "PI",
        "PMT",
        "POISSON.DIST",
        "POISSON",
        "POWER",
        "PPMT",
        "PRICE",
        "PRICEDISC",
        "PRICEMAT",
        "PROB",
        "PRODUCT",
        "PROPER",
        "PV",
        "QUARTILE",
        "QUARTILE.EXC",
        "QUARTILE.INC",
        "QUOTIENT",
        "RADIANS",
        "RAND",
        "RANDARRAY",
        "RANDBETWEEN",
        "RANK.AVG",
        "RANK.EQ",
        "RANK",
        "RATE",
        "RECEIVED",
        "REDUCE",
        "REGISTER.ID",
        "REPLACE",
        "REPLACEB",
        "REPT",
        "RIGHT",
        "RIGHTB",
        "ROMAN",
        "ROUND",
        "ROUNDDOWN",
        "ROUNDUP",
        "ROW",
        "ROWS",
        "RRI",
        "RSQ",
        "RTD",
        "SCAN",
        "SEARCH",
        "SEARCHB",
        "SEC",
        "SECH",
        "SECOND",
        "SEQUENCE",
        "SERIESSUM",
        "SHEET",
        "SHEETS",
        "SIGN",
        "SIN",
        "SINH",
        "SKEW",
        "SKEW.P",
        "SLN",
        "SLOPE",
        "SMALL",
        "SORT",
        "SORTBY",
        "SQRT",
        "SQRTPI",
        "SQL.REQUEST",
        "STANDARDIZE",
        "STOCKHISTORY",
        "STDEV",
        "STDEV.P",
        "STDEV.S",
        "STDEVA",
        "STDEVP",
        "STDEVPA",
        "STEYX",
        "SUBSTITUTE",
        "SUBTOTAL",
        "SUM",
        "SUMIF",
        "SUMIFS",
        "SUMPRODUCT",
        "SUMSQ",
        "SUMX2MY2",
        "SUMX2PY2",
        "SUMXMY2",
        "SWITCH",
        "SYD",
        "T",
        "TAN",
        "TANH",
        "TAKE",
        "TBILLEQ",
        "TBILLPRICE",
        "TBILLYIELD",
        "T.DIST",
        "T.DIST.2T",
        "T.DIST.RT",
        "TDIST",
        "TEXT",
        "TEXTAFTER",
        "TEXTBEFORE",
        "TEXTJOIN",
        "TEXTSPLIT",
        "TIME",
        "TIMEVALUE",
        "T.INV",
        "T.INV.2T",
        "TINV",
        "TOCOL",
        "TOROW",
        "TODAY",
        "TRANSPOSE",
        "TREND",
        "TRIM",
        "TRIMMEAN",
        "TRUE",
        "TRUNC",
        "T.TEST",
        "TTEST",
        "TYPE",
        "UNICHAR",
        "UNICODE",
        "UNIQUE",
        "UPPER",
        "VALUE",
        "VALUETOTEXT",
        "VAR",
        "VAR.P",
        "VAR.S",
        "VARA",
        "VARP",
        "VARPA",
        "VDB",
        "VLOOKUP",
        "VSTACK",
        "WEBSERVICE",
        "WEEKDAY",
        "WEEKNUM",
        "WEIBULL",
        "WEIBULL.DIST",
        "WORKDAY",
        "WORKDAY.INTL",
        "WRAPCOLS",
        "WRAPROWS",
        "XIRR",
        "XLOOKUP",
        "XMATCH",
        "XNPV",
        "XOR",
        "YEAR",
        "YEARFRAC",
        "YIELD",
        "YIELDDISC",
        "YIELDMAT",
        "Z.TEST",
        "ZTEST"
      ]
    },
    contains: [
      {
        /* matches a beginning equal sign found in Excel formula examples */
        begin: /^=/,
        end: /[^=]/,
        returnEnd: !0,
        illegal: /=/,
        /* only allow single equal sign at front of line */
        relevance: 10
      },
      /* technically, there can be more than 2 letters in column names, but this prevents conflict with some keywords */
      {
        /* matches a reference to a single cell */
        className: "symbol",
        begin: /\b[A-Z]{1,2}\d+\b/,
        end: /[^\d]/,
        excludeEnd: !0,
        relevance: 0
      },
      {
        /* matches a reference to a range of cells */
        className: "symbol",
        begin: /[A-Z]{0,2}\d*:[A-Z]{0,2}\d*/,
        relevance: 0
      },
      t.BACKSLASH_ESCAPE,
      t.QUOTE_STRING_MODE,
      {
        className: "number",
        begin: t.NUMBER_RE + "(%)?",
        relevance: 0
      },
      /* Excel formula comments are done by putting the comment in a function call to N() */
      t.COMMENT(
        /\bN\(/,
        /\)/,
        {
          excludeBegin: !0,
          excludeEnd: !0,
          illegal: /\n/
        }
      )
    ]
  };
}
function gx(t) {
  return {
    name: "FIX",
    contains: [
      {
        begin: /[^\u2401\u0001]+/,
        end: /[\u2401\u0001]/,
        excludeEnd: !0,
        returnBegin: !0,
        returnEnd: !1,
        contains: [
          {
            begin: /([^\u2401\u0001=]+)/,
            end: /=([^\u2401\u0001=]+)/,
            returnEnd: !0,
            returnBegin: !1,
            className: "attr"
          },
          {
            begin: /=/,
            end: /([\u2401\u0001])/,
            excludeEnd: !0,
            excludeBegin: !0,
            className: "string"
          }
        ]
      }
    ],
    case_insensitive: !0
  };
}
function hx(t) {
  const e = {
    className: "string",
    begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/
  }, n = {
    className: "string",
    variants: [
      {
        begin: '"',
        end: '"'
      }
    ]
  }, i = {
    className: "function",
    beginKeywords: "def",
    end: /[:={\[(\n;]/,
    excludeEnd: !0,
    contains: [{
      className: "title",
      relevance: 0,
      begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/
    }]
  };
  return {
    name: "Flix",
    keywords: {
      keyword: [
        "case",
        "class",
        "def",
        "else",
        "enum",
        "if",
        "impl",
        "import",
        "in",
        "lat",
        "rel",
        "index",
        "let",
        "match",
        "namespace",
        "switch",
        "type",
        "yield",
        "with"
      ],
      literal: [
        "true",
        "false"
      ]
    },
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      e,
      n,
      i,
      t.C_NUMBER_MODE
    ]
  };
}
function Ex(t) {
  const e = t.regex, n = {
    className: "params",
    begin: "\\(",
    end: "\\)"
  }, r = { variants: [
    t.COMMENT("!", "$", { relevance: 0 }),
    // allow FORTRAN 77 style comments
    t.COMMENT("^C[ ]", "$", { relevance: 0 }),
    t.COMMENT("^C$", "$", { relevance: 0 })
  ] }, i = /(_[a-z_\d]+)?/, o = /([de][+-]?\d+)?/, a = {
    className: "number",
    variants: [
      { begin: e.concat(/\b\d+/, /\.(\d*)/, o, i) },
      { begin: e.concat(/\b\d+/, o, i) },
      { begin: e.concat(/\.\d+/, o, i) }
    ],
    relevance: 0
  }, s = {
    className: "function",
    beginKeywords: "subroutine function program",
    illegal: "[${=\\n]",
    contains: [
      t.UNDERSCORE_TITLE_MODE,
      n
    ]
  }, l = {
    className: "string",
    relevance: 0,
    variants: [
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE
    ]
  };
  return {
    name: "Fortran",
    case_insensitive: !0,
    aliases: [
      "f90",
      "f95"
    ],
    keywords: {
      $pattern: /\b[a-z][a-z0-9_]+\b|\.[a-z][a-z0-9_]+\./,
      keyword: [
        "kind",
        "do",
        "concurrent",
        "local",
        "shared",
        "while",
        "private",
        "call",
        "intrinsic",
        "where",
        "elsewhere",
        "type",
        "endtype",
        "endmodule",
        "endselect",
        "endinterface",
        "end",
        "enddo",
        "endif",
        "if",
        "forall",
        "endforall",
        "only",
        "contains",
        "default",
        "return",
        "stop",
        "then",
        "block",
        "endblock",
        "endassociate",
        "public",
        "subroutine|10",
        "function",
        "program",
        ".and.",
        ".or.",
        ".not.",
        ".le.",
        ".eq.",
        ".ge.",
        ".gt.",
        ".lt.",
        "goto",
        "save",
        "else",
        "use",
        "module",
        "select",
        "case",
        "access",
        "blank",
        "direct",
        "exist",
        "file",
        "fmt",
        "form",
        "formatted",
        "iostat",
        "name",
        "named",
        "nextrec",
        "number",
        "opened",
        "rec",
        "recl",
        "sequential",
        "status",
        "unformatted",
        "unit",
        "continue",
        "format",
        "pause",
        "cycle",
        "exit",
        "c_null_char",
        "c_alert",
        "c_backspace",
        "c_form_feed",
        "flush",
        "wait",
        "decimal",
        "round",
        "iomsg",
        "synchronous",
        "nopass",
        "non_overridable",
        "pass",
        "protected",
        "volatile",
        "abstract",
        "extends",
        "import",
        "non_intrinsic",
        "value",
        "deferred",
        "generic",
        "final",
        "enumerator",
        "class",
        "associate",
        "bind",
        "enum",
        "c_int",
        "c_short",
        "c_long",
        "c_long_long",
        "c_signed_char",
        "c_size_t",
        "c_int8_t",
        "c_int16_t",
        "c_int32_t",
        "c_int64_t",
        "c_int_least8_t",
        "c_int_least16_t",
        "c_int_least32_t",
        "c_int_least64_t",
        "c_int_fast8_t",
        "c_int_fast16_t",
        "c_int_fast32_t",
        "c_int_fast64_t",
        "c_intmax_t",
        "C_intptr_t",
        "c_float",
        "c_double",
        "c_long_double",
        "c_float_complex",
        "c_double_complex",
        "c_long_double_complex",
        "c_bool",
        "c_char",
        "c_null_ptr",
        "c_null_funptr",
        "c_new_line",
        "c_carriage_return",
        "c_horizontal_tab",
        "c_vertical_tab",
        "iso_c_binding",
        "c_loc",
        "c_funloc",
        "c_associated",
        "c_f_pointer",
        "c_ptr",
        "c_funptr",
        "iso_fortran_env",
        "character_storage_size",
        "error_unit",
        "file_storage_size",
        "input_unit",
        "iostat_end",
        "iostat_eor",
        "numeric_storage_size",
        "output_unit",
        "c_f_procpointer",
        "ieee_arithmetic",
        "ieee_support_underflow_control",
        "ieee_get_underflow_mode",
        "ieee_set_underflow_mode",
        "newunit",
        "contiguous",
        "recursive",
        "pad",
        "position",
        "action",
        "delim",
        "readwrite",
        "eor",
        "advance",
        "nml",
        "interface",
        "procedure",
        "namelist",
        "include",
        "sequence",
        "elemental",
        "pure",
        "impure",
        "integer",
        "real",
        "character",
        "complex",
        "logical",
        "codimension",
        "dimension",
        "allocatable|10",
        "parameter",
        "external",
        "implicit|10",
        "none",
        "double",
        "precision",
        "assign",
        "intent",
        "optional",
        "pointer",
        "target",
        "in",
        "out",
        "common",
        "equivalence",
        "data"
      ],
      literal: [
        ".False.",
        ".True."
      ],
      built_in: [
        "alog",
        "alog10",
        "amax0",
        "amax1",
        "amin0",
        "amin1",
        "amod",
        "cabs",
        "ccos",
        "cexp",
        "clog",
        "csin",
        "csqrt",
        "dabs",
        "dacos",
        "dasin",
        "datan",
        "datan2",
        "dcos",
        "dcosh",
        "ddim",
        "dexp",
        "dint",
        "dlog",
        "dlog10",
        "dmax1",
        "dmin1",
        "dmod",
        "dnint",
        "dsign",
        "dsin",
        "dsinh",
        "dsqrt",
        "dtan",
        "dtanh",
        "float",
        "iabs",
        "idim",
        "idint",
        "idnint",
        "ifix",
        "isign",
        "max0",
        "max1",
        "min0",
        "min1",
        "sngl",
        "algama",
        "cdabs",
        "cdcos",
        "cdexp",
        "cdlog",
        "cdsin",
        "cdsqrt",
        "cqabs",
        "cqcos",
        "cqexp",
        "cqlog",
        "cqsin",
        "cqsqrt",
        "dcmplx",
        "dconjg",
        "derf",
        "derfc",
        "dfloat",
        "dgamma",
        "dimag",
        "dlgama",
        "iqint",
        "qabs",
        "qacos",
        "qasin",
        "qatan",
        "qatan2",
        "qcmplx",
        "qconjg",
        "qcos",
        "qcosh",
        "qdim",
        "qerf",
        "qerfc",
        "qexp",
        "qgamma",
        "qimag",
        "qlgama",
        "qlog",
        "qlog10",
        "qmax1",
        "qmin1",
        "qmod",
        "qnint",
        "qsign",
        "qsin",
        "qsinh",
        "qsqrt",
        "qtan",
        "qtanh",
        "abs",
        "acos",
        "aimag",
        "aint",
        "anint",
        "asin",
        "atan",
        "atan2",
        "char",
        "cmplx",
        "conjg",
        "cos",
        "cosh",
        "exp",
        "ichar",
        "index",
        "int",
        "log",
        "log10",
        "max",
        "min",
        "nint",
        "sign",
        "sin",
        "sinh",
        "sqrt",
        "tan",
        "tanh",
        "print",
        "write",
        "dim",
        "lge",
        "lgt",
        "lle",
        "llt",
        "mod",
        "nullify",
        "allocate",
        "deallocate",
        "adjustl",
        "adjustr",
        "all",
        "allocated",
        "any",
        "associated",
        "bit_size",
        "btest",
        "ceiling",
        "count",
        "cshift",
        "date_and_time",
        "digits",
        "dot_product",
        "eoshift",
        "epsilon",
        "exponent",
        "floor",
        "fraction",
        "huge",
        "iand",
        "ibclr",
        "ibits",
        "ibset",
        "ieor",
        "ior",
        "ishft",
        "ishftc",
        "lbound",
        "len_trim",
        "matmul",
        "maxexponent",
        "maxloc",
        "maxval",
        "merge",
        "minexponent",
        "minloc",
        "minval",
        "modulo",
        "mvbits",
        "nearest",
        "pack",
        "present",
        "product",
        "radix",
        "random_number",
        "random_seed",
        "range",
        "repeat",
        "reshape",
        "rrspacing",
        "scale",
        "scan",
        "selected_int_kind",
        "selected_real_kind",
        "set_exponent",
        "shape",
        "size",
        "spacing",
        "spread",
        "sum",
        "system_clock",
        "tiny",
        "transpose",
        "trim",
        "ubound",
        "unpack",
        "verify",
        "achar",
        "iachar",
        "transfer",
        "dble",
        "entry",
        "dprod",
        "cpu_time",
        "command_argument_count",
        "get_command",
        "get_command_argument",
        "get_environment_variable",
        "is_iostat_end",
        "ieee_arithmetic",
        "ieee_support_underflow_control",
        "ieee_get_underflow_mode",
        "ieee_set_underflow_mode",
        "is_iostat_eor",
        "move_alloc",
        "new_line",
        "selected_char_kind",
        "same_type_as",
        "extends_type_of",
        "acosh",
        "asinh",
        "atanh",
        "bessel_j0",
        "bessel_j1",
        "bessel_jn",
        "bessel_y0",
        "bessel_y1",
        "bessel_yn",
        "erf",
        "erfc",
        "erfc_scaled",
        "gamma",
        "log_gamma",
        "hypot",
        "norm2",
        "atomic_define",
        "atomic_ref",
        "execute_command_line",
        "leadz",
        "trailz",
        "storage_size",
        "merge_bits",
        "bge",
        "bgt",
        "ble",
        "blt",
        "dshiftl",
        "dshiftr",
        "findloc",
        "iall",
        "iany",
        "iparity",
        "image_index",
        "lcobound",
        "ucobound",
        "maskl",
        "maskr",
        "num_images",
        "parity",
        "popcnt",
        "poppar",
        "shifta",
        "shiftl",
        "shiftr",
        "this_image",
        "sync",
        "change",
        "team",
        "co_broadcast",
        "co_max",
        "co_min",
        "co_sum",
        "co_reduce"
      ]
    },
    illegal: /\/\*/,
    contains: [
      l,
      s,
      // allow `C = value` for assignments so they aren't misdetected
      // as Fortran 77 style comments
      {
        begin: /^C\s*=(?!=)/,
        relevance: 0
      },
      r,
      a
    ]
  };
}
function Sx(t) {
  return new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&"), "m");
}
function Sh(t) {
  return t ? typeof t == "string" ? t : t.source : null;
}
function yi(t) {
  return Ht("(?=", t, ")");
}
function Ht(...t) {
  return t.map((n) => Sh(n)).join("");
}
function bx(t) {
  const e = t[t.length - 1];
  return typeof e == "object" && e.constructor === Object ? (t.splice(t.length - 1, 1), e) : {};
}
function Jn(...t) {
  return "(" + (bx(t).capture ? "" : "?:") + t.map((r) => Sh(r)).join("|") + ")";
}
function Tx(t) {
  const e = [
    "abstract",
    "and",
    "as",
    "assert",
    "base",
    "begin",
    "class",
    "default",
    "delegate",
    "do",
    "done",
    "downcast",
    "downto",
    "elif",
    "else",
    "end",
    "exception",
    "extern",
    // "false", // literal
    "finally",
    "fixed",
    "for",
    "fun",
    "function",
    "global",
    "if",
    "in",
    "inherit",
    "inline",
    "interface",
    "internal",
    "lazy",
    "let",
    "match",
    "member",
    "module",
    "mutable",
    "namespace",
    "new",
    // "not", // built_in
    // "null", // literal
    "of",
    "open",
    "or",
    "override",
    "private",
    "public",
    "rec",
    "return",
    "static",
    "struct",
    "then",
    "to",
    // "true", // literal
    "try",
    "type",
    "upcast",
    "use",
    "val",
    "void",
    "when",
    "while",
    "with",
    "yield"
  ], n = {
    // monad builder keywords (matches before non-bang keywords)
    scope: "keyword",
    match: /\b(yield|return|let|do|match|use)!/
  }, r = [
    "if",
    "else",
    "endif",
    "line",
    "nowarn",
    "light",
    "r",
    "i",
    "I",
    "load",
    "time",
    "help",
    "quit"
  ], i = [
    "true",
    "false",
    "null",
    "Some",
    "None",
    "Ok",
    "Error",
    "infinity",
    "infinityf",
    "nan",
    "nanf"
  ], o = [
    "__LINE__",
    "__SOURCE_DIRECTORY__",
    "__SOURCE_FILE__"
  ], a = [
    // basic types
    "bool",
    "byte",
    "sbyte",
    "int8",
    "int16",
    "int32",
    "uint8",
    "uint16",
    "uint32",
    "int",
    "uint",
    "int64",
    "uint64",
    "nativeint",
    "unativeint",
    "decimal",
    "float",
    "double",
    "float32",
    "single",
    "char",
    "string",
    "unit",
    "bigint",
    // other native types or lowercase aliases
    "option",
    "voption",
    "list",
    "array",
    "seq",
    "byref",
    "exn",
    "inref",
    "nativeptr",
    "obj",
    "outref",
    "voidptr",
    // other important FSharp types
    "Result"
  ], l = {
    keyword: e,
    literal: i,
    built_in: [
      // Somewhat arbitrary list of builtin functions and values.
      // Most of them are declared in Microsoft.FSharp.Core
      // I tried to stay relevant by adding only the most idiomatic
      // and most used symbols that are not already declared as types.
      "not",
      "ref",
      "raise",
      "reraise",
      "dict",
      "readOnlyDict",
      "set",
      "get",
      "enum",
      "sizeof",
      "typeof",
      "typedefof",
      "nameof",
      "nullArg",
      "invalidArg",
      "invalidOp",
      "id",
      "fst",
      "snd",
      "ignore",
      "lock",
      "using",
      "box",
      "unbox",
      "tryUnbox",
      "printf",
      "printfn",
      "sprintf",
      "eprintf",
      "eprintfn",
      "fprintf",
      "fprintfn",
      "failwith",
      "failwithf"
    ],
    "variable.constant": o
  }, u = {
    variants: [
      t.COMMENT(/\(\*(?!\))/, /\*\)/, {
        contains: ["self"]
      }),
      t.C_LINE_COMMENT_MODE
    ]
  }, d = /[a-zA-Z_](\w|')*/, p = {
    scope: "variable",
    begin: /``/,
    end: /``/
  }, _ = /\B('|\^)/, m = {
    scope: "symbol",
    variants: [
      // the type name is a quoted identifier:
      { match: Ht(_, /``.*?``/) },
      // the type name is a normal identifier (we don't use IDENTIFIER_RE because there cannot be another apostrophe here):
      { match: Ht(_, t.UNDERSCORE_IDENT_RE) }
    ],
    relevance: 0
  }, f = function({ includeEqual: R }) {
    let w;
    R ? w = "!%&*+-/<=>@^|~?" : w = "!%&*+-/<>@^|~?";
    const B = Array.from(w), $ = Ht("[", ...B.map(Sx), "]"), X = Jn($, /\./), de = Ht(X, yi(X)), pe = Jn(
      Ht(de, X, "*"),
      // Matches at least 2 chars operators
      Ht($, "+")
      // Matches at least one char operators
    );
    return {
      scope: "operator",
      match: Jn(
        // symbolic operators:
        pe,
        // other symbolic keywords:
        // Type casting and conversion operators:
        /:\?>/,
        /:\?/,
        /:>/,
        /:=/,
        // Reference cell assignment
        /::?/,
        // : or ::
        /\$/
      ),
      // A single $ can be used as an operator
      relevance: 0
    };
  }, g = f({ includeEqual: !0 }), S = f({ includeEqual: !1 }), E = function(R, w) {
    return {
      begin: Ht(
        // a type annotation is a
        R,
        // should be a colon or the 'of' keyword
        yi(
          // that has to be followed by
          Ht(
            /\s*/,
            // optional space
            Jn(
              // then either of:
              /\w/,
              // word
              /'/,
              // generic type name
              /\^/,
              // generic type name
              /#/,
              // flexible type name
              /``/,
              // quoted type name
              /\(/,
              // parens type expression
              /{\|/
              // anonymous type annotation
            )
          )
        )
      ),
      beginScope: w,
      // BUG: because ending with \n is necessary for some cases, multi-line type annotations are not properly supported.
      // Examples where \n is required at the end:
      // - abstract member definitions in classes: abstract Property : int * string
      // - return type annotations: let f f' = f' () : returnTypeAnnotation
      // - record fields definitions: { A : int \n B : string }
      end: yi(
        Jn(
          /\n/,
          /=/
        )
      ),
      relevance: 0,
      // we need the known types, and we need the type constraint keywords and literals. e.g.: when 'a : null
      keywords: t.inherit(l, { type: a }),
      contains: [
        u,
        m,
        t.inherit(p, { scope: null }),
        // match to avoid strange patterns inside that may break the parsing
        S
      ]
    };
  }, b = E(/:/, "operator"), h = E(/\bof\b/, "keyword"), T = {
    begin: [
      /(^|\s+)/,
      // prevents matching the following: `match s.stype with`
      /type/,
      /\s+/,
      d
    ],
    beginScope: {
      2: "keyword",
      4: "title.class"
    },
    end: yi(/\(|=|$/),
    keywords: l,
    // match keywords in type constraints. e.g.: when 'a : null
    contains: [
      u,
      t.inherit(p, { scope: null }),
      // match to avoid strange patterns inside that may break the parsing
      m,
      {
        // For visual consistency, highlight type brackets as operators.
        scope: "operator",
        match: /<|>/
      },
      b
      // generic types can have constraints, which are type annotations. e.g. type MyType<'T when 'T : delegate<obj * string>> =
    ]
  }, C = {
    // computation expressions:
    scope: "computation-expression",
    // BUG: might conflict with record deconstruction. e.g. let f { Name = name } = name // will highlight f
    match: /\b[_a-z]\w*(?=\s*\{)/
  }, v = {
    // preprocessor directives and fsi commands:
    begin: [
      /^\s*/,
      Ht(/#/, Jn(...r)),
      /\b/
    ],
    beginScope: { 2: "meta" },
    end: yi(/\s|$/)
  }, I = {
    variants: [
      t.BINARY_NUMBER_MODE,
      t.C_NUMBER_MODE
    ]
  }, N = {
    scope: "string",
    begin: /"/,
    end: /"/,
    contains: [
      t.BACKSLASH_ESCAPE
    ]
  }, x = {
    scope: "string",
    begin: /@"/,
    end: /"/,
    contains: [
      {
        match: /""/
        // escaped "
      },
      t.BACKSLASH_ESCAPE
    ]
  }, P = {
    scope: "string",
    begin: /"""/,
    end: /"""/,
    relevance: 2
  }, Y = {
    scope: "subst",
    begin: /\{/,
    end: /\}/,
    keywords: l
  }, Z = {
    scope: "string",
    begin: /\$"/,
    end: /"/,
    contains: [
      {
        match: /\{\{/
        // escaped {
      },
      {
        match: /\}\}/
        // escaped }
      },
      t.BACKSLASH_ESCAPE,
      Y
    ]
  }, q = {
    scope: "string",
    begin: /(\$@|@\$)"/,
    end: /"/,
    contains: [
      {
        match: /\{\{/
        // escaped {
      },
      {
        match: /\}\}/
        // escaped }
      },
      {
        match: /""/
      },
      t.BACKSLASH_ESCAPE,
      Y
    ]
  }, V = {
    scope: "string",
    begin: /\$"""/,
    end: /"""/,
    contains: [
      {
        match: /\{\{/
        // escaped {
      },
      {
        match: /\}\}/
        // escaped }
      },
      Y
    ],
    relevance: 2
  }, O = {
    scope: "string",
    match: Ht(
      /'/,
      Jn(
        /[^\\']/,
        // either a single non escaped char...
        /\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8})/
        // ...or an escape sequence
      ),
      /'/
    )
  };
  return Y.contains = [
    q,
    Z,
    x,
    N,
    O,
    n,
    u,
    p,
    b,
    C,
    v,
    I,
    m,
    g
  ], {
    name: "F#",
    aliases: [
      "fs",
      "f#"
    ],
    keywords: l,
    illegal: /\/\*/,
    classNameAliases: {
      "computation-expression": "keyword"
    },
    contains: [
      n,
      {
        variants: [
          V,
          q,
          Z,
          P,
          x,
          N,
          O
        ]
      },
      u,
      p,
      T,
      {
        // e.g. [<Attributes("")>] or [<``module``: MyCustomAttributeThatWorksOnModules>]
        // or [<Sealed; NoEquality; NoComparison; CompiledName("FSharpAsync`1")>]
        scope: "meta",
        begin: /\[</,
        end: />\]/,
        relevance: 2,
        contains: [
          p,
          // can contain any constant value
          P,
          x,
          N,
          O,
          I
        ]
      },
      h,
      b,
      C,
      v,
      I,
      m,
      g
    ]
  };
}
function Cx(t) {
  const e = t.regex, n = {
    keyword: "abort acronym acronyms alias all and assign binary card diag display else eq file files for free ge gt if integer le loop lt maximizing minimizing model models ne negative no not option options or ord positive prod put putpage puttl repeat sameas semicont semiint smax smin solve sos1 sos2 sum system table then until using while xor yes",
    literal: "eps inf na",
    built_in: "abs arccos arcsin arctan arctan2 Beta betaReg binomial ceil centropy cos cosh cvPower div div0 eDist entropy errorf execSeed exp fact floor frac gamma gammaReg log logBeta logGamma log10 log2 mapVal max min mod ncpCM ncpF ncpVUpow ncpVUsin normal pi poly power randBinomial randLinear randTriangle round rPower sigmoid sign signPower sin sinh slexp sllog10 slrec sqexp sqlog10 sqr sqrec sqrt tan tanh trunc uniform uniformInt vcPower bool_and bool_eqv bool_imp bool_not bool_or bool_xor ifThen rel_eq rel_ge rel_gt rel_le rel_lt rel_ne gday gdow ghour gleap gmillisec gminute gmonth gsecond gyear jdate jnow jstart jtime errorLevel execError gamsRelease gamsVersion handleCollect handleDelete handleStatus handleSubmit heapFree heapLimit heapSize jobHandle jobKill jobStatus jobTerminate licenseLevel licenseStatus maxExecError sleep timeClose timeComp timeElapsed timeExec timeStart"
  }, r = {
    className: "params",
    begin: /\(/,
    end: /\)/,
    excludeBegin: !0,
    excludeEnd: !0
  }, i = {
    className: "symbol",
    variants: [
      { begin: /=[lgenxc]=/ },
      { begin: /\$/ }
    ]
  }, o = {
    // One-line quoted comment string
    className: "comment",
    variants: [
      {
        begin: "'",
        end: "'"
      },
      {
        begin: '"',
        end: '"'
      }
    ],
    illegal: "\\n",
    contains: [t.BACKSLASH_ESCAPE]
  }, a = {
    begin: "/",
    end: "/",
    keywords: n,
    contains: [
      o,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      t.APOS_STRING_MODE,
      t.C_NUMBER_MODE
    ]
  }, s = /[a-z0-9&#*=?@\\><:,()$[\]_.{}!+%^-]+/, l = {
    // Parameter/set/variable description text
    begin: /[a-z][a-z0-9_]*(\([a-z0-9_, ]*\))?[ \t]+/,
    excludeBegin: !0,
    end: "$",
    endsWithParent: !0,
    contains: [
      o,
      a,
      {
        className: "comment",
        // one comment word, then possibly more
        begin: e.concat(
          s,
          // [ ] because \s would be too broad (matching newlines)
          e.anyNumberOfTimes(e.concat(/[ ]+/, s))
        ),
        relevance: 0
      }
    ]
  };
  return {
    name: "GAMS",
    aliases: ["gms"],
    case_insensitive: !0,
    keywords: n,
    contains: [
      t.COMMENT(/^\$ontext/, /^\$offtext/),
      {
        className: "meta",
        begin: "^\\$[a-z0-9]+",
        end: "$",
        returnBegin: !0,
        contains: [
          {
            className: "keyword",
            begin: "^\\$[a-z0-9]+"
          }
        ]
      },
      t.COMMENT("^\\*", "$"),
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      t.APOS_STRING_MODE,
      // Declarations
      {
        beginKeywords: "set sets parameter parameters variable variables scalar scalars equation equations",
        end: ";",
        contains: [
          t.COMMENT("^\\*", "$"),
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE,
          t.QUOTE_STRING_MODE,
          t.APOS_STRING_MODE,
          a,
          l
        ]
      },
      {
        // table environment
        beginKeywords: "table",
        end: ";",
        returnBegin: !0,
        contains: [
          {
            // table header row
            beginKeywords: "table",
            end: "$",
            contains: [l]
          },
          t.COMMENT("^\\*", "$"),
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE,
          t.QUOTE_STRING_MODE,
          t.APOS_STRING_MODE,
          t.C_NUMBER_MODE
          // Table does not contain DESCTEXT or ASSIGNMENT
        ]
      },
      // Function definitions
      {
        className: "function",
        begin: /^[a-z][a-z0-9_,\-+' ()$]+\.{2}/,
        returnBegin: !0,
        contains: [
          {
            // Function title
            className: "title",
            begin: /^[a-z0-9_]+/
          },
          r,
          i
        ]
      },
      t.C_NUMBER_MODE,
      i
    ]
  };
}
function yx(t) {
  const e = {
    keyword: "bool break call callexe checkinterrupt clear clearg closeall cls comlog compile continue create debug declare delete disable dlibrary dllcall do dos ed edit else elseif enable end endfor endif endp endo errorlog errorlogat expr external fn for format goto gosub graph if keyword let lib library line load loadarray loadexe loadf loadk loadm loadp loads loadx local locate loopnextindex lprint lpwidth lshow matrix msym ndpclex new open output outwidth plot plotsym pop prcsn print printdos proc push retp return rndcon rndmod rndmult rndseed run save saveall screen scroll setarray show sparse stop string struct system trace trap threadfor threadendfor threadbegin threadjoin threadstat threadend until use while winprint ne ge le gt lt and xor or not eq eqv",
    built_in: "abs acf aconcat aeye amax amean AmericanBinomCall AmericanBinomCall_Greeks AmericanBinomCall_ImpVol AmericanBinomPut AmericanBinomPut_Greeks AmericanBinomPut_ImpVol AmericanBSCall AmericanBSCall_Greeks AmericanBSCall_ImpVol AmericanBSPut AmericanBSPut_Greeks AmericanBSPut_ImpVol amin amult annotationGetDefaults annotationSetBkd annotationSetFont annotationSetLineColor annotationSetLineStyle annotationSetLineThickness annualTradingDays arccos arcsin areshape arrayalloc arrayindex arrayinit arraytomat asciiload asclabel astd astds asum atan atan2 atranspose axmargin balance band bandchol bandcholsol bandltsol bandrv bandsolpd bar base10 begwind besselj bessely beta box boxcox cdfBeta cdfBetaInv cdfBinomial cdfBinomialInv cdfBvn cdfBvn2 cdfBvn2e cdfCauchy cdfCauchyInv cdfChic cdfChii cdfChinc cdfChincInv cdfExp cdfExpInv cdfFc cdfFnc cdfFncInv cdfGam cdfGenPareto cdfHyperGeo cdfLaplace cdfLaplaceInv cdfLogistic cdfLogisticInv cdfmControlCreate cdfMvn cdfMvn2e cdfMvnce cdfMvne cdfMvt2e cdfMvtce cdfMvte cdfN cdfN2 cdfNc cdfNegBinomial cdfNegBinomialInv cdfNi cdfPoisson cdfPoissonInv cdfRayleigh cdfRayleighInv cdfTc cdfTci cdfTnc cdfTvn cdfWeibull cdfWeibullInv cdir ceil ChangeDir chdir chiBarSquare chol choldn cholsol cholup chrs close code cols colsf combinate combinated complex con cond conj cons ConScore contour conv convertsatostr convertstrtosa corrm corrms corrvc corrx corrxs cos cosh counts countwts crossprd crout croutp csrcol csrlin csvReadM csvReadSA cumprodc cumsumc curve cvtos datacreate datacreatecomplex datalist dataload dataloop dataopen datasave date datestr datestring datestrymd dayinyr dayofweek dbAddDatabase dbClose dbCommit dbCreateQuery dbExecQuery dbGetConnectOptions dbGetDatabaseName dbGetDriverName dbGetDrivers dbGetHostName dbGetLastErrorNum dbGetLastErrorText dbGetNumericalPrecPolicy dbGetPassword dbGetPort dbGetTableHeaders dbGetTables dbGetUserName dbHasFeature dbIsDriverAvailable dbIsOpen dbIsOpenError dbOpen dbQueryBindValue dbQueryClear dbQueryCols dbQueryExecPrepared dbQueryFetchAllM dbQueryFetchAllSA dbQueryFetchOneM dbQueryFetchOneSA dbQueryFinish dbQueryGetBoundValue dbQueryGetBoundValues dbQueryGetField dbQueryGetLastErrorNum dbQueryGetLastErrorText dbQueryGetLastInsertID dbQueryGetLastQuery dbQueryGetPosition dbQueryIsActive dbQueryIsForwardOnly dbQueryIsNull dbQueryIsSelect dbQueryIsValid dbQueryPrepare dbQueryRows dbQuerySeek dbQuerySeekFirst dbQuerySeekLast dbQuerySeekNext dbQuerySeekPrevious dbQuerySetForwardOnly dbRemoveDatabase dbRollback dbSetConnectOptions dbSetDatabaseName dbSetHostName dbSetNumericalPrecPolicy dbSetPort dbSetUserName dbTransaction DeleteFile delif delrows denseToSp denseToSpRE denToZero design det detl dfft dffti diag diagrv digamma doswin DOSWinCloseall DOSWinOpen dotfeq dotfeqmt dotfge dotfgemt dotfgt dotfgtmt dotfle dotflemt dotflt dotfltmt dotfne dotfnemt draw drop dsCreate dstat dstatmt dstatmtControlCreate dtdate dtday dttime dttodtv dttostr dttoutc dtvnormal dtvtodt dtvtoutc dummy dummybr dummydn eig eigh eighv eigv elapsedTradingDays endwind envget eof eqSolve eqSolvemt eqSolvemtControlCreate eqSolvemtOutCreate eqSolveset erf erfc erfccplx erfcplx error etdays ethsec etstr EuropeanBinomCall EuropeanBinomCall_Greeks EuropeanBinomCall_ImpVol EuropeanBinomPut EuropeanBinomPut_Greeks EuropeanBinomPut_ImpVol EuropeanBSCall EuropeanBSCall_Greeks EuropeanBSCall_ImpVol EuropeanBSPut EuropeanBSPut_Greeks EuropeanBSPut_ImpVol exctsmpl exec execbg exp extern eye fcheckerr fclearerr feq feqmt fflush fft ffti fftm fftmi fftn fge fgemt fgets fgetsa fgetsat fgetst fgt fgtmt fileinfo filesa fle flemt floor flt fltmt fmod fne fnemt fonts fopen formatcv formatnv fputs fputst fseek fstrerror ftell ftocv ftos ftostrC gamma gammacplx gammaii gausset gdaAppend gdaCreate gdaDStat gdaDStatMat gdaGetIndex gdaGetName gdaGetNames gdaGetOrders gdaGetType gdaGetTypes gdaGetVarInfo gdaIsCplx gdaLoad gdaPack gdaRead gdaReadByIndex gdaReadSome gdaReadSparse gdaReadStruct gdaReportVarInfo gdaSave gdaUpdate gdaUpdateAndPack gdaVars gdaWrite gdaWrite32 gdaWriteSome getarray getdims getf getGAUSShome getmatrix getmatrix4D getname getnamef getNextTradingDay getNextWeekDay getnr getorders getpath getPreviousTradingDay getPreviousWeekDay getRow getscalar3D getscalar4D getTrRow getwind glm gradcplx gradMT gradMTm gradMTT gradMTTm gradp graphprt graphset hasimag header headermt hess hessMT hessMTg hessMTgw hessMTm hessMTmw hessMTT hessMTTg hessMTTgw hessMTTm hessMTw hessp hist histf histp hsec imag indcv indexcat indices indices2 indicesf indicesfn indnv indsav integrate1d integrateControlCreate intgrat2 intgrat3 inthp1 inthp2 inthp3 inthp4 inthpControlCreate intquad1 intquad2 intquad3 intrleav intrleavsa intrsect intsimp inv invpd invswp iscplx iscplxf isden isinfnanmiss ismiss key keyav keyw lag lag1 lagn lapEighb lapEighi lapEighvb lapEighvi lapgEig lapgEigh lapgEighv lapgEigv lapgSchur lapgSvdcst lapgSvds lapgSvdst lapSvdcusv lapSvds lapSvdusv ldlp ldlsol linSolve listwise ln lncdfbvn lncdfbvn2 lncdfmvn lncdfn lncdfn2 lncdfnc lnfact lngammacplx lnpdfmvn lnpdfmvt lnpdfn lnpdft loadd loadstruct loadwind loess loessmt loessmtControlCreate log loglog logx logy lower lowmat lowmat1 ltrisol lu lusol machEpsilon make makevars makewind margin matalloc matinit mattoarray maxbytes maxc maxindc maxv maxvec mbesselei mbesselei0 mbesselei1 mbesseli mbesseli0 mbesseli1 meanc median mergeby mergevar minc minindc minv miss missex missrv moment momentd movingave movingaveExpwgt movingaveWgt nextindex nextn nextnevn nextwind ntos null null1 numCombinations ols olsmt olsmtControlCreate olsqr olsqr2 olsqrmt ones optn optnevn orth outtyp pacf packedToSp packr parse pause pdfCauchy pdfChi pdfExp pdfGenPareto pdfHyperGeo pdfLaplace pdfLogistic pdfn pdfPoisson pdfRayleigh pdfWeibull pi pinv pinvmt plotAddArrow plotAddBar plotAddBox plotAddHist plotAddHistF plotAddHistP plotAddPolar plotAddScatter plotAddShape plotAddTextbox plotAddTS plotAddXY plotArea plotBar plotBox plotClearLayout plotContour plotCustomLayout plotGetDefaults plotHist plotHistF plotHistP plotLayout plotLogLog plotLogX plotLogY plotOpenWindow plotPolar plotSave plotScatter plotSetAxesPen plotSetBar plotSetBarFill plotSetBarStacked plotSetBkdColor plotSetFill plotSetGrid plotSetLegend plotSetLineColor plotSetLineStyle plotSetLineSymbol plotSetLineThickness plotSetNewWindow plotSetTitle plotSetWhichYAxis plotSetXAxisShow plotSetXLabel plotSetXRange plotSetXTicInterval plotSetXTicLabel plotSetYAxisShow plotSetYLabel plotSetYRange plotSetZAxisShow plotSetZLabel plotSurface plotTS plotXY polar polychar polyeval polygamma polyint polymake polymat polymroot polymult polyroot pqgwin previousindex princomp printfm printfmt prodc psi putarray putf putvals pvCreate pvGetIndex pvGetParNames pvGetParVector pvLength pvList pvPack pvPacki pvPackm pvPackmi pvPacks pvPacksi pvPacksm pvPacksmi pvPutParVector pvTest pvUnpack QNewton QNewtonmt QNewtonmtControlCreate QNewtonmtOutCreate QNewtonSet QProg QProgmt QProgmtInCreate qqr qqre qqrep qr qre qrep qrsol qrtsol qtyr qtyre qtyrep quantile quantiled qyr qyre qyrep qz rank rankindx readr real reclassify reclassifyCuts recode recserar recsercp recserrc rerun rescale reshape rets rev rfft rffti rfftip rfftn rfftnp rfftp rndBernoulli rndBeta rndBinomial rndCauchy rndChiSquare rndCon rndCreateState rndExp rndGamma rndGeo rndGumbel rndHyperGeo rndi rndKMbeta rndKMgam rndKMi rndKMn rndKMnb rndKMp rndKMu rndKMvm rndLaplace rndLCbeta rndLCgam rndLCi rndLCn rndLCnb rndLCp rndLCu rndLCvm rndLogNorm rndMTu rndMVn rndMVt rndn rndnb rndNegBinomial rndp rndPoisson rndRayleigh rndStateSkip rndu rndvm rndWeibull rndWishart rotater round rows rowsf rref sampleData satostrC saved saveStruct savewind scale scale3d scalerr scalinfnanmiss scalmiss schtoc schur searchsourcepath seekr select selif seqa seqm setdif setdifsa setvars setvwrmode setwind shell shiftr sin singleindex sinh sleep solpd sortc sortcc sortd sorthc sorthcc sortind sortindc sortmc sortr sortrc spBiconjGradSol spChol spConjGradSol spCreate spDenseSubmat spDiagRvMat spEigv spEye spLDL spline spLU spNumNZE spOnes spreadSheetReadM spreadSheetReadSA spreadSheetWrite spScale spSubmat spToDense spTrTDense spTScalar spZeros sqpSolve sqpSolveMT sqpSolveMTControlCreate sqpSolveMTlagrangeCreate sqpSolveMToutCreate sqpSolveSet sqrt statements stdc stdsc stocv stof strcombine strindx strlen strput strrindx strsect strsplit strsplitPad strtodt strtof strtofcplx strtriml strtrimr strtrunc strtruncl strtruncpad strtruncr submat subscat substute subvec sumc sumr surface svd svd1 svd2 svdcusv svds svdusv sysstate tab tan tanh tempname time timedt timestr timeutc title tkf2eps tkf2ps tocart todaydt toeplitz token topolar trapchk trigamma trimr trunc type typecv typef union unionsa uniqindx uniqindxsa unique uniquesa upmat upmat1 upper utctodt utctodtv utrisol vals varCovMS varCovXS varget vargetl varmall varmares varput varputl vartypef vcm vcms vcx vcxs vec vech vecr vector vget view viewxyz vlist vnamecv volume vput vread vtypecv wait waitc walkindex where window writer xlabel xlsGetSheetCount xlsGetSheetSize xlsGetSheetTypes xlsMakeRange xlsReadM xlsReadSA xlsWrite xlsWriteM xlsWriteSA xpnd xtics xy xyz ylabel ytics zeros zeta zlabel ztics cdfEmpirical dot h5create h5open h5read h5readAttribute h5write h5writeAttribute ldl plotAddErrorBar plotAddSurface plotCDFEmpirical plotSetColormap plotSetContourLabels plotSetLegendFont plotSetTextInterpreter plotSetXTicCount plotSetYTicCount plotSetZLevels powerm strjoin sylvester strtrim",
    literal: "DB_AFTER_LAST_ROW DB_ALL_TABLES DB_BATCH_OPERATIONS DB_BEFORE_FIRST_ROW DB_BLOB DB_EVENT_NOTIFICATIONS DB_FINISH_QUERY DB_HIGH_PRECISION DB_LAST_INSERT_ID DB_LOW_PRECISION_DOUBLE DB_LOW_PRECISION_INT32 DB_LOW_PRECISION_INT64 DB_LOW_PRECISION_NUMBERS DB_MULTIPLE_RESULT_SETS DB_NAMED_PLACEHOLDERS DB_POSITIONAL_PLACEHOLDERS DB_PREPARED_QUERIES DB_QUERY_SIZE DB_SIMPLE_LOCKING DB_SYSTEM_TABLES DB_TABLES DB_TRANSACTIONS DB_UNICODE DB_VIEWS __STDIN __STDOUT __STDERR __FILE_DIR"
  }, n = t.COMMENT("@", "@"), r = {
    className: "meta",
    begin: "#",
    end: "$",
    keywords: { keyword: "define definecs|10 undef ifdef ifndef iflight ifdllcall ifmac ifos2win ifunix else endif lineson linesoff srcfile srcline" },
    contains: [
      {
        begin: /\\\n/,
        relevance: 0
      },
      {
        beginKeywords: "include",
        end: "$",
        keywords: { keyword: "include" },
        contains: [
          {
            className: "string",
            begin: '"',
            end: '"',
            illegal: "\\n"
          }
        ]
      },
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      n
    ]
  }, i = {
    begin: /\bstruct\s+/,
    end: /\s/,
    keywords: "struct",
    contains: [
      {
        className: "type",
        begin: t.UNDERSCORE_IDENT_RE,
        relevance: 0
      }
    ]
  }, o = [
    {
      className: "params",
      begin: /\(/,
      end: /\)/,
      excludeBegin: !0,
      excludeEnd: !0,
      endsWithParent: !0,
      relevance: 0,
      contains: [
        {
          // dots
          className: "literal",
          begin: /\.\.\./
        },
        t.C_NUMBER_MODE,
        t.C_BLOCK_COMMENT_MODE,
        n,
        i
      ]
    }
  ], a = {
    className: "title",
    begin: t.UNDERSCORE_IDENT_RE,
    relevance: 0
  }, s = function(p, _, m) {
    const f = t.inherit(
      {
        className: "function",
        beginKeywords: p,
        end: _,
        excludeEnd: !0,
        contains: [].concat(o)
      },
      {}
    );
    return f.contains.push(a), f.contains.push(t.C_NUMBER_MODE), f.contains.push(t.C_BLOCK_COMMENT_MODE), f.contains.push(n), f;
  }, l = {
    // these are explicitly named internal function calls
    className: "built_in",
    begin: "\\b(" + e.built_in.split(" ").join("|") + ")\\b"
  }, c = {
    className: "string",
    begin: '"',
    end: '"',
    contains: [t.BACKSLASH_ESCAPE],
    relevance: 0
  }, u = {
    // className: "fn_ref",
    begin: t.UNDERSCORE_IDENT_RE + "\\s*\\(",
    returnBegin: !0,
    keywords: e,
    relevance: 0,
    contains: [
      { beginKeywords: e.keyword },
      l,
      {
        // ambiguously named function calls get a relevance of 0
        className: "built_in",
        begin: t.UNDERSCORE_IDENT_RE,
        relevance: 0
      }
    ]
  }, d = {
    // className: "fn_ref_params",
    begin: /\(/,
    end: /\)/,
    relevance: 0,
    keywords: {
      built_in: e.built_in,
      literal: e.literal
    },
    contains: [
      t.C_NUMBER_MODE,
      t.C_BLOCK_COMMENT_MODE,
      n,
      l,
      u,
      c,
      "self"
    ]
  };
  return u.contains.push(d), {
    name: "GAUSS",
    aliases: ["gss"],
    case_insensitive: !0,
    // language is case-insensitive
    keywords: e,
    illegal: /(\{[%#]|[%#]\}| <- )/,
    contains: [
      t.C_NUMBER_MODE,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      n,
      c,
      r,
      {
        className: "keyword",
        begin: /\bexternal (matrix|string|array|sparse matrix|struct|proc|keyword|fn)/
      },
      s("proc keyword", ";"),
      s("fn", "="),
      {
        beginKeywords: "for threadfor",
        end: /;/,
        // end: /\(/,
        relevance: 0,
        contains: [
          t.C_BLOCK_COMMENT_MODE,
          n,
          d
        ]
      },
      {
        // custom method guard
        // excludes method names from keyword processing
        variants: [
          { begin: t.UNDERSCORE_IDENT_RE + "\\." + t.UNDERSCORE_IDENT_RE },
          { begin: t.UNDERSCORE_IDENT_RE + "\\s*=" }
        ],
        relevance: 0
      },
      u,
      i
    ]
  };
}
function vx(t) {
  const e = t.regex, n = {
    $pattern: /[A-Z]+|%/,
    keyword: [
      // conditions
      "THEN",
      "ELSE",
      "ENDIF",
      "IF",
      // controls
      "GOTO",
      "DO",
      "WHILE",
      "WH",
      "END",
      "CALL",
      // scoping
      "SUB",
      "ENDSUB",
      // comparisons
      "EQ",
      "NE",
      "LT",
      "GT",
      "LE",
      "GE",
      "AND",
      "OR",
      "XOR",
      // start/end of program
      "%"
    ],
    built_in: [
      "ATAN",
      "ABS",
      "ACOS",
      "ASIN",
      "COS",
      "EXP",
      "FIX",
      "FUP",
      "ROUND",
      "LN",
      "SIN",
      "SQRT",
      "TAN",
      "EXISTS"
    ]
  }, r = /\b/;
  function i(_, m) {
    if (_.index === 0)
      return;
    const f = _.input[_.index - 1];
    f >= "0" && f <= "9" || f !== "_" && m.ignoreMatch();
  }
  const o = /[+-]?((\.\d+)|(\d+)(\.\d*)?)/, a = /[GM]\s*\d+(\.\d+)?/, s = /T\s*\d+/, l = /O\s*\d+/, c = /O<.+>/, u = /[ABCUVWXYZ]\s*/, d = /[FHIJKPQRS]\s*/, p = [
    // comments
    t.COMMENT(/\(/, /\)/),
    t.COMMENT(/;/, /$/),
    t.APOS_STRING_MODE,
    t.QUOTE_STRING_MODE,
    t.C_NUMBER_MODE,
    // gcodes
    {
      scope: "title.function",
      variants: [
        // G General functions: G0, G5.1, G5.2, …
        // M Misc functions: M0, M55.6, M199, …
        { match: e.concat(r, a) },
        {
          begin: a,
          "on:begin": i
        },
        // T Tools
        { match: e.concat(r, s) },
        {
          begin: s,
          "on:begin": i
        }
      ]
    },
    {
      scope: "symbol",
      variants: [
        // O Subroutine ID: O100, O110, …
        { match: e.concat(r, l) },
        {
          begin: l,
          "on:begin": i
        },
        // O Subroutine name: O<some>, …
        { match: e.concat(r, c) },
        {
          begin: c,
          "on:begin": i
        },
        // Checksum at end of line: *71, *199, …
        { match: /\*\s*\d+\s*$/ }
      ]
    },
    {
      scope: "operator",
      // N Line number: N1, N2, N1020, …
      match: /^N\s*\d+/
    },
    {
      scope: "variable",
      match: /-?#\s*\d+/
    },
    {
      scope: "property",
      // Physical axes,
      variants: [
        { match: e.concat(r, u, o) },
        {
          begin: e.concat(u, o),
          "on:begin": i
        }
      ]
    },
    {
      scope: "params",
      // Different types of parameters
      variants: [
        { match: e.concat(r, d, o) },
        {
          begin: e.concat(d, o),
          "on:begin": i
        }
      ]
    }
  ];
  return {
    name: "G-code (ISO 6983)",
    aliases: ["nc"],
    // Some implementations (CNC controls) of G-code are interoperable with uppercase and lowercase letters seamlessly.
    // However, most prefer all uppercase and uppercase is customary.
    case_insensitive: !0,
    // TODO: post v12 with the use of look-behind this can be enabled
    disableAutodetect: !0,
    keywords: n,
    contains: p
  };
}
function Rx(t) {
  return {
    name: "Gherkin",
    aliases: ["feature"],
    keywords: "Feature Background Ability Business Need Scenario Scenarios Scenario Outline Scenario Template Examples Given And Then But When",
    contains: [
      {
        className: "symbol",
        begin: "\\*",
        relevance: 0
      },
      {
        className: "meta",
        begin: "@[^@\\s]+"
      },
      {
        begin: "\\|",
        end: "\\|\\w*$",
        contains: [
          {
            className: "string",
            begin: "[^|]+"
          }
        ]
      },
      {
        className: "variable",
        begin: "<",
        end: ">"
      },
      t.HASH_COMMENT_MODE,
      {
        className: "string",
        begin: '"""',
        end: '"""'
      },
      t.QUOTE_STRING_MODE
    ]
  };
}
function Ox(t) {
  return {
    name: "GLSL",
    keywords: {
      keyword: (
        // Statements
        "break continue discard do else for if return while switch case default attribute binding buffer ccw centroid centroid varying coherent column_major const cw depth_any depth_greater depth_less depth_unchanged early_fragment_tests equal_spacing flat fractional_even_spacing fractional_odd_spacing highp in index inout invariant invocations isolines layout line_strip lines lines_adjacency local_size_x local_size_y local_size_z location lowp max_vertices mediump noperspective offset origin_upper_left out packed patch pixel_center_integer point_mode points precise precision quads r11f_g11f_b10f r16 r16_snorm r16f r16i r16ui r32f r32i r32ui r8 r8_snorm r8i r8ui readonly restrict rg16 rg16_snorm rg16f rg16i rg16ui rg32f rg32i rg32ui rg8 rg8_snorm rg8i rg8ui rgb10_a2 rgb10_a2ui rgba16 rgba16_snorm rgba16f rgba16i rgba16ui rgba32f rgba32i rgba32ui rgba8 rgba8_snorm rgba8i rgba8ui row_major sample shared smooth std140 std430 stream triangle_strip triangles triangles_adjacency uniform varying vertices volatile writeonly"
      ),
      type: "atomic_uint bool bvec2 bvec3 bvec4 dmat2 dmat2x2 dmat2x3 dmat2x4 dmat3 dmat3x2 dmat3x3 dmat3x4 dmat4 dmat4x2 dmat4x3 dmat4x4 double dvec2 dvec3 dvec4 float iimage1D iimage1DArray iimage2D iimage2DArray iimage2DMS iimage2DMSArray iimage2DRect iimage3D iimageBuffer iimageCube iimageCubeArray image1D image1DArray image2D image2DArray image2DMS image2DMSArray image2DRect image3D imageBuffer imageCube imageCubeArray int isampler1D isampler1DArray isampler2D isampler2DArray isampler2DMS isampler2DMSArray isampler2DRect isampler3D isamplerBuffer isamplerCube isamplerCubeArray ivec2 ivec3 ivec4 mat2 mat2x2 mat2x3 mat2x4 mat3 mat3x2 mat3x3 mat3x4 mat4 mat4x2 mat4x3 mat4x4 sampler1D sampler1DArray sampler1DArrayShadow sampler1DShadow sampler2D sampler2DArray sampler2DArrayShadow sampler2DMS sampler2DMSArray sampler2DRect sampler2DRectShadow sampler2DShadow sampler3D samplerBuffer samplerCube samplerCubeArray samplerCubeArrayShadow samplerCubeShadow image1D uimage1DArray uimage2D uimage2DArray uimage2DMS uimage2DMSArray uimage2DRect uimage3D uimageBuffer uimageCube uimageCubeArray uint usampler1D usampler1DArray usampler2D usampler2DArray usampler2DMS usampler2DMSArray usampler2DRect usampler3D samplerBuffer usamplerCube usamplerCubeArray uvec2 uvec3 uvec4 vec2 vec3 vec4 void",
      built_in: (
        // Constants
        "gl_MaxAtomicCounterBindings gl_MaxAtomicCounterBufferSize gl_MaxClipDistances gl_MaxClipPlanes gl_MaxCombinedAtomicCounterBuffers gl_MaxCombinedAtomicCounters gl_MaxCombinedImageUniforms gl_MaxCombinedImageUnitsAndFragmentOutputs gl_MaxCombinedTextureImageUnits gl_MaxComputeAtomicCounterBuffers gl_MaxComputeAtomicCounters gl_MaxComputeImageUniforms gl_MaxComputeTextureImageUnits gl_MaxComputeUniformComponents gl_MaxComputeWorkGroupCount gl_MaxComputeWorkGroupSize gl_MaxDrawBuffers gl_MaxFragmentAtomicCounterBuffers gl_MaxFragmentAtomicCounters gl_MaxFragmentImageUniforms gl_MaxFragmentInputComponents gl_MaxFragmentInputVectors gl_MaxFragmentUniformComponents gl_MaxFragmentUniformVectors gl_MaxGeometryAtomicCounterBuffers gl_MaxGeometryAtomicCounters gl_MaxGeometryImageUniforms gl_MaxGeometryInputComponents gl_MaxGeometryOutputComponents gl_MaxGeometryOutputVertices gl_MaxGeometryTextureImageUnits gl_MaxGeometryTotalOutputComponents gl_MaxGeometryUniformComponents gl_MaxGeometryVaryingComponents gl_MaxImageSamples gl_MaxImageUnits gl_MaxLights gl_MaxPatchVertices gl_MaxProgramTexelOffset gl_MaxTessControlAtomicCounterBuffers gl_MaxTessControlAtomicCounters gl_MaxTessControlImageUniforms gl_MaxTessControlInputComponents gl_MaxTessControlOutputComponents gl_MaxTessControlTextureImageUnits gl_MaxTessControlTotalOutputComponents gl_MaxTessControlUniformComponents gl_MaxTessEvaluationAtomicCounterBuffers gl_MaxTessEvaluationAtomicCounters gl_MaxTessEvaluationImageUniforms gl_MaxTessEvaluationInputComponents gl_MaxTessEvaluationOutputComponents gl_MaxTessEvaluationTextureImageUnits gl_MaxTessEvaluationUniformComponents gl_MaxTessGenLevel gl_MaxTessPatchComponents gl_MaxTextureCoords gl_MaxTextureImageUnits gl_MaxTextureUnits gl_MaxVaryingComponents gl_MaxVaryingFloats gl_MaxVaryingVectors gl_MaxVertexAtomicCounterBuffers gl_MaxVertexAtomicCounters gl_MaxVertexAttribs gl_MaxVertexImageUniforms gl_MaxVertexOutputComponents gl_MaxVertexOutputVectors gl_MaxVertexTextureImageUnits gl_MaxVertexUniformComponents gl_MaxVertexUniformVectors gl_MaxViewports gl_MinProgramTexelOffset gl_BackColor gl_BackLightModelProduct gl_BackLightProduct gl_BackMaterial gl_BackSecondaryColor gl_ClipDistance gl_ClipPlane gl_ClipVertex gl_Color gl_DepthRange gl_EyePlaneQ gl_EyePlaneR gl_EyePlaneS gl_EyePlaneT gl_Fog gl_FogCoord gl_FogFragCoord gl_FragColor gl_FragCoord gl_FragData gl_FragDepth gl_FrontColor gl_FrontFacing gl_FrontLightModelProduct gl_FrontLightProduct gl_FrontMaterial gl_FrontSecondaryColor gl_GlobalInvocationID gl_InstanceID gl_InvocationID gl_Layer gl_LightModel gl_LightSource gl_LocalInvocationID gl_LocalInvocationIndex gl_ModelViewMatrix gl_ModelViewMatrixInverse gl_ModelViewMatrixInverseTranspose gl_ModelViewMatrixTranspose gl_ModelViewProjectionMatrix gl_ModelViewProjectionMatrixInverse gl_ModelViewProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixTranspose gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_Normal gl_NormalMatrix gl_NormalScale gl_NumSamples gl_NumWorkGroups gl_ObjectPlaneQ gl_ObjectPlaneR gl_ObjectPlaneS gl_ObjectPlaneT gl_PatchVerticesIn gl_Point gl_PointCoord gl_PointSize gl_Position gl_PrimitiveID gl_PrimitiveIDIn gl_ProjectionMatrix gl_ProjectionMatrixInverse gl_ProjectionMatrixInverseTranspose gl_ProjectionMatrixTranspose gl_SampleID gl_SampleMask gl_SampleMaskIn gl_SamplePosition gl_SecondaryColor gl_TessCoord gl_TessLevelInner gl_TessLevelOuter gl_TexCoord gl_TextureEnvColor gl_TextureMatrix gl_TextureMatrixInverse gl_TextureMatrixInverseTranspose gl_TextureMatrixTranspose gl_Vertex gl_VertexID gl_ViewportIndex gl_WorkGroupID gl_WorkGroupSize gl_in gl_out EmitStreamVertex EmitVertex EndPrimitive EndStreamPrimitive abs acos acosh all any asin asinh atan atanh atomicAdd atomicAnd atomicCompSwap atomicCounter atomicCounterDecrement atomicCounterIncrement atomicExchange atomicMax atomicMin atomicOr atomicXor barrier bitCount bitfieldExtract bitfieldInsert bitfieldReverse ceil clamp cos cosh cross dFdx dFdy degrees determinant distance dot equal exp exp2 faceforward findLSB findMSB floatBitsToInt floatBitsToUint floor fma fract frexp ftransform fwidth greaterThan greaterThanEqual groupMemoryBarrier imageAtomicAdd imageAtomicAnd imageAtomicCompSwap imageAtomicExchange imageAtomicMax imageAtomicMin imageAtomicOr imageAtomicXor imageLoad imageSize imageStore imulExtended intBitsToFloat interpolateAtCentroid interpolateAtOffset interpolateAtSample inverse inversesqrt isinf isnan ldexp length lessThan lessThanEqual log log2 matrixCompMult max memoryBarrier memoryBarrierAtomicCounter memoryBarrierBuffer memoryBarrierImage memoryBarrierShared min mix mod modf noise1 noise2 noise3 noise4 normalize not notEqual outerProduct packDouble2x32 packHalf2x16 packSnorm2x16 packSnorm4x8 packUnorm2x16 packUnorm4x8 pow radians reflect refract round roundEven shadow1D shadow1DLod shadow1DProj shadow1DProjLod shadow2D shadow2DLod shadow2DProj shadow2DProjLod sign sin sinh smoothstep sqrt step tan tanh texelFetch texelFetchOffset texture texture1D texture1DLod texture1DProj texture1DProjLod texture2D texture2DLod texture2DProj texture2DProjLod texture3D texture3DLod texture3DProj texture3DProjLod textureCube textureCubeLod textureGather textureGatherOffset textureGatherOffsets textureGrad textureGradOffset textureLod textureLodOffset textureOffset textureProj textureProjGrad textureProjGradOffset textureProjLod textureProjLodOffset textureProjOffset textureQueryLevels textureQueryLod textureSize transpose trunc uaddCarry uintBitsToFloat umulExtended unpackDouble2x32 unpackHalf2x16 unpackSnorm2x16 unpackSnorm4x8 unpackUnorm2x16 unpackUnorm4x8 usubBorrow"
      ),
      literal: "true false"
    },
    illegal: '"',
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.C_NUMBER_MODE,
      {
        className: "meta",
        begin: "#",
        end: "$"
      }
    ]
  };
}
function Nx(t) {
  return {
    name: "GML",
    case_insensitive: !1,
    // language is case-insensitive
    keywords: {
      keyword: [
        "#endregion",
        "#macro",
        "#region",
        "and",
        "begin",
        "break",
        "case",
        "constructor",
        "continue",
        "default",
        "delete",
        "div",
        "do",
        "else",
        "end",
        "enum",
        "exit",
        "for",
        "function",
        "globalvar",
        "if",
        "mod",
        "new",
        "not",
        "or",
        "repeat",
        "return",
        "static",
        "switch",
        "then",
        "until",
        "var",
        "while",
        "with",
        "xor"
      ],
      built_in: [
        "abs",
        "alarm_get",
        "alarm_set",
        "angle_difference",
        "animcurve_channel_evaluate",
        "animcurve_channel_new",
        "animcurve_create",
        "animcurve_destroy",
        "animcurve_exists",
        "animcurve_get",
        "animcurve_get_channel",
        "animcurve_get_channel_index",
        "animcurve_point_new",
        "ansi_char",
        "application_get_position",
        "application_surface_draw_enable",
        "application_surface_enable",
        "application_surface_is_enabled",
        "arccos",
        "arcsin",
        "arctan",
        "arctan2",
        "array_all",
        "array_any",
        "array_concat",
        "array_contains",
        "array_contains_ext",
        "array_copy",
        "array_copy_while",
        "array_create",
        "array_create_ext",
        "array_delete",
        "array_equals",
        "array_filter",
        "array_filter_ext",
        "array_find_index",
        "array_first",
        "array_foreach",
        "array_get",
        "array_get_index",
        "array_insert",
        "array_intersection",
        "array_last",
        "array_length",
        "array_map",
        "array_map_ext",
        "array_pop",
        "array_push",
        "array_reduce",
        "array_resize",
        "array_reverse",
        "array_reverse_ext",
        "array_set",
        "array_shuffle",
        "array_shuffle_ext",
        "array_sort",
        "array_union",
        "array_unique",
        "array_unique_ext",
        "asset_add_tags",
        "asset_clear_tags",
        "asset_get_ids",
        "asset_get_index",
        "asset_get_tags",
        "asset_get_type",
        "asset_has_any_tag",
        "asset_has_tags",
        "asset_remove_tags",
        "audio_bus_clear_emitters",
        "audio_bus_create",
        "audio_bus_get_emitters",
        "audio_channel_num",
        "audio_create_buffer_sound",
        "audio_create_play_queue",
        "audio_create_stream",
        "audio_create_sync_group",
        "audio_debug",
        "audio_destroy_stream",
        "audio_destroy_sync_group",
        "audio_effect_create",
        "audio_emitter_bus",
        "audio_emitter_create",
        "audio_emitter_exists",
        "audio_emitter_falloff",
        "audio_emitter_free",
        "audio_emitter_gain",
        "audio_emitter_get_bus",
        "audio_emitter_get_gain",
        "audio_emitter_get_listener_mask",
        "audio_emitter_get_pitch",
        "audio_emitter_get_vx",
        "audio_emitter_get_vy",
        "audio_emitter_get_vz",
        "audio_emitter_get_x",
        "audio_emitter_get_y",
        "audio_emitter_get_z",
        "audio_emitter_pitch",
        "audio_emitter_position",
        "audio_emitter_set_listener_mask",
        "audio_emitter_velocity",
        "audio_exists",
        "audio_falloff_set_model",
        "audio_free_buffer_sound",
        "audio_free_play_queue",
        "audio_get_listener_count",
        "audio_get_listener_info",
        "audio_get_listener_mask",
        "audio_get_master_gain",
        "audio_get_name",
        "audio_get_recorder_count",
        "audio_get_recorder_info",
        "audio_get_type",
        "audio_group_get_assets",
        "audio_group_get_gain",
        "audio_group_is_loaded",
        "audio_group_load",
        "audio_group_load_progress",
        "audio_group_name",
        "audio_group_set_gain",
        "audio_group_stop_all",
        "audio_group_unload",
        "audio_is_paused",
        "audio_is_playing",
        "audio_listener_get_data",
        "audio_listener_orientation",
        "audio_listener_position",
        "audio_listener_set_orientation",
        "audio_listener_set_position",
        "audio_listener_set_velocity",
        "audio_listener_velocity",
        "audio_master_gain",
        "audio_pause_all",
        "audio_pause_sound",
        "audio_pause_sync_group",
        "audio_play_in_sync_group",
        "audio_play_sound",
        "audio_play_sound_at",
        "audio_play_sound_ext",
        "audio_play_sound_on",
        "audio_queue_sound",
        "audio_resume_all",
        "audio_resume_sound",
        "audio_resume_sync_group",
        "audio_set_listener_mask",
        "audio_set_master_gain",
        "audio_sound_gain",
        "audio_sound_get_audio_group",
        "audio_sound_get_gain",
        "audio_sound_get_listener_mask",
        "audio_sound_get_loop",
        "audio_sound_get_loop_end",
        "audio_sound_get_loop_start",
        "audio_sound_get_pitch",
        "audio_sound_get_track_position",
        "audio_sound_is_playable",
        "audio_sound_length",
        "audio_sound_loop",
        "audio_sound_loop_end",
        "audio_sound_loop_start",
        "audio_sound_pitch",
        "audio_sound_set_listener_mask",
        "audio_sound_set_track_position",
        "audio_start_recording",
        "audio_start_sync_group",
        "audio_stop_all",
        "audio_stop_recording",
        "audio_stop_sound",
        "audio_stop_sync_group",
        "audio_sync_group_debug",
        "audio_sync_group_get_track_pos",
        "audio_sync_group_is_paused",
        "audio_sync_group_is_playing",
        "audio_system_is_available",
        "audio_system_is_initialised",
        "base64_decode",
        "base64_encode",
        "bool",
        "browser_input_capture",
        "buffer_async_group_begin",
        "buffer_async_group_end",
        "buffer_async_group_option",
        "buffer_base64_decode",
        "buffer_base64_decode_ext",
        "buffer_base64_encode",
        "buffer_compress",
        "buffer_copy",
        "buffer_copy_from_vertex_buffer",
        "buffer_copy_stride",
        "buffer_crc32",
        "buffer_create",
        "buffer_create_from_vertex_buffer",
        "buffer_create_from_vertex_buffer_ext",
        "buffer_decompress",
        "buffer_delete",
        "buffer_exists",
        "buffer_fill",
        "buffer_get_address",
        "buffer_get_alignment",
        "buffer_get_size",
        "buffer_get_surface",
        "buffer_get_type",
        "buffer_load",
        "buffer_load_async",
        "buffer_load_ext",
        "buffer_load_partial",
        "buffer_md5",
        "buffer_peek",
        "buffer_poke",
        "buffer_read",
        "buffer_resize",
        "buffer_save",
        "buffer_save_async",
        "buffer_save_ext",
        "buffer_seek",
        "buffer_set_surface",
        "buffer_set_used_size",
        "buffer_sha1",
        "buffer_sizeof",
        "buffer_tell",
        "buffer_write",
        "call_cancel",
        "call_later",
        "camera_apply",
        "camera_copy_transforms",
        "camera_create",
        "camera_create_view",
        "camera_destroy",
        "camera_get_active",
        "camera_get_begin_script",
        "camera_get_default",
        "camera_get_end_script",
        "camera_get_proj_mat",
        "camera_get_update_script",
        "camera_get_view_angle",
        "camera_get_view_border_x",
        "camera_get_view_border_y",
        "camera_get_view_height",
        "camera_get_view_mat",
        "camera_get_view_speed_x",
        "camera_get_view_speed_y",
        "camera_get_view_target",
        "camera_get_view_width",
        "camera_get_view_x",
        "camera_get_view_y",
        "camera_set_begin_script",
        "camera_set_default",
        "camera_set_end_script",
        "camera_set_proj_mat",
        "camera_set_update_script",
        "camera_set_view_angle",
        "camera_set_view_border",
        "camera_set_view_mat",
        "camera_set_view_pos",
        "camera_set_view_size",
        "camera_set_view_speed",
        "camera_set_view_target",
        "ceil",
        "choose",
        "chr",
        "clamp",
        "clickable_add",
        "clickable_add_ext",
        "clickable_change",
        "clickable_change_ext",
        "clickable_delete",
        "clickable_exists",
        "clickable_set_style",
        "clipboard_get_text",
        "clipboard_has_text",
        "clipboard_set_text",
        "cloud_file_save",
        "cloud_string_save",
        "cloud_synchronise",
        "code_is_compiled",
        "collision_circle",
        "collision_circle_list",
        "collision_ellipse",
        "collision_ellipse_list",
        "collision_line",
        "collision_line_list",
        "collision_point",
        "collision_point_list",
        "collision_rectangle",
        "collision_rectangle_list",
        "color_get_blue",
        "color_get_green",
        "color_get_hue",
        "color_get_red",
        "color_get_saturation",
        "color_get_value",
        "colour_get_blue",
        "colour_get_green",
        "colour_get_hue",
        "colour_get_red",
        "colour_get_saturation",
        "colour_get_value",
        "cos",
        "darccos",
        "darcsin",
        "darctan",
        "darctan2",
        "date_compare_date",
        "date_compare_datetime",
        "date_compare_time",
        "date_create_datetime",
        "date_current_datetime",
        "date_date_of",
        "date_date_string",
        "date_datetime_string",
        "date_day_span",
        "date_days_in_month",
        "date_days_in_year",
        "date_get_day",
        "date_get_day_of_year",
        "date_get_hour",
        "date_get_hour_of_year",
        "date_get_minute",
        "date_get_minute_of_year",
        "date_get_month",
        "date_get_second",
        "date_get_second_of_year",
        "date_get_timezone",
        "date_get_week",
        "date_get_weekday",
        "date_get_year",
        "date_hour_span",
        "date_inc_day",
        "date_inc_hour",
        "date_inc_minute",
        "date_inc_month",
        "date_inc_second",
        "date_inc_week",
        "date_inc_year",
        "date_is_today",
        "date_leap_year",
        "date_minute_span",
        "date_month_span",
        "date_second_span",
        "date_set_timezone",
        "date_time_of",
        "date_time_string",
        "date_valid_datetime",
        "date_week_span",
        "date_year_span",
        "db_to_lin",
        "dbg_add_font_glyphs",
        "dbg_button",
        "dbg_checkbox",
        "dbg_color",
        "dbg_colour",
        "dbg_drop_down",
        "dbg_same_line",
        "dbg_section",
        "dbg_section_delete",
        "dbg_section_exists",
        "dbg_slider",
        "dbg_slider_int",
        "dbg_sprite",
        "dbg_text",
        "dbg_text_input",
        "dbg_view",
        "dbg_view_delete",
        "dbg_view_exists",
        "dbg_watch",
        "dcos",
        "debug_event",
        "debug_get_callstack",
        "degtorad",
        "device_get_tilt_x",
        "device_get_tilt_y",
        "device_get_tilt_z",
        "device_is_keypad_open",
        "device_mouse_check_button",
        "device_mouse_check_button_pressed",
        "device_mouse_check_button_released",
        "device_mouse_dbclick_enable",
        "device_mouse_raw_x",
        "device_mouse_raw_y",
        "device_mouse_x",
        "device_mouse_x_to_gui",
        "device_mouse_y",
        "device_mouse_y_to_gui",
        "directory_create",
        "directory_destroy",
        "directory_exists",
        "display_get_dpi_x",
        "display_get_dpi_y",
        "display_get_frequency",
        "display_get_gui_height",
        "display_get_gui_width",
        "display_get_height",
        "display_get_orientation",
        "display_get_sleep_margin",
        "display_get_timing_method",
        "display_get_width",
        "display_mouse_get_x",
        "display_mouse_get_y",
        "display_mouse_set",
        "display_reset",
        "display_set_gui_maximise",
        "display_set_gui_maximize",
        "display_set_gui_size",
        "display_set_sleep_margin",
        "display_set_timing_method",
        "display_set_ui_visibility",
        "distance_to_object",
        "distance_to_point",
        "dot_product",
        "dot_product_3d",
        "dot_product_3d_normalised",
        "dot_product_3d_normalized",
        "dot_product_normalised",
        "dot_product_normalized",
        "draw_arrow",
        "draw_button",
        "draw_circle",
        "draw_circle_color",
        "draw_circle_colour",
        "draw_clear",
        "draw_clear_alpha",
        "draw_ellipse",
        "draw_ellipse_color",
        "draw_ellipse_colour",
        "draw_enable_drawevent",
        "draw_enable_skeleton_blendmodes",
        "draw_enable_swf_aa",
        "draw_flush",
        "draw_get_alpha",
        "draw_get_color",
        "draw_get_colour",
        "draw_get_enable_skeleton_blendmodes",
        "draw_get_font",
        "draw_get_halign",
        "draw_get_lighting",
        "draw_get_swf_aa_level",
        "draw_get_valign",
        "draw_getpixel",
        "draw_getpixel_ext",
        "draw_healthbar",
        "draw_highscore",
        "draw_light_define_ambient",
        "draw_light_define_direction",
        "draw_light_define_point",
        "draw_light_enable",
        "draw_light_get",
        "draw_light_get_ambient",
        "draw_line",
        "draw_line_color",
        "draw_line_colour",
        "draw_line_width",
        "draw_line_width_color",
        "draw_line_width_colour",
        "draw_path",
        "draw_point",
        "draw_point_color",
        "draw_point_colour",
        "draw_primitive_begin",
        "draw_primitive_begin_texture",
        "draw_primitive_end",
        "draw_rectangle",
        "draw_rectangle_color",
        "draw_rectangle_colour",
        "draw_roundrect",
        "draw_roundrect_color",
        "draw_roundrect_color_ext",
        "draw_roundrect_colour",
        "draw_roundrect_colour_ext",
        "draw_roundrect_ext",
        "draw_self",
        "draw_set_alpha",
        "draw_set_circle_precision",
        "draw_set_color",
        "draw_set_colour",
        "draw_set_font",
        "draw_set_halign",
        "draw_set_lighting",
        "draw_set_swf_aa_level",
        "draw_set_valign",
        "draw_skeleton",
        "draw_skeleton_collision",
        "draw_skeleton_instance",
        "draw_skeleton_time",
        "draw_sprite",
        "draw_sprite_ext",
        "draw_sprite_general",
        "draw_sprite_part",
        "draw_sprite_part_ext",
        "draw_sprite_pos",
        "draw_sprite_stretched",
        "draw_sprite_stretched_ext",
        "draw_sprite_tiled",
        "draw_sprite_tiled_ext",
        "draw_surface",
        "draw_surface_ext",
        "draw_surface_general",
        "draw_surface_part",
        "draw_surface_part_ext",
        "draw_surface_stretched",
        "draw_surface_stretched_ext",
        "draw_surface_tiled",
        "draw_surface_tiled_ext",
        "draw_text",
        "draw_text_color",
        "draw_text_colour",
        "draw_text_ext",
        "draw_text_ext_color",
        "draw_text_ext_colour",
        "draw_text_ext_transformed",
        "draw_text_ext_transformed_color",
        "draw_text_ext_transformed_colour",
        "draw_text_transformed",
        "draw_text_transformed_color",
        "draw_text_transformed_colour",
        "draw_texture_flush",
        "draw_tile",
        "draw_tilemap",
        "draw_triangle",
        "draw_triangle_color",
        "draw_triangle_colour",
        "draw_vertex",
        "draw_vertex_color",
        "draw_vertex_colour",
        "draw_vertex_texture",
        "draw_vertex_texture_color",
        "draw_vertex_texture_colour",
        "ds_exists",
        "ds_grid_add",
        "ds_grid_add_disk",
        "ds_grid_add_grid_region",
        "ds_grid_add_region",
        "ds_grid_clear",
        "ds_grid_copy",
        "ds_grid_create",
        "ds_grid_destroy",
        "ds_grid_get",
        "ds_grid_get_disk_max",
        "ds_grid_get_disk_mean",
        "ds_grid_get_disk_min",
        "ds_grid_get_disk_sum",
        "ds_grid_get_max",
        "ds_grid_get_mean",
        "ds_grid_get_min",
        "ds_grid_get_sum",
        "ds_grid_height",
        "ds_grid_multiply",
        "ds_grid_multiply_disk",
        "ds_grid_multiply_grid_region",
        "ds_grid_multiply_region",
        "ds_grid_read",
        "ds_grid_resize",
        "ds_grid_set",
        "ds_grid_set_disk",
        "ds_grid_set_grid_region",
        "ds_grid_set_region",
        "ds_grid_shuffle",
        "ds_grid_sort",
        "ds_grid_to_mp_grid",
        "ds_grid_value_disk_exists",
        "ds_grid_value_disk_x",
        "ds_grid_value_disk_y",
        "ds_grid_value_exists",
        "ds_grid_value_x",
        "ds_grid_value_y",
        "ds_grid_width",
        "ds_grid_write",
        "ds_list_add",
        "ds_list_clear",
        "ds_list_copy",
        "ds_list_create",
        "ds_list_delete",
        "ds_list_destroy",
        "ds_list_empty",
        "ds_list_find_index",
        "ds_list_find_value",
        "ds_list_insert",
        "ds_list_is_list",
        "ds_list_is_map",
        "ds_list_mark_as_list",
        "ds_list_mark_as_map",
        "ds_list_read",
        "ds_list_replace",
        "ds_list_set",
        "ds_list_shuffle",
        "ds_list_size",
        "ds_list_sort",
        "ds_list_write",
        "ds_map_add",
        "ds_map_add_list",
        "ds_map_add_map",
        "ds_map_clear",
        "ds_map_copy",
        "ds_map_create",
        "ds_map_delete",
        "ds_map_destroy",
        "ds_map_empty",
        "ds_map_exists",
        "ds_map_find_first",
        "ds_map_find_last",
        "ds_map_find_next",
        "ds_map_find_previous",
        "ds_map_find_value",
        "ds_map_is_list",
        "ds_map_is_map",
        "ds_map_keys_to_array",
        "ds_map_read",
        "ds_map_replace",
        "ds_map_replace_list",
        "ds_map_replace_map",
        "ds_map_secure_load",
        "ds_map_secure_load_buffer",
        "ds_map_secure_save",
        "ds_map_secure_save_buffer",
        "ds_map_set",
        "ds_map_size",
        "ds_map_values_to_array",
        "ds_map_write",
        "ds_priority_add",
        "ds_priority_change_priority",
        "ds_priority_clear",
        "ds_priority_copy",
        "ds_priority_create",
        "ds_priority_delete_max",
        "ds_priority_delete_min",
        "ds_priority_delete_value",
        "ds_priority_destroy",
        "ds_priority_empty",
        "ds_priority_find_max",
        "ds_priority_find_min",
        "ds_priority_find_priority",
        "ds_priority_read",
        "ds_priority_size",
        "ds_priority_write",
        "ds_queue_clear",
        "ds_queue_copy",
        "ds_queue_create",
        "ds_queue_dequeue",
        "ds_queue_destroy",
        "ds_queue_empty",
        "ds_queue_enqueue",
        "ds_queue_head",
        "ds_queue_read",
        "ds_queue_size",
        "ds_queue_tail",
        "ds_queue_write",
        "ds_set_precision",
        "ds_stack_clear",
        "ds_stack_copy",
        "ds_stack_create",
        "ds_stack_destroy",
        "ds_stack_empty",
        "ds_stack_pop",
        "ds_stack_push",
        "ds_stack_read",
        "ds_stack_size",
        "ds_stack_top",
        "ds_stack_write",
        "dsin",
        "dtan",
        "effect_clear",
        "effect_create_above",
        "effect_create_below",
        "effect_create_depth",
        "effect_create_layer",
        "environment_get_variable",
        "event_inherited",
        "event_perform",
        "event_perform_async",
        "event_perform_object",
        "event_user",
        "exception_unhandled_handler",
        "exp",
        "extension_exists",
        "extension_get_option_count",
        "extension_get_option_names",
        "extension_get_option_value",
        "extension_get_options",
        "extension_get_version",
        "external_call",
        "external_define",
        "external_free",
        "file_attributes",
        "file_bin_close",
        "file_bin_open",
        "file_bin_position",
        "file_bin_read_byte",
        "file_bin_rewrite",
        "file_bin_seek",
        "file_bin_size",
        "file_bin_write_byte",
        "file_copy",
        "file_delete",
        "file_exists",
        "file_find_close",
        "file_find_first",
        "file_find_next",
        "file_rename",
        "file_text_close",
        "file_text_eof",
        "file_text_eoln",
        "file_text_open_append",
        "file_text_open_from_string",
        "file_text_open_read",
        "file_text_open_write",
        "file_text_read_real",
        "file_text_read_string",
        "file_text_readln",
        "file_text_write_real",
        "file_text_write_string",
        "file_text_writeln",
        "filename_change_ext",
        "filename_dir",
        "filename_drive",
        "filename_ext",
        "filename_name",
        "filename_path",
        "floor",
        "font_add",
        "font_add_enable_aa",
        "font_add_get_enable_aa",
        "font_add_sprite",
        "font_add_sprite_ext",
        "font_cache_glyph",
        "font_delete",
        "font_enable_effects",
        "font_enable_sdf",
        "font_exists",
        "font_get_bold",
        "font_get_first",
        "font_get_fontname",
        "font_get_info",
        "font_get_italic",
        "font_get_last",
        "font_get_name",
        "font_get_sdf_enabled",
        "font_get_sdf_spread",
        "font_get_size",
        "font_get_texture",
        "font_get_uvs",
        "font_replace_sprite",
        "font_replace_sprite_ext",
        "font_sdf_spread",
        "font_set_cache_size",
        "frac",
        "fx_create",
        "fx_get_name",
        "fx_get_parameter",
        "fx_get_parameter_names",
        "fx_get_parameters",
        "fx_get_single_layer",
        "fx_set_parameter",
        "fx_set_parameters",
        "fx_set_single_layer",
        "game_change",
        "game_end",
        "game_get_speed",
        "game_load",
        "game_load_buffer",
        "game_restart",
        "game_save",
        "game_save_buffer",
        "game_set_speed",
        "gamepad_axis_count",
        "gamepad_axis_value",
        "gamepad_button_check",
        "gamepad_button_check_pressed",
        "gamepad_button_check_released",
        "gamepad_button_count",
        "gamepad_button_value",
        "gamepad_get_axis_deadzone",
        "gamepad_get_button_threshold",
        "gamepad_get_description",
        "gamepad_get_device_count",
        "gamepad_get_guid",
        "gamepad_get_mapping",
        "gamepad_get_option",
        "gamepad_hat_count",
        "gamepad_hat_value",
        "gamepad_is_connected",
        "gamepad_is_supported",
        "gamepad_remove_mapping",
        "gamepad_set_axis_deadzone",
        "gamepad_set_button_threshold",
        "gamepad_set_color",
        "gamepad_set_colour",
        "gamepad_set_option",
        "gamepad_set_vibration",
        "gamepad_test_mapping",
        "gc_collect",
        "gc_enable",
        "gc_get_stats",
        "gc_get_target_frame_time",
        "gc_is_enabled",
        "gc_target_frame_time",
        "gesture_double_tap_distance",
        "gesture_double_tap_time",
        "gesture_drag_distance",
        "gesture_drag_time",
        "gesture_flick_speed",
        "gesture_get_double_tap_distance",
        "gesture_get_double_tap_time",
        "gesture_get_drag_distance",
        "gesture_get_drag_time",
        "gesture_get_flick_speed",
        "gesture_get_pinch_angle_away",
        "gesture_get_pinch_angle_towards",
        "gesture_get_pinch_distance",
        "gesture_get_rotate_angle",
        "gesture_get_rotate_time",
        "gesture_get_tap_count",
        "gesture_pinch_angle_away",
        "gesture_pinch_angle_towards",
        "gesture_pinch_distance",
        "gesture_rotate_angle",
        "gesture_rotate_time",
        "gesture_tap_count",
        "get_integer",
        "get_integer_async",
        "get_login_async",
        "get_open_filename",
        "get_open_filename_ext",
        "get_save_filename",
        "get_save_filename_ext",
        "get_string",
        "get_string_async",
        "get_timer",
        "gif_add_surface",
        "gif_open",
        "gif_save",
        "gif_save_buffer",
        "gml_pragma",
        "gml_release_mode",
        "gpu_get_alphatestenable",
        "gpu_get_alphatestref",
        "gpu_get_blendenable",
        "gpu_get_blendmode",
        "gpu_get_blendmode_dest",
        "gpu_get_blendmode_destalpha",
        "gpu_get_blendmode_ext",
        "gpu_get_blendmode_ext_sepalpha",
        "gpu_get_blendmode_src",
        "gpu_get_blendmode_srcalpha",
        "gpu_get_colorwriteenable",
        "gpu_get_colourwriteenable",
        "gpu_get_cullmode",
        "gpu_get_depth",
        "gpu_get_fog",
        "gpu_get_state",
        "gpu_get_tex_filter",
        "gpu_get_tex_filter_ext",
        "gpu_get_tex_max_aniso",
        "gpu_get_tex_max_aniso_ext",
        "gpu_get_tex_max_mip",
        "gpu_get_tex_max_mip_ext",
        "gpu_get_tex_min_mip",
        "gpu_get_tex_min_mip_ext",
        "gpu_get_tex_mip_bias",
        "gpu_get_tex_mip_bias_ext",
        "gpu_get_tex_mip_enable",
        "gpu_get_tex_mip_enable_ext",
        "gpu_get_tex_mip_filter",
        "gpu_get_tex_mip_filter_ext",
        "gpu_get_tex_repeat",
        "gpu_get_tex_repeat_ext",
        "gpu_get_texfilter",
        "gpu_get_texfilter_ext",
        "gpu_get_texrepeat",
        "gpu_get_texrepeat_ext",
        "gpu_get_zfunc",
        "gpu_get_ztestenable",
        "gpu_get_zwriteenable",
        "gpu_pop_state",
        "gpu_push_state",
        "gpu_set_alphatestenable",
        "gpu_set_alphatestref",
        "gpu_set_blendenable",
        "gpu_set_blendmode",
        "gpu_set_blendmode_ext",
        "gpu_set_blendmode_ext_sepalpha",
        "gpu_set_colorwriteenable",
        "gpu_set_colourwriteenable",
        "gpu_set_cullmode",
        "gpu_set_depth",
        "gpu_set_fog",
        "gpu_set_state",
        "gpu_set_tex_filter",
        "gpu_set_tex_filter_ext",
        "gpu_set_tex_max_aniso",
        "gpu_set_tex_max_aniso_ext",
        "gpu_set_tex_max_mip",
        "gpu_set_tex_max_mip_ext",
        "gpu_set_tex_min_mip",
        "gpu_set_tex_min_mip_ext",
        "gpu_set_tex_mip_bias",
        "gpu_set_tex_mip_bias_ext",
        "gpu_set_tex_mip_enable",
        "gpu_set_tex_mip_enable_ext",
        "gpu_set_tex_mip_filter",
        "gpu_set_tex_mip_filter_ext",
        "gpu_set_tex_repeat",
        "gpu_set_tex_repeat_ext",
        "gpu_set_texfilter",
        "gpu_set_texfilter_ext",
        "gpu_set_texrepeat",
        "gpu_set_texrepeat_ext",
        "gpu_set_zfunc",
        "gpu_set_ztestenable",
        "gpu_set_zwriteenable",
        "handle_parse",
        "highscore_add",
        "highscore_clear",
        "highscore_name",
        "highscore_value",
        "http_get",
        "http_get_file",
        "http_get_request_crossorigin",
        "http_post_string",
        "http_request",
        "http_set_request_crossorigin",
        "iap_acquire",
        "iap_activate",
        "iap_consume",
        "iap_enumerate_products",
        "iap_product_details",
        "iap_purchase_details",
        "iap_restore_all",
        "iap_status",
        "ini_close",
        "ini_key_delete",
        "ini_key_exists",
        "ini_open",
        "ini_open_from_string",
        "ini_read_real",
        "ini_read_string",
        "ini_section_delete",
        "ini_section_exists",
        "ini_write_real",
        "ini_write_string",
        "instance_activate_all",
        "instance_activate_layer",
        "instance_activate_object",
        "instance_activate_region",
        "instance_change",
        "instance_copy",
        "instance_create_depth",
        "instance_create_layer",
        "instance_deactivate_all",
        "instance_deactivate_layer",
        "instance_deactivate_object",
        "instance_deactivate_region",
        "instance_destroy",
        "instance_exists",
        "instance_find",
        "instance_furthest",
        "instance_id_get",
        "instance_nearest",
        "instance_number",
        "instance_place",
        "instance_place_list",
        "instance_position",
        "instance_position_list",
        "instanceof",
        "int64",
        "io_clear",
        "irandom",
        "irandom_range",
        "is_array",
        "is_bool",
        "is_callable",
        "is_debug_overlay_open",
        "is_handle",
        "is_infinity",
        "is_instanceof",
        "is_int32",
        "is_int64",
        "is_keyboard_used_debug_overlay",
        "is_method",
        "is_mouse_over_debug_overlay",
        "is_nan",
        "is_numeric",
        "is_ptr",
        "is_real",
        "is_string",
        "is_struct",
        "is_undefined",
        "json_decode",
        "json_encode",
        "json_parse",
        "json_stringify",
        "keyboard_check",
        "keyboard_check_direct",
        "keyboard_check_pressed",
        "keyboard_check_released",
        "keyboard_clear",
        "keyboard_get_map",
        "keyboard_get_numlock",
        "keyboard_key_press",
        "keyboard_key_release",
        "keyboard_set_map",
        "keyboard_set_numlock",
        "keyboard_unset_map",
        "keyboard_virtual_height",
        "keyboard_virtual_hide",
        "keyboard_virtual_show",
        "keyboard_virtual_status",
        "layer_add_instance",
        "layer_background_alpha",
        "layer_background_blend",
        "layer_background_change",
        "layer_background_create",
        "layer_background_destroy",
        "layer_background_exists",
        "layer_background_get_alpha",
        "layer_background_get_blend",
        "layer_background_get_htiled",
        "layer_background_get_id",
        "layer_background_get_index",
        "layer_background_get_speed",
        "layer_background_get_sprite",
        "layer_background_get_stretch",
        "layer_background_get_visible",
        "layer_background_get_vtiled",
        "layer_background_get_xscale",
        "layer_background_get_yscale",
        "layer_background_htiled",
        "layer_background_index",
        "layer_background_speed",
        "layer_background_sprite",
        "layer_background_stretch",
        "layer_background_visible",
        "layer_background_vtiled",
        "layer_background_xscale",
        "layer_background_yscale",
        "layer_clear_fx",
        "layer_create",
        "layer_depth",
        "layer_destroy",
        "layer_destroy_instances",
        "layer_element_move",
        "layer_enable_fx",
        "layer_exists",
        "layer_force_draw_depth",
        "layer_fx_is_enabled",
        "layer_get_all",
        "layer_get_all_elements",
        "layer_get_depth",
        "layer_get_element_layer",
        "layer_get_element_type",
        "layer_get_forced_depth",
        "layer_get_fx",
        "layer_get_hspeed",
        "layer_get_id",
        "layer_get_id_at_depth",
        "layer_get_name",
        "layer_get_script_begin",
        "layer_get_script_end",
        "layer_get_shader",
        "layer_get_target_room",
        "layer_get_visible",
        "layer_get_vspeed",
        "layer_get_x",
        "layer_get_y",
        "layer_has_instance",
        "layer_hspeed",
        "layer_instance_get_instance",
        "layer_is_draw_depth_forced",
        "layer_reset_target_room",
        "layer_script_begin",
        "layer_script_end",
        "layer_sequence_angle",
        "layer_sequence_create",
        "layer_sequence_destroy",
        "layer_sequence_exists",
        "layer_sequence_get_angle",
        "layer_sequence_get_headdir",
        "layer_sequence_get_headpos",
        "layer_sequence_get_instance",
        "layer_sequence_get_length",
        "layer_sequence_get_sequence",
        "layer_sequence_get_speedscale",
        "layer_sequence_get_x",
        "layer_sequence_get_xscale",
        "layer_sequence_get_y",
        "layer_sequence_get_yscale",
        "layer_sequence_headdir",
        "layer_sequence_headpos",
        "layer_sequence_is_finished",
        "layer_sequence_is_paused",
        "layer_sequence_pause",
        "layer_sequence_play",
        "layer_sequence_speedscale",
        "layer_sequence_x",
        "layer_sequence_xscale",
        "layer_sequence_y",
        "layer_sequence_yscale",
        "layer_set_fx",
        "layer_set_target_room",
        "layer_set_visible",
        "layer_shader",
        "layer_sprite_alpha",
        "layer_sprite_angle",
        "layer_sprite_blend",
        "layer_sprite_change",
        "layer_sprite_create",
        "layer_sprite_destroy",
        "layer_sprite_exists",
        "layer_sprite_get_alpha",
        "layer_sprite_get_angle",
        "layer_sprite_get_blend",
        "layer_sprite_get_id",
        "layer_sprite_get_index",
        "layer_sprite_get_speed",
        "layer_sprite_get_sprite",
        "layer_sprite_get_x",
        "layer_sprite_get_xscale",
        "layer_sprite_get_y",
        "layer_sprite_get_yscale",
        "layer_sprite_index",
        "layer_sprite_speed",
        "layer_sprite_x",
        "layer_sprite_xscale",
        "layer_sprite_y",
        "layer_sprite_yscale",
        "layer_tile_alpha",
        "layer_tile_blend",
        "layer_tile_change",
        "layer_tile_create",
        "layer_tile_destroy",
        "layer_tile_exists",
        "layer_tile_get_alpha",
        "layer_tile_get_blend",
        "layer_tile_get_region",
        "layer_tile_get_sprite",
        "layer_tile_get_visible",
        "layer_tile_get_x",
        "layer_tile_get_xscale",
        "layer_tile_get_y",
        "layer_tile_get_yscale",
        "layer_tile_region",
        "layer_tile_visible",
        "layer_tile_x",
        "layer_tile_xscale",
        "layer_tile_y",
        "layer_tile_yscale",
        "layer_tilemap_create",
        "layer_tilemap_destroy",
        "layer_tilemap_exists",
        "layer_tilemap_get_id",
        "layer_vspeed",
        "layer_x",
        "layer_y",
        "lengthdir_x",
        "lengthdir_y",
        "lerp",
        "lin_to_db",
        "ln",
        "load_csv",
        "log10",
        "log2",
        "logn",
        "make_color_hsv",
        "make_color_rgb",
        "make_colour_hsv",
        "make_colour_rgb",
        "math_get_epsilon",
        "math_set_epsilon",
        "matrix_build",
        "matrix_build_identity",
        "matrix_build_lookat",
        "matrix_build_projection_ortho",
        "matrix_build_projection_perspective",
        "matrix_build_projection_perspective_fov",
        "matrix_get",
        "matrix_multiply",
        "matrix_set",
        "matrix_stack_clear",
        "matrix_stack_is_empty",
        "matrix_stack_pop",
        "matrix_stack_push",
        "matrix_stack_set",
        "matrix_stack_top",
        "matrix_transform_vertex",
        "max",
        "md5_file",
        "md5_string_unicode",
        "md5_string_utf8",
        "mean",
        "median",
        "merge_color",
        "merge_colour",
        "method",
        "method_call",
        "method_get_index",
        "method_get_self",
        "min",
        "motion_add",
        "motion_set",
        "mouse_check_button",
        "mouse_check_button_pressed",
        "mouse_check_button_released",
        "mouse_clear",
        "mouse_wheel_down",
        "mouse_wheel_up",
        "move_and_collide",
        "move_bounce_all",
        "move_bounce_solid",
        "move_contact_all",
        "move_contact_solid",
        "move_outside_all",
        "move_outside_solid",
        "move_random",
        "move_snap",
        "move_towards_point",
        "move_wrap",
        "mp_grid_add_cell",
        "mp_grid_add_instances",
        "mp_grid_add_rectangle",
        "mp_grid_clear_all",
        "mp_grid_clear_cell",
        "mp_grid_clear_rectangle",
        "mp_grid_create",
        "mp_grid_destroy",
        "mp_grid_draw",
        "mp_grid_get_cell",
        "mp_grid_path",
        "mp_grid_to_ds_grid",
        "mp_linear_path",
        "mp_linear_path_object",
        "mp_linear_step",
        "mp_linear_step_object",
        "mp_potential_path",
        "mp_potential_path_object",
        "mp_potential_settings",
        "mp_potential_step",
        "mp_potential_step_object",
        "nameof",
        "network_connect",
        "network_connect_async",
        "network_connect_raw",
        "network_connect_raw_async",
        "network_create_server",
        "network_create_server_raw",
        "network_create_socket",
        "network_create_socket_ext",
        "network_destroy",
        "network_resolve",
        "network_send_broadcast",
        "network_send_packet",
        "network_send_raw",
        "network_send_udp",
        "network_send_udp_raw",
        "network_set_config",
        "network_set_timeout",
        "object_exists",
        "object_get_mask",
        "object_get_name",
        "object_get_parent",
        "object_get_persistent",
        "object_get_physics",
        "object_get_solid",
        "object_get_sprite",
        "object_get_visible",
        "object_is_ancestor",
        "object_set_mask",
        "object_set_persistent",
        "object_set_solid",
        "object_set_sprite",
        "object_set_visible",
        "ord",
        "os_check_permission",
        "os_get_config",
        "os_get_info",
        "os_get_language",
        "os_get_region",
        "os_is_network_connected",
        "os_is_paused",
        "os_lock_orientation",
        "os_powersave_enable",
        "os_request_permission",
        "os_set_orientation_lock",
        "parameter_count",
        "parameter_string",
        "part_emitter_burst",
        "part_emitter_clear",
        "part_emitter_create",
        "part_emitter_delay",
        "part_emitter_destroy",
        "part_emitter_destroy_all",
        "part_emitter_enable",
        "part_emitter_exists",
        "part_emitter_interval",
        "part_emitter_region",
        "part_emitter_relative",
        "part_emitter_stream",
        "part_particles_burst",
        "part_particles_clear",
        "part_particles_count",
        "part_particles_create",
        "part_particles_create_color",
        "part_particles_create_colour",
        "part_system_angle",
        "part_system_automatic_draw",
        "part_system_automatic_update",
        "part_system_clear",
        "part_system_color",
        "part_system_colour",
        "part_system_create",
        "part_system_create_layer",
        "part_system_depth",
        "part_system_destroy",
        "part_system_draw_order",
        "part_system_drawit",
        "part_system_exists",
        "part_system_get_info",
        "part_system_get_layer",
        "part_system_global_space",
        "part_system_layer",
        "part_system_position",
        "part_system_update",
        "part_type_alpha1",
        "part_type_alpha2",
        "part_type_alpha3",
        "part_type_blend",
        "part_type_clear",
        "part_type_color1",
        "part_type_color2",
        "part_type_color3",
        "part_type_color_hsv",
        "part_type_color_mix",
        "part_type_color_rgb",
        "part_type_colour1",
        "part_type_colour2",
        "part_type_colour3",
        "part_type_colour_hsv",
        "part_type_colour_mix",
        "part_type_colour_rgb",
        "part_type_create",
        "part_type_death",
        "part_type_destroy",
        "part_type_direction",
        "part_type_exists",
        "part_type_gravity",
        "part_type_life",
        "part_type_orientation",
        "part_type_scale",
        "part_type_shape",
        "part_type_size",
        "part_type_size_x",
        "part_type_size_y",
        "part_type_speed",
        "part_type_sprite",
        "part_type_step",
        "part_type_subimage",
        "particle_exists",
        "particle_get_info",
        "path_add",
        "path_add_point",
        "path_append",
        "path_assign",
        "path_change_point",
        "path_clear_points",
        "path_delete",
        "path_delete_point",
        "path_duplicate",
        "path_end",
        "path_exists",
        "path_flip",
        "path_get_closed",
        "path_get_kind",
        "path_get_length",
        "path_get_name",
        "path_get_number",
        "path_get_point_speed",
        "path_get_point_x",
        "path_get_point_y",
        "path_get_precision",
        "path_get_speed",
        "path_get_x",
        "path_get_y",
        "path_insert_point",
        "path_mirror",
        "path_rescale",
        "path_reverse",
        "path_rotate",
        "path_set_closed",
        "path_set_kind",
        "path_set_precision",
        "path_shift",
        "path_start",
        "physics_apply_angular_impulse",
        "physics_apply_force",
        "physics_apply_impulse",
        "physics_apply_local_force",
        "physics_apply_local_impulse",
        "physics_apply_torque",
        "physics_draw_debug",
        "physics_fixture_add_point",
        "physics_fixture_bind",
        "physics_fixture_bind_ext",
        "physics_fixture_create",
        "physics_fixture_delete",
        "physics_fixture_set_angular_damping",
        "physics_fixture_set_awake",
        "physics_fixture_set_box_shape",
        "physics_fixture_set_chain_shape",
        "physics_fixture_set_circle_shape",
        "physics_fixture_set_collision_group",
        "physics_fixture_set_density",
        "physics_fixture_set_edge_shape",
        "physics_fixture_set_friction",
        "physics_fixture_set_kinematic",
        "physics_fixture_set_linear_damping",
        "physics_fixture_set_polygon_shape",
        "physics_fixture_set_restitution",
        "physics_fixture_set_sensor",
        "physics_get_density",
        "physics_get_friction",
        "physics_get_restitution",
        "physics_joint_delete",
        "physics_joint_distance_create",
        "physics_joint_enable_motor",
        "physics_joint_friction_create",
        "physics_joint_gear_create",
        "physics_joint_get_value",
        "physics_joint_prismatic_create",
        "physics_joint_pulley_create",
        "physics_joint_revolute_create",
        "physics_joint_rope_create",
        "physics_joint_set_value",
        "physics_joint_weld_create",
        "physics_joint_wheel_create",
        "physics_mass_properties",
        "physics_particle_count",
        "physics_particle_create",
        "physics_particle_delete",
        "physics_particle_delete_region_box",
        "physics_particle_delete_region_circle",
        "physics_particle_delete_region_poly",
        "physics_particle_draw",
        "physics_particle_draw_ext",
        "physics_particle_get_damping",
        "physics_particle_get_data",
        "physics_particle_get_data_particle",
        "physics_particle_get_density",
        "physics_particle_get_gravity_scale",
        "physics_particle_get_group_flags",
        "physics_particle_get_max_count",
        "physics_particle_get_radius",
        "physics_particle_group_add_point",
        "physics_particle_group_begin",
        "physics_particle_group_box",
        "physics_particle_group_circle",
        "physics_particle_group_count",
        "physics_particle_group_delete",
        "physics_particle_group_end",
        "physics_particle_group_get_ang_vel",
        "physics_particle_group_get_angle",
        "physics_particle_group_get_centre_x",
        "physics_particle_group_get_centre_y",
        "physics_particle_group_get_data",
        "physics_particle_group_get_inertia",
        "physics_particle_group_get_mass",
        "physics_particle_group_get_vel_x",
        "physics_particle_group_get_vel_y",
        "physics_particle_group_get_x",
        "physics_particle_group_get_y",
        "physics_particle_group_join",
        "physics_particle_group_polygon",
        "physics_particle_set_category_flags",
        "physics_particle_set_damping",
        "physics_particle_set_density",
        "physics_particle_set_flags",
        "physics_particle_set_gravity_scale",
        "physics_particle_set_group_flags",
        "physics_particle_set_max_count",
        "physics_particle_set_radius",
        "physics_pause_enable",
        "physics_remove_fixture",
        "physics_set_density",
        "physics_set_friction",
        "physics_set_restitution",
        "physics_test_overlap",
        "physics_world_create",
        "physics_world_draw_debug",
        "physics_world_gravity",
        "physics_world_update_iterations",
        "physics_world_update_speed",
        "place_empty",
        "place_free",
        "place_meeting",
        "place_snapped",
        "point_direction",
        "point_distance",
        "point_distance_3d",
        "point_in_circle",
        "point_in_rectangle",
        "point_in_triangle",
        "position_change",
        "position_destroy",
        "position_empty",
        "position_meeting",
        "power",
        "ptr",
        "radtodeg",
        "random",
        "random_get_seed",
        "random_range",
        "random_set_seed",
        "randomise",
        "randomize",
        "real",
        "rectangle_in_circle",
        "rectangle_in_rectangle",
        "rectangle_in_triangle",
        "ref_create",
        "rollback_chat",
        "rollback_create_game",
        "rollback_define_extra_network_latency",
        "rollback_define_input",
        "rollback_define_input_frame_delay",
        "rollback_define_mock_input",
        "rollback_define_player",
        "rollback_display_events",
        "rollback_get_info",
        "rollback_get_input",
        "rollback_get_player_prefs",
        "rollback_join_game",
        "rollback_leave_game",
        "rollback_set_player_prefs",
        "rollback_start_game",
        "rollback_sync_on_frame",
        "rollback_use_late_join",
        "rollback_use_manual_start",
        "rollback_use_player_prefs",
        "rollback_use_random_input",
        "room_add",
        "room_assign",
        "room_duplicate",
        "room_exists",
        "room_get_camera",
        "room_get_info",
        "room_get_name",
        "room_get_viewport",
        "room_goto",
        "room_goto_next",
        "room_goto_previous",
        "room_instance_add",
        "room_instance_clear",
        "room_next",
        "room_previous",
        "room_restart",
        "room_set_camera",
        "room_set_height",
        "room_set_persistent",
        "room_set_view_enabled",
        "room_set_viewport",
        "room_set_width",
        "round",
        "scheduler_resolution_get",
        "scheduler_resolution_set",
        "screen_save",
        "screen_save_part",
        "script_execute",
        "script_execute_ext",
        "script_exists",
        "script_get_name",
        "sequence_create",
        "sequence_destroy",
        "sequence_exists",
        "sequence_get",
        "sequence_get_objects",
        "sequence_instance_override_object",
        "sequence_keyframe_new",
        "sequence_keyframedata_new",
        "sequence_track_new",
        "sha1_file",
        "sha1_string_unicode",
        "sha1_string_utf8",
        "shader_current",
        "shader_enable_corner_id",
        "shader_get_name",
        "shader_get_sampler_index",
        "shader_get_uniform",
        "shader_is_compiled",
        "shader_reset",
        "shader_set",
        "shader_set_uniform_f",
        "shader_set_uniform_f_array",
        "shader_set_uniform_f_buffer",
        "shader_set_uniform_i",
        "shader_set_uniform_i_array",
        "shader_set_uniform_matrix",
        "shader_set_uniform_matrix_array",
        "shaders_are_supported",
        "shop_leave_rating",
        "show_debug_message",
        "show_debug_message_ext",
        "show_debug_overlay",
        "show_error",
        "show_message",
        "show_message_async",
        "show_question",
        "show_question_async",
        "sign",
        "sin",
        "skeleton_animation_clear",
        "skeleton_animation_get",
        "skeleton_animation_get_duration",
        "skeleton_animation_get_event_frames",
        "skeleton_animation_get_ext",
        "skeleton_animation_get_frame",
        "skeleton_animation_get_frames",
        "skeleton_animation_get_position",
        "skeleton_animation_is_finished",
        "skeleton_animation_is_looping",
        "skeleton_animation_list",
        "skeleton_animation_mix",
        "skeleton_animation_set",
        "skeleton_animation_set_ext",
        "skeleton_animation_set_frame",
        "skeleton_animation_set_position",
        "skeleton_attachment_create",
        "skeleton_attachment_create_color",
        "skeleton_attachment_create_colour",
        "skeleton_attachment_destroy",
        "skeleton_attachment_exists",
        "skeleton_attachment_get",
        "skeleton_attachment_replace",
        "skeleton_attachment_replace_color",
        "skeleton_attachment_replace_colour",
        "skeleton_attachment_set",
        "skeleton_bone_data_get",
        "skeleton_bone_data_set",
        "skeleton_bone_list",
        "skeleton_bone_state_get",
        "skeleton_bone_state_set",
        "skeleton_collision_draw_set",
        "skeleton_find_slot",
        "skeleton_get_bounds",
        "skeleton_get_minmax",
        "skeleton_get_num_bounds",
        "skeleton_skin_create",
        "skeleton_skin_get",
        "skeleton_skin_list",
        "skeleton_skin_set",
        "skeleton_slot_alpha_get",
        "skeleton_slot_color_get",
        "skeleton_slot_color_set",
        "skeleton_slot_colour_get",
        "skeleton_slot_colour_set",
        "skeleton_slot_data",
        "skeleton_slot_data_instance",
        "skeleton_slot_list",
        "sprite_add",
        "sprite_add_ext",
        "sprite_add_from_surface",
        "sprite_assign",
        "sprite_collision_mask",
        "sprite_create_from_surface",
        "sprite_delete",
        "sprite_duplicate",
        "sprite_exists",
        "sprite_flush",
        "sprite_flush_multi",
        "sprite_get_bbox_bottom",
        "sprite_get_bbox_left",
        "sprite_get_bbox_mode",
        "sprite_get_bbox_right",
        "sprite_get_bbox_top",
        "sprite_get_height",
        "sprite_get_info",
        "sprite_get_name",
        "sprite_get_nineslice",
        "sprite_get_number",
        "sprite_get_speed",
        "sprite_get_speed_type",
        "sprite_get_texture",
        "sprite_get_tpe",
        "sprite_get_uvs",
        "sprite_get_width",
        "sprite_get_xoffset",
        "sprite_get_yoffset",
        "sprite_merge",
        "sprite_nineslice_create",
        "sprite_prefetch",
        "sprite_prefetch_multi",
        "sprite_replace",
        "sprite_save",
        "sprite_save_strip",
        "sprite_set_alpha_from_sprite",
        "sprite_set_bbox",
        "sprite_set_bbox_mode",
        "sprite_set_cache_size",
        "sprite_set_cache_size_ext",
        "sprite_set_nineslice",
        "sprite_set_offset",
        "sprite_set_speed",
        "sqr",
        "sqrt",
        "static_get",
        "static_set",
        "string",
        "string_byte_at",
        "string_byte_length",
        "string_char_at",
        "string_concat",
        "string_concat_ext",
        "string_copy",
        "string_count",
        "string_delete",
        "string_digits",
        "string_ends_with",
        "string_ext",
        "string_foreach",
        "string_format",
        "string_hash_to_newline",
        "string_height",
        "string_height_ext",
        "string_insert",
        "string_join",
        "string_join_ext",
        "string_last_pos",
        "string_last_pos_ext",
        "string_length",
        "string_letters",
        "string_lettersdigits",
        "string_lower",
        "string_ord_at",
        "string_pos",
        "string_pos_ext",
        "string_repeat",
        "string_replace",
        "string_replace_all",
        "string_set_byte_at",
        "string_split",
        "string_split_ext",
        "string_starts_with",
        "string_trim",
        "string_trim_end",
        "string_trim_start",
        "string_upper",
        "string_width",
        "string_width_ext",
        "struct_exists",
        "struct_foreach",
        "struct_get",
        "struct_get_from_hash",
        "struct_get_names",
        "struct_names_count",
        "struct_remove",
        "struct_set",
        "struct_set_from_hash",
        "surface_copy",
        "surface_copy_part",
        "surface_create",
        "surface_create_ext",
        "surface_depth_disable",
        "surface_exists",
        "surface_format_is_supported",
        "surface_free",
        "surface_get_depth_disable",
        "surface_get_format",
        "surface_get_height",
        "surface_get_target",
        "surface_get_target_ext",
        "surface_get_texture",
        "surface_get_width",
        "surface_getpixel",
        "surface_getpixel_ext",
        "surface_reset_target",
        "surface_resize",
        "surface_save",
        "surface_save_part",
        "surface_set_target",
        "surface_set_target_ext",
        "tag_get_asset_ids",
        "tag_get_assets",
        "tan",
        "texture_debug_messages",
        "texture_flush",
        "texture_get_height",
        "texture_get_texel_height",
        "texture_get_texel_width",
        "texture_get_uvs",
        "texture_get_width",
        "texture_global_scale",
        "texture_is_ready",
        "texture_prefetch",
        "texture_set_stage",
        "texturegroup_get_fonts",
        "texturegroup_get_names",
        "texturegroup_get_sprites",
        "texturegroup_get_status",
        "texturegroup_get_textures",
        "texturegroup_get_tilesets",
        "texturegroup_load",
        "texturegroup_set_mode",
        "texturegroup_unload",
        "tile_get_empty",
        "tile_get_flip",
        "tile_get_index",
        "tile_get_mirror",
        "tile_get_rotate",
        "tile_set_empty",
        "tile_set_flip",
        "tile_set_index",
        "tile_set_mirror",
        "tile_set_rotate",
        "tilemap_clear",
        "tilemap_get",
        "tilemap_get_at_pixel",
        "tilemap_get_cell_x_at_pixel",
        "tilemap_get_cell_y_at_pixel",
        "tilemap_get_frame",
        "tilemap_get_global_mask",
        "tilemap_get_height",
        "tilemap_get_mask",
        "tilemap_get_tile_height",
        "tilemap_get_tile_width",
        "tilemap_get_tileset",
        "tilemap_get_width",
        "tilemap_get_x",
        "tilemap_get_y",
        "tilemap_set",
        "tilemap_set_at_pixel",
        "tilemap_set_global_mask",
        "tilemap_set_height",
        "tilemap_set_mask",
        "tilemap_set_width",
        "tilemap_tileset",
        "tilemap_x",
        "tilemap_y",
        "tileset_get_info",
        "tileset_get_name",
        "tileset_get_texture",
        "tileset_get_uvs",
        "time_bpm_to_seconds",
        "time_seconds_to_bpm",
        "time_source_create",
        "time_source_destroy",
        "time_source_exists",
        "time_source_get_children",
        "time_source_get_parent",
        "time_source_get_period",
        "time_source_get_reps_completed",
        "time_source_get_reps_remaining",
        "time_source_get_state",
        "time_source_get_time_remaining",
        "time_source_get_units",
        "time_source_pause",
        "time_source_reconfigure",
        "time_source_reset",
        "time_source_resume",
        "time_source_start",
        "time_source_stop",
        "timeline_add",
        "timeline_clear",
        "timeline_delete",
        "timeline_exists",
        "timeline_get_name",
        "timeline_max_moment",
        "timeline_moment_add_script",
        "timeline_moment_clear",
        "timeline_size",
        "typeof",
        "url_get_domain",
        "url_open",
        "url_open_ext",
        "url_open_full",
        "uwp_device_touchscreen_available",
        "uwp_livetile_badge_clear",
        "uwp_livetile_badge_notification",
        "uwp_livetile_notification_begin",
        "uwp_livetile_notification_end",
        "uwp_livetile_notification_expiry",
        "uwp_livetile_notification_image_add",
        "uwp_livetile_notification_secondary_begin",
        "uwp_livetile_notification_tag",
        "uwp_livetile_notification_template_add",
        "uwp_livetile_notification_text_add",
        "uwp_livetile_queue_enable",
        "uwp_livetile_tile_clear",
        "uwp_secondarytile_badge_clear",
        "uwp_secondarytile_badge_notification",
        "uwp_secondarytile_delete",
        "uwp_secondarytile_pin",
        "uwp_secondarytile_tile_clear",
        "variable_clone",
        "variable_get_hash",
        "variable_global_exists",
        "variable_global_get",
        "variable_global_set",
        "variable_instance_exists",
        "variable_instance_get",
        "variable_instance_get_names",
        "variable_instance_names_count",
        "variable_instance_set",
        "variable_struct_exists",
        "variable_struct_get",
        "variable_struct_get_names",
        "variable_struct_names_count",
        "variable_struct_remove",
        "variable_struct_set",
        "vertex_argb",
        "vertex_begin",
        "vertex_color",
        "vertex_colour",
        "vertex_create_buffer",
        "vertex_create_buffer_ext",
        "vertex_create_buffer_from_buffer",
        "vertex_create_buffer_from_buffer_ext",
        "vertex_delete_buffer",
        "vertex_end",
        "vertex_float1",
        "vertex_float2",
        "vertex_float3",
        "vertex_float4",
        "vertex_format_add_color",
        "vertex_format_add_colour",
        "vertex_format_add_custom",
        "vertex_format_add_normal",
        "vertex_format_add_position",
        "vertex_format_add_position_3d",
        "vertex_format_add_texcoord",
        "vertex_format_begin",
        "vertex_format_delete",
        "vertex_format_end",
        "vertex_format_get_info",
        "vertex_freeze",
        "vertex_get_buffer_size",
        "vertex_get_number",
        "vertex_normal",
        "vertex_position",
        "vertex_position_3d",
        "vertex_submit",
        "vertex_submit_ext",
        "vertex_texcoord",
        "vertex_ubyte4",
        "vertex_update_buffer_from_buffer",
        "vertex_update_buffer_from_vertex",
        "video_close",
        "video_draw",
        "video_enable_loop",
        "video_get_duration",
        "video_get_format",
        "video_get_position",
        "video_get_status",
        "video_get_volume",
        "video_is_looping",
        "video_open",
        "video_pause",
        "video_resume",
        "video_seek_to",
        "video_set_volume",
        "view_get_camera",
        "view_get_hport",
        "view_get_surface_id",
        "view_get_visible",
        "view_get_wport",
        "view_get_xport",
        "view_get_yport",
        "view_set_camera",
        "view_set_hport",
        "view_set_surface_id",
        "view_set_visible",
        "view_set_wport",
        "view_set_xport",
        "view_set_yport",
        "virtual_key_add",
        "virtual_key_delete",
        "virtual_key_hide",
        "virtual_key_show",
        "wallpaper_set_config",
        "wallpaper_set_subscriptions",
        "weak_ref_alive",
        "weak_ref_any_alive",
        "weak_ref_create",
        "window_center",
        "window_device",
        "window_enable_borderless_fullscreen",
        "window_get_borderless_fullscreen",
        "window_get_caption",
        "window_get_color",
        "window_get_colour",
        "window_get_cursor",
        "window_get_fullscreen",
        "window_get_height",
        "window_get_showborder",
        "window_get_visible_rects",
        "window_get_width",
        "window_get_x",
        "window_get_y",
        "window_handle",
        "window_has_focus",
        "window_mouse_get_delta_x",
        "window_mouse_get_delta_y",
        "window_mouse_get_locked",
        "window_mouse_get_x",
        "window_mouse_get_y",
        "window_mouse_set",
        "window_mouse_set_locked",
        "window_set_caption",
        "window_set_color",
        "window_set_colour",
        "window_set_cursor",
        "window_set_fullscreen",
        "window_set_max_height",
        "window_set_max_width",
        "window_set_min_height",
        "window_set_min_width",
        "window_set_position",
        "window_set_rectangle",
        "window_set_showborder",
        "window_set_size",
        "window_view_mouse_get_x",
        "window_view_mouse_get_y",
        "window_views_mouse_get_x",
        "window_views_mouse_get_y",
        "winphone_tile_background_color",
        "winphone_tile_background_colour",
        "zip_add_file",
        "zip_create",
        "zip_save",
        "zip_unzip",
        "zip_unzip_async"
      ],
      symbol: [
        "AudioEffect",
        "AudioEffectType",
        "AudioLFOType",
        "GM_build_date",
        "GM_build_type",
        "GM_is_sandboxed",
        "GM_project_filename",
        "GM_runtime_version",
        "GM_version",
        "NaN",
        "_GMFILE_",
        "_GMFUNCTION_",
        "_GMLINE_",
        "alignmentH",
        "alignmentV",
        "all",
        "animcurvetype_bezier",
        "animcurvetype_catmullrom",
        "animcurvetype_linear",
        "asset_animationcurve",
        "asset_font",
        "asset_object",
        "asset_path",
        "asset_room",
        "asset_script",
        "asset_sequence",
        "asset_shader",
        "asset_sound",
        "asset_sprite",
        "asset_tiles",
        "asset_timeline",
        "asset_unknown",
        "audio_3D",
        "audio_bus_main",
        "audio_falloff_exponent_distance",
        "audio_falloff_exponent_distance_clamped",
        "audio_falloff_exponent_distance_scaled",
        "audio_falloff_inverse_distance",
        "audio_falloff_inverse_distance_clamped",
        "audio_falloff_inverse_distance_scaled",
        "audio_falloff_linear_distance",
        "audio_falloff_linear_distance_clamped",
        "audio_falloff_none",
        "audio_mono",
        "audio_stereo",
        "bboxkind_diamond",
        "bboxkind_ellipse",
        "bboxkind_precise",
        "bboxkind_rectangular",
        "bboxmode_automatic",
        "bboxmode_fullimage",
        "bboxmode_manual",
        "bm_add",
        "bm_dest_alpha",
        "bm_dest_color",
        "bm_dest_colour",
        "bm_inv_dest_alpha",
        "bm_inv_dest_color",
        "bm_inv_dest_colour",
        "bm_inv_src_alpha",
        "bm_inv_src_color",
        "bm_inv_src_colour",
        "bm_max",
        "bm_normal",
        "bm_one",
        "bm_src_alpha",
        "bm_src_alpha_sat",
        "bm_src_color",
        "bm_src_colour",
        "bm_subtract",
        "bm_zero",
        "browser_chrome",
        "browser_edge",
        "browser_firefox",
        "browser_ie",
        "browser_ie_mobile",
        "browser_not_a_browser",
        "browser_opera",
        "browser_safari",
        "browser_safari_mobile",
        "browser_tizen",
        "browser_unknown",
        "browser_windows_store",
        "buffer_bool",
        "buffer_f16",
        "buffer_f32",
        "buffer_f64",
        "buffer_fast",
        "buffer_fixed",
        "buffer_grow",
        "buffer_s16",
        "buffer_s32",
        "buffer_s8",
        "buffer_seek_end",
        "buffer_seek_relative",
        "buffer_seek_start",
        "buffer_string",
        "buffer_text",
        "buffer_u16",
        "buffer_u32",
        "buffer_u64",
        "buffer_u8",
        "buffer_vbuffer",
        "buffer_wrap",
        "c_aqua",
        "c_black",
        "c_blue",
        "c_dkgray",
        "c_dkgrey",
        "c_fuchsia",
        "c_gray",
        "c_green",
        "c_grey",
        "c_lime",
        "c_ltgray",
        "c_ltgrey",
        "c_maroon",
        "c_navy",
        "c_olive",
        "c_orange",
        "c_purple",
        "c_red",
        "c_silver",
        "c_teal",
        "c_white",
        "c_yellow",
        "cache_directory",
        "characterSpacing",
        "cmpfunc_always",
        "cmpfunc_equal",
        "cmpfunc_greater",
        "cmpfunc_greaterequal",
        "cmpfunc_less",
        "cmpfunc_lessequal",
        "cmpfunc_never",
        "cmpfunc_notequal",
        "coreColor",
        "coreColour",
        "cr_appstart",
        "cr_arrow",
        "cr_beam",
        "cr_cross",
        "cr_default",
        "cr_drag",
        "cr_handpoint",
        "cr_hourglass",
        "cr_none",
        "cr_size_all",
        "cr_size_nesw",
        "cr_size_ns",
        "cr_size_nwse",
        "cr_size_we",
        "cr_uparrow",
        "cull_clockwise",
        "cull_counterclockwise",
        "cull_noculling",
        "device_emulator",
        "device_ios_ipad",
        "device_ios_ipad_retina",
        "device_ios_iphone",
        "device_ios_iphone5",
        "device_ios_iphone6",
        "device_ios_iphone6plus",
        "device_ios_iphone_retina",
        "device_ios_unknown",
        "device_tablet",
        "display_landscape",
        "display_landscape_flipped",
        "display_portrait",
        "display_portrait_flipped",
        "dll_cdecl",
        "dll_stdcall",
        "dropShadowEnabled",
        "dropShadowEnabled",
        "ds_type_grid",
        "ds_type_list",
        "ds_type_map",
        "ds_type_priority",
        "ds_type_queue",
        "ds_type_stack",
        "ef_cloud",
        "ef_ellipse",
        "ef_explosion",
        "ef_firework",
        "ef_flare",
        "ef_rain",
        "ef_ring",
        "ef_smoke",
        "ef_smokeup",
        "ef_snow",
        "ef_spark",
        "ef_star",
        "effectsEnabled",
        "effectsEnabled",
        "ev_alarm",
        "ev_animation_end",
        "ev_animation_event",
        "ev_animation_update",
        "ev_async_audio_playback",
        "ev_async_audio_playback_ended",
        "ev_async_audio_recording",
        "ev_async_dialog",
        "ev_async_push_notification",
        "ev_async_save_load",
        "ev_async_save_load",
        "ev_async_social",
        "ev_async_system_event",
        "ev_async_web",
        "ev_async_web_cloud",
        "ev_async_web_iap",
        "ev_async_web_image_load",
        "ev_async_web_networking",
        "ev_async_web_steam",
        "ev_audio_playback",
        "ev_audio_playback_ended",
        "ev_audio_recording",
        "ev_boundary",
        "ev_boundary_view0",
        "ev_boundary_view1",
        "ev_boundary_view2",
        "ev_boundary_view3",
        "ev_boundary_view4",
        "ev_boundary_view5",
        "ev_boundary_view6",
        "ev_boundary_view7",
        "ev_broadcast_message",
        "ev_cleanup",
        "ev_collision",
        "ev_create",
        "ev_destroy",
        "ev_dialog_async",
        "ev_draw",
        "ev_draw_begin",
        "ev_draw_end",
        "ev_draw_normal",
        "ev_draw_post",
        "ev_draw_pre",
        "ev_end_of_path",
        "ev_game_end",
        "ev_game_start",
        "ev_gesture",
        "ev_gesture_double_tap",
        "ev_gesture_drag_end",
        "ev_gesture_drag_start",
        "ev_gesture_dragging",
        "ev_gesture_flick",
        "ev_gesture_pinch_end",
        "ev_gesture_pinch_in",
        "ev_gesture_pinch_out",
        "ev_gesture_pinch_start",
        "ev_gesture_rotate_end",
        "ev_gesture_rotate_start",
        "ev_gesture_rotating",
        "ev_gesture_tap",
        "ev_global_gesture_double_tap",
        "ev_global_gesture_drag_end",
        "ev_global_gesture_drag_start",
        "ev_global_gesture_dragging",
        "ev_global_gesture_flick",
        "ev_global_gesture_pinch_end",
        "ev_global_gesture_pinch_in",
        "ev_global_gesture_pinch_out",
        "ev_global_gesture_pinch_start",
        "ev_global_gesture_rotate_end",
        "ev_global_gesture_rotate_start",
        "ev_global_gesture_rotating",
        "ev_global_gesture_tap",
        "ev_global_left_button",
        "ev_global_left_press",
        "ev_global_left_release",
        "ev_global_middle_button",
        "ev_global_middle_press",
        "ev_global_middle_release",
        "ev_global_right_button",
        "ev_global_right_press",
        "ev_global_right_release",
        "ev_gui",
        "ev_gui_begin",
        "ev_gui_end",
        "ev_joystick1_button1",
        "ev_joystick1_button2",
        "ev_joystick1_button3",
        "ev_joystick1_button4",
        "ev_joystick1_button5",
        "ev_joystick1_button6",
        "ev_joystick1_button7",
        "ev_joystick1_button8",
        "ev_joystick1_down",
        "ev_joystick1_left",
        "ev_joystick1_right",
        "ev_joystick1_up",
        "ev_joystick2_button1",
        "ev_joystick2_button2",
        "ev_joystick2_button3",
        "ev_joystick2_button4",
        "ev_joystick2_button5",
        "ev_joystick2_button6",
        "ev_joystick2_button7",
        "ev_joystick2_button8",
        "ev_joystick2_down",
        "ev_joystick2_left",
        "ev_joystick2_right",
        "ev_joystick2_up",
        "ev_keyboard",
        "ev_keypress",
        "ev_keyrelease",
        "ev_left_button",
        "ev_left_press",
        "ev_left_release",
        "ev_middle_button",
        "ev_middle_press",
        "ev_middle_release",
        "ev_mouse",
        "ev_mouse_enter",
        "ev_mouse_leave",
        "ev_mouse_wheel_down",
        "ev_mouse_wheel_up",
        "ev_no_button",
        "ev_no_more_health",
        "ev_no_more_lives",
        "ev_other",
        "ev_outside",
        "ev_outside_view0",
        "ev_outside_view1",
        "ev_outside_view2",
        "ev_outside_view3",
        "ev_outside_view4",
        "ev_outside_view5",
        "ev_outside_view6",
        "ev_outside_view7",
        "ev_pre_create",
        "ev_push_notification",
        "ev_right_button",
        "ev_right_press",
        "ev_right_release",
        "ev_room_end",
        "ev_room_start",
        "ev_social",
        "ev_step",
        "ev_step_begin",
        "ev_step_end",
        "ev_step_normal",
        "ev_system_event",
        "ev_trigger",
        "ev_user0",
        "ev_user1",
        "ev_user10",
        "ev_user11",
        "ev_user12",
        "ev_user13",
        "ev_user14",
        "ev_user15",
        "ev_user2",
        "ev_user3",
        "ev_user4",
        "ev_user5",
        "ev_user6",
        "ev_user7",
        "ev_user8",
        "ev_user9",
        "ev_web_async",
        "ev_web_cloud",
        "ev_web_iap",
        "ev_web_image_load",
        "ev_web_networking",
        "ev_web_sound_load",
        "ev_web_steam",
        "fa_archive",
        "fa_bottom",
        "fa_center",
        "fa_directory",
        "fa_hidden",
        "fa_left",
        "fa_middle",
        "fa_none",
        "fa_readonly",
        "fa_right",
        "fa_sysfile",
        "fa_top",
        "fa_volumeid",
        "false",
        "frameSizeX",
        "frameSizeY",
        "gamespeed_fps",
        "gamespeed_microseconds",
        "global",
        "glowColor",
        "glowColour",
        "glowEnabled",
        "glowEnabled",
        "glowEnd",
        "glowStart",
        "gp_axis_acceleration_x",
        "gp_axis_acceleration_y",
        "gp_axis_acceleration_z",
        "gp_axis_angular_velocity_x",
        "gp_axis_angular_velocity_y",
        "gp_axis_angular_velocity_z",
        "gp_axis_orientation_w",
        "gp_axis_orientation_x",
        "gp_axis_orientation_y",
        "gp_axis_orientation_z",
        "gp_axislh",
        "gp_axislv",
        "gp_axisrh",
        "gp_axisrv",
        "gp_face1",
        "gp_face2",
        "gp_face3",
        "gp_face4",
        "gp_padd",
        "gp_padl",
        "gp_padr",
        "gp_padu",
        "gp_select",
        "gp_shoulderl",
        "gp_shoulderlb",
        "gp_shoulderr",
        "gp_shoulderrb",
        "gp_start",
        "gp_stickl",
        "gp_stickr",
        "iap_available",
        "iap_canceled",
        "iap_ev_consume",
        "iap_ev_product",
        "iap_ev_purchase",
        "iap_ev_restore",
        "iap_ev_storeload",
        "iap_failed",
        "iap_purchased",
        "iap_refunded",
        "iap_status_available",
        "iap_status_loading",
        "iap_status_processing",
        "iap_status_restoring",
        "iap_status_unavailable",
        "iap_status_uninitialised",
        "iap_storeload_failed",
        "iap_storeload_ok",
        "iap_unavailable",
        "infinity",
        "kbv_autocapitalize_characters",
        "kbv_autocapitalize_none",
        "kbv_autocapitalize_sentences",
        "kbv_autocapitalize_words",
        "kbv_returnkey_continue",
        "kbv_returnkey_default",
        "kbv_returnkey_done",
        "kbv_returnkey_emergency",
        "kbv_returnkey_go",
        "kbv_returnkey_google",
        "kbv_returnkey_join",
        "kbv_returnkey_next",
        "kbv_returnkey_route",
        "kbv_returnkey_search",
        "kbv_returnkey_send",
        "kbv_returnkey_yahoo",
        "kbv_type_ascii",
        "kbv_type_default",
        "kbv_type_email",
        "kbv_type_numbers",
        "kbv_type_phone",
        "kbv_type_phone_name",
        "kbv_type_url",
        "layerelementtype_background",
        "layerelementtype_instance",
        "layerelementtype_oldtilemap",
        "layerelementtype_particlesystem",
        "layerelementtype_sequence",
        "layerelementtype_sprite",
        "layerelementtype_tile",
        "layerelementtype_tilemap",
        "layerelementtype_undefined",
        "leaderboard_type_number",
        "leaderboard_type_time_mins_secs",
        "lighttype_dir",
        "lighttype_point",
        "lineSpacing",
        "m_axisx",
        "m_axisx_gui",
        "m_axisy",
        "m_axisy_gui",
        "m_scroll_down",
        "m_scroll_up",
        "matrix_projection",
        "matrix_view",
        "matrix_world",
        "mb_any",
        "mb_left",
        "mb_middle",
        "mb_none",
        "mb_right",
        "mb_side1",
        "mb_side2",
        "mip_markedonly",
        "mip_off",
        "mip_on",
        "network_config_avoid_time_wait",
        "network_config_connect_timeout",
        "network_config_disable_multicast",
        "network_config_disable_reliable_udp",
        "network_config_enable_multicast",
        "network_config_enable_reliable_udp",
        "network_config_use_non_blocking_socket",
        "network_config_websocket_protocol",
        "network_connect_active",
        "network_connect_blocking",
        "network_connect_nonblocking",
        "network_connect_none",
        "network_connect_passive",
        "network_send_binary",
        "network_send_text",
        "network_socket_bluetooth",
        "network_socket_tcp",
        "network_socket_udp",
        "network_socket_ws",
        "network_socket_wss",
        "network_type_connect",
        "network_type_data",
        "network_type_disconnect",
        "network_type_down",
        "network_type_non_blocking_connect",
        "network_type_up",
        "network_type_up_failed",
        "nineslice_blank",
        "nineslice_bottom",
        "nineslice_center",
        "nineslice_centre",
        "nineslice_hide",
        "nineslice_left",
        "nineslice_mirror",
        "nineslice_repeat",
        "nineslice_right",
        "nineslice_stretch",
        "nineslice_top",
        "noone",
        "of_challenge_lose",
        "of_challenge_tie",
        "of_challenge_win",
        "os_android",
        "os_gdk",
        "os_gxgames",
        "os_ios",
        "os_linux",
        "os_macosx",
        "os_operagx",
        "os_permission_denied",
        "os_permission_denied_dont_request",
        "os_permission_granted",
        "os_ps3",
        "os_ps4",
        "os_ps5",
        "os_psvita",
        "os_switch",
        "os_tvos",
        "os_unknown",
        "os_uwp",
        "os_win8native",
        "os_windows",
        "os_winphone",
        "os_xboxone",
        "os_xboxseriesxs",
        "other",
        "outlineColor",
        "outlineColour",
        "outlineDist",
        "outlineEnabled",
        "outlineEnabled",
        "paragraphSpacing",
        "path_action_continue",
        "path_action_restart",
        "path_action_reverse",
        "path_action_stop",
        "phy_debug_render_aabb",
        "phy_debug_render_collision_pairs",
        "phy_debug_render_coms",
        "phy_debug_render_core_shapes",
        "phy_debug_render_joints",
        "phy_debug_render_obb",
        "phy_debug_render_shapes",
        "phy_joint_anchor_1_x",
        "phy_joint_anchor_1_y",
        "phy_joint_anchor_2_x",
        "phy_joint_anchor_2_y",
        "phy_joint_angle",
        "phy_joint_angle_limits",
        "phy_joint_damping_ratio",
        "phy_joint_frequency",
        "phy_joint_length_1",
        "phy_joint_length_2",
        "phy_joint_lower_angle_limit",
        "phy_joint_max_force",
        "phy_joint_max_length",
        "phy_joint_max_motor_force",
        "phy_joint_max_motor_torque",
        "phy_joint_max_torque",
        "phy_joint_motor_force",
        "phy_joint_motor_speed",
        "phy_joint_motor_torque",
        "phy_joint_reaction_force_x",
        "phy_joint_reaction_force_y",
        "phy_joint_reaction_torque",
        "phy_joint_speed",
        "phy_joint_translation",
        "phy_joint_upper_angle_limit",
        "phy_particle_data_flag_category",
        "phy_particle_data_flag_color",
        "phy_particle_data_flag_colour",
        "phy_particle_data_flag_position",
        "phy_particle_data_flag_typeflags",
        "phy_particle_data_flag_velocity",
        "phy_particle_flag_colormixing",
        "phy_particle_flag_colourmixing",
        "phy_particle_flag_elastic",
        "phy_particle_flag_powder",
        "phy_particle_flag_spring",
        "phy_particle_flag_tensile",
        "phy_particle_flag_viscous",
        "phy_particle_flag_wall",
        "phy_particle_flag_water",
        "phy_particle_flag_zombie",
        "phy_particle_group_flag_rigid",
        "phy_particle_group_flag_solid",
        "pi",
        "pointer_invalid",
        "pointer_null",
        "pr_linelist",
        "pr_linestrip",
        "pr_pointlist",
        "pr_trianglefan",
        "pr_trianglelist",
        "pr_trianglestrip",
        "ps_distr_gaussian",
        "ps_distr_invgaussian",
        "ps_distr_linear",
        "ps_mode_burst",
        "ps_mode_stream",
        "ps_shape_diamond",
        "ps_shape_ellipse",
        "ps_shape_line",
        "ps_shape_rectangle",
        "pt_shape_circle",
        "pt_shape_cloud",
        "pt_shape_disk",
        "pt_shape_explosion",
        "pt_shape_flare",
        "pt_shape_line",
        "pt_shape_pixel",
        "pt_shape_ring",
        "pt_shape_smoke",
        "pt_shape_snow",
        "pt_shape_spark",
        "pt_shape_sphere",
        "pt_shape_square",
        "pt_shape_star",
        "rollback_chat_message",
        "rollback_connect_error",
        "rollback_connect_info",
        "rollback_connected_to_peer",
        "rollback_connection_rejected",
        "rollback_disconnected_from_peer",
        "rollback_end_game",
        "rollback_game_full",
        "rollback_game_info",
        "rollback_game_interrupted",
        "rollback_game_resumed",
        "rollback_high_latency",
        "rollback_player_prefs",
        "rollback_protocol_rejected",
        "rollback_synchronized_with_peer",
        "rollback_synchronizing_with_peer",
        "self",
        "seqaudiokey_loop",
        "seqaudiokey_oneshot",
        "seqdir_left",
        "seqdir_right",
        "seqinterpolation_assign",
        "seqinterpolation_lerp",
        "seqplay_loop",
        "seqplay_oneshot",
        "seqplay_pingpong",
        "seqtextkey_bottom",
        "seqtextkey_center",
        "seqtextkey_justify",
        "seqtextkey_left",
        "seqtextkey_middle",
        "seqtextkey_right",
        "seqtextkey_top",
        "seqtracktype_audio",
        "seqtracktype_bool",
        "seqtracktype_clipmask",
        "seqtracktype_clipmask_mask",
        "seqtracktype_clipmask_subject",
        "seqtracktype_color",
        "seqtracktype_colour",
        "seqtracktype_empty",
        "seqtracktype_graphic",
        "seqtracktype_group",
        "seqtracktype_instance",
        "seqtracktype_message",
        "seqtracktype_moment",
        "seqtracktype_particlesystem",
        "seqtracktype_real",
        "seqtracktype_sequence",
        "seqtracktype_spriteframes",
        "seqtracktype_string",
        "seqtracktype_text",
        "shadowColor",
        "shadowColour",
        "shadowOffsetX",
        "shadowOffsetY",
        "shadowSoftness",
        "sprite_add_ext_error_cancelled",
        "sprite_add_ext_error_decompressfailed",
        "sprite_add_ext_error_loadfailed",
        "sprite_add_ext_error_setupfailed",
        "sprite_add_ext_error_spritenotfound",
        "sprite_add_ext_error_unknown",
        "spritespeed_framespergameframe",
        "spritespeed_framespersecond",
        "surface_r16float",
        "surface_r32float",
        "surface_r8unorm",
        "surface_rg8unorm",
        "surface_rgba16float",
        "surface_rgba32float",
        "surface_rgba4unorm",
        "surface_rgba8unorm",
        "texturegroup_status_fetched",
        "texturegroup_status_loaded",
        "texturegroup_status_loading",
        "texturegroup_status_unloaded",
        "tf_anisotropic",
        "tf_linear",
        "tf_point",
        "thickness",
        "tile_flip",
        "tile_index_mask",
        "tile_mirror",
        "tile_rotate",
        "time_source_expire_after",
        "time_source_expire_nearest",
        "time_source_game",
        "time_source_global",
        "time_source_state_active",
        "time_source_state_initial",
        "time_source_state_paused",
        "time_source_state_stopped",
        "time_source_units_frames",
        "time_source_units_seconds",
        "timezone_local",
        "timezone_utc",
        "tm_countvsyncs",
        "tm_sleep",
        "tm_systemtiming",
        "true",
        "ty_real",
        "ty_string",
        "undefined",
        "vertex_type_color",
        "vertex_type_colour",
        "vertex_type_float1",
        "vertex_type_float2",
        "vertex_type_float3",
        "vertex_type_float4",
        "vertex_type_ubyte4",
        "vertex_usage_binormal",
        "vertex_usage_blendindices",
        "vertex_usage_blendweight",
        "vertex_usage_color",
        "vertex_usage_colour",
        "vertex_usage_depth",
        "vertex_usage_fog",
        "vertex_usage_normal",
        "vertex_usage_position",
        "vertex_usage_psize",
        "vertex_usage_sample",
        "vertex_usage_tangent",
        "vertex_usage_texcoord",
        "video_format_rgba",
        "video_format_yuv",
        "video_status_closed",
        "video_status_paused",
        "video_status_playing",
        "video_status_preparing",
        "vk_add",
        "vk_alt",
        "vk_anykey",
        "vk_backspace",
        "vk_control",
        "vk_decimal",
        "vk_delete",
        "vk_divide",
        "vk_down",
        "vk_end",
        "vk_enter",
        "vk_escape",
        "vk_f1",
        "vk_f10",
        "vk_f11",
        "vk_f12",
        "vk_f2",
        "vk_f3",
        "vk_f4",
        "vk_f5",
        "vk_f6",
        "vk_f7",
        "vk_f8",
        "vk_f9",
        "vk_home",
        "vk_insert",
        "vk_lalt",
        "vk_lcontrol",
        "vk_left",
        "vk_lshift",
        "vk_multiply",
        "vk_nokey",
        "vk_numpad0",
        "vk_numpad1",
        "vk_numpad2",
        "vk_numpad3",
        "vk_numpad4",
        "vk_numpad5",
        "vk_numpad6",
        "vk_numpad7",
        "vk_numpad8",
        "vk_numpad9",
        "vk_pagedown",
        "vk_pageup",
        "vk_pause",
        "vk_printscreen",
        "vk_ralt",
        "vk_rcontrol",
        "vk_return",
        "vk_right",
        "vk_rshift",
        "vk_shift",
        "vk_space",
        "vk_subtract",
        "vk_tab",
        "vk_up",
        "wallpaper_config",
        "wallpaper_subscription_data",
        "wrap"
      ],
      "variable.language": [
        "alarm",
        "application_surface",
        "argument",
        "argument0",
        "argument1",
        "argument2",
        "argument3",
        "argument4",
        "argument5",
        "argument6",
        "argument7",
        "argument8",
        "argument9",
        "argument10",
        "argument11",
        "argument12",
        "argument13",
        "argument14",
        "argument15",
        "argument_count",
        "async_load",
        "background_color",
        "background_colour",
        "background_showcolor",
        "background_showcolour",
        "bbox_bottom",
        "bbox_left",
        "bbox_right",
        "bbox_top",
        "browser_height",
        "browser_width",
        "colour?ColourTrack",
        "current_day",
        "current_hour",
        "current_minute",
        "current_month",
        "current_second",
        "current_time",
        "current_weekday",
        "current_year",
        "cursor_sprite",
        "debug_mode",
        "delta_time",
        "depth",
        "direction",
        "display_aa",
        "drawn_by_sequence",
        "event_action",
        "event_data",
        "event_number",
        "event_object",
        "event_type",
        "font_texture_page_size",
        "fps",
        "fps_real",
        "friction",
        "game_display_name",
        "game_id",
        "game_project_name",
        "game_save_id",
        "gravity",
        "gravity_direction",
        "health",
        "hspeed",
        "iap_data",
        "id",
        "image_alpha",
        "image_angle",
        "image_blend",
        "image_index",
        "image_number",
        "image_speed",
        "image_xscale",
        "image_yscale",
        "in_collision_tree",
        "in_sequence",
        "instance_count",
        "instance_id",
        "keyboard_key",
        "keyboard_lastchar",
        "keyboard_lastkey",
        "keyboard_string",
        "layer",
        "lives",
        "longMessage",
        "managed",
        "mask_index",
        "message",
        "mouse_button",
        "mouse_lastbutton",
        "mouse_x",
        "mouse_y",
        "object_index",
        "os_browser",
        "os_device",
        "os_type",
        "os_version",
        "path_endaction",
        "path_index",
        "path_orientation",
        "path_position",
        "path_positionprevious",
        "path_scale",
        "path_speed",
        "persistent",
        "phy_active",
        "phy_angular_damping",
        "phy_angular_velocity",
        "phy_bullet",
        "phy_col_normal_x",
        "phy_col_normal_y",
        "phy_collision_points",
        "phy_collision_x",
        "phy_collision_y",
        "phy_com_x",
        "phy_com_y",
        "phy_dynamic",
        "phy_fixed_rotation",
        "phy_inertia",
        "phy_kinematic",
        "phy_linear_damping",
        "phy_linear_velocity_x",
        "phy_linear_velocity_y",
        "phy_mass",
        "phy_position_x",
        "phy_position_xprevious",
        "phy_position_y",
        "phy_position_yprevious",
        "phy_rotation",
        "phy_sleeping",
        "phy_speed",
        "phy_speed_x",
        "phy_speed_y",
        "player_avatar_sprite",
        "player_avatar_url",
        "player_id",
        "player_local",
        "player_type",
        "player_user_id",
        "program_directory",
        "rollback_api_server",
        "rollback_confirmed_frame",
        "rollback_current_frame",
        "rollback_event_id",
        "rollback_event_param",
        "rollback_game_running",
        "room",
        "room_first",
        "room_height",
        "room_last",
        "room_persistent",
        "room_speed",
        "room_width",
        "score",
        "script",
        "sequence_instance",
        "solid",
        "speed",
        "sprite_height",
        "sprite_index",
        "sprite_width",
        "sprite_xoffset",
        "sprite_yoffset",
        "stacktrace",
        "temp_directory",
        "timeline_index",
        "timeline_loop",
        "timeline_position",
        "timeline_running",
        "timeline_speed",
        "view_camera",
        "view_current",
        "view_enabled",
        "view_hport",
        "view_surface_id",
        "view_visible",
        "view_wport",
        "view_xport",
        "view_yport",
        "visible",
        "vspeed",
        "webgl_enabled",
        "working_directory",
        "x",
        "xprevious",
        "xstart",
        "y",
        "yprevious",
        "ystart"
      ]
    },
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      t.C_NUMBER_MODE
    ]
  };
}
function Ax(t) {
  return {
    name: "Golo",
    keywords: {
      keyword: [
        "println",
        "readln",
        "print",
        "import",
        "module",
        "function",
        "local",
        "return",
        "let",
        "var",
        "while",
        "for",
        "foreach",
        "times",
        "in",
        "case",
        "when",
        "match",
        "with",
        "break",
        "continue",
        "augment",
        "augmentation",
        "each",
        "find",
        "filter",
        "reduce",
        "if",
        "then",
        "else",
        "otherwise",
        "try",
        "catch",
        "finally",
        "raise",
        "throw",
        "orIfNull",
        "DynamicObject|10",
        "DynamicVariable",
        "struct",
        "Observable",
        "map",
        "set",
        "vector",
        "list",
        "array"
      ],
      literal: [
        "true",
        "false",
        "null"
      ]
    },
    contains: [
      t.HASH_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      t.C_NUMBER_MODE,
      {
        className: "meta",
        begin: "@[A-Za-z]+"
      }
    ]
  };
}
function Ix(t) {
  return {
    name: "Gradle",
    case_insensitive: !0,
    keywords: [
      "task",
      "project",
      "allprojects",
      "subprojects",
      "artifacts",
      "buildscript",
      "configurations",
      "dependencies",
      "repositories",
      "sourceSets",
      "description",
      "delete",
      "from",
      "into",
      "include",
      "exclude",
      "source",
      "classpath",
      "destinationDir",
      "includes",
      "options",
      "sourceCompatibility",
      "targetCompatibility",
      "group",
      "flatDir",
      "doLast",
      "doFirst",
      "flatten",
      "todir",
      "fromdir",
      "ant",
      "def",
      "abstract",
      "break",
      "case",
      "catch",
      "continue",
      "default",
      "do",
      "else",
      "extends",
      "final",
      "finally",
      "for",
      "if",
      "implements",
      "instanceof",
      "native",
      "new",
      "private",
      "protected",
      "public",
      "return",
      "static",
      "switch",
      "synchronized",
      "throw",
      "throws",
      "transient",
      "try",
      "volatile",
      "while",
      "strictfp",
      "package",
      "import",
      "false",
      "null",
      "super",
      "this",
      "true",
      "antlrtask",
      "checkstyle",
      "codenarc",
      "copy",
      "boolean",
      "byte",
      "char",
      "class",
      "double",
      "float",
      "int",
      "interface",
      "long",
      "short",
      "void",
      "compile",
      "runTime",
      "file",
      "fileTree",
      "abs",
      "any",
      "append",
      "asList",
      "asWritable",
      "call",
      "collect",
      "compareTo",
      "count",
      "div",
      "dump",
      "each",
      "eachByte",
      "eachFile",
      "eachLine",
      "every",
      "find",
      "findAll",
      "flatten",
      "getAt",
      "getErr",
      "getIn",
      "getOut",
      "getText",
      "grep",
      "immutable",
      "inject",
      "inspect",
      "intersect",
      "invokeMethods",
      "isCase",
      "join",
      "leftShift",
      "minus",
      "multiply",
      "newInputStream",
      "newOutputStream",
      "newPrintWriter",
      "newReader",
      "newWriter",
      "next",
      "plus",
      "pop",
      "power",
      "previous",
      "print",
      "println",
      "push",
      "putAt",
      "read",
      "readBytes",
      "readLines",
      "reverse",
      "reverseEach",
      "round",
      "size",
      "sort",
      "splitEachLine",
      "step",
      "subMap",
      "times",
      "toInteger",
      "toList",
      "tokenize",
      "upto",
      "waitForOrKill",
      "withPrintWriter",
      "withReader",
      "withStream",
      "withWriter",
      "withWriterAppend",
      "write",
      "writeLine"
    ],
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      t.NUMBER_MODE,
      t.REGEXP_MODE
    ]
  };
}
function xl(t, e = {}) {
  return e.variants = t, e;
}
function xx(t) {
  const e = t.regex, n = "[A-Za-z0-9_$]+", r = xl([
    t.C_LINE_COMMENT_MODE,
    t.C_BLOCK_COMMENT_MODE,
    t.COMMENT(
      "/\\*\\*",
      "\\*/",
      {
        relevance: 0,
        contains: [
          {
            // eat up @'s in emails to prevent them to be recognized as doctags
            begin: /\w+@/,
            relevance: 0
          },
          {
            className: "doctag",
            begin: "@[A-Za-z]+"
          }
        ]
      }
    )
  ]), i = {
    className: "regexp",
    begin: /~?\/[^\/\n]+\//,
    contains: [t.BACKSLASH_ESCAPE]
  }, o = xl([
    t.BINARY_NUMBER_MODE,
    t.C_NUMBER_MODE
  ]), a = xl(
    [
      {
        begin: /"""/,
        end: /"""/
      },
      {
        begin: /'''/,
        end: /'''/
      },
      {
        begin: "\\$/",
        end: "/\\$",
        relevance: 10
      },
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE
    ],
    { className: "string" }
  ), s = {
    match: [
      /(class|interface|trait|enum|record|extends|implements)/,
      /\s+/,
      t.UNDERSCORE_IDENT_RE
    ],
    scope: {
      1: "keyword",
      3: "title.class"
    }
  };
  return {
    name: "Groovy",
    keywords: {
      "variable.language": "this super",
      literal: "true false null",
      type: [
        "byte",
        "short",
        "char",
        "int",
        "long",
        "boolean",
        "float",
        "double",
        "void"
      ],
      keyword: [
        // groovy specific keywords
        "def",
        "as",
        "in",
        "assert",
        "trait",
        // common keywords with Java
        "abstract",
        "static",
        "volatile",
        "transient",
        "public",
        "private",
        "protected",
        "synchronized",
        "final",
        "class",
        "interface",
        "enum",
        "if",
        "else",
        "for",
        "while",
        "switch",
        "case",
        "break",
        "default",
        "continue",
        "throw",
        "throws",
        "try",
        "catch",
        "finally",
        "implements",
        "extends",
        "new",
        "import",
        "package",
        "return",
        "instanceof",
        "var"
      ]
    },
    contains: [
      t.SHEBANG({
        binary: "groovy",
        relevance: 10
      }),
      r,
      a,
      i,
      o,
      s,
      {
        className: "meta",
        begin: "@[A-Za-z]+",
        relevance: 0
      },
      {
        // highlight map keys and named parameters as attrs
        className: "attr",
        begin: n + "[ 	]*:",
        relevance: 0
      },
      {
        // catch middle element of the ternary operator
        // to avoid highlight it as a label, named parameter, or map key
        begin: /\?/,
        end: /:/,
        relevance: 0,
        contains: [
          r,
          a,
          i,
          o,
          "self"
        ]
      },
      {
        // highlight labeled statements
        className: "symbol",
        begin: "^[ 	]*" + e.lookahead(n + ":"),
        excludeBegin: !0,
        end: n + ":",
        relevance: 0
      }
    ],
    illegal: /#|<\//
  };
}
function Dx(t) {
  return {
    name: "HAML",
    case_insensitive: !0,
    contains: [
      {
        className: "meta",
        begin: "^!!!( (5|1\\.1|Strict|Frameset|Basic|Mobile|RDFa|XML\\b.*))?$",
        relevance: 10
      },
      // FIXME these comments should be allowed to span indented lines
      t.COMMENT(
        "^\\s*(!=#|=#|-#|/).*$",
        null,
        { relevance: 0 }
      ),
      {
        begin: "^\\s*(-|=|!=)(?!#)",
        end: /$/,
        subLanguage: "ruby",
        excludeBegin: !0,
        excludeEnd: !0
      },
      {
        className: "tag",
        begin: "^\\s*%",
        contains: [
          {
            className: "selector-tag",
            begin: "\\w+"
          },
          {
            className: "selector-id",
            begin: "#[\\w-]+"
          },
          {
            className: "selector-class",
            begin: "\\.[\\w-]+"
          },
          {
            begin: /\{\s*/,
            end: /\s*\}/,
            contains: [
              {
                begin: ":\\w+\\s*=>",
                end: ",\\s+",
                returnBegin: !0,
                endsWithParent: !0,
                contains: [
                  {
                    className: "attr",
                    begin: ":\\w+"
                  },
                  t.APOS_STRING_MODE,
                  t.QUOTE_STRING_MODE,
                  {
                    begin: "\\w+",
                    relevance: 0
                  }
                ]
              }
            ]
          },
          {
            begin: "\\(\\s*",
            end: "\\s*\\)",
            excludeEnd: !0,
            contains: [
              {
                begin: "\\w+\\s*=",
                end: "\\s+",
                returnBegin: !0,
                endsWithParent: !0,
                contains: [
                  {
                    className: "attr",
                    begin: "\\w+",
                    relevance: 0
                  },
                  t.APOS_STRING_MODE,
                  t.QUOTE_STRING_MODE,
                  {
                    begin: "\\w+",
                    relevance: 0
                  }
                ]
              }
            ]
          }
        ]
      },
      { begin: "^\\s*[=~]\\s*" },
      {
        begin: /#\{/,
        end: /\}/,
        subLanguage: "ruby",
        excludeBegin: !0,
        excludeEnd: !0
      }
    ]
  };
}
function wx(t) {
  const e = t.regex, n = {
    $pattern: /[\w.\/]+/,
    built_in: [
      "action",
      "bindattr",
      "collection",
      "component",
      "concat",
      "debugger",
      "each",
      "each-in",
      "get",
      "hash",
      "if",
      "in",
      "input",
      "link-to",
      "loc",
      "log",
      "lookup",
      "mut",
      "outlet",
      "partial",
      "query-params",
      "render",
      "template",
      "textarea",
      "unbound",
      "unless",
      "view",
      "with",
      "yield"
    ]
  }, r = {
    $pattern: /[\w.\/]+/,
    literal: [
      "true",
      "false",
      "undefined",
      "null"
    ]
  }, i = /""|"[^"]+"/, o = /''|'[^']+'/, a = /\[\]|\[[^\]]+\]/, s = /[^\s!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]+/, l = /(\.|\/)/, c = e.either(
    i,
    o,
    a,
    s
  ), u = e.concat(
    e.optional(/\.|\.\/|\//),
    // relative or absolute path
    c,
    e.anyNumberOfTimes(e.concat(
      l,
      c
    ))
  ), d = e.concat(
    "(",
    a,
    "|",
    s,
    ")(?==)"
  ), p = { begin: u }, _ = t.inherit(p, { keywords: r }), m = {
    begin: /\(/,
    end: /\)/
    // the "contains" is added below when all necessary sub-modes are defined
  }, f = {
    // fka "attribute-assignment", parameters of the form 'key=value'
    className: "attr",
    begin: d,
    relevance: 0,
    starts: {
      begin: /=/,
      end: /=/,
      starts: { contains: [
        t.NUMBER_MODE,
        t.QUOTE_STRING_MODE,
        t.APOS_STRING_MODE,
        _,
        m
      ] }
    }
  }, g = {
    // parameters of the form '{{#with x as | y |}}...{{/with}}'
    begin: /as\s+\|/,
    keywords: { keyword: "as" },
    end: /\|/,
    contains: [
      {
        // define sub-mode in order to prevent highlighting of block-parameter named "as"
        begin: /\w+/
      }
    ]
  }, S = {
    contains: [
      t.NUMBER_MODE,
      t.QUOTE_STRING_MODE,
      t.APOS_STRING_MODE,
      g,
      f,
      _,
      m
    ],
    returnEnd: !0
    // the property "end" is defined through inheritance when the mode is used. If depends
    // on the surrounding mode, but "endsWithParent" does not work here (i.e. it includes the
    // end-token of the surrounding mode)
  }, E = t.inherit(p, {
    className: "name",
    keywords: n,
    starts: t.inherit(S, { end: /\)/ })
  });
  m.contains = [E];
  const b = t.inherit(p, {
    keywords: n,
    className: "name",
    starts: t.inherit(S, { end: /\}\}/ })
  }), h = t.inherit(p, {
    keywords: n,
    className: "name"
  }), T = t.inherit(p, {
    className: "name",
    keywords: n,
    starts: t.inherit(S, { end: /\}\}/ })
  });
  return {
    name: "Handlebars",
    aliases: [
      "hbs",
      "html.hbs",
      "html.handlebars",
      "htmlbars"
    ],
    case_insensitive: !0,
    subLanguage: "xml",
    contains: [
      {
        begin: /\\\{\{/,
        skip: !0
      },
      {
        begin: /\\\\(?=\{\{)/,
        skip: !0
      },
      t.COMMENT(/\{\{!--/, /--\}\}/),
      t.COMMENT(/\{\{!/, /\}\}/),
      {
        // open raw block "{{{{raw}}}} content not evaluated {{{{/raw}}}}"
        className: "template-tag",
        begin: /\{\{\{\{(?!\/)/,
        end: /\}\}\}\}/,
        contains: [b],
        starts: {
          end: /\{\{\{\{\//,
          returnEnd: !0,
          subLanguage: "xml"
        }
      },
      {
        // close raw block
        className: "template-tag",
        begin: /\{\{\{\{\//,
        end: /\}\}\}\}/,
        contains: [h]
      },
      {
        // open block statement
        className: "template-tag",
        begin: /\{\{#/,
        end: /\}\}/,
        contains: [b]
      },
      {
        className: "template-tag",
        begin: /\{\{(?=else\}\})/,
        end: /\}\}/,
        keywords: "else"
      },
      {
        className: "template-tag",
        begin: /\{\{(?=else if)/,
        end: /\}\}/,
        keywords: "else if"
      },
      {
        // closing block statement
        className: "template-tag",
        begin: /\{\{\//,
        end: /\}\}/,
        contains: [h]
      },
      {
        // template variable or helper-call that is NOT html-escaped
        className: "template-variable",
        begin: /\{\{\{/,
        end: /\}\}\}/,
        contains: [T]
      },
      {
        // template variable or helper-call that is html-escaped
        className: "template-variable",
        begin: /\{\{/,
        end: /\}\}/,
        contains: [T]
      }
    ]
  };
}
function Mx(t) {
  const e = "([0-9]_*)+", n = "([0-9a-fA-F]_*)+", r = "([01]_*)+", i = "([0-7]_*)+", l = "([!#$%&*+.\\/<=>?@\\\\^~-]|(?!([(),;\\[\\]`|{}]|[_:\"']))(\\p{S}|\\p{P}))", c = { variants: [
    // Double dash forms a valid comment only if it's not part of legal lexeme.
    // See: Haskell 98 report: https://www.haskell.org/onlinereport/lexemes.html
    //
    // The commented code does the job, but we can't use negative lookbehind,
    // due to poor support by Safari browser.
    // > hljs.COMMENT(`(?<!${symbol})--+(?!${symbol})`, '$'),
    // So instead, we'll add a no-markup rule before the COMMENT rule in the rules list
    // to match the problematic infix operators that contain double dash.
    t.COMMENT("--+", "$"),
    t.COMMENT(
      /\{-/,
      /-\}/,
      { contains: ["self"] }
    )
  ] }, u = {
    className: "meta",
    begin: /\{-#/,
    end: /#-\}/
  }, d = {
    className: "meta",
    begin: "^#",
    end: "$"
  }, p = {
    className: "type",
    begin: "\\b[A-Z][\\w']*",
    // TODO: other constructors (build-in, infix).
    relevance: 0
  }, _ = {
    begin: "\\(",
    end: "\\)",
    illegal: '"',
    contains: [
      u,
      d,
      {
        className: "type",
        begin: "\\b[A-Z][\\w]*(\\((\\.\\.|,|\\w+)\\))?"
      },
      t.inherit(t.TITLE_MODE, { begin: "[_a-z][\\w']*" }),
      c
    ]
  }, m = {
    begin: /\{/,
    end: /\}/,
    contains: _.contains
  }, f = {
    className: "number",
    relevance: 0,
    variants: [
      // decimal floating-point-literal (subsumes decimal-literal)
      { match: `\\b(${e})(\\.(${e}))?([eE][+-]?(${e}))?\\b` },
      // hexadecimal floating-point-literal (subsumes hexadecimal-literal)
      { match: `\\b0[xX]_*(${n})(\\.(${n}))?([pP][+-]?(${e}))?\\b` },
      // octal-literal
      { match: `\\b0[oO](${i})\\b` },
      // binary-literal
      { match: `\\b0[bB](${r})\\b` }
    ]
  };
  return {
    name: "Haskell",
    aliases: ["hs"],
    keywords: "let in if then else case of where do module import hiding qualified type data newtype deriving class instance as default infix infixl infixr foreign export ccall stdcall cplusplus jvm dotnet safe unsafe family forall mdo proc rec",
    unicodeRegex: !0,
    contains: [
      // Top-level constructions.
      {
        beginKeywords: "module",
        end: "where",
        keywords: "module where",
        contains: [
          _,
          c
        ],
        illegal: "\\W\\.|;"
      },
      {
        begin: "\\bimport\\b",
        end: "$",
        keywords: "import qualified as hiding",
        contains: [
          _,
          c
        ],
        illegal: "\\W\\.|;"
      },
      {
        className: "class",
        begin: "^(\\s*)?(class|instance)\\b",
        end: "where",
        keywords: "class family instance where",
        contains: [
          p,
          _,
          c
        ]
      },
      {
        className: "class",
        begin: "\\b(data|(new)?type)\\b",
        end: "$",
        keywords: "data family type newtype deriving",
        contains: [
          u,
          p,
          _,
          m,
          c
        ]
      },
      {
        beginKeywords: "default",
        end: "$",
        contains: [
          p,
          _,
          c
        ]
      },
      {
        beginKeywords: "infix infixl infixr",
        end: "$",
        contains: [
          t.C_NUMBER_MODE,
          c
        ]
      },
      {
        begin: "\\bforeign\\b",
        end: "$",
        keywords: "foreign import export ccall stdcall cplusplus jvm dotnet safe unsafe",
        contains: [
          p,
          t.QUOTE_STRING_MODE,
          c
        ]
      },
      {
        className: "meta",
        begin: "#!\\/usr\\/bin\\/env runhaskell",
        end: "$"
      },
      // "Whitespaces".
      u,
      d,
      // Literals and names.
      // Single characters.
      {
        scope: "string",
        begin: /'(?=\\?.')/,
        end: /'/,
        contains: [
          {
            scope: "char.escape",
            match: /\\./
          }
        ]
      },
      t.QUOTE_STRING_MODE,
      f,
      p,
      t.inherit(t.TITLE_MODE, { begin: "^[_a-z][\\w']*" }),
      // No markup, prevents infix operators from being recognized as comments.
      { begin: `(?!-)${l}--+|--+(?!-)${l}` },
      c,
      {
        // No markup, relevance booster
        begin: "->|<-"
      }
    ]
  };
}
function Lx(t) {
  const e = "[a-zA-Z_$][a-zA-Z0-9_$]*", n = /(-?)(\b0[xX][a-fA-F0-9_]+|(\b\d+(\.[\d_]*)?|\.[\d_]+)(([eE][-+]?\d+)|i32|u32|i64|f64)?)/;
  return {
    name: "Haxe",
    aliases: ["hx"],
    keywords: {
      keyword: "abstract break case cast catch continue default do dynamic else enum extern final for function here if import in inline is macro never new override package private get set public return static super switch this throw trace try typedef untyped using var while " + "Int Float String Bool Dynamic Void Array ",
      built_in: "trace this",
      literal: "true false null _"
    },
    contains: [
      {
        className: "string",
        // interpolate-able strings
        begin: "'",
        end: "'",
        contains: [
          t.BACKSLASH_ESCAPE,
          {
            className: "subst",
            // interpolation
            begin: /\$\{/,
            end: /\}/
          },
          {
            className: "subst",
            // interpolation
            begin: /\$/,
            end: /\W\}/
          }
        ]
      },
      t.QUOTE_STRING_MODE,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      {
        className: "number",
        begin: n,
        relevance: 0
      },
      {
        className: "variable",
        begin: "\\$" + e
      },
      {
        className: "meta",
        // compiler meta
        begin: /@:?/,
        end: /\(|$/,
        excludeEnd: !0
      },
      {
        className: "meta",
        // compiler conditionals
        begin: "#",
        end: "$",
        keywords: { keyword: "if else elseif end error" }
      },
      {
        className: "type",
        // function types
        begin: /:[ \t]*/,
        end: /[^A-Za-z0-9_ \t\->]/,
        excludeBegin: !0,
        excludeEnd: !0,
        relevance: 0
      },
      {
        className: "type",
        // types
        begin: /:[ \t]*/,
        end: /\W/,
        excludeBegin: !0,
        excludeEnd: !0
      },
      {
        className: "type",
        // instantiation
        beginKeywords: "new",
        end: /\W/,
        excludeBegin: !0,
        excludeEnd: !0
      },
      {
        className: "title.class",
        // enums
        beginKeywords: "enum",
        end: /\{/,
        contains: [t.TITLE_MODE]
      },
      {
        className: "title.class",
        // abstracts
        begin: "\\babstract\\b(?=\\s*" + t.IDENT_RE + "\\s*\\()",
        end: /[\{$]/,
        contains: [
          {
            className: "type",
            begin: /\(/,
            end: /\)/,
            excludeBegin: !0,
            excludeEnd: !0
          },
          {
            className: "type",
            begin: /from +/,
            end: /\W/,
            excludeBegin: !0,
            excludeEnd: !0
          },
          {
            className: "type",
            begin: /to +/,
            end: /\W/,
            excludeBegin: !0,
            excludeEnd: !0
          },
          t.TITLE_MODE
        ],
        keywords: { keyword: "abstract from to" }
      },
      {
        className: "title.class",
        // classes
        begin: /\b(class|interface) +/,
        end: /[\{$]/,
        excludeEnd: !0,
        keywords: "class interface",
        contains: [
          {
            className: "keyword",
            begin: /\b(extends|implements) +/,
            keywords: "extends implements",
            contains: [
              {
                className: "type",
                begin: t.IDENT_RE,
                relevance: 0
              }
            ]
          },
          t.TITLE_MODE
        ]
      },
      {
        className: "title.function",
        beginKeywords: "function",
        end: /\(/,
        excludeEnd: !0,
        illegal: /\S/,
        contains: [t.TITLE_MODE]
      }
    ],
    illegal: /<\//
  };
}
function kx(t) {
  return {
    name: "HSP",
    case_insensitive: !0,
    keywords: {
      $pattern: /[\w._]+/,
      keyword: "goto gosub return break repeat loop continue wait await dim sdim foreach dimtype dup dupptr end stop newmod delmod mref run exgoto on mcall assert logmes newlab resume yield onexit onerror onkey onclick oncmd exist delete mkdir chdir dirlist bload bsave bcopy memfile if else poke wpoke lpoke getstr chdpm memexpand memcpy memset notesel noteadd notedel noteload notesave randomize noteunsel noteget split strrep setease button chgdisp exec dialog mmload mmplay mmstop mci pset pget syscolor mes print title pos circle cls font sysfont objsize picload color palcolor palette redraw width gsel gcopy gzoom gmode bmpsave hsvcolor getkey listbox chkbox combox input mesbox buffer screen bgscr mouse objsel groll line clrobj boxf objprm objmode stick grect grotate gsquare gradf objimage objskip objenable celload celdiv celput newcom querycom delcom cnvstow comres axobj winobj sendmsg comevent comevarg sarrayconv callfunc cnvwtos comevdisp libptr system hspstat hspver stat cnt err strsize looplev sublev iparam wparam lparam refstr refdval int rnd strlen length length2 length3 length4 vartype gettime peek wpeek lpeek varptr varuse noteinfo instr abs limit getease str strmid strf getpath strtrim sin cos tan atan sqrt double absf expf logf limitf powf geteasef mousex mousey mousew hwnd hinstance hdc ginfo objinfo dirinfo sysinfo thismod __hspver__ __hsp30__ __date__ __time__ __line__ __file__ _debug __hspdef__ and or xor not screen_normal screen_palette screen_hide screen_fixedsize screen_tool screen_frame gmode_gdi gmode_mem gmode_rgb0 gmode_alpha gmode_rgb0alpha gmode_add gmode_sub gmode_pixela ginfo_mx ginfo_my ginfo_act ginfo_sel ginfo_wx1 ginfo_wy1 ginfo_wx2 ginfo_wy2 ginfo_vx ginfo_vy ginfo_sizex ginfo_sizey ginfo_winx ginfo_winy ginfo_mesx ginfo_mesy ginfo_r ginfo_g ginfo_b ginfo_paluse ginfo_dispx ginfo_dispy ginfo_cx ginfo_cy ginfo_intid ginfo_newid ginfo_sx ginfo_sy objinfo_mode objinfo_bmscr objinfo_hwnd notemax notesize dir_cur dir_exe dir_win dir_sys dir_cmdline dir_desktop dir_mydoc dir_tv font_normal font_bold font_italic font_underline font_strikeout font_antialias objmode_normal objmode_guifont objmode_usefont gsquare_grad msgothic msmincho do until while wend for next _break _continue switch case default swbreak swend ddim ldim alloc m_pi rad2deg deg2rad ease_linear ease_quad_in ease_quad_out ease_quad_inout ease_cubic_in ease_cubic_out ease_cubic_inout ease_quartic_in ease_quartic_out ease_quartic_inout ease_bounce_in ease_bounce_out ease_bounce_inout ease_shake_in ease_shake_out ease_shake_inout ease_loop"
    },
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      t.APOS_STRING_MODE,
      {
        // multi-line string
        className: "string",
        begin: /\{"/,
        end: /"\}/,
        contains: [t.BACKSLASH_ESCAPE]
      },
      t.COMMENT(";", "$", { relevance: 0 }),
      {
        // pre-processor
        className: "meta",
        begin: "#",
        end: "$",
        keywords: { keyword: "addion cfunc cmd cmpopt comfunc const defcfunc deffunc define else endif enum epack func global if ifdef ifndef include modcfunc modfunc modinit modterm module pack packopt regcmd runtime undef usecom uselib" },
        contains: [
          t.inherit(t.QUOTE_STRING_MODE, { className: "string" }),
          t.NUMBER_MODE,
          t.C_NUMBER_MODE,
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      {
        // label
        className: "symbol",
        begin: "^\\*(\\w+|@)"
      },
      t.NUMBER_MODE,
      t.C_NUMBER_MODE
    ]
  };
}
function Px(t) {
  const e = t.regex, n = "HTTP/([32]|1\\.[01])", r = /[A-Za-z][A-Za-z0-9-]*/, i = {
    className: "attribute",
    begin: e.concat("^", r, "(?=\\:\\s)"),
    starts: { contains: [
      {
        className: "punctuation",
        begin: /: /,
        relevance: 0,
        starts: {
          end: "$",
          relevance: 0
        }
      }
    ] }
  }, o = [
    i,
    {
      begin: "\\n\\n",
      starts: {
        subLanguage: [],
        endsWithParent: !0
      }
    }
  ];
  return {
    name: "HTTP",
    aliases: ["https"],
    illegal: /\S/,
    contains: [
      // response
      {
        begin: "^(?=" + n + " \\d{3})",
        end: /$/,
        contains: [
          {
            className: "meta",
            begin: n
          },
          {
            className: "number",
            begin: "\\b\\d{3}\\b"
          }
        ],
        starts: {
          end: /\b\B/,
          illegal: /\S/,
          contains: o
        }
      },
      // request
      {
        begin: "(?=^[A-Z]+ (.*?) " + n + "$)",
        end: /$/,
        contains: [
          {
            className: "string",
            begin: " ",
            end: " ",
            excludeBegin: !0,
            excludeEnd: !0
          },
          {
            className: "meta",
            begin: n
          },
          {
            className: "keyword",
            begin: "[A-Z]+"
          }
        ],
        starts: {
          end: /\b\B/,
          illegal: /\S/,
          contains: o
        }
      },
      // to allow headers to work even without a preamble
      t.inherit(i, { relevance: 0 })
    ]
  };
}
function Fx(t) {
  const e = "a-zA-Z_\\-!.?+*=<>&#'", n = "[" + e + "][" + e + "0-9/;:]*", r = {
    $pattern: n,
    built_in: (
      // keywords
      "!= % %= & &= * ** **= *= *map + += , --build-class-- --import-- -= . / // //= /= < << <<= <= = > >= >> >>= @ @= ^ ^= abs accumulate all and any ap-compose ap-dotimes ap-each ap-each-while ap-filter ap-first ap-if ap-last ap-map ap-map-when ap-pipe ap-reduce ap-reject apply as-> ascii assert assoc bin break butlast callable calling-module-name car case cdr chain chr coll? combinations compile compress cond cons cons? continue count curry cut cycle dec def default-method defclass defmacro defmacro-alias defmacro/g! defmain defmethod defmulti defn defn-alias defnc defnr defreader defseq del delattr delete-route dict-comp dir disassemble dispatch-reader-macro distinct divmod do doto drop drop-last drop-while empty? end-sequence eval eval-and-compile eval-when-compile even? every? except exec filter first flatten float? fn fnc fnr for for* format fraction genexpr gensym get getattr global globals group-by hasattr hash hex id identity if if* if-not if-python2 import in inc input instance? integer integer-char? integer? interleave interpose is is-coll is-cons is-empty is-even is-every is-float is-instance is-integer is-integer-char is-iterable is-iterator is-keyword is-neg is-none is-not is-numeric is-odd is-pos is-string is-symbol is-zero isinstance islice issubclass iter iterable? iterate iterator? keyword keyword? lambda last len let lif lif-not list* list-comp locals loop macro-error macroexpand macroexpand-1 macroexpand-all map max merge-with method-decorator min multi-decorator multicombinations name neg? next none? nonlocal not not-in not? nth numeric? oct odd? open or ord partition permutations pos? post-route postwalk pow prewalk print product profile/calls profile/cpu put-route quasiquote quote raise range read read-str recursive-replace reduce remove repeat repeatedly repr require rest round route route-with-methods rwm second seq set-comp setattr setv some sorted string string? sum switch symbol? take take-nth take-while tee try unless unquote unquote-splicing vars walk when while with with* with-decorator with-gensyms xi xor yield yield-from zero? zip zip-longest | |= ~"
    )
  }, i = "[-+]?\\d+(\\.\\d+)?", o = {
    begin: n,
    relevance: 0
  }, a = {
    className: "number",
    begin: i,
    relevance: 0
  }, s = t.inherit(t.QUOTE_STRING_MODE, { illegal: null }), l = t.COMMENT(
    ";",
    "$",
    { relevance: 0 }
  ), c = {
    className: "literal",
    begin: /\b([Tt]rue|[Ff]alse|nil|None)\b/
  }, u = {
    begin: "[\\[\\{]",
    end: "[\\]\\}]",
    relevance: 0
  }, d = {
    className: "comment",
    begin: "\\^" + n
  }, p = t.COMMENT("\\^\\{", "\\}"), _ = {
    className: "symbol",
    begin: "[:]{1,2}" + n
  }, m = {
    begin: "\\(",
    end: "\\)"
  }, f = {
    endsWithParent: !0,
    relevance: 0
  }, g = {
    className: "name",
    relevance: 0,
    keywords: r,
    begin: n,
    starts: f
  }, S = [
    m,
    s,
    d,
    p,
    l,
    _,
    u,
    a,
    c,
    o
  ];
  return m.contains = [
    t.COMMENT("comment", ""),
    g,
    f
  ], f.contains = S, u.contains = S, {
    name: "Hy",
    aliases: ["hylang"],
    illegal: /\S/,
    contains: [
      t.SHEBANG(),
      m,
      s,
      d,
      p,
      l,
      _,
      u,
      a,
      c
    ]
  };
}
function Bx(t) {
  const e = "\\[", n = "\\]";
  return {
    name: "Inform 7",
    aliases: ["i7"],
    case_insensitive: !0,
    keywords: {
      // Some keywords more or less unique to I7, for relevance.
      keyword: (
        // kind:
        "thing room person man woman animal container supporter backdrop door scenery open closed locked inside gender is are say understand kind of rule"
      )
    },
    contains: [
      {
        className: "string",
        begin: '"',
        end: '"',
        relevance: 0,
        contains: [
          {
            className: "subst",
            begin: e,
            end: n
          }
        ]
      },
      {
        className: "section",
        begin: /^(Volume|Book|Part|Chapter|Section|Table)\b/,
        end: "$"
      },
      {
        // Rule definition
        // This is here for relevance.
        begin: /^(Check|Carry out|Report|Instead of|To|Rule|When|Before|After)\b/,
        end: ":",
        contains: [
          {
            // Rule name
            begin: "\\(This",
            end: "\\)"
          }
        ]
      },
      {
        className: "comment",
        begin: e,
        end: n,
        contains: ["self"]
      }
    ]
  };
}
function Ux(t) {
  const e = t.regex, n = {
    className: "params",
    begin: "\\(",
    end: "\\)"
  }, r = /(_[a-z_\d]+)?/, i = /([de][+-]?\d+)?/, o = {
    className: "number",
    variants: [
      { begin: e.concat(/\b\d+/, /\.(\d*)/, i, r) },
      { begin: e.concat(/\b\d+/, i, r) },
      { begin: e.concat(/\.\d+/, i, r) }
    ],
    relevance: 0
  };
  return {
    name: "IRPF90",
    case_insensitive: !0,
    keywords: {
      literal: ".False. .True.",
      keyword: "kind do while private call intrinsic where elsewhere type endtype endmodule endselect endinterface end enddo endif if forall endforall only contains default return stop then public subroutine|10 function program .and. .or. .not. .le. .eq. .ge. .gt. .lt. goto save else use module select case access blank direct exist file fmt form formatted iostat name named nextrec number opened rec recl sequential status unformatted unit continue format pause cycle exit c_null_char c_alert c_backspace c_form_feed flush wait decimal round iomsg synchronous nopass non_overridable pass protected volatile abstract extends import non_intrinsic value deferred generic final enumerator class associate bind enum c_int c_short c_long c_long_long c_signed_char c_size_t c_int8_t c_int16_t c_int32_t c_int64_t c_int_least8_t c_int_least16_t c_int_least32_t c_int_least64_t c_int_fast8_t c_int_fast16_t c_int_fast32_t c_int_fast64_t c_intmax_t C_intptr_t c_float c_double c_long_double c_float_complex c_double_complex c_long_double_complex c_bool c_char c_null_ptr c_null_funptr c_new_line c_carriage_return c_horizontal_tab c_vertical_tab iso_c_binding c_loc c_funloc c_associated  c_f_pointer c_ptr c_funptr iso_fortran_env character_storage_size error_unit file_storage_size input_unit iostat_end iostat_eor numeric_storage_size output_unit c_f_procpointer ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode newunit contiguous recursive pad position action delim readwrite eor advance nml interface procedure namelist include sequence elemental pure integer real character complex logical dimension allocatable|10 parameter external implicit|10 none double precision assign intent optional pointer target in out common equivalence data begin_provider &begin_provider end_provider begin_shell end_shell begin_template end_template subst assert touch soft_touch provide no_dep free irp_if irp_else irp_endif irp_write irp_read",
      built_in: "alog alog10 amax0 amax1 amin0 amin1 amod cabs ccos cexp clog csin csqrt dabs dacos dasin datan datan2 dcos dcosh ddim dexp dint dlog dlog10 dmax1 dmin1 dmod dnint dsign dsin dsinh dsqrt dtan dtanh float iabs idim idint idnint ifix isign max0 max1 min0 min1 sngl algama cdabs cdcos cdexp cdlog cdsin cdsqrt cqabs cqcos cqexp cqlog cqsin cqsqrt dcmplx dconjg derf derfc dfloat dgamma dimag dlgama iqint qabs qacos qasin qatan qatan2 qcmplx qconjg qcos qcosh qdim qerf qerfc qexp qgamma qimag qlgama qlog qlog10 qmax1 qmin1 qmod qnint qsign qsin qsinh qsqrt qtan qtanh abs acos aimag aint anint asin atan atan2 char cmplx conjg cos cosh exp ichar index int log log10 max min nint sign sin sinh sqrt tan tanh print write dim lge lgt lle llt mod nullify allocate deallocate adjustl adjustr all allocated any associated bit_size btest ceiling count cshift date_and_time digits dot_product eoshift epsilon exponent floor fraction huge iand ibclr ibits ibset ieor ior ishft ishftc lbound len_trim matmul maxexponent maxloc maxval merge minexponent minloc minval modulo mvbits nearest pack present product radix random_number random_seed range repeat reshape rrspacing scale scan selected_int_kind selected_real_kind set_exponent shape size spacing spread sum system_clock tiny transpose trim ubound unpack verify achar iachar transfer dble entry dprod cpu_time command_argument_count get_command get_command_argument get_environment_variable is_iostat_end ieee_arithmetic ieee_support_underflow_control ieee_get_underflow_mode ieee_set_underflow_mode is_iostat_eor move_alloc new_line selected_char_kind same_type_as extends_type_of acosh asinh atanh bessel_j0 bessel_j1 bessel_jn bessel_y0 bessel_y1 bessel_yn erf erfc erfc_scaled gamma log_gamma hypot norm2 atomic_define atomic_ref execute_command_line leadz trailz storage_size merge_bits bge bgt ble blt dshiftl dshiftr findloc iall iany iparity image_index lcobound ucobound maskl maskr num_images parity popcnt poppar shifta shiftl shiftr this_image IRP_ALIGN irp_here"
    },
    illegal: /\/\*/,
    contains: [
      t.inherit(t.APOS_STRING_MODE, {
        className: "string",
        relevance: 0
      }),
      t.inherit(t.QUOTE_STRING_MODE, {
        className: "string",
        relevance: 0
      }),
      {
        className: "function",
        beginKeywords: "subroutine function program",
        illegal: "[${=\\n]",
        contains: [
          t.UNDERSCORE_TITLE_MODE,
          n
        ]
      },
      t.COMMENT("!", "$", { relevance: 0 }),
      t.COMMENT("begin_doc", "end_doc", { relevance: 10 }),
      o
    ]
  };
}
function Hx(t) {
  const e = "[A-Za-zА-Яа-яёЁ_!][A-Za-zА-Яа-яёЁ_0-9]*", n = "[A-Za-zА-Яа-яёЁ_][A-Za-zА-Яа-яёЁ_0-9]*", r = "and и else иначе endexcept endfinally endforeach конецвсе endif конецесли endwhile конецпока except exitfor finally foreach все if если in в not не or или try while пока ", pe = "SYSRES_CONST_ACCES_RIGHT_TYPE_EDIT SYSRES_CONST_ACCES_RIGHT_TYPE_FULL SYSRES_CONST_ACCES_RIGHT_TYPE_VIEW SYSRES_CONST_ACCESS_MODE_REQUISITE_CODE SYSRES_CONST_ACCESS_NO_ACCESS_VIEW SYSRES_CONST_ACCESS_NO_ACCESS_VIEW_CODE SYSRES_CONST_ACCESS_RIGHTS_ADD_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_ADD_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_CHANGE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_CHANGE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_DELETE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_DELETE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_EXECUTE_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_EXECUTE_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_NO_ACCESS_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_NO_ACCESS_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_RATIFY_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_RATIFY_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_RIGHTS_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW SYSRES_CONST_ACCESS_RIGHTS_VIEW_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW_REQUISITE_CODE SYSRES_CONST_ACCESS_RIGHTS_VIEW_REQUISITE_YES_CODE SYSRES_CONST_ACCESS_TYPE_CHANGE SYSRES_CONST_ACCESS_TYPE_CHANGE_CODE SYSRES_CONST_ACCESS_TYPE_EXISTS SYSRES_CONST_ACCESS_TYPE_EXISTS_CODE SYSRES_CONST_ACCESS_TYPE_FULL SYSRES_CONST_ACCESS_TYPE_FULL_CODE SYSRES_CONST_ACCESS_TYPE_VIEW SYSRES_CONST_ACCESS_TYPE_VIEW_CODE SYSRES_CONST_ACTION_TYPE_ABORT SYSRES_CONST_ACTION_TYPE_ACCEPT SYSRES_CONST_ACTION_TYPE_ACCESS_RIGHTS SYSRES_CONST_ACTION_TYPE_ADD_ATTACHMENT SYSRES_CONST_ACTION_TYPE_CHANGE_CARD SYSRES_CONST_ACTION_TYPE_CHANGE_KIND SYSRES_CONST_ACTION_TYPE_CHANGE_STORAGE SYSRES_CONST_ACTION_TYPE_CONTINUE SYSRES_CONST_ACTION_TYPE_COPY SYSRES_CONST_ACTION_TYPE_CREATE SYSRES_CONST_ACTION_TYPE_CREATE_VERSION SYSRES_CONST_ACTION_TYPE_DELETE SYSRES_CONST_ACTION_TYPE_DELETE_ATTACHMENT SYSRES_CONST_ACTION_TYPE_DELETE_VERSION SYSRES_CONST_ACTION_TYPE_DISABLE_DELEGATE_ACCESS_RIGHTS SYSRES_CONST_ACTION_TYPE_ENABLE_DELEGATE_ACCESS_RIGHTS SYSRES_CONST_ACTION_TYPE_ENCRYPTION_BY_CERTIFICATE SYSRES_CONST_ACTION_TYPE_ENCRYPTION_BY_CERTIFICATE_AND_PASSWORD SYSRES_CONST_ACTION_TYPE_ENCRYPTION_BY_PASSWORD SYSRES_CONST_ACTION_TYPE_EXPORT_WITH_LOCK SYSRES_CONST_ACTION_TYPE_EXPORT_WITHOUT_LOCK SYSRES_CONST_ACTION_TYPE_IMPORT_WITH_UNLOCK SYSRES_CONST_ACTION_TYPE_IMPORT_WITHOUT_UNLOCK SYSRES_CONST_ACTION_TYPE_LIFE_CYCLE_STAGE SYSRES_CONST_ACTION_TYPE_LOCK SYSRES_CONST_ACTION_TYPE_LOCK_FOR_SERVER SYSRES_CONST_ACTION_TYPE_LOCK_MODIFY SYSRES_CONST_ACTION_TYPE_MARK_AS_READED SYSRES_CONST_ACTION_TYPE_MARK_AS_UNREADED SYSRES_CONST_ACTION_TYPE_MODIFY SYSRES_CONST_ACTION_TYPE_MODIFY_CARD SYSRES_CONST_ACTION_TYPE_MOVE_TO_ARCHIVE SYSRES_CONST_ACTION_TYPE_OFF_ENCRYPTION SYSRES_CONST_ACTION_TYPE_PASSWORD_CHANGE SYSRES_CONST_ACTION_TYPE_PERFORM SYSRES_CONST_ACTION_TYPE_RECOVER_FROM_LOCAL_COPY SYSRES_CONST_ACTION_TYPE_RESTART SYSRES_CONST_ACTION_TYPE_RESTORE_FROM_ARCHIVE SYSRES_CONST_ACTION_TYPE_REVISION SYSRES_CONST_ACTION_TYPE_SEND_BY_MAIL SYSRES_CONST_ACTION_TYPE_SIGN SYSRES_CONST_ACTION_TYPE_START SYSRES_CONST_ACTION_TYPE_UNLOCK SYSRES_CONST_ACTION_TYPE_UNLOCK_FROM_SERVER SYSRES_CONST_ACTION_TYPE_VERSION_STATE SYSRES_CONST_ACTION_TYPE_VERSION_VISIBILITY SYSRES_CONST_ACTION_TYPE_VIEW SYSRES_CONST_ACTION_TYPE_VIEW_SHADOW_COPY SYSRES_CONST_ACTION_TYPE_WORKFLOW_DESCRIPTION_MODIFY SYSRES_CONST_ACTION_TYPE_WRITE_HISTORY SYSRES_CONST_ACTIVE_VERSION_STATE_PICK_VALUE SYSRES_CONST_ADD_REFERENCE_MODE_NAME SYSRES_CONST_ADDITION_REQUISITE_CODE SYSRES_CONST_ADDITIONAL_PARAMS_REQUISITE_CODE SYSRES_CONST_ADITIONAL_JOB_END_DATE_REQUISITE_NAME SYSRES_CONST_ADITIONAL_JOB_READ_REQUISITE_NAME SYSRES_CONST_ADITIONAL_JOB_START_DATE_REQUISITE_NAME SYSRES_CONST_ADITIONAL_JOB_STATE_REQUISITE_NAME SYSRES_CONST_ADMINISTRATION_HISTORY_ADDING_USER_TO_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_ADDING_USER_TO_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_COMP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_COMP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_USER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_CREATION_USER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_CREATION SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_CREATION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_DELETION SYSRES_CONST_ADMINISTRATION_HISTORY_DATABASE_USER_DELETION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_COMP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_COMP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_FROM_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_DELETION_USER_FROM_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_RESTRICTION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_FILTERER_RESTRICTION_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_PRIVILEGE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_PRIVILEGE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_RIGHTS_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_GRANTING_RIGHTS_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_IS_MAIN_SERVER_CHANGED_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_IS_MAIN_SERVER_CHANGED_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_IS_PUBLIC_CHANGED_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_IS_PUBLIC_CHANGED_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_RESTRICTION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_FILTERER_RESTRICTION_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_PRIVILEGE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_PRIVILEGE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_RIGHTS_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_REMOVING_RIGHTS_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_CREATION SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_CREATION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_DELETION SYSRES_CONST_ADMINISTRATION_HISTORY_SERVER_LOGIN_DELETION_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_CATEGORY_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_CATEGORY_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_COMP_TITLE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_COMP_TITLE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_FULL_NAME_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_FULL_NAME_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_PARENT_GROUP_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_PARENT_GROUP_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_AUTH_TYPE_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_AUTH_TYPE_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_LOGIN_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_LOGIN_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_STATUS_ACTION SYSRES_CONST_ADMINISTRATION_HISTORY_UPDATING_USER_STATUS_ACTION_CODE SYSRES_CONST_ADMINISTRATION_HISTORY_USER_PASSWORD_CHANGE SYSRES_CONST_ADMINISTRATION_HISTORY_USER_PASSWORD_CHANGE_ACTION SYSRES_CONST_ALL_ACCEPT_CONDITION_RUS SYSRES_CONST_ALL_USERS_GROUP SYSRES_CONST_ALL_USERS_GROUP_NAME SYSRES_CONST_ALL_USERS_SERVER_GROUP_NAME SYSRES_CONST_ALLOWED_ACCESS_TYPE_CODE SYSRES_CONST_ALLOWED_ACCESS_TYPE_NAME SYSRES_CONST_APP_VIEWER_TYPE_REQUISITE_CODE SYSRES_CONST_APPROVING_SIGNATURE_NAME SYSRES_CONST_APPROVING_SIGNATURE_REQUISITE_CODE SYSRES_CONST_ASSISTANT_SUBSTITUE_TYPE SYSRES_CONST_ASSISTANT_SUBSTITUE_TYPE_CODE SYSRES_CONST_ATTACH_TYPE_COMPONENT_TOKEN SYSRES_CONST_ATTACH_TYPE_DOC SYSRES_CONST_ATTACH_TYPE_EDOC SYSRES_CONST_ATTACH_TYPE_FOLDER SYSRES_CONST_ATTACH_TYPE_JOB SYSRES_CONST_ATTACH_TYPE_REFERENCE SYSRES_CONST_ATTACH_TYPE_TASK SYSRES_CONST_AUTH_ENCODED_PASSWORD SYSRES_CONST_AUTH_ENCODED_PASSWORD_CODE SYSRES_CONST_AUTH_NOVELL SYSRES_CONST_AUTH_PASSWORD SYSRES_CONST_AUTH_PASSWORD_CODE SYSRES_CONST_AUTH_WINDOWS SYSRES_CONST_AUTHENTICATING_SIGNATURE_NAME SYSRES_CONST_AUTHENTICATING_SIGNATURE_REQUISITE_CODE SYSRES_CONST_AUTO_ENUM_METHOD_FLAG SYSRES_CONST_AUTO_NUMERATION_CODE SYSRES_CONST_AUTO_STRONG_ENUM_METHOD_FLAG SYSRES_CONST_AUTOTEXT_NAME_REQUISITE_CODE SYSRES_CONST_AUTOTEXT_TEXT_REQUISITE_CODE SYSRES_CONST_AUTOTEXT_USAGE_ALL SYSRES_CONST_AUTOTEXT_USAGE_ALL_CODE SYSRES_CONST_AUTOTEXT_USAGE_SIGN SYSRES_CONST_AUTOTEXT_USAGE_SIGN_CODE SYSRES_CONST_AUTOTEXT_USAGE_WORK SYSRES_CONST_AUTOTEXT_USAGE_WORK_CODE SYSRES_CONST_AUTOTEXT_USE_ANYWHERE_CODE SYSRES_CONST_AUTOTEXT_USE_ON_SIGNING_CODE SYSRES_CONST_AUTOTEXT_USE_ON_WORK_CODE SYSRES_CONST_BEGIN_DATE_REQUISITE_CODE SYSRES_CONST_BLACK_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_BLUE_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_BTN_PART SYSRES_CONST_CALCULATED_ROLE_TYPE_CODE SYSRES_CONST_CALL_TYPE_VARIABLE_BUTTON_VALUE SYSRES_CONST_CALL_TYPE_VARIABLE_PROGRAM_VALUE SYSRES_CONST_CANCEL_MESSAGE_FUNCTION_RESULT SYSRES_CONST_CARD_PART SYSRES_CONST_CARD_REFERENCE_MODE_NAME SYSRES_CONST_CERTIFICATE_TYPE_REQUISITE_ENCRYPT_VALUE SYSRES_CONST_CERTIFICATE_TYPE_REQUISITE_SIGN_AND_ENCRYPT_VALUE SYSRES_CONST_CERTIFICATE_TYPE_REQUISITE_SIGN_VALUE SYSRES_CONST_CHECK_PARAM_VALUE_DATE_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_FLOAT_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_INTEGER_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_PICK_PARAM_TYPE SYSRES_CONST_CHECK_PARAM_VALUE_REEFRENCE_PARAM_TYPE SYSRES_CONST_CLOSED_RECORD_FLAG_VALUE_FEMININE SYSRES_CONST_CLOSED_RECORD_FLAG_VALUE_MASCULINE SYSRES_CONST_CODE_COMPONENT_TYPE_ADMIN SYSRES_CONST_CODE_COMPONENT_TYPE_DEVELOPER SYSRES_CONST_CODE_COMPONENT_TYPE_DOCS SYSRES_CONST_CODE_COMPONENT_TYPE_EDOC_CARDS SYSRES_CONST_CODE_COMPONENT_TYPE_EXTERNAL_EXECUTABLE SYSRES_CONST_CODE_COMPONENT_TYPE_OTHER SYSRES_CONST_CODE_COMPONENT_TYPE_REFERENCE SYSRES_CONST_CODE_COMPONENT_TYPE_REPORT SYSRES_CONST_CODE_COMPONENT_TYPE_SCRIPT SYSRES_CONST_CODE_COMPONENT_TYPE_URL SYSRES_CONST_CODE_REQUISITE_ACCESS SYSRES_CONST_CODE_REQUISITE_CODE SYSRES_CONST_CODE_REQUISITE_COMPONENT SYSRES_CONST_CODE_REQUISITE_DESCRIPTION SYSRES_CONST_CODE_REQUISITE_EXCLUDE_COMPONENT SYSRES_CONST_CODE_REQUISITE_RECORD SYSRES_CONST_COMMENT_REQ_CODE SYSRES_CONST_COMMON_SETTINGS_REQUISITE_CODE SYSRES_CONST_COMP_CODE_GRD SYSRES_CONST_COMPONENT_GROUP_TYPE_REQUISITE_CODE SYSRES_CONST_COMPONENT_TYPE_ADMIN_COMPONENTS SYSRES_CONST_COMPONENT_TYPE_DEVELOPER_COMPONENTS SYSRES_CONST_COMPONENT_TYPE_DOCS SYSRES_CONST_COMPONENT_TYPE_EDOC_CARDS SYSRES_CONST_COMPONENT_TYPE_EDOCS SYSRES_CONST_COMPONENT_TYPE_EXTERNAL_EXECUTABLE SYSRES_CONST_COMPONENT_TYPE_OTHER SYSRES_CONST_COMPONENT_TYPE_REFERENCE_TYPES SYSRES_CONST_COMPONENT_TYPE_REFERENCES SYSRES_CONST_COMPONENT_TYPE_REPORTS SYSRES_CONST_COMPONENT_TYPE_SCRIPTS SYSRES_CONST_COMPONENT_TYPE_URL SYSRES_CONST_COMPONENTS_REMOTE_SERVERS_VIEW_CODE SYSRES_CONST_CONDITION_BLOCK_DESCRIPTION SYSRES_CONST_CONST_FIRM_STATUS_COMMON SYSRES_CONST_CONST_FIRM_STATUS_INDIVIDUAL SYSRES_CONST_CONST_NEGATIVE_VALUE SYSRES_CONST_CONST_POSITIVE_VALUE SYSRES_CONST_CONST_SERVER_STATUS_DONT_REPLICATE SYSRES_CONST_CONST_SERVER_STATUS_REPLICATE SYSRES_CONST_CONTENTS_REQUISITE_CODE SYSRES_CONST_DATA_TYPE_BOOLEAN SYSRES_CONST_DATA_TYPE_DATE SYSRES_CONST_DATA_TYPE_FLOAT SYSRES_CONST_DATA_TYPE_INTEGER SYSRES_CONST_DATA_TYPE_PICK SYSRES_CONST_DATA_TYPE_REFERENCE SYSRES_CONST_DATA_TYPE_STRING SYSRES_CONST_DATA_TYPE_TEXT SYSRES_CONST_DATA_TYPE_VARIANT SYSRES_CONST_DATE_CLOSE_REQ_CODE SYSRES_CONST_DATE_FORMAT_DATE_ONLY_CHAR SYSRES_CONST_DATE_OPEN_REQ_CODE SYSRES_CONST_DATE_REQUISITE SYSRES_CONST_DATE_REQUISITE_CODE SYSRES_CONST_DATE_REQUISITE_NAME SYSRES_CONST_DATE_REQUISITE_TYPE SYSRES_CONST_DATE_TYPE_CHAR SYSRES_CONST_DATETIME_FORMAT_VALUE SYSRES_CONST_DEA_ACCESS_RIGHTS_ACTION_CODE SYSRES_CONST_DESCRIPTION_LOCALIZE_ID_REQUISITE_CODE SYSRES_CONST_DESCRIPTION_REQUISITE_CODE SYSRES_CONST_DET1_PART SYSRES_CONST_DET2_PART SYSRES_CONST_DET3_PART SYSRES_CONST_DET4_PART SYSRES_CONST_DET5_PART SYSRES_CONST_DET6_PART SYSRES_CONST_DETAIL_DATASET_KEY_REQUISITE_CODE SYSRES_CONST_DETAIL_PICK_REQUISITE_CODE SYSRES_CONST_DETAIL_REQ_CODE SYSRES_CONST_DO_NOT_USE_ACCESS_TYPE_CODE SYSRES_CONST_DO_NOT_USE_ACCESS_TYPE_NAME SYSRES_CONST_DO_NOT_USE_ON_VIEW_ACCESS_TYPE_CODE SYSRES_CONST_DO_NOT_USE_ON_VIEW_ACCESS_TYPE_NAME SYSRES_CONST_DOCUMENT_STORAGES_CODE SYSRES_CONST_DOCUMENT_TEMPLATES_TYPE_NAME SYSRES_CONST_DOUBLE_REQUISITE_CODE SYSRES_CONST_EDITOR_CLOSE_FILE_OBSERV_TYPE_CODE SYSRES_CONST_EDITOR_CLOSE_PROCESS_OBSERV_TYPE_CODE SYSRES_CONST_EDITOR_TYPE_REQUISITE_CODE SYSRES_CONST_EDITORS_APPLICATION_NAME_REQUISITE_CODE SYSRES_CONST_EDITORS_CREATE_SEVERAL_PROCESSES_REQUISITE_CODE SYSRES_CONST_EDITORS_EXTENSION_REQUISITE_CODE SYSRES_CONST_EDITORS_OBSERVER_BY_PROCESS_TYPE SYSRES_CONST_EDITORS_REFERENCE_CODE SYSRES_CONST_EDITORS_REPLACE_SPEC_CHARS_REQUISITE_CODE SYSRES_CONST_EDITORS_USE_PLUGINS_REQUISITE_CODE SYSRES_CONST_EDITORS_VIEW_DOCUMENT_OPENED_TO_EDIT_CODE SYSRES_CONST_EDOC_CARD_TYPE_REQUISITE_CODE SYSRES_CONST_EDOC_CARD_TYPES_LINK_REQUISITE_CODE SYSRES_CONST_EDOC_CERTIFICATE_AND_PASSWORD_ENCODE_CODE SYSRES_CONST_EDOC_CERTIFICATE_ENCODE_CODE SYSRES_CONST_EDOC_DATE_REQUISITE_CODE SYSRES_CONST_EDOC_KIND_REFERENCE_CODE SYSRES_CONST_EDOC_KINDS_BY_TEMPLATE_ACTION_CODE SYSRES_CONST_EDOC_MANAGE_ACCESS_CODE SYSRES_CONST_EDOC_NONE_ENCODE_CODE SYSRES_CONST_EDOC_NUMBER_REQUISITE_CODE SYSRES_CONST_EDOC_PASSWORD_ENCODE_CODE SYSRES_CONST_EDOC_READONLY_ACCESS_CODE SYSRES_CONST_EDOC_SHELL_LIFE_TYPE_VIEW_VALUE SYSRES_CONST_EDOC_SIZE_RESTRICTION_PRIORITY_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_CHECK_ACCESS_RIGHTS_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_COMPUTER_NAME_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_DATABASE_NAME_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_EDIT_IN_STORAGE_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_LOCAL_PATH_REQUISITE_CODE SYSRES_CONST_EDOC_STORAGE_SHARED_SOURCE_NAME_REQUISITE_CODE SYSRES_CONST_EDOC_TEMPLATE_REQUISITE_CODE SYSRES_CONST_EDOC_TYPES_REFERENCE_CODE SYSRES_CONST_EDOC_VERSION_ACTIVE_STAGE_CODE SYSRES_CONST_EDOC_VERSION_DESIGN_STAGE_CODE SYSRES_CONST_EDOC_VERSION_OBSOLETE_STAGE_CODE SYSRES_CONST_EDOC_WRITE_ACCES_CODE SYSRES_CONST_EDOCUMENT_CARD_REQUISITES_REFERENCE_CODE_SELECTED_REQUISITE SYSRES_CONST_ENCODE_CERTIFICATE_TYPE_CODE SYSRES_CONST_END_DATE_REQUISITE_CODE SYSRES_CONST_ENUMERATION_TYPE_REQUISITE_CODE SYSRES_CONST_EXECUTE_ACCESS_RIGHTS_TYPE_CODE SYSRES_CONST_EXECUTIVE_FILE_STORAGE_TYPE SYSRES_CONST_EXIST_CONST SYSRES_CONST_EXIST_VALUE SYSRES_CONST_EXPORT_LOCK_TYPE_ASK SYSRES_CONST_EXPORT_LOCK_TYPE_WITH_LOCK SYSRES_CONST_EXPORT_LOCK_TYPE_WITHOUT_LOCK SYSRES_CONST_EXPORT_VERSION_TYPE_ASK SYSRES_CONST_EXPORT_VERSION_TYPE_LAST SYSRES_CONST_EXPORT_VERSION_TYPE_LAST_ACTIVE SYSRES_CONST_EXTENSION_REQUISITE_CODE SYSRES_CONST_FILTER_NAME_REQUISITE_CODE SYSRES_CONST_FILTER_REQUISITE_CODE SYSRES_CONST_FILTER_TYPE_COMMON_CODE SYSRES_CONST_FILTER_TYPE_COMMON_NAME SYSRES_CONST_FILTER_TYPE_USER_CODE SYSRES_CONST_FILTER_TYPE_USER_NAME SYSRES_CONST_FILTER_VALUE_REQUISITE_NAME SYSRES_CONST_FLOAT_NUMBER_FORMAT_CHAR SYSRES_CONST_FLOAT_REQUISITE_TYPE SYSRES_CONST_FOLDER_AUTHOR_VALUE SYSRES_CONST_FOLDER_KIND_ANY_OBJECTS SYSRES_CONST_FOLDER_KIND_COMPONENTS SYSRES_CONST_FOLDER_KIND_EDOCS SYSRES_CONST_FOLDER_KIND_JOBS SYSRES_CONST_FOLDER_KIND_TASKS SYSRES_CONST_FOLDER_TYPE_COMMON SYSRES_CONST_FOLDER_TYPE_COMPONENT SYSRES_CONST_FOLDER_TYPE_FAVORITES SYSRES_CONST_FOLDER_TYPE_INBOX SYSRES_CONST_FOLDER_TYPE_OUTBOX SYSRES_CONST_FOLDER_TYPE_QUICK_LAUNCH SYSRES_CONST_FOLDER_TYPE_SEARCH SYSRES_CONST_FOLDER_TYPE_SHORTCUTS SYSRES_CONST_FOLDER_TYPE_USER SYSRES_CONST_FROM_DICTIONARY_ENUM_METHOD_FLAG SYSRES_CONST_FULL_SUBSTITUTE_TYPE SYSRES_CONST_FULL_SUBSTITUTE_TYPE_CODE SYSRES_CONST_FUNCTION_CANCEL_RESULT SYSRES_CONST_FUNCTION_CATEGORY_SYSTEM SYSRES_CONST_FUNCTION_CATEGORY_USER SYSRES_CONST_FUNCTION_FAILURE_RESULT SYSRES_CONST_FUNCTION_SAVE_RESULT SYSRES_CONST_GENERATED_REQUISITE SYSRES_CONST_GREEN_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_GROUP_ACCOUNT_TYPE_VALUE_CODE SYSRES_CONST_GROUP_CATEGORY_NORMAL_CODE SYSRES_CONST_GROUP_CATEGORY_NORMAL_NAME SYSRES_CONST_GROUP_CATEGORY_SERVICE_CODE SYSRES_CONST_GROUP_CATEGORY_SERVICE_NAME SYSRES_CONST_GROUP_COMMON_CATEGORY_FIELD_VALUE SYSRES_CONST_GROUP_FULL_NAME_REQUISITE_CODE SYSRES_CONST_GROUP_NAME_REQUISITE_CODE SYSRES_CONST_GROUP_RIGHTS_T_REQUISITE_CODE SYSRES_CONST_GROUP_SERVER_CODES_REQUISITE_CODE SYSRES_CONST_GROUP_SERVER_NAME_REQUISITE_CODE SYSRES_CONST_GROUP_SERVICE_CATEGORY_FIELD_VALUE SYSRES_CONST_GROUP_USER_REQUISITE_CODE SYSRES_CONST_GROUPS_REFERENCE_CODE SYSRES_CONST_GROUPS_REQUISITE_CODE SYSRES_CONST_HIDDEN_MODE_NAME SYSRES_CONST_HIGH_LVL_REQUISITE_CODE SYSRES_CONST_HISTORY_ACTION_CREATE_CODE SYSRES_CONST_HISTORY_ACTION_DELETE_CODE SYSRES_CONST_HISTORY_ACTION_EDIT_CODE SYSRES_CONST_HOUR_CHAR SYSRES_CONST_ID_REQUISITE_CODE SYSRES_CONST_IDSPS_REQUISITE_CODE SYSRES_CONST_IMAGE_MODE_COLOR SYSRES_CONST_IMAGE_MODE_GREYSCALE SYSRES_CONST_IMAGE_MODE_MONOCHROME SYSRES_CONST_IMPORTANCE_HIGH SYSRES_CONST_IMPORTANCE_LOW SYSRES_CONST_IMPORTANCE_NORMAL SYSRES_CONST_IN_DESIGN_VERSION_STATE_PICK_VALUE SYSRES_CONST_INCOMING_WORK_RULE_TYPE_CODE SYSRES_CONST_INT_REQUISITE SYSRES_CONST_INT_REQUISITE_TYPE SYSRES_CONST_INTEGER_NUMBER_FORMAT_CHAR SYSRES_CONST_INTEGER_TYPE_CHAR SYSRES_CONST_IS_GENERATED_REQUISITE_NEGATIVE_VALUE SYSRES_CONST_IS_PUBLIC_ROLE_REQUISITE_CODE SYSRES_CONST_IS_REMOTE_USER_NEGATIVE_VALUE SYSRES_CONST_IS_REMOTE_USER_POSITIVE_VALUE SYSRES_CONST_IS_STORED_REQUISITE_NEGATIVE_VALUE SYSRES_CONST_IS_STORED_REQUISITE_STORED_VALUE SYSRES_CONST_ITALIC_LIFE_CYCLE_STAGE_DRAW_STYLE SYSRES_CONST_JOB_BLOCK_DESCRIPTION SYSRES_CONST_JOB_KIND_CONTROL_JOB SYSRES_CONST_JOB_KIND_JOB SYSRES_CONST_JOB_KIND_NOTICE SYSRES_CONST_JOB_STATE_ABORTED SYSRES_CONST_JOB_STATE_COMPLETE SYSRES_CONST_JOB_STATE_WORKING SYSRES_CONST_KIND_REQUISITE_CODE SYSRES_CONST_KIND_REQUISITE_NAME SYSRES_CONST_KINDS_CREATE_SHADOW_COPIES_REQUISITE_CODE SYSRES_CONST_KINDS_DEFAULT_EDOC_LIFE_STAGE_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_ALL_TEPLATES_ALLOWED_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_ALLOW_LIFE_CYCLE_STAGE_CHANGING_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_ALLOW_MULTIPLE_ACTIVE_VERSIONS_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_SHARE_ACCES_RIGHTS_BY_DEFAULT_CODE SYSRES_CONST_KINDS_EDOC_TEMPLATE_REQUISITE_CODE SYSRES_CONST_KINDS_EDOC_TYPE_REQUISITE_CODE SYSRES_CONST_KINDS_SIGNERS_REQUISITES_CODE SYSRES_CONST_KOD_INPUT_TYPE SYSRES_CONST_LAST_UPDATE_DATE_REQUISITE_CODE SYSRES_CONST_LIFE_CYCLE_START_STAGE_REQUISITE_CODE SYSRES_CONST_LILAC_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_LINK_OBJECT_KIND_COMPONENT SYSRES_CONST_LINK_OBJECT_KIND_DOCUMENT SYSRES_CONST_LINK_OBJECT_KIND_EDOC SYSRES_CONST_LINK_OBJECT_KIND_FOLDER SYSRES_CONST_LINK_OBJECT_KIND_JOB SYSRES_CONST_LINK_OBJECT_KIND_REFERENCE SYSRES_CONST_LINK_OBJECT_KIND_TASK SYSRES_CONST_LINK_REF_TYPE_REQUISITE_CODE SYSRES_CONST_LIST_REFERENCE_MODE_NAME SYSRES_CONST_LOCALIZATION_DICTIONARY_MAIN_VIEW_CODE SYSRES_CONST_MAIN_VIEW_CODE SYSRES_CONST_MANUAL_ENUM_METHOD_FLAG SYSRES_CONST_MASTER_COMP_TYPE_REQUISITE_CODE SYSRES_CONST_MASTER_TABLE_REC_ID_REQUISITE_CODE SYSRES_CONST_MAXIMIZED_MODE_NAME SYSRES_CONST_ME_VALUE SYSRES_CONST_MESSAGE_ATTENTION_CAPTION SYSRES_CONST_MESSAGE_CONFIRMATION_CAPTION SYSRES_CONST_MESSAGE_ERROR_CAPTION SYSRES_CONST_MESSAGE_INFORMATION_CAPTION SYSRES_CONST_MINIMIZED_MODE_NAME SYSRES_CONST_MINUTE_CHAR SYSRES_CONST_MODULE_REQUISITE_CODE SYSRES_CONST_MONITORING_BLOCK_DESCRIPTION SYSRES_CONST_MONTH_FORMAT_VALUE SYSRES_CONST_NAME_LOCALIZE_ID_REQUISITE_CODE SYSRES_CONST_NAME_REQUISITE_CODE SYSRES_CONST_NAME_SINGULAR_REQUISITE_CODE SYSRES_CONST_NAMEAN_INPUT_TYPE SYSRES_CONST_NEGATIVE_PICK_VALUE SYSRES_CONST_NEGATIVE_VALUE SYSRES_CONST_NO SYSRES_CONST_NO_PICK_VALUE SYSRES_CONST_NO_SIGNATURE_REQUISITE_CODE SYSRES_CONST_NO_VALUE SYSRES_CONST_NONE_ACCESS_RIGHTS_TYPE_CODE SYSRES_CONST_NONOPERATING_RECORD_FLAG_VALUE SYSRES_CONST_NONOPERATING_RECORD_FLAG_VALUE_MASCULINE SYSRES_CONST_NORMAL_ACCESS_RIGHTS_TYPE_CODE SYSRES_CONST_NORMAL_LIFE_CYCLE_STAGE_DRAW_STYLE SYSRES_CONST_NORMAL_MODE_NAME SYSRES_CONST_NOT_ALLOWED_ACCESS_TYPE_CODE SYSRES_CONST_NOT_ALLOWED_ACCESS_TYPE_NAME SYSRES_CONST_NOTE_REQUISITE_CODE SYSRES_CONST_NOTICE_BLOCK_DESCRIPTION SYSRES_CONST_NUM_REQUISITE SYSRES_CONST_NUM_STR_REQUISITE_CODE SYSRES_CONST_NUMERATION_AUTO_NOT_STRONG SYSRES_CONST_NUMERATION_AUTO_STRONG SYSRES_CONST_NUMERATION_FROM_DICTONARY SYSRES_CONST_NUMERATION_MANUAL SYSRES_CONST_NUMERIC_TYPE_CHAR SYSRES_CONST_NUMREQ_REQUISITE_CODE SYSRES_CONST_OBSOLETE_VERSION_STATE_PICK_VALUE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE_CODE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE_FEMININE SYSRES_CONST_OPERATING_RECORD_FLAG_VALUE_MASCULINE SYSRES_CONST_OPTIONAL_FORM_COMP_REQCODE_PREFIX SYSRES_CONST_ORANGE_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_ORIGINALREF_REQUISITE_CODE SYSRES_CONST_OURFIRM_REF_CODE SYSRES_CONST_OURFIRM_REQUISITE_CODE SYSRES_CONST_OURFIRM_VAR SYSRES_CONST_OUTGOING_WORK_RULE_TYPE_CODE SYSRES_CONST_PICK_NEGATIVE_RESULT SYSRES_CONST_PICK_POSITIVE_RESULT SYSRES_CONST_PICK_REQUISITE SYSRES_CONST_PICK_REQUISITE_TYPE SYSRES_CONST_PICK_TYPE_CHAR SYSRES_CONST_PLAN_STATUS_REQUISITE_CODE SYSRES_CONST_PLATFORM_VERSION_COMMENT SYSRES_CONST_PLUGINS_SETTINGS_DESCRIPTION_REQUISITE_CODE SYSRES_CONST_POSITIVE_PICK_VALUE SYSRES_CONST_POWER_TO_CREATE_ACTION_CODE SYSRES_CONST_POWER_TO_SIGN_ACTION_CODE SYSRES_CONST_PRIORITY_REQUISITE_CODE SYSRES_CONST_QUALIFIED_TASK_TYPE SYSRES_CONST_QUALIFIED_TASK_TYPE_CODE SYSRES_CONST_RECSTAT_REQUISITE_CODE SYSRES_CONST_RED_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_REF_ID_T_REF_TYPE_REQUISITE_CODE SYSRES_CONST_REF_REQUISITE SYSRES_CONST_REF_REQUISITE_TYPE SYSRES_CONST_REF_REQUISITES_REFERENCE_CODE_SELECTED_REQUISITE SYSRES_CONST_REFERENCE_RECORD_HISTORY_CREATE_ACTION_CODE SYSRES_CONST_REFERENCE_RECORD_HISTORY_DELETE_ACTION_CODE SYSRES_CONST_REFERENCE_RECORD_HISTORY_MODIFY_ACTION_CODE SYSRES_CONST_REFERENCE_TYPE_CHAR SYSRES_CONST_REFERENCE_TYPE_REQUISITE_NAME SYSRES_CONST_REFERENCES_ADD_PARAMS_REQUISITE_CODE SYSRES_CONST_REFERENCES_DISPLAY_REQUISITE_REQUISITE_CODE SYSRES_CONST_REMOTE_SERVER_STATUS_WORKING SYSRES_CONST_REMOTE_SERVER_TYPE_MAIN SYSRES_CONST_REMOTE_SERVER_TYPE_SECONDARY SYSRES_CONST_REMOTE_USER_FLAG_VALUE_CODE SYSRES_CONST_REPORT_APP_EDITOR_INTERNAL SYSRES_CONST_REPORT_BASE_REPORT_ID_REQUISITE_CODE SYSRES_CONST_REPORT_BASE_REPORT_REQUISITE_CODE SYSRES_CONST_REPORT_SCRIPT_REQUISITE_CODE SYSRES_CONST_REPORT_TEMPLATE_REQUISITE_CODE SYSRES_CONST_REPORT_VIEWER_CODE_REQUISITE_CODE SYSRES_CONST_REQ_ALLOW_COMPONENT_DEFAULT_VALUE SYSRES_CONST_REQ_ALLOW_RECORD_DEFAULT_VALUE SYSRES_CONST_REQ_ALLOW_SERVER_COMPONENT_DEFAULT_VALUE SYSRES_CONST_REQ_MODE_AVAILABLE_CODE SYSRES_CONST_REQ_MODE_EDIT_CODE SYSRES_CONST_REQ_MODE_HIDDEN_CODE SYSRES_CONST_REQ_MODE_NOT_AVAILABLE_CODE SYSRES_CONST_REQ_MODE_VIEW_CODE SYSRES_CONST_REQ_NUMBER_REQUISITE_CODE SYSRES_CONST_REQ_SECTION_VALUE SYSRES_CONST_REQ_TYPE_VALUE SYSRES_CONST_REQUISITE_FORMAT_BY_UNIT SYSRES_CONST_REQUISITE_FORMAT_DATE_FULL SYSRES_CONST_REQUISITE_FORMAT_DATE_TIME SYSRES_CONST_REQUISITE_FORMAT_LEFT SYSRES_CONST_REQUISITE_FORMAT_RIGHT SYSRES_CONST_REQUISITE_FORMAT_WITHOUT_UNIT SYSRES_CONST_REQUISITE_NUMBER_REQUISITE_CODE SYSRES_CONST_REQUISITE_SECTION_ACTIONS SYSRES_CONST_REQUISITE_SECTION_BUTTON SYSRES_CONST_REQUISITE_SECTION_BUTTONS SYSRES_CONST_REQUISITE_SECTION_CARD SYSRES_CONST_REQUISITE_SECTION_TABLE SYSRES_CONST_REQUISITE_SECTION_TABLE10 SYSRES_CONST_REQUISITE_SECTION_TABLE11 SYSRES_CONST_REQUISITE_SECTION_TABLE12 SYSRES_CONST_REQUISITE_SECTION_TABLE13 SYSRES_CONST_REQUISITE_SECTION_TABLE14 SYSRES_CONST_REQUISITE_SECTION_TABLE15 SYSRES_CONST_REQUISITE_SECTION_TABLE16 SYSRES_CONST_REQUISITE_SECTION_TABLE17 SYSRES_CONST_REQUISITE_SECTION_TABLE18 SYSRES_CONST_REQUISITE_SECTION_TABLE19 SYSRES_CONST_REQUISITE_SECTION_TABLE2 SYSRES_CONST_REQUISITE_SECTION_TABLE20 SYSRES_CONST_REQUISITE_SECTION_TABLE21 SYSRES_CONST_REQUISITE_SECTION_TABLE22 SYSRES_CONST_REQUISITE_SECTION_TABLE23 SYSRES_CONST_REQUISITE_SECTION_TABLE24 SYSRES_CONST_REQUISITE_SECTION_TABLE3 SYSRES_CONST_REQUISITE_SECTION_TABLE4 SYSRES_CONST_REQUISITE_SECTION_TABLE5 SYSRES_CONST_REQUISITE_SECTION_TABLE6 SYSRES_CONST_REQUISITE_SECTION_TABLE7 SYSRES_CONST_REQUISITE_SECTION_TABLE8 SYSRES_CONST_REQUISITE_SECTION_TABLE9 SYSRES_CONST_REQUISITES_PSEUDOREFERENCE_REQUISITE_NUMBER_REQUISITE_CODE SYSRES_CONST_RIGHT_ALIGNMENT_CODE SYSRES_CONST_ROLES_REFERENCE_CODE SYSRES_CONST_ROUTE_STEP_AFTER_RUS SYSRES_CONST_ROUTE_STEP_AND_CONDITION_RUS SYSRES_CONST_ROUTE_STEP_OR_CONDITION_RUS SYSRES_CONST_ROUTE_TYPE_COMPLEX SYSRES_CONST_ROUTE_TYPE_PARALLEL SYSRES_CONST_ROUTE_TYPE_SERIAL SYSRES_CONST_SBDATASETDESC_NEGATIVE_VALUE SYSRES_CONST_SBDATASETDESC_POSITIVE_VALUE SYSRES_CONST_SBVIEWSDESC_POSITIVE_VALUE SYSRES_CONST_SCRIPT_BLOCK_DESCRIPTION SYSRES_CONST_SEARCH_BY_TEXT_REQUISITE_CODE SYSRES_CONST_SEARCHES_COMPONENT_CONTENT SYSRES_CONST_SEARCHES_CRITERIA_ACTION_NAME SYSRES_CONST_SEARCHES_EDOC_CONTENT SYSRES_CONST_SEARCHES_FOLDER_CONTENT SYSRES_CONST_SEARCHES_JOB_CONTENT SYSRES_CONST_SEARCHES_REFERENCE_CODE SYSRES_CONST_SEARCHES_TASK_CONTENT SYSRES_CONST_SECOND_CHAR SYSRES_CONST_SECTION_REQUISITE_ACTIONS_VALUE SYSRES_CONST_SECTION_REQUISITE_CARD_VALUE SYSRES_CONST_SECTION_REQUISITE_CODE SYSRES_CONST_SECTION_REQUISITE_DETAIL_1_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_2_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_3_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_4_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_5_VALUE SYSRES_CONST_SECTION_REQUISITE_DETAIL_6_VALUE SYSRES_CONST_SELECT_REFERENCE_MODE_NAME SYSRES_CONST_SELECT_TYPE_SELECTABLE SYSRES_CONST_SELECT_TYPE_SELECTABLE_ONLY_CHILD SYSRES_CONST_SELECT_TYPE_SELECTABLE_WITH_CHILD SYSRES_CONST_SELECT_TYPE_UNSLECTABLE SYSRES_CONST_SERVER_TYPE_MAIN SYSRES_CONST_SERVICE_USER_CATEGORY_FIELD_VALUE SYSRES_CONST_SETTINGS_USER_REQUISITE_CODE SYSRES_CONST_SIGNATURE_AND_ENCODE_CERTIFICATE_TYPE_CODE SYSRES_CONST_SIGNATURE_CERTIFICATE_TYPE_CODE SYSRES_CONST_SINGULAR_TITLE_REQUISITE_CODE SYSRES_CONST_SQL_SERVER_AUTHENTIFICATION_FLAG_VALUE_CODE SYSRES_CONST_SQL_SERVER_ENCODE_AUTHENTIFICATION_FLAG_VALUE_CODE SYSRES_CONST_STANDART_ROUTE_REFERENCE_CODE SYSRES_CONST_STANDART_ROUTE_REFERENCE_COMMENT_REQUISITE_CODE SYSRES_CONST_STANDART_ROUTES_GROUPS_REFERENCE_CODE SYSRES_CONST_STATE_REQ_NAME SYSRES_CONST_STATE_REQUISITE_ACTIVE_VALUE SYSRES_CONST_STATE_REQUISITE_CLOSED_VALUE SYSRES_CONST_STATE_REQUISITE_CODE SYSRES_CONST_STATIC_ROLE_TYPE_CODE SYSRES_CONST_STATUS_PLAN_DEFAULT_VALUE SYSRES_CONST_STATUS_VALUE_AUTOCLEANING SYSRES_CONST_STATUS_VALUE_BLUE_SQUARE SYSRES_CONST_STATUS_VALUE_COMPLETE SYSRES_CONST_STATUS_VALUE_GREEN_SQUARE SYSRES_CONST_STATUS_VALUE_ORANGE_SQUARE SYSRES_CONST_STATUS_VALUE_PURPLE_SQUARE SYSRES_CONST_STATUS_VALUE_RED_SQUARE SYSRES_CONST_STATUS_VALUE_SUSPEND SYSRES_CONST_STATUS_VALUE_YELLOW_SQUARE SYSRES_CONST_STDROUTE_SHOW_TO_USERS_REQUISITE_CODE SYSRES_CONST_STORAGE_TYPE_FILE SYSRES_CONST_STORAGE_TYPE_SQL_SERVER SYSRES_CONST_STR_REQUISITE SYSRES_CONST_STRIKEOUT_LIFE_CYCLE_STAGE_DRAW_STYLE SYSRES_CONST_STRING_FORMAT_LEFT_ALIGN_CHAR SYSRES_CONST_STRING_FORMAT_RIGHT_ALIGN_CHAR SYSRES_CONST_STRING_REQUISITE_CODE SYSRES_CONST_STRING_REQUISITE_TYPE SYSRES_CONST_STRING_TYPE_CHAR SYSRES_CONST_SUBSTITUTES_PSEUDOREFERENCE_CODE SYSRES_CONST_SUBTASK_BLOCK_DESCRIPTION SYSRES_CONST_SYSTEM_SETTING_CURRENT_USER_PARAM_VALUE SYSRES_CONST_SYSTEM_SETTING_EMPTY_VALUE_PARAM_VALUE SYSRES_CONST_SYSTEM_VERSION_COMMENT SYSRES_CONST_TASK_ACCESS_TYPE_ALL SYSRES_CONST_TASK_ACCESS_TYPE_ALL_MEMBERS SYSRES_CONST_TASK_ACCESS_TYPE_MANUAL SYSRES_CONST_TASK_ENCODE_TYPE_CERTIFICATION SYSRES_CONST_TASK_ENCODE_TYPE_CERTIFICATION_AND_PASSWORD SYSRES_CONST_TASK_ENCODE_TYPE_NONE SYSRES_CONST_TASK_ENCODE_TYPE_PASSWORD SYSRES_CONST_TASK_ROUTE_ALL_CONDITION SYSRES_CONST_TASK_ROUTE_AND_CONDITION SYSRES_CONST_TASK_ROUTE_OR_CONDITION SYSRES_CONST_TASK_STATE_ABORTED SYSRES_CONST_TASK_STATE_COMPLETE SYSRES_CONST_TASK_STATE_CONTINUED SYSRES_CONST_TASK_STATE_CONTROL SYSRES_CONST_TASK_STATE_INIT SYSRES_CONST_TASK_STATE_WORKING SYSRES_CONST_TASK_TITLE SYSRES_CONST_TASK_TYPES_GROUPS_REFERENCE_CODE SYSRES_CONST_TASK_TYPES_REFERENCE_CODE SYSRES_CONST_TEMPLATES_REFERENCE_CODE SYSRES_CONST_TEST_DATE_REQUISITE_NAME SYSRES_CONST_TEST_DEV_DATABASE_NAME SYSRES_CONST_TEST_DEV_SYSTEM_CODE SYSRES_CONST_TEST_EDMS_DATABASE_NAME SYSRES_CONST_TEST_EDMS_MAIN_CODE SYSRES_CONST_TEST_EDMS_MAIN_DB_NAME SYSRES_CONST_TEST_EDMS_SECOND_CODE SYSRES_CONST_TEST_EDMS_SECOND_DB_NAME SYSRES_CONST_TEST_EDMS_SYSTEM_CODE SYSRES_CONST_TEST_NUMERIC_REQUISITE_NAME SYSRES_CONST_TEXT_REQUISITE SYSRES_CONST_TEXT_REQUISITE_CODE SYSRES_CONST_TEXT_REQUISITE_TYPE SYSRES_CONST_TEXT_TYPE_CHAR SYSRES_CONST_TYPE_CODE_REQUISITE_CODE SYSRES_CONST_TYPE_REQUISITE_CODE SYSRES_CONST_UNDEFINED_LIFE_CYCLE_STAGE_FONT_COLOR SYSRES_CONST_UNITS_SECTION_ID_REQUISITE_CODE SYSRES_CONST_UNITS_SECTION_REQUISITE_CODE SYSRES_CONST_UNOPERATING_RECORD_FLAG_VALUE_CODE SYSRES_CONST_UNSTORED_DATA_REQUISITE_CODE SYSRES_CONST_UNSTORED_DATA_REQUISITE_NAME SYSRES_CONST_USE_ACCESS_TYPE_CODE SYSRES_CONST_USE_ACCESS_TYPE_NAME SYSRES_CONST_USER_ACCOUNT_TYPE_VALUE_CODE SYSRES_CONST_USER_ADDITIONAL_INFORMATION_REQUISITE_CODE SYSRES_CONST_USER_AND_GROUP_ID_FROM_PSEUDOREFERENCE_REQUISITE_CODE SYSRES_CONST_USER_CATEGORY_NORMAL SYSRES_CONST_USER_CERTIFICATE_REQUISITE_CODE SYSRES_CONST_USER_CERTIFICATE_STATE_REQUISITE_CODE SYSRES_CONST_USER_CERTIFICATE_SUBJECT_NAME_REQUISITE_CODE SYSRES_CONST_USER_CERTIFICATE_THUMBPRINT_REQUISITE_CODE SYSRES_CONST_USER_COMMON_CATEGORY SYSRES_CONST_USER_COMMON_CATEGORY_CODE SYSRES_CONST_USER_FULL_NAME_REQUISITE_CODE SYSRES_CONST_USER_GROUP_TYPE_REQUISITE_CODE SYSRES_CONST_USER_LOGIN_REQUISITE_CODE SYSRES_CONST_USER_REMOTE_CONTROLLER_REQUISITE_CODE SYSRES_CONST_USER_REMOTE_SYSTEM_REQUISITE_CODE SYSRES_CONST_USER_RIGHTS_T_REQUISITE_CODE SYSRES_CONST_USER_SERVER_NAME_REQUISITE_CODE SYSRES_CONST_USER_SERVICE_CATEGORY SYSRES_CONST_USER_SERVICE_CATEGORY_CODE SYSRES_CONST_USER_STATUS_ADMINISTRATOR_CODE SYSRES_CONST_USER_STATUS_ADMINISTRATOR_NAME SYSRES_CONST_USER_STATUS_DEVELOPER_CODE SYSRES_CONST_USER_STATUS_DEVELOPER_NAME SYSRES_CONST_USER_STATUS_DISABLED_CODE SYSRES_CONST_USER_STATUS_DISABLED_NAME SYSRES_CONST_USER_STATUS_SYSTEM_DEVELOPER_CODE SYSRES_CONST_USER_STATUS_USER_CODE SYSRES_CONST_USER_STATUS_USER_NAME SYSRES_CONST_USER_STATUS_USER_NAME_DEPRECATED SYSRES_CONST_USER_TYPE_FIELD_VALUE_USER SYSRES_CONST_USER_TYPE_REQUISITE_CODE SYSRES_CONST_USERS_CONTROLLER_REQUISITE_CODE SYSRES_CONST_USERS_IS_MAIN_SERVER_REQUISITE_CODE SYSRES_CONST_USERS_REFERENCE_CODE SYSRES_CONST_USERS_REGISTRATION_CERTIFICATES_ACTION_NAME SYSRES_CONST_USERS_REQUISITE_CODE SYSRES_CONST_USERS_SYSTEM_REQUISITE_CODE SYSRES_CONST_USERS_USER_ACCESS_RIGHTS_TYPR_REQUISITE_CODE SYSRES_CONST_USERS_USER_AUTHENTICATION_REQUISITE_CODE SYSRES_CONST_USERS_USER_COMPONENT_REQUISITE_CODE SYSRES_CONST_USERS_USER_GROUP_REQUISITE_CODE SYSRES_CONST_USERS_VIEW_CERTIFICATES_ACTION_NAME SYSRES_CONST_VIEW_DEFAULT_CODE SYSRES_CONST_VIEW_DEFAULT_NAME SYSRES_CONST_VIEWER_REQUISITE_CODE SYSRES_CONST_WAITING_BLOCK_DESCRIPTION SYSRES_CONST_WIZARD_FORM_LABEL_TEST_STRING  SYSRES_CONST_WIZARD_QUERY_PARAM_HEIGHT_ETALON_STRING SYSRES_CONST_WIZARD_REFERENCE_COMMENT_REQUISITE_CODE SYSRES_CONST_WORK_RULES_DESCRIPTION_REQUISITE_CODE SYSRES_CONST_WORK_TIME_CALENDAR_REFERENCE_CODE SYSRES_CONST_WORK_WORKFLOW_HARD_ROUTE_TYPE_VALUE SYSRES_CONST_WORK_WORKFLOW_HARD_ROUTE_TYPE_VALUE_CODE SYSRES_CONST_WORK_WORKFLOW_HARD_ROUTE_TYPE_VALUE_CODE_RUS SYSRES_CONST_WORK_WORKFLOW_SOFT_ROUTE_TYPE_VALUE_CODE_RUS SYSRES_CONST_WORKFLOW_ROUTE_TYPR_HARD SYSRES_CONST_WORKFLOW_ROUTE_TYPR_SOFT SYSRES_CONST_XML_ENCODING SYSRES_CONST_XREC_STAT_REQUISITE_CODE SYSRES_CONST_XRECID_FIELD_NAME SYSRES_CONST_YES SYSRES_CONST_YES_NO_2_REQUISITE_CODE SYSRES_CONST_YES_NO_REQUISITE_CODE SYSRES_CONST_YES_NO_T_REF_TYPE_REQUISITE_CODE SYSRES_CONST_YES_PICK_VALUE SYSRES_CONST_YES_VALUE " + "CR FALSE nil NO_VALUE NULL TAB TRUE YES_VALUE " + "ADMINISTRATORS_GROUP_NAME CUSTOMIZERS_GROUP_NAME DEVELOPERS_GROUP_NAME SERVICE_USERS_GROUP_NAME " + "DECISION_BLOCK_FIRST_OPERAND_PROPERTY DECISION_BLOCK_NAME_PROPERTY DECISION_BLOCK_OPERATION_PROPERTY DECISION_BLOCK_RESULT_TYPE_PROPERTY DECISION_BLOCK_SECOND_OPERAND_PROPERTY " + "ANY_FILE_EXTENTION COMPRESSED_DOCUMENT_EXTENSION EXTENDED_DOCUMENT_EXTENSION SHORT_COMPRESSED_DOCUMENT_EXTENSION SHORT_EXTENDED_DOCUMENT_EXTENSION " + "JOB_BLOCK_ABORT_DEADLINE_PROPERTY JOB_BLOCK_AFTER_FINISH_EVENT JOB_BLOCK_AFTER_QUERY_PARAMETERS_EVENT JOB_BLOCK_ATTACHMENT_PROPERTY JOB_BLOCK_ATTACHMENTS_RIGHTS_GROUP_PROPERTY JOB_BLOCK_ATTACHMENTS_RIGHTS_TYPE_PROPERTY JOB_BLOCK_BEFORE_QUERY_PARAMETERS_EVENT JOB_BLOCK_BEFORE_START_EVENT JOB_BLOCK_CREATED_JOBS_PROPERTY JOB_BLOCK_DEADLINE_PROPERTY JOB_BLOCK_EXECUTION_RESULTS_PROPERTY JOB_BLOCK_IS_PARALLEL_PROPERTY JOB_BLOCK_IS_RELATIVE_ABORT_DEADLINE_PROPERTY JOB_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY JOB_BLOCK_JOB_TEXT_PROPERTY JOB_BLOCK_NAME_PROPERTY JOB_BLOCK_NEED_SIGN_ON_PERFORM_PROPERTY JOB_BLOCK_PERFORMER_PROPERTY JOB_BLOCK_RELATIVE_ABORT_DEADLINE_TYPE_PROPERTY JOB_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY JOB_BLOCK_SUBJECT_PROPERTY " + "ENGLISH_LANGUAGE_CODE RUSSIAN_LANGUAGE_CODE " + "smHidden smMaximized smMinimized smNormal wmNo wmYes " + "COMPONENT_TOKEN_LINK_KIND DOCUMENT_LINK_KIND EDOCUMENT_LINK_KIND FOLDER_LINK_KIND JOB_LINK_KIND REFERENCE_LINK_KIND TASK_LINK_KIND " + "COMPONENT_TOKEN_LOCK_TYPE EDOCUMENT_VERSION_LOCK_TYPE " + "MONITOR_BLOCK_AFTER_FINISH_EVENT MONITOR_BLOCK_BEFORE_START_EVENT MONITOR_BLOCK_DEADLINE_PROPERTY MONITOR_BLOCK_INTERVAL_PROPERTY MONITOR_BLOCK_INTERVAL_TYPE_PROPERTY MONITOR_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY MONITOR_BLOCK_NAME_PROPERTY MONITOR_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY MONITOR_BLOCK_SEARCH_SCRIPT_PROPERTY " + "NOTICE_BLOCK_AFTER_FINISH_EVENT NOTICE_BLOCK_ATTACHMENT_PROPERTY NOTICE_BLOCK_ATTACHMENTS_RIGHTS_GROUP_PROPERTY NOTICE_BLOCK_ATTACHMENTS_RIGHTS_TYPE_PROPERTY NOTICE_BLOCK_BEFORE_START_EVENT NOTICE_BLOCK_CREATED_NOTICES_PROPERTY NOTICE_BLOCK_DEADLINE_PROPERTY NOTICE_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY NOTICE_BLOCK_NAME_PROPERTY NOTICE_BLOCK_NOTICE_TEXT_PROPERTY NOTICE_BLOCK_PERFORMER_PROPERTY NOTICE_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY NOTICE_BLOCK_SUBJECT_PROPERTY " + "dseAfterCancel dseAfterClose dseAfterDelete dseAfterDeleteOutOfTransaction dseAfterInsert dseAfterOpen dseAfterScroll dseAfterUpdate dseAfterUpdateOutOfTransaction dseBeforeCancel dseBeforeClose dseBeforeDelete dseBeforeDetailUpdate dseBeforeInsert dseBeforeOpen dseBeforeUpdate dseOnAnyRequisiteChange dseOnCloseRecord dseOnDeleteError dseOnOpenRecord dseOnPrepareUpdate dseOnUpdateError dseOnUpdateRatifiedRecord dseOnValidDelete dseOnValidUpdate reOnChange reOnChangeValues SELECTION_BEGIN_ROUTE_EVENT SELECTION_END_ROUTE_EVENT " + "CURRENT_PERIOD_IS_REQUIRED PREVIOUS_CARD_TYPE_NAME SHOW_RECORD_PROPERTIES_FORM " + "ACCESS_RIGHTS_SETTING_DIALOG_CODE ADMINISTRATOR_USER_CODE ANALYTIC_REPORT_TYPE asrtHideLocal asrtHideRemote CALCULATED_ROLE_TYPE_CODE COMPONENTS_REFERENCE_DEVELOPER_VIEW_CODE DCTS_TEST_PROTOCOLS_FOLDER_PATH E_EDOC_VERSION_ALREADY_APPROVINGLY_SIGNED E_EDOC_VERSION_ALREADY_APPROVINGLY_SIGNED_BY_USER E_EDOC_VERSION_ALREDY_SIGNED E_EDOC_VERSION_ALREDY_SIGNED_BY_USER EDOC_TYPES_CODE_REQUISITE_FIELD_NAME EDOCUMENTS_ALIAS_NAME FILES_FOLDER_PATH FILTER_OPERANDS_DELIMITER FILTER_OPERATIONS_DELIMITER FORMCARD_NAME FORMLIST_NAME GET_EXTENDED_DOCUMENT_EXTENSION_CREATION_MODE GET_EXTENDED_DOCUMENT_EXTENSION_IMPORT_MODE INTEGRATED_REPORT_TYPE IS_BUILDER_APPLICATION_ROLE IS_BUILDER_APPLICATION_ROLE2 IS_BUILDER_USERS ISBSYSDEV LOG_FOLDER_PATH mbCancel mbNo mbNoToAll mbOK mbYes mbYesToAll MEMORY_DATASET_DESRIPTIONS_FILENAME mrNo mrNoToAll mrYes mrYesToAll MULTIPLE_SELECT_DIALOG_CODE NONOPERATING_RECORD_FLAG_FEMININE NONOPERATING_RECORD_FLAG_MASCULINE OPERATING_RECORD_FLAG_FEMININE OPERATING_RECORD_FLAG_MASCULINE PROFILING_SETTINGS_COMMON_SETTINGS_CODE_VALUE PROGRAM_INITIATED_LOOKUP_ACTION ratDelete ratEdit ratInsert REPORT_TYPE REQUIRED_PICK_VALUES_VARIABLE rmCard rmList SBRTE_PROGID_DEV SBRTE_PROGID_RELEASE STATIC_ROLE_TYPE_CODE SUPPRESS_EMPTY_TEMPLATE_CREATION SYSTEM_USER_CODE UPDATE_DIALOG_DATASET USED_IN_OBJECT_HINT_PARAM USER_INITIATED_LOOKUP_ACTION USER_NAME_FORMAT USER_SELECTION_RESTRICTIONS WORKFLOW_TEST_PROTOCOLS_FOLDER_PATH ELS_SUBTYPE_CONTROL_NAME ELS_FOLDER_KIND_CONTROL_NAME REPEAT_PROCESS_CURRENT_OBJECT_EXCEPTION_NAME " + "PRIVILEGE_COMPONENT_FULL_ACCESS PRIVILEGE_DEVELOPMENT_EXPORT PRIVILEGE_DEVELOPMENT_IMPORT PRIVILEGE_DOCUMENT_DELETE PRIVILEGE_ESD PRIVILEGE_FOLDER_DELETE PRIVILEGE_MANAGE_ACCESS_RIGHTS PRIVILEGE_MANAGE_REPLICATION PRIVILEGE_MANAGE_SESSION_SERVER PRIVILEGE_OBJECT_FULL_ACCESS PRIVILEGE_OBJECT_VIEW PRIVILEGE_RESERVE_LICENSE PRIVILEGE_SYSTEM_CUSTOMIZE PRIVILEGE_SYSTEM_DEVELOP PRIVILEGE_SYSTEM_INSTALL PRIVILEGE_TASK_DELETE PRIVILEGE_USER_PLUGIN_SETTINGS_CUSTOMIZE PRIVILEGES_PSEUDOREFERENCE_CODE " + "ACCESS_TYPES_PSEUDOREFERENCE_CODE ALL_AVAILABLE_COMPONENTS_PSEUDOREFERENCE_CODE ALL_AVAILABLE_PRIVILEGES_PSEUDOREFERENCE_CODE ALL_REPLICATE_COMPONENTS_PSEUDOREFERENCE_CODE AVAILABLE_DEVELOPERS_COMPONENTS_PSEUDOREFERENCE_CODE COMPONENTS_PSEUDOREFERENCE_CODE FILTRATER_SETTINGS_CONFLICTS_PSEUDOREFERENCE_CODE GROUPS_PSEUDOREFERENCE_CODE RECEIVE_PROTOCOL_PSEUDOREFERENCE_CODE REFERENCE_REQUISITE_PSEUDOREFERENCE_CODE REFERENCE_REQUISITES_PSEUDOREFERENCE_CODE REFTYPES_PSEUDOREFERENCE_CODE REPLICATION_SEANCES_DIARY_PSEUDOREFERENCE_CODE SEND_PROTOCOL_PSEUDOREFERENCE_CODE SUBSTITUTES_PSEUDOREFERENCE_CODE SYSTEM_SETTINGS_PSEUDOREFERENCE_CODE UNITS_PSEUDOREFERENCE_CODE USERS_PSEUDOREFERENCE_CODE VIEWERS_PSEUDOREFERENCE_CODE " + "CERTIFICATE_TYPE_ENCRYPT CERTIFICATE_TYPE_SIGN CERTIFICATE_TYPE_SIGN_AND_ENCRYPT " + "STORAGE_TYPE_FILE STORAGE_TYPE_NAS_CIFS STORAGE_TYPE_SAPERION STORAGE_TYPE_SQL_SERVER " + "COMPTYPE2_REQUISITE_DOCUMENTS_VALUE COMPTYPE2_REQUISITE_TASKS_VALUE COMPTYPE2_REQUISITE_FOLDERS_VALUE COMPTYPE2_REQUISITE_REFERENCES_VALUE " + "SYSREQ_CODE SYSREQ_COMPTYPE2 SYSREQ_CONST_AVAILABLE_FOR_WEB SYSREQ_CONST_COMMON_CODE SYSREQ_CONST_COMMON_VALUE SYSREQ_CONST_FIRM_CODE SYSREQ_CONST_FIRM_STATUS SYSREQ_CONST_FIRM_VALUE SYSREQ_CONST_SERVER_STATUS SYSREQ_CONTENTS SYSREQ_DATE_OPEN SYSREQ_DATE_CLOSE SYSREQ_DESCRIPTION SYSREQ_DESCRIPTION_LOCALIZE_ID SYSREQ_DOUBLE SYSREQ_EDOC_ACCESS_TYPE SYSREQ_EDOC_AUTHOR SYSREQ_EDOC_CREATED SYSREQ_EDOC_DELEGATE_RIGHTS_REQUISITE_CODE SYSREQ_EDOC_EDITOR SYSREQ_EDOC_ENCODE_TYPE SYSREQ_EDOC_ENCRYPTION_PLUGIN_NAME SYSREQ_EDOC_ENCRYPTION_PLUGIN_VERSION SYSREQ_EDOC_EXPORT_DATE SYSREQ_EDOC_EXPORTER SYSREQ_EDOC_KIND SYSREQ_EDOC_LIFE_STAGE_NAME SYSREQ_EDOC_LOCKED_FOR_SERVER_CODE SYSREQ_EDOC_MODIFIED SYSREQ_EDOC_NAME SYSREQ_EDOC_NOTE SYSREQ_EDOC_QUALIFIED_ID SYSREQ_EDOC_SESSION_KEY SYSREQ_EDOC_SESSION_KEY_ENCRYPTION_PLUGIN_NAME SYSREQ_EDOC_SESSION_KEY_ENCRYPTION_PLUGIN_VERSION SYSREQ_EDOC_SIGNATURE_TYPE SYSREQ_EDOC_SIGNED SYSREQ_EDOC_STORAGE SYSREQ_EDOC_STORAGES_ARCHIVE_STORAGE SYSREQ_EDOC_STORAGES_CHECK_RIGHTS SYSREQ_EDOC_STORAGES_COMPUTER_NAME SYSREQ_EDOC_STORAGES_EDIT_IN_STORAGE SYSREQ_EDOC_STORAGES_EXECUTIVE_STORAGE SYSREQ_EDOC_STORAGES_FUNCTION SYSREQ_EDOC_STORAGES_INITIALIZED SYSREQ_EDOC_STORAGES_LOCAL_PATH SYSREQ_EDOC_STORAGES_SAPERION_DATABASE_NAME SYSREQ_EDOC_STORAGES_SEARCH_BY_TEXT SYSREQ_EDOC_STORAGES_SERVER_NAME SYSREQ_EDOC_STORAGES_SHARED_SOURCE_NAME SYSREQ_EDOC_STORAGES_TYPE SYSREQ_EDOC_TEXT_MODIFIED SYSREQ_EDOC_TYPE_ACT_CODE SYSREQ_EDOC_TYPE_ACT_DESCRIPTION SYSREQ_EDOC_TYPE_ACT_DESCRIPTION_LOCALIZE_ID SYSREQ_EDOC_TYPE_ACT_ON_EXECUTE SYSREQ_EDOC_TYPE_ACT_ON_EXECUTE_EXISTS SYSREQ_EDOC_TYPE_ACT_SECTION SYSREQ_EDOC_TYPE_ADD_PARAMS SYSREQ_EDOC_TYPE_COMMENT SYSREQ_EDOC_TYPE_EVENT_TEXT SYSREQ_EDOC_TYPE_NAME_IN_SINGULAR SYSREQ_EDOC_TYPE_NAME_IN_SINGULAR_LOCALIZE_ID SYSREQ_EDOC_TYPE_NAME_LOCALIZE_ID SYSREQ_EDOC_TYPE_NUMERATION_METHOD SYSREQ_EDOC_TYPE_PSEUDO_REQUISITE_CODE SYSREQ_EDOC_TYPE_REQ_CODE SYSREQ_EDOC_TYPE_REQ_DESCRIPTION SYSREQ_EDOC_TYPE_REQ_DESCRIPTION_LOCALIZE_ID SYSREQ_EDOC_TYPE_REQ_IS_LEADING SYSREQ_EDOC_TYPE_REQ_IS_REQUIRED SYSREQ_EDOC_TYPE_REQ_NUMBER SYSREQ_EDOC_TYPE_REQ_ON_CHANGE SYSREQ_EDOC_TYPE_REQ_ON_CHANGE_EXISTS SYSREQ_EDOC_TYPE_REQ_ON_SELECT SYSREQ_EDOC_TYPE_REQ_ON_SELECT_KIND SYSREQ_EDOC_TYPE_REQ_SECTION SYSREQ_EDOC_TYPE_VIEW_CARD SYSREQ_EDOC_TYPE_VIEW_CODE SYSREQ_EDOC_TYPE_VIEW_COMMENT SYSREQ_EDOC_TYPE_VIEW_IS_MAIN SYSREQ_EDOC_TYPE_VIEW_NAME SYSREQ_EDOC_TYPE_VIEW_NAME_LOCALIZE_ID SYSREQ_EDOC_VERSION_AUTHOR SYSREQ_EDOC_VERSION_CRC SYSREQ_EDOC_VERSION_DATA SYSREQ_EDOC_VERSION_EDITOR SYSREQ_EDOC_VERSION_EXPORT_DATE SYSREQ_EDOC_VERSION_EXPORTER SYSREQ_EDOC_VERSION_HIDDEN SYSREQ_EDOC_VERSION_LIFE_STAGE SYSREQ_EDOC_VERSION_MODIFIED SYSREQ_EDOC_VERSION_NOTE SYSREQ_EDOC_VERSION_SIGNATURE_TYPE SYSREQ_EDOC_VERSION_SIGNED SYSREQ_EDOC_VERSION_SIZE SYSREQ_EDOC_VERSION_SOURCE SYSREQ_EDOC_VERSION_TEXT_MODIFIED SYSREQ_EDOCKIND_DEFAULT_VERSION_STATE_CODE SYSREQ_FOLDER_KIND SYSREQ_FUNC_CATEGORY SYSREQ_FUNC_COMMENT SYSREQ_FUNC_GROUP SYSREQ_FUNC_GROUP_COMMENT SYSREQ_FUNC_GROUP_NUMBER SYSREQ_FUNC_HELP SYSREQ_FUNC_PARAM_DEF_VALUE SYSREQ_FUNC_PARAM_IDENT SYSREQ_FUNC_PARAM_NUMBER SYSREQ_FUNC_PARAM_TYPE SYSREQ_FUNC_TEXT SYSREQ_GROUP_CATEGORY SYSREQ_ID SYSREQ_LAST_UPDATE SYSREQ_LEADER_REFERENCE SYSREQ_LINE_NUMBER SYSREQ_MAIN_RECORD_ID SYSREQ_NAME SYSREQ_NAME_LOCALIZE_ID SYSREQ_NOTE SYSREQ_ORIGINAL_RECORD SYSREQ_OUR_FIRM SYSREQ_PROFILING_SETTINGS_BATCH_LOGING SYSREQ_PROFILING_SETTINGS_BATCH_SIZE SYSREQ_PROFILING_SETTINGS_PROFILING_ENABLED SYSREQ_PROFILING_SETTINGS_SQL_PROFILING_ENABLED SYSREQ_PROFILING_SETTINGS_START_LOGGED SYSREQ_RECORD_STATUS SYSREQ_REF_REQ_FIELD_NAME SYSREQ_REF_REQ_FORMAT SYSREQ_REF_REQ_GENERATED SYSREQ_REF_REQ_LENGTH SYSREQ_REF_REQ_PRECISION SYSREQ_REF_REQ_REFERENCE SYSREQ_REF_REQ_SECTION SYSREQ_REF_REQ_STORED SYSREQ_REF_REQ_TOKENS SYSREQ_REF_REQ_TYPE SYSREQ_REF_REQ_VIEW SYSREQ_REF_TYPE_ACT_CODE SYSREQ_REF_TYPE_ACT_DESCRIPTION SYSREQ_REF_TYPE_ACT_DESCRIPTION_LOCALIZE_ID SYSREQ_REF_TYPE_ACT_ON_EXECUTE SYSREQ_REF_TYPE_ACT_ON_EXECUTE_EXISTS SYSREQ_REF_TYPE_ACT_SECTION SYSREQ_REF_TYPE_ADD_PARAMS SYSREQ_REF_TYPE_COMMENT SYSREQ_REF_TYPE_COMMON_SETTINGS SYSREQ_REF_TYPE_DISPLAY_REQUISITE_NAME SYSREQ_REF_TYPE_EVENT_TEXT SYSREQ_REF_TYPE_MAIN_LEADING_REF SYSREQ_REF_TYPE_NAME_IN_SINGULAR SYSREQ_REF_TYPE_NAME_IN_SINGULAR_LOCALIZE_ID SYSREQ_REF_TYPE_NAME_LOCALIZE_ID SYSREQ_REF_TYPE_NUMERATION_METHOD SYSREQ_REF_TYPE_REQ_CODE SYSREQ_REF_TYPE_REQ_DESCRIPTION SYSREQ_REF_TYPE_REQ_DESCRIPTION_LOCALIZE_ID SYSREQ_REF_TYPE_REQ_IS_CONTROL SYSREQ_REF_TYPE_REQ_IS_FILTER SYSREQ_REF_TYPE_REQ_IS_LEADING SYSREQ_REF_TYPE_REQ_IS_REQUIRED SYSREQ_REF_TYPE_REQ_NUMBER SYSREQ_REF_TYPE_REQ_ON_CHANGE SYSREQ_REF_TYPE_REQ_ON_CHANGE_EXISTS SYSREQ_REF_TYPE_REQ_ON_SELECT SYSREQ_REF_TYPE_REQ_ON_SELECT_KIND SYSREQ_REF_TYPE_REQ_SECTION SYSREQ_REF_TYPE_VIEW_CARD SYSREQ_REF_TYPE_VIEW_CODE SYSREQ_REF_TYPE_VIEW_COMMENT SYSREQ_REF_TYPE_VIEW_IS_MAIN SYSREQ_REF_TYPE_VIEW_NAME SYSREQ_REF_TYPE_VIEW_NAME_LOCALIZE_ID SYSREQ_REFERENCE_TYPE_ID SYSREQ_STATE SYSREQ_STATЕ SYSREQ_SYSTEM_SETTINGS_VALUE SYSREQ_TYPE SYSREQ_UNIT SYSREQ_UNIT_ID SYSREQ_USER_GROUPS_GROUP_FULL_NAME SYSREQ_USER_GROUPS_GROUP_NAME SYSREQ_USER_GROUPS_GROUP_SERVER_NAME SYSREQ_USERS_ACCESS_RIGHTS SYSREQ_USERS_AUTHENTICATION SYSREQ_USERS_CATEGORY SYSREQ_USERS_COMPONENT SYSREQ_USERS_COMPONENT_USER_IS_PUBLIC SYSREQ_USERS_DOMAIN SYSREQ_USERS_FULL_USER_NAME SYSREQ_USERS_GROUP SYSREQ_USERS_IS_MAIN_SERVER SYSREQ_USERS_LOGIN SYSREQ_USERS_REFERENCE_USER_IS_PUBLIC SYSREQ_USERS_STATUS SYSREQ_USERS_USER_CERTIFICATE SYSREQ_USERS_USER_CERTIFICATE_INFO SYSREQ_USERS_USER_CERTIFICATE_PLUGIN_NAME SYSREQ_USERS_USER_CERTIFICATE_PLUGIN_VERSION SYSREQ_USERS_USER_CERTIFICATE_STATE SYSREQ_USERS_USER_CERTIFICATE_SUBJECT_NAME SYSREQ_USERS_USER_CERTIFICATE_THUMBPRINT SYSREQ_USERS_USER_DEFAULT_CERTIFICATE SYSREQ_USERS_USER_DESCRIPTION SYSREQ_USERS_USER_GLOBAL_NAME SYSREQ_USERS_USER_LOGIN SYSREQ_USERS_USER_MAIN_SERVER SYSREQ_USERS_USER_TYPE SYSREQ_WORK_RULES_FOLDER_ID " + "RESULT_VAR_NAME RESULT_VAR_NAME_ENG " + "AUTO_NUMERATION_RULE_ID CANT_CHANGE_ID_REQUISITE_RULE_ID CANT_CHANGE_OURFIRM_REQUISITE_RULE_ID CHECK_CHANGING_REFERENCE_RECORD_USE_RULE_ID CHECK_CODE_REQUISITE_RULE_ID CHECK_DELETING_REFERENCE_RECORD_USE_RULE_ID CHECK_FILTRATER_CHANGES_RULE_ID CHECK_RECORD_INTERVAL_RULE_ID CHECK_REFERENCE_INTERVAL_RULE_ID CHECK_REQUIRED_DATA_FULLNESS_RULE_ID CHECK_REQUIRED_REQUISITES_FULLNESS_RULE_ID MAKE_RECORD_UNRATIFIED_RULE_ID RESTORE_AUTO_NUMERATION_RULE_ID SET_FIRM_CONTEXT_FROM_RECORD_RULE_ID SET_FIRST_RECORD_IN_LIST_FORM_RULE_ID SET_IDSPS_VALUE_RULE_ID SET_NEXT_CODE_VALUE_RULE_ID SET_OURFIRM_BOUNDS_RULE_ID SET_OURFIRM_REQUISITE_RULE_ID " + "SCRIPT_BLOCK_AFTER_FINISH_EVENT SCRIPT_BLOCK_BEFORE_START_EVENT SCRIPT_BLOCK_EXECUTION_RESULTS_PROPERTY SCRIPT_BLOCK_NAME_PROPERTY SCRIPT_BLOCK_SCRIPT_PROPERTY " + "SUBTASK_BLOCK_ABORT_DEADLINE_PROPERTY SUBTASK_BLOCK_AFTER_FINISH_EVENT SUBTASK_BLOCK_ASSIGN_PARAMS_EVENT SUBTASK_BLOCK_ATTACHMENTS_PROPERTY SUBTASK_BLOCK_ATTACHMENTS_RIGHTS_GROUP_PROPERTY SUBTASK_BLOCK_ATTACHMENTS_RIGHTS_TYPE_PROPERTY SUBTASK_BLOCK_BEFORE_START_EVENT SUBTASK_BLOCK_CREATED_TASK_PROPERTY SUBTASK_BLOCK_CREATION_EVENT SUBTASK_BLOCK_DEADLINE_PROPERTY SUBTASK_BLOCK_IMPORTANCE_PROPERTY SUBTASK_BLOCK_INITIATOR_PROPERTY SUBTASK_BLOCK_IS_RELATIVE_ABORT_DEADLINE_PROPERTY SUBTASK_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY SUBTASK_BLOCK_JOBS_TYPE_PROPERTY SUBTASK_BLOCK_NAME_PROPERTY SUBTASK_BLOCK_PARALLEL_ROUTE_PROPERTY SUBTASK_BLOCK_PERFORMERS_PROPERTY SUBTASK_BLOCK_RELATIVE_ABORT_DEADLINE_TYPE_PROPERTY SUBTASK_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY SUBTASK_BLOCK_REQUIRE_SIGN_PROPERTY SUBTASK_BLOCK_STANDARD_ROUTE_PROPERTY SUBTASK_BLOCK_START_EVENT SUBTASK_BLOCK_STEP_CONTROL_PROPERTY SUBTASK_BLOCK_SUBJECT_PROPERTY SUBTASK_BLOCK_TASK_CONTROL_PROPERTY SUBTASK_BLOCK_TEXT_PROPERTY SUBTASK_BLOCK_UNLOCK_ATTACHMENTS_ON_STOP_PROPERTY SUBTASK_BLOCK_USE_STANDARD_ROUTE_PROPERTY SUBTASK_BLOCK_WAIT_FOR_TASK_COMPLETE_PROPERTY " + "SYSCOMP_CONTROL_JOBS SYSCOMP_FOLDERS SYSCOMP_JOBS SYSCOMP_NOTICES SYSCOMP_TASKS " + "SYSDLG_CREATE_EDOCUMENT SYSDLG_CREATE_EDOCUMENT_VERSION SYSDLG_CURRENT_PERIOD SYSDLG_EDIT_FUNCTION_HELP SYSDLG_EDOCUMENT_KINDS_FOR_TEMPLATE SYSDLG_EXPORT_MULTIPLE_EDOCUMENTS SYSDLG_EXPORT_SINGLE_EDOCUMENT SYSDLG_IMPORT_EDOCUMENT SYSDLG_MULTIPLE_SELECT SYSDLG_SETUP_ACCESS_RIGHTS SYSDLG_SETUP_DEFAULT_RIGHTS SYSDLG_SETUP_FILTER_CONDITION SYSDLG_SETUP_SIGN_RIGHTS SYSDLG_SETUP_TASK_OBSERVERS SYSDLG_SETUP_TASK_ROUTE SYSDLG_SETUP_USERS_LIST SYSDLG_SIGN_EDOCUMENT SYSDLG_SIGN_MULTIPLE_EDOCUMENTS " + "SYSREF_ACCESS_RIGHTS_TYPES SYSREF_ADMINISTRATION_HISTORY SYSREF_ALL_AVAILABLE_COMPONENTS SYSREF_ALL_AVAILABLE_PRIVILEGES SYSREF_ALL_REPLICATING_COMPONENTS SYSREF_AVAILABLE_DEVELOPERS_COMPONENTS SYSREF_CALENDAR_EVENTS SYSREF_COMPONENT_TOKEN_HISTORY SYSREF_COMPONENT_TOKENS SYSREF_COMPONENTS SYSREF_CONSTANTS SYSREF_DATA_RECEIVE_PROTOCOL SYSREF_DATA_SEND_PROTOCOL SYSREF_DIALOGS SYSREF_DIALOGS_REQUISITES SYSREF_EDITORS SYSREF_EDOC_CARDS SYSREF_EDOC_TYPES SYSREF_EDOCUMENT_CARD_REQUISITES SYSREF_EDOCUMENT_CARD_TYPES SYSREF_EDOCUMENT_CARD_TYPES_REFERENCE SYSREF_EDOCUMENT_CARDS SYSREF_EDOCUMENT_HISTORY SYSREF_EDOCUMENT_KINDS SYSREF_EDOCUMENT_REQUISITES SYSREF_EDOCUMENT_SIGNATURES SYSREF_EDOCUMENT_TEMPLATES SYSREF_EDOCUMENT_TEXT_STORAGES SYSREF_EDOCUMENT_VIEWS SYSREF_FILTERER_SETUP_CONFLICTS SYSREF_FILTRATER_SETTING_CONFLICTS SYSREF_FOLDER_HISTORY SYSREF_FOLDERS SYSREF_FUNCTION_GROUPS SYSREF_FUNCTION_PARAMS SYSREF_FUNCTIONS SYSREF_JOB_HISTORY SYSREF_LINKS SYSREF_LOCALIZATION_DICTIONARY SYSREF_LOCALIZATION_LANGUAGES SYSREF_MODULES SYSREF_PRIVILEGES SYSREF_RECORD_HISTORY SYSREF_REFERENCE_REQUISITES SYSREF_REFERENCE_TYPE_VIEWS SYSREF_REFERENCE_TYPES SYSREF_REFERENCES SYSREF_REFERENCES_REQUISITES SYSREF_REMOTE_SERVERS SYSREF_REPLICATION_SESSIONS_LOG SYSREF_REPLICATION_SESSIONS_PROTOCOL SYSREF_REPORTS SYSREF_ROLES SYSREF_ROUTE_BLOCK_GROUPS SYSREF_ROUTE_BLOCKS SYSREF_SCRIPTS SYSREF_SEARCHES SYSREF_SERVER_EVENTS SYSREF_SERVER_EVENTS_HISTORY SYSREF_STANDARD_ROUTE_GROUPS SYSREF_STANDARD_ROUTES SYSREF_STATUSES SYSREF_SYSTEM_SETTINGS SYSREF_TASK_HISTORY SYSREF_TASK_KIND_GROUPS SYSREF_TASK_KINDS SYSREF_TASK_RIGHTS SYSREF_TASK_SIGNATURES SYSREF_TASKS SYSREF_UNITS SYSREF_USER_GROUPS SYSREF_USER_GROUPS_REFERENCE SYSREF_USER_SUBSTITUTION SYSREF_USERS SYSREF_USERS_REFERENCE SYSREF_VIEWERS SYSREF_WORKING_TIME_CALENDARS " + "ACCESS_RIGHTS_TABLE_NAME EDMS_ACCESS_TABLE_NAME EDOC_TYPES_TABLE_NAME " + "TEST_DEV_DB_NAME TEST_DEV_SYSTEM_CODE TEST_EDMS_DB_NAME TEST_EDMS_MAIN_CODE TEST_EDMS_MAIN_DB_NAME TEST_EDMS_SECOND_CODE TEST_EDMS_SECOND_DB_NAME TEST_EDMS_SYSTEM_CODE TEST_ISB5_MAIN_CODE TEST_ISB5_SECOND_CODE TEST_SQL_SERVER_2005_NAME TEST_SQL_SERVER_NAME " + "ATTENTION_CAPTION cbsCommandLinks cbsDefault CONFIRMATION_CAPTION ERROR_CAPTION INFORMATION_CAPTION mrCancel mrOk " + "EDOC_VERSION_ACTIVE_STAGE_CODE EDOC_VERSION_DESIGN_STAGE_CODE EDOC_VERSION_OBSOLETE_STAGE_CODE " + "cpDataEnciphermentEnabled cpDigitalSignatureEnabled cpID cpIssuer cpPluginVersion cpSerial cpSubjectName cpSubjSimpleName cpValidFromDate cpValidToDate " + "ISBL_SYNTAX NO_SYNTAX XML_SYNTAX " + "WAIT_BLOCK_AFTER_FINISH_EVENT WAIT_BLOCK_BEFORE_START_EVENT WAIT_BLOCK_DEADLINE_PROPERTY WAIT_BLOCK_IS_RELATIVE_DEADLINE_PROPERTY WAIT_BLOCK_NAME_PROPERTY WAIT_BLOCK_RELATIVE_DEADLINE_TYPE_PROPERTY " + "SYSRES_COMMON SYSRES_CONST SYSRES_MBFUNC SYSRES_SBDATA SYSRES_SBGUI SYSRES_SBINTF SYSRES_SBREFDSC SYSRES_SQLERRORS SYSRES_SYSCOMP ", FE = "atUser atGroup atRole " + "aemEnabledAlways aemDisabledAlways aemEnabledOnBrowse aemEnabledOnEdit aemDisabledOnBrowseEmpty " + "apBegin apEnd " + "alLeft alRight " + "asmNever asmNoButCustomize asmAsLastTime asmYesButCustomize asmAlways " + "cirCommon cirRevoked " + "ctSignature ctEncode ctSignatureEncode " + "clbUnchecked clbChecked clbGrayed " + "ceISB ceAlways ceNever " + "ctDocument ctReference ctScript ctUnknown ctReport ctDialog ctFunction ctFolder ctEDocument ctTask ctJob ctNotice ctControlJob " + "cfInternal cfDisplay " + "ciUnspecified ciWrite ciRead " + "ckFolder ckEDocument ckTask ckJob ckComponentToken ckAny ckReference ckScript ckReport ckDialog " + "ctISBLEditor ctBevel ctButton ctCheckListBox ctComboBox ctComboEdit ctGrid ctDBCheckBox ctDBComboBox ctDBEdit ctDBEllipsis ctDBMemo ctDBNavigator ctDBRadioGroup ctDBStatusLabel ctEdit ctGroupBox ctInplaceHint ctMemo ctPanel ctListBox ctRadioButton ctRichEdit ctTabSheet ctWebBrowser ctImage ctHyperLink ctLabel ctDBMultiEllipsis ctRibbon ctRichView ctInnerPanel ctPanelGroup ctBitButton " + "cctDate cctInteger cctNumeric cctPick cctReference cctString cctText " + "cltInternal cltPrimary cltGUI " + "dseBeforeOpen dseAfterOpen dseBeforeClose dseAfterClose dseOnValidDelete dseBeforeDelete dseAfterDelete dseAfterDeleteOutOfTransaction dseOnDeleteError dseBeforeInsert dseAfterInsert dseOnValidUpdate dseBeforeUpdate dseOnUpdateRatifiedRecord dseAfterUpdate dseAfterUpdateOutOfTransaction dseOnUpdateError dseAfterScroll dseOnOpenRecord dseOnCloseRecord dseBeforeCancel dseAfterCancel dseOnUpdateDeadlockError dseBeforeDetailUpdate dseOnPrepareUpdate dseOnAnyRequisiteChange " + "dssEdit dssInsert dssBrowse dssInActive " + "dftDate dftShortDate dftDateTime dftTimeStamp " + "dotDays dotHours dotMinutes dotSeconds " + "dtkndLocal dtkndUTC " + "arNone arView arEdit arFull " + "ddaView ddaEdit " + "emLock emEdit emSign emExportWithLock emImportWithUnlock emChangeVersionNote emOpenForModify emChangeLifeStage emDelete emCreateVersion emImport emUnlockExportedWithLock emStart emAbort emReInit emMarkAsReaded emMarkAsUnreaded emPerform emAccept emResume emChangeRights emEditRoute emEditObserver emRecoveryFromLocalCopy emChangeWorkAccessType emChangeEncodeTypeToCertificate emChangeEncodeTypeToPassword emChangeEncodeTypeToNone emChangeEncodeTypeToCertificatePassword emChangeStandardRoute emGetText emOpenForView emMoveToStorage emCreateObject emChangeVersionHidden emDeleteVersion emChangeLifeCycleStage emApprovingSign emExport emContinue emLockFromEdit emUnLockForEdit emLockForServer emUnlockFromServer emDelegateAccessRights emReEncode " + "ecotFile ecotProcess " + "eaGet eaCopy eaCreate eaCreateStandardRoute " + "edltAll edltNothing edltQuery " + "essmText essmCard " + "esvtLast esvtLastActive esvtSpecified " + "edsfExecutive edsfArchive " + "edstSQLServer edstFile " + "edvstNone edvstEDocumentVersionCopy edvstFile edvstTemplate edvstScannedFile " + "vsDefault vsDesign vsActive vsObsolete " + "etNone etCertificate etPassword etCertificatePassword " + "ecException ecWarning ecInformation " + "estAll estApprovingOnly " + "evtLast evtLastActive evtQuery " + "fdtString fdtNumeric fdtInteger fdtDate fdtText fdtUnknown fdtWideString fdtLargeInteger " + "ftInbox ftOutbox ftFavorites ftCommonFolder ftUserFolder ftComponents ftQuickLaunch ftShortcuts ftSearch " + "grhAuto grhX1 grhX2 grhX3 " + "hltText hltRTF hltHTML " + "iffBMP iffJPEG iffMultiPageTIFF iffSinglePageTIFF iffTIFF iffPNG " + "im8bGrayscale im24bRGB im1bMonochrome " + "itBMP itJPEG itWMF itPNG " + "ikhInformation ikhWarning ikhError ikhNoIcon " + "icUnknown icScript icFunction icIntegratedReport icAnalyticReport icDataSetEventHandler icActionHandler icFormEventHandler icLookUpEventHandler icRequisiteChangeEventHandler icBeforeSearchEventHandler icRoleCalculation icSelectRouteEventHandler icBlockPropertyCalculation icBlockQueryParamsEventHandler icChangeSearchResultEventHandler icBlockEventHandler icSubTaskInitEventHandler icEDocDataSetEventHandler icEDocLookUpEventHandler icEDocActionHandler icEDocFormEventHandler icEDocRequisiteChangeEventHandler icStructuredConversionRule icStructuredConversionEventBefore icStructuredConversionEventAfter icWizardEventHandler icWizardFinishEventHandler icWizardStepEventHandler icWizardStepFinishEventHandler icWizardActionEnableEventHandler icWizardActionExecuteEventHandler icCreateJobsHandler icCreateNoticesHandler icBeforeLookUpEventHandler icAfterLookUpEventHandler icTaskAbortEventHandler icWorkflowBlockActionHandler icDialogDataSetEventHandler icDialogActionHandler icDialogLookUpEventHandler icDialogRequisiteChangeEventHandler icDialogFormEventHandler icDialogValidCloseEventHandler icBlockFormEventHandler icTaskFormEventHandler icReferenceMethod icEDocMethod icDialogMethod icProcessMessageHandler " + "isShow isHide isByUserSettings " + "jkJob jkNotice jkControlJob " + "jtInner jtLeft jtRight jtFull jtCross " + "lbpAbove lbpBelow lbpLeft lbpRight " + "eltPerConnection eltPerUser " + "sfcUndefined sfcBlack sfcGreen sfcRed sfcBlue sfcOrange sfcLilac " + "sfsItalic sfsStrikeout sfsNormal " + "ldctStandardRoute ldctWizard ldctScript ldctFunction ldctRouteBlock ldctIntegratedReport ldctAnalyticReport ldctReferenceType ldctEDocumentType ldctDialog ldctServerEvents " + "mrcrtNone mrcrtUser mrcrtMaximal mrcrtCustom " + "vtEqual vtGreaterOrEqual vtLessOrEqual vtRange " + "rdYesterday rdToday rdTomorrow rdThisWeek rdThisMonth rdThisYear rdNextMonth rdNextWeek rdLastWeek rdLastMonth " + "rdWindow rdFile rdPrinter " + "rdtString rdtNumeric rdtInteger rdtDate rdtReference rdtAccount rdtText rdtPick rdtUnknown rdtLargeInteger rdtDocument " + "reOnChange reOnChangeValues " + "ttGlobal ttLocal ttUser ttSystem " + "ssmBrowse ssmSelect ssmMultiSelect ssmBrowseModal " + "smSelect smLike smCard " + "stNone stAuthenticating stApproving " + "sctString sctStream " + "sstAnsiSort sstNaturalSort " + "svtEqual svtContain " + "soatString soatNumeric soatInteger soatDatetime soatReferenceRecord soatText soatPick soatBoolean soatEDocument soatAccount soatIntegerCollection soatNumericCollection soatStringCollection soatPickCollection soatDatetimeCollection soatBooleanCollection soatReferenceRecordCollection soatEDocumentCollection soatAccountCollection soatContents soatUnknown " + "tarAbortByUser tarAbortByWorkflowException " + "tvtAllWords tvtExactPhrase tvtAnyWord " + "usNone usCompleted usRedSquare usBlueSquare usYellowSquare usGreenSquare usOrangeSquare usPurpleSquare usFollowUp " + "utUnknown utUser utDeveloper utAdministrator utSystemDeveloper utDisconnected " + "btAnd btDetailAnd btOr btNotOr btOnly " + "vmView vmSelect vmNavigation " + "vsmSingle vsmMultiple vsmMultipleCheck vsmNoSelection " + "wfatPrevious wfatNext wfatCancel wfatFinish " + "wfepUndefined wfepText3 wfepText6 wfepText9 wfepSpinEdit wfepDropDown wfepRadioGroup wfepFlag wfepText12 wfepText15 wfepText18 wfepText21 wfepText24 wfepText27 wfepText30 wfepRadioGroupColumn1 wfepRadioGroupColumn2 wfepRadioGroupColumn3 " + "wfetQueryParameter wfetText wfetDelimiter wfetLabel " + "wptString wptInteger wptNumeric wptBoolean wptDateTime wptPick wptText wptUser wptUserList wptEDocumentInfo wptEDocumentInfoList wptReferenceRecordInfo wptReferenceRecordInfoList wptFolderInfo wptTaskInfo wptContents wptFileName wptDate " + "wsrComplete wsrGoNext wsrGoPrevious wsrCustom wsrCancel wsrGoFinal " + "wstForm wstEDocument wstTaskCard wstReferenceRecordCard wstFinal " + "waAll waPerformers waManual " + "wsbStart wsbFinish wsbNotice wsbStep wsbDecision wsbWait wsbMonitor wsbScript wsbConnector wsbSubTask wsbLifeCycleStage wsbPause " + "wdtInteger wdtFloat wdtString wdtPick wdtDateTime wdtBoolean wdtTask wdtJob wdtFolder wdtEDocument wdtReferenceRecord wdtUser wdtGroup wdtRole wdtIntegerCollection wdtFloatCollection wdtStringCollection wdtPickCollection wdtDateTimeCollection wdtBooleanCollection wdtTaskCollection wdtJobCollection wdtFolderCollection wdtEDocumentCollection wdtReferenceRecordCollection wdtUserCollection wdtGroupCollection wdtRoleCollection wdtContents wdtUserList wdtSearchDescription wdtDeadLine wdtPickSet wdtAccountCollection " + "wiLow wiNormal wiHigh " + "wrtSoft wrtHard " + "wsInit wsRunning wsDone wsControlled wsAborted wsContinued " + "wtmFull wtmFromCurrent wtmOnlyCurrent ", BE = "AddSubString AdjustLineBreaks AmountInWords Analysis ArrayDimCount ArrayHighBound ArrayLowBound ArrayOf ArrayReDim Assert Assigned BeginOfMonth BeginOfPeriod BuildProfilingOperationAnalysis CallProcedure CanReadFile CArrayElement CDataSetRequisite ChangeDate ChangeReferenceDataset Char CharPos CheckParam CheckParamValue CompareStrings ConstantExists ControlState ConvertDateStr Copy CopyFile CreateArray CreateCachedReference CreateConnection CreateDialog CreateDualListDialog CreateEditor CreateException CreateFile CreateFolderDialog CreateInputDialog CreateLinkFile CreateList CreateLock CreateMemoryDataSet CreateObject CreateOpenDialog CreateProgress CreateQuery CreateReference CreateReport CreateSaveDialog CreateScript CreateSQLPivotFunction CreateStringList CreateTreeListSelectDialog CSelectSQL CSQL CSubString CurrentUserID CurrentUserName CurrentVersion DataSetLocateEx DateDiff DateTimeDiff DateToStr DayOfWeek DeleteFile DirectoryExists DisableCheckAccessRights DisableCheckFullShowingRestriction DisableMassTaskSendingRestrictions DropTable DupeString EditText EnableCheckAccessRights EnableCheckFullShowingRestriction EnableMassTaskSendingRestrictions EndOfMonth EndOfPeriod ExceptionExists ExceptionsOff ExceptionsOn Execute ExecuteProcess Exit ExpandEnvironmentVariables ExtractFileDrive ExtractFileExt ExtractFileName ExtractFilePath ExtractParams FileExists FileSize FindFile FindSubString FirmContext ForceDirectories Format FormatDate FormatNumeric FormatSQLDate FormatString FreeException GetComponent GetComponentLaunchParam GetConstant GetLastException GetReferenceRecord GetRefTypeByRefID GetTableID GetTempFolder IfThen In IndexOf InputDialog InputDialogEx InteractiveMode IsFileLocked IsGraphicFile IsNumeric Length LoadString LoadStringFmt LocalTimeToUTC LowerCase Max MessageBox MessageBoxEx MimeDecodeBinary MimeDecodeString MimeEncodeBinary MimeEncodeString Min MoneyInWords MoveFile NewID Now OpenFile Ord Precision Raise ReadCertificateFromFile ReadFile ReferenceCodeByID ReferenceNumber ReferenceRequisiteMode ReferenceRequisiteValue RegionDateSettings RegionNumberSettings RegionTimeSettings RegRead RegWrite RenameFile Replace Round SelectServerCode SelectSQL ServerDateTime SetConstant SetManagedFolderFieldsState ShowConstantsInputDialog ShowMessage Sleep Split SQL SQL2XLSTAB SQLProfilingSendReport StrToDate SubString SubStringCount SystemSetting Time TimeDiff Today Transliterate Trim UpperCase UserStatus UTCToLocalTime ValidateXML VarIsClear VarIsEmpty VarIsNull WorkTimeDiff WriteFile WriteFileEx WriteObjectHistory Анализ БазаДанных БлокЕсть БлокЕстьРасш БлокИнфо БлокСнять БлокСнятьРасш БлокУстановить Ввод ВводМеню ВедС ВедСпр ВерхняяГраницаМассива ВнешПрогр Восст ВременнаяПапка Время ВыборSQL ВыбратьЗапись ВыделитьСтр Вызвать Выполнить ВыпПрогр ГрафическийФайл ГруппаДополнительно ДатаВремяСерв ДеньНедели ДиалогДаНет ДлинаСтр ДобПодстр ЕПусто ЕслиТо ЕЧисло ЗамПодстр ЗаписьСправочника ЗначПоляСпр ИДТипСпр ИзвлечьДиск ИзвлечьИмяФайла ИзвлечьПуть ИзвлечьРасширение ИзмДат ИзменитьРазмерМассива ИзмеренийМассива ИмяОрг ИмяПоляСпр Индекс ИндикаторЗакрыть ИндикаторОткрыть ИндикаторШаг ИнтерактивныйРежим ИтогТблСпр КодВидВедСпр КодВидСпрПоИД КодПоAnalit КодСимвола КодСпр КолПодстр КолПроп КонМес Конст КонстЕсть КонстЗнач КонТран КопироватьФайл КопияСтр КПериод КСтрТблСпр Макс МаксСтрТблСпр Массив Меню МенюРасш Мин НаборДанныхНайтиРасш НаимВидСпр НаимПоAnalit НаимСпр НастроитьПереводыСтрок НачМес НачТран НижняяГраницаМассива НомерСпр НПериод Окно Окр Окружение ОтлИнфДобавить ОтлИнфУдалить Отчет ОтчетАнал ОтчетИнт ПапкаСуществует Пауза ПВыборSQL ПереименоватьФайл Переменные ПереместитьФайл Подстр ПоискПодстр ПоискСтр ПолучитьИДТаблицы ПользовательДополнительно ПользовательИД ПользовательИмя ПользовательСтатус Прервать ПроверитьПараметр ПроверитьПараметрЗнач ПроверитьУсловие РазбСтр РазнВремя РазнДат РазнДатаВремя РазнРабВремя РегУстВрем РегУстДат РегУстЧсл РедТекст РеестрЗапись РеестрСписокИменПарам РеестрЧтение РеквСпр РеквСпрПр Сегодня Сейчас Сервер СерверПроцессИД СертификатФайлСчитать СжПроб Символ СистемаДиректумКод СистемаИнформация СистемаКод Содержит СоединениеЗакрыть СоединениеОткрыть СоздатьДиалог СоздатьДиалогВыбораИзДвухСписков СоздатьДиалогВыбораПапки СоздатьДиалогОткрытияФайла СоздатьДиалогСохраненияФайла СоздатьЗапрос СоздатьИндикатор СоздатьИсключение СоздатьКэшированныйСправочник СоздатьМассив СоздатьНаборДанных СоздатьОбъект СоздатьОтчет СоздатьПапку СоздатьРедактор СоздатьСоединение СоздатьСписок СоздатьСписокСтрок СоздатьСправочник СоздатьСценарий СоздСпр СостСпр Сохр СохрСпр СписокСистем Спр Справочник СпрБлокЕсть СпрБлокСнять СпрБлокСнятьРасш СпрБлокУстановить СпрИзмНабДан СпрКод СпрНомер СпрОбновить СпрОткрыть СпрОтменить СпрПарам СпрПолеЗнач СпрПолеИмя СпрРекв СпрРеквВведЗн СпрРеквНовые СпрРеквПр СпрРеквПредЗн СпрРеквРежим СпрРеквТипТекст СпрСоздать СпрСост СпрСохранить СпрТблИтог СпрТблСтр СпрТблСтрКол СпрТблСтрМакс СпрТблСтрМин СпрТблСтрПред СпрТблСтрСлед СпрТблСтрСозд СпрТблСтрУд СпрТекПредст СпрУдалить СравнитьСтр СтрВерхРегистр СтрНижнРегистр СтрТблСпр СумПроп Сценарий СценарийПарам ТекВерсия ТекОрг Точн Тран Транслитерация УдалитьТаблицу УдалитьФайл УдСпр УдСтрТблСпр Уст УстановкиКонстант ФайлАтрибутСчитать ФайлАтрибутУстановить ФайлВремя ФайлВремяУстановить ФайлВыбрать ФайлЗанят ФайлЗаписать ФайлИскать ФайлКопировать ФайлМожноЧитать ФайлОткрыть ФайлПереименовать ФайлПерекодировать ФайлПереместить ФайлПросмотреть ФайлРазмер ФайлСоздать ФайлСсылкаСоздать ФайлСуществует ФайлСчитать ФайлУдалить ФмтSQLДат ФмтДат ФмтСтр ФмтЧсл Формат ЦМассивЭлемент ЦНаборДанныхРеквизит ЦПодстр ", UE = "AltState Application CallType ComponentTokens CreatedJobs CreatedNotices ControlState DialogResult Dialogs EDocuments EDocumentVersionSource Folders GlobalIDs Job Jobs InputValue LookUpReference LookUpRequisiteNames LookUpSearch Object ParentComponent Processes References Requisite ReportName Reports Result Scripts Searches SelectedAttachments SelectedItems SelectMode Sender ServerEvents ServiceFactory ShiftState SubTask SystemDialogs Tasks Wizard Wizards Work ВызовСпособ ИмяОтчета РеквЗнач ", HE = "IApplication IAccessRights IAccountRepository IAccountSelectionRestrictions IAction IActionList IAdministrationHistoryDescription IAnchors IApplication IArchiveInfo IAttachment IAttachmentList ICheckListBox ICheckPointedList IColumn IComponent IComponentDescription IComponentToken IComponentTokenFactory IComponentTokenInfo ICompRecordInfo IConnection IContents IControl IControlJob IControlJobInfo IControlList ICrypto ICrypto2 ICustomJob ICustomJobInfo ICustomListBox ICustomObjectWizardStep ICustomWork ICustomWorkInfo IDataSet IDataSetAccessInfo IDataSigner IDateCriterion IDateRequisite IDateRequisiteDescription IDateValue IDeaAccessRights IDeaObjectInfo IDevelopmentComponentLock IDialog IDialogFactory IDialogPickRequisiteItems IDialogsFactory IDICSFactory IDocRequisite IDocumentInfo IDualListDialog IECertificate IECertificateInfo IECertificates IEditControl IEditorForm IEdmsExplorer IEdmsObject IEdmsObjectDescription IEdmsObjectFactory IEdmsObjectInfo IEDocument IEDocumentAccessRights IEDocumentDescription IEDocumentEditor IEDocumentFactory IEDocumentInfo IEDocumentStorage IEDocumentVersion IEDocumentVersionListDialog IEDocumentVersionSource IEDocumentWizardStep IEDocVerSignature IEDocVersionState IEnabledMode IEncodeProvider IEncrypter IEvent IEventList IException IExternalEvents IExternalHandler IFactory IField IFileDialog IFolder IFolderDescription IFolderDialog IFolderFactory IFolderInfo IForEach IForm IFormTitle IFormWizardStep IGlobalIDFactory IGlobalIDInfo IGrid IHasher IHistoryDescription IHyperLinkControl IImageButton IImageControl IInnerPanel IInplaceHint IIntegerCriterion IIntegerList IIntegerRequisite IIntegerValue IISBLEditorForm IJob IJobDescription IJobFactory IJobForm IJobInfo ILabelControl ILargeIntegerCriterion ILargeIntegerRequisite ILargeIntegerValue ILicenseInfo ILifeCycleStage IList IListBox ILocalIDInfo ILocalization ILock IMemoryDataSet IMessagingFactory IMetadataRepository INotice INoticeInfo INumericCriterion INumericRequisite INumericValue IObject IObjectDescription IObjectImporter IObjectInfo IObserver IPanelGroup IPickCriterion IPickProperty IPickRequisite IPickRequisiteDescription IPickRequisiteItem IPickRequisiteItems IPickValue IPrivilege IPrivilegeList IProcess IProcessFactory IProcessMessage IProgress IProperty IPropertyChangeEvent IQuery IReference IReferenceCriterion IReferenceEnabledMode IReferenceFactory IReferenceHistoryDescription IReferenceInfo IReferenceRecordCardWizardStep IReferenceRequisiteDescription IReferencesFactory IReferenceValue IRefRequisite IReport IReportFactory IRequisite IRequisiteDescription IRequisiteDescriptionList IRequisiteFactory IRichEdit IRouteStep IRule IRuleList ISchemeBlock IScript IScriptFactory ISearchCriteria ISearchCriterion ISearchDescription ISearchFactory ISearchFolderInfo ISearchForObjectDescription ISearchResultRestrictions ISecuredContext ISelectDialog IServerEvent IServerEventFactory IServiceDialog IServiceFactory ISignature ISignProvider ISignProvider2 ISignProvider3 ISimpleCriterion IStringCriterion IStringList IStringRequisite IStringRequisiteDescription IStringValue ISystemDialogsFactory ISystemInfo ITabSheet ITask ITaskAbortReasonInfo ITaskCardWizardStep ITaskDescription ITaskFactory ITaskInfo ITaskRoute ITextCriterion ITextRequisite ITextValue ITreeListSelectDialog IUser IUserList IValue IView IWebBrowserControl IWizard IWizardAction IWizardFactory IWizardFormElement IWizardParam IWizardPickParam IWizardReferenceParam IWizardStep IWorkAccessRights IWorkDescription IWorkflowAskableParam IWorkflowAskableParams IWorkflowBlock IWorkflowBlockResult IWorkflowEnabledMode IWorkflowParam IWorkflowPickParam IWorkflowReferenceParam IWorkState IWorkTreeCustomNode IWorkTreeJobNode IWorkTreeTaskNode IXMLEditorForm SBCrypto ", GE = pe + FE, VE = UE, YE = "null true false nil ", ed = {
    className: "number",
    begin: t.NUMBER_RE,
    relevance: 0
  }, td = {
    className: "string",
    variants: [
      {
        begin: '"',
        end: '"'
      },
      {
        begin: "'",
        end: "'"
      }
    ]
  }, nd = {
    className: "doctag",
    begin: "\\b(?:TODO|DONE|BEGIN|END|STUB|CHG|FIXME|NOTE|BUG|XXX)\\b",
    relevance: 0
  }, $E = {
    className: "comment",
    begin: "//",
    end: "$",
    relevance: 0,
    contains: [
      t.PHRASAL_WORDS_MODE,
      nd
    ]
  }, zE = {
    className: "comment",
    begin: "/\\*",
    end: "\\*/",
    relevance: 0,
    contains: [
      t.PHRASAL_WORDS_MODE,
      nd
    ]
  }, rd = { variants: [
    $E,
    zE
  ] }, Ao = {
    $pattern: e,
    keyword: r,
    built_in: GE,
    class: VE,
    literal: YE
  }, zs = {
    begin: "\\.\\s*" + t.UNDERSCORE_IDENT_RE,
    keywords: Ao,
    relevance: 0
  }, id = {
    className: "type",
    begin: ":[ \\t]*(" + HE.trim().replace(/\s/g, "|") + ")",
    end: "[ \\t]*=",
    excludeEnd: !0
  }, od = {
    className: "variable",
    keywords: Ao,
    begin: e,
    relevance: 0,
    contains: [
      id,
      zs
    ]
  }, ad = n + "\\(";
  return {
    name: "ISBL",
    case_insensitive: !0,
    keywords: Ao,
    illegal: "\\$|\\?|%|,|;$|~|#|@|</",
    contains: [
      {
        className: "function",
        begin: ad,
        end: "\\)$",
        returnBegin: !0,
        keywords: Ao,
        illegal: "[\\[\\]\\|\\$\\?%,~#@]",
        contains: [
          {
            className: "title",
            keywords: {
              $pattern: e,
              built_in: BE
            },
            begin: ad,
            end: "\\(",
            returnBegin: !0,
            excludeEnd: !0
          },
          zs,
          od,
          td,
          ed,
          rd
        ]
      },
      id,
      zs,
      od,
      td,
      ed,
      rd
    ]
  };
}
function Gx(t) {
  const n = {
    className: "params",
    begin: /\(/,
    end: /\)/,
    contains: [{
      begin: /[\w-]+ *=/,
      returnBegin: !0,
      relevance: 0,
      contains: [
        {
          className: "attr",
          begin: /[\w-]+/
        }
      ]
    }],
    relevance: 0
  }, r = {
    className: "function",
    begin: /:[\w\-.]+/,
    relevance: 0
  }, i = {
    className: "string",
    begin: /\B([\/.])[\w\-.\/=]+/
  }, o = {
    className: "params",
    begin: /--[\w\-=\/]+/
  };
  return {
    name: "JBoss CLI",
    aliases: ["wildfly-cli"],
    keywords: {
      $pattern: "[a-z-]+",
      keyword: "alias batch cd clear command connect connection-factory connection-info data-source deploy deployment-info deployment-overlay echo echo-dmr help history if jdbc-driver-info jms-queue|20 jms-topic|20 ls patch pwd quit read-attribute read-operation reload rollout-plan run-batch set shutdown try unalias undeploy unset version xa-data-source",
      // module
      literal: "true false"
    },
    contains: [
      t.HASH_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      o,
      r,
      i,
      n
    ]
  };
}
function Vx(t) {
  const e = "[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*", o = {
    $pattern: e,
    keyword: [
      "baremodule",
      "begin",
      "break",
      "catch",
      "ccall",
      "const",
      "continue",
      "do",
      "else",
      "elseif",
      "end",
      "export",
      "false",
      "finally",
      "for",
      "function",
      "global",
      "if",
      "import",
      "in",
      "isa",
      "let",
      "local",
      "macro",
      "module",
      "quote",
      "return",
      "true",
      "try",
      "using",
      "where",
      "while"
    ],
    literal: [
      "ARGS",
      "C_NULL",
      "DEPOT_PATH",
      "ENDIAN_BOM",
      "ENV",
      "Inf",
      "Inf16",
      "Inf32",
      "Inf64",
      "InsertionSort",
      "LOAD_PATH",
      "MergeSort",
      "NaN",
      "NaN16",
      "NaN32",
      "NaN64",
      "PROGRAM_FILE",
      "QuickSort",
      "RoundDown",
      "RoundFromZero",
      "RoundNearest",
      "RoundNearestTiesAway",
      "RoundNearestTiesUp",
      "RoundToZero",
      "RoundUp",
      "VERSION|0",
      "devnull",
      "false",
      "im",
      "missing",
      "nothing",
      "pi",
      "stderr",
      "stdin",
      "stdout",
      "true",
      "undef",
      "π",
      "ℯ"
    ],
    built_in: [
      "AbstractArray",
      "AbstractChannel",
      "AbstractChar",
      "AbstractDict",
      "AbstractDisplay",
      "AbstractFloat",
      "AbstractIrrational",
      "AbstractMatrix",
      "AbstractRange",
      "AbstractSet",
      "AbstractString",
      "AbstractUnitRange",
      "AbstractVecOrMat",
      "AbstractVector",
      "Any",
      "ArgumentError",
      "Array",
      "AssertionError",
      "BigFloat",
      "BigInt",
      "BitArray",
      "BitMatrix",
      "BitSet",
      "BitVector",
      "Bool",
      "BoundsError",
      "CapturedException",
      "CartesianIndex",
      "CartesianIndices",
      "Cchar",
      "Cdouble",
      "Cfloat",
      "Channel",
      "Char",
      "Cint",
      "Cintmax_t",
      "Clong",
      "Clonglong",
      "Cmd",
      "Colon",
      "Complex",
      "ComplexF16",
      "ComplexF32",
      "ComplexF64",
      "CompositeException",
      "Condition",
      "Cptrdiff_t",
      "Cshort",
      "Csize_t",
      "Cssize_t",
      "Cstring",
      "Cuchar",
      "Cuint",
      "Cuintmax_t",
      "Culong",
      "Culonglong",
      "Cushort",
      "Cvoid",
      "Cwchar_t",
      "Cwstring",
      "DataType",
      "DenseArray",
      "DenseMatrix",
      "DenseVecOrMat",
      "DenseVector",
      "Dict",
      "DimensionMismatch",
      "Dims",
      "DivideError",
      "DomainError",
      "EOFError",
      "Enum",
      "ErrorException",
      "Exception",
      "ExponentialBackOff",
      "Expr",
      "Float16",
      "Float32",
      "Float64",
      "Function",
      "GlobalRef",
      "HTML",
      "IO",
      "IOBuffer",
      "IOContext",
      "IOStream",
      "IdDict",
      "IndexCartesian",
      "IndexLinear",
      "IndexStyle",
      "InexactError",
      "InitError",
      "Int",
      "Int128",
      "Int16",
      "Int32",
      "Int64",
      "Int8",
      "Integer",
      "InterruptException",
      "InvalidStateException",
      "Irrational",
      "KeyError",
      "LinRange",
      "LineNumberNode",
      "LinearIndices",
      "LoadError",
      "MIME",
      "Matrix",
      "Method",
      "MethodError",
      "Missing",
      "MissingException",
      "Module",
      "NTuple",
      "NamedTuple",
      "Nothing",
      "Number",
      "OrdinalRange",
      "OutOfMemoryError",
      "OverflowError",
      "Pair",
      "PartialQuickSort",
      "PermutedDimsArray",
      "Pipe",
      "ProcessFailedException",
      "Ptr",
      "QuoteNode",
      "Rational",
      "RawFD",
      "ReadOnlyMemoryError",
      "Real",
      "ReentrantLock",
      "Ref",
      "Regex",
      "RegexMatch",
      "RoundingMode",
      "SegmentationFault",
      "Set",
      "Signed",
      "Some",
      "StackOverflowError",
      "StepRange",
      "StepRangeLen",
      "StridedArray",
      "StridedMatrix",
      "StridedVecOrMat",
      "StridedVector",
      "String",
      "StringIndexError",
      "SubArray",
      "SubString",
      "SubstitutionString",
      "Symbol",
      "SystemError",
      "Task",
      "TaskFailedException",
      "Text",
      "TextDisplay",
      "Timer",
      "Tuple",
      "Type",
      "TypeError",
      "TypeVar",
      "UInt",
      "UInt128",
      "UInt16",
      "UInt32",
      "UInt64",
      "UInt8",
      "UndefInitializer",
      "UndefKeywordError",
      "UndefRefError",
      "UndefVarError",
      "Union",
      "UnionAll",
      "UnitRange",
      "Unsigned",
      "Val",
      "Vararg",
      "VecElement",
      "VecOrMat",
      "Vector",
      "VersionNumber",
      "WeakKeyDict",
      "WeakRef"
    ]
  }, a = {
    keywords: o,
    illegal: /<\//
  }, s = {
    className: "number",
    // supported numeric literals:
    //  * binary literal (e.g. 0x10)
    //  * octal literal (e.g. 0o76543210)
    //  * hexadecimal literal (e.g. 0xfedcba876543210)
    //  * hexadecimal floating point literal (e.g. 0x1p0, 0x1.2p2)
    //  * decimal literal (e.g. 9876543210, 100_000_000)
    //  * floating pointe literal (e.g. 1.2, 1.2f, .2, 1., 1.2e10, 1.2e-10)
    begin: /(\b0x[\d_]*(\.[\d_]*)?|0x\.\d[\d_]*)p[-+]?\d+|\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\b\d[\d_]*(\.[\d_]*)?|\.\d[\d_]*)([eEfF][-+]?\d+)?/,
    relevance: 0
  }, l = {
    className: "string",
    begin: /'(.|\\[xXuU][a-zA-Z0-9]+)'/
  }, c = {
    className: "subst",
    begin: /\$\(/,
    end: /\)/,
    keywords: o
  }, u = {
    className: "variable",
    begin: "\\$" + e
  }, d = {
    className: "string",
    contains: [
      t.BACKSLASH_ESCAPE,
      c,
      u
    ],
    variants: [
      {
        begin: /\w*"""/,
        end: /"""\w*/,
        relevance: 10
      },
      {
        begin: /\w*"/,
        end: /"\w*/
      }
    ]
  }, p = {
    className: "string",
    contains: [
      t.BACKSLASH_ESCAPE,
      c,
      u
    ],
    begin: "`",
    end: "`"
  }, _ = {
    className: "meta",
    begin: "@" + e
  }, m = {
    className: "comment",
    variants: [
      {
        begin: "#=",
        end: "=#",
        relevance: 10
      },
      {
        begin: "#",
        end: "$"
      }
    ]
  };
  return a.name = "Julia", a.contains = [
    s,
    l,
    d,
    p,
    _,
    m,
    t.HASH_COMMENT_MODE,
    {
      className: "keyword",
      begin: "\\b(((abstract|primitive)\\s+)type|(mutable\\s+)?struct)\\b"
    },
    { begin: /<:/ }
    // relevance booster
  ], c.contains = a.contains, a;
}
function Yx(t) {
  return {
    name: "Julia REPL",
    contains: [
      {
        className: "meta.prompt",
        begin: /^julia>/,
        relevance: 10,
        starts: {
          // end the highlighting if we are on a new line and the line does not have at
          // least six spaces in the beginning
          end: /^(?![ ]{6})/,
          subLanguage: "julia"
        }
      }
    ],
    // jldoctest Markdown blocks are used in the Julia manual and package docs indicate
    // code snippets that should be verified when the documentation is built. They can be
    // either REPL-like or script-like, but are usually REPL-like and therefore we apply
    // julia-repl highlighting to them. More information can be found in Documenter's
    // manual: https://juliadocs.github.io/Documenter.jl/latest/man/doctests.html
    aliases: ["jldoctest"]
  };
}
function $x(t) {
  const e = "[a-zA-Z_][\\w.]*", n = "<\\?(lasso(script)?|=)", r = "\\]|\\?>", i = {
    $pattern: e + "|&[lg]t;",
    literal: "true false none minimal full all void and or not bw nbw ew new cn ncn lt lte gt gte eq neq rx nrx ft",
    built_in: "array date decimal duration integer map pair string tag xml null boolean bytes keyword list locale queue set stack staticarray local var variable global data self inherited currentcapture givenblock",
    keyword: "cache database_names database_schemanames database_tablenames define_tag define_type email_batch encode_set html_comment handle handle_error header if inline iterate ljax_target link link_currentaction link_currentgroup link_currentrecord link_detail link_firstgroup link_firstrecord link_lastgroup link_lastrecord link_nextgroup link_nextrecord link_prevgroup link_prevrecord log loop namespace_using output_none portal private protect records referer referrer repeating resultset rows search_args search_arguments select sort_args sort_arguments thread_atomic value_list while abort case else fail_if fail_ifnot fail if_empty if_false if_null if_true loop_abort loop_continue loop_count params params_up return return_value run_children soap_definetag soap_lastrequest soap_lastresponse tag_name ascending average by define descending do equals frozen group handle_failure import in into join let match max min on order parent protected provide public require returnhome skip split_thread sum take thread to trait type where with yield yieldhome"
  }, o = t.COMMENT(
    "<!--",
    "-->",
    { relevance: 0 }
  ), a = {
    className: "meta",
    begin: "\\[noprocess\\]",
    starts: {
      end: "\\[/noprocess\\]",
      returnEnd: !0,
      contains: [o]
    }
  }, s = {
    className: "meta",
    begin: "\\[/noprocess|" + n
  }, l = {
    className: "symbol",
    begin: "'" + e + "'"
  }, c = [
    t.C_LINE_COMMENT_MODE,
    t.C_BLOCK_COMMENT_MODE,
    t.inherit(t.C_NUMBER_MODE, { begin: t.C_NUMBER_RE + "|(-?infinity|NaN)\\b" }),
    t.inherit(t.APOS_STRING_MODE, { illegal: null }),
    t.inherit(t.QUOTE_STRING_MODE, { illegal: null }),
    {
      className: "string",
      begin: "`",
      end: "`"
    },
    {
      // variables
      variants: [
        { begin: "[#$]" + e },
        {
          begin: "#",
          end: "\\d+",
          illegal: "\\W"
        }
      ]
    },
    {
      className: "type",
      begin: "::\\s*",
      end: e,
      illegal: "\\W"
    },
    {
      className: "params",
      variants: [
        {
          begin: "-(?!infinity)" + e,
          relevance: 0
        },
        { begin: "(\\.\\.\\.)" }
      ]
    },
    {
      begin: /(->|\.)\s*/,
      relevance: 0,
      contains: [l]
    },
    {
      className: "class",
      beginKeywords: "define",
      returnEnd: !0,
      end: "\\(|=>",
      contains: [t.inherit(t.TITLE_MODE, { begin: e + "(=(?!>))?|[-+*/%](?!>)" })]
    }
  ];
  return {
    name: "Lasso",
    aliases: [
      "ls",
      "lassoscript"
    ],
    case_insensitive: !0,
    keywords: i,
    contains: [
      {
        className: "meta",
        begin: r,
        relevance: 0,
        starts: {
          // markup
          end: "\\[|" + n,
          returnEnd: !0,
          relevance: 0,
          contains: [o]
        }
      },
      a,
      s,
      {
        className: "meta",
        begin: "\\[no_square_brackets",
        starts: {
          end: "\\[/no_square_brackets\\]",
          // not implemented in the language
          keywords: i,
          contains: [
            {
              className: "meta",
              begin: r,
              relevance: 0,
              starts: {
                end: "\\[noprocess\\]|" + n,
                returnEnd: !0,
                contains: [o]
              }
            },
            a,
            s
          ].concat(c)
        }
      },
      {
        className: "meta",
        begin: "\\[",
        relevance: 0
      },
      {
        className: "meta",
        begin: "^#!",
        end: "lasso9$",
        relevance: 10
      }
    ].concat(c)
  };
}
function zx(t) {
  const n = t.regex.either(...[
    "(?:NeedsTeXFormat|RequirePackage|GetIdInfo)",
    "Provides(?:Expl)?(?:Package|Class|File)",
    "(?:DeclareOption|ProcessOptions)",
    "(?:documentclass|usepackage|input|include)",
    "makeat(?:letter|other)",
    "ExplSyntax(?:On|Off)",
    "(?:new|renew|provide)?command",
    "(?:re)newenvironment",
    "(?:New|Renew|Provide|Declare)(?:Expandable)?DocumentCommand",
    "(?:New|Renew|Provide|Declare)DocumentEnvironment",
    "(?:(?:e|g|x)?def|let)",
    "(?:begin|end)",
    "(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph)",
    "caption",
    "(?:label|(?:eq|page|name)?ref|(?:paren|foot|super)?cite)",
    "(?:alpha|beta|[Gg]amma|[Dd]elta|(?:var)?epsilon|zeta|eta|[Tt]heta|vartheta)",
    "(?:iota|(?:var)?kappa|[Ll]ambda|mu|nu|[Xx]i|[Pp]i|varpi|(?:var)rho)",
    "(?:[Ss]igma|varsigma|tau|[Uu]psilon|[Pp]hi|varphi|chi|[Pp]si|[Oo]mega)",
    "(?:frac|sum|prod|lim|infty|times|sqrt|leq|geq|left|right|middle|[bB]igg?)",
    "(?:[lr]angle|q?quad|[lcvdi]?dots|d?dot|hat|tilde|bar)"
  ].map((x) => x + "(?![a-zA-Z@:_])")), r = new RegExp([
    // A function \module_function_name:signature or \__module_function_name:signature,
    // where both module and function_name need at least two characters and
    // function_name may contain single underscores.
    "(?:__)?[a-zA-Z]{2,}_[a-zA-Z](?:_?[a-zA-Z])+:[a-zA-Z]*",
    // A variable \scope_module_and_name_type or \scope__module_ane_name_type,
    // where scope is one of l, g or c, type needs at least two characters
    // and module_and_name may contain single underscores.
    "[lgc]__?[a-zA-Z](?:_?[a-zA-Z])*_[a-zA-Z]{2,}",
    // A quark \q_the_name or \q__the_name or
    // scan mark \s_the_name or \s__vthe_name,
    // where variable_name needs at least two characters and
    // may contain single underscores.
    "[qs]__?[a-zA-Z](?:_?[a-zA-Z])+",
    // Other LaTeX3 macro names that are not covered by the three rules above.
    "use(?:_i)?:[a-zA-Z]*",
    "(?:else|fi|or):",
    "(?:if|cs|exp):w",
    "(?:hbox|vbox):n",
    "::[a-zA-Z]_unbraced",
    "::[a-zA-Z:]"
  ].map((x) => x + "(?![a-zA-Z:_])").join("|")), i = [
    { begin: /[a-zA-Z@]+/ },
    // control word
    { begin: /[^a-zA-Z@]?/ }
    // control symbol
  ], o = [
    { begin: /\^{6}[0-9a-f]{6}/ },
    { begin: /\^{5}[0-9a-f]{5}/ },
    { begin: /\^{4}[0-9a-f]{4}/ },
    { begin: /\^{3}[0-9a-f]{3}/ },
    { begin: /\^{2}[0-9a-f]{2}/ },
    { begin: /\^{2}[\u0000-\u007f]/ }
  ], a = {
    className: "keyword",
    begin: /\\/,
    relevance: 0,
    contains: [
      {
        endsParent: !0,
        begin: n
      },
      {
        endsParent: !0,
        begin: r
      },
      {
        endsParent: !0,
        variants: o
      },
      {
        endsParent: !0,
        relevance: 0,
        variants: i
      }
    ]
  }, s = {
    className: "params",
    relevance: 0,
    begin: /#+\d?/
  }, l = {
    // relevance: 1
    variants: o
  }, c = {
    className: "built_in",
    relevance: 0,
    begin: /[$&^_]/
  }, u = {
    className: "meta",
    begin: /% ?!(T[eE]X|tex|BIB|bib)/,
    end: "$",
    relevance: 10
  }, d = t.COMMENT(
    "%",
    "$",
    { relevance: 0 }
  ), p = [
    a,
    s,
    l,
    c,
    u,
    d
  ], _ = {
    begin: /\{/,
    end: /\}/,
    relevance: 0,
    contains: [
      "self",
      ...p
    ]
  }, m = t.inherit(
    _,
    {
      relevance: 0,
      endsParent: !0,
      contains: [
        _,
        ...p
      ]
    }
  ), f = {
    begin: /\[/,
    end: /\]/,
    endsParent: !0,
    relevance: 0,
    contains: [
      _,
      ...p
    ]
  }, g = {
    begin: /\s+/,
    relevance: 0
  }, S = [m], E = [f], b = function(x, P) {
    return {
      contains: [g],
      starts: {
        relevance: 0,
        contains: x,
        starts: P
      }
    };
  }, h = function(x, P) {
    return {
      begin: "\\\\" + x + "(?![a-zA-Z@:_])",
      keywords: {
        $pattern: /\\[a-zA-Z]+/,
        keyword: "\\" + x
      },
      relevance: 0,
      contains: [g],
      starts: P
    };
  }, T = function(x, P) {
    return t.inherit(
      {
        begin: "\\\\begin(?=[ 	]*(\\r?\\n[ 	]*)?\\{" + x + "\\})",
        keywords: {
          $pattern: /\\[a-zA-Z]+/,
          keyword: "\\begin"
        },
        relevance: 0
      },
      b(S, P)
    );
  }, C = (x = "string") => t.END_SAME_AS_BEGIN({
    className: x,
    begin: /(.|\r?\n)/,
    end: /(.|\r?\n)/,
    excludeBegin: !0,
    excludeEnd: !0,
    endsParent: !0
  }), v = function(x) {
    return {
      className: "string",
      end: "(?=\\\\end\\{" + x + "\\})"
    };
  }, I = (x = "string") => ({
    relevance: 0,
    begin: /\{/,
    starts: {
      endsParent: !0,
      contains: [
        {
          className: x,
          end: /(?=\})/,
          endsParent: !0,
          contains: [
            {
              begin: /\{/,
              end: /\}/,
              relevance: 0,
              contains: ["self"]
            }
          ]
        }
      ]
    }
  }), N = [
    ...[
      "verb",
      "lstinline"
    ].map((x) => h(x, { contains: [C()] })),
    h("mint", b(S, { contains: [C()] })),
    h("mintinline", b(S, { contains: [
      I(),
      C()
    ] })),
    h("url", { contains: [
      I("link"),
      I("link")
    ] }),
    h("hyperref", { contains: [I("link")] }),
    h("href", b(E, { contains: [I("link")] })),
    ...[].concat(...[
      "",
      "\\*"
    ].map((x) => [
      T("verbatim" + x, v("verbatim" + x)),
      T("filecontents" + x, b(S, v("filecontents" + x))),
      ...[
        "",
        "B",
        "L"
      ].map(
        (P) => T(P + "Verbatim" + x, b(E, v(P + "Verbatim" + x)))
      )
    ])),
    T("minted", b(E, b(S, v("minted"))))
  ];
  return {
    name: "LaTeX",
    aliases: ["tex"],
    contains: [
      ...N,
      ...p
    ]
  };
}
function qx(t) {
  return {
    name: "LDIF",
    contains: [
      {
        className: "attribute",
        match: "^dn(?=:)",
        relevance: 10
      },
      {
        className: "attribute",
        match: "^\\w+(?=:)"
      },
      {
        className: "literal",
        match: "^-"
      },
      t.HASH_COMMENT_MODE
    ]
  };
}
function Wx(t) {
  const e = /([A-Za-z_][A-Za-z_0-9]*)?/, r = {
    scope: "params",
    begin: /\(/,
    end: /\)(?=\:?)/,
    endsParent: !0,
    relevance: 7,
    contains: [
      {
        scope: "string",
        begin: '"',
        end: '"'
      },
      {
        scope: "keyword",
        match: [
          "true",
          "false",
          "in"
        ].join("|")
      },
      {
        scope: "variable",
        match: /[A-Za-z_][A-Za-z_0-9]*/
      },
      {
        scope: "operator",
        match: /\+|\-|\*|\/|\%|\=\=|\=|\!|\>|\<|\&\&|\|\|/
      }
    ]
  }, i = {
    match: [
      e,
      /(?=\()/
    ],
    scope: {
      1: "keyword"
    },
    contains: [r]
  };
  return r.contains.unshift(i), {
    name: "Leaf",
    contains: [
      // #ident():
      {
        match: [
          /#+/,
          e,
          /(?=\()/
        ],
        scope: {
          1: "punctuation",
          2: "keyword"
        },
        // will start up after the ending `)` match from line ~44
        // just to grab the trailing `:` if we can match it
        starts: {
          contains: [
            {
              match: /\:/,
              scope: "punctuation"
            }
          ]
        },
        contains: [
          r
        ]
      },
      // #ident or #ident:
      {
        match: [
          /#+/,
          e,
          /:?/
        ],
        scope: {
          1: "punctuation",
          2: "keyword",
          3: "punctuation"
        }
      }
    ]
  };
}
function Kx(t) {
  const e = "[a-zA-Z_\\-+\\*\\/<=>&#][a-zA-Z0-9_\\-+*\\/<=>&#!]*", n = "\\|[^]*?\\|", r = "(-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s|D|E|F|L|S)(\\+|-)?\\d+)?", i = {
    className: "literal",
    begin: "\\b(t{1}|nil)\\b"
  }, o = {
    className: "number",
    variants: [
      {
        begin: r,
        relevance: 0
      },
      { begin: "#(b|B)[0-1]+(/[0-1]+)?" },
      { begin: "#(o|O)[0-7]+(/[0-7]+)?" },
      { begin: "#(x|X)[0-9a-fA-F]+(/[0-9a-fA-F]+)?" },
      {
        begin: "#(c|C)\\(" + r + " +" + r,
        end: "\\)"
      }
    ]
  }, a = t.inherit(t.QUOTE_STRING_MODE, { illegal: null }), s = t.COMMENT(
    ";",
    "$",
    { relevance: 0 }
  ), l = {
    begin: "\\*",
    end: "\\*"
  }, c = {
    className: "symbol",
    begin: "[:&]" + e
  }, u = {
    begin: e,
    relevance: 0
  }, d = { begin: n }, _ = {
    contains: [
      o,
      a,
      l,
      c,
      {
        begin: "\\(",
        end: "\\)",
        contains: [
          "self",
          i,
          a,
          o,
          u
        ]
      },
      u
    ],
    variants: [
      {
        begin: "['`]\\(",
        end: "\\)"
      },
      {
        begin: "\\(quote ",
        end: "\\)",
        keywords: { name: "quote" }
      },
      { begin: "'" + n }
    ]
  }, m = { variants: [
    { begin: "'" + e },
    { begin: "#'" + e + "(::" + e + ")*" }
  ] }, f = {
    begin: "\\(\\s*",
    end: "\\)"
  }, g = {
    endsWithParent: !0,
    relevance: 0
  };
  return f.contains = [
    {
      className: "name",
      variants: [
        {
          begin: e,
          relevance: 0
        },
        { begin: n }
      ]
    },
    g
  ], g.contains = [
    _,
    m,
    f,
    i,
    o,
    a,
    s,
    l,
    c,
    d,
    u
  ], {
    name: "Lisp",
    illegal: /\S/,
    contains: [
      o,
      t.SHEBANG(),
      i,
      a,
      s,
      _,
      m,
      f,
      u
    ]
  };
}
function Qx(t) {
  const e = {
    className: "variable",
    variants: [
      { begin: "\\b([gtps][A-Z]{1}[a-zA-Z0-9]*)(\\[.+\\])?(?:\\s*?)" },
      { begin: "\\$_[A-Z]+" }
    ],
    relevance: 0
  }, n = [
    t.C_BLOCK_COMMENT_MODE,
    t.HASH_COMMENT_MODE,
    t.COMMENT("--", "$"),
    t.COMMENT("[^:]//", "$")
  ], r = t.inherit(t.TITLE_MODE, { variants: [
    { begin: "\\b_*rig[A-Z][A-Za-z0-9_\\-]*" },
    { begin: "\\b_[a-z0-9\\-]+" }
  ] }), i = t.inherit(t.TITLE_MODE, { begin: "\\b([A-Za-z0-9_\\-]+)\\b" });
  return {
    name: "LiveCode",
    case_insensitive: !1,
    keywords: {
      keyword: "$_COOKIE $_FILES $_GET $_GET_BINARY $_GET_RAW $_POST $_POST_BINARY $_POST_RAW $_SESSION $_SERVER codepoint codepoints segment segments codeunit codeunits sentence sentences trueWord trueWords paragraph after byte bytes english the until http forever descending using line real8 with seventh for stdout finally element word words fourth before black ninth sixth characters chars stderr uInt1 uInt1s uInt2 uInt2s stdin string lines relative rel any fifth items from middle mid at else of catch then third it file milliseconds seconds second secs sec int1 int1s int4 int4s internet int2 int2s normal text item last long detailed effective uInt4 uInt4s repeat end repeat URL in try into switch to words https token binfile each tenth as ticks tick system real4 by dateItems without char character ascending eighth whole dateTime numeric short first ftp integer abbreviated abbr abbrev private case while if div mod wrap and or bitAnd bitNot bitOr bitXor among not in a an within contains ends with begins the keys of keys",
      literal: "SIX TEN FORMFEED NINE ZERO NONE SPACE FOUR FALSE COLON CRLF PI COMMA ENDOFFILE EOF EIGHT FIVE QUOTE EMPTY ONE TRUE RETURN CR LINEFEED RIGHT BACKSLASH NULL SEVEN TAB THREE TWO six ten formfeed nine zero none space four false colon crlf pi comma endoffile eof eight five quote empty one true return cr linefeed right backslash null seven tab three two RIVERSION RISTATE FILE_READ_MODE FILE_WRITE_MODE FILE_WRITE_MODE DIR_WRITE_MODE FILE_READ_UMASK FILE_WRITE_UMASK DIR_READ_UMASK DIR_WRITE_UMASK",
      built_in: "put abs acos aliasReference annuity arrayDecode arrayEncode asin atan atan2 average avg avgDev base64Decode base64Encode baseConvert binaryDecode binaryEncode byteOffset byteToNum cachedURL cachedURLs charToNum cipherNames codepointOffset codepointProperty codepointToNum codeunitOffset commandNames compound compress constantNames cos date dateFormat decompress difference directories diskSpace DNSServers exp exp1 exp2 exp10 extents files flushEvents folders format functionNames geometricMean global globals hasMemory harmonicMean hostAddress hostAddressToName hostName hostNameToAddress isNumber ISOToMac itemOffset keys len length libURLErrorData libUrlFormData libURLftpCommand libURLLastHTTPHeaders libURLLastRHHeaders libUrlMultipartFormAddPart libUrlMultipartFormData libURLVersion lineOffset ln ln1 localNames log log2 log10 longFilePath lower macToISO matchChunk matchText matrixMultiply max md5Digest median merge messageAuthenticationCode messageDigest millisec millisecs millisecond milliseconds min monthNames nativeCharToNum normalizeText num number numToByte numToChar numToCodepoint numToNativeChar offset open openfiles openProcesses openProcessIDs openSockets paragraphOffset paramCount param params peerAddress pendingMessages platform popStdDev populationStandardDeviation populationVariance popVariance processID random randomBytes replaceText result revCreateXMLTree revCreateXMLTreeFromFile revCurrentRecord revCurrentRecordIsFirst revCurrentRecordIsLast revDatabaseColumnCount revDatabaseColumnIsNull revDatabaseColumnLengths revDatabaseColumnNames revDatabaseColumnNamed revDatabaseColumnNumbered revDatabaseColumnTypes revDatabaseConnectResult revDatabaseCursors revDatabaseID revDatabaseTableNames revDatabaseType revDataFromQuery revdb_closeCursor revdb_columnbynumber revdb_columncount revdb_columnisnull revdb_columnlengths revdb_columnnames revdb_columntypes revdb_commit revdb_connect revdb_connections revdb_connectionerr revdb_currentrecord revdb_cursorconnection revdb_cursorerr revdb_cursors revdb_dbtype revdb_disconnect revdb_execute revdb_iseof revdb_isbof revdb_movefirst revdb_movelast revdb_movenext revdb_moveprev revdb_query revdb_querylist revdb_recordcount revdb_rollback revdb_tablenames revGetDatabaseDriverPath revNumberOfRecords revOpenDatabase revOpenDatabases revQueryDatabase revQueryDatabaseBlob revQueryResult revQueryIsAtStart revQueryIsAtEnd revUnixFromMacPath revXMLAttribute revXMLAttributes revXMLAttributeValues revXMLChildContents revXMLChildNames revXMLCreateTreeFromFileWithNamespaces revXMLCreateTreeWithNamespaces revXMLDataFromXPathQuery revXMLEvaluateXPath revXMLFirstChild revXMLMatchingNode revXMLNextSibling revXMLNodeContents revXMLNumberOfChildren revXMLParent revXMLPreviousSibling revXMLRootNode revXMLRPC_CreateRequest revXMLRPC_Documents revXMLRPC_Error revXMLRPC_GetHost revXMLRPC_GetMethod revXMLRPC_GetParam revXMLText revXMLRPC_Execute revXMLRPC_GetParamCount revXMLRPC_GetParamNode revXMLRPC_GetParamType revXMLRPC_GetPath revXMLRPC_GetPort revXMLRPC_GetProtocol revXMLRPC_GetRequest revXMLRPC_GetResponse revXMLRPC_GetSocket revXMLTree revXMLTrees revXMLValidateDTD revZipDescribeItem revZipEnumerateItems revZipOpenArchives round sampVariance sec secs seconds sentenceOffset sha1Digest shell shortFilePath sin specialFolderPath sqrt standardDeviation statRound stdDev sum sysError systemVersion tan tempName textDecode textEncode tick ticks time to tokenOffset toLower toUpper transpose truewordOffset trunc uniDecode uniEncode upper URLDecode URLEncode URLStatus uuid value variableNames variance version waitDepth weekdayNames wordOffset xsltApplyStylesheet xsltApplyStylesheetFromFile xsltLoadStylesheet xsltLoadStylesheetFromFile add breakpoint cancel clear local variable file word line folder directory URL close socket process combine constant convert create new alias folder directory decrypt delete variable word line folder directory URL dispatch divide do encrypt filter get include intersect kill libURLDownloadToFile libURLFollowHttpRedirects libURLftpUpload libURLftpUploadFile libURLresetAll libUrlSetAuthCallback libURLSetDriver libURLSetCustomHTTPHeaders libUrlSetExpect100 libURLSetFTPListCommand libURLSetFTPMode libURLSetFTPStopTime libURLSetStatusCallback load extension loadedExtensions multiply socket prepare process post seek rel relative read from process rename replace require resetAll resolve revAddXMLNode revAppendXML revCloseCursor revCloseDatabase revCommitDatabase revCopyFile revCopyFolder revCopyXMLNode revDeleteFolder revDeleteXMLNode revDeleteAllXMLTrees revDeleteXMLTree revExecuteSQL revGoURL revInsertXMLNode revMoveFolder revMoveToFirstRecord revMoveToLastRecord revMoveToNextRecord revMoveToPreviousRecord revMoveToRecord revMoveXMLNode revPutIntoXMLNode revRollBackDatabase revSetDatabaseDriverPath revSetXMLAttribute revXMLRPC_AddParam revXMLRPC_DeleteAllDocuments revXMLAddDTD revXMLRPC_Free revXMLRPC_FreeAll revXMLRPC_DeleteDocument revXMLRPC_DeleteParam revXMLRPC_SetHost revXMLRPC_SetMethod revXMLRPC_SetPort revXMLRPC_SetProtocol revXMLRPC_SetSocket revZipAddItemWithData revZipAddItemWithFile revZipAddUncompressedItemWithData revZipAddUncompressedItemWithFile revZipCancel revZipCloseArchive revZipDeleteItem revZipExtractItemToFile revZipExtractItemToVariable revZipSetProgressCallback revZipRenameItem revZipReplaceItemWithData revZipReplaceItemWithFile revZipOpenArchive send set sort split start stop subtract symmetric union unload vectorDotProduct wait write"
    },
    contains: [
      e,
      {
        className: "keyword",
        begin: "\\bend\\sif\\b"
      },
      {
        className: "function",
        beginKeywords: "function",
        end: "$",
        contains: [
          e,
          i,
          t.APOS_STRING_MODE,
          t.QUOTE_STRING_MODE,
          t.BINARY_NUMBER_MODE,
          t.C_NUMBER_MODE,
          r
        ]
      },
      {
        className: "function",
        begin: "\\bend\\s+",
        end: "$",
        keywords: "end",
        contains: [
          i,
          r
        ],
        relevance: 0
      },
      {
        beginKeywords: "command on",
        end: "$",
        contains: [
          e,
          i,
          t.APOS_STRING_MODE,
          t.QUOTE_STRING_MODE,
          t.BINARY_NUMBER_MODE,
          t.C_NUMBER_MODE,
          r
        ]
      },
      {
        className: "meta",
        variants: [
          {
            begin: "<\\?(rev|lc|livecode)",
            relevance: 10
          },
          { begin: "<\\?" },
          { begin: "\\?>" }
        ]
      },
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      t.BINARY_NUMBER_MODE,
      t.C_NUMBER_MODE,
      r
    ].concat(n),
    illegal: ";$|^\\[|^=|&|\\{"
  };
}
const Zx = [
  "as",
  // for exports
  "in",
  "of",
  "if",
  "for",
  "while",
  "finally",
  "var",
  "new",
  "function",
  "do",
  "return",
  "void",
  "else",
  "break",
  "catch",
  "instanceof",
  "with",
  "throw",
  "case",
  "default",
  "try",
  "switch",
  "continue",
  "typeof",
  "delete",
  "let",
  "yield",
  "const",
  "class",
  // JS handles these with a special rule
  // "get",
  // "set",
  "debugger",
  "async",
  "await",
  "static",
  "import",
  "from",
  "export",
  "extends",
  // It's reached stage 3, which is "recommended for implementation":
  "using"
], Xx = [
  "true",
  "false",
  "null",
  "undefined",
  "NaN",
  "Infinity"
], jx = [
  // Fundamental objects
  "Object",
  "Function",
  "Boolean",
  "Symbol",
  // numbers and dates
  "Math",
  "Date",
  "Number",
  "BigInt",
  // text
  "String",
  "RegExp",
  // Indexed collections
  "Array",
  "Float32Array",
  "Float64Array",
  "Int8Array",
  "Uint8Array",
  "Uint8ClampedArray",
  "Int16Array",
  "Int32Array",
  "Uint16Array",
  "Uint32Array",
  "BigInt64Array",
  "BigUint64Array",
  // Keyed collections
  "Set",
  "Map",
  "WeakSet",
  "WeakMap",
  // Structured data
  "ArrayBuffer",
  "SharedArrayBuffer",
  "Atomics",
  "DataView",
  "JSON",
  // Control abstraction objects
  "Promise",
  "Generator",
  "GeneratorFunction",
  "AsyncFunction",
  // Reflection
  "Reflect",
  "Proxy",
  // Internationalization
  "Intl",
  // WebAssembly
  "WebAssembly"
], Jx = [
  "Error",
  "EvalError",
  "InternalError",
  "RangeError",
  "ReferenceError",
  "SyntaxError",
  "TypeError",
  "URIError"
], eD = [
  "setInterval",
  "setTimeout",
  "clearInterval",
  "clearTimeout",
  "require",
  "exports",
  "eval",
  "isFinite",
  "isNaN",
  "parseFloat",
  "parseInt",
  "decodeURI",
  "decodeURIComponent",
  "encodeURI",
  "encodeURIComponent",
  "escape",
  "unescape"
], tD = [].concat(
  eD,
  jx,
  Jx
);
function nD(t) {
  const e = [
    "npm",
    "print"
  ], n = [
    "yes",
    "no",
    "on",
    "off",
    "it",
    "that",
    "void"
  ], r = [
    "then",
    "unless",
    "until",
    "loop",
    "of",
    "by",
    "when",
    "and",
    "or",
    "is",
    "isnt",
    "not",
    "it",
    "that",
    "otherwise",
    "from",
    "to",
    "til",
    "fallthrough",
    "case",
    "enum",
    "native",
    "list",
    "map",
    "__hasProp",
    "__extends",
    "__slice",
    "__bind",
    "__indexOf"
  ], i = {
    keyword: Zx.concat(r),
    literal: Xx.concat(n),
    built_in: tD.concat(e)
  }, o = "[A-Za-z$_](?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*", a = t.inherit(t.TITLE_MODE, { begin: o }), s = {
    className: "subst",
    begin: /#\{/,
    end: /\}/,
    keywords: i
  }, l = {
    className: "subst",
    begin: /#[A-Za-z$_]/,
    end: /(?:-[0-9A-Za-z$_]|[0-9A-Za-z$_])*/,
    keywords: i
  }, c = [
    t.BINARY_NUMBER_MODE,
    {
      className: "number",
      begin: "(\\b0[xX][a-fA-F0-9_]+)|(\\b\\d(\\d|_\\d)*(\\.(\\d(\\d|_\\d)*)?)?(_*[eE]([-+]\\d(_\\d|\\d)*)?)?[_a-z]*)",
      relevance: 0,
      starts: {
        end: "(\\s*/)?",
        relevance: 0
      }
      // a number tries to eat the following slash to prevent treating it as a regexp
    },
    {
      className: "string",
      variants: [
        {
          begin: /'''/,
          end: /'''/,
          contains: [t.BACKSLASH_ESCAPE]
        },
        {
          begin: /'/,
          end: /'/,
          contains: [t.BACKSLASH_ESCAPE]
        },
        {
          begin: /"""/,
          end: /"""/,
          contains: [
            t.BACKSLASH_ESCAPE,
            s,
            l
          ]
        },
        {
          begin: /"/,
          end: /"/,
          contains: [
            t.BACKSLASH_ESCAPE,
            s,
            l
          ]
        },
        {
          begin: /\\/,
          end: /(\s|$)/,
          excludeEnd: !0
        }
      ]
    },
    {
      className: "regexp",
      variants: [
        {
          begin: "//",
          end: "//[gim]*",
          contains: [
            s,
            t.HASH_COMMENT_MODE
          ]
        },
        {
          // regex can't start with space to parse x / 2 / 3 as two divisions
          // regex can't start with *, and it supports an "illegal" in the main mode
          begin: /\/(?![ *])(\\.|[^\\\n])*?\/[gim]*(?=\W)/
        }
      ]
    },
    { begin: "@" + o },
    {
      begin: "``",
      end: "``",
      excludeBegin: !0,
      excludeEnd: !0,
      subLanguage: "javascript"
    }
  ];
  s.contains = c;
  const u = {
    className: "params",
    begin: "\\(",
    returnBegin: !0,
    /* We need another contained nameless mode to not have every nested
    pair of parens to be called "params" */
    contains: [
      {
        begin: /\(/,
        end: /\)/,
        keywords: i,
        contains: ["self"].concat(c)
      }
    ]
  }, d = { begin: "(#=>|=>|\\|>>|-?->|!->)" }, p = {
    variants: [
      { match: [
        /class\s+/,
        o,
        /\s+extends\s+/,
        o
      ] },
      { match: [
        /class\s+/,
        o
      ] }
    ],
    scope: {
      2: "title.class",
      4: "title.class.inherited"
    },
    keywords: i
  };
  return {
    name: "LiveScript",
    aliases: ["ls"],
    keywords: i,
    illegal: /\/\*/,
    contains: c.concat([
      t.COMMENT("\\/\\*", "\\*\\/"),
      t.HASH_COMMENT_MODE,
      d,
      // relevance booster
      {
        className: "function",
        contains: [
          a,
          u
        ],
        returnBegin: !0,
        variants: [
          {
            begin: "(" + o + "\\s*(?:=|:=)\\s*)?(\\(.*\\)\\s*)?\\B->\\*?",
            end: "->\\*?"
          },
          {
            begin: "(" + o + "\\s*(?:=|:=)\\s*)?!?(\\(.*\\)\\s*)?\\B[-~]{1,2}>\\*?",
            end: "[-~]{1,2}>\\*?"
          },
          {
            begin: "(" + o + "\\s*(?:=|:=)\\s*)?(\\(.*\\)\\s*)?\\B!?[-~]{1,2}>\\*?",
            end: "!?[-~]{1,2}>\\*?"
          }
        ]
      },
      p,
      {
        begin: o + ":",
        end: ":",
        returnBegin: !0,
        returnEnd: !0,
        relevance: 0
      }
    ])
  };
}
function rD(t) {
  const e = t.regex, n = /([-a-zA-Z$._][\w$.-]*)/, r = {
    className: "type",
    begin: /\bi\d+(?=\s|\b)/
  }, i = {
    className: "operator",
    relevance: 0,
    begin: /=/
  }, o = {
    className: "punctuation",
    relevance: 0,
    begin: /,/
  }, a = {
    className: "number",
    variants: [
      { begin: /[su]?0[xX][KMLHR]?[a-fA-F0-9]+/ },
      { begin: /[-+]?\d+(?:[.]\d+)?(?:[eE][-+]?\d+(?:[.]\d+)?)?/ }
    ],
    relevance: 0
  }, s = {
    className: "symbol",
    variants: [
      { begin: /^\s*[a-z]+:/ }
      // labels
    ],
    relevance: 0
  }, l = {
    className: "variable",
    variants: [
      { begin: e.concat(/%/, n) },
      { begin: /%\d+/ },
      { begin: /#\d+/ }
    ]
  }, c = {
    className: "title",
    variants: [
      { begin: e.concat(/@/, n) },
      { begin: /@\d+/ },
      { begin: e.concat(/!/, n) },
      { begin: e.concat(/!\d+/, n) },
      // https://llvm.org/docs/LangRef.html#namedmetadatastructure
      // obviously a single digit can also be used in this fashion
      { begin: /!\d+/ }
    ]
  };
  return {
    name: "LLVM IR",
    // TODO: split into different categories of keywords
    keywords: {
      keyword: "begin end true false declare define global constant private linker_private internal available_externally linkonce linkonce_odr weak weak_odr appending dllimport dllexport common default hidden protected extern_weak external thread_local zeroinitializer undef null to tail target triple datalayout volatile nuw nsw nnan ninf nsz arcp fast exact inbounds align addrspace section alias module asm sideeffect gc dbg linker_private_weak attributes blockaddress initialexec localdynamic localexec prefix unnamed_addr ccc fastcc coldcc x86_stdcallcc x86_fastcallcc arm_apcscc arm_aapcscc arm_aapcs_vfpcc ptx_device ptx_kernel intel_ocl_bicc msp430_intrcc spir_func spir_kernel x86_64_sysvcc x86_64_win64cc x86_thiscallcc cc c signext zeroext inreg sret nounwind noreturn noalias nocapture byval nest readnone readonly inlinehint noinline alwaysinline optsize ssp sspreq noredzone noimplicitfloat naked builtin cold nobuiltin noduplicate nonlazybind optnone returns_twice sanitize_address sanitize_memory sanitize_thread sspstrong uwtable returned type opaque eq ne slt sgt sle sge ult ugt ule uge oeq one olt ogt ole oge ord uno ueq une x acq_rel acquire alignstack atomic catch cleanup filter inteldialect max min monotonic nand personality release seq_cst singlethread umax umin unordered xchg add fadd sub fsub mul fmul udiv sdiv fdiv urem srem frem shl lshr ashr and or xor icmp fcmp phi call trunc zext sext fptrunc fpext uitofp sitofp fptoui fptosi inttoptr ptrtoint bitcast addrspacecast select va_arg ret br switch invoke unwind unreachable indirectbr landingpad resume malloc alloca free load store getelementptr extractelement insertelement shufflevector getresult extractvalue insertvalue atomicrmw cmpxchg fence argmemonly",
      type: "void half bfloat float double fp128 x86_fp80 ppc_fp128 x86_amx x86_mmx ptr label token metadata opaque"
    },
    contains: [
      r,
      // this matches "empty comments"...
      // ...because it's far more likely this is a statement terminator in
      // another language than an actual comment
      t.COMMENT(/;\s*$/, null, { relevance: 0 }),
      t.COMMENT(/;/, /$/),
      {
        className: "string",
        begin: /"/,
        end: /"/,
        contains: [
          {
            className: "char.escape",
            match: /\\\d\d/
          }
        ]
      },
      c,
      o,
      i,
      l,
      s,
      a
    ]
  };
}
function iD(t) {
  const n = {
    className: "string",
    begin: '"',
    end: '"',
    contains: [{
      className: "subst",
      begin: /\\[tn"\\]/
    }]
  }, r = {
    className: "number",
    relevance: 0,
    begin: t.C_NUMBER_RE
  }, i = {
    className: "literal",
    variants: [
      { begin: "\\b(PI|TWO_PI|PI_BY_TWO|DEG_TO_RAD|RAD_TO_DEG|SQRT2)\\b" },
      { begin: "\\b(XP_ERROR_(EXPERIENCES_DISABLED|EXPERIENCE_(DISABLED|SUSPENDED)|INVALID_(EXPERIENCE|PARAMETERS)|KEY_NOT_FOUND|MATURITY_EXCEEDED|NONE|NOT_(FOUND|PERMITTED(_LAND)?)|NO_EXPERIENCE|QUOTA_EXCEEDED|RETRY_UPDATE|STORAGE_EXCEPTION|STORE_DISABLED|THROTTLED|UNKNOWN_ERROR)|JSON_APPEND|STATUS_(PHYSICS|ROTATE_[XYZ]|PHANTOM|SANDBOX|BLOCK_GRAB(_OBJECT)?|(DIE|RETURN)_AT_EDGE|CAST_SHADOWS|OK|MALFORMED_PARAMS|TYPE_MISMATCH|BOUNDS_ERROR|NOT_(FOUND|SUPPORTED)|INTERNAL_ERROR|WHITELIST_FAILED)|AGENT(_(BY_(LEGACY_|USER)NAME|FLYING|ATTACHMENTS|SCRIPTED|MOUSELOOK|SITTING|ON_OBJECT|AWAY|WALKING|IN_AIR|TYPING|CROUCHING|BUSY|ALWAYS_RUN|AUTOPILOT|LIST_(PARCEL(_OWNER)?|REGION)))?|CAMERA_(PITCH|DISTANCE|BEHINDNESS_(ANGLE|LAG)|(FOCUS|POSITION)(_(THRESHOLD|LOCKED|LAG))?|FOCUS_OFFSET|ACTIVE)|ANIM_ON|LOOP|REVERSE|PING_PONG|SMOOTH|ROTATE|SCALE|ALL_SIDES|LINK_(ROOT|SET|ALL_(OTHERS|CHILDREN)|THIS)|ACTIVE|PASS(IVE|_(ALWAYS|IF_NOT_HANDLED|NEVER))|SCRIPTED|CONTROL_(FWD|BACK|(ROT_)?(LEFT|RIGHT)|UP|DOWN|(ML_)?LBUTTON)|PERMISSION_(RETURN_OBJECTS|DEBIT|OVERRIDE_ANIMATIONS|SILENT_ESTATE_MANAGEMENT|TAKE_CONTROLS|TRIGGER_ANIMATION|ATTACH|CHANGE_LINKS|(CONTROL|TRACK)_CAMERA|TELEPORT)|INVENTORY_(TEXTURE|SOUND|OBJECT|SCRIPT|LANDMARK|CLOTHING|NOTECARD|BODYPART|ANIMATION|GESTURE|ALL|NONE)|CHANGED_(INVENTORY|COLOR|SHAPE|SCALE|TEXTURE|LINK|ALLOWED_DROP|OWNER|REGION(_START)?|TELEPORT|MEDIA)|OBJECT_(CLICK_ACTION|HOVER_HEIGHT|LAST_OWNER_ID|(PHYSICS|SERVER|STREAMING)_COST|UNKNOWN_DETAIL|CHARACTER_TIME|PHANTOM|PHYSICS|TEMP_(ATTACHED|ON_REZ)|NAME|DESC|POS|PRIM_(COUNT|EQUIVALENCE)|RETURN_(PARCEL(_OWNER)?|REGION)|REZZER_KEY|ROO?T|VELOCITY|OMEGA|OWNER|GROUP(_TAG)?|CREATOR|ATTACHED_(POINT|SLOTS_AVAILABLE)|RENDER_WEIGHT|(BODY_SHAPE|PATHFINDING)_TYPE|(RUNNING|TOTAL)_SCRIPT_COUNT|TOTAL_INVENTORY_COUNT|SCRIPT_(MEMORY|TIME))|TYPE_(INTEGER|FLOAT|STRING|KEY|VECTOR|ROTATION|INVALID)|(DEBUG|PUBLIC)_CHANNEL|ATTACH_(AVATAR_CENTER|CHEST|HEAD|BACK|PELVIS|MOUTH|CHIN|NECK|NOSE|BELLY|[LR](SHOULDER|HAND|FOOT|EAR|EYE|[UL](ARM|LEG)|HIP)|(LEFT|RIGHT)_PEC|HUD_(CENTER_[12]|TOP_(RIGHT|CENTER|LEFT)|BOTTOM(_(RIGHT|LEFT))?)|[LR]HAND_RING1|TAIL_(BASE|TIP)|[LR]WING|FACE_(JAW|[LR]EAR|[LR]EYE|TOUNGE)|GROIN|HIND_[LR]FOOT)|LAND_(LEVEL|RAISE|LOWER|SMOOTH|NOISE|REVERT)|DATA_(ONLINE|NAME|BORN|SIM_(POS|STATUS|RATING)|PAYINFO)|PAYMENT_INFO_(ON_FILE|USED)|REMOTE_DATA_(CHANNEL|REQUEST|REPLY)|PSYS_(PART_(BF_(ZERO|ONE(_MINUS_(DEST_COLOR|SOURCE_(ALPHA|COLOR)))?|DEST_COLOR|SOURCE_(ALPHA|COLOR))|BLEND_FUNC_(DEST|SOURCE)|FLAGS|(START|END)_(COLOR|ALPHA|SCALE|GLOW)|MAX_AGE|(RIBBON|WIND|INTERP_(COLOR|SCALE)|BOUNCE|FOLLOW_(SRC|VELOCITY)|TARGET_(POS|LINEAR)|EMISSIVE)_MASK)|SRC_(MAX_AGE|PATTERN|ANGLE_(BEGIN|END)|BURST_(RATE|PART_COUNT|RADIUS|SPEED_(MIN|MAX))|ACCEL|TEXTURE|TARGET_KEY|OMEGA|PATTERN_(DROP|EXPLODE|ANGLE(_CONE(_EMPTY)?)?)))|VEHICLE_(REFERENCE_FRAME|TYPE_(NONE|SLED|CAR|BOAT|AIRPLANE|BALLOON)|(LINEAR|ANGULAR)_(FRICTION_TIMESCALE|MOTOR_DIRECTION)|LINEAR_MOTOR_OFFSET|HOVER_(HEIGHT|EFFICIENCY|TIMESCALE)|BUOYANCY|(LINEAR|ANGULAR)_(DEFLECTION_(EFFICIENCY|TIMESCALE)|MOTOR_(DECAY_)?TIMESCALE)|VERTICAL_ATTRACTION_(EFFICIENCY|TIMESCALE)|BANKING_(EFFICIENCY|MIX|TIMESCALE)|FLAG_(NO_DEFLECTION_UP|LIMIT_(ROLL_ONLY|MOTOR_UP)|HOVER_((WATER|TERRAIN|UP)_ONLY|GLOBAL_HEIGHT)|MOUSELOOK_(STEER|BANK)|CAMERA_DECOUPLED))|PRIM_(ALLOW_UNSIT|ALPHA_MODE(_(BLEND|EMISSIVE|MASK|NONE))?|NORMAL|SPECULAR|TYPE(_(BOX|CYLINDER|PRISM|SPHERE|TORUS|TUBE|RING|SCULPT))?|HOLE_(DEFAULT|CIRCLE|SQUARE|TRIANGLE)|MATERIAL(_(STONE|METAL|GLASS|WOOD|FLESH|PLASTIC|RUBBER))?|SHINY_(NONE|LOW|MEDIUM|HIGH)|BUMP_(NONE|BRIGHT|DARK|WOOD|BARK|BRICKS|CHECKER|CONCRETE|TILE|STONE|DISKS|GRAVEL|BLOBS|SIDING|LARGETILE|STUCCO|SUCTION|WEAVE)|TEXGEN_(DEFAULT|PLANAR)|SCRIPTED_SIT_ONLY|SCULPT_(TYPE_(SPHERE|TORUS|PLANE|CYLINDER|MASK)|FLAG_(MIRROR|INVERT))|PHYSICS(_(SHAPE_(CONVEX|NONE|PRIM|TYPE)))?|(POS|ROT)_LOCAL|SLICE|TEXT|FLEXIBLE|POINT_LIGHT|TEMP_ON_REZ|PHANTOM|POSITION|SIT_TARGET|SIZE|ROTATION|TEXTURE|NAME|OMEGA|DESC|LINK_TARGET|COLOR|BUMP_SHINY|FULLBRIGHT|TEXGEN|GLOW|MEDIA_(ALT_IMAGE_ENABLE|CONTROLS|(CURRENT|HOME)_URL|AUTO_(LOOP|PLAY|SCALE|ZOOM)|FIRST_CLICK_INTERACT|(WIDTH|HEIGHT)_PIXELS|WHITELIST(_ENABLE)?|PERMS_(INTERACT|CONTROL)|PARAM_MAX|CONTROLS_(STANDARD|MINI)|PERM_(NONE|OWNER|GROUP|ANYONE)|MAX_(URL_LENGTH|WHITELIST_(SIZE|COUNT)|(WIDTH|HEIGHT)_PIXELS)))|MASK_(BASE|OWNER|GROUP|EVERYONE|NEXT)|PERM_(TRANSFER|MODIFY|COPY|MOVE|ALL)|PARCEL_(MEDIA_COMMAND_(STOP|PAUSE|PLAY|LOOP|TEXTURE|URL|TIME|AGENT|UNLOAD|AUTO_ALIGN|TYPE|SIZE|DESC|LOOP_SET)|FLAG_(ALLOW_(FLY|(GROUP_)?SCRIPTS|LANDMARK|TERRAFORM|DAMAGE|CREATE_(GROUP_)?OBJECTS)|USE_(ACCESS_(GROUP|LIST)|BAN_LIST|LAND_PASS_LIST)|LOCAL_SOUND_ONLY|RESTRICT_PUSHOBJECT|ALLOW_(GROUP|ALL)_OBJECT_ENTRY)|COUNT_(TOTAL|OWNER|GROUP|OTHER|SELECTED|TEMP)|DETAILS_(NAME|DESC|OWNER|GROUP|AREA|ID|SEE_AVATARS))|LIST_STAT_(MAX|MIN|MEAN|MEDIAN|STD_DEV|SUM(_SQUARES)?|NUM_COUNT|GEOMETRIC_MEAN|RANGE)|PAY_(HIDE|DEFAULT)|REGION_FLAG_(ALLOW_DAMAGE|FIXED_SUN|BLOCK_TERRAFORM|SANDBOX|DISABLE_(COLLISIONS|PHYSICS)|BLOCK_FLY|ALLOW_DIRECT_TELEPORT|RESTRICT_PUSHOBJECT)|HTTP_(METHOD|MIMETYPE|BODY_(MAXLENGTH|TRUNCATED)|CUSTOM_HEADER|PRAGMA_NO_CACHE|VERBOSE_THROTTLE|VERIFY_CERT)|SIT_(INVALID_(AGENT|LINK_OBJECT)|NO(T_EXPERIENCE|_(ACCESS|EXPERIENCE_PERMISSION|SIT_TARGET)))|STRING_(TRIM(_(HEAD|TAIL))?)|CLICK_ACTION_(NONE|TOUCH|SIT|BUY|PAY|OPEN(_MEDIA)?|PLAY|ZOOM)|TOUCH_INVALID_FACE|PROFILE_(NONE|SCRIPT_MEMORY)|RC_(DATA_FLAGS|DETECT_PHANTOM|GET_(LINK_NUM|NORMAL|ROOT_KEY)|MAX_HITS|REJECT_(TYPES|AGENTS|(NON)?PHYSICAL|LAND))|RCERR_(CAST_TIME_EXCEEDED|SIM_PERF_LOW|UNKNOWN)|ESTATE_ACCESS_(ALLOWED_(AGENT|GROUP)_(ADD|REMOVE)|BANNED_AGENT_(ADD|REMOVE))|DENSITY|FRICTION|RESTITUTION|GRAVITY_MULTIPLIER|KFM_(COMMAND|CMD_(PLAY|STOP|PAUSE)|MODE|FORWARD|LOOP|PING_PONG|REVERSE|DATA|ROTATION|TRANSLATION)|ERR_(GENERIC|PARCEL_PERMISSIONS|MALFORMED_PARAMS|RUNTIME_PERMISSIONS|THROTTLED)|CHARACTER_(CMD_((SMOOTH_)?STOP|JUMP)|DESIRED_(TURN_)?SPEED|RADIUS|STAY_WITHIN_PARCEL|LENGTH|ORIENTATION|ACCOUNT_FOR_SKIPPED_FRAMES|AVOIDANCE_MODE|TYPE(_([ABCD]|NONE))?|MAX_(DECEL|TURN_RADIUS|(ACCEL|SPEED)))|PURSUIT_(OFFSET|FUZZ_FACTOR|GOAL_TOLERANCE|INTERCEPT)|REQUIRE_LINE_OF_SIGHT|FORCE_DIRECT_PATH|VERTICAL|HORIZONTAL|AVOID_(CHARACTERS|DYNAMIC_OBSTACLES|NONE)|PU_(EVADE_(HIDDEN|SPOTTED)|FAILURE_(DYNAMIC_PATHFINDING_DISABLED|INVALID_(GOAL|START)|NO_(NAVMESH|VALID_DESTINATION)|OTHER|TARGET_GONE|(PARCEL_)?UNREACHABLE)|(GOAL|SLOWDOWN_DISTANCE)_REACHED)|TRAVERSAL_TYPE(_(FAST|NONE|SLOW))?|CONTENT_TYPE_(ATOM|FORM|HTML|JSON|LLSD|RSS|TEXT|XHTML|XML)|GCNP_(RADIUS|STATIC)|(PATROL|WANDER)_PAUSE_AT_WAYPOINTS|OPT_(AVATAR|CHARACTER|EXCLUSION_VOLUME|LEGACY_LINKSET|MATERIAL_VOLUME|OTHER|STATIC_OBSTACLE|WALKABLE)|SIM_STAT_PCT_CHARS_STEPPED)\\b" },
      { begin: "\\b(FALSE|TRUE)\\b" },
      { begin: "\\b(ZERO_ROTATION)\\b" },
      { begin: "\\b(EOF|JSON_(ARRAY|DELETE|FALSE|INVALID|NULL|NUMBER|OBJECT|STRING|TRUE)|NULL_KEY|TEXTURE_(BLANK|DEFAULT|MEDIA|PLYWOOD|TRANSPARENT)|URL_REQUEST_(GRANTED|DENIED))\\b" },
      { begin: "\\b(ZERO_VECTOR|TOUCH_INVALID_(TEXCOORD|VECTOR))\\b" }
    ]
  }, o = {
    className: "built_in",
    begin: "\\b(ll(AgentInExperience|(Create|DataSize|Delete|KeyCount|Keys|Read|Update)KeyValue|GetExperience(Details|ErrorMessage)|ReturnObjectsBy(ID|Owner)|Json(2List|[GS]etValue|ValueType)|Sin|Cos|Tan|Atan2|Sqrt|Pow|Abs|Fabs|Frand|Floor|Ceil|Round|Vec(Mag|Norm|Dist)|Rot(Between|2(Euler|Fwd|Left|Up))|(Euler|Axes)2Rot|Whisper|(Region|Owner)?Say|Shout|Listen(Control|Remove)?|Sensor(Repeat|Remove)?|Detected(Name|Key|Owner|Type|Pos|Vel|Grab|Rot|Group|LinkNumber)|Die|Ground|Wind|([GS]et)(AnimationOverride|MemoryLimit|PrimMediaParams|ParcelMusicURL|Object(Desc|Name)|PhysicsMaterial|Status|Scale|Color|Alpha|Texture|Pos|Rot|Force|Torque)|ResetAnimationOverride|(Scale|Offset|Rotate)Texture|(Rot)?Target(Remove)?|(Stop)?MoveToTarget|Apply(Rotational)?Impulse|Set(KeyframedMotion|ContentType|RegionPos|(Angular)?Velocity|Buoyancy|HoverHeight|ForceAndTorque|TimerEvent|ScriptState|Damage|TextureAnim|Sound(Queueing|Radius)|Vehicle(Type|(Float|Vector|Rotation)Param)|(Touch|Sit)?Text|Camera(Eye|At)Offset|PrimitiveParams|ClickAction|Link(Alpha|Color|PrimitiveParams(Fast)?|Texture(Anim)?|Camera|Media)|RemoteScriptAccessPin|PayPrice|LocalRot)|ScaleByFactor|Get((Max|Min)ScaleFactor|ClosestNavPoint|StaticPath|SimStats|Env|PrimitiveParams|Link(PrimitiveParams|Number(OfSides)?|Key|Name|Media)|HTTPHeader|FreeURLs|Object(Details|PermMask|PrimCount)|Parcel(MaxPrims|Details|Prim(Count|Owners))|Attached(List)?|(SPMax|Free|Used)Memory|Region(Name|TimeDilation|FPS|Corner|AgentCount)|Root(Position|Rotation)|UnixTime|(Parcel|Region)Flags|(Wall|GMT)clock|SimulatorHostname|BoundingBox|GeometricCenter|Creator|NumberOf(Prims|NotecardLines|Sides)|Animation(List)?|(Camera|Local)(Pos|Rot)|Vel|Accel|Omega|Time(stamp|OfDay)|(Object|CenterOf)?Mass|MassMKS|Energy|Owner|(Owner)?Key|SunDirection|Texture(Offset|Scale|Rot)|Inventory(Number|Name|Key|Type|Creator|PermMask)|Permissions(Key)?|StartParameter|List(Length|EntryType)|Date|Agent(Size|Info|Language|List)|LandOwnerAt|NotecardLine|Script(Name|State))|(Get|Reset|GetAndReset)Time|PlaySound(Slave)?|LoopSound(Master|Slave)?|(Trigger|Stop|Preload)Sound|((Get|Delete)Sub|Insert)String|To(Upper|Lower)|Give(InventoryList|Money)|RezObject|(Stop)?LookAt|Sleep|CollisionFilter|(Take|Release)Controls|DetachFromAvatar|AttachToAvatar(Temp)?|InstantMessage|(GetNext)?Email|StopHover|MinEventDelay|RotLookAt|String(Length|Trim)|(Start|Stop)Animation|TargetOmega|Request(Experience)?Permissions|(Create|Break)Link|BreakAllLinks|(Give|Remove)Inventory|Water|PassTouches|Request(Agent|Inventory)Data|TeleportAgent(Home|GlobalCoords)?|ModifyLand|CollisionSound|ResetScript|MessageLinked|PushObject|PassCollisions|AxisAngle2Rot|Rot2(Axis|Angle)|A(cos|sin)|AngleBetween|AllowInventoryDrop|SubStringIndex|List2(CSV|Integer|Json|Float|String|Key|Vector|Rot|List(Strided)?)|DeleteSubList|List(Statistics|Sort|Randomize|(Insert|Find|Replace)List)|EdgeOfWorld|AdjustSoundVolume|Key2Name|TriggerSoundLimited|EjectFromLand|(CSV|ParseString)2List|OverMyLand|SameGroup|UnSit|Ground(Slope|Normal|Contour)|GroundRepel|(Set|Remove)VehicleFlags|SitOnLink|(AvatarOn)?(Link)?SitTarget|Script(Danger|Profiler)|Dialog|VolumeDetect|ResetOtherScript|RemoteLoadScriptPin|(Open|Close)RemoteDataChannel|SendRemoteData|RemoteDataReply|(Integer|String)ToBase64|XorBase64|Log(10)?|Base64To(String|Integer)|ParseStringKeepNulls|RezAtRoot|RequestSimulatorData|ForceMouselook|(Load|Release|(E|Une)scape)URL|ParcelMedia(CommandList|Query)|ModPow|MapDestination|(RemoveFrom|AddTo|Reset)Land(Pass|Ban)List|(Set|Clear)CameraParams|HTTP(Request|Response)|TextBox|DetectedTouch(UV|Face|Pos|(N|Bin)ormal|ST)|(MD5|SHA1|DumpList2)String|Request(Secure)?URL|Clear(Prim|Link)Media|(Link)?ParticleSystem|(Get|Request)(Username|DisplayName)|RegionSayTo|CastRay|GenerateKey|TransferLindenDollars|ManageEstateAccess|(Create|Delete)Character|ExecCharacterCmd|Evade|FleeFrom|NavigateTo|PatrolPoints|Pursue|UpdateCharacter|WanderWithin))\\b"
  };
  return {
    name: "LSL (Linden Scripting Language)",
    illegal: ":",
    contains: [
      n,
      {
        className: "comment",
        variants: [
          t.COMMENT("//", "$"),
          t.COMMENT("/\\*", "\\*/")
        ],
        relevance: 0
      },
      r,
      {
        className: "section",
        variants: [
          { begin: "\\b(state|default)\\b" },
          { begin: "\\b(state_(entry|exit)|touch(_(start|end))?|(land_)?collision(_(start|end))?|timer|listen|(no_)?sensor|control|(not_)?at_(rot_)?target|money|email|experience_permissions(_denied)?|run_time_permissions|changed|attach|dataserver|moving_(start|end)|link_message|(on|object)_rez|remote_data|http_re(sponse|quest)|path_update|transaction_result)\\b" }
        ]
      },
      o,
      i,
      {
        className: "type",
        begin: "\\b(integer|float|string|key|vector|quaternion|rotation|list)\\b"
      }
    ]
  };
}
const oD = [
  "AASTriangle",
  "AbelianGroup",
  "Abort",
  "AbortKernels",
  "AbortProtect",
  "AbortScheduledTask",
  "Above",
  "Abs",
  "AbsArg",
  "AbsArgPlot",
  "Absolute",
  "AbsoluteCorrelation",
  "AbsoluteCorrelationFunction",
  "AbsoluteCurrentValue",
  "AbsoluteDashing",
  "AbsoluteFileName",
  "AbsoluteOptions",
  "AbsolutePointSize",
  "AbsoluteThickness",
  "AbsoluteTime",
  "AbsoluteTiming",
  "AcceptanceThreshold",
  "AccountingForm",
  "Accumulate",
  "Accuracy",
  "AccuracyGoal",
  "AcousticAbsorbingValue",
  "AcousticImpedanceValue",
  "AcousticNormalVelocityValue",
  "AcousticPDEComponent",
  "AcousticPressureCondition",
  "AcousticRadiationValue",
  "AcousticSoundHardValue",
  "AcousticSoundSoftCondition",
  "ActionDelay",
  "ActionMenu",
  "ActionMenuBox",
  "ActionMenuBoxOptions",
  "Activate",
  "Active",
  "ActiveClassification",
  "ActiveClassificationObject",
  "ActiveItem",
  "ActivePrediction",
  "ActivePredictionObject",
  "ActiveStyle",
  "AcyclicGraphQ",
  "AddOnHelpPath",
  "AddSides",
  "AddTo",
  "AddToSearchIndex",
  "AddUsers",
  "AdjacencyGraph",
  "AdjacencyList",
  "AdjacencyMatrix",
  "AdjacentMeshCells",
  "Adjugate",
  "AdjustmentBox",
  "AdjustmentBoxOptions",
  "AdjustTimeSeriesForecast",
  "AdministrativeDivisionData",
  "AffineHalfSpace",
  "AffineSpace",
  "AffineStateSpaceModel",
  "AffineTransform",
  "After",
  "AggregatedEntityClass",
  "AggregationLayer",
  "AircraftData",
  "AirportData",
  "AirPressureData",
  "AirSoundAttenuation",
  "AirTemperatureData",
  "AiryAi",
  "AiryAiPrime",
  "AiryAiZero",
  "AiryBi",
  "AiryBiPrime",
  "AiryBiZero",
  "AlgebraicIntegerQ",
  "AlgebraicNumber",
  "AlgebraicNumberDenominator",
  "AlgebraicNumberNorm",
  "AlgebraicNumberPolynomial",
  "AlgebraicNumberTrace",
  "AlgebraicRules",
  "AlgebraicRulesData",
  "Algebraics",
  "AlgebraicUnitQ",
  "Alignment",
  "AlignmentMarker",
  "AlignmentPoint",
  "All",
  "AllowAdultContent",
  "AllowChatServices",
  "AllowedCloudExtraParameters",
  "AllowedCloudParameterExtensions",
  "AllowedDimensions",
  "AllowedFrequencyRange",
  "AllowedHeads",
  "AllowGroupClose",
  "AllowIncomplete",
  "AllowInlineCells",
  "AllowKernelInitialization",
  "AllowLooseGrammar",
  "AllowReverseGroupClose",
  "AllowScriptLevelChange",
  "AllowVersionUpdate",
  "AllTrue",
  "Alphabet",
  "AlphabeticOrder",
  "AlphabeticSort",
  "AlphaChannel",
  "AlternateImage",
  "AlternatingFactorial",
  "AlternatingGroup",
  "AlternativeHypothesis",
  "Alternatives",
  "AltitudeMethod",
  "AmbientLight",
  "AmbiguityFunction",
  "AmbiguityList",
  "Analytic",
  "AnatomyData",
  "AnatomyForm",
  "AnatomyPlot3D",
  "AnatomySkinStyle",
  "AnatomyStyling",
  "AnchoredSearch",
  "And",
  "AndersonDarlingTest",
  "AngerJ",
  "AngleBisector",
  "AngleBracket",
  "AnglePath",
  "AnglePath3D",
  "AngleVector",
  "AngularGauge",
  "Animate",
  "AnimatedImage",
  "AnimationCycleOffset",
  "AnimationCycleRepetitions",
  "AnimationDirection",
  "AnimationDisplayTime",
  "AnimationRate",
  "AnimationRepetitions",
  "AnimationRunning",
  "AnimationRunTime",
  "AnimationTimeIndex",
  "AnimationVideo",
  "Animator",
  "AnimatorBox",
  "AnimatorBoxOptions",
  "AnimatorElements",
  "Annotate",
  "Annotation",
  "AnnotationDelete",
  "AnnotationKeys",
  "AnnotationRules",
  "AnnotationValue",
  "Annuity",
  "AnnuityDue",
  "Annulus",
  "AnomalyDetection",
  "AnomalyDetector",
  "AnomalyDetectorFunction",
  "Anonymous",
  "Antialiasing",
  "Antihermitian",
  "AntihermitianMatrixQ",
  "Antisymmetric",
  "AntisymmetricMatrixQ",
  "Antonyms",
  "AnyOrder",
  "AnySubset",
  "AnyTrue",
  "Apart",
  "ApartSquareFree",
  "APIFunction",
  "Appearance",
  "AppearanceElements",
  "AppearanceRules",
  "AppellF1",
  "Append",
  "AppendCheck",
  "AppendLayer",
  "AppendTo",
  "Application",
  "Apply",
  "ApplyReaction",
  "ApplySides",
  "ApplyTo",
  "ArcCos",
  "ArcCosh",
  "ArcCot",
  "ArcCoth",
  "ArcCsc",
  "ArcCsch",
  "ArcCurvature",
  "ARCHProcess",
  "ArcLength",
  "ArcSec",
  "ArcSech",
  "ArcSin",
  "ArcSinDistribution",
  "ArcSinh",
  "ArcTan",
  "ArcTanh",
  "Area",
  "Arg",
  "ArgMax",
  "ArgMin",
  "ArgumentCountQ",
  "ArgumentsOptions",
  "ARIMAProcess",
  "ArithmeticGeometricMean",
  "ARMAProcess",
  "Around",
  "AroundReplace",
  "ARProcess",
  "Array",
  "ArrayComponents",
  "ArrayDepth",
  "ArrayFilter",
  "ArrayFlatten",
  "ArrayMesh",
  "ArrayPad",
  "ArrayPlot",
  "ArrayPlot3D",
  "ArrayQ",
  "ArrayReduce",
  "ArrayResample",
  "ArrayReshape",
  "ArrayRules",
  "Arrays",
  "Arrow",
  "Arrow3DBox",
  "ArrowBox",
  "Arrowheads",
  "ASATriangle",
  "Ask",
  "AskAppend",
  "AskConfirm",
  "AskDisplay",
  "AskedQ",
  "AskedValue",
  "AskFunction",
  "AskState",
  "AskTemplateDisplay",
  "AspectRatio",
  "AspectRatioFixed",
  "Assert",
  "AssessmentFunction",
  "AssessmentResultObject",
  "AssociateTo",
  "Association",
  "AssociationFormat",
  "AssociationMap",
  "AssociationQ",
  "AssociationThread",
  "AssumeDeterministic",
  "Assuming",
  "Assumptions",
  "AstroAngularSeparation",
  "AstroBackground",
  "AstroCenter",
  "AstroDistance",
  "AstroGraphics",
  "AstroGridLines",
  "AstroGridLinesStyle",
  "AstronomicalData",
  "AstroPosition",
  "AstroProjection",
  "AstroRange",
  "AstroRangePadding",
  "AstroReferenceFrame",
  "AstroStyling",
  "AstroZoomLevel",
  "Asymptotic",
  "AsymptoticDSolveValue",
  "AsymptoticEqual",
  "AsymptoticEquivalent",
  "AsymptoticExpectation",
  "AsymptoticGreater",
  "AsymptoticGreaterEqual",
  "AsymptoticIntegrate",
  "AsymptoticLess",
  "AsymptoticLessEqual",
  "AsymptoticOutputTracker",
  "AsymptoticProbability",
  "AsymptoticProduct",
  "AsymptoticRSolveValue",
  "AsymptoticSolve",
  "AsymptoticSum",
  "Asynchronous",
  "AsynchronousTaskObject",
  "AsynchronousTasks",
  "Atom",
  "AtomCoordinates",
  "AtomCount",
  "AtomDiagramCoordinates",
  "AtomLabels",
  "AtomLabelStyle",
  "AtomList",
  "AtomQ",
  "AttachCell",
  "AttachedCell",
  "AttentionLayer",
  "Attributes",
  "Audio",
  "AudioAmplify",
  "AudioAnnotate",
  "AudioAnnotationLookup",
  "AudioBlockMap",
  "AudioCapture",
  "AudioChannelAssignment",
  "AudioChannelCombine",
  "AudioChannelMix",
  "AudioChannels",
  "AudioChannelSeparate",
  "AudioData",
  "AudioDelay",
  "AudioDelete",
  "AudioDevice",
  "AudioDistance",
  "AudioEncoding",
  "AudioFade",
  "AudioFrequencyShift",
  "AudioGenerator",
  "AudioIdentify",
  "AudioInputDevice",
  "AudioInsert",
  "AudioInstanceQ",
  "AudioIntervals",
  "AudioJoin",
  "AudioLabel",
  "AudioLength",
  "AudioLocalMeasurements",
  "AudioLooping",
  "AudioLoudness",
  "AudioMeasurements",
  "AudioNormalize",
  "AudioOutputDevice",
  "AudioOverlay",
  "AudioPad",
  "AudioPan",
  "AudioPartition",
  "AudioPause",
  "AudioPitchShift",
  "AudioPlay",
  "AudioPlot",
  "AudioQ",
  "AudioRecord",
  "AudioReplace",
  "AudioResample",
  "AudioReverb",
  "AudioReverse",
  "AudioSampleRate",
  "AudioSpectralMap",
  "AudioSpectralTransformation",
  "AudioSplit",
  "AudioStop",
  "AudioStream",
  "AudioStreams",
  "AudioTimeStretch",
  "AudioTrackApply",
  "AudioTrackSelection",
  "AudioTrim",
  "AudioType",
  "AugmentedPolyhedron",
  "AugmentedSymmetricPolynomial",
  "Authenticate",
  "Authentication",
  "AuthenticationDialog",
  "AutoAction",
  "Autocomplete",
  "AutocompletionFunction",
  "AutoCopy",
  "AutocorrelationTest",
  "AutoDelete",
  "AutoEvaluateEvents",
  "AutoGeneratedPackage",
  "AutoIndent",
  "AutoIndentSpacings",
  "AutoItalicWords",
  "AutoloadPath",
  "AutoMatch",
  "Automatic",
  "AutomaticImageSize",
  "AutoMultiplicationSymbol",
  "AutoNumberFormatting",
  "AutoOpenNotebooks",
  "AutoOpenPalettes",
  "AutoOperatorRenderings",
  "AutoQuoteCharacters",
  "AutoRefreshed",
  "AutoRemove",
  "AutorunSequencing",
  "AutoScaling",
  "AutoScroll",
  "AutoSpacing",
  "AutoStyleOptions",
  "AutoStyleWords",
  "AutoSubmitting",
  "Axes",
  "AxesEdge",
  "AxesLabel",
  "AxesOrigin",
  "AxesStyle",
  "AxiomaticTheory",
  "Axis",
  "Axis3DBox",
  "Axis3DBoxOptions",
  "AxisBox",
  "AxisBoxOptions",
  "AxisLabel",
  "AxisObject",
  "AxisStyle",
  "BabyMonsterGroupB",
  "Back",
  "BackFaceColor",
  "BackFaceGlowColor",
  "BackFaceOpacity",
  "BackFaceSpecularColor",
  "BackFaceSpecularExponent",
  "BackFaceSurfaceAppearance",
  "BackFaceTexture",
  "Background",
  "BackgroundAppearance",
  "BackgroundTasksSettings",
  "Backslash",
  "Backsubstitution",
  "Backward",
  "Ball",
  "Band",
  "BandpassFilter",
  "BandstopFilter",
  "BarabasiAlbertGraphDistribution",
  "BarChart",
  "BarChart3D",
  "BarcodeImage",
  "BarcodeRecognize",
  "BaringhausHenzeTest",
  "BarLegend",
  "BarlowProschanImportance",
  "BarnesG",
  "BarOrigin",
  "BarSpacing",
  "BartlettHannWindow",
  "BartlettWindow",
  "BaseDecode",
  "BaseEncode",
  "BaseForm",
  "Baseline",
  "BaselinePosition",
  "BaseStyle",
  "BasicRecurrentLayer",
  "BatchNormalizationLayer",
  "BatchSize",
  "BatesDistribution",
  "BattleLemarieWavelet",
  "BayesianMaximization",
  "BayesianMaximizationObject",
  "BayesianMinimization",
  "BayesianMinimizationObject",
  "Because",
  "BeckmannDistribution",
  "Beep",
  "Before",
  "Begin",
  "BeginDialogPacket",
  "BeginPackage",
  "BellB",
  "BellY",
  "Below",
  "BenfordDistribution",
  "BeniniDistribution",
  "BenktanderGibratDistribution",
  "BenktanderWeibullDistribution",
  "BernoulliB",
  "BernoulliDistribution",
  "BernoulliGraphDistribution",
  "BernoulliProcess",
  "BernsteinBasis",
  "BesagL",
  "BesselFilterModel",
  "BesselI",
  "BesselJ",
  "BesselJZero",
  "BesselK",
  "BesselY",
  "BesselYZero",
  "Beta",
  "BetaBinomialDistribution",
  "BetaDistribution",
  "BetaNegativeBinomialDistribution",
  "BetaPrimeDistribution",
  "BetaRegularized",
  "Between",
  "BetweennessCentrality",
  "Beveled",
  "BeveledPolyhedron",
  "BezierCurve",
  "BezierCurve3DBox",
  "BezierCurve3DBoxOptions",
  "BezierCurveBox",
  "BezierCurveBoxOptions",
  "BezierFunction",
  "BilateralFilter",
  "BilateralLaplaceTransform",
  "BilateralZTransform",
  "Binarize",
  "BinaryDeserialize",
  "BinaryDistance",
  "BinaryFormat",
  "BinaryImageQ",
  "BinaryRead",
  "BinaryReadList",
  "BinarySerialize",
  "BinaryWrite",
  "BinCounts",
  "BinLists",
  "BinnedVariogramList",
  "Binomial",
  "BinomialDistribution",
  "BinomialPointProcess",
  "BinomialProcess",
  "BinormalDistribution",
  "BiorthogonalSplineWavelet",
  "BioSequence",
  "BioSequenceBackTranslateList",
  "BioSequenceComplement",
  "BioSequenceInstances",
  "BioSequenceModify",
  "BioSequencePlot",
  "BioSequenceQ",
  "BioSequenceReverseComplement",
  "BioSequenceTranscribe",
  "BioSequenceTranslate",
  "BipartiteGraphQ",
  "BiquadraticFilterModel",
  "BirnbaumImportance",
  "BirnbaumSaundersDistribution",
  "BitAnd",
  "BitClear",
  "BitGet",
  "BitLength",
  "BitNot",
  "BitOr",
  "BitRate",
  "BitSet",
  "BitShiftLeft",
  "BitShiftRight",
  "BitXor",
  "BiweightLocation",
  "BiweightMidvariance",
  "Black",
  "BlackmanHarrisWindow",
  "BlackmanNuttallWindow",
  "BlackmanWindow",
  "Blank",
  "BlankForm",
  "BlankNullSequence",
  "BlankSequence",
  "Blend",
  "Block",
  "BlockchainAddressData",
  "BlockchainBase",
  "BlockchainBlockData",
  "BlockchainContractValue",
  "BlockchainData",
  "BlockchainGet",
  "BlockchainKeyEncode",
  "BlockchainPut",
  "BlockchainTokenData",
  "BlockchainTransaction",
  "BlockchainTransactionData",
  "BlockchainTransactionSign",
  "BlockchainTransactionSubmit",
  "BlockDiagonalMatrix",
  "BlockLowerTriangularMatrix",
  "BlockMap",
  "BlockRandom",
  "BlockUpperTriangularMatrix",
  "BlomqvistBeta",
  "BlomqvistBetaTest",
  "Blue",
  "Blur",
  "Blurring",
  "BodePlot",
  "BohmanWindow",
  "Bold",
  "Bond",
  "BondCount",
  "BondLabels",
  "BondLabelStyle",
  "BondList",
  "BondQ",
  "Bookmarks",
  "Boole",
  "BooleanConsecutiveFunction",
  "BooleanConvert",
  "BooleanCountingFunction",
  "BooleanFunction",
  "BooleanGraph",
  "BooleanMaxterms",
  "BooleanMinimize",
  "BooleanMinterms",
  "BooleanQ",
  "BooleanRegion",
  "Booleans",
  "BooleanStrings",
  "BooleanTable",
  "BooleanVariables",
  "BorderDimensions",
  "BorelTannerDistribution",
  "Bottom",
  "BottomHatTransform",
  "BoundaryDiscretizeGraphics",
  "BoundaryDiscretizeRegion",
  "BoundaryMesh",
  "BoundaryMeshRegion",
  "BoundaryMeshRegionQ",
  "BoundaryStyle",
  "BoundedRegionQ",
  "BoundingRegion",
  "Bounds",
  "Box",
  "BoxBaselineShift",
  "BoxData",
  "BoxDimensions",
  "Boxed",
  "Boxes",
  "BoxForm",
  "BoxFormFormatTypes",
  "BoxFrame",
  "BoxID",
  "BoxMargins",
  "BoxMatrix",
  "BoxObject",
  "BoxRatios",
  "BoxRotation",
  "BoxRotationPoint",
  "BoxStyle",
  "BoxWhiskerChart",
  "Bra",
  "BracketingBar",
  "BraKet",
  "BrayCurtisDistance",
  "BreadthFirstScan",
  "Break",
  "BridgeData",
  "BrightnessEqualize",
  "BroadcastStationData",
  "Brown",
  "BrownForsytheTest",
  "BrownianBridgeProcess",
  "BrowserCategory",
  "BSplineBasis",
  "BSplineCurve",
  "BSplineCurve3DBox",
  "BSplineCurve3DBoxOptions",
  "BSplineCurveBox",
  "BSplineCurveBoxOptions",
  "BSplineFunction",
  "BSplineSurface",
  "BSplineSurface3DBox",
  "BSplineSurface3DBoxOptions",
  "BubbleChart",
  "BubbleChart3D",
  "BubbleScale",
  "BubbleSizes",
  "BuckyballGraph",
  "BuildCompiledComponent",
  "BuildingData",
  "BulletGauge",
  "BusinessDayQ",
  "ButterflyGraph",
  "ButterworthFilterModel",
  "Button",
  "ButtonBar",
  "ButtonBox",
  "ButtonBoxOptions",
  "ButtonCell",
  "ButtonContents",
  "ButtonData",
  "ButtonEvaluator",
  "ButtonExpandable",
  "ButtonFrame",
  "ButtonFunction",
  "ButtonMargins",
  "ButtonMinHeight",
  "ButtonNote",
  "ButtonNotebook",
  "ButtonSource",
  "ButtonStyle",
  "ButtonStyleMenuListing",
  "Byte",
  "ByteArray",
  "ByteArrayFormat",
  "ByteArrayFormatQ",
  "ByteArrayQ",
  "ByteArrayToString",
  "ByteCount",
  "ByteOrdering",
  "C",
  "CachedValue",
  "CacheGraphics",
  "CachePersistence",
  "CalendarConvert",
  "CalendarData",
  "CalendarType",
  "Callout",
  "CalloutMarker",
  "CalloutStyle",
  "CallPacket",
  "CanberraDistance",
  "Cancel",
  "CancelButton",
  "CandlestickChart",
  "CanonicalGraph",
  "CanonicalizePolygon",
  "CanonicalizePolyhedron",
  "CanonicalizeRegion",
  "CanonicalName",
  "CanonicalWarpingCorrespondence",
  "CanonicalWarpingDistance",
  "CantorMesh",
  "CantorStaircase",
  "Canvas",
  "Cap",
  "CapForm",
  "CapitalDifferentialD",
  "Capitalize",
  "CapsuleShape",
  "CaptureRunning",
  "CaputoD",
  "CardinalBSplineBasis",
  "CarlemanLinearize",
  "CarlsonRC",
  "CarlsonRD",
  "CarlsonRE",
  "CarlsonRF",
  "CarlsonRG",
  "CarlsonRJ",
  "CarlsonRK",
  "CarlsonRM",
  "CarmichaelLambda",
  "CaseOrdering",
  "Cases",
  "CaseSensitive",
  "Cashflow",
  "Casoratian",
  "Cast",
  "Catalan",
  "CatalanNumber",
  "Catch",
  "CategoricalDistribution",
  "Catenate",
  "CatenateLayer",
  "CauchyDistribution",
  "CauchyMatrix",
  "CauchyPointProcess",
  "CauchyWindow",
  "CayleyGraph",
  "CDF",
  "CDFDeploy",
  "CDFInformation",
  "CDFWavelet",
  "Ceiling",
  "CelestialSystem",
  "Cell",
  "CellAutoOverwrite",
  "CellBaseline",
  "CellBoundingBox",
  "CellBracketOptions",
  "CellChangeTimes",
  "CellContents",
  "CellContext",
  "CellDingbat",
  "CellDingbatMargin",
  "CellDynamicExpression",
  "CellEditDuplicate",
  "CellElementsBoundingBox",
  "CellElementSpacings",
  "CellEpilog",
  "CellEvaluationDuplicate",
  "CellEvaluationFunction",
  "CellEvaluationLanguage",
  "CellEventActions",
  "CellFrame",
  "CellFrameColor",
  "CellFrameLabelMargins",
  "CellFrameLabels",
  "CellFrameMargins",
  "CellFrameStyle",
  "CellGroup",
  "CellGroupData",
  "CellGrouping",
  "CellGroupingRules",
  "CellHorizontalScrolling",
  "CellID",
  "CellInsertionPointCell",
  "CellLabel",
  "CellLabelAutoDelete",
  "CellLabelMargins",
  "CellLabelPositioning",
  "CellLabelStyle",
  "CellLabelTemplate",
  "CellMargins",
  "CellObject",
  "CellOpen",
  "CellPrint",
  "CellProlog",
  "Cells",
  "CellSize",
  "CellStyle",
  "CellTags",
  "CellTrayPosition",
  "CellTrayWidgets",
  "CellularAutomaton",
  "CensoredDistribution",
  "Censoring",
  "Center",
  "CenterArray",
  "CenterDot",
  "CenteredInterval",
  "CentralFeature",
  "CentralMoment",
  "CentralMomentGeneratingFunction",
  "Cepstrogram",
  "CepstrogramArray",
  "CepstrumArray",
  "CForm",
  "ChampernowneNumber",
  "ChangeOptions",
  "ChannelBase",
  "ChannelBrokerAction",
  "ChannelDatabin",
  "ChannelHistoryLength",
  "ChannelListen",
  "ChannelListener",
  "ChannelListeners",
  "ChannelListenerWait",
  "ChannelObject",
  "ChannelPreSendFunction",
  "ChannelReceiverFunction",
  "ChannelSend",
  "ChannelSubscribers",
  "ChanVeseBinarize",
  "Character",
  "CharacterCounts",
  "CharacterEncoding",
  "CharacterEncodingsPath",
  "CharacteristicFunction",
  "CharacteristicPolynomial",
  "CharacterName",
  "CharacterNormalize",
  "CharacterRange",
  "Characters",
  "ChartBaseStyle",
  "ChartElementData",
  "ChartElementDataFunction",
  "ChartElementFunction",
  "ChartElements",
  "ChartLabels",
  "ChartLayout",
  "ChartLegends",
  "ChartStyle",
  "Chebyshev1FilterModel",
  "Chebyshev2FilterModel",
  "ChebyshevDistance",
  "ChebyshevT",
  "ChebyshevU",
  "Check",
  "CheckAbort",
  "CheckAll",
  "CheckArguments",
  "Checkbox",
  "CheckboxBar",
  "CheckboxBox",
  "CheckboxBoxOptions",
  "ChemicalConvert",
  "ChemicalData",
  "ChemicalFormula",
  "ChemicalInstance",
  "ChemicalReaction",
  "ChessboardDistance",
  "ChiDistribution",
  "ChineseRemainder",
  "ChiSquareDistribution",
  "ChoiceButtons",
  "ChoiceDialog",
  "CholeskyDecomposition",
  "Chop",
  "ChromaticityPlot",
  "ChromaticityPlot3D",
  "ChromaticPolynomial",
  "Circle",
  "CircleBox",
  "CircleDot",
  "CircleMinus",
  "CirclePlus",
  "CirclePoints",
  "CircleThrough",
  "CircleTimes",
  "CirculantGraph",
  "CircularArcThrough",
  "CircularOrthogonalMatrixDistribution",
  "CircularQuaternionMatrixDistribution",
  "CircularRealMatrixDistribution",
  "CircularSymplecticMatrixDistribution",
  "CircularUnitaryMatrixDistribution",
  "Circumsphere",
  "CityData",
  "ClassifierFunction",
  "ClassifierInformation",
  "ClassifierMeasurements",
  "ClassifierMeasurementsObject",
  "Classify",
  "ClassPriors",
  "Clear",
  "ClearAll",
  "ClearAttributes",
  "ClearCookies",
  "ClearPermissions",
  "ClearSystemCache",
  "ClebschGordan",
  "ClickPane",
  "ClickToCopy",
  "ClickToCopyEnabled",
  "Clip",
  "ClipboardNotebook",
  "ClipFill",
  "ClippingStyle",
  "ClipPlanes",
  "ClipPlanesStyle",
  "ClipRange",
  "Clock",
  "ClockGauge",
  "ClockwiseContourIntegral",
  "Close",
  "Closed",
  "CloseKernels",
  "ClosenessCentrality",
  "Closing",
  "ClosingAutoSave",
  "ClosingEvent",
  "CloudAccountData",
  "CloudBase",
  "CloudConnect",
  "CloudConnections",
  "CloudDeploy",
  "CloudDirectory",
  "CloudDisconnect",
  "CloudEvaluate",
  "CloudExport",
  "CloudExpression",
  "CloudExpressions",
  "CloudFunction",
  "CloudGet",
  "CloudImport",
  "CloudLoggingData",
  "CloudObject",
  "CloudObjectInformation",
  "CloudObjectInformationData",
  "CloudObjectNameFormat",
  "CloudObjects",
  "CloudObjectURLType",
  "CloudPublish",
  "CloudPut",
  "CloudRenderingMethod",
  "CloudSave",
  "CloudShare",
  "CloudSubmit",
  "CloudSymbol",
  "CloudUnshare",
  "CloudUserID",
  "ClusterClassify",
  "ClusterDissimilarityFunction",
  "ClusteringComponents",
  "ClusteringMeasurements",
  "ClusteringTree",
  "CMYKColor",
  "Coarse",
  "CodeAssistOptions",
  "Coefficient",
  "CoefficientArrays",
  "CoefficientDomain",
  "CoefficientList",
  "CoefficientRules",
  "CoifletWavelet",
  "Collect",
  "CollinearPoints",
  "Colon",
  "ColonForm",
  "ColorBalance",
  "ColorCombine",
  "ColorConvert",
  "ColorCoverage",
  "ColorData",
  "ColorDataFunction",
  "ColorDetect",
  "ColorDistance",
  "ColorFunction",
  "ColorFunctionBinning",
  "ColorFunctionScaling",
  "Colorize",
  "ColorNegate",
  "ColorOutput",
  "ColorProfileData",
  "ColorQ",
  "ColorQuantize",
  "ColorReplace",
  "ColorRules",
  "ColorSelectorSettings",
  "ColorSeparate",
  "ColorSetter",
  "ColorSetterBox",
  "ColorSetterBoxOptions",
  "ColorSlider",
  "ColorsNear",
  "ColorSpace",
  "ColorToneMapping",
  "Column",
  "ColumnAlignments",
  "ColumnBackgrounds",
  "ColumnForm",
  "ColumnLines",
  "ColumnsEqual",
  "ColumnSpacings",
  "ColumnWidths",
  "CombinatorB",
  "CombinatorC",
  "CombinatorI",
  "CombinatorK",
  "CombinatorS",
  "CombinatorW",
  "CombinatorY",
  "CombinedEntityClass",
  "CombinerFunction",
  "CometData",
  "CommonDefaultFormatTypes",
  "Commonest",
  "CommonestFilter",
  "CommonName",
  "CommonUnits",
  "CommunityBoundaryStyle",
  "CommunityGraphPlot",
  "CommunityLabels",
  "CommunityRegionStyle",
  "CompanyData",
  "CompatibleUnitQ",
  "CompilationOptions",
  "CompilationTarget",
  "Compile",
  "Compiled",
  "CompiledCodeFunction",
  "CompiledComponent",
  "CompiledExpressionDeclaration",
  "CompiledFunction",
  "CompiledLayer",
  "CompilerCallback",
  "CompilerEnvironment",
  "CompilerEnvironmentAppend",
  "CompilerEnvironmentAppendTo",
  "CompilerEnvironmentObject",
  "CompilerOptions",
  "Complement",
  "ComplementedEntityClass",
  "CompleteGraph",
  "CompleteGraphQ",
  "CompleteIntegral",
  "CompleteKaryTree",
  "CompletionsListPacket",
  "Complex",
  "ComplexArrayPlot",
  "ComplexContourPlot",
  "Complexes",
  "ComplexExpand",
  "ComplexInfinity",
  "ComplexityFunction",
  "ComplexListPlot",
  "ComplexPlot",
  "ComplexPlot3D",
  "ComplexRegionPlot",
  "ComplexStreamPlot",
  "ComplexVectorPlot",
  "ComponentMeasurements",
  "ComponentwiseContextMenu",
  "Compose",
  "ComposeList",
  "ComposeSeries",
  "CompositeQ",
  "Composition",
  "CompoundElement",
  "CompoundExpression",
  "CompoundPoissonDistribution",
  "CompoundPoissonProcess",
  "CompoundRenewalProcess",
  "Compress",
  "CompressedData",
  "CompressionLevel",
  "ComputeUncertainty",
  "ConcaveHullMesh",
  "Condition",
  "ConditionalExpression",
  "Conditioned",
  "Cone",
  "ConeBox",
  "ConfidenceLevel",
  "ConfidenceRange",
  "ConfidenceTransform",
  "ConfigurationPath",
  "Confirm",
  "ConfirmAssert",
  "ConfirmBy",
  "ConfirmMatch",
  "ConfirmQuiet",
  "ConformationMethod",
  "ConformAudio",
  "ConformImages",
  "Congruent",
  "ConicGradientFilling",
  "ConicHullRegion",
  "ConicHullRegion3DBox",
  "ConicHullRegion3DBoxOptions",
  "ConicHullRegionBox",
  "ConicHullRegionBoxOptions",
  "ConicOptimization",
  "Conjugate",
  "ConjugateTranspose",
  "Conjunction",
  "Connect",
  "ConnectedComponents",
  "ConnectedGraphComponents",
  "ConnectedGraphQ",
  "ConnectedMeshComponents",
  "ConnectedMoleculeComponents",
  "ConnectedMoleculeQ",
  "ConnectionSettings",
  "ConnectLibraryCallbackFunction",
  "ConnectSystemModelComponents",
  "ConnectSystemModelController",
  "ConnesWindow",
  "ConoverTest",
  "ConservativeConvectionPDETerm",
  "ConsoleMessage",
  "Constant",
  "ConstantArray",
  "ConstantArrayLayer",
  "ConstantImage",
  "ConstantPlusLayer",
  "ConstantRegionQ",
  "Constants",
  "ConstantTimesLayer",
  "ConstellationData",
  "ConstrainedMax",
  "ConstrainedMin",
  "Construct",
  "Containing",
  "ContainsAll",
  "ContainsAny",
  "ContainsExactly",
  "ContainsNone",
  "ContainsOnly",
  "ContentDetectorFunction",
  "ContentFieldOptions",
  "ContentLocationFunction",
  "ContentObject",
  "ContentPadding",
  "ContentsBoundingBox",
  "ContentSelectable",
  "ContentSize",
  "Context",
  "ContextMenu",
  "Contexts",
  "ContextToFileName",
  "Continuation",
  "Continue",
  "ContinuedFraction",
  "ContinuedFractionK",
  "ContinuousAction",
  "ContinuousMarkovProcess",
  "ContinuousTask",
  "ContinuousTimeModelQ",
  "ContinuousWaveletData",
  "ContinuousWaveletTransform",
  "ContourDetect",
  "ContourGraphics",
  "ContourIntegral",
  "ContourLabels",
  "ContourLines",
  "ContourPlot",
  "ContourPlot3D",
  "Contours",
  "ContourShading",
  "ContourSmoothing",
  "ContourStyle",
  "ContraharmonicMean",
  "ContrastiveLossLayer",
  "Control",
  "ControlActive",
  "ControlAlignment",
  "ControlGroupContentsBox",
  "ControllabilityGramian",
  "ControllabilityMatrix",
  "ControllableDecomposition",
  "ControllableModelQ",
  "ControllerDuration",
  "ControllerInformation",
  "ControllerInformationData",
  "ControllerLinking",
  "ControllerManipulate",
  "ControllerMethod",
  "ControllerPath",
  "ControllerState",
  "ControlPlacement",
  "ControlsRendering",
  "ControlType",
  "ConvectionPDETerm",
  "Convergents",
  "ConversionOptions",
  "ConversionRules",
  "ConvertToPostScript",
  "ConvertToPostScriptPacket",
  "ConvexHullMesh",
  "ConvexHullRegion",
  "ConvexOptimization",
  "ConvexPolygonQ",
  "ConvexPolyhedronQ",
  "ConvexRegionQ",
  "ConvolutionLayer",
  "Convolve",
  "ConwayGroupCo1",
  "ConwayGroupCo2",
  "ConwayGroupCo3",
  "CookieFunction",
  "Cookies",
  "CoordinateBoundingBox",
  "CoordinateBoundingBoxArray",
  "CoordinateBounds",
  "CoordinateBoundsArray",
  "CoordinateChartData",
  "CoordinatesToolOptions",
  "CoordinateTransform",
  "CoordinateTransformData",
  "CoplanarPoints",
  "CoprimeQ",
  "Coproduct",
  "CopulaDistribution",
  "Copyable",
  "CopyDatabin",
  "CopyDirectory",
  "CopyFile",
  "CopyFunction",
  "CopyTag",
  "CopyToClipboard",
  "CoreNilpotentDecomposition",
  "CornerFilter",
  "CornerNeighbors",
  "Correlation",
  "CorrelationDistance",
  "CorrelationFunction",
  "CorrelationTest",
  "Cos",
  "Cosh",
  "CoshIntegral",
  "CosineDistance",
  "CosineWindow",
  "CosIntegral",
  "Cot",
  "Coth",
  "CoulombF",
  "CoulombG",
  "CoulombH1",
  "CoulombH2",
  "Count",
  "CountDistinct",
  "CountDistinctBy",
  "CounterAssignments",
  "CounterBox",
  "CounterBoxOptions",
  "CounterClockwiseContourIntegral",
  "CounterEvaluator",
  "CounterFunction",
  "CounterIncrements",
  "CounterStyle",
  "CounterStyleMenuListing",
  "CountRoots",
  "CountryData",
  "Counts",
  "CountsBy",
  "Covariance",
  "CovarianceEstimatorFunction",
  "CovarianceFunction",
  "CoxianDistribution",
  "CoxIngersollRossProcess",
  "CoxModel",
  "CoxModelFit",
  "CramerVonMisesTest",
  "CreateArchive",
  "CreateCellID",
  "CreateChannel",
  "CreateCloudExpression",
  "CreateCompilerEnvironment",
  "CreateDatabin",
  "CreateDataStructure",
  "CreateDataSystemModel",
  "CreateDialog",
  "CreateDirectory",
  "CreateDocument",
  "CreateFile",
  "CreateIntermediateDirectories",
  "CreateLicenseEntitlement",
  "CreateManagedLibraryExpression",
  "CreateNotebook",
  "CreatePacletArchive",
  "CreatePalette",
  "CreatePermissionsGroup",
  "CreateScheduledTask",
  "CreateSearchIndex",
  "CreateSystemModel",
  "CreateTemporary",
  "CreateTypeInstance",
  "CreateUUID",
  "CreateWindow",
  "CriterionFunction",
  "CriticalityFailureImportance",
  "CriticalitySuccessImportance",
  "CriticalSection",
  "Cross",
  "CrossEntropyLossLayer",
  "CrossingCount",
  "CrossingDetect",
  "CrossingPolygon",
  "CrossMatrix",
  "Csc",
  "Csch",
  "CSGRegion",
  "CSGRegionQ",
  "CSGRegionTree",
  "CTCLossLayer",
  "Cube",
  "CubeRoot",
  "Cubics",
  "Cuboid",
  "CuboidBox",
  "CuboidBoxOptions",
  "Cumulant",
  "CumulantGeneratingFunction",
  "CumulativeFeatureImpactPlot",
  "Cup",
  "CupCap",
  "Curl",
  "CurlyDoubleQuote",
  "CurlyQuote",
  "CurrencyConvert",
  "CurrentDate",
  "CurrentImage",
  "CurrentNotebookImage",
  "CurrentScreenImage",
  "CurrentValue",
  "Curry",
  "CurryApplied",
  "CurvatureFlowFilter",
  "CurveClosed",
  "Cyan",
  "CycleGraph",
  "CycleIndexPolynomial",
  "Cycles",
  "CyclicGroup",
  "Cyclotomic",
  "Cylinder",
  "CylinderBox",
  "CylinderBoxOptions",
  "CylindricalDecomposition",
  "CylindricalDecompositionFunction",
  "D",
  "DagumDistribution",
  "DamData",
  "DamerauLevenshteinDistance",
  "DampingFactor",
  "Darker",
  "Dashed",
  "Dashing",
  "DatabaseConnect",
  "DatabaseDisconnect",
  "DatabaseReference",
  "Databin",
  "DatabinAdd",
  "DatabinRemove",
  "Databins",
  "DatabinSubmit",
  "DatabinUpload",
  "DataCompression",
  "DataDistribution",
  "DataRange",
  "DataReversed",
  "Dataset",
  "DatasetDisplayPanel",
  "DatasetTheme",
  "DataStructure",
  "DataStructureQ",
  "Date",
  "DateBounds",
  "Dated",
  "DateDelimiters",
  "DateDifference",
  "DatedUnit",
  "DateFormat",
  "DateFunction",
  "DateGranularity",
  "DateHistogram",
  "DateInterval",
  "DateList",
  "DateListLogPlot",
  "DateListPlot",
  "DateListStepPlot",
  "DateObject",
  "DateObjectQ",
  "DateOverlapsQ",
  "DatePattern",
  "DatePlus",
  "DateRange",
  "DateReduction",
  "DateScale",
  "DateSelect",
  "DateString",
  "DateTicksFormat",
  "DateValue",
  "DateWithinQ",
  "DaubechiesWavelet",
  "DavisDistribution",
  "DawsonF",
  "DayCount",
  "DayCountConvention",
  "DayHemisphere",
  "DaylightQ",
  "DayMatchQ",
  "DayName",
  "DayNightTerminator",
  "DayPlus",
  "DayRange",
  "DayRound",
  "DeBruijnGraph",
  "DeBruijnSequence",
  "Debug",
  "DebugTag",
  "Decapitalize",
  "Decimal",
  "DecimalForm",
  "DeclareCompiledComponent",
  "DeclareKnownSymbols",
  "DeclarePackage",
  "Decompose",
  "DeconvolutionLayer",
  "Decrement",
  "Decrypt",
  "DecryptFile",
  "DedekindEta",
  "DeepSpaceProbeData",
  "Default",
  "Default2DTool",
  "Default3DTool",
  "DefaultAttachedCellStyle",
  "DefaultAxesStyle",
  "DefaultBaseStyle",
  "DefaultBoxStyle",
  "DefaultButton",
  "DefaultColor",
  "DefaultControlPlacement",
  "DefaultDockedCellStyle",
  "DefaultDuplicateCellStyle",
  "DefaultDuration",
  "DefaultElement",
  "DefaultFaceGridsStyle",
  "DefaultFieldHintStyle",
  "DefaultFont",
  "DefaultFontProperties",
  "DefaultFormatType",
  "DefaultFrameStyle",
  "DefaultFrameTicksStyle",
  "DefaultGridLinesStyle",
  "DefaultInlineFormatType",
  "DefaultInputFormatType",
  "DefaultLabelStyle",
  "DefaultMenuStyle",
  "DefaultNaturalLanguage",
  "DefaultNewCellStyle",
  "DefaultNewInlineCellStyle",
  "DefaultNotebook",
  "DefaultOptions",
  "DefaultOutputFormatType",
  "DefaultPrintPrecision",
  "DefaultStyle",
  "DefaultStyleDefinitions",
  "DefaultTextFormatType",
  "DefaultTextInlineFormatType",
  "DefaultTicksStyle",
  "DefaultTooltipStyle",
  "DefaultValue",
  "DefaultValues",
  "Defer",
  "DefineExternal",
  "DefineInputStreamMethod",
  "DefineOutputStreamMethod",
  "DefineResourceFunction",
  "Definition",
  "Degree",
  "DegreeCentrality",
  "DegreeGraphDistribution",
  "DegreeLexicographic",
  "DegreeReverseLexicographic",
  "DEigensystem",
  "DEigenvalues",
  "Deinitialization",
  "Del",
  "DelaunayMesh",
  "Delayed",
  "Deletable",
  "Delete",
  "DeleteAdjacentDuplicates",
  "DeleteAnomalies",
  "DeleteBorderComponents",
  "DeleteCases",
  "DeleteChannel",
  "DeleteCloudExpression",
  "DeleteContents",
  "DeleteDirectory",
  "DeleteDuplicates",
  "DeleteDuplicatesBy",
  "DeleteElements",
  "DeleteFile",
  "DeleteMissing",
  "DeleteObject",
  "DeletePermissionsKey",
  "DeleteSearchIndex",
  "DeleteSmallComponents",
  "DeleteStopwords",
  "DeleteWithContents",
  "DeletionWarning",
  "DelimitedArray",
  "DelimitedSequence",
  "Delimiter",
  "DelimiterAutoMatching",
  "DelimiterFlashTime",
  "DelimiterMatching",
  "Delimiters",
  "DeliveryFunction",
  "Dendrogram",
  "Denominator",
  "DensityGraphics",
  "DensityHistogram",
  "DensityPlot",
  "DensityPlot3D",
  "DependentVariables",
  "Deploy",
  "Deployed",
  "Depth",
  "DepthFirstScan",
  "Derivative",
  "DerivativeFilter",
  "DerivativePDETerm",
  "DerivedKey",
  "DescriptorStateSpace",
  "DesignMatrix",
  "DestroyAfterEvaluation",
  "Det",
  "DeviceClose",
  "DeviceConfigure",
  "DeviceExecute",
  "DeviceExecuteAsynchronous",
  "DeviceObject",
  "DeviceOpen",
  "DeviceOpenQ",
  "DeviceRead",
  "DeviceReadBuffer",
  "DeviceReadLatest",
  "DeviceReadList",
  "DeviceReadTimeSeries",
  "Devices",
  "DeviceStreams",
  "DeviceWrite",
  "DeviceWriteBuffer",
  "DGaussianWavelet",
  "DiacriticalPositioning",
  "Diagonal",
  "DiagonalizableMatrixQ",
  "DiagonalMatrix",
  "DiagonalMatrixQ",
  "Dialog",
  "DialogIndent",
  "DialogInput",
  "DialogLevel",
  "DialogNotebook",
  "DialogProlog",
  "DialogReturn",
  "DialogSymbols",
  "Diamond",
  "DiamondMatrix",
  "DiceDissimilarity",
  "DictionaryLookup",
  "DictionaryWordQ",
  "DifferenceDelta",
  "DifferenceOrder",
  "DifferenceQuotient",
  "DifferenceRoot",
  "DifferenceRootReduce",
  "Differences",
  "DifferentialD",
  "DifferentialRoot",
  "DifferentialRootReduce",
  "DifferentiatorFilter",
  "DiffusionPDETerm",
  "DiggleGatesPointProcess",
  "DiggleGrattonPointProcess",
  "DigitalSignature",
  "DigitBlock",
  "DigitBlockMinimum",
  "DigitCharacter",
  "DigitCount",
  "DigitQ",
  "DihedralAngle",
  "DihedralGroup",
  "Dilation",
  "DimensionalCombinations",
  "DimensionalMeshComponents",
  "DimensionReduce",
  "DimensionReducerFunction",
  "DimensionReduction",
  "Dimensions",
  "DiracComb",
  "DiracDelta",
  "DirectedEdge",
  "DirectedEdges",
  "DirectedGraph",
  "DirectedGraphQ",
  "DirectedInfinity",
  "Direction",
  "DirectionalLight",
  "Directive",
  "Directory",
  "DirectoryName",
  "DirectoryQ",
  "DirectoryStack",
  "DirichletBeta",
  "DirichletCharacter",
  "DirichletCondition",
  "DirichletConvolve",
  "DirichletDistribution",
  "DirichletEta",
  "DirichletL",
  "DirichletLambda",
  "DirichletTransform",
  "DirichletWindow",
  "DisableConsolePrintPacket",
  "DisableFormatting",
  "DiscreteAsymptotic",
  "DiscreteChirpZTransform",
  "DiscreteConvolve",
  "DiscreteDelta",
  "DiscreteHadamardTransform",
  "DiscreteIndicator",
  "DiscreteInputOutputModel",
  "DiscreteLimit",
  "DiscreteLQEstimatorGains",
  "DiscreteLQRegulatorGains",
  "DiscreteLyapunovSolve",
  "DiscreteMarkovProcess",
  "DiscreteMaxLimit",
  "DiscreteMinLimit",
  "DiscretePlot",
  "DiscretePlot3D",
  "DiscreteRatio",
  "DiscreteRiccatiSolve",
  "DiscreteShift",
  "DiscreteTimeModelQ",
  "DiscreteUniformDistribution",
  "DiscreteVariables",
  "DiscreteWaveletData",
  "DiscreteWaveletPacketTransform",
  "DiscreteWaveletTransform",
  "DiscretizeGraphics",
  "DiscretizeRegion",
  "Discriminant",
  "DisjointQ",
  "Disjunction",
  "Disk",
  "DiskBox",
  "DiskBoxOptions",
  "DiskMatrix",
  "DiskSegment",
  "Dispatch",
  "DispatchQ",
  "DispersionEstimatorFunction",
  "Display",
  "DisplayAllSteps",
  "DisplayEndPacket",
  "DisplayForm",
  "DisplayFunction",
  "DisplayPacket",
  "DisplayRules",
  "DisplayString",
  "DisplayTemporary",
  "DisplayWith",
  "DisplayWithRef",
  "DisplayWithVariable",
  "DistanceFunction",
  "DistanceMatrix",
  "DistanceTransform",
  "Distribute",
  "Distributed",
  "DistributedContexts",
  "DistributeDefinitions",
  "DistributionChart",
  "DistributionDomain",
  "DistributionFitTest",
  "DistributionParameterAssumptions",
  "DistributionParameterQ",
  "Dithering",
  "Div",
  "Divergence",
  "Divide",
  "DivideBy",
  "Dividers",
  "DivideSides",
  "Divisible",
  "Divisors",
  "DivisorSigma",
  "DivisorSum",
  "DMSList",
  "DMSString",
  "Do",
  "DockedCell",
  "DockedCells",
  "DocumentGenerator",
  "DocumentGeneratorInformation",
  "DocumentGeneratorInformationData",
  "DocumentGenerators",
  "DocumentNotebook",
  "DocumentWeightingRules",
  "Dodecahedron",
  "DomainRegistrationInformation",
  "DominantColors",
  "DominatorTreeGraph",
  "DominatorVertexList",
  "DOSTextFormat",
  "Dot",
  "DotDashed",
  "DotEqual",
  "DotLayer",
  "DotPlusLayer",
  "Dotted",
  "DoubleBracketingBar",
  "DoubleContourIntegral",
  "DoubleDownArrow",
  "DoubleLeftArrow",
  "DoubleLeftRightArrow",
  "DoubleLeftTee",
  "DoubleLongLeftArrow",
  "DoubleLongLeftRightArrow",
  "DoubleLongRightArrow",
  "DoubleRightArrow",
  "DoubleRightTee",
  "DoubleUpArrow",
  "DoubleUpDownArrow",
  "DoubleVerticalBar",
  "DoublyInfinite",
  "Down",
  "DownArrow",
  "DownArrowBar",
  "DownArrowUpArrow",
  "DownLeftRightVector",
  "DownLeftTeeVector",
  "DownLeftVector",
  "DownLeftVectorBar",
  "DownRightTeeVector",
  "DownRightVector",
  "DownRightVectorBar",
  "Downsample",
  "DownTee",
  "DownTeeArrow",
  "DownValues",
  "DownValuesFunction",
  "DragAndDrop",
  "DrawBackFaces",
  "DrawEdges",
  "DrawFrontFaces",
  "DrawHighlighted",
  "DrazinInverse",
  "Drop",
  "DropoutLayer",
  "DropShadowing",
  "DSolve",
  "DSolveChangeVariables",
  "DSolveValue",
  "Dt",
  "DualLinearProgramming",
  "DualPlanarGraph",
  "DualPolyhedron",
  "DualSystemsModel",
  "DumpGet",
  "DumpSave",
  "DuplicateFreeQ",
  "Duration",
  "Dynamic",
  "DynamicBox",
  "DynamicBoxOptions",
  "DynamicEvaluationTimeout",
  "DynamicGeoGraphics",
  "DynamicImage",
  "DynamicLocation",
  "DynamicModule",
  "DynamicModuleBox",
  "DynamicModuleBoxOptions",
  "DynamicModuleParent",
  "DynamicModuleValues",
  "DynamicName",
  "DynamicNamespace",
  "DynamicReference",
  "DynamicSetting",
  "DynamicUpdating",
  "DynamicWrapper",
  "DynamicWrapperBox",
  "DynamicWrapperBoxOptions",
  "E",
  "EarthImpactData",
  "EarthquakeData",
  "EccentricityCentrality",
  "Echo",
  "EchoEvaluation",
  "EchoFunction",
  "EchoLabel",
  "EchoTiming",
  "EclipseType",
  "EdgeAdd",
  "EdgeBetweennessCentrality",
  "EdgeCapacity",
  "EdgeCapForm",
  "EdgeChromaticNumber",
  "EdgeColor",
  "EdgeConnectivity",
  "EdgeContract",
  "EdgeCost",
  "EdgeCount",
  "EdgeCoverQ",
  "EdgeCycleMatrix",
  "EdgeDashing",
  "EdgeDelete",
  "EdgeDetect",
  "EdgeForm",
  "EdgeIndex",
  "EdgeJoinForm",
  "EdgeLabeling",
  "EdgeLabels",
  "EdgeLabelStyle",
  "EdgeList",
  "EdgeOpacity",
  "EdgeQ",
  "EdgeRenderingFunction",
  "EdgeRules",
  "EdgeShapeFunction",
  "EdgeStyle",
  "EdgeTaggedGraph",
  "EdgeTaggedGraphQ",
  "EdgeTags",
  "EdgeThickness",
  "EdgeTransitiveGraphQ",
  "EdgeValueRange",
  "EdgeValueSizes",
  "EdgeWeight",
  "EdgeWeightedGraphQ",
  "Editable",
  "EditButtonSettings",
  "EditCellTagsSettings",
  "EditDistance",
  "EffectiveInterest",
  "Eigensystem",
  "Eigenvalues",
  "EigenvectorCentrality",
  "Eigenvectors",
  "Element",
  "ElementData",
  "ElementwiseLayer",
  "ElidedForms",
  "Eliminate",
  "EliminationOrder",
  "Ellipsoid",
  "EllipticE",
  "EllipticExp",
  "EllipticExpPrime",
  "EllipticF",
  "EllipticFilterModel",
  "EllipticK",
  "EllipticLog",
  "EllipticNomeQ",
  "EllipticPi",
  "EllipticReducedHalfPeriods",
  "EllipticTheta",
  "EllipticThetaPrime",
  "EmbedCode",
  "EmbeddedHTML",
  "EmbeddedService",
  "EmbeddedSQLEntityClass",
  "EmbeddedSQLExpression",
  "EmbeddingLayer",
  "EmbeddingObject",
  "EmitSound",
  "EmphasizeSyntaxErrors",
  "EmpiricalDistribution",
  "Empty",
  "EmptyGraphQ",
  "EmptyRegion",
  "EmptySpaceF",
  "EnableConsolePrintPacket",
  "Enabled",
  "Enclose",
  "Encode",
  "Encrypt",
  "EncryptedObject",
  "EncryptFile",
  "End",
  "EndAdd",
  "EndDialogPacket",
  "EndOfBuffer",
  "EndOfFile",
  "EndOfLine",
  "EndOfString",
  "EndPackage",
  "EngineEnvironment",
  "EngineeringForm",
  "Enter",
  "EnterExpressionPacket",
  "EnterTextPacket",
  "Entity",
  "EntityClass",
  "EntityClassList",
  "EntityCopies",
  "EntityFunction",
  "EntityGroup",
  "EntityInstance",
  "EntityList",
  "EntityPrefetch",
  "EntityProperties",
  "EntityProperty",
  "EntityPropertyClass",
  "EntityRegister",
  "EntityStore",
  "EntityStores",
  "EntityTypeName",
  "EntityUnregister",
  "EntityValue",
  "Entropy",
  "EntropyFilter",
  "Environment",
  "Epilog",
  "EpilogFunction",
  "Equal",
  "EqualColumns",
  "EqualRows",
  "EqualTilde",
  "EqualTo",
  "EquatedTo",
  "Equilibrium",
  "EquirippleFilterKernel",
  "Equivalent",
  "Erf",
  "Erfc",
  "Erfi",
  "ErlangB",
  "ErlangC",
  "ErlangDistribution",
  "Erosion",
  "ErrorBox",
  "ErrorBoxOptions",
  "ErrorNorm",
  "ErrorPacket",
  "ErrorsDialogSettings",
  "EscapeRadius",
  "EstimatedBackground",
  "EstimatedDistribution",
  "EstimatedPointNormals",
  "EstimatedPointProcess",
  "EstimatedProcess",
  "EstimatedVariogramModel",
  "EstimatorGains",
  "EstimatorRegulator",
  "EuclideanDistance",
  "EulerAngles",
  "EulerCharacteristic",
  "EulerE",
  "EulerGamma",
  "EulerianGraphQ",
  "EulerMatrix",
  "EulerPhi",
  "Evaluatable",
  "Evaluate",
  "Evaluated",
  "EvaluatePacket",
  "EvaluateScheduledTask",
  "EvaluationBox",
  "EvaluationCell",
  "EvaluationCompletionAction",
  "EvaluationData",
  "EvaluationElements",
  "EvaluationEnvironment",
  "EvaluationMode",
  "EvaluationMonitor",
  "EvaluationNotebook",
  "EvaluationObject",
  "EvaluationOrder",
  "EvaluationPrivileges",
  "EvaluationRateLimit",
  "Evaluator",
  "EvaluatorNames",
  "EvenQ",
  "EventData",
  "EventEvaluator",
  "EventHandler",
  "EventHandlerTag",
  "EventLabels",
  "EventSeries",
  "ExactBlackmanWindow",
  "ExactNumberQ",
  "ExactRootIsolation",
  "ExampleData",
  "Except",
  "ExcludedContexts",
  "ExcludedForms",
  "ExcludedLines",
  "ExcludedPhysicalQuantities",
  "ExcludePods",
  "Exclusions",
  "ExclusionsStyle",
  "Exists",
  "Exit",
  "ExitDialog",
  "ExoplanetData",
  "Exp",
  "Expand",
  "ExpandAll",
  "ExpandDenominator",
  "ExpandFileName",
  "ExpandNumerator",
  "Expectation",
  "ExpectationE",
  "ExpectedValue",
  "ExpGammaDistribution",
  "ExpIntegralE",
  "ExpIntegralEi",
  "ExpirationDate",
  "Exponent",
  "ExponentFunction",
  "ExponentialDistribution",
  "ExponentialFamily",
  "ExponentialGeneratingFunction",
  "ExponentialMovingAverage",
  "ExponentialPowerDistribution",
  "ExponentPosition",
  "ExponentStep",
  "Export",
  "ExportAutoReplacements",
  "ExportByteArray",
  "ExportForm",
  "ExportPacket",
  "ExportString",
  "Expression",
  "ExpressionCell",
  "ExpressionGraph",
  "ExpressionPacket",
  "ExpressionTree",
  "ExpressionUUID",
  "ExpToTrig",
  "ExtendedEntityClass",
  "ExtendedGCD",
  "Extension",
  "ExtentElementFunction",
  "ExtentMarkers",
  "ExtentSize",
  "ExternalBundle",
  "ExternalCall",
  "ExternalDataCharacterEncoding",
  "ExternalEvaluate",
  "ExternalFunction",
  "ExternalFunctionName",
  "ExternalIdentifier",
  "ExternalObject",
  "ExternalOptions",
  "ExternalSessionObject",
  "ExternalSessions",
  "ExternalStorageBase",
  "ExternalStorageDownload",
  "ExternalStorageGet",
  "ExternalStorageObject",
  "ExternalStoragePut",
  "ExternalStorageUpload",
  "ExternalTypeSignature",
  "ExternalValue",
  "Extract",
  "ExtractArchive",
  "ExtractLayer",
  "ExtractPacletArchive",
  "ExtremeValueDistribution",
  "FaceAlign",
  "FaceForm",
  "FaceGrids",
  "FaceGridsStyle",
  "FaceRecognize",
  "FacialFeatures",
  "Factor",
  "FactorComplete",
  "Factorial",
  "Factorial2",
  "FactorialMoment",
  "FactorialMomentGeneratingFunction",
  "FactorialPower",
  "FactorInteger",
  "FactorList",
  "FactorSquareFree",
  "FactorSquareFreeList",
  "FactorTerms",
  "FactorTermsList",
  "Fail",
  "Failure",
  "FailureAction",
  "FailureDistribution",
  "FailureQ",
  "False",
  "FareySequence",
  "FARIMAProcess",
  "FeatureDistance",
  "FeatureExtract",
  "FeatureExtraction",
  "FeatureExtractor",
  "FeatureExtractorFunction",
  "FeatureImpactPlot",
  "FeatureNames",
  "FeatureNearest",
  "FeatureSpacePlot",
  "FeatureSpacePlot3D",
  "FeatureTypes",
  "FeatureValueDependencyPlot",
  "FeatureValueImpactPlot",
  "FEDisableConsolePrintPacket",
  "FeedbackLinearize",
  "FeedbackSector",
  "FeedbackSectorStyle",
  "FeedbackType",
  "FEEnableConsolePrintPacket",
  "FetalGrowthData",
  "Fibonacci",
  "Fibonorial",
  "FieldCompletionFunction",
  "FieldHint",
  "FieldHintStyle",
  "FieldMasked",
  "FieldSize",
  "File",
  "FileBaseName",
  "FileByteCount",
  "FileConvert",
  "FileDate",
  "FileExistsQ",
  "FileExtension",
  "FileFormat",
  "FileFormatProperties",
  "FileFormatQ",
  "FileHandler",
  "FileHash",
  "FileInformation",
  "FileName",
  "FileNameDepth",
  "FileNameDialogSettings",
  "FileNameDrop",
  "FileNameForms",
  "FileNameJoin",
  "FileNames",
  "FileNameSetter",
  "FileNameSplit",
  "FileNameTake",
  "FileNameToFormatList",
  "FilePrint",
  "FileSize",
  "FileSystemMap",
  "FileSystemScan",
  "FileSystemTree",
  "FileTemplate",
  "FileTemplateApply",
  "FileType",
  "FilledCurve",
  "FilledCurveBox",
  "FilledCurveBoxOptions",
  "FilledTorus",
  "FillForm",
  "Filling",
  "FillingStyle",
  "FillingTransform",
  "FilteredEntityClass",
  "FilterRules",
  "FinancialBond",
  "FinancialData",
  "FinancialDerivative",
  "FinancialIndicator",
  "Find",
  "FindAnomalies",
  "FindArgMax",
  "FindArgMin",
  "FindChannels",
  "FindClique",
  "FindClusters",
  "FindCookies",
  "FindCurvePath",
  "FindCycle",
  "FindDevices",
  "FindDistribution",
  "FindDistributionParameters",
  "FindDivisions",
  "FindEdgeColoring",
  "FindEdgeCover",
  "FindEdgeCut",
  "FindEdgeIndependentPaths",
  "FindEquationalProof",
  "FindEulerianCycle",
  "FindExternalEvaluators",
  "FindFaces",
  "FindFile",
  "FindFit",
  "FindFormula",
  "FindFundamentalCycles",
  "FindGeneratingFunction",
  "FindGeoLocation",
  "FindGeometricConjectures",
  "FindGeometricTransform",
  "FindGraphCommunities",
  "FindGraphIsomorphism",
  "FindGraphPartition",
  "FindHamiltonianCycle",
  "FindHamiltonianPath",
  "FindHiddenMarkovStates",
  "FindImageText",
  "FindIndependentEdgeSet",
  "FindIndependentVertexSet",
  "FindInstance",
  "FindIntegerNullVector",
  "FindIsomers",
  "FindIsomorphicSubgraph",
  "FindKClan",
  "FindKClique",
  "FindKClub",
  "FindKPlex",
  "FindLibrary",
  "FindLinearRecurrence",
  "FindList",
  "FindMatchingColor",
  "FindMaximum",
  "FindMaximumCut",
  "FindMaximumFlow",
  "FindMaxValue",
  "FindMeshDefects",
  "FindMinimum",
  "FindMinimumCostFlow",
  "FindMinimumCut",
  "FindMinValue",
  "FindMoleculeSubstructure",
  "FindPath",
  "FindPeaks",
  "FindPermutation",
  "FindPlanarColoring",
  "FindPointProcessParameters",
  "FindPostmanTour",
  "FindProcessParameters",
  "FindRegionTransform",
  "FindRepeat",
  "FindRoot",
  "FindSequenceFunction",
  "FindSettings",
  "FindShortestPath",
  "FindShortestTour",
  "FindSpanningTree",
  "FindSubgraphIsomorphism",
  "FindSystemModelEquilibrium",
  "FindTextualAnswer",
  "FindThreshold",
  "FindTransientRepeat",
  "FindVertexColoring",
  "FindVertexCover",
  "FindVertexCut",
  "FindVertexIndependentPaths",
  "Fine",
  "FinishDynamic",
  "FiniteAbelianGroupCount",
  "FiniteGroupCount",
  "FiniteGroupData",
  "First",
  "FirstCase",
  "FirstPassageTimeDistribution",
  "FirstPosition",
  "FischerGroupFi22",
  "FischerGroupFi23",
  "FischerGroupFi24Prime",
  "FisherHypergeometricDistribution",
  "FisherRatioTest",
  "FisherZDistribution",
  "Fit",
  "FitAll",
  "FitRegularization",
  "FittedModel",
  "FixedOrder",
  "FixedPoint",
  "FixedPointList",
  "FlashSelection",
  "Flat",
  "FlatShading",
  "Flatten",
  "FlattenAt",
  "FlattenLayer",
  "FlatTopWindow",
  "FlightData",
  "FlipView",
  "Floor",
  "FlowPolynomial",
  "Fold",
  "FoldList",
  "FoldPair",
  "FoldPairList",
  "FoldWhile",
  "FoldWhileList",
  "FollowRedirects",
  "Font",
  "FontColor",
  "FontFamily",
  "FontForm",
  "FontName",
  "FontOpacity",
  "FontPostScriptName",
  "FontProperties",
  "FontReencoding",
  "FontSize",
  "FontSlant",
  "FontSubstitutions",
  "FontTracking",
  "FontVariations",
  "FontWeight",
  "For",
  "ForAll",
  "ForAllType",
  "ForceVersionInstall",
  "Format",
  "FormatRules",
  "FormatType",
  "FormatTypeAutoConvert",
  "FormatValues",
  "FormBox",
  "FormBoxOptions",
  "FormControl",
  "FormFunction",
  "FormLayoutFunction",
  "FormObject",
  "FormPage",
  "FormProtectionMethod",
  "FormTheme",
  "FormulaData",
  "FormulaLookup",
  "FortranForm",
  "Forward",
  "ForwardBackward",
  "ForwardCloudCredentials",
  "Fourier",
  "FourierCoefficient",
  "FourierCosCoefficient",
  "FourierCosSeries",
  "FourierCosTransform",
  "FourierDCT",
  "FourierDCTFilter",
  "FourierDCTMatrix",
  "FourierDST",
  "FourierDSTMatrix",
  "FourierMatrix",
  "FourierParameters",
  "FourierSequenceTransform",
  "FourierSeries",
  "FourierSinCoefficient",
  "FourierSinSeries",
  "FourierSinTransform",
  "FourierTransform",
  "FourierTrigSeries",
  "FoxH",
  "FoxHReduce",
  "FractionalBrownianMotionProcess",
  "FractionalD",
  "FractionalGaussianNoiseProcess",
  "FractionalPart",
  "FractionBox",
  "FractionBoxOptions",
  "FractionLine",
  "Frame",
  "FrameBox",
  "FrameBoxOptions",
  "Framed",
  "FrameInset",
  "FrameLabel",
  "Frameless",
  "FrameListVideo",
  "FrameMargins",
  "FrameRate",
  "FrameStyle",
  "FrameTicks",
  "FrameTicksStyle",
  "FRatioDistribution",
  "FrechetDistribution",
  "FreeQ",
  "FrenetSerretSystem",
  "FrequencySamplingFilterKernel",
  "FresnelC",
  "FresnelF",
  "FresnelG",
  "FresnelS",
  "Friday",
  "FrobeniusNumber",
  "FrobeniusSolve",
  "FromAbsoluteTime",
  "FromCharacterCode",
  "FromCoefficientRules",
  "FromContinuedFraction",
  "FromDate",
  "FromDateString",
  "FromDigits",
  "FromDMS",
  "FromEntity",
  "FromJulianDate",
  "FromLetterNumber",
  "FromPolarCoordinates",
  "FromRawPointer",
  "FromRomanNumeral",
  "FromSphericalCoordinates",
  "FromUnixTime",
  "Front",
  "FrontEndDynamicExpression",
  "FrontEndEventActions",
  "FrontEndExecute",
  "FrontEndObject",
  "FrontEndResource",
  "FrontEndResourceString",
  "FrontEndStackSize",
  "FrontEndToken",
  "FrontEndTokenExecute",
  "FrontEndValueCache",
  "FrontEndVersion",
  "FrontFaceColor",
  "FrontFaceGlowColor",
  "FrontFaceOpacity",
  "FrontFaceSpecularColor",
  "FrontFaceSpecularExponent",
  "FrontFaceSurfaceAppearance",
  "FrontFaceTexture",
  "Full",
  "FullAxes",
  "FullDefinition",
  "FullForm",
  "FullGraphics",
  "FullInformationOutputRegulator",
  "FullOptions",
  "FullRegion",
  "FullSimplify",
  "Function",
  "FunctionAnalytic",
  "FunctionBijective",
  "FunctionCompile",
  "FunctionCompileExport",
  "FunctionCompileExportByteArray",
  "FunctionCompileExportLibrary",
  "FunctionCompileExportString",
  "FunctionContinuous",
  "FunctionConvexity",
  "FunctionDeclaration",
  "FunctionDiscontinuities",
  "FunctionDomain",
  "FunctionExpand",
  "FunctionInjective",
  "FunctionInterpolation",
  "FunctionLayer",
  "FunctionMeromorphic",
  "FunctionMonotonicity",
  "FunctionPeriod",
  "FunctionPoles",
  "FunctionRange",
  "FunctionSign",
  "FunctionSingularities",
  "FunctionSpace",
  "FunctionSurjective",
  "FussellVeselyImportance",
  "GaborFilter",
  "GaborMatrix",
  "GaborWavelet",
  "GainMargins",
  "GainPhaseMargins",
  "GalaxyData",
  "GalleryView",
  "Gamma",
  "GammaDistribution",
  "GammaRegularized",
  "GapPenalty",
  "GARCHProcess",
  "GatedRecurrentLayer",
  "Gather",
  "GatherBy",
  "GaugeFaceElementFunction",
  "GaugeFaceStyle",
  "GaugeFrameElementFunction",
  "GaugeFrameSize",
  "GaugeFrameStyle",
  "GaugeLabels",
  "GaugeMarkers",
  "GaugeStyle",
  "GaussianFilter",
  "GaussianIntegers",
  "GaussianMatrix",
  "GaussianOrthogonalMatrixDistribution",
  "GaussianSymplecticMatrixDistribution",
  "GaussianUnitaryMatrixDistribution",
  "GaussianWindow",
  "GCD",
  "GegenbauerC",
  "General",
  "GeneralizedLinearModelFit",
  "GenerateAsymmetricKeyPair",
  "GenerateConditions",
  "GeneratedAssetFormat",
  "GeneratedAssetLocation",
  "GeneratedCell",
  "GeneratedCellStyles",
  "GeneratedDocumentBinding",
  "GenerateDerivedKey",
  "GenerateDigitalSignature",
  "GenerateDocument",
  "GeneratedParameters",
  "GeneratedQuantityMagnitudes",
  "GenerateFileSignature",
  "GenerateHTTPResponse",
  "GenerateSecuredAuthenticationKey",
  "GenerateSymmetricKey",
  "GeneratingFunction",
  "GeneratorDescription",
  "GeneratorHistoryLength",
  "GeneratorOutputType",
  "Generic",
  "GenericCylindricalDecomposition",
  "GenomeData",
  "GenomeLookup",
  "GeoAntipode",
  "GeoArea",
  "GeoArraySize",
  "GeoBackground",
  "GeoBoundary",
  "GeoBoundingBox",
  "GeoBounds",
  "GeoBoundsRegion",
  "GeoBoundsRegionBoundary",
  "GeoBubbleChart",
  "GeoCenter",
  "GeoCircle",
  "GeoContourPlot",
  "GeoDensityPlot",
  "GeodesicClosing",
  "GeodesicDilation",
  "GeodesicErosion",
  "GeodesicOpening",
  "GeodesicPolyhedron",
  "GeoDestination",
  "GeodesyData",
  "GeoDirection",
  "GeoDisk",
  "GeoDisplacement",
  "GeoDistance",
  "GeoDistanceList",
  "GeoElevationData",
  "GeoEntities",
  "GeoGraphics",
  "GeoGraphPlot",
  "GeoGraphValuePlot",
  "GeogravityModelData",
  "GeoGridDirectionDifference",
  "GeoGridLines",
  "GeoGridLinesStyle",
  "GeoGridPosition",
  "GeoGridRange",
  "GeoGridRangePadding",
  "GeoGridUnitArea",
  "GeoGridUnitDistance",
  "GeoGridVector",
  "GeoGroup",
  "GeoHemisphere",
  "GeoHemisphereBoundary",
  "GeoHistogram",
  "GeoIdentify",
  "GeoImage",
  "GeoLabels",
  "GeoLength",
  "GeoListPlot",
  "GeoLocation",
  "GeologicalPeriodData",
  "GeomagneticModelData",
  "GeoMarker",
  "GeometricAssertion",
  "GeometricBrownianMotionProcess",
  "GeometricDistribution",
  "GeometricMean",
  "GeometricMeanFilter",
  "GeometricOptimization",
  "GeometricScene",
  "GeometricStep",
  "GeometricStylingRules",
  "GeometricTest",
  "GeometricTransformation",
  "GeometricTransformation3DBox",
  "GeometricTransformation3DBoxOptions",
  "GeometricTransformationBox",
  "GeometricTransformationBoxOptions",
  "GeoModel",
  "GeoNearest",
  "GeoOrientationData",
  "GeoPath",
  "GeoPolygon",
  "GeoPosition",
  "GeoPositionENU",
  "GeoPositionXYZ",
  "GeoProjection",
  "GeoProjectionData",
  "GeoRange",
  "GeoRangePadding",
  "GeoRegionValuePlot",
  "GeoResolution",
  "GeoScaleBar",
  "GeoServer",
  "GeoSmoothHistogram",
  "GeoStreamPlot",
  "GeoStyling",
  "GeoStylingImageFunction",
  "GeoVariant",
  "GeoVector",
  "GeoVectorENU",
  "GeoVectorPlot",
  "GeoVectorXYZ",
  "GeoVisibleRegion",
  "GeoVisibleRegionBoundary",
  "GeoWithinQ",
  "GeoZoomLevel",
  "GestureHandler",
  "GestureHandlerTag",
  "Get",
  "GetContext",
  "GetEnvironment",
  "GetFileName",
  "GetLinebreakInformationPacket",
  "GibbsPointProcess",
  "Glaisher",
  "GlobalClusteringCoefficient",
  "GlobalPreferences",
  "GlobalSession",
  "Glow",
  "GoldenAngle",
  "GoldenRatio",
  "GompertzMakehamDistribution",
  "GoochShading",
  "GoodmanKruskalGamma",
  "GoodmanKruskalGammaTest",
  "Goto",
  "GouraudShading",
  "Grad",
  "Gradient",
  "GradientFilter",
  "GradientFittedMesh",
  "GradientOrientationFilter",
  "GrammarApply",
  "GrammarRules",
  "GrammarToken",
  "Graph",
  "Graph3D",
  "GraphAssortativity",
  "GraphAutomorphismGroup",
  "GraphCenter",
  "GraphComplement",
  "GraphData",
  "GraphDensity",
  "GraphDiameter",
  "GraphDifference",
  "GraphDisjointUnion",
  "GraphDistance",
  "GraphDistanceMatrix",
  "GraphEmbedding",
  "GraphHighlight",
  "GraphHighlightStyle",
  "GraphHub",
  "Graphics",
  "Graphics3D",
  "Graphics3DBox",
  "Graphics3DBoxOptions",
  "GraphicsArray",
  "GraphicsBaseline",
  "GraphicsBox",
  "GraphicsBoxOptions",
  "GraphicsColor",
  "GraphicsColumn",
  "GraphicsComplex",
  "GraphicsComplex3DBox",
  "GraphicsComplex3DBoxOptions",
  "GraphicsComplexBox",
  "GraphicsComplexBoxOptions",
  "GraphicsContents",
  "GraphicsData",
  "GraphicsGrid",
  "GraphicsGridBox",
  "GraphicsGroup",
  "GraphicsGroup3DBox",
  "GraphicsGroup3DBoxOptions",
  "GraphicsGroupBox",
  "GraphicsGroupBoxOptions",
  "GraphicsGrouping",
  "GraphicsHighlightColor",
  "GraphicsRow",
  "GraphicsSpacing",
  "GraphicsStyle",
  "GraphIntersection",
  "GraphJoin",
  "GraphLayerLabels",
  "GraphLayers",
  "GraphLayerStyle",
  "GraphLayout",
  "GraphLinkEfficiency",
  "GraphPeriphery",
  "GraphPlot",
  "GraphPlot3D",
  "GraphPower",
  "GraphProduct",
  "GraphPropertyDistribution",
  "GraphQ",
  "GraphRadius",
  "GraphReciprocity",
  "GraphRoot",
  "GraphStyle",
  "GraphSum",
  "GraphTree",
  "GraphUnion",
  "Gray",
  "GrayLevel",
  "Greater",
  "GreaterEqual",
  "GreaterEqualLess",
  "GreaterEqualThan",
  "GreaterFullEqual",
  "GreaterGreater",
  "GreaterLess",
  "GreaterSlantEqual",
  "GreaterThan",
  "GreaterTilde",
  "GreekStyle",
  "Green",
  "GreenFunction",
  "Grid",
  "GridBaseline",
  "GridBox",
  "GridBoxAlignment",
  "GridBoxBackground",
  "GridBoxDividers",
  "GridBoxFrame",
  "GridBoxItemSize",
  "GridBoxItemStyle",
  "GridBoxOptions",
  "GridBoxSpacings",
  "GridCreationSettings",
  "GridDefaultElement",
  "GridElementStyleOptions",
  "GridFrame",
  "GridFrameMargins",
  "GridGraph",
  "GridLines",
  "GridLinesStyle",
  "GridVideo",
  "GroebnerBasis",
  "GroupActionBase",
  "GroupBy",
  "GroupCentralizer",
  "GroupElementFromWord",
  "GroupElementPosition",
  "GroupElementQ",
  "GroupElements",
  "GroupElementToWord",
  "GroupGenerators",
  "Groupings",
  "GroupMultiplicationTable",
  "GroupOpenerColor",
  "GroupOpenerInsideFrame",
  "GroupOrbits",
  "GroupOrder",
  "GroupPageBreakWithin",
  "GroupSetwiseStabilizer",
  "GroupStabilizer",
  "GroupStabilizerChain",
  "GroupTogetherGrouping",
  "GroupTogetherNestedGrouping",
  "GrowCutComponents",
  "Gudermannian",
  "GuidedFilter",
  "GumbelDistribution",
  "HaarWavelet",
  "HadamardMatrix",
  "HalfLine",
  "HalfNormalDistribution",
  "HalfPlane",
  "HalfSpace",
  "HalftoneShading",
  "HamiltonianGraphQ",
  "HammingDistance",
  "HammingWindow",
  "HandlerFunctions",
  "HandlerFunctionsKeys",
  "HankelH1",
  "HankelH2",
  "HankelMatrix",
  "HankelTransform",
  "HannPoissonWindow",
  "HannWindow",
  "HaradaNortonGroupHN",
  "HararyGraph",
  "HardcorePointProcess",
  "HarmonicMean",
  "HarmonicMeanFilter",
  "HarmonicNumber",
  "Hash",
  "HatchFilling",
  "HatchShading",
  "Haversine",
  "HazardFunction",
  "Head",
  "HeadCompose",
  "HeaderAlignment",
  "HeaderBackground",
  "HeaderDisplayFunction",
  "HeaderLines",
  "Headers",
  "HeaderSize",
  "HeaderStyle",
  "Heads",
  "HeatFluxValue",
  "HeatInsulationValue",
  "HeatOutflowValue",
  "HeatRadiationValue",
  "HeatSymmetryValue",
  "HeatTemperatureCondition",
  "HeatTransferPDEComponent",
  "HeatTransferValue",
  "HeavisideLambda",
  "HeavisidePi",
  "HeavisideTheta",
  "HeldGroupHe",
  "HeldPart",
  "HelmholtzPDEComponent",
  "HelpBrowserLookup",
  "HelpBrowserNotebook",
  "HelpBrowserSettings",
  "HelpViewerSettings",
  "Here",
  "HermiteDecomposition",
  "HermiteH",
  "Hermitian",
  "HermitianMatrixQ",
  "HessenbergDecomposition",
  "Hessian",
  "HeunB",
  "HeunBPrime",
  "HeunC",
  "HeunCPrime",
  "HeunD",
  "HeunDPrime",
  "HeunG",
  "HeunGPrime",
  "HeunT",
  "HeunTPrime",
  "HexadecimalCharacter",
  "Hexahedron",
  "HexahedronBox",
  "HexahedronBoxOptions",
  "HiddenItems",
  "HiddenMarkovProcess",
  "HiddenSurface",
  "Highlighted",
  "HighlightGraph",
  "HighlightImage",
  "HighlightMesh",
  "HighlightString",
  "HighpassFilter",
  "HigmanSimsGroupHS",
  "HilbertCurve",
  "HilbertFilter",
  "HilbertMatrix",
  "Histogram",
  "Histogram3D",
  "HistogramDistribution",
  "HistogramList",
  "HistogramPointDensity",
  "HistogramTransform",
  "HistogramTransformInterpolation",
  "HistoricalPeriodData",
  "HitMissTransform",
  "HITSCentrality",
  "HjorthDistribution",
  "HodgeDual",
  "HoeffdingD",
  "HoeffdingDTest",
  "Hold",
  "HoldAll",
  "HoldAllComplete",
  "HoldComplete",
  "HoldFirst",
  "HoldForm",
  "HoldPattern",
  "HoldRest",
  "HolidayCalendar",
  "HomeDirectory",
  "HomePage",
  "Horizontal",
  "HorizontalForm",
  "HorizontalGauge",
  "HorizontalScrollPosition",
  "HornerForm",
  "HostLookup",
  "HotellingTSquareDistribution",
  "HoytDistribution",
  "HTMLSave",
  "HTTPErrorResponse",
  "HTTPRedirect",
  "HTTPRequest",
  "HTTPRequestData",
  "HTTPResponse",
  "Hue",
  "HumanGrowthData",
  "HumpDownHump",
  "HumpEqual",
  "HurwitzLerchPhi",
  "HurwitzZeta",
  "HyperbolicDistribution",
  "HypercubeGraph",
  "HyperexponentialDistribution",
  "Hyperfactorial",
  "Hypergeometric0F1",
  "Hypergeometric0F1Regularized",
  "Hypergeometric1F1",
  "Hypergeometric1F1Regularized",
  "Hypergeometric2F1",
  "Hypergeometric2F1Regularized",
  "HypergeometricDistribution",
  "HypergeometricPFQ",
  "HypergeometricPFQRegularized",
  "HypergeometricU",
  "Hyperlink",
  "HyperlinkAction",
  "HyperlinkCreationSettings",
  "Hyperplane",
  "Hyphenation",
  "HyphenationOptions",
  "HypoexponentialDistribution",
  "HypothesisTestData",
  "I",
  "IconData",
  "Iconize",
  "IconizedObject",
  "IconRules",
  "Icosahedron",
  "Identity",
  "IdentityMatrix",
  "If",
  "IfCompiled",
  "IgnoreCase",
  "IgnoreDiacritics",
  "IgnoreIsotopes",
  "IgnorePunctuation",
  "IgnoreSpellCheck",
  "IgnoreStereochemistry",
  "IgnoringInactive",
  "Im",
  "Image",
  "Image3D",
  "Image3DProjection",
  "Image3DSlices",
  "ImageAccumulate",
  "ImageAdd",
  "ImageAdjust",
  "ImageAlign",
  "ImageApply",
  "ImageApplyIndexed",
  "ImageAspectRatio",
  "ImageAssemble",
  "ImageAugmentationLayer",
  "ImageBoundingBoxes",
  "ImageCache",
  "ImageCacheValid",
  "ImageCapture",
  "ImageCaptureFunction",
  "ImageCases",
  "ImageChannels",
  "ImageClip",
  "ImageCollage",
  "ImageColorSpace",
  "ImageCompose",
  "ImageContainsQ",
  "ImageContents",
  "ImageConvolve",
  "ImageCooccurrence",
  "ImageCorners",
  "ImageCorrelate",
  "ImageCorrespondingPoints",
  "ImageCrop",
  "ImageData",
  "ImageDeconvolve",
  "ImageDemosaic",
  "ImageDifference",
  "ImageDimensions",
  "ImageDisplacements",
  "ImageDistance",
  "ImageEditMode",
  "ImageEffect",
  "ImageExposureCombine",
  "ImageFeatureTrack",
  "ImageFileApply",
  "ImageFileFilter",
  "ImageFileScan",
  "ImageFilter",
  "ImageFocusCombine",
  "ImageForestingComponents",
  "ImageFormattingWidth",
  "ImageForwardTransformation",
  "ImageGraphics",
  "ImageHistogram",
  "ImageIdentify",
  "ImageInstanceQ",
  "ImageKeypoints",
  "ImageLabels",
  "ImageLegends",
  "ImageLevels",
  "ImageLines",
  "ImageMargins",
  "ImageMarker",
  "ImageMarkers",
  "ImageMeasurements",
  "ImageMesh",
  "ImageMultiply",
  "ImageOffset",
  "ImagePad",
  "ImagePadding",
  "ImagePartition",
  "ImagePeriodogram",
  "ImagePerspectiveTransformation",
  "ImagePosition",
  "ImagePreviewFunction",
  "ImagePyramid",
  "ImagePyramidApply",
  "ImageQ",
  "ImageRangeCache",
  "ImageRecolor",
  "ImageReflect",
  "ImageRegion",
  "ImageResize",
  "ImageResolution",
  "ImageRestyle",
  "ImageRotate",
  "ImageRotated",
  "ImageSaliencyFilter",
  "ImageScaled",
  "ImageScan",
  "ImageSize",
  "ImageSizeAction",
  "ImageSizeCache",
  "ImageSizeMultipliers",
  "ImageSizeRaw",
  "ImageStitch",
  "ImageSubtract",
  "ImageTake",
  "ImageTransformation",
  "ImageTrim",
  "ImageType",
  "ImageValue",
  "ImageValuePositions",
  "ImageVectorscopePlot",
  "ImageWaveformPlot",
  "ImagingDevice",
  "ImplicitD",
  "ImplicitRegion",
  "Implies",
  "Import",
  "ImportAutoReplacements",
  "ImportByteArray",
  "ImportedObject",
  "ImportOptions",
  "ImportString",
  "ImprovementImportance",
  "In",
  "Inactivate",
  "Inactive",
  "InactiveStyle",
  "IncidenceGraph",
  "IncidenceList",
  "IncidenceMatrix",
  "IncludeAromaticBonds",
  "IncludeConstantBasis",
  "IncludedContexts",
  "IncludeDefinitions",
  "IncludeDirectories",
  "IncludeFileExtension",
  "IncludeGeneratorTasks",
  "IncludeHydrogens",
  "IncludeInflections",
  "IncludeMetaInformation",
  "IncludePods",
  "IncludeQuantities",
  "IncludeRelatedTables",
  "IncludeSingularSolutions",
  "IncludeSingularTerm",
  "IncludeWindowTimes",
  "Increment",
  "IndefiniteMatrixQ",
  "Indent",
  "IndentingNewlineSpacings",
  "IndentMaxFraction",
  "IndependenceTest",
  "IndependentEdgeSetQ",
  "IndependentPhysicalQuantity",
  "IndependentUnit",
  "IndependentUnitDimension",
  "IndependentVertexSetQ",
  "Indeterminate",
  "IndeterminateThreshold",
  "IndexCreationOptions",
  "Indexed",
  "IndexEdgeTaggedGraph",
  "IndexGraph",
  "IndexTag",
  "Inequality",
  "InertEvaluate",
  "InertExpression",
  "InexactNumberQ",
  "InexactNumbers",
  "InfiniteFuture",
  "InfiniteLine",
  "InfiniteLineThrough",
  "InfinitePast",
  "InfinitePlane",
  "Infinity",
  "Infix",
  "InflationAdjust",
  "InflationMethod",
  "Information",
  "InformationData",
  "InformationDataGrid",
  "Inherited",
  "InheritScope",
  "InhomogeneousPoissonPointProcess",
  "InhomogeneousPoissonProcess",
  "InitialEvaluationHistory",
  "Initialization",
  "InitializationCell",
  "InitializationCellEvaluation",
  "InitializationCellWarning",
  "InitializationObject",
  "InitializationObjects",
  "InitializationValue",
  "Initialize",
  "InitialSeeding",
  "InlineCounterAssignments",
  "InlineCounterIncrements",
  "InlineRules",
  "Inner",
  "InnerPolygon",
  "InnerPolyhedron",
  "Inpaint",
  "Input",
  "InputAliases",
  "InputAssumptions",
  "InputAutoReplacements",
  "InputField",
  "InputFieldBox",
  "InputFieldBoxOptions",
  "InputForm",
  "InputGrouping",
  "InputNamePacket",
  "InputNotebook",
  "InputPacket",
  "InputPorts",
  "InputSettings",
  "InputStream",
  "InputString",
  "InputStringPacket",
  "InputToBoxFormPacket",
  "Insert",
  "InsertionFunction",
  "InsertionPointObject",
  "InsertLinebreaks",
  "InsertResults",
  "Inset",
  "Inset3DBox",
  "Inset3DBoxOptions",
  "InsetBox",
  "InsetBoxOptions",
  "Insphere",
  "Install",
  "InstallService",
  "InstanceNormalizationLayer",
  "InString",
  "Integer",
  "IntegerDigits",
  "IntegerExponent",
  "IntegerLength",
  "IntegerName",
  "IntegerPart",
  "IntegerPartitions",
  "IntegerQ",
  "IntegerReverse",
  "Integers",
  "IntegerString",
  "Integral",
  "Integrate",
  "IntegrateChangeVariables",
  "Interactive",
  "InteractiveTradingChart",
  "InterfaceSwitched",
  "Interlaced",
  "Interleaving",
  "InternallyBalancedDecomposition",
  "InterpolatingFunction",
  "InterpolatingPolynomial",
  "Interpolation",
  "InterpolationOrder",
  "InterpolationPoints",
  "InterpolationPrecision",
  "Interpretation",
  "InterpretationBox",
  "InterpretationBoxOptions",
  "InterpretationFunction",
  "Interpreter",
  "InterpretTemplate",
  "InterquartileRange",
  "Interrupt",
  "InterruptSettings",
  "IntersectedEntityClass",
  "IntersectingQ",
  "Intersection",
  "Interval",
  "IntervalIntersection",
  "IntervalMarkers",
  "IntervalMarkersStyle",
  "IntervalMemberQ",
  "IntervalSlider",
  "IntervalUnion",
  "Into",
  "Inverse",
  "InverseBetaRegularized",
  "InverseBilateralLaplaceTransform",
  "InverseBilateralZTransform",
  "InverseCDF",
  "InverseChiSquareDistribution",
  "InverseContinuousWaveletTransform",
  "InverseDistanceTransform",
  "InverseEllipticNomeQ",
  "InverseErf",
  "InverseErfc",
  "InverseFourier",
  "InverseFourierCosTransform",
  "InverseFourierSequenceTransform",
  "InverseFourierSinTransform",
  "InverseFourierTransform",
  "InverseFunction",
  "InverseFunctions",
  "InverseGammaDistribution",
  "InverseGammaRegularized",
  "InverseGaussianDistribution",
  "InverseGudermannian",
  "InverseHankelTransform",
  "InverseHaversine",
  "InverseImagePyramid",
  "InverseJacobiCD",
  "InverseJacobiCN",
  "InverseJacobiCS",
  "InverseJacobiDC",
  "InverseJacobiDN",
  "InverseJacobiDS",
  "InverseJacobiNC",
  "InverseJacobiND",
  "InverseJacobiNS",
  "InverseJacobiSC",
  "InverseJacobiSD",
  "InverseJacobiSN",
  "InverseLaplaceTransform",
  "InverseMellinTransform",
  "InversePermutation",
  "InverseRadon",
  "InverseRadonTransform",
  "InverseSeries",
  "InverseShortTimeFourier",
  "InverseSpectrogram",
  "InverseSurvivalFunction",
  "InverseTransformedRegion",
  "InverseWaveletTransform",
  "InverseWeierstrassP",
  "InverseWishartMatrixDistribution",
  "InverseZTransform",
  "Invisible",
  "InvisibleApplication",
  "InvisibleTimes",
  "IPAddress",
  "IrreduciblePolynomialQ",
  "IslandData",
  "IsolatingInterval",
  "IsomorphicGraphQ",
  "IsomorphicSubgraphQ",
  "IsotopeData",
  "Italic",
  "Item",
  "ItemAspectRatio",
  "ItemBox",
  "ItemBoxOptions",
  "ItemDisplayFunction",
  "ItemSize",
  "ItemStyle",
  "ItoProcess",
  "JaccardDissimilarity",
  "JacobiAmplitude",
  "Jacobian",
  "JacobiCD",
  "JacobiCN",
  "JacobiCS",
  "JacobiDC",
  "JacobiDN",
  "JacobiDS",
  "JacobiEpsilon",
  "JacobiNC",
  "JacobiND",
  "JacobiNS",
  "JacobiP",
  "JacobiSC",
  "JacobiSD",
  "JacobiSN",
  "JacobiSymbol",
  "JacobiZeta",
  "JacobiZN",
  "JankoGroupJ1",
  "JankoGroupJ2",
  "JankoGroupJ3",
  "JankoGroupJ4",
  "JarqueBeraALMTest",
  "JohnsonDistribution",
  "Join",
  "JoinAcross",
  "Joined",
  "JoinedCurve",
  "JoinedCurveBox",
  "JoinedCurveBoxOptions",
  "JoinForm",
  "JordanDecomposition",
  "JordanModelDecomposition",
  "JulianDate",
  "JuliaSetBoettcher",
  "JuliaSetIterationCount",
  "JuliaSetPlot",
  "JuliaSetPoints",
  "K",
  "KagiChart",
  "KaiserBesselWindow",
  "KaiserWindow",
  "KalmanEstimator",
  "KalmanFilter",
  "KarhunenLoeveDecomposition",
  "KaryTree",
  "KatzCentrality",
  "KCoreComponents",
  "KDistribution",
  "KEdgeConnectedComponents",
  "KEdgeConnectedGraphQ",
  "KeepExistingVersion",
  "KelvinBei",
  "KelvinBer",
  "KelvinKei",
  "KelvinKer",
  "KendallTau",
  "KendallTauTest",
  "KernelConfiguration",
  "KernelExecute",
  "KernelFunction",
  "KernelMixtureDistribution",
  "KernelObject",
  "Kernels",
  "Ket",
  "Key",
  "KeyCollisionFunction",
  "KeyComplement",
  "KeyDrop",
  "KeyDropFrom",
  "KeyExistsQ",
  "KeyFreeQ",
  "KeyIntersection",
  "KeyMap",
  "KeyMemberQ",
  "KeypointStrength",
  "Keys",
  "KeySelect",
  "KeySort",
  "KeySortBy",
  "KeyTake",
  "KeyUnion",
  "KeyValueMap",
  "KeyValuePattern",
  "Khinchin",
  "KillProcess",
  "KirchhoffGraph",
  "KirchhoffMatrix",
  "KleinInvariantJ",
  "KnapsackSolve",
  "KnightTourGraph",
  "KnotData",
  "KnownUnitQ",
  "KochCurve",
  "KolmogorovSmirnovTest",
  "KroneckerDelta",
  "KroneckerModelDecomposition",
  "KroneckerProduct",
  "KroneckerSymbol",
  "KuiperTest",
  "KumaraswamyDistribution",
  "Kurtosis",
  "KuwaharaFilter",
  "KVertexConnectedComponents",
  "KVertexConnectedGraphQ",
  "LABColor",
  "Label",
  "Labeled",
  "LabeledSlider",
  "LabelingFunction",
  "LabelingSize",
  "LabelStyle",
  "LabelVisibility",
  "LaguerreL",
  "LakeData",
  "LambdaComponents",
  "LambertW",
  "LameC",
  "LameCPrime",
  "LameEigenvalueA",
  "LameEigenvalueB",
  "LameS",
  "LameSPrime",
  "LaminaData",
  "LanczosWindow",
  "LandauDistribution",
  "Language",
  "LanguageCategory",
  "LanguageData",
  "LanguageIdentify",
  "LanguageOptions",
  "LaplaceDistribution",
  "LaplaceTransform",
  "Laplacian",
  "LaplacianFilter",
  "LaplacianGaussianFilter",
  "LaplacianPDETerm",
  "Large",
  "Larger",
  "Last",
  "Latitude",
  "LatitudeLongitude",
  "LatticeData",
  "LatticeReduce",
  "Launch",
  "LaunchKernels",
  "LayeredGraphPlot",
  "LayeredGraphPlot3D",
  "LayerSizeFunction",
  "LayoutInformation",
  "LCHColor",
  "LCM",
  "LeaderSize",
  "LeafCount",
  "LeapVariant",
  "LeapYearQ",
  "LearnDistribution",
  "LearnedDistribution",
  "LearningRate",
  "LearningRateMultipliers",
  "LeastSquares",
  "LeastSquaresFilterKernel",
  "Left",
  "LeftArrow",
  "LeftArrowBar",
  "LeftArrowRightArrow",
  "LeftDownTeeVector",
  "LeftDownVector",
  "LeftDownVectorBar",
  "LeftRightArrow",
  "LeftRightVector",
  "LeftTee",
  "LeftTeeArrow",
  "LeftTeeVector",
  "LeftTriangle",
  "LeftTriangleBar",
  "LeftTriangleEqual",
  "LeftUpDownVector",
  "LeftUpTeeVector",
  "LeftUpVector",
  "LeftUpVectorBar",
  "LeftVector",
  "LeftVectorBar",
  "LegendAppearance",
  "Legended",
  "LegendFunction",
  "LegendLabel",
  "LegendLayout",
  "LegendMargins",
  "LegendMarkers",
  "LegendMarkerSize",
  "LegendreP",
  "LegendreQ",
  "LegendreType",
  "Length",
  "LengthWhile",
  "LerchPhi",
  "Less",
  "LessEqual",
  "LessEqualGreater",
  "LessEqualThan",
  "LessFullEqual",
  "LessGreater",
  "LessLess",
  "LessSlantEqual",
  "LessThan",
  "LessTilde",
  "LetterCharacter",
  "LetterCounts",
  "LetterNumber",
  "LetterQ",
  "Level",
  "LeveneTest",
  "LeviCivitaTensor",
  "LevyDistribution",
  "Lexicographic",
  "LexicographicOrder",
  "LexicographicSort",
  "LibraryDataType",
  "LibraryFunction",
  "LibraryFunctionDeclaration",
  "LibraryFunctionError",
  "LibraryFunctionInformation",
  "LibraryFunctionLoad",
  "LibraryFunctionUnload",
  "LibraryLoad",
  "LibraryUnload",
  "LicenseEntitlementObject",
  "LicenseEntitlements",
  "LicenseID",
  "LicensingSettings",
  "LiftingFilterData",
  "LiftingWaveletTransform",
  "LightBlue",
  "LightBrown",
  "LightCyan",
  "Lighter",
  "LightGray",
  "LightGreen",
  "Lighting",
  "LightingAngle",
  "LightMagenta",
  "LightOrange",
  "LightPink",
  "LightPurple",
  "LightRed",
  "LightSources",
  "LightYellow",
  "Likelihood",
  "Limit",
  "LimitsPositioning",
  "LimitsPositioningTokens",
  "LindleyDistribution",
  "Line",
  "Line3DBox",
  "Line3DBoxOptions",
  "LinearFilter",
  "LinearFractionalOptimization",
  "LinearFractionalTransform",
  "LinearGradientFilling",
  "LinearGradientImage",
  "LinearizingTransformationData",
  "LinearLayer",
  "LinearModelFit",
  "LinearOffsetFunction",
  "LinearOptimization",
  "LinearProgramming",
  "LinearRecurrence",
  "LinearSolve",
  "LinearSolveFunction",
  "LineBox",
  "LineBoxOptions",
  "LineBreak",
  "LinebreakAdjustments",
  "LineBreakChart",
  "LinebreakSemicolonWeighting",
  "LineBreakWithin",
  "LineColor",
  "LineGraph",
  "LineIndent",
  "LineIndentMaxFraction",
  "LineIntegralConvolutionPlot",
  "LineIntegralConvolutionScale",
  "LineLegend",
  "LineOpacity",
  "LineSpacing",
  "LineWrapParts",
  "LinkActivate",
  "LinkClose",
  "LinkConnect",
  "LinkConnectedQ",
  "LinkCreate",
  "LinkError",
  "LinkFlush",
  "LinkFunction",
  "LinkHost",
  "LinkInterrupt",
  "LinkLaunch",
  "LinkMode",
  "LinkObject",
  "LinkOpen",
  "LinkOptions",
  "LinkPatterns",
  "LinkProtocol",
  "LinkRankCentrality",
  "LinkRead",
  "LinkReadHeld",
  "LinkReadyQ",
  "Links",
  "LinkService",
  "LinkWrite",
  "LinkWriteHeld",
  "LiouvilleLambda",
  "List",
  "Listable",
  "ListAnimate",
  "ListContourPlot",
  "ListContourPlot3D",
  "ListConvolve",
  "ListCorrelate",
  "ListCurvePathPlot",
  "ListDeconvolve",
  "ListDensityPlot",
  "ListDensityPlot3D",
  "Listen",
  "ListFormat",
  "ListFourierSequenceTransform",
  "ListInterpolation",
  "ListLineIntegralConvolutionPlot",
  "ListLinePlot",
  "ListLinePlot3D",
  "ListLogLinearPlot",
  "ListLogLogPlot",
  "ListLogPlot",
  "ListPicker",
  "ListPickerBox",
  "ListPickerBoxBackground",
  "ListPickerBoxOptions",
  "ListPlay",
  "ListPlot",
  "ListPlot3D",
  "ListPointPlot3D",
  "ListPolarPlot",
  "ListQ",
  "ListSliceContourPlot3D",
  "ListSliceDensityPlot3D",
  "ListSliceVectorPlot3D",
  "ListStepPlot",
  "ListStreamDensityPlot",
  "ListStreamPlot",
  "ListStreamPlot3D",
  "ListSurfacePlot3D",
  "ListVectorDensityPlot",
  "ListVectorDisplacementPlot",
  "ListVectorDisplacementPlot3D",
  "ListVectorPlot",
  "ListVectorPlot3D",
  "ListZTransform",
  "Literal",
  "LiteralSearch",
  "LiteralType",
  "LoadCompiledComponent",
  "LocalAdaptiveBinarize",
  "LocalCache",
  "LocalClusteringCoefficient",
  "LocalEvaluate",
  "LocalizeDefinitions",
  "LocalizeVariables",
  "LocalObject",
  "LocalObjects",
  "LocalResponseNormalizationLayer",
  "LocalSubmit",
  "LocalSymbol",
  "LocalTime",
  "LocalTimeZone",
  "LocationEquivalenceTest",
  "LocationTest",
  "Locator",
  "LocatorAutoCreate",
  "LocatorBox",
  "LocatorBoxOptions",
  "LocatorCentering",
  "LocatorPane",
  "LocatorPaneBox",
  "LocatorPaneBoxOptions",
  "LocatorRegion",
  "Locked",
  "Log",
  "Log10",
  "Log2",
  "LogBarnesG",
  "LogGamma",
  "LogGammaDistribution",
  "LogicalExpand",
  "LogIntegral",
  "LogisticDistribution",
  "LogisticSigmoid",
  "LogitModelFit",
  "LogLikelihood",
  "LogLinearPlot",
  "LogLogisticDistribution",
  "LogLogPlot",
  "LogMultinormalDistribution",
  "LogNormalDistribution",
  "LogPlot",
  "LogRankTest",
  "LogSeriesDistribution",
  "LongEqual",
  "Longest",
  "LongestCommonSequence",
  "LongestCommonSequencePositions",
  "LongestCommonSubsequence",
  "LongestCommonSubsequencePositions",
  "LongestMatch",
  "LongestOrderedSequence",
  "LongForm",
  "Longitude",
  "LongLeftArrow",
  "LongLeftRightArrow",
  "LongRightArrow",
  "LongShortTermMemoryLayer",
  "Lookup",
  "Loopback",
  "LoopFreeGraphQ",
  "Looping",
  "LossFunction",
  "LowerCaseQ",
  "LowerLeftArrow",
  "LowerRightArrow",
  "LowerTriangularize",
  "LowerTriangularMatrix",
  "LowerTriangularMatrixQ",
  "LowpassFilter",
  "LQEstimatorGains",
  "LQGRegulator",
  "LQOutputRegulatorGains",
  "LQRegulatorGains",
  "LUBackSubstitution",
  "LucasL",
  "LuccioSamiComponents",
  "LUDecomposition",
  "LunarEclipse",
  "LUVColor",
  "LyapunovSolve",
  "LyonsGroupLy",
  "MachineID",
  "MachineName",
  "MachineNumberQ",
  "MachinePrecision",
  "MacintoshSystemPageSetup",
  "Magenta",
  "Magnification",
  "Magnify",
  "MailAddressValidation",
  "MailExecute",
  "MailFolder",
  "MailItem",
  "MailReceiverFunction",
  "MailResponseFunction",
  "MailSearch",
  "MailServerConnect",
  "MailServerConnection",
  "MailSettings",
  "MainSolve",
  "MaintainDynamicCaches",
  "Majority",
  "MakeBoxes",
  "MakeExpression",
  "MakeRules",
  "ManagedLibraryExpressionID",
  "ManagedLibraryExpressionQ",
  "MandelbrotSetBoettcher",
  "MandelbrotSetDistance",
  "MandelbrotSetIterationCount",
  "MandelbrotSetMemberQ",
  "MandelbrotSetPlot",
  "MangoldtLambda",
  "ManhattanDistance",
  "Manipulate",
  "Manipulator",
  "MannedSpaceMissionData",
  "MannWhitneyTest",
  "MantissaExponent",
  "Manual",
  "Map",
  "MapAll",
  "MapApply",
  "MapAt",
  "MapIndexed",
  "MAProcess",
  "MapThread",
  "MarchenkoPasturDistribution",
  "MarcumQ",
  "MardiaCombinedTest",
  "MardiaKurtosisTest",
  "MardiaSkewnessTest",
  "MarginalDistribution",
  "MarkovProcessProperties",
  "Masking",
  "MassConcentrationCondition",
  "MassFluxValue",
  "MassImpermeableBoundaryValue",
  "MassOutflowValue",
  "MassSymmetryValue",
  "MassTransferValue",
  "MassTransportPDEComponent",
  "MatchingDissimilarity",
  "MatchLocalNameQ",
  "MatchLocalNames",
  "MatchQ",
  "Material",
  "MaterialShading",
  "MaternPointProcess",
  "MathematicalFunctionData",
  "MathematicaNotation",
  "MathieuC",
  "MathieuCharacteristicA",
  "MathieuCharacteristicB",
  "MathieuCharacteristicExponent",
  "MathieuCPrime",
  "MathieuGroupM11",
  "MathieuGroupM12",
  "MathieuGroupM22",
  "MathieuGroupM23",
  "MathieuGroupM24",
  "MathieuS",
  "MathieuSPrime",
  "MathMLForm",
  "MathMLText",
  "Matrices",
  "MatrixExp",
  "MatrixForm",
  "MatrixFunction",
  "MatrixLog",
  "MatrixNormalDistribution",
  "MatrixPlot",
  "MatrixPower",
  "MatrixPropertyDistribution",
  "MatrixQ",
  "MatrixRank",
  "MatrixTDistribution",
  "Max",
  "MaxBend",
  "MaxCellMeasure",
  "MaxColorDistance",
  "MaxDate",
  "MaxDetect",
  "MaxDisplayedChildren",
  "MaxDuration",
  "MaxExtraBandwidths",
  "MaxExtraConditions",
  "MaxFeatureDisplacement",
  "MaxFeatures",
  "MaxFilter",
  "MaximalBy",
  "Maximize",
  "MaxItems",
  "MaxIterations",
  "MaxLimit",
  "MaxMemoryUsed",
  "MaxMixtureKernels",
  "MaxOverlapFraction",
  "MaxPlotPoints",
  "MaxPoints",
  "MaxRecursion",
  "MaxStableDistribution",
  "MaxStepFraction",
  "MaxSteps",
  "MaxStepSize",
  "MaxTrainingRounds",
  "MaxValue",
  "MaxwellDistribution",
  "MaxWordGap",
  "McLaughlinGroupMcL",
  "Mean",
  "MeanAbsoluteLossLayer",
  "MeanAround",
  "MeanClusteringCoefficient",
  "MeanDegreeConnectivity",
  "MeanDeviation",
  "MeanFilter",
  "MeanGraphDistance",
  "MeanNeighborDegree",
  "MeanPointDensity",
  "MeanShift",
  "MeanShiftFilter",
  "MeanSquaredLossLayer",
  "Median",
  "MedianDeviation",
  "MedianFilter",
  "MedicalTestData",
  "Medium",
  "MeijerG",
  "MeijerGReduce",
  "MeixnerDistribution",
  "MellinConvolve",
  "MellinTransform",
  "MemberQ",
  "MemoryAvailable",
  "MemoryConstrained",
  "MemoryConstraint",
  "MemoryInUse",
  "MengerMesh",
  "Menu",
  "MenuAppearance",
  "MenuCommandKey",
  "MenuEvaluator",
  "MenuItem",
  "MenuList",
  "MenuPacket",
  "MenuSortingValue",
  "MenuStyle",
  "MenuView",
  "Merge",
  "MergeDifferences",
  "MergingFunction",
  "MersennePrimeExponent",
  "MersennePrimeExponentQ",
  "Mesh",
  "MeshCellCentroid",
  "MeshCellCount",
  "MeshCellHighlight",
  "MeshCellIndex",
  "MeshCellLabel",
  "MeshCellMarker",
  "MeshCellMeasure",
  "MeshCellQuality",
  "MeshCells",
  "MeshCellShapeFunction",
  "MeshCellStyle",
  "MeshConnectivityGraph",
  "MeshCoordinates",
  "MeshFunctions",
  "MeshPrimitives",
  "MeshQualityGoal",
  "MeshRange",
  "MeshRefinementFunction",
  "MeshRegion",
  "MeshRegionQ",
  "MeshShading",
  "MeshStyle",
  "Message",
  "MessageDialog",
  "MessageList",
  "MessageName",
  "MessageObject",
  "MessageOptions",
  "MessagePacket",
  "Messages",
  "MessagesNotebook",
  "MetaCharacters",
  "MetaInformation",
  "MeteorShowerData",
  "Method",
  "MethodOptions",
  "MexicanHatWavelet",
  "MeyerWavelet",
  "Midpoint",
  "MIMETypeToFormatList",
  "Min",
  "MinColorDistance",
  "MinDate",
  "MinDetect",
  "MineralData",
  "MinFilter",
  "MinimalBy",
  "MinimalPolynomial",
  "MinimalStateSpaceModel",
  "Minimize",
  "MinimumTimeIncrement",
  "MinIntervalSize",
  "MinkowskiQuestionMark",
  "MinLimit",
  "MinMax",
  "MinorPlanetData",
  "Minors",
  "MinPointSeparation",
  "MinRecursion",
  "MinSize",
  "MinStableDistribution",
  "Minus",
  "MinusPlus",
  "MinValue",
  "Missing",
  "MissingBehavior",
  "MissingDataMethod",
  "MissingDataRules",
  "MissingQ",
  "MissingString",
  "MissingStyle",
  "MissingValuePattern",
  "MissingValueSynthesis",
  "MittagLefflerE",
  "MixedFractionParts",
  "MixedGraphQ",
  "MixedMagnitude",
  "MixedRadix",
  "MixedRadixQuantity",
  "MixedUnit",
  "MixtureDistribution",
  "Mod",
  "Modal",
  "Mode",
  "ModelPredictiveController",
  "Modular",
  "ModularInverse",
  "ModularLambda",
  "Module",
  "Modulus",
  "MoebiusMu",
  "Molecule",
  "MoleculeAlign",
  "MoleculeContainsQ",
  "MoleculeDraw",
  "MoleculeEquivalentQ",
  "MoleculeFreeQ",
  "MoleculeGraph",
  "MoleculeMatchQ",
  "MoleculeMaximumCommonSubstructure",
  "MoleculeModify",
  "MoleculeName",
  "MoleculePattern",
  "MoleculePlot",
  "MoleculePlot3D",
  "MoleculeProperty",
  "MoleculeQ",
  "MoleculeRecognize",
  "MoleculeSubstructureCount",
  "MoleculeValue",
  "Moment",
  "MomentConvert",
  "MomentEvaluate",
  "MomentGeneratingFunction",
  "MomentOfInertia",
  "Monday",
  "Monitor",
  "MonomialList",
  "MonomialOrder",
  "MonsterGroupM",
  "MoonPhase",
  "MoonPosition",
  "MorletWavelet",
  "MorphologicalBinarize",
  "MorphologicalBranchPoints",
  "MorphologicalComponents",
  "MorphologicalEulerNumber",
  "MorphologicalGraph",
  "MorphologicalPerimeter",
  "MorphologicalTransform",
  "MortalityData",
  "Most",
  "MountainData",
  "MouseAnnotation",
  "MouseAppearance",
  "MouseAppearanceTag",
  "MouseButtons",
  "Mouseover",
  "MousePointerNote",
  "MousePosition",
  "MovieData",
  "MovingAverage",
  "MovingMap",
  "MovingMedian",
  "MoyalDistribution",
  "MultiaxisArrangement",
  "Multicolumn",
  "MultiedgeStyle",
  "MultigraphQ",
  "MultilaunchWarning",
  "MultiLetterItalics",
  "MultiLetterStyle",
  "MultilineFunction",
  "Multinomial",
  "MultinomialDistribution",
  "MultinormalDistribution",
  "MultiplicativeOrder",
  "Multiplicity",
  "MultiplySides",
  "MultiscriptBoxOptions",
  "Multiselection",
  "MultivariateHypergeometricDistribution",
  "MultivariatePoissonDistribution",
  "MultivariateTDistribution",
  "N",
  "NakagamiDistribution",
  "NameQ",
  "Names",
  "NamespaceBox",
  "NamespaceBoxOptions",
  "Nand",
  "NArgMax",
  "NArgMin",
  "NBernoulliB",
  "NBodySimulation",
  "NBodySimulationData",
  "NCache",
  "NCaputoD",
  "NDEigensystem",
  "NDEigenvalues",
  "NDSolve",
  "NDSolveValue",
  "Nearest",
  "NearestFunction",
  "NearestMeshCells",
  "NearestNeighborG",
  "NearestNeighborGraph",
  "NearestTo",
  "NebulaData",
  "NeedlemanWunschSimilarity",
  "Needs",
  "Negative",
  "NegativeBinomialDistribution",
  "NegativeDefiniteMatrixQ",
  "NegativeIntegers",
  "NegativelyOrientedPoints",
  "NegativeMultinomialDistribution",
  "NegativeRationals",
  "NegativeReals",
  "NegativeSemidefiniteMatrixQ",
  "NeighborhoodData",
  "NeighborhoodGraph",
  "Nest",
  "NestedGreaterGreater",
  "NestedLessLess",
  "NestedScriptRules",
  "NestGraph",
  "NestList",
  "NestTree",
  "NestWhile",
  "NestWhileList",
  "NetAppend",
  "NetArray",
  "NetArrayLayer",
  "NetBidirectionalOperator",
  "NetChain",
  "NetDecoder",
  "NetDelete",
  "NetDrop",
  "NetEncoder",
  "NetEvaluationMode",
  "NetExternalObject",
  "NetExtract",
  "NetFlatten",
  "NetFoldOperator",
  "NetGANOperator",
  "NetGraph",
  "NetInformation",
  "NetInitialize",
  "NetInsert",
  "NetInsertSharedArrays",
  "NetJoin",
  "NetMapOperator",
  "NetMapThreadOperator",
  "NetMeasurements",
  "NetModel",
  "NetNestOperator",
  "NetPairEmbeddingOperator",
  "NetPort",
  "NetPortGradient",
  "NetPrepend",
  "NetRename",
  "NetReplace",
  "NetReplacePart",
  "NetSharedArray",
  "NetStateObject",
  "NetTake",
  "NetTrain",
  "NetTrainResultsObject",
  "NetUnfold",
  "NetworkPacketCapture",
  "NetworkPacketRecording",
  "NetworkPacketRecordingDuring",
  "NetworkPacketTrace",
  "NeumannValue",
  "NevilleThetaC",
  "NevilleThetaD",
  "NevilleThetaN",
  "NevilleThetaS",
  "NewPrimitiveStyle",
  "NExpectation",
  "Next",
  "NextCell",
  "NextDate",
  "NextPrime",
  "NextScheduledTaskTime",
  "NeymanScottPointProcess",
  "NFractionalD",
  "NHoldAll",
  "NHoldFirst",
  "NHoldRest",
  "NicholsGridLines",
  "NicholsPlot",
  "NightHemisphere",
  "NIntegrate",
  "NMaximize",
  "NMaxValue",
  "NMinimize",
  "NMinValue",
  "NominalScale",
  "NominalVariables",
  "NonAssociative",
  "NoncentralBetaDistribution",
  "NoncentralChiSquareDistribution",
  "NoncentralFRatioDistribution",
  "NoncentralStudentTDistribution",
  "NonCommutativeMultiply",
  "NonConstants",
  "NondimensionalizationTransform",
  "None",
  "NoneTrue",
  "NonlinearModelFit",
  "NonlinearStateSpaceModel",
  "NonlocalMeansFilter",
  "NonNegative",
  "NonNegativeIntegers",
  "NonNegativeRationals",
  "NonNegativeReals",
  "NonPositive",
  "NonPositiveIntegers",
  "NonPositiveRationals",
  "NonPositiveReals",
  "Nor",
  "NorlundB",
  "Norm",
  "Normal",
  "NormalDistribution",
  "NormalGrouping",
  "NormalizationLayer",
  "Normalize",
  "Normalized",
  "NormalizedSquaredEuclideanDistance",
  "NormalMatrixQ",
  "NormalsFunction",
  "NormFunction",
  "Not",
  "NotCongruent",
  "NotCupCap",
  "NotDoubleVerticalBar",
  "Notebook",
  "NotebookApply",
  "NotebookAutoSave",
  "NotebookBrowseDirectory",
  "NotebookClose",
  "NotebookConvertSettings",
  "NotebookCreate",
  "NotebookDefault",
  "NotebookDelete",
  "NotebookDirectory",
  "NotebookDynamicExpression",
  "NotebookEvaluate",
  "NotebookEventActions",
  "NotebookFileName",
  "NotebookFind",
  "NotebookGet",
  "NotebookImport",
  "NotebookInformation",
  "NotebookInterfaceObject",
  "NotebookLocate",
  "NotebookObject",
  "NotebookOpen",
  "NotebookPath",
  "NotebookPrint",
  "NotebookPut",
  "NotebookRead",
  "Notebooks",
  "NotebookSave",
  "NotebookSelection",
  "NotebooksMenu",
  "NotebookTemplate",
  "NotebookWrite",
  "NotElement",
  "NotEqualTilde",
  "NotExists",
  "NotGreater",
  "NotGreaterEqual",
  "NotGreaterFullEqual",
  "NotGreaterGreater",
  "NotGreaterLess",
  "NotGreaterSlantEqual",
  "NotGreaterTilde",
  "Nothing",
  "NotHumpDownHump",
  "NotHumpEqual",
  "NotificationFunction",
  "NotLeftTriangle",
  "NotLeftTriangleBar",
  "NotLeftTriangleEqual",
  "NotLess",
  "NotLessEqual",
  "NotLessFullEqual",
  "NotLessGreater",
  "NotLessLess",
  "NotLessSlantEqual",
  "NotLessTilde",
  "NotNestedGreaterGreater",
  "NotNestedLessLess",
  "NotPrecedes",
  "NotPrecedesEqual",
  "NotPrecedesSlantEqual",
  "NotPrecedesTilde",
  "NotReverseElement",
  "NotRightTriangle",
  "NotRightTriangleBar",
  "NotRightTriangleEqual",
  "NotSquareSubset",
  "NotSquareSubsetEqual",
  "NotSquareSuperset",
  "NotSquareSupersetEqual",
  "NotSubset",
  "NotSubsetEqual",
  "NotSucceeds",
  "NotSucceedsEqual",
  "NotSucceedsSlantEqual",
  "NotSucceedsTilde",
  "NotSuperset",
  "NotSupersetEqual",
  "NotTilde",
  "NotTildeEqual",
  "NotTildeFullEqual",
  "NotTildeTilde",
  "NotVerticalBar",
  "Now",
  "NoWhitespace",
  "NProbability",
  "NProduct",
  "NProductFactors",
  "NRoots",
  "NSolve",
  "NSolveValues",
  "NSum",
  "NSumTerms",
  "NuclearExplosionData",
  "NuclearReactorData",
  "Null",
  "NullRecords",
  "NullSpace",
  "NullWords",
  "Number",
  "NumberCompose",
  "NumberDecompose",
  "NumberDigit",
  "NumberExpand",
  "NumberFieldClassNumber",
  "NumberFieldDiscriminant",
  "NumberFieldFundamentalUnits",
  "NumberFieldIntegralBasis",
  "NumberFieldNormRepresentatives",
  "NumberFieldRegulator",
  "NumberFieldRootsOfUnity",
  "NumberFieldSignature",
  "NumberForm",
  "NumberFormat",
  "NumberLinePlot",
  "NumberMarks",
  "NumberMultiplier",
  "NumberPadding",
  "NumberPoint",
  "NumberQ",
  "NumberSeparator",
  "NumberSigns",
  "NumberString",
  "Numerator",
  "NumeratorDenominator",
  "NumericalOrder",
  "NumericalSort",
  "NumericArray",
  "NumericArrayQ",
  "NumericArrayType",
  "NumericFunction",
  "NumericQ",
  "NuttallWindow",
  "NValues",
  "NyquistGridLines",
  "NyquistPlot",
  "O",
  "ObjectExistsQ",
  "ObservabilityGramian",
  "ObservabilityMatrix",
  "ObservableDecomposition",
  "ObservableModelQ",
  "OceanData",
  "Octahedron",
  "OddQ",
  "Off",
  "Offset",
  "OLEData",
  "On",
  "ONanGroupON",
  "Once",
  "OneIdentity",
  "Opacity",
  "OpacityFunction",
  "OpacityFunctionScaling",
  "Open",
  "OpenAppend",
  "Opener",
  "OpenerBox",
  "OpenerBoxOptions",
  "OpenerView",
  "OpenFunctionInspectorPacket",
  "Opening",
  "OpenRead",
  "OpenSpecialOptions",
  "OpenTemporary",
  "OpenWrite",
  "Operate",
  "OperatingSystem",
  "OperatorApplied",
  "OptimumFlowData",
  "Optional",
  "OptionalElement",
  "OptionInspectorSettings",
  "OptionQ",
  "Options",
  "OptionsPacket",
  "OptionsPattern",
  "OptionValue",
  "OptionValueBox",
  "OptionValueBoxOptions",
  "Or",
  "Orange",
  "Order",
  "OrderDistribution",
  "OrderedQ",
  "Ordering",
  "OrderingBy",
  "OrderingLayer",
  "Orderless",
  "OrderlessPatternSequence",
  "OrdinalScale",
  "OrnsteinUhlenbeckProcess",
  "Orthogonalize",
  "OrthogonalMatrixQ",
  "Out",
  "Outer",
  "OuterPolygon",
  "OuterPolyhedron",
  "OutputAutoOverwrite",
  "OutputControllabilityMatrix",
  "OutputControllableModelQ",
  "OutputForm",
  "OutputFormData",
  "OutputGrouping",
  "OutputMathEditExpression",
  "OutputNamePacket",
  "OutputPorts",
  "OutputResponse",
  "OutputSizeLimit",
  "OutputStream",
  "Over",
  "OverBar",
  "OverDot",
  "Overflow",
  "OverHat",
  "Overlaps",
  "Overlay",
  "OverlayBox",
  "OverlayBoxOptions",
  "OverlayVideo",
  "Overscript",
  "OverscriptBox",
  "OverscriptBoxOptions",
  "OverTilde",
  "OverVector",
  "OverwriteTarget",
  "OwenT",
  "OwnValues",
  "Package",
  "PackingMethod",
  "PackPaclet",
  "PacletDataRebuild",
  "PacletDirectoryAdd",
  "PacletDirectoryLoad",
  "PacletDirectoryRemove",
  "PacletDirectoryUnload",
  "PacletDisable",
  "PacletEnable",
  "PacletFind",
  "PacletFindRemote",
  "PacletInformation",
  "PacletInstall",
  "PacletInstallSubmit",
  "PacletNewerQ",
  "PacletObject",
  "PacletObjectQ",
  "PacletSite",
  "PacletSiteObject",
  "PacletSiteRegister",
  "PacletSites",
  "PacletSiteUnregister",
  "PacletSiteUpdate",
  "PacletSymbol",
  "PacletUninstall",
  "PacletUpdate",
  "PaddedForm",
  "Padding",
  "PaddingLayer",
  "PaddingSize",
  "PadeApproximant",
  "PadLeft",
  "PadRight",
  "PageBreakAbove",
  "PageBreakBelow",
  "PageBreakWithin",
  "PageFooterLines",
  "PageFooters",
  "PageHeaderLines",
  "PageHeaders",
  "PageHeight",
  "PageRankCentrality",
  "PageTheme",
  "PageWidth",
  "Pagination",
  "PairCorrelationG",
  "PairedBarChart",
  "PairedHistogram",
  "PairedSmoothHistogram",
  "PairedTTest",
  "PairedZTest",
  "PaletteNotebook",
  "PalettePath",
  "PalettesMenuSettings",
  "PalindromeQ",
  "Pane",
  "PaneBox",
  "PaneBoxOptions",
  "Panel",
  "PanelBox",
  "PanelBoxOptions",
  "Paneled",
  "PaneSelector",
  "PaneSelectorBox",
  "PaneSelectorBoxOptions",
  "PaperWidth",
  "ParabolicCylinderD",
  "ParagraphIndent",
  "ParagraphSpacing",
  "ParallelArray",
  "ParallelAxisPlot",
  "ParallelCombine",
  "ParallelDo",
  "Parallelepiped",
  "ParallelEvaluate",
  "Parallelization",
  "Parallelize",
  "ParallelKernels",
  "ParallelMap",
  "ParallelNeeds",
  "Parallelogram",
  "ParallelProduct",
  "ParallelSubmit",
  "ParallelSum",
  "ParallelTable",
  "ParallelTry",
  "Parameter",
  "ParameterEstimator",
  "ParameterMixtureDistribution",
  "ParameterVariables",
  "ParametricConvexOptimization",
  "ParametricFunction",
  "ParametricNDSolve",
  "ParametricNDSolveValue",
  "ParametricPlot",
  "ParametricPlot3D",
  "ParametricRampLayer",
  "ParametricRegion",
  "ParentBox",
  "ParentCell",
  "ParentConnect",
  "ParentDirectory",
  "ParentEdgeLabel",
  "ParentEdgeLabelFunction",
  "ParentEdgeLabelStyle",
  "ParentEdgeShapeFunction",
  "ParentEdgeStyle",
  "ParentEdgeStyleFunction",
  "ParentForm",
  "Parenthesize",
  "ParentList",
  "ParentNotebook",
  "ParetoDistribution",
  "ParetoPickandsDistribution",
  "ParkData",
  "Part",
  "PartBehavior",
  "PartialCorrelationFunction",
  "PartialD",
  "ParticleAcceleratorData",
  "ParticleData",
  "Partition",
  "PartitionGranularity",
  "PartitionsP",
  "PartitionsQ",
  "PartLayer",
  "PartOfSpeech",
  "PartProtection",
  "ParzenWindow",
  "PascalDistribution",
  "PassEventsDown",
  "PassEventsUp",
  "Paste",
  "PasteAutoQuoteCharacters",
  "PasteBoxFormInlineCells",
  "PasteButton",
  "Path",
  "PathGraph",
  "PathGraphQ",
  "Pattern",
  "PatternFilling",
  "PatternReaction",
  "PatternSequence",
  "PatternTest",
  "PauliMatrix",
  "PaulWavelet",
  "Pause",
  "PausedTime",
  "PDF",
  "PeakDetect",
  "PeanoCurve",
  "PearsonChiSquareTest",
  "PearsonCorrelationTest",
  "PearsonDistribution",
  "PenttinenPointProcess",
  "PercentForm",
  "PerfectNumber",
  "PerfectNumberQ",
  "PerformanceGoal",
  "Perimeter",
  "PeriodicBoundaryCondition",
  "PeriodicInterpolation",
  "Periodogram",
  "PeriodogramArray",
  "Permanent",
  "Permissions",
  "PermissionsGroup",
  "PermissionsGroupMemberQ",
  "PermissionsGroups",
  "PermissionsKey",
  "PermissionsKeys",
  "PermutationCycles",
  "PermutationCyclesQ",
  "PermutationGroup",
  "PermutationLength",
  "PermutationList",
  "PermutationListQ",
  "PermutationMatrix",
  "PermutationMax",
  "PermutationMin",
  "PermutationOrder",
  "PermutationPower",
  "PermutationProduct",
  "PermutationReplace",
  "Permutations",
  "PermutationSupport",
  "Permute",
  "PeronaMalikFilter",
  "Perpendicular",
  "PerpendicularBisector",
  "PersistenceLocation",
  "PersistenceTime",
  "PersistentObject",
  "PersistentObjects",
  "PersistentSymbol",
  "PersistentValue",
  "PersonData",
  "PERTDistribution",
  "PetersenGraph",
  "PhaseMargins",
  "PhaseRange",
  "PhongShading",
  "PhysicalSystemData",
  "Pi",
  "Pick",
  "PickedElements",
  "PickMode",
  "PIDData",
  "PIDDerivativeFilter",
  "PIDFeedforward",
  "PIDTune",
  "Piecewise",
  "PiecewiseExpand",
  "PieChart",
  "PieChart3D",
  "PillaiTrace",
  "PillaiTraceTest",
  "PingTime",
  "Pink",
  "PitchRecognize",
  "Pivoting",
  "PixelConstrained",
  "PixelValue",
  "PixelValuePositions",
  "Placed",
  "Placeholder",
  "PlaceholderLayer",
  "PlaceholderReplace",
  "Plain",
  "PlanarAngle",
  "PlanarFaceList",
  "PlanarGraph",
  "PlanarGraphQ",
  "PlanckRadiationLaw",
  "PlaneCurveData",
  "PlanetaryMoonData",
  "PlanetData",
  "PlantData",
  "Play",
  "PlaybackSettings",
  "PlayRange",
  "Plot",
  "Plot3D",
  "Plot3Matrix",
  "PlotDivision",
  "PlotJoined",
  "PlotLabel",
  "PlotLabels",
  "PlotLayout",
  "PlotLegends",
  "PlotMarkers",
  "PlotPoints",
  "PlotRange",
  "PlotRangeClipping",
  "PlotRangeClipPlanesStyle",
  "PlotRangePadding",
  "PlotRegion",
  "PlotStyle",
  "PlotTheme",
  "Pluralize",
  "Plus",
  "PlusMinus",
  "Pochhammer",
  "PodStates",
  "PodWidth",
  "Point",
  "Point3DBox",
  "Point3DBoxOptions",
  "PointBox",
  "PointBoxOptions",
  "PointCountDistribution",
  "PointDensity",
  "PointDensityFunction",
  "PointFigureChart",
  "PointLegend",
  "PointLight",
  "PointProcessEstimator",
  "PointProcessFitTest",
  "PointProcessParameterAssumptions",
  "PointProcessParameterQ",
  "PointSize",
  "PointStatisticFunction",
  "PointValuePlot",
  "PoissonConsulDistribution",
  "PoissonDistribution",
  "PoissonPDEComponent",
  "PoissonPointProcess",
  "PoissonProcess",
  "PoissonWindow",
  "PolarAxes",
  "PolarAxesOrigin",
  "PolarGridLines",
  "PolarPlot",
  "PolarTicks",
  "PoleZeroMarkers",
  "PolyaAeppliDistribution",
  "PolyGamma",
  "Polygon",
  "Polygon3DBox",
  "Polygon3DBoxOptions",
  "PolygonalNumber",
  "PolygonAngle",
  "PolygonBox",
  "PolygonBoxOptions",
  "PolygonCoordinates",
  "PolygonDecomposition",
  "PolygonHoleScale",
  "PolygonIntersections",
  "PolygonScale",
  "Polyhedron",
  "PolyhedronAngle",
  "PolyhedronBox",
  "PolyhedronBoxOptions",
  "PolyhedronCoordinates",
  "PolyhedronData",
  "PolyhedronDecomposition",
  "PolyhedronGenus",
  "PolyLog",
  "PolynomialExpressionQ",
  "PolynomialExtendedGCD",
  "PolynomialForm",
  "PolynomialGCD",
  "PolynomialLCM",
  "PolynomialMod",
  "PolynomialQ",
  "PolynomialQuotient",
  "PolynomialQuotientRemainder",
  "PolynomialReduce",
  "PolynomialRemainder",
  "Polynomials",
  "PolynomialSumOfSquaresList",
  "PoolingLayer",
  "PopupMenu",
  "PopupMenuBox",
  "PopupMenuBoxOptions",
  "PopupView",
  "PopupWindow",
  "Position",
  "PositionIndex",
  "PositionLargest",
  "PositionSmallest",
  "Positive",
  "PositiveDefiniteMatrixQ",
  "PositiveIntegers",
  "PositivelyOrientedPoints",
  "PositiveRationals",
  "PositiveReals",
  "PositiveSemidefiniteMatrixQ",
  "PossibleZeroQ",
  "Postfix",
  "PostScript",
  "Power",
  "PowerDistribution",
  "PowerExpand",
  "PowerMod",
  "PowerModList",
  "PowerRange",
  "PowerSpectralDensity",
  "PowersRepresentations",
  "PowerSymmetricPolynomial",
  "Precedence",
  "PrecedenceForm",
  "Precedes",
  "PrecedesEqual",
  "PrecedesSlantEqual",
  "PrecedesTilde",
  "Precision",
  "PrecisionGoal",
  "PreDecrement",
  "Predict",
  "PredictionRoot",
  "PredictorFunction",
  "PredictorInformation",
  "PredictorMeasurements",
  "PredictorMeasurementsObject",
  "PreemptProtect",
  "PreferencesPath",
  "PreferencesSettings",
  "Prefix",
  "PreIncrement",
  "Prepend",
  "PrependLayer",
  "PrependTo",
  "PreprocessingRules",
  "PreserveColor",
  "PreserveImageOptions",
  "Previous",
  "PreviousCell",
  "PreviousDate",
  "PriceGraphDistribution",
  "PrimaryPlaceholder",
  "Prime",
  "PrimeNu",
  "PrimeOmega",
  "PrimePi",
  "PrimePowerQ",
  "PrimeQ",
  "Primes",
  "PrimeZetaP",
  "PrimitivePolynomialQ",
  "PrimitiveRoot",
  "PrimitiveRootList",
  "PrincipalComponents",
  "PrincipalValue",
  "Print",
  "PrintableASCIIQ",
  "PrintAction",
  "PrintForm",
  "PrintingCopies",
  "PrintingOptions",
  "PrintingPageRange",
  "PrintingStartingPageNumber",
  "PrintingStyleEnvironment",
  "Printout3D",
  "Printout3DPreviewer",
  "PrintPrecision",
  "PrintTemporary",
  "Prism",
  "PrismBox",
  "PrismBoxOptions",
  "PrivateCellOptions",
  "PrivateEvaluationOptions",
  "PrivateFontOptions",
  "PrivateFrontEndOptions",
  "PrivateKey",
  "PrivateNotebookOptions",
  "PrivatePaths",
  "Probability",
  "ProbabilityDistribution",
  "ProbabilityPlot",
  "ProbabilityPr",
  "ProbabilityScalePlot",
  "ProbitModelFit",
  "ProcessConnection",
  "ProcessDirectory",
  "ProcessEnvironment",
  "Processes",
  "ProcessEstimator",
  "ProcessInformation",
  "ProcessObject",
  "ProcessParameterAssumptions",
  "ProcessParameterQ",
  "ProcessStateDomain",
  "ProcessStatus",
  "ProcessTimeDomain",
  "Product",
  "ProductDistribution",
  "ProductLog",
  "ProgressIndicator",
  "ProgressIndicatorBox",
  "ProgressIndicatorBoxOptions",
  "ProgressReporting",
  "Projection",
  "Prolog",
  "PromptForm",
  "ProofObject",
  "PropagateAborts",
  "Properties",
  "Property",
  "PropertyList",
  "PropertyValue",
  "Proportion",
  "Proportional",
  "Protect",
  "Protected",
  "ProteinData",
  "Pruning",
  "PseudoInverse",
  "PsychrometricPropertyData",
  "PublicKey",
  "PublisherID",
  "PulsarData",
  "PunctuationCharacter",
  "Purple",
  "Put",
  "PutAppend",
  "Pyramid",
  "PyramidBox",
  "PyramidBoxOptions",
  "QBinomial",
  "QFactorial",
  "QGamma",
  "QHypergeometricPFQ",
  "QnDispersion",
  "QPochhammer",
  "QPolyGamma",
  "QRDecomposition",
  "QuadraticIrrationalQ",
  "QuadraticOptimization",
  "Quantile",
  "QuantilePlot",
  "Quantity",
  "QuantityArray",
  "QuantityDistribution",
  "QuantityForm",
  "QuantityMagnitude",
  "QuantityQ",
  "QuantityUnit",
  "QuantityVariable",
  "QuantityVariableCanonicalUnit",
  "QuantityVariableDimensions",
  "QuantityVariableIdentifier",
  "QuantityVariablePhysicalQuantity",
  "Quartics",
  "QuartileDeviation",
  "Quartiles",
  "QuartileSkewness",
  "Query",
  "QuestionGenerator",
  "QuestionInterface",
  "QuestionObject",
  "QuestionSelector",
  "QueueingNetworkProcess",
  "QueueingProcess",
  "QueueProperties",
  "Quiet",
  "QuietEcho",
  "Quit",
  "Quotient",
  "QuotientRemainder",
  "RadialAxisPlot",
  "RadialGradientFilling",
  "RadialGradientImage",
  "RadialityCentrality",
  "RadicalBox",
  "RadicalBoxOptions",
  "RadioButton",
  "RadioButtonBar",
  "RadioButtonBox",
  "RadioButtonBoxOptions",
  "Radon",
  "RadonTransform",
  "RamanujanTau",
  "RamanujanTauL",
  "RamanujanTauTheta",
  "RamanujanTauZ",
  "Ramp",
  "Random",
  "RandomArrayLayer",
  "RandomChoice",
  "RandomColor",
  "RandomComplex",
  "RandomDate",
  "RandomEntity",
  "RandomFunction",
  "RandomGeneratorState",
  "RandomGeoPosition",
  "RandomGraph",
  "RandomImage",
  "RandomInstance",
  "RandomInteger",
  "RandomPermutation",
  "RandomPoint",
  "RandomPointConfiguration",
  "RandomPolygon",
  "RandomPolyhedron",
  "RandomPrime",
  "RandomReal",
  "RandomSample",
  "RandomSeed",
  "RandomSeeding",
  "RandomTime",
  "RandomTree",
  "RandomVariate",
  "RandomWalkProcess",
  "RandomWord",
  "Range",
  "RangeFilter",
  "RangeSpecification",
  "RankedMax",
  "RankedMin",
  "RarerProbability",
  "Raster",
  "Raster3D",
  "Raster3DBox",
  "Raster3DBoxOptions",
  "RasterArray",
  "RasterBox",
  "RasterBoxOptions",
  "Rasterize",
  "RasterSize",
  "Rational",
  "RationalExpressionQ",
  "RationalFunctions",
  "Rationalize",
  "Rationals",
  "Ratios",
  "RawArray",
  "RawBoxes",
  "RawData",
  "RawMedium",
  "RayleighDistribution",
  "Re",
  "ReactionBalance",
  "ReactionBalancedQ",
  "ReactionPDETerm",
  "Read",
  "ReadByteArray",
  "ReadLine",
  "ReadList",
  "ReadProtected",
  "ReadString",
  "Real",
  "RealAbs",
  "RealBlockDiagonalForm",
  "RealDigits",
  "RealExponent",
  "Reals",
  "RealSign",
  "Reap",
  "RebuildPacletData",
  "RecalibrationFunction",
  "RecognitionPrior",
  "RecognitionThreshold",
  "ReconstructionMesh",
  "Record",
  "RecordLists",
  "RecordSeparators",
  "Rectangle",
  "RectangleBox",
  "RectangleBoxOptions",
  "RectangleChart",
  "RectangleChart3D",
  "RectangularRepeatingElement",
  "RecurrenceFilter",
  "RecurrenceTable",
  "RecurringDigitsForm",
  "Red",
  "Reduce",
  "RefBox",
  "ReferenceLineStyle",
  "ReferenceMarkers",
  "ReferenceMarkerStyle",
  "Refine",
  "ReflectionMatrix",
  "ReflectionTransform",
  "Refresh",
  "RefreshRate",
  "Region",
  "RegionBinarize",
  "RegionBoundary",
  "RegionBoundaryStyle",
  "RegionBounds",
  "RegionCentroid",
  "RegionCongruent",
  "RegionConvert",
  "RegionDifference",
  "RegionDilation",
  "RegionDimension",
  "RegionDisjoint",
  "RegionDistance",
  "RegionDistanceFunction",
  "RegionEmbeddingDimension",
  "RegionEqual",
  "RegionErosion",
  "RegionFillingStyle",
  "RegionFit",
  "RegionFunction",
  "RegionImage",
  "RegionIntersection",
  "RegionMeasure",
  "RegionMember",
  "RegionMemberFunction",
  "RegionMoment",
  "RegionNearest",
  "RegionNearestFunction",
  "RegionPlot",
  "RegionPlot3D",
  "RegionProduct",
  "RegionQ",
  "RegionResize",
  "RegionSimilar",
  "RegionSize",
  "RegionSymmetricDifference",
  "RegionUnion",
  "RegionWithin",
  "RegisterExternalEvaluator",
  "RegularExpression",
  "Regularization",
  "RegularlySampledQ",
  "RegularPolygon",
  "ReIm",
  "ReImLabels",
  "ReImPlot",
  "ReImStyle",
  "Reinstall",
  "RelationalDatabase",
  "RelationGraph",
  "Release",
  "ReleaseHold",
  "ReliabilityDistribution",
  "ReliefImage",
  "ReliefPlot",
  "RemoteAuthorizationCaching",
  "RemoteBatchJobAbort",
  "RemoteBatchJobObject",
  "RemoteBatchJobs",
  "RemoteBatchMapSubmit",
  "RemoteBatchSubmissionEnvironment",
  "RemoteBatchSubmit",
  "RemoteConnect",
  "RemoteConnectionObject",
  "RemoteEvaluate",
  "RemoteFile",
  "RemoteInputFiles",
  "RemoteKernelObject",
  "RemoteProviderSettings",
  "RemoteRun",
  "RemoteRunProcess",
  "RemovalConditions",
  "Remove",
  "RemoveAlphaChannel",
  "RemoveAsynchronousTask",
  "RemoveAudioStream",
  "RemoveBackground",
  "RemoveChannelListener",
  "RemoveChannelSubscribers",
  "Removed",
  "RemoveDiacritics",
  "RemoveInputStreamMethod",
  "RemoveOutputStreamMethod",
  "RemoveProperty",
  "RemoveScheduledTask",
  "RemoveUsers",
  "RemoveVideoStream",
  "RenameDirectory",
  "RenameFile",
  "RenderAll",
  "RenderingOptions",
  "RenewalProcess",
  "RenkoChart",
  "RepairMesh",
  "Repeated",
  "RepeatedNull",
  "RepeatedString",
  "RepeatedTiming",
  "RepeatingElement",
  "Replace",
  "ReplaceAll",
  "ReplaceAt",
  "ReplaceHeldPart",
  "ReplaceImageValue",
  "ReplaceList",
  "ReplacePart",
  "ReplacePixelValue",
  "ReplaceRepeated",
  "ReplicateLayer",
  "RequiredPhysicalQuantities",
  "Resampling",
  "ResamplingAlgorithmData",
  "ResamplingMethod",
  "Rescale",
  "RescalingTransform",
  "ResetDirectory",
  "ResetScheduledTask",
  "ReshapeLayer",
  "Residue",
  "ResidueSum",
  "ResizeLayer",
  "Resolve",
  "ResolveContextAliases",
  "ResourceAcquire",
  "ResourceData",
  "ResourceFunction",
  "ResourceObject",
  "ResourceRegister",
  "ResourceRemove",
  "ResourceSearch",
  "ResourceSubmissionObject",
  "ResourceSubmit",
  "ResourceSystemBase",
  "ResourceSystemPath",
  "ResourceUpdate",
  "ResourceVersion",
  "ResponseForm",
  "Rest",
  "RestartInterval",
  "Restricted",
  "Resultant",
  "ResumePacket",
  "Return",
  "ReturnCreatesNewCell",
  "ReturnEntersInput",
  "ReturnExpressionPacket",
  "ReturnInputFormPacket",
  "ReturnPacket",
  "ReturnReceiptFunction",
  "ReturnTextPacket",
  "Reverse",
  "ReverseApplied",
  "ReverseBiorthogonalSplineWavelet",
  "ReverseElement",
  "ReverseEquilibrium",
  "ReverseGraph",
  "ReverseSort",
  "ReverseSortBy",
  "ReverseUpEquilibrium",
  "RevolutionAxis",
  "RevolutionPlot3D",
  "RGBColor",
  "RiccatiSolve",
  "RiceDistribution",
  "RidgeFilter",
  "RiemannR",
  "RiemannSiegelTheta",
  "RiemannSiegelZ",
  "RiemannXi",
  "Riffle",
  "Right",
  "RightArrow",
  "RightArrowBar",
  "RightArrowLeftArrow",
  "RightComposition",
  "RightCosetRepresentative",
  "RightDownTeeVector",
  "RightDownVector",
  "RightDownVectorBar",
  "RightTee",
  "RightTeeArrow",
  "RightTeeVector",
  "RightTriangle",
  "RightTriangleBar",
  "RightTriangleEqual",
  "RightUpDownVector",
  "RightUpTeeVector",
  "RightUpVector",
  "RightUpVectorBar",
  "RightVector",
  "RightVectorBar",
  "RipleyK",
  "RipleyRassonRegion",
  "RiskAchievementImportance",
  "RiskReductionImportance",
  "RobustConvexOptimization",
  "RogersTanimotoDissimilarity",
  "RollPitchYawAngles",
  "RollPitchYawMatrix",
  "RomanNumeral",
  "Root",
  "RootApproximant",
  "RootIntervals",
  "RootLocusPlot",
  "RootMeanSquare",
  "RootOfUnityQ",
  "RootReduce",
  "Roots",
  "RootSum",
  "RootTree",
  "Rotate",
  "RotateLabel",
  "RotateLeft",
  "RotateRight",
  "RotationAction",
  "RotationBox",
  "RotationBoxOptions",
  "RotationMatrix",
  "RotationTransform",
  "Round",
  "RoundImplies",
  "RoundingRadius",
  "Row",
  "RowAlignments",
  "RowBackgrounds",
  "RowBox",
  "RowHeights",
  "RowLines",
  "RowMinHeight",
  "RowReduce",
  "RowsEqual",
  "RowSpacings",
  "RSolve",
  "RSolveValue",
  "RudinShapiro",
  "RudvalisGroupRu",
  "Rule",
  "RuleCondition",
  "RuleDelayed",
  "RuleForm",
  "RulePlot",
  "RulerUnits",
  "RulesTree",
  "Run",
  "RunProcess",
  "RunScheduledTask",
  "RunThrough",
  "RuntimeAttributes",
  "RuntimeOptions",
  "RussellRaoDissimilarity",
  "SameAs",
  "SameQ",
  "SameTest",
  "SameTestProperties",
  "SampledEntityClass",
  "SampleDepth",
  "SampledSoundFunction",
  "SampledSoundList",
  "SampleRate",
  "SamplingPeriod",
  "SARIMAProcess",
  "SARMAProcess",
  "SASTriangle",
  "SatelliteData",
  "SatisfiabilityCount",
  "SatisfiabilityInstances",
  "SatisfiableQ",
  "Saturday",
  "Save",
  "Saveable",
  "SaveAutoDelete",
  "SaveConnection",
  "SaveDefinitions",
  "SavitzkyGolayMatrix",
  "SawtoothWave",
  "Scale",
  "Scaled",
  "ScaleDivisions",
  "ScaledMousePosition",
  "ScaleOrigin",
  "ScalePadding",
  "ScaleRanges",
  "ScaleRangeStyle",
  "ScalingFunctions",
  "ScalingMatrix",
  "ScalingTransform",
  "Scan",
  "ScheduledTask",
  "ScheduledTaskActiveQ",
  "ScheduledTaskInformation",
  "ScheduledTaskInformationData",
  "ScheduledTaskObject",
  "ScheduledTasks",
  "SchurDecomposition",
  "ScientificForm",
  "ScientificNotationThreshold",
  "ScorerGi",
  "ScorerGiPrime",
  "ScorerHi",
  "ScorerHiPrime",
  "ScreenRectangle",
  "ScreenStyleEnvironment",
  "ScriptBaselineShifts",
  "ScriptForm",
  "ScriptLevel",
  "ScriptMinSize",
  "ScriptRules",
  "ScriptSizeMultipliers",
  "Scrollbars",
  "ScrollingOptions",
  "ScrollPosition",
  "SearchAdjustment",
  "SearchIndexObject",
  "SearchIndices",
  "SearchQueryString",
  "SearchResultObject",
  "Sec",
  "Sech",
  "SechDistribution",
  "SecondOrderConeOptimization",
  "SectionGrouping",
  "SectorChart",
  "SectorChart3D",
  "SectorOrigin",
  "SectorSpacing",
  "SecuredAuthenticationKey",
  "SecuredAuthenticationKeys",
  "SecurityCertificate",
  "SeedRandom",
  "Select",
  "Selectable",
  "SelectComponents",
  "SelectedCells",
  "SelectedNotebook",
  "SelectFirst",
  "Selection",
  "SelectionAnimate",
  "SelectionCell",
  "SelectionCellCreateCell",
  "SelectionCellDefaultStyle",
  "SelectionCellParentStyle",
  "SelectionCreateCell",
  "SelectionDebuggerTag",
  "SelectionEvaluate",
  "SelectionEvaluateCreateCell",
  "SelectionMove",
  "SelectionPlaceholder",
  "SelectWithContents",
  "SelfLoops",
  "SelfLoopStyle",
  "SemanticImport",
  "SemanticImportString",
  "SemanticInterpretation",
  "SemialgebraicComponentInstances",
  "SemidefiniteOptimization",
  "SendMail",
  "SendMessage",
  "Sequence",
  "SequenceAlignment",
  "SequenceAttentionLayer",
  "SequenceCases",
  "SequenceCount",
  "SequenceFold",
  "SequenceFoldList",
  "SequenceForm",
  "SequenceHold",
  "SequenceIndicesLayer",
  "SequenceLastLayer",
  "SequenceMostLayer",
  "SequencePosition",
  "SequencePredict",
  "SequencePredictorFunction",
  "SequenceReplace",
  "SequenceRestLayer",
  "SequenceReverseLayer",
  "SequenceSplit",
  "Series",
  "SeriesCoefficient",
  "SeriesData",
  "SeriesTermGoal",
  "ServiceConnect",
  "ServiceDisconnect",
  "ServiceExecute",
  "ServiceObject",
  "ServiceRequest",
  "ServiceResponse",
  "ServiceSubmit",
  "SessionSubmit",
  "SessionTime",
  "Set",
  "SetAccuracy",
  "SetAlphaChannel",
  "SetAttributes",
  "Setbacks",
  "SetCloudDirectory",
  "SetCookies",
  "SetDelayed",
  "SetDirectory",
  "SetEnvironment",
  "SetFileDate",
  "SetFileFormatProperties",
  "SetOptions",
  "SetOptionsPacket",
  "SetPermissions",
  "SetPrecision",
  "SetProperty",
  "SetSecuredAuthenticationKey",
  "SetSelectedNotebook",
  "SetSharedFunction",
  "SetSharedVariable",
  "SetStreamPosition",
  "SetSystemModel",
  "SetSystemOptions",
  "Setter",
  "SetterBar",
  "SetterBox",
  "SetterBoxOptions",
  "Setting",
  "SetUsers",
  "Shading",
  "Shallow",
  "ShannonWavelet",
  "ShapiroWilkTest",
  "Share",
  "SharingList",
  "Sharpen",
  "ShearingMatrix",
  "ShearingTransform",
  "ShellRegion",
  "ShenCastanMatrix",
  "ShiftedGompertzDistribution",
  "ShiftRegisterSequence",
  "Short",
  "ShortDownArrow",
  "Shortest",
  "ShortestMatch",
  "ShortestPathFunction",
  "ShortLeftArrow",
  "ShortRightArrow",
  "ShortTimeFourier",
  "ShortTimeFourierData",
  "ShortUpArrow",
  "Show",
  "ShowAutoConvert",
  "ShowAutoSpellCheck",
  "ShowAutoStyles",
  "ShowCellBracket",
  "ShowCellLabel",
  "ShowCellTags",
  "ShowClosedCellArea",
  "ShowCodeAssist",
  "ShowContents",
  "ShowControls",
  "ShowCursorTracker",
  "ShowGroupOpenCloseIcon",
  "ShowGroupOpener",
  "ShowInvisibleCharacters",
  "ShowPageBreaks",
  "ShowPredictiveInterface",
  "ShowSelection",
  "ShowShortBoxForm",
  "ShowSpecialCharacters",
  "ShowStringCharacters",
  "ShowSyntaxStyles",
  "ShrinkingDelay",
  "ShrinkWrapBoundingBox",
  "SiderealTime",
  "SiegelTheta",
  "SiegelTukeyTest",
  "SierpinskiCurve",
  "SierpinskiMesh",
  "Sign",
  "Signature",
  "SignedRankTest",
  "SignedRegionDistance",
  "SignificanceLevel",
  "SignPadding",
  "SignTest",
  "SimilarityRules",
  "SimpleGraph",
  "SimpleGraphQ",
  "SimplePolygonQ",
  "SimplePolyhedronQ",
  "Simplex",
  "Simplify",
  "Sin",
  "Sinc",
  "SinghMaddalaDistribution",
  "SingleEvaluation",
  "SingleLetterItalics",
  "SingleLetterStyle",
  "SingularValueDecomposition",
  "SingularValueList",
  "SingularValuePlot",
  "SingularValues",
  "Sinh",
  "SinhIntegral",
  "SinIntegral",
  "SixJSymbol",
  "Skeleton",
  "SkeletonTransform",
  "SkellamDistribution",
  "Skewness",
  "SkewNormalDistribution",
  "SkinStyle",
  "Skip",
  "SliceContourPlot3D",
  "SliceDensityPlot3D",
  "SliceDistribution",
  "SliceVectorPlot3D",
  "Slider",
  "Slider2D",
  "Slider2DBox",
  "Slider2DBoxOptions",
  "SliderBox",
  "SliderBoxOptions",
  "SlideShowVideo",
  "SlideView",
  "Slot",
  "SlotSequence",
  "Small",
  "SmallCircle",
  "Smaller",
  "SmithDecomposition",
  "SmithDelayCompensator",
  "SmithWatermanSimilarity",
  "SmoothDensityHistogram",
  "SmoothHistogram",
  "SmoothHistogram3D",
  "SmoothKernelDistribution",
  "SmoothPointDensity",
  "SnDispersion",
  "Snippet",
  "SnippetsVideo",
  "SnubPolyhedron",
  "SocialMediaData",
  "Socket",
  "SocketConnect",
  "SocketListen",
  "SocketListener",
  "SocketObject",
  "SocketOpen",
  "SocketReadMessage",
  "SocketReadyQ",
  "Sockets",
  "SocketWaitAll",
  "SocketWaitNext",
  "SoftmaxLayer",
  "SokalSneathDissimilarity",
  "SolarEclipse",
  "SolarSystemFeatureData",
  "SolarTime",
  "SolidAngle",
  "SolidBoundaryLoadValue",
  "SolidData",
  "SolidDisplacementCondition",
  "SolidFixedCondition",
  "SolidMechanicsPDEComponent",
  "SolidMechanicsStrain",
  "SolidMechanicsStress",
  "SolidRegionQ",
  "Solve",
  "SolveAlways",
  "SolveDelayed",
  "SolveValues",
  "Sort",
  "SortBy",
  "SortedBy",
  "SortedEntityClass",
  "Sound",
  "SoundAndGraphics",
  "SoundNote",
  "SoundVolume",
  "SourceLink",
  "SourcePDETerm",
  "Sow",
  "Space",
  "SpaceCurveData",
  "SpaceForm",
  "Spacer",
  "Spacings",
  "Span",
  "SpanAdjustments",
  "SpanCharacterRounding",
  "SpanFromAbove",
  "SpanFromBoth",
  "SpanFromLeft",
  "SpanLineThickness",
  "SpanMaxSize",
  "SpanMinSize",
  "SpanningCharacters",
  "SpanSymmetric",
  "SparseArray",
  "SparseArrayQ",
  "SpatialBinnedPointData",
  "SpatialBoundaryCorrection",
  "SpatialEstimate",
  "SpatialEstimatorFunction",
  "SpatialGraphDistribution",
  "SpatialJ",
  "SpatialMedian",
  "SpatialNoiseLevel",
  "SpatialObservationRegionQ",
  "SpatialPointData",
  "SpatialPointSelect",
  "SpatialRandomnessTest",
  "SpatialTransformationLayer",
  "SpatialTrendFunction",
  "Speak",
  "SpeakerMatchQ",
  "SpearmanRankTest",
  "SpearmanRho",
  "SpeciesData",
  "SpecificityGoal",
  "SpectralLineData",
  "Spectrogram",
  "SpectrogramArray",
  "Specularity",
  "SpeechCases",
  "SpeechInterpreter",
  "SpeechRecognize",
  "SpeechSynthesize",
  "SpellingCorrection",
  "SpellingCorrectionList",
  "SpellingDictionaries",
  "SpellingDictionariesPath",
  "SpellingOptions",
  "Sphere",
  "SphereBox",
  "SphereBoxOptions",
  "SpherePoints",
  "SphericalBesselJ",
  "SphericalBesselY",
  "SphericalHankelH1",
  "SphericalHankelH2",
  "SphericalHarmonicY",
  "SphericalPlot3D",
  "SphericalRegion",
  "SphericalShell",
  "SpheroidalEigenvalue",
  "SpheroidalJoiningFactor",
  "SpheroidalPS",
  "SpheroidalPSPrime",
  "SpheroidalQS",
  "SpheroidalQSPrime",
  "SpheroidalRadialFactor",
  "SpheroidalS1",
  "SpheroidalS1Prime",
  "SpheroidalS2",
  "SpheroidalS2Prime",
  "Splice",
  "SplicedDistribution",
  "SplineClosed",
  "SplineDegree",
  "SplineKnots",
  "SplineWeights",
  "Split",
  "SplitBy",
  "SpokenString",
  "SpotLight",
  "Sqrt",
  "SqrtBox",
  "SqrtBoxOptions",
  "Square",
  "SquaredEuclideanDistance",
  "SquareFreeQ",
  "SquareIntersection",
  "SquareMatrixQ",
  "SquareRepeatingElement",
  "SquaresR",
  "SquareSubset",
  "SquareSubsetEqual",
  "SquareSuperset",
  "SquareSupersetEqual",
  "SquareUnion",
  "SquareWave",
  "SSSTriangle",
  "StabilityMargins",
  "StabilityMarginsStyle",
  "StableDistribution",
  "Stack",
  "StackBegin",
  "StackComplete",
  "StackedDateListPlot",
  "StackedListPlot",
  "StackInhibit",
  "StadiumShape",
  "StandardAtmosphereData",
  "StandardDeviation",
  "StandardDeviationFilter",
  "StandardForm",
  "Standardize",
  "Standardized",
  "StandardOceanData",
  "StandbyDistribution",
  "Star",
  "StarClusterData",
  "StarData",
  "StarGraph",
  "StartAsynchronousTask",
  "StartExternalSession",
  "StartingStepSize",
  "StartOfLine",
  "StartOfString",
  "StartProcess",
  "StartScheduledTask",
  "StartupSound",
  "StartWebSession",
  "StateDimensions",
  "StateFeedbackGains",
  "StateOutputEstimator",
  "StateResponse",
  "StateSpaceModel",
  "StateSpaceRealization",
  "StateSpaceTransform",
  "StateTransformationLinearize",
  "StationaryDistribution",
  "StationaryWaveletPacketTransform",
  "StationaryWaveletTransform",
  "StatusArea",
  "StatusCentrality",
  "StepMonitor",
  "StereochemistryElements",
  "StieltjesGamma",
  "StippleShading",
  "StirlingS1",
  "StirlingS2",
  "StopAsynchronousTask",
  "StoppingPowerData",
  "StopScheduledTask",
  "StrataVariables",
  "StratonovichProcess",
  "StraussHardcorePointProcess",
  "StraussPointProcess",
  "StreamColorFunction",
  "StreamColorFunctionScaling",
  "StreamDensityPlot",
  "StreamMarkers",
  "StreamPlot",
  "StreamPlot3D",
  "StreamPoints",
  "StreamPosition",
  "Streams",
  "StreamScale",
  "StreamStyle",
  "StrictInequalities",
  "String",
  "StringBreak",
  "StringByteCount",
  "StringCases",
  "StringContainsQ",
  "StringCount",
  "StringDelete",
  "StringDrop",
  "StringEndsQ",
  "StringExpression",
  "StringExtract",
  "StringForm",
  "StringFormat",
  "StringFormatQ",
  "StringFreeQ",
  "StringInsert",
  "StringJoin",
  "StringLength",
  "StringMatchQ",
  "StringPadLeft",
  "StringPadRight",
  "StringPart",
  "StringPartition",
  "StringPosition",
  "StringQ",
  "StringRepeat",
  "StringReplace",
  "StringReplaceList",
  "StringReplacePart",
  "StringReverse",
  "StringRiffle",
  "StringRotateLeft",
  "StringRotateRight",
  "StringSkeleton",
  "StringSplit",
  "StringStartsQ",
  "StringTake",
  "StringTakeDrop",
  "StringTemplate",
  "StringToByteArray",
  "StringToStream",
  "StringTrim",
  "StripBoxes",
  "StripOnInput",
  "StripStyleOnPaste",
  "StripWrapperBoxes",
  "StrokeForm",
  "Struckthrough",
  "StructuralImportance",
  "StructuredArray",
  "StructuredArrayHeadQ",
  "StructuredSelection",
  "StruveH",
  "StruveL",
  "Stub",
  "StudentTDistribution",
  "Style",
  "StyleBox",
  "StyleBoxAutoDelete",
  "StyleData",
  "StyleDefinitions",
  "StyleForm",
  "StyleHints",
  "StyleKeyMapping",
  "StyleMenuListing",
  "StyleNameDialogSettings",
  "StyleNames",
  "StylePrint",
  "StyleSheetPath",
  "Subdivide",
  "Subfactorial",
  "Subgraph",
  "SubMinus",
  "SubPlus",
  "SubresultantPolynomialRemainders",
  "SubresultantPolynomials",
  "Subresultants",
  "Subscript",
  "SubscriptBox",
  "SubscriptBoxOptions",
  "Subscripted",
  "Subsequences",
  "Subset",
  "SubsetCases",
  "SubsetCount",
  "SubsetEqual",
  "SubsetMap",
  "SubsetPosition",
  "SubsetQ",
  "SubsetReplace",
  "Subsets",
  "SubStar",
  "SubstitutionSystem",
  "Subsuperscript",
  "SubsuperscriptBox",
  "SubsuperscriptBoxOptions",
  "SubtitleEncoding",
  "SubtitleTrackSelection",
  "Subtract",
  "SubtractFrom",
  "SubtractSides",
  "SubValues",
  "Succeeds",
  "SucceedsEqual",
  "SucceedsSlantEqual",
  "SucceedsTilde",
  "Success",
  "SuchThat",
  "Sum",
  "SumConvergence",
  "SummationLayer",
  "Sunday",
  "SunPosition",
  "Sunrise",
  "Sunset",
  "SuperDagger",
  "SuperMinus",
  "SupernovaData",
  "SuperPlus",
  "Superscript",
  "SuperscriptBox",
  "SuperscriptBoxOptions",
  "Superset",
  "SupersetEqual",
  "SuperStar",
  "Surd",
  "SurdForm",
  "SurfaceAppearance",
  "SurfaceArea",
  "SurfaceColor",
  "SurfaceData",
  "SurfaceGraphics",
  "SurvivalDistribution",
  "SurvivalFunction",
  "SurvivalModel",
  "SurvivalModelFit",
  "SuspendPacket",
  "SuzukiDistribution",
  "SuzukiGroupSuz",
  "SwatchLegend",
  "Switch",
  "Symbol",
  "SymbolName",
  "SymletWavelet",
  "Symmetric",
  "SymmetricDifference",
  "SymmetricGroup",
  "SymmetricKey",
  "SymmetricMatrixQ",
  "SymmetricPolynomial",
  "SymmetricReduction",
  "Symmetrize",
  "SymmetrizedArray",
  "SymmetrizedArrayRules",
  "SymmetrizedDependentComponents",
  "SymmetrizedIndependentComponents",
  "SymmetrizedReplacePart",
  "SynchronousInitialization",
  "SynchronousUpdating",
  "Synonyms",
  "Syntax",
  "SyntaxForm",
  "SyntaxInformation",
  "SyntaxLength",
  "SyntaxPacket",
  "SyntaxQ",
  "SynthesizeMissingValues",
  "SystemCredential",
  "SystemCredentialData",
  "SystemCredentialKey",
  "SystemCredentialKeys",
  "SystemCredentialStoreObject",
  "SystemDialogInput",
  "SystemException",
  "SystemGet",
  "SystemHelpPath",
  "SystemInformation",
  "SystemInformationData",
  "SystemInstall",
  "SystemModel",
  "SystemModeler",
  "SystemModelExamples",
  "SystemModelLinearize",
  "SystemModelMeasurements",
  "SystemModelParametricSimulate",
  "SystemModelPlot",
  "SystemModelProgressReporting",
  "SystemModelReliability",
  "SystemModels",
  "SystemModelSimulate",
  "SystemModelSimulateSensitivity",
  "SystemModelSimulationData",
  "SystemOpen",
  "SystemOptions",
  "SystemProcessData",
  "SystemProcesses",
  "SystemsConnectionsModel",
  "SystemsModelControllerData",
  "SystemsModelDelay",
  "SystemsModelDelayApproximate",
  "SystemsModelDelete",
  "SystemsModelDimensions",
  "SystemsModelExtract",
  "SystemsModelFeedbackConnect",
  "SystemsModelLabels",
  "SystemsModelLinearity",
  "SystemsModelMerge",
  "SystemsModelOrder",
  "SystemsModelParallelConnect",
  "SystemsModelSeriesConnect",
  "SystemsModelStateFeedbackConnect",
  "SystemsModelVectorRelativeOrders",
  "SystemStub",
  "SystemTest",
  "Tab",
  "TabFilling",
  "Table",
  "TableAlignments",
  "TableDepth",
  "TableDirections",
  "TableForm",
  "TableHeadings",
  "TableSpacing",
  "TableView",
  "TableViewBox",
  "TableViewBoxAlignment",
  "TableViewBoxBackground",
  "TableViewBoxHeaders",
  "TableViewBoxItemSize",
  "TableViewBoxItemStyle",
  "TableViewBoxOptions",
  "TabSpacings",
  "TabView",
  "TabViewBox",
  "TabViewBoxOptions",
  "TagBox",
  "TagBoxNote",
  "TagBoxOptions",
  "TaggingRules",
  "TagSet",
  "TagSetDelayed",
  "TagStyle",
  "TagUnset",
  "Take",
  "TakeDrop",
  "TakeLargest",
  "TakeLargestBy",
  "TakeList",
  "TakeSmallest",
  "TakeSmallestBy",
  "TakeWhile",
  "Tally",
  "Tan",
  "Tanh",
  "TargetDevice",
  "TargetFunctions",
  "TargetSystem",
  "TargetUnits",
  "TaskAbort",
  "TaskExecute",
  "TaskObject",
  "TaskRemove",
  "TaskResume",
  "Tasks",
  "TaskSuspend",
  "TaskWait",
  "TautologyQ",
  "TelegraphProcess",
  "TemplateApply",
  "TemplateArgBox",
  "TemplateBox",
  "TemplateBoxOptions",
  "TemplateEvaluate",
  "TemplateExpression",
  "TemplateIf",
  "TemplateObject",
  "TemplateSequence",
  "TemplateSlot",
  "TemplateSlotSequence",
  "TemplateUnevaluated",
  "TemplateVerbatim",
  "TemplateWith",
  "TemporalData",
  "TemporalRegularity",
  "Temporary",
  "TemporaryVariable",
  "TensorContract",
  "TensorDimensions",
  "TensorExpand",
  "TensorProduct",
  "TensorQ",
  "TensorRank",
  "TensorReduce",
  "TensorSymmetry",
  "TensorTranspose",
  "TensorWedge",
  "TerminatedEvaluation",
  "TernaryListPlot",
  "TernaryPlotCorners",
  "TestID",
  "TestReport",
  "TestReportObject",
  "TestResultObject",
  "Tetrahedron",
  "TetrahedronBox",
  "TetrahedronBoxOptions",
  "TeXForm",
  "TeXSave",
  "Text",
  "Text3DBox",
  "Text3DBoxOptions",
  "TextAlignment",
  "TextBand",
  "TextBoundingBox",
  "TextBox",
  "TextCases",
  "TextCell",
  "TextClipboardType",
  "TextContents",
  "TextData",
  "TextElement",
  "TextForm",
  "TextGrid",
  "TextJustification",
  "TextLine",
  "TextPacket",
  "TextParagraph",
  "TextPosition",
  "TextRecognize",
  "TextSearch",
  "TextSearchReport",
  "TextSentences",
  "TextString",
  "TextStructure",
  "TextStyle",
  "TextTranslation",
  "Texture",
  "TextureCoordinateFunction",
  "TextureCoordinateScaling",
  "TextWords",
  "Therefore",
  "ThermodynamicData",
  "ThermometerGauge",
  "Thick",
  "Thickness",
  "Thin",
  "Thinning",
  "ThisLink",
  "ThomasPointProcess",
  "ThompsonGroupTh",
  "Thread",
  "Threaded",
  "ThreadingLayer",
  "ThreeJSymbol",
  "Threshold",
  "Through",
  "Throw",
  "ThueMorse",
  "Thumbnail",
  "Thursday",
  "TickDirection",
  "TickLabelOrientation",
  "TickLabelPositioning",
  "TickLabels",
  "TickLengths",
  "TickPositions",
  "Ticks",
  "TicksStyle",
  "TideData",
  "Tilde",
  "TildeEqual",
  "TildeFullEqual",
  "TildeTilde",
  "TimeConstrained",
  "TimeConstraint",
  "TimeDirection",
  "TimeFormat",
  "TimeGoal",
  "TimelinePlot",
  "TimeObject",
  "TimeObjectQ",
  "TimeRemaining",
  "Times",
  "TimesBy",
  "TimeSeries",
  "TimeSeriesAggregate",
  "TimeSeriesForecast",
  "TimeSeriesInsert",
  "TimeSeriesInvertibility",
  "TimeSeriesMap",
  "TimeSeriesMapThread",
  "TimeSeriesModel",
  "TimeSeriesModelFit",
  "TimeSeriesResample",
  "TimeSeriesRescale",
  "TimeSeriesShift",
  "TimeSeriesThread",
  "TimeSeriesWindow",
  "TimeSystem",
  "TimeSystemConvert",
  "TimeUsed",
  "TimeValue",
  "TimeWarpingCorrespondence",
  "TimeWarpingDistance",
  "TimeZone",
  "TimeZoneConvert",
  "TimeZoneOffset",
  "Timing",
  "Tiny",
  "TitleGrouping",
  "TitsGroupT",
  "ToBoxes",
  "ToCharacterCode",
  "ToColor",
  "ToContinuousTimeModel",
  "ToDate",
  "Today",
  "ToDiscreteTimeModel",
  "ToEntity",
  "ToeplitzMatrix",
  "ToExpression",
  "ToFileName",
  "Together",
  "Toggle",
  "ToggleFalse",
  "Toggler",
  "TogglerBar",
  "TogglerBox",
  "TogglerBoxOptions",
  "ToHeldExpression",
  "ToInvertibleTimeSeries",
  "TokenWords",
  "Tolerance",
  "ToLowerCase",
  "Tomorrow",
  "ToNumberField",
  "TooBig",
  "Tooltip",
  "TooltipBox",
  "TooltipBoxOptions",
  "TooltipDelay",
  "TooltipStyle",
  "ToonShading",
  "Top",
  "TopHatTransform",
  "ToPolarCoordinates",
  "TopologicalSort",
  "ToRadicals",
  "ToRawPointer",
  "ToRules",
  "Torus",
  "TorusGraph",
  "ToSphericalCoordinates",
  "ToString",
  "Total",
  "TotalHeight",
  "TotalLayer",
  "TotalVariationFilter",
  "TotalWidth",
  "TouchPosition",
  "TouchscreenAutoZoom",
  "TouchscreenControlPlacement",
  "ToUpperCase",
  "TourVideo",
  "Tr",
  "Trace",
  "TraceAbove",
  "TraceAction",
  "TraceBackward",
  "TraceDepth",
  "TraceDialog",
  "TraceForward",
  "TraceInternal",
  "TraceLevel",
  "TraceOff",
  "TraceOn",
  "TraceOriginal",
  "TracePrint",
  "TraceScan",
  "TrackCellChangeTimes",
  "TrackedSymbols",
  "TrackingFunction",
  "TracyWidomDistribution",
  "TradingChart",
  "TraditionalForm",
  "TraditionalFunctionNotation",
  "TraditionalNotation",
  "TraditionalOrder",
  "TrainImageContentDetector",
  "TrainingProgressCheckpointing",
  "TrainingProgressFunction",
  "TrainingProgressMeasurements",
  "TrainingProgressReporting",
  "TrainingStoppingCriterion",
  "TrainingUpdateSchedule",
  "TrainTextContentDetector",
  "TransferFunctionCancel",
  "TransferFunctionExpand",
  "TransferFunctionFactor",
  "TransferFunctionModel",
  "TransferFunctionPoles",
  "TransferFunctionTransform",
  "TransferFunctionZeros",
  "TransformationClass",
  "TransformationFunction",
  "TransformationFunctions",
  "TransformationMatrix",
  "TransformedDistribution",
  "TransformedField",
  "TransformedProcess",
  "TransformedRegion",
  "TransitionDirection",
  "TransitionDuration",
  "TransitionEffect",
  "TransitiveClosureGraph",
  "TransitiveReductionGraph",
  "Translate",
  "TranslationOptions",
  "TranslationTransform",
  "Transliterate",
  "Transparent",
  "TransparentColor",
  "Transpose",
  "TransposeLayer",
  "TrapEnterKey",
  "TrapSelection",
  "TravelDirections",
  "TravelDirectionsData",
  "TravelDistance",
  "TravelDistanceList",
  "TravelMethod",
  "TravelTime",
  "Tree",
  "TreeCases",
  "TreeChildren",
  "TreeCount",
  "TreeData",
  "TreeDelete",
  "TreeDepth",
  "TreeElementCoordinates",
  "TreeElementLabel",
  "TreeElementLabelFunction",
  "TreeElementLabelStyle",
  "TreeElementShape",
  "TreeElementShapeFunction",
  "TreeElementSize",
  "TreeElementSizeFunction",
  "TreeElementStyle",
  "TreeElementStyleFunction",
  "TreeExpression",
  "TreeExtract",
  "TreeFold",
  "TreeForm",
  "TreeGraph",
  "TreeGraphQ",
  "TreeInsert",
  "TreeLayout",
  "TreeLeafCount",
  "TreeLeafQ",
  "TreeLeaves",
  "TreeLevel",
  "TreeMap",
  "TreeMapAt",
  "TreeOutline",
  "TreePlot",
  "TreePosition",
  "TreeQ",
  "TreeReplacePart",
  "TreeRules",
  "TreeScan",
  "TreeSelect",
  "TreeSize",
  "TreeTraversalOrder",
  "TrendStyle",
  "Triangle",
  "TriangleCenter",
  "TriangleConstruct",
  "TriangleMeasurement",
  "TriangleWave",
  "TriangularDistribution",
  "TriangulateMesh",
  "Trig",
  "TrigExpand",
  "TrigFactor",
  "TrigFactorList",
  "Trigger",
  "TrigReduce",
  "TrigToExp",
  "TrimmedMean",
  "TrimmedVariance",
  "TropicalStormData",
  "True",
  "TrueQ",
  "TruncatedDistribution",
  "TruncatedPolyhedron",
  "TsallisQExponentialDistribution",
  "TsallisQGaussianDistribution",
  "TTest",
  "Tube",
  "TubeBezierCurveBox",
  "TubeBezierCurveBoxOptions",
  "TubeBox",
  "TubeBoxOptions",
  "TubeBSplineCurveBox",
  "TubeBSplineCurveBoxOptions",
  "Tuesday",
  "TukeyLambdaDistribution",
  "TukeyWindow",
  "TunnelData",
  "Tuples",
  "TuranGraph",
  "TuringMachine",
  "TuttePolynomial",
  "TwoWayRule",
  "Typed",
  "TypeDeclaration",
  "TypeEvaluate",
  "TypeHint",
  "TypeOf",
  "TypeSpecifier",
  "UnateQ",
  "Uncompress",
  "UnconstrainedParameters",
  "Undefined",
  "UnderBar",
  "Underflow",
  "Underlined",
  "Underoverscript",
  "UnderoverscriptBox",
  "UnderoverscriptBoxOptions",
  "Underscript",
  "UnderscriptBox",
  "UnderscriptBoxOptions",
  "UnderseaFeatureData",
  "UndirectedEdge",
  "UndirectedGraph",
  "UndirectedGraphQ",
  "UndoOptions",
  "UndoTrackedVariables",
  "Unequal",
  "UnequalTo",
  "Unevaluated",
  "UniformDistribution",
  "UniformGraphDistribution",
  "UniformPolyhedron",
  "UniformSumDistribution",
  "Uninstall",
  "Union",
  "UnionedEntityClass",
  "UnionPlus",
  "Unique",
  "UniqueElements",
  "UnitaryMatrixQ",
  "UnitBox",
  "UnitConvert",
  "UnitDimensions",
  "Unitize",
  "UnitRootTest",
  "UnitSimplify",
  "UnitStep",
  "UnitSystem",
  "UnitTriangle",
  "UnitVector",
  "UnitVectorLayer",
  "UnityDimensions",
  "UniverseModelData",
  "UniversityData",
  "UnixTime",
  "UnlabeledTree",
  "UnmanageObject",
  "Unprotect",
  "UnregisterExternalEvaluator",
  "UnsameQ",
  "UnsavedVariables",
  "Unset",
  "UnsetShared",
  "Until",
  "UntrackedVariables",
  "Up",
  "UpArrow",
  "UpArrowBar",
  "UpArrowDownArrow",
  "Update",
  "UpdateDynamicObjects",
  "UpdateDynamicObjectsSynchronous",
  "UpdateInterval",
  "UpdatePacletSites",
  "UpdateSearchIndex",
  "UpDownArrow",
  "UpEquilibrium",
  "UpperCaseQ",
  "UpperLeftArrow",
  "UpperRightArrow",
  "UpperTriangularize",
  "UpperTriangularMatrix",
  "UpperTriangularMatrixQ",
  "Upsample",
  "UpSet",
  "UpSetDelayed",
  "UpTee",
  "UpTeeArrow",
  "UpTo",
  "UpValues",
  "URL",
  "URLBuild",
  "URLDecode",
  "URLDispatcher",
  "URLDownload",
  "URLDownloadSubmit",
  "URLEncode",
  "URLExecute",
  "URLExpand",
  "URLFetch",
  "URLFetchAsynchronous",
  "URLParse",
  "URLQueryDecode",
  "URLQueryEncode",
  "URLRead",
  "URLResponseTime",
  "URLSave",
  "URLSaveAsynchronous",
  "URLShorten",
  "URLSubmit",
  "UseEmbeddedLibrary",
  "UseGraphicsRange",
  "UserDefinedWavelet",
  "Using",
  "UsingFrontEnd",
  "UtilityFunction",
  "V2Get",
  "ValenceErrorHandling",
  "ValenceFilling",
  "ValidationLength",
  "ValidationSet",
  "ValueBox",
  "ValueBoxOptions",
  "ValueDimensions",
  "ValueForm",
  "ValuePreprocessingFunction",
  "ValueQ",
  "Values",
  "ValuesData",
  "VandermondeMatrix",
  "Variables",
  "Variance",
  "VarianceEquivalenceTest",
  "VarianceEstimatorFunction",
  "VarianceGammaDistribution",
  "VarianceGammaPointProcess",
  "VarianceTest",
  "VariogramFunction",
  "VariogramModel",
  "VectorAngle",
  "VectorAround",
  "VectorAspectRatio",
  "VectorColorFunction",
  "VectorColorFunctionScaling",
  "VectorDensityPlot",
  "VectorDisplacementPlot",
  "VectorDisplacementPlot3D",
  "VectorGlyphData",
  "VectorGreater",
  "VectorGreaterEqual",
  "VectorLess",
  "VectorLessEqual",
  "VectorMarkers",
  "VectorPlot",
  "VectorPlot3D",
  "VectorPoints",
  "VectorQ",
  "VectorRange",
  "Vectors",
  "VectorScale",
  "VectorScaling",
  "VectorSizes",
  "VectorStyle",
  "Vee",
  "Verbatim",
  "Verbose",
  "VerificationTest",
  "VerifyConvergence",
  "VerifyDerivedKey",
  "VerifyDigitalSignature",
  "VerifyFileSignature",
  "VerifyInterpretation",
  "VerifySecurityCertificates",
  "VerifySolutions",
  "VerifyTestAssumptions",
  "VersionedPreferences",
  "VertexAdd",
  "VertexCapacity",
  "VertexChromaticNumber",
  "VertexColors",
  "VertexComponent",
  "VertexConnectivity",
  "VertexContract",
  "VertexCoordinateRules",
  "VertexCoordinates",
  "VertexCorrelationSimilarity",
  "VertexCosineSimilarity",
  "VertexCount",
  "VertexCoverQ",
  "VertexDataCoordinates",
  "VertexDegree",
  "VertexDelete",
  "VertexDiceSimilarity",
  "VertexEccentricity",
  "VertexInComponent",
  "VertexInComponentGraph",
  "VertexInDegree",
  "VertexIndex",
  "VertexJaccardSimilarity",
  "VertexLabeling",
  "VertexLabels",
  "VertexLabelStyle",
  "VertexList",
  "VertexNormals",
  "VertexOutComponent",
  "VertexOutComponentGraph",
  "VertexOutDegree",
  "VertexQ",
  "VertexRenderingFunction",
  "VertexReplace",
  "VertexShape",
  "VertexShapeFunction",
  "VertexSize",
  "VertexStyle",
  "VertexTextureCoordinates",
  "VertexTransitiveGraphQ",
  "VertexWeight",
  "VertexWeightedGraphQ",
  "Vertical",
  "VerticalBar",
  "VerticalForm",
  "VerticalGauge",
  "VerticalSeparator",
  "VerticalSlider",
  "VerticalTilde",
  "Video",
  "VideoCapture",
  "VideoCombine",
  "VideoDelete",
  "VideoEncoding",
  "VideoExtractFrames",
  "VideoFrameList",
  "VideoFrameMap",
  "VideoGenerator",
  "VideoInsert",
  "VideoIntervals",
  "VideoJoin",
  "VideoMap",
  "VideoMapList",
  "VideoMapTimeSeries",
  "VideoPadding",
  "VideoPause",
  "VideoPlay",
  "VideoQ",
  "VideoRecord",
  "VideoReplace",
  "VideoScreenCapture",
  "VideoSplit",
  "VideoStop",
  "VideoStream",
  "VideoStreams",
  "VideoTimeStretch",
  "VideoTrackSelection",
  "VideoTranscode",
  "VideoTransparency",
  "VideoTrim",
  "ViewAngle",
  "ViewCenter",
  "ViewMatrix",
  "ViewPoint",
  "ViewPointSelectorSettings",
  "ViewPort",
  "ViewProjection",
  "ViewRange",
  "ViewVector",
  "ViewVertical",
  "VirtualGroupData",
  "Visible",
  "VisibleCell",
  "VoiceStyleData",
  "VoigtDistribution",
  "VolcanoData",
  "Volume",
  "VonMisesDistribution",
  "VoronoiMesh",
  "WaitAll",
  "WaitAsynchronousTask",
  "WaitNext",
  "WaitUntil",
  "WakebyDistribution",
  "WalleniusHypergeometricDistribution",
  "WaringYuleDistribution",
  "WarpingCorrespondence",
  "WarpingDistance",
  "WatershedComponents",
  "WatsonUSquareTest",
  "WattsStrogatzGraphDistribution",
  "WaveletBestBasis",
  "WaveletFilterCoefficients",
  "WaveletImagePlot",
  "WaveletListPlot",
  "WaveletMapIndexed",
  "WaveletMatrixPlot",
  "WaveletPhi",
  "WaveletPsi",
  "WaveletScale",
  "WaveletScalogram",
  "WaveletThreshold",
  "WavePDEComponent",
  "WeaklyConnectedComponents",
  "WeaklyConnectedGraphComponents",
  "WeaklyConnectedGraphQ",
  "WeakStationarity",
  "WeatherData",
  "WeatherForecastData",
  "WebAudioSearch",
  "WebColumn",
  "WebElementObject",
  "WeberE",
  "WebExecute",
  "WebImage",
  "WebImageSearch",
  "WebItem",
  "WebPageMetaInformation",
  "WebRow",
  "WebSearch",
  "WebSessionObject",
  "WebSessions",
  "WebWindowObject",
  "Wedge",
  "Wednesday",
  "WeibullDistribution",
  "WeierstrassE1",
  "WeierstrassE2",
  "WeierstrassE3",
  "WeierstrassEta1",
  "WeierstrassEta2",
  "WeierstrassEta3",
  "WeierstrassHalfPeriods",
  "WeierstrassHalfPeriodW1",
  "WeierstrassHalfPeriodW2",
  "WeierstrassHalfPeriodW3",
  "WeierstrassInvariantG2",
  "WeierstrassInvariantG3",
  "WeierstrassInvariants",
  "WeierstrassP",
  "WeierstrassPPrime",
  "WeierstrassSigma",
  "WeierstrassZeta",
  "WeightedAdjacencyGraph",
  "WeightedAdjacencyMatrix",
  "WeightedData",
  "WeightedGraphQ",
  "Weights",
  "WelchWindow",
  "WheelGraph",
  "WhenEvent",
  "Which",
  "While",
  "White",
  "WhiteNoiseProcess",
  "WhitePoint",
  "Whitespace",
  "WhitespaceCharacter",
  "WhittakerM",
  "WhittakerW",
  "WholeCellGroupOpener",
  "WienerFilter",
  "WienerProcess",
  "WignerD",
  "WignerSemicircleDistribution",
  "WikidataData",
  "WikidataSearch",
  "WikipediaData",
  "WikipediaSearch",
  "WilksW",
  "WilksWTest",
  "WindDirectionData",
  "WindingCount",
  "WindingPolygon",
  "WindowClickSelect",
  "WindowElements",
  "WindowFloating",
  "WindowFrame",
  "WindowFrameElements",
  "WindowMargins",
  "WindowMovable",
  "WindowOpacity",
  "WindowPersistentStyles",
  "WindowSelected",
  "WindowSize",
  "WindowStatusArea",
  "WindowTitle",
  "WindowToolbars",
  "WindowWidth",
  "WindSpeedData",
  "WindVectorData",
  "WinsorizedMean",
  "WinsorizedVariance",
  "WishartMatrixDistribution",
  "With",
  "WithCleanup",
  "WithLock",
  "WolframAlpha",
  "WolframAlphaDate",
  "WolframAlphaQuantity",
  "WolframAlphaResult",
  "WolframCloudSettings",
  "WolframLanguageData",
  "Word",
  "WordBoundary",
  "WordCharacter",
  "WordCloud",
  "WordCount",
  "WordCounts",
  "WordData",
  "WordDefinition",
  "WordFrequency",
  "WordFrequencyData",
  "WordList",
  "WordOrientation",
  "WordSearch",
  "WordSelectionFunction",
  "WordSeparators",
  "WordSpacings",
  "WordStem",
  "WordTranslation",
  "WorkingPrecision",
  "WrapAround",
  "Write",
  "WriteLine",
  "WriteString",
  "Wronskian",
  "XMLElement",
  "XMLObject",
  "XMLTemplate",
  "Xnor",
  "Xor",
  "XYZColor",
  "Yellow",
  "Yesterday",
  "YuleDissimilarity",
  "ZernikeR",
  "ZeroSymmetric",
  "ZeroTest",
  "ZeroWidthTimes",
  "Zeta",
  "ZetaZero",
  "ZIPCodeData",
  "ZipfDistribution",
  "ZoomCenter",
  "ZoomFactor",
  "ZTest",
  "ZTransform",
  "$Aborted",
  "$ActivationGroupID",
  "$ActivationKey",
  "$ActivationUserRegistered",
  "$AddOnsDirectory",
  "$AllowDataUpdates",
  "$AllowExternalChannelFunctions",
  "$AllowInternet",
  "$AssertFunction",
  "$Assumptions",
  "$AsynchronousTask",
  "$AudioDecoders",
  "$AudioEncoders",
  "$AudioInputDevices",
  "$AudioOutputDevices",
  "$BaseDirectory",
  "$BasePacletsDirectory",
  "$BatchInput",
  "$BatchOutput",
  "$BlockchainBase",
  "$BoxForms",
  "$ByteOrdering",
  "$CacheBaseDirectory",
  "$Canceled",
  "$ChannelBase",
  "$CharacterEncoding",
  "$CharacterEncodings",
  "$CloudAccountName",
  "$CloudBase",
  "$CloudConnected",
  "$CloudConnection",
  "$CloudCreditsAvailable",
  "$CloudEvaluation",
  "$CloudExpressionBase",
  "$CloudObjectNameFormat",
  "$CloudObjectURLType",
  "$CloudRootDirectory",
  "$CloudSymbolBase",
  "$CloudUserID",
  "$CloudUserUUID",
  "$CloudVersion",
  "$CloudVersionNumber",
  "$CloudWolframEngineVersionNumber",
  "$CommandLine",
  "$CompilationTarget",
  "$CompilerEnvironment",
  "$ConditionHold",
  "$ConfiguredKernels",
  "$Context",
  "$ContextAliases",
  "$ContextPath",
  "$ControlActiveSetting",
  "$Cookies",
  "$CookieStore",
  "$CreationDate",
  "$CryptographicEllipticCurveNames",
  "$CurrentLink",
  "$CurrentTask",
  "$CurrentWebSession",
  "$DataStructures",
  "$DateStringFormat",
  "$DefaultAudioInputDevice",
  "$DefaultAudioOutputDevice",
  "$DefaultFont",
  "$DefaultFrontEnd",
  "$DefaultImagingDevice",
  "$DefaultKernels",
  "$DefaultLocalBase",
  "$DefaultLocalKernel",
  "$DefaultMailbox",
  "$DefaultNetworkInterface",
  "$DefaultPath",
  "$DefaultProxyRules",
  "$DefaultRemoteBatchSubmissionEnvironment",
  "$DefaultRemoteKernel",
  "$DefaultSystemCredentialStore",
  "$Display",
  "$DisplayFunction",
  "$DistributedContexts",
  "$DynamicEvaluation",
  "$Echo",
  "$EmbedCodeEnvironments",
  "$EmbeddableServices",
  "$EntityStores",
  "$Epilog",
  "$EvaluationCloudBase",
  "$EvaluationCloudObject",
  "$EvaluationEnvironment",
  "$ExportFormats",
  "$ExternalIdentifierTypes",
  "$ExternalStorageBase",
  "$Failed",
  "$FinancialDataSource",
  "$FontFamilies",
  "$FormatType",
  "$FrontEnd",
  "$FrontEndSession",
  "$GeneratedAssetLocation",
  "$GeoEntityTypes",
  "$GeoLocation",
  "$GeoLocationCity",
  "$GeoLocationCountry",
  "$GeoLocationPrecision",
  "$GeoLocationSource",
  "$HistoryLength",
  "$HomeDirectory",
  "$HTMLExportRules",
  "$HTTPCookies",
  "$HTTPRequest",
  "$IgnoreEOF",
  "$ImageFormattingWidth",
  "$ImageResolution",
  "$ImagingDevice",
  "$ImagingDevices",
  "$ImportFormats",
  "$IncomingMailSettings",
  "$InitialDirectory",
  "$Initialization",
  "$InitializationContexts",
  "$Input",
  "$InputFileName",
  "$InputStreamMethods",
  "$Inspector",
  "$InstallationDate",
  "$InstallationDirectory",
  "$InterfaceEnvironment",
  "$InterpreterTypes",
  "$IterationLimit",
  "$KernelCount",
  "$KernelID",
  "$Language",
  "$LaunchDirectory",
  "$LibraryPath",
  "$LicenseExpirationDate",
  "$LicenseID",
  "$LicenseProcesses",
  "$LicenseServer",
  "$LicenseSubprocesses",
  "$LicenseType",
  "$Line",
  "$Linked",
  "$LinkSupported",
  "$LoadedFiles",
  "$LocalBase",
  "$LocalSymbolBase",
  "$MachineAddresses",
  "$MachineDomain",
  "$MachineDomains",
  "$MachineEpsilon",
  "$MachineID",
  "$MachineName",
  "$MachinePrecision",
  "$MachineType",
  "$MaxDisplayedChildren",
  "$MaxExtraPrecision",
  "$MaxLicenseProcesses",
  "$MaxLicenseSubprocesses",
  "$MaxMachineNumber",
  "$MaxNumber",
  "$MaxPiecewiseCases",
  "$MaxPrecision",
  "$MaxRootDegree",
  "$MessageGroups",
  "$MessageList",
  "$MessagePrePrint",
  "$Messages",
  "$MinMachineNumber",
  "$MinNumber",
  "$MinorReleaseNumber",
  "$MinPrecision",
  "$MobilePhone",
  "$ModuleNumber",
  "$NetworkConnected",
  "$NetworkInterfaces",
  "$NetworkLicense",
  "$NewMessage",
  "$NewSymbol",
  "$NotebookInlineStorageLimit",
  "$Notebooks",
  "$NoValue",
  "$NumberMarks",
  "$Off",
  "$OperatingSystem",
  "$Output",
  "$OutputForms",
  "$OutputSizeLimit",
  "$OutputStreamMethods",
  "$Packages",
  "$ParentLink",
  "$ParentProcessID",
  "$PasswordFile",
  "$PatchLevelID",
  "$Path",
  "$PathnameSeparator",
  "$PerformanceGoal",
  "$Permissions",
  "$PermissionsGroupBase",
  "$PersistenceBase",
  "$PersistencePath",
  "$PipeSupported",
  "$PlotTheme",
  "$Post",
  "$Pre",
  "$PreferencesDirectory",
  "$PreInitialization",
  "$PrePrint",
  "$PreRead",
  "$PrintForms",
  "$PrintLiteral",
  "$Printout3DPreviewer",
  "$ProcessID",
  "$ProcessorCount",
  "$ProcessorType",
  "$ProductInformation",
  "$ProgramName",
  "$ProgressReporting",
  "$PublisherID",
  "$RandomGeneratorState",
  "$RandomState",
  "$RecursionLimit",
  "$RegisteredDeviceClasses",
  "$RegisteredUserName",
  "$ReleaseNumber",
  "$RequesterAddress",
  "$RequesterCloudUserID",
  "$RequesterCloudUserUUID",
  "$RequesterWolframID",
  "$RequesterWolframUUID",
  "$ResourceSystemBase",
  "$ResourceSystemPath",
  "$RootDirectory",
  "$ScheduledTask",
  "$ScriptCommandLine",
  "$ScriptInputString",
  "$SecuredAuthenticationKeyTokens",
  "$ServiceCreditsAvailable",
  "$Services",
  "$SessionID",
  "$SetParentLink",
  "$SharedFunctions",
  "$SharedVariables",
  "$SoundDisplay",
  "$SoundDisplayFunction",
  "$SourceLink",
  "$SSHAuthentication",
  "$SubtitleDecoders",
  "$SubtitleEncoders",
  "$SummaryBoxDataSizeLimit",
  "$SuppressInputFormHeads",
  "$SynchronousEvaluation",
  "$SyntaxHandler",
  "$System",
  "$SystemCharacterEncoding",
  "$SystemCredentialStore",
  "$SystemID",
  "$SystemMemory",
  "$SystemShell",
  "$SystemTimeZone",
  "$SystemWordLength",
  "$TargetSystems",
  "$TemplatePath",
  "$TemporaryDirectory",
  "$TemporaryPrefix",
  "$TestFileName",
  "$TextStyle",
  "$TimedOut",
  "$TimeUnit",
  "$TimeZone",
  "$TimeZoneEntity",
  "$TopDirectory",
  "$TraceOff",
  "$TraceOn",
  "$TracePattern",
  "$TracePostAction",
  "$TracePreAction",
  "$UnitSystem",
  "$Urgent",
  "$UserAddOnsDirectory",
  "$UserAgentLanguages",
  "$UserAgentMachine",
  "$UserAgentName",
  "$UserAgentOperatingSystem",
  "$UserAgentString",
  "$UserAgentVersion",
  "$UserBaseDirectory",
  "$UserBasePacletsDirectory",
  "$UserDocumentsDirectory",
  "$Username",
  "$UserName",
  "$UserURLBase",
  "$Version",
  "$VersionNumber",
  "$VideoDecoders",
  "$VideoEncoders",
  "$VoiceStyles",
  "$WolframDocumentsDirectory",
  "$WolframID",
  "$WolframUUID"
];
function aD(t) {
  const e = t.regex, n = /([2-9]|[1-2]\d|[3][0-5])\^\^/, r = /(\w*\.\w+|\w+\.\w*|\w+)/, i = /(\d*\.\d+|\d+\.\d*|\d+)/, o = e.either(e.concat(n, r), i), a = /``[+-]?(\d*\.\d+|\d+\.\d*|\d+)/, s = /`([+-]?(\d*\.\d+|\d+\.\d*|\d+))?/, l = e.either(a, s), c = /\*\^[+-]?\d+/, d = {
    className: "number",
    relevance: 0,
    begin: e.concat(
      o,
      e.optional(l),
      e.optional(c)
    )
  }, p = /[a-zA-Z$][a-zA-Z0-9$]*/, _ = new Set(oD), m = { variants: [
    {
      className: "builtin-symbol",
      begin: p,
      // for performance out of fear of regex.either(...Mathematica.SYSTEM_SYMBOLS)
      "on:begin": (T, C) => {
        _.has(T[0]) || C.ignoreMatch();
      }
    },
    {
      className: "symbol",
      relevance: 0,
      begin: p
    }
  ] }, f = {
    className: "named-character",
    begin: /\\\[[$a-zA-Z][$a-zA-Z0-9]+\]/
  }, g = {
    className: "operator",
    relevance: 0,
    begin: /[+\-*/,;.:@~=><&|_`'^?!%]+/
  }, S = {
    className: "pattern",
    relevance: 0,
    begin: /([a-zA-Z$][a-zA-Z0-9$]*)?_+([a-zA-Z$][a-zA-Z0-9$]*)?/
  }, E = {
    className: "slot",
    relevance: 0,
    begin: /#[a-zA-Z$][a-zA-Z0-9$]*|#+[0-9]?/
  }, b = {
    className: "brace",
    relevance: 0,
    begin: /[[\](){}]/
  }, h = {
    className: "message-name",
    relevance: 0,
    begin: e.concat("::", p)
  };
  return {
    name: "Mathematica",
    aliases: [
      "mma",
      "wl"
    ],
    classNameAliases: {
      brace: "punctuation",
      pattern: "type",
      slot: "type",
      symbol: "variable",
      "named-character": "variable",
      "builtin-symbol": "built_in",
      "message-name": "string"
    },
    contains: [
      t.COMMENT(/\(\*/, /\*\)/, { contains: ["self"] }),
      S,
      E,
      h,
      m,
      f,
      t.QUOTE_STRING_MODE,
      d,
      g,
      b
    ]
  };
}
function sD(t) {
  const e = "('|\\.')+", n = {
    relevance: 0,
    contains: [{ begin: e }]
  };
  return {
    name: "Matlab",
    keywords: {
      keyword: "arguments break case catch classdef continue else elseif end enumeration events for function global if methods otherwise parfor persistent properties return spmd switch try while",
      built_in: "sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i|0 inf nan isnan isinf isfinite j|0 why compan gallery hadamard hankel hilb invhilb magic pascal rosser toeplitz vander wilkinson max min nanmax nanmin mean nanmean type table readtable writetable sortrows sort figure plot plot3 scatter scatter3 cellfun legend intersect ismember procrustes hold num2cell "
    },
    illegal: '(//|"|#|/\\*|\\s+/\\w+)',
    contains: [
      {
        className: "function",
        beginKeywords: "function",
        end: "$",
        contains: [
          t.UNDERSCORE_TITLE_MODE,
          {
            className: "params",
            variants: [
              {
                begin: "\\(",
                end: "\\)"
              },
              {
                begin: "\\[",
                end: "\\]"
              }
            ]
          }
        ]
      },
      {
        className: "built_in",
        begin: /true|false/,
        relevance: 0,
        starts: n
      },
      {
        begin: "[a-zA-Z][a-zA-Z_0-9]*" + e,
        relevance: 0
      },
      {
        className: "number",
        begin: t.C_NUMBER_RE,
        relevance: 0,
        starts: n
      },
      {
        className: "string",
        begin: "'",
        end: "'",
        contains: [{ begin: "''" }]
      },
      {
        begin: /\]|\}|\)/,
        relevance: 0,
        starts: n
      },
      {
        className: "string",
        begin: '"',
        end: '"',
        contains: [{ begin: '""' }],
        starts: n
      },
      t.COMMENT("^\\s*%\\{\\s*$", "^\\s*%\\}\\s*$"),
      t.COMMENT("%", "$")
    ]
  };
}
function lD(t) {
  return {
    name: "Maxima",
    keywords: {
      $pattern: "[A-Za-z_%][0-9A-Za-z_%]*",
      keyword: "if then else elseif for thru do while unless step in and or not",
      literal: "true false unknown inf minf ind und %e %i %pi %phi %gamma",
      built_in: " abasep abs absint absolute_real_time acos acosh acot acoth acsc acsch activate addcol add_edge add_edges addmatrices addrow add_vertex add_vertices adjacency_matrix adjoin adjoint af agd airy airy_ai airy_bi airy_dai airy_dbi algsys alg_type alias allroots alphacharp alphanumericp amortization %and annuity_fv annuity_pv antid antidiff AntiDifference append appendfile apply apply1 apply2 applyb1 apropos args arit_amortization arithmetic arithsum array arrayapply arrayinfo arraymake arraysetapply ascii asec asech asin asinh askinteger asksign assoc assoc_legendre_p assoc_legendre_q assume assume_external_byte_order asympa at atan atan2 atanh atensimp atom atvalue augcoefmatrix augmented_lagrangian_method av average_degree backtrace bars barsplot barsplot_description base64 base64_decode bashindices batch batchload bc2 bdvac belln benefit_cost bern bernpoly bernstein_approx bernstein_expand bernstein_poly bessel bessel_i bessel_j bessel_k bessel_simplify bessel_y beta beta_incomplete beta_incomplete_generalized beta_incomplete_regularized bezout bfallroots bffac bf_find_root bf_fmin_cobyla bfhzeta bfloat bfloatp bfpsi bfpsi0 bfzeta biconnected_components bimetric binomial bipartition block blockmatrixp bode_gain bode_phase bothcoef box boxplot boxplot_description break bug_report build_info|10 buildq build_sample burn cabs canform canten cardinality carg cartan cartesian_product catch cauchy_matrix cbffac cdf_bernoulli cdf_beta cdf_binomial cdf_cauchy cdf_chi2 cdf_continuous_uniform cdf_discrete_uniform cdf_exp cdf_f cdf_gamma cdf_general_finite_discrete cdf_geometric cdf_gumbel cdf_hypergeometric cdf_laplace cdf_logistic cdf_lognormal cdf_negative_binomial cdf_noncentral_chi2 cdf_noncentral_student_t cdf_normal cdf_pareto cdf_poisson cdf_rank_sum cdf_rayleigh cdf_signed_rank cdf_student_t cdf_weibull cdisplay ceiling central_moment cequal cequalignore cf cfdisrep cfexpand cgeodesic cgreaterp cgreaterpignore changename changevar chaosgame charat charfun charfun2 charlist charp charpoly chdir chebyshev_t chebyshev_u checkdiv check_overlaps chinese cholesky christof chromatic_index chromatic_number cint circulant_graph clear_edge_weight clear_rules clear_vertex_label clebsch_gordan clebsch_graph clessp clesspignore close closefile cmetric coeff coefmatrix cograd col collapse collectterms columnop columnspace columnswap columnvector combination combine comp2pui compare compfile compile compile_file complement_graph complete_bipartite_graph complete_graph complex_number_p components compose_functions concan concat conjugate conmetderiv connected_components connect_vertices cons constant constantp constituent constvalue cont2part content continuous_freq contortion contour_plot contract contract_edge contragrad contrib_ode convert coord copy copy_file copy_graph copylist copymatrix cor cos cosh cot coth cov cov1 covdiff covect covers crc24sum create_graph create_list csc csch csetup cspline ctaylor ct_coordsys ctransform ctranspose cube_graph cuboctahedron_graph cunlisp cv cycle_digraph cycle_graph cylindrical days360 dblint deactivate declare declare_constvalue declare_dimensions declare_fundamental_dimensions declare_fundamental_units declare_qty declare_translated declare_unit_conversion declare_units declare_weights decsym defcon define define_alt_display define_variable defint defmatch defrule defstruct deftaylor degree_sequence del delete deleten delta demo demoivre denom depends derivdegree derivlist describe desolve determinant dfloat dgauss_a dgauss_b dgeev dgemm dgeqrf dgesv dgesvd diag diagmatrix diag_matrix diagmatrixp diameter diff digitcharp dimacs_export dimacs_import dimension dimensionless dimensions dimensions_as_list direct directory discrete_freq disjoin disjointp disolate disp dispcon dispform dispfun dispJordan display disprule dispterms distrib divide divisors divsum dkummer_m dkummer_u dlange dodecahedron_graph dotproduct dotsimp dpart draw draw2d draw3d drawdf draw_file draw_graph dscalar echelon edge_coloring edge_connectivity edges eigens_by_jacobi eigenvalues eigenvectors eighth einstein eivals eivects elapsed_real_time elapsed_run_time ele2comp ele2polynome ele2pui elem elementp elevation_grid elim elim_allbut eliminate eliminate_using ellipse elliptic_e elliptic_ec elliptic_eu elliptic_f elliptic_kc elliptic_pi ematrix empty_graph emptyp endcons entermatrix entertensor entier equal equalp equiv_classes erf erfc erf_generalized erfi errcatch error errormsg errors euler ev eval_string evenp every evolution evolution2d evundiff example exp expand expandwrt expandwrt_factored expint expintegral_chi expintegral_ci expintegral_e expintegral_e1 expintegral_ei expintegral_e_simplify expintegral_li expintegral_shi expintegral_si explicit explose exponentialize express expt exsec extdiff extract_linear_equations extremal_subset ezgcd %f f90 facsum factcomb factor factorfacsum factorial factorout factorsum facts fast_central_elements fast_linsolve fasttimes featurep fernfale fft fib fibtophi fifth filename_merge file_search file_type fillarray findde find_root find_root_abs find_root_error find_root_rel first fix flatten flength float floatnump floor flower_snark flush flush1deriv flushd flushnd flush_output fmin_cobyla forget fortran fourcos fourexpand fourier fourier_elim fourint fourintcos fourintsin foursimp foursin fourth fposition frame_bracket freeof freshline fresnel_c fresnel_s from_adjacency_matrix frucht_graph full_listify fullmap fullmapl fullratsimp fullratsubst fullsetify funcsolve fundamental_dimensions fundamental_units fundef funmake funp fv g0 g1 gamma gamma_greek gamma_incomplete gamma_incomplete_generalized gamma_incomplete_regularized gauss gauss_a gauss_b gaussprob gcd gcdex gcdivide gcfac gcfactor gd generalized_lambert_w genfact gen_laguerre genmatrix gensym geo_amortization geo_annuity_fv geo_annuity_pv geomap geometric geometric_mean geosum get getcurrentdirectory get_edge_weight getenv get_lu_factors get_output_stream_string get_pixel get_plot_option get_tex_environment get_tex_environment_default get_vertex_label gfactor gfactorsum ggf girth global_variances gn gnuplot_close gnuplot_replot gnuplot_reset gnuplot_restart gnuplot_start go Gosper GosperSum gr2d gr3d gradef gramschmidt graph6_decode graph6_encode graph6_export graph6_import graph_center graph_charpoly graph_eigenvalues graph_flow graph_order graph_periphery graph_product graph_size graph_union great_rhombicosidodecahedron_graph great_rhombicuboctahedron_graph grid_graph grind grobner_basis grotzch_graph hamilton_cycle hamilton_path hankel hankel_1 hankel_2 harmonic harmonic_mean hav heawood_graph hermite hessian hgfred hilbertmap hilbert_matrix hipow histogram histogram_description hodge horner hypergeometric i0 i1 %ibes ic1 ic2 ic_convert ichr1 ichr2 icosahedron_graph icosidodecahedron_graph icurvature ident identfor identity idiff idim idummy ieqn %if ifactors iframes ifs igcdex igeodesic_coords ilt image imagpart imetric implicit implicit_derivative implicit_plot indexed_tensor indices induced_subgraph inferencep inference_result infix info_display init_atensor init_ctensor in_neighbors innerproduct inpart inprod inrt integerp integer_partitions integrate intersect intersection intervalp intopois intosum invariant1 invariant2 inverse_fft inverse_jacobi_cd inverse_jacobi_cn inverse_jacobi_cs inverse_jacobi_dc inverse_jacobi_dn inverse_jacobi_ds inverse_jacobi_nc inverse_jacobi_nd inverse_jacobi_ns inverse_jacobi_sc inverse_jacobi_sd inverse_jacobi_sn invert invert_by_adjoint invert_by_lu inv_mod irr is is_biconnected is_bipartite is_connected is_digraph is_edge_in_graph is_graph is_graph_or_digraph ishow is_isomorphic isolate isomorphism is_planar isqrt isreal_p is_sconnected is_tree is_vertex_in_graph items_inference %j j0 j1 jacobi jacobian jacobi_cd jacobi_cn jacobi_cs jacobi_dc jacobi_dn jacobi_ds jacobi_nc jacobi_nd jacobi_ns jacobi_p jacobi_sc jacobi_sd jacobi_sn JF jn join jordan julia julia_set julia_sin %k kdels kdelta kill killcontext kostka kron_delta kronecker_product kummer_m kummer_u kurtosis kurtosis_bernoulli kurtosis_beta kurtosis_binomial kurtosis_chi2 kurtosis_continuous_uniform kurtosis_discrete_uniform kurtosis_exp kurtosis_f kurtosis_gamma kurtosis_general_finite_discrete kurtosis_geometric kurtosis_gumbel kurtosis_hypergeometric kurtosis_laplace kurtosis_logistic kurtosis_lognormal kurtosis_negative_binomial kurtosis_noncentral_chi2 kurtosis_noncentral_student_t kurtosis_normal kurtosis_pareto kurtosis_poisson kurtosis_rayleigh kurtosis_student_t kurtosis_weibull label labels lagrange laguerre lambda lambert_w laplace laplacian_matrix last lbfgs lc2kdt lcharp lc_l lcm lc_u ldefint ldisp ldisplay legendre_p legendre_q leinstein length let letrules letsimp levi_civita lfreeof lgtreillis lhs li liediff limit Lindstedt linear linearinterpol linear_program linear_regression line_graph linsolve listarray list_correlations listify list_matrix_entries list_nc_monomials listoftens listofvars listp lmax lmin load loadfile local locate_matrix_entry log logcontract log_gamma lopow lorentz_gauge lowercasep lpart lratsubst lreduce lriemann lsquares_estimates lsquares_estimates_approximate lsquares_estimates_exact lsquares_mse lsquares_residual_mse lsquares_residuals lsum ltreillis lu_backsub lucas lu_factor %m macroexpand macroexpand1 make_array makebox makefact makegamma make_graph make_level_picture makelist makeOrders make_poly_continent make_poly_country make_polygon make_random_state make_rgb_picture makeset make_string_input_stream make_string_output_stream make_transform mandelbrot mandelbrot_set map mapatom maplist matchdeclare matchfix mat_cond mat_fullunblocker mat_function mathml_display mat_norm matrix matrixmap matrixp matrix_size mattrace mat_trace mat_unblocker max max_clique max_degree max_flow maximize_lp max_independent_set max_matching maybe md5sum mean mean_bernoulli mean_beta mean_binomial mean_chi2 mean_continuous_uniform mean_deviation mean_discrete_uniform mean_exp mean_f mean_gamma mean_general_finite_discrete mean_geometric mean_gumbel mean_hypergeometric mean_laplace mean_logistic mean_lognormal mean_negative_binomial mean_noncentral_chi2 mean_noncentral_student_t mean_normal mean_pareto mean_poisson mean_rayleigh mean_student_t mean_weibull median median_deviation member mesh metricexpandall mgf1_sha1 min min_degree min_edge_cut minfactorial minimalPoly minimize_lp minimum_spanning_tree minor minpack_lsquares minpack_solve min_vertex_cover min_vertex_cut mkdir mnewton mod mode_declare mode_identity ModeMatrix moebius mon2schur mono monomial_dimensions multibernstein_poly multi_display_for_texinfo multi_elem multinomial multinomial_coeff multi_orbit multiplot_mode multi_pui multsym multthru mycielski_graph nary natural_unit nc_degree ncexpt ncharpoly negative_picture neighbors new newcontext newdet new_graph newline newton new_variable next_prime nicedummies niceindices ninth nofix nonarray noncentral_moment nonmetricity nonnegintegerp nonscalarp nonzeroandfreeof notequal nounify nptetrad npv nroots nterms ntermst nthroot nullity nullspace num numbered_boundaries numberp number_to_octets num_distinct_partitions numerval numfactor num_partitions nusum nzeta nzetai nzetar octets_to_number octets_to_oid odd_girth oddp ode2 ode_check odelin oid_to_octets op opena opena_binary openr openr_binary openw openw_binary operatorp opsubst optimize %or orbit orbits ordergreat ordergreatp orderless orderlessp orthogonal_complement orthopoly_recur orthopoly_weight outermap out_neighbors outofpois pade parabolic_cylinder_d parametric parametric_surface parg parGosper parse_string parse_timedate part part2cont partfrac partition partition_set partpol path_digraph path_graph pathname_directory pathname_name pathname_type pdf_bernoulli pdf_beta pdf_binomial pdf_cauchy pdf_chi2 pdf_continuous_uniform pdf_discrete_uniform pdf_exp pdf_f pdf_gamma pdf_general_finite_discrete pdf_geometric pdf_gumbel pdf_hypergeometric pdf_laplace pdf_logistic pdf_lognormal pdf_negative_binomial pdf_noncentral_chi2 pdf_noncentral_student_t pdf_normal pdf_pareto pdf_poisson pdf_rank_sum pdf_rayleigh pdf_signed_rank pdf_student_t pdf_weibull pearson_skewness permanent permut permutation permutations petersen_graph petrov pickapart picture_equalp picturep piechart piechart_description planar_embedding playback plog plot2d plot3d plotdf ploteq plsquares pochhammer points poisdiff poisexpt poisint poismap poisplus poissimp poissubst poistimes poistrim polar polarform polartorect polar_to_xy poly_add poly_buchberger poly_buchberger_criterion poly_colon_ideal poly_content polydecomp poly_depends_p poly_elimination_ideal poly_exact_divide poly_expand poly_expt poly_gcd polygon poly_grobner poly_grobner_equal poly_grobner_member poly_grobner_subsetp poly_ideal_intersection poly_ideal_polysaturation poly_ideal_polysaturation1 poly_ideal_saturation poly_ideal_saturation1 poly_lcm poly_minimization polymod poly_multiply polynome2ele polynomialp poly_normal_form poly_normalize poly_normalize_list poly_polysaturation_extension poly_primitive_part poly_pseudo_divide poly_reduced_grobner poly_reduction poly_saturation_extension poly_s_polynomial poly_subtract polytocompanion pop postfix potential power_mod powerseries powerset prefix prev_prime primep primes principal_components print printf printfile print_graph printpois printprops prodrac product properties propvars psi psubst ptriangularize pui pui2comp pui2ele pui2polynome pui_direct puireduc push put pv qput qrange qty quad_control quad_qag quad_qagi quad_qagp quad_qags quad_qawc quad_qawf quad_qawo quad_qaws quadrilateral quantile quantile_bernoulli quantile_beta quantile_binomial quantile_cauchy quantile_chi2 quantile_continuous_uniform quantile_discrete_uniform quantile_exp quantile_f quantile_gamma quantile_general_finite_discrete quantile_geometric quantile_gumbel quantile_hypergeometric quantile_laplace quantile_logistic quantile_lognormal quantile_negative_binomial quantile_noncentral_chi2 quantile_noncentral_student_t quantile_normal quantile_pareto quantile_poisson quantile_rayleigh quantile_student_t quantile_weibull quartile_skewness quit qunit quotient racah_v racah_w radcan radius random random_bernoulli random_beta random_binomial random_bipartite_graph random_cauchy random_chi2 random_continuous_uniform random_digraph random_discrete_uniform random_exp random_f random_gamma random_general_finite_discrete random_geometric random_graph random_graph1 random_gumbel random_hypergeometric random_laplace random_logistic random_lognormal random_negative_binomial random_network random_noncentral_chi2 random_noncentral_student_t random_normal random_pareto random_permutation random_poisson random_rayleigh random_regular_graph random_student_t random_tournament random_tree random_weibull range rank rat ratcoef ratdenom ratdiff ratdisrep ratexpand ratinterpol rational rationalize ratnumer ratnump ratp ratsimp ratsubst ratvars ratweight read read_array read_binary_array read_binary_list read_binary_matrix readbyte readchar read_hashed_array readline read_list read_matrix read_nested_list readonly read_xpm real_imagpart_to_conjugate realpart realroots rearray rectangle rectform rectform_log_if_constant recttopolar rediff reduce_consts reduce_order region region_boundaries region_boundaries_plus rem remainder remarray rembox remcomps remcon remcoord remfun remfunction remlet remove remove_constvalue remove_dimensions remove_edge remove_fundamental_dimensions remove_fundamental_units remove_plot_option remove_vertex rempart remrule remsym remvalue rename rename_file reset reset_displays residue resolvante resolvante_alternee1 resolvante_bipartite resolvante_diedrale resolvante_klein resolvante_klein3 resolvante_produit_sym resolvante_unitaire resolvante_vierer rest resultant return reveal reverse revert revert2 rgb2level rhs ricci riemann rinvariant risch rk rmdir rncombine romberg room rootscontract round row rowop rowswap rreduce run_testsuite %s save saving scalarp scaled_bessel_i scaled_bessel_i0 scaled_bessel_i1 scalefactors scanmap scatterplot scatterplot_description scene schur2comp sconcat scopy scsimp scurvature sdowncase sec sech second sequal sequalignore set_alt_display setdifference set_draw_defaults set_edge_weight setelmx setequalp setify setp set_partitions set_plot_option set_prompt set_random_state set_tex_environment set_tex_environment_default setunits setup_autoload set_up_dot_simplifications set_vertex_label seventh sexplode sf sha1sum sha256sum shortest_path shortest_weighted_path show showcomps showratvars sierpinskiale sierpinskimap sign signum similaritytransform simp_inequality simplify_sum simplode simpmetderiv simtran sin sinh sinsert sinvertcase sixth skewness skewness_bernoulli skewness_beta skewness_binomial skewness_chi2 skewness_continuous_uniform skewness_discrete_uniform skewness_exp skewness_f skewness_gamma skewness_general_finite_discrete skewness_geometric skewness_gumbel skewness_hypergeometric skewness_laplace skewness_logistic skewness_lognormal skewness_negative_binomial skewness_noncentral_chi2 skewness_noncentral_student_t skewness_normal skewness_pareto skewness_poisson skewness_rayleigh skewness_student_t skewness_weibull slength smake small_rhombicosidodecahedron_graph small_rhombicuboctahedron_graph smax smin smismatch snowmap snub_cube_graph snub_dodecahedron_graph solve solve_rec solve_rec_rat some somrac sort sparse6_decode sparse6_encode sparse6_export sparse6_import specint spherical spherical_bessel_j spherical_bessel_y spherical_hankel1 spherical_hankel2 spherical_harmonic spherical_to_xyz splice split sposition sprint sqfr sqrt sqrtdenest sremove sremovefirst sreverse ssearch ssort sstatus ssubst ssubstfirst staircase standardize standardize_inverse_trig starplot starplot_description status std std1 std_bernoulli std_beta std_binomial std_chi2 std_continuous_uniform std_discrete_uniform std_exp std_f std_gamma std_general_finite_discrete std_geometric std_gumbel std_hypergeometric std_laplace std_logistic std_lognormal std_negative_binomial std_noncentral_chi2 std_noncentral_student_t std_normal std_pareto std_poisson std_rayleigh std_student_t std_weibull stemplot stirling stirling1 stirling2 strim striml strimr string stringout stringp strong_components struve_h struve_l sublis sublist sublist_indices submatrix subsample subset subsetp subst substinpart subst_parallel substpart substring subvar subvarp sum sumcontract summand_to_rec supcase supcontext symbolp symmdifference symmetricp system take_channel take_inference tan tanh taylor taylorinfo taylorp taylor_simplifier taytorat tcl_output tcontract tellrat tellsimp tellsimpafter tentex tenth test_mean test_means_difference test_normality test_proportion test_proportions_difference test_rank_sum test_sign test_signed_rank test_variance test_variance_ratio tex tex1 tex_display texput %th third throw time timedate timer timer_info tldefint tlimit todd_coxeter toeplitz tokens to_lisp topological_sort to_poly to_poly_solve totaldisrep totalfourier totient tpartpol trace tracematrix trace_options transform_sample translate translate_file transpose treefale tree_reduce treillis treinat triangle triangularize trigexpand trigrat trigreduce trigsimp trunc truncate truncated_cube_graph truncated_dodecahedron_graph truncated_icosahedron_graph truncated_tetrahedron_graph tr_warnings_get tube tutte_graph ueivects uforget ultraspherical underlying_graph undiff union unique uniteigenvectors unitp units unit_step unitvector unorder unsum untellrat untimer untrace uppercasep uricci uriemann uvect vandermonde_matrix var var1 var_bernoulli var_beta var_binomial var_chi2 var_continuous_uniform var_discrete_uniform var_exp var_f var_gamma var_general_finite_discrete var_geometric var_gumbel var_hypergeometric var_laplace var_logistic var_lognormal var_negative_binomial var_noncentral_chi2 var_noncentral_student_t var_normal var_pareto var_poisson var_rayleigh var_student_t var_weibull vector vectorpotential vectorsimp verbify vers vertex_coloring vertex_connectivity vertex_degree vertex_distance vertex_eccentricity vertex_in_degree vertex_out_degree vertices vertices_to_cycle vertices_to_path %w weyl wheel_graph wiener_index wigner_3j wigner_6j wigner_9j with_stdout write_binary_data writebyte write_data writefile wronskian xreduce xthru %y Zeilberger zeroequiv zerofor zeromatrix zeromatrixp zeta zgeev zheev zlange zn_add_table zn_carmichael_lambda zn_characteristic_factors zn_determinant zn_factor_generators zn_invert_by_lu zn_log zn_mult_table absboxchar activecontexts adapt_depth additive adim aform algebraic algepsilon algexact aliases allbut all_dotsimp_denoms allocation allsym alphabetic animation antisymmetric arrays askexp assume_pos assume_pos_pred assumescalar asymbol atomgrad atrig1 axes axis_3d axis_bottom axis_left axis_right axis_top azimuth background background_color backsubst berlefact bernstein_explicit besselexpand beta_args_sum_to_integer beta_expand bftorat bftrunc bindtest border boundaries_array box boxchar breakup %c capping cauchysum cbrange cbtics center cflength cframe_flag cnonmet_flag color color_bar color_bar_tics colorbox columns commutative complex cone context contexts contour contour_levels cosnpiflag ctaypov ctaypt ctayswitch ctayvar ct_coords ctorsion_flag ctrgsimp cube current_let_rule_package cylinder data_file_name debugmode decreasing default_let_rule_package delay dependencies derivabbrev derivsubst detout diagmetric diff dim dimensions dispflag display2d|10 display_format_internal distribute_over doallmxops domain domxexpt domxmxops domxnctimes dontfactor doscmxops doscmxplus dot0nscsimp dot0simp dot1simp dotassoc dotconstrules dotdistrib dotexptsimp dotident dotscrules draw_graph_program draw_realpart edge_color edge_coloring edge_partition edge_type edge_width %edispflag elevation %emode endphi endtheta engineering_format_floats enhanced3d %enumer epsilon_lp erfflag erf_representation errormsg error_size error_syms error_type %e_to_numlog eval even evenfun evflag evfun ev_point expandwrt_denom expintexpand expintrep expon expop exptdispflag exptisolate exptsubst facexpand facsum_combine factlim factorflag factorial_expand factors_only fb feature features file_name file_output_append file_search_demo file_search_lisp file_search_maxima|10 file_search_tests file_search_usage file_type_lisp file_type_maxima|10 fill_color fill_density filled_func fixed_vertices flipflag float2bf font font_size fortindent fortspaces fpprec fpprintprec functions gamma_expand gammalim gdet genindex gensumnum GGFCFMAX GGFINFINITY globalsolve gnuplot_command gnuplot_curve_styles gnuplot_curve_titles gnuplot_default_term_command gnuplot_dumb_term_command gnuplot_file_args gnuplot_file_name gnuplot_out_file gnuplot_pdf_term_command gnuplot_pm3d gnuplot_png_term_command gnuplot_postamble gnuplot_preamble gnuplot_ps_term_command gnuplot_svg_term_command gnuplot_term gnuplot_view_args Gosper_in_Zeilberger gradefs grid grid2d grind halfangles head_angle head_both head_length head_type height hypergeometric_representation %iargs ibase icc1 icc2 icounter idummyx ieqnprint ifb ifc1 ifc2 ifg ifgi ifr iframe_bracket_form ifri igeowedge_flag ikt1 ikt2 imaginary inchar increasing infeval infinity inflag infolists inm inmc1 inmc2 intanalysis integer integervalued integrate_use_rootsof integration_constant integration_constant_counter interpolate_color intfaclim ip_grid ip_grid_in irrational isolate_wrt_times iterations itr julia_parameter %k1 %k2 keepfloat key key_pos kinvariant kt label label_alignment label_orientation labels lassociative lbfgs_ncorrections lbfgs_nfeval_max leftjust legend letrat let_rule_packages lfg lg lhospitallim limsubst linear linear_solver linechar linel|10 linenum line_type linewidth line_width linsolve_params linsolvewarn lispdisp listarith listconstvars listdummyvars lmxchar load_pathname loadprint logabs logarc logcb logconcoeffp logexpand lognegint logsimp logx logx_secondary logy logy_secondary logz lriem m1pbranch macroexpansion macros mainvar manual_demo maperror mapprint matrix_element_add matrix_element_mult matrix_element_transpose maxapplydepth maxapplyheight maxima_tempdir|10 maxima_userdir|10 maxnegex MAX_ORD maxposex maxpsifracdenom maxpsifracnum maxpsinegint maxpsiposint maxtayorder mesh_lines_color method mod_big_prime mode_check_errorp mode_checkp mode_check_warnp mod_test mod_threshold modular_linear_solver modulus multiplicative multiplicities myoptions nary negdistrib negsumdispflag newline newtonepsilon newtonmaxiter nextlayerfactor niceindicespref nm nmc noeval nolabels nonegative_lp noninteger nonscalar noun noundisp nouns np npi nticks ntrig numer numer_pbranch obase odd oddfun opacity opproperties opsubst optimprefix optionset orientation origin orthopoly_returns_intervals outative outchar packagefile palette partswitch pdf_file pfeformat phiresolution %piargs piece pivot_count_sx pivot_max_sx plot_format plot_options plot_realpart png_file pochhammer_max_index points pointsize point_size points_joined point_type poislim poisson poly_coefficient_ring poly_elimination_order polyfactor poly_grobner_algorithm poly_grobner_debug poly_monomial_order poly_primary_elimination_order poly_return_term_list poly_secondary_elimination_order poly_top_reduction_only posfun position powerdisp pred prederror primep_number_of_tests product_use_gamma program programmode promote_float_to_bigfloat prompt proportional_axes props psexpand ps_file radexpand radius radsubstflag rassociative ratalgdenom ratchristof ratdenomdivide rateinstein ratepsilon ratfac rational ratmx ratprint ratriemann ratsimpexpons ratvarswitch ratweights ratweyl ratwtlvl real realonly redraw refcheck resolution restart resultant ric riem rmxchar %rnum_list rombergabs rombergit rombergmin rombergtol rootsconmode rootsepsilon run_viewer same_xy same_xyz savedef savefactors scalar scalarmatrixp scale scale_lp setcheck setcheckbreak setval show_edge_color show_edges show_edge_type show_edge_width show_id show_label showtime show_vertex_color show_vertex_size show_vertex_type show_vertices show_weight simp simplified_output simplify_products simpproduct simpsum sinnpiflag solvedecomposes solveexplicit solvefactors solvenullwarn solveradcan solvetrigwarn space sparse sphere spring_embedding_depth sqrtdispflag stardisp startphi starttheta stats_numer stringdisp structures style sublis_apply_lambda subnumsimp sumexpand sumsplitfact surface surface_hide svg_file symmetric tab taylordepth taylor_logexpand taylor_order_coefficients taylor_truncate_polynomials tensorkill terminal testsuite_files thetaresolution timer_devalue title tlimswitch tr track transcompile transform transform_xy translate_fast_arrays transparent transrun tr_array_as_ref tr_bound_function_applyp tr_file_tty_messagesp tr_float_can_branch_complex tr_function_call_default trigexpandplus trigexpandtimes triginverses trigsign trivial_solutions tr_numer tr_optimize_max_loop tr_semicompile tr_state_vars tr_warn_bad_function_calls tr_warn_fexpr tr_warn_meval tr_warn_mode tr_warn_undeclared tr_warn_undefined_variable tstep ttyoff tube_extremes ufg ug %unitexpand unit_vectors uric uriem use_fast_arrays user_preamble usersetunits values vect_cross verbose vertex_color vertex_coloring vertex_partition vertex_size vertex_type view warnings weyl width windowname windowtitle wired_surface wireframe xaxis xaxis_color xaxis_secondary xaxis_type xaxis_width xlabel xlabel_secondary xlength xrange xrange_secondary xtics xtics_axis xtics_rotate xtics_rotate_secondary xtics_secondary xtics_secondary_axis xu_grid x_voxel xy_file xyplane xy_scale yaxis yaxis_color yaxis_secondary yaxis_type yaxis_width ylabel ylabel_secondary ylength yrange yrange_secondary ytics ytics_axis ytics_rotate ytics_rotate_secondary ytics_secondary ytics_secondary_axis yv_grid y_voxel yx_ratio zaxis zaxis_color zaxis_type zaxis_width zeroa zerob zerobern zeta%pi zlabel zlabel_rotate zlength zmin zn_primroot_limit zn_primroot_pretest",
      symbol: "_ __ %|0 %%|0"
    },
    contains: [
      {
        className: "comment",
        begin: "/\\*",
        end: "\\*/",
        contains: ["self"]
      },
      t.QUOTE_STRING_MODE,
      {
        className: "number",
        relevance: 0,
        variants: [
          {
            // float number w/ exponent
            // hmm, I wonder if we ought to include other exponent markers?
            begin: "\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Ee][-+]?\\d+\\b"
          },
          {
            // bigfloat number
            begin: "\\b(\\d+|\\d+\\.|\\.\\d+|\\d+\\.\\d+)[Bb][-+]?\\d+\\b",
            relevance: 10
          },
          {
            // float number w/out exponent
            // Doesn't seem to recognize floats which start with '.'
            begin: "\\b(\\.\\d+|\\d+\\.\\d+)\\b"
          },
          {
            // integer in base up to 36
            // Doesn't seem to recognize integers which end with '.'
            begin: "\\b(\\d+|0[0-9A-Za-z]+)\\.?\\b"
          }
        ]
      }
    ],
    illegal: /@/
  };
}
function cD(t) {
  return {
    name: "MEL",
    keywords: "int float string vector matrix if else switch case default while do for in break continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor animDisplay animView annotate appendStringArray applicationName applyAttrPreset applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem componentEditor compositingInterop computePolysetVolume condition cone confirmDialog connectAttr connectControl connectDynamic connectJoint connectionInfo constrain constrainValue constructionHistory container containsMultibyte contextInfo control convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse currentCtx currentTime currentTimeCtx currentUnit curve curveAddPtCtx curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected displayColor displayCull displayLevelOfDetail displayPref displayRGBColor displaySmoothness displayStats displayString displaySurface distanceDimContext distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor editorTemplate effector emit emitter enableDevice encodeString endString endsWith env equivalent equivalentTol erf error eval evalDeferred evalEcho event exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo filetest filletCurve filter filterCurve filterExpand filterStudioImport findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss geometryConstraint getApplicationVersionAsFloat getAttr getClassification getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation listNodeTypes listPanelCategories listRelatives listSets listTransforms listUnselected listerEditor loadFluid loadNewShelf loadPlugin loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration panelHistory paramDimContext paramDimension paramLocator parent parentConstraint particle particleExists particleInstancer particleRenderInfo partition pasteKey pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE registerPluginResource rehash reloadImage removeJoint removeMultiInstance removePanelCategory rename renameAttr renameSelectionList renameUI render renderGlobalsNode renderInfo renderLayerButton renderLayerParent renderLayerPostProcess renderLayerUnparent renderManip renderPartition renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor renderWindowSelectContext renderer reorder reorderDeformers requires reroot resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType selectedNodes selectionConnection separator setAttr setAttrEnumResource setAttrMapping setAttrNiceNameResource setConstraintRestPosition setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField shortNameOf showHelp showHidden showManipCtx showSelectionInTitle showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString stringToStringArray strip stripPrefixFromName stroke subdAutoProjection subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList textToShelf textureDisplacePlane textureHairColor texturePlacementContext textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper trace track trackCtx transferAttributes transformCompare transformLimits translator trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform",
    illegal: "</",
    contains: [
      t.C_NUMBER_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      {
        className: "string",
        begin: "`",
        end: "`",
        contains: [t.BACKSLASH_ESCAPE]
      },
      {
        // eats variables
        begin: /[$%@](\^\w\b|#\w+|[^\s\w{]|\{\w+\}|\w+)/
      },
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE
    ]
  };
}
function uD(t) {
  const e = {
    keyword: "module use_module import_module include_module end_module initialise mutable initialize finalize finalise interface implementation pred mode func type inst solver any_pred any_func is semidet det nondet multi erroneous failure cc_nondet cc_multi typeclass instance where pragma promise external trace atomic or_else require_complete_switch require_det require_semidet require_multi require_nondet require_cc_multi require_cc_nondet require_erroneous require_failure",
    meta: (
      // pragma
      "inline no_inline type_spec source_file fact_table obsolete memo loop_check minimal_model terminates does_not_terminate check_termination promise_equivalent_clauses foreign_proc foreign_decl foreign_code foreign_type foreign_import_module foreign_export_enum foreign_export foreign_enum may_call_mercury will_not_call_mercury thread_safe not_thread_safe maybe_thread_safe promise_pure promise_semipure tabled_for_io local untrailed trailed attach_to_io_state can_pass_as_mercury_type stable will_not_throw_exception may_modify_trail will_not_modify_trail may_duplicate may_not_duplicate affects_liveness does_not_affect_liveness doesnt_affect_liveness no_sharing unknown_sharing sharing"
    ),
    built_in: "some all not if then else true fail false try catch catch_any semidet_true semidet_false semidet_fail impure_true impure semipure"
  }, n = t.COMMENT("%", "$"), r = {
    className: "number",
    begin: "0'.\\|0[box][0-9a-fA-F]*"
  }, i = t.inherit(t.APOS_STRING_MODE, { relevance: 0 }), o = t.inherit(t.QUOTE_STRING_MODE, { relevance: 0 }), a = {
    className: "subst",
    begin: "\\\\[abfnrtv]\\|\\\\x[0-9a-fA-F]*\\\\\\|%[-+# *.0-9]*[dioxXucsfeEgGp]",
    relevance: 0
  };
  return o.contains = o.contains.slice(), o.contains.push(a), {
    name: "Mercury",
    aliases: [
      "m",
      "moo"
    ],
    keywords: e,
    contains: [
      {
        className: "built_in",
        variants: [
          { begin: "<=>" },
          {
            begin: "<=",
            relevance: 0
          },
          {
            begin: "=>",
            relevance: 0
          },
          { begin: "/\\\\" },
          { begin: "\\\\/" }
        ]
      },
      {
        className: "built_in",
        variants: [
          { begin: ":-\\|-->" },
          {
            begin: "=",
            relevance: 0
          }
        ]
      },
      n,
      t.C_BLOCK_COMMENT_MODE,
      r,
      t.NUMBER_MODE,
      i,
      o,
      {
        // relevance booster
        begin: /:-/
      },
      {
        // relevance booster
        begin: /\.$/
      }
    ]
  };
}
function dD(t) {
  return {
    name: "MIPS Assembly",
    case_insensitive: !0,
    aliases: ["mips"],
    keywords: {
      $pattern: "\\.?" + t.IDENT_RE,
      meta: (
        // GNU preprocs
        ".2byte .4byte .align .ascii .asciz .balign .byte .code .data .else .end .endif .endm .endr .equ .err .exitm .extern .global .hword .if .ifdef .ifndef .include .irp .long .macro .rept .req .section .set .skip .space .text .word .ltorg "
      ),
      built_in: "$0 $1 $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20 $21 $22 $23 $24 $25 $26 $27 $28 $29 $30 $31 zero at v0 v1 a0 a1 a2 a3 a4 a5 a6 a7 t0 t1 t2 t3 t4 t5 t6 t7 t8 t9 s0 s1 s2 s3 s4 s5 s6 s7 s8 k0 k1 gp sp fp ra $f0 $f1 $f2 $f2 $f4 $f5 $f6 $f7 $f8 $f9 $f10 $f11 $f12 $f13 $f14 $f15 $f16 $f17 $f18 $f19 $f20 $f21 $f22 $f23 $f24 $f25 $f26 $f27 $f28 $f29 $f30 $f31 Context Random EntryLo0 EntryLo1 Context PageMask Wired EntryHi HWREna BadVAddr Count Compare SR IntCtl SRSCtl SRSMap Cause EPC PRId EBase Config Config1 Config2 Config3 LLAddr Debug DEPC DESAVE CacheErr ECC ErrorEPC TagLo DataLo TagHi DataHi WatchLo WatchHi PerfCtl PerfCnt "
      // Coprocessor 0 registers
    },
    contains: [
      {
        className: "keyword",
        begin: "\\b(addi?u?|andi?|b(al)?|beql?|bgez(al)?l?|bgtzl?|blezl?|bltz(al)?l?|bnel?|cl[oz]|divu?|ext|ins|j(al)?|jalr(\\.hb)?|jr(\\.hb)?|lbu?|lhu?|ll|lui|lw[lr]?|maddu?|mfhi|mflo|movn|movz|move|msubu?|mthi|mtlo|mul|multu?|nop|nor|ori?|rotrv?|sb|sc|se[bh]|sh|sllv?|slti?u?|srav?|srlv?|subu?|sw[lr]?|xori?|wsbh|abs\\.[sd]|add\\.[sd]|alnv.ps|bc1[ft]l?|c\\.(s?f|un|u?eq|[ou]lt|[ou]le|ngle?|seq|l[et]|ng[et])\\.[sd]|(ceil|floor|round|trunc)\\.[lw]\\.[sd]|cfc1|cvt\\.d\\.[lsw]|cvt\\.l\\.[dsw]|cvt\\.ps\\.s|cvt\\.s\\.[dlw]|cvt\\.s\\.p[lu]|cvt\\.w\\.[dls]|div\\.[ds]|ldx?c1|luxc1|lwx?c1|madd\\.[sd]|mfc1|mov[fntz]?\\.[ds]|msub\\.[sd]|mth?c1|mul\\.[ds]|neg\\.[ds]|nmadd\\.[ds]|nmsub\\.[ds]|p[lu][lu]\\.ps|recip\\.fmt|r?sqrt\\.[ds]|sdx?c1|sub\\.[ds]|suxc1|swx?c1|break|cache|d?eret|[de]i|ehb|mfc0|mtc0|pause|prefx?|rdhwr|rdpgpr|sdbbp|ssnop|synci?|syscall|teqi?|tgei?u?|tlb(p|r|w[ir])|tlti?u?|tnei?|wait|wrpgpr)",
        end: "\\s"
      },
      // lines ending with ; or # aren't really comments, probably auto-detect fail
      t.COMMENT("[;#](?!\\s*$)", "$"),
      t.C_BLOCK_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      {
        className: "string",
        begin: "'",
        end: "[^\\\\]'",
        relevance: 0
      },
      {
        className: "title",
        begin: "\\|",
        end: "\\|",
        illegal: "\\n",
        relevance: 0
      },
      {
        className: "number",
        variants: [
          {
            // hex
            begin: "0x[0-9a-f]+"
          },
          {
            // bare number
            begin: "\\b-?\\d+"
          }
        ],
        relevance: 0
      },
      {
        className: "symbol",
        variants: [
          {
            // GNU MIPS syntax
            begin: "^\\s*[a-z_\\.\\$][a-z0-9_\\.\\$]+:"
          },
          {
            // numbered local labels
            begin: "^\\s*[0-9]+:"
          },
          {
            // number local label reference (backwards, forwards)
            begin: "[0-9]+[bf]"
          }
        ],
        relevance: 0
      }
    ],
    // forward slashes are not allowed
    illegal: /\//
  };
}
function pD(t) {
  return {
    name: "Mizar",
    keywords: "environ vocabularies notations constructors definitions registrations theorems schemes requirements begin end definition registration cluster existence pred func defpred deffunc theorem proof let take assume then thus hence ex for st holds consider reconsider such that and in provided of as from be being by means equals implies iff redefine define now not or attr is mode suppose per cases set thesis contradiction scheme reserve struct correctness compatibility coherence symmetry assymetry reflexivity irreflexivity connectedness uniqueness commutativity idempotence involutiveness projectivity",
    contains: [t.COMMENT("::", "$")]
  };
}
function _D(t) {
  return {
    name: "Mojolicious",
    subLanguage: "xml",
    contains: [
      {
        className: "meta",
        begin: "^__(END|DATA)__$"
      },
      // mojolicious line
      {
        begin: "^\\s*%{1,2}={0,2}",
        end: "$",
        subLanguage: "perl"
      },
      // mojolicious block
      {
        begin: "<%{1,2}={0,2}",
        end: "={0,1}%>",
        subLanguage: "perl",
        excludeBegin: !0,
        excludeEnd: !0
      }
    ]
  };
}
function mD(t) {
  const e = {
    className: "number",
    relevance: 0,
    variants: [
      { begin: "[$][a-fA-F0-9]+" },
      t.NUMBER_MODE
    ]
  }, n = {
    variants: [
      { match: [
        /(function|method)/,
        /\s+/,
        t.UNDERSCORE_IDENT_RE
      ] }
    ],
    scope: {
      1: "keyword",
      3: "title.function"
    }
  }, r = {
    variants: [
      { match: [
        /(class|interface|extends|implements)/,
        /\s+/,
        t.UNDERSCORE_IDENT_RE
      ] }
    ],
    scope: {
      1: "keyword",
      3: "title.class"
    }
  };
  return {
    name: "Monkey",
    case_insensitive: !0,
    keywords: {
      keyword: [
        "public",
        "private",
        "property",
        "continue",
        "exit",
        "extern",
        "new",
        "try",
        "catch",
        "eachin",
        "not",
        "abstract",
        "final",
        "select",
        "case",
        "default",
        "const",
        "local",
        "global",
        "field",
        "end",
        "if",
        "then",
        "else",
        "elseif",
        "endif",
        "while",
        "wend",
        "repeat",
        "until",
        "forever",
        "for",
        "to",
        "step",
        "next",
        "return",
        "module",
        "inline",
        "throw",
        "import",
        // not positive, but these are not literals
        "and",
        "or",
        "shl",
        "shr",
        "mod"
      ],
      built_in: [
        "DebugLog",
        "DebugStop",
        "Error",
        "Print",
        "ACos",
        "ACosr",
        "ASin",
        "ASinr",
        "ATan",
        "ATan2",
        "ATan2r",
        "ATanr",
        "Abs",
        "Abs",
        "Ceil",
        "Clamp",
        "Clamp",
        "Cos",
        "Cosr",
        "Exp",
        "Floor",
        "Log",
        "Max",
        "Max",
        "Min",
        "Min",
        "Pow",
        "Sgn",
        "Sgn",
        "Sin",
        "Sinr",
        "Sqrt",
        "Tan",
        "Tanr",
        "Seed",
        "PI",
        "HALFPI",
        "TWOPI"
      ],
      literal: [
        "true",
        "false",
        "null"
      ]
    },
    illegal: /\/\*/,
    contains: [
      t.COMMENT("#rem", "#end"),
      t.COMMENT(
        "'",
        "$",
        { relevance: 0 }
      ),
      n,
      r,
      {
        className: "variable.language",
        begin: /\b(self|super)\b/
      },
      {
        className: "meta",
        begin: /\s*#/,
        end: "$",
        keywords: { keyword: "if else elseif endif end then" }
      },
      {
        match: [
          /^\s*/,
          /strict\b/
        ],
        scope: { 2: "meta" }
      },
      {
        beginKeywords: "alias",
        end: "=",
        contains: [t.UNDERSCORE_TITLE_MODE]
      },
      t.QUOTE_STRING_MODE,
      e
    ]
  };
}
function fD(t) {
  const e = {
    keyword: (
      // Moonscript keywords
      "if then not for in while do return else elseif break continue switch and or unless when class extends super local import export from using"
    ),
    literal: "true false nil",
    built_in: "_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug io math os package string table"
  }, n = "[A-Za-z$_][0-9A-Za-z$_]*", r = {
    className: "subst",
    begin: /#\{/,
    end: /\}/,
    keywords: e
  }, i = [
    t.inherit(
      t.C_NUMBER_MODE,
      { starts: {
        end: "(\\s*/)?",
        relevance: 0
      } }
    ),
    // a number tries to eat the following slash to prevent treating it as a regexp
    {
      className: "string",
      variants: [
        {
          begin: /'/,
          end: /'/,
          contains: [t.BACKSLASH_ESCAPE]
        },
        {
          begin: /"/,
          end: /"/,
          contains: [
            t.BACKSLASH_ESCAPE,
            r
          ]
        }
      ]
    },
    {
      className: "built_in",
      begin: "@__" + t.IDENT_RE
    },
    {
      begin: "@" + t.IDENT_RE
      // relevance booster on par with CoffeeScript
    },
    {
      begin: t.IDENT_RE + "\\\\" + t.IDENT_RE
      // inst\method
    }
  ];
  r.contains = i;
  const o = t.inherit(t.TITLE_MODE, { begin: n }), a = "(\\(.*\\)\\s*)?\\B[-=]>", s = {
    className: "params",
    begin: "\\([^\\(]",
    returnBegin: !0,
    /* We need another contained nameless mode to not have every nested
    pair of parens to be called "params" */
    contains: [
      {
        begin: /\(/,
        end: /\)/,
        keywords: e,
        contains: ["self"].concat(i)
      }
    ]
  };
  return {
    name: "MoonScript",
    aliases: ["moon"],
    keywords: e,
    illegal: /\/\*/,
    contains: i.concat([
      t.COMMENT("--", "$"),
      {
        className: "function",
        // function: -> =>
        begin: "^\\s*" + n + "\\s*=\\s*" + a,
        end: "[-=]>",
        returnBegin: !0,
        contains: [
          o,
          s
        ]
      },
      {
        begin: /[\(,:=]\s*/,
        // anonymous function start
        relevance: 0,
        contains: [
          {
            className: "function",
            begin: a,
            end: "[-=]>",
            returnBegin: !0,
            contains: [s]
          }
        ]
      },
      {
        className: "class",
        beginKeywords: "class",
        end: "$",
        illegal: /[:="\[\]]/,
        contains: [
          {
            beginKeywords: "extends",
            endsWithParent: !0,
            illegal: /[:="\[\]]/,
            contains: [o]
          },
          o
        ]
      },
      {
        className: "name",
        // table
        begin: n + ":",
        end: ":",
        returnBegin: !0,
        returnEnd: !0,
        relevance: 0
      }
    ])
  };
}
function gD(t) {
  return {
    name: "N1QL",
    case_insensitive: !0,
    contains: [
      {
        beginKeywords: "build create index delete drop explain infer|10 insert merge prepare select update upsert|10",
        end: /;/,
        keywords: {
          keyword: [
            "all",
            "alter",
            "analyze",
            "and",
            "any",
            "array",
            "as",
            "asc",
            "begin",
            "between",
            "binary",
            "boolean",
            "break",
            "bucket",
            "build",
            "by",
            "call",
            "case",
            "cast",
            "cluster",
            "collate",
            "collection",
            "commit",
            "connect",
            "continue",
            "correlate",
            "cover",
            "create",
            "database",
            "dataset",
            "datastore",
            "declare",
            "decrement",
            "delete",
            "derived",
            "desc",
            "describe",
            "distinct",
            "do",
            "drop",
            "each",
            "element",
            "else",
            "end",
            "every",
            "except",
            "exclude",
            "execute",
            "exists",
            "explain",
            "fetch",
            "first",
            "flatten",
            "for",
            "force",
            "from",
            "function",
            "grant",
            "group",
            "gsi",
            "having",
            "if",
            "ignore",
            "ilike",
            "in",
            "include",
            "increment",
            "index",
            "infer",
            "inline",
            "inner",
            "insert",
            "intersect",
            "into",
            "is",
            "join",
            "key",
            "keys",
            "keyspace",
            "known",
            "last",
            "left",
            "let",
            "letting",
            "like",
            "limit",
            "lsm",
            "map",
            "mapping",
            "matched",
            "materialized",
            "merge",
            "minus",
            "namespace",
            "nest",
            "not",
            "number",
            "object",
            "offset",
            "on",
            "option",
            "or",
            "order",
            "outer",
            "over",
            "parse",
            "partition",
            "password",
            "path",
            "pool",
            "prepare",
            "primary",
            "private",
            "privilege",
            "procedure",
            "public",
            "raw",
            "realm",
            "reduce",
            "rename",
            "return",
            "returning",
            "revoke",
            "right",
            "role",
            "rollback",
            "satisfies",
            "schema",
            "select",
            "self",
            "semi",
            "set",
            "show",
            "some",
            "start",
            "statistics",
            "string",
            "system",
            "then",
            "to",
            "transaction",
            "trigger",
            "truncate",
            "under",
            "union",
            "unique",
            "unknown",
            "unnest",
            "unset",
            "update",
            "upsert",
            "use",
            "user",
            "using",
            "validate",
            "value",
            "valued",
            "values",
            "via",
            "view",
            "when",
            "where",
            "while",
            "with",
            "within",
            "work",
            "xor"
          ],
          literal: [
            "true",
            "false",
            "null",
            "missing|5"
          ],
          built_in: [
            "array_agg",
            "array_append",
            "array_concat",
            "array_contains",
            "array_count",
            "array_distinct",
            "array_ifnull",
            "array_length",
            "array_max",
            "array_min",
            "array_position",
            "array_prepend",
            "array_put",
            "array_range",
            "array_remove",
            "array_repeat",
            "array_replace",
            "array_reverse",
            "array_sort",
            "array_sum",
            "avg",
            "count",
            "max",
            "min",
            "sum",
            "greatest",
            "least",
            "ifmissing",
            "ifmissingornull",
            "ifnull",
            "missingif",
            "nullif",
            "ifinf",
            "ifnan",
            "ifnanorinf",
            "naninf",
            "neginfif",
            "posinfif",
            "clock_millis",
            "clock_str",
            "date_add_millis",
            "date_add_str",
            "date_diff_millis",
            "date_diff_str",
            "date_part_millis",
            "date_part_str",
            "date_trunc_millis",
            "date_trunc_str",
            "duration_to_str",
            "millis",
            "str_to_millis",
            "millis_to_str",
            "millis_to_utc",
            "millis_to_zone_name",
            "now_millis",
            "now_str",
            "str_to_duration",
            "str_to_utc",
            "str_to_zone_name",
            "decode_json",
            "encode_json",
            "encoded_size",
            "poly_length",
            "base64",
            "base64_encode",
            "base64_decode",
            "meta",
            "uuid",
            "abs",
            "acos",
            "asin",
            "atan",
            "atan2",
            "ceil",
            "cos",
            "degrees",
            "e",
            "exp",
            "ln",
            "log",
            "floor",
            "pi",
            "power",
            "radians",
            "random",
            "round",
            "sign",
            "sin",
            "sqrt",
            "tan",
            "trunc",
            "object_length",
            "object_names",
            "object_pairs",
            "object_inner_pairs",
            "object_values",
            "object_inner_values",
            "object_add",
            "object_put",
            "object_remove",
            "object_unwrap",
            "regexp_contains",
            "regexp_like",
            "regexp_position",
            "regexp_replace",
            "contains",
            "initcap",
            "length",
            "lower",
            "ltrim",
            "position",
            "repeat",
            "replace",
            "rtrim",
            "split",
            "substr",
            "title",
            "trim",
            "upper",
            "isarray",
            "isatom",
            "isboolean",
            "isnumber",
            "isobject",
            "isstring",
            "type",
            "toarray",
            "toatom",
            "toboolean",
            "tonumber",
            "toobject",
            "tostring"
          ]
        },
        contains: [
          {
            className: "string",
            begin: "'",
            end: "'",
            contains: [t.BACKSLASH_ESCAPE]
          },
          {
            className: "string",
            begin: '"',
            end: '"',
            contains: [t.BACKSLASH_ESCAPE]
          },
          {
            className: "symbol",
            begin: "`",
            end: "`",
            contains: [t.BACKSLASH_ESCAPE]
          },
          t.C_NUMBER_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      t.C_BLOCK_COMMENT_MODE
    ]
  };
}
function hD(t) {
  const e = {
    match: [
      /^\s*(?=\S)/,
      // have to look forward here to avoid polynomial backtracking
      /[^:]+/,
      /:\s*/,
      /$/
    ],
    className: {
      2: "attribute",
      3: "punctuation"
    }
  }, n = {
    match: [
      /^\s*(?=\S)/,
      // have to look forward here to avoid polynomial backtracking
      /[^:]*[^: ]/,
      /[ ]*:/,
      /[ ]/,
      /.*$/
    ],
    className: {
      2: "attribute",
      3: "punctuation",
      5: "string"
    }
  }, r = {
    match: [
      /^\s*/,
      />/,
      /[ ]/,
      /.*$/
    ],
    className: {
      2: "punctuation",
      4: "string"
    }
  }, i = {
    variants: [
      { match: [
        /^\s*/,
        /-/,
        /[ ]/,
        /.*$/
      ] },
      { match: [
        /^\s*/,
        /-$/
      ] }
    ],
    className: {
      2: "bullet",
      4: "string"
    }
  };
  return {
    name: "Nested Text",
    aliases: ["nt"],
    contains: [
      t.inherit(t.HASH_COMMENT_MODE, {
        begin: /^\s*(?=#)/,
        excludeBegin: !0
      }),
      i,
      r,
      e,
      n
    ]
  };
}
function ED(t) {
  const e = t.regex, n = {
    className: "variable",
    variants: [
      { begin: /\$\d+/ },
      { begin: /\$\{\w+\}/ },
      { begin: e.concat(/[$@]/, t.UNDERSCORE_IDENT_RE) }
    ]
  }, i = {
    endsWithParent: !0,
    keywords: {
      $pattern: /[a-z_]{2,}|\/dev\/poll/,
      literal: [
        "on",
        "off",
        "yes",
        "no",
        "true",
        "false",
        "none",
        "blocked",
        "debug",
        "info",
        "notice",
        "warn",
        "error",
        "crit",
        "select",
        "break",
        "last",
        "permanent",
        "redirect",
        "kqueue",
        "rtsig",
        "epoll",
        "poll",
        "/dev/poll"
      ]
    },
    relevance: 0,
    illegal: "=>",
    contains: [
      t.HASH_COMMENT_MODE,
      {
        className: "string",
        contains: [
          t.BACKSLASH_ESCAPE,
          n
        ],
        variants: [
          {
            begin: /"/,
            end: /"/
          },
          {
            begin: /'/,
            end: /'/
          }
        ]
      },
      // this swallows entire URLs to avoid detecting numbers within
      {
        begin: "([a-z]+):/",
        end: "\\s",
        endsWithParent: !0,
        excludeEnd: !0,
        contains: [n]
      },
      {
        className: "regexp",
        contains: [
          t.BACKSLASH_ESCAPE,
          n
        ],
        variants: [
          {
            begin: "\\s\\^",
            end: "\\s|\\{|;",
            returnEnd: !0
          },
          // regexp locations (~, ~*)
          {
            begin: "~\\*?\\s+",
            end: "\\s|\\{|;",
            returnEnd: !0
          },
          // *.example.com
          { begin: "\\*(\\.[a-z\\-]+)+" },
          // sub.example.*
          { begin: "([a-z\\-]+\\.)+\\*" }
        ]
      },
      // IP
      {
        className: "number",
        begin: "\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"
      },
      // units
      {
        className: "number",
        begin: "\\b\\d+[kKmMgGdshdwy]?\\b",
        relevance: 0
      },
      n
    ]
  };
  return {
    name: "Nginx config",
    aliases: ["nginxconf"],
    contains: [
      t.HASH_COMMENT_MODE,
      {
        beginKeywords: "upstream location",
        end: /;|\{/,
        contains: i.contains,
        keywords: { section: "upstream location" }
      },
      {
        className: "section",
        begin: e.concat(t.UNDERSCORE_IDENT_RE + e.lookahead(/\s+\{/)),
        relevance: 0
      },
      {
        begin: e.lookahead(t.UNDERSCORE_IDENT_RE + "\\s"),
        end: ";|\\{",
        contains: [
          {
            className: "attribute",
            begin: t.UNDERSCORE_IDENT_RE,
            starts: i
          }
        ],
        relevance: 0
      }
    ],
    illegal: "[^\\s\\}\\{]"
  };
}
function SD(t) {
  return {
    name: "Nim",
    keywords: {
      keyword: [
        "addr",
        "and",
        "as",
        "asm",
        "bind",
        "block",
        "break",
        "case",
        "cast",
        "concept",
        "const",
        "continue",
        "converter",
        "defer",
        "discard",
        "distinct",
        "div",
        "do",
        "elif",
        "else",
        "end",
        "enum",
        "except",
        "export",
        "finally",
        "for",
        "from",
        "func",
        "generic",
        "guarded",
        "if",
        "import",
        "in",
        "include",
        "interface",
        "is",
        "isnot",
        "iterator",
        "let",
        "macro",
        "method",
        "mixin",
        "mod",
        "nil",
        "not",
        "notin",
        "object",
        "of",
        "or",
        "out",
        "proc",
        "ptr",
        "raise",
        "ref",
        "return",
        "shared",
        "shl",
        "shr",
        "static",
        "template",
        "try",
        "tuple",
        "type",
        "using",
        "var",
        "when",
        "while",
        "with",
        "without",
        "xor",
        "yield"
      ],
      literal: [
        "true",
        "false"
      ],
      type: [
        "int",
        "int8",
        "int16",
        "int32",
        "int64",
        "uint",
        "uint8",
        "uint16",
        "uint32",
        "uint64",
        "float",
        "float32",
        "float64",
        "bool",
        "char",
        "string",
        "cstring",
        "pointer",
        "expr",
        "stmt",
        "void",
        "auto",
        "any",
        "range",
        "array",
        "openarray",
        "varargs",
        "seq",
        "set",
        "clong",
        "culong",
        "cchar",
        "cschar",
        "cshort",
        "cint",
        "csize",
        "clonglong",
        "cfloat",
        "cdouble",
        "clongdouble",
        "cuchar",
        "cushort",
        "cuint",
        "culonglong",
        "cstringarray",
        "semistatic"
      ],
      built_in: [
        "stdin",
        "stdout",
        "stderr",
        "result"
      ]
    },
    contains: [
      {
        className: "meta",
        // Actually pragma
        begin: /\{\./,
        end: /\.\}/,
        relevance: 10
      },
      {
        className: "string",
        begin: /[a-zA-Z]\w*"/,
        end: /"/,
        contains: [{ begin: /""/ }]
      },
      {
        className: "string",
        begin: /([a-zA-Z]\w*)?"""/,
        end: /"""/
      },
      t.QUOTE_STRING_MODE,
      {
        className: "type",
        begin: /\b[A-Z]\w+\b/,
        relevance: 0
      },
      {
        className: "number",
        relevance: 0,
        variants: [
          { begin: /\b(0[xX][0-9a-fA-F][_0-9a-fA-F]*)('?[iIuU](8|16|32|64))?/ },
          { begin: /\b(0o[0-7][_0-7]*)('?[iIuUfF](8|16|32|64))?/ },
          { begin: /\b(0(b|B)[01][_01]*)('?[iIuUfF](8|16|32|64))?/ },
          { begin: /\b(\d[_\d]*)('?[iIuUfF](8|16|32|64))?/ }
        ]
      },
      t.HASH_COMMENT_MODE
    ]
  };
}
function bD(t) {
  const e = t.regex, n = {
    keyword: [
      "assert",
      "else",
      "if",
      "in",
      "inherit",
      "let",
      "or",
      "rec",
      "then",
      "with"
    ],
    literal: [
      "true",
      "false",
      "null"
    ],
    built_in: [
      // toplevel builtins
      "abort",
      "baseNameOf",
      "builtins",
      "derivation",
      "derivationStrict",
      "dirOf",
      "fetchGit",
      "fetchMercurial",
      "fetchTarball",
      "fetchTree",
      "fromTOML",
      "import",
      "isNull",
      "map",
      "placeholder",
      "removeAttrs",
      "scopedImport",
      "throw",
      "toString"
    ]
  }, r = {
    scope: "built_in",
    match: e.either(...[
      "abort",
      "add",
      "addDrvOutputDependencies",
      "addErrorContext",
      "all",
      "any",
      "appendContext",
      "attrNames",
      "attrValues",
      "baseNameOf",
      "bitAnd",
      "bitOr",
      "bitXor",
      "break",
      "builtins",
      "catAttrs",
      "ceil",
      "compareVersions",
      "concatLists",
      "concatMap",
      "concatStringsSep",
      "convertHash",
      "currentSystem",
      "currentTime",
      "deepSeq",
      "derivation",
      "derivationStrict",
      "dirOf",
      "div",
      "elem",
      "elemAt",
      "false",
      "fetchGit",
      "fetchMercurial",
      "fetchTarball",
      "fetchTree",
      "fetchurl",
      "filter",
      "filterSource",
      "findFile",
      "flakeRefToString",
      "floor",
      "foldl'",
      "fromJSON",
      "fromTOML",
      "functionArgs",
      "genList",
      "genericClosure",
      "getAttr",
      "getContext",
      "getEnv",
      "getFlake",
      "groupBy",
      "hasAttr",
      "hasContext",
      "hashFile",
      "hashString",
      "head",
      "import",
      "intersectAttrs",
      "isAttrs",
      "isBool",
      "isFloat",
      "isFunction",
      "isInt",
      "isList",
      "isNull",
      "isPath",
      "isString",
      "langVersion",
      "length",
      "lessThan",
      "listToAttrs",
      "map",
      "mapAttrs",
      "match",
      "mul",
      "nixPath",
      "nixVersion",
      "null",
      "parseDrvName",
      "parseFlakeRef",
      "partition",
      "path",
      "pathExists",
      "placeholder",
      "readDir",
      "readFile",
      "readFileType",
      "removeAttrs",
      "replaceStrings",
      "scopedImport",
      "seq",
      "sort",
      "split",
      "splitVersion",
      "storeDir",
      "storePath",
      "stringLength",
      "sub",
      "substring",
      "tail",
      "throw",
      "toFile",
      "toJSON",
      "toPath",
      "toString",
      "toXML",
      "trace",
      "traceVerbose",
      "true",
      "tryEval",
      "typeOf",
      "unsafeDiscardOutputDependency",
      "unsafeDiscardStringContext",
      "unsafeGetAttrPos",
      "warn",
      "zipAttrsWith"
    ].map((C) => `builtins\\.${C}`)),
    relevance: 10
  }, i = "[A-Za-z_][A-Za-z0-9_'-]*", o = {
    scope: "symbol",
    match: new RegExp(`<${i}(/${i})*>`)
  }, a = "[A-Za-z0-9_\\+\\.-]+", s = {
    scope: "symbol",
    match: new RegExp(`(\\.\\.|\\.|~)?/(${a})?(/${a})*(?=[\\s;])`)
  }, l = e.either("==", "=", "\\+\\+", "\\+", "<=", "<\\|", "<", ">=", ">", "->", "//", "/", "!=", "!", "\\|\\|", "\\|>", "\\?", "\\*", "&&"), c = {
    scope: "operator",
    match: e.concat(l, /(?!-)/),
    relevance: 0
  }, u = {
    scope: "number",
    match: new RegExp(`${t.NUMBER_RE}(?!-)`),
    relevance: 0
  }, d = {
    variants: [
      {
        scope: "operator",
        beforeMatch: /\s/,
        // The (?!>) is used to ensure this doesn't collide with the '->' operator
        begin: /-(?!>)/
      },
      {
        begin: [
          new RegExp(`${t.NUMBER_RE}`),
          /-/,
          /(?!>)/
        ],
        beginScope: {
          1: "number",
          2: "operator"
        }
      },
      {
        begin: [
          l,
          /-/,
          /(?!>)/
        ],
        beginScope: {
          1: "operator",
          2: "operator"
        }
      }
    ],
    relevance: 0
  }, p = {
    beforeMatch: /(^|\{|;)\s*/,
    begin: new RegExp(`${i}(\\.${i})*\\s*=(?!=)`),
    returnBegin: !0,
    relevance: 0,
    contains: [
      {
        scope: "attr",
        match: new RegExp(`${i}(\\.${i})*(?=\\s*=)`),
        relevance: 0.2
      }
    ]
  }, _ = {
    scope: "char.escape",
    match: /\\\$/
  }, m = {
    scope: "char.escape",
    match: /''\$/
  }, f = {
    scope: "subst",
    begin: /\$\{/,
    end: /\}/,
    keywords: n
  }, g = {
    scope: "char.escape",
    match: /'''/
  }, S = {
    scope: "char.escape",
    match: /\\(?!\$)./
  }, E = {
    scope: "string",
    variants: [
      {
        begin: "''",
        end: "''",
        contains: [
          m,
          f,
          g,
          S
        ]
      },
      {
        begin: '"',
        end: '"',
        contains: [
          _,
          f,
          S
        ]
      }
    ]
  }, b = {
    scope: "params",
    match: new RegExp(`${i}\\s*:(?=\\s)`)
  }, h = [
    u,
    t.HASH_COMMENT_MODE,
    t.C_BLOCK_COMMENT_MODE,
    t.COMMENT(
      /\/\*\*(?!\/)/,
      /\*\//,
      {
        subLanguage: "markdown",
        relevance: 0
      }
    ),
    r,
    E,
    o,
    s,
    b,
    p,
    d,
    c
  ];
  f.contains = h;
  const T = [
    {
      scope: "meta.prompt",
      match: /^nix-repl>(?=\s)/,
      relevance: 10
    },
    {
      scope: "meta",
      beforeMatch: /\s+/,
      begin: /:([a-z]+|\?)/
    }
  ];
  return {
    name: "Nix",
    aliases: ["nixos"],
    keywords: n,
    contains: h.concat(T)
  };
}
function TD(t) {
  return {
    name: "Node REPL",
    contains: [
      {
        className: "meta.prompt",
        starts: {
          // a space separates the REPL prefix from the actual code
          // this is purely for cleaner HTML output
          end: / |$/,
          starts: {
            end: "$",
            subLanguage: "javascript"
          }
        },
        variants: [
          { begin: /^>(?=[ ]|$)/ },
          { begin: /^\.\.\.(?=[ ]|$)/ }
        ]
      }
    ]
  };
}
function CD(t) {
  const e = t.regex, n = [
    "ADMINTOOLS",
    "APPDATA",
    "CDBURN_AREA",
    "CMDLINE",
    "COMMONFILES32",
    "COMMONFILES64",
    "COMMONFILES",
    "COOKIES",
    "DESKTOP",
    "DOCUMENTS",
    "EXEDIR",
    "EXEFILE",
    "EXEPATH",
    "FAVORITES",
    "FONTS",
    "HISTORY",
    "HWNDPARENT",
    "INSTDIR",
    "INTERNET_CACHE",
    "LANGUAGE",
    "LOCALAPPDATA",
    "MUSIC",
    "NETHOOD",
    "OUTDIR",
    "PICTURES",
    "PLUGINSDIR",
    "PRINTHOOD",
    "PROFILE",
    "PROGRAMFILES32",
    "PROGRAMFILES64",
    "PROGRAMFILES",
    "QUICKLAUNCH",
    "RECENT",
    "RESOURCES_LOCALIZED",
    "RESOURCES",
    "SENDTO",
    "SMPROGRAMS",
    "SMSTARTUP",
    "STARTMENU",
    "SYSDIR",
    "TEMP",
    "TEMPLATES",
    "VIDEOS",
    "WINDIR"
  ], r = [
    "ARCHIVE",
    "FILE_ATTRIBUTE_ARCHIVE",
    "FILE_ATTRIBUTE_NORMAL",
    "FILE_ATTRIBUTE_OFFLINE",
    "FILE_ATTRIBUTE_READONLY",
    "FILE_ATTRIBUTE_SYSTEM",
    "FILE_ATTRIBUTE_TEMPORARY",
    "HKCR",
    "HKCU",
    "HKDD",
    "HKEY_CLASSES_ROOT",
    "HKEY_CURRENT_CONFIG",
    "HKEY_CURRENT_USER",
    "HKEY_DYN_DATA",
    "HKEY_LOCAL_MACHINE",
    "HKEY_PERFORMANCE_DATA",
    "HKEY_USERS",
    "HKLM",
    "HKPD",
    "HKU",
    "IDABORT",
    "IDCANCEL",
    "IDIGNORE",
    "IDNO",
    "IDOK",
    "IDRETRY",
    "IDYES",
    "MB_ABORTRETRYIGNORE",
    "MB_DEFBUTTON1",
    "MB_DEFBUTTON2",
    "MB_DEFBUTTON3",
    "MB_DEFBUTTON4",
    "MB_ICONEXCLAMATION",
    "MB_ICONINFORMATION",
    "MB_ICONQUESTION",
    "MB_ICONSTOP",
    "MB_OK",
    "MB_OKCANCEL",
    "MB_RETRYCANCEL",
    "MB_RIGHT",
    "MB_RTLREADING",
    "MB_SETFOREGROUND",
    "MB_TOPMOST",
    "MB_USERICON",
    "MB_YESNO",
    "NORMAL",
    "OFFLINE",
    "READONLY",
    "SHCTX",
    "SHELL_CONTEXT",
    "SYSTEM|TEMPORARY"
  ], i = [
    "addincludedir",
    "addplugindir",
    "appendfile",
    "assert",
    "cd",
    "define",
    "delfile",
    "echo",
    "else",
    "endif",
    "error",
    "execute",
    "finalize",
    "getdllversion",
    "gettlbversion",
    "if",
    "ifdef",
    "ifmacrodef",
    "ifmacrondef",
    "ifndef",
    "include",
    "insertmacro",
    "macro",
    "macroend",
    "makensis",
    "packhdr",
    "searchparse",
    "searchreplace",
    "system",
    "tempfile",
    "undef",
    "uninstfinalize",
    "verbose",
    "warning"
  ], o = {
    className: "variable.constant",
    begin: e.concat(/\$/, e.either(...n))
  }, a = {
    // ${defines}
    className: "variable",
    begin: /\$+\{[\!\w.:-]+\}/
  }, s = {
    // $variables
    className: "variable",
    begin: /\$+\w[\w\.]*/,
    illegal: /\(\)\{\}/
  }, l = {
    // $(language_strings)
    className: "variable",
    begin: /\$+\([\w^.:!-]+\)/
  }, c = {
    // command parameters
    className: "params",
    begin: e.either(...r)
  }, u = {
    // !compiler_flags
    className: "keyword",
    begin: e.concat(
      /!/,
      e.either(...i)
    )
  }, d = {
    // $\n, $\r, $\t, $$
    className: "char.escape",
    begin: /\$(\\[nrt]|\$)/
  }, p = {
    // plug::ins
    className: "title.function",
    begin: /\w+::\w+/
  }, _ = {
    className: "string",
    variants: [
      {
        begin: '"',
        end: '"'
      },
      {
        begin: "'",
        end: "'"
      },
      {
        begin: "`",
        end: "`"
      }
    ],
    illegal: /\n/,
    contains: [
      d,
      o,
      a,
      s,
      l
    ]
  }, m = [
    "Abort",
    "AddBrandingImage",
    "AddSize",
    "AllowRootDirInstall",
    "AllowSkipFiles",
    "AutoCloseWindow",
    "BGFont",
    "BGGradient",
    "BrandingText",
    "BringToFront",
    "Call",
    "CallInstDLL",
    "Caption",
    "ChangeUI",
    "CheckBitmap",
    "ClearErrors",
    "CompletedText",
    "ComponentText",
    "CopyFiles",
    "CRCCheck",
    "CreateDirectory",
    "CreateFont",
    "CreateShortCut",
    "Delete",
    "DeleteINISec",
    "DeleteINIStr",
    "DeleteRegKey",
    "DeleteRegValue",
    "DetailPrint",
    "DetailsButtonText",
    "DirText",
    "DirVar",
    "DirVerify",
    "EnableWindow",
    "EnumRegKey",
    "EnumRegValue",
    "Exch",
    "Exec",
    "ExecShell",
    "ExecShellWait",
    "ExecWait",
    "ExpandEnvStrings",
    "File",
    "FileBufSize",
    "FileClose",
    "FileErrorText",
    "FileOpen",
    "FileRead",
    "FileReadByte",
    "FileReadUTF16LE",
    "FileReadWord",
    "FileWriteUTF16LE",
    "FileSeek",
    "FileWrite",
    "FileWriteByte",
    "FileWriteWord",
    "FindClose",
    "FindFirst",
    "FindNext",
    "FindWindow",
    "FlushINI",
    "GetCurInstType",
    "GetCurrentAddress",
    "GetDlgItem",
    "GetDLLVersion",
    "GetDLLVersionLocal",
    "GetErrorLevel",
    "GetFileTime",
    "GetFileTimeLocal",
    "GetFullPathName",
    "GetFunctionAddress",
    "GetInstDirError",
    "GetKnownFolderPath",
    "GetLabelAddress",
    "GetTempFileName",
    "GetWinVer",
    "Goto",
    "HideWindow",
    "Icon",
    "IfAbort",
    "IfErrors",
    "IfFileExists",
    "IfRebootFlag",
    "IfRtlLanguage",
    "IfShellVarContextAll",
    "IfSilent",
    "InitPluginsDir",
    "InstallButtonText",
    "InstallColors",
    "InstallDir",
    "InstallDirRegKey",
    "InstProgressFlags",
    "InstType",
    "InstTypeGetText",
    "InstTypeSetText",
    "Int64Cmp",
    "Int64CmpU",
    "Int64Fmt",
    "IntCmp",
    "IntCmpU",
    "IntFmt",
    "IntOp",
    "IntPtrCmp",
    "IntPtrCmpU",
    "IntPtrOp",
    "IsWindow",
    "LangString",
    "LicenseBkColor",
    "LicenseData",
    "LicenseForceSelection",
    "LicenseLangString",
    "LicenseText",
    "LoadAndSetImage",
    "LoadLanguageFile",
    "LockWindow",
    "LogSet",
    "LogText",
    "ManifestDPIAware",
    "ManifestLongPathAware",
    "ManifestMaxVersionTested",
    "ManifestSupportedOS",
    "MessageBox",
    "MiscButtonText",
    "Name|0",
    "Nop",
    "OutFile",
    "Page",
    "PageCallbacks",
    "PEAddResource",
    "PEDllCharacteristics",
    "PERemoveResource",
    "PESubsysVer",
    "Pop",
    "Push",
    "Quit",
    "ReadEnvStr",
    "ReadINIStr",
    "ReadRegDWORD",
    "ReadRegStr",
    "Reboot",
    "RegDLL",
    "Rename",
    "RequestExecutionLevel",
    "ReserveFile",
    "Return",
    "RMDir",
    "SearchPath",
    "SectionGetFlags",
    "SectionGetInstTypes",
    "SectionGetSize",
    "SectionGetText",
    "SectionIn",
    "SectionSetFlags",
    "SectionSetInstTypes",
    "SectionSetSize",
    "SectionSetText",
    "SendMessage",
    "SetAutoClose",
    "SetBrandingImage",
    "SetCompress",
    "SetCompressor",
    "SetCompressorDictSize",
    "SetCtlColors",
    "SetCurInstType",
    "SetDatablockOptimize",
    "SetDateSave",
    "SetDetailsPrint",
    "SetDetailsView",
    "SetErrorLevel",
    "SetErrors",
    "SetFileAttributes",
    "SetFont",
    "SetOutPath",
    "SetOverwrite",
    "SetRebootFlag",
    "SetRegView",
    "SetShellVarContext",
    "SetSilent",
    "ShowInstDetails",
    "ShowUninstDetails",
    "ShowWindow",
    "SilentInstall",
    "SilentUnInstall",
    "Sleep",
    "SpaceTexts",
    "StrCmp",
    "StrCmpS",
    "StrCpy",
    "StrLen",
    "SubCaption",
    "Unicode",
    "UninstallButtonText",
    "UninstallCaption",
    "UninstallIcon",
    "UninstallSubCaption",
    "UninstallText",
    "UninstPage",
    "UnRegDLL",
    "Var",
    "VIAddVersionKey",
    "VIFileVersion",
    "VIProductVersion",
    "WindowIcon",
    "WriteINIStr",
    "WriteRegBin",
    "WriteRegDWORD",
    "WriteRegExpandStr",
    "WriteRegMultiStr",
    "WriteRegNone",
    "WriteRegStr",
    "WriteUninstaller",
    "XPStyle"
  ], f = [
    "admin",
    "all",
    "auto",
    "both",
    "bottom",
    "bzip2",
    "colored",
    "components",
    "current",
    "custom",
    "directory",
    "false",
    "force",
    "hide",
    "highest",
    "ifdiff",
    "ifnewer",
    "instfiles",
    "lastused",
    "leave",
    "left",
    "license",
    "listonly",
    "lzma",
    "nevershow",
    "none",
    "normal",
    "notset",
    "off",
    "on",
    "open",
    "print",
    "right",
    "show",
    "silent",
    "silentlog",
    "smooth",
    "textonly",
    "top",
    "true",
    "try",
    "un.components",
    "un.custom",
    "un.directory",
    "un.instfiles",
    "un.license",
    "uninstConfirm",
    "user",
    "Win10",
    "Win7",
    "Win8",
    "WinVista",
    "zlib"
  ], g = {
    match: [
      /Function/,
      /\s+/,
      e.concat(/(\.)?/, t.IDENT_RE)
    ],
    scope: {
      1: "keyword",
      3: "title.function"
    }
  }, E = {
    match: [
      /Var/,
      /\s+/,
      /(?:\/GLOBAL\s+)?/,
      /[A-Za-z][\w.]*/
    ],
    scope: {
      1: "keyword",
      3: "params",
      4: "variable"
    }
  };
  return {
    name: "NSIS",
    case_insensitive: !0,
    keywords: {
      keyword: m,
      literal: f
    },
    contains: [
      t.HASH_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.COMMENT(
        ";",
        "$",
        { relevance: 0 }
      ),
      E,
      g,
      { beginKeywords: "Function PageEx Section SectionGroup FunctionEnd SectionEnd" },
      _,
      u,
      a,
      s,
      l,
      c,
      p,
      t.NUMBER_MODE
    ]
  };
}
function yD(t) {
  return {
    name: "OCaml",
    aliases: ["ml"],
    keywords: {
      $pattern: "[a-z_]\\w*!?",
      keyword: "and as assert asr begin class constraint do done downto else end exception external for fun function functor if in include inherit! inherit initializer land lazy let lor lsl lsr lxor match method!|10 method mod module mutable new object of open! open or private rec sig struct then to try type val! val virtual when while with parser value",
      built_in: (
        /* built-in types */
        "array bool bytes char exn|5 float int int32 int64 list lazy_t|5 nativeint|5 string unit in_channel out_channel ref"
      ),
      literal: "true false"
    },
    illegal: /\/\/|>>/,
    contains: [
      {
        className: "literal",
        begin: "\\[(\\|\\|)?\\]|\\(\\)",
        relevance: 0
      },
      t.COMMENT(
        "\\(\\*",
        "\\*\\)",
        { contains: ["self"] }
      ),
      {
        /* type variable */
        className: "symbol",
        begin: "'[A-Za-z_](?!')[\\w']*"
        /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */
      },
      {
        /* polymorphic variant */
        className: "type",
        begin: "`[A-Z][\\w']*"
      },
      {
        /* module or constructor */
        className: "type",
        begin: "\\b[A-Z][\\w']*",
        relevance: 0
      },
      {
        /* don't color identifiers, but safely catch all identifiers with ' */
        begin: "[a-z_]\\w*'[\\w']*",
        relevance: 0
      },
      t.inherit(t.APOS_STRING_MODE, {
        className: "string",
        relevance: 0
      }),
      t.inherit(t.QUOTE_STRING_MODE, { illegal: null }),
      {
        className: "number",
        begin: "\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",
        relevance: 0
      },
      {
        begin: /->/
        // relevance booster
      }
    ]
  };
}
function vD(t) {
  const e = {
    className: "keyword",
    begin: "\\$(f[asn]|t|vp[rtd]|children)"
  }, n = {
    className: "literal",
    begin: "false|true|PI|undef"
  }, r = {
    className: "number",
    begin: "\\b\\d+(\\.\\d+)?(e-?\\d+)?",
    // adds 1e5, 1e-10
    relevance: 0
  }, i = t.inherit(t.QUOTE_STRING_MODE, { illegal: null }), o = {
    className: "meta",
    keywords: { keyword: "include use" },
    begin: "include|use <",
    end: ">"
  }, a = {
    className: "params",
    begin: "\\(",
    end: "\\)",
    contains: [
      "self",
      r,
      i,
      e,
      n
    ]
  }, s = {
    begin: "[*!#%]",
    relevance: 0
  }, l = {
    className: "function",
    beginKeywords: "module function",
    end: /=|\{/,
    contains: [
      a,
      t.UNDERSCORE_TITLE_MODE
    ]
  };
  return {
    name: "OpenSCAD",
    aliases: ["scad"],
    keywords: {
      keyword: "function module include use for intersection_for if else \\%",
      literal: "false true PI undef",
      built_in: "circle square polygon text sphere cube cylinder polyhedron translate rotate scale resize mirror multmatrix color offset hull minkowski union difference intersection abs sign sin cos tan acos asin atan atan2 floor round ceil ln log pow sqrt exp rands min max concat lookup str chr search version version_num norm cross parent_module echo import import_dxf dxf_linear_extrude linear_extrude rotate_extrude surface projection render children dxf_cross dxf_dim let assign"
    },
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      r,
      o,
      i,
      e,
      s,
      l
    ]
  };
}
function RD(t) {
  const e = {
    $pattern: /\.?\w+/,
    keyword: "abstract add and array as asc aspect assembly async begin break block by case class concat const copy constructor continue create default delegate desc distinct div do downto dynamic each else empty end ensure enum equals event except exit extension external false final finalize finalizer finally flags for forward from function future global group has if implementation implements implies in index inherited inline interface into invariants is iterator join locked locking loop matching method mod module namespace nested new nil not notify nullable of old on operator or order out override parallel params partial pinned private procedure property protected public queryable raise read readonly record reintroduce remove repeat require result reverse sealed select self sequence set shl shr skip static step soft take then to true try tuple type union unit unsafe until uses using var virtual raises volatile where while with write xor yield await mapped deprecated stdcall cdecl pascal register safecall overload library platform reference packed strict published autoreleasepool selector strong weak unretained"
  }, n = t.COMMENT(
    /\{/,
    /\}/,
    { relevance: 0 }
  ), r = t.COMMENT(
    "\\(\\*",
    "\\*\\)",
    { relevance: 10 }
  ), i = {
    className: "string",
    begin: "'",
    end: "'",
    contains: [{ begin: "''" }]
  }, o = {
    className: "string",
    begin: "(#\\d+)+"
  }, a = {
    beginKeywords: "function constructor destructor procedure method",
    end: "[:;]",
    keywords: "function constructor|10 destructor|10 procedure|10 method|10",
    contains: [
      t.inherit(t.TITLE_MODE, { scope: "title.function" }),
      {
        className: "params",
        begin: "\\(",
        end: "\\)",
        keywords: e,
        contains: [
          i,
          o
        ]
      },
      n,
      r
    ]
  }, s = {
    scope: "punctuation",
    match: /;/,
    relevance: 0
  };
  return {
    name: "Oxygene",
    case_insensitive: !0,
    keywords: e,
    illegal: '("|\\$[G-Zg-z]|\\/\\*|</|=>|->)',
    contains: [
      n,
      r,
      t.C_LINE_COMMENT_MODE,
      i,
      o,
      t.NUMBER_MODE,
      a,
      s
    ]
  };
}
function OD(t) {
  const e = t.COMMENT(
    /\{/,
    /\}/,
    { contains: ["self"] }
  );
  return {
    name: "Parser3",
    subLanguage: "xml",
    relevance: 0,
    contains: [
      t.COMMENT("^#", "$"),
      t.COMMENT(
        /\^rem\{/,
        /\}/,
        {
          relevance: 10,
          contains: [e]
        }
      ),
      {
        className: "meta",
        begin: "^@(?:BASE|USE|CLASS|OPTIONS)$",
        relevance: 10
      },
      {
        className: "title",
        begin: "@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$"
      },
      {
        className: "variable",
        begin: /\$\{?[\w\-.:]+\}?/
      },
      {
        className: "keyword",
        begin: /\^[\w\-.:]+/
      },
      {
        className: "number",
        begin: "\\^#[0-9a-fA-F]+"
      },
      t.C_NUMBER_MODE
    ]
  };
}
function ND(t) {
  const e = {
    className: "variable",
    begin: /\$[\w\d#@][\w\d_]*/,
    relevance: 0
  }, n = {
    className: "variable",
    begin: /<(?!\/)/,
    end: />/
  };
  return {
    name: "Packet Filter config",
    aliases: ["pf.conf"],
    keywords: {
      $pattern: /[a-z0-9_<>-]+/,
      built_in: (
        /* block match pass are "actions" in pf.conf(5), the rest are
         * lexically similar top-level commands.
         */
        "block match pass load anchor|5 antispoof|10 set table"
      ),
      keyword: "in out log quick on rdomain inet inet6 proto from port os to route allow-opts divert-packet divert-reply divert-to flags group icmp-type icmp6-type label once probability recieved-on rtable prio queue tos tag tagged user keep fragment for os drop af-to|10 binat-to|10 nat-to|10 rdr-to|10 bitmask least-stats random round-robin source-hash static-port dup-to reply-to route-to parent bandwidth default min max qlimit block-policy debug fingerprints hostid limit loginterface optimization reassemble ruleset-optimization basic none profile skip state-defaults state-policy timeout const counters persist no modulate synproxy state|5 floating if-bound no-sync pflow|10 sloppy source-track global rule max-src-nodes max-src-states max-src-conn max-src-conn-rate overload flush scrub|5 max-mss min-ttl no-df|10 random-id",
      literal: "all any no-route self urpf-failed egress|5 unknown"
    },
    contains: [
      t.HASH_COMMENT_MODE,
      t.NUMBER_MODE,
      t.QUOTE_STRING_MODE,
      e,
      n
    ]
  };
}
function AD(t) {
  const e = t.COMMENT("--", "$"), n = "[a-zA-Z_][a-zA-Z_0-9$]*", r = "\\$([a-zA-Z_]?|[a-zA-Z_][a-zA-Z_0-9]*)\\$", i = "<<\\s*" + n + "\\s*>>", o = (
    // https://www.postgresql.org/docs/11/static/sql-keywords-appendix.html
    // https://www.postgresql.org/docs/11/static/sql-commands.html
    // SQL commands (starting words)
    "ABORT ALTER ANALYZE BEGIN CALL CHECKPOINT|10 CLOSE CLUSTER COMMENT COMMIT COPY CREATE DEALLOCATE DECLARE DELETE DISCARD DO DROP END EXECUTE EXPLAIN FETCH GRANT IMPORT INSERT LISTEN LOAD LOCK MOVE NOTIFY PREPARE REASSIGN|10 REFRESH REINDEX RELEASE RESET REVOKE ROLLBACK SAVEPOINT SECURITY SELECT SET SHOW START TRUNCATE UNLISTEN|10 UPDATE VACUUM|10 VALUES AGGREGATE COLLATION CONVERSION|10 DATABASE DEFAULT PRIVILEGES DOMAIN TRIGGER EXTENSION FOREIGN WRAPPER|10 TABLE FUNCTION GROUP LANGUAGE LARGE OBJECT MATERIALIZED VIEW OPERATOR CLASS FAMILY POLICY PUBLICATION|10 ROLE RULE SCHEMA SEQUENCE SERVER STATISTICS SUBSCRIPTION SYSTEM TABLESPACE CONFIGURATION DICTIONARY PARSER TEMPLATE TYPE USER MAPPING PREPARED ACCESS METHOD CAST AS TRANSFORM TRANSACTION OWNED TO INTO SESSION AUTHORIZATION INDEX PROCEDURE ASSERTION ALL ANALYSE AND ANY ARRAY ASC ASYMMETRIC|10 BOTH CASE CHECK COLLATE COLUMN CONCURRENTLY|10 CONSTRAINT CROSS DEFERRABLE RANGE DESC DISTINCT ELSE EXCEPT FOR FREEZE|10 FROM FULL HAVING ILIKE IN INITIALLY INNER INTERSECT IS ISNULL JOIN LATERAL LEADING LIKE LIMIT NATURAL NOT NOTNULL NULL OFFSET ON ONLY OR ORDER OUTER OVERLAPS PLACING PRIMARY REFERENCES RETURNING SIMILAR SOME SYMMETRIC TABLESAMPLE THEN TRAILING UNION UNIQUE USING VARIADIC|10 VERBOSE WHEN WHERE WINDOW WITH BY RETURNS INOUT OUT SETOF|10 IF STRICT CURRENT CONTINUE OWNER LOCATION OVER PARTITION WITHIN BETWEEN ESCAPE EXTERNAL INVOKER DEFINER WORK RENAME VERSION CONNECTION CONNECT TABLES TEMP TEMPORARY FUNCTIONS SEQUENCES TYPES SCHEMAS OPTION CASCADE RESTRICT ADD ADMIN EXISTS VALID VALIDATE ENABLE DISABLE REPLICA|10 ALWAYS PASSING COLUMNS PATH REF VALUE OVERRIDING IMMUTABLE STABLE VOLATILE BEFORE AFTER EACH ROW PROCEDURAL ROUTINE NO HANDLER VALIDATOR OPTIONS STORAGE OIDS|10 WITHOUT INHERIT DEPENDS CALLED INPUT LEAKPROOF|10 COST ROWS NOWAIT SEARCH UNTIL ENCRYPTED|10 PASSWORD CONFLICT|10 INSTEAD INHERITS CHARACTERISTICS WRITE CURSOR ALSO STATEMENT SHARE EXCLUSIVE INLINE ISOLATION REPEATABLE READ COMMITTED SERIALIZABLE UNCOMMITTED LOCAL GLOBAL SQL PROCEDURES RECURSIVE SNAPSHOT ROLLUP CUBE TRUSTED|10 INCLUDE FOLLOWING PRECEDING UNBOUNDED RANGE GROUPS UNENCRYPTED|10 SYSID FORMAT DELIMITER HEADER QUOTE ENCODING FILTER OFF FORCE_QUOTE FORCE_NOT_NULL FORCE_NULL COSTS BUFFERS TIMING SUMMARY DISABLE_PAGE_SKIPPING RESTART CYCLE GENERATED IDENTITY DEFERRED IMMEDIATE LEVEL LOGGED UNLOGGED OF NOTHING NONE EXCLUDE ATTRIBUTE USAGE ROUTINES TRUE FALSE NAN INFINITY "
  ), a = (
    // only those not in keywrods already
    "SUPERUSER NOSUPERUSER CREATEDB NOCREATEDB CREATEROLE NOCREATEROLE INHERIT NOINHERIT LOGIN NOLOGIN REPLICATION NOREPLICATION BYPASSRLS NOBYPASSRLS "
  ), s = "ALIAS BEGIN CONSTANT DECLARE END EXCEPTION RETURN PERFORM|10 RAISE GET DIAGNOSTICS STACKED|10 FOREACH LOOP ELSIF EXIT WHILE REVERSE SLICE DEBUG LOG INFO NOTICE WARNING ASSERT OPEN ", l = (
    // https://www.postgresql.org/docs/11/static/datatype.html
    "BIGINT INT8 BIGSERIAL SERIAL8 BIT VARYING VARBIT BOOLEAN BOOL BOX BYTEA CHARACTER CHAR VARCHAR CIDR CIRCLE DATE DOUBLE PRECISION FLOAT8 FLOAT INET INTEGER INT INT4 INTERVAL JSON JSONB LINE LSEG|10 MACADDR MACADDR8 MONEY NUMERIC DEC DECIMAL PATH POINT POLYGON REAL FLOAT4 SMALLINT INT2 SMALLSERIAL|10 SERIAL2|10 SERIAL|10 SERIAL4|10 TEXT TIME ZONE TIMETZ|10 TIMESTAMP TIMESTAMPTZ|10 TSQUERY|10 TSVECTOR|10 TXID_SNAPSHOT|10 UUID XML NATIONAL NCHAR INT4RANGE|10 INT8RANGE|10 NUMRANGE|10 TSRANGE|10 TSTZRANGE|10 DATERANGE|10 ANYELEMENT ANYARRAY ANYNONARRAY ANYENUM ANYRANGE CSTRING INTERNAL RECORD PG_DDL_COMMAND VOID UNKNOWN OPAQUE REFCURSOR NAME OID REGPROC|10 REGPROCEDURE|10 REGOPER|10 REGOPERATOR|10 REGCLASS|10 REGTYPE|10 REGROLE|10 REGNAMESPACE|10 REGCONFIG|10 REGDICTIONARY|10 "
  ), c = l.trim().split(" ").map(function(f) {
    return f.split("|")[0];
  }).join("|"), u = "CURRENT_TIME CURRENT_TIMESTAMP CURRENT_USER CURRENT_CATALOG|10 CURRENT_DATE LOCALTIME LOCALTIMESTAMP CURRENT_ROLE|10 CURRENT_SCHEMA|10 SESSION_USER PUBLIC ", d = "FOUND NEW OLD TG_NAME|10 TG_WHEN|10 TG_LEVEL|10 TG_OP|10 TG_RELID|10 TG_RELNAME|10 TG_TABLE_NAME|10 TG_TABLE_SCHEMA|10 TG_NARGS|10 TG_ARGV|10 TG_EVENT|10 TG_TAG|10 ROW_COUNT RESULT_OID|10 PG_CONTEXT|10 RETURNED_SQLSTATE COLUMN_NAME CONSTRAINT_NAME PG_DATATYPE_NAME|10 MESSAGE_TEXT TABLE_NAME SCHEMA_NAME PG_EXCEPTION_DETAIL|10 PG_EXCEPTION_HINT|10 PG_EXCEPTION_CONTEXT|10 ", p = (
    // exceptions https://www.postgresql.org/docs/current/static/errcodes-appendix.html
    "SQLSTATE SQLERRM|10 SUCCESSFUL_COMPLETION WARNING DYNAMIC_RESULT_SETS_RETURNED IMPLICIT_ZERO_BIT_PADDING NULL_VALUE_ELIMINATED_IN_SET_FUNCTION PRIVILEGE_NOT_GRANTED PRIVILEGE_NOT_REVOKED STRING_DATA_RIGHT_TRUNCATION DEPRECATED_FEATURE NO_DATA NO_ADDITIONAL_DYNAMIC_RESULT_SETS_RETURNED SQL_STATEMENT_NOT_YET_COMPLETE CONNECTION_EXCEPTION CONNECTION_DOES_NOT_EXIST CONNECTION_FAILURE SQLCLIENT_UNABLE_TO_ESTABLISH_SQLCONNECTION SQLSERVER_REJECTED_ESTABLISHMENT_OF_SQLCONNECTION TRANSACTION_RESOLUTION_UNKNOWN PROTOCOL_VIOLATION TRIGGERED_ACTION_EXCEPTION FEATURE_NOT_SUPPORTED INVALID_TRANSACTION_INITIATION LOCATOR_EXCEPTION INVALID_LOCATOR_SPECIFICATION INVALID_GRANTOR INVALID_GRANT_OPERATION INVALID_ROLE_SPECIFICATION DIAGNOSTICS_EXCEPTION STACKED_DIAGNOSTICS_ACCESSED_WITHOUT_ACTIVE_HANDLER CASE_NOT_FOUND CARDINALITY_VIOLATION DATA_EXCEPTION ARRAY_SUBSCRIPT_ERROR CHARACTER_NOT_IN_REPERTOIRE DATETIME_FIELD_OVERFLOW DIVISION_BY_ZERO ERROR_IN_ASSIGNMENT ESCAPE_CHARACTER_CONFLICT INDICATOR_OVERFLOW INTERVAL_FIELD_OVERFLOW INVALID_ARGUMENT_FOR_LOGARITHM INVALID_ARGUMENT_FOR_NTILE_FUNCTION INVALID_ARGUMENT_FOR_NTH_VALUE_FUNCTION INVALID_ARGUMENT_FOR_POWER_FUNCTION INVALID_ARGUMENT_FOR_WIDTH_BUCKET_FUNCTION INVALID_CHARACTER_VALUE_FOR_CAST INVALID_DATETIME_FORMAT INVALID_ESCAPE_CHARACTER INVALID_ESCAPE_OCTET INVALID_ESCAPE_SEQUENCE NONSTANDARD_USE_OF_ESCAPE_CHARACTER INVALID_INDICATOR_PARAMETER_VALUE INVALID_PARAMETER_VALUE INVALID_REGULAR_EXPRESSION INVALID_ROW_COUNT_IN_LIMIT_CLAUSE INVALID_ROW_COUNT_IN_RESULT_OFFSET_CLAUSE INVALID_TABLESAMPLE_ARGUMENT INVALID_TABLESAMPLE_REPEAT INVALID_TIME_ZONE_DISPLACEMENT_VALUE INVALID_USE_OF_ESCAPE_CHARACTER MOST_SPECIFIC_TYPE_MISMATCH NULL_VALUE_NOT_ALLOWED NULL_VALUE_NO_INDICATOR_PARAMETER NUMERIC_VALUE_OUT_OF_RANGE SEQUENCE_GENERATOR_LIMIT_EXCEEDED STRING_DATA_LENGTH_MISMATCH STRING_DATA_RIGHT_TRUNCATION SUBSTRING_ERROR TRIM_ERROR UNTERMINATED_C_STRING ZERO_LENGTH_CHARACTER_STRING FLOATING_POINT_EXCEPTION INVALID_TEXT_REPRESENTATION INVALID_BINARY_REPRESENTATION BAD_COPY_FILE_FORMAT UNTRANSLATABLE_CHARACTER NOT_AN_XML_DOCUMENT INVALID_XML_DOCUMENT INVALID_XML_CONTENT INVALID_XML_COMMENT INVALID_XML_PROCESSING_INSTRUCTION INTEGRITY_CONSTRAINT_VIOLATION RESTRICT_VIOLATION NOT_NULL_VIOLATION FOREIGN_KEY_VIOLATION UNIQUE_VIOLATION CHECK_VIOLATION EXCLUSION_VIOLATION INVALID_CURSOR_STATE INVALID_TRANSACTION_STATE ACTIVE_SQL_TRANSACTION BRANCH_TRANSACTION_ALREADY_ACTIVE HELD_CURSOR_REQUIRES_SAME_ISOLATION_LEVEL INAPPROPRIATE_ACCESS_MODE_FOR_BRANCH_TRANSACTION INAPPROPRIATE_ISOLATION_LEVEL_FOR_BRANCH_TRANSACTION NO_ACTIVE_SQL_TRANSACTION_FOR_BRANCH_TRANSACTION READ_ONLY_SQL_TRANSACTION SCHEMA_AND_DATA_STATEMENT_MIXING_NOT_SUPPORTED NO_ACTIVE_SQL_TRANSACTION IN_FAILED_SQL_TRANSACTION IDLE_IN_TRANSACTION_SESSION_TIMEOUT INVALID_SQL_STATEMENT_NAME TRIGGERED_DATA_CHANGE_VIOLATION INVALID_AUTHORIZATION_SPECIFICATION INVALID_PASSWORD DEPENDENT_PRIVILEGE_DESCRIPTORS_STILL_EXIST DEPENDENT_OBJECTS_STILL_EXIST INVALID_TRANSACTION_TERMINATION SQL_ROUTINE_EXCEPTION FUNCTION_EXECUTED_NO_RETURN_STATEMENT MODIFYING_SQL_DATA_NOT_PERMITTED PROHIBITED_SQL_STATEMENT_ATTEMPTED READING_SQL_DATA_NOT_PERMITTED INVALID_CURSOR_NAME EXTERNAL_ROUTINE_EXCEPTION CONTAINING_SQL_NOT_PERMITTED MODIFYING_SQL_DATA_NOT_PERMITTED PROHIBITED_SQL_STATEMENT_ATTEMPTED READING_SQL_DATA_NOT_PERMITTED EXTERNAL_ROUTINE_INVOCATION_EXCEPTION INVALID_SQLSTATE_RETURNED NULL_VALUE_NOT_ALLOWED TRIGGER_PROTOCOL_VIOLATED SRF_PROTOCOL_VIOLATED EVENT_TRIGGER_PROTOCOL_VIOLATED SAVEPOINT_EXCEPTION INVALID_SAVEPOINT_SPECIFICATION INVALID_CATALOG_NAME INVALID_SCHEMA_NAME TRANSACTION_ROLLBACK TRANSACTION_INTEGRITY_CONSTRAINT_VIOLATION SERIALIZATION_FAILURE STATEMENT_COMPLETION_UNKNOWN DEADLOCK_DETECTED SYNTAX_ERROR_OR_ACCESS_RULE_VIOLATION SYNTAX_ERROR INSUFFICIENT_PRIVILEGE CANNOT_COERCE GROUPING_ERROR WINDOWING_ERROR INVALID_RECURSION INVALID_FOREIGN_KEY INVALID_NAME NAME_TOO_LONG RESERVED_NAME DATATYPE_MISMATCH INDETERMINATE_DATATYPE COLLATION_MISMATCH INDETERMINATE_COLLATION WRONG_OBJECT_TYPE GENERATED_ALWAYS UNDEFINED_COLUMN UNDEFINED_FUNCTION UNDEFINED_TABLE UNDEFINED_PARAMETER UNDEFINED_OBJECT DUPLICATE_COLUMN DUPLICATE_CURSOR DUPLICATE_DATABASE DUPLICATE_FUNCTION DUPLICATE_PREPARED_STATEMENT DUPLICATE_SCHEMA DUPLICATE_TABLE DUPLICATE_ALIAS DUPLICATE_OBJECT AMBIGUOUS_COLUMN AMBIGUOUS_FUNCTION AMBIGUOUS_PARAMETER AMBIGUOUS_ALIAS INVALID_COLUMN_REFERENCE INVALID_COLUMN_DEFINITION INVALID_CURSOR_DEFINITION INVALID_DATABASE_DEFINITION INVALID_FUNCTION_DEFINITION INVALID_PREPARED_STATEMENT_DEFINITION INVALID_SCHEMA_DEFINITION INVALID_TABLE_DEFINITION INVALID_OBJECT_DEFINITION WITH_CHECK_OPTION_VIOLATION INSUFFICIENT_RESOURCES DISK_FULL OUT_OF_MEMORY TOO_MANY_CONNECTIONS CONFIGURATION_LIMIT_EXCEEDED PROGRAM_LIMIT_EXCEEDED STATEMENT_TOO_COMPLEX TOO_MANY_COLUMNS TOO_MANY_ARGUMENTS OBJECT_NOT_IN_PREREQUISITE_STATE OBJECT_IN_USE CANT_CHANGE_RUNTIME_PARAM LOCK_NOT_AVAILABLE OPERATOR_INTERVENTION QUERY_CANCELED ADMIN_SHUTDOWN CRASH_SHUTDOWN CANNOT_CONNECT_NOW DATABASE_DROPPED SYSTEM_ERROR IO_ERROR UNDEFINED_FILE DUPLICATE_FILE SNAPSHOT_TOO_OLD CONFIG_FILE_ERROR LOCK_FILE_EXISTS FDW_ERROR FDW_COLUMN_NAME_NOT_FOUND FDW_DYNAMIC_PARAMETER_VALUE_NEEDED FDW_FUNCTION_SEQUENCE_ERROR FDW_INCONSISTENT_DESCRIPTOR_INFORMATION FDW_INVALID_ATTRIBUTE_VALUE FDW_INVALID_COLUMN_NAME FDW_INVALID_COLUMN_NUMBER FDW_INVALID_DATA_TYPE FDW_INVALID_DATA_TYPE_DESCRIPTORS FDW_INVALID_DESCRIPTOR_FIELD_IDENTIFIER FDW_INVALID_HANDLE FDW_INVALID_OPTION_INDEX FDW_INVALID_OPTION_NAME FDW_INVALID_STRING_LENGTH_OR_BUFFER_LENGTH FDW_INVALID_STRING_FORMAT FDW_INVALID_USE_OF_NULL_POINTER FDW_TOO_MANY_HANDLES FDW_OUT_OF_MEMORY FDW_NO_SCHEMAS FDW_OPTION_NAME_NOT_FOUND FDW_REPLY_HANDLE FDW_SCHEMA_NOT_FOUND FDW_TABLE_NOT_FOUND FDW_UNABLE_TO_CREATE_EXECUTION FDW_UNABLE_TO_CREATE_REPLY FDW_UNABLE_TO_ESTABLISH_CONNECTION PLPGSQL_ERROR RAISE_EXCEPTION NO_DATA_FOUND TOO_MANY_ROWS ASSERT_FAILURE INTERNAL_ERROR DATA_CORRUPTED INDEX_CORRUPTED "
  ), m = /* https://www.postgresql.org/docs/11/static/functions-aggregate.html */ "ARRAY_AGG AVG BIT_AND BIT_OR BOOL_AND BOOL_OR COUNT EVERY JSON_AGG JSONB_AGG JSON_OBJECT_AGG JSONB_OBJECT_AGG MAX MIN MODE STRING_AGG SUM XMLAGG CORR COVAR_POP COVAR_SAMP REGR_AVGX REGR_AVGY REGR_COUNT REGR_INTERCEPT REGR_R2 REGR_SLOPE REGR_SXX REGR_SXY REGR_SYY STDDEV STDDEV_POP STDDEV_SAMP VARIANCE VAR_POP VAR_SAMP PERCENTILE_CONT PERCENTILE_DISC ROW_NUMBER RANK DENSE_RANK PERCENT_RANK CUME_DIST NTILE LAG LEAD FIRST_VALUE LAST_VALUE NTH_VALUE NUM_NONNULLS NUM_NULLS ABS CBRT CEIL CEILING DEGREES DIV EXP FLOOR LN LOG MOD PI POWER RADIANS ROUND SCALE SIGN SQRT TRUNC WIDTH_BUCKET RANDOM SETSEED ACOS ACOSD ASIN ASIND ATAN ATAND ATAN2 ATAN2D COS COSD COT COTD SIN SIND TAN TAND BIT_LENGTH CHAR_LENGTH CHARACTER_LENGTH LOWER OCTET_LENGTH OVERLAY POSITION SUBSTRING TREAT TRIM UPPER ASCII BTRIM CHR CONCAT CONCAT_WS CONVERT CONVERT_FROM CONVERT_TO DECODE ENCODE INITCAP LEFT LENGTH LPAD LTRIM MD5 PARSE_IDENT PG_CLIENT_ENCODING QUOTE_IDENT|10 QUOTE_LITERAL|10 QUOTE_NULLABLE|10 REGEXP_MATCH REGEXP_MATCHES REGEXP_REPLACE REGEXP_SPLIT_TO_ARRAY REGEXP_SPLIT_TO_TABLE REPEAT REPLACE REVERSE RIGHT RPAD RTRIM SPLIT_PART STRPOS SUBSTR TO_ASCII TO_HEX TRANSLATE OCTET_LENGTH GET_BIT GET_BYTE SET_BIT SET_BYTE TO_CHAR TO_DATE TO_NUMBER TO_TIMESTAMP AGE CLOCK_TIMESTAMP|10 DATE_PART DATE_TRUNC ISFINITE JUSTIFY_DAYS JUSTIFY_HOURS JUSTIFY_INTERVAL MAKE_DATE MAKE_INTERVAL|10 MAKE_TIME MAKE_TIMESTAMP|10 MAKE_TIMESTAMPTZ|10 NOW STATEMENT_TIMESTAMP|10 TIMEOFDAY TRANSACTION_TIMESTAMP|10 ENUM_FIRST ENUM_LAST ENUM_RANGE AREA CENTER DIAMETER HEIGHT ISCLOSED ISOPEN NPOINTS PCLOSE POPEN RADIUS WIDTH BOX BOUND_BOX CIRCLE LINE LSEG PATH POLYGON ABBREV BROADCAST HOST HOSTMASK MASKLEN NETMASK NETWORK SET_MASKLEN TEXT INET_SAME_FAMILY INET_MERGE MACADDR8_SET7BIT ARRAY_TO_TSVECTOR GET_CURRENT_TS_CONFIG NUMNODE PLAINTO_TSQUERY PHRASETO_TSQUERY WEBSEARCH_TO_TSQUERY QUERYTREE SETWEIGHT STRIP TO_TSQUERY TO_TSVECTOR JSON_TO_TSVECTOR JSONB_TO_TSVECTOR TS_DELETE TS_FILTER TS_HEADLINE TS_RANK TS_RANK_CD TS_REWRITE TSQUERY_PHRASE TSVECTOR_TO_ARRAY TSVECTOR_UPDATE_TRIGGER TSVECTOR_UPDATE_TRIGGER_COLUMN XMLCOMMENT XMLCONCAT XMLELEMENT XMLFOREST XMLPI XMLROOT XMLEXISTS XML_IS_WELL_FORMED XML_IS_WELL_FORMED_DOCUMENT XML_IS_WELL_FORMED_CONTENT XPATH XPATH_EXISTS XMLTABLE XMLNAMESPACES TABLE_TO_XML TABLE_TO_XMLSCHEMA TABLE_TO_XML_AND_XMLSCHEMA QUERY_TO_XML QUERY_TO_XMLSCHEMA QUERY_TO_XML_AND_XMLSCHEMA CURSOR_TO_XML CURSOR_TO_XMLSCHEMA SCHEMA_TO_XML SCHEMA_TO_XMLSCHEMA SCHEMA_TO_XML_AND_XMLSCHEMA DATABASE_TO_XML DATABASE_TO_XMLSCHEMA DATABASE_TO_XML_AND_XMLSCHEMA XMLATTRIBUTES TO_JSON TO_JSONB ARRAY_TO_JSON ROW_TO_JSON JSON_BUILD_ARRAY JSONB_BUILD_ARRAY JSON_BUILD_OBJECT JSONB_BUILD_OBJECT JSON_OBJECT JSONB_OBJECT JSON_ARRAY_LENGTH JSONB_ARRAY_LENGTH JSON_EACH JSONB_EACH JSON_EACH_TEXT JSONB_EACH_TEXT JSON_EXTRACT_PATH JSONB_EXTRACT_PATH JSON_OBJECT_KEYS JSONB_OBJECT_KEYS JSON_POPULATE_RECORD JSONB_POPULATE_RECORD JSON_POPULATE_RECORDSET JSONB_POPULATE_RECORDSET JSON_ARRAY_ELEMENTS JSONB_ARRAY_ELEMENTS JSON_ARRAY_ELEMENTS_TEXT JSONB_ARRAY_ELEMENTS_TEXT JSON_TYPEOF JSONB_TYPEOF JSON_TO_RECORD JSONB_TO_RECORD JSON_TO_RECORDSET JSONB_TO_RECORDSET JSON_STRIP_NULLS JSONB_STRIP_NULLS JSONB_SET JSONB_INSERT JSONB_PRETTY CURRVAL LASTVAL NEXTVAL SETVAL COALESCE NULLIF GREATEST LEAST ARRAY_APPEND ARRAY_CAT ARRAY_NDIMS ARRAY_DIMS ARRAY_FILL ARRAY_LENGTH ARRAY_LOWER ARRAY_POSITION ARRAY_POSITIONS ARRAY_PREPEND ARRAY_REMOVE ARRAY_REPLACE ARRAY_TO_STRING ARRAY_UPPER CARDINALITY STRING_TO_ARRAY UNNEST ISEMPTY LOWER_INC UPPER_INC LOWER_INF UPPER_INF RANGE_MERGE GENERATE_SERIES GENERATE_SUBSCRIPTS CURRENT_DATABASE CURRENT_QUERY CURRENT_SCHEMA|10 CURRENT_SCHEMAS|10 INET_CLIENT_ADDR INET_CLIENT_PORT INET_SERVER_ADDR INET_SERVER_PORT ROW_SECURITY_ACTIVE FORMAT_TYPE TO_REGCLASS TO_REGPROC TO_REGPROCEDURE TO_REGOPER TO_REGOPERATOR TO_REGTYPE TO_REGNAMESPACE TO_REGROLE COL_DESCRIPTION OBJ_DESCRIPTION SHOBJ_DESCRIPTION TXID_CURRENT TXID_CURRENT_IF_ASSIGNED TXID_CURRENT_SNAPSHOT TXID_SNAPSHOT_XIP TXID_SNAPSHOT_XMAX TXID_SNAPSHOT_XMIN TXID_VISIBLE_IN_SNAPSHOT TXID_STATUS CURRENT_SETTING SET_CONFIG BRIN_SUMMARIZE_NEW_VALUES BRIN_SUMMARIZE_RANGE BRIN_DESUMMARIZE_RANGE GIN_CLEAN_PENDING_LIST SUPPRESS_REDUNDANT_UPDATES_TRIGGER LO_FROM_BYTEA LO_PUT LO_GET LO_CREAT LO_CREATE LO_UNLINK LO_IMPORT LO_EXPORT LOREAD LOWRITE GROUPING CAST ".trim().split(" ").map(function(f) {
    return f.split("|")[0];
  }).join("|");
  return {
    name: "PostgreSQL",
    aliases: [
      "postgres",
      "postgresql"
    ],
    supersetOf: "sql",
    case_insensitive: !0,
    keywords: {
      keyword: o + s + a,
      built_in: u + d + p
    },
    // Forbid some cunstructs from other languages to improve autodetect. In fact
    // "[a-z]:" is legal (as part of array slice), but improbabal.
    illegal: /:==|\W\s*\(\*|(^|\s)\$[a-z]|\{\{|[a-z]:\s*$|\.\.\.|TO:|DO:/,
    contains: [
      // special handling of some words, which are reserved only in some contexts
      {
        className: "keyword",
        variants: [
          { begin: /\bTEXT\s*SEARCH\b/ },
          { begin: /\b(PRIMARY|FOREIGN|FOR(\s+NO)?)\s+KEY\b/ },
          { begin: /\bPARALLEL\s+(UNSAFE|RESTRICTED|SAFE)\b/ },
          { begin: /\bSTORAGE\s+(PLAIN|EXTERNAL|EXTENDED|MAIN)\b/ },
          { begin: /\bMATCH\s+(FULL|PARTIAL|SIMPLE)\b/ },
          { begin: /\bNULLS\s+(FIRST|LAST)\b/ },
          { begin: /\bEVENT\s+TRIGGER\b/ },
          { begin: /\b(MAPPING|OR)\s+REPLACE\b/ },
          { begin: /\b(FROM|TO)\s+(PROGRAM|STDIN|STDOUT)\b/ },
          { begin: /\b(SHARE|EXCLUSIVE)\s+MODE\b/ },
          { begin: /\b(LEFT|RIGHT)\s+(OUTER\s+)?JOIN\b/ },
          { begin: /\b(FETCH|MOVE)\s+(NEXT|PRIOR|FIRST|LAST|ABSOLUTE|RELATIVE|FORWARD|BACKWARD)\b/ },
          { begin: /\bPRESERVE\s+ROWS\b/ },
          { begin: /\bDISCARD\s+PLANS\b/ },
          { begin: /\bREFERENCING\s+(OLD|NEW)\b/ },
          { begin: /\bSKIP\s+LOCKED\b/ },
          { begin: /\bGROUPING\s+SETS\b/ },
          { begin: /\b(BINARY|INSENSITIVE|SCROLL|NO\s+SCROLL)\s+(CURSOR|FOR)\b/ },
          { begin: /\b(WITH|WITHOUT)\s+HOLD\b/ },
          { begin: /\bWITH\s+(CASCADED|LOCAL)\s+CHECK\s+OPTION\b/ },
          { begin: /\bEXCLUDE\s+(TIES|NO\s+OTHERS)\b/ },
          { begin: /\bFORMAT\s+(TEXT|XML|JSON|YAML)\b/ },
          { begin: /\bSET\s+((SESSION|LOCAL)\s+)?NAMES\b/ },
          { begin: /\bIS\s+(NOT\s+)?UNKNOWN\b/ },
          { begin: /\bSECURITY\s+LABEL\b/ },
          { begin: /\bSTANDALONE\s+(YES|NO|NO\s+VALUE)\b/ },
          { begin: /\bWITH\s+(NO\s+)?DATA\b/ },
          { begin: /\b(FOREIGN|SET)\s+DATA\b/ },
          { begin: /\bSET\s+(CATALOG|CONSTRAINTS)\b/ },
          { begin: /\b(WITH|FOR)\s+ORDINALITY\b/ },
          { begin: /\bIS\s+(NOT\s+)?DOCUMENT\b/ },
          { begin: /\bXML\s+OPTION\s+(DOCUMENT|CONTENT)\b/ },
          { begin: /\b(STRIP|PRESERVE)\s+WHITESPACE\b/ },
          { begin: /\bNO\s+(ACTION|MAXVALUE|MINVALUE)\b/ },
          { begin: /\bPARTITION\s+BY\s+(RANGE|LIST|HASH)\b/ },
          { begin: /\bAT\s+TIME\s+ZONE\b/ },
          { begin: /\bGRANTED\s+BY\b/ },
          { begin: /\bRETURN\s+(QUERY|NEXT)\b/ },
          { begin: /\b(ATTACH|DETACH)\s+PARTITION\b/ },
          { begin: /\bFORCE\s+ROW\s+LEVEL\s+SECURITY\b/ },
          { begin: /\b(INCLUDING|EXCLUDING)\s+(COMMENTS|CONSTRAINTS|DEFAULTS|IDENTITY|INDEXES|STATISTICS|STORAGE|ALL)\b/ },
          { begin: /\bAS\s+(ASSIGNMENT|IMPLICIT|PERMISSIVE|RESTRICTIVE|ENUM|RANGE)\b/ }
        ]
      },
      // functions named as keywords, followed by '('
      {
        begin: /\b(FORMAT|FAMILY|VERSION)\s*\(/
        // keywords: { built_in: 'FORMAT FAMILY VERSION' }
      },
      // INCLUDE ( ... ) in index_parameters in CREATE TABLE
      {
        begin: /\bINCLUDE\s*\(/,
        keywords: "INCLUDE"
      },
      // not highlight RANGE if not in frame_clause (not 100% correct, but seems satisfactory)
      { begin: /\bRANGE(?!\s*(BETWEEN|UNBOUNDED|CURRENT|[-0-9]+))/ },
      // disable highlighting in commands CREATE AGGREGATE/COLLATION/DATABASE/OPERTOR/TEXT SEARCH .../TYPE
      // and in PL/pgSQL RAISE ... USING
      { begin: /\b(VERSION|OWNER|TEMPLATE|TABLESPACE|CONNECTION\s+LIMIT|PROCEDURE|RESTRICT|JOIN|PARSER|COPY|START|END|COLLATION|INPUT|ANALYZE|STORAGE|LIKE|DEFAULT|DELIMITER|ENCODING|COLUMN|CONSTRAINT|TABLE|SCHEMA)\s*=/ },
      // PG_smth; HAS_some_PRIVILEGE
      {
        // className: 'built_in',
        begin: /\b(PG_\w+?|HAS_[A-Z_]+_PRIVILEGE)\b/,
        relevance: 10
      },
      // extract
      {
        begin: /\bEXTRACT\s*\(/,
        end: /\bFROM\b/,
        returnEnd: !0,
        keywords: {
          // built_in: 'EXTRACT',
          type: "CENTURY DAY DECADE DOW DOY EPOCH HOUR ISODOW ISOYEAR MICROSECONDS MILLENNIUM MILLISECONDS MINUTE MONTH QUARTER SECOND TIMEZONE TIMEZONE_HOUR TIMEZONE_MINUTE WEEK YEAR"
        }
      },
      // xmlelement, xmlpi - special NAME
      {
        begin: /\b(XMLELEMENT|XMLPI)\s*\(\s*NAME/,
        keywords: {
          // built_in: 'XMLELEMENT XMLPI',
          keyword: "NAME"
        }
      },
      // xmlparse, xmlserialize
      {
        begin: /\b(XMLPARSE|XMLSERIALIZE)\s*\(\s*(DOCUMENT|CONTENT)/,
        keywords: {
          // built_in: 'XMLPARSE XMLSERIALIZE',
          keyword: "DOCUMENT CONTENT"
        }
      },
      // Sequences. We actually skip everything between CACHE|INCREMENT|MAXVALUE|MINVALUE and
      // nearest following numeric constant. Without with trick we find a lot of "keywords"
      // in 'avrasm' autodetection test...
      {
        beginKeywords: "CACHE INCREMENT MAXVALUE MINVALUE",
        end: t.C_NUMBER_RE,
        returnEnd: !0,
        keywords: "BY CACHE INCREMENT MAXVALUE MINVALUE"
      },
      // WITH|WITHOUT TIME ZONE as part of datatype
      {
        className: "type",
        begin: /\b(WITH|WITHOUT)\s+TIME\s+ZONE\b/
      },
      // INTERVAL optional fields
      {
        className: "type",
        begin: /\bINTERVAL\s+(YEAR|MONTH|DAY|HOUR|MINUTE|SECOND)(\s+TO\s+(MONTH|HOUR|MINUTE|SECOND))?\b/
      },
      // Pseudo-types which allowed only as return type
      {
        begin: /\bRETURNS\s+(LANGUAGE_HANDLER|TRIGGER|EVENT_TRIGGER|FDW_HANDLER|INDEX_AM_HANDLER|TSM_HANDLER)\b/,
        keywords: {
          keyword: "RETURNS",
          type: "LANGUAGE_HANDLER TRIGGER EVENT_TRIGGER FDW_HANDLER INDEX_AM_HANDLER TSM_HANDLER"
        }
      },
      // Known functions - only when followed by '('
      {
        begin: "\\b(" + m + ")\\s*\\("
        // keywords: { built_in: FUNCTIONS }
      },
      // Types
      {
        begin: "\\.(" + c + ")\\b"
        // prevent highlight as type, say, 'oid' in 'pgclass.oid'
      },
      {
        begin: "\\b(" + c + ")\\s+PATH\\b",
        // in XMLTABLE
        keywords: {
          keyword: "PATH",
          // hopefully no one would use PATH type in XMLTABLE...
          type: l.replace("PATH ", "")
        }
      },
      {
        className: "type",
        begin: "\\b(" + c + ")\\b"
      },
      // Strings, see https://www.postgresql.org/docs/11/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS
      {
        className: "string",
        begin: "'",
        end: "'",
        contains: [{ begin: "''" }]
      },
      {
        className: "string",
        begin: "(e|E|u&|U&)'",
        end: "'",
        contains: [{ begin: "\\\\." }],
        relevance: 10
      },
      t.END_SAME_AS_BEGIN({
        begin: r,
        end: r,
        contains: [
          {
            // actually we want them all except SQL; listed are those with known implementations
            // and XML + JSON just in case
            subLanguage: [
              "pgsql",
              "perl",
              "python",
              "tcl",
              "r",
              "lua",
              "java",
              "php",
              "ruby",
              "bash",
              "scheme",
              "xml",
              "json"
            ],
            endsWithParent: !0
          }
        ]
      }),
      // identifiers in quotes
      {
        begin: '"',
        end: '"',
        contains: [{ begin: '""' }]
      },
      // numbers
      t.C_NUMBER_MODE,
      // comments
      t.C_BLOCK_COMMENT_MODE,
      e,
      // PL/pgSQL staff
      // %ROWTYPE, %TYPE, $n
      {
        className: "meta",
        variants: [
          {
            // %TYPE, %ROWTYPE
            begin: "%(ROW)?TYPE",
            relevance: 10
          },
          {
            // $n
            begin: "\\$\\d+"
          },
          {
            // #compiler option
            begin: "^#\\w",
            end: "$"
          }
        ]
      },
      // <<labeles>>
      {
        className: "symbol",
        begin: i,
        relevance: 10
      }
    ]
  };
}
function ID(t) {
  const e = {
    keyword: "actor addressof and as be break class compile_error compile_intrinsic consume continue delegate digestof do else elseif embed end error for fun if ifdef in interface is isnt lambda let match new not object or primitive recover repeat return struct then trait try type until use var where while with xor",
    meta: "iso val tag trn box ref",
    literal: "this false true"
  }, n = {
    className: "string",
    begin: '"""',
    end: '"""',
    relevance: 10
  }, r = {
    className: "string",
    begin: '"',
    end: '"',
    contains: [t.BACKSLASH_ESCAPE]
  }, i = {
    className: "string",
    begin: "'",
    end: "'",
    contains: [t.BACKSLASH_ESCAPE],
    relevance: 0
  }, o = {
    className: "type",
    begin: "\\b_?[A-Z][\\w]*",
    relevance: 0
  }, a = {
    begin: t.IDENT_RE + "'",
    relevance: 0
  };
  return {
    name: "Pony",
    keywords: e,
    contains: [
      o,
      n,
      r,
      i,
      a,
      {
        className: "number",
        begin: "(-?)(\\b0[xX][a-fA-F0-9]+|\\b0[bB][01]+|(\\b\\d+(_\\d+)?(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",
        relevance: 0
      },
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE
    ]
  };
}
function xD(t) {
  const e = [
    "string",
    "char",
    "byte",
    "int",
    "long",
    "bool",
    "decimal",
    "single",
    "double",
    "DateTime",
    "xml",
    "array",
    "hashtable",
    "void"
  ], n = "Add|Clear|Close|Copy|Enter|Exit|Find|Format|Get|Hide|Join|Lock|Move|New|Open|Optimize|Pop|Push|Redo|Remove|Rename|Reset|Resize|Search|Select|Set|Show|Skip|Split|Step|Switch|Undo|Unlock|Watch|Backup|Checkpoint|Compare|Compress|Convert|ConvertFrom|ConvertTo|Dismount|Edit|Expand|Export|Group|Import|Initialize|Limit|Merge|Mount|Out|Publish|Restore|Save|Sync|Unpublish|Update|Approve|Assert|Build|Complete|Confirm|Deny|Deploy|Disable|Enable|Install|Invoke|Register|Request|Restart|Resume|Start|Stop|Submit|Suspend|Uninstall|Unregister|Wait|Debug|Measure|Ping|Repair|Resolve|Test|Trace|Connect|Disconnect|Read|Receive|Send|Write|Block|Grant|Protect|Revoke|Unblock|Unprotect|Use|ForEach|Sort|Tee|Where", r = "-and|-as|-band|-bnot|-bor|-bxor|-casesensitive|-ccontains|-ceq|-cge|-cgt|-cle|-clike|-clt|-cmatch|-cne|-cnotcontains|-cnotlike|-cnotmatch|-contains|-creplace|-csplit|-eq|-exact|-f|-file|-ge|-gt|-icontains|-ieq|-ige|-igt|-ile|-ilike|-ilt|-imatch|-in|-ine|-inotcontains|-inotlike|-inotmatch|-ireplace|-is|-isnot|-isplit|-join|-le|-like|-lt|-match|-ne|-not|-notcontains|-notin|-notlike|-notmatch|-or|-regex|-replace|-shl|-shr|-split|-wildcard|-xor", i = {
    $pattern: /-?[A-z\.\-]+\b/,
    keyword: "if else foreach return do while until elseif begin for trap data dynamicparam end break throw param continue finally in switch exit filter try process catch hidden static parameter",
    // "echo" relevance has been set to 0 to avoid auto-detect conflicts with shell transcripts
    built_in: "ac asnp cat cd CFS chdir clc clear clhy cli clp cls clv cnsn compare copy cp cpi cpp curl cvpa dbp del diff dir dnsn ebp echo|0 epal epcsv epsn erase etsn exsn fc fhx fl ft fw gal gbp gc gcb gci gcm gcs gdr gerr ghy gi gin gjb gl gm gmo gp gps gpv group gsn gsnp gsv gtz gu gv gwmi h history icm iex ihy ii ipal ipcsv ipmo ipsn irm ise iwmi iwr kill lp ls man md measure mi mount move mp mv nal ndr ni nmo npssc nsn nv ogv oh popd ps pushd pwd r rbp rcjb rcsn rd rdr ren ri rjb rm rmdir rmo rni rnp rp rsn rsnp rujb rv rvpa rwmi sajb sal saps sasv sbp sc scb select set shcm si sl sleep sls sort sp spjb spps spsv start stz sujb sv swmi tee trcm type wget where wjb write"
    // TODO: 'validate[A-Z]+' can't work in keywords
  }, o = /\w[\w\d]*((-)[\w\d]+)*/, a = {
    begin: "`[\\s\\S]",
    relevance: 0
  }, s = {
    className: "variable",
    variants: [
      { begin: /\$\B/ },
      {
        className: "keyword",
        begin: /\$this/
      },
      { begin: /\$[\w\d][\w\d_:]*/ }
    ]
  }, l = {
    className: "literal",
    begin: /\$(null|true|false)\b/
  }, c = {
    className: "string",
    variants: [
      {
        begin: /"/,
        end: /"/
      },
      {
        begin: /@"/,
        end: /^"@/
      }
    ],
    contains: [
      a,
      s,
      {
        className: "variable",
        begin: /\$[A-z]/,
        end: /[^A-z]/
      }
    ]
  }, u = {
    className: "string",
    variants: [
      {
        begin: /'/,
        end: /'/
      },
      {
        begin: /@'/,
        end: /^'@/
      }
    ]
  }, d = {
    className: "doctag",
    variants: [
      /* no paramater help tags */
      { begin: /\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/ },
      /* one parameter help tags */
      { begin: /\.(parameter|forwardhelptargetname|forwardhelpcategory|remotehelprunspace|externalhelp)\s+\S+/ }
    ]
  }, p = t.inherit(
    t.COMMENT(null, null),
    {
      variants: [
        /* single-line comment */
        {
          begin: /#/,
          end: /$/
        },
        /* multi-line comment */
        {
          begin: /<#/,
          end: /#>/
        }
      ],
      contains: [d]
    }
  ), _ = {
    className: "built_in",
    variants: [{ begin: "(".concat(n, ")+(-)[\\w\\d]+") }]
  }, m = {
    className: "class",
    beginKeywords: "class enum",
    end: /\s*[{]/,
    excludeEnd: !0,
    relevance: 0,
    contains: [t.TITLE_MODE]
  }, f = {
    className: "function",
    begin: /function\s+/,
    end: /\s*\{|$/,
    excludeEnd: !0,
    returnBegin: !0,
    relevance: 0,
    contains: [
      {
        begin: "function",
        relevance: 0,
        className: "keyword"
      },
      {
        className: "title",
        begin: o,
        relevance: 0
      },
      {
        begin: /\(/,
        end: /\)/,
        className: "params",
        relevance: 0,
        contains: [s]
      }
      // CMDLETS
    ]
  }, g = {
    begin: /using\s/,
    end: /$/,
    returnBegin: !0,
    contains: [
      c,
      u,
      {
        className: "keyword",
        begin: /(using|assembly|command|module|namespace|type)/
      }
    ]
  }, S = { variants: [
    // PS literals are pretty verbose so it's a good idea to accent them a bit.
    {
      className: "operator",
      begin: "(".concat(r, ")\\b")
    },
    {
      className: "literal",
      begin: /(-){1,2}[\w\d-]+/,
      relevance: 0
    }
  ] }, E = {
    className: "selector-tag",
    begin: /@\B/,
    relevance: 0
  }, b = {
    className: "function",
    begin: /\[.*\]\s*[\w]+[ ]??\(/,
    end: /$/,
    returnBegin: !0,
    relevance: 0,
    contains: [
      {
        className: "keyword",
        begin: "(".concat(
          i.keyword.toString().replace(
            /\s/g,
            "|"
          ),
          ")\\b"
        ),
        endsParent: !0,
        relevance: 0
      },
      t.inherit(t.TITLE_MODE, { endsParent: !0 })
    ]
  }, h = [
    // STATIC_MEMBER,
    b,
    p,
    a,
    t.NUMBER_MODE,
    c,
    u,
    // PS_NEW_OBJECT_TYPE,
    _,
    s,
    l,
    E
  ], T = {
    begin: /\[/,
    end: /\]/,
    excludeBegin: !0,
    excludeEnd: !0,
    relevance: 0,
    contains: [].concat(
      "self",
      h,
      {
        begin: "(" + e.join("|") + ")",
        className: "built_in",
        relevance: 0
      },
      {
        className: "type",
        begin: /[\.\w\d]+/,
        relevance: 0
      }
    )
  };
  return b.contains.unshift(T), {
    name: "PowerShell",
    aliases: [
      "pwsh",
      "ps",
      "ps1"
    ],
    case_insensitive: !0,
    keywords: i,
    contains: h.concat(
      m,
      f,
      g,
      S,
      T
    )
  };
}
function DD(t) {
  const e = t.regex, n = [
    "displayHeight",
    "displayWidth",
    "mouseY",
    "mouseX",
    "mousePressed",
    "pmouseX",
    "pmouseY",
    "key",
    "keyCode",
    "pixels",
    "focused",
    "frameCount",
    "frameRate",
    "height",
    "width",
    "size",
    "createGraphics",
    "beginDraw",
    "createShape",
    "loadShape",
    "PShape",
    "arc",
    "ellipse",
    "line",
    "point",
    "quad",
    "rect",
    "triangle",
    "bezier",
    "bezierDetail",
    "bezierPoint",
    "bezierTangent",
    "curve",
    "curveDetail",
    "curvePoint",
    "curveTangent",
    "curveTightness",
    "shape",
    "shapeMode",
    "beginContour",
    "beginShape",
    "bezierVertex",
    "curveVertex",
    "endContour",
    "endShape",
    "quadraticVertex",
    "vertex",
    "ellipseMode",
    "noSmooth",
    "rectMode",
    "smooth",
    "strokeCap",
    "strokeJoin",
    "strokeWeight",
    "mouseClicked",
    "mouseDragged",
    "mouseMoved",
    "mousePressed",
    "mouseReleased",
    "mouseWheel",
    "keyPressed",
    "keyPressedkeyReleased",
    "keyTyped",
    "print",
    "println",
    "save",
    "saveFrame",
    "day",
    "hour",
    "millis",
    "minute",
    "month",
    "second",
    "year",
    "background",
    "clear",
    "colorMode",
    "fill",
    "noFill",
    "noStroke",
    "stroke",
    "alpha",
    "blue",
    "brightness",
    "color",
    "green",
    "hue",
    "lerpColor",
    "red",
    "saturation",
    "modelX",
    "modelY",
    "modelZ",
    "screenX",
    "screenY",
    "screenZ",
    "ambient",
    "emissive",
    "shininess",
    "specular",
    "add",
    "createImage",
    "beginCamera",
    "camera",
    "endCamera",
    "frustum",
    "ortho",
    "perspective",
    "printCamera",
    "printProjection",
    "cursor",
    "frameRate",
    "noCursor",
    "exit",
    "loop",
    "noLoop",
    "popStyle",
    "pushStyle",
    "redraw",
    "binary",
    "boolean",
    "byte",
    "char",
    "float",
    "hex",
    "int",
    "str",
    "unbinary",
    "unhex",
    "join",
    "match",
    "matchAll",
    "nf",
    "nfc",
    "nfp",
    "nfs",
    "split",
    "splitTokens",
    "trim",
    "append",
    "arrayCopy",
    "concat",
    "expand",
    "reverse",
    "shorten",
    "sort",
    "splice",
    "subset",
    "box",
    "sphere",
    "sphereDetail",
    "createInput",
    "createReader",
    "loadBytes",
    "loadJSONArray",
    "loadJSONObject",
    "loadStrings",
    "loadTable",
    "loadXML",
    "open",
    "parseXML",
    "saveTable",
    "selectFolder",
    "selectInput",
    "beginRaw",
    "beginRecord",
    "createOutput",
    "createWriter",
    "endRaw",
    "endRecord",
    "PrintWritersaveBytes",
    "saveJSONArray",
    "saveJSONObject",
    "saveStream",
    "saveStrings",
    "saveXML",
    "selectOutput",
    "popMatrix",
    "printMatrix",
    "pushMatrix",
    "resetMatrix",
    "rotate",
    "rotateX",
    "rotateY",
    "rotateZ",
    "scale",
    "shearX",
    "shearY",
    "translate",
    "ambientLight",
    "directionalLight",
    "lightFalloff",
    "lights",
    "lightSpecular",
    "noLights",
    "normal",
    "pointLight",
    "spotLight",
    "image",
    "imageMode",
    "loadImage",
    "noTint",
    "requestImage",
    "tint",
    "texture",
    "textureMode",
    "textureWrap",
    "blend",
    "copy",
    "filter",
    "get",
    "loadPixels",
    "set",
    "updatePixels",
    "blendMode",
    "loadShader",
    "PShaderresetShader",
    "shader",
    "createFont",
    "loadFont",
    "text",
    "textFont",
    "textAlign",
    "textLeading",
    "textMode",
    "textSize",
    "textWidth",
    "textAscent",
    "textDescent",
    "abs",
    "ceil",
    "constrain",
    "dist",
    "exp",
    "floor",
    "lerp",
    "log",
    "mag",
    "map",
    "max",
    "min",
    "norm",
    "pow",
    "round",
    "sq",
    "sqrt",
    "acos",
    "asin",
    "atan",
    "atan2",
    "cos",
    "degrees",
    "radians",
    "sin",
    "tan",
    "noise",
    "noiseDetail",
    "noiseSeed",
    "random",
    "randomGaussian",
    "randomSeed"
  ], r = t.IDENT_RE, i = { variants: [
    {
      match: e.concat(e.either(...n), e.lookahead(/\s*\(/)),
      className: "built_in"
    },
    {
      relevance: 0,
      match: e.concat(
        /\b(?!for|if|while)/,
        r,
        e.lookahead(/\s*\(/)
      ),
      className: "title.function"
    }
  ] }, o = {
    match: [
      /new\s+/,
      r
    ],
    className: {
      1: "keyword",
      2: "class.title"
    }
  }, a = {
    relevance: 0,
    match: [
      /\./,
      r
    ],
    className: { 2: "property" }
  }, s = {
    variants: [
      { match: [
        /class/,
        /\s+/,
        r,
        /\s+/,
        /extends/,
        /\s+/,
        r
      ] },
      { match: [
        /class/,
        /\s+/,
        r
      ] }
    ],
    className: {
      1: "keyword",
      3: "title.class",
      5: "keyword",
      7: "title.class.inherited"
    }
  }, l = [
    "boolean",
    "byte",
    "char",
    "color",
    "double",
    "float",
    "int",
    "long",
    "short"
  ], c = [
    "BufferedReader",
    "PVector",
    "PFont",
    "PImage",
    "PGraphics",
    "HashMap",
    "String",
    "Array",
    "FloatDict",
    "ArrayList",
    "FloatList",
    "IntDict",
    "IntList",
    "JSONArray",
    "JSONObject",
    "Object",
    "StringDict",
    "StringList",
    "Table",
    "TableRow",
    "XML"
  ];
  return {
    name: "Processing",
    aliases: ["pde"],
    keywords: {
      keyword: [...[
        "abstract",
        "assert",
        "break",
        "case",
        "catch",
        "const",
        "continue",
        "default",
        "else",
        "enum",
        "final",
        "finally",
        "for",
        "if",
        "import",
        "instanceof",
        "long",
        "native",
        "new",
        "package",
        "private",
        "private",
        "protected",
        "protected",
        "public",
        "public",
        "return",
        "static",
        "strictfp",
        "switch",
        "synchronized",
        "throw",
        "throws",
        "transient",
        "try",
        "void",
        "volatile",
        "while"
      ]],
      literal: "P2D P3D HALF_PI PI QUARTER_PI TAU TWO_PI null true false",
      title: "setup draw",
      variable: "super this",
      built_in: [
        ...n,
        ...c
      ],
      type: l
    },
    contains: [
      s,
      o,
      i,
      a,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      t.C_NUMBER_MODE
    ]
  };
}
function wD(t) {
  return {
    name: "Python profiler",
    contains: [
      t.C_NUMBER_MODE,
      {
        begin: "[a-zA-Z_][\\da-zA-Z_]+\\.[\\da-zA-Z_]{1,3}",
        end: ":",
        excludeEnd: !0
      },
      {
        begin: "(ncalls|tottime|cumtime)",
        end: "$",
        keywords: "ncalls tottime|10 cumtime|10 filename",
        relevance: 10
      },
      {
        begin: "function calls",
        end: "$",
        contains: [t.C_NUMBER_MODE],
        relevance: 10
      },
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      {
        className: "string",
        begin: "\\(",
        end: "\\)$",
        excludeBegin: !0,
        excludeEnd: !0,
        relevance: 0
      }
    ]
  };
}
function MD(t) {
  const e = {
    begin: /[a-z][A-Za-z0-9_]*/,
    relevance: 0
  }, n = {
    className: "symbol",
    variants: [
      { begin: /[A-Z][a-zA-Z0-9_]*/ },
      { begin: /_[A-Za-z0-9_]*/ }
    ],
    relevance: 0
  }, r = {
    begin: /\(/,
    end: /\)/,
    relevance: 0
  }, i = {
    begin: /\[/,
    end: /\]/
  }, o = {
    className: "comment",
    begin: /%/,
    end: /$/,
    contains: [t.PHRASAL_WORDS_MODE]
  }, a = {
    className: "string",
    begin: /`/,
    end: /`/,
    contains: [t.BACKSLASH_ESCAPE]
  }, s = {
    className: "string",
    // 0'a etc.
    begin: /0'(\\'|.)/
  }, l = {
    className: "string",
    begin: /0'\\s/
    // 0'\s
  }, u = [
    e,
    n,
    r,
    {
      // relevance booster
      begin: /:-/
    },
    i,
    o,
    t.C_BLOCK_COMMENT_MODE,
    t.QUOTE_STRING_MODE,
    t.APOS_STRING_MODE,
    a,
    s,
    l,
    t.C_NUMBER_MODE
  ];
  return r.contains = u, i.contains = u, {
    name: "Prolog",
    contains: u.concat([
      {
        // relevance booster
        begin: /\.$/
      }
    ])
  };
}
function LD(t) {
  const e = "[ \\t\\f]*", n = "[ \\t\\f]+", r = e + "[:=]" + e, i = n, o = "(" + r + "|" + i + ")", a = "([^\\\\:= \\t\\f\\n]|\\\\.)+", s = {
    // skip DELIM
    end: o,
    relevance: 0,
    starts: {
      // value: everything until end of line (again, taking into account backslashes)
      className: "string",
      end: /$/,
      relevance: 0,
      contains: [
        { begin: "\\\\\\\\" },
        { begin: "\\\\\\n" }
      ]
    }
  };
  return {
    name: ".properties",
    disableAutodetect: !0,
    case_insensitive: !0,
    illegal: /\S/,
    contains: [
      t.COMMENT("^\\s*[!#]", "$"),
      // key: everything until whitespace or = or : (taking into account backslashes)
      // case of a key-value pair
      {
        returnBegin: !0,
        variants: [
          { begin: a + r },
          { begin: a + i }
        ],
        contains: [
          {
            className: "attr",
            begin: a,
            endsParent: !0
          }
        ],
        starts: s
      },
      // case of an empty key
      {
        className: "attr",
        begin: a + e + "$"
      }
    ]
  };
}
function kD(t) {
  const e = [
    "package",
    "import",
    "option",
    "optional",
    "required",
    "repeated",
    "group",
    "oneof"
  ], n = [
    "double",
    "float",
    "int32",
    "int64",
    "uint32",
    "uint64",
    "sint32",
    "sint64",
    "fixed32",
    "fixed64",
    "sfixed32",
    "sfixed64",
    "bool",
    "string",
    "bytes"
  ], r = {
    match: [
      /(message|enum|service)\s+/,
      t.IDENT_RE
    ],
    scope: {
      1: "keyword",
      2: "title.class"
    }
  };
  return {
    name: "Protocol Buffers",
    aliases: ["proto"],
    keywords: {
      keyword: e,
      type: n,
      literal: [
        "true",
        "false"
      ]
    },
    contains: [
      t.QUOTE_STRING_MODE,
      t.NUMBER_MODE,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      r,
      {
        className: "function",
        beginKeywords: "rpc",
        end: /[{;]/,
        excludeEnd: !0,
        keywords: "rpc returns"
      },
      {
        // match enum items (relevance)
        // BLAH = ...;
        begin: /^\s*[A-Z_]+(?=\s*=[^\n]+;$)/
      }
    ]
  };
}
function PD(t) {
  const e = {
    keyword: (
      /* language keywords */
      "and case default else elsif false if in import enherits node or true undef unless main settings $string "
    ),
    literal: (
      /* metaparameters */
      "alias audit before loglevel noop require subscribe tag owner ensure group mode name|0 changes context force incl lens load_path onlyif provider returns root show_diff type_check en_address ip_address realname command environment hour monute month monthday special target weekday creates cwd ogoutput refresh refreshonly tries try_sleep umask backup checksum content ctime force ignore links mtime purge recurse recurselimit replace selinux_ignore_defaults selrange selrole seltype seluser source souirce_permissions sourceselect validate_cmd validate_replacement allowdupe attribute_membership auth_membership forcelocal gid ia_load_module members system host_aliases ip allowed_trunk_vlans description device_url duplex encapsulation etherchannel native_vlan speed principals allow_root auth_class auth_type authenticate_user k_of_n mechanisms rule session_owner shared options device fstype enable hasrestart directory present absent link atboot blockdevice device dump pass remounts poller_tag use message withpath adminfile allow_virtual allowcdrom category configfiles flavor install_options instance package_settings platform responsefile status uninstall_options vendor unless_system_user unless_uid binary control flags hasstatus manifest pattern restart running start stop allowdupe auths expiry gid groups home iterations key_membership keys managehome membership password password_max_age password_min_age profile_membership profiles project purge_ssh_keys role_membership roles salt shell uid baseurl cost descr enabled enablegroups exclude failovermethod gpgcheck gpgkey http_caching include includepkgs keepalive metadata_expire metalink mirrorlist priority protect proxy proxy_password proxy_username repo_gpgcheck s3_enabled skip_if_unavailable sslcacert sslclientcert sslclientkey sslverify mounted"
    ),
    built_in: (
      /* core facts */
      "architecture augeasversion blockdevices boardmanufacturer boardproductname boardserialnumber cfkey dhcp_servers domain ec2_ ec2_userdata facterversion filesystems ldom fqdn gid hardwareisa hardwaremodel hostname id|0 interfaces ipaddress ipaddress_ ipaddress6 ipaddress6_ iphostnumber is_virtual kernel kernelmajversion kernelrelease kernelversion kernelrelease kernelversion lsbdistcodename lsbdistdescription lsbdistid lsbdistrelease lsbmajdistrelease lsbminordistrelease lsbrelease macaddress macaddress_ macosx_buildversion macosx_productname macosx_productversion macosx_productverson_major macosx_productversion_minor manufacturer memoryfree memorysize netmask metmask_ network_ operatingsystem operatingsystemmajrelease operatingsystemrelease osfamily partitions path physicalprocessorcount processor processorcount productname ps puppetversion rubysitedir rubyversion selinux selinux_config_mode selinux_config_policy selinux_current_mode selinux_current_mode selinux_enforced selinux_policyversion serialnumber sp_ sshdsakey sshecdsakey sshrsakey swapencrypted swapfree swapsize timezone type uniqueid uptime uptime_days uptime_hours uptime_seconds uuid virtual vlans xendomains zfs_version zonenae zones zpool_version"
    )
  }, n = t.COMMENT("#", "$"), r = "([A-Za-z_]|::)(\\w|::)*", i = t.inherit(t.TITLE_MODE, { begin: r }), o = {
    className: "variable",
    begin: "\\$" + r
  }, a = {
    className: "string",
    contains: [
      t.BACKSLASH_ESCAPE,
      o
    ],
    variants: [
      {
        begin: /'/,
        end: /'/
      },
      {
        begin: /"/,
        end: /"/
      }
    ]
  };
  return {
    name: "Puppet",
    aliases: ["pp"],
    contains: [
      n,
      o,
      a,
      {
        beginKeywords: "class",
        end: "\\{|;",
        illegal: /=/,
        contains: [
          i,
          n
        ]
      },
      {
        beginKeywords: "define",
        end: /\{/,
        contains: [
          {
            className: "section",
            begin: t.IDENT_RE,
            endsParent: !0
          }
        ]
      },
      {
        begin: t.IDENT_RE + "\\s+\\{",
        returnBegin: !0,
        end: /\S/,
        contains: [
          {
            className: "keyword",
            begin: t.IDENT_RE,
            relevance: 0.2
          },
          {
            begin: /\{/,
            end: /\}/,
            keywords: e,
            relevance: 0,
            contains: [
              a,
              n,
              {
                begin: "[a-zA-Z_]+\\s*=>",
                returnBegin: !0,
                end: "=>",
                contains: [
                  {
                    className: "attr",
                    begin: t.IDENT_RE
                  }
                ]
              },
              {
                className: "number",
                begin: "(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",
                relevance: 0
              },
              o
            ]
          }
        ],
        relevance: 0
      }
    ]
  };
}
function FD(t) {
  const e = {
    // PB IDE color: #0080FF (Azure Radiance)
    className: "string",
    begin: '(~)?"',
    end: '"',
    illegal: "\\n"
  }, n = {
    // PB IDE color: #924B72 (Cannon Pink)
    //  "#" + a letter or underscore + letters, digits or underscores + (optional) "$"
    className: "symbol",
    begin: "#[a-zA-Z_]\\w*\\$?"
  };
  return {
    name: "PureBASIC",
    aliases: [
      "pb",
      "pbi"
    ],
    keywords: (
      // PB IDE color: #006666 (Blue Stone) + Bold
      // Keywords from all version of PureBASIC 5.00 upward ...
      "Align And Array As Break CallDebugger Case CompilerCase CompilerDefault CompilerElse CompilerElseIf CompilerEndIf CompilerEndSelect CompilerError CompilerIf CompilerSelect CompilerWarning Continue Data DataSection Debug DebugLevel Declare DeclareC DeclareCDLL DeclareDLL DeclareModule Default Define Dim DisableASM DisableDebugger DisableExplicit Else ElseIf EnableASM EnableDebugger EnableExplicit End EndDataSection EndDeclareModule EndEnumeration EndIf EndImport EndInterface EndMacro EndModule EndProcedure EndSelect EndStructure EndStructureUnion EndWith Enumeration EnumerationBinary Extends FakeReturn For ForEach ForEver Global Gosub Goto If Import ImportC IncludeBinary IncludeFile IncludePath Interface List Macro MacroExpandedCount Map Module NewList NewMap Next Not Or Procedure ProcedureC ProcedureCDLL ProcedureDLL ProcedureReturn Protected Prototype PrototypeC ReDim Read Repeat Restore Return Runtime Select Shared Static Step Structure StructureUnion Swap Threaded To UndefineMacro Until Until  UnuseModule UseModule Wend While With XIncludeFile XOr"
    ),
    contains: [
      // COMMENTS | PB IDE color: #00AAAA (Persian Green)
      t.COMMENT(";", "$", { relevance: 0 }),
      {
        // PROCEDURES DEFINITIONS
        className: "function",
        begin: "\\b(Procedure|Declare)(C|CDLL|DLL)?\\b",
        end: "\\(",
        excludeEnd: !0,
        returnBegin: !0,
        contains: [
          {
            // PROCEDURE KEYWORDS | PB IDE color: #006666 (Blue Stone) + Bold
            className: "keyword",
            begin: "(Procedure|Declare)(C|CDLL|DLL)?",
            excludeEnd: !0
          },
          {
            // PROCEDURE RETURN TYPE SETTING | PB IDE color: #000000 (Black)
            className: "type",
            begin: "\\.\\w*"
            // end: ' ',
          },
          t.UNDERSCORE_TITLE_MODE
          // PROCEDURE NAME | PB IDE color: #006666 (Blue Stone)
        ]
      },
      e,
      n
    ]
  };
}
function BD(t) {
  return {
    name: "Q",
    aliases: [
      "k",
      "kdb"
    ],
    keywords: {
      $pattern: /(`?)[A-Za-z0-9_]+\b/,
      keyword: "do while select delete by update from",
      literal: "0b 1b",
      built_in: "neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum",
      type: "`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid"
    },
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      t.C_NUMBER_MODE
    ]
  };
}
function UD(t) {
  const e = t.regex, n = {
    keyword: "in of on if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await import",
    literal: "true false null undefined NaN Infinity",
    built_in: "eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Behavior bool color coordinate date double enumeration font geocircle georectangle geoshape int list matrix4x4 parent point quaternion real rect size string url variant vector2d vector3d vector4d Promise"
  }, r = "[a-zA-Z_][a-zA-Z0-9\\._]*", i = {
    className: "keyword",
    begin: "\\bproperty\\b",
    starts: {
      className: "string",
      end: "(:|=|;|,|//|/\\*|$)",
      returnEnd: !0
    }
  }, o = {
    className: "keyword",
    begin: "\\bsignal\\b",
    starts: {
      className: "string",
      end: "(\\(|:|=|;|,|//|/\\*|$)",
      returnEnd: !0
    }
  }, a = {
    className: "attribute",
    begin: "\\bid\\s*:",
    starts: {
      className: "string",
      end: r,
      returnEnd: !1
    }
  }, s = {
    begin: r + "\\s*:",
    returnBegin: !0,
    contains: [
      {
        className: "attribute",
        begin: r,
        end: "\\s*:",
        excludeEnd: !0,
        relevance: 0
      }
    ],
    relevance: 0
  }, l = {
    begin: e.concat(r, /\s*\{/),
    end: /\{/,
    returnBegin: !0,
    relevance: 0,
    contains: [t.inherit(t.TITLE_MODE, { begin: r })]
  };
  return {
    name: "QML",
    aliases: ["qt"],
    case_insensitive: !1,
    keywords: n,
    contains: [
      {
        className: "meta",
        begin: /^\s*['"]use (strict|asm)['"]/
      },
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      {
        // template string
        className: "string",
        begin: "`",
        end: "`",
        contains: [
          t.BACKSLASH_ESCAPE,
          {
            className: "subst",
            begin: "\\$\\{",
            end: "\\}"
          }
        ]
      },
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      {
        className: "number",
        variants: [
          { begin: "\\b(0[bB][01]+)" },
          { begin: "\\b(0[oO][0-7]+)" },
          { begin: t.C_NUMBER_RE }
        ],
        relevance: 0
      },
      {
        // "value" container
        begin: "(" + t.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
        keywords: "return throw case",
        contains: [
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE,
          t.REGEXP_MODE,
          {
            // E4X / JSX
            begin: /</,
            end: />\s*[);\]]/,
            relevance: 0,
            subLanguage: "xml"
          }
        ],
        relevance: 0
      },
      o,
      i,
      {
        className: "function",
        beginKeywords: "function",
        end: /\{/,
        excludeEnd: !0,
        contains: [
          t.inherit(t.TITLE_MODE, { begin: /[A-Za-z$_][0-9A-Za-z$_]*/ }),
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            excludeBegin: !0,
            excludeEnd: !0,
            contains: [
              t.C_LINE_COMMENT_MODE,
              t.C_BLOCK_COMMENT_MODE
            ]
          }
        ],
        illegal: /\[|%/
      },
      {
        // hack: prevents detection of keywords after dots
        begin: "\\." + t.IDENT_RE,
        relevance: 0
      },
      a,
      s,
      l
    ],
    illegal: /#/
  };
}
function HD(t) {
  return {
    name: "ReasonML",
    aliases: ["re"],
    keywords: {
      $pattern: /[a-z_]\w*!?/,
      keyword: [
        "and",
        "as",
        "asr",
        "assert",
        "begin",
        "class",
        "constraint",
        "do",
        "done",
        "downto",
        "else",
        "end",
        "esfun",
        "exception",
        "external",
        "for",
        "fun",
        "function",
        "functor",
        "if",
        "in",
        "include",
        "inherit",
        "initializer",
        "land",
        "lazy",
        "let",
        "lor",
        "lsl",
        "lsr",
        "lxor",
        "mod",
        "module",
        "mutable",
        "new",
        "nonrec",
        "object",
        "of",
        "open",
        "or",
        "pri",
        "pub",
        "rec",
        "sig",
        "struct",
        "switch",
        "then",
        "to",
        "try",
        "type",
        "val",
        "virtual",
        "when",
        "while",
        "with"
      ],
      built_in: [
        "array",
        "bool",
        "bytes",
        "char",
        "exn|5",
        "float",
        "int",
        "int32",
        "int64",
        "list",
        "lazy_t|5",
        "nativeint|5",
        "ref",
        "string",
        "unit"
      ],
      literal: ["true", "false"]
    },
    illegal: /(:-|:=|\$\{|\+=)/,
    contains: [
      {
        scope: "literal",
        match: /\[(\|\|)?\]|\(\)/,
        relevance: 0
      },
      t.C_LINE_COMMENT_MODE,
      t.COMMENT(/\/\*/, /\*\//, { illegal: /^(#,\/\/)/ }),
      {
        /* type variable */
        scope: "symbol",
        match: /\'[A-Za-z_](?!\')[\w\']*/
        /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */
      },
      {
        /* polymorphic variant */
        scope: "type",
        match: /`[A-Z][\w\']*/
      },
      {
        /* module or constructor */
        scope: "type",
        match: /\b[A-Z][\w\']*/,
        relevance: 0
      },
      {
        /* don't color identifiers, but safely catch all identifiers with ' */
        match: /[a-z_]\w*\'[\w\']*/,
        relevance: 0
      },
      {
        scope: "operator",
        match: /\s+(\|\||\+[\+\.]?|\*[\*\/\.]?|\/[\.]?|\.\.\.|\|>|&&|===?)\s+/,
        relevance: 0
      },
      t.inherit(t.APOS_STRING_MODE, {
        scope: "string",
        relevance: 0
      }),
      t.inherit(t.QUOTE_STRING_MODE, { illegal: null }),
      {
        scope: "number",
        variants: [
          { match: /\b0[xX][a-fA-F0-9_]+[Lln]?/ },
          { match: /\b0[oO][0-7_]+[Lln]?/ },
          { match: /\b0[bB][01_]+[Lln]?/ },
          { match: /\b[0-9][0-9_]*([Lln]|(\.[0-9_]*)?([eE][-+]?[0-9_]+)?)/ }
        ],
        relevance: 0
      }
    ]
  };
}
function GD(t) {
  return {
    name: "RenderMan RIB",
    keywords: "ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry Hider Hyperboloid Identity Illuminate Imager Interior LightSource MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd TransformPoints Translate TrimCurve WorldBegin WorldEnd",
    illegal: "</",
    contains: [
      t.HASH_COMMENT_MODE,
      t.C_NUMBER_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE
    ]
  };
}
function VD(t) {
  const e = "[a-zA-Z-_][^\\n{]+\\{", n = {
    className: "attribute",
    begin: /[a-zA-Z-_]+/,
    end: /\s*:/,
    excludeEnd: !0,
    starts: {
      end: ";",
      relevance: 0,
      contains: [
        {
          className: "variable",
          begin: /\.[a-zA-Z-_]+/
        },
        {
          className: "keyword",
          begin: /\(optional\)/
        }
      ]
    }
  };
  return {
    name: "Roboconf",
    aliases: [
      "graph",
      "instances"
    ],
    case_insensitive: !0,
    keywords: "import",
    contains: [
      // Facet sections
      {
        begin: "^facet " + e,
        end: /\}/,
        keywords: "facet",
        contains: [
          n,
          t.HASH_COMMENT_MODE
        ]
      },
      // Instance sections
      {
        begin: "^\\s*instance of " + e,
        end: /\}/,
        keywords: "name count channels instance-data instance-state instance of",
        illegal: /\S/,
        contains: [
          "self",
          n,
          t.HASH_COMMENT_MODE
        ]
      },
      // Component sections
      {
        begin: "^" + e,
        end: /\}/,
        contains: [
          n,
          t.HASH_COMMENT_MODE
        ]
      },
      // Comments
      t.HASH_COMMENT_MODE
    ]
  };
}
function YD(t) {
  const e = "foreach do while for if from to step else on-error and or not in", n = "global local beep delay put len typeof pick log time set find environment terminal error execute parse resolve toarray tobool toid toip toip6 tonum tostr totime", r = "add remove enable disable set get print export edit find run debug error info warning", i = "true false yes no nothing nil null", o = "traffic-flow traffic-generator firewall scheduler aaa accounting address-list address align area bandwidth-server bfd bgp bridge client clock community config connection console customer default dhcp-client dhcp-server discovery dns e-mail ethernet filter firmware gps graphing group hardware health hotspot identity igmp-proxy incoming instance interface ip ipsec ipv6 irq l2tp-server lcd ldp logging mac-server mac-winbox mangle manual mirror mme mpls nat nd neighbor network note ntp ospf ospf-v3 ovpn-server page peer pim ping policy pool port ppp pppoe-client pptp-server prefix profile proposal proxy queue radius resource rip ripng route routing screen script security-profiles server service service-port settings shares smb sms sniffer snmp snooper socks sstp-server system tool tracking type upgrade upnp user-manager users user vlan secret vrrp watchdog web-access wireless pptp pppoe lan wan layer7-protocol lease simple raw", a = {
    className: "variable",
    variants: [
      { begin: /\$[\w\d#@][\w\d_]*/ },
      { begin: /\$\{(.*?)\}/ }
    ]
  }, s = {
    className: "string",
    begin: /"/,
    end: /"/,
    contains: [
      t.BACKSLASH_ESCAPE,
      a,
      {
        className: "variable",
        begin: /\$\(/,
        end: /\)/,
        contains: [t.BACKSLASH_ESCAPE]
      }
    ]
  }, l = {
    className: "string",
    begin: /'/,
    end: /'/
  };
  return {
    name: "MikroTik RouterOS script",
    aliases: ["mikrotik"],
    case_insensitive: !0,
    keywords: {
      $pattern: /:?[\w-]+/,
      literal: i,
      keyword: e + " :" + e.split(" ").join(" :") + " :" + n.split(" ").join(" :")
    },
    contains: [
      {
        // illegal syntax
        variants: [
          {
            // -- comment
            begin: /\/\*/,
            end: /\*\//
          },
          {
            // Stan comment
            begin: /\/\//,
            end: /$/
          },
          {
            // HTML tags
            begin: /<\//,
            end: />/
          }
        ],
        illegal: /./
      },
      t.COMMENT("^#", "$"),
      s,
      l,
      a,
      // attribute=value
      {
        // > is to avoid matches with => in other grammars
        begin: /[\w-]+=([^\s{}[\]()>]+)/,
        relevance: 0,
        returnBegin: !0,
        contains: [
          {
            className: "attribute",
            begin: /[^=]+/
          },
          {
            begin: /=/,
            endsWithParent: !0,
            relevance: 0,
            contains: [
              s,
              l,
              a,
              {
                className: "literal",
                begin: "\\b(" + i.split(" ").join("|") + ")\\b"
              },
              {
                // Do not format unclassified values. Needed to exclude highlighting of values as built_in.
                begin: /("[^"]*"|[^\s{}[\]]+)/
              }
              /*
              {
                // IPv4 addresses and subnets
                className: 'number',
                variants: [
                  {begin: IPADDR_wBITMASK+'(,'+IPADDR_wBITMASK+')*'}, //192.168.0.0/24,1.2.3.0/24
                  {begin: IPADDR+'-'+IPADDR},       // 192.168.0.1-192.168.0.3
                  {begin: IPADDR+'(,'+IPADDR+')*'}, // 192.168.0.1,192.168.0.34,192.168.24.1,192.168.0.1
                ]
              },
              {
                // MAC addresses and DHCP Client IDs
                className: 'number',
                begin: /\b(1:)?([0-9A-Fa-f]{1,2}[:-]){5}([0-9A-Fa-f]){1,2}\b/,
              },
              */
            ]
          }
        ]
      },
      {
        // HEX values
        className: "number",
        begin: /\*[0-9a-fA-F]+/
      },
      {
        begin: "\\b(" + r.split(" ").join("|") + ")([\\s[(\\]|])",
        returnBegin: !0,
        contains: [
          {
            className: "built_in",
            // 'function',
            begin: /\w+/
          }
        ]
      },
      {
        className: "built_in",
        variants: [
          { begin: "(\\.\\./|/|\\s)((" + o.split(" ").join("|") + ");?\\s)+" },
          {
            begin: /\.\./,
            relevance: 0
          }
        ]
      }
    ]
  };
}
function $D(t) {
  const e = [
    "abs",
    "acos",
    "ambient",
    "area",
    "asin",
    "atan",
    "atmosphere",
    "attribute",
    "calculatenormal",
    "ceil",
    "cellnoise",
    "clamp",
    "comp",
    "concat",
    "cos",
    "degrees",
    "depth",
    "Deriv",
    "diffuse",
    "distance",
    "Du",
    "Dv",
    "environment",
    "exp",
    "faceforward",
    "filterstep",
    "floor",
    "format",
    "fresnel",
    "incident",
    "length",
    "lightsource",
    "log",
    "match",
    "max",
    "min",
    "mod",
    "noise",
    "normalize",
    "ntransform",
    "opposite",
    "option",
    "phong",
    "pnoise",
    "pow",
    "printf",
    "ptlined",
    "radians",
    "random",
    "reflect",
    "refract",
    "renderinfo",
    "round",
    "setcomp",
    "setxcomp",
    "setycomp",
    "setzcomp",
    "shadow",
    "sign",
    "sin",
    "smoothstep",
    "specular",
    "specularbrdf",
    "spline",
    "sqrt",
    "step",
    "tan",
    "texture",
    "textureinfo",
    "trace",
    "transform",
    "vtransform",
    "xcomp",
    "ycomp",
    "zcomp"
  ], n = [
    "matrix",
    "float",
    "color",
    "point",
    "normal",
    "vector"
  ], r = [
    "while",
    "for",
    "if",
    "do",
    "return",
    "else",
    "break",
    "extern",
    "continue"
  ], i = {
    match: [
      /(surface|displacement|light|volume|imager)/,
      /\s+/,
      t.IDENT_RE
    ],
    scope: {
      1: "keyword",
      3: "title.class"
    }
  };
  return {
    name: "RenderMan RSL",
    keywords: {
      keyword: r,
      built_in: e,
      type: n
    },
    illegal: "</",
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      t.APOS_STRING_MODE,
      t.C_NUMBER_MODE,
      {
        className: "meta",
        begin: "#",
        end: "$"
      },
      i,
      {
        beginKeywords: "illuminate illuminance gather",
        end: "\\("
      }
    ]
  };
}
function zD(t) {
  return {
    name: "Oracle Rules Language",
    keywords: {
      keyword: "BILL_PERIOD BILL_START BILL_STOP RS_EFFECTIVE_START RS_EFFECTIVE_STOP RS_JURIS_CODE RS_OPCO_CODE INTDADDATTRIBUTE|5 INTDADDVMSG|5 INTDBLOCKOP|5 INTDBLOCKOPNA|5 INTDCLOSE|5 INTDCOUNT|5 INTDCOUNTSTATUSCODE|5 INTDCREATEMASK|5 INTDCREATEDAYMASK|5 INTDCREATEFACTORMASK|5 INTDCREATEHANDLE|5 INTDCREATEOVERRIDEDAYMASK|5 INTDCREATEOVERRIDEMASK|5 INTDCREATESTATUSCODEMASK|5 INTDCREATETOUPERIOD|5 INTDDELETE|5 INTDDIPTEST|5 INTDEXPORT|5 INTDGETERRORCODE|5 INTDGETERRORMESSAGE|5 INTDISEQUAL|5 INTDJOIN|5 INTDLOAD|5 INTDLOADACTUALCUT|5 INTDLOADDATES|5 INTDLOADHIST|5 INTDLOADLIST|5 INTDLOADLISTDATES|5 INTDLOADLISTENERGY|5 INTDLOADLISTHIST|5 INTDLOADRELATEDCHANNEL|5 INTDLOADSP|5 INTDLOADSTAGING|5 INTDLOADUOM|5 INTDLOADUOMDATES|5 INTDLOADUOMHIST|5 INTDLOADVERSION|5 INTDOPEN|5 INTDREADFIRST|5 INTDREADNEXT|5 INTDRECCOUNT|5 INTDRELEASE|5 INTDREPLACE|5 INTDROLLAVG|5 INTDROLLPEAK|5 INTDSCALAROP|5 INTDSCALE|5 INTDSETATTRIBUTE|5 INTDSETDSTPARTICIPANT|5 INTDSETSTRING|5 INTDSETVALUE|5 INTDSETVALUESTATUS|5 INTDSHIFTSTARTTIME|5 INTDSMOOTH|5 INTDSORT|5 INTDSPIKETEST|5 INTDSUBSET|5 INTDTOU|5 INTDTOURELEASE|5 INTDTOUVALUE|5 INTDUPDATESTATS|5 INTDVALUE|5 STDEV INTDDELETEEX|5 INTDLOADEXACTUAL|5 INTDLOADEXCUT|5 INTDLOADEXDATES|5 INTDLOADEX|5 INTDLOADEXRELATEDCHANNEL|5 INTDSAVEEX|5 MVLOAD|5 MVLOADACCT|5 MVLOADACCTDATES|5 MVLOADACCTHIST|5 MVLOADDATES|5 MVLOADHIST|5 MVLOADLIST|5 MVLOADLISTDATES|5 MVLOADLISTHIST|5 IF FOR NEXT DONE SELECT END CALL ABORT CLEAR CHANNEL FACTOR LIST NUMBER OVERRIDE SET WEEK DISTRIBUTIONNODE ELSE WHEN THEN OTHERWISE IENUM CSV INCLUDE LEAVE RIDER SAVE DELETE NOVALUE SECTION WARN SAVE_UPDATE DETERMINANT LABEL REPORT REVENUE EACH IN FROM TOTAL CHARGE BLOCK AND OR CSV_FILE RATE_CODE AUXILIARY_DEMAND UIDACCOUNT RS BILL_PERIOD_SELECT HOURS_PER_MONTH INTD_ERROR_STOP SEASON_SCHEDULE_NAME ACCOUNTFACTOR ARRAYUPPERBOUND CALLSTOREDPROC GETADOCONNECTION GETCONNECT GETDATASOURCE GETQUALIFIER GETUSERID HASVALUE LISTCOUNT LISTOP LISTUPDATE LISTVALUE PRORATEFACTOR RSPRORATE SETBINPATH SETDBMONITOR WQ_OPEN BILLINGHOURS DATE DATEFROMFLOAT DATETIMEFROMSTRING DATETIMETOSTRING DATETOFLOAT DAY DAYDIFF DAYNAME DBDATETIME HOUR MINUTE MONTH MONTHDIFF MONTHHOURS MONTHNAME ROUNDDATE SAMEWEEKDAYLASTYEAR SECOND WEEKDAY WEEKDIFF YEAR YEARDAY YEARSTR COMPSUM HISTCOUNT HISTMAX HISTMIN HISTMINNZ HISTVALUE MAXNRANGE MAXRANGE MINRANGE COMPIKVA COMPKVA COMPKVARFROMKQKW COMPLF IDATTR FLAG LF2KW LF2KWH MAXKW POWERFACTOR READING2USAGE AVGSEASON MAXSEASON MONTHLYMERGE SEASONVALUE SUMSEASON ACCTREADDATES ACCTTABLELOAD CONFIGADD CONFIGGET CREATEOBJECT CREATEREPORT EMAILCLIENT EXPBLKMDMUSAGE EXPMDMUSAGE EXPORT_USAGE FACTORINEFFECT GETUSERSPECIFIEDSTOP INEFFECT ISHOLIDAY RUNRATE SAVE_PROFILE SETREPORTTITLE USEREXIT WATFORRUNRATE TO TABLE ACOS ASIN ATAN ATAN2 BITAND CEIL COS COSECANT COSH COTANGENT DIVQUOT DIVREM EXP FABS FLOOR FMOD FREPM FREXPN LOG LOG10 MAX MAXN MIN MINNZ MODF POW ROUND ROUND2VALUE ROUNDINT SECANT SIN SINH SQROOT TAN TANH FLOAT2STRING FLOAT2STRINGNC INSTR LEFT LEN LTRIM MID RIGHT RTRIM STRING STRINGNC TOLOWER TOUPPER TRIM NUMDAYS READ_DATE STAGING",
      built_in: "IDENTIFIER OPTIONS XML_ELEMENT XML_OP XML_ELEMENT_OF DOMDOCCREATE DOMDOCLOADFILE DOMDOCLOADXML DOMDOCSAVEFILE DOMDOCGETROOT DOMDOCADDPI DOMNODEGETNAME DOMNODEGETTYPE DOMNODEGETVALUE DOMNODEGETCHILDCT DOMNODEGETFIRSTCHILD DOMNODEGETSIBLING DOMNODECREATECHILDELEMENT DOMNODESETATTRIBUTE DOMNODEGETCHILDELEMENTCT DOMNODEGETFIRSTCHILDELEMENT DOMNODEGETSIBLINGELEMENT DOMNODEGETATTRIBUTECT DOMNODEGETATTRIBUTEI DOMNODEGETATTRIBUTEBYNAME DOMNODEGETBYNAME"
    },
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      t.C_NUMBER_MODE,
      {
        className: "literal",
        variants: [
          {
            // looks like #-comment
            begin: "#\\s+",
            relevance: 0
          },
          { begin: "#[a-zA-Z .]+" }
        ]
      }
    ]
  };
}
function qD(t) {
  const e = t.regex, n = [
    "do",
    "if",
    "then",
    "else",
    "end",
    "until",
    "while",
    "abort",
    "array",
    "attrib",
    "by",
    "call",
    "cards",
    "cards4",
    "catname",
    "continue",
    "datalines",
    "datalines4",
    "delete",
    "delim",
    "delimiter",
    "display",
    "dm",
    "drop",
    "endsas",
    "error",
    "file",
    "filename",
    "footnote",
    "format",
    "goto",
    "in",
    "infile",
    "informat",
    "input",
    "keep",
    "label",
    "leave",
    "length",
    "libname",
    "link",
    "list",
    "lostcard",
    "merge",
    "missing",
    "modify",
    "options",
    "output",
    "out",
    "page",
    "put",
    "redirect",
    "remove",
    "rename",
    "replace",
    "retain",
    "return",
    "select",
    "set",
    "skip",
    "startsas",
    "stop",
    "title",
    "update",
    "waitsas",
    "where",
    "window",
    "x|0",
    "systask",
    "add",
    "and",
    "alter",
    "as",
    "cascade",
    "check",
    "create",
    "delete",
    "describe",
    "distinct",
    "drop",
    "foreign",
    "from",
    "group",
    "having",
    "index",
    "insert",
    "into",
    "in",
    "key",
    "like",
    "message",
    "modify",
    "msgtype",
    "not",
    "null",
    "on",
    "or",
    "order",
    "primary",
    "references",
    "reset",
    "restrict",
    "select",
    "set",
    "table",
    "unique",
    "update",
    "validate",
    "view",
    "where"
  ], r = [
    "abs",
    "addr",
    "airy",
    "arcos",
    "arsin",
    "atan",
    "attrc",
    "attrn",
    "band",
    "betainv",
    "blshift",
    "bnot",
    "bor",
    "brshift",
    "bxor",
    "byte",
    "cdf",
    "ceil",
    "cexist",
    "cinv",
    "close",
    "cnonct",
    "collate",
    "compbl",
    "compound",
    "compress",
    "cos",
    "cosh",
    "css",
    "curobs",
    "cv",
    "daccdb",
    "daccdbsl",
    "daccsl",
    "daccsyd",
    "dacctab",
    "dairy",
    "date",
    "datejul",
    "datepart",
    "datetime",
    "day",
    "dclose",
    "depdb",
    "depdbsl",
    "depdbsl",
    "depsl",
    "depsl",
    "depsyd",
    "depsyd",
    "deptab",
    "deptab",
    "dequote",
    "dhms",
    "dif",
    "digamma",
    "dim",
    "dinfo",
    "dnum",
    "dopen",
    "doptname",
    "doptnum",
    "dread",
    "dropnote",
    "dsname",
    "erf",
    "erfc",
    "exist",
    "exp",
    "fappend",
    "fclose",
    "fcol",
    "fdelete",
    "fetch",
    "fetchobs",
    "fexist",
    "fget",
    "fileexist",
    "filename",
    "fileref",
    "finfo",
    "finv",
    "fipname",
    "fipnamel",
    "fipstate",
    "floor",
    "fnonct",
    "fnote",
    "fopen",
    "foptname",
    "foptnum",
    "fpoint",
    "fpos",
    "fput",
    "fread",
    "frewind",
    "frlen",
    "fsep",
    "fuzz",
    "fwrite",
    "gaminv",
    "gamma",
    "getoption",
    "getvarc",
    "getvarn",
    "hbound",
    "hms",
    "hosthelp",
    "hour",
    "ibessel",
    "index",
    "indexc",
    "indexw",
    "input",
    "inputc",
    "inputn",
    "int",
    "intck",
    "intnx",
    "intrr",
    "irr",
    "jbessel",
    "juldate",
    "kurtosis",
    "lag",
    "lbound",
    "left",
    "length",
    "lgamma",
    "libname",
    "libref",
    "log",
    "log10",
    "log2",
    "logpdf",
    "logpmf",
    "logsdf",
    "lowcase",
    "max",
    "mdy",
    "mean",
    "min",
    "minute",
    "mod",
    "month",
    "mopen",
    "mort",
    "n",
    "netpv",
    "nmiss",
    "normal",
    "note",
    "npv",
    "open",
    "ordinal",
    "pathname",
    "pdf",
    "peek",
    "peekc",
    "pmf",
    "point",
    "poisson",
    "poke",
    "probbeta",
    "probbnml",
    "probchi",
    "probf",
    "probgam",
    "probhypr",
    "probit",
    "probnegb",
    "probnorm",
    "probt",
    "put",
    "putc",
    "putn",
    "qtr",
    "quote",
    "ranbin",
    "rancau",
    "ranexp",
    "rangam",
    "range",
    "rank",
    "rannor",
    "ranpoi",
    "rantbl",
    "rantri",
    "ranuni",
    "repeat",
    "resolve",
    "reverse",
    "rewind",
    "right",
    "round",
    "saving",
    "scan",
    "sdf",
    "second",
    "sign",
    "sin",
    "sinh",
    "skewness",
    "soundex",
    "spedis",
    "sqrt",
    "std",
    "stderr",
    "stfips",
    "stname",
    "stnamel",
    "substr",
    "sum",
    "symget",
    "sysget",
    "sysmsg",
    "sysprod",
    "sysrc",
    "system",
    "tan",
    "tanh",
    "time",
    "timepart",
    "tinv",
    "tnonct",
    "today",
    "translate",
    "tranwrd",
    "trigamma",
    "trim",
    "trimn",
    "trunc",
    "uniform",
    "upcase",
    "uss",
    "var",
    "varfmt",
    "varinfmt",
    "varlabel",
    "varlen",
    "varname",
    "varnum",
    "varray",
    "varrayx",
    "vartype",
    "verify",
    "vformat",
    "vformatd",
    "vformatdx",
    "vformatn",
    "vformatnx",
    "vformatw",
    "vformatwx",
    "vformatx",
    "vinarray",
    "vinarrayx",
    "vinformat",
    "vinformatd",
    "vinformatdx",
    "vinformatn",
    "vinformatnx",
    "vinformatw",
    "vinformatwx",
    "vinformatx",
    "vlabel",
    "vlabelx",
    "vlength",
    "vlengthx",
    "vname",
    "vnamex",
    "vtype",
    "vtypex",
    "weekday",
    "year",
    "yyq",
    "zipfips",
    "zipname",
    "zipnamel",
    "zipstate"
  ], i = [
    "bquote",
    "nrbquote",
    "cmpres",
    "qcmpres",
    "compstor",
    "datatyp",
    "display",
    "do",
    "else",
    "end",
    "eval",
    "global",
    "goto",
    "if",
    "index",
    "input",
    "keydef",
    "label",
    "left",
    "length",
    "let",
    "local",
    "lowcase",
    "macro",
    "mend",
    "nrbquote",
    "nrquote",
    "nrstr",
    "put",
    "qcmpres",
    "qleft",
    "qlowcase",
    "qscan",
    "qsubstr",
    "qsysfunc",
    "qtrim",
    "quote",
    "qupcase",
    "scan",
    "str",
    "substr",
    "superq",
    "syscall",
    "sysevalf",
    "sysexec",
    "sysfunc",
    "sysget",
    "syslput",
    "sysprod",
    "sysrc",
    "sysrput",
    "then",
    "to",
    "trim",
    "unquote",
    "until",
    "upcase",
    "verify",
    "while",
    "window"
  ];
  return {
    name: "SAS",
    case_insensitive: !0,
    keywords: {
      literal: [
        "null",
        "missing",
        "_all_",
        "_automatic_",
        "_character_",
        "_infile_",
        "_n_",
        "_name_",
        "_null_",
        "_numeric_",
        "_user_",
        "_webout_"
      ],
      keyword: n
    },
    contains: [
      {
        // Distinct highlight for proc <proc>, data, run, quit
        className: "keyword",
        begin: /^\s*(proc [\w\d_]+|data|run|quit)[\s;]/
      },
      {
        // Macro variables
        className: "variable",
        begin: /&[a-zA-Z_&][a-zA-Z0-9_]*\.?/
      },
      {
        begin: [
          /^\s*/,
          /datalines;|cards;/,
          /(?:.*\n)+/,
          /^\s*;\s*$/
        ],
        className: {
          2: "keyword",
          3: "string"
        }
      },
      {
        begin: [
          /%mend|%macro/,
          /\s+/,
          /[a-zA-Z_&][a-zA-Z0-9_]*/
        ],
        className: {
          1: "built_in",
          3: "title.function"
        }
      },
      {
        // Built-in macro variables
        className: "built_in",
        begin: "%" + e.either(...i)
      },
      {
        // User-defined macro functions
        className: "title.function",
        begin: /%[a-zA-Z_][a-zA-Z_0-9]*/
      },
      {
        // TODO: this is most likely an incorrect classification
        // built_in may need more nuance
        // https://github.com/highlightjs/highlight.js/issues/2521
        className: "meta",
        begin: e.either(...r) + "(?=\\()"
      },
      {
        className: "string",
        variants: [
          t.APOS_STRING_MODE,
          t.QUOTE_STRING_MODE
        ]
      },
      t.COMMENT("\\*", ";"),
      t.C_BLOCK_COMMENT_MODE
    ]
  };
}
function WD(t) {
  const e = t.regex, n = {
    className: "meta",
    begin: "@[A-Za-z]+"
  }, r = {
    className: "subst",
    variants: [
      { begin: "\\$[A-Za-z0-9_]+" },
      {
        begin: /\$\{/,
        end: /\}/
      }
    ]
  }, i = {
    className: "string",
    variants: [
      {
        begin: '"""',
        end: '"""'
      },
      {
        begin: '"',
        end: '"',
        illegal: "\\n",
        contains: [t.BACKSLASH_ESCAPE]
      },
      {
        begin: '[a-z]+"',
        end: '"',
        illegal: "\\n",
        contains: [
          t.BACKSLASH_ESCAPE,
          r
        ]
      },
      {
        className: "string",
        begin: '[a-z]+"""',
        end: '"""',
        contains: [r],
        relevance: 10
      }
    ]
  }, o = {
    className: "type",
    begin: "\\b[A-Z][A-Za-z0-9_]*",
    relevance: 0
  }, a = {
    className: "title",
    begin: /[^0-9\n\t "'(),.`{}\[\]:;][^\n\t "'(),.`{}\[\]:;]+|[^0-9\n\t "'(),.`{}\[\]:;=]/,
    relevance: 0
  }, s = {
    className: "class",
    beginKeywords: "class object trait type",
    end: /[:={\[\n;]/,
    excludeEnd: !0,
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      {
        beginKeywords: "extends with",
        relevance: 10
      },
      {
        begin: /\[/,
        end: /\]/,
        excludeBegin: !0,
        excludeEnd: !0,
        relevance: 0,
        contains: [
          o,
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      {
        className: "params",
        begin: /\(/,
        end: /\)/,
        excludeBegin: !0,
        excludeEnd: !0,
        relevance: 0,
        contains: [
          o,
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      a
    ]
  }, l = {
    className: "function",
    beginKeywords: "def",
    end: e.lookahead(/[:={\[(\n;]/),
    contains: [a]
  }, c = {
    begin: [
      /^\s*/,
      // Is first token on the line
      "extension",
      /\s+(?=[[(])/
      // followed by at least one space and `[` or `(`
    ],
    beginScope: { 2: "keyword" }
  }, u = {
    begin: [
      /^\s*/,
      // Is first token on the line
      /end/,
      /\s+/,
      /(extension\b)?/
      // `extension` is the only marker that follows an `end` that cannot be captured by another rule.
    ],
    beginScope: {
      2: "keyword",
      4: "keyword"
    }
  }, d = [
    { match: /\.inline\b/ },
    {
      begin: /\binline(?=\s)/,
      keywords: "inline"
    }
  ], p = {
    begin: [
      /\(\s*/,
      // Opening `(` of a parameter or argument list
      /using/,
      /\s+(?!\))/
      // Spaces not followed by `)`
    ],
    beginScope: { 2: "keyword" }
  };
  return {
    name: "Scala",
    keywords: {
      literal: "true false null",
      keyword: "type yield lazy override def with val var sealed abstract private trait object if then forSome for while do throw finally protected extends import final return else break new catch super class case package default try this match continue throws implicit export enum given transparent"
    },
    contains: [
      {
        begin: [
          "//>",
          /\s+/,
          /using/,
          /\s+/,
          /\S+/
        ],
        beginScope: {
          1: "comment",
          3: "keyword",
          5: "type"
        },
        end: /$/,
        contains: [
          {
            className: "string",
            begin: /\S+/
          }
        ]
      },
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      i,
      o,
      l,
      s,
      t.C_NUMBER_MODE,
      c,
      u,
      ...d,
      p,
      n
    ]
  };
}
function KD(t) {
  const e = "[^\\(\\)\\[\\]\\{\\}\",'`;#|\\\\\\s]+", n = "(-|\\+)?\\d+([./]\\d+)?", r = n + "[+\\-]" + n + "i", i = {
    $pattern: e,
    built_in: "case-lambda call/cc class define-class exit-handler field import inherit init-field interface let*-values let-values let/ec mixin opt-lambda override protect provide public rename require require-for-syntax syntax syntax-case syntax-error unit/sig unless when with-syntax and begin call-with-current-continuation call-with-input-file call-with-output-file case cond define define-syntax delay do dynamic-wind else for-each if lambda let let* let-syntax letrec letrec-syntax map or syntax-rules ' * + , ,@ - ... / ; < <= = => > >= ` abs acos angle append apply asin assoc assq assv atan boolean? caar cadr call-with-input-file call-with-output-file call-with-values car cdddar cddddr cdr ceiling char->integer char-alphabetic? char-ci<=? char-ci<? char-ci=? char-ci>=? char-ci>? char-downcase char-lower-case? char-numeric? char-ready? char-upcase char-upper-case? char-whitespace? char<=? char<? char=? char>=? char>? char? close-input-port close-output-port complex? cons cos current-input-port current-output-port denominator display eof-object? eq? equal? eqv? eval even? exact->inexact exact? exp expt floor force gcd imag-part inexact->exact inexact? input-port? integer->char integer? interaction-environment lcm length list list->string list->vector list-ref list-tail list? load log magnitude make-polar make-rectangular make-string make-vector max member memq memv min modulo negative? newline not null-environment null? number->string number? numerator odd? open-input-file open-output-file output-port? pair? peek-char port? positive? procedure? quasiquote quote quotient rational? rationalize read read-char real-part real? remainder reverse round scheme-report-environment set! set-car! set-cdr! sin sqrt string string->list string->number string->symbol string-append string-ci<=? string-ci<? string-ci=? string-ci>=? string-ci>? string-copy string-fill! string-length string-ref string-set! string<=? string<? string=? string>=? string>? string? substring symbol->string symbol? tan transcript-off transcript-on truncate values vector vector->list vector-fill! vector-length vector-ref vector-set! with-input-from-file with-output-to-file write write-char zero?"
  }, o = {
    className: "literal",
    begin: "(#t|#f|#\\\\" + e + "|#\\\\.)"
  }, a = {
    className: "number",
    variants: [
      {
        begin: n,
        relevance: 0
      },
      {
        begin: r,
        relevance: 0
      },
      { begin: "#b[0-1]+(/[0-1]+)?" },
      { begin: "#o[0-7]+(/[0-7]+)?" },
      { begin: "#x[0-9a-f]+(/[0-9a-f]+)?" }
    ]
  }, s = t.QUOTE_STRING_MODE, l = [
    t.COMMENT(
      ";",
      "$",
      { relevance: 0 }
    ),
    t.COMMENT("#\\|", "\\|#")
  ], c = {
    begin: e,
    relevance: 0
  }, u = {
    className: "symbol",
    begin: "'" + e
  }, d = {
    endsWithParent: !0,
    relevance: 0
  }, p = {
    variants: [
      { begin: /'/ },
      { begin: "`" }
    ],
    contains: [
      {
        begin: "\\(",
        end: "\\)",
        contains: [
          "self",
          o,
          s,
          a,
          c,
          u
        ]
      }
    ]
  }, _ = {
    className: "name",
    relevance: 0,
    begin: e,
    keywords: i
  }, f = {
    variants: [
      {
        begin: "\\(",
        end: "\\)"
      },
      {
        begin: "\\[",
        end: "\\]"
      }
    ],
    contains: [
      {
        begin: /lambda/,
        endsWithParent: !0,
        returnBegin: !0,
        contains: [
          _,
          {
            endsParent: !0,
            variants: [
              {
                begin: /\(/,
                end: /\)/
              },
              {
                begin: /\[/,
                end: /\]/
              }
            ],
            contains: [c]
          }
        ]
      },
      _,
      d
    ]
  };
  return d.contains = [
    o,
    a,
    s,
    c,
    u,
    p,
    f
  ].concat(l), {
    name: "Scheme",
    aliases: ["scm"],
    illegal: /\S/,
    contains: [
      t.SHEBANG(),
      a,
      s,
      u,
      p,
      f
    ].concat(l)
  };
}
function QD(t) {
  const e = [
    t.C_NUMBER_MODE,
    {
      className: "string",
      begin: `'|"`,
      end: `'|"`,
      contains: [
        t.BACKSLASH_ESCAPE,
        { begin: "''" }
      ]
    }
  ];
  return {
    name: "Scilab",
    aliases: ["sci"],
    keywords: {
      $pattern: /%?\w+/,
      keyword: "abort break case clear catch continue do elseif else endfunction end for function global if pause return resume select try then while",
      literal: "%f %F %t %T %pi %eps %inf %nan %e %i %z %s",
      built_in: (
        // Scilab has more than 2000 functions. Just list the most commons
        "abs and acos asin atan ceil cd chdir clearglobal cosh cos cumprod deff disp error exec execstr exists exp eye gettext floor fprintf fread fsolve imag isdef isempty isinfisnan isvector lasterror length load linspace list listfiles log10 log2 log max min msprintf mclose mopen ones or pathconvert poly printf prod pwd rand real round sinh sin size gsort sprintf sqrt strcat strcmps tring sum system tanh tan type typename warning zeros matrix"
      )
    },
    illegal: '("|#|/\\*|\\s+/\\w+)',
    contains: [
      {
        className: "function",
        beginKeywords: "function",
        end: "$",
        contains: [
          t.UNDERSCORE_TITLE_MODE,
          {
            className: "params",
            begin: "\\(",
            end: "\\)"
          }
        ]
      },
      // seems to be a guard against [ident]' or [ident].
      // perhaps to prevent attributes from flagging as keywords?
      {
        begin: "[a-zA-Z_][a-zA-Z_0-9]*[\\.']+",
        relevance: 0
      },
      {
        begin: "\\[",
        end: "\\][\\.']*",
        relevance: 0,
        contains: e
      },
      t.COMMENT("//", "$")
    ].concat(e)
  };
}
function ZD(t) {
  const e = [
    "add",
    "and",
    "cmp",
    "cmpg",
    "cmpl",
    "const",
    "div",
    "double",
    "float",
    "goto",
    "if",
    "int",
    "long",
    "move",
    "mul",
    "neg",
    "new",
    "nop",
    "not",
    "or",
    "rem",
    "return",
    "shl",
    "shr",
    "sput",
    "sub",
    "throw",
    "ushr",
    "xor"
  ], n = [
    "aget",
    "aput",
    "array",
    "check",
    "execute",
    "fill",
    "filled",
    "goto/16",
    "goto/32",
    "iget",
    "instance",
    "invoke",
    "iput",
    "monitor",
    "packed",
    "sget",
    "sparse"
  ], r = [
    "transient",
    "constructor",
    "abstract",
    "final",
    "synthetic",
    "public",
    "private",
    "protected",
    "static",
    "bridge",
    "system"
  ];
  return {
    name: "Smali",
    contains: [
      {
        className: "string",
        begin: '"',
        end: '"',
        relevance: 0
      },
      t.COMMENT(
        "#",
        "$",
        { relevance: 0 }
      ),
      {
        className: "keyword",
        variants: [
          { begin: "\\s*\\.end\\s[a-zA-Z0-9]*" },
          {
            begin: "^[ ]*\\.[a-zA-Z]*",
            relevance: 0
          },
          {
            begin: "\\s:[a-zA-Z_0-9]*",
            relevance: 0
          },
          { begin: "\\s(" + r.join("|") + ")" }
        ]
      },
      {
        className: "built_in",
        variants: [
          { begin: "\\s(" + e.join("|") + ")\\s" },
          {
            begin: "\\s(" + e.join("|") + ")((-|/)[a-zA-Z0-9]+)+\\s",
            relevance: 10
          },
          {
            begin: "\\s(" + n.join("|") + ")((-|/)[a-zA-Z0-9]+)*\\s",
            relevance: 10
          }
        ]
      },
      {
        className: "class",
        begin: `L[^(;:
]*;`,
        relevance: 0
      },
      { begin: "[vp][0-9]+" }
    ]
  };
}
function XD(t) {
  const e = "[a-z][a-zA-Z0-9_]*", n = {
    className: "string",
    begin: "\\$.{1}"
  }, r = {
    className: "symbol",
    begin: "#" + t.UNDERSCORE_IDENT_RE
  };
  return {
    name: "Smalltalk",
    aliases: ["st"],
    keywords: [
      "self",
      "super",
      "nil",
      "true",
      "false",
      "thisContext"
    ],
    contains: [
      t.COMMENT('"', '"'),
      t.APOS_STRING_MODE,
      {
        className: "type",
        begin: "\\b[A-Z][A-Za-z0-9_]*",
        relevance: 0
      },
      {
        begin: e + ":",
        relevance: 0
      },
      t.C_NUMBER_MODE,
      r,
      n,
      {
        // This looks more complicated than needed to avoid combinatorial
        // explosion under V8. It effectively means `| var1 var2 ... |` with
        // whitespace adjacent to `|` being optional.
        begin: "\\|[ ]*" + e + "([ ]+" + e + ")*[ ]*\\|",
        returnBegin: !0,
        end: /\|/,
        illegal: /\S/,
        contains: [{ begin: "(\\|[ ]*)?" + e }]
      },
      {
        begin: "#\\(",
        end: "\\)",
        contains: [
          t.APOS_STRING_MODE,
          n,
          t.C_NUMBER_MODE,
          r
        ]
      }
    ]
  };
}
function jD(t) {
  return {
    name: "SML (Standard ML)",
    aliases: ["ml"],
    keywords: {
      $pattern: "[a-z_]\\w*!?",
      keyword: (
        /* according to Definition of Standard ML 97  */
        "abstype and andalso as case datatype do else end eqtype exception fn fun functor handle if in include infix infixr let local nonfix of op open orelse raise rec sharing sig signature struct structure then type val with withtype where while"
      ),
      built_in: (
        /* built-in types according to basis library */
        "array bool char exn int list option order real ref string substring vector unit word"
      ),
      literal: "true false NONE SOME LESS EQUAL GREATER nil"
    },
    illegal: /\/\/|>>/,
    contains: [
      {
        className: "literal",
        begin: /\[(\|\|)?\]|\(\)/,
        relevance: 0
      },
      t.COMMENT(
        "\\(\\*",
        "\\*\\)",
        { contains: ["self"] }
      ),
      {
        /* type variable */
        className: "symbol",
        begin: "'[A-Za-z_](?!')[\\w']*"
        /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */
      },
      {
        /* polymorphic variant */
        className: "type",
        begin: "`[A-Z][\\w']*"
      },
      {
        /* module or constructor */
        className: "type",
        begin: "\\b[A-Z][\\w']*",
        relevance: 0
      },
      {
        /* don't color identifiers, but safely catch all identifiers with ' */
        begin: "[a-z_]\\w*'[\\w']*"
      },
      t.inherit(t.APOS_STRING_MODE, {
        className: "string",
        relevance: 0
      }),
      t.inherit(t.QUOTE_STRING_MODE, { illegal: null }),
      {
        className: "number",
        begin: "\\b(0[xX][a-fA-F0-9_]+[Lln]?|0[oO][0-7_]+[Lln]?|0[bB][01_]+[Lln]?|[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)",
        relevance: 0
      },
      {
        begin: /[-=]>/
        // relevance booster
      }
    ]
  };
}
function JD(t) {
  const e = {
    className: "variable",
    begin: /\b_+[a-zA-Z]\w*/
  }, n = {
    className: "title",
    begin: /[a-zA-Z][a-zA-Z_0-9]*_fnc_[a-zA-Z_0-9]+/
  }, r = {
    className: "string",
    variants: [
      {
        begin: '"',
        end: '"',
        contains: [
          {
            begin: '""',
            relevance: 0
          }
        ]
      },
      {
        begin: "'",
        end: "'",
        contains: [
          {
            begin: "''",
            relevance: 0
          }
        ]
      }
    ]
  }, i = [
    "break",
    "breakWith",
    "breakOut",
    "breakTo",
    "case",
    "catch",
    "continue",
    "continueWith",
    "default",
    "do",
    "else",
    "exit",
    "exitWith",
    "for",
    "forEach",
    "from",
    "if",
    "local",
    "private",
    "switch",
    "step",
    "then",
    "throw",
    "to",
    "try",
    "waitUntil",
    "while",
    "with"
  ], o = [
    "blufor",
    "civilian",
    "configNull",
    "controlNull",
    "displayNull",
    "diaryRecordNull",
    "east",
    "endl",
    "false",
    "grpNull",
    "independent",
    "lineBreak",
    "locationNull",
    "nil",
    "objNull",
    "opfor",
    "pi",
    "resistance",
    "scriptNull",
    "sideAmbientLife",
    "sideEmpty",
    "sideEnemy",
    "sideFriendly",
    "sideLogic",
    "sideUnknown",
    "taskNull",
    "teamMemberNull",
    "true",
    "west"
  ], a = [
    "abs",
    "accTime",
    "acos",
    "action",
    "actionIDs",
    "actionKeys",
    "actionKeysEx",
    "actionKeysImages",
    "actionKeysNames",
    "actionKeysNamesArray",
    "actionName",
    "actionParams",
    "activateAddons",
    "activatedAddons",
    "activateKey",
    "activeTitleEffectParams",
    "add3DENConnection",
    "add3DENEventHandler",
    "add3DENLayer",
    "addAction",
    "addBackpack",
    "addBackpackCargo",
    "addBackpackCargoGlobal",
    "addBackpackGlobal",
    "addBinocularItem",
    "addCamShake",
    "addCuratorAddons",
    "addCuratorCameraArea",
    "addCuratorEditableObjects",
    "addCuratorEditingArea",
    "addCuratorPoints",
    "addEditorObject",
    "addEventHandler",
    "addForce",
    "addForceGeneratorRTD",
    "addGoggles",
    "addGroupIcon",
    "addHandgunItem",
    "addHeadgear",
    "addItem",
    "addItemCargo",
    "addItemCargoGlobal",
    "addItemPool",
    "addItemToBackpack",
    "addItemToUniform",
    "addItemToVest",
    "addLiveStats",
    "addMagazine",
    "addMagazineAmmoCargo",
    "addMagazineCargo",
    "addMagazineCargoGlobal",
    "addMagazineGlobal",
    "addMagazinePool",
    "addMagazines",
    "addMagazineTurret",
    "addMenu",
    "addMenuItem",
    "addMissionEventHandler",
    "addMPEventHandler",
    "addMusicEventHandler",
    "addonFiles",
    "addOwnedMine",
    "addPlayerScores",
    "addPrimaryWeaponItem",
    "addPublicVariableEventHandler",
    "addRating",
    "addResources",
    "addScore",
    "addScoreSide",
    "addSecondaryWeaponItem",
    "addSwitchableUnit",
    "addTeamMember",
    "addToRemainsCollector",
    "addTorque",
    "addUniform",
    "addUserActionEventHandler",
    "addVehicle",
    "addVest",
    "addWaypoint",
    "addWeapon",
    "addWeaponCargo",
    "addWeaponCargoGlobal",
    "addWeaponGlobal",
    "addWeaponItem",
    "addWeaponPool",
    "addWeaponTurret",
    "addWeaponWithAttachmentsCargo",
    "addWeaponWithAttachmentsCargoGlobal",
    "admin",
    "agent",
    "agents",
    "AGLToASL",
    "aimedAtTarget",
    "aimPos",
    "airDensityCurveRTD",
    "airDensityRTD",
    "airplaneThrottle",
    "airportSide",
    "AISFinishHeal",
    "alive",
    "all3DENEntities",
    "allActiveTitleEffects",
    "allAddonsInfo",
    "allAirports",
    "allControls",
    "allCurators",
    "allCutLayers",
    "allDead",
    "allDeadMen",
    "allDiaryRecords",
    "allDiarySubjects",
    "allDisplays",
    "allEnv3DSoundSources",
    "allGroups",
    "allLODs",
    "allMapMarkers",
    "allMines",
    "allMissionObjects",
    "allObjects",
    "allow3DMode",
    "allowCrewInImmobile",
    "allowCuratorLogicIgnoreAreas",
    "allowDamage",
    "allowDammage",
    "allowedService",
    "allowFileOperations",
    "allowFleeing",
    "allowGetIn",
    "allowService",
    "allowSprint",
    "allPlayers",
    "allSimpleObjects",
    "allSites",
    "allTurrets",
    "allUnits",
    "allUnitsUAV",
    "allUsers",
    "allVariables",
    "ambientTemperature",
    "ammo",
    "ammoOnPylon",
    "and",
    "animate",
    "animateBay",
    "animateDoor",
    "animatePylon",
    "animateSource",
    "animationNames",
    "animationPhase",
    "animationSourcePhase",
    "animationState",
    "apertureParams",
    "append",
    "apply",
    "armoryPoints",
    "arrayIntersect",
    "asin",
    "ASLToAGL",
    "ASLToATL",
    "assert",
    "assignAsCargo",
    "assignAsCargoIndex",
    "assignAsCommander",
    "assignAsDriver",
    "assignAsGunner",
    "assignAsTurret",
    "assignCurator",
    "assignedCargo",
    "assignedCommander",
    "assignedDriver",
    "assignedGroup",
    "assignedGunner",
    "assignedItems",
    "assignedTarget",
    "assignedTeam",
    "assignedVehicle",
    "assignedVehicleRole",
    "assignedVehicles",
    "assignItem",
    "assignTeam",
    "assignToAirport",
    "atan",
    "atan2",
    "atg",
    "ATLToASL",
    "attachedObject",
    "attachedObjects",
    "attachedTo",
    "attachObject",
    "attachTo",
    "attackEnabled",
    "awake",
    "backpack",
    "backpackCargo",
    "backpackContainer",
    "backpackItems",
    "backpackMagazines",
    "backpackSpaceFor",
    "behaviour",
    "benchmark",
    "bezierInterpolation",
    "binocular",
    "binocularItems",
    "binocularMagazine",
    "boundingBox",
    "boundingBoxReal",
    "boundingCenter",
    "brakesDisabled",
    "briefingName",
    "buildingExit",
    "buildingPos",
    "buldozer_EnableRoadDiag",
    "buldozer_IsEnabledRoadDiag",
    "buldozer_LoadNewRoads",
    "buldozer_reloadOperMap",
    "buttonAction",
    "buttonSetAction",
    "cadetMode",
    "calculatePath",
    "calculatePlayerVisibilityByFriendly",
    "call",
    "callExtension",
    "camCommand",
    "camCommit",
    "camCommitPrepared",
    "camCommitted",
    "camConstuctionSetParams",
    "camCreate",
    "camDestroy",
    "cameraEffect",
    "cameraEffectEnableHUD",
    "cameraInterest",
    "cameraOn",
    "cameraView",
    "campaignConfigFile",
    "camPreload",
    "camPreloaded",
    "camPrepareBank",
    "camPrepareDir",
    "camPrepareDive",
    "camPrepareFocus",
    "camPrepareFov",
    "camPrepareFovRange",
    "camPreparePos",
    "camPrepareRelPos",
    "camPrepareTarget",
    "camSetBank",
    "camSetDir",
    "camSetDive",
    "camSetFocus",
    "camSetFov",
    "camSetFovRange",
    "camSetPos",
    "camSetRelPos",
    "camSetTarget",
    "camTarget",
    "camUseNVG",
    "canAdd",
    "canAddItemToBackpack",
    "canAddItemToUniform",
    "canAddItemToVest",
    "cancelSimpleTaskDestination",
    "canDeployWeapon",
    "canFire",
    "canMove",
    "canSlingLoad",
    "canStand",
    "canSuspend",
    "canTriggerDynamicSimulation",
    "canUnloadInCombat",
    "canVehicleCargo",
    "captive",
    "captiveNum",
    "cbChecked",
    "cbSetChecked",
    "ceil",
    "channelEnabled",
    "cheatsEnabled",
    "checkAIFeature",
    "checkVisibility",
    "className",
    "clear3DENAttribute",
    "clear3DENInventory",
    "clearAllItemsFromBackpack",
    "clearBackpackCargo",
    "clearBackpackCargoGlobal",
    "clearForcesRTD",
    "clearGroupIcons",
    "clearItemCargo",
    "clearItemCargoGlobal",
    "clearItemPool",
    "clearMagazineCargo",
    "clearMagazineCargoGlobal",
    "clearMagazinePool",
    "clearOverlay",
    "clearRadio",
    "clearWeaponCargo",
    "clearWeaponCargoGlobal",
    "clearWeaponPool",
    "clientOwner",
    "closeDialog",
    "closeDisplay",
    "closeOverlay",
    "collapseObjectTree",
    "collect3DENHistory",
    "collectiveRTD",
    "collisionDisabledWith",
    "combatBehaviour",
    "combatMode",
    "commandArtilleryFire",
    "commandChat",
    "commander",
    "commandFire",
    "commandFollow",
    "commandFSM",
    "commandGetOut",
    "commandingMenu",
    "commandMove",
    "commandRadio",
    "commandStop",
    "commandSuppressiveFire",
    "commandTarget",
    "commandWatch",
    "comment",
    "commitOverlay",
    "compatibleItems",
    "compatibleMagazines",
    "compile",
    "compileFinal",
    "compileScript",
    "completedFSM",
    "composeText",
    "configClasses",
    "configFile",
    "configHierarchy",
    "configName",
    "configOf",
    "configProperties",
    "configSourceAddonList",
    "configSourceMod",
    "configSourceModList",
    "confirmSensorTarget",
    "connectTerminalToUAV",
    "connectToServer",
    "controlsGroupCtrl",
    "conversationDisabled",
    "copyFromClipboard",
    "copyToClipboard",
    "copyWaypoints",
    "cos",
    "count",
    "countEnemy",
    "countFriendly",
    "countSide",
    "countType",
    "countUnknown",
    "create3DENComposition",
    "create3DENEntity",
    "createAgent",
    "createCenter",
    "createDialog",
    "createDiaryLink",
    "createDiaryRecord",
    "createDiarySubject",
    "createDisplay",
    "createGearDialog",
    "createGroup",
    "createGuardedPoint",
    "createHashMap",
    "createHashMapFromArray",
    "createLocation",
    "createMarker",
    "createMarkerLocal",
    "createMenu",
    "createMine",
    "createMissionDisplay",
    "createMPCampaignDisplay",
    "createSimpleObject",
    "createSimpleTask",
    "createSite",
    "createSoundSource",
    "createTask",
    "createTeam",
    "createTrigger",
    "createUnit",
    "createVehicle",
    "createVehicleCrew",
    "createVehicleLocal",
    "crew",
    "ctAddHeader",
    "ctAddRow",
    "ctClear",
    "ctCurSel",
    "ctData",
    "ctFindHeaderRows",
    "ctFindRowHeader",
    "ctHeaderControls",
    "ctHeaderCount",
    "ctRemoveHeaders",
    "ctRemoveRows",
    "ctrlActivate",
    "ctrlAddEventHandler",
    "ctrlAngle",
    "ctrlAnimateModel",
    "ctrlAnimationPhaseModel",
    "ctrlAt",
    "ctrlAutoScrollDelay",
    "ctrlAutoScrollRewind",
    "ctrlAutoScrollSpeed",
    "ctrlBackgroundColor",
    "ctrlChecked",
    "ctrlClassName",
    "ctrlCommit",
    "ctrlCommitted",
    "ctrlCreate",
    "ctrlDelete",
    "ctrlEnable",
    "ctrlEnabled",
    "ctrlFade",
    "ctrlFontHeight",
    "ctrlForegroundColor",
    "ctrlHTMLLoaded",
    "ctrlIDC",
    "ctrlIDD",
    "ctrlMapAnimAdd",
    "ctrlMapAnimClear",
    "ctrlMapAnimCommit",
    "ctrlMapAnimDone",
    "ctrlMapCursor",
    "ctrlMapMouseOver",
    "ctrlMapPosition",
    "ctrlMapScale",
    "ctrlMapScreenToWorld",
    "ctrlMapSetPosition",
    "ctrlMapWorldToScreen",
    "ctrlModel",
    "ctrlModelDirAndUp",
    "ctrlModelScale",
    "ctrlMousePosition",
    "ctrlParent",
    "ctrlParentControlsGroup",
    "ctrlPosition",
    "ctrlRemoveAllEventHandlers",
    "ctrlRemoveEventHandler",
    "ctrlScale",
    "ctrlScrollValues",
    "ctrlSetActiveColor",
    "ctrlSetAngle",
    "ctrlSetAutoScrollDelay",
    "ctrlSetAutoScrollRewind",
    "ctrlSetAutoScrollSpeed",
    "ctrlSetBackgroundColor",
    "ctrlSetChecked",
    "ctrlSetDisabledColor",
    "ctrlSetEventHandler",
    "ctrlSetFade",
    "ctrlSetFocus",
    "ctrlSetFont",
    "ctrlSetFontH1",
    "ctrlSetFontH1B",
    "ctrlSetFontH2",
    "ctrlSetFontH2B",
    "ctrlSetFontH3",
    "ctrlSetFontH3B",
    "ctrlSetFontH4",
    "ctrlSetFontH4B",
    "ctrlSetFontH5",
    "ctrlSetFontH5B",
    "ctrlSetFontH6",
    "ctrlSetFontH6B",
    "ctrlSetFontHeight",
    "ctrlSetFontHeightH1",
    "ctrlSetFontHeightH2",
    "ctrlSetFontHeightH3",
    "ctrlSetFontHeightH4",
    "ctrlSetFontHeightH5",
    "ctrlSetFontHeightH6",
    "ctrlSetFontHeightSecondary",
    "ctrlSetFontP",
    "ctrlSetFontPB",
    "ctrlSetFontSecondary",
    "ctrlSetForegroundColor",
    "ctrlSetModel",
    "ctrlSetModelDirAndUp",
    "ctrlSetModelScale",
    "ctrlSetMousePosition",
    "ctrlSetPixelPrecision",
    "ctrlSetPosition",
    "ctrlSetPositionH",
    "ctrlSetPositionW",
    "ctrlSetPositionX",
    "ctrlSetPositionY",
    "ctrlSetScale",
    "ctrlSetScrollValues",
    "ctrlSetShadow",
    "ctrlSetStructuredText",
    "ctrlSetText",
    "ctrlSetTextColor",
    "ctrlSetTextColorSecondary",
    "ctrlSetTextSecondary",
    "ctrlSetTextSelection",
    "ctrlSetTooltip",
    "ctrlSetTooltipColorBox",
    "ctrlSetTooltipColorShade",
    "ctrlSetTooltipColorText",
    "ctrlSetTooltipMaxWidth",
    "ctrlSetURL",
    "ctrlSetURLOverlayMode",
    "ctrlShadow",
    "ctrlShow",
    "ctrlShown",
    "ctrlStyle",
    "ctrlText",
    "ctrlTextColor",
    "ctrlTextHeight",
    "ctrlTextSecondary",
    "ctrlTextSelection",
    "ctrlTextWidth",
    "ctrlTooltip",
    "ctrlType",
    "ctrlURL",
    "ctrlURLOverlayMode",
    "ctrlVisible",
    "ctRowControls",
    "ctRowCount",
    "ctSetCurSel",
    "ctSetData",
    "ctSetHeaderTemplate",
    "ctSetRowTemplate",
    "ctSetValue",
    "ctValue",
    "curatorAddons",
    "curatorCamera",
    "curatorCameraArea",
    "curatorCameraAreaCeiling",
    "curatorCoef",
    "curatorEditableObjects",
    "curatorEditingArea",
    "curatorEditingAreaType",
    "curatorMouseOver",
    "curatorPoints",
    "curatorRegisteredObjects",
    "curatorSelected",
    "curatorWaypointCost",
    "current3DENOperation",
    "currentChannel",
    "currentCommand",
    "currentMagazine",
    "currentMagazineDetail",
    "currentMagazineDetailTurret",
    "currentMagazineTurret",
    "currentMuzzle",
    "currentNamespace",
    "currentPilot",
    "currentTask",
    "currentTasks",
    "currentThrowable",
    "currentVisionMode",
    "currentWaypoint",
    "currentWeapon",
    "currentWeaponMode",
    "currentWeaponTurret",
    "currentZeroing",
    "cursorObject",
    "cursorTarget",
    "customChat",
    "customRadio",
    "customWaypointPosition",
    "cutFadeOut",
    "cutObj",
    "cutRsc",
    "cutText",
    "damage",
    "date",
    "dateToNumber",
    "dayTime",
    "deActivateKey",
    "debriefingText",
    "debugFSM",
    "debugLog",
    "decayGraphValues",
    "deg",
    "delete3DENEntities",
    "deleteAt",
    "deleteCenter",
    "deleteCollection",
    "deleteEditorObject",
    "deleteGroup",
    "deleteGroupWhenEmpty",
    "deleteIdentity",
    "deleteLocation",
    "deleteMarker",
    "deleteMarkerLocal",
    "deleteRange",
    "deleteResources",
    "deleteSite",
    "deleteStatus",
    "deleteTeam",
    "deleteVehicle",
    "deleteVehicleCrew",
    "deleteWaypoint",
    "detach",
    "detectedMines",
    "diag_activeMissionFSMs",
    "diag_activeScripts",
    "diag_activeSQFScripts",
    "diag_activeSQSScripts",
    "diag_allMissionEventHandlers",
    "diag_captureFrame",
    "diag_captureFrameToFile",
    "diag_captureSlowFrame",
    "diag_codePerformance",
    "diag_deltaTime",
    "diag_drawmode",
    "diag_dumpCalltraceToLog",
    "diag_dumpScriptAssembly",
    "diag_dumpTerrainSynth",
    "diag_dynamicSimulationEnd",
    "diag_enable",
    "diag_enabled",
    "diag_exportConfig",
    "diag_exportTerrainSVG",
    "diag_fps",
    "diag_fpsmin",
    "diag_frameno",
    "diag_getTerrainSegmentOffset",
    "diag_lightNewLoad",
    "diag_list",
    "diag_localized",
    "diag_log",
    "diag_logSlowFrame",
    "diag_mergeConfigFile",
    "diag_recordTurretLimits",
    "diag_resetFSM",
    "diag_resetshapes",
    "diag_scope",
    "diag_setLightNew",
    "diag_stacktrace",
    "diag_tickTime",
    "diag_toggle",
    "dialog",
    "diarySubjectExists",
    "didJIP",
    "didJIPOwner",
    "difficulty",
    "difficultyEnabled",
    "difficultyEnabledRTD",
    "difficultyOption",
    "direction",
    "directionStabilizationEnabled",
    "directSay",
    "disableAI",
    "disableBrakes",
    "disableCollisionWith",
    "disableConversation",
    "disableDebriefingStats",
    "disableMapIndicators",
    "disableNVGEquipment",
    "disableRemoteSensors",
    "disableSerialization",
    "disableTIEquipment",
    "disableUAVConnectability",
    "disableUserInput",
    "displayAddEventHandler",
    "displayChild",
    "displayCtrl",
    "displayParent",
    "displayRemoveAllEventHandlers",
    "displayRemoveEventHandler",
    "displaySetEventHandler",
    "displayUniqueName",
    "displayUpdate",
    "dissolveTeam",
    "distance",
    "distance2D",
    "distanceSqr",
    "distributionRegion",
    "do3DENAction",
    "doArtilleryFire",
    "doFire",
    "doFollow",
    "doFSM",
    "doGetOut",
    "doMove",
    "doorPhase",
    "doStop",
    "doSuppressiveFire",
    "doTarget",
    "doWatch",
    "drawArrow",
    "drawEllipse",
    "drawIcon",
    "drawIcon3D",
    "drawLaser",
    "drawLine",
    "drawLine3D",
    "drawLink",
    "drawLocation",
    "drawPolygon",
    "drawRectangle",
    "drawTriangle",
    "driver",
    "drop",
    "dynamicSimulationDistance",
    "dynamicSimulationDistanceCoef",
    "dynamicSimulationEnabled",
    "dynamicSimulationSystemEnabled",
    "echo",
    "edit3DENMissionAttributes",
    "editObject",
    "editorSetEventHandler",
    "effectiveCommander",
    "elevatePeriscope",
    "emptyPositions",
    "enableAI",
    "enableAIFeature",
    "enableAimPrecision",
    "enableAttack",
    "enableAudioFeature",
    "enableAutoStartUpRTD",
    "enableAutoTrimRTD",
    "enableCamShake",
    "enableCaustics",
    "enableChannel",
    "enableCollisionWith",
    "enableCopilot",
    "enableDebriefingStats",
    "enableDiagLegend",
    "enableDirectionStabilization",
    "enableDynamicSimulation",
    "enableDynamicSimulationSystem",
    "enableEndDialog",
    "enableEngineArtillery",
    "enableEnvironment",
    "enableFatigue",
    "enableGunLights",
    "enableInfoPanelComponent",
    "enableIRLasers",
    "enableMimics",
    "enablePersonTurret",
    "enableRadio",
    "enableReload",
    "enableRopeAttach",
    "enableSatNormalOnDetail",
    "enableSaving",
    "enableSentences",
    "enableSimulation",
    "enableSimulationGlobal",
    "enableStamina",
    "enableStressDamage",
    "enableTeamSwitch",
    "enableTraffic",
    "enableUAVConnectability",
    "enableUAVWaypoints",
    "enableVehicleCargo",
    "enableVehicleSensor",
    "enableWeaponDisassembly",
    "endLoadingScreen",
    "endMission",
    "engineOn",
    "enginesIsOnRTD",
    "enginesPowerRTD",
    "enginesRpmRTD",
    "enginesTorqueRTD",
    "entities",
    "environmentEnabled",
    "environmentVolume",
    "equipmentDisabled",
    "estimatedEndServerTime",
    "estimatedTimeLeft",
    "evalObjectArgument",
    "everyBackpack",
    "everyContainer",
    "exec",
    "execEditorScript",
    "execFSM",
    "execVM",
    "exp",
    "expectedDestination",
    "exportJIPMessages",
    "eyeDirection",
    "eyePos",
    "face",
    "faction",
    "fadeEnvironment",
    "fadeMusic",
    "fadeRadio",
    "fadeSound",
    "fadeSpeech",
    "failMission",
    "fileExists",
    "fillWeaponsFromPool",
    "find",
    "findAny",
    "findCover",
    "findDisplay",
    "findEditorObject",
    "findEmptyPosition",
    "findEmptyPositionReady",
    "findIf",
    "findNearestEnemy",
    "finishMissionInit",
    "finite",
    "fire",
    "fireAtTarget",
    "firstBackpack",
    "flag",
    "flagAnimationPhase",
    "flagOwner",
    "flagSide",
    "flagTexture",
    "flatten",
    "fleeing",
    "floor",
    "flyInHeight",
    "flyInHeightASL",
    "focusedCtrl",
    "fog",
    "fogForecast",
    "fogParams",
    "forceAddUniform",
    "forceAtPositionRTD",
    "forceCadetDifficulty",
    "forcedMap",
    "forceEnd",
    "forceFlagTexture",
    "forceFollowRoad",
    "forceGeneratorRTD",
    "forceMap",
    "forceRespawn",
    "forceSpeed",
    "forceUnicode",
    "forceWalk",
    "forceWeaponFire",
    "forceWeatherChange",
    "forEachMember",
    "forEachMemberAgent",
    "forEachMemberTeam",
    "forgetTarget",
    "format",
    "formation",
    "formationDirection",
    "formationLeader",
    "formationMembers",
    "formationPosition",
    "formationTask",
    "formatText",
    "formLeader",
    "freeExtension",
    "freeLook",
    "fromEditor",
    "fuel",
    "fullCrew",
    "gearIDCAmmoCount",
    "gearSlotAmmoCount",
    "gearSlotData",
    "gestureState",
    "get",
    "get3DENActionState",
    "get3DENAttribute",
    "get3DENCamera",
    "get3DENConnections",
    "get3DENEntity",
    "get3DENEntityID",
    "get3DENGrid",
    "get3DENIconsVisible",
    "get3DENLayerEntities",
    "get3DENLinesVisible",
    "get3DENMissionAttribute",
    "get3DENMouseOver",
    "get3DENSelected",
    "getAimingCoef",
    "getAllEnv3DSoundControllers",
    "getAllEnvSoundControllers",
    "getAllHitPointsDamage",
    "getAllOwnedMines",
    "getAllPylonsInfo",
    "getAllSoundControllers",
    "getAllUnitTraits",
    "getAmmoCargo",
    "getAnimAimPrecision",
    "getAnimSpeedCoef",
    "getArray",
    "getArtilleryAmmo",
    "getArtilleryComputerSettings",
    "getArtilleryETA",
    "getAssetDLCInfo",
    "getAssignedCuratorLogic",
    "getAssignedCuratorUnit",
    "getAttackTarget",
    "getAudioOptionVolumes",
    "getBackpackCargo",
    "getBleedingRemaining",
    "getBurningValue",
    "getCalculatePlayerVisibilityByFriendly",
    "getCameraViewDirection",
    "getCargoIndex",
    "getCenterOfMass",
    "getClientState",
    "getClientStateNumber",
    "getCompatiblePylonMagazines",
    "getConnectedUAV",
    "getConnectedUAVUnit",
    "getContainerMaxLoad",
    "getCorpse",
    "getCruiseControl",
    "getCursorObjectParams",
    "getCustomAimCoef",
    "getCustomSoundController",
    "getCustomSoundControllerCount",
    "getDammage",
    "getDebriefingText",
    "getDescription",
    "getDir",
    "getDirVisual",
    "getDiverState",
    "getDLCAssetsUsage",
    "getDLCAssetsUsageByName",
    "getDLCs",
    "getDLCUsageTime",
    "getEditorCamera",
    "getEditorMode",
    "getEditorObjectScope",
    "getElevationOffset",
    "getEngineTargetRPMRTD",
    "getEnv3DSoundController",
    "getEnvSoundController",
    "getEventHandlerInfo",
    "getFatigue",
    "getFieldManualStartPage",
    "getForcedFlagTexture",
    "getForcedSpeed",
    "getFriend",
    "getFSMVariable",
    "getFuelCargo",
    "getGraphValues",
    "getGroupIcon",
    "getGroupIconParams",
    "getGroupIcons",
    "getHideFrom",
    "getHit",
    "getHitIndex",
    "getHitPointDamage",
    "getItemCargo",
    "getLighting",
    "getLightingAt",
    "getLoadedModsInfo",
    "getMagazineCargo",
    "getMarkerColor",
    "getMarkerPos",
    "getMarkerSize",
    "getMarkerType",
    "getMass",
    "getMissionConfig",
    "getMissionConfigValue",
    "getMissionDLCs",
    "getMissionLayerEntities",
    "getMissionLayers",
    "getMissionPath",
    "getModelInfo",
    "getMousePosition",
    "getMusicPlayedTime",
    "getNumber",
    "getObjectArgument",
    "getObjectChildren",
    "getObjectDLC",
    "getObjectFOV",
    "getObjectID",
    "getObjectMaterials",
    "getObjectProxy",
    "getObjectScale",
    "getObjectTextures",
    "getObjectType",
    "getObjectViewDistance",
    "getOpticsMode",
    "getOrDefault",
    "getOrDefaultCall",
    "getOxygenRemaining",
    "getPersonUsedDLCs",
    "getPilotCameraDirection",
    "getPilotCameraPosition",
    "getPilotCameraRotation",
    "getPilotCameraTarget",
    "getPiPViewDistance",
    "getPlateNumber",
    "getPlayerChannel",
    "getPlayerID",
    "getPlayerScores",
    "getPlayerUID",
    "getPlayerVoNVolume",
    "getPos",
    "getPosASL",
    "getPosASLVisual",
    "getPosASLW",
    "getPosATL",
    "getPosATLVisual",
    "getPosVisual",
    "getPosWorld",
    "getPosWorldVisual",
    "getPylonMagazines",
    "getRelDir",
    "getRelPos",
    "getRemoteSensorsDisabled",
    "getRepairCargo",
    "getResolution",
    "getRoadInfo",
    "getRotorBrakeRTD",
    "getSensorTargets",
    "getSensorThreats",
    "getShadowDistance",
    "getShotParents",
    "getSlingLoad",
    "getSoundController",
    "getSoundControllerResult",
    "getSpeed",
    "getStamina",
    "getStatValue",
    "getSteamFriendsServers",
    "getSubtitleOptions",
    "getSuppression",
    "getTerrainGrid",
    "getTerrainHeight",
    "getTerrainHeightASL",
    "getTerrainInfo",
    "getText",
    "getTextRaw",
    "getTextureInfo",
    "getTextWidth",
    "getTiParameters",
    "getTotalDLCUsageTime",
    "getTrimOffsetRTD",
    "getTurretLimits",
    "getTurretOpticsMode",
    "getUnitFreefallInfo",
    "getUnitLoadout",
    "getUnitTrait",
    "getUnloadInCombat",
    "getUserInfo",
    "getUserMFDText",
    "getUserMFDValue",
    "getVariable",
    "getVehicleCargo",
    "getVehicleTiPars",
    "getWeaponCargo",
    "getWeaponSway",
    "getWingsOrientationRTD",
    "getWingsPositionRTD",
    "getWPPos",
    "glanceAt",
    "globalChat",
    "globalRadio",
    "goggles",
    "goto",
    "group",
    "groupChat",
    "groupFromNetId",
    "groupIconSelectable",
    "groupIconsVisible",
    "groupID",
    "groupOwner",
    "groupRadio",
    "groups",
    "groupSelectedUnits",
    "groupSelectUnit",
    "gunner",
    "gusts",
    "halt",
    "handgunItems",
    "handgunMagazine",
    "handgunWeapon",
    "handsHit",
    "hashValue",
    "hasInterface",
    "hasPilotCamera",
    "hasWeapon",
    "hcAllGroups",
    "hcGroupParams",
    "hcLeader",
    "hcRemoveAllGroups",
    "hcRemoveGroup",
    "hcSelected",
    "hcSelectGroup",
    "hcSetGroup",
    "hcShowBar",
    "hcShownBar",
    "headgear",
    "hideBody",
    "hideObject",
    "hideObjectGlobal",
    "hideSelection",
    "hint",
    "hintC",
    "hintCadet",
    "hintSilent",
    "hmd",
    "hostMission",
    "htmlLoad",
    "HUDMovementLevels",
    "humidity",
    "image",
    "importAllGroups",
    "importance",
    "in",
    "inArea",
    "inAreaArray",
    "incapacitatedState",
    "inflame",
    "inflamed",
    "infoPanel",
    "infoPanelComponentEnabled",
    "infoPanelComponents",
    "infoPanels",
    "inGameUISetEventHandler",
    "inheritsFrom",
    "initAmbientLife",
    "inPolygon",
    "inputAction",
    "inputController",
    "inputMouse",
    "inRangeOfArtillery",
    "insert",
    "insertEditorObject",
    "intersect",
    "is3DEN",
    "is3DENMultiplayer",
    "is3DENPreview",
    "isAbleToBreathe",
    "isActionMenuVisible",
    "isAgent",
    "isAimPrecisionEnabled",
    "isAllowedCrewInImmobile",
    "isArray",
    "isAutoHoverOn",
    "isAutonomous",
    "isAutoStartUpEnabledRTD",
    "isAutotest",
    "isAutoTrimOnRTD",
    "isAwake",
    "isBleeding",
    "isBurning",
    "isClass",
    "isCollisionLightOn",
    "isCopilotEnabled",
    "isDamageAllowed",
    "isDedicated",
    "isDLCAvailable",
    "isEngineOn",
    "isEqualRef",
    "isEqualTo",
    "isEqualType",
    "isEqualTypeAll",
    "isEqualTypeAny",
    "isEqualTypeArray",
    "isEqualTypeParams",
    "isFilePatchingEnabled",
    "isFinal",
    "isFlashlightOn",
    "isFlatEmpty",
    "isForcedWalk",
    "isFormationLeader",
    "isGameFocused",
    "isGamePaused",
    "isGroupDeletedWhenEmpty",
    "isHidden",
    "isInRemainsCollector",
    "isInstructorFigureEnabled",
    "isIRLaserOn",
    "isKeyActive",
    "isKindOf",
    "isLaserOn",
    "isLightOn",
    "isLocalized",
    "isManualFire",
    "isMarkedForCollection",
    "isMissionProfileNamespaceLoaded",
    "isMultiplayer",
    "isMultiplayerSolo",
    "isNil",
    "isNotEqualRef",
    "isNotEqualTo",
    "isNull",
    "isNumber",
    "isObjectHidden",
    "isObjectRTD",
    "isOnRoad",
    "isPiPEnabled",
    "isPlayer",
    "isRealTime",
    "isRemoteExecuted",
    "isRemoteExecutedJIP",
    "isSaving",
    "isSensorTargetConfirmed",
    "isServer",
    "isShowing3DIcons",
    "isSimpleObject",
    "isSprintAllowed",
    "isStaminaEnabled",
    "isSteamMission",
    "isSteamOverlayEnabled",
    "isStreamFriendlyUIEnabled",
    "isStressDamageEnabled",
    "isText",
    "isTouchingGround",
    "isTurnedOut",
    "isTutHintsEnabled",
    "isUAVConnectable",
    "isUAVConnected",
    "isUIContext",
    "isUniformAllowed",
    "isVehicleCargo",
    "isVehicleRadarOn",
    "isVehicleSensorEnabled",
    "isWalking",
    "isWeaponDeployed",
    "isWeaponRested",
    "itemCargo",
    "items",
    "itemsWithMagazines",
    "join",
    "joinAs",
    "joinAsSilent",
    "joinSilent",
    "joinString",
    "kbAddDatabase",
    "kbAddDatabaseTargets",
    "kbAddTopic",
    "kbHasTopic",
    "kbReact",
    "kbRemoveTopic",
    "kbTell",
    "kbWasSaid",
    "keyImage",
    "keyName",
    "keys",
    "knowsAbout",
    "land",
    "landAt",
    "landResult",
    "language",
    "laserTarget",
    "lbAdd",
    "lbClear",
    "lbColor",
    "lbColorRight",
    "lbCurSel",
    "lbData",
    "lbDelete",
    "lbIsSelected",
    "lbPicture",
    "lbPictureRight",
    "lbSelection",
    "lbSetColor",
    "lbSetColorRight",
    "lbSetCurSel",
    "lbSetData",
    "lbSetPicture",
    "lbSetPictureColor",
    "lbSetPictureColorDisabled",
    "lbSetPictureColorSelected",
    "lbSetPictureRight",
    "lbSetPictureRightColor",
    "lbSetPictureRightColorDisabled",
    "lbSetPictureRightColorSelected",
    "lbSetSelectColor",
    "lbSetSelectColorRight",
    "lbSetSelected",
    "lbSetText",
    "lbSetTextRight",
    "lbSetTooltip",
    "lbSetValue",
    "lbSize",
    "lbSort",
    "lbSortBy",
    "lbSortByValue",
    "lbText",
    "lbTextRight",
    "lbTooltip",
    "lbValue",
    "leader",
    "leaderboardDeInit",
    "leaderboardGetRows",
    "leaderboardInit",
    "leaderboardRequestRowsFriends",
    "leaderboardRequestRowsGlobal",
    "leaderboardRequestRowsGlobalAroundUser",
    "leaderboardsRequestUploadScore",
    "leaderboardsRequestUploadScoreKeepBest",
    "leaderboardState",
    "leaveVehicle",
    "libraryCredits",
    "libraryDisclaimers",
    "lifeState",
    "lightAttachObject",
    "lightDetachObject",
    "lightIsOn",
    "lightnings",
    "limitSpeed",
    "linearConversion",
    "lineIntersects",
    "lineIntersectsObjs",
    "lineIntersectsSurfaces",
    "lineIntersectsWith",
    "linkItem",
    "list",
    "listObjects",
    "listRemoteTargets",
    "listVehicleSensors",
    "ln",
    "lnbAddArray",
    "lnbAddColumn",
    "lnbAddRow",
    "lnbClear",
    "lnbColor",
    "lnbColorRight",
    "lnbCurSelRow",
    "lnbData",
    "lnbDeleteColumn",
    "lnbDeleteRow",
    "lnbGetColumnsPosition",
    "lnbPicture",
    "lnbPictureRight",
    "lnbSetColor",
    "lnbSetColorRight",
    "lnbSetColumnsPos",
    "lnbSetCurSelRow",
    "lnbSetData",
    "lnbSetPicture",
    "lnbSetPictureColor",
    "lnbSetPictureColorRight",
    "lnbSetPictureColorSelected",
    "lnbSetPictureColorSelectedRight",
    "lnbSetPictureRight",
    "lnbSetText",
    "lnbSetTextRight",
    "lnbSetTooltip",
    "lnbSetValue",
    "lnbSize",
    "lnbSort",
    "lnbSortBy",
    "lnbSortByValue",
    "lnbText",
    "lnbTextRight",
    "lnbValue",
    "load",
    "loadAbs",
    "loadBackpack",
    "loadConfig",
    "loadFile",
    "loadGame",
    "loadIdentity",
    "loadMagazine",
    "loadOverlay",
    "loadStatus",
    "loadUniform",
    "loadVest",
    "localize",
    "localNamespace",
    "locationPosition",
    "lock",
    "lockCameraTo",
    "lockCargo",
    "lockDriver",
    "locked",
    "lockedCameraTo",
    "lockedCargo",
    "lockedDriver",
    "lockedInventory",
    "lockedTurret",
    "lockIdentity",
    "lockInventory",
    "lockTurret",
    "lockWp",
    "log",
    "logEntities",
    "logNetwork",
    "logNetworkTerminate",
    "lookAt",
    "lookAtPos",
    "magazineCargo",
    "magazines",
    "magazinesAllTurrets",
    "magazinesAmmo",
    "magazinesAmmoCargo",
    "magazinesAmmoFull",
    "magazinesDetail",
    "magazinesDetailBackpack",
    "magazinesDetailUniform",
    "magazinesDetailVest",
    "magazinesTurret",
    "magazineTurretAmmo",
    "mapAnimAdd",
    "mapAnimClear",
    "mapAnimCommit",
    "mapAnimDone",
    "mapCenterOnCamera",
    "mapGridPosition",
    "markAsFinishedOnSteam",
    "markerAlpha",
    "markerBrush",
    "markerChannel",
    "markerColor",
    "markerDir",
    "markerPolyline",
    "markerPos",
    "markerShadow",
    "markerShape",
    "markerSize",
    "markerText",
    "markerType",
    "matrixMultiply",
    "matrixTranspose",
    "max",
    "maxLoad",
    "members",
    "menuAction",
    "menuAdd",
    "menuChecked",
    "menuClear",
    "menuCollapse",
    "menuData",
    "menuDelete",
    "menuEnable",
    "menuEnabled",
    "menuExpand",
    "menuHover",
    "menuPicture",
    "menuSetAction",
    "menuSetCheck",
    "menuSetData",
    "menuSetPicture",
    "menuSetShortcut",
    "menuSetText",
    "menuSetURL",
    "menuSetValue",
    "menuShortcut",
    "menuShortcutText",
    "menuSize",
    "menuSort",
    "menuText",
    "menuURL",
    "menuValue",
    "merge",
    "min",
    "mineActive",
    "mineDetectedBy",
    "missileTarget",
    "missileTargetPos",
    "missionConfigFile",
    "missionDifficulty",
    "missionEnd",
    "missionName",
    "missionNameSource",
    "missionNamespace",
    "missionProfileNamespace",
    "missionStart",
    "missionVersion",
    "mod",
    "modelToWorld",
    "modelToWorldVisual",
    "modelToWorldVisualWorld",
    "modelToWorldWorld",
    "modParams",
    "moonIntensity",
    "moonPhase",
    "morale",
    "move",
    "move3DENCamera",
    "moveInAny",
    "moveInCargo",
    "moveInCommander",
    "moveInDriver",
    "moveInGunner",
    "moveInTurret",
    "moveObjectToEnd",
    "moveOut",
    "moveTime",
    "moveTo",
    "moveToCompleted",
    "moveToFailed",
    "musicVolume",
    "name",
    "namedProperties",
    "nameSound",
    "nearEntities",
    "nearestBuilding",
    "nearestLocation",
    "nearestLocations",
    "nearestLocationWithDubbing",
    "nearestMines",
    "nearestObject",
    "nearestObjects",
    "nearestTerrainObjects",
    "nearObjects",
    "nearObjectsReady",
    "nearRoads",
    "nearSupplies",
    "nearTargets",
    "needReload",
    "needService",
    "netId",
    "netObjNull",
    "newOverlay",
    "nextMenuItemIndex",
    "nextWeatherChange",
    "nMenuItems",
    "not",
    "numberOfEnginesRTD",
    "numberToDate",
    "objectCurators",
    "objectFromNetId",
    "objectParent",
    "objStatus",
    "onBriefingGroup",
    "onBriefingNotes",
    "onBriefingPlan",
    "onBriefingTeamSwitch",
    "onCommandModeChanged",
    "onDoubleClick",
    "onEachFrame",
    "onGroupIconClick",
    "onGroupIconOverEnter",
    "onGroupIconOverLeave",
    "onHCGroupSelectionChanged",
    "onMapSingleClick",
    "onPlayerConnected",
    "onPlayerDisconnected",
    "onPreloadFinished",
    "onPreloadStarted",
    "onShowNewObject",
    "onTeamSwitch",
    "openCuratorInterface",
    "openDLCPage",
    "openGPS",
    "openMap",
    "openSteamApp",
    "openYoutubeVideo",
    "or",
    "orderGetIn",
    "overcast",
    "overcastForecast",
    "owner",
    "param",
    "params",
    "parseNumber",
    "parseSimpleArray",
    "parseText",
    "parsingNamespace",
    "particlesQuality",
    "periscopeElevation",
    "pickWeaponPool",
    "pitch",
    "pixelGrid",
    "pixelGridBase",
    "pixelGridNoUIScale",
    "pixelH",
    "pixelW",
    "playableSlotsNumber",
    "playableUnits",
    "playAction",
    "playActionNow",
    "player",
    "playerRespawnTime",
    "playerSide",
    "playersNumber",
    "playGesture",
    "playMission",
    "playMove",
    "playMoveNow",
    "playMusic",
    "playScriptedMission",
    "playSound",
    "playSound3D",
    "playSoundUI",
    "pose",
    "position",
    "positionCameraToWorld",
    "posScreenToWorld",
    "posWorldToScreen",
    "ppEffectAdjust",
    "ppEffectCommit",
    "ppEffectCommitted",
    "ppEffectCreate",
    "ppEffectDestroy",
    "ppEffectEnable",
    "ppEffectEnabled",
    "ppEffectForceInNVG",
    "precision",
    "preloadCamera",
    "preloadObject",
    "preloadSound",
    "preloadTitleObj",
    "preloadTitleRsc",
    "preprocessFile",
    "preprocessFileLineNumbers",
    "primaryWeapon",
    "primaryWeaponItems",
    "primaryWeaponMagazine",
    "priority",
    "processDiaryLink",
    "productVersion",
    "profileName",
    "profileNamespace",
    "profileNameSteam",
    "progressLoadingScreen",
    "progressPosition",
    "progressSetPosition",
    "publicVariable",
    "publicVariableClient",
    "publicVariableServer",
    "pushBack",
    "pushBackUnique",
    "putWeaponPool",
    "queryItemsPool",
    "queryMagazinePool",
    "queryWeaponPool",
    "rad",
    "radioChannelAdd",
    "radioChannelCreate",
    "radioChannelInfo",
    "radioChannelRemove",
    "radioChannelSetCallSign",
    "radioChannelSetLabel",
    "radioEnabled",
    "radioVolume",
    "rain",
    "rainbow",
    "rainParams",
    "random",
    "rank",
    "rankId",
    "rating",
    "rectangular",
    "regexFind",
    "regexMatch",
    "regexReplace",
    "registeredTasks",
    "registerTask",
    "reload",
    "reloadEnabled",
    "remoteControl",
    "remoteExec",
    "remoteExecCall",
    "remoteExecutedOwner",
    "remove3DENConnection",
    "remove3DENEventHandler",
    "remove3DENLayer",
    "removeAction",
    "removeAll3DENEventHandlers",
    "removeAllActions",
    "removeAllAssignedItems",
    "removeAllBinocularItems",
    "removeAllContainers",
    "removeAllCuratorAddons",
    "removeAllCuratorCameraAreas",
    "removeAllCuratorEditingAreas",
    "removeAllEventHandlers",
    "removeAllHandgunItems",
    "removeAllItems",
    "removeAllItemsWithMagazines",
    "removeAllMissionEventHandlers",
    "removeAllMPEventHandlers",
    "removeAllMusicEventHandlers",
    "removeAllOwnedMines",
    "removeAllPrimaryWeaponItems",
    "removeAllSecondaryWeaponItems",
    "removeAllUserActionEventHandlers",
    "removeAllWeapons",
    "removeBackpack",
    "removeBackpackGlobal",
    "removeBinocularItem",
    "removeCuratorAddons",
    "removeCuratorCameraArea",
    "removeCuratorEditableObjects",
    "removeCuratorEditingArea",
    "removeDiaryRecord",
    "removeDiarySubject",
    "removeDrawIcon",
    "removeDrawLinks",
    "removeEventHandler",
    "removeFromRemainsCollector",
    "removeGoggles",
    "removeGroupIcon",
    "removeHandgunItem",
    "removeHeadgear",
    "removeItem",
    "removeItemFromBackpack",
    "removeItemFromUniform",
    "removeItemFromVest",
    "removeItems",
    "removeMagazine",
    "removeMagazineGlobal",
    "removeMagazines",
    "removeMagazinesTurret",
    "removeMagazineTurret",
    "removeMenuItem",
    "removeMissionEventHandler",
    "removeMPEventHandler",
    "removeMusicEventHandler",
    "removeOwnedMine",
    "removePrimaryWeaponItem",
    "removeSecondaryWeaponItem",
    "removeSimpleTask",
    "removeSwitchableUnit",
    "removeTeamMember",
    "removeUniform",
    "removeUserActionEventHandler",
    "removeVest",
    "removeWeapon",
    "removeWeaponAttachmentCargo",
    "removeWeaponCargo",
    "removeWeaponGlobal",
    "removeWeaponTurret",
    "reportRemoteTarget",
    "requiredVersion",
    "resetCamShake",
    "resetSubgroupDirection",
    "resize",
    "resources",
    "respawnVehicle",
    "restartEditorCamera",
    "reveal",
    "revealMine",
    "reverse",
    "reversedMouseY",
    "roadAt",
    "roadsConnectedTo",
    "roleDescription",
    "ropeAttachedObjects",
    "ropeAttachedTo",
    "ropeAttachEnabled",
    "ropeAttachTo",
    "ropeCreate",
    "ropeCut",
    "ropeDestroy",
    "ropeDetach",
    "ropeEndPosition",
    "ropeLength",
    "ropes",
    "ropesAttachedTo",
    "ropeSegments",
    "ropeUnwind",
    "ropeUnwound",
    "rotorsForcesRTD",
    "rotorsRpmRTD",
    "round",
    "runInitScript",
    "safeZoneH",
    "safeZoneW",
    "safeZoneWAbs",
    "safeZoneX",
    "safeZoneXAbs",
    "safeZoneY",
    "save3DENInventory",
    "saveGame",
    "saveIdentity",
    "saveJoysticks",
    "saveMissionProfileNamespace",
    "saveOverlay",
    "saveProfileNamespace",
    "saveStatus",
    "saveVar",
    "savingEnabled",
    "say",
    "say2D",
    "say3D",
    "scopeName",
    "score",
    "scoreSide",
    "screenshot",
    "screenToWorld",
    "scriptDone",
    "scriptName",
    "scudState",
    "secondaryWeapon",
    "secondaryWeaponItems",
    "secondaryWeaponMagazine",
    "select",
    "selectBestPlaces",
    "selectDiarySubject",
    "selectedEditorObjects",
    "selectEditorObject",
    "selectionNames",
    "selectionPosition",
    "selectionVectorDirAndUp",
    "selectLeader",
    "selectMax",
    "selectMin",
    "selectNoPlayer",
    "selectPlayer",
    "selectRandom",
    "selectRandomWeighted",
    "selectWeapon",
    "selectWeaponTurret",
    "sendAUMessage",
    "sendSimpleCommand",
    "sendTask",
    "sendTaskResult",
    "sendUDPMessage",
    "sentencesEnabled",
    "serverCommand",
    "serverCommandAvailable",
    "serverCommandExecutable",
    "serverName",
    "serverNamespace",
    "serverTime",
    "set",
    "set3DENAttribute",
    "set3DENAttributes",
    "set3DENGrid",
    "set3DENIconsVisible",
    "set3DENLayer",
    "set3DENLinesVisible",
    "set3DENLogicType",
    "set3DENMissionAttribute",
    "set3DENMissionAttributes",
    "set3DENModelsVisible",
    "set3DENObjectType",
    "set3DENSelected",
    "setAccTime",
    "setActualCollectiveRTD",
    "setAirplaneThrottle",
    "setAirportSide",
    "setAmmo",
    "setAmmoCargo",
    "setAmmoOnPylon",
    "setAnimSpeedCoef",
    "setAperture",
    "setApertureNew",
    "setArmoryPoints",
    "setAttributes",
    "setAutonomous",
    "setBehaviour",
    "setBehaviourStrong",
    "setBleedingRemaining",
    "setBrakesRTD",
    "setCameraInterest",
    "setCamShakeDefParams",
    "setCamShakeParams",
    "setCamUseTi",
    "setCaptive",
    "setCenterOfMass",
    "setCollisionLight",
    "setCombatBehaviour",
    "setCombatMode",
    "setCompassOscillation",
    "setConvoySeparation",
    "setCruiseControl",
    "setCuratorCameraAreaCeiling",
    "setCuratorCoef",
    "setCuratorEditingAreaType",
    "setCuratorWaypointCost",
    "setCurrentChannel",
    "setCurrentTask",
    "setCurrentWaypoint",
    "setCustomAimCoef",
    "SetCustomMissionData",
    "setCustomSoundController",
    "setCustomWeightRTD",
    "setDamage",
    "setDammage",
    "setDate",
    "setDebriefingText",
    "setDefaultCamera",
    "setDestination",
    "setDetailMapBlendPars",
    "setDiaryRecordText",
    "setDiarySubjectPicture",
    "setDir",
    "setDirection",
    "setDrawIcon",
    "setDriveOnPath",
    "setDropInterval",
    "setDynamicSimulationDistance",
    "setDynamicSimulationDistanceCoef",
    "setEditorMode",
    "setEditorObjectScope",
    "setEffectCondition",
    "setEffectiveCommander",
    "setEngineRpmRTD",
    "setFace",
    "setFaceanimation",
    "setFatigue",
    "setFeatureType",
    "setFlagAnimationPhase",
    "setFlagOwner",
    "setFlagSide",
    "setFlagTexture",
    "setFog",
    "setForceGeneratorRTD",
    "setFormation",
    "setFormationTask",
    "setFormDir",
    "setFriend",
    "setFromEditor",
    "setFSMVariable",
    "setFuel",
    "setFuelCargo",
    "setGroupIcon",
    "setGroupIconParams",
    "setGroupIconsSelectable",
    "setGroupIconsVisible",
    "setGroupid",
    "setGroupIdGlobal",
    "setGroupOwner",
    "setGusts",
    "setHideBehind",
    "setHit",
    "setHitIndex",
    "setHitPointDamage",
    "setHorizonParallaxCoef",
    "setHUDMovementLevels",
    "setHumidity",
    "setIdentity",
    "setImportance",
    "setInfoPanel",
    "setLeader",
    "setLightAmbient",
    "setLightAttenuation",
    "setLightBrightness",
    "setLightColor",
    "setLightConePars",
    "setLightDayLight",
    "setLightFlareMaxDistance",
    "setLightFlareSize",
    "setLightIntensity",
    "setLightIR",
    "setLightnings",
    "setLightUseFlare",
    "setLightVolumeShape",
    "setLocalWindParams",
    "setMagazineTurretAmmo",
    "setMarkerAlpha",
    "setMarkerAlphaLocal",
    "setMarkerBrush",
    "setMarkerBrushLocal",
    "setMarkerColor",
    "setMarkerColorLocal",
    "setMarkerDir",
    "setMarkerDirLocal",
    "setMarkerPolyline",
    "setMarkerPolylineLocal",
    "setMarkerPos",
    "setMarkerPosLocal",
    "setMarkerShadow",
    "setMarkerShadowLocal",
    "setMarkerShape",
    "setMarkerShapeLocal",
    "setMarkerSize",
    "setMarkerSizeLocal",
    "setMarkerText",
    "setMarkerTextLocal",
    "setMarkerType",
    "setMarkerTypeLocal",
    "setMass",
    "setMaxLoad",
    "setMimic",
    "setMissileTarget",
    "setMissileTargetPos",
    "setMousePosition",
    "setMusicEffect",
    "setMusicEventHandler",
    "setName",
    "setNameSound",
    "setObjectArguments",
    "setObjectMaterial",
    "setObjectMaterialGlobal",
    "setObjectProxy",
    "setObjectScale",
    "setObjectTexture",
    "setObjectTextureGlobal",
    "setObjectViewDistance",
    "setOpticsMode",
    "setOvercast",
    "setOwner",
    "setOxygenRemaining",
    "setParticleCircle",
    "setParticleClass",
    "setParticleFire",
    "setParticleParams",
    "setParticleRandom",
    "setPilotCameraDirection",
    "setPilotCameraRotation",
    "setPilotCameraTarget",
    "setPilotLight",
    "setPiPEffect",
    "setPiPViewDistance",
    "setPitch",
    "setPlateNumber",
    "setPlayable",
    "setPlayerRespawnTime",
    "setPlayerVoNVolume",
    "setPos",
    "setPosASL",
    "setPosASL2",
    "setPosASLW",
    "setPosATL",
    "setPosition",
    "setPosWorld",
    "setPylonLoadout",
    "setPylonsPriority",
    "setRadioMsg",
    "setRain",
    "setRainbow",
    "setRandomLip",
    "setRank",
    "setRectangular",
    "setRepairCargo",
    "setRotorBrakeRTD",
    "setShadowDistance",
    "setShotParents",
    "setSide",
    "setSimpleTaskAlwaysVisible",
    "setSimpleTaskCustomData",
    "setSimpleTaskDescription",
    "setSimpleTaskDestination",
    "setSimpleTaskTarget",
    "setSimpleTaskType",
    "setSimulWeatherLayers",
    "setSize",
    "setSkill",
    "setSlingLoad",
    "setSoundEffect",
    "setSpeaker",
    "setSpeech",
    "setSpeedMode",
    "setStamina",
    "setStaminaScheme",
    "setStatValue",
    "setSuppression",
    "setSystemOfUnits",
    "setTargetAge",
    "setTaskMarkerOffset",
    "setTaskResult",
    "setTaskState",
    "setTerrainGrid",
    "setTerrainHeight",
    "setText",
    "setTimeMultiplier",
    "setTiParameter",
    "setTitleEffect",
    "setTowParent",
    "setTrafficDensity",
    "setTrafficDistance",
    "setTrafficGap",
    "setTrafficSpeed",
    "setTriggerActivation",
    "setTriggerArea",
    "setTriggerInterval",
    "setTriggerStatements",
    "setTriggerText",
    "setTriggerTimeout",
    "setTriggerType",
    "setTurretLimits",
    "setTurretOpticsMode",
    "setType",
    "setUnconscious",
    "setUnitAbility",
    "setUnitCombatMode",
    "setUnitFreefallHeight",
    "setUnitLoadout",
    "setUnitPos",
    "setUnitPosWeak",
    "setUnitRank",
    "setUnitRecoilCoefficient",
    "setUnitTrait",
    "setUnloadInCombat",
    "setUserActionText",
    "setUserMFDText",
    "setUserMFDValue",
    "setVariable",
    "setVectorDir",
    "setVectorDirAndUp",
    "setVectorUp",
    "setVehicleAmmo",
    "setVehicleAmmoDef",
    "setVehicleArmor",
    "setVehicleCargo",
    "setVehicleId",
    "setVehicleLock",
    "setVehiclePosition",
    "setVehicleRadar",
    "setVehicleReceiveRemoteTargets",
    "setVehicleReportOwnPosition",
    "setVehicleReportRemoteTargets",
    "setVehicleTiPars",
    "setVehicleVarName",
    "setVelocity",
    "setVelocityModelSpace",
    "setVelocityTransformation",
    "setViewDistance",
    "setVisibleIfTreeCollapsed",
    "setWantedRPMRTD",
    "setWaves",
    "setWaypointBehaviour",
    "setWaypointCombatMode",
    "setWaypointCompletionRadius",
    "setWaypointDescription",
    "setWaypointForceBehaviour",
    "setWaypointFormation",
    "setWaypointHousePosition",
    "setWaypointLoiterAltitude",
    "setWaypointLoiterRadius",
    "setWaypointLoiterType",
    "setWaypointName",
    "setWaypointPosition",
    "setWaypointScript",
    "setWaypointSpeed",
    "setWaypointStatements",
    "setWaypointTimeout",
    "setWaypointType",
    "setWaypointVisible",
    "setWeaponReloadingTime",
    "setWeaponZeroing",
    "setWind",
    "setWindDir",
    "setWindForce",
    "setWindStr",
    "setWingForceScaleRTD",
    "setWPPos",
    "show3DIcons",
    "showChat",
    "showCinemaBorder",
    "showCommandingMenu",
    "showCompass",
    "showCuratorCompass",
    "showGps",
    "showHUD",
    "showLegend",
    "showMap",
    "shownArtilleryComputer",
    "shownChat",
    "shownCompass",
    "shownCuratorCompass",
    "showNewEditorObject",
    "shownGps",
    "shownHUD",
    "shownMap",
    "shownPad",
    "shownRadio",
    "shownScoretable",
    "shownSubtitles",
    "shownUAVFeed",
    "shownWarrant",
    "shownWatch",
    "showPad",
    "showRadio",
    "showScoretable",
    "showSubtitles",
    "showUAVFeed",
    "showWarrant",
    "showWatch",
    "showWaypoint",
    "showWaypoints",
    "side",
    "sideChat",
    "sideRadio",
    "simpleTasks",
    "simulationEnabled",
    "simulCloudDensity",
    "simulCloudOcclusion",
    "simulInClouds",
    "simulWeatherSync",
    "sin",
    "size",
    "sizeOf",
    "skill",
    "skillFinal",
    "skipTime",
    "sleep",
    "sliderPosition",
    "sliderRange",
    "sliderSetPosition",
    "sliderSetRange",
    "sliderSetSpeed",
    "sliderSpeed",
    "slingLoadAssistantShown",
    "soldierMagazines",
    "someAmmo",
    "sort",
    "soundVolume",
    "spawn",
    "speaker",
    "speechVolume",
    "speed",
    "speedMode",
    "splitString",
    "sqrt",
    "squadParams",
    "stance",
    "startLoadingScreen",
    "stop",
    "stopEngineRTD",
    "stopped",
    "str",
    "sunOrMoon",
    "supportInfo",
    "suppressFor",
    "surfaceIsWater",
    "surfaceNormal",
    "surfaceTexture",
    "surfaceType",
    "swimInDepth",
    "switchableUnits",
    "switchAction",
    "switchCamera",
    "switchGesture",
    "switchLight",
    "switchMove",
    "synchronizedObjects",
    "synchronizedTriggers",
    "synchronizedWaypoints",
    "synchronizeObjectsAdd",
    "synchronizeObjectsRemove",
    "synchronizeTrigger",
    "synchronizeWaypoint",
    "systemChat",
    "systemOfUnits",
    "systemTime",
    "systemTimeUTC",
    "tan",
    "targetKnowledge",
    "targets",
    "targetsAggregate",
    "targetsQuery",
    "taskAlwaysVisible",
    "taskChildren",
    "taskCompleted",
    "taskCustomData",
    "taskDescription",
    "taskDestination",
    "taskHint",
    "taskMarkerOffset",
    "taskName",
    "taskParent",
    "taskResult",
    "taskState",
    "taskType",
    "teamMember",
    "teamName",
    "teams",
    "teamSwitch",
    "teamSwitchEnabled",
    "teamType",
    "terminate",
    "terrainIntersect",
    "terrainIntersectASL",
    "terrainIntersectAtASL",
    "text",
    "textLog",
    "textLogFormat",
    "tg",
    "time",
    "timeMultiplier",
    "titleCut",
    "titleFadeOut",
    "titleObj",
    "titleRsc",
    "titleText",
    "toArray",
    "toFixed",
    "toLower",
    "toLowerANSI",
    "toString",
    "toUpper",
    "toUpperANSI",
    "triggerActivated",
    "triggerActivation",
    "triggerAmmo",
    "triggerArea",
    "triggerAttachedVehicle",
    "triggerAttachObject",
    "triggerAttachVehicle",
    "triggerDynamicSimulation",
    "triggerInterval",
    "triggerStatements",
    "triggerText",
    "triggerTimeout",
    "triggerTimeoutCurrent",
    "triggerType",
    "trim",
    "turretLocal",
    "turretOwner",
    "turretUnit",
    "tvAdd",
    "tvClear",
    "tvCollapse",
    "tvCollapseAll",
    "tvCount",
    "tvCurSel",
    "tvData",
    "tvDelete",
    "tvExpand",
    "tvExpandAll",
    "tvIsSelected",
    "tvPicture",
    "tvPictureRight",
    "tvSelection",
    "tvSetColor",
    "tvSetCurSel",
    "tvSetData",
    "tvSetPicture",
    "tvSetPictureColor",
    "tvSetPictureColorDisabled",
    "tvSetPictureColorSelected",
    "tvSetPictureRight",
    "tvSetPictureRightColor",
    "tvSetPictureRightColorDisabled",
    "tvSetPictureRightColorSelected",
    "tvSetSelectColor",
    "tvSetSelected",
    "tvSetText",
    "tvSetTooltip",
    "tvSetValue",
    "tvSort",
    "tvSortAll",
    "tvSortByValue",
    "tvSortByValueAll",
    "tvText",
    "tvTooltip",
    "tvValue",
    "type",
    "typeName",
    "typeOf",
    "UAVControl",
    "uiNamespace",
    "uiSleep",
    "unassignCurator",
    "unassignItem",
    "unassignTeam",
    "unassignVehicle",
    "underwater",
    "uniform",
    "uniformContainer",
    "uniformItems",
    "uniformMagazines",
    "uniqueUnitItems",
    "unitAddons",
    "unitAimPosition",
    "unitAimPositionVisual",
    "unitBackpack",
    "unitCombatMode",
    "unitIsUAV",
    "unitPos",
    "unitReady",
    "unitRecoilCoefficient",
    "units",
    "unitsBelowHeight",
    "unitTurret",
    "unlinkItem",
    "unlockAchievement",
    "unregisterTask",
    "updateDrawIcon",
    "updateMenuItem",
    "updateObjectTree",
    "useAIOperMapObstructionTest",
    "useAISteeringComponent",
    "useAudioTimeForMoves",
    "userInputDisabled",
    "values",
    "vectorAdd",
    "vectorCos",
    "vectorCrossProduct",
    "vectorDiff",
    "vectorDir",
    "vectorDirVisual",
    "vectorDistance",
    "vectorDistanceSqr",
    "vectorDotProduct",
    "vectorFromTo",
    "vectorLinearConversion",
    "vectorMagnitude",
    "vectorMagnitudeSqr",
    "vectorModelToWorld",
    "vectorModelToWorldVisual",
    "vectorMultiply",
    "vectorNormalized",
    "vectorUp",
    "vectorUpVisual",
    "vectorWorldToModel",
    "vectorWorldToModelVisual",
    "vehicle",
    "vehicleCargoEnabled",
    "vehicleChat",
    "vehicleMoveInfo",
    "vehicleRadio",
    "vehicleReceiveRemoteTargets",
    "vehicleReportOwnPosition",
    "vehicleReportRemoteTargets",
    "vehicles",
    "vehicleVarName",
    "velocity",
    "velocityModelSpace",
    "verifySignature",
    "vest",
    "vestContainer",
    "vestItems",
    "vestMagazines",
    "viewDistance",
    "visibleCompass",
    "visibleGps",
    "visibleMap",
    "visiblePosition",
    "visiblePositionASL",
    "visibleScoretable",
    "visibleWatch",
    "waves",
    "waypointAttachedObject",
    "waypointAttachedVehicle",
    "waypointAttachObject",
    "waypointAttachVehicle",
    "waypointBehaviour",
    "waypointCombatMode",
    "waypointCompletionRadius",
    "waypointDescription",
    "waypointForceBehaviour",
    "waypointFormation",
    "waypointHousePosition",
    "waypointLoiterAltitude",
    "waypointLoiterRadius",
    "waypointLoiterType",
    "waypointName",
    "waypointPosition",
    "waypoints",
    "waypointScript",
    "waypointsEnabledUAV",
    "waypointShow",
    "waypointSpeed",
    "waypointStatements",
    "waypointTimeout",
    "waypointTimeoutCurrent",
    "waypointType",
    "waypointVisible",
    "weaponAccessories",
    "weaponAccessoriesCargo",
    "weaponCargo",
    "weaponDirection",
    "weaponInertia",
    "weaponLowered",
    "weaponReloadingTime",
    "weapons",
    "weaponsInfo",
    "weaponsItems",
    "weaponsItemsCargo",
    "weaponState",
    "weaponsTurret",
    "weightRTD",
    "WFSideText",
    "wind",
    "windDir",
    "windRTD",
    "windStr",
    "wingsForcesRTD",
    "worldName",
    "worldSize",
    "worldToModel",
    "worldToModelVisual",
    "worldToScreen"
  ], s = {
    className: "meta",
    begin: /#\s*[a-z]+\b/,
    end: /$/,
    keywords: "define undef ifdef ifndef else endif include if",
    contains: [
      {
        begin: /\\\n/,
        relevance: 0
      },
      t.inherit(r, { className: "string" }),
      {
        begin: /<[^\n>]*>/,
        end: /$/,
        illegal: "\\n"
      },
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE
    ]
  };
  return {
    name: "SQF",
    case_insensitive: !0,
    keywords: {
      keyword: i,
      built_in: a,
      literal: o
    },
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.NUMBER_MODE,
      e,
      n,
      r,
      s
    ],
    illegal: [
      //$ is only valid when used with Hex numbers (e.g. $FF)
      /\$[^a-fA-F0-9]/,
      /\w\$/,
      /\?/,
      //There's no ? in SQF
      /@/,
      //There's no @ in SQF
      // Brute-force-fixing the build error. See https://github.com/highlightjs/highlight.js/pull/3193#issuecomment-843088729
      / \| /,
      // . is only used in numbers
      /[a-zA-Z_]\./,
      /\:\=/,
      /\[\:/
    ]
  };
}
function ew(t) {
  const e = t.regex, n = [
    "functions",
    "model",
    "data",
    "parameters",
    "quantities",
    "transformed",
    "generated"
  ], r = [
    "for",
    "in",
    "if",
    "else",
    "while",
    "break",
    "continue",
    "return"
  ], i = [
    "array",
    "tuple",
    "complex",
    "int",
    "real",
    "vector",
    "complex_vector",
    "ordered",
    "positive_ordered",
    "simplex",
    "unit_vector",
    "row_vector",
    "complex_row_vector",
    "matrix",
    "complex_matrix",
    "cholesky_factor_corr|10",
    "cholesky_factor_cov|10",
    "corr_matrix|10",
    "cov_matrix|10",
    "void"
  ], o = [
    "abs",
    "acos",
    "acosh",
    "add_diag",
    "algebra_solver",
    "algebra_solver_newton",
    "append_array",
    "append_col",
    "append_row",
    "asin",
    "asinh",
    "atan",
    "atan2",
    "atanh",
    "bessel_first_kind",
    "bessel_second_kind",
    "binary_log_loss",
    "block",
    "cbrt",
    "ceil",
    "chol2inv",
    "cholesky_decompose",
    "choose",
    "col",
    "cols",
    "columns_dot_product",
    "columns_dot_self",
    "complex_schur_decompose",
    "complex_schur_decompose_t",
    "complex_schur_decompose_u",
    "conj",
    "cos",
    "cosh",
    "cov_exp_quad",
    "crossprod",
    "csr_extract",
    "csr_extract_u",
    "csr_extract_v",
    "csr_extract_w",
    "csr_matrix_times_vector",
    "csr_to_dense_matrix",
    "cumulative_sum",
    "dae",
    "dae_tol",
    "determinant",
    "diag_matrix",
    "diagonal",
    "diag_post_multiply",
    "diag_pre_multiply",
    "digamma",
    "dims",
    "distance",
    "dot_product",
    "dot_self",
    "eigendecompose",
    "eigendecompose_sym",
    "eigenvalues",
    "eigenvalues_sym",
    "eigenvectors",
    "eigenvectors_sym",
    "erf",
    "erfc",
    "exp",
    "exp2",
    "expm1",
    "falling_factorial",
    "fdim",
    "fft",
    "fft2",
    "floor",
    "fma",
    "fmax",
    "fmin",
    "fmod",
    "gamma_p",
    "gamma_q",
    "generalized_inverse",
    "get_imag",
    "get_real",
    "head",
    "hmm_hidden_state_prob",
    "hmm_marginal",
    "hypot",
    "identity_matrix",
    "inc_beta",
    "integrate_1d",
    "integrate_ode",
    "integrate_ode_adams",
    "integrate_ode_bdf",
    "integrate_ode_rk45",
    "int_step",
    "inv",
    "inv_cloglog",
    "inv_erfc",
    "inverse",
    "inverse_spd",
    "inv_fft",
    "inv_fft2",
    "inv_inc_beta",
    "inv_logit",
    "inv_Phi",
    "inv_sqrt",
    "inv_square",
    "is_inf",
    "is_nan",
    "lambert_w0",
    "lambert_wm1",
    "lbeta",
    "lchoose",
    "ldexp",
    "lgamma",
    "linspaced_array",
    "linspaced_int_array",
    "linspaced_row_vector",
    "linspaced_vector",
    "lmgamma",
    "lmultiply",
    "log",
    "log1m",
    "log1m_exp",
    "log1m_inv_logit",
    "log1p",
    "log1p_exp",
    "log_determinant",
    "log_diff_exp",
    "log_falling_factorial",
    "log_inv_logit",
    "log_inv_logit_diff",
    "logit",
    "log_mix",
    "log_modified_bessel_first_kind",
    "log_rising_factorial",
    "log_softmax",
    "log_sum_exp",
    "machine_precision",
    "map_rect",
    "matrix_exp",
    "matrix_exp_multiply",
    "matrix_power",
    "max",
    "mdivide_left_spd",
    "mdivide_left_tri_low",
    "mdivide_right_spd",
    "mdivide_right_tri_low",
    "mean",
    "min",
    "modified_bessel_first_kind",
    "modified_bessel_second_kind",
    "multiply_lower_tri_self_transpose",
    "negative_infinity",
    "norm",
    "norm1",
    "norm2",
    "not_a_number",
    "num_elements",
    "ode_adams",
    "ode_adams_tol",
    "ode_adjoint_tol_ctl",
    "ode_bdf",
    "ode_bdf_tol",
    "ode_ckrk",
    "ode_ckrk_tol",
    "ode_rk45",
    "ode_rk45_tol",
    "one_hot_array",
    "one_hot_int_array",
    "one_hot_row_vector",
    "one_hot_vector",
    "ones_array",
    "ones_int_array",
    "ones_row_vector",
    "ones_vector",
    "owens_t",
    "Phi",
    "Phi_approx",
    "polar",
    "positive_infinity",
    "pow",
    "print",
    "prod",
    "proj",
    "qr",
    "qr_Q",
    "qr_R",
    "qr_thin",
    "qr_thin_Q",
    "qr_thin_R",
    "quad_form",
    "quad_form_diag",
    "quad_form_sym",
    "quantile",
    "rank",
    "reduce_sum",
    "reject",
    "rep_array",
    "rep_matrix",
    "rep_row_vector",
    "rep_vector",
    "reverse",
    "rising_factorial",
    "round",
    "row",
    "rows",
    "rows_dot_product",
    "rows_dot_self",
    "scale_matrix_exp_multiply",
    "sd",
    "segment",
    "sin",
    "singular_values",
    "sinh",
    "size",
    "softmax",
    "sort_asc",
    "sort_desc",
    "sort_indices_asc",
    "sort_indices_desc",
    "sqrt",
    "square",
    "squared_distance",
    "step",
    "sub_col",
    "sub_row",
    "sum",
    "svd",
    "svd_U",
    "svd_V",
    "symmetrize_from_lower_tri",
    "tail",
    "tan",
    "tanh",
    "target",
    "tcrossprod",
    "tgamma",
    "to_array_1d",
    "to_array_2d",
    "to_complex",
    "to_int",
    "to_matrix",
    "to_row_vector",
    "to_vector",
    "trace",
    "trace_gen_quad_form",
    "trace_quad_form",
    "trigamma",
    "trunc",
    "uniform_simplex",
    "variance",
    "zeros_array",
    "zeros_int_array",
    "zeros_row_vector"
  ], a = [
    "bernoulli",
    "bernoulli_logit",
    "bernoulli_logit_glm",
    "beta",
    "beta_binomial",
    "beta_proportion",
    "binomial",
    "binomial_logit",
    "categorical",
    "categorical_logit",
    "categorical_logit_glm",
    "cauchy",
    "chi_square",
    "dirichlet",
    "discrete_range",
    "double_exponential",
    "exp_mod_normal",
    "exponential",
    "frechet",
    "gamma",
    "gaussian_dlm_obs",
    "gumbel",
    "hmm_latent",
    "hypergeometric",
    "inv_chi_square",
    "inv_gamma",
    "inv_wishart",
    "inv_wishart_cholesky",
    "lkj_corr",
    "lkj_corr_cholesky",
    "logistic",
    "loglogistic",
    "lognormal",
    "multi_gp",
    "multi_gp_cholesky",
    "multinomial",
    "multinomial_logit",
    "multi_normal",
    "multi_normal_cholesky",
    "multi_normal_prec",
    "multi_student_cholesky_t",
    "multi_student_t",
    "multi_student_t_cholesky",
    "neg_binomial",
    "neg_binomial_2",
    "neg_binomial_2_log",
    "neg_binomial_2_log_glm",
    "normal",
    "normal_id_glm",
    "ordered_logistic",
    "ordered_logistic_glm",
    "ordered_probit",
    "pareto",
    "pareto_type_2",
    "poisson",
    "poisson_log",
    "poisson_log_glm",
    "rayleigh",
    "scaled_inv_chi_square",
    "skew_double_exponential",
    "skew_normal",
    "std_normal",
    "std_normal_log",
    "student_t",
    "uniform",
    "von_mises",
    "weibull",
    "wiener",
    "wishart",
    "wishart_cholesky"
  ], s = t.COMMENT(
    /\/\*/,
    /\*\//,
    {
      relevance: 0,
      contains: [
        {
          scope: "doctag",
          match: /@(return|param)/
        }
      ]
    }
  ), l = {
    scope: "meta",
    begin: /#include\b/,
    end: /$/,
    contains: [
      {
        match: /[a-z][a-z-._]+/,
        scope: "string"
      },
      t.C_LINE_COMMENT_MODE
    ]
  }, c = [
    "lower",
    "upper",
    "offset",
    "multiplier"
  ];
  return {
    name: "Stan",
    aliases: ["stanfuncs"],
    keywords: {
      $pattern: t.IDENT_RE,
      title: n,
      type: i,
      keyword: r,
      built_in: o
    },
    contains: [
      t.C_LINE_COMMENT_MODE,
      l,
      t.HASH_COMMENT_MODE,
      s,
      {
        scope: "built_in",
        match: /\s(pi|e|sqrt2|log2|log10)(?=\()/,
        relevance: 0
      },
      {
        match: e.concat(/[<,]\s*/, e.either(...c), /\s*=/),
        keywords: c
      },
      {
        scope: "keyword",
        match: /\btarget(?=\s*\+=)/
      },
      {
        // highlights the 'T' in T[,] for only Stan language distributrions
        match: [
          /~\s*/,
          e.either(...a),
          /(?:\(\))/,
          /\s*T(?=\s*\[)/
        ],
        scope: {
          2: "built_in",
          4: "keyword"
        }
      },
      {
        // highlights distributions that end with special endings
        scope: "built_in",
        keywords: a,
        begin: e.concat(/\w*/, e.either(...a), /(_lpdf|_lupdf|_lpmf|_cdf|_lcdf|_lccdf|_qf)(?=\s*[\(.*\)])/)
      },
      {
        // highlights distributions after ~
        begin: [
          /~/,
          /\s*/,
          e.concat(e.either(...a), /(?=\s*[\(.*\)])/)
        ],
        scope: { 3: "built_in" }
      },
      {
        // highlights user defined distributions after ~
        begin: [
          /~/,
          /\s*\w+(?=\s*[\(.*\)])/,
          "(?!.*/\b(" + e.either(...a) + ")\b)"
        ],
        scope: { 2: "title.function" }
      },
      {
        // highlights user defined distributions with special endings
        scope: "title.function",
        begin: /\w*(_lpdf|_lupdf|_lpmf|_cdf|_lcdf|_lccdf|_qf)(?=\s*[\(.*\)])/
      },
      {
        scope: "number",
        match: e.concat(
          // Comes from @RunDevelopment accessed 11/29/2021 at
          // https://github.com/PrismJS/prism/blob/c53ad2e65b7193ab4f03a1797506a54bbb33d5a2/components/prism-stan.js#L56
          // start of big noncapture group which
          // 1. gets numbers that are by themselves
          // 2. numbers that are separated by _
          // 3. numbers that are separted by .
          /(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)/,
          // grabs scientific notation
          // grabs complex numbers with i
          /(?:[eE][+-]?\d+(?:_\d+)*)?i?(?!\w)/
        ),
        relevance: 0
      },
      {
        scope: "string",
        begin: /"/,
        end: /"/
      }
    ]
  };
}
function tw(t) {
  return {
    name: "Stata",
    aliases: [
      "do",
      "ado"
    ],
    case_insensitive: !0,
    keywords: "if else in foreach for forv forva forval forvalu forvalue forvalues by bys bysort xi quietly qui capture about ac ac_7 acprplot acprplot_7 adjust ado adopath adoupdate alpha ameans an ano anov anova anova_estat anova_terms anovadef aorder ap app appe appen append arch arch_dr arch_estat arch_p archlm areg areg_p args arima arima_dr arima_estat arima_p as asmprobit asmprobit_estat asmprobit_lf asmprobit_mfx__dlg asmprobit_p ass asse asser assert avplot avplot_7 avplots avplots_7 bcskew0 bgodfrey bias binreg bip0_lf biplot bipp_lf bipr_lf bipr_p biprobit bitest bitesti bitowt blogit bmemsize boot bootsamp bootstrap bootstrap_8 boxco_l boxco_p boxcox boxcox_6 boxcox_p bprobit br break brier bro brow brows browse brr brrstat bs bs_7 bsampl_w bsample bsample_7 bsqreg bstat bstat_7 bstat_8 bstrap bstrap_7 bubble bubbleplot ca ca_estat ca_p cabiplot camat canon canon_8 canon_8_p canon_estat canon_p cap caprojection capt captu captur capture cat cc cchart cchart_7 cci cd censobs_table centile cf char chdir checkdlgfiles checkestimationsample checkhlpfiles checksum chelp ci cii cl class classutil clear cli clis clist clo clog clog_lf clog_p clogi clogi_sw clogit clogit_lf clogit_p clogitp clogl_sw cloglog clonevar clslistarray cluster cluster_measures cluster_stop cluster_tree cluster_tree_8 clustermat cmdlog cnr cnre cnreg cnreg_p cnreg_sw cnsreg codebook collaps4 collapse colormult_nb colormult_nw compare compress conf confi confir confirm conren cons const constr constra constrai constrain constraint continue contract copy copyright copysource cor corc corr corr2data corr_anti corr_kmo corr_smc corre correl correla correlat correlate corrgram cou coun count cox cox_p cox_sw coxbase coxhaz coxvar cprplot cprplot_7 crc cret cretu cretur creturn cross cs cscript cscript_log csi ct ct_is ctset ctst_5 ctst_st cttost cumsp cumsp_7 cumul cusum cusum_7 cutil d|0 datasig datasign datasigna datasignat datasignatu datasignatur datasignature datetof db dbeta de dec deco decod decode deff des desc descr descri describ describe destring dfbeta dfgls dfuller di di_g dir dirstats dis discard disp disp_res disp_s displ displa display distinct do doe doed doedi doedit dotplot dotplot_7 dprobit drawnorm drop ds ds_util dstdize duplicates durbina dwstat dydx e|0 ed edi edit egen eivreg emdef en enc enco encod encode eq erase ereg ereg_lf ereg_p ereg_sw ereghet ereghet_glf ereghet_glf_sh ereghet_gp ereghet_ilf ereghet_ilf_sh ereghet_ip eret eretu eretur ereturn err erro error esize est est_cfexist est_cfname est_clickable est_expand est_hold est_table est_unhold est_unholdok estat estat_default estat_summ estat_vce_only esti estimates etodow etof etomdy ex exi exit expand expandcl fac fact facto factor factor_estat factor_p factor_pca_rotated factor_rotate factormat fcast fcast_compute fcast_graph fdades fdadesc fdadescr fdadescri fdadescrib fdadescribe fdasav fdasave fdause fh_st file open file read file close file filefilter fillin find_hlp_file findfile findit findit_7 fit fl fli flis flist for5_0 forest forestplot form forma format fpredict frac_154 frac_adj frac_chk frac_cox frac_ddp frac_dis frac_dv frac_in frac_mun frac_pp frac_pq frac_pv frac_wgt frac_xo fracgen fracplot fracplot_7 fracpoly fracpred fron_ex fron_hn fron_p fron_tn fron_tn2 frontier ftodate ftoe ftomdy ftowdate funnel funnelplot g|0 gamhet_glf gamhet_gp gamhet_ilf gamhet_ip gamma gamma_d2 gamma_p gamma_sw gammahet gdi_hexagon gdi_spokes ge gen gene gener genera generat generate genrank genstd genvmean gettoken gl gladder gladder_7 glim_l01 glim_l02 glim_l03 glim_l04 glim_l05 glim_l06 glim_l07 glim_l08 glim_l09 glim_l10 glim_l11 glim_l12 glim_lf glim_mu glim_nw1 glim_nw2 glim_nw3 glim_p glim_v1 glim_v2 glim_v3 glim_v4 glim_v5 glim_v6 glim_v7 glm glm_6 glm_p glm_sw glmpred glo glob globa global glogit glogit_8 glogit_p gmeans gnbre_lf gnbreg gnbreg_5 gnbreg_p gomp_lf gompe_sw gomper_p gompertz gompertzhet gomphet_glf gomphet_glf_sh gomphet_gp gomphet_ilf gomphet_ilf_sh gomphet_ip gphdot gphpen gphprint gprefs gprobi_p gprobit gprobit_8 gr gr7 gr_copy gr_current gr_db gr_describe gr_dir gr_draw gr_draw_replay gr_drop gr_edit gr_editviewopts gr_example gr_example2 gr_export gr_print gr_qscheme gr_query gr_read gr_rename gr_replay gr_save gr_set gr_setscheme gr_table gr_undo gr_use graph graph7 grebar greigen greigen_7 greigen_8 grmeanby grmeanby_7 gs_fileinfo gs_filetype gs_graphinfo gs_stat gsort gwood h|0 hadimvo hareg hausman haver he heck_d2 heckma_p heckman heckp_lf heckpr_p heckprob hel help hereg hetpr_lf hetpr_p hetprob hettest hexdump hilite hist hist_7 histogram hlogit hlu hmeans hotel hotelling hprobit hreg hsearch icd9 icd9_ff icd9p iis impute imtest inbase include inf infi infil infile infix inp inpu input ins insheet insp inspe inspec inspect integ inten intreg intreg_7 intreg_p intrg2_ll intrg_ll intrg_ll2 ipolate iqreg ir irf irf_create irfm iri is_svy is_svysum isid istdize ivprob_1_lf ivprob_lf ivprobit ivprobit_p ivreg ivreg_footnote ivtob_1_lf ivtob_lf ivtobit ivtobit_p jackknife jacknife jknife jknife_6 jknife_8 jkstat joinby kalarma1 kap kap_3 kapmeier kappa kapwgt kdensity kdensity_7 keep ksm ksmirnov ktau kwallis l|0 la lab labbe labbeplot labe label labelbook ladder levels levelsof leverage lfit lfit_p li lincom line linktest lis list lloghet_glf lloghet_glf_sh lloghet_gp lloghet_ilf lloghet_ilf_sh lloghet_ip llogi_sw llogis_p llogist llogistic llogistichet lnorm_lf lnorm_sw lnorma_p lnormal lnormalhet lnormhet_glf lnormhet_glf_sh lnormhet_gp lnormhet_ilf lnormhet_ilf_sh lnormhet_ip lnskew0 loadingplot loc loca local log logi logis_lf logistic logistic_p logit logit_estat logit_p loglogs logrank loneway lookfor lookup lowess lowess_7 lpredict lrecomp lroc lroc_7 lrtest ls lsens lsens_7 lsens_x lstat ltable ltable_7 ltriang lv lvr2plot lvr2plot_7 m|0 ma mac macr macro makecns man manova manova_estat manova_p manovatest mantel mark markin markout marksample mat mat_capp mat_order mat_put_rr mat_rapp mata mata_clear mata_describe mata_drop mata_matdescribe mata_matsave mata_matuse mata_memory mata_mlib mata_mosave mata_rename mata_which matalabel matcproc matlist matname matr matri matrix matrix_input__dlg matstrik mcc mcci md0_ md1_ md1debug_ md2_ md2debug_ mds mds_estat mds_p mdsconfig mdslong mdsmat mdsshepard mdytoe mdytof me_derd mean means median memory memsize menl meqparse mer merg merge meta mfp mfx mhelp mhodds minbound mixed_ll mixed_ll_reparm mkassert mkdir mkmat mkspline ml ml_5 ml_adjs ml_bhhhs ml_c_d ml_check ml_clear ml_cnt ml_debug ml_defd ml_e0 ml_e0_bfgs ml_e0_cycle ml_e0_dfp ml_e0i ml_e1 ml_e1_bfgs ml_e1_bhhh ml_e1_cycle ml_e1_dfp ml_e2 ml_e2_cycle ml_ebfg0 ml_ebfr0 ml_ebfr1 ml_ebh0q ml_ebhh0 ml_ebhr0 ml_ebr0i ml_ecr0i ml_edfp0 ml_edfr0 ml_edfr1 ml_edr0i ml_eds ml_eer0i ml_egr0i ml_elf ml_elf_bfgs ml_elf_bhhh ml_elf_cycle ml_elf_dfp ml_elfi ml_elfs ml_enr0i ml_enrr0 ml_erdu0 ml_erdu0_bfgs ml_erdu0_bhhh ml_erdu0_bhhhq ml_erdu0_cycle ml_erdu0_dfp ml_erdu0_nrbfgs ml_exde ml_footnote ml_geqnr ml_grad0 ml_graph ml_hbhhh ml_hd0 ml_hold ml_init ml_inv ml_log ml_max ml_mlout ml_mlout_8 ml_model ml_nb0 ml_opt ml_p ml_plot ml_query ml_rdgrd ml_repor ml_s_e ml_score ml_searc ml_technique ml_unhold mleval mlf_ mlmatbysum mlmatsum mlog mlogi mlogit mlogit_footnote mlogit_p mlopts mlsum mlvecsum mnl0_ mor more mov move mprobit mprobit_lf mprobit_p mrdu0_ mrdu1_ mvdecode mvencode mvreg mvreg_estat n|0 nbreg nbreg_al nbreg_lf nbreg_p nbreg_sw nestreg net newey newey_7 newey_p news nl nl_7 nl_9 nl_9_p nl_p nl_p_7 nlcom nlcom_p nlexp2 nlexp2_7 nlexp2a nlexp2a_7 nlexp3 nlexp3_7 nlgom3 nlgom3_7 nlgom4 nlgom4_7 nlinit nllog3 nllog3_7 nllog4 nllog4_7 nlog_rd nlogit nlogit_p nlogitgen nlogittree nlpred no nobreak noi nois noisi noisil noisily note notes notes_dlg nptrend numlabel numlist odbc old_ver olo olog ologi ologi_sw ologit ologit_p ologitp on one onew onewa oneway op_colnm op_comp op_diff op_inv op_str opr opro oprob oprob_sw oprobi oprobi_p oprobit oprobitp opts_exclusive order orthog orthpoly ou out outf outfi outfil outfile outs outsh outshe outshee outsheet ovtest pac pac_7 palette parse parse_dissim pause pca pca_8 pca_display pca_estat pca_p pca_rotate pcamat pchart pchart_7 pchi pchi_7 pcorr pctile pentium pergram pergram_7 permute permute_8 personal peto_st pkcollapse pkcross pkequiv pkexamine pkexamine_7 pkshape pksumm pksumm_7 pl plo plot plugin pnorm pnorm_7 poisgof poiss_lf poiss_sw poisso_p poisson poisson_estat post postclose postfile postutil pperron pr prais prais_e prais_e2 prais_p predict predictnl preserve print pro prob probi probit probit_estat probit_p proc_time procoverlay procrustes procrustes_estat procrustes_p profiler prog progr progra program prop proportion prtest prtesti pwcorr pwd q\\s qby qbys qchi qchi_7 qladder qladder_7 qnorm qnorm_7 qqplot qqplot_7 qreg qreg_c qreg_p qreg_sw qu quadchk quantile quantile_7 que quer query range ranksum ratio rchart rchart_7 rcof recast reclink recode reg reg3 reg3_p regdw regr regre regre_p2 regres regres_p regress regress_estat regriv_p remap ren rena renam rename renpfix repeat replace report reshape restore ret retu retur return rm rmdir robvar roccomp roccomp_7 roccomp_8 rocf_lf rocfit rocfit_8 rocgold rocplot rocplot_7 roctab roctab_7 rolling rologit rologit_p rot rota rotat rotate rotatemat rreg rreg_p ru run runtest rvfplot rvfplot_7 rvpplot rvpplot_7 sa safesum sample sampsi sav save savedresults saveold sc sca scal scala scalar scatter scm_mine sco scob_lf scob_p scobi_sw scobit scor score scoreplot scoreplot_help scree screeplot screeplot_help sdtest sdtesti se search separate seperate serrbar serrbar_7 serset set set_defaults sfrancia sh she shel shell shewhart shewhart_7 signestimationsample signrank signtest simul simul_7 simulate simulate_8 sktest sleep slogit slogit_d2 slogit_p smooth snapspan so sor sort spearman spikeplot spikeplot_7 spikeplt spline_x split sqreg sqreg_p sret sretu sretur sreturn ssc st st_ct st_hc st_hcd st_hcd_sh st_is st_issys st_note st_promo st_set st_show st_smpl st_subid stack statsby statsby_8 stbase stci stci_7 stcox stcox_estat stcox_fr stcox_fr_ll stcox_p stcox_sw stcoxkm stcoxkm_7 stcstat stcurv stcurve stcurve_7 stdes stem stepwise stereg stfill stgen stir stjoin stmc stmh stphplot stphplot_7 stphtest stphtest_7 stptime strate strate_7 streg streg_sw streset sts sts_7 stset stsplit stsum sttocc sttoct stvary stweib su suest suest_8 sum summ summa summar summari summariz summarize sunflower sureg survcurv survsum svar svar_p svmat svy svy_disp svy_dreg svy_est svy_est_7 svy_estat svy_get svy_gnbreg_p svy_head svy_header svy_heckman_p svy_heckprob_p svy_intreg_p svy_ivreg_p svy_logistic_p svy_logit_p svy_mlogit_p svy_nbreg_p svy_ologit_p svy_oprobit_p svy_poisson_p svy_probit_p svy_regress_p svy_sub svy_sub_7 svy_x svy_x_7 svy_x_p svydes svydes_8 svygen svygnbreg svyheckman svyheckprob svyintreg svyintreg_7 svyintrg svyivreg svylc svylog_p svylogit svymarkout svymarkout_8 svymean svymlog svymlogit svynbreg svyolog svyologit svyoprob svyoprobit svyopts svypois svypois_7 svypoisson svyprobit svyprobt svyprop svyprop_7 svyratio svyreg svyreg_p svyregress svyset svyset_7 svyset_8 svytab svytab_7 svytest svytotal sw sw_8 swcnreg swcox swereg swilk swlogis swlogit swologit swoprbt swpois swprobit swqreg swtobit swweib symmetry symmi symplot symplot_7 syntax sysdescribe sysdir sysuse szroeter ta tab tab1 tab2 tab_or tabd tabdi tabdis tabdisp tabi table tabodds tabodds_7 tabstat tabu tabul tabula tabulat tabulate te tempfile tempname tempvar tes test testnl testparm teststd tetrachoric time_it timer tis tob tobi tobit tobit_p tobit_sw token tokeni tokeniz tokenize tostring total translate translator transmap treat_ll treatr_p treatreg trim trimfill trnb_cons trnb_mean trpoiss_d2 trunc_ll truncr_p truncreg tsappend tset tsfill tsline tsline_ex tsreport tsrevar tsrline tsset tssmooth tsunab ttest ttesti tut_chk tut_wait tutorial tw tware_st two twoway twoway__fpfit_serset twoway__function_gen twoway__histogram_gen twoway__ipoint_serset twoway__ipoints_serset twoway__kdensity_gen twoway__lfit_serset twoway__normgen_gen twoway__pci_serset twoway__qfit_serset twoway__scatteri_serset twoway__sunflower_gen twoway_ksm_serset ty typ type typeof u|0 unab unabbrev unabcmd update us use uselabel var var_mkcompanion var_p varbasic varfcast vargranger varirf varirf_add varirf_cgraph varirf_create varirf_ctable varirf_describe varirf_dir varirf_drop varirf_erase varirf_graph varirf_ograph varirf_rename varirf_set varirf_table varlist varlmar varnorm varsoc varstable varstable_w varstable_w2 varwle vce vec vec_fevd vec_mkphi vec_p vec_p_w vecirf_create veclmar veclmar_w vecnorm vecnorm_w vecrank vecstable verinst vers versi versio version view viewsource vif vwls wdatetof webdescribe webseek webuse weib1_lf weib2_lf weib_lf weib_lf0 weibhet_glf weibhet_glf_sh weibhet_glfa weibhet_glfa_sh weibhet_gp weibhet_ilf weibhet_ilf_sh weibhet_ilfa weibhet_ilfa_sh weibhet_ip weibu_sw weibul_p weibull weibull_c weibull_s weibullhet wh whelp whi which whil while wilc_st wilcoxon win wind windo window winexec wntestb wntestb_7 wntestq xchart xchart_7 xcorr xcorr_7 xi xi_6 xmlsav xmlsave xmluse xpose xsh xshe xshel xshell xt_iis xt_tis xtab_p xtabond xtbin_p xtclog xtcloglog xtcloglog_8 xtcloglog_d2 xtcloglog_pa_p xtcloglog_re_p xtcnt_p xtcorr xtdata xtdes xtfront_p xtfrontier xtgee xtgee_elink xtgee_estat xtgee_makeivar xtgee_p xtgee_plink xtgls xtgls_p xthaus xthausman xtht_p xthtaylor xtile xtint_p xtintreg xtintreg_8 xtintreg_d2 xtintreg_p xtivp_1 xtivp_2 xtivreg xtline xtline_ex xtlogit xtlogit_8 xtlogit_d2 xtlogit_fe_p xtlogit_pa_p xtlogit_re_p xtmixed xtmixed_estat xtmixed_p xtnb_fe xtnb_lf xtnbreg xtnbreg_pa_p xtnbreg_refe_p xtpcse xtpcse_p xtpois xtpoisson xtpoisson_d2 xtpoisson_pa_p xtpoisson_refe_p xtpred xtprobit xtprobit_8 xtprobit_d2 xtprobit_re_p xtps_fe xtps_lf xtps_ren xtps_ren_8 xtrar_p xtrc xtrc_p xtrchh xtrefe_p xtreg xtreg_be xtreg_fe xtreg_ml xtreg_pa_p xtreg_re xtregar xtrere_p xtset xtsf_ll xtsf_llti xtsum xttab xttest0 xttobit xttobit_8 xttobit_p xttrans yx yxview__barlike_draw yxview_area_draw yxview_bar_draw yxview_dot_draw yxview_dropline_draw yxview_function_draw yxview_iarrow_draw yxview_ilabels_draw yxview_normal_draw yxview_pcarrow_draw yxview_pcbarrow_draw yxview_pccapsym_draw yxview_pcscatter_draw yxview_pcspike_draw yxview_rarea_draw yxview_rbar_draw yxview_rbarm_draw yxview_rcap_draw yxview_rcapsym_draw yxview_rconnected_draw yxview_rline_draw yxview_rscatter_draw yxview_rspike_draw yxview_spike_draw yxview_sunflower_draw zap_s zinb zinb_llf zinb_plf zip zip_llf zip_p zip_plf zt_ct_5 zt_hc_5 zt_hcd_5 zt_is_5 zt_iss_5 zt_sho_5 zt_smp_5 ztbase_5 ztcox_5 ztdes_5 ztereg_5 ztfill_5 ztgen_5 ztir_5 ztjoin_5 ztnb ztnb_p ztp ztp_p zts_5 ztset_5 ztspli_5 ztsum_5 zttoct_5 ztvary_5 ztweib_5",
    contains: [
      {
        className: "symbol",
        begin: /`[a-zA-Z0-9_]+'/
      },
      {
        className: "variable",
        begin: /\$\{?[a-zA-Z0-9_]+\}?/,
        relevance: 0
      },
      {
        className: "string",
        variants: [
          { begin: `\`"[^\r
]*?"'` },
          { begin: `"[^\r
"]*"` }
        ]
      },
      {
        className: "built_in",
        variants: [{ begin: "\\b(abs|acos|asin|atan|atan2|atanh|ceil|cloglog|comb|cos|digamma|exp|floor|invcloglog|invlogit|ln|lnfact|lnfactorial|lngamma|log|log10|max|min|mod|reldif|round|sign|sin|sqrt|sum|tan|tanh|trigamma|trunc|betaden|Binomial|binorm|binormal|chi2|chi2tail|dgammapda|dgammapdada|dgammapdadx|dgammapdx|dgammapdxdx|F|Fden|Ftail|gammaden|gammap|ibeta|invbinomial|invchi2|invchi2tail|invF|invFtail|invgammap|invibeta|invnchi2|invnFtail|invnibeta|invnorm|invnormal|invttail|nbetaden|nchi2|nFden|nFtail|nibeta|norm|normal|normalden|normd|npnchi2|tden|ttail|uniform|abbrev|char|index|indexnot|length|lower|ltrim|match|plural|proper|real|regexm|regexr|regexs|reverse|rtrim|string|strlen|strlower|strltrim|strmatch|strofreal|strpos|strproper|strreverse|strrtrim|strtrim|strupper|subinstr|subinword|substr|trim|upper|word|wordcount|_caller|autocode|byteorder|chop|clip|cond|e|epsdouble|epsfloat|group|inlist|inrange|irecode|matrix|maxbyte|maxdouble|maxfloat|maxint|maxlong|mi|minbyte|mindouble|minfloat|minint|minlong|missing|r|recode|replay|return|s|scalar|d|date|day|dow|doy|halfyear|mdy|month|quarter|week|year|d|daily|dofd|dofh|dofm|dofq|dofw|dofy|h|halfyearly|hofd|m|mofd|monthly|q|qofd|quarterly|tin|twithin|w|weekly|wofd|y|yearly|yh|ym|yofd|yq|yw|cholesky|colnumb|colsof|corr|det|diag|diag0cnt|el|get|hadamard|I|inv|invsym|issym|issymmetric|J|matmissing|matuniform|mreldif|nullmat|rownumb|rowsof|sweep|syminv|trace|vec|vecdiag)(?=\\()" }]
      },
      t.COMMENT("^[ 	]*\\*.*$", !1),
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE
    ]
  };
}
function nw(t) {
  return {
    name: "STEP Part 21",
    aliases: [
      "p21",
      "step",
      "stp"
    ],
    case_insensitive: !0,
    // STEP 21 is case insensitive in theory, in practice all non-comments are capitalized.
    keywords: {
      $pattern: "[A-Z_][A-Z0-9_.]*",
      keyword: [
        "HEADER",
        "ENDSEC",
        "DATA"
      ]
    },
    contains: [
      {
        className: "meta",
        begin: "ISO-10303-21;",
        relevance: 10
      },
      {
        className: "meta",
        begin: "END-ISO-10303-21;",
        relevance: 10
      },
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.COMMENT("/\\*\\*!", "\\*/"),
      t.C_NUMBER_MODE,
      t.inherit(t.APOS_STRING_MODE, { illegal: null }),
      t.inherit(t.QUOTE_STRING_MODE, { illegal: null }),
      {
        className: "string",
        begin: "'",
        end: "'"
      },
      {
        className: "symbol",
        variants: [
          {
            begin: "#",
            end: "\\d+",
            illegal: "\\W"
          }
        ]
      }
    ]
  };
}
const rw = (t) => ({
  IMPORTANT: {
    scope: "meta",
    begin: "!important"
  },
  BLOCK_COMMENT: t.C_BLOCK_COMMENT_MODE,
  HEXCOLOR: {
    scope: "number",
    begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
  },
  FUNCTION_DISPATCH: {
    className: "built_in",
    begin: /[\w-]+(?=\()/
  },
  ATTRIBUTE_SELECTOR_MODE: {
    scope: "selector-attr",
    begin: /\[/,
    end: /\]/,
    illegal: "$",
    contains: [
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE
    ]
  },
  CSS_NUMBER_MODE: {
    scope: "number",
    begin: t.NUMBER_RE + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
    relevance: 0
  },
  CSS_VARIABLE: {
    className: "attr",
    begin: /--[A-Za-z_][A-Za-z0-9_-]*/
  }
}), iw = [
  "a",
  "abbr",
  "address",
  "article",
  "aside",
  "audio",
  "b",
  "blockquote",
  "body",
  "button",
  "canvas",
  "caption",
  "cite",
  "code",
  "dd",
  "del",
  "details",
  "dfn",
  "div",
  "dl",
  "dt",
  "em",
  "fieldset",
  "figcaption",
  "figure",
  "footer",
  "form",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "header",
  "hgroup",
  "html",
  "i",
  "iframe",
  "img",
  "input",
  "ins",
  "kbd",
  "label",
  "legend",
  "li",
  "main",
  "mark",
  "menu",
  "nav",
  "object",
  "ol",
  "optgroup",
  "option",
  "p",
  "picture",
  "q",
  "quote",
  "samp",
  "section",
  "select",
  "source",
  "span",
  "strong",
  "summary",
  "sup",
  "table",
  "tbody",
  "td",
  "textarea",
  "tfoot",
  "th",
  "thead",
  "time",
  "tr",
  "ul",
  "var",
  "video"
], ow = [
  "defs",
  "g",
  "marker",
  "mask",
  "pattern",
  "svg",
  "switch",
  "symbol",
  "feBlend",
  "feColorMatrix",
  "feComponentTransfer",
  "feComposite",
  "feConvolveMatrix",
  "feDiffuseLighting",
  "feDisplacementMap",
  "feFlood",
  "feGaussianBlur",
  "feImage",
  "feMerge",
  "feMorphology",
  "feOffset",
  "feSpecularLighting",
  "feTile",
  "feTurbulence",
  "linearGradient",
  "radialGradient",
  "stop",
  "circle",
  "ellipse",
  "image",
  "line",
  "path",
  "polygon",
  "polyline",
  "rect",
  "text",
  "use",
  "textPath",
  "tspan",
  "foreignObject",
  "clipPath"
], aw = [
  ...iw,
  ...ow
], sw = [
  "any-hover",
  "any-pointer",
  "aspect-ratio",
  "color",
  "color-gamut",
  "color-index",
  "device-aspect-ratio",
  "device-height",
  "device-width",
  "display-mode",
  "forced-colors",
  "grid",
  "height",
  "hover",
  "inverted-colors",
  "monochrome",
  "orientation",
  "overflow-block",
  "overflow-inline",
  "pointer",
  "prefers-color-scheme",
  "prefers-contrast",
  "prefers-reduced-motion",
  "prefers-reduced-transparency",
  "resolution",
  "scan",
  "scripting",
  "update",
  "width",
  // TODO: find a better solution?
  "min-width",
  "max-width",
  "min-height",
  "max-height"
].sort().reverse(), lw = [
  "active",
  "any-link",
  "blank",
  "checked",
  "current",
  "default",
  "defined",
  "dir",
  // dir()
  "disabled",
  "drop",
  "empty",
  "enabled",
  "first",
  "first-child",
  "first-of-type",
  "fullscreen",
  "future",
  "focus",
  "focus-visible",
  "focus-within",
  "has",
  // has()
  "host",
  // host or host()
  "host-context",
  // host-context()
  "hover",
  "indeterminate",
  "in-range",
  "invalid",
  "is",
  // is()
  "lang",
  // lang()
  "last-child",
  "last-of-type",
  "left",
  "link",
  "local-link",
  "not",
  // not()
  "nth-child",
  // nth-child()
  "nth-col",
  // nth-col()
  "nth-last-child",
  // nth-last-child()
  "nth-last-col",
  // nth-last-col()
  "nth-last-of-type",
  //nth-last-of-type()
  "nth-of-type",
  //nth-of-type()
  "only-child",
  "only-of-type",
  "optional",
  "out-of-range",
  "past",
  "placeholder-shown",
  "read-only",
  "read-write",
  "required",
  "right",
  "root",
  "scope",
  "target",
  "target-within",
  "user-invalid",
  "valid",
  "visited",
  "where"
  // where()
].sort().reverse(), cw = [
  "after",
  "backdrop",
  "before",
  "cue",
  "cue-region",
  "first-letter",
  "first-line",
  "grammar-error",
  "marker",
  "part",
  "placeholder",
  "selection",
  "slotted",
  "spelling-error"
].sort().reverse(), uw = [
  "accent-color",
  "align-content",
  "align-items",
  "align-self",
  "alignment-baseline",
  "all",
  "anchor-name",
  "animation",
  "animation-composition",
  "animation-delay",
  "animation-direction",
  "animation-duration",
  "animation-fill-mode",
  "animation-iteration-count",
  "animation-name",
  "animation-play-state",
  "animation-range",
  "animation-range-end",
  "animation-range-start",
  "animation-timeline",
  "animation-timing-function",
  "appearance",
  "aspect-ratio",
  "backdrop-filter",
  "backface-visibility",
  "background",
  "background-attachment",
  "background-blend-mode",
  "background-clip",
  "background-color",
  "background-image",
  "background-origin",
  "background-position",
  "background-position-x",
  "background-position-y",
  "background-repeat",
  "background-size",
  "baseline-shift",
  "block-size",
  "border",
  "border-block",
  "border-block-color",
  "border-block-end",
  "border-block-end-color",
  "border-block-end-style",
  "border-block-end-width",
  "border-block-start",
  "border-block-start-color",
  "border-block-start-style",
  "border-block-start-width",
  "border-block-style",
  "border-block-width",
  "border-bottom",
  "border-bottom-color",
  "border-bottom-left-radius",
  "border-bottom-right-radius",
  "border-bottom-style",
  "border-bottom-width",
  "border-collapse",
  "border-color",
  "border-end-end-radius",
  "border-end-start-radius",
  "border-image",
  "border-image-outset",
  "border-image-repeat",
  "border-image-slice",
  "border-image-source",
  "border-image-width",
  "border-inline",
  "border-inline-color",
  "border-inline-end",
  "border-inline-end-color",
  "border-inline-end-style",
  "border-inline-end-width",
  "border-inline-start",
  "border-inline-start-color",
  "border-inline-start-style",
  "border-inline-start-width",
  "border-inline-style",
  "border-inline-width",
  "border-left",
  "border-left-color",
  "border-left-style",
  "border-left-width",
  "border-radius",
  "border-right",
  "border-right-color",
  "border-right-style",
  "border-right-width",
  "border-spacing",
  "border-start-end-radius",
  "border-start-start-radius",
  "border-style",
  "border-top",
  "border-top-color",
  "border-top-left-radius",
  "border-top-right-radius",
  "border-top-style",
  "border-top-width",
  "border-width",
  "bottom",
  "box-align",
  "box-decoration-break",
  "box-direction",
  "box-flex",
  "box-flex-group",
  "box-lines",
  "box-ordinal-group",
  "box-orient",
  "box-pack",
  "box-shadow",
  "box-sizing",
  "break-after",
  "break-before",
  "break-inside",
  "caption-side",
  "caret-color",
  "clear",
  "clip",
  "clip-path",
  "clip-rule",
  "color",
  "color-interpolation",
  "color-interpolation-filters",
  "color-profile",
  "color-rendering",
  "color-scheme",
  "column-count",
  "column-fill",
  "column-gap",
  "column-rule",
  "column-rule-color",
  "column-rule-style",
  "column-rule-width",
  "column-span",
  "column-width",
  "columns",
  "contain",
  "contain-intrinsic-block-size",
  "contain-intrinsic-height",
  "contain-intrinsic-inline-size",
  "contain-intrinsic-size",
  "contain-intrinsic-width",
  "container",
  "container-name",
  "container-type",
  "content",
  "content-visibility",
  "counter-increment",
  "counter-reset",
  "counter-set",
  "cue",
  "cue-after",
  "cue-before",
  "cursor",
  "cx",
  "cy",
  "direction",
  "display",
  "dominant-baseline",
  "empty-cells",
  "enable-background",
  "field-sizing",
  "fill",
  "fill-opacity",
  "fill-rule",
  "filter",
  "flex",
  "flex-basis",
  "flex-direction",
  "flex-flow",
  "flex-grow",
  "flex-shrink",
  "flex-wrap",
  "float",
  "flood-color",
  "flood-opacity",
  "flow",
  "font",
  "font-display",
  "font-family",
  "font-feature-settings",
  "font-kerning",
  "font-language-override",
  "font-optical-sizing",
  "font-palette",
  "font-size",
  "font-size-adjust",
  "font-smooth",
  "font-smoothing",
  "font-stretch",
  "font-style",
  "font-synthesis",
  "font-synthesis-position",
  "font-synthesis-small-caps",
  "font-synthesis-style",
  "font-synthesis-weight",
  "font-variant",
  "font-variant-alternates",
  "font-variant-caps",
  "font-variant-east-asian",
  "font-variant-emoji",
  "font-variant-ligatures",
  "font-variant-numeric",
  "font-variant-position",
  "font-variation-settings",
  "font-weight",
  "forced-color-adjust",
  "gap",
  "glyph-orientation-horizontal",
  "glyph-orientation-vertical",
  "grid",
  "grid-area",
  "grid-auto-columns",
  "grid-auto-flow",
  "grid-auto-rows",
  "grid-column",
  "grid-column-end",
  "grid-column-start",
  "grid-gap",
  "grid-row",
  "grid-row-end",
  "grid-row-start",
  "grid-template",
  "grid-template-areas",
  "grid-template-columns",
  "grid-template-rows",
  "hanging-punctuation",
  "height",
  "hyphenate-character",
  "hyphenate-limit-chars",
  "hyphens",
  "icon",
  "image-orientation",
  "image-rendering",
  "image-resolution",
  "ime-mode",
  "initial-letter",
  "initial-letter-align",
  "inline-size",
  "inset",
  "inset-area",
  "inset-block",
  "inset-block-end",
  "inset-block-start",
  "inset-inline",
  "inset-inline-end",
  "inset-inline-start",
  "isolation",
  "justify-content",
  "justify-items",
  "justify-self",
  "kerning",
  "left",
  "letter-spacing",
  "lighting-color",
  "line-break",
  "line-height",
  "line-height-step",
  "list-style",
  "list-style-image",
  "list-style-position",
  "list-style-type",
  "margin",
  "margin-block",
  "margin-block-end",
  "margin-block-start",
  "margin-bottom",
  "margin-inline",
  "margin-inline-end",
  "margin-inline-start",
  "margin-left",
  "margin-right",
  "margin-top",
  "margin-trim",
  "marker",
  "marker-end",
  "marker-mid",
  "marker-start",
  "marks",
  "mask",
  "mask-border",
  "mask-border-mode",
  "mask-border-outset",
  "mask-border-repeat",
  "mask-border-slice",
  "mask-border-source",
  "mask-border-width",
  "mask-clip",
  "mask-composite",
  "mask-image",
  "mask-mode",
  "mask-origin",
  "mask-position",
  "mask-repeat",
  "mask-size",
  "mask-type",
  "masonry-auto-flow",
  "math-depth",
  "math-shift",
  "math-style",
  "max-block-size",
  "max-height",
  "max-inline-size",
  "max-width",
  "min-block-size",
  "min-height",
  "min-inline-size",
  "min-width",
  "mix-blend-mode",
  "nav-down",
  "nav-index",
  "nav-left",
  "nav-right",
  "nav-up",
  "none",
  "normal",
  "object-fit",
  "object-position",
  "offset",
  "offset-anchor",
  "offset-distance",
  "offset-path",
  "offset-position",
  "offset-rotate",
  "opacity",
  "order",
  "orphans",
  "outline",
  "outline-color",
  "outline-offset",
  "outline-style",
  "outline-width",
  "overflow",
  "overflow-anchor",
  "overflow-block",
  "overflow-clip-margin",
  "overflow-inline",
  "overflow-wrap",
  "overflow-x",
  "overflow-y",
  "overlay",
  "overscroll-behavior",
  "overscroll-behavior-block",
  "overscroll-behavior-inline",
  "overscroll-behavior-x",
  "overscroll-behavior-y",
  "padding",
  "padding-block",
  "padding-block-end",
  "padding-block-start",
  "padding-bottom",
  "padding-inline",
  "padding-inline-end",
  "padding-inline-start",
  "padding-left",
  "padding-right",
  "padding-top",
  "page",
  "page-break-after",
  "page-break-before",
  "page-break-inside",
  "paint-order",
  "pause",
  "pause-after",
  "pause-before",
  "perspective",
  "perspective-origin",
  "place-content",
  "place-items",
  "place-self",
  "pointer-events",
  "position",
  "position-anchor",
  "position-visibility",
  "print-color-adjust",
  "quotes",
  "r",
  "resize",
  "rest",
  "rest-after",
  "rest-before",
  "right",
  "rotate",
  "row-gap",
  "ruby-align",
  "ruby-position",
  "scale",
  "scroll-behavior",
  "scroll-margin",
  "scroll-margin-block",
  "scroll-margin-block-end",
  "scroll-margin-block-start",
  "scroll-margin-bottom",
  "scroll-margin-inline",
  "scroll-margin-inline-end",
  "scroll-margin-inline-start",
  "scroll-margin-left",
  "scroll-margin-right",
  "scroll-margin-top",
  "scroll-padding",
  "scroll-padding-block",
  "scroll-padding-block-end",
  "scroll-padding-block-start",
  "scroll-padding-bottom",
  "scroll-padding-inline",
  "scroll-padding-inline-end",
  "scroll-padding-inline-start",
  "scroll-padding-left",
  "scroll-padding-right",
  "scroll-padding-top",
  "scroll-snap-align",
  "scroll-snap-stop",
  "scroll-snap-type",
  "scroll-timeline",
  "scroll-timeline-axis",
  "scroll-timeline-name",
  "scrollbar-color",
  "scrollbar-gutter",
  "scrollbar-width",
  "shape-image-threshold",
  "shape-margin",
  "shape-outside",
  "shape-rendering",
  "speak",
  "speak-as",
  "src",
  // @font-face
  "stop-color",
  "stop-opacity",
  "stroke",
  "stroke-dasharray",
  "stroke-dashoffset",
  "stroke-linecap",
  "stroke-linejoin",
  "stroke-miterlimit",
  "stroke-opacity",
  "stroke-width",
  "tab-size",
  "table-layout",
  "text-align",
  "text-align-all",
  "text-align-last",
  "text-anchor",
  "text-combine-upright",
  "text-decoration",
  "text-decoration-color",
  "text-decoration-line",
  "text-decoration-skip",
  "text-decoration-skip-ink",
  "text-decoration-style",
  "text-decoration-thickness",
  "text-emphasis",
  "text-emphasis-color",
  "text-emphasis-position",
  "text-emphasis-style",
  "text-indent",
  "text-justify",
  "text-orientation",
  "text-overflow",
  "text-rendering",
  "text-shadow",
  "text-size-adjust",
  "text-transform",
  "text-underline-offset",
  "text-underline-position",
  "text-wrap",
  "text-wrap-mode",
  "text-wrap-style",
  "timeline-scope",
  "top",
  "touch-action",
  "transform",
  "transform-box",
  "transform-origin",
  "transform-style",
  "transition",
  "transition-behavior",
  "transition-delay",
  "transition-duration",
  "transition-property",
  "transition-timing-function",
  "translate",
  "unicode-bidi",
  "user-modify",
  "user-select",
  "vector-effect",
  "vertical-align",
  "view-timeline",
  "view-timeline-axis",
  "view-timeline-inset",
  "view-timeline-name",
  "view-transition-name",
  "visibility",
  "voice-balance",
  "voice-duration",
  "voice-family",
  "voice-pitch",
  "voice-range",
  "voice-rate",
  "voice-stress",
  "voice-volume",
  "white-space",
  "white-space-collapse",
  "widows",
  "width",
  "will-change",
  "word-break",
  "word-spacing",
  "word-wrap",
  "writing-mode",
  "x",
  "y",
  "z-index",
  "zoom"
].sort().reverse();
function dw(t) {
  const e = rw(t), n = "and or not only", r = {
    className: "variable",
    begin: "\\$" + t.IDENT_RE
  }, i = [
    "charset",
    "css",
    "debug",
    "extend",
    "font-face",
    "for",
    "import",
    "include",
    "keyframes",
    "media",
    "mixin",
    "page",
    "warn",
    "while"
  ], o = "(?=[.\\s\\n[:,(])";
  return {
    name: "Stylus",
    aliases: ["styl"],
    case_insensitive: !1,
    keywords: "if else for in",
    illegal: "(" + [
      "\\?",
      "(\\bReturn\\b)",
      // monkey
      "(\\bEnd\\b)",
      // monkey
      "(\\bend\\b)",
      // vbscript
      "(\\bdef\\b)",
      // gradle
      ";",
      // a whole lot of languages
      "#\\s",
      // markdown
      "\\*\\s",
      // markdown
      "===\\s",
      // markdown
      "\\|",
      "%"
      // prolog
    ].join("|") + ")",
    contains: [
      // strings
      t.QUOTE_STRING_MODE,
      t.APOS_STRING_MODE,
      // comments
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      // hex colors
      e.HEXCOLOR,
      // class tag
      {
        begin: "\\.[a-zA-Z][a-zA-Z0-9_-]*" + o,
        className: "selector-class"
      },
      // id tag
      {
        begin: "#[a-zA-Z][a-zA-Z0-9_-]*" + o,
        className: "selector-id"
      },
      // tags
      {
        begin: "\\b(" + aw.join("|") + ")" + o,
        className: "selector-tag"
      },
      // psuedo selectors
      {
        className: "selector-pseudo",
        begin: "&?:(" + lw.join("|") + ")" + o
      },
      {
        className: "selector-pseudo",
        begin: "&?:(:)?(" + cw.join("|") + ")" + o
      },
      e.ATTRIBUTE_SELECTOR_MODE,
      {
        className: "keyword",
        begin: /@media/,
        starts: {
          end: /[{;}]/,
          keywords: {
            $pattern: /[a-z-]+/,
            keyword: n,
            attribute: sw.join(" ")
          },
          contains: [e.CSS_NUMBER_MODE]
        }
      },
      // @ keywords
      {
        className: "keyword",
        begin: "@((-(o|moz|ms|webkit)-)?(" + i.join("|") + "))\\b"
      },
      // variables
      r,
      // dimension
      e.CSS_NUMBER_MODE,
      // functions
      //  - only from beginning of line + whitespace
      {
        className: "function",
        begin: "^[a-zA-Z][a-zA-Z0-9_-]*\\(.*\\)",
        illegal: "[\\n]",
        returnBegin: !0,
        contains: [
          {
            className: "title",
            begin: "\\b[a-zA-Z][a-zA-Z0-9_-]*"
          },
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            contains: [
              e.HEXCOLOR,
              r,
              t.APOS_STRING_MODE,
              e.CSS_NUMBER_MODE,
              t.QUOTE_STRING_MODE
            ]
          }
        ]
      },
      // css variables
      e.CSS_VARIABLE,
      // attributes
      //  - only from beginning of line + whitespace
      //  - must have whitespace after it
      {
        className: "attribute",
        begin: "\\b(" + uw.join("|") + ")\\b",
        starts: {
          // value container
          end: /;|$/,
          contains: [
            e.HEXCOLOR,
            r,
            t.APOS_STRING_MODE,
            t.QUOTE_STRING_MODE,
            e.CSS_NUMBER_MODE,
            t.C_BLOCK_COMMENT_MODE,
            e.IMPORTANT,
            e.FUNCTION_DISPATCH
          ],
          illegal: /\./,
          relevance: 0
        }
      },
      e.FUNCTION_DISPATCH
    ]
  };
}
function pw(t) {
  return {
    name: "SubUnit",
    case_insensitive: !0,
    contains: [
      {
        className: "string",
        begin: `\\[
(multipart)?`,
        end: `\\]
`
      },
      {
        className: "string",
        begin: "\\d{4}-\\d{2}-\\d{2}(\\s+)\\d{2}:\\d{2}:\\d{2}.\\d+Z"
      },
      {
        className: "string",
        begin: "(\\+|-)\\d+"
      },
      {
        className: "keyword",
        relevance: 10,
        variants: [
          { begin: "^(test|testing|success|successful|failure|error|skip|xfail|uxsuccess)(:?)\\s+(test)?" },
          { begin: "^progress(:?)(\\s+)?(pop|push)?" },
          { begin: "^tags:" },
          { begin: "^time:" }
        ]
      }
    ]
  };
}
function _w(t) {
  return {
    name: "Tagger Script",
    contains: [
      {
        className: "comment",
        begin: /\$noop\(/,
        end: /\)/,
        contains: [
          { begin: /\\[()]/ },
          {
            begin: /\(/,
            end: /\)/,
            contains: [
              { begin: /\\[()]/ },
              "self"
            ]
          }
        ],
        relevance: 10
      },
      {
        className: "keyword",
        begin: /\$[_a-zA-Z0-9]+(?=\()/
      },
      {
        className: "variable",
        begin: /%[_a-zA-Z0-9:]+%/
      },
      {
        className: "symbol",
        begin: /\\[\\nt$%,()]/
      },
      {
        className: "symbol",
        begin: /\\u[a-fA-F0-9]{4}/
      }
    ]
  };
}
function mw(t) {
  return {
    name: "Test Anything Protocol",
    case_insensitive: !0,
    contains: [
      t.HASH_COMMENT_MODE,
      // version of format and total amount of testcases
      {
        className: "meta",
        variants: [
          { begin: "^TAP version (\\d+)$" },
          { begin: "^1\\.\\.(\\d+)$" }
        ]
      },
      // YAML block
      {
        begin: /---$/,
        end: "\\.\\.\\.$",
        subLanguage: "yaml",
        relevance: 0
      },
      // testcase number
      {
        className: "number",
        begin: " (\\d+) "
      },
      // testcase status and description
      {
        className: "symbol",
        variants: [
          { begin: "^ok" },
          { begin: "^not ok" }
        ]
      }
    ]
  };
}
function fw(t) {
  const e = t.regex, n = /[a-zA-Z_][a-zA-Z0-9_]*/, r = {
    className: "number",
    variants: [
      t.BINARY_NUMBER_MODE,
      t.C_NUMBER_MODE
    ]
  };
  return {
    name: "Tcl",
    aliases: ["tk"],
    keywords: [
      "after",
      "append",
      "apply",
      "array",
      "auto_execok",
      "auto_import",
      "auto_load",
      "auto_mkindex",
      "auto_mkindex_old",
      "auto_qualify",
      "auto_reset",
      "bgerror",
      "binary",
      "break",
      "catch",
      "cd",
      "chan",
      "clock",
      "close",
      "concat",
      "continue",
      "dde",
      "dict",
      "encoding",
      "eof",
      "error",
      "eval",
      "exec",
      "exit",
      "expr",
      "fblocked",
      "fconfigure",
      "fcopy",
      "file",
      "fileevent",
      "filename",
      "flush",
      "for",
      "foreach",
      "format",
      "gets",
      "glob",
      "global",
      "history",
      "http",
      "if",
      "incr",
      "info",
      "interp",
      "join",
      "lappend|10",
      "lassign|10",
      "lindex|10",
      "linsert|10",
      "list",
      "llength|10",
      "load",
      "lrange|10",
      "lrepeat|10",
      "lreplace|10",
      "lreverse|10",
      "lsearch|10",
      "lset|10",
      "lsort|10",
      "mathfunc",
      "mathop",
      "memory",
      "msgcat",
      "namespace",
      "open",
      "package",
      "parray",
      "pid",
      "pkg::create",
      "pkg_mkIndex",
      "platform",
      "platform::shell",
      "proc",
      "puts",
      "pwd",
      "read",
      "refchan",
      "regexp",
      "registry",
      "regsub|10",
      "rename",
      "return",
      "safe",
      "scan",
      "seek",
      "set",
      "socket",
      "source",
      "split",
      "string",
      "subst",
      "switch",
      "tcl_endOfWord",
      "tcl_findLibrary",
      "tcl_startOfNextWord",
      "tcl_startOfPreviousWord",
      "tcl_wordBreakAfter",
      "tcl_wordBreakBefore",
      "tcltest",
      "tclvars",
      "tell",
      "time",
      "tm",
      "trace",
      "unknown",
      "unload",
      "unset",
      "update",
      "uplevel",
      "upvar",
      "variable",
      "vwait",
      "while"
    ],
    contains: [
      t.COMMENT(";[ \\t]*#", "$"),
      t.COMMENT("^[ \\t]*#", "$"),
      {
        beginKeywords: "proc",
        end: "[\\{]",
        excludeEnd: !0,
        contains: [
          {
            className: "title",
            begin: "[ \\t\\n\\r]+(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",
            end: "[ \\t\\n\\r]",
            endsWithParent: !0,
            excludeEnd: !0
          }
        ]
      },
      {
        className: "variable",
        variants: [
          { begin: e.concat(
            /\$/,
            e.optional(/::/),
            n,
            "(::",
            n,
            ")*"
          ) },
          {
            begin: "\\$\\{(::)?[a-zA-Z_]((::)?[a-zA-Z0-9_])*",
            end: "\\}",
            contains: [r]
          }
        ]
      },
      {
        className: "string",
        contains: [t.BACKSLASH_ESCAPE],
        variants: [t.inherit(t.QUOTE_STRING_MODE, { illegal: null })]
      },
      r
    ]
  };
}
function gw(t) {
  const e = [
    "bool",
    "byte",
    "i16",
    "i32",
    "i64",
    "double",
    "string",
    "binary"
  ];
  return {
    name: "Thrift",
    keywords: {
      keyword: [
        "namespace",
        "const",
        "typedef",
        "struct",
        "enum",
        "service",
        "exception",
        "void",
        "oneway",
        "set",
        "list",
        "map",
        "required",
        "optional"
      ],
      type: e,
      literal: "true false"
    },
    contains: [
      t.QUOTE_STRING_MODE,
      t.NUMBER_MODE,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      {
        className: "class",
        beginKeywords: "struct enum service exception",
        end: /\{/,
        illegal: /\n/,
        contains: [
          t.inherit(t.TITLE_MODE, {
            // hack: eating everything after the first title
            starts: {
              endsWithParent: !0,
              excludeEnd: !0
            }
          })
        ]
      },
      {
        begin: "\\b(set|list|map)\\s*<",
        keywords: { type: [
          ...e,
          "set",
          "list",
          "map"
        ] },
        end: ">",
        contains: ["self"]
      }
    ]
  };
}
function hw(t) {
  const e = {
    className: "number",
    begin: "[1-9][0-9]*",
    /* no leading zeros */
    relevance: 0
  }, n = {
    className: "symbol",
    begin: ":[^\\]]+"
  }, r = {
    className: "built_in",
    begin: "(AR|P|PAYLOAD|PR|R|SR|RSR|LBL|VR|UALM|MESSAGE|UTOOL|UFRAME|TIMER|TIMER_OVERFLOW|JOINT_MAX_SPEED|RESUME_PROG|DIAG_REC)\\[",
    end: "\\]",
    contains: [
      "self",
      e,
      n
    ]
  }, i = {
    className: "built_in",
    begin: "(AI|AO|DI|DO|F|RI|RO|UI|UO|GI|GO|SI|SO)\\[",
    end: "\\]",
    contains: [
      "self",
      e,
      t.QUOTE_STRING_MODE,
      /* for pos section at bottom */
      n
    ]
  };
  return {
    name: "TP",
    keywords: {
      keyword: [
        "ABORT",
        "ACC",
        "ADJUST",
        "AND",
        "AP_LD",
        "BREAK",
        "CALL",
        "CNT",
        "COL",
        "CONDITION",
        "CONFIG",
        "DA",
        "DB",
        "DIV",
        "DETECT",
        "ELSE",
        "END",
        "ENDFOR",
        "ERR_NUM",
        "ERROR_PROG",
        "FINE",
        "FOR",
        "GP",
        "GUARD",
        "INC",
        "IF",
        "JMP",
        "LINEAR_MAX_SPEED",
        "LOCK",
        "MOD",
        "MONITOR",
        "OFFSET",
        "Offset",
        "OR",
        "OVERRIDE",
        "PAUSE",
        "PREG",
        "PTH",
        "RT_LD",
        "RUN",
        "SELECT",
        "SKIP",
        "Skip",
        "TA",
        "TB",
        "TO",
        "TOOL_OFFSET",
        "Tool_Offset",
        "UF",
        "UT",
        "UFRAME_NUM",
        "UTOOL_NUM",
        "UNLOCK",
        "WAIT",
        "X",
        "Y",
        "Z",
        "W",
        "P",
        "R",
        "STRLEN",
        "SUBSTR",
        "FINDSTR",
        "VOFFSET",
        "PROG",
        "ATTR",
        "MN",
        "POS"
      ],
      literal: [
        "ON",
        "OFF",
        "max_speed",
        "LPOS",
        "JPOS",
        "ENABLE",
        "DISABLE",
        "START",
        "STOP",
        "RESET"
      ]
    },
    contains: [
      r,
      i,
      {
        className: "keyword",
        begin: "/(PROG|ATTR|MN|POS|END)\\b"
      },
      {
        /* this is for cases like ,CALL */
        className: "keyword",
        begin: "(CALL|RUN|POINT_LOGIC|LBL)\\b"
      },
      {
        /* this is for cases like CNT100 where the default lexemes do not
         * separate the keyword and the number */
        className: "keyword",
        begin: "\\b(ACC|CNT|Skip|Offset|PSPD|RT_LD|AP_LD|Tool_Offset)"
      },
      {
        /* to catch numbers that do not have a word boundary on the left */
        className: "number",
        begin: "\\d+(sec|msec|mm/sec|cm/min|inch/min|deg/sec|mm|in|cm)?\\b",
        relevance: 0
      },
      t.COMMENT("//", "[;$]"),
      t.COMMENT("!", "[;$]"),
      t.COMMENT("--eg:", "$"),
      t.QUOTE_STRING_MODE,
      {
        className: "string",
        begin: "'",
        end: "'"
      },
      t.C_NUMBER_MODE,
      {
        className: "variable",
        begin: "\\$[A-Za-z0-9_]+"
      }
    ]
  };
}
function Ew(t) {
  const e = t.regex, n = [
    "absolute_url",
    "asset|0",
    "asset_version",
    "attribute",
    "block",
    "constant",
    "controller|0",
    "country_timezones",
    "csrf_token",
    "cycle",
    "date",
    "dump",
    "expression",
    "form|0",
    "form_end",
    "form_errors",
    "form_help",
    "form_label",
    "form_rest",
    "form_row",
    "form_start",
    "form_widget",
    "html_classes",
    "include",
    "is_granted",
    "logout_path",
    "logout_url",
    "max",
    "min",
    "parent",
    "path|0",
    "random",
    "range",
    "relative_path",
    "render",
    "render_esi",
    "source",
    "template_from_string",
    "url|0"
  ], r = [
    "abs",
    "abbr_class",
    "abbr_method",
    "batch",
    "capitalize",
    "column",
    "convert_encoding",
    "country_name",
    "currency_name",
    "currency_symbol",
    "data_uri",
    "date",
    "date_modify",
    "default",
    "escape",
    "file_excerpt",
    "file_link",
    "file_relative",
    "filter",
    "first",
    "format",
    "format_args",
    "format_args_as_text",
    "format_currency",
    "format_date",
    "format_datetime",
    "format_file",
    "format_file_from_text",
    "format_number",
    "format_time",
    "html_to_markdown",
    "humanize",
    "inky_to_html",
    "inline_css",
    "join",
    "json_encode",
    "keys",
    "language_name",
    "last",
    "length",
    "locale_name",
    "lower",
    "map",
    "markdown",
    "markdown_to_html",
    "merge",
    "nl2br",
    "number_format",
    "raw",
    "reduce",
    "replace",
    "reverse",
    "round",
    "slice",
    "slug",
    "sort",
    "spaceless",
    "split",
    "striptags",
    "timezone_name",
    "title",
    "trans",
    "transchoice",
    "trim",
    "u|0",
    "upper",
    "url_encode",
    "yaml_dump",
    "yaml_encode"
  ];
  let i = [
    "apply",
    "autoescape",
    "block",
    "cache",
    "deprecated",
    "do",
    "embed",
    "extends",
    "filter",
    "flush",
    "for",
    "form_theme",
    "from",
    "if",
    "import",
    "include",
    "macro",
    "sandbox",
    "set",
    "stopwatch",
    "trans",
    "trans_default_domain",
    "transchoice",
    "use",
    "verbatim",
    "with"
  ];
  i = i.concat(i.map((m) => `end${m}`));
  const o = {
    scope: "string",
    variants: [
      {
        begin: /'/,
        end: /'/
      },
      {
        begin: /"/,
        end: /"/
      }
    ]
  }, a = {
    scope: "number",
    match: /\d+/
  }, s = {
    begin: /\(/,
    end: /\)/,
    excludeBegin: !0,
    excludeEnd: !0,
    contains: [
      o,
      a
    ]
  }, l = {
    beginKeywords: n.join(" "),
    keywords: { name: n },
    relevance: 0,
    contains: [s]
  }, c = {
    match: /\|(?=[A-Za-z_]+:?)/,
    beginScope: "punctuation",
    relevance: 0,
    contains: [
      {
        match: /[A-Za-z_]+:?/,
        keywords: r
      }
    ]
  }, u = (m, { relevance: f }) => ({
    beginScope: {
      1: "template-tag",
      3: "name"
    },
    relevance: f || 2,
    endScope: "template-tag",
    begin: [
      /\{%/,
      /\s*/,
      e.either(...m)
    ],
    end: /%\}/,
    keywords: "in",
    contains: [
      c,
      l,
      o,
      a
    ]
  }), d = /[a-z_]+/, p = u(i, { relevance: 2 }), _ = u([d], { relevance: 1 });
  return {
    name: "Twig",
    aliases: ["craftcms"],
    case_insensitive: !0,
    subLanguage: "xml",
    contains: [
      t.COMMENT(/\{#/, /#\}/),
      p,
      _,
      {
        className: "template-variable",
        begin: /\{\{/,
        end: /\}\}/,
        contains: [
          "self",
          c,
          l,
          o,
          a
        ]
      }
    ]
  };
}
function Sw(t) {
  return {
    name: "Vala",
    keywords: {
      keyword: (
        // Value types
        "char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 uint16 uint32 uint64 float double bool struct enum string void weak unowned owned async signal static abstract interface override virtual delegate if while do for foreach else switch case break default return try catch public private protected internal using new this get set const stdout stdin stderr var"
      ),
      built_in: "DBus GLib CCode Gee Object Gtk Posix",
      literal: "false true null"
    },
    contains: [
      {
        className: "class",
        beginKeywords: "class interface namespace",
        end: /\{/,
        excludeEnd: !0,
        illegal: "[^,:\\n\\s\\.]",
        contains: [t.UNDERSCORE_TITLE_MODE]
      },
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      {
        className: "string",
        begin: '"""',
        end: '"""',
        relevance: 5
      },
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      t.C_NUMBER_MODE,
      {
        className: "meta",
        begin: "^#",
        end: "$"
      }
    ]
  };
}
function bw(t) {
  const e = t.regex, n = [
    "lcase",
    "month",
    "vartype",
    "instrrev",
    "ubound",
    "setlocale",
    "getobject",
    "rgb",
    "getref",
    "string",
    "weekdayname",
    "rnd",
    "dateadd",
    "monthname",
    "now",
    "day",
    "minute",
    "isarray",
    "cbool",
    "round",
    "formatcurrency",
    "conversions",
    "csng",
    "timevalue",
    "second",
    "year",
    "space",
    "abs",
    "clng",
    "timeserial",
    "fixs",
    "len",
    "asc",
    "isempty",
    "maths",
    "dateserial",
    "atn",
    "timer",
    "isobject",
    "filter",
    "weekday",
    "datevalue",
    "ccur",
    "isdate",
    "instr",
    "datediff",
    "formatdatetime",
    "replace",
    "isnull",
    "right",
    "sgn",
    "array",
    "snumeric",
    "log",
    "cdbl",
    "hex",
    "chr",
    "lbound",
    "msgbox",
    "ucase",
    "getlocale",
    "cos",
    "cdate",
    "cbyte",
    "rtrim",
    "join",
    "hour",
    "oct",
    "typename",
    "trim",
    "strcomp",
    "int",
    "createobject",
    "loadpicture",
    "tan",
    "formatnumber",
    "mid",
    "split",
    "cint",
    "sin",
    "datepart",
    "ltrim",
    "sqr",
    "time",
    "derived",
    "eval",
    "date",
    "formatpercent",
    "exp",
    "inputbox",
    "left",
    "ascw",
    "chrw",
    "regexp",
    "cstr",
    "err"
  ], r = [
    "server",
    "response",
    "request",
    // take no arguments so can be called without ()
    "scriptengine",
    "scriptenginebuildversion",
    "scriptengineminorversion",
    "scriptenginemajorversion"
  ], i = {
    begin: e.concat(e.either(...n), "\\s*\\("),
    // relevance 0 because this is acting as a beginKeywords really
    relevance: 0,
    keywords: { built_in: n }
  };
  return {
    name: "VBScript",
    aliases: ["vbs"],
    case_insensitive: !0,
    keywords: {
      keyword: [
        "call",
        "class",
        "const",
        "dim",
        "do",
        "loop",
        "erase",
        "execute",
        "executeglobal",
        "exit",
        "for",
        "each",
        "next",
        "function",
        "if",
        "then",
        "else",
        "on",
        "error",
        "option",
        "explicit",
        "new",
        "private",
        "property",
        "let",
        "get",
        "public",
        "randomize",
        "redim",
        "rem",
        "select",
        "case",
        "set",
        "stop",
        "sub",
        "while",
        "wend",
        "with",
        "end",
        "to",
        "elseif",
        "is",
        "or",
        "xor",
        "and",
        "not",
        "class_initialize",
        "class_terminate",
        "default",
        "preserve",
        "in",
        "me",
        "byval",
        "byref",
        "step",
        "resume",
        "goto"
      ],
      built_in: r,
      literal: [
        "true",
        "false",
        "null",
        "nothing",
        "empty"
      ]
    },
    illegal: "//",
    contains: [
      i,
      t.inherit(t.QUOTE_STRING_MODE, { contains: [{ begin: '""' }] }),
      t.COMMENT(
        /'/,
        /$/,
        { relevance: 0 }
      ),
      t.C_NUMBER_MODE
    ]
  };
}
function Tw(t) {
  return {
    name: "VBScript in HTML",
    subLanguage: "xml",
    contains: [
      {
        begin: "<%",
        end: "%>",
        subLanguage: "vbscript"
      }
    ]
  };
}
function Cw(t) {
  const e = t.regex, n = {
    $pattern: /\$?[\w]+(\$[\w]+)*/,
    keyword: [
      "accept_on",
      "alias",
      "always",
      "always_comb",
      "always_ff",
      "always_latch",
      "and",
      "assert",
      "assign",
      "assume",
      "automatic",
      "before",
      "begin",
      "bind",
      "bins",
      "binsof",
      "bit",
      "break",
      "buf|0",
      "bufif0",
      "bufif1",
      "byte",
      "case",
      "casex",
      "casez",
      "cell",
      "chandle",
      "checker",
      "class",
      "clocking",
      "cmos",
      "config",
      "const",
      "constraint",
      "context",
      "continue",
      "cover",
      "covergroup",
      "coverpoint",
      "cross",
      "deassign",
      "default",
      "defparam",
      "design",
      "disable",
      "dist",
      "do",
      "edge",
      "else",
      "end",
      "endcase",
      "endchecker",
      "endclass",
      "endclocking",
      "endconfig",
      "endfunction",
      "endgenerate",
      "endgroup",
      "endinterface",
      "endmodule",
      "endpackage",
      "endprimitive",
      "endprogram",
      "endproperty",
      "endspecify",
      "endsequence",
      "endtable",
      "endtask",
      "enum",
      "event",
      "eventually",
      "expect",
      "export",
      "extends",
      "extern",
      "final",
      "first_match",
      "for",
      "force",
      "foreach",
      "forever",
      "fork",
      "forkjoin",
      "function",
      "generate|5",
      "genvar",
      "global",
      "highz0",
      "highz1",
      "if",
      "iff",
      "ifnone",
      "ignore_bins",
      "illegal_bins",
      "implements",
      "implies",
      "import",
      "incdir",
      "include",
      "initial",
      "inout",
      "input",
      "inside",
      "instance",
      "int",
      "integer",
      "interconnect",
      "interface",
      "intersect",
      "join",
      "join_any",
      "join_none",
      "large",
      "let",
      "liblist",
      "library",
      "local",
      "localparam",
      "logic",
      "longint",
      "macromodule",
      "matches",
      "medium",
      "modport",
      "module",
      "nand",
      "negedge",
      "nettype",
      "new",
      "nexttime",
      "nmos",
      "nor",
      "noshowcancelled",
      "not",
      "notif0",
      "notif1",
      "or",
      "output",
      "package",
      "packed",
      "parameter",
      "pmos",
      "posedge",
      "primitive",
      "priority",
      "program",
      "property",
      "protected",
      "pull0",
      "pull1",
      "pulldown",
      "pullup",
      "pulsestyle_ondetect",
      "pulsestyle_onevent",
      "pure",
      "rand",
      "randc",
      "randcase",
      "randsequence",
      "rcmos",
      "real",
      "realtime",
      "ref",
      "reg",
      "reject_on",
      "release",
      "repeat",
      "restrict",
      "return",
      "rnmos",
      "rpmos",
      "rtran",
      "rtranif0",
      "rtranif1",
      "s_always",
      "s_eventually",
      "s_nexttime",
      "s_until",
      "s_until_with",
      "scalared",
      "sequence",
      "shortint",
      "shortreal",
      "showcancelled",
      "signed",
      "small",
      "soft",
      "solve",
      "specify",
      "specparam",
      "static",
      "string",
      "strong",
      "strong0",
      "strong1",
      "struct",
      "super",
      "supply0",
      "supply1",
      "sync_accept_on",
      "sync_reject_on",
      "table",
      "tagged",
      "task",
      "this",
      "throughout",
      "time",
      "timeprecision",
      "timeunit",
      "tran",
      "tranif0",
      "tranif1",
      "tri",
      "tri0",
      "tri1",
      "triand",
      "trior",
      "trireg",
      "type",
      "typedef",
      "union",
      "unique",
      "unique0",
      "unsigned",
      "until",
      "until_with",
      "untyped",
      "use",
      "uwire",
      "var",
      "vectored",
      "virtual",
      "void",
      "wait",
      "wait_order",
      "wand",
      "weak",
      "weak0",
      "weak1",
      "while",
      "wildcard",
      "wire",
      "with",
      "within",
      "wor",
      "xnor",
      "xor"
    ],
    literal: ["null"],
    built_in: [
      "$finish",
      "$stop",
      "$exit",
      "$fatal",
      "$error",
      "$warning",
      "$info",
      "$realtime",
      "$time",
      "$printtimescale",
      "$bitstoreal",
      "$bitstoshortreal",
      "$itor",
      "$signed",
      "$cast",
      "$bits",
      "$stime",
      "$timeformat",
      "$realtobits",
      "$shortrealtobits",
      "$rtoi",
      "$unsigned",
      "$asserton",
      "$assertkill",
      "$assertpasson",
      "$assertfailon",
      "$assertnonvacuouson",
      "$assertoff",
      "$assertcontrol",
      "$assertpassoff",
      "$assertfailoff",
      "$assertvacuousoff",
      "$isunbounded",
      "$sampled",
      "$fell",
      "$changed",
      "$past_gclk",
      "$fell_gclk",
      "$changed_gclk",
      "$rising_gclk",
      "$steady_gclk",
      "$coverage_control",
      "$coverage_get",
      "$coverage_save",
      "$set_coverage_db_name",
      "$rose",
      "$stable",
      "$past",
      "$rose_gclk",
      "$stable_gclk",
      "$future_gclk",
      "$falling_gclk",
      "$changing_gclk",
      "$display",
      "$coverage_get_max",
      "$coverage_merge",
      "$get_coverage",
      "$load_coverage_db",
      "$typename",
      "$unpacked_dimensions",
      "$left",
      "$low",
      "$increment",
      "$clog2",
      "$ln",
      "$log10",
      "$exp",
      "$sqrt",
      "$pow",
      "$floor",
      "$ceil",
      "$sin",
      "$cos",
      "$tan",
      "$countbits",
      "$onehot",
      "$isunknown",
      "$fatal",
      "$warning",
      "$dimensions",
      "$right",
      "$high",
      "$size",
      "$asin",
      "$acos",
      "$atan",
      "$atan2",
      "$hypot",
      "$sinh",
      "$cosh",
      "$tanh",
      "$asinh",
      "$acosh",
      "$atanh",
      "$countones",
      "$onehot0",
      "$error",
      "$info",
      "$random",
      "$dist_chi_square",
      "$dist_erlang",
      "$dist_exponential",
      "$dist_normal",
      "$dist_poisson",
      "$dist_t",
      "$dist_uniform",
      "$q_initialize",
      "$q_remove",
      "$q_exam",
      "$async$and$array",
      "$async$nand$array",
      "$async$or$array",
      "$async$nor$array",
      "$sync$and$array",
      "$sync$nand$array",
      "$sync$or$array",
      "$sync$nor$array",
      "$q_add",
      "$q_full",
      "$psprintf",
      "$async$and$plane",
      "$async$nand$plane",
      "$async$or$plane",
      "$async$nor$plane",
      "$sync$and$plane",
      "$sync$nand$plane",
      "$sync$or$plane",
      "$sync$nor$plane",
      "$system",
      "$display",
      "$displayb",
      "$displayh",
      "$displayo",
      "$strobe",
      "$strobeb",
      "$strobeh",
      "$strobeo",
      "$write",
      "$readmemb",
      "$readmemh",
      "$writememh",
      "$value$plusargs",
      "$dumpvars",
      "$dumpon",
      "$dumplimit",
      "$dumpports",
      "$dumpportson",
      "$dumpportslimit",
      "$writeb",
      "$writeh",
      "$writeo",
      "$monitor",
      "$monitorb",
      "$monitorh",
      "$monitoro",
      "$writememb",
      "$dumpfile",
      "$dumpoff",
      "$dumpall",
      "$dumpflush",
      "$dumpportsoff",
      "$dumpportsall",
      "$dumpportsflush",
      "$fclose",
      "$fdisplay",
      "$fdisplayb",
      "$fdisplayh",
      "$fdisplayo",
      "$fstrobe",
      "$fstrobeb",
      "$fstrobeh",
      "$fstrobeo",
      "$swrite",
      "$swriteb",
      "$swriteh",
      "$swriteo",
      "$fscanf",
      "$fread",
      "$fseek",
      "$fflush",
      "$feof",
      "$fopen",
      "$fwrite",
      "$fwriteb",
      "$fwriteh",
      "$fwriteo",
      "$fmonitor",
      "$fmonitorb",
      "$fmonitorh",
      "$fmonitoro",
      "$sformat",
      "$sformatf",
      "$fgetc",
      "$ungetc",
      "$fgets",
      "$sscanf",
      "$rewind",
      "$ftell",
      "$ferror"
    ]
  }, r = [
    "__FILE__",
    "__LINE__"
  ], i = [
    "begin_keywords",
    "celldefine",
    "default_nettype",
    "default_decay_time",
    "default_trireg_strength",
    "define",
    "delay_mode_distributed",
    "delay_mode_path",
    "delay_mode_unit",
    "delay_mode_zero",
    "else",
    "elsif",
    "end_keywords",
    "endcelldefine",
    "endif",
    "ifdef",
    "ifndef",
    "include",
    "line",
    "nounconnected_drive",
    "pragma",
    "resetall",
    "timescale",
    "unconnected_drive",
    "undef",
    "undefineall"
  ];
  return {
    name: "Verilog",
    aliases: [
      "v",
      "sv",
      "svh"
    ],
    case_insensitive: !1,
    keywords: n,
    contains: [
      t.C_BLOCK_COMMENT_MODE,
      t.C_LINE_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      {
        scope: "number",
        contains: [t.BACKSLASH_ESCAPE],
        variants: [
          { begin: /\b((\d+'([bhodBHOD]))[0-9xzXZa-fA-F_]+)/ },
          { begin: /\B(('([bhodBHOD]))[0-9xzXZa-fA-F_]+)/ },
          {
            // decimal
            begin: /\b[0-9][0-9_]*/,
            relevance: 0
          }
        ]
      },
      /* parameters to instances */
      {
        scope: "variable",
        variants: [
          { begin: "#\\((?!parameter).+\\)" },
          {
            begin: "\\.\\w+",
            relevance: 0
          }
        ]
      },
      {
        scope: "variable.constant",
        match: e.concat(/`/, e.either(...r))
      },
      {
        scope: "meta",
        begin: e.concat(/`/, e.either(...i)),
        end: /$|\/\/|\/\*/,
        returnEnd: !0,
        keywords: i
      }
    ]
  };
}
function yw(t) {
  const e = "\\d(_|\\d)*", n = "[eE][-+]?" + e, r = e + "(\\." + e + ")?(" + n + ")?", i = "\\w+", a = "\\b(" + (e + "#" + i + "(\\." + i + ")?#(" + n + ")?") + "|" + r + ")";
  return {
    name: "VHDL",
    case_insensitive: !0,
    keywords: {
      keyword: [
        "abs",
        "access",
        "after",
        "alias",
        "all",
        "and",
        "architecture",
        "array",
        "assert",
        "assume",
        "assume_guarantee",
        "attribute",
        "begin",
        "block",
        "body",
        "buffer",
        "bus",
        "case",
        "component",
        "configuration",
        "constant",
        "context",
        "cover",
        "disconnect",
        "downto",
        "default",
        "else",
        "elsif",
        "end",
        "entity",
        "exit",
        "fairness",
        "file",
        "for",
        "force",
        "function",
        "generate",
        "generic",
        "group",
        "guarded",
        "if",
        "impure",
        "in",
        "inertial",
        "inout",
        "is",
        "label",
        "library",
        "linkage",
        "literal",
        "loop",
        "map",
        "mod",
        "nand",
        "new",
        "next",
        "nor",
        "not",
        "null",
        "of",
        "on",
        "open",
        "or",
        "others",
        "out",
        "package",
        "parameter",
        "port",
        "postponed",
        "procedure",
        "process",
        "property",
        "protected",
        "pure",
        "range",
        "record",
        "register",
        "reject",
        "release",
        "rem",
        "report",
        "restrict",
        "restrict_guarantee",
        "return",
        "rol",
        "ror",
        "select",
        "sequence",
        "severity",
        "shared",
        "signal",
        "sla",
        "sll",
        "sra",
        "srl",
        "strong",
        "subtype",
        "then",
        "to",
        "transport",
        "type",
        "unaffected",
        "units",
        "until",
        "use",
        "variable",
        "view",
        "vmode",
        "vprop",
        "vunit",
        "wait",
        "when",
        "while",
        "with",
        "xnor",
        "xor"
      ],
      built_in: [
        "boolean",
        "bit",
        "character",
        "integer",
        "time",
        "delay_length",
        "natural",
        "positive",
        "string",
        "bit_vector",
        "file_open_kind",
        "file_open_status",
        "std_logic",
        "std_logic_vector",
        "unsigned",
        "signed",
        "boolean_vector",
        "integer_vector",
        "std_ulogic",
        "std_ulogic_vector",
        "unresolved_unsigned",
        "u_unsigned",
        "unresolved_signed",
        "u_signed",
        "real_vector",
        "time_vector"
      ],
      literal: [
        // severity_level
        "false",
        "true",
        "note",
        "warning",
        "error",
        "failure",
        // textio
        "line",
        "text",
        "side",
        "width"
      ]
    },
    illegal: /\{/,
    contains: [
      t.C_BLOCK_COMMENT_MODE,
      // VHDL-2008 block commenting.
      t.COMMENT("--", "$"),
      t.QUOTE_STRING_MODE,
      {
        className: "number",
        begin: a,
        relevance: 0
      },
      {
        className: "string",
        begin: "'(U|X|0|1|Z|W|L|H|-)'",
        contains: [t.BACKSLASH_ESCAPE]
      },
      {
        className: "symbol",
        begin: "'[A-Za-z](_?[A-Za-z0-9])*",
        contains: [t.BACKSLASH_ESCAPE]
      }
    ]
  };
}
function vw(t) {
  return {
    name: "Vim Script",
    keywords: {
      $pattern: /[!#@\w]+/,
      keyword: (
        // express version except: ! & * < = > !! # @ @@
        "N|0 P|0 X|0 a|0 ab abc abo al am an|0 ar arga argd arge argdo argg argl argu as au aug aun b|0 bN ba bad bd be bel bf bl bm bn bo bp br brea breaka breakd breakl bro bufdo buffers bun bw c|0 cN cNf ca cabc caddb cad caddf cal cat cb cc ccl cd ce cex cf cfir cgetb cgete cg changes chd che checkt cl cla clo cm cmapc cme cn cnew cnf cno cnorea cnoreme co col colo com comc comp con conf cope cp cpf cq cr cs cst cu cuna cunme cw delm deb debugg delc delf dif diffg diffo diffp diffpu diffs diffthis dig di dl dell dj dli do doautoa dp dr ds dsp e|0 ea ec echoe echoh echom echon el elsei em en endfo endf endt endw ene ex exe exi exu f|0 files filet fin fina fini fir fix fo foldc foldd folddoc foldo for fu go gr grepa gu gv ha helpf helpg helpt hi hid his ia iabc if ij il im imapc ime ino inorea inoreme int is isp iu iuna iunme j|0 ju k|0 keepa kee keepj lN lNf l|0 lad laddb laddf la lan lat lb lc lch lcl lcs le lefta let lex lf lfir lgetb lgete lg lgr lgrepa lh ll lla lli lmak lm lmapc lne lnew lnf ln loadk lo loc lockv lol lope lp lpf lr ls lt lu lua luad luaf lv lvimgrepa lw m|0 ma mak map mapc marks mat me menut mes mk mks mksp mkv mkvie mod mz mzf nbc nb nbs new nm nmapc nme nn nnoreme noa no noh norea noreme norm nu nun nunme ol o|0 om omapc ome on ono onoreme opt ou ounme ow p|0 profd prof pro promptr pc ped pe perld po popu pp pre prev ps pt ptN ptf ptj ptl ptn ptp ptr pts pu pw py3 python3 py3d py3f py pyd pyf quita qa rec red redi redr redraws reg res ret retu rew ri rightb rub rubyd rubyf rund ru rv sN san sa sal sav sb sbN sba sbf sbl sbm sbn sbp sbr scrip scripte scs se setf setg setl sf sfir sh sim sig sil sl sla sm smap smapc sme sn sni sno snor snoreme sor so spelld spe spelli spellr spellu spellw sp spr sre st sta startg startr star stopi stj sts sun sunm sunme sus sv sw sy synti sync tN tabN tabc tabdo tabe tabf tabfir tabl tabm tabnew tabn tabo tabp tabr tabs tab ta tags tc tcld tclf te tf th tj tl tm tn to tp tr try ts tu u|0 undoj undol una unh unl unlo unm unme uns up ve verb vert vim vimgrepa vi viu vie vm vmapc vme vne vn vnoreme vs vu vunme windo w|0 wN wa wh wi winc winp wn wp wq wqa ws wu wv x|0 xa xmapc xm xme xn xnoreme xu xunme y|0 z|0 ~ Next Print append abbreviate abclear aboveleft all amenu anoremenu args argadd argdelete argedit argglobal arglocal argument ascii autocmd augroup aunmenu buffer bNext ball badd bdelete behave belowright bfirst blast bmodified bnext botright bprevious brewind break breakadd breakdel breaklist browse bunload bwipeout change cNext cNfile cabbrev cabclear caddbuffer caddexpr caddfile call catch cbuffer cclose center cexpr cfile cfirst cgetbuffer cgetexpr cgetfile chdir checkpath checktime clist clast close cmap cmapclear cmenu cnext cnewer cnfile cnoremap cnoreabbrev cnoremenu copy colder colorscheme command comclear compiler continue confirm copen cprevious cpfile cquit crewind cscope cstag cunmap cunabbrev cunmenu cwindow delete delmarks debug debuggreedy delcommand delfunction diffupdate diffget diffoff diffpatch diffput diffsplit digraphs display deletel djump dlist doautocmd doautoall deletep drop dsearch dsplit edit earlier echo echoerr echohl echomsg else elseif emenu endif endfor endfunction endtry endwhile enew execute exit exusage file filetype find finally finish first fixdel fold foldclose folddoopen folddoclosed foldopen function global goto grep grepadd gui gvim hardcopy help helpfind helpgrep helptags highlight hide history insert iabbrev iabclear ijump ilist imap imapclear imenu inoremap inoreabbrev inoremenu intro isearch isplit iunmap iunabbrev iunmenu join jumps keepalt keepmarks keepjumps lNext lNfile list laddexpr laddbuffer laddfile last language later lbuffer lcd lchdir lclose lcscope left leftabove lexpr lfile lfirst lgetbuffer lgetexpr lgetfile lgrep lgrepadd lhelpgrep llast llist lmake lmap lmapclear lnext lnewer lnfile lnoremap loadkeymap loadview lockmarks lockvar lolder lopen lprevious lpfile lrewind ltag lunmap luado luafile lvimgrep lvimgrepadd lwindow move mark make mapclear match menu menutranslate messages mkexrc mksession mkspell mkvimrc mkview mode mzscheme mzfile nbclose nbkey nbsart next nmap nmapclear nmenu nnoremap nnoremenu noautocmd noremap nohlsearch noreabbrev noremenu normal number nunmap nunmenu oldfiles open omap omapclear omenu only onoremap onoremenu options ounmap ounmenu ownsyntax print profdel profile promptfind promptrepl pclose pedit perl perldo pop popup ppop preserve previous psearch ptag ptNext ptfirst ptjump ptlast ptnext ptprevious ptrewind ptselect put pwd py3do py3file python pydo pyfile quit quitall qall read recover redo redir redraw redrawstatus registers resize retab return rewind right rightbelow ruby rubydo rubyfile rundo runtime rviminfo substitute sNext sandbox sargument sall saveas sbuffer sbNext sball sbfirst sblast sbmodified sbnext sbprevious sbrewind scriptnames scriptencoding scscope set setfiletype setglobal setlocal sfind sfirst shell simalt sign silent sleep slast smagic smapclear smenu snext sniff snomagic snoremap snoremenu sort source spelldump spellgood spellinfo spellrepall spellundo spellwrong split sprevious srewind stop stag startgreplace startreplace startinsert stopinsert stjump stselect sunhide sunmap sunmenu suspend sview swapname syntax syntime syncbind tNext tabNext tabclose tabedit tabfind tabfirst tablast tabmove tabnext tabonly tabprevious tabrewind tag tcl tcldo tclfile tearoff tfirst throw tjump tlast tmenu tnext topleft tprevious trewind tselect tunmenu undo undojoin undolist unabbreviate unhide unlet unlockvar unmap unmenu unsilent update vglobal version verbose vertical vimgrep vimgrepadd visual viusage view vmap vmapclear vmenu vnew vnoremap vnoremenu vsplit vunmap vunmenu write wNext wall while winsize wincmd winpos wnext wprevious wqall wsverb wundo wviminfo xit xall xmapclear xmap xmenu xnoremap xnoremenu xunmap xunmenu yank"
      ),
      built_in: (
        // built in func
        "synIDtrans atan2 range matcharg did_filetype asin feedkeys xor argv complete_check add getwinposx getqflist getwinposy screencol clearmatches empty extend getcmdpos mzeval garbagecollect setreg ceil sqrt diff_hlID inputsecret get getfperm getpid filewritable shiftwidth max sinh isdirectory synID system inputrestore winline atan visualmode inputlist tabpagewinnr round getregtype mapcheck hasmapto histdel argidx findfile sha256 exists toupper getcmdline taglist string getmatches bufnr strftime winwidth bufexists strtrans tabpagebuflist setcmdpos remote_read printf setloclist getpos getline bufwinnr float2nr len getcmdtype diff_filler luaeval resolve libcallnr foldclosedend reverse filter has_key bufname str2float strlen setline getcharmod setbufvar index searchpos shellescape undofile foldclosed setqflist buflisted strchars str2nr virtcol floor remove undotree remote_expr winheight gettabwinvar reltime cursor tabpagenr finddir localtime acos getloclist search tanh matchend rename gettabvar strdisplaywidth type abs py3eval setwinvar tolower wildmenumode log10 spellsuggest bufloaded synconcealed nextnonblank server2client complete settabwinvar executable input wincol setmatches getftype hlID inputsave searchpair or screenrow line settabvar histadd deepcopy strpart remote_peek and eval getftime submatch screenchar winsaveview matchadd mkdir screenattr getfontname libcall reltimestr getfsize winnr invert pow getbufline byte2line soundfold repeat fnameescape tagfiles sin strwidth spellbadword trunc maparg log lispindent hostname setpos globpath remote_foreground getchar synIDattr fnamemodify cscope_connection stridx winbufnr indent min complete_add nr2char searchpairpos inputdialog values matchlist items hlexists strridx browsedir expand fmod pathshorten line2byte argc count getwinvar glob foldtextresult getreg foreground cosh matchdelete has char2nr simplify histget searchdecl iconv winrestcmd pumvisible writefile foldlevel haslocaldir keys cos matchstr foldtext histnr tan tempname getcwd byteidx getbufvar islocked escape eventhandler remote_send serverlist winrestview synstack pyeval prevnonblank readfile cindent filereadable changenr exp"
      )
    },
    illegal: /;/,
    contains: [
      t.NUMBER_MODE,
      {
        className: "string",
        begin: "'",
        end: "'",
        illegal: "\\n"
      },
      /*
            A double quote can start either a string or a line comment. Strings are
            ended before the end of a line by another double quote and can contain
            escaped double-quotes and post-escaped line breaks.
      
            Also, any double quote at the beginning of a line is a comment but we
            don't handle that properly at the moment: any double quote inside will
            turn them into a string. Handling it properly will require a smarter
            parser.
            */
      {
        className: "string",
        begin: /"(\\"|\n\\|[^"\n])*"/
      },
      t.COMMENT('"', "$"),
      {
        className: "variable",
        begin: /[bwtglsav]:[\w\d_]+/
      },
      {
        begin: [
          /\b(?:function|function!)/,
          /\s+/,
          t.IDENT_RE
        ],
        className: {
          1: "keyword",
          3: "title"
        },
        end: "$",
        relevance: 0,
        contains: [
          {
            className: "params",
            begin: "\\(",
            end: "\\)"
          }
        ]
      },
      {
        className: "symbol",
        begin: /<[\w-]+>/
      }
    ]
  };
}
function Rw(t) {
  const e = t.regex, n = /[a-zA-Z]\w*/, r = [
    "as",
    "break",
    "class",
    "construct",
    "continue",
    "else",
    "for",
    "foreign",
    "if",
    "import",
    "in",
    "is",
    "return",
    "static",
    "var",
    "while"
  ], i = [
    "true",
    "false",
    "null"
  ], o = [
    "this",
    "super"
  ], a = [
    "Bool",
    "Class",
    "Fiber",
    "Fn",
    "List",
    "Map",
    "Null",
    "Num",
    "Object",
    "Range",
    "Sequence",
    "String",
    "System"
  ], s = [
    "-",
    "~",
    /\*/,
    "%",
    /\.\.\./,
    /\.\./,
    /\+/,
    "<<",
    ">>",
    ">=",
    "<=",
    "<",
    ">",
    /\^/,
    /!=/,
    /!/,
    /\bis\b/,
    "==",
    "&&",
    "&",
    /\|\|/,
    /\|/,
    /\?:/,
    "="
  ], l = {
    relevance: 0,
    match: e.concat(/\b(?!(if|while|for|else|super)\b)/, n, /(?=\s*[({])/),
    className: "title.function"
  }, c = {
    match: e.concat(
      e.either(
        e.concat(/\b(?!(if|while|for|else|super)\b)/, n),
        e.either(...s)
      ),
      /(?=\s*\([^)]+\)\s*\{)/
    ),
    className: "title.function",
    starts: { contains: [
      {
        begin: /\(/,
        end: /\)/,
        contains: [
          {
            relevance: 0,
            scope: "params",
            match: n
          }
        ]
      }
    ] }
  }, u = {
    variants: [
      { match: [
        /class\s+/,
        n,
        /\s+is\s+/,
        n
      ] },
      { match: [
        /class\s+/,
        n
      ] }
    ],
    scope: {
      2: "title.class",
      4: "title.class.inherited"
    },
    keywords: r
  }, d = {
    relevance: 0,
    match: e.either(...s),
    className: "operator"
  }, p = {
    className: "string",
    begin: /"""/,
    end: /"""/
  }, _ = {
    className: "property",
    begin: e.concat(/\./, e.lookahead(n)),
    end: n,
    excludeBegin: !0,
    relevance: 0
  }, m = {
    relevance: 0,
    match: e.concat(/\b_/, n),
    scope: "variable"
  }, f = {
    relevance: 0,
    match: /\b[A-Z]+[a-z]+([A-Z]+[a-z]+)*/,
    scope: "title.class",
    keywords: { _: a }
  }, g = t.C_NUMBER_MODE, S = {
    match: [
      n,
      /\s*/,
      /=/,
      /\s*/,
      /\(/,
      n,
      /\)\s*\{/
    ],
    scope: {
      1: "title.function",
      3: "operator",
      6: "params"
    }
  }, E = t.COMMENT(
    /\/\*\*/,
    /\*\//,
    { contains: [
      {
        match: /@[a-z]+/,
        scope: "doctag"
      },
      "self"
    ] }
  ), b = {
    scope: "subst",
    begin: /%\(/,
    end: /\)/,
    contains: [
      g,
      f,
      l,
      m,
      d
    ]
  }, h = {
    scope: "string",
    begin: /"/,
    end: /"/,
    contains: [
      b,
      {
        scope: "char.escape",
        variants: [
          { match: /\\\\|\\["0%abefnrtv]/ },
          { match: /\\x[0-9A-F]{2}/ },
          { match: /\\u[0-9A-F]{4}/ },
          { match: /\\U[0-9A-F]{8}/ }
        ]
      }
    ]
  };
  b.contains.push(h);
  const T = [
    ...r,
    ...o,
    ...i
  ], C = {
    relevance: 0,
    match: e.concat(
      "\\b(?!",
      T.join("|"),
      "\\b)",
      /[a-zA-Z_]\w*(?:[?!]|\b)/
    ),
    className: "variable"
  };
  return {
    name: "Wren",
    keywords: {
      keyword: r,
      "variable.language": o,
      literal: i
    },
    contains: [
      {
        // scope: "meta",
        scope: "comment",
        variants: [
          {
            begin: [
              /#!?/,
              /[A-Za-z_]+(?=\()/
            ],
            beginScope: {
              // 2: "attr"
            },
            keywords: { literal: i },
            contains: [
              // NUMBER,
              // VARIABLE
            ],
            end: /\)/
          },
          {
            begin: [
              /#!?/,
              /[A-Za-z_]+/
            ],
            beginScope: {
              // 2: "attr"
            },
            end: /$/
          }
        ]
      },
      g,
      h,
      p,
      E,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      f,
      u,
      S,
      c,
      l,
      d,
      m,
      _,
      C
    ]
  };
}
function Ow(t) {
  return {
    name: "Intel x86 Assembly",
    case_insensitive: !0,
    keywords: {
      $pattern: "[.%]?" + t.IDENT_RE,
      keyword: "lock rep repe repz repne repnz xaquire xrelease bnd nobnd aaa aad aam aas adc add and arpl bb0_reset bb1_reset bound bsf bsr bswap bt btc btr bts call cbw cdq cdqe clc cld cli clts cmc cmp cmpsb cmpsd cmpsq cmpsw cmpxchg cmpxchg486 cmpxchg8b cmpxchg16b cpuid cpu_read cpu_write cqo cwd cwde daa das dec div dmint emms enter equ f2xm1 fabs fadd faddp fbld fbstp fchs fclex fcmovb fcmovbe fcmove fcmovnb fcmovnbe fcmovne fcmovnu fcmovu fcom fcomi fcomip fcomp fcompp fcos fdecstp fdisi fdiv fdivp fdivr fdivrp femms feni ffree ffreep fiadd ficom ficomp fidiv fidivr fild fimul fincstp finit fist fistp fisttp fisub fisubr fld fld1 fldcw fldenv fldl2e fldl2t fldlg2 fldln2 fldpi fldz fmul fmulp fnclex fndisi fneni fninit fnop fnsave fnstcw fnstenv fnstsw fpatan fprem fprem1 fptan frndint frstor fsave fscale fsetpm fsin fsincos fsqrt fst fstcw fstenv fstp fstsw fsub fsubp fsubr fsubrp ftst fucom fucomi fucomip fucomp fucompp fxam fxch fxtract fyl2x fyl2xp1 hlt ibts icebp idiv imul in inc incbin insb insd insw int int01 int1 int03 int3 into invd invpcid invlpg invlpga iret iretd iretq iretw jcxz jecxz jrcxz jmp jmpe lahf lar lds lea leave les lfence lfs lgdt lgs lidt lldt lmsw loadall loadall286 lodsb lodsd lodsq lodsw loop loope loopne loopnz loopz lsl lss ltr mfence monitor mov movd movq movsb movsd movsq movsw movsx movsxd movzx mul mwait neg nop not or out outsb outsd outsw packssdw packsswb packuswb paddb paddd paddsb paddsiw paddsw paddusb paddusw paddw pand pandn pause paveb pavgusb pcmpeqb pcmpeqd pcmpeqw pcmpgtb pcmpgtd pcmpgtw pdistib pf2id pfacc pfadd pfcmpeq pfcmpge pfcmpgt pfmax pfmin pfmul pfrcp pfrcpit1 pfrcpit2 pfrsqit1 pfrsqrt pfsub pfsubr pi2fd pmachriw pmaddwd pmagw pmulhriw pmulhrwa pmulhrwc pmulhw pmullw pmvgezb pmvlzb pmvnzb pmvzb pop popa popad popaw popf popfd popfq popfw por prefetch prefetchw pslld psllq psllw psrad psraw psrld psrlq psrlw psubb psubd psubsb psubsiw psubsw psubusb psubusw psubw punpckhbw punpckhdq punpckhwd punpcklbw punpckldq punpcklwd push pusha pushad pushaw pushf pushfd pushfq pushfw pxor rcl rcr rdshr rdmsr rdpmc rdtsc rdtscp ret retf retn rol ror rdm rsdc rsldt rsm rsts sahf sal salc sar sbb scasb scasd scasq scasw sfence sgdt shl shld shr shrd sidt sldt skinit smi smint smintold smsw stc std sti stosb stosd stosq stosw str sub svdc svldt svts swapgs syscall sysenter sysexit sysret test ud0 ud1 ud2b ud2 ud2a umov verr verw fwait wbinvd wrshr wrmsr xadd xbts xchg xlatb xlat xor cmove cmovz cmovne cmovnz cmova cmovnbe cmovae cmovnb cmovb cmovnae cmovbe cmovna cmovg cmovnle cmovge cmovnl cmovl cmovnge cmovle cmovng cmovc cmovnc cmovo cmovno cmovs cmovns cmovp cmovpe cmovnp cmovpo je jz jne jnz ja jnbe jae jnb jb jnae jbe jna jg jnle jge jnl jl jnge jle jng jc jnc jo jno js jns jpo jnp jpe jp sete setz setne setnz seta setnbe setae setnb setnc setb setnae setcset setbe setna setg setnle setge setnl setl setnge setle setng sets setns seto setno setpe setp setpo setnp addps addss andnps andps cmpeqps cmpeqss cmpleps cmpless cmpltps cmpltss cmpneqps cmpneqss cmpnleps cmpnless cmpnltps cmpnltss cmpordps cmpordss cmpunordps cmpunordss cmpps cmpss comiss cvtpi2ps cvtps2pi cvtsi2ss cvtss2si cvttps2pi cvttss2si divps divss ldmxcsr maxps maxss minps minss movaps movhps movlhps movlps movhlps movmskps movntps movss movups mulps mulss orps rcpps rcpss rsqrtps rsqrtss shufps sqrtps sqrtss stmxcsr subps subss ucomiss unpckhps unpcklps xorps fxrstor fxrstor64 fxsave fxsave64 xgetbv xsetbv xsave xsave64 xsaveopt xsaveopt64 xrstor xrstor64 prefetchnta prefetcht0 prefetcht1 prefetcht2 maskmovq movntq pavgb pavgw pextrw pinsrw pmaxsw pmaxub pminsw pminub pmovmskb pmulhuw psadbw pshufw pf2iw pfnacc pfpnacc pi2fw pswapd maskmovdqu clflush movntdq movnti movntpd movdqa movdqu movdq2q movq2dq paddq pmuludq pshufd pshufhw pshuflw pslldq psrldq psubq punpckhqdq punpcklqdq addpd addsd andnpd andpd cmpeqpd cmpeqsd cmplepd cmplesd cmpltpd cmpltsd cmpneqpd cmpneqsd cmpnlepd cmpnlesd cmpnltpd cmpnltsd cmpordpd cmpordsd cmpunordpd cmpunordsd cmppd comisd cvtdq2pd cvtdq2ps cvtpd2dq cvtpd2pi cvtpd2ps cvtpi2pd cvtps2dq cvtps2pd cvtsd2si cvtsd2ss cvtsi2sd cvtss2sd cvttpd2pi cvttpd2dq cvttps2dq cvttsd2si divpd divsd maxpd maxsd minpd minsd movapd movhpd movlpd movmskpd movupd mulpd mulsd orpd shufpd sqrtpd sqrtsd subpd subsd ucomisd unpckhpd unpcklpd xorpd addsubpd addsubps haddpd haddps hsubpd hsubps lddqu movddup movshdup movsldup clgi stgi vmcall vmclear vmfunc vmlaunch vmload vmmcall vmptrld vmptrst vmread vmresume vmrun vmsave vmwrite vmxoff vmxon invept invvpid pabsb pabsw pabsd palignr phaddw phaddd phaddsw phsubw phsubd phsubsw pmaddubsw pmulhrsw pshufb psignb psignw psignd extrq insertq movntsd movntss lzcnt blendpd blendps blendvpd blendvps dppd dpps extractps insertps movntdqa mpsadbw packusdw pblendvb pblendw pcmpeqq pextrb pextrd pextrq phminposuw pinsrb pinsrd pinsrq pmaxsb pmaxsd pmaxud pmaxuw pminsb pminsd pminud pminuw pmovsxbw pmovsxbd pmovsxbq pmovsxwd pmovsxwq pmovsxdq pmovzxbw pmovzxbd pmovzxbq pmovzxwd pmovzxwq pmovzxdq pmuldq pmulld ptest roundpd roundps roundsd roundss crc32 pcmpestri pcmpestrm pcmpistri pcmpistrm pcmpgtq popcnt getsec pfrcpv pfrsqrtv movbe aesenc aesenclast aesdec aesdeclast aesimc aeskeygenassist vaesenc vaesenclast vaesdec vaesdeclast vaesimc vaeskeygenassist vaddpd vaddps vaddsd vaddss vaddsubpd vaddsubps vandpd vandps vandnpd vandnps vblendpd vblendps vblendvpd vblendvps vbroadcastss vbroadcastsd vbroadcastf128 vcmpeq_ospd vcmpeqpd vcmplt_ospd vcmpltpd vcmple_ospd vcmplepd vcmpunord_qpd vcmpunordpd vcmpneq_uqpd vcmpneqpd vcmpnlt_uspd vcmpnltpd vcmpnle_uspd vcmpnlepd vcmpord_qpd vcmpordpd vcmpeq_uqpd vcmpnge_uspd vcmpngepd vcmpngt_uspd vcmpngtpd vcmpfalse_oqpd vcmpfalsepd vcmpneq_oqpd vcmpge_ospd vcmpgepd vcmpgt_ospd vcmpgtpd vcmptrue_uqpd vcmptruepd vcmplt_oqpd vcmple_oqpd vcmpunord_spd vcmpneq_uspd vcmpnlt_uqpd vcmpnle_uqpd vcmpord_spd vcmpeq_uspd vcmpnge_uqpd vcmpngt_uqpd vcmpfalse_ospd vcmpneq_ospd vcmpge_oqpd vcmpgt_oqpd vcmptrue_uspd vcmppd vcmpeq_osps vcmpeqps vcmplt_osps vcmpltps vcmple_osps vcmpleps vcmpunord_qps vcmpunordps vcmpneq_uqps vcmpneqps vcmpnlt_usps vcmpnltps vcmpnle_usps vcmpnleps vcmpord_qps vcmpordps vcmpeq_uqps vcmpnge_usps vcmpngeps vcmpngt_usps vcmpngtps vcmpfalse_oqps vcmpfalseps vcmpneq_oqps vcmpge_osps vcmpgeps vcmpgt_osps vcmpgtps vcmptrue_uqps vcmptrueps vcmplt_oqps vcmple_oqps vcmpunord_sps vcmpneq_usps vcmpnlt_uqps vcmpnle_uqps vcmpord_sps vcmpeq_usps vcmpnge_uqps vcmpngt_uqps vcmpfalse_osps vcmpneq_osps vcmpge_oqps vcmpgt_oqps vcmptrue_usps vcmpps vcmpeq_ossd vcmpeqsd vcmplt_ossd vcmpltsd vcmple_ossd vcmplesd vcmpunord_qsd vcmpunordsd vcmpneq_uqsd vcmpneqsd vcmpnlt_ussd vcmpnltsd vcmpnle_ussd vcmpnlesd vcmpord_qsd vcmpordsd vcmpeq_uqsd vcmpnge_ussd vcmpngesd vcmpngt_ussd vcmpngtsd vcmpfalse_oqsd vcmpfalsesd vcmpneq_oqsd vcmpge_ossd vcmpgesd vcmpgt_ossd vcmpgtsd vcmptrue_uqsd vcmptruesd vcmplt_oqsd vcmple_oqsd vcmpunord_ssd vcmpneq_ussd vcmpnlt_uqsd vcmpnle_uqsd vcmpord_ssd vcmpeq_ussd vcmpnge_uqsd vcmpngt_uqsd vcmpfalse_ossd vcmpneq_ossd vcmpge_oqsd vcmpgt_oqsd vcmptrue_ussd vcmpsd vcmpeq_osss vcmpeqss vcmplt_osss vcmpltss vcmple_osss vcmpless vcmpunord_qss vcmpunordss vcmpneq_uqss vcmpneqss vcmpnlt_usss vcmpnltss vcmpnle_usss vcmpnless vcmpord_qss vcmpordss vcmpeq_uqss vcmpnge_usss vcmpngess vcmpngt_usss vcmpngtss vcmpfalse_oqss vcmpfalsess vcmpneq_oqss vcmpge_osss vcmpgess vcmpgt_osss vcmpgtss vcmptrue_uqss vcmptruess vcmplt_oqss vcmple_oqss vcmpunord_sss vcmpneq_usss vcmpnlt_uqss vcmpnle_uqss vcmpord_sss vcmpeq_usss vcmpnge_uqss vcmpngt_uqss vcmpfalse_osss vcmpneq_osss vcmpge_oqss vcmpgt_oqss vcmptrue_usss vcmpss vcomisd vcomiss vcvtdq2pd vcvtdq2ps vcvtpd2dq vcvtpd2ps vcvtps2dq vcvtps2pd vcvtsd2si vcvtsd2ss vcvtsi2sd vcvtsi2ss vcvtss2sd vcvtss2si vcvttpd2dq vcvttps2dq vcvttsd2si vcvttss2si vdivpd vdivps vdivsd vdivss vdppd vdpps vextractf128 vextractps vhaddpd vhaddps vhsubpd vhsubps vinsertf128 vinsertps vlddqu vldqqu vldmxcsr vmaskmovdqu vmaskmovps vmaskmovpd vmaxpd vmaxps vmaxsd vmaxss vminpd vminps vminsd vminss vmovapd vmovaps vmovd vmovq vmovddup vmovdqa vmovqqa vmovdqu vmovqqu vmovhlps vmovhpd vmovhps vmovlhps vmovlpd vmovlps vmovmskpd vmovmskps vmovntdq vmovntqq vmovntdqa vmovntpd vmovntps vmovsd vmovshdup vmovsldup vmovss vmovupd vmovups vmpsadbw vmulpd vmulps vmulsd vmulss vorpd vorps vpabsb vpabsw vpabsd vpacksswb vpackssdw vpackuswb vpackusdw vpaddb vpaddw vpaddd vpaddq vpaddsb vpaddsw vpaddusb vpaddusw vpalignr vpand vpandn vpavgb vpavgw vpblendvb vpblendw vpcmpestri vpcmpestrm vpcmpistri vpcmpistrm vpcmpeqb vpcmpeqw vpcmpeqd vpcmpeqq vpcmpgtb vpcmpgtw vpcmpgtd vpcmpgtq vpermilpd vpermilps vperm2f128 vpextrb vpextrw vpextrd vpextrq vphaddw vphaddd vphaddsw vphminposuw vphsubw vphsubd vphsubsw vpinsrb vpinsrw vpinsrd vpinsrq vpmaddwd vpmaddubsw vpmaxsb vpmaxsw vpmaxsd vpmaxub vpmaxuw vpmaxud vpminsb vpminsw vpminsd vpminub vpminuw vpminud vpmovmskb vpmovsxbw vpmovsxbd vpmovsxbq vpmovsxwd vpmovsxwq vpmovsxdq vpmovzxbw vpmovzxbd vpmovzxbq vpmovzxwd vpmovzxwq vpmovzxdq vpmulhuw vpmulhrsw vpmulhw vpmullw vpmulld vpmuludq vpmuldq vpor vpsadbw vpshufb vpshufd vpshufhw vpshuflw vpsignb vpsignw vpsignd vpslldq vpsrldq vpsllw vpslld vpsllq vpsraw vpsrad vpsrlw vpsrld vpsrlq vptest vpsubb vpsubw vpsubd vpsubq vpsubsb vpsubsw vpsubusb vpsubusw vpunpckhbw vpunpckhwd vpunpckhdq vpunpckhqdq vpunpcklbw vpunpcklwd vpunpckldq vpunpcklqdq vpxor vrcpps vrcpss vrsqrtps vrsqrtss vroundpd vroundps vroundsd vroundss vshufpd vshufps vsqrtpd vsqrtps vsqrtsd vsqrtss vstmxcsr vsubpd vsubps vsubsd vsubss vtestps vtestpd vucomisd vucomiss vunpckhpd vunpckhps vunpcklpd vunpcklps vxorpd vxorps vzeroall vzeroupper pclmullqlqdq pclmulhqlqdq pclmullqhqdq pclmulhqhqdq pclmulqdq vpclmullqlqdq vpclmulhqlqdq vpclmullqhqdq vpclmulhqhqdq vpclmulqdq vfmadd132ps vfmadd132pd vfmadd312ps vfmadd312pd vfmadd213ps vfmadd213pd vfmadd123ps vfmadd123pd vfmadd231ps vfmadd231pd vfmadd321ps vfmadd321pd vfmaddsub132ps vfmaddsub132pd vfmaddsub312ps vfmaddsub312pd vfmaddsub213ps vfmaddsub213pd vfmaddsub123ps vfmaddsub123pd vfmaddsub231ps vfmaddsub231pd vfmaddsub321ps vfmaddsub321pd vfmsub132ps vfmsub132pd vfmsub312ps vfmsub312pd vfmsub213ps vfmsub213pd vfmsub123ps vfmsub123pd vfmsub231ps vfmsub231pd vfmsub321ps vfmsub321pd vfmsubadd132ps vfmsubadd132pd vfmsubadd312ps vfmsubadd312pd vfmsubadd213ps vfmsubadd213pd vfmsubadd123ps vfmsubadd123pd vfmsubadd231ps vfmsubadd231pd vfmsubadd321ps vfmsubadd321pd vfnmadd132ps vfnmadd132pd vfnmadd312ps vfnmadd312pd vfnmadd213ps vfnmadd213pd vfnmadd123ps vfnmadd123pd vfnmadd231ps vfnmadd231pd vfnmadd321ps vfnmadd321pd vfnmsub132ps vfnmsub132pd vfnmsub312ps vfnmsub312pd vfnmsub213ps vfnmsub213pd vfnmsub123ps vfnmsub123pd vfnmsub231ps vfnmsub231pd vfnmsub321ps vfnmsub321pd vfmadd132ss vfmadd132sd vfmadd312ss vfmadd312sd vfmadd213ss vfmadd213sd vfmadd123ss vfmadd123sd vfmadd231ss vfmadd231sd vfmadd321ss vfmadd321sd vfmsub132ss vfmsub132sd vfmsub312ss vfmsub312sd vfmsub213ss vfmsub213sd vfmsub123ss vfmsub123sd vfmsub231ss vfmsub231sd vfmsub321ss vfmsub321sd vfnmadd132ss vfnmadd132sd vfnmadd312ss vfnmadd312sd vfnmadd213ss vfnmadd213sd vfnmadd123ss vfnmadd123sd vfnmadd231ss vfnmadd231sd vfnmadd321ss vfnmadd321sd vfnmsub132ss vfnmsub132sd vfnmsub312ss vfnmsub312sd vfnmsub213ss vfnmsub213sd vfnmsub123ss vfnmsub123sd vfnmsub231ss vfnmsub231sd vfnmsub321ss vfnmsub321sd rdfsbase rdgsbase rdrand wrfsbase wrgsbase vcvtph2ps vcvtps2ph adcx adox rdseed clac stac xstore xcryptecb xcryptcbc xcryptctr xcryptcfb xcryptofb montmul xsha1 xsha256 llwpcb slwpcb lwpval lwpins vfmaddpd vfmaddps vfmaddsd vfmaddss vfmaddsubpd vfmaddsubps vfmsubaddpd vfmsubaddps vfmsubpd vfmsubps vfmsubsd vfmsubss vfnmaddpd vfnmaddps vfnmaddsd vfnmaddss vfnmsubpd vfnmsubps vfnmsubsd vfnmsubss vfrczpd vfrczps vfrczsd vfrczss vpcmov vpcomb vpcomd vpcomq vpcomub vpcomud vpcomuq vpcomuw vpcomw vphaddbd vphaddbq vphaddbw vphadddq vphaddubd vphaddubq vphaddubw vphaddudq vphadduwd vphadduwq vphaddwd vphaddwq vphsubbw vphsubdq vphsubwd vpmacsdd vpmacsdqh vpmacsdql vpmacssdd vpmacssdqh vpmacssdql vpmacsswd vpmacssww vpmacswd vpmacsww vpmadcsswd vpmadcswd vpperm vprotb vprotd vprotq vprotw vpshab vpshad vpshaq vpshaw vpshlb vpshld vpshlq vpshlw vbroadcasti128 vpblendd vpbroadcastb vpbroadcastw vpbroadcastd vpbroadcastq vpermd vpermpd vpermps vpermq vperm2i128 vextracti128 vinserti128 vpmaskmovd vpmaskmovq vpsllvd vpsllvq vpsravd vpsrlvd vpsrlvq vgatherdpd vgatherqpd vgatherdps vgatherqps vpgatherdd vpgatherqd vpgatherdq vpgatherqq xabort xbegin xend xtest andn bextr blci blcic blsi blsic blcfill blsfill blcmsk blsmsk blsr blcs bzhi mulx pdep pext rorx sarx shlx shrx tzcnt tzmsk t1mskc valignd valignq vblendmpd vblendmps vbroadcastf32x4 vbroadcastf64x4 vbroadcasti32x4 vbroadcasti64x4 vcompresspd vcompressps vcvtpd2udq vcvtps2udq vcvtsd2usi vcvtss2usi vcvttpd2udq vcvttps2udq vcvttsd2usi vcvttss2usi vcvtudq2pd vcvtudq2ps vcvtusi2sd vcvtusi2ss vexpandpd vexpandps vextractf32x4 vextractf64x4 vextracti32x4 vextracti64x4 vfixupimmpd vfixupimmps vfixupimmsd vfixupimmss vgetexppd vgetexpps vgetexpsd vgetexpss vgetmantpd vgetmantps vgetmantsd vgetmantss vinsertf32x4 vinsertf64x4 vinserti32x4 vinserti64x4 vmovdqa32 vmovdqa64 vmovdqu32 vmovdqu64 vpabsq vpandd vpandnd vpandnq vpandq vpblendmd vpblendmq vpcmpltd vpcmpled vpcmpneqd vpcmpnltd vpcmpnled vpcmpd vpcmpltq vpcmpleq vpcmpneqq vpcmpnltq vpcmpnleq vpcmpq vpcmpequd vpcmpltud vpcmpleud vpcmpnequd vpcmpnltud vpcmpnleud vpcmpud vpcmpequq vpcmpltuq vpcmpleuq vpcmpnequq vpcmpnltuq vpcmpnleuq vpcmpuq vpcompressd vpcompressq vpermi2d vpermi2pd vpermi2ps vpermi2q vpermt2d vpermt2pd vpermt2ps vpermt2q vpexpandd vpexpandq vpmaxsq vpmaxuq vpminsq vpminuq vpmovdb vpmovdw vpmovqb vpmovqd vpmovqw vpmovsdb vpmovsdw vpmovsqb vpmovsqd vpmovsqw vpmovusdb vpmovusdw vpmovusqb vpmovusqd vpmovusqw vpord vporq vprold vprolq vprolvd vprolvq vprord vprorq vprorvd vprorvq vpscatterdd vpscatterdq vpscatterqd vpscatterqq vpsraq vpsravq vpternlogd vpternlogq vptestmd vptestmq vptestnmd vptestnmq vpxord vpxorq vrcp14pd vrcp14ps vrcp14sd vrcp14ss vrndscalepd vrndscaleps vrndscalesd vrndscaless vrsqrt14pd vrsqrt14ps vrsqrt14sd vrsqrt14ss vscalefpd vscalefps vscalefsd vscalefss vscatterdpd vscatterdps vscatterqpd vscatterqps vshuff32x4 vshuff64x2 vshufi32x4 vshufi64x2 kandnw kandw kmovw knotw kortestw korw kshiftlw kshiftrw kunpckbw kxnorw kxorw vpbroadcastmb2q vpbroadcastmw2d vpconflictd vpconflictq vplzcntd vplzcntq vexp2pd vexp2ps vrcp28pd vrcp28ps vrcp28sd vrcp28ss vrsqrt28pd vrsqrt28ps vrsqrt28sd vrsqrt28ss vgatherpf0dpd vgatherpf0dps vgatherpf0qpd vgatherpf0qps vgatherpf1dpd vgatherpf1dps vgatherpf1qpd vgatherpf1qps vscatterpf0dpd vscatterpf0dps vscatterpf0qpd vscatterpf0qps vscatterpf1dpd vscatterpf1dps vscatterpf1qpd vscatterpf1qps prefetchwt1 bndmk bndcl bndcu bndcn bndmov bndldx bndstx sha1rnds4 sha1nexte sha1msg1 sha1msg2 sha256rnds2 sha256msg1 sha256msg2 hint_nop0 hint_nop1 hint_nop2 hint_nop3 hint_nop4 hint_nop5 hint_nop6 hint_nop7 hint_nop8 hint_nop9 hint_nop10 hint_nop11 hint_nop12 hint_nop13 hint_nop14 hint_nop15 hint_nop16 hint_nop17 hint_nop18 hint_nop19 hint_nop20 hint_nop21 hint_nop22 hint_nop23 hint_nop24 hint_nop25 hint_nop26 hint_nop27 hint_nop28 hint_nop29 hint_nop30 hint_nop31 hint_nop32 hint_nop33 hint_nop34 hint_nop35 hint_nop36 hint_nop37 hint_nop38 hint_nop39 hint_nop40 hint_nop41 hint_nop42 hint_nop43 hint_nop44 hint_nop45 hint_nop46 hint_nop47 hint_nop48 hint_nop49 hint_nop50 hint_nop51 hint_nop52 hint_nop53 hint_nop54 hint_nop55 hint_nop56 hint_nop57 hint_nop58 hint_nop59 hint_nop60 hint_nop61 hint_nop62 hint_nop63",
      built_in: (
        // Instruction pointer
        "ip eip rip al ah bl bh cl ch dl dh sil dil bpl spl r8b r9b r10b r11b r12b r13b r14b r15b ax bx cx dx si di bp sp r8w r9w r10w r11w r12w r13w r14w r15w eax ebx ecx edx esi edi ebp esp eip r8d r9d r10d r11d r12d r13d r14d r15d rax rbx rcx rdx rsi rdi rbp rsp r8 r9 r10 r11 r12 r13 r14 r15 cs ds es fs gs ss st st0 st1 st2 st3 st4 st5 st6 st7 mm0 mm1 mm2 mm3 mm4 mm5 mm6 mm7 xmm0  xmm1  xmm2  xmm3  xmm4  xmm5  xmm6  xmm7  xmm8  xmm9 xmm10  xmm11 xmm12 xmm13 xmm14 xmm15 xmm16 xmm17 xmm18 xmm19 xmm20 xmm21 xmm22 xmm23 xmm24 xmm25 xmm26 xmm27 xmm28 xmm29 xmm30 xmm31 ymm0  ymm1  ymm2  ymm3  ymm4  ymm5  ymm6  ymm7  ymm8  ymm9 ymm10  ymm11 ymm12 ymm13 ymm14 ymm15 ymm16 ymm17 ymm18 ymm19 ymm20 ymm21 ymm22 ymm23 ymm24 ymm25 ymm26 ymm27 ymm28 ymm29 ymm30 ymm31 zmm0  zmm1  zmm2  zmm3  zmm4  zmm5  zmm6  zmm7  zmm8  zmm9 zmm10  zmm11 zmm12 zmm13 zmm14 zmm15 zmm16 zmm17 zmm18 zmm19 zmm20 zmm21 zmm22 zmm23 zmm24 zmm25 zmm26 zmm27 zmm28 zmm29 zmm30 zmm31 k0 k1 k2 k3 k4 k5 k6 k7 bnd0 bnd1 bnd2 bnd3 cr0 cr1 cr2 cr3 cr4 cr8 dr0 dr1 dr2 dr3 dr8 tr3 tr4 tr5 tr6 tr7 r0 r1 r2 r3 r4 r5 r6 r7 r0b r1b r2b r3b r4b r5b r6b r7b r0w r1w r2w r3w r4w r5w r6w r7w r0d r1d r2d r3d r4d r5d r6d r7d r0h r1h r2h r3h r0l r1l r2l r3l r4l r5l r6l r7l r8l r9l r10l r11l r12l r13l r14l r15l db dw dd dq dt ddq do dy dz resb resw resd resq rest resdq reso resy resz incbin equ times byte word dword qword nosplit rel abs seg wrt strict near far a32 ptr"
      ),
      meta: "%define %xdefine %+ %undef %defstr %deftok %assign %strcat %strlen %substr %rotate %elif %else %endif %if %ifmacro %ifctx %ifidn %ifidni %ifid %ifnum %ifstr %iftoken %ifempty %ifenv %error %warning %fatal %rep %endrep %include %push %pop %repl %pathsearch %depend %use %arg %stacksize %local %line %comment %endcomment .nolist __FILE__ __LINE__ __SECT__  __BITS__ __OUTPUT_FORMAT__ __DATE__ __TIME__ __DATE_NUM__ __TIME_NUM__ __UTC_DATE__ __UTC_TIME__ __UTC_DATE_NUM__ __UTC_TIME_NUM__  __PASS__ struc endstruc istruc at iend align alignb sectalign daz nodaz up down zero default option assume public bits use16 use32 use64 default section segment absolute extern global common cpu float __utf16__ __utf16le__ __utf16be__ __utf32__ __utf32le__ __utf32be__ __float8__ __float16__ __float32__ __float64__ __float80m__ __float80e__ __float128l__ __float128h__ __Infinity__ __QNaN__ __SNaN__ Inf NaN QNaN SNaN float8 float16 float32 float64 float80m float80e float128l float128h __FLOAT_DAZ__ __FLOAT_ROUND__ __FLOAT__"
    },
    contains: [
      t.COMMENT(
        ";",
        "$",
        { relevance: 0 }
      ),
      {
        className: "number",
        variants: [
          // Float number and x87 BCD
          {
            begin: "\\b(?:([0-9][0-9_]*)?\\.[0-9_]*(?:[eE][+-]?[0-9_]+)?|(0[Xx])?[0-9][0-9_]*(\\.[0-9_]*)?(?:[pP](?:[+-]?[0-9_]+)?)?)\\b",
            relevance: 0
          },
          // Hex number in $
          {
            begin: "\\$[0-9][0-9A-Fa-f]*",
            relevance: 0
          },
          // Number in H,D,T,Q,O,B,Y suffix
          { begin: "\\b(?:[0-9A-Fa-f][0-9A-Fa-f_]*[Hh]|[0-9][0-9_]*[DdTt]?|[0-7][0-7_]*[QqOo]|[0-1][0-1_]*[BbYy])\\b" },
          // Number in X,D,T,Q,O,B,Y prefix
          { begin: "\\b(?:0[Xx][0-9A-Fa-f_]+|0[DdTt][0-9_]+|0[QqOo][0-7_]+|0[BbYy][0-1_]+)\\b" }
        ]
      },
      // Double quote string
      t.QUOTE_STRING_MODE,
      {
        className: "string",
        variants: [
          // Single-quoted string
          {
            begin: "'",
            end: "[^\\\\]'"
          },
          // Backquoted string
          {
            begin: "`",
            end: "[^\\\\]`"
          }
        ],
        relevance: 0
      },
      {
        className: "symbol",
        variants: [
          // Global label and local label
          { begin: "^\\s*[A-Za-z._?][A-Za-z0-9_$#@~.?]*(:|\\s+label)" },
          // Macro-local label
          { begin: "^\\s*%%[A-Za-z0-9_$#@~.?]*:" }
        ],
        relevance: 0
      },
      // Macro parameter
      {
        className: "subst",
        begin: "%[0-9]+",
        relevance: 0
      },
      // Macro parameter
      {
        className: "subst",
        begin: "%!S+",
        relevance: 0
      },
      {
        className: "meta",
        begin: /^\s*\.[\w_-]+/
      }
    ]
  };
}
function Nw(t) {
  const e = [
    "if",
    "then",
    "else",
    "do",
    "while",
    "until",
    "for",
    "loop",
    "import",
    "with",
    "is",
    "as",
    "where",
    "when",
    "by",
    "data",
    "constant",
    "integer",
    "real",
    "text",
    "name",
    "boolean",
    "symbol",
    "infix",
    "prefix",
    "postfix",
    "block",
    "tree"
  ], n = [
    "in",
    "mod",
    "rem",
    "and",
    "or",
    "xor",
    "not",
    "abs",
    "sign",
    "floor",
    "ceil",
    "sqrt",
    "sin",
    "cos",
    "tan",
    "asin",
    "acos",
    "atan",
    "exp",
    "expm1",
    "log",
    "log2",
    "log10",
    "log1p",
    "pi",
    "at",
    "text_length",
    "text_range",
    "text_find",
    "text_replace",
    "contains",
    "page",
    "slide",
    "basic_slide",
    "title_slide",
    "title",
    "subtitle",
    "fade_in",
    "fade_out",
    "fade_at",
    "clear_color",
    "color",
    "line_color",
    "line_width",
    "texture_wrap",
    "texture_transform",
    "texture",
    "scale_?x",
    "scale_?y",
    "scale_?z?",
    "translate_?x",
    "translate_?y",
    "translate_?z?",
    "rotate_?x",
    "rotate_?y",
    "rotate_?z?",
    "rectangle",
    "circle",
    "ellipse",
    "sphere",
    "path",
    "line_to",
    "move_to",
    "quad_to",
    "curve_to",
    "theme",
    "background",
    "contents",
    "locally",
    "time",
    "mouse_?x",
    "mouse_?y",
    "mouse_buttons"
  ], r = [
    "ObjectLoader",
    "Animate",
    "MovieCredits",
    "Slides",
    "Filters",
    "Shading",
    "Materials",
    "LensFlare",
    "Mapping",
    "VLCAudioVideo",
    "StereoDecoder",
    "PointCloud",
    "NetworkAccess",
    "RemoteControl",
    "RegExp",
    "ChromaKey",
    "Snowfall",
    "NodeJS",
    "Speech",
    "Charts"
  ], o = {
    $pattern: /[a-zA-Z][a-zA-Z0-9_?]*/,
    keyword: e,
    literal: [
      "true",
      "false",
      "nil"
    ],
    built_in: n.concat(r)
  }, a = {
    className: "string",
    begin: '"',
    end: '"',
    illegal: "\\n"
  }, s = {
    className: "string",
    begin: "'",
    end: "'",
    illegal: "\\n"
  }, l = {
    className: "string",
    begin: "<<",
    end: ">>"
  }, c = {
    className: "number",
    begin: "[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?"
  }, u = {
    beginKeywords: "import",
    end: "$",
    keywords: o,
    contains: [a]
  }, d = {
    className: "function",
    begin: /[a-z][^\n]*->/,
    returnBegin: !0,
    end: /->/,
    contains: [
      t.inherit(t.TITLE_MODE, { starts: {
        endsWithParent: !0,
        keywords: o
      } })
    ]
  };
  return {
    name: "XL",
    aliases: ["tao"],
    keywords: o,
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      a,
      s,
      l,
      d,
      u,
      c,
      t.NUMBER_MODE
    ]
  };
}
function Aw(t) {
  return {
    name: "XQuery",
    aliases: [
      "xpath",
      "xq",
      "xqm"
    ],
    case_insensitive: !1,
    illegal: /(proc)|(abstract)|(extends)|(until)|(#)/,
    keywords: {
      $pattern: /[a-zA-Z$][a-zA-Z0-9_:-]*/,
      keyword: [
        "module",
        "schema",
        "namespace",
        "boundary-space",
        "preserve",
        "no-preserve",
        "strip",
        "default",
        "collation",
        "base-uri",
        "ordering",
        "context",
        "decimal-format",
        "decimal-separator",
        "copy-namespaces",
        "empty-sequence",
        "except",
        "exponent-separator",
        "external",
        "grouping-separator",
        "inherit",
        "no-inherit",
        "lax",
        "minus-sign",
        "per-mille",
        "percent",
        "schema-attribute",
        "schema-element",
        "strict",
        "unordered",
        "zero-digit",
        "declare",
        "import",
        "option",
        "function",
        "validate",
        "variable",
        "for",
        "at",
        "in",
        "let",
        "where",
        "order",
        "group",
        "by",
        "return",
        "if",
        "then",
        "else",
        "tumbling",
        "sliding",
        "window",
        "start",
        "when",
        "only",
        "end",
        "previous",
        "next",
        "stable",
        "ascending",
        "descending",
        "allowing",
        "empty",
        "greatest",
        "least",
        "some",
        "every",
        "satisfies",
        "switch",
        "case",
        "typeswitch",
        "try",
        "catch",
        "and",
        "or",
        "to",
        "union",
        "intersect",
        "instance",
        "of",
        "treat",
        "as",
        "castable",
        "cast",
        "map",
        "array",
        "delete",
        "insert",
        "into",
        "replace",
        "value",
        "rename",
        "copy",
        "modify",
        "update"
      ],
      type: [
        "item",
        "document-node",
        "node",
        "attribute",
        "document",
        "element",
        "comment",
        "namespace",
        "namespace-node",
        "processing-instruction",
        "text",
        "construction",
        "xs:anyAtomicType",
        "xs:untypedAtomic",
        "xs:duration",
        "xs:time",
        "xs:decimal",
        "xs:float",
        "xs:double",
        "xs:gYearMonth",
        "xs:gYear",
        "xs:gMonthDay",
        "xs:gMonth",
        "xs:gDay",
        "xs:boolean",
        "xs:base64Binary",
        "xs:hexBinary",
        "xs:anyURI",
        "xs:QName",
        "xs:NOTATION",
        "xs:dateTime",
        "xs:dateTimeStamp",
        "xs:date",
        "xs:string",
        "xs:normalizedString",
        "xs:token",
        "xs:language",
        "xs:NMTOKEN",
        "xs:Name",
        "xs:NCName",
        "xs:ID",
        "xs:IDREF",
        "xs:ENTITY",
        "xs:integer",
        "xs:nonPositiveInteger",
        "xs:negativeInteger",
        "xs:long",
        "xs:int",
        "xs:short",
        "xs:byte",
        "xs:nonNegativeInteger",
        "xs:unisignedLong",
        "xs:unsignedInt",
        "xs:unsignedShort",
        "xs:unsignedByte",
        "xs:positiveInteger",
        "xs:yearMonthDuration",
        "xs:dayTimeDuration"
      ],
      literal: [
        "eq",
        "ne",
        "lt",
        "le",
        "gt",
        "ge",
        "is",
        "self::",
        "child::",
        "descendant::",
        "descendant-or-self::",
        "attribute::",
        "following::",
        "following-sibling::",
        "parent::",
        "ancestor::",
        "ancestor-or-self::",
        "preceding::",
        "preceding-sibling::",
        "NaN"
      ]
    },
    contains: [
      {
        className: "variable",
        begin: /[$][\w\-:]+/
      },
      {
        className: "built_in",
        variants: [
          {
            begin: /\barray:/,
            end: /(?:append|filter|flatten|fold-(?:left|right)|for-each(?:-pair)?|get|head|insert-before|join|put|remove|reverse|size|sort|subarray|tail)\b/
          },
          {
            begin: /\bmap:/,
            end: /(?:contains|entry|find|for-each|get|keys|merge|put|remove|size)\b/
          },
          {
            begin: /\bmath:/,
            end: /(?:a(?:cos|sin|tan[2]?)|cos|exp(?:10)?|log(?:10)?|pi|pow|sin|sqrt|tan)\b/
          },
          {
            begin: /\bop:/,
            end: /\(/,
            excludeEnd: !0
          },
          {
            begin: /\bfn:/,
            end: /\(/,
            excludeEnd: !0
          },
          // do not highlight inbuilt strings as variable or xml element names
          { begin: /[^</$:'"-]\b(?:abs|accumulator-(?:after|before)|adjust-(?:date(?:Time)?|time)-to-timezone|analyze-string|apply|available-(?:environment-variables|system-properties)|avg|base-uri|boolean|ceiling|codepoints?-(?:equal|to-string)|collation-key|collection|compare|concat|contains(?:-token)?|copy-of|count|current(?:-)?(?:date(?:Time)?|time|group(?:ing-key)?|output-uri|merge-(?:group|key))?data|dateTime|days?-from-(?:date(?:Time)?|duration)|deep-equal|default-(?:collation|language)|distinct-values|document(?:-uri)?|doc(?:-available)?|element-(?:available|with-id)|empty|encode-for-uri|ends-with|environment-variable|error|escape-html-uri|exactly-one|exists|false|filter|floor|fold-(?:left|right)|for-each(?:-pair)?|format-(?:date(?:Time)?|time|integer|number)|function-(?:arity|available|lookup|name)|generate-id|has-children|head|hours-from-(?:dateTime|duration|time)|id(?:ref)?|implicit-timezone|in-scope-prefixes|index-of|innermost|insert-before|iri-to-uri|json-(?:doc|to-xml)|key|lang|last|load-xquery-module|local-name(?:-from-QName)?|(?:lower|upper)-case|matches|max|minutes-from-(?:dateTime|duration|time)|min|months?-from-(?:date(?:Time)?|duration)|name(?:space-uri-?(?:for-prefix|from-QName)?)?|nilled|node-name|normalize-(?:space|unicode)|not|number|one-or-more|outermost|parse-(?:ietf-date|json)|path|position|(?:prefix-from-)?QName|random-number-generator|regex-group|remove|replace|resolve-(?:QName|uri)|reverse|root|round(?:-half-to-even)?|seconds-from-(?:dateTime|duration|time)|snapshot|sort|starts-with|static-base-uri|stream-available|string-?(?:join|length|to-codepoints)?|subsequence|substring-?(?:after|before)?|sum|system-property|tail|timezone-from-(?:date(?:Time)?|time)|tokenize|trace|trans(?:form|late)|true|type-available|unordered|unparsed-(?:entity|text)?-?(?:public-id|uri|available|lines)?|uri-collection|xml-to-json|years?-from-(?:date(?:Time)?|duration)|zero-or-one)\b/ },
          {
            begin: /\blocal:/,
            end: /\(/,
            excludeEnd: !0
          },
          {
            begin: /\bzip:/,
            end: /(?:zip-file|(?:xml|html|text|binary)-entry| (?:update-)?entries)\b/
          },
          {
            begin: /\b(?:util|db|functx|app|xdmp|xmldb):/,
            end: /\(/,
            excludeEnd: !0
          }
        ]
      },
      {
        className: "string",
        variants: [
          {
            begin: /"/,
            end: /"/,
            contains: [
              {
                begin: /""/,
                relevance: 0
              }
            ]
          },
          {
            begin: /'/,
            end: /'/,
            contains: [
              {
                begin: /''/,
                relevance: 0
              }
            ]
          }
        ]
      },
      {
        className: "number",
        begin: /(\b0[0-7_]+)|(\b0x[0-9a-fA-F_]+)|(\b[1-9][0-9_]*(\.[0-9_]+)?)|[0_]\b/,
        relevance: 0
      },
      {
        className: "comment",
        begin: /\(:/,
        end: /:\)/,
        relevance: 10,
        contains: [
          {
            className: "doctag",
            begin: /@\w+/
          }
        ]
      },
      {
        className: "meta",
        begin: /%[\w\-:]+/
      },
      {
        className: "title",
        begin: /\bxquery version "[13]\.[01]"\s?(?:encoding ".+")?/,
        end: /;/
      },
      {
        beginKeywords: "element attribute comment document processing-instruction",
        end: /\{/,
        excludeEnd: !0
      },
      {
        begin: /<([\w._:-]+)(\s+\S*=('|").*('|"))?>/,
        end: /(\/[\w._:-]+>)/,
        subLanguage: "xml",
        contains: [
          {
            begin: /\{/,
            end: /\}/,
            subLanguage: "xquery"
          },
          "self"
        ]
      }
    ]
  };
}
function Iw(t) {
  const e = {
    className: "string",
    contains: [t.BACKSLASH_ESCAPE],
    variants: [
      t.inherit(t.APOS_STRING_MODE, { illegal: null }),
      t.inherit(t.QUOTE_STRING_MODE, { illegal: null })
    ]
  }, n = t.UNDERSCORE_TITLE_MODE, r = { variants: [
    t.BINARY_NUMBER_MODE,
    t.C_NUMBER_MODE
  ] }, i = (
    // classes and objects
    "namespace class interface use extends function return abstract final public protected private static deprecated throw try catch Exception echo empty isset instanceof unset let var new const self require if else elseif switch case default do while loop for continue break likely unlikely __LINE__ __FILE__ __DIR__ __FUNCTION__ __CLASS__ __TRAIT__ __METHOD__ __NAMESPACE__ array boolean float double integer object resource string char long unsigned bool int uint ulong uchar true false null undefined"
  );
  return {
    name: "Zephir",
    aliases: ["zep"],
    keywords: i,
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.COMMENT(
        /\/\*/,
        /\*\//,
        { contains: [
          {
            className: "doctag",
            begin: /@[A-Za-z]+/
          }
        ] }
      ),
      {
        className: "string",
        begin: /<<<['"]?\w+['"]?$/,
        end: /^\w+;/,
        contains: [t.BACKSLASH_ESCAPE]
      },
      {
        // swallow composed identifiers to avoid parsing them as keywords
        begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/
      },
      {
        className: "function",
        beginKeywords: "function fn",
        end: /[;{]/,
        excludeEnd: !0,
        illegal: /\$|\[|%/,
        contains: [
          n,
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            keywords: i,
            contains: [
              "self",
              t.C_BLOCK_COMMENT_MODE,
              e,
              r
            ]
          }
        ]
      },
      {
        className: "class",
        beginKeywords: "class interface",
        end: /\{/,
        excludeEnd: !0,
        illegal: /[:($"]/,
        contains: [
          { beginKeywords: "extends implements" },
          n
        ]
      },
      {
        beginKeywords: "namespace",
        end: /;/,
        illegal: /[.']/,
        contains: [n]
      },
      {
        beginKeywords: "use",
        end: /;/,
        contains: [n]
      },
      {
        begin: /=>/
        // No markup, just a relevance booster
      },
      e,
      r
    ]
  };
}
function xw(t) {
  const e = t.regex, n = t.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), r = "decltype\\(auto\\)", i = "[a-zA-Z_]\\w*::", a = "(?!struct)(" + r + "|" + e.optional(i) + "[a-zA-Z_]\\w*" + e.optional("<[^<>]+>") + ")", s = {
    className: "type",
    begin: "\\b[a-z\\d_]*_t\\b"
  }, c = {
    className: "string",
    variants: [
      {
        begin: '(u8?|U|L)?"',
        end: '"',
        illegal: "\\n",
        contains: [t.BACKSLASH_ESCAPE]
      },
      {
        begin: "(u8?|U|L)?'(" + "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)" + "|.)",
        end: "'",
        illegal: "."
      },
      t.END_SAME_AS_BEGIN({
        begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,
        end: /\)([^()\\ ]{0,16})"/
      })
    ]
  }, u = {
    className: "number",
    variants: [
      // Floating-point literal.
      {
        begin: "[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"
      },
      // Integer literal.
      {
        begin: "[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"
        // Note: there are user-defined literal suffixes too, but perhaps having the custom suffix not part of the
        // literal highlight actually makes it stand out more.
      }
    ],
    relevance: 0
  }, d = {
    className: "meta",
    begin: /#\s*[a-z]+\b/,
    end: /$/,
    keywords: { keyword: "if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" },
    contains: [
      {
        begin: /\\\n/,
        relevance: 0
      },
      t.inherit(c, { className: "string" }),
      {
        className: "string",
        begin: /<.*?>/
      },
      n,
      t.C_BLOCK_COMMENT_MODE
    ]
  }, p = {
    className: "title",
    begin: e.optional(i) + t.IDENT_RE,
    relevance: 0
  }, _ = e.optional(i) + t.IDENT_RE + "\\s*\\(", m = [
    "alignas",
    "alignof",
    "and",
    "and_eq",
    "asm",
    "atomic_cancel",
    "atomic_commit",
    "atomic_noexcept",
    "auto",
    "bitand",
    "bitor",
    "break",
    "case",
    "catch",
    "class",
    "co_await",
    "co_return",
    "co_yield",
    "compl",
    "concept",
    "const_cast|10",
    "consteval",
    "constexpr",
    "constinit",
    "continue",
    "decltype",
    "default",
    "delete",
    "do",
    "dynamic_cast|10",
    "else",
    "enum",
    "explicit",
    "export",
    "extern",
    "false",
    "final",
    "for",
    "friend",
    "goto",
    "if",
    "import",
    "inline",
    "module",
    "mutable",
    "namespace",
    "new",
    "noexcept",
    "not",
    "not_eq",
    "nullptr",
    "operator",
    "or",
    "or_eq",
    "override",
    "private",
    "protected",
    "public",
    "reflexpr",
    "register",
    "reinterpret_cast|10",
    "requires",
    "return",
    "sizeof",
    "static_assert",
    "static_cast|10",
    "struct",
    "switch",
    "synchronized",
    "template",
    "this",
    "thread_local",
    "throw",
    "transaction_safe",
    "transaction_safe_dynamic",
    "true",
    "try",
    "typedef",
    "typeid",
    "typename",
    "union",
    "using",
    "virtual",
    "volatile",
    "while",
    "xor",
    "xor_eq"
  ], f = [
    "bool",
    "char",
    "char16_t",
    "char32_t",
    "char8_t",
    "double",
    "float",
    "int",
    "long",
    "short",
    "void",
    "wchar_t",
    "unsigned",
    "signed",
    "const",
    "static"
  ], g = [
    "any",
    "auto_ptr",
    "barrier",
    "binary_semaphore",
    "bitset",
    "complex",
    "condition_variable",
    "condition_variable_any",
    "counting_semaphore",
    "deque",
    "false_type",
    "flat_map",
    "flat_set",
    "future",
    "imaginary",
    "initializer_list",
    "istringstream",
    "jthread",
    "latch",
    "lock_guard",
    "multimap",
    "multiset",
    "mutex",
    "optional",
    "ostringstream",
    "packaged_task",
    "pair",
    "promise",
    "priority_queue",
    "queue",
    "recursive_mutex",
    "recursive_timed_mutex",
    "scoped_lock",
    "set",
    "shared_future",
    "shared_lock",
    "shared_mutex",
    "shared_timed_mutex",
    "shared_ptr",
    "stack",
    "string_view",
    "stringstream",
    "timed_mutex",
    "thread",
    "true_type",
    "tuple",
    "unique_lock",
    "unique_ptr",
    "unordered_map",
    "unordered_multimap",
    "unordered_multiset",
    "unordered_set",
    "variant",
    "vector",
    "weak_ptr",
    "wstring",
    "wstring_view"
  ], S = [
    "abort",
    "abs",
    "acos",
    "apply",
    "as_const",
    "asin",
    "atan",
    "atan2",
    "calloc",
    "ceil",
    "cerr",
    "cin",
    "clog",
    "cos",
    "cosh",
    "cout",
    "declval",
    "endl",
    "exchange",
    "exit",
    "exp",
    "fabs",
    "floor",
    "fmod",
    "forward",
    "fprintf",
    "fputs",
    "free",
    "frexp",
    "fscanf",
    "future",
    "invoke",
    "isalnum",
    "isalpha",
    "iscntrl",
    "isdigit",
    "isgraph",
    "islower",
    "isprint",
    "ispunct",
    "isspace",
    "isupper",
    "isxdigit",
    "labs",
    "launder",
    "ldexp",
    "log",
    "log10",
    "make_pair",
    "make_shared",
    "make_shared_for_overwrite",
    "make_tuple",
    "make_unique",
    "malloc",
    "memchr",
    "memcmp",
    "memcpy",
    "memset",
    "modf",
    "move",
    "pow",
    "printf",
    "putchar",
    "puts",
    "realloc",
    "scanf",
    "sin",
    "sinh",
    "snprintf",
    "sprintf",
    "sqrt",
    "sscanf",
    "std",
    "stderr",
    "stdin",
    "stdout",
    "strcat",
    "strchr",
    "strcmp",
    "strcpy",
    "strcspn",
    "strlen",
    "strncat",
    "strncmp",
    "strncpy",
    "strpbrk",
    "strrchr",
    "strspn",
    "strstr",
    "swap",
    "tan",
    "tanh",
    "terminate",
    "to_underlying",
    "tolower",
    "toupper",
    "vfprintf",
    "visit",
    "vprintf",
    "vsprintf"
  ], h = {
    type: f,
    keyword: m,
    literal: [
      "NULL",
      "false",
      "nullopt",
      "nullptr",
      "true"
    ],
    built_in: ["_Pragma"],
    _type_hints: g
  }, T = {
    className: "function.dispatch",
    relevance: 0,
    keywords: {
      // Only for relevance, not highlighting.
      _hint: S
    },
    begin: e.concat(
      /\b/,
      /(?!decltype)/,
      /(?!if)/,
      /(?!for)/,
      /(?!switch)/,
      /(?!while)/,
      t.IDENT_RE,
      e.lookahead(/(<[^<>]+>|)\s*\(/)
    )
  }, C = [
    T,
    d,
    s,
    n,
    t.C_BLOCK_COMMENT_MODE,
    u,
    c
  ], v = {
    // This mode covers expression context where we can't expect a function
    // definition and shouldn't highlight anything that looks like one:
    // `return some()`, `else if()`, `(x*sum(1, 2))`
    variants: [
      {
        begin: /=/,
        end: /;/
      },
      {
        begin: /\(/,
        end: /\)/
      },
      {
        beginKeywords: "new throw return else",
        end: /;/
      }
    ],
    keywords: h,
    contains: C.concat([
      {
        begin: /\(/,
        end: /\)/,
        keywords: h,
        contains: C.concat(["self"]),
        relevance: 0
      }
    ]),
    relevance: 0
  }, I = {
    className: "function",
    begin: "(" + a + "[\\*&\\s]+)+" + _,
    returnBegin: !0,
    end: /[{;=]/,
    excludeEnd: !0,
    keywords: h,
    illegal: /[^\w\s\*&:<>.]/,
    contains: [
      {
        // to prevent it from being confused as the function title
        begin: r,
        keywords: h,
        relevance: 0
      },
      {
        begin: _,
        returnBegin: !0,
        contains: [p],
        relevance: 0
      },
      // needed because we do not have look-behind on the below rule
      // to prevent it from grabbing the final : in a :: pair
      {
        begin: /::/,
        relevance: 0
      },
      // initializers
      {
        begin: /:/,
        endsWithParent: !0,
        contains: [
          c,
          u
        ]
      },
      // allow for multiple declarations, e.g.:
      // extern void f(int), g(char);
      {
        relevance: 0,
        match: /,/
      },
      {
        className: "params",
        begin: /\(/,
        end: /\)/,
        keywords: h,
        relevance: 0,
        contains: [
          n,
          t.C_BLOCK_COMMENT_MODE,
          c,
          u,
          s,
          // Count matching parentheses.
          {
            begin: /\(/,
            end: /\)/,
            keywords: h,
            relevance: 0,
            contains: [
              "self",
              n,
              t.C_BLOCK_COMMENT_MODE,
              c,
              u,
              s
            ]
          }
        ]
      },
      s,
      n,
      t.C_BLOCK_COMMENT_MODE,
      d
    ]
  };
  return {
    name: "C++",
    aliases: [
      "cc",
      "c++",
      "h++",
      "hpp",
      "hh",
      "hxx",
      "cxx"
    ],
    keywords: h,
    illegal: "</",
    classNameAliases: { "function.dispatch": "built_in" },
    contains: [].concat(
      v,
      I,
      T,
      C,
      [
        d,
        {
          // containers: ie, `vector <int> rooms (9);`
          begin: "\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",
          end: ">",
          keywords: h,
          contains: [
            "self",
            s
          ]
        },
        {
          begin: t.IDENT_RE + "::",
          keywords: h
        },
        {
          match: [
            // extra complexity to deal with `enum class` and `enum struct`
            /\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,
            /\s+/,
            /\w+/
          ],
          className: {
            1: "keyword",
            3: "title.class"
          }
        }
      ]
    )
  };
}
function Dw(t) {
  const e = {
    type: [
      "boolean",
      "byte",
      "word",
      "String"
    ],
    built_in: [
      "KeyboardController",
      "MouseController",
      "SoftwareSerial",
      "EthernetServer",
      "EthernetClient",
      "LiquidCrystal",
      "RobotControl",
      "GSMVoiceCall",
      "EthernetUDP",
      "EsploraTFT",
      "HttpClient",
      "RobotMotor",
      "WiFiClient",
      "GSMScanner",
      "FileSystem",
      "Scheduler",
      "GSMServer",
      "YunClient",
      "YunServer",
      "IPAddress",
      "GSMClient",
      "GSMModem",
      "Keyboard",
      "Ethernet",
      "Console",
      "GSMBand",
      "Esplora",
      "Stepper",
      "Process",
      "WiFiUDP",
      "GSM_SMS",
      "Mailbox",
      "USBHost",
      "Firmata",
      "PImage",
      "Client",
      "Server",
      "GSMPIN",
      "FileIO",
      "Bridge",
      "Serial",
      "EEPROM",
      "Stream",
      "Mouse",
      "Audio",
      "Servo",
      "File",
      "Task",
      "GPRS",
      "WiFi",
      "Wire",
      "TFT",
      "GSM",
      "SPI",
      "SD"
    ],
    _hints: [
      "setup",
      "loop",
      "runShellCommandAsynchronously",
      "analogWriteResolution",
      "retrieveCallingNumber",
      "printFirmwareVersion",
      "analogReadResolution",
      "sendDigitalPortPair",
      "noListenOnLocalhost",
      "readJoystickButton",
      "setFirmwareVersion",
      "readJoystickSwitch",
      "scrollDisplayRight",
      "getVoiceCallStatus",
      "scrollDisplayLeft",
      "writeMicroseconds",
      "delayMicroseconds",
      "beginTransmission",
      "getSignalStrength",
      "runAsynchronously",
      "getAsynchronously",
      "listenOnLocalhost",
      "getCurrentCarrier",
      "readAccelerometer",
      "messageAvailable",
      "sendDigitalPorts",
      "lineFollowConfig",
      "countryNameWrite",
      "runShellCommand",
      "readStringUntil",
      "rewindDirectory",
      "readTemperature",
      "setClockDivider",
      "readLightSensor",
      "endTransmission",
      "analogReference",
      "detachInterrupt",
      "countryNameRead",
      "attachInterrupt",
      "encryptionType",
      "readBytesUntil",
      "robotNameWrite",
      "readMicrophone",
      "robotNameRead",
      "cityNameWrite",
      "userNameWrite",
      "readJoystickY",
      "readJoystickX",
      "mouseReleased",
      "openNextFile",
      "scanNetworks",
      "noInterrupts",
      "digitalWrite",
      "beginSpeaker",
      "mousePressed",
      "isActionDone",
      "mouseDragged",
      "displayLogos",
      "noAutoscroll",
      "addParameter",
      "remoteNumber",
      "getModifiers",
      "keyboardRead",
      "userNameRead",
      "waitContinue",
      "processInput",
      "parseCommand",
      "printVersion",
      "readNetworks",
      "writeMessage",
      "blinkVersion",
      "cityNameRead",
      "readMessage",
      "setDataMode",
      "parsePacket",
      "isListening",
      "setBitOrder",
      "beginPacket",
      "isDirectory",
      "motorsWrite",
      "drawCompass",
      "digitalRead",
      "clearScreen",
      "serialEvent",
      "rightToLeft",
      "setTextSize",
      "leftToRight",
      "requestFrom",
      "keyReleased",
      "compassRead",
      "analogWrite",
      "interrupts",
      "WiFiServer",
      "disconnect",
      "playMelody",
      "parseFloat",
      "autoscroll",
      "getPINUsed",
      "setPINUsed",
      "setTimeout",
      "sendAnalog",
      "readSlider",
      "analogRead",
      "beginWrite",
      "createChar",
      "motorsStop",
      "keyPressed",
      "tempoWrite",
      "readButton",
      "subnetMask",
      "debugPrint",
      "macAddress",
      "writeGreen",
      "randomSeed",
      "attachGPRS",
      "readString",
      "sendString",
      "remotePort",
      "releaseAll",
      "mouseMoved",
      "background",
      "getXChange",
      "getYChange",
      "answerCall",
      "getResult",
      "voiceCall",
      "endPacket",
      "constrain",
      "getSocket",
      "writeJSON",
      "getButton",
      "available",
      "connected",
      "findUntil",
      "readBytes",
      "exitValue",
      "readGreen",
      "writeBlue",
      "startLoop",
      "IPAddress",
      "isPressed",
      "sendSysex",
      "pauseMode",
      "gatewayIP",
      "setCursor",
      "getOemKey",
      "tuneWrite",
      "noDisplay",
      "loadImage",
      "switchPIN",
      "onRequest",
      "onReceive",
      "changePIN",
      "playFile",
      "noBuffer",
      "parseInt",
      "overflow",
      "checkPIN",
      "knobRead",
      "beginTFT",
      "bitClear",
      "updateIR",
      "bitWrite",
      "position",
      "writeRGB",
      "highByte",
      "writeRed",
      "setSpeed",
      "readBlue",
      "noStroke",
      "remoteIP",
      "transfer",
      "shutdown",
      "hangCall",
      "beginSMS",
      "endWrite",
      "attached",
      "maintain",
      "noCursor",
      "checkReg",
      "checkPUK",
      "shiftOut",
      "isValid",
      "shiftIn",
      "pulseIn",
      "connect",
      "println",
      "localIP",
      "pinMode",
      "getIMEI",
      "display",
      "noBlink",
      "process",
      "getBand",
      "running",
      "beginSD",
      "drawBMP",
      "lowByte",
      "setBand",
      "release",
      "bitRead",
      "prepare",
      "pointTo",
      "readRed",
      "setMode",
      "noFill",
      "remove",
      "listen",
      "stroke",
      "detach",
      "attach",
      "noTone",
      "exists",
      "buffer",
      "height",
      "bitSet",
      "circle",
      "config",
      "cursor",
      "random",
      "IRread",
      "setDNS",
      "endSMS",
      "getKey",
      "micros",
      "millis",
      "begin",
      "print",
      "write",
      "ready",
      "flush",
      "width",
      "isPIN",
      "blink",
      "clear",
      "press",
      "mkdir",
      "rmdir",
      "close",
      "point",
      "yield",
      "image",
      "BSSID",
      "click",
      "delay",
      "read",
      "text",
      "move",
      "peek",
      "beep",
      "rect",
      "line",
      "open",
      "seek",
      "fill",
      "size",
      "turn",
      "stop",
      "home",
      "find",
      "step",
      "tone",
      "sqrt",
      "RSSI",
      "SSID",
      "end",
      "bit",
      "tan",
      "cos",
      "sin",
      "pow",
      "map",
      "abs",
      "max",
      "min",
      "get",
      "run",
      "put"
    ],
    literal: [
      "DIGITAL_MESSAGE",
      "FIRMATA_STRING",
      "ANALOG_MESSAGE",
      "REPORT_DIGITAL",
      "REPORT_ANALOG",
      "INPUT_PULLUP",
      "SET_PIN_MODE",
      "INTERNAL2V56",
      "SYSTEM_RESET",
      "LED_BUILTIN",
      "INTERNAL1V1",
      "SYSEX_START",
      "INTERNAL",
      "EXTERNAL",
      "DEFAULT",
      "OUTPUT",
      "INPUT",
      "HIGH",
      "LOW"
    ]
  }, n = xw(t), r = (
    /** @type {Record<string,any>} */
    n.keywords
  );
  return r.type = [
    ...r.type,
    ...e.type
  ], r.literal = [
    ...r.literal,
    ...e.literal
  ], r.built_in = [
    ...r.built_in,
    ...e.built_in
  ], r._hints = e._hints, n.name = "Arduino", n.aliases = ["ino"], n.supersetOf = "cpp", n;
}
function ww(t) {
  const e = t.regex, n = {}, r = {
    begin: /\$\{/,
    end: /\}/,
    contains: [
      "self",
      {
        begin: /:-/,
        contains: [n]
      }
      // default values
    ]
  };
  Object.assign(n, {
    className: "variable",
    variants: [
      { begin: e.concat(
        /\$[\w\d#@][\w\d_]*/,
        // negative look-ahead tries to avoid matching patterns that are not
        // Perl at all like $ident$, @ident@, etc.
        "(?![\\w\\d])(?![$])"
      ) },
      r
    ]
  });
  const i = {
    className: "subst",
    begin: /\$\(/,
    end: /\)/,
    contains: [t.BACKSLASH_ESCAPE]
  }, o = t.inherit(
    t.COMMENT(),
    {
      match: [
        /(^|\s)/,
        /#.*$/
      ],
      scope: {
        2: "comment"
      }
    }
  ), a = {
    begin: /<<-?\s*(?=\w+)/,
    starts: { contains: [
      t.END_SAME_AS_BEGIN({
        begin: /(\w+)/,
        end: /(\w+)/,
        className: "string"
      })
    ] }
  }, s = {
    className: "string",
    begin: /"/,
    end: /"/,
    contains: [
      t.BACKSLASH_ESCAPE,
      n,
      i
    ]
  };
  i.contains.push(s);
  const l = {
    match: /\\"/
  }, c = {
    className: "string",
    begin: /'/,
    end: /'/
  }, u = {
    match: /\\'/
  }, d = {
    begin: /\$?\(\(/,
    end: /\)\)/,
    contains: [
      {
        begin: /\d+#[0-9a-f]+/,
        className: "number"
      },
      t.NUMBER_MODE,
      n
    ]
  }, p = [
    "fish",
    "bash",
    "zsh",
    "sh",
    "csh",
    "ksh",
    "tcsh",
    "dash",
    "scsh"
  ], _ = t.SHEBANG({
    binary: `(${p.join("|")})`,
    relevance: 10
  }), m = {
    className: "function",
    begin: /\w[\w\d_]*\s*\(\s*\)\s*\{/,
    returnBegin: !0,
    contains: [t.inherit(t.TITLE_MODE, { begin: /\w[\w\d_]*/ })],
    relevance: 0
  }, f = [
    "if",
    "then",
    "else",
    "elif",
    "fi",
    "time",
    "for",
    "while",
    "until",
    "in",
    "do",
    "done",
    "case",
    "esac",
    "coproc",
    "function",
    "select"
  ], g = [
    "true",
    "false"
  ], S = { match: /(\/[a-z._-]+)+/ }, E = [
    "break",
    "cd",
    "continue",
    "eval",
    "exec",
    "exit",
    "export",
    "getopts",
    "hash",
    "pwd",
    "readonly",
    "return",
    "shift",
    "test",
    "times",
    "trap",
    "umask",
    "unset"
  ], b = [
    "alias",
    "bind",
    "builtin",
    "caller",
    "command",
    "declare",
    "echo",
    "enable",
    "help",
    "let",
    "local",
    "logout",
    "mapfile",
    "printf",
    "read",
    "readarray",
    "source",
    "sudo",
    "type",
    "typeset",
    "ulimit",
    "unalias"
  ], h = [
    "autoload",
    "bg",
    "bindkey",
    "bye",
    "cap",
    "chdir",
    "clone",
    "comparguments",
    "compcall",
    "compctl",
    "compdescribe",
    "compfiles",
    "compgroups",
    "compquote",
    "comptags",
    "comptry",
    "compvalues",
    "dirs",
    "disable",
    "disown",
    "echotc",
    "echoti",
    "emulate",
    "fc",
    "fg",
    "float",
    "functions",
    "getcap",
    "getln",
    "history",
    "integer",
    "jobs",
    "kill",
    "limit",
    "log",
    "noglob",
    "popd",
    "print",
    "pushd",
    "pushln",
    "rehash",
    "sched",
    "setcap",
    "setopt",
    "stat",
    "suspend",
    "ttyctl",
    "unfunction",
    "unhash",
    "unlimit",
    "unsetopt",
    "vared",
    "wait",
    "whence",
    "where",
    "which",
    "zcompile",
    "zformat",
    "zftp",
    "zle",
    "zmodload",
    "zparseopts",
    "zprof",
    "zpty",
    "zregexparse",
    "zsocket",
    "zstyle",
    "ztcp"
  ], T = [
    "chcon",
    "chgrp",
    "chown",
    "chmod",
    "cp",
    "dd",
    "df",
    "dir",
    "dircolors",
    "ln",
    "ls",
    "mkdir",
    "mkfifo",
    "mknod",
    "mktemp",
    "mv",
    "realpath",
    "rm",
    "rmdir",
    "shred",
    "sync",
    "touch",
    "truncate",
    "vdir",
    "b2sum",
    "base32",
    "base64",
    "cat",
    "cksum",
    "comm",
    "csplit",
    "cut",
    "expand",
    "fmt",
    "fold",
    "head",
    "join",
    "md5sum",
    "nl",
    "numfmt",
    "od",
    "paste",
    "ptx",
    "pr",
    "sha1sum",
    "sha224sum",
    "sha256sum",
    "sha384sum",
    "sha512sum",
    "shuf",
    "sort",
    "split",
    "sum",
    "tac",
    "tail",
    "tr",
    "tsort",
    "unexpand",
    "uniq",
    "wc",
    "arch",
    "basename",
    "chroot",
    "date",
    "dirname",
    "du",
    "echo",
    "env",
    "expr",
    "factor",
    // "false", // keyword literal already
    "groups",
    "hostid",
    "id",
    "link",
    "logname",
    "nice",
    "nohup",
    "nproc",
    "pathchk",
    "pinky",
    "printenv",
    "printf",
    "pwd",
    "readlink",
    "runcon",
    "seq",
    "sleep",
    "stat",
    "stdbuf",
    "stty",
    "tee",
    "test",
    "timeout",
    // "true", // keyword literal already
    "tty",
    "uname",
    "unlink",
    "uptime",
    "users",
    "who",
    "whoami",
    "yes"
  ];
  return {
    name: "Bash",
    aliases: [
      "sh",
      "zsh"
    ],
    keywords: {
      $pattern: /\b[a-z][a-z0-9._-]+\b/,
      keyword: f,
      literal: g,
      built_in: [
        ...E,
        ...b,
        // Shell modifiers
        "set",
        "shopt",
        ...h,
        ...T
      ]
    },
    contains: [
      _,
      // to catch known shells and boost relevancy
      t.SHEBANG(),
      // to catch unknown shells but still highlight the shebang
      m,
      d,
      o,
      a,
      S,
      s,
      l,
      c,
      u,
      n
    ]
  };
}
function Mw(t) {
  const e = t.regex, n = t.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), r = "decltype\\(auto\\)", i = "[a-zA-Z_]\\w*::", a = "(" + r + "|" + e.optional(i) + "[a-zA-Z_]\\w*" + e.optional("<[^<>]+>") + ")", s = {
    className: "type",
    variants: [
      { begin: "\\b[a-z\\d_]*_t\\b" },
      { match: /\batomic_[a-z]{3,6}\b/ }
    ]
  }, c = {
    className: "string",
    variants: [
      {
        begin: '(u8?|U|L)?"',
        end: '"',
        illegal: "\\n",
        contains: [t.BACKSLASH_ESCAPE]
      },
      {
        begin: "(u8?|U|L)?'(" + "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)" + "|.)",
        end: "'",
        illegal: "."
      },
      t.END_SAME_AS_BEGIN({
        begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,
        end: /\)([^()\\ ]{0,16})"/
      })
    ]
  }, u = {
    className: "number",
    variants: [
      { match: /\b(0b[01']+)/ },
      { match: /(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/ },
      { match: /(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/ },
      { match: /(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/ }
    ],
    relevance: 0
  }, d = {
    className: "meta",
    begin: /#\s*[a-z]+\b/,
    end: /$/,
    keywords: { keyword: "if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include" },
    contains: [
      {
        begin: /\\\n/,
        relevance: 0
      },
      t.inherit(c, { className: "string" }),
      {
        className: "string",
        begin: /<.*?>/
      },
      n,
      t.C_BLOCK_COMMENT_MODE
    ]
  }, p = {
    className: "title",
    begin: e.optional(i) + t.IDENT_RE,
    relevance: 0
  }, _ = e.optional(i) + t.IDENT_RE + "\\s*\\(", g = {
    keyword: [
      "asm",
      "auto",
      "break",
      "case",
      "continue",
      "default",
      "do",
      "else",
      "enum",
      "extern",
      "for",
      "fortran",
      "goto",
      "if",
      "inline",
      "register",
      "restrict",
      "return",
      "sizeof",
      "typeof",
      "typeof_unqual",
      "struct",
      "switch",
      "typedef",
      "union",
      "volatile",
      "while",
      "_Alignas",
      "_Alignof",
      "_Atomic",
      "_Generic",
      "_Noreturn",
      "_Static_assert",
      "_Thread_local",
      // aliases
      "alignas",
      "alignof",
      "noreturn",
      "static_assert",
      "thread_local",
      // not a C keyword but is, for all intents and purposes, treated exactly like one.
      "_Pragma"
    ],
    type: [
      "float",
      "double",
      "signed",
      "unsigned",
      "int",
      "short",
      "long",
      "char",
      "void",
      "_Bool",
      "_BitInt",
      "_Complex",
      "_Imaginary",
      "_Decimal32",
      "_Decimal64",
      "_Decimal96",
      "_Decimal128",
      "_Decimal64x",
      "_Decimal128x",
      "_Float16",
      "_Float32",
      "_Float64",
      "_Float128",
      "_Float32x",
      "_Float64x",
      "_Float128x",
      // modifiers
      "const",
      "static",
      "constexpr",
      // aliases
      "complex",
      "bool",
      "imaginary"
    ],
    literal: "true false NULL",
    // TODO: apply hinting work similar to what was done in cpp.js
    built_in: "std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"
  }, S = [
    d,
    s,
    n,
    t.C_BLOCK_COMMENT_MODE,
    u,
    c
  ], E = {
    // This mode covers expression context where we can't expect a function
    // definition and shouldn't highlight anything that looks like one:
    // `return some()`, `else if()`, `(x*sum(1, 2))`
    variants: [
      {
        begin: /=/,
        end: /;/
      },
      {
        begin: /\(/,
        end: /\)/
      },
      {
        beginKeywords: "new throw return else",
        end: /;/
      }
    ],
    keywords: g,
    contains: S.concat([
      {
        begin: /\(/,
        end: /\)/,
        keywords: g,
        contains: S.concat(["self"]),
        relevance: 0
      }
    ]),
    relevance: 0
  }, b = {
    begin: "(" + a + "[\\*&\\s]+)+" + _,
    returnBegin: !0,
    end: /[{;=]/,
    excludeEnd: !0,
    keywords: g,
    illegal: /[^\w\s\*&:<>.]/,
    contains: [
      {
        // to prevent it from being confused as the function title
        begin: r,
        keywords: g,
        relevance: 0
      },
      {
        begin: _,
        returnBegin: !0,
        contains: [t.inherit(p, { className: "title.function" })],
        relevance: 0
      },
      // allow for multiple declarations, e.g.:
      // extern void f(int), g(char);
      {
        relevance: 0,
        match: /,/
      },
      {
        className: "params",
        begin: /\(/,
        end: /\)/,
        keywords: g,
        relevance: 0,
        contains: [
          n,
          t.C_BLOCK_COMMENT_MODE,
          c,
          u,
          s,
          // Count matching parentheses.
          {
            begin: /\(/,
            end: /\)/,
            keywords: g,
            relevance: 0,
            contains: [
              "self",
              n,
              t.C_BLOCK_COMMENT_MODE,
              c,
              u,
              s
            ]
          }
        ]
      },
      s,
      n,
      t.C_BLOCK_COMMENT_MODE,
      d
    ]
  };
  return {
    name: "C",
    aliases: ["h"],
    keywords: g,
    // Until differentiations are added between `c` and `cpp`, `c` will
    // not be auto-detected to avoid auto-detect conflicts between C and C++
    disableAutodetect: !0,
    illegal: "</",
    contains: [].concat(
      E,
      b,
      S,
      [
        d,
        {
          begin: t.IDENT_RE + "::",
          keywords: g
        },
        {
          className: "class",
          beginKeywords: "enum class struct union",
          end: /[{;:<>=]/,
          contains: [
            { beginKeywords: "final class struct" },
            t.TITLE_MODE
          ]
        }
      ]
    ),
    exports: {
      preprocessor: d,
      strings: c,
      keywords: g
    }
  };
}
function Lw(t) {
  const e = t.regex, n = t.COMMENT("//", "$", { contains: [{ begin: /\\\n/ }] }), r = "decltype\\(auto\\)", i = "[a-zA-Z_]\\w*::", a = "(?!struct)(" + r + "|" + e.optional(i) + "[a-zA-Z_]\\w*" + e.optional("<[^<>]+>") + ")", s = {
    className: "type",
    begin: "\\b[a-z\\d_]*_t\\b"
  }, c = {
    className: "string",
    variants: [
      {
        begin: '(u8?|U|L)?"',
        end: '"',
        illegal: "\\n",
        contains: [t.BACKSLASH_ESCAPE]
      },
      {
        begin: "(u8?|U|L)?'(" + "\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)" + "|.)",
        end: "'",
        illegal: "."
      },
      t.END_SAME_AS_BEGIN({
        begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,
        end: /\)([^()\\ ]{0,16})"/
      })
    ]
  }, u = {
    className: "number",
    variants: [
      // Floating-point literal.
      {
        begin: "[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"
      },
      // Integer literal.
      {
        begin: "[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"
        // Note: there are user-defined literal suffixes too, but perhaps having the custom suffix not part of the
        // literal highlight actually makes it stand out more.
      }
    ],
    relevance: 0
  }, d = {
    className: "meta",
    begin: /#\s*[a-z]+\b/,
    end: /$/,
    keywords: { keyword: "if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include" },
    contains: [
      {
        begin: /\\\n/,
        relevance: 0
      },
      t.inherit(c, { className: "string" }),
      {
        className: "string",
        begin: /<.*?>/
      },
      n,
      t.C_BLOCK_COMMENT_MODE
    ]
  }, p = {
    className: "title",
    begin: e.optional(i) + t.IDENT_RE,
    relevance: 0
  }, _ = e.optional(i) + t.IDENT_RE + "\\s*\\(", m = [
    "alignas",
    "alignof",
    "and",
    "and_eq",
    "asm",
    "atomic_cancel",
    "atomic_commit",
    "atomic_noexcept",
    "auto",
    "bitand",
    "bitor",
    "break",
    "case",
    "catch",
    "class",
    "co_await",
    "co_return",
    "co_yield",
    "compl",
    "concept",
    "const_cast|10",
    "consteval",
    "constexpr",
    "constinit",
    "continue",
    "decltype",
    "default",
    "delete",
    "do",
    "dynamic_cast|10",
    "else",
    "enum",
    "explicit",
    "export",
    "extern",
    "false",
    "final",
    "for",
    "friend",
    "goto",
    "if",
    "import",
    "inline",
    "module",
    "mutable",
    "namespace",
    "new",
    "noexcept",
    "not",
    "not_eq",
    "nullptr",
    "operator",
    "or",
    "or_eq",
    "override",
    "private",
    "protected",
    "public",
    "reflexpr",
    "register",
    "reinterpret_cast|10",
    "requires",
    "return",
    "sizeof",
    "static_assert",
    "static_cast|10",
    "struct",
    "switch",
    "synchronized",
    "template",
    "this",
    "thread_local",
    "throw",
    "transaction_safe",
    "transaction_safe_dynamic",
    "true",
    "try",
    "typedef",
    "typeid",
    "typename",
    "union",
    "using",
    "virtual",
    "volatile",
    "while",
    "xor",
    "xor_eq"
  ], f = [
    "bool",
    "char",
    "char16_t",
    "char32_t",
    "char8_t",
    "double",
    "float",
    "int",
    "long",
    "short",
    "void",
    "wchar_t",
    "unsigned",
    "signed",
    "const",
    "static"
  ], g = [
    "any",
    "auto_ptr",
    "barrier",
    "binary_semaphore",
    "bitset",
    "complex",
    "condition_variable",
    "condition_variable_any",
    "counting_semaphore",
    "deque",
    "false_type",
    "flat_map",
    "flat_set",
    "future",
    "imaginary",
    "initializer_list",
    "istringstream",
    "jthread",
    "latch",
    "lock_guard",
    "multimap",
    "multiset",
    "mutex",
    "optional",
    "ostringstream",
    "packaged_task",
    "pair",
    "promise",
    "priority_queue",
    "queue",
    "recursive_mutex",
    "recursive_timed_mutex",
    "scoped_lock",
    "set",
    "shared_future",
    "shared_lock",
    "shared_mutex",
    "shared_timed_mutex",
    "shared_ptr",
    "stack",
    "string_view",
    "stringstream",
    "timed_mutex",
    "thread",
    "true_type",
    "tuple",
    "unique_lock",
    "unique_ptr",
    "unordered_map",
    "unordered_multimap",
    "unordered_multiset",
    "unordered_set",
    "variant",
    "vector",
    "weak_ptr",
    "wstring",
    "wstring_view"
  ], S = [
    "abort",
    "abs",
    "acos",
    "apply",
    "as_const",
    "asin",
    "atan",
    "atan2",
    "calloc",
    "ceil",
    "cerr",
    "cin",
    "clog",
    "cos",
    "cosh",
    "cout",
    "declval",
    "endl",
    "exchange",
    "exit",
    "exp",
    "fabs",
    "floor",
    "fmod",
    "forward",
    "fprintf",
    "fputs",
    "free",
    "frexp",
    "fscanf",
    "future",
    "invoke",
    "isalnum",
    "isalpha",
    "iscntrl",
    "isdigit",
    "isgraph",
    "islower",
    "isprint",
    "ispunct",
    "isspace",
    "isupper",
    "isxdigit",
    "labs",
    "launder",
    "ldexp",
    "log",
    "log10",
    "make_pair",
    "make_shared",
    "make_shared_for_overwrite",
    "make_tuple",
    "make_unique",
    "malloc",
    "memchr",
    "memcmp",
    "memcpy",
    "memset",
    "modf",
    "move",
    "pow",
    "printf",
    "putchar",
    "puts",
    "realloc",
    "scanf",
    "sin",
    "sinh",
    "snprintf",
    "sprintf",
    "sqrt",
    "sscanf",
    "std",
    "stderr",
    "stdin",
    "stdout",
    "strcat",
    "strchr",
    "strcmp",
    "strcpy",
    "strcspn",
    "strlen",
    "strncat",
    "strncmp",
    "strncpy",
    "strpbrk",
    "strrchr",
    "strspn",
    "strstr",
    "swap",
    "tan",
    "tanh",
    "terminate",
    "to_underlying",
    "tolower",
    "toupper",
    "vfprintf",
    "visit",
    "vprintf",
    "vsprintf"
  ], h = {
    type: f,
    keyword: m,
    literal: [
      "NULL",
      "false",
      "nullopt",
      "nullptr",
      "true"
    ],
    built_in: ["_Pragma"],
    _type_hints: g
  }, T = {
    className: "function.dispatch",
    relevance: 0,
    keywords: {
      // Only for relevance, not highlighting.
      _hint: S
    },
    begin: e.concat(
      /\b/,
      /(?!decltype)/,
      /(?!if)/,
      /(?!for)/,
      /(?!switch)/,
      /(?!while)/,
      t.IDENT_RE,
      e.lookahead(/(<[^<>]+>|)\s*\(/)
    )
  }, C = [
    T,
    d,
    s,
    n,
    t.C_BLOCK_COMMENT_MODE,
    u,
    c
  ], v = {
    // This mode covers expression context where we can't expect a function
    // definition and shouldn't highlight anything that looks like one:
    // `return some()`, `else if()`, `(x*sum(1, 2))`
    variants: [
      {
        begin: /=/,
        end: /;/
      },
      {
        begin: /\(/,
        end: /\)/
      },
      {
        beginKeywords: "new throw return else",
        end: /;/
      }
    ],
    keywords: h,
    contains: C.concat([
      {
        begin: /\(/,
        end: /\)/,
        keywords: h,
        contains: C.concat(["self"]),
        relevance: 0
      }
    ]),
    relevance: 0
  }, I = {
    className: "function",
    begin: "(" + a + "[\\*&\\s]+)+" + _,
    returnBegin: !0,
    end: /[{;=]/,
    excludeEnd: !0,
    keywords: h,
    illegal: /[^\w\s\*&:<>.]/,
    contains: [
      {
        // to prevent it from being confused as the function title
        begin: r,
        keywords: h,
        relevance: 0
      },
      {
        begin: _,
        returnBegin: !0,
        contains: [p],
        relevance: 0
      },
      // needed because we do not have look-behind on the below rule
      // to prevent it from grabbing the final : in a :: pair
      {
        begin: /::/,
        relevance: 0
      },
      // initializers
      {
        begin: /:/,
        endsWithParent: !0,
        contains: [
          c,
          u
        ]
      },
      // allow for multiple declarations, e.g.:
      // extern void f(int), g(char);
      {
        relevance: 0,
        match: /,/
      },
      {
        className: "params",
        begin: /\(/,
        end: /\)/,
        keywords: h,
        relevance: 0,
        contains: [
          n,
          t.C_BLOCK_COMMENT_MODE,
          c,
          u,
          s,
          // Count matching parentheses.
          {
            begin: /\(/,
            end: /\)/,
            keywords: h,
            relevance: 0,
            contains: [
              "self",
              n,
              t.C_BLOCK_COMMENT_MODE,
              c,
              u,
              s
            ]
          }
        ]
      },
      s,
      n,
      t.C_BLOCK_COMMENT_MODE,
      d
    ]
  };
  return {
    name: "C++",
    aliases: [
      "cc",
      "c++",
      "h++",
      "hpp",
      "hh",
      "hxx",
      "cxx"
    ],
    keywords: h,
    illegal: "</",
    classNameAliases: { "function.dispatch": "built_in" },
    contains: [].concat(
      v,
      I,
      T,
      C,
      [
        d,
        {
          // containers: ie, `vector <int> rooms (9);`
          begin: "\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",
          end: ">",
          keywords: h,
          contains: [
            "self",
            s
          ]
        },
        {
          begin: t.IDENT_RE + "::",
          keywords: h
        },
        {
          match: [
            // extra complexity to deal with `enum class` and `enum struct`
            /\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,
            /\s+/,
            /\w+/
          ],
          className: {
            1: "keyword",
            3: "title.class"
          }
        }
      ]
    )
  };
}
function kw(t) {
  const e = [
    "bool",
    "byte",
    "char",
    "decimal",
    "delegate",
    "double",
    "dynamic",
    "enum",
    "float",
    "int",
    "long",
    "nint",
    "nuint",
    "object",
    "sbyte",
    "short",
    "string",
    "ulong",
    "uint",
    "ushort"
  ], n = [
    "public",
    "private",
    "protected",
    "static",
    "internal",
    "protected",
    "abstract",
    "async",
    "extern",
    "override",
    "unsafe",
    "virtual",
    "new",
    "sealed",
    "partial"
  ], r = [
    "default",
    "false",
    "null",
    "true"
  ], i = [
    "abstract",
    "as",
    "base",
    "break",
    "case",
    "catch",
    "class",
    "const",
    "continue",
    "do",
    "else",
    "event",
    "explicit",
    "extern",
    "finally",
    "fixed",
    "for",
    "foreach",
    "goto",
    "if",
    "implicit",
    "in",
    "interface",
    "internal",
    "is",
    "lock",
    "namespace",
    "new",
    "operator",
    "out",
    "override",
    "params",
    "private",
    "protected",
    "public",
    "readonly",
    "record",
    "ref",
    "return",
    "scoped",
    "sealed",
    "sizeof",
    "stackalloc",
    "static",
    "struct",
    "switch",
    "this",
    "throw",
    "try",
    "typeof",
    "unchecked",
    "unsafe",
    "using",
    "virtual",
    "void",
    "volatile",
    "while"
  ], o = [
    "add",
    "alias",
    "and",
    "ascending",
    "args",
    "async",
    "await",
    "by",
    "descending",
    "dynamic",
    "equals",
    "file",
    "from",
    "get",
    "global",
    "group",
    "init",
    "into",
    "join",
    "let",
    "nameof",
    "not",
    "notnull",
    "on",
    "or",
    "orderby",
    "partial",
    "record",
    "remove",
    "required",
    "scoped",
    "select",
    "set",
    "unmanaged",
    "value|0",
    "var",
    "when",
    "where",
    "with",
    "yield"
  ], a = {
    keyword: i.concat(o),
    built_in: e,
    literal: r
  }, s = t.inherit(t.TITLE_MODE, { begin: "[a-zA-Z](\\.?\\w)*" }), l = {
    className: "number",
    variants: [
      { begin: "\\b(0b[01']+)" },
      { begin: "(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)" },
      { begin: "(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)" }
    ],
    relevance: 0
  }, c = {
    className: "string",
    begin: /"""("*)(?!")(.|\n)*?"""\1/,
    relevance: 1
  }, u = {
    className: "string",
    begin: '@"',
    end: '"',
    contains: [{ begin: '""' }]
  }, d = t.inherit(u, { illegal: /\n/ }), p = {
    className: "subst",
    begin: /\{/,
    end: /\}/,
    keywords: a
  }, _ = t.inherit(p, { illegal: /\n/ }), m = {
    className: "string",
    begin: /\$"/,
    end: '"',
    illegal: /\n/,
    contains: [
      { begin: /\{\{/ },
      { begin: /\}\}/ },
      t.BACKSLASH_ESCAPE,
      _
    ]
  }, f = {
    className: "string",
    begin: /\$@"/,
    end: '"',
    contains: [
      { begin: /\{\{/ },
      { begin: /\}\}/ },
      { begin: '""' },
      p
    ]
  }, g = t.inherit(f, {
    illegal: /\n/,
    contains: [
      { begin: /\{\{/ },
      { begin: /\}\}/ },
      { begin: '""' },
      _
    ]
  });
  p.contains = [
    f,
    m,
    u,
    t.APOS_STRING_MODE,
    t.QUOTE_STRING_MODE,
    l,
    t.C_BLOCK_COMMENT_MODE
  ], _.contains = [
    g,
    m,
    d,
    t.APOS_STRING_MODE,
    t.QUOTE_STRING_MODE,
    l,
    t.inherit(t.C_BLOCK_COMMENT_MODE, { illegal: /\n/ })
  ];
  const S = { variants: [
    c,
    f,
    m,
    u,
    t.APOS_STRING_MODE,
    t.QUOTE_STRING_MODE
  ] }, E = {
    begin: "<",
    end: ">",
    contains: [
      { beginKeywords: "in out" },
      s
    ]
  }, b = t.IDENT_RE + "(<" + t.IDENT_RE + "(\\s*,\\s*" + t.IDENT_RE + ")*>)?(\\[\\])?", h = {
    // prevents expressions like `@class` from incorrect flagging
    // `class` as a keyword
    begin: "@" + t.IDENT_RE,
    relevance: 0
  };
  return {
    name: "C#",
    aliases: [
      "cs",
      "c#"
    ],
    keywords: a,
    illegal: /::/,
    contains: [
      t.COMMENT(
        "///",
        "$",
        {
          returnBegin: !0,
          contains: [
            {
              className: "doctag",
              variants: [
                {
                  begin: "///",
                  relevance: 0
                },
                { begin: "<!--|-->" },
                {
                  begin: "</?",
                  end: ">"
                }
              ]
            }
          ]
        }
      ),
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      {
        className: "meta",
        begin: "#",
        end: "$",
        keywords: { keyword: "if else elif endif define undef warning error line region endregion pragma checksum" }
      },
      S,
      l,
      {
        beginKeywords: "class interface",
        relevance: 0,
        end: /[{;=]/,
        illegal: /[^\s:,]/,
        contains: [
          { beginKeywords: "where class" },
          s,
          E,
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      {
        beginKeywords: "namespace",
        relevance: 0,
        end: /[{;=]/,
        illegal: /[^\s:]/,
        contains: [
          s,
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      {
        beginKeywords: "record",
        relevance: 0,
        end: /[{;=]/,
        illegal: /[^\s:]/,
        contains: [
          s,
          E,
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      {
        // [Attributes("")]
        className: "meta",
        begin: "^\\s*\\[(?=[\\w])",
        excludeBegin: !0,
        end: "\\]",
        excludeEnd: !0,
        contains: [
          {
            className: "string",
            begin: /"/,
            end: /"/
          }
        ]
      },
      {
        // Expression keywords prevent 'keyword Name(...)' from being
        // recognized as a function definition
        beginKeywords: "new return throw await else",
        relevance: 0
      },
      {
        className: "function",
        begin: "(" + b + "\\s+)+" + t.IDENT_RE + "\\s*(<[^=]+>\\s*)?\\(",
        returnBegin: !0,
        end: /\s*[{;=]/,
        excludeEnd: !0,
        keywords: a,
        contains: [
          // prevents these from being highlighted `title`
          {
            beginKeywords: n.join(" "),
            relevance: 0
          },
          {
            begin: t.IDENT_RE + "\\s*(<[^=]+>\\s*)?\\(",
            returnBegin: !0,
            contains: [
              t.TITLE_MODE,
              E
            ],
            relevance: 0
          },
          { match: /\(\)/ },
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            excludeBegin: !0,
            excludeEnd: !0,
            keywords: a,
            relevance: 0,
            contains: [
              S,
              l,
              t.C_BLOCK_COMMENT_MODE
            ]
          },
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      h
    ]
  };
}
const Pw = (t) => ({
  IMPORTANT: {
    scope: "meta",
    begin: "!important"
  },
  BLOCK_COMMENT: t.C_BLOCK_COMMENT_MODE,
  HEXCOLOR: {
    scope: "number",
    begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
  },
  FUNCTION_DISPATCH: {
    className: "built_in",
    begin: /[\w-]+(?=\()/
  },
  ATTRIBUTE_SELECTOR_MODE: {
    scope: "selector-attr",
    begin: /\[/,
    end: /\]/,
    illegal: "$",
    contains: [
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE
    ]
  },
  CSS_NUMBER_MODE: {
    scope: "number",
    begin: t.NUMBER_RE + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
    relevance: 0
  },
  CSS_VARIABLE: {
    className: "attr",
    begin: /--[A-Za-z_][A-Za-z0-9_-]*/
  }
}), Fw = [
  "a",
  "abbr",
  "address",
  "article",
  "aside",
  "audio",
  "b",
  "blockquote",
  "body",
  "button",
  "canvas",
  "caption",
  "cite",
  "code",
  "dd",
  "del",
  "details",
  "dfn",
  "div",
  "dl",
  "dt",
  "em",
  "fieldset",
  "figcaption",
  "figure",
  "footer",
  "form",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "header",
  "hgroup",
  "html",
  "i",
  "iframe",
  "img",
  "input",
  "ins",
  "kbd",
  "label",
  "legend",
  "li",
  "main",
  "mark",
  "menu",
  "nav",
  "object",
  "ol",
  "optgroup",
  "option",
  "p",
  "picture",
  "q",
  "quote",
  "samp",
  "section",
  "select",
  "source",
  "span",
  "strong",
  "summary",
  "sup",
  "table",
  "tbody",
  "td",
  "textarea",
  "tfoot",
  "th",
  "thead",
  "time",
  "tr",
  "ul",
  "var",
  "video"
], Bw = [
  "defs",
  "g",
  "marker",
  "mask",
  "pattern",
  "svg",
  "switch",
  "symbol",
  "feBlend",
  "feColorMatrix",
  "feComponentTransfer",
  "feComposite",
  "feConvolveMatrix",
  "feDiffuseLighting",
  "feDisplacementMap",
  "feFlood",
  "feGaussianBlur",
  "feImage",
  "feMerge",
  "feMorphology",
  "feOffset",
  "feSpecularLighting",
  "feTile",
  "feTurbulence",
  "linearGradient",
  "radialGradient",
  "stop",
  "circle",
  "ellipse",
  "image",
  "line",
  "path",
  "polygon",
  "polyline",
  "rect",
  "text",
  "use",
  "textPath",
  "tspan",
  "foreignObject",
  "clipPath"
], Uw = [
  ...Fw,
  ...Bw
], Hw = [
  "any-hover",
  "any-pointer",
  "aspect-ratio",
  "color",
  "color-gamut",
  "color-index",
  "device-aspect-ratio",
  "device-height",
  "device-width",
  "display-mode",
  "forced-colors",
  "grid",
  "height",
  "hover",
  "inverted-colors",
  "monochrome",
  "orientation",
  "overflow-block",
  "overflow-inline",
  "pointer",
  "prefers-color-scheme",
  "prefers-contrast",
  "prefers-reduced-motion",
  "prefers-reduced-transparency",
  "resolution",
  "scan",
  "scripting",
  "update",
  "width",
  // TODO: find a better solution?
  "min-width",
  "max-width",
  "min-height",
  "max-height"
].sort().reverse(), Gw = [
  "active",
  "any-link",
  "blank",
  "checked",
  "current",
  "default",
  "defined",
  "dir",
  // dir()
  "disabled",
  "drop",
  "empty",
  "enabled",
  "first",
  "first-child",
  "first-of-type",
  "fullscreen",
  "future",
  "focus",
  "focus-visible",
  "focus-within",
  "has",
  // has()
  "host",
  // host or host()
  "host-context",
  // host-context()
  "hover",
  "indeterminate",
  "in-range",
  "invalid",
  "is",
  // is()
  "lang",
  // lang()
  "last-child",
  "last-of-type",
  "left",
  "link",
  "local-link",
  "not",
  // not()
  "nth-child",
  // nth-child()
  "nth-col",
  // nth-col()
  "nth-last-child",
  // nth-last-child()
  "nth-last-col",
  // nth-last-col()
  "nth-last-of-type",
  //nth-last-of-type()
  "nth-of-type",
  //nth-of-type()
  "only-child",
  "only-of-type",
  "optional",
  "out-of-range",
  "past",
  "placeholder-shown",
  "read-only",
  "read-write",
  "required",
  "right",
  "root",
  "scope",
  "target",
  "target-within",
  "user-invalid",
  "valid",
  "visited",
  "where"
  // where()
].sort().reverse(), Vw = [
  "after",
  "backdrop",
  "before",
  "cue",
  "cue-region",
  "first-letter",
  "first-line",
  "grammar-error",
  "marker",
  "part",
  "placeholder",
  "selection",
  "slotted",
  "spelling-error"
].sort().reverse(), Yw = [
  "accent-color",
  "align-content",
  "align-items",
  "align-self",
  "alignment-baseline",
  "all",
  "anchor-name",
  "animation",
  "animation-composition",
  "animation-delay",
  "animation-direction",
  "animation-duration",
  "animation-fill-mode",
  "animation-iteration-count",
  "animation-name",
  "animation-play-state",
  "animation-range",
  "animation-range-end",
  "animation-range-start",
  "animation-timeline",
  "animation-timing-function",
  "appearance",
  "aspect-ratio",
  "backdrop-filter",
  "backface-visibility",
  "background",
  "background-attachment",
  "background-blend-mode",
  "background-clip",
  "background-color",
  "background-image",
  "background-origin",
  "background-position",
  "background-position-x",
  "background-position-y",
  "background-repeat",
  "background-size",
  "baseline-shift",
  "block-size",
  "border",
  "border-block",
  "border-block-color",
  "border-block-end",
  "border-block-end-color",
  "border-block-end-style",
  "border-block-end-width",
  "border-block-start",
  "border-block-start-color",
  "border-block-start-style",
  "border-block-start-width",
  "border-block-style",
  "border-block-width",
  "border-bottom",
  "border-bottom-color",
  "border-bottom-left-radius",
  "border-bottom-right-radius",
  "border-bottom-style",
  "border-bottom-width",
  "border-collapse",
  "border-color",
  "border-end-end-radius",
  "border-end-start-radius",
  "border-image",
  "border-image-outset",
  "border-image-repeat",
  "border-image-slice",
  "border-image-source",
  "border-image-width",
  "border-inline",
  "border-inline-color",
  "border-inline-end",
  "border-inline-end-color",
  "border-inline-end-style",
  "border-inline-end-width",
  "border-inline-start",
  "border-inline-start-color",
  "border-inline-start-style",
  "border-inline-start-width",
  "border-inline-style",
  "border-inline-width",
  "border-left",
  "border-left-color",
  "border-left-style",
  "border-left-width",
  "border-radius",
  "border-right",
  "border-right-color",
  "border-right-style",
  "border-right-width",
  "border-spacing",
  "border-start-end-radius",
  "border-start-start-radius",
  "border-style",
  "border-top",
  "border-top-color",
  "border-top-left-radius",
  "border-top-right-radius",
  "border-top-style",
  "border-top-width",
  "border-width",
  "bottom",
  "box-align",
  "box-decoration-break",
  "box-direction",
  "box-flex",
  "box-flex-group",
  "box-lines",
  "box-ordinal-group",
  "box-orient",
  "box-pack",
  "box-shadow",
  "box-sizing",
  "break-after",
  "break-before",
  "break-inside",
  "caption-side",
  "caret-color",
  "clear",
  "clip",
  "clip-path",
  "clip-rule",
  "color",
  "color-interpolation",
  "color-interpolation-filters",
  "color-profile",
  "color-rendering",
  "color-scheme",
  "column-count",
  "column-fill",
  "column-gap",
  "column-rule",
  "column-rule-color",
  "column-rule-style",
  "column-rule-width",
  "column-span",
  "column-width",
  "columns",
  "contain",
  "contain-intrinsic-block-size",
  "contain-intrinsic-height",
  "contain-intrinsic-inline-size",
  "contain-intrinsic-size",
  "contain-intrinsic-width",
  "container",
  "container-name",
  "container-type",
  "content",
  "content-visibility",
  "counter-increment",
  "counter-reset",
  "counter-set",
  "cue",
  "cue-after",
  "cue-before",
  "cursor",
  "cx",
  "cy",
  "direction",
  "display",
  "dominant-baseline",
  "empty-cells",
  "enable-background",
  "field-sizing",
  "fill",
  "fill-opacity",
  "fill-rule",
  "filter",
  "flex",
  "flex-basis",
  "flex-direction",
  "flex-flow",
  "flex-grow",
  "flex-shrink",
  "flex-wrap",
  "float",
  "flood-color",
  "flood-opacity",
  "flow",
  "font",
  "font-display",
  "font-family",
  "font-feature-settings",
  "font-kerning",
  "font-language-override",
  "font-optical-sizing",
  "font-palette",
  "font-size",
  "font-size-adjust",
  "font-smooth",
  "font-smoothing",
  "font-stretch",
  "font-style",
  "font-synthesis",
  "font-synthesis-position",
  "font-synthesis-small-caps",
  "font-synthesis-style",
  "font-synthesis-weight",
  "font-variant",
  "font-variant-alternates",
  "font-variant-caps",
  "font-variant-east-asian",
  "font-variant-emoji",
  "font-variant-ligatures",
  "font-variant-numeric",
  "font-variant-position",
  "font-variation-settings",
  "font-weight",
  "forced-color-adjust",
  "gap",
  "glyph-orientation-horizontal",
  "glyph-orientation-vertical",
  "grid",
  "grid-area",
  "grid-auto-columns",
  "grid-auto-flow",
  "grid-auto-rows",
  "grid-column",
  "grid-column-end",
  "grid-column-start",
  "grid-gap",
  "grid-row",
  "grid-row-end",
  "grid-row-start",
  "grid-template",
  "grid-template-areas",
  "grid-template-columns",
  "grid-template-rows",
  "hanging-punctuation",
  "height",
  "hyphenate-character",
  "hyphenate-limit-chars",
  "hyphens",
  "icon",
  "image-orientation",
  "image-rendering",
  "image-resolution",
  "ime-mode",
  "initial-letter",
  "initial-letter-align",
  "inline-size",
  "inset",
  "inset-area",
  "inset-block",
  "inset-block-end",
  "inset-block-start",
  "inset-inline",
  "inset-inline-end",
  "inset-inline-start",
  "isolation",
  "justify-content",
  "justify-items",
  "justify-self",
  "kerning",
  "left",
  "letter-spacing",
  "lighting-color",
  "line-break",
  "line-height",
  "line-height-step",
  "list-style",
  "list-style-image",
  "list-style-position",
  "list-style-type",
  "margin",
  "margin-block",
  "margin-block-end",
  "margin-block-start",
  "margin-bottom",
  "margin-inline",
  "margin-inline-end",
  "margin-inline-start",
  "margin-left",
  "margin-right",
  "margin-top",
  "margin-trim",
  "marker",
  "marker-end",
  "marker-mid",
  "marker-start",
  "marks",
  "mask",
  "mask-border",
  "mask-border-mode",
  "mask-border-outset",
  "mask-border-repeat",
  "mask-border-slice",
  "mask-border-source",
  "mask-border-width",
  "mask-clip",
  "mask-composite",
  "mask-image",
  "mask-mode",
  "mask-origin",
  "mask-position",
  "mask-repeat",
  "mask-size",
  "mask-type",
  "masonry-auto-flow",
  "math-depth",
  "math-shift",
  "math-style",
  "max-block-size",
  "max-height",
  "max-inline-size",
  "max-width",
  "min-block-size",
  "min-height",
  "min-inline-size",
  "min-width",
  "mix-blend-mode",
  "nav-down",
  "nav-index",
  "nav-left",
  "nav-right",
  "nav-up",
  "none",
  "normal",
  "object-fit",
  "object-position",
  "offset",
  "offset-anchor",
  "offset-distance",
  "offset-path",
  "offset-position",
  "offset-rotate",
  "opacity",
  "order",
  "orphans",
  "outline",
  "outline-color",
  "outline-offset",
  "outline-style",
  "outline-width",
  "overflow",
  "overflow-anchor",
  "overflow-block",
  "overflow-clip-margin",
  "overflow-inline",
  "overflow-wrap",
  "overflow-x",
  "overflow-y",
  "overlay",
  "overscroll-behavior",
  "overscroll-behavior-block",
  "overscroll-behavior-inline",
  "overscroll-behavior-x",
  "overscroll-behavior-y",
  "padding",
  "padding-block",
  "padding-block-end",
  "padding-block-start",
  "padding-bottom",
  "padding-inline",
  "padding-inline-end",
  "padding-inline-start",
  "padding-left",
  "padding-right",
  "padding-top",
  "page",
  "page-break-after",
  "page-break-before",
  "page-break-inside",
  "paint-order",
  "pause",
  "pause-after",
  "pause-before",
  "perspective",
  "perspective-origin",
  "place-content",
  "place-items",
  "place-self",
  "pointer-events",
  "position",
  "position-anchor",
  "position-visibility",
  "print-color-adjust",
  "quotes",
  "r",
  "resize",
  "rest",
  "rest-after",
  "rest-before",
  "right",
  "rotate",
  "row-gap",
  "ruby-align",
  "ruby-position",
  "scale",
  "scroll-behavior",
  "scroll-margin",
  "scroll-margin-block",
  "scroll-margin-block-end",
  "scroll-margin-block-start",
  "scroll-margin-bottom",
  "scroll-margin-inline",
  "scroll-margin-inline-end",
  "scroll-margin-inline-start",
  "scroll-margin-left",
  "scroll-margin-right",
  "scroll-margin-top",
  "scroll-padding",
  "scroll-padding-block",
  "scroll-padding-block-end",
  "scroll-padding-block-start",
  "scroll-padding-bottom",
  "scroll-padding-inline",
  "scroll-padding-inline-end",
  "scroll-padding-inline-start",
  "scroll-padding-left",
  "scroll-padding-right",
  "scroll-padding-top",
  "scroll-snap-align",
  "scroll-snap-stop",
  "scroll-snap-type",
  "scroll-timeline",
  "scroll-timeline-axis",
  "scroll-timeline-name",
  "scrollbar-color",
  "scrollbar-gutter",
  "scrollbar-width",
  "shape-image-threshold",
  "shape-margin",
  "shape-outside",
  "shape-rendering",
  "speak",
  "speak-as",
  "src",
  // @font-face
  "stop-color",
  "stop-opacity",
  "stroke",
  "stroke-dasharray",
  "stroke-dashoffset",
  "stroke-linecap",
  "stroke-linejoin",
  "stroke-miterlimit",
  "stroke-opacity",
  "stroke-width",
  "tab-size",
  "table-layout",
  "text-align",
  "text-align-all",
  "text-align-last",
  "text-anchor",
  "text-combine-upright",
  "text-decoration",
  "text-decoration-color",
  "text-decoration-line",
  "text-decoration-skip",
  "text-decoration-skip-ink",
  "text-decoration-style",
  "text-decoration-thickness",
  "text-emphasis",
  "text-emphasis-color",
  "text-emphasis-position",
  "text-emphasis-style",
  "text-indent",
  "text-justify",
  "text-orientation",
  "text-overflow",
  "text-rendering",
  "text-shadow",
  "text-size-adjust",
  "text-transform",
  "text-underline-offset",
  "text-underline-position",
  "text-wrap",
  "text-wrap-mode",
  "text-wrap-style",
  "timeline-scope",
  "top",
  "touch-action",
  "transform",
  "transform-box",
  "transform-origin",
  "transform-style",
  "transition",
  "transition-behavior",
  "transition-delay",
  "transition-duration",
  "transition-property",
  "transition-timing-function",
  "translate",
  "unicode-bidi",
  "user-modify",
  "user-select",
  "vector-effect",
  "vertical-align",
  "view-timeline",
  "view-timeline-axis",
  "view-timeline-inset",
  "view-timeline-name",
  "view-transition-name",
  "visibility",
  "voice-balance",
  "voice-duration",
  "voice-family",
  "voice-pitch",
  "voice-range",
  "voice-rate",
  "voice-stress",
  "voice-volume",
  "white-space",
  "white-space-collapse",
  "widows",
  "width",
  "will-change",
  "word-break",
  "word-spacing",
  "word-wrap",
  "writing-mode",
  "x",
  "y",
  "z-index",
  "zoom"
].sort().reverse();
function $w(t) {
  const e = t.regex, n = Pw(t), r = { begin: /-(webkit|moz|ms|o)-(?=[a-z])/ }, i = "and or not only", o = /@-?\w[\w]*(-\w+)*/, a = "[a-zA-Z-][a-zA-Z0-9_-]*", s = [
    t.APOS_STRING_MODE,
    t.QUOTE_STRING_MODE
  ];
  return {
    name: "CSS",
    case_insensitive: !0,
    illegal: /[=|'\$]/,
    keywords: { keyframePosition: "from to" },
    classNameAliases: {
      // for visual continuity with `tag {}` and because we
      // don't have a great class for this?
      keyframePosition: "selector-tag"
    },
    contains: [
      n.BLOCK_COMMENT,
      r,
      // to recognize keyframe 40% etc which are outside the scope of our
      // attribute value mode
      n.CSS_NUMBER_MODE,
      {
        className: "selector-id",
        begin: /#[A-Za-z0-9_-]+/,
        relevance: 0
      },
      {
        className: "selector-class",
        begin: "\\." + a,
        relevance: 0
      },
      n.ATTRIBUTE_SELECTOR_MODE,
      {
        className: "selector-pseudo",
        variants: [
          { begin: ":(" + Gw.join("|") + ")" },
          { begin: ":(:)?(" + Vw.join("|") + ")" }
        ]
      },
      // we may actually need this (12/2020)
      // { // pseudo-selector params
      //   begin: /\(/,
      //   end: /\)/,
      //   contains: [ hljs.CSS_NUMBER_MODE ]
      // },
      n.CSS_VARIABLE,
      {
        className: "attribute",
        begin: "\\b(" + Yw.join("|") + ")\\b"
      },
      // attribute values
      {
        begin: /:/,
        end: /[;}{]/,
        contains: [
          n.BLOCK_COMMENT,
          n.HEXCOLOR,
          n.IMPORTANT,
          n.CSS_NUMBER_MODE,
          ...s,
          // needed to highlight these as strings and to avoid issues with
          // illegal characters that might be inside urls that would tigger the
          // languages illegal stack
          {
            begin: /(url|data-uri)\(/,
            end: /\)/,
            relevance: 0,
            // from keywords
            keywords: { built_in: "url data-uri" },
            contains: [
              ...s,
              {
                className: "string",
                // any character other than `)` as in `url()` will be the start
                // of a string, which ends with `)` (from the parent mode)
                begin: /[^)]/,
                endsWithParent: !0,
                excludeEnd: !0
              }
            ]
          },
          n.FUNCTION_DISPATCH
        ]
      },
      {
        begin: e.lookahead(/@/),
        end: "[{;]",
        relevance: 0,
        illegal: /:/,
        // break on Less variables @var: ...
        contains: [
          {
            className: "keyword",
            begin: o
          },
          {
            begin: /\s/,
            endsWithParent: !0,
            excludeEnd: !0,
            relevance: 0,
            keywords: {
              $pattern: /[a-z-]+/,
              keyword: i,
              attribute: Hw.join(" ")
            },
            contains: [
              {
                begin: /[a-z-]+(?=:)/,
                className: "attribute"
              },
              ...s,
              n.CSS_NUMBER_MODE
            ]
          }
        ]
      },
      {
        className: "selector-tag",
        begin: "\\b(" + Uw.join("|") + ")\\b"
      }
    ]
  };
}
function zw(t) {
  const e = t.regex;
  return {
    name: "Diff",
    aliases: ["patch"],
    contains: [
      {
        className: "meta",
        relevance: 10,
        match: e.either(
          /^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,
          /^\*\*\* +\d+,\d+ +\*\*\*\*$/,
          /^--- +\d+,\d+ +----$/
        )
      },
      {
        className: "comment",
        variants: [
          {
            begin: e.either(
              /Index: /,
              /^index/,
              /={3,}/,
              /^-{3}/,
              /^\*{3} /,
              /^\+{3}/,
              /^diff --git/
            ),
            end: /$/
          },
          { match: /^\*{15}$/ }
        ]
      },
      {
        className: "addition",
        begin: /^\+/,
        end: /$/
      },
      {
        className: "deletion",
        begin: /^-/,
        end: /$/
      },
      {
        className: "addition",
        begin: /^!/,
        end: /$/
      }
    ]
  };
}
function qw(t) {
  const o = {
    keyword: [
      "break",
      "case",
      "chan",
      "const",
      "continue",
      "default",
      "defer",
      "else",
      "fallthrough",
      "for",
      "func",
      "go",
      "goto",
      "if",
      "import",
      "interface",
      "map",
      "package",
      "range",
      "return",
      "select",
      "struct",
      "switch",
      "type",
      "var"
    ],
    type: [
      "bool",
      "byte",
      "complex64",
      "complex128",
      "error",
      "float32",
      "float64",
      "int8",
      "int16",
      "int32",
      "int64",
      "string",
      "uint8",
      "uint16",
      "uint32",
      "uint64",
      "int",
      "uint",
      "uintptr",
      "rune"
    ],
    literal: [
      "true",
      "false",
      "iota",
      "nil"
    ],
    built_in: [
      "append",
      "cap",
      "close",
      "complex",
      "copy",
      "imag",
      "len",
      "make",
      "new",
      "panic",
      "print",
      "println",
      "real",
      "recover",
      "delete"
    ]
  };
  return {
    name: "Go",
    aliases: ["golang"],
    keywords: o,
    illegal: "</",
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      {
        className: "string",
        variants: [
          t.QUOTE_STRING_MODE,
          t.APOS_STRING_MODE,
          {
            begin: "`",
            end: "`"
          }
        ]
      },
      {
        className: "number",
        variants: [
          {
            match: /-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,
            // hex without a present digit before . (making a digit afterwards required)
            relevance: 0
          },
          {
            match: /-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,
            // hex with a present digit before . (making a digit afterwards optional)
            relevance: 0
          },
          {
            match: /-?\b0[oO](_?[0-7])*i?/,
            // leading 0o octal
            relevance: 0
          },
          {
            match: /-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,
            // decimal without a present digit before . (making a digit afterwards required)
            relevance: 0
          },
          {
            match: /-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,
            // decimal with a present digit before . (making a digit afterwards optional)
            relevance: 0
          }
        ]
      },
      {
        begin: /:=/
        // relevance booster
      },
      {
        className: "function",
        beginKeywords: "func",
        end: "\\s*(\\{|$)",
        excludeEnd: !0,
        contains: [
          t.TITLE_MODE,
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            endsParent: !0,
            keywords: o,
            illegal: /["']/
          }
        ]
      }
    ]
  };
}
function Ww(t) {
  const e = t.regex, n = /[_A-Za-z][_0-9A-Za-z]*/;
  return {
    name: "GraphQL",
    aliases: ["gql"],
    case_insensitive: !0,
    disableAutodetect: !1,
    keywords: {
      keyword: [
        "query",
        "mutation",
        "subscription",
        "type",
        "input",
        "schema",
        "directive",
        "interface",
        "union",
        "scalar",
        "fragment",
        "enum",
        "on"
      ],
      literal: [
        "true",
        "false",
        "null"
      ]
    },
    contains: [
      t.HASH_COMMENT_MODE,
      t.QUOTE_STRING_MODE,
      t.NUMBER_MODE,
      {
        scope: "punctuation",
        match: /[.]{3}/,
        relevance: 0
      },
      {
        scope: "punctuation",
        begin: /[\!\(\)\:\=\[\]\{\|\}]{1}/,
        relevance: 0
      },
      {
        scope: "variable",
        begin: /\$/,
        end: /\W/,
        excludeEnd: !0,
        relevance: 0
      },
      {
        scope: "meta",
        match: /@\w+/,
        excludeEnd: !0
      },
      {
        scope: "symbol",
        begin: e.concat(n, e.lookahead(/\s*:/)),
        relevance: 0
      }
    ],
    illegal: [
      /[;<']/,
      /BEGIN/
    ]
  };
}
function Kw(t) {
  const e = t.regex, n = {
    className: "number",
    relevance: 0,
    variants: [
      { begin: /([+-]+)?[\d]+_[\d_]+/ },
      { begin: t.NUMBER_RE }
    ]
  }, r = t.COMMENT();
  r.variants = [
    {
      begin: /;/,
      end: /$/
    },
    {
      begin: /#/,
      end: /$/
    }
  ];
  const i = {
    className: "variable",
    variants: [
      { begin: /\$[\w\d"][\w\d_]*/ },
      { begin: /\$\{(.*?)\}/ }
    ]
  }, o = {
    className: "literal",
    begin: /\bon|off|true|false|yes|no\b/
  }, a = {
    className: "string",
    contains: [t.BACKSLASH_ESCAPE],
    variants: [
      {
        begin: "'''",
        end: "'''",
        relevance: 10
      },
      {
        begin: '"""',
        end: '"""',
        relevance: 10
      },
      {
        begin: '"',
        end: '"'
      },
      {
        begin: "'",
        end: "'"
      }
    ]
  }, s = {
    begin: /\[/,
    end: /\]/,
    contains: [
      r,
      o,
      i,
      a,
      n,
      "self"
    ],
    relevance: 0
  }, l = /[A-Za-z0-9_-]+/, c = /"(\\"|[^"])*"/, u = /'[^']*'/, d = e.either(
    l,
    c,
    u
  ), p = e.concat(
    d,
    "(\\s*\\.\\s*",
    d,
    ")*",
    e.lookahead(/\s*=\s*[^#\s]/)
  );
  return {
    name: "TOML, also INI",
    aliases: ["toml"],
    case_insensitive: !0,
    illegal: /\S/,
    contains: [
      r,
      {
        className: "section",
        begin: /\[+/,
        end: /\]+/
      },
      {
        begin: p,
        className: "attr",
        starts: {
          end: /$/,
          contains: [
            r,
            s,
            o,
            i,
            a,
            n
          ]
        }
      }
    ]
  };
}
var Hr = "[0-9](_*[0-9])*", Ko = `\\.(${Hr})`, Qo = "[0-9a-fA-F](_*[0-9a-fA-F])*", H_ = {
  className: "number",
  variants: [
    // DecimalFloatingPointLiteral
    // including ExponentPart
    { begin: `(\\b(${Hr})((${Ko})|\\.)?|(${Ko}))[eE][+-]?(${Hr})[fFdD]?\\b` },
    // excluding ExponentPart
    { begin: `\\b(${Hr})((${Ko})[fFdD]?\\b|\\.([fFdD]\\b)?)` },
    { begin: `(${Ko})[fFdD]?\\b` },
    { begin: `\\b(${Hr})[fFdD]\\b` },
    // HexadecimalFloatingPointLiteral
    { begin: `\\b0[xX]((${Qo})\\.?|(${Qo})?\\.(${Qo}))[pP][+-]?(${Hr})[fFdD]?\\b` },
    // DecimalIntegerLiteral
    { begin: "\\b(0|[1-9](_*[0-9])*)[lL]?\\b" },
    // HexIntegerLiteral
    { begin: `\\b0[xX](${Qo})[lL]?\\b` },
    // OctalIntegerLiteral
    { begin: "\\b0(_*[0-7])*[lL]?\\b" },
    // BinaryIntegerLiteral
    { begin: "\\b0[bB][01](_*[01])*[lL]?\\b" }
  ],
  relevance: 0
};
function bh(t, e, n) {
  return n === -1 ? "" : t.replace(e, (r) => bh(t, e, n - 1));
}
function Qw(t) {
  const e = t.regex, n = "[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*", r = n + bh("(?:<" + n + "~~~(?:\\s*,\\s*" + n + "~~~)*>)?", /~~~/g, 2), l = {
    keyword: [
      "synchronized",
      "abstract",
      "private",
      "var",
      "static",
      "if",
      "const ",
      "for",
      "while",
      "strictfp",
      "finally",
      "protected",
      "import",
      "native",
      "final",
      "void",
      "enum",
      "else",
      "break",
      "transient",
      "catch",
      "instanceof",
      "volatile",
      "case",
      "assert",
      "package",
      "default",
      "public",
      "try",
      "switch",
      "continue",
      "throws",
      "protected",
      "public",
      "private",
      "module",
      "requires",
      "exports",
      "do",
      "sealed",
      "yield",
      "permits",
      "goto",
      "when"
    ],
    literal: [
      "false",
      "true",
      "null"
    ],
    type: [
      "char",
      "boolean",
      "long",
      "float",
      "int",
      "byte",
      "short",
      "double"
    ],
    built_in: [
      "super",
      "this"
    ]
  }, c = {
    className: "meta",
    begin: "@" + n,
    contains: [
      {
        begin: /\(/,
        end: /\)/,
        contains: ["self"]
        // allow nested () inside our annotation
      }
    ]
  }, u = {
    className: "params",
    begin: /\(/,
    end: /\)/,
    keywords: l,
    relevance: 0,
    contains: [t.C_BLOCK_COMMENT_MODE],
    endsParent: !0
  };
  return {
    name: "Java",
    aliases: ["jsp"],
    keywords: l,
    illegal: /<\/|#/,
    contains: [
      t.COMMENT(
        "/\\*\\*",
        "\\*/",
        {
          relevance: 0,
          contains: [
            {
              // eat up @'s in emails to prevent them to be recognized as doctags
              begin: /\w+@/,
              relevance: 0
            },
            {
              className: "doctag",
              begin: "@[A-Za-z]+"
            }
          ]
        }
      ),
      // relevance boost
      {
        begin: /import java\.[a-z]+\./,
        keywords: "import",
        relevance: 2
      },
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      {
        begin: /"""/,
        end: /"""/,
        className: "string",
        contains: [t.BACKSLASH_ESCAPE]
      },
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      {
        match: [
          /\b(?:class|interface|enum|extends|implements|new)/,
          /\s+/,
          n
        ],
        className: {
          1: "keyword",
          3: "title.class"
        }
      },
      {
        // Exceptions for hyphenated keywords
        match: /non-sealed/,
        scope: "keyword"
      },
      {
        begin: [
          e.concat(/(?!else)/, n),
          /\s+/,
          n,
          /\s+/,
          /=(?!=)/
        ],
        className: {
          1: "type",
          3: "variable",
          5: "operator"
        }
      },
      {
        begin: [
          /record/,
          /\s+/,
          n
        ],
        className: {
          1: "keyword",
          3: "title.class"
        },
        contains: [
          u,
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      {
        // Expression keywords prevent 'keyword Name(...)' from being
        // recognized as a function definition
        beginKeywords: "new throw return else",
        relevance: 0
      },
      {
        begin: [
          "(?:" + r + "\\s+)",
          t.UNDERSCORE_IDENT_RE,
          /\s*(?=\()/
        ],
        className: { 2: "title.function" },
        keywords: l,
        contains: [
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            keywords: l,
            relevance: 0,
            contains: [
              c,
              t.APOS_STRING_MODE,
              t.QUOTE_STRING_MODE,
              H_,
              t.C_BLOCK_COMMENT_MODE
            ]
          },
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      H_,
      c
    ]
  };
}
const G_ = "[A-Za-z$_][0-9A-Za-z$_]*", Zw = [
  "as",
  // for exports
  "in",
  "of",
  "if",
  "for",
  "while",
  "finally",
  "var",
  "new",
  "function",
  "do",
  "return",
  "void",
  "else",
  "break",
  "catch",
  "instanceof",
  "with",
  "throw",
  "case",
  "default",
  "try",
  "switch",
  "continue",
  "typeof",
  "delete",
  "let",
  "yield",
  "const",
  "class",
  // JS handles these with a special rule
  // "get",
  // "set",
  "debugger",
  "async",
  "await",
  "static",
  "import",
  "from",
  "export",
  "extends",
  // It's reached stage 3, which is "recommended for implementation":
  "using"
], Xw = [
  "true",
  "false",
  "null",
  "undefined",
  "NaN",
  "Infinity"
], Th = [
  // Fundamental objects
  "Object",
  "Function",
  "Boolean",
  "Symbol",
  // numbers and dates
  "Math",
  "Date",
  "Number",
  "BigInt",
  // text
  "String",
  "RegExp",
  // Indexed collections
  "Array",
  "Float32Array",
  "Float64Array",
  "Int8Array",
  "Uint8Array",
  "Uint8ClampedArray",
  "Int16Array",
  "Int32Array",
  "Uint16Array",
  "Uint32Array",
  "BigInt64Array",
  "BigUint64Array",
  // Keyed collections
  "Set",
  "Map",
  "WeakSet",
  "WeakMap",
  // Structured data
  "ArrayBuffer",
  "SharedArrayBuffer",
  "Atomics",
  "DataView",
  "JSON",
  // Control abstraction objects
  "Promise",
  "Generator",
  "GeneratorFunction",
  "AsyncFunction",
  // Reflection
  "Reflect",
  "Proxy",
  // Internationalization
  "Intl",
  // WebAssembly
  "WebAssembly"
], Ch = [
  "Error",
  "EvalError",
  "InternalError",
  "RangeError",
  "ReferenceError",
  "SyntaxError",
  "TypeError",
  "URIError"
], yh = [
  "setInterval",
  "setTimeout",
  "clearInterval",
  "clearTimeout",
  "require",
  "exports",
  "eval",
  "isFinite",
  "isNaN",
  "parseFloat",
  "parseInt",
  "decodeURI",
  "decodeURIComponent",
  "encodeURI",
  "encodeURIComponent",
  "escape",
  "unescape"
], jw = [
  "arguments",
  "this",
  "super",
  "console",
  "window",
  "document",
  "localStorage",
  "sessionStorage",
  "module",
  "global"
  // Node.js
], Jw = [].concat(
  yh,
  Th,
  Ch
);
function eM(t) {
  const e = t.regex, n = (R, { after: w }) => {
    const B = "</" + R[0].slice(1);
    return R.input.indexOf(B, w) !== -1;
  }, r = G_, i = {
    begin: "<>",
    end: "</>"
  }, o = /<[A-Za-z0-9\\._:-]+\s*\/>/, a = {
    begin: /<[A-Za-z0-9\\._:-]+/,
    end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
    /**
     * @param {RegExpMatchArray} match
     * @param {CallbackResponse} response
     */
    isTrulyOpeningTag: (R, w) => {
      const B = R[0].length + R.index, $ = R.input[B];
      if (
        // HTML should not include another raw `<` inside a tag
        // nested type?
        // `<Array<Array<number>>`, etc.
        $ === "<" || // the , gives away that this is not HTML
        // `<T, A extends keyof T, V>`
        $ === ","
      ) {
        w.ignoreMatch();
        return;
      }
      $ === ">" && (n(R, { after: B }) || w.ignoreMatch());
      let X;
      const de = R.input.substring(B);
      if (X = de.match(/^\s*=/)) {
        w.ignoreMatch();
        return;
      }
      if ((X = de.match(/^\s+extends\s+/)) && X.index === 0) {
        w.ignoreMatch();
        return;
      }
    }
  }, s = {
    $pattern: G_,
    keyword: Zw,
    literal: Xw,
    built_in: Jw,
    "variable.language": jw
  }, l = "[0-9](_?[0-9])*", c = `\\.(${l})`, u = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", d = {
    className: "number",
    variants: [
      // DecimalLiteral
      { begin: `(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b` },
      { begin: `\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b` },
      // DecimalBigIntegerLiteral
      { begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
      // NonDecimalIntegerLiteral
      { begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
      { begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
      { begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
      // LegacyOctalIntegerLiteral (does not include underscore separators)
      // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
      { begin: "\\b0[0-7]+n?\\b" }
    ],
    relevance: 0
  }, p = {
    className: "subst",
    begin: "\\$\\{",
    end: "\\}",
    keywords: s,
    contains: []
    // defined later
  }, _ = {
    begin: ".?html`",
    end: "",
    starts: {
      end: "`",
      returnEnd: !1,
      contains: [
        t.BACKSLASH_ESCAPE,
        p
      ],
      subLanguage: "xml"
    }
  }, m = {
    begin: ".?css`",
    end: "",
    starts: {
      end: "`",
      returnEnd: !1,
      contains: [
        t.BACKSLASH_ESCAPE,
        p
      ],
      subLanguage: "css"
    }
  }, f = {
    begin: ".?gql`",
    end: "",
    starts: {
      end: "`",
      returnEnd: !1,
      contains: [
        t.BACKSLASH_ESCAPE,
        p
      ],
      subLanguage: "graphql"
    }
  }, g = {
    className: "string",
    begin: "`",
    end: "`",
    contains: [
      t.BACKSLASH_ESCAPE,
      p
    ]
  }, E = {
    className: "comment",
    variants: [
      t.COMMENT(
        /\/\*\*(?!\/)/,
        "\\*/",
        {
          relevance: 0,
          contains: [
            {
              begin: "(?=@[A-Za-z]+)",
              relevance: 0,
              contains: [
                {
                  className: "doctag",
                  begin: "@[A-Za-z]+"
                },
                {
                  className: "type",
                  begin: "\\{",
                  end: "\\}",
                  excludeEnd: !0,
                  excludeBegin: !0,
                  relevance: 0
                },
                {
                  className: "variable",
                  begin: r + "(?=\\s*(-)|$)",
                  endsParent: !0,
                  relevance: 0
                },
                // eat spaces (not newlines) so we can find
                // types or variables
                {
                  begin: /(?=[^\n])\s/,
                  relevance: 0
                }
              ]
            }
          ]
        }
      ),
      t.C_BLOCK_COMMENT_MODE,
      t.C_LINE_COMMENT_MODE
    ]
  }, b = [
    t.APOS_STRING_MODE,
    t.QUOTE_STRING_MODE,
    _,
    m,
    f,
    g,
    // Skip numbers when they are part of a variable name
    { match: /\$\d+/ },
    d
    // This is intentional:
    // See https://github.com/highlightjs/highlight.js/issues/3288
    // hljs.REGEXP_MODE
  ];
  p.contains = b.concat({
    // we need to pair up {} inside our subst to prevent
    // it from ending too early by matching another }
    begin: /\{/,
    end: /\}/,
    keywords: s,
    contains: [
      "self"
    ].concat(b)
  });
  const h = [].concat(E, p.contains), T = h.concat([
    // eat recursive parens in sub expressions
    {
      begin: /(\s*)\(/,
      end: /\)/,
      keywords: s,
      contains: ["self"].concat(h)
    }
  ]), C = {
    className: "params",
    // convert this to negative lookbehind in v12
    begin: /(\s*)\(/,
    // to match the parms with
    end: /\)/,
    excludeBegin: !0,
    excludeEnd: !0,
    keywords: s,
    contains: T
  }, v = {
    variants: [
      // class Car extends vehicle
      {
        match: [
          /class/,
          /\s+/,
          r,
          /\s+/,
          /extends/,
          /\s+/,
          e.concat(r, "(", e.concat(/\./, r), ")*")
        ],
        scope: {
          1: "keyword",
          3: "title.class",
          5: "keyword",
          7: "title.class.inherited"
        }
      },
      // class Car
      {
        match: [
          /class/,
          /\s+/,
          r
        ],
        scope: {
          1: "keyword",
          3: "title.class"
        }
      }
    ]
  }, I = {
    relevance: 0,
    match: e.either(
      // Hard coded exceptions
      /\bJSON/,
      // Float32Array, OutT
      /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
      // CSSFactory, CSSFactoryT
      /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
      // FPs, FPsT
      /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
      // P
      // single letters are not highlighted
      // BLAH
      // this will be flagged as a UPPER_CASE_CONSTANT instead
    ),
    className: "title.class",
    keywords: {
      _: [
        // se we still get relevance credit for JS library classes
        ...Th,
        ...Ch
      ]
    }
  }, N = {
    label: "use_strict",
    className: "meta",
    relevance: 10,
    begin: /^\s*['"]use (strict|asm)['"]/
  }, x = {
    variants: [
      {
        match: [
          /function/,
          /\s+/,
          r,
          /(?=\s*\()/
        ]
      },
      // anonymous function
      {
        match: [
          /function/,
          /\s*(?=\()/
        ]
      }
    ],
    className: {
      1: "keyword",
      3: "title.function"
    },
    label: "func.def",
    contains: [C],
    illegal: /%/
  }, P = {
    relevance: 0,
    match: /\b[A-Z][A-Z_0-9]+\b/,
    className: "variable.constant"
  };
  function Y(R) {
    return e.concat("(?!", R.join("|"), ")");
  }
  const Z = {
    match: e.concat(
      /\b/,
      Y([
        ...yh,
        "super",
        "import"
      ].map((R) => `${R}\\s*\\(`)),
      r,
      e.lookahead(/\s*\(/)
    ),
    className: "title.function",
    relevance: 0
  }, q = {
    begin: e.concat(/\./, e.lookahead(
      e.concat(r, /(?![0-9A-Za-z$_(])/)
    )),
    end: r,
    excludeBegin: !0,
    keywords: "prototype",
    className: "property",
    relevance: 0
  }, V = {
    match: [
      /get|set/,
      /\s+/,
      r,
      /(?=\()/
    ],
    className: {
      1: "keyword",
      3: "title.function"
    },
    contains: [
      {
        // eat to avoid empty params
        begin: /\(\)/
      },
      C
    ]
  }, O = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + t.UNDERSCORE_IDENT_RE + ")\\s*=>", y = {
    match: [
      /const|var|let/,
      /\s+/,
      r,
      /\s*/,
      /=\s*/,
      /(async\s*)?/,
      // async is optional
      e.lookahead(O)
    ],
    keywords: "async",
    className: {
      1: "keyword",
      3: "title.function"
    },
    contains: [
      C
    ]
  };
  return {
    name: "JavaScript",
    aliases: ["js", "jsx", "mjs", "cjs"],
    keywords: s,
    // this will be extended by TypeScript
    exports: { PARAMS_CONTAINS: T, CLASS_REFERENCE: I },
    illegal: /#(?![$_A-z])/,
    contains: [
      t.SHEBANG({
        label: "shebang",
        binary: "node",
        relevance: 5
      }),
      N,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      _,
      m,
      f,
      g,
      E,
      // Skip numbers when they are part of a variable name
      { match: /\$\d+/ },
      d,
      I,
      {
        scope: "attr",
        match: r + e.lookahead(":"),
        relevance: 0
      },
      y,
      {
        // "value" container
        begin: "(" + t.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
        keywords: "return throw case",
        relevance: 0,
        contains: [
          E,
          t.REGEXP_MODE,
          {
            className: "function",
            // we have to count the parens to make sure we actually have the
            // correct bounding ( ) before the =>.  There could be any number of
            // sub-expressions inside also surrounded by parens.
            begin: O,
            returnBegin: !0,
            end: "\\s*=>",
            contains: [
              {
                className: "params",
                variants: [
                  {
                    begin: t.UNDERSCORE_IDENT_RE,
                    relevance: 0
                  },
                  {
                    className: null,
                    begin: /\(\s*\)/,
                    skip: !0
                  },
                  {
                    begin: /(\s*)\(/,
                    end: /\)/,
                    excludeBegin: !0,
                    excludeEnd: !0,
                    keywords: s,
                    contains: T
                  }
                ]
              }
            ]
          },
          {
            // could be a comma delimited list of params to a function call
            begin: /,/,
            relevance: 0
          },
          {
            match: /\s+/,
            relevance: 0
          },
          {
            // JSX
            variants: [
              { begin: i.begin, end: i.end },
              { match: o },
              {
                begin: a.begin,
                // we carefully check the opening tag to see if it truly
                // is a tag and not a false positive
                "on:begin": a.isTrulyOpeningTag,
                end: a.end
              }
            ],
            subLanguage: "xml",
            contains: [
              {
                begin: a.begin,
                end: a.end,
                skip: !0,
                contains: ["self"]
              }
            ]
          }
        ]
      },
      x,
      {
        // prevent this from getting swallowed up by function
        // since they appear "function like"
        beginKeywords: "while if switch catch for"
      },
      {
        // we have to count the parens to make sure we actually have the correct
        // bounding ( ).  There could be any number of sub-expressions inside
        // also surrounded by parens.
        begin: "\\b(?!function)" + t.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
        // end parens
        returnBegin: !0,
        label: "func.def",
        contains: [
          C,
          t.inherit(t.TITLE_MODE, { begin: r, className: "title.function" })
        ]
      },
      // catch ... so it won't trigger the property rule below
      {
        match: /\.\.\./,
        relevance: 0
      },
      q,
      // hack: prevents detection of keywords in some circumstances
      // .keyword()
      // $keyword = x
      {
        match: "\\$" + r,
        relevance: 0
      },
      {
        match: [/\bconstructor(?=\s*\()/],
        className: { 1: "title.function" },
        contains: [C]
      },
      Z,
      P,
      v,
      V,
      {
        match: /\$[(.]/
        // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
      }
    ]
  };
}
function tM(t) {
  const e = {
    className: "attr",
    begin: /"(\\.|[^\\"\r\n])*"(?=\s*:)/,
    relevance: 1.01
  }, n = {
    match: /[{}[\],:]/,
    className: "punctuation",
    relevance: 0
  }, r = [
    "true",
    "false",
    "null"
  ], i = {
    scope: "literal",
    beginKeywords: r.join(" ")
  };
  return {
    name: "JSON",
    aliases: ["jsonc"],
    keywords: {
      literal: r
    },
    contains: [
      e,
      n,
      t.QUOTE_STRING_MODE,
      i,
      t.C_NUMBER_MODE,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE
    ],
    illegal: "\\S"
  };
}
var Gr = "[0-9](_*[0-9])*", Zo = `\\.(${Gr})`, Xo = "[0-9a-fA-F](_*[0-9a-fA-F])*", nM = {
  className: "number",
  variants: [
    // DecimalFloatingPointLiteral
    // including ExponentPart
    { begin: `(\\b(${Gr})((${Zo})|\\.)?|(${Zo}))[eE][+-]?(${Gr})[fFdD]?\\b` },
    // excluding ExponentPart
    { begin: `\\b(${Gr})((${Zo})[fFdD]?\\b|\\.([fFdD]\\b)?)` },
    { begin: `(${Zo})[fFdD]?\\b` },
    { begin: `\\b(${Gr})[fFdD]\\b` },
    // HexadecimalFloatingPointLiteral
    { begin: `\\b0[xX]((${Xo})\\.?|(${Xo})?\\.(${Xo}))[pP][+-]?(${Gr})[fFdD]?\\b` },
    // DecimalIntegerLiteral
    { begin: "\\b(0|[1-9](_*[0-9])*)[lL]?\\b" },
    // HexIntegerLiteral
    { begin: `\\b0[xX](${Xo})[lL]?\\b` },
    // OctalIntegerLiteral
    { begin: "\\b0(_*[0-7])*[lL]?\\b" },
    // BinaryIntegerLiteral
    { begin: "\\b0[bB][01](_*[01])*[lL]?\\b" }
  ],
  relevance: 0
};
function rM(t) {
  const e = {
    keyword: "abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",
    built_in: "Byte Short Char Int Long Boolean Float Double Void Unit Nothing",
    literal: "true false null"
  }, n = {
    className: "keyword",
    begin: /\b(break|continue|return|this)\b/,
    starts: { contains: [
      {
        className: "symbol",
        begin: /@\w+/
      }
    ] }
  }, r = {
    className: "symbol",
    begin: t.UNDERSCORE_IDENT_RE + "@"
  }, i = {
    className: "subst",
    begin: /\$\{/,
    end: /\}/,
    contains: [t.C_NUMBER_MODE]
  }, o = {
    className: "variable",
    begin: "\\$" + t.UNDERSCORE_IDENT_RE
  }, a = {
    className: "string",
    variants: [
      {
        begin: '"""',
        end: '"""(?=[^"])',
        contains: [
          o,
          i
        ]
      },
      // Can't use built-in modes easily, as we want to use STRING in the meta
      // context as 'meta-string' and there's no syntax to remove explicitly set
      // classNames in built-in modes.
      {
        begin: "'",
        end: "'",
        illegal: /\n/,
        contains: [t.BACKSLASH_ESCAPE]
      },
      {
        begin: '"',
        end: '"',
        illegal: /\n/,
        contains: [
          t.BACKSLASH_ESCAPE,
          o,
          i
        ]
      }
    ]
  };
  i.contains.push(a);
  const s = {
    className: "meta",
    begin: "@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*" + t.UNDERSCORE_IDENT_RE + ")?"
  }, l = {
    className: "meta",
    begin: "@" + t.UNDERSCORE_IDENT_RE,
    contains: [
      {
        begin: /\(/,
        end: /\)/,
        contains: [
          t.inherit(a, { className: "string" }),
          "self"
        ]
      }
    ]
  }, c = nM, u = t.COMMENT(
    "/\\*",
    "\\*/",
    { contains: [t.C_BLOCK_COMMENT_MODE] }
  ), d = { variants: [
    {
      className: "type",
      begin: t.UNDERSCORE_IDENT_RE
    },
    {
      begin: /\(/,
      end: /\)/,
      contains: []
      // defined later
    }
  ] }, p = d;
  return p.variants[1].contains = [d], d.variants[1].contains = [p], {
    name: "Kotlin",
    aliases: [
      "kt",
      "kts"
    ],
    keywords: e,
    contains: [
      t.COMMENT(
        "/\\*\\*",
        "\\*/",
        {
          relevance: 0,
          contains: [
            {
              className: "doctag",
              begin: "@[A-Za-z]+"
            }
          ]
        }
      ),
      t.C_LINE_COMMENT_MODE,
      u,
      n,
      r,
      s,
      l,
      {
        className: "function",
        beginKeywords: "fun",
        end: "[(]|$",
        returnBegin: !0,
        excludeEnd: !0,
        keywords: e,
        relevance: 5,
        contains: [
          {
            begin: t.UNDERSCORE_IDENT_RE + "\\s*\\(",
            returnBegin: !0,
            relevance: 0,
            contains: [t.UNDERSCORE_TITLE_MODE]
          },
          {
            className: "type",
            begin: /</,
            end: />/,
            keywords: "reified",
            relevance: 0
          },
          {
            className: "params",
            begin: /\(/,
            end: /\)/,
            endsParent: !0,
            keywords: e,
            relevance: 0,
            contains: [
              {
                begin: /:/,
                end: /[=,\/]/,
                endsWithParent: !0,
                contains: [
                  d,
                  t.C_LINE_COMMENT_MODE,
                  u
                ],
                relevance: 0
              },
              t.C_LINE_COMMENT_MODE,
              u,
              s,
              l,
              a,
              t.C_NUMBER_MODE
            ]
          },
          u
        ]
      },
      {
        begin: [
          /class|interface|trait/,
          /\s+/,
          t.UNDERSCORE_IDENT_RE
        ],
        beginScope: {
          3: "title.class"
        },
        keywords: "class interface trait",
        end: /[:\{(]|$/,
        excludeEnd: !0,
        illegal: "extends implements",
        contains: [
          { beginKeywords: "public protected internal private constructor" },
          t.UNDERSCORE_TITLE_MODE,
          {
            className: "type",
            begin: /</,
            end: />/,
            excludeBegin: !0,
            excludeEnd: !0,
            relevance: 0
          },
          {
            className: "type",
            begin: /[,:]\s*/,
            end: /[<\(,){\s]|$/,
            excludeBegin: !0,
            returnEnd: !0
          },
          s,
          l
        ]
      },
      a,
      {
        className: "meta",
        begin: "^#!/usr/bin/env",
        end: "$",
        illegal: `
`
      },
      c
    ]
  };
}
const iM = (t) => ({
  IMPORTANT: {
    scope: "meta",
    begin: "!important"
  },
  BLOCK_COMMENT: t.C_BLOCK_COMMENT_MODE,
  HEXCOLOR: {
    scope: "number",
    begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
  },
  FUNCTION_DISPATCH: {
    className: "built_in",
    begin: /[\w-]+(?=\()/
  },
  ATTRIBUTE_SELECTOR_MODE: {
    scope: "selector-attr",
    begin: /\[/,
    end: /\]/,
    illegal: "$",
    contains: [
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE
    ]
  },
  CSS_NUMBER_MODE: {
    scope: "number",
    begin: t.NUMBER_RE + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
    relevance: 0
  },
  CSS_VARIABLE: {
    className: "attr",
    begin: /--[A-Za-z_][A-Za-z0-9_-]*/
  }
}), oM = [
  "a",
  "abbr",
  "address",
  "article",
  "aside",
  "audio",
  "b",
  "blockquote",
  "body",
  "button",
  "canvas",
  "caption",
  "cite",
  "code",
  "dd",
  "del",
  "details",
  "dfn",
  "div",
  "dl",
  "dt",
  "em",
  "fieldset",
  "figcaption",
  "figure",
  "footer",
  "form",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "header",
  "hgroup",
  "html",
  "i",
  "iframe",
  "img",
  "input",
  "ins",
  "kbd",
  "label",
  "legend",
  "li",
  "main",
  "mark",
  "menu",
  "nav",
  "object",
  "ol",
  "optgroup",
  "option",
  "p",
  "picture",
  "q",
  "quote",
  "samp",
  "section",
  "select",
  "source",
  "span",
  "strong",
  "summary",
  "sup",
  "table",
  "tbody",
  "td",
  "textarea",
  "tfoot",
  "th",
  "thead",
  "time",
  "tr",
  "ul",
  "var",
  "video"
], aM = [
  "defs",
  "g",
  "marker",
  "mask",
  "pattern",
  "svg",
  "switch",
  "symbol",
  "feBlend",
  "feColorMatrix",
  "feComponentTransfer",
  "feComposite",
  "feConvolveMatrix",
  "feDiffuseLighting",
  "feDisplacementMap",
  "feFlood",
  "feGaussianBlur",
  "feImage",
  "feMerge",
  "feMorphology",
  "feOffset",
  "feSpecularLighting",
  "feTile",
  "feTurbulence",
  "linearGradient",
  "radialGradient",
  "stop",
  "circle",
  "ellipse",
  "image",
  "line",
  "path",
  "polygon",
  "polyline",
  "rect",
  "text",
  "use",
  "textPath",
  "tspan",
  "foreignObject",
  "clipPath"
], sM = [
  ...oM,
  ...aM
], lM = [
  "any-hover",
  "any-pointer",
  "aspect-ratio",
  "color",
  "color-gamut",
  "color-index",
  "device-aspect-ratio",
  "device-height",
  "device-width",
  "display-mode",
  "forced-colors",
  "grid",
  "height",
  "hover",
  "inverted-colors",
  "monochrome",
  "orientation",
  "overflow-block",
  "overflow-inline",
  "pointer",
  "prefers-color-scheme",
  "prefers-contrast",
  "prefers-reduced-motion",
  "prefers-reduced-transparency",
  "resolution",
  "scan",
  "scripting",
  "update",
  "width",
  // TODO: find a better solution?
  "min-width",
  "max-width",
  "min-height",
  "max-height"
].sort().reverse(), vh = [
  "active",
  "any-link",
  "blank",
  "checked",
  "current",
  "default",
  "defined",
  "dir",
  // dir()
  "disabled",
  "drop",
  "empty",
  "enabled",
  "first",
  "first-child",
  "first-of-type",
  "fullscreen",
  "future",
  "focus",
  "focus-visible",
  "focus-within",
  "has",
  // has()
  "host",
  // host or host()
  "host-context",
  // host-context()
  "hover",
  "indeterminate",
  "in-range",
  "invalid",
  "is",
  // is()
  "lang",
  // lang()
  "last-child",
  "last-of-type",
  "left",
  "link",
  "local-link",
  "not",
  // not()
  "nth-child",
  // nth-child()
  "nth-col",
  // nth-col()
  "nth-last-child",
  // nth-last-child()
  "nth-last-col",
  // nth-last-col()
  "nth-last-of-type",
  //nth-last-of-type()
  "nth-of-type",
  //nth-of-type()
  "only-child",
  "only-of-type",
  "optional",
  "out-of-range",
  "past",
  "placeholder-shown",
  "read-only",
  "read-write",
  "required",
  "right",
  "root",
  "scope",
  "target",
  "target-within",
  "user-invalid",
  "valid",
  "visited",
  "where"
  // where()
].sort().reverse(), Rh = [
  "after",
  "backdrop",
  "before",
  "cue",
  "cue-region",
  "first-letter",
  "first-line",
  "grammar-error",
  "marker",
  "part",
  "placeholder",
  "selection",
  "slotted",
  "spelling-error"
].sort().reverse(), cM = [
  "accent-color",
  "align-content",
  "align-items",
  "align-self",
  "alignment-baseline",
  "all",
  "anchor-name",
  "animation",
  "animation-composition",
  "animation-delay",
  "animation-direction",
  "animation-duration",
  "animation-fill-mode",
  "animation-iteration-count",
  "animation-name",
  "animation-play-state",
  "animation-range",
  "animation-range-end",
  "animation-range-start",
  "animation-timeline",
  "animation-timing-function",
  "appearance",
  "aspect-ratio",
  "backdrop-filter",
  "backface-visibility",
  "background",
  "background-attachment",
  "background-blend-mode",
  "background-clip",
  "background-color",
  "background-image",
  "background-origin",
  "background-position",
  "background-position-x",
  "background-position-y",
  "background-repeat",
  "background-size",
  "baseline-shift",
  "block-size",
  "border",
  "border-block",
  "border-block-color",
  "border-block-end",
  "border-block-end-color",
  "border-block-end-style",
  "border-block-end-width",
  "border-block-start",
  "border-block-start-color",
  "border-block-start-style",
  "border-block-start-width",
  "border-block-style",
  "border-block-width",
  "border-bottom",
  "border-bottom-color",
  "border-bottom-left-radius",
  "border-bottom-right-radius",
  "border-bottom-style",
  "border-bottom-width",
  "border-collapse",
  "border-color",
  "border-end-end-radius",
  "border-end-start-radius",
  "border-image",
  "border-image-outset",
  "border-image-repeat",
  "border-image-slice",
  "border-image-source",
  "border-image-width",
  "border-inline",
  "border-inline-color",
  "border-inline-end",
  "border-inline-end-color",
  "border-inline-end-style",
  "border-inline-end-width",
  "border-inline-start",
  "border-inline-start-color",
  "border-inline-start-style",
  "border-inline-start-width",
  "border-inline-style",
  "border-inline-width",
  "border-left",
  "border-left-color",
  "border-left-style",
  "border-left-width",
  "border-radius",
  "border-right",
  "border-right-color",
  "border-right-style",
  "border-right-width",
  "border-spacing",
  "border-start-end-radius",
  "border-start-start-radius",
  "border-style",
  "border-top",
  "border-top-color",
  "border-top-left-radius",
  "border-top-right-radius",
  "border-top-style",
  "border-top-width",
  "border-width",
  "bottom",
  "box-align",
  "box-decoration-break",
  "box-direction",
  "box-flex",
  "box-flex-group",
  "box-lines",
  "box-ordinal-group",
  "box-orient",
  "box-pack",
  "box-shadow",
  "box-sizing",
  "break-after",
  "break-before",
  "break-inside",
  "caption-side",
  "caret-color",
  "clear",
  "clip",
  "clip-path",
  "clip-rule",
  "color",
  "color-interpolation",
  "color-interpolation-filters",
  "color-profile",
  "color-rendering",
  "color-scheme",
  "column-count",
  "column-fill",
  "column-gap",
  "column-rule",
  "column-rule-color",
  "column-rule-style",
  "column-rule-width",
  "column-span",
  "column-width",
  "columns",
  "contain",
  "contain-intrinsic-block-size",
  "contain-intrinsic-height",
  "contain-intrinsic-inline-size",
  "contain-intrinsic-size",
  "contain-intrinsic-width",
  "container",
  "container-name",
  "container-type",
  "content",
  "content-visibility",
  "counter-increment",
  "counter-reset",
  "counter-set",
  "cue",
  "cue-after",
  "cue-before",
  "cursor",
  "cx",
  "cy",
  "direction",
  "display",
  "dominant-baseline",
  "empty-cells",
  "enable-background",
  "field-sizing",
  "fill",
  "fill-opacity",
  "fill-rule",
  "filter",
  "flex",
  "flex-basis",
  "flex-direction",
  "flex-flow",
  "flex-grow",
  "flex-shrink",
  "flex-wrap",
  "float",
  "flood-color",
  "flood-opacity",
  "flow",
  "font",
  "font-display",
  "font-family",
  "font-feature-settings",
  "font-kerning",
  "font-language-override",
  "font-optical-sizing",
  "font-palette",
  "font-size",
  "font-size-adjust",
  "font-smooth",
  "font-smoothing",
  "font-stretch",
  "font-style",
  "font-synthesis",
  "font-synthesis-position",
  "font-synthesis-small-caps",
  "font-synthesis-style",
  "font-synthesis-weight",
  "font-variant",
  "font-variant-alternates",
  "font-variant-caps",
  "font-variant-east-asian",
  "font-variant-emoji",
  "font-variant-ligatures",
  "font-variant-numeric",
  "font-variant-position",
  "font-variation-settings",
  "font-weight",
  "forced-color-adjust",
  "gap",
  "glyph-orientation-horizontal",
  "glyph-orientation-vertical",
  "grid",
  "grid-area",
  "grid-auto-columns",
  "grid-auto-flow",
  "grid-auto-rows",
  "grid-column",
  "grid-column-end",
  "grid-column-start",
  "grid-gap",
  "grid-row",
  "grid-row-end",
  "grid-row-start",
  "grid-template",
  "grid-template-areas",
  "grid-template-columns",
  "grid-template-rows",
  "hanging-punctuation",
  "height",
  "hyphenate-character",
  "hyphenate-limit-chars",
  "hyphens",
  "icon",
  "image-orientation",
  "image-rendering",
  "image-resolution",
  "ime-mode",
  "initial-letter",
  "initial-letter-align",
  "inline-size",
  "inset",
  "inset-area",
  "inset-block",
  "inset-block-end",
  "inset-block-start",
  "inset-inline",
  "inset-inline-end",
  "inset-inline-start",
  "isolation",
  "justify-content",
  "justify-items",
  "justify-self",
  "kerning",
  "left",
  "letter-spacing",
  "lighting-color",
  "line-break",
  "line-height",
  "line-height-step",
  "list-style",
  "list-style-image",
  "list-style-position",
  "list-style-type",
  "margin",
  "margin-block",
  "margin-block-end",
  "margin-block-start",
  "margin-bottom",
  "margin-inline",
  "margin-inline-end",
  "margin-inline-start",
  "margin-left",
  "margin-right",
  "margin-top",
  "margin-trim",
  "marker",
  "marker-end",
  "marker-mid",
  "marker-start",
  "marks",
  "mask",
  "mask-border",
  "mask-border-mode",
  "mask-border-outset",
  "mask-border-repeat",
  "mask-border-slice",
  "mask-border-source",
  "mask-border-width",
  "mask-clip",
  "mask-composite",
  "mask-image",
  "mask-mode",
  "mask-origin",
  "mask-position",
  "mask-repeat",
  "mask-size",
  "mask-type",
  "masonry-auto-flow",
  "math-depth",
  "math-shift",
  "math-style",
  "max-block-size",
  "max-height",
  "max-inline-size",
  "max-width",
  "min-block-size",
  "min-height",
  "min-inline-size",
  "min-width",
  "mix-blend-mode",
  "nav-down",
  "nav-index",
  "nav-left",
  "nav-right",
  "nav-up",
  "none",
  "normal",
  "object-fit",
  "object-position",
  "offset",
  "offset-anchor",
  "offset-distance",
  "offset-path",
  "offset-position",
  "offset-rotate",
  "opacity",
  "order",
  "orphans",
  "outline",
  "outline-color",
  "outline-offset",
  "outline-style",
  "outline-width",
  "overflow",
  "overflow-anchor",
  "overflow-block",
  "overflow-clip-margin",
  "overflow-inline",
  "overflow-wrap",
  "overflow-x",
  "overflow-y",
  "overlay",
  "overscroll-behavior",
  "overscroll-behavior-block",
  "overscroll-behavior-inline",
  "overscroll-behavior-x",
  "overscroll-behavior-y",
  "padding",
  "padding-block",
  "padding-block-end",
  "padding-block-start",
  "padding-bottom",
  "padding-inline",
  "padding-inline-end",
  "padding-inline-start",
  "padding-left",
  "padding-right",
  "padding-top",
  "page",
  "page-break-after",
  "page-break-before",
  "page-break-inside",
  "paint-order",
  "pause",
  "pause-after",
  "pause-before",
  "perspective",
  "perspective-origin",
  "place-content",
  "place-items",
  "place-self",
  "pointer-events",
  "position",
  "position-anchor",
  "position-visibility",
  "print-color-adjust",
  "quotes",
  "r",
  "resize",
  "rest",
  "rest-after",
  "rest-before",
  "right",
  "rotate",
  "row-gap",
  "ruby-align",
  "ruby-position",
  "scale",
  "scroll-behavior",
  "scroll-margin",
  "scroll-margin-block",
  "scroll-margin-block-end",
  "scroll-margin-block-start",
  "scroll-margin-bottom",
  "scroll-margin-inline",
  "scroll-margin-inline-end",
  "scroll-margin-inline-start",
  "scroll-margin-left",
  "scroll-margin-right",
  "scroll-margin-top",
  "scroll-padding",
  "scroll-padding-block",
  "scroll-padding-block-end",
  "scroll-padding-block-start",
  "scroll-padding-bottom",
  "scroll-padding-inline",
  "scroll-padding-inline-end",
  "scroll-padding-inline-start",
  "scroll-padding-left",
  "scroll-padding-right",
  "scroll-padding-top",
  "scroll-snap-align",
  "scroll-snap-stop",
  "scroll-snap-type",
  "scroll-timeline",
  "scroll-timeline-axis",
  "scroll-timeline-name",
  "scrollbar-color",
  "scrollbar-gutter",
  "scrollbar-width",
  "shape-image-threshold",
  "shape-margin",
  "shape-outside",
  "shape-rendering",
  "speak",
  "speak-as",
  "src",
  // @font-face
  "stop-color",
  "stop-opacity",
  "stroke",
  "stroke-dasharray",
  "stroke-dashoffset",
  "stroke-linecap",
  "stroke-linejoin",
  "stroke-miterlimit",
  "stroke-opacity",
  "stroke-width",
  "tab-size",
  "table-layout",
  "text-align",
  "text-align-all",
  "text-align-last",
  "text-anchor",
  "text-combine-upright",
  "text-decoration",
  "text-decoration-color",
  "text-decoration-line",
  "text-decoration-skip",
  "text-decoration-skip-ink",
  "text-decoration-style",
  "text-decoration-thickness",
  "text-emphasis",
  "text-emphasis-color",
  "text-emphasis-position",
  "text-emphasis-style",
  "text-indent",
  "text-justify",
  "text-orientation",
  "text-overflow",
  "text-rendering",
  "text-shadow",
  "text-size-adjust",
  "text-transform",
  "text-underline-offset",
  "text-underline-position",
  "text-wrap",
  "text-wrap-mode",
  "text-wrap-style",
  "timeline-scope",
  "top",
  "touch-action",
  "transform",
  "transform-box",
  "transform-origin",
  "transform-style",
  "transition",
  "transition-behavior",
  "transition-delay",
  "transition-duration",
  "transition-property",
  "transition-timing-function",
  "translate",
  "unicode-bidi",
  "user-modify",
  "user-select",
  "vector-effect",
  "vertical-align",
  "view-timeline",
  "view-timeline-axis",
  "view-timeline-inset",
  "view-timeline-name",
  "view-transition-name",
  "visibility",
  "voice-balance",
  "voice-duration",
  "voice-family",
  "voice-pitch",
  "voice-range",
  "voice-rate",
  "voice-stress",
  "voice-volume",
  "white-space",
  "white-space-collapse",
  "widows",
  "width",
  "will-change",
  "word-break",
  "word-spacing",
  "word-wrap",
  "writing-mode",
  "x",
  "y",
  "z-index",
  "zoom"
].sort().reverse(), uM = vh.concat(Rh).sort().reverse();
function dM(t) {
  const e = iM(t), n = uM, r = "and or not only", i = "[\\w-]+", o = "(" + i + "|@\\{" + i + "\\})", a = [], s = [], l = function(b) {
    return {
      // Less strings are not multiline (also include '~' for more consistent coloring of "escaped" strings)
      className: "string",
      begin: "~?" + b + ".*?" + b
    };
  }, c = function(b, h, T) {
    return {
      className: b,
      begin: h,
      relevance: T
    };
  }, u = {
    $pattern: /[a-z-]+/,
    keyword: r,
    attribute: lM.join(" ")
  }, d = {
    // used only to properly balance nested parens inside mixin call, def. arg list
    begin: "\\(",
    end: "\\)",
    contains: s,
    keywords: u,
    relevance: 0
  };
  s.push(
    t.C_LINE_COMMENT_MODE,
    t.C_BLOCK_COMMENT_MODE,
    l("'"),
    l('"'),
    e.CSS_NUMBER_MODE,
    // fixme: it does not include dot for numbers like .5em :(
    {
      begin: "(url|data-uri)\\(",
      starts: {
        className: "string",
        end: "[\\)\\n]",
        excludeEnd: !0
      }
    },
    e.HEXCOLOR,
    d,
    c("variable", "@@?" + i, 10),
    c("variable", "@\\{" + i + "\\}"),
    c("built_in", "~?`[^`]*?`"),
    // inline javascript (or whatever host language) *multiline* string
    {
      // @media features (it’s here to not duplicate things in AT_RULE_MODE with extra PARENS_MODE overriding):
      className: "attribute",
      begin: i + "\\s*:",
      end: ":",
      returnBegin: !0,
      excludeEnd: !0
    },
    e.IMPORTANT,
    { beginKeywords: "and not" },
    e.FUNCTION_DISPATCH
  );
  const p = s.concat({
    begin: /\{/,
    end: /\}/,
    contains: a
  }), _ = {
    beginKeywords: "when",
    endsWithParent: !0,
    contains: [{ beginKeywords: "and not" }].concat(s)
    // using this form to override VALUE’s 'function' match
  }, m = {
    begin: o + "\\s*:",
    returnBegin: !0,
    end: /[;}]/,
    relevance: 0,
    contains: [
      { begin: /-(webkit|moz|ms|o)-/ },
      e.CSS_VARIABLE,
      {
        className: "attribute",
        begin: "\\b(" + cM.join("|") + ")\\b",
        end: /(?=:)/,
        starts: {
          endsWithParent: !0,
          illegal: "[<=$]",
          relevance: 0,
          contains: s
        }
      }
    ]
  }, f = {
    className: "keyword",
    begin: "@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",
    starts: {
      end: "[;{}]",
      keywords: u,
      returnEnd: !0,
      contains: s,
      relevance: 0
    }
  }, g = {
    className: "variable",
    variants: [
      // using more strict pattern for higher relevance to increase chances of Less detection.
      // this is *the only* Less specific statement used in most of the sources, so...
      // (we’ll still often loose to the css-parser unless there's '//' comment,
      // simply because 1 variable just can't beat 99 properties :)
      {
        begin: "@" + i + "\\s*:",
        relevance: 15
      },
      { begin: "@" + i }
    ],
    starts: {
      end: "[;}]",
      returnEnd: !0,
      contains: p
    }
  }, S = {
    // first parse unambiguous selectors (i.e. those not starting with tag)
    // then fall into the scary lookahead-discriminator variant.
    // this mode also handles mixin definitions and calls
    variants: [
      {
        begin: "[\\.#:&\\[>]",
        end: "[;{}]"
        // mixin calls end with ';'
      },
      {
        begin: o,
        end: /\{/
      }
    ],
    returnBegin: !0,
    returnEnd: !0,
    illegal: `[<='$"]`,
    relevance: 0,
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      _,
      c("keyword", "all\\b"),
      c("variable", "@\\{" + i + "\\}"),
      // otherwise it’s identified as tag
      {
        begin: "\\b(" + sM.join("|") + ")\\b",
        className: "selector-tag"
      },
      e.CSS_NUMBER_MODE,
      c("selector-tag", o, 0),
      c("selector-id", "#" + o),
      c("selector-class", "\\." + o, 0),
      c("selector-tag", "&", 0),
      e.ATTRIBUTE_SELECTOR_MODE,
      {
        className: "selector-pseudo",
        begin: ":(" + vh.join("|") + ")"
      },
      {
        className: "selector-pseudo",
        begin: ":(:)?(" + Rh.join("|") + ")"
      },
      {
        begin: /\(/,
        end: /\)/,
        relevance: 0,
        contains: p
      },
      // argument list of parametric mixins
      { begin: "!important" },
      // eat !important after mixin call or it will be colored as tag
      e.FUNCTION_DISPATCH
    ]
  }, E = {
    begin: i + `:(:)?(${n.join("|")})`,
    returnBegin: !0,
    contains: [S]
  };
  return a.push(
    t.C_LINE_COMMENT_MODE,
    t.C_BLOCK_COMMENT_MODE,
    f,
    g,
    E,
    m,
    S,
    _,
    e.FUNCTION_DISPATCH
  ), {
    name: "Less",
    case_insensitive: !0,
    illegal: `[=>'/<($"]`,
    contains: a
  };
}
function pM(t) {
  const e = "\\[=*\\[", n = "\\]=*\\]", r = {
    begin: e,
    end: n,
    contains: ["self"]
  }, i = [
    t.COMMENT("--(?!" + e + ")", "$"),
    t.COMMENT(
      "--" + e,
      n,
      {
        contains: [r],
        relevance: 10
      }
    )
  ];
  return {
    name: "Lua",
    aliases: ["pluto"],
    keywords: {
      $pattern: t.UNDERSCORE_IDENT_RE,
      literal: "true false nil",
      keyword: "and break do else elseif end for goto if in local not or repeat return then until while",
      built_in: (
        // Metatags and globals:
        "_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"
      )
    },
    contains: i.concat([
      {
        className: "function",
        beginKeywords: "function",
        end: "\\)",
        contains: [
          t.inherit(t.TITLE_MODE, { begin: "([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*" }),
          {
            className: "params",
            begin: "\\(",
            endsWithParent: !0,
            contains: i
          }
        ].concat(i)
      },
      t.C_NUMBER_MODE,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      {
        className: "string",
        begin: e,
        end: n,
        contains: [r],
        relevance: 5
      }
    ])
  };
}
function _M(t) {
  const e = {
    className: "variable",
    variants: [
      {
        begin: "\\$\\(" + t.UNDERSCORE_IDENT_RE + "\\)",
        contains: [t.BACKSLASH_ESCAPE]
      },
      { begin: /\$[@%<?\^\+\*]/ }
    ]
  }, n = {
    className: "string",
    begin: /"/,
    end: /"/,
    contains: [
      t.BACKSLASH_ESCAPE,
      e
    ]
  }, r = {
    className: "variable",
    begin: /\$\([\w-]+\s/,
    end: /\)/,
    keywords: { built_in: "subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value" },
    contains: [
      e,
      n
      // Added QUOTE_STRING as they can be a part of functions
    ]
  }, i = { begin: "^" + t.UNDERSCORE_IDENT_RE + "\\s*(?=[:+?]?=)" }, o = {
    className: "meta",
    begin: /^\.PHONY:/,
    end: /$/,
    keywords: {
      $pattern: /[\.\w]+/,
      keyword: ".PHONY"
    }
  }, a = {
    className: "section",
    begin: /^[^\s]+:/,
    end: /$/,
    contains: [e]
  };
  return {
    name: "Makefile",
    aliases: [
      "mk",
      "mak",
      "make"
    ],
    keywords: {
      $pattern: /[\w-]+/,
      keyword: "define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"
    },
    contains: [
      t.HASH_COMMENT_MODE,
      e,
      n,
      r,
      i,
      o,
      a
    ]
  };
}
function mM(t) {
  const e = t.regex, n = {
    begin: /<\/?[A-Za-z_]/,
    end: ">",
    subLanguage: "xml",
    relevance: 0
  }, r = {
    begin: "^[-\\*]{3,}",
    end: "$"
  }, i = {
    className: "code",
    variants: [
      // TODO: fix to allow these to work with sublanguage also
      { begin: "(`{3,})[^`](.|\\n)*?\\1`*[ ]*" },
      { begin: "(~{3,})[^~](.|\\n)*?\\1~*[ ]*" },
      // needed to allow markdown as a sublanguage to work
      {
        begin: "```",
        end: "```+[ ]*$"
      },
      {
        begin: "~~~",
        end: "~~~+[ ]*$"
      },
      { begin: "`.+?`" },
      {
        begin: "(?=^( {4}|\\t))",
        // use contains to gobble up multiple lines to allow the block to be whatever size
        // but only have a single open/close tag vs one per line
        contains: [
          {
            begin: "^( {4}|\\t)",
            end: "(\\n)$"
          }
        ],
        relevance: 0
      }
    ]
  }, o = {
    className: "bullet",
    begin: "^[ 	]*([*+-]|(\\d+\\.))(?=\\s+)",
    end: "\\s+",
    excludeEnd: !0
  }, a = {
    begin: /^\[[^\n]+\]:/,
    returnBegin: !0,
    contains: [
      {
        className: "symbol",
        begin: /\[/,
        end: /\]/,
        excludeBegin: !0,
        excludeEnd: !0
      },
      {
        className: "link",
        begin: /:\s*/,
        end: /$/,
        excludeBegin: !0
      }
    ]
  }, s = /[A-Za-z][A-Za-z0-9+.-]*/, l = {
    variants: [
      // too much like nested array access in so many languages
      // to have any real relevance
      {
        begin: /\[.+?\]\[.*?\]/,
        relevance: 0
      },
      // popular internet URLs
      {
        begin: /\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,
        relevance: 2
      },
      {
        begin: e.concat(/\[.+?\]\(/, s, /:\/\/.*?\)/),
        relevance: 2
      },
      // relative urls
      {
        begin: /\[.+?\]\([./?&#].*?\)/,
        relevance: 1
      },
      // whatever else, lower relevance (might not be a link at all)
      {
        begin: /\[.*?\]\(.*?\)/,
        relevance: 0
      }
    ],
    returnBegin: !0,
    contains: [
      {
        // empty strings for alt or link text
        match: /\[(?=\])/
      },
      {
        className: "string",
        relevance: 0,
        begin: "\\[",
        end: "\\]",
        excludeBegin: !0,
        returnEnd: !0
      },
      {
        className: "link",
        relevance: 0,
        begin: "\\]\\(",
        end: "\\)",
        excludeBegin: !0,
        excludeEnd: !0
      },
      {
        className: "symbol",
        relevance: 0,
        begin: "\\]\\[",
        end: "\\]",
        excludeBegin: !0,
        excludeEnd: !0
      }
    ]
  }, c = {
    className: "strong",
    contains: [],
    // defined later
    variants: [
      {
        begin: /_{2}(?!\s)/,
        end: /_{2}/
      },
      {
        begin: /\*{2}(?!\s)/,
        end: /\*{2}/
      }
    ]
  }, u = {
    className: "emphasis",
    contains: [],
    // defined later
    variants: [
      {
        begin: /\*(?![*\s])/,
        end: /\*/
      },
      {
        begin: /_(?![_\s])/,
        end: /_/,
        relevance: 0
      }
    ]
  }, d = t.inherit(c, { contains: [] }), p = t.inherit(u, { contains: [] });
  c.contains.push(p), u.contains.push(d);
  let _ = [
    n,
    l
  ];
  return [
    c,
    u,
    d,
    p
  ].forEach((S) => {
    S.contains = S.contains.concat(_);
  }), _ = _.concat(c, u), {
    name: "Markdown",
    aliases: [
      "md",
      "mkdown",
      "mkd"
    ],
    contains: [
      {
        className: "section",
        variants: [
          {
            begin: "^#{1,6}",
            end: "$",
            contains: _
          },
          {
            begin: "(?=^.+?\\n[=-]{2,}$)",
            contains: [
              { begin: "^[=-]*$" },
              {
                begin: "^",
                end: "\\n",
                contains: _
              }
            ]
          }
        ]
      },
      n,
      o,
      c,
      u,
      {
        className: "quote",
        begin: "^>\\s+",
        contains: _,
        end: "$"
      },
      i,
      r,
      l,
      a,
      {
        //https://spec.commonmark.org/0.31.2/#entity-references
        scope: "literal",
        match: /&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/
      }
    ]
  };
}
function fM(t) {
  const e = {
    className: "built_in",
    begin: "\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"
  }, n = /[a-zA-Z@][a-zA-Z0-9_]*/, s = {
    "variable.language": [
      "this",
      "super"
    ],
    $pattern: n,
    keyword: [
      "while",
      "export",
      "sizeof",
      "typedef",
      "const",
      "struct",
      "for",
      "union",
      "volatile",
      "static",
      "mutable",
      "if",
      "do",
      "return",
      "goto",
      "enum",
      "else",
      "break",
      "extern",
      "asm",
      "case",
      "default",
      "register",
      "explicit",
      "typename",
      "switch",
      "continue",
      "inline",
      "readonly",
      "assign",
      "readwrite",
      "self",
      "@synchronized",
      "id",
      "typeof",
      "nonatomic",
      "IBOutlet",
      "IBAction",
      "strong",
      "weak",
      "copy",
      "in",
      "out",
      "inout",
      "bycopy",
      "byref",
      "oneway",
      "__strong",
      "__weak",
      "__block",
      "__autoreleasing",
      "@private",
      "@protected",
      "@public",
      "@try",
      "@property",
      "@end",
      "@throw",
      "@catch",
      "@finally",
      "@autoreleasepool",
      "@synthesize",
      "@dynamic",
      "@selector",
      "@optional",
      "@required",
      "@encode",
      "@package",
      "@import",
      "@defs",
      "@compatibility_alias",
      "__bridge",
      "__bridge_transfer",
      "__bridge_retained",
      "__bridge_retain",
      "__covariant",
      "__contravariant",
      "__kindof",
      "_Nonnull",
      "_Nullable",
      "_Null_unspecified",
      "__FUNCTION__",
      "__PRETTY_FUNCTION__",
      "__attribute__",
      "getter",
      "setter",
      "retain",
      "unsafe_unretained",
      "nonnull",
      "nullable",
      "null_unspecified",
      "null_resettable",
      "class",
      "instancetype",
      "NS_DESIGNATED_INITIALIZER",
      "NS_UNAVAILABLE",
      "NS_REQUIRES_SUPER",
      "NS_RETURNS_INNER_POINTER",
      "NS_INLINE",
      "NS_AVAILABLE",
      "NS_DEPRECATED",
      "NS_ENUM",
      "NS_OPTIONS",
      "NS_SWIFT_UNAVAILABLE",
      "NS_ASSUME_NONNULL_BEGIN",
      "NS_ASSUME_NONNULL_END",
      "NS_REFINED_FOR_SWIFT",
      "NS_SWIFT_NAME",
      "NS_SWIFT_NOTHROW",
      "NS_DURING",
      "NS_HANDLER",
      "NS_ENDHANDLER",
      "NS_VALUERETURN",
      "NS_VOIDRETURN"
    ],
    literal: [
      "false",
      "true",
      "FALSE",
      "TRUE",
      "nil",
      "YES",
      "NO",
      "NULL"
    ],
    built_in: [
      "dispatch_once_t",
      "dispatch_queue_t",
      "dispatch_sync",
      "dispatch_async",
      "dispatch_once"
    ],
    type: [
      "int",
      "float",
      "char",
      "unsigned",
      "signed",
      "short",
      "long",
      "double",
      "wchar_t",
      "unichar",
      "void",
      "bool",
      "BOOL",
      "id|0",
      "_Bool"
    ]
  }, l = {
    $pattern: n,
    keyword: [
      "@interface",
      "@class",
      "@protocol",
      "@implementation"
    ]
  };
  return {
    name: "Objective-C",
    aliases: [
      "mm",
      "objc",
      "obj-c",
      "obj-c++",
      "objective-c++"
    ],
    keywords: s,
    illegal: "</",
    contains: [
      e,
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      t.C_NUMBER_MODE,
      t.QUOTE_STRING_MODE,
      t.APOS_STRING_MODE,
      {
        className: "string",
        variants: [
          {
            begin: '@"',
            end: '"',
            illegal: "\\n",
            contains: [t.BACKSLASH_ESCAPE]
          }
        ]
      },
      {
        className: "meta",
        begin: /#\s*[a-z]+\b/,
        end: /$/,
        keywords: { keyword: "if else elif endif define undef warning error line pragma ifdef ifndef include" },
        contains: [
          {
            begin: /\\\n/,
            relevance: 0
          },
          t.inherit(t.QUOTE_STRING_MODE, { className: "string" }),
          {
            className: "string",
            begin: /<.*?>/,
            end: /$/,
            illegal: "\\n"
          },
          t.C_LINE_COMMENT_MODE,
          t.C_BLOCK_COMMENT_MODE
        ]
      },
      {
        className: "class",
        begin: "(" + l.keyword.join("|") + ")\\b",
        end: /(\{|$)/,
        excludeEnd: !0,
        keywords: l,
        contains: [t.UNDERSCORE_TITLE_MODE]
      },
      {
        begin: "\\." + t.UNDERSCORE_IDENT_RE,
        relevance: 0
      }
    ]
  };
}
function gM(t) {
  const e = t.regex, n = [
    "abs",
    "accept",
    "alarm",
    "and",
    "atan2",
    "bind",
    "binmode",
    "bless",
    "break",
    "caller",
    "chdir",
    "chmod",
    "chomp",
    "chop",
    "chown",
    "chr",
    "chroot",
    "class",
    "close",
    "closedir",
    "connect",
    "continue",
    "cos",
    "crypt",
    "dbmclose",
    "dbmopen",
    "defined",
    "delete",
    "die",
    "do",
    "dump",
    "each",
    "else",
    "elsif",
    "endgrent",
    "endhostent",
    "endnetent",
    "endprotoent",
    "endpwent",
    "endservent",
    "eof",
    "eval",
    "exec",
    "exists",
    "exit",
    "exp",
    "fcntl",
    "field",
    "fileno",
    "flock",
    "for",
    "foreach",
    "fork",
    "format",
    "formline",
    "getc",
    "getgrent",
    "getgrgid",
    "getgrnam",
    "gethostbyaddr",
    "gethostbyname",
    "gethostent",
    "getlogin",
    "getnetbyaddr",
    "getnetbyname",
    "getnetent",
    "getpeername",
    "getpgrp",
    "getpriority",
    "getprotobyname",
    "getprotobynumber",
    "getprotoent",
    "getpwent",
    "getpwnam",
    "getpwuid",
    "getservbyname",
    "getservbyport",
    "getservent",
    "getsockname",
    "getsockopt",
    "given",
    "glob",
    "gmtime",
    "goto",
    "grep",
    "gt",
    "hex",
    "if",
    "index",
    "int",
    "ioctl",
    "join",
    "keys",
    "kill",
    "last",
    "lc",
    "lcfirst",
    "length",
    "link",
    "listen",
    "local",
    "localtime",
    "log",
    "lstat",
    "lt",
    "ma",
    "map",
    "method",
    "mkdir",
    "msgctl",
    "msgget",
    "msgrcv",
    "msgsnd",
    "my",
    "ne",
    "next",
    "no",
    "not",
    "oct",
    "open",
    "opendir",
    "or",
    "ord",
    "our",
    "pack",
    "package",
    "pipe",
    "pop",
    "pos",
    "print",
    "printf",
    "prototype",
    "push",
    "q|0",
    "qq",
    "quotemeta",
    "qw",
    "qx",
    "rand",
    "read",
    "readdir",
    "readline",
    "readlink",
    "readpipe",
    "recv",
    "redo",
    "ref",
    "rename",
    "require",
    "reset",
    "return",
    "reverse",
    "rewinddir",
    "rindex",
    "rmdir",
    "say",
    "scalar",
    "seek",
    "seekdir",
    "select",
    "semctl",
    "semget",
    "semop",
    "send",
    "setgrent",
    "sethostent",
    "setnetent",
    "setpgrp",
    "setpriority",
    "setprotoent",
    "setpwent",
    "setservent",
    "setsockopt",
    "shift",
    "shmctl",
    "shmget",
    "shmread",
    "shmwrite",
    "shutdown",
    "sin",
    "sleep",
    "socket",
    "socketpair",
    "sort",
    "splice",
    "split",
    "sprintf",
    "sqrt",
    "srand",
    "stat",
    "state",
    "study",
    "sub",
    "substr",
    "symlink",
    "syscall",
    "sysopen",
    "sysread",
    "sysseek",
    "system",
    "syswrite",
    "tell",
    "telldir",
    "tie",
    "tied",
    "time",
    "times",
    "tr",
    "truncate",
    "uc",
    "ucfirst",
    "umask",
    "undef",
    "unless",
    "unlink",
    "unpack",
    "unshift",
    "untie",
    "until",
    "use",
    "utime",
    "values",
    "vec",
    "wait",
    "waitpid",
    "wantarray",
    "warn",
    "when",
    "while",
    "write",
    "x|0",
    "xor",
    "y|0"
  ], r = /[dualxmsipngr]{0,12}/, i = {
    $pattern: /[\w.]+/,
    keyword: n.join(" ")
  }, o = {
    className: "subst",
    begin: "[$@]\\{",
    end: "\\}",
    keywords: i
  }, a = {
    begin: /->\{/,
    end: /\}/
    // contains defined later
  }, s = {
    scope: "attr",
    match: /\s+:\s*\w+(\s*\(.*?\))?/
  }, l = {
    scope: "variable",
    variants: [
      { begin: /\$\d/ },
      {
        begin: e.concat(
          /[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,
          // negative look-ahead tries to avoid matching patterns that are not
          // Perl at all like $ident$, @ident@, etc.
          "(?![A-Za-z])(?![@$%])"
        )
      },
      {
        // Only $= is a special Perl variable and one can't declare @= or %=.
        begin: /[$%@](?!")[^\s\w{=]|\$=/,
        relevance: 0
      }
    ],
    contains: [s]
  }, c = {
    className: "number",
    variants: [
      // decimal numbers:
      // include the case where a number starts with a dot (eg. .9), and
      // the leading 0? avoids mixing the first and second match on 0.x cases
      { match: /0?\.[0-9][0-9_]+\b/ },
      // include the special versioned number (eg. v5.38)
      { match: /\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/ },
      // non-decimal numbers:
      { match: /\b0[0-7][0-7_]*\b/ },
      { match: /\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/ },
      { match: /\b0b[0-1][0-1_]*\b/ }
    ],
    relevance: 0
  }, u = [
    t.BACKSLASH_ESCAPE,
    o,
    l
  ], d = [
    /!/,
    /\//,
    /\|/,
    /\?/,
    /'/,
    /"/,
    // valid but infrequent and weird
    /#/
    // valid but infrequent and weird
  ], p = (f, g, S = "\\1") => {
    const E = S === "\\1" ? S : e.concat(S, g);
    return e.concat(
      e.concat("(?:", f, ")"),
      g,
      /(?:\\.|[^\\\/])*?/,
      E,
      /(?:\\.|[^\\\/])*?/,
      S,
      r
    );
  }, _ = (f, g, S) => e.concat(
    e.concat("(?:", f, ")"),
    g,
    /(?:\\.|[^\\\/])*?/,
    S,
    r
  ), m = [
    l,
    t.HASH_COMMENT_MODE,
    t.COMMENT(
      /^=\w/,
      /=cut/,
      { endsWithParent: !0 }
    ),
    a,
    {
      className: "string",
      contains: u,
      variants: [
        {
          begin: "q[qwxr]?\\s*\\(",
          end: "\\)",
          relevance: 5
        },
        {
          begin: "q[qwxr]?\\s*\\[",
          end: "\\]",
          relevance: 5
        },
        {
          begin: "q[qwxr]?\\s*\\{",
          end: "\\}",
          relevance: 5
        },
        {
          begin: "q[qwxr]?\\s*\\|",
          end: "\\|",
          relevance: 5
        },
        {
          begin: "q[qwxr]?\\s*<",
          end: ">",
          relevance: 5
        },
        {
          begin: "qw\\s+q",
          end: "q",
          relevance: 5
        },
        {
          begin: "'",
          end: "'",
          contains: [t.BACKSLASH_ESCAPE]
        },
        {
          begin: '"',
          end: '"'
        },
        {
          begin: "`",
          end: "`",
          contains: [t.BACKSLASH_ESCAPE]
        },
        {
          begin: /\{\w+\}/,
          relevance: 0
        },
        {
          begin: "-?\\w+\\s*=>",
          relevance: 0
        }
      ]
    },
    c,
    {
      // regexp container
      begin: "(\\/\\/|" + t.RE_STARTERS_RE + "|\\b(split|return|print|reverse|grep)\\b)\\s*",
      keywords: "split return print reverse grep",
      relevance: 0,
      contains: [
        t.HASH_COMMENT_MODE,
        {
          className: "regexp",
          variants: [
            // allow matching common delimiters
            { begin: p("s|tr|y", e.either(...d, { capture: !0 })) },
            // and then paired delmis
            { begin: p("s|tr|y", "\\(", "\\)") },
            { begin: p("s|tr|y", "\\[", "\\]") },
            { begin: p("s|tr|y", "\\{", "\\}") }
          ],
          relevance: 2
        },
        {
          className: "regexp",
          variants: [
            {
              // could be a comment in many languages so do not count
              // as relevant
              begin: /(m|qr)\/\//,
              relevance: 0
            },
            // prefix is optional with /regex/
            { begin: _("(?:m|qr)?", /\//, /\//) },
            // allow matching common delimiters
            { begin: _("m|qr", e.either(...d, { capture: !0 }), /\1/) },
            // allow common paired delmins
            { begin: _("m|qr", /\(/, /\)/) },
            { begin: _("m|qr", /\[/, /\]/) },
            { begin: _("m|qr", /\{/, /\}/) }
          ]
        }
      ]
    },
    {
      className: "function",
      beginKeywords: "sub method",
      end: "(\\s*\\(.*?\\))?[;{]",
      excludeEnd: !0,
      relevance: 5,
      contains: [t.TITLE_MODE, s]
    },
    {
      className: "class",
      beginKeywords: "class",
      end: "[;{]",
      excludeEnd: !0,
      relevance: 5,
      contains: [t.TITLE_MODE, s, c]
    },
    {
      begin: "-\\w\\b",
      relevance: 0
    },
    {
      begin: "^__DATA__$",
      end: "^__END__$",
      subLanguage: "mojolicious",
      contains: [
        {
          begin: "^@@.*",
          end: "$",
          className: "comment"
        }
      ]
    }
  ];
  return o.contains = m, a.contains = m, {
    name: "Perl",
    aliases: [
      "pl",
      "pm"
    ],
    keywords: i,
    contains: m
  };
}
function hM(t) {
  const e = t.regex, n = /(?![A-Za-z0-9])(?![$])/, r = e.concat(
    /[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,
    n
  ), i = e.concat(
    /(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,
    n
  ), o = e.concat(
    /[A-Z]+/,
    n
  ), a = {
    scope: "variable",
    match: "\\$+" + r
  }, s = {
    scope: "meta",
    variants: [
      { begin: /<\?php/, relevance: 10 },
      // boost for obvious PHP
      { begin: /<\?=/ },
      // less relevant per PSR-1 which says not to use short-tags
      { begin: /<\?/, relevance: 0.1 },
      { begin: /\?>/ }
      // end php tag
    ]
  }, l = {
    scope: "subst",
    variants: [
      { begin: /\$\w+/ },
      {
        begin: /\{\$/,
        end: /\}/
      }
    ]
  }, c = t.inherit(t.APOS_STRING_MODE, { illegal: null }), u = t.inherit(t.QUOTE_STRING_MODE, {
    illegal: null,
    contains: t.QUOTE_STRING_MODE.contains.concat(l)
  }), d = {
    begin: /<<<[ \t]*(?:(\w+)|"(\w+)")\n/,
    end: /[ \t]*(\w+)\b/,
    contains: t.QUOTE_STRING_MODE.contains.concat(l),
    "on:begin": (q, V) => {
      V.data._beginMatch = q[1] || q[2];
    },
    "on:end": (q, V) => {
      V.data._beginMatch !== q[1] && V.ignoreMatch();
    }
  }, p = t.END_SAME_AS_BEGIN({
    begin: /<<<[ \t]*'(\w+)'\n/,
    end: /[ \t]*(\w+)\b/
  }), _ = `[ 	
]`, m = {
    scope: "string",
    variants: [
      u,
      c,
      d,
      p
    ]
  }, f = {
    scope: "number",
    variants: [
      { begin: "\\b0[bB][01]+(?:_[01]+)*\\b" },
      // Binary w/ underscore support
      { begin: "\\b0[oO][0-7]+(?:_[0-7]+)*\\b" },
      // Octals w/ underscore support
      { begin: "\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b" },
      // Hex w/ underscore support
      // Decimals w/ underscore support, with optional fragments and scientific exponent (e) suffix.
      { begin: "(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?" }
    ],
    relevance: 0
  }, g = [
    "false",
    "null",
    "true"
  ], S = [
    // Magic constants:
    // <https://www.php.net/manual/en/language.constants.predefined.php>
    "__CLASS__",
    "__DIR__",
    "__FILE__",
    "__FUNCTION__",
    "__COMPILER_HALT_OFFSET__",
    "__LINE__",
    "__METHOD__",
    "__NAMESPACE__",
    "__TRAIT__",
    // Function that look like language construct or language construct that look like function:
    // List of keywords that may not require parenthesis
    "die",
    "echo",
    "exit",
    "include",
    "include_once",
    "print",
    "require",
    "require_once",
    // These are not language construct (function) but operate on the currently-executing function and can access the current symbol table
    // 'compact extract func_get_arg func_get_args func_num_args get_called_class get_parent_class ' +
    // Other keywords:
    // <https://www.php.net/manual/en/reserved.php>
    // <https://www.php.net/manual/en/language.types.type-juggling.php>
    "array",
    "abstract",
    "and",
    "as",
    "binary",
    "bool",
    "boolean",
    "break",
    "callable",
    "case",
    "catch",
    "class",
    "clone",
    "const",
    "continue",
    "declare",
    "default",
    "do",
    "double",
    "else",
    "elseif",
    "empty",
    "enddeclare",
    "endfor",
    "endforeach",
    "endif",
    "endswitch",
    "endwhile",
    "enum",
    "eval",
    "extends",
    "final",
    "finally",
    "float",
    "for",
    "foreach",
    "from",
    "global",
    "goto",
    "if",
    "implements",
    "instanceof",
    "insteadof",
    "int",
    "integer",
    "interface",
    "isset",
    "iterable",
    "list",
    "match|0",
    "mixed",
    "new",
    "never",
    "object",
    "or",
    "private",
    "protected",
    "public",
    "readonly",
    "real",
    "return",
    "string",
    "switch",
    "throw",
    "trait",
    "try",
    "unset",
    "use",
    "var",
    "void",
    "while",
    "xor",
    "yield"
  ], E = [
    // Standard PHP library:
    // <https://www.php.net/manual/en/book.spl.php>
    "Error|0",
    "AppendIterator",
    "ArgumentCountError",
    "ArithmeticError",
    "ArrayIterator",
    "ArrayObject",
    "AssertionError",
    "BadFunctionCallException",
    "BadMethodCallException",
    "CachingIterator",
    "CallbackFilterIterator",
    "CompileError",
    "Countable",
    "DirectoryIterator",
    "DivisionByZeroError",
    "DomainException",
    "EmptyIterator",
    "ErrorException",
    "Exception",
    "FilesystemIterator",
    "FilterIterator",
    "GlobIterator",
    "InfiniteIterator",
    "InvalidArgumentException",
    "IteratorIterator",
    "LengthException",
    "LimitIterator",
    "LogicException",
    "MultipleIterator",
    "NoRewindIterator",
    "OutOfBoundsException",
    "OutOfRangeException",
    "OuterIterator",
    "OverflowException",
    "ParentIterator",
    "ParseError",
    "RangeException",
    "RecursiveArrayIterator",
    "RecursiveCachingIterator",
    "RecursiveCallbackFilterIterator",
    "RecursiveDirectoryIterator",
    "RecursiveFilterIterator",
    "RecursiveIterator",
    "RecursiveIteratorIterator",
    "RecursiveRegexIterator",
    "RecursiveTreeIterator",
    "RegexIterator",
    "RuntimeException",
    "SeekableIterator",
    "SplDoublyLinkedList",
    "SplFileInfo",
    "SplFileObject",
    "SplFixedArray",
    "SplHeap",
    "SplMaxHeap",
    "SplMinHeap",
    "SplObjectStorage",
    "SplObserver",
    "SplPriorityQueue",
    "SplQueue",
    "SplStack",
    "SplSubject",
    "SplTempFileObject",
    "TypeError",
    "UnderflowException",
    "UnexpectedValueException",
    "UnhandledMatchError",
    // Reserved interfaces:
    // <https://www.php.net/manual/en/reserved.interfaces.php>
    "ArrayAccess",
    "BackedEnum",
    "Closure",
    "Fiber",
    "Generator",
    "Iterator",
    "IteratorAggregate",
    "Serializable",
    "Stringable",
    "Throwable",
    "Traversable",
    "UnitEnum",
    "WeakReference",
    "WeakMap",
    // Reserved classes:
    // <https://www.php.net/manual/en/reserved.classes.php>
    "Directory",
    "__PHP_Incomplete_Class",
    "parent",
    "php_user_filter",
    "self",
    "static",
    "stdClass"
  ], h = {
    keyword: S,
    literal: ((q) => {
      const V = [];
      return q.forEach((O) => {
        V.push(O), O.toLowerCase() === O ? V.push(O.toUpperCase()) : V.push(O.toLowerCase());
      }), V;
    })(g),
    built_in: E
  }, T = (q) => q.map((V) => V.replace(/\|\d+$/, "")), C = { variants: [
    {
      match: [
        /new/,
        e.concat(_, "+"),
        // to prevent built ins from being confused as the class constructor call
        e.concat("(?!", T(E).join("\\b|"), "\\b)"),
        i
      ],
      scope: {
        1: "keyword",
        4: "title.class"
      }
    }
  ] }, v = e.concat(r, "\\b(?!\\()"), I = { variants: [
    {
      match: [
        e.concat(
          /::/,
          e.lookahead(/(?!class\b)/)
        ),
        v
      ],
      scope: { 2: "variable.constant" }
    },
    {
      match: [
        /::/,
        /class/
      ],
      scope: { 2: "variable.language" }
    },
    {
      match: [
        i,
        e.concat(
          /::/,
          e.lookahead(/(?!class\b)/)
        ),
        v
      ],
      scope: {
        1: "title.class",
        3: "variable.constant"
      }
    },
    {
      match: [
        i,
        e.concat(
          "::",
          e.lookahead(/(?!class\b)/)
        )
      ],
      scope: { 1: "title.class" }
    },
    {
      match: [
        i,
        /::/,
        /class/
      ],
      scope: {
        1: "title.class",
        3: "variable.language"
      }
    }
  ] }, N = {
    scope: "attr",
    match: e.concat(r, e.lookahead(":"), e.lookahead(/(?!::)/))
  }, x = {
    relevance: 0,
    begin: /\(/,
    end: /\)/,
    keywords: h,
    contains: [
      N,
      a,
      I,
      t.C_BLOCK_COMMENT_MODE,
      m,
      f,
      C
    ]
  }, P = {
    relevance: 0,
    match: [
      /\b/,
      // to prevent keywords from being confused as the function title
      e.concat("(?!fn\\b|function\\b|", T(S).join("\\b|"), "|", T(E).join("\\b|"), "\\b)"),
      r,
      e.concat(_, "*"),
      e.lookahead(/(?=\()/)
    ],
    scope: { 3: "title.function.invoke" },
    contains: [x]
  };
  x.contains.push(P);
  const Y = [
    N,
    I,
    t.C_BLOCK_COMMENT_MODE,
    m,
    f,
    C
  ], Z = {
    begin: e.concat(
      /#\[\s*\\?/,
      e.either(
        i,
        o
      )
    ),
    beginScope: "meta",
    end: /]/,
    endScope: "meta",
    keywords: {
      literal: g,
      keyword: [
        "new",
        "array"
      ]
    },
    contains: [
      {
        begin: /\[/,
        end: /]/,
        keywords: {
          literal: g,
          keyword: [
            "new",
            "array"
          ]
        },
        contains: [
          "self",
          ...Y
        ]
      },
      ...Y,
      {
        scope: "meta",
        variants: [
          { match: i },
          { match: o }
        ]
      }
    ]
  };
  return {
    case_insensitive: !1,
    keywords: h,
    contains: [
      Z,
      t.HASH_COMMENT_MODE,
      t.COMMENT("//", "$"),
      t.COMMENT(
        "/\\*",
        "\\*/",
        { contains: [
          {
            scope: "doctag",
            match: "@[A-Za-z]+"
          }
        ] }
      ),
      {
        match: /__halt_compiler\(\);/,
        keywords: "__halt_compiler",
        starts: {
          scope: "comment",
          end: t.MATCH_NOTHING_RE,
          contains: [
            {
              match: /\?>/,
              scope: "meta",
              endsParent: !0
            }
          ]
        }
      },
      s,
      {
        scope: "variable.language",
        match: /\$this\b/
      },
      a,
      P,
      I,
      {
        match: [
          /const/,
          /\s/,
          r
        ],
        scope: {
          1: "keyword",
          3: "variable.constant"
        }
      },
      C,
      {
        scope: "function",
        relevance: 0,
        beginKeywords: "fn function",
        end: /[;{]/,
        excludeEnd: !0,
        illegal: "[$%\\[]",
        contains: [
          { beginKeywords: "use" },
          t.UNDERSCORE_TITLE_MODE,
          {
            begin: "=>",
            // No markup, just a relevance booster
            endsParent: !0
          },
          {
            scope: "params",
            begin: "\\(",
            end: "\\)",
            excludeBegin: !0,
            excludeEnd: !0,
            keywords: h,
            contains: [
              "self",
              Z,
              a,
              I,
              t.C_BLOCK_COMMENT_MODE,
              m,
              f
            ]
          }
        ]
      },
      {
        scope: "class",
        variants: [
          {
            beginKeywords: "enum",
            illegal: /[($"]/
          },
          {
            beginKeywords: "class interface trait",
            illegal: /[:($"]/
          }
        ],
        relevance: 0,
        end: /\{/,
        excludeEnd: !0,
        contains: [
          { beginKeywords: "extends implements" },
          t.UNDERSCORE_TITLE_MODE
        ]
      },
      // both use and namespace still use "old style" rules (vs multi-match)
      // because the namespace name can include `\` and we still want each
      // element to be treated as its own *individual* title
      {
        beginKeywords: "namespace",
        relevance: 0,
        end: ";",
        illegal: /[.']/,
        contains: [t.inherit(t.UNDERSCORE_TITLE_MODE, { scope: "title.class" })]
      },
      {
        beginKeywords: "use",
        relevance: 0,
        end: ";",
        contains: [
          // TODO: title.function vs title.class
          {
            match: /\b(as|const|function)\b/,
            scope: "keyword"
          },
          // TODO: could be title.class or title.function
          t.UNDERSCORE_TITLE_MODE
        ]
      },
      m,
      f
    ]
  };
}
function EM(t) {
  return {
    name: "PHP template",
    subLanguage: "xml",
    contains: [
      {
        begin: /<\?(php|=)?/,
        end: /\?>/,
        subLanguage: "php",
        contains: [
          // We don't want the php closing tag ?> to close the PHP block when
          // inside any of the following blocks:
          {
            begin: "/\\*",
            end: "\\*/",
            skip: !0
          },
          {
            begin: 'b"',
            end: '"',
            skip: !0
          },
          {
            begin: "b'",
            end: "'",
            skip: !0
          },
          t.inherit(t.APOS_STRING_MODE, {
            illegal: null,
            className: null,
            contains: null,
            skip: !0
          }),
          t.inherit(t.QUOTE_STRING_MODE, {
            illegal: null,
            className: null,
            contains: null,
            skip: !0
          })
        ]
      }
    ]
  };
}
function SM(t) {
  return {
    name: "Plain text",
    aliases: [
      "text",
      "txt"
    ],
    disableAutodetect: !0
  };
}
function bM(t) {
  const e = t.regex, n = new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*", "u"), r = [
    "and",
    "as",
    "assert",
    "async",
    "await",
    "break",
    "case",
    "class",
    "continue",
    "def",
    "del",
    "elif",
    "else",
    "except",
    "finally",
    "for",
    "from",
    "global",
    "if",
    "import",
    "in",
    "is",
    "lambda",
    "match",
    "nonlocal|10",
    "not",
    "or",
    "pass",
    "raise",
    "return",
    "try",
    "while",
    "with",
    "yield"
  ], s = {
    $pattern: /[A-Za-z]\w+|__\w+__/,
    keyword: r,
    built_in: [
      "__import__",
      "abs",
      "all",
      "any",
      "ascii",
      "bin",
      "bool",
      "breakpoint",
      "bytearray",
      "bytes",
      "callable",
      "chr",
      "classmethod",
      "compile",
      "complex",
      "delattr",
      "dict",
      "dir",
      "divmod",
      "enumerate",
      "eval",
      "exec",
      "filter",
      "float",
      "format",
      "frozenset",
      "getattr",
      "globals",
      "hasattr",
      "hash",
      "help",
      "hex",
      "id",
      "input",
      "int",
      "isinstance",
      "issubclass",
      "iter",
      "len",
      "list",
      "locals",
      "map",
      "max",
      "memoryview",
      "min",
      "next",
      "object",
      "oct",
      "open",
      "ord",
      "pow",
      "print",
      "property",
      "range",
      "repr",
      "reversed",
      "round",
      "set",
      "setattr",
      "slice",
      "sorted",
      "staticmethod",
      "str",
      "sum",
      "super",
      "tuple",
      "type",
      "vars",
      "zip"
    ],
    literal: [
      "__debug__",
      "Ellipsis",
      "False",
      "None",
      "NotImplemented",
      "True"
    ],
    type: [
      "Any",
      "Callable",
      "Coroutine",
      "Dict",
      "List",
      "Literal",
      "Generic",
      "Optional",
      "Sequence",
      "Set",
      "Tuple",
      "Type",
      "Union"
    ]
  }, l = {
    className: "meta",
    begin: /^(>>>|\.\.\.) /
  }, c = {
    className: "subst",
    begin: /\{/,
    end: /\}/,
    keywords: s,
    illegal: /#/
  }, u = {
    begin: /\{\{/,
    relevance: 0
  }, d = {
    className: "string",
    contains: [t.BACKSLASH_ESCAPE],
    variants: [
      {
        begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,
        end: /'''/,
        contains: [
          t.BACKSLASH_ESCAPE,
          l
        ],
        relevance: 10
      },
      {
        begin: /([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,
        end: /"""/,
        contains: [
          t.BACKSLASH_ESCAPE,
          l
        ],
        relevance: 10
      },
      {
        begin: /([fF][rR]|[rR][fF]|[fF])'''/,
        end: /'''/,
        contains: [
          t.BACKSLASH_ESCAPE,
          l,
          u,
          c
        ]
      },
      {
        begin: /([fF][rR]|[rR][fF]|[fF])"""/,
        end: /"""/,
        contains: [
          t.BACKSLASH_ESCAPE,
          l,
          u,
          c
        ]
      },
      {
        begin: /([uU]|[rR])'/,
        end: /'/,
        relevance: 10
      },
      {
        begin: /([uU]|[rR])"/,
        end: /"/,
        relevance: 10
      },
      {
        begin: /([bB]|[bB][rR]|[rR][bB])'/,
        end: /'/
      },
      {
        begin: /([bB]|[bB][rR]|[rR][bB])"/,
        end: /"/
      },
      {
        begin: /([fF][rR]|[rR][fF]|[fF])'/,
        end: /'/,
        contains: [
          t.BACKSLASH_ESCAPE,
          u,
          c
        ]
      },
      {
        begin: /([fF][rR]|[rR][fF]|[fF])"/,
        end: /"/,
        contains: [
          t.BACKSLASH_ESCAPE,
          u,
          c
        ]
      },
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE
    ]
  }, p = "[0-9](_?[0-9])*", _ = `(\\b(${p}))?\\.(${p})|\\b(${p})\\.`, m = `\\b|${r.join("|")}`, f = {
    className: "number",
    relevance: 0,
    variants: [
      // exponentfloat, pointfloat
      // https://docs.python.org/3.9/reference/lexical_analysis.html#floating-point-literals
      // optionally imaginary
      // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
      // Note: no leading \b because floats can start with a decimal point
      // and we don't want to mishandle e.g. `fn(.5)`,
      // no trailing \b for pointfloat because it can end with a decimal point
      // and we don't want to mishandle e.g. `0..hex()`; this should be safe
      // because both MUST contain a decimal point and so cannot be confused with
      // the interior part of an identifier
      {
        begin: `(\\b(${p})|(${_}))[eE][+-]?(${p})[jJ]?(?=${m})`
      },
      {
        begin: `(${_})[jJ]?`
      },
      // decinteger, bininteger, octinteger, hexinteger
      // https://docs.python.org/3.9/reference/lexical_analysis.html#integer-literals
      // optionally "long" in Python 2
      // https://docs.python.org/2.7/reference/lexical_analysis.html#integer-and-long-integer-literals
      // decinteger is optionally imaginary
      // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
      {
        begin: `\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`
      },
      {
        begin: `\\b0[bB](_?[01])+[lL]?(?=${m})`
      },
      {
        begin: `\\b0[oO](_?[0-7])+[lL]?(?=${m})`
      },
      {
        begin: `\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`
      },
      // imagnumber (digitpart-based)
      // https://docs.python.org/3.9/reference/lexical_analysis.html#imaginary-literals
      {
        begin: `\\b(${p})[jJ](?=${m})`
      }
    ]
  }, g = {
    className: "comment",
    begin: e.lookahead(/# type:/),
    end: /$/,
    keywords: s,
    contains: [
      {
        // prevent keywords from coloring `type`
        begin: /# type:/
      },
      // comment within a datatype comment includes no keywords
      {
        begin: /#/,
        end: /\b\B/,
        endsWithParent: !0
      }
    ]
  }, S = {
    className: "params",
    variants: [
      // Exclude params in functions without params
      {
        className: "",
        begin: /\(\s*\)/,
        skip: !0
      },
      {
        begin: /\(/,
        end: /\)/,
        excludeBegin: !0,
        excludeEnd: !0,
        keywords: s,
        contains: [
          "self",
          l,
          f,
          d,
          t.HASH_COMMENT_MODE
        ]
      }
    ]
  };
  return c.contains = [
    d,
    f,
    l
  ], {
    name: "Python",
    aliases: [
      "py",
      "gyp",
      "ipython"
    ],
    unicodeRegex: !0,
    keywords: s,
    illegal: /(<\/|\?)|=>/,
    contains: [
      l,
      f,
      {
        // very common convention
        scope: "variable.language",
        match: /\bself\b/
      },
      {
        // eat "if" prior to string so that it won't accidentally be
        // labeled as an f-string
        beginKeywords: "if",
        relevance: 0
      },
      { match: /\bor\b/, scope: "keyword" },
      d,
      g,
      t.HASH_COMMENT_MODE,
      {
        match: [
          /\bdef/,
          /\s+/,
          n
        ],
        scope: {
          1: "keyword",
          3: "title.function"
        },
        contains: [S]
      },
      {
        variants: [
          {
            match: [
              /\bclass/,
              /\s+/,
              n,
              /\s*/,
              /\(\s*/,
              n,
              /\s*\)/
            ]
          },
          {
            match: [
              /\bclass/,
              /\s+/,
              n
            ]
          }
        ],
        scope: {
          1: "keyword",
          3: "title.class",
          6: "title.class.inherited"
        }
      },
      {
        className: "meta",
        begin: /^[\t ]*@/,
        end: /(?=#)|$/,
        contains: [
          f,
          S,
          d
        ]
      }
    ]
  };
}
function TM(t) {
  return {
    aliases: ["pycon"],
    contains: [
      {
        className: "meta.prompt",
        starts: {
          // a space separates the REPL prefix from the actual code
          // this is purely for cleaner HTML output
          end: / |$/,
          starts: {
            end: "$",
            subLanguage: "python"
          }
        },
        variants: [
          { begin: /^>>>(?=[ ]|$)/ },
          { begin: /^\.\.\.(?=[ ]|$)/ }
        ]
      }
    ]
  };
}
function CM(t) {
  const e = t.regex, n = /(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/, r = e.either(
    // Special case: only hexadecimal binary powers can contain fractions
    /0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,
    // Hexadecimal numbers without fraction and optional binary power
    /0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,
    // Decimal numbers
    /(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/
  ), i = /[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/, o = e.either(
    /[()]/,
    /[{}]/,
    /\[\[/,
    /[[\]]/,
    /\\/,
    /,/
  );
  return {
    name: "R",
    keywords: {
      $pattern: n,
      keyword: "function if in break next repeat else for while",
      literal: "NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",
      built_in: (
        // Builtin constants
        "LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"
      )
    },
    contains: [
      // Roxygen comments
      t.COMMENT(
        /#'/,
        /$/,
        { contains: [
          {
            // Handle `@examples` separately to cause all subsequent code
            // until the next `@`-tag on its own line to be kept as-is,
            // preventing highlighting. This code is example R code, so nested
            // doctags shouldn’t be treated as such. See
            // `test/markup/r/roxygen.txt` for an example.
            scope: "doctag",
            match: /@examples/,
            starts: {
              end: e.lookahead(e.either(
                // end if another doc comment
                /\n^#'\s*(?=@[a-zA-Z]+)/,
                // or a line with no comment
                /\n^(?!#')/
              )),
              endsParent: !0
            }
          },
          {
            // Handle `@param` to highlight the parameter name following
            // after.
            scope: "doctag",
            begin: "@param",
            end: /$/,
            contains: [
              {
                scope: "variable",
                variants: [
                  { match: n },
                  { match: /`(?:\\.|[^`\\])+`/ }
                ],
                endsParent: !0
              }
            ]
          },
          {
            scope: "doctag",
            match: /@[a-zA-Z]+/
          },
          {
            scope: "keyword",
            match: /\\[a-zA-Z]+/
          }
        ] }
      ),
      t.HASH_COMMENT_MODE,
      {
        scope: "string",
        contains: [t.BACKSLASH_ESCAPE],
        variants: [
          t.END_SAME_AS_BEGIN({
            begin: /[rR]"(-*)\(/,
            end: /\)(-*)"/
          }),
          t.END_SAME_AS_BEGIN({
            begin: /[rR]"(-*)\{/,
            end: /\}(-*)"/
          }),
          t.END_SAME_AS_BEGIN({
            begin: /[rR]"(-*)\[/,
            end: /\](-*)"/
          }),
          t.END_SAME_AS_BEGIN({
            begin: /[rR]'(-*)\(/,
            end: /\)(-*)'/
          }),
          t.END_SAME_AS_BEGIN({
            begin: /[rR]'(-*)\{/,
            end: /\}(-*)'/
          }),
          t.END_SAME_AS_BEGIN({
            begin: /[rR]'(-*)\[/,
            end: /\](-*)'/
          }),
          {
            begin: '"',
            end: '"',
            relevance: 0
          },
          {
            begin: "'",
            end: "'",
            relevance: 0
          }
        ]
      },
      // Matching numbers immediately following punctuation and operators is
      // tricky since we need to look at the character ahead of a number to
      // ensure the number is not part of an identifier, and we cannot use
      // negative look-behind assertions. So instead we explicitly handle all
      // possible combinations of (operator|punctuation), number.
      // TODO: replace with negative look-behind when available
      // { begin: /(?<![a-zA-Z0-9._])0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/ },
      // { begin: /(?<![a-zA-Z0-9._])0[xX][0-9a-fA-F]+([pP][+-]?\d+)?[Li]?/ },
      // { begin: /(?<![a-zA-Z0-9._])(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?[Li]?/ }
      {
        relevance: 0,
        variants: [
          {
            scope: {
              1: "operator",
              2: "number"
            },
            match: [
              i,
              r
            ]
          },
          {
            scope: {
              1: "operator",
              2: "number"
            },
            match: [
              /%[^%]*%/,
              r
            ]
          },
          {
            scope: {
              1: "punctuation",
              2: "number"
            },
            match: [
              o,
              r
            ]
          },
          {
            scope: { 2: "number" },
            match: [
              /[^a-zA-Z0-9._]|^/,
              // not part of an identifier, or start of document
              r
            ]
          }
        ]
      },
      // Operators/punctuation when they're not directly followed by numbers
      {
        // Relevance boost for the most common assignment form.
        scope: { 3: "operator" },
        match: [
          n,
          /\s+/,
          /<-/,
          /\s+/
        ]
      },
      {
        scope: "operator",
        relevance: 0,
        variants: [
          { match: i },
          { match: /%[^%]*%/ }
        ]
      },
      {
        scope: "punctuation",
        relevance: 0,
        match: o
      },
      {
        // Escaped identifier
        begin: "`",
        end: "`",
        contains: [{ begin: /\\./ }]
      }
    ]
  };
}
function yM(t) {
  const e = t.regex, n = "([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)", r = e.either(
    /\b([A-Z]+[a-z0-9]+)+/,
    // ends in caps
    /\b([A-Z]+[a-z0-9]+)+[A-Z]+/
  ), i = e.concat(r, /(::\w+)*/), a = {
    "variable.constant": [
      "__FILE__",
      "__LINE__",
      "__ENCODING__"
    ],
    "variable.language": [
      "self",
      "super"
    ],
    keyword: [
      "alias",
      "and",
      "begin",
      "BEGIN",
      "break",
      "case",
      "class",
      "defined",
      "do",
      "else",
      "elsif",
      "end",
      "END",
      "ensure",
      "for",
      "if",
      "in",
      "module",
      "next",
      "not",
      "or",
      "redo",
      "require",
      "rescue",
      "retry",
      "return",
      "then",
      "undef",
      "unless",
      "until",
      "when",
      "while",
      "yield",
      ...[
        "include",
        "extend",
        "prepend",
        "public",
        "private",
        "protected",
        "raise",
        "throw"
      ]
    ],
    built_in: [
      "proc",
      "lambda",
      "attr_accessor",
      "attr_reader",
      "attr_writer",
      "define_method",
      "private_constant",
      "module_function"
    ],
    literal: [
      "true",
      "false",
      "nil"
    ]
  }, s = {
    className: "doctag",
    begin: "@[A-Za-z]+"
  }, l = {
    begin: "#<",
    end: ">"
  }, c = [
    t.COMMENT(
      "#",
      "$",
      { contains: [s] }
    ),
    t.COMMENT(
      "^=begin",
      "^=end",
      {
        contains: [s],
        relevance: 10
      }
    ),
    t.COMMENT("^__END__", t.MATCH_NOTHING_RE)
  ], u = {
    className: "subst",
    begin: /#\{/,
    end: /\}/,
    keywords: a
  }, d = {
    className: "string",
    contains: [
      t.BACKSLASH_ESCAPE,
      u
    ],
    variants: [
      {
        begin: /'/,
        end: /'/
      },
      {
        begin: /"/,
        end: /"/
      },
      {
        begin: /`/,
        end: /`/
      },
      {
        begin: /%[qQwWx]?\(/,
        end: /\)/
      },
      {
        begin: /%[qQwWx]?\[/,
        end: /\]/
      },
      {
        begin: /%[qQwWx]?\{/,
        end: /\}/
      },
      {
        begin: /%[qQwWx]?</,
        end: />/
      },
      {
        begin: /%[qQwWx]?\//,
        end: /\//
      },
      {
        begin: /%[qQwWx]?%/,
        end: /%/
      },
      {
        begin: /%[qQwWx]?-/,
        end: /-/
      },
      {
        begin: /%[qQwWx]?\|/,
        end: /\|/
      },
      // in the following expressions, \B in the beginning suppresses recognition of ?-sequences
      // where ? is the last character of a preceding identifier, as in: `func?4`
      { begin: /\B\?(\\\d{1,3})/ },
      { begin: /\B\?(\\x[A-Fa-f0-9]{1,2})/ },
      { begin: /\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/ },
      { begin: /\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/ },
      { begin: /\B\?\\(c|C-)[\x20-\x7e]/ },
      { begin: /\B\?\\?\S/ },
      // heredocs
      {
        // this guard makes sure that we have an entire heredoc and not a false
        // positive (auto-detect, etc.)
        begin: e.concat(
          /<<[-~]?'?/,
          e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)
        ),
        contains: [
          t.END_SAME_AS_BEGIN({
            begin: /(\w+)/,
            end: /(\w+)/,
            contains: [
              t.BACKSLASH_ESCAPE,
              u
            ]
          })
        ]
      }
    ]
  }, p = "[1-9](_?[0-9])*|0", _ = "[0-9](_?[0-9])*", m = {
    className: "number",
    relevance: 0,
    variants: [
      // decimal integer/float, optionally exponential or rational, optionally imaginary
      { begin: `\\b(${p})(\\.(${_}))?([eE][+-]?(${_})|r)?i?\\b` },
      // explicit decimal/binary/octal/hexadecimal integer,
      // optionally rational and/or imaginary
      { begin: "\\b0[dD][0-9](_?[0-9])*r?i?\\b" },
      { begin: "\\b0[bB][0-1](_?[0-1])*r?i?\\b" },
      { begin: "\\b0[oO][0-7](_?[0-7])*r?i?\\b" },
      { begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b" },
      // 0-prefixed implicit octal integer, optionally rational and/or imaginary
      { begin: "\\b0(_?[0-7])+r?i?\\b" }
    ]
  }, f = {
    variants: [
      {
        match: /\(\)/
      },
      {
        className: "params",
        begin: /\(/,
        end: /(?=\))/,
        excludeBegin: !0,
        endsParent: !0,
        keywords: a
      }
    ]
  }, C = [
    d,
    {
      variants: [
        {
          match: [
            /class\s+/,
            i,
            /\s+<\s+/,
            i
          ]
        },
        {
          match: [
            /\b(class|module)\s+/,
            i
          ]
        }
      ],
      scope: {
        2: "title.class",
        4: "title.class.inherited"
      },
      keywords: a
    },
    {
      match: [
        /(include|extend)\s+/,
        i
      ],
      scope: {
        2: "title.class"
      },
      keywords: a
    },
    {
      relevance: 0,
      match: [
        i,
        /\.new[. (]/
      ],
      scope: {
        1: "title.class"
      }
    },
    {
      relevance: 0,
      match: /\b[A-Z][A-Z_0-9]+\b/,
      className: "variable.constant"
    },
    {
      relevance: 0,
      match: r,
      scope: "title.class"
    },
    {
      match: [
        /def/,
        /\s+/,
        n
      ],
      scope: {
        1: "keyword",
        3: "title.function"
      },
      contains: [
        f
      ]
    },
    {
      // swallow namespace qualifiers before symbols
      begin: t.IDENT_RE + "::"
    },
    {
      className: "symbol",
      begin: t.UNDERSCORE_IDENT_RE + "(!|\\?)?:",
      relevance: 0
    },
    {
      className: "symbol",
      begin: ":(?!\\s)",
      contains: [
        d,
        { begin: n }
      ],
      relevance: 0
    },
    m,
    {
      // negative-look forward attempts to prevent false matches like:
      // @ident@ or $ident$ that might indicate this is not ruby at all
      className: "variable",
      begin: "(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"
    },
    {
      className: "params",
      begin: /\|(?!=)/,
      end: /\|/,
      excludeBegin: !0,
      excludeEnd: !0,
      relevance: 0,
      // this could be a lot of things (in other languages) other than params
      keywords: a
    },
    {
      // regexp container
      begin: "(" + t.RE_STARTERS_RE + "|unless)\\s*",
      keywords: "unless",
      contains: [
        {
          className: "regexp",
          contains: [
            t.BACKSLASH_ESCAPE,
            u
          ],
          illegal: /\n/,
          variants: [
            {
              begin: "/",
              end: "/[a-z]*"
            },
            {
              begin: /%r\{/,
              end: /\}[a-z]*/
            },
            {
              begin: "%r\\(",
              end: "\\)[a-z]*"
            },
            {
              begin: "%r!",
              end: "![a-z]*"
            },
            {
              begin: "%r\\[",
              end: "\\][a-z]*"
            }
          ]
        }
      ].concat(l, c),
      relevance: 0
    }
  ].concat(l, c);
  u.contains = C, f.contains = C;
  const x = [
    {
      begin: /^\s*=>/,
      starts: {
        end: "$",
        contains: C
      }
    },
    {
      className: "meta.prompt",
      begin: "^(" + "[>?]>" + "|" + "[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]" + "|" + "(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>" + ")(?=[ ])",
      starts: {
        end: "$",
        keywords: a,
        contains: C
      }
    }
  ];
  return c.unshift(l), {
    name: "Ruby",
    aliases: [
      "rb",
      "gemspec",
      "podspec",
      "thor",
      "irb"
    ],
    keywords: a,
    illegal: /\/\*/,
    contains: [t.SHEBANG({ binary: "ruby" })].concat(x).concat(c).concat(C)
  };
}
function vM(t) {
  const e = t.regex, n = /(r#)?/, r = e.concat(n, t.UNDERSCORE_IDENT_RE), i = e.concat(n, t.IDENT_RE), o = {
    className: "title.function.invoke",
    relevance: 0,
    begin: e.concat(
      /\b/,
      /(?!let|for|while|if|else|match\b)/,
      i,
      e.lookahead(/\s*\(/)
    )
  }, a = "([ui](8|16|32|64|128|size)|f(32|64))?", s = [
    "abstract",
    "as",
    "async",
    "await",
    "become",
    "box",
    "break",
    "const",
    "continue",
    "crate",
    "do",
    "dyn",
    "else",
    "enum",
    "extern",
    "false",
    "final",
    "fn",
    "for",
    "if",
    "impl",
    "in",
    "let",
    "loop",
    "macro",
    "match",
    "mod",
    "move",
    "mut",
    "override",
    "priv",
    "pub",
    "ref",
    "return",
    "self",
    "Self",
    "static",
    "struct",
    "super",
    "trait",
    "true",
    "try",
    "type",
    "typeof",
    "union",
    "unsafe",
    "unsized",
    "use",
    "virtual",
    "where",
    "while",
    "yield"
  ], l = [
    "true",
    "false",
    "Some",
    "None",
    "Ok",
    "Err"
  ], c = [
    // functions
    "drop ",
    // traits
    "Copy",
    "Send",
    "Sized",
    "Sync",
    "Drop",
    "Fn",
    "FnMut",
    "FnOnce",
    "ToOwned",
    "Clone",
    "Debug",
    "PartialEq",
    "PartialOrd",
    "Eq",
    "Ord",
    "AsRef",
    "AsMut",
    "Into",
    "From",
    "Default",
    "Iterator",
    "Extend",
    "IntoIterator",
    "DoubleEndedIterator",
    "ExactSizeIterator",
    "SliceConcatExt",
    "ToString",
    // macros
    "assert!",
    "assert_eq!",
    "bitflags!",
    "bytes!",
    "cfg!",
    "col!",
    "concat!",
    "concat_idents!",
    "debug_assert!",
    "debug_assert_eq!",
    "env!",
    "eprintln!",
    "panic!",
    "file!",
    "format!",
    "format_args!",
    "include_bytes!",
    "include_str!",
    "line!",
    "local_data_key!",
    "module_path!",
    "option_env!",
    "print!",
    "println!",
    "select!",
    "stringify!",
    "try!",
    "unimplemented!",
    "unreachable!",
    "vec!",
    "write!",
    "writeln!",
    "macro_rules!",
    "assert_ne!",
    "debug_assert_ne!"
  ], u = [
    "i8",
    "i16",
    "i32",
    "i64",
    "i128",
    "isize",
    "u8",
    "u16",
    "u32",
    "u64",
    "u128",
    "usize",
    "f32",
    "f64",
    "str",
    "char",
    "bool",
    "Box",
    "Option",
    "Result",
    "String",
    "Vec"
  ];
  return {
    name: "Rust",
    aliases: ["rs"],
    keywords: {
      $pattern: t.IDENT_RE + "!?",
      type: u,
      keyword: s,
      literal: l,
      built_in: c
    },
    illegal: "</",
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.COMMENT("/\\*", "\\*/", { contains: ["self"] }),
      t.inherit(t.QUOTE_STRING_MODE, {
        begin: /b?"/,
        illegal: null
      }),
      {
        className: "symbol",
        // negative lookahead to avoid matching `'`
        begin: /'[a-zA-Z_][a-zA-Z0-9_]*(?!')/
      },
      {
        scope: "string",
        variants: [
          { begin: /b?r(#*)"(.|\n)*?"\1(?!#)/ },
          {
            begin: /b?'/,
            end: /'/,
            contains: [
              {
                scope: "char.escape",
                match: /\\('|\w|x\w{2}|u\w{4}|U\w{8})/
              }
            ]
          }
        ]
      },
      {
        className: "number",
        variants: [
          { begin: "\\b0b([01_]+)" + a },
          { begin: "\\b0o([0-7_]+)" + a },
          { begin: "\\b0x([A-Fa-f0-9_]+)" + a },
          { begin: "\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)" + a }
        ],
        relevance: 0
      },
      {
        begin: [
          /fn/,
          /\s+/,
          r
        ],
        className: {
          1: "keyword",
          3: "title.function"
        }
      },
      {
        className: "meta",
        begin: "#!?\\[",
        end: "\\]",
        contains: [
          {
            className: "string",
            begin: /"/,
            end: /"/,
            contains: [
              t.BACKSLASH_ESCAPE
            ]
          }
        ]
      },
      {
        begin: [
          /let/,
          /\s+/,
          /(?:mut\s+)?/,
          r
        ],
        className: {
          1: "keyword",
          3: "keyword",
          4: "variable"
        }
      },
      // must come before impl/for rule later
      {
        begin: [
          /for/,
          /\s+/,
          r,
          /\s+/,
          /in/
        ],
        className: {
          1: "keyword",
          3: "variable",
          5: "keyword"
        }
      },
      {
        begin: [
          /type/,
          /\s+/,
          r
        ],
        className: {
          1: "keyword",
          3: "title.class"
        }
      },
      {
        begin: [
          /(?:trait|enum|struct|union|impl|for)/,
          /\s+/,
          r
        ],
        className: {
          1: "keyword",
          3: "title.class"
        }
      },
      {
        begin: t.IDENT_RE + "::",
        keywords: {
          keyword: "Self",
          built_in: c,
          type: u
        }
      },
      {
        className: "punctuation",
        begin: "->"
      },
      o
    ]
  };
}
const RM = (t) => ({
  IMPORTANT: {
    scope: "meta",
    begin: "!important"
  },
  BLOCK_COMMENT: t.C_BLOCK_COMMENT_MODE,
  HEXCOLOR: {
    scope: "number",
    begin: /#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/
  },
  FUNCTION_DISPATCH: {
    className: "built_in",
    begin: /[\w-]+(?=\()/
  },
  ATTRIBUTE_SELECTOR_MODE: {
    scope: "selector-attr",
    begin: /\[/,
    end: /\]/,
    illegal: "$",
    contains: [
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE
    ]
  },
  CSS_NUMBER_MODE: {
    scope: "number",
    begin: t.NUMBER_RE + "(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",
    relevance: 0
  },
  CSS_VARIABLE: {
    className: "attr",
    begin: /--[A-Za-z_][A-Za-z0-9_-]*/
  }
}), OM = [
  "a",
  "abbr",
  "address",
  "article",
  "aside",
  "audio",
  "b",
  "blockquote",
  "body",
  "button",
  "canvas",
  "caption",
  "cite",
  "code",
  "dd",
  "del",
  "details",
  "dfn",
  "div",
  "dl",
  "dt",
  "em",
  "fieldset",
  "figcaption",
  "figure",
  "footer",
  "form",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "header",
  "hgroup",
  "html",
  "i",
  "iframe",
  "img",
  "input",
  "ins",
  "kbd",
  "label",
  "legend",
  "li",
  "main",
  "mark",
  "menu",
  "nav",
  "object",
  "ol",
  "optgroup",
  "option",
  "p",
  "picture",
  "q",
  "quote",
  "samp",
  "section",
  "select",
  "source",
  "span",
  "strong",
  "summary",
  "sup",
  "table",
  "tbody",
  "td",
  "textarea",
  "tfoot",
  "th",
  "thead",
  "time",
  "tr",
  "ul",
  "var",
  "video"
], NM = [
  "defs",
  "g",
  "marker",
  "mask",
  "pattern",
  "svg",
  "switch",
  "symbol",
  "feBlend",
  "feColorMatrix",
  "feComponentTransfer",
  "feComposite",
  "feConvolveMatrix",
  "feDiffuseLighting",
  "feDisplacementMap",
  "feFlood",
  "feGaussianBlur",
  "feImage",
  "feMerge",
  "feMorphology",
  "feOffset",
  "feSpecularLighting",
  "feTile",
  "feTurbulence",
  "linearGradient",
  "radialGradient",
  "stop",
  "circle",
  "ellipse",
  "image",
  "line",
  "path",
  "polygon",
  "polyline",
  "rect",
  "text",
  "use",
  "textPath",
  "tspan",
  "foreignObject",
  "clipPath"
], AM = [
  ...OM,
  ...NM
], IM = [
  "any-hover",
  "any-pointer",
  "aspect-ratio",
  "color",
  "color-gamut",
  "color-index",
  "device-aspect-ratio",
  "device-height",
  "device-width",
  "display-mode",
  "forced-colors",
  "grid",
  "height",
  "hover",
  "inverted-colors",
  "monochrome",
  "orientation",
  "overflow-block",
  "overflow-inline",
  "pointer",
  "prefers-color-scheme",
  "prefers-contrast",
  "prefers-reduced-motion",
  "prefers-reduced-transparency",
  "resolution",
  "scan",
  "scripting",
  "update",
  "width",
  // TODO: find a better solution?
  "min-width",
  "max-width",
  "min-height",
  "max-height"
].sort().reverse(), xM = [
  "active",
  "any-link",
  "blank",
  "checked",
  "current",
  "default",
  "defined",
  "dir",
  // dir()
  "disabled",
  "drop",
  "empty",
  "enabled",
  "first",
  "first-child",
  "first-of-type",
  "fullscreen",
  "future",
  "focus",
  "focus-visible",
  "focus-within",
  "has",
  // has()
  "host",
  // host or host()
  "host-context",
  // host-context()
  "hover",
  "indeterminate",
  "in-range",
  "invalid",
  "is",
  // is()
  "lang",
  // lang()
  "last-child",
  "last-of-type",
  "left",
  "link",
  "local-link",
  "not",
  // not()
  "nth-child",
  // nth-child()
  "nth-col",
  // nth-col()
  "nth-last-child",
  // nth-last-child()
  "nth-last-col",
  // nth-last-col()
  "nth-last-of-type",
  //nth-last-of-type()
  "nth-of-type",
  //nth-of-type()
  "only-child",
  "only-of-type",
  "optional",
  "out-of-range",
  "past",
  "placeholder-shown",
  "read-only",
  "read-write",
  "required",
  "right",
  "root",
  "scope",
  "target",
  "target-within",
  "user-invalid",
  "valid",
  "visited",
  "where"
  // where()
].sort().reverse(), DM = [
  "after",
  "backdrop",
  "before",
  "cue",
  "cue-region",
  "first-letter",
  "first-line",
  "grammar-error",
  "marker",
  "part",
  "placeholder",
  "selection",
  "slotted",
  "spelling-error"
].sort().reverse(), wM = [
  "accent-color",
  "align-content",
  "align-items",
  "align-self",
  "alignment-baseline",
  "all",
  "anchor-name",
  "animation",
  "animation-composition",
  "animation-delay",
  "animation-direction",
  "animation-duration",
  "animation-fill-mode",
  "animation-iteration-count",
  "animation-name",
  "animation-play-state",
  "animation-range",
  "animation-range-end",
  "animation-range-start",
  "animation-timeline",
  "animation-timing-function",
  "appearance",
  "aspect-ratio",
  "backdrop-filter",
  "backface-visibility",
  "background",
  "background-attachment",
  "background-blend-mode",
  "background-clip",
  "background-color",
  "background-image",
  "background-origin",
  "background-position",
  "background-position-x",
  "background-position-y",
  "background-repeat",
  "background-size",
  "baseline-shift",
  "block-size",
  "border",
  "border-block",
  "border-block-color",
  "border-block-end",
  "border-block-end-color",
  "border-block-end-style",
  "border-block-end-width",
  "border-block-start",
  "border-block-start-color",
  "border-block-start-style",
  "border-block-start-width",
  "border-block-style",
  "border-block-width",
  "border-bottom",
  "border-bottom-color",
  "border-bottom-left-radius",
  "border-bottom-right-radius",
  "border-bottom-style",
  "border-bottom-width",
  "border-collapse",
  "border-color",
  "border-end-end-radius",
  "border-end-start-radius",
  "border-image",
  "border-image-outset",
  "border-image-repeat",
  "border-image-slice",
  "border-image-source",
  "border-image-width",
  "border-inline",
  "border-inline-color",
  "border-inline-end",
  "border-inline-end-color",
  "border-inline-end-style",
  "border-inline-end-width",
  "border-inline-start",
  "border-inline-start-color",
  "border-inline-start-style",
  "border-inline-start-width",
  "border-inline-style",
  "border-inline-width",
  "border-left",
  "border-left-color",
  "border-left-style",
  "border-left-width",
  "border-radius",
  "border-right",
  "border-right-color",
  "border-right-style",
  "border-right-width",
  "border-spacing",
  "border-start-end-radius",
  "border-start-start-radius",
  "border-style",
  "border-top",
  "border-top-color",
  "border-top-left-radius",
  "border-top-right-radius",
  "border-top-style",
  "border-top-width",
  "border-width",
  "bottom",
  "box-align",
  "box-decoration-break",
  "box-direction",
  "box-flex",
  "box-flex-group",
  "box-lines",
  "box-ordinal-group",
  "box-orient",
  "box-pack",
  "box-shadow",
  "box-sizing",
  "break-after",
  "break-before",
  "break-inside",
  "caption-side",
  "caret-color",
  "clear",
  "clip",
  "clip-path",
  "clip-rule",
  "color",
  "color-interpolation",
  "color-interpolation-filters",
  "color-profile",
  "color-rendering",
  "color-scheme",
  "column-count",
  "column-fill",
  "column-gap",
  "column-rule",
  "column-rule-color",
  "column-rule-style",
  "column-rule-width",
  "column-span",
  "column-width",
  "columns",
  "contain",
  "contain-intrinsic-block-size",
  "contain-intrinsic-height",
  "contain-intrinsic-inline-size",
  "contain-intrinsic-size",
  "contain-intrinsic-width",
  "container",
  "container-name",
  "container-type",
  "content",
  "content-visibility",
  "counter-increment",
  "counter-reset",
  "counter-set",
  "cue",
  "cue-after",
  "cue-before",
  "cursor",
  "cx",
  "cy",
  "direction",
  "display",
  "dominant-baseline",
  "empty-cells",
  "enable-background",
  "field-sizing",
  "fill",
  "fill-opacity",
  "fill-rule",
  "filter",
  "flex",
  "flex-basis",
  "flex-direction",
  "flex-flow",
  "flex-grow",
  "flex-shrink",
  "flex-wrap",
  "float",
  "flood-color",
  "flood-opacity",
  "flow",
  "font",
  "font-display",
  "font-family",
  "font-feature-settings",
  "font-kerning",
  "font-language-override",
  "font-optical-sizing",
  "font-palette",
  "font-size",
  "font-size-adjust",
  "font-smooth",
  "font-smoothing",
  "font-stretch",
  "font-style",
  "font-synthesis",
  "font-synthesis-position",
  "font-synthesis-small-caps",
  "font-synthesis-style",
  "font-synthesis-weight",
  "font-variant",
  "font-variant-alternates",
  "font-variant-caps",
  "font-variant-east-asian",
  "font-variant-emoji",
  "font-variant-ligatures",
  "font-variant-numeric",
  "font-variant-position",
  "font-variation-settings",
  "font-weight",
  "forced-color-adjust",
  "gap",
  "glyph-orientation-horizontal",
  "glyph-orientation-vertical",
  "grid",
  "grid-area",
  "grid-auto-columns",
  "grid-auto-flow",
  "grid-auto-rows",
  "grid-column",
  "grid-column-end",
  "grid-column-start",
  "grid-gap",
  "grid-row",
  "grid-row-end",
  "grid-row-start",
  "grid-template",
  "grid-template-areas",
  "grid-template-columns",
  "grid-template-rows",
  "hanging-punctuation",
  "height",
  "hyphenate-character",
  "hyphenate-limit-chars",
  "hyphens",
  "icon",
  "image-orientation",
  "image-rendering",
  "image-resolution",
  "ime-mode",
  "initial-letter",
  "initial-letter-align",
  "inline-size",
  "inset",
  "inset-area",
  "inset-block",
  "inset-block-end",
  "inset-block-start",
  "inset-inline",
  "inset-inline-end",
  "inset-inline-start",
  "isolation",
  "justify-content",
  "justify-items",
  "justify-self",
  "kerning",
  "left",
  "letter-spacing",
  "lighting-color",
  "line-break",
  "line-height",
  "line-height-step",
  "list-style",
  "list-style-image",
  "list-style-position",
  "list-style-type",
  "margin",
  "margin-block",
  "margin-block-end",
  "margin-block-start",
  "margin-bottom",
  "margin-inline",
  "margin-inline-end",
  "margin-inline-start",
  "margin-left",
  "margin-right",
  "margin-top",
  "margin-trim",
  "marker",
  "marker-end",
  "marker-mid",
  "marker-start",
  "marks",
  "mask",
  "mask-border",
  "mask-border-mode",
  "mask-border-outset",
  "mask-border-repeat",
  "mask-border-slice",
  "mask-border-source",
  "mask-border-width",
  "mask-clip",
  "mask-composite",
  "mask-image",
  "mask-mode",
  "mask-origin",
  "mask-position",
  "mask-repeat",
  "mask-size",
  "mask-type",
  "masonry-auto-flow",
  "math-depth",
  "math-shift",
  "math-style",
  "max-block-size",
  "max-height",
  "max-inline-size",
  "max-width",
  "min-block-size",
  "min-height",
  "min-inline-size",
  "min-width",
  "mix-blend-mode",
  "nav-down",
  "nav-index",
  "nav-left",
  "nav-right",
  "nav-up",
  "none",
  "normal",
  "object-fit",
  "object-position",
  "offset",
  "offset-anchor",
  "offset-distance",
  "offset-path",
  "offset-position",
  "offset-rotate",
  "opacity",
  "order",
  "orphans",
  "outline",
  "outline-color",
  "outline-offset",
  "outline-style",
  "outline-width",
  "overflow",
  "overflow-anchor",
  "overflow-block",
  "overflow-clip-margin",
  "overflow-inline",
  "overflow-wrap",
  "overflow-x",
  "overflow-y",
  "overlay",
  "overscroll-behavior",
  "overscroll-behavior-block",
  "overscroll-behavior-inline",
  "overscroll-behavior-x",
  "overscroll-behavior-y",
  "padding",
  "padding-block",
  "padding-block-end",
  "padding-block-start",
  "padding-bottom",
  "padding-inline",
  "padding-inline-end",
  "padding-inline-start",
  "padding-left",
  "padding-right",
  "padding-top",
  "page",
  "page-break-after",
  "page-break-before",
  "page-break-inside",
  "paint-order",
  "pause",
  "pause-after",
  "pause-before",
  "perspective",
  "perspective-origin",
  "place-content",
  "place-items",
  "place-self",
  "pointer-events",
  "position",
  "position-anchor",
  "position-visibility",
  "print-color-adjust",
  "quotes",
  "r",
  "resize",
  "rest",
  "rest-after",
  "rest-before",
  "right",
  "rotate",
  "row-gap",
  "ruby-align",
  "ruby-position",
  "scale",
  "scroll-behavior",
  "scroll-margin",
  "scroll-margin-block",
  "scroll-margin-block-end",
  "scroll-margin-block-start",
  "scroll-margin-bottom",
  "scroll-margin-inline",
  "scroll-margin-inline-end",
  "scroll-margin-inline-start",
  "scroll-margin-left",
  "scroll-margin-right",
  "scroll-margin-top",
  "scroll-padding",
  "scroll-padding-block",
  "scroll-padding-block-end",
  "scroll-padding-block-start",
  "scroll-padding-bottom",
  "scroll-padding-inline",
  "scroll-padding-inline-end",
  "scroll-padding-inline-start",
  "scroll-padding-left",
  "scroll-padding-right",
  "scroll-padding-top",
  "scroll-snap-align",
  "scroll-snap-stop",
  "scroll-snap-type",
  "scroll-timeline",
  "scroll-timeline-axis",
  "scroll-timeline-name",
  "scrollbar-color",
  "scrollbar-gutter",
  "scrollbar-width",
  "shape-image-threshold",
  "shape-margin",
  "shape-outside",
  "shape-rendering",
  "speak",
  "speak-as",
  "src",
  // @font-face
  "stop-color",
  "stop-opacity",
  "stroke",
  "stroke-dasharray",
  "stroke-dashoffset",
  "stroke-linecap",
  "stroke-linejoin",
  "stroke-miterlimit",
  "stroke-opacity",
  "stroke-width",
  "tab-size",
  "table-layout",
  "text-align",
  "text-align-all",
  "text-align-last",
  "text-anchor",
  "text-combine-upright",
  "text-decoration",
  "text-decoration-color",
  "text-decoration-line",
  "text-decoration-skip",
  "text-decoration-skip-ink",
  "text-decoration-style",
  "text-decoration-thickness",
  "text-emphasis",
  "text-emphasis-color",
  "text-emphasis-position",
  "text-emphasis-style",
  "text-indent",
  "text-justify",
  "text-orientation",
  "text-overflow",
  "text-rendering",
  "text-shadow",
  "text-size-adjust",
  "text-transform",
  "text-underline-offset",
  "text-underline-position",
  "text-wrap",
  "text-wrap-mode",
  "text-wrap-style",
  "timeline-scope",
  "top",
  "touch-action",
  "transform",
  "transform-box",
  "transform-origin",
  "transform-style",
  "transition",
  "transition-behavior",
  "transition-delay",
  "transition-duration",
  "transition-property",
  "transition-timing-function",
  "translate",
  "unicode-bidi",
  "user-modify",
  "user-select",
  "vector-effect",
  "vertical-align",
  "view-timeline",
  "view-timeline-axis",
  "view-timeline-inset",
  "view-timeline-name",
  "view-transition-name",
  "visibility",
  "voice-balance",
  "voice-duration",
  "voice-family",
  "voice-pitch",
  "voice-range",
  "voice-rate",
  "voice-stress",
  "voice-volume",
  "white-space",
  "white-space-collapse",
  "widows",
  "width",
  "will-change",
  "word-break",
  "word-spacing",
  "word-wrap",
  "writing-mode",
  "x",
  "y",
  "z-index",
  "zoom"
].sort().reverse();
function MM(t) {
  const e = RM(t), n = DM, r = xM, i = "@[a-z-]+", o = "and or not only", s = {
    className: "variable",
    begin: "(\\$" + "[a-zA-Z-][a-zA-Z0-9_-]*" + ")\\b",
    relevance: 0
  };
  return {
    name: "SCSS",
    case_insensitive: !0,
    illegal: "[=/|']",
    contains: [
      t.C_LINE_COMMENT_MODE,
      t.C_BLOCK_COMMENT_MODE,
      // to recognize keyframe 40% etc which are outside the scope of our
      // attribute value mode
      e.CSS_NUMBER_MODE,
      {
        className: "selector-id",
        begin: "#[A-Za-z0-9_-]+",
        relevance: 0
      },
      {
        className: "selector-class",
        begin: "\\.[A-Za-z0-9_-]+",
        relevance: 0
      },
      e.ATTRIBUTE_SELECTOR_MODE,
      {
        className: "selector-tag",
        begin: "\\b(" + AM.join("|") + ")\\b",
        // was there, before, but why?
        relevance: 0
      },
      {
        className: "selector-pseudo",
        begin: ":(" + r.join("|") + ")"
      },
      {
        className: "selector-pseudo",
        begin: ":(:)?(" + n.join("|") + ")"
      },
      s,
      {
        // pseudo-selector params
        begin: /\(/,
        end: /\)/,
        contains: [e.CSS_NUMBER_MODE]
      },
      e.CSS_VARIABLE,
      {
        className: "attribute",
        begin: "\\b(" + wM.join("|") + ")\\b"
      },
      { begin: "\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b" },
      {
        begin: /:/,
        end: /[;}{]/,
        relevance: 0,
        contains: [
          e.BLOCK_COMMENT,
          s,
          e.HEXCOLOR,
          e.CSS_NUMBER_MODE,
          t.QUOTE_STRING_MODE,
          t.APOS_STRING_MODE,
          e.IMPORTANT,
          e.FUNCTION_DISPATCH
        ]
      },
      // matching these here allows us to treat them more like regular CSS
      // rules so everything between the {} gets regular rule highlighting,
      // which is what we want for page and font-face
      {
        begin: "@(page|font-face)",
        keywords: {
          $pattern: i,
          keyword: "@page @font-face"
        }
      },
      {
        begin: "@",
        end: "[{;]",
        returnBegin: !0,
        keywords: {
          $pattern: /[a-z-]+/,
          keyword: o,
          attribute: IM.join(" ")
        },
        contains: [
          {
            begin: i,
            className: "keyword"
          },
          {
            begin: /[a-z-]+(?=:)/,
            className: "attribute"
          },
          s,
          t.QUOTE_STRING_MODE,
          t.APOS_STRING_MODE,
          e.HEXCOLOR,
          e.CSS_NUMBER_MODE
        ]
      },
      e.FUNCTION_DISPATCH
    ]
  };
}
function LM(t) {
  return {
    name: "Shell Session",
    aliases: [
      "console",
      "shellsession"
    ],
    contains: [
      {
        className: "meta.prompt",
        // We cannot add \s (spaces) in the regular expression otherwise it will be too broad and produce unexpected result.
        // For instance, in the following example, it would match "echo /path/to/home >" as a prompt:
        // echo /path/to/home > t.exe
        begin: /^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,
        starts: {
          end: /[^\\](?=\s*$)/,
          subLanguage: "bash"
        }
      }
    ]
  };
}
function kM(t) {
  const e = t.regex, n = t.COMMENT("--", "$"), r = {
    scope: "string",
    variants: [
      {
        begin: /'/,
        end: /'/,
        contains: [{ match: /''/ }]
      }
    ]
  }, i = {
    begin: /"/,
    end: /"/,
    contains: [{ match: /""/ }]
  }, o = [
    "true",
    "false",
    // Not sure it's correct to call NULL literal, and clauses like IS [NOT] NULL look strange that way.
    // "null",
    "unknown"
  ], a = [
    "double precision",
    "large object",
    "with timezone",
    "without timezone"
  ], s = [
    "bigint",
    "binary",
    "blob",
    "boolean",
    "char",
    "character",
    "clob",
    "date",
    "dec",
    "decfloat",
    "decimal",
    "float",
    "int",
    "integer",
    "interval",
    "nchar",
    "nclob",
    "national",
    "numeric",
    "real",
    "row",
    "smallint",
    "time",
    "timestamp",
    "varchar",
    "varying",
    // modifier (character varying)
    "varbinary"
  ], l = [
    "add",
    "asc",
    "collation",
    "desc",
    "final",
    "first",
    "last",
    "view"
  ], c = [
    "abs",
    "acos",
    "all",
    "allocate",
    "alter",
    "and",
    "any",
    "are",
    "array",
    "array_agg",
    "array_max_cardinality",
    "as",
    "asensitive",
    "asin",
    "asymmetric",
    "at",
    "atan",
    "atomic",
    "authorization",
    "avg",
    "begin",
    "begin_frame",
    "begin_partition",
    "between",
    "bigint",
    "binary",
    "blob",
    "boolean",
    "both",
    "by",
    "call",
    "called",
    "cardinality",
    "cascaded",
    "case",
    "cast",
    "ceil",
    "ceiling",
    "char",
    "char_length",
    "character",
    "character_length",
    "check",
    "classifier",
    "clob",
    "close",
    "coalesce",
    "collate",
    "collect",
    "column",
    "commit",
    "condition",
    "connect",
    "constraint",
    "contains",
    "convert",
    "copy",
    "corr",
    "corresponding",
    "cos",
    "cosh",
    "count",
    "covar_pop",
    "covar_samp",
    "create",
    "cross",
    "cube",
    "cume_dist",
    "current",
    "current_catalog",
    "current_date",
    "current_default_transform_group",
    "current_path",
    "current_role",
    "current_row",
    "current_schema",
    "current_time",
    "current_timestamp",
    "current_path",
    "current_role",
    "current_transform_group_for_type",
    "current_user",
    "cursor",
    "cycle",
    "date",
    "day",
    "deallocate",
    "dec",
    "decimal",
    "decfloat",
    "declare",
    "default",
    "define",
    "delete",
    "dense_rank",
    "deref",
    "describe",
    "deterministic",
    "disconnect",
    "distinct",
    "double",
    "drop",
    "dynamic",
    "each",
    "element",
    "else",
    "empty",
    "end",
    "end_frame",
    "end_partition",
    "end-exec",
    "equals",
    "escape",
    "every",
    "except",
    "exec",
    "execute",
    "exists",
    "exp",
    "external",
    "extract",
    "false",
    "fetch",
    "filter",
    "first_value",
    "float",
    "floor",
    "for",
    "foreign",
    "frame_row",
    "free",
    "from",
    "full",
    "function",
    "fusion",
    "get",
    "global",
    "grant",
    "group",
    "grouping",
    "groups",
    "having",
    "hold",
    "hour",
    "identity",
    "in",
    "indicator",
    "initial",
    "inner",
    "inout",
    "insensitive",
    "insert",
    "int",
    "integer",
    "intersect",
    "intersection",
    "interval",
    "into",
    "is",
    "join",
    "json_array",
    "json_arrayagg",
    "json_exists",
    "json_object",
    "json_objectagg",
    "json_query",
    "json_table",
    "json_table_primitive",
    "json_value",
    "lag",
    "language",
    "large",
    "last_value",
    "lateral",
    "lead",
    "leading",
    "left",
    "like",
    "like_regex",
    "listagg",
    "ln",
    "local",
    "localtime",
    "localtimestamp",
    "log",
    "log10",
    "lower",
    "match",
    "match_number",
    "match_recognize",
    "matches",
    "max",
    "member",
    "merge",
    "method",
    "min",
    "minute",
    "mod",
    "modifies",
    "module",
    "month",
    "multiset",
    "national",
    "natural",
    "nchar",
    "nclob",
    "new",
    "no",
    "none",
    "normalize",
    "not",
    "nth_value",
    "ntile",
    "null",
    "nullif",
    "numeric",
    "octet_length",
    "occurrences_regex",
    "of",
    "offset",
    "old",
    "omit",
    "on",
    "one",
    "only",
    "open",
    "or",
    "order",
    "out",
    "outer",
    "over",
    "overlaps",
    "overlay",
    "parameter",
    "partition",
    "pattern",
    "per",
    "percent",
    "percent_rank",
    "percentile_cont",
    "percentile_disc",
    "period",
    "portion",
    "position",
    "position_regex",
    "power",
    "precedes",
    "precision",
    "prepare",
    "primary",
    "procedure",
    "ptf",
    "range",
    "rank",
    "reads",
    "real",
    "recursive",
    "ref",
    "references",
    "referencing",
    "regr_avgx",
    "regr_avgy",
    "regr_count",
    "regr_intercept",
    "regr_r2",
    "regr_slope",
    "regr_sxx",
    "regr_sxy",
    "regr_syy",
    "release",
    "result",
    "return",
    "returns",
    "revoke",
    "right",
    "rollback",
    "rollup",
    "row",
    "row_number",
    "rows",
    "running",
    "savepoint",
    "scope",
    "scroll",
    "search",
    "second",
    "seek",
    "select",
    "sensitive",
    "session_user",
    "set",
    "show",
    "similar",
    "sin",
    "sinh",
    "skip",
    "smallint",
    "some",
    "specific",
    "specifictype",
    "sql",
    "sqlexception",
    "sqlstate",
    "sqlwarning",
    "sqrt",
    "start",
    "static",
    "stddev_pop",
    "stddev_samp",
    "submultiset",
    "subset",
    "substring",
    "substring_regex",
    "succeeds",
    "sum",
    "symmetric",
    "system",
    "system_time",
    "system_user",
    "table",
    "tablesample",
    "tan",
    "tanh",
    "then",
    "time",
    "timestamp",
    "timezone_hour",
    "timezone_minute",
    "to",
    "trailing",
    "translate",
    "translate_regex",
    "translation",
    "treat",
    "trigger",
    "trim",
    "trim_array",
    "true",
    "truncate",
    "uescape",
    "union",
    "unique",
    "unknown",
    "unnest",
    "update",
    "upper",
    "user",
    "using",
    "value",
    "values",
    "value_of",
    "var_pop",
    "var_samp",
    "varbinary",
    "varchar",
    "varying",
    "versioning",
    "when",
    "whenever",
    "where",
    "width_bucket",
    "window",
    "with",
    "within",
    "without",
    "year"
  ], u = [
    "abs",
    "acos",
    "array_agg",
    "asin",
    "atan",
    "avg",
    "cast",
    "ceil",
    "ceiling",
    "coalesce",
    "corr",
    "cos",
    "cosh",
    "count",
    "covar_pop",
    "covar_samp",
    "cume_dist",
    "dense_rank",
    "deref",
    "element",
    "exp",
    "extract",
    "first_value",
    "floor",
    "json_array",
    "json_arrayagg",
    "json_exists",
    "json_object",
    "json_objectagg",
    "json_query",
    "json_table",
    "json_table_primitive",
    "json_value",
    "lag",
    "last_value",
    "lead",
    "listagg",
    "ln",
    "log",
    "log10",
    "lower",
    "max",
    "min",
    "mod",
    "nth_value",
    "ntile",
    "nullif",
    "percent_rank",
    "percentile_cont",
    "percentile_disc",
    "position",
    "position_regex",
    "power",
    "rank",
    "regr_avgx",
    "regr_avgy",
    "regr_count",
    "regr_intercept",
    "regr_r2",
    "regr_slope",
    "regr_sxx",
    "regr_sxy",
    "regr_syy",
    "row_number",
    "sin",
    "sinh",
    "sqrt",
    "stddev_pop",
    "stddev_samp",
    "substring",
    "substring_regex",
    "sum",
    "tan",
    "tanh",
    "translate",
    "translate_regex",
    "treat",
    "trim",
    "trim_array",
    "unnest",
    "upper",
    "value_of",
    "var_pop",
    "var_samp",
    "width_bucket"
  ], d = [
    "current_catalog",
    "current_date",
    "current_default_transform_group",
    "current_path",
    "current_role",
    "current_schema",
    "current_transform_group_for_type",
    "current_user",
    "session_user",
    "system_time",
    "system_user",
    "current_time",
    "localtime",
    "current_timestamp",
    "localtimestamp"
  ], p = [
    "create table",
    "insert into",
    "primary key",
    "foreign key",
    "not null",
    "alter table",
    "add constraint",
    "grouping sets",
    "on overflow",
    "character set",
    "respect nulls",
    "ignore nulls",
    "nulls first",
    "nulls last",
    "depth first",
    "breadth first"
  ], _ = u, m = [
    ...c,
    ...l
  ].filter((T) => !u.includes(T)), f = {
    scope: "variable",
    match: /@[a-z0-9][a-z0-9_]*/
  }, g = {
    scope: "operator",
    match: /[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,
    relevance: 0
  }, S = {
    match: e.concat(/\b/, e.either(..._), /\s*\(/),
    relevance: 0,
    keywords: { built_in: _ }
  };
  function E(T) {
    return e.concat(
      /\b/,
      e.either(...T.map((C) => C.replace(/\s+/, "\\s+"))),
      /\b/
    );
  }
  const b = {
    scope: "keyword",
    match: E(p),
    relevance: 0
  };
  function h(T, {
    exceptions: C,
    when: v
  } = {}) {
    const I = v;
    return C = C || [], T.map((N) => N.match(/\|\d+$/) || C.includes(N) ? N : I(N) ? `${N}|0` : N);
  }
  return {
    name: "SQL",
    case_insensitive: !0,
    // does not include {} or HTML tags `</`
    illegal: /[{}]|<\//,
    keywords: {
      $pattern: /\b[\w\.]+/,
      keyword: h(m, { when: (T) => T.length < 3 }),
      literal: o,
      type: s,
      built_in: d
    },
    contains: [
      {
        scope: "type",
        match: E(a)
      },
      b,
      S,
      f,
      r,
      i,
      t.C_NUMBER_MODE,
      t.C_BLOCK_COMMENT_MODE,
      n,
      g
    ]
  };
}
function Oh(t) {
  return t ? typeof t == "string" ? t : t.source : null;
}
function vi(t) {
  return Re("(?=", t, ")");
}
function Re(...t) {
  return t.map((n) => Oh(n)).join("");
}
function PM(t) {
  const e = t[t.length - 1];
  return typeof e == "object" && e.constructor === Object ? (t.splice(t.length - 1, 1), e) : {};
}
function ut(...t) {
  return "(" + (PM(t).capture ? "" : "?:") + t.map((r) => Oh(r)).join("|") + ")";
}
const Lu = (t) => Re(
  /\b/,
  t,
  /\w$/.test(t) ? /\b/ : /\B/
), FM = [
  "Protocol",
  // contextual
  "Type"
  // contextual
].map(Lu), V_ = [
  "init",
  "self"
].map(Lu), BM = [
  "Any",
  "Self"
], Dl = [
  // strings below will be fed into the regular `keywords` engine while regex
  // will result in additional modes being created to scan for those keywords to
  // avoid conflicts with other rules
  "actor",
  "any",
  // contextual
  "associatedtype",
  "async",
  "await",
  /as\?/,
  // operator
  /as!/,
  // operator
  "as",
  // operator
  "borrowing",
  // contextual
  "break",
  "case",
  "catch",
  "class",
  "consume",
  // contextual
  "consuming",
  // contextual
  "continue",
  "convenience",
  // contextual
  "copy",
  // contextual
  "default",
  "defer",
  "deinit",
  "didSet",
  // contextual
  "distributed",
  "do",
  "dynamic",
  // contextual
  "each",
  "else",
  "enum",
  "extension",
  "fallthrough",
  /fileprivate\(set\)/,
  "fileprivate",
  "final",
  // contextual
  "for",
  "func",
  "get",
  // contextual
  "guard",
  "if",
  "import",
  "indirect",
  // contextual
  "infix",
  // contextual
  /init\?/,
  /init!/,
  "inout",
  /internal\(set\)/,
  "internal",
  "in",
  "is",
  // operator
  "isolated",
  // contextual
  "nonisolated",
  // contextual
  "lazy",
  // contextual
  "let",
  "macro",
  "mutating",
  // contextual
  "nonmutating",
  // contextual
  /open\(set\)/,
  // contextual
  "open",
  // contextual
  "operator",
  "optional",
  // contextual
  "override",
  // contextual
  "package",
  "postfix",
  // contextual
  "precedencegroup",
  "prefix",
  // contextual
  /private\(set\)/,
  "private",
  "protocol",
  /public\(set\)/,
  "public",
  "repeat",
  "required",
  // contextual
  "rethrows",
  "return",
  "set",
  // contextual
  "some",
  // contextual
  "static",
  "struct",
  "subscript",
  "super",
  "switch",
  "throws",
  "throw",
  /try\?/,
  // operator
  /try!/,
  // operator
  "try",
  // operator
  "typealias",
  /unowned\(safe\)/,
  // contextual
  /unowned\(unsafe\)/,
  // contextual
  "unowned",
  // contextual
  "var",
  "weak",
  // contextual
  "where",
  "while",
  "willSet"
  // contextual
], Y_ = [
  "false",
  "nil",
  "true"
], UM = [
  "assignment",
  "associativity",
  "higherThan",
  "left",
  "lowerThan",
  "none",
  "right"
], HM = [
  "#colorLiteral",
  "#column",
  "#dsohandle",
  "#else",
  "#elseif",
  "#endif",
  "#error",
  "#file",
  "#fileID",
  "#fileLiteral",
  "#filePath",
  "#function",
  "#if",
  "#imageLiteral",
  "#keyPath",
  "#line",
  "#selector",
  "#sourceLocation",
  "#warning"
], $_ = [
  "abs",
  "all",
  "any",
  "assert",
  "assertionFailure",
  "debugPrint",
  "dump",
  "fatalError",
  "getVaList",
  "isKnownUniquelyReferenced",
  "max",
  "min",
  "numericCast",
  "pointwiseMax",
  "pointwiseMin",
  "precondition",
  "preconditionFailure",
  "print",
  "readLine",
  "repeatElement",
  "sequence",
  "stride",
  "swap",
  "swift_unboxFromSwiftValueWithType",
  "transcode",
  "type",
  "unsafeBitCast",
  "unsafeDowncast",
  "withExtendedLifetime",
  "withUnsafeMutablePointer",
  "withUnsafePointer",
  "withVaList",
  "withoutActuallyEscaping",
  "zip"
], Nh = ut(
  /[/=\-+!*%<>&|^~?]/,
  /[\u00A1-\u00A7]/,
  /[\u00A9\u00AB]/,
  /[\u00AC\u00AE]/,
  /[\u00B0\u00B1]/,
  /[\u00B6\u00BB\u00BF\u00D7\u00F7]/,
  /[\u2016-\u2017]/,
  /[\u2020-\u2027]/,
  /[\u2030-\u203E]/,
  /[\u2041-\u2053]/,
  /[\u2055-\u205E]/,
  /[\u2190-\u23FF]/,
  /[\u2500-\u2775]/,
  /[\u2794-\u2BFF]/,
  /[\u2E00-\u2E7F]/,
  /[\u3001-\u3003]/,
  /[\u3008-\u3020]/,
  /[\u3030]/
), Ah = ut(
  Nh,
  /[\u0300-\u036F]/,
  /[\u1DC0-\u1DFF]/,
  /[\u20D0-\u20FF]/,
  /[\uFE00-\uFE0F]/,
  /[\uFE20-\uFE2F]/
  // TODO: The following characters are also allowed, but the regex isn't supported yet.
  // /[\u{E0100}-\u{E01EF}]/u
), wl = Re(Nh, Ah, "*"), Ih = ut(
  /[a-zA-Z_]/,
  /[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,
  /[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,
  /[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,
  /[\u1E00-\u1FFF]/,
  /[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,
  /[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,
  /[\u2C00-\u2DFF\u2E80-\u2FFF]/,
  /[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,
  /[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,
  /[\uFE47-\uFEFE\uFF00-\uFFFD]/
  // Should be /[\uFE47-\uFFFD]/, but we have to exclude FEFF.
  // The following characters are also allowed, but the regexes aren't supported yet.
  // /[\u{10000}-\u{1FFFD}\u{20000-\u{2FFFD}\u{30000}-\u{3FFFD}\u{40000}-\u{4FFFD}]/u,
  // /[\u{50000}-\u{5FFFD}\u{60000-\u{6FFFD}\u{70000}-\u{7FFFD}\u{80000}-\u{8FFFD}]/u,
  // /[\u{90000}-\u{9FFFD}\u{A0000-\u{AFFFD}\u{B0000}-\u{BFFFD}\u{C0000}-\u{CFFFD}]/u,
  // /[\u{D0000}-\u{DFFFD}\u{E0000-\u{EFFFD}]/u
), rs = ut(
  Ih,
  /\d/,
  /[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/
), zt = Re(Ih, rs, "*"), jo = Re(/[A-Z]/, rs, "*"), GM = [
  "attached",
  "autoclosure",
  Re(/convention\(/, ut("swift", "block", "c"), /\)/),
  "discardableResult",
  "dynamicCallable",
  "dynamicMemberLookup",
  "escaping",
  "freestanding",
  "frozen",
  "GKInspectable",
  "IBAction",
  "IBDesignable",
  "IBInspectable",
  "IBOutlet",
  "IBSegueAction",
  "inlinable",
  "main",
  "nonobjc",
  "NSApplicationMain",
  "NSCopying",
  "NSManaged",
  Re(/objc\(/, zt, /\)/),
  "objc",
  "objcMembers",
  "propertyWrapper",
  "requires_stored_property_inits",
  "resultBuilder",
  "Sendable",
  "testable",
  "UIApplicationMain",
  "unchecked",
  "unknown",
  "usableFromInline",
  "warn_unqualified_access"
], VM = [
  "iOS",
  "iOSApplicationExtension",
  "macOS",
  "macOSApplicationExtension",
  "macCatalyst",
  "macCatalystApplicationExtension",
  "watchOS",
  "watchOSApplicationExtension",
  "tvOS",
  "tvOSApplicationExtension",
  "swift"
];
function YM(t) {
  const e = {
    match: /\s+/,
    relevance: 0
  }, n = t.COMMENT(
    "/\\*",
    "\\*/",
    { contains: ["self"] }
  ), r = [
    t.C_LINE_COMMENT_MODE,
    n
  ], i = {
    match: [
      /\./,
      ut(...FM, ...V_)
    ],
    className: { 2: "keyword" }
  }, o = {
    // Consume .keyword to prevent highlighting properties and methods as keywords.
    match: Re(/\./, ut(...Dl)),
    relevance: 0
  }, a = Dl.filter((ae) => typeof ae == "string").concat(["_|0"]), s = Dl.filter((ae) => typeof ae != "string").concat(BM).map(Lu), l = { variants: [
    {
      className: "keyword",
      match: ut(...s, ...V_)
    }
  ] }, c = {
    $pattern: ut(
      /\b\w+/,
      // regular keywords
      /#\w+/
      // number keywords
    ),
    keyword: a.concat(HM),
    literal: Y_
  }, u = [
    i,
    o,
    l
  ], d = {
    // Consume .built_in to prevent highlighting properties and methods.
    match: Re(/\./, ut(...$_)),
    relevance: 0
  }, p = {
    className: "built_in",
    match: Re(/\b/, ut(...$_), /(?=\()/)
  }, _ = [
    d,
    p
  ], m = {
    // Prevent -> from being highlighting as an operator.
    match: /->/,
    relevance: 0
  }, f = {
    className: "operator",
    relevance: 0,
    variants: [
      { match: wl },
      {
        // dot-operator: only operators that start with a dot are allowed to use dots as
        // characters (..., ...<, .*, etc). So there rule here is: a dot followed by one or more
        // characters that may also include dots.
        match: `\\.(\\.|${Ah})+`
      }
    ]
  }, g = [
    m,
    f
  ], S = "([0-9]_*)+", E = "([0-9a-fA-F]_*)+", b = {
    className: "number",
    relevance: 0,
    variants: [
      // decimal floating-point-literal (subsumes decimal-literal)
      { match: `\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b` },
      // hexadecimal floating-point-literal (subsumes hexadecimal-literal)
      { match: `\\b0x(${E})(\\.(${E}))?([pP][+-]?(${S}))?\\b` },
      // octal-literal
      { match: /\b0o([0-7]_*)+\b/ },
      // binary-literal
      { match: /\b0b([01]_*)+\b/ }
    ]
  }, h = (ae = "") => ({
    className: "subst",
    variants: [
      { match: Re(/\\/, ae, /[0\\tnr"']/) },
      { match: Re(/\\/, ae, /u\{[0-9a-fA-F]{1,8}\}/) }
    ]
  }), T = (ae = "") => ({
    className: "subst",
    match: Re(/\\/, ae, /[\t ]*(?:[\r\n]|\r\n)/)
  }), C = (ae = "") => ({
    className: "subst",
    label: "interpol",
    begin: Re(/\\/, ae, /\(/),
    end: /\)/
  }), v = (ae = "") => ({
    begin: Re(ae, /"""/),
    end: Re(/"""/, ae),
    contains: [
      h(ae),
      T(ae),
      C(ae)
    ]
  }), I = (ae = "") => ({
    begin: Re(ae, /"/),
    end: Re(/"/, ae),
    contains: [
      h(ae),
      C(ae)
    ]
  }), N = {
    className: "string",
    variants: [
      v(),
      v("#"),
      v("##"),
      v("###"),
      I(),
      I("#"),
      I("##"),
      I("###")
    ]
  }, x = [
    t.BACKSLASH_ESCAPE,
    {
      begin: /\[/,
      end: /\]/,
      relevance: 0,
      contains: [t.BACKSLASH_ESCAPE]
    }
  ], P = {
    begin: /\/[^\s](?=[^/\n]*\/)/,
    end: /\//,
    contains: x
  }, Y = (ae) => {
    const Qe = Re(ae, /\//), Q = Re(/\//, ae);
    return {
      begin: Qe,
      end: Q,
      contains: [
        ...x,
        {
          scope: "comment",
          begin: `#(?!.*${Q})`,
          end: /$/
        }
      ]
    };
  }, Z = {
    scope: "regexp",
    variants: [
      Y("###"),
      Y("##"),
      Y("#"),
      P
    ]
  }, q = { match: Re(/`/, zt, /`/) }, V = {
    className: "variable",
    match: /\$\d+/
  }, O = {
    className: "variable",
    match: `\\$${rs}+`
  }, y = [
    q,
    V,
    O
  ], R = {
    match: /(@|#(un)?)available/,
    scope: "keyword",
    starts: { contains: [
      {
        begin: /\(/,
        end: /\)/,
        keywords: VM,
        contains: [
          ...g,
          b,
          N
        ]
      }
    ] }
  }, w = {
    scope: "keyword",
    match: Re(/@/, ut(...GM), vi(ut(/\(/, /\s+/)))
  }, B = {
    scope: "meta",
    match: Re(/@/, zt)
  }, $ = [
    R,
    w,
    B
  ], X = {
    match: vi(/\b[A-Z]/),
    relevance: 0,
    contains: [
      {
        // Common Apple frameworks, for relevance boost
        className: "type",
        match: Re(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/, rs, "+")
      },
      {
        // Type identifier
        className: "type",
        match: jo,
        relevance: 0
      },
      {
        // Optional type
        match: /[?!]+/,
        relevance: 0
      },
      {
        // Variadic parameter
        match: /\.\.\./,
        relevance: 0
      },
      {
        // Protocol composition
        match: Re(/\s+&\s+/, vi(jo)),
        relevance: 0
      }
    ]
  }, de = {
    begin: /</,
    end: />/,
    keywords: c,
    contains: [
      ...r,
      ...u,
      ...$,
      m,
      X
    ]
  };
  X.contains.push(de);
  const pe = {
    match: Re(zt, /\s*:/),
    keywords: "_|0",
    relevance: 0
  }, le = {
    begin: /\(/,
    end: /\)/,
    relevance: 0,
    keywords: c,
    contains: [
      "self",
      pe,
      ...r,
      Z,
      ...u,
      ..._,
      ...g,
      b,
      N,
      ...y,
      ...$,
      X
    ]
  }, he = {
    begin: /</,
    end: />/,
    keywords: "repeat each",
    contains: [
      ...r,
      X
    ]
  }, We = {
    begin: ut(
      vi(Re(zt, /\s*:/)),
      vi(Re(zt, /\s+/, zt, /\s*:/))
    ),
    end: /:/,
    relevance: 0,
    contains: [
      {
        className: "keyword",
        match: /\b_\b/
      },
      {
        className: "params",
        match: zt
      }
    ]
  }, De = {
    begin: /\(/,
    end: /\)/,
    keywords: c,
    contains: [
      We,
      ...r,
      ...u,
      ...g,
      b,
      N,
      ...$,
      X,
      le
    ],
    endsParent: !0,
    illegal: /["']/
  }, et = {
    match: [
      /(func|macro)/,
      /\s+/,
      ut(q.match, zt, wl)
    ],
    className: {
      1: "keyword",
      3: "title.function"
    },
    contains: [
      he,
      De,
      e
    ],
    illegal: [
      /\[/,
      /%/
    ]
  }, Ke = {
    match: [
      /\b(?:subscript|init[?!]?)/,
      /\s*(?=[<(])/
    ],
    className: { 1: "keyword" },
    contains: [
      he,
      De,
      e
    ],
    illegal: /\[|%/
  }, st = {
    match: [
      /operator/,
      /\s+/,
      wl
    ],
    className: {
      1: "keyword",
      3: "title"
    }
  }, Ut = {
    begin: [
      /precedencegroup/,
      /\s+/,
      jo
    ],
    className: {
      1: "keyword",
      3: "title"
    },
    contains: [X],
    keywords: [
      ...UM,
      ...Y_
    ],
    end: /}/
  }, lt = {
    match: [
      /class\b/,
      /\s+/,
      /func\b/,
      /\s+/,
      /\b[A-Za-z_][A-Za-z0-9_]*\b/
    ],
    scope: {
      1: "keyword",
      3: "keyword",
      5: "title.function"
    }
  }, ct = {
    match: [
      /class\b/,
      /\s+/,
      /var\b/
    ],
    scope: {
      1: "keyword",
      3: "keyword"
    }
  }, Pe = {
    begin: [
      /(struct|protocol|class|extension|enum|actor)/,
      /\s+/,
      zt,
      /\s*/
    ],
    beginScope: {
      1: "keyword",
      3: "title.class"
    },
    keywords: c,
    contains: [
      he,
      ...u,
      {
        begin: /:/,
        end: /\{/,
        keywords: c,
        contains: [
          {
            scope: "title.class.inherited",
            match: jo
          },
          ...u
        ],
        relevance: 0
      }
    ]
  };
  for (const ae of N.variants) {
    const Qe = ae.contains.find((j) => j.label === "interpol");
    Qe.keywords = c;
    const Q = [
      ...u,
      ..._,
      ...g,
      b,
      N,
      ...y
    ];
    Qe.contains = [
      ...Q,
      {
        begin: /\(/,
        end: /\)/,
        contains: [
          "self",
          ...Q
        ]
      }
    ];
  }
  return {
    name: "Swift",
    keywords: c,
    contains: [
      ...r,
      et,
      Ke,
      lt,
      ct,
      Pe,
      st,
      Ut,
      {
        beginKeywords: "import",
        end: /$/,
        contains: [...r],
        relevance: 0
      },
      Z,
      ...u,
      ..._,
      ...g,
      b,
      N,
      ...y,
      ...$,
      X,
      le
    ]
  };
}
const is = "[A-Za-z$_][0-9A-Za-z$_]*", xh = [
  "as",
  // for exports
  "in",
  "of",
  "if",
  "for",
  "while",
  "finally",
  "var",
  "new",
  "function",
  "do",
  "return",
  "void",
  "else",
  "break",
  "catch",
  "instanceof",
  "with",
  "throw",
  "case",
  "default",
  "try",
  "switch",
  "continue",
  "typeof",
  "delete",
  "let",
  "yield",
  "const",
  "class",
  // JS handles these with a special rule
  // "get",
  // "set",
  "debugger",
  "async",
  "await",
  "static",
  "import",
  "from",
  "export",
  "extends",
  // It's reached stage 3, which is "recommended for implementation":
  "using"
], Dh = [
  "true",
  "false",
  "null",
  "undefined",
  "NaN",
  "Infinity"
], wh = [
  // Fundamental objects
  "Object",
  "Function",
  "Boolean",
  "Symbol",
  // numbers and dates
  "Math",
  "Date",
  "Number",
  "BigInt",
  // text
  "String",
  "RegExp",
  // Indexed collections
  "Array",
  "Float32Array",
  "Float64Array",
  "Int8Array",
  "Uint8Array",
  "Uint8ClampedArray",
  "Int16Array",
  "Int32Array",
  "Uint16Array",
  "Uint32Array",
  "BigInt64Array",
  "BigUint64Array",
  // Keyed collections
  "Set",
  "Map",
  "WeakSet",
  "WeakMap",
  // Structured data
  "ArrayBuffer",
  "SharedArrayBuffer",
  "Atomics",
  "DataView",
  "JSON",
  // Control abstraction objects
  "Promise",
  "Generator",
  "GeneratorFunction",
  "AsyncFunction",
  // Reflection
  "Reflect",
  "Proxy",
  // Internationalization
  "Intl",
  // WebAssembly
  "WebAssembly"
], Mh = [
  "Error",
  "EvalError",
  "InternalError",
  "RangeError",
  "ReferenceError",
  "SyntaxError",
  "TypeError",
  "URIError"
], Lh = [
  "setInterval",
  "setTimeout",
  "clearInterval",
  "clearTimeout",
  "require",
  "exports",
  "eval",
  "isFinite",
  "isNaN",
  "parseFloat",
  "parseInt",
  "decodeURI",
  "decodeURIComponent",
  "encodeURI",
  "encodeURIComponent",
  "escape",
  "unescape"
], kh = [
  "arguments",
  "this",
  "super",
  "console",
  "window",
  "document",
  "localStorage",
  "sessionStorage",
  "module",
  "global"
  // Node.js
], Ph = [].concat(
  Lh,
  wh,
  Mh
);
function $M(t) {
  const e = t.regex, n = (R, { after: w }) => {
    const B = "</" + R[0].slice(1);
    return R.input.indexOf(B, w) !== -1;
  }, r = is, i = {
    begin: "<>",
    end: "</>"
  }, o = /<[A-Za-z0-9\\._:-]+\s*\/>/, a = {
    begin: /<[A-Za-z0-9\\._:-]+/,
    end: /\/[A-Za-z0-9\\._:-]+>|\/>/,
    /**
     * @param {RegExpMatchArray} match
     * @param {CallbackResponse} response
     */
    isTrulyOpeningTag: (R, w) => {
      const B = R[0].length + R.index, $ = R.input[B];
      if (
        // HTML should not include another raw `<` inside a tag
        // nested type?
        // `<Array<Array<number>>`, etc.
        $ === "<" || // the , gives away that this is not HTML
        // `<T, A extends keyof T, V>`
        $ === ","
      ) {
        w.ignoreMatch();
        return;
      }
      $ === ">" && (n(R, { after: B }) || w.ignoreMatch());
      let X;
      const de = R.input.substring(B);
      if (X = de.match(/^\s*=/)) {
        w.ignoreMatch();
        return;
      }
      if ((X = de.match(/^\s+extends\s+/)) && X.index === 0) {
        w.ignoreMatch();
        return;
      }
    }
  }, s = {
    $pattern: is,
    keyword: xh,
    literal: Dh,
    built_in: Ph,
    "variable.language": kh
  }, l = "[0-9](_?[0-9])*", c = `\\.(${l})`, u = "0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*", d = {
    className: "number",
    variants: [
      // DecimalLiteral
      { begin: `(\\b(${u})((${c})|\\.)?|(${c}))[eE][+-]?(${l})\\b` },
      { begin: `\\b(${u})\\b((${c})\\b|\\.)?|(${c})\\b` },
      // DecimalBigIntegerLiteral
      { begin: "\\b(0|[1-9](_?[0-9])*)n\\b" },
      // NonDecimalIntegerLiteral
      { begin: "\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b" },
      { begin: "\\b0[bB][0-1](_?[0-1])*n?\\b" },
      { begin: "\\b0[oO][0-7](_?[0-7])*n?\\b" },
      // LegacyOctalIntegerLiteral (does not include underscore separators)
      // https://tc39.es/ecma262/#sec-additional-syntax-numeric-literals
      { begin: "\\b0[0-7]+n?\\b" }
    ],
    relevance: 0
  }, p = {
    className: "subst",
    begin: "\\$\\{",
    end: "\\}",
    keywords: s,
    contains: []
    // defined later
  }, _ = {
    begin: ".?html`",
    end: "",
    starts: {
      end: "`",
      returnEnd: !1,
      contains: [
        t.BACKSLASH_ESCAPE,
        p
      ],
      subLanguage: "xml"
    }
  }, m = {
    begin: ".?css`",
    end: "",
    starts: {
      end: "`",
      returnEnd: !1,
      contains: [
        t.BACKSLASH_ESCAPE,
        p
      ],
      subLanguage: "css"
    }
  }, f = {
    begin: ".?gql`",
    end: "",
    starts: {
      end: "`",
      returnEnd: !1,
      contains: [
        t.BACKSLASH_ESCAPE,
        p
      ],
      subLanguage: "graphql"
    }
  }, g = {
    className: "string",
    begin: "`",
    end: "`",
    contains: [
      t.BACKSLASH_ESCAPE,
      p
    ]
  }, E = {
    className: "comment",
    variants: [
      t.COMMENT(
        /\/\*\*(?!\/)/,
        "\\*/",
        {
          relevance: 0,
          contains: [
            {
              begin: "(?=@[A-Za-z]+)",
              relevance: 0,
              contains: [
                {
                  className: "doctag",
                  begin: "@[A-Za-z]+"
                },
                {
                  className: "type",
                  begin: "\\{",
                  end: "\\}",
                  excludeEnd: !0,
                  excludeBegin: !0,
                  relevance: 0
                },
                {
                  className: "variable",
                  begin: r + "(?=\\s*(-)|$)",
                  endsParent: !0,
                  relevance: 0
                },
                // eat spaces (not newlines) so we can find
                // types or variables
                {
                  begin: /(?=[^\n])\s/,
                  relevance: 0
                }
              ]
            }
          ]
        }
      ),
      t.C_BLOCK_COMMENT_MODE,
      t.C_LINE_COMMENT_MODE
    ]
  }, b = [
    t.APOS_STRING_MODE,
    t.QUOTE_STRING_MODE,
    _,
    m,
    f,
    g,
    // Skip numbers when they are part of a variable name
    { match: /\$\d+/ },
    d
    // This is intentional:
    // See https://github.com/highlightjs/highlight.js/issues/3288
    // hljs.REGEXP_MODE
  ];
  p.contains = b.concat({
    // we need to pair up {} inside our subst to prevent
    // it from ending too early by matching another }
    begin: /\{/,
    end: /\}/,
    keywords: s,
    contains: [
      "self"
    ].concat(b)
  });
  const h = [].concat(E, p.contains), T = h.concat([
    // eat recursive parens in sub expressions
    {
      begin: /(\s*)\(/,
      end: /\)/,
      keywords: s,
      contains: ["self"].concat(h)
    }
  ]), C = {
    className: "params",
    // convert this to negative lookbehind in v12
    begin: /(\s*)\(/,
    // to match the parms with
    end: /\)/,
    excludeBegin: !0,
    excludeEnd: !0,
    keywords: s,
    contains: T
  }, v = {
    variants: [
      // class Car extends vehicle
      {
        match: [
          /class/,
          /\s+/,
          r,
          /\s+/,
          /extends/,
          /\s+/,
          e.concat(r, "(", e.concat(/\./, r), ")*")
        ],
        scope: {
          1: "keyword",
          3: "title.class",
          5: "keyword",
          7: "title.class.inherited"
        }
      },
      // class Car
      {
        match: [
          /class/,
          /\s+/,
          r
        ],
        scope: {
          1: "keyword",
          3: "title.class"
        }
      }
    ]
  }, I = {
    relevance: 0,
    match: e.either(
      // Hard coded exceptions
      /\bJSON/,
      // Float32Array, OutT
      /\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,
      // CSSFactory, CSSFactoryT
      /\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,
      // FPs, FPsT
      /\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/
      // P
      // single letters are not highlighted
      // BLAH
      // this will be flagged as a UPPER_CASE_CONSTANT instead
    ),
    className: "title.class",
    keywords: {
      _: [
        // se we still get relevance credit for JS library classes
        ...wh,
        ...Mh
      ]
    }
  }, N = {
    label: "use_strict",
    className: "meta",
    relevance: 10,
    begin: /^\s*['"]use (strict|asm)['"]/
  }, x = {
    variants: [
      {
        match: [
          /function/,
          /\s+/,
          r,
          /(?=\s*\()/
        ]
      },
      // anonymous function
      {
        match: [
          /function/,
          /\s*(?=\()/
        ]
      }
    ],
    className: {
      1: "keyword",
      3: "title.function"
    },
    label: "func.def",
    contains: [C],
    illegal: /%/
  }, P = {
    relevance: 0,
    match: /\b[A-Z][A-Z_0-9]+\b/,
    className: "variable.constant"
  };
  function Y(R) {
    return e.concat("(?!", R.join("|"), ")");
  }
  const Z = {
    match: e.concat(
      /\b/,
      Y([
        ...Lh,
        "super",
        "import"
      ].map((R) => `${R}\\s*\\(`)),
      r,
      e.lookahead(/\s*\(/)
    ),
    className: "title.function",
    relevance: 0
  }, q = {
    begin: e.concat(/\./, e.lookahead(
      e.concat(r, /(?![0-9A-Za-z$_(])/)
    )),
    end: r,
    excludeBegin: !0,
    keywords: "prototype",
    className: "property",
    relevance: 0
  }, V = {
    match: [
      /get|set/,
      /\s+/,
      r,
      /(?=\()/
    ],
    className: {
      1: "keyword",
      3: "title.function"
    },
    contains: [
      {
        // eat to avoid empty params
        begin: /\(\)/
      },
      C
    ]
  }, O = "(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|" + t.UNDERSCORE_IDENT_RE + ")\\s*=>", y = {
    match: [
      /const|var|let/,
      /\s+/,
      r,
      /\s*/,
      /=\s*/,
      /(async\s*)?/,
      // async is optional
      e.lookahead(O)
    ],
    keywords: "async",
    className: {
      1: "keyword",
      3: "title.function"
    },
    contains: [
      C
    ]
  };
  return {
    name: "JavaScript",
    aliases: ["js", "jsx", "mjs", "cjs"],
    keywords: s,
    // this will be extended by TypeScript
    exports: { PARAMS_CONTAINS: T, CLASS_REFERENCE: I },
    illegal: /#(?![$_A-z])/,
    contains: [
      t.SHEBANG({
        label: "shebang",
        binary: "node",
        relevance: 5
      }),
      N,
      t.APOS_STRING_MODE,
      t.QUOTE_STRING_MODE,
      _,
      m,
      f,
      g,
      E,
      // Skip numbers when they are part of a variable name
      { match: /\$\d+/ },
      d,
      I,
      {
        scope: "attr",
        match: r + e.lookahead(":"),
        relevance: 0
      },
      y,
      {
        // "value" container
        begin: "(" + t.RE_STARTERS_RE + "|\\b(case|return|throw)\\b)\\s*",
        keywords: "return throw case",
        relevance: 0,
        contains: [
          E,
          t.REGEXP_MODE,
          {
            className: "function",
            // we have to count the parens to make sure we actually have the
            // correct bounding ( ) before the =>.  There could be any number of
            // sub-expressions inside also surrounded by parens.
            begin: O,
            returnBegin: !0,
            end: "\\s*=>",
            contains: [
              {
                className: "params",
                variants: [
                  {
                    begin: t.UNDERSCORE_IDENT_RE,
                    relevance: 0
                  },
                  {
                    className: null,
                    begin: /\(\s*\)/,
                    skip: !0
                  },
                  {
                    begin: /(\s*)\(/,
                    end: /\)/,
                    excludeBegin: !0,
                    excludeEnd: !0,
                    keywords: s,
                    contains: T
                  }
                ]
              }
            ]
          },
          {
            // could be a comma delimited list of params to a function call
            begin: /,/,
            relevance: 0
          },
          {
            match: /\s+/,
            relevance: 0
          },
          {
            // JSX
            variants: [
              { begin: i.begin, end: i.end },
              { match: o },
              {
                begin: a.begin,
                // we carefully check the opening tag to see if it truly
                // is a tag and not a false positive
                "on:begin": a.isTrulyOpeningTag,
                end: a.end
              }
            ],
            subLanguage: "xml",
            contains: [
              {
                begin: a.begin,
                end: a.end,
                skip: !0,
                contains: ["self"]
              }
            ]
          }
        ]
      },
      x,
      {
        // prevent this from getting swallowed up by function
        // since they appear "function like"
        beginKeywords: "while if switch catch for"
      },
      {
        // we have to count the parens to make sure we actually have the correct
        // bounding ( ).  There could be any number of sub-expressions inside
        // also surrounded by parens.
        begin: "\\b(?!function)" + t.UNDERSCORE_IDENT_RE + "\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",
        // end parens
        returnBegin: !0,
        label: "func.def",
        contains: [
          C,
          t.inherit(t.TITLE_MODE, { begin: r, className: "title.function" })
        ]
      },
      // catch ... so it won't trigger the property rule below
      {
        match: /\.\.\./,
        relevance: 0
      },
      q,
      // hack: prevents detection of keywords in some circumstances
      // .keyword()
      // $keyword = x
      {
        match: "\\$" + r,
        relevance: 0
      },
      {
        match: [/\bconstructor(?=\s*\()/],
        className: { 1: "title.function" },
        contains: [C]
      },
      Z,
      P,
      v,
      V,
      {
        match: /\$[(.]/
        // relevance booster for a pattern common to JS libs: `$(something)` and `$.something`
      }
    ]
  };
}
function zM(t) {
  const e = t.regex, n = $M(t), r = is, i = [
    "any",
    "void",
    "number",
    "boolean",
    "string",
    "object",
    "never",
    "symbol",
    "bigint",
    "unknown"
  ], o = {
    begin: [
      /namespace/,
      /\s+/,
      t.IDENT_RE
    ],
    beginScope: {
      1: "keyword",
      3: "title.class"
    }
  }, a = {
    beginKeywords: "interface",
    end: /\{/,
    excludeEnd: !0,
    keywords: {
      keyword: "interface extends",
      built_in: i
    },
    contains: [n.exports.CLASS_REFERENCE]
  }, s = {
    className: "meta",
    relevance: 10,
    begin: /^\s*['"]use strict['"]/
  }, l = [
    "type",
    // "namespace",
    "interface",
    "public",
    "private",
    "protected",
    "implements",
    "declare",
    "abstract",
    "readonly",
    "enum",
    "override",
    "satisfies"
  ], c = {
    $pattern: is,
    keyword: xh.concat(l),
    literal: Dh,
    built_in: Ph.concat(i),
    "variable.language": kh
  }, u = {
    className: "meta",
    begin: "@" + r
  }, d = (f, g, S) => {
    const E = f.contains.findIndex((b) => b.label === g);
    if (E === -1)
      throw new Error("can not find mode to replace");
    f.contains.splice(E, 1, S);
  };
  Object.assign(n.keywords, c), n.exports.PARAMS_CONTAINS.push(u);
  const p = n.contains.find((f) => f.scope === "attr"), _ = Object.assign(
    {},
    p,
    { match: e.concat(r, e.lookahead(/\s*\?:/)) }
  );
  n.exports.PARAMS_CONTAINS.push([
    n.exports.CLASS_REFERENCE,
    // class reference for highlighting the params types
    p,
    // highlight the params key
    _
    // Added for optional property assignment highlighting
  ]), n.contains = n.contains.concat([
    u,
    o,
    a,
    _
    // Added for optional property assignment highlighting
  ]), d(n, "shebang", t.SHEBANG()), d(n, "use_strict", s);
  const m = n.contains.find((f) => f.label === "func.def");
  return m.relevance = 0, Object.assign(n, {
    name: "TypeScript",
    aliases: [
      "ts",
      "tsx",
      "mts",
      "cts"
    ]
  }), n;
}
function qM(t) {
  const e = t.regex, n = {
    className: "string",
    begin: /"(""|[^/n])"C\b/
  }, r = {
    className: "string",
    begin: /"/,
    end: /"/,
    illegal: /\n/,
    contains: [
      {
        // double quote escape
        begin: /""/
      }
    ]
  }, i = /\d{1,2}\/\d{1,2}\/\d{4}/, o = /\d{4}-\d{1,2}-\d{1,2}/, a = /(\d|1[012])(:\d+){0,2} *(AM|PM)/, s = /\d{1,2}(:\d{1,2}){1,2}/, l = {
    className: "literal",
    variants: [
      {
        // #YYYY-MM-DD# (ISO-Date) or #M/D/YYYY# (US-Date)
        begin: e.concat(/# */, e.either(o, i), / *#/)
      },
      {
        // #H:mm[:ss]# (24h Time)
        begin: e.concat(/# */, s, / *#/)
      },
      {
        // #h[:mm[:ss]] A# (12h Time)
        begin: e.concat(/# */, a, / *#/)
      },
      {
        // date plus time
        begin: e.concat(
          /# */,
          e.either(o, i),
          / +/,
          e.either(a, s),
          / *#/
        )
      }
    ]
  }, c = {
    className: "number",
    relevance: 0,
    variants: [
      {
        // Float
        begin: /\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/
      },
      {
        // Integer (base 10)
        begin: /\b\d[\d_]*((U?[SIL])|[%&])?/
      },
      {
        // Integer (base 16)
        begin: /&H[\dA-F_]+((U?[SIL])|[%&])?/
      },
      {
        // Integer (base 8)
        begin: /&O[0-7_]+((U?[SIL])|[%&])?/
      },
      {
        // Integer (base 2)
        begin: /&B[01_]+((U?[SIL])|[%&])?/
      }
    ]
  }, u = {
    className: "label",
    begin: /^\w+:/
  }, d = t.COMMENT(/'''/, /$/, { contains: [
    {
      className: "doctag",
      begin: /<\/?/,
      end: />/
    }
  ] }), p = t.COMMENT(null, /$/, { variants: [
    { begin: /'/ },
    {
      // TODO: Use multi-class for leading spaces
      begin: /([\t ]|^)REM(?=\s)/
    }
  ] });
  return {
    name: "Visual Basic .NET",
    aliases: ["vb"],
    case_insensitive: !0,
    classNameAliases: { label: "symbol" },
    keywords: {
      keyword: "addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",
      built_in: (
        // Operators https://docs.microsoft.com/dotnet/visual-basic/language-reference/operators
        "addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort"
      ),
      type: (
        // Data types https://docs.microsoft.com/dotnet/visual-basic/language-reference/data-types
        "boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort"
      ),
      literal: "true false nothing"
    },
    illegal: "//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",
    contains: [
      n,
      r,
      l,
      c,
      u,
      d,
      p,
      {
        className: "meta",
        // TODO: Use multi-class for indentation once available
        begin: /[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,
        end: /$/,
        keywords: { keyword: "const disable else elseif enable end externalsource if region then" },
        contains: [p]
      }
    ]
  };
}
function WM(t) {
  t.regex;
  const e = t.COMMENT(/\(;/, /;\)/);
  e.contains.push("self");
  const n = t.COMMENT(/;;/, /$/), r = [
    "anyfunc",
    "block",
    "br",
    "br_if",
    "br_table",
    "call",
    "call_indirect",
    "data",
    "drop",
    "elem",
    "else",
    "end",
    "export",
    "func",
    "global.get",
    "global.set",
    "local.get",
    "local.set",
    "local.tee",
    "get_global",
    "get_local",
    "global",
    "if",
    "import",
    "local",
    "loop",
    "memory",
    "memory.grow",
    "memory.size",
    "module",
    "mut",
    "nop",
    "offset",
    "param",
    "result",
    "return",
    "select",
    "set_global",
    "set_local",
    "start",
    "table",
    "tee_local",
    "then",
    "type",
    "unreachable"
  ], i = {
    begin: [
      /(?:func|call|call_indirect)/,
      /\s+/,
      /\$[^\s)]+/
    ],
    className: {
      1: "keyword",
      3: "title.function"
    }
  }, o = {
    className: "variable",
    begin: /\$[\w_]+/
  }, a = {
    match: /(\((?!;)|\))+/,
    className: "punctuation",
    relevance: 0
  }, s = {
    className: "number",
    relevance: 0,
    // borrowed from Prism, TODO: split out into variants
    match: /[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/
  }, l = {
    // look-ahead prevents us from gobbling up opcodes
    match: /(i32|i64|f32|f64)(?!\.)/,
    className: "type"
  }, c = {
    className: "keyword",
    // borrowed from Prism, TODO: split out into variants
    match: /\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/
  };
  return {
    name: "WebAssembly",
    keywords: {
      $pattern: /[\w.]+/,
      keyword: r
    },
    contains: [
      n,
      e,
      {
        match: [
          /(?:offset|align)/,
          /\s*/,
          /=/
        ],
        className: {
          1: "keyword",
          3: "operator"
        }
      },
      o,
      a,
      i,
      t.QUOTE_STRING_MODE,
      l,
      c,
      s
    ]
  };
}
function KM(t) {
  const e = t.regex, n = e.concat(/[\p{L}_]/u, e.optional(/[\p{L}0-9_.-]*:/u), /[\p{L}0-9_.-]*/u), r = /[\p{L}0-9._:-]+/u, i = {
    className: "symbol",
    begin: /&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/
  }, o = {
    begin: /\s/,
    contains: [
      {
        className: "keyword",
        begin: /#?[a-z_][a-z1-9_-]+/,
        illegal: /\n/
      }
    ]
  }, a = t.inherit(o, {
    begin: /\(/,
    end: /\)/
  }), s = t.inherit(t.APOS_STRING_MODE, { className: "string" }), l = t.inherit(t.QUOTE_STRING_MODE, { className: "string" }), c = {
    endsWithParent: !0,
    illegal: /</,
    relevance: 0,
    contains: [
      {
        className: "attr",
        begin: r,
        relevance: 0
      },
      {
        begin: /=\s*/,
        relevance: 0,
        contains: [
          {
            className: "string",
            endsParent: !0,
            variants: [
              {
                begin: /"/,
                end: /"/,
                contains: [i]
              },
              {
                begin: /'/,
                end: /'/,
                contains: [i]
              },
              { begin: /[^\s"'=<>`]+/ }
            ]
          }
        ]
      }
    ]
  };
  return {
    name: "HTML, XML",
    aliases: [
      "html",
      "xhtml",
      "rss",
      "atom",
      "xjb",
      "xsd",
      "xsl",
      "plist",
      "wsf",
      "svg"
    ],
    case_insensitive: !0,
    unicodeRegex: !0,
    contains: [
      {
        className: "meta",
        begin: /<![a-z]/,
        end: />/,
        relevance: 10,
        contains: [
          o,
          l,
          s,
          a,
          {
            begin: /\[/,
            end: /\]/,
            contains: [
              {
                className: "meta",
                begin: /<![a-z]/,
                end: />/,
                contains: [
                  o,
                  a,
                  l,
                  s
                ]
              }
            ]
          }
        ]
      },
      t.COMMENT(
        /<!--/,
        /-->/,
        { relevance: 10 }
      ),
      {
        begin: /<!\[CDATA\[/,
        end: /\]\]>/,
        relevance: 10
      },
      i,
      // xml processing instructions
      {
        className: "meta",
        end: /\?>/,
        variants: [
          {
            begin: /<\?xml/,
            relevance: 10,
            contains: [
              l
            ]
          },
          {
            begin: /<\?[a-z][a-z0-9]+/
          }
        ]
      },
      {
        className: "tag",
        /*
        The lookahead pattern (?=...) ensures that 'begin' only matches
        '<style' as a single word, followed by a whitespace or an
        ending bracket.
        */
        begin: /<style(?=\s|>)/,
        end: />/,
        keywords: { name: "style" },
        contains: [c],
        starts: {
          end: /<\/style>/,
          returnEnd: !0,
          subLanguage: [
            "css",
            "xml"
          ]
        }
      },
      {
        className: "tag",
        // See the comment in the <style tag about the lookahead pattern
        begin: /<script(?=\s|>)/,
        end: />/,
        keywords: { name: "script" },
        contains: [c],
        starts: {
          end: /<\/script>/,
          returnEnd: !0,
          subLanguage: [
            "javascript",
            "handlebars",
            "xml"
          ]
        }
      },
      // we need this for now for jSX
      {
        className: "tag",
        begin: /<>|<\/>/
      },
      // open tag
      {
        className: "tag",
        begin: e.concat(
          /</,
          e.lookahead(e.concat(
            n,
            // <tag/>
            // <tag>
            // <tag ...
            e.either(/\/>/, />/, /\s/)
          ))
        ),
        end: /\/?>/,
        contains: [
          {
            className: "name",
            begin: n,
            relevance: 0,
            starts: c
          }
        ]
      },
      // close tag
      {
        className: "tag",
        begin: e.concat(
          /<\//,
          e.lookahead(e.concat(
            n,
            />/
          ))
        ),
        contains: [
          {
            className: "name",
            begin: n,
            relevance: 0
          },
          {
            begin: />/,
            relevance: 0,
            endsParent: !0
          }
        ]
      }
    ]
  };
}
function QM(t) {
  const e = "true false yes no null", n = "[\\w#;/?:@&=+$,.~*'()[\\]]+", r = {
    className: "attr",
    variants: [
      // added brackets support and special char support
      { begin: /[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/ },
      {
        // double quoted keys - with brackets and special char support
        begin: /"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/
      },
      {
        // single quoted keys - with brackets and special char support
        begin: /'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/
      }
    ]
  }, i = {
    className: "template-variable",
    variants: [
      {
        // jinja templates Ansible
        begin: /\{\{/,
        end: /\}\}/
      },
      {
        // Ruby i18n
        begin: /%\{/,
        end: /\}/
      }
    ]
  }, o = {
    className: "string",
    relevance: 0,
    begin: /'/,
    end: /'/,
    contains: [
      {
        match: /''/,
        scope: "char.escape",
        relevance: 0
      }
    ]
  }, a = {
    className: "string",
    relevance: 0,
    variants: [
      {
        begin: /"/,
        end: /"/
      },
      { begin: /\S+/ }
    ],
    contains: [
      t.BACKSLASH_ESCAPE,
      i
    ]
  }, s = t.inherit(a, { variants: [
    {
      begin: /'/,
      end: /'/,
      contains: [
        {
          begin: /''/,
          relevance: 0
        }
      ]
    },
    {
      begin: /"/,
      end: /"/
    },
    { begin: /[^\s,{}[\]]+/ }
  ] }), p = {
    className: "number",
    begin: "\\b" + "[0-9]{4}(-[0-9][0-9]){0,2}" + "([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?" + "(\\.[0-9]*)?" + "([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?" + "\\b"
  }, _ = {
    end: ",",
    endsWithParent: !0,
    excludeEnd: !0,
    keywords: e,
    relevance: 0
  }, m = {
    begin: /\{/,
    end: /\}/,
    contains: [_],
    illegal: "\\n",
    relevance: 0
  }, f = {
    begin: "\\[",
    end: "\\]",
    contains: [_],
    illegal: "\\n",
    relevance: 0
  }, g = [
    r,
    {
      className: "meta",
      begin: "^---\\s*$",
      relevance: 10
    },
    {
      // multi line string
      // Blocks start with a | or > followed by a newline
      //
      // Indentation of subsequent lines must be the same to
      // be considered part of the block
      className: "string",
      begin: "[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"
    },
    {
      // Ruby/Rails erb
      begin: "<%[%=-]?",
      end: "[%-]?%>",
      subLanguage: "ruby",
      excludeBegin: !0,
      excludeEnd: !0,
      relevance: 0
    },
    {
      // named tags
      className: "type",
      begin: "!\\w+!" + n
    },
    // https://yaml.org/spec/1.2/spec.html#id2784064
    {
      // verbatim tags
      className: "type",
      begin: "!<" + n + ">"
    },
    {
      // primary tags
      className: "type",
      begin: "!" + n
    },
    {
      // secondary tags
      className: "type",
      begin: "!!" + n
    },
    {
      // fragment id &ref
      className: "meta",
      begin: "&" + t.UNDERSCORE_IDENT_RE + "$"
    },
    {
      // fragment reference *ref
      className: "meta",
      begin: "\\*" + t.UNDERSCORE_IDENT_RE + "$"
    },
    {
      // array listing
      className: "bullet",
      // TODO: remove |$ hack when we have proper look-ahead support
      begin: "-(?=[ ]|$)",
      relevance: 0
    },
    t.HASH_COMMENT_MODE,
    {
      beginKeywords: e,
      keywords: { literal: e }
    },
    p,
    // numbers are any valid C-style number that
    // sit isolated from other words
    {
      className: "number",
      begin: t.C_NUMBER_RE + "\\b",
      relevance: 0
    },
    m,
    f,
    o,
    a
  ], S = [...g];
  return S.pop(), S.push(s), _.contains = S, {
    name: "YAML",
    case_insensitive: !0,
    aliases: ["yml"],
    contains: g
  };
}
const ZM = {
  arduino: Dw,
  bash: ww,
  c: Mw,
  cpp: Lw,
  csharp: kw,
  css: $w,
  diff: zw,
  go: qw,
  graphql: Ww,
  ini: Kw,
  java: Qw,
  javascript: eM,
  json: tM,
  kotlin: rM,
  less: dM,
  lua: pM,
  makefile: _M,
  markdown: mM,
  objectivec: fM,
  perl: gM,
  php: hM,
  "php-template": EM,
  plaintext: SM,
  python: bM,
  "python-repl": TM,
  r: CM,
  ruby: yM,
  rust: vM,
  scss: MM,
  shell: LM,
  sql: kM,
  swift: YM,
  typescript: zM,
  vbnet: qM,
  wasm: WM,
  xml: KM,
  yaml: QM
}, XM = {
  ...ZM,
  "1c": mI,
  abnf: fI,
  accesslog: gI,
  actionscript: hI,
  ada: EI,
  angelscript: SI,
  apache: bI,
  applescript: TI,
  arcade: CI,
  armasm: yI,
  asciidoc: vI,
  aspectj: RI,
  autohotkey: OI,
  autoit: NI,
  avrasm: AI,
  awk: II,
  axapta: xI,
  basic: DI,
  bnf: wI,
  brainfuck: MI,
  cal: LI,
  capnproto: kI,
  ceylon: PI,
  clean: FI,
  clojure: BI,
  "clojure-repl": UI,
  cmake: HI,
  coffeescript: WI,
  coq: KI,
  cos: QI,
  crmsh: ZI,
  crystal: XI,
  csp: jI,
  d: JI,
  dart: ex,
  delphi: tx,
  django: nx,
  dns: rx,
  dockerfile: ix,
  dos: ox,
  dsconfig: ax,
  dts: sx,
  dust: lx,
  ebnf: cx,
  elixir: ux,
  elm: dx,
  erb: px,
  erlang: _x,
  "erlang-repl": mx,
  excel: fx,
  fix: gx,
  flix: hx,
  fortran: Ex,
  fsharp: Tx,
  gams: Cx,
  gauss: yx,
  gcode: vx,
  gherkin: Rx,
  glsl: Ox,
  gml: Nx,
  golo: Ax,
  gradle: Ix,
  groovy: xx,
  haml: Dx,
  handlebars: wx,
  haskell: Mx,
  haxe: Lx,
  hsp: kx,
  http: Px,
  hy: Fx,
  inform7: Bx,
  irpf90: Ux,
  isbl: Hx,
  "jboss-cli": Gx,
  julia: Vx,
  "julia-repl": Yx,
  lasso: $x,
  latex: zx,
  ldif: qx,
  leaf: Wx,
  lisp: Kx,
  livecodeserver: Qx,
  livescript: nD,
  llvm: rD,
  lsl: iD,
  mathematica: aD,
  matlab: sD,
  maxima: lD,
  mel: cD,
  mercury: uD,
  mipsasm: dD,
  mizar: pD,
  mojolicious: _D,
  monkey: mD,
  moonscript: fD,
  n1ql: gD,
  nestedtext: hD,
  nginx: ED,
  nim: SD,
  nix: bD,
  "node-repl": TD,
  nsis: CD,
  ocaml: yD,
  openscad: vD,
  oxygene: RD,
  parser3: OD,
  pf: ND,
  pgsql: AD,
  pony: ID,
  powershell: xD,
  processing: DD,
  profile: wD,
  prolog: MD,
  properties: LD,
  protobuf: kD,
  puppet: PD,
  purebasic: FD,
  q: BD,
  qml: UD,
  reasonml: HD,
  rib: GD,
  roboconf: VD,
  routeros: YD,
  rsl: $D,
  ruleslanguage: zD,
  sas: qD,
  scala: WD,
  scheme: KD,
  scilab: QD,
  smali: ZD,
  smalltalk: XD,
  sml: jD,
  sqf: JD,
  stan: ew,
  stata: tw,
  step21: nw,
  stylus: dw,
  subunit: pw,
  taggerscript: _w,
  tap: mw,
  tcl: fw,
  thrift: gw,
  tp: hw,
  twig: Ew,
  vala: Sw,
  vbscript: bw,
  "vbscript-html": Tw,
  verilog: Cw,
  vhdl: yw,
  vim: vw,
  wren: Rw,
  x86asm: Ow,
  xl: Nw,
  xquery: Aw,
  zephir: Iw
};
function Fh(t) {
  return t instanceof Map ? t.clear = t.delete = t.set = function() {
    throw new Error("map is read-only");
  } : t instanceof Set && (t.add = t.clear = t.delete = function() {
    throw new Error("set is read-only");
  }), Object.freeze(t), Object.getOwnPropertyNames(t).forEach((e) => {
    const n = t[e], r = typeof n;
    (r === "object" || r === "function") && !Object.isFrozen(n) && Fh(n);
  }), t;
}
class z_ {
  /**
   * @param {CompiledMode} mode
   */
  constructor(e) {
    e.data === void 0 && (e.data = {}), this.data = e.data, this.isMatchIgnored = !1;
  }
  ignoreMatch() {
    this.isMatchIgnored = !0;
  }
}
function Bh(t) {
  return t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;");
}
function Fn(t, ...e) {
  const n = /* @__PURE__ */ Object.create(null);
  for (const r in t)
    n[r] = t[r];
  return e.forEach(function(r) {
    for (const i in r)
      n[i] = r[i];
  }), /** @type {T} */
  n;
}
const jM = "</span>", q_ = (t) => !!t.scope, JM = (t, { prefix: e }) => {
  if (t.startsWith("language:"))
    return t.replace("language:", "language-");
  if (t.includes(".")) {
    const n = t.split(".");
    return [
      `${e}${n.shift()}`,
      ...n.map((r, i) => `${r}${"_".repeat(i + 1)}`)
    ].join(" ");
  }
  return `${e}${t}`;
};
class e2 {
  /**
   * Creates a new HTMLRenderer
   *
   * @param {Tree} parseTree - the parse tree (must support `walk` API)
   * @param {{classPrefix: string}} options
   */
  constructor(e, n) {
    this.buffer = "", this.classPrefix = n.classPrefix, e.walk(this);
  }
  /**
   * Adds texts to the output stream
   *
   * @param {string} text */
  addText(e) {
    this.buffer += Bh(e);
  }
  /**
   * Adds a node open to the output stream (if needed)
   *
   * @param {Node} node */
  openNode(e) {
    if (!q_(e)) return;
    const n = JM(
      e.scope,
      { prefix: this.classPrefix }
    );
    this.span(n);
  }
  /**
   * Adds a node close to the output stream (if needed)
   *
   * @param {Node} node */
  closeNode(e) {
    q_(e) && (this.buffer += jM);
  }
  /**
   * returns the accumulated buffer
  */
  value() {
    return this.buffer;
  }
  // helpers
  /**
   * Builds a span element
   *
   * @param {string} className */
  span(e) {
    this.buffer += `<span class="${e}">`;
  }
}
const W_ = (t = {}) => {
  const e = { children: [] };
  return Object.assign(e, t), e;
};
class ku {
  constructor() {
    this.rootNode = W_(), this.stack = [this.rootNode];
  }
  get top() {
    return this.stack[this.stack.length - 1];
  }
  get root() {
    return this.rootNode;
  }
  /** @param {Node} node */
  add(e) {
    this.top.children.push(e);
  }
  /** @param {string} scope */
  openNode(e) {
    const n = W_({ scope: e });
    this.add(n), this.stack.push(n);
  }
  closeNode() {
    if (this.stack.length > 1)
      return this.stack.pop();
  }
  closeAllNodes() {
    for (; this.closeNode(); ) ;
  }
  toJSON() {
    return JSON.stringify(this.rootNode, null, 4);
  }
  /**
   * @typedef { import("./html_renderer").Renderer } Renderer
   * @param {Renderer} builder
   */
  walk(e) {
    return this.constructor._walk(e, this.rootNode);
  }
  /**
   * @param {Renderer} builder
   * @param {Node} node
   */
  static _walk(e, n) {
    return typeof n == "string" ? e.addText(n) : n.children && (e.openNode(n), n.children.forEach((r) => this._walk(e, r)), e.closeNode(n)), e;
  }
  /**
   * @param {Node} node
   */
  static _collapse(e) {
    typeof e != "string" && e.children && (e.children.every((n) => typeof n == "string") ? e.children = [e.children.join("")] : e.children.forEach((n) => {
      ku._collapse(n);
    }));
  }
}
class t2 extends ku {
  /**
   * @param {*} options
   */
  constructor(e) {
    super(), this.options = e;
  }
  /**
   * @param {string} text
   */
  addText(e) {
    e !== "" && this.add(e);
  }
  /** @param {string} scope */
  startScope(e) {
    this.openNode(e);
  }
  endScope() {
    this.closeNode();
  }
  /**
   * @param {Emitter & {root: DataNode}} emitter
   * @param {string} name
   */
  __addSublanguage(e, n) {
    const r = e.root;
    n && (r.scope = `language:${n}`), this.add(r);
  }
  toHTML() {
    return new e2(this, this.options).value();
  }
  finalize() {
    return this.closeAllNodes(), !0;
  }
}
function lo(t) {
  return t ? typeof t == "string" ? t : t.source : null;
}
function Uh(t) {
  return vr("(?=", t, ")");
}
function n2(t) {
  return vr("(?:", t, ")*");
}
function r2(t) {
  return vr("(?:", t, ")?");
}
function vr(...t) {
  return t.map((n) => lo(n)).join("");
}
function i2(t) {
  const e = t[t.length - 1];
  return typeof e == "object" && e.constructor === Object ? (t.splice(t.length - 1, 1), e) : {};
}
function Pu(...t) {
  return "(" + (i2(t).capture ? "" : "?:") + t.map((r) => lo(r)).join("|") + ")";
}
function Hh(t) {
  return new RegExp(t.toString() + "|").exec("").length - 1;
}
function o2(t, e) {
  const n = t && t.exec(e);
  return n && n.index === 0;
}
const a2 = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;
function Fu(t, { joinWith: e }) {
  let n = 0;
  return t.map((r) => {
    n += 1;
    const i = n;
    let o = lo(r), a = "";
    for (; o.length > 0; ) {
      const s = a2.exec(o);
      if (!s) {
        a += o;
        break;
      }
      a += o.substring(0, s.index), o = o.substring(s.index + s[0].length), s[0][0] === "\\" && s[1] ? a += "\\" + String(Number(s[1]) + i) : (a += s[0], s[0] === "(" && n++);
    }
    return a;
  }).map((r) => `(${r})`).join(e);
}
const s2 = /\b\B/, Gh = "[a-zA-Z]\\w*", Bu = "[a-zA-Z_]\\w*", Vh = "\\b\\d+(\\.\\d+)?", Yh = "(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)", $h = "\\b(0b[01]+)", l2 = "!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~", c2 = (t = {}) => {
  const e = /^#![ ]*\//;
  return t.binary && (t.begin = vr(
    e,
    /.*\b/,
    t.binary,
    /\b.*/
  )), Fn({
    scope: "meta",
    begin: e,
    end: /$/,
    relevance: 0,
    /** @type {ModeCallback} */
    "on:begin": (n, r) => {
      n.index !== 0 && r.ignoreMatch();
    }
  }, t);
}, co = {
  begin: "\\\\[\\s\\S]",
  relevance: 0
}, u2 = {
  scope: "string",
  begin: "'",
  end: "'",
  illegal: "\\n",
  contains: [co]
}, d2 = {
  scope: "string",
  begin: '"',
  end: '"',
  illegal: "\\n",
  contains: [co]
}, p2 = {
  begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/
}, Fs = function(t, e, n = {}) {
  const r = Fn(
    {
      scope: "comment",
      begin: t,
      end: e,
      contains: []
    },
    n
  );
  r.contains.push({
    scope: "doctag",
    // hack to avoid the space from being included. the space is necessary to
    // match here to prevent the plain text rule below from gobbling up doctags
    begin: "[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",
    end: /(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,
    excludeBegin: !0,
    relevance: 0
  });
  const i = Pu(
    // list of common 1 and 2 letter words in English
    "I",
    "a",
    "is",
    "so",
    "us",
    "to",
    "at",
    "if",
    "in",
    "it",
    "on",
    // note: this is not an exhaustive list of contractions, just popular ones
    /[A-Za-z]+['](d|ve|re|ll|t|s|n)/,
    // contractions - can't we'd they're let's, etc
    /[A-Za-z]+[-][a-z]+/,
    // `no-way`, etc.
    /[A-Za-z][a-z]{2,}/
    // allow capitalized words at beginning of sentences
  );
  return r.contains.push(
    {
      // TODO: how to include ", (, ) without breaking grammars that use these for
      // comment delimiters?
      // begin: /[ ]+([()"]?([A-Za-z'-]{3,}|is|a|I|so|us|[tT][oO]|at|if|in|it|on)[.]?[()":]?([.][ ]|[ ]|\))){3}/
      // ---
      // this tries to find sequences of 3 english words in a row (without any
      // "programming" type syntax) this gives us a strong signal that we've
      // TRULY found a comment - vs perhaps scanning with the wrong language.
      // It's possible to find something that LOOKS like the start of the
      // comment - but then if there is no readable text - good chance it is a
      // false match and not a comment.
      //
      // for a visual example please see:
      // https://github.com/highlightjs/highlight.js/issues/2827
      begin: vr(
        /[ ]+/,
        // necessary to prevent us gobbling up doctags like /* @author Bob Mcgill */
        "(",
        i,
        /[.]?[:]?([.][ ]|[ ])/,
        "){3}"
      )
      // look for 3 words in a row
    }
  ), r;
}, _2 = Fs("//", "$"), m2 = Fs("/\\*", "\\*/"), f2 = Fs("#", "$"), g2 = {
  scope: "number",
  begin: Vh,
  relevance: 0
}, h2 = {
  scope: "number",
  begin: Yh,
  relevance: 0
}, E2 = {
  scope: "number",
  begin: $h,
  relevance: 0
}, S2 = {
  scope: "regexp",
  begin: /\/(?=[^/\n]*\/)/,
  end: /\/[gimuy]*/,
  contains: [
    co,
    {
      begin: /\[/,
      end: /\]/,
      relevance: 0,
      contains: [co]
    }
  ]
}, b2 = {
  scope: "title",
  begin: Gh,
  relevance: 0
}, T2 = {
  scope: "title",
  begin: Bu,
  relevance: 0
}, C2 = {
  // excludes method names from keyword processing
  begin: "\\.\\s*" + Bu,
  relevance: 0
}, y2 = function(t) {
  return Object.assign(
    t,
    {
      /** @type {ModeCallback} */
      "on:begin": (e, n) => {
        n.data._beginMatch = e[1];
      },
      /** @type {ModeCallback} */
      "on:end": (e, n) => {
        n.data._beginMatch !== e[1] && n.ignoreMatch();
      }
    }
  );
};
var Jo = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  APOS_STRING_MODE: u2,
  BACKSLASH_ESCAPE: co,
  BINARY_NUMBER_MODE: E2,
  BINARY_NUMBER_RE: $h,
  COMMENT: Fs,
  C_BLOCK_COMMENT_MODE: m2,
  C_LINE_COMMENT_MODE: _2,
  C_NUMBER_MODE: h2,
  C_NUMBER_RE: Yh,
  END_SAME_AS_BEGIN: y2,
  HASH_COMMENT_MODE: f2,
  IDENT_RE: Gh,
  MATCH_NOTHING_RE: s2,
  METHOD_GUARD: C2,
  NUMBER_MODE: g2,
  NUMBER_RE: Vh,
  PHRASAL_WORDS_MODE: p2,
  QUOTE_STRING_MODE: d2,
  REGEXP_MODE: S2,
  RE_STARTERS_RE: l2,
  SHEBANG: c2,
  TITLE_MODE: b2,
  UNDERSCORE_IDENT_RE: Bu,
  UNDERSCORE_TITLE_MODE: T2
});
function v2(t, e) {
  t.input[t.index - 1] === "." && e.ignoreMatch();
}
function R2(t, e) {
  t.className !== void 0 && (t.scope = t.className, delete t.className);
}
function O2(t, e) {
  e && t.beginKeywords && (t.begin = "\\b(" + t.beginKeywords.split(" ").join("|") + ")(?!\\.)(?=\\b|\\s)", t.__beforeBegin = v2, t.keywords = t.keywords || t.beginKeywords, delete t.beginKeywords, t.relevance === void 0 && (t.relevance = 0));
}
function N2(t, e) {
  Array.isArray(t.illegal) && (t.illegal = Pu(...t.illegal));
}
function A2(t, e) {
  if (t.match) {
    if (t.begin || t.end) throw new Error("begin & end are not supported with match");
    t.begin = t.match, delete t.match;
  }
}
function I2(t, e) {
  t.relevance === void 0 && (t.relevance = 1);
}
const x2 = (t, e) => {
  if (!t.beforeMatch) return;
  if (t.starts) throw new Error("beforeMatch cannot be used with starts");
  const n = Object.assign({}, t);
  Object.keys(t).forEach((r) => {
    delete t[r];
  }), t.keywords = n.keywords, t.begin = vr(n.beforeMatch, Uh(n.begin)), t.starts = {
    relevance: 0,
    contains: [
      Object.assign(n, { endsParent: !0 })
    ]
  }, t.relevance = 0, delete n.beforeMatch;
}, D2 = [
  "of",
  "and",
  "for",
  "in",
  "not",
  "or",
  "if",
  "then",
  "parent",
  // common variable name
  "list",
  // common variable name
  "value"
  // common variable name
], w2 = "keyword";
function zh(t, e, n = w2) {
  const r = /* @__PURE__ */ Object.create(null);
  return typeof t == "string" ? i(n, t.split(" ")) : Array.isArray(t) ? i(n, t) : Object.keys(t).forEach(function(o) {
    Object.assign(
      r,
      zh(t[o], e, o)
    );
  }), r;
  function i(o, a) {
    e && (a = a.map((s) => s.toLowerCase())), a.forEach(function(s) {
      const l = s.split("|");
      r[l[0]] = [o, M2(l[0], l[1])];
    });
  }
}
function M2(t, e) {
  return e ? Number(e) : L2(t) ? 0 : 1;
}
function L2(t) {
  return D2.includes(t.toLowerCase());
}
const K_ = {}, _r = (t) => {
  console.error(t);
}, Q_ = (t, ...e) => {
  console.log(`WARN: ${t}`, ...e);
}, Lr = (t, e) => {
  K_[`${t}/${e}`] || (console.log(`Deprecated as of ${t}. ${e}`), K_[`${t}/${e}`] = !0);
}, as = new Error();
function qh(t, e, { key: n }) {
  let r = 0;
  const i = t[n], o = {}, a = {};
  for (let s = 1; s <= e.length; s++)
    a[s + r] = i[s], o[s + r] = !0, r += Hh(e[s - 1]);
  t[n] = a, t[n]._emit = o, t[n]._multi = !0;
}
function k2(t) {
  if (Array.isArray(t.begin)) {
    if (t.skip || t.excludeBegin || t.returnBegin)
      throw _r("skip, excludeBegin, returnBegin not compatible with beginScope: {}"), as;
    if (typeof t.beginScope != "object" || t.beginScope === null)
      throw _r("beginScope must be object"), as;
    qh(t, t.begin, { key: "beginScope" }), t.begin = Fu(t.begin, { joinWith: "" });
  }
}
function P2(t) {
  if (Array.isArray(t.end)) {
    if (t.skip || t.excludeEnd || t.returnEnd)
      throw _r("skip, excludeEnd, returnEnd not compatible with endScope: {}"), as;
    if (typeof t.endScope != "object" || t.endScope === null)
      throw _r("endScope must be object"), as;
    qh(t, t.end, { key: "endScope" }), t.end = Fu(t.end, { joinWith: "" });
  }
}
function F2(t) {
  t.scope && typeof t.scope == "object" && t.scope !== null && (t.beginScope = t.scope, delete t.scope);
}
function B2(t) {
  F2(t), typeof t.beginScope == "string" && (t.beginScope = { _wrap: t.beginScope }), typeof t.endScope == "string" && (t.endScope = { _wrap: t.endScope }), k2(t), P2(t);
}
function U2(t) {
  function e(a, s) {
    return new RegExp(
      lo(a),
      "m" + (t.case_insensitive ? "i" : "") + (t.unicodeRegex ? "u" : "") + (s ? "g" : "")
    );
  }
  class n {
    constructor() {
      this.matchIndexes = {}, this.regexes = [], this.matchAt = 1, this.position = 0;
    }
    // @ts-ignore
    addRule(s, l) {
      l.position = this.position++, this.matchIndexes[this.matchAt] = l, this.regexes.push([l, s]), this.matchAt += Hh(s) + 1;
    }
    compile() {
      this.regexes.length === 0 && (this.exec = () => null);
      const s = this.regexes.map((l) => l[1]);
      this.matcherRe = e(Fu(s, { joinWith: "|" }), !0), this.lastIndex = 0;
    }
    /** @param {string} s */
    exec(s) {
      this.matcherRe.lastIndex = this.lastIndex;
      const l = this.matcherRe.exec(s);
      if (!l)
        return null;
      const c = l.findIndex((d, p) => p > 0 && d !== void 0), u = this.matchIndexes[c];
      return l.splice(0, c), Object.assign(l, u);
    }
  }
  class r {
    constructor() {
      this.rules = [], this.multiRegexes = [], this.count = 0, this.lastIndex = 0, this.regexIndex = 0;
    }
    // @ts-ignore
    getMatcher(s) {
      if (this.multiRegexes[s]) return this.multiRegexes[s];
      const l = new n();
      return this.rules.slice(s).forEach(([c, u]) => l.addRule(c, u)), l.compile(), this.multiRegexes[s] = l, l;
    }
    resumingScanAtSamePosition() {
      return this.regexIndex !== 0;
    }
    considerAll() {
      this.regexIndex = 0;
    }
    // @ts-ignore
    addRule(s, l) {
      this.rules.push([s, l]), l.type === "begin" && this.count++;
    }
    /** @param {string} s */
    exec(s) {
      const l = this.getMatcher(this.regexIndex);
      l.lastIndex = this.lastIndex;
      let c = l.exec(s);
      if (this.resumingScanAtSamePosition() && !(c && c.index === this.lastIndex)) {
        const u = this.getMatcher(0);
        u.lastIndex = this.lastIndex + 1, c = u.exec(s);
      }
      return c && (this.regexIndex += c.position + 1, this.regexIndex === this.count && this.considerAll()), c;
    }
  }
  function i(a) {
    const s = new r();
    return a.contains.forEach((l) => s.addRule(l.begin, { rule: l, type: "begin" })), a.terminatorEnd && s.addRule(a.terminatorEnd, { type: "end" }), a.illegal && s.addRule(a.illegal, { type: "illegal" }), s;
  }
  function o(a, s) {
    const l = (
      /** @type CompiledMode */
      a
    );
    if (a.isCompiled) return l;
    [
      R2,
      // do this early so compiler extensions generally don't have to worry about
      // the distinction between match/begin
      A2,
      B2,
      x2
    ].forEach((u) => u(a, s)), t.compilerExtensions.forEach((u) => u(a, s)), a.__beforeBegin = null, [
      O2,
      // do this later so compiler extensions that come earlier have access to the
      // raw array if they wanted to perhaps manipulate it, etc.
      N2,
      // default to 1 relevance if not specified
      I2
    ].forEach((u) => u(a, s)), a.isCompiled = !0;
    let c = null;
    return typeof a.keywords == "object" && a.keywords.$pattern && (a.keywords = Object.assign({}, a.keywords), c = a.keywords.$pattern, delete a.keywords.$pattern), c = c || /\w+/, a.keywords && (a.keywords = zh(a.keywords, t.case_insensitive)), l.keywordPatternRe = e(c, !0), s && (a.begin || (a.begin = /\B|\b/), l.beginRe = e(l.begin), !a.end && !a.endsWithParent && (a.end = /\B|\b/), a.end && (l.endRe = e(l.end)), l.terminatorEnd = lo(l.end) || "", a.endsWithParent && s.terminatorEnd && (l.terminatorEnd += (a.end ? "|" : "") + s.terminatorEnd)), a.illegal && (l.illegalRe = e(
      /** @type {RegExp | string} */
      a.illegal
    )), a.contains || (a.contains = []), a.contains = [].concat(...a.contains.map(function(u) {
      return H2(u === "self" ? a : u);
    })), a.contains.forEach(function(u) {
      o(
        /** @type Mode */
        u,
        l
      );
    }), a.starts && o(a.starts, s), l.matcher = i(l), l;
  }
  if (t.compilerExtensions || (t.compilerExtensions = []), t.contains && t.contains.includes("self"))
    throw new Error("ERR: contains `self` is not supported at the top-level of a language.  See documentation.");
  return t.classNameAliases = Fn(t.classNameAliases || {}), o(
    /** @type Mode */
    t
  );
}
function Wh(t) {
  return t ? t.endsWithParent || Wh(t.starts) : !1;
}
function H2(t) {
  return t.variants && !t.cachedVariants && (t.cachedVariants = t.variants.map(function(e) {
    return Fn(t, { variants: null }, e);
  })), t.cachedVariants ? t.cachedVariants : Wh(t) ? Fn(t, { starts: t.starts ? Fn(t.starts) : null }) : Object.isFrozen(t) ? Fn(t) : t;
}
var G2 = "11.11.1";
class V2 extends Error {
  constructor(e, n) {
    super(e), this.name = "HTMLInjectionError", this.html = n;
  }
}
const Ml = Bh, Z_ = Fn, X_ = Symbol("nomatch"), Y2 = 7, Kh = function(t) {
  const e = /* @__PURE__ */ Object.create(null), n = /* @__PURE__ */ Object.create(null), r = [];
  let i = !0;
  const o = "Could not find the language '{}', did you forget to load/include a language module?", a = { disableAutodetect: !0, name: "Plain text", contains: [] };
  let s = {
    ignoreUnescapedHTML: !1,
    throwUnescapedHTML: !1,
    noHighlightRe: /^(no-?highlight)$/i,
    languageDetectRe: /\blang(?:uage)?-([\w-]+)\b/i,
    classPrefix: "hljs-",
    cssSelector: "pre code",
    languages: null,
    // beta configuration options, subject to change, welcome to discuss
    // https://github.com/highlightjs/highlight.js/issues/1086
    __emitter: t2
  };
  function l(O) {
    return s.noHighlightRe.test(O);
  }
  function c(O) {
    let y = O.className + " ";
    y += O.parentNode ? O.parentNode.className : "";
    const R = s.languageDetectRe.exec(y);
    if (R) {
      const w = I(R[1]);
      return w || (Q_(o.replace("{}", R[1])), Q_("Falling back to no-highlight mode for this block.", O)), w ? R[1] : "no-highlight";
    }
    return y.split(/\s+/).find((w) => l(w) || I(w));
  }
  function u(O, y, R) {
    let w = "", B = "";
    typeof y == "object" ? (w = O, R = y.ignoreIllegals, B = y.language) : (Lr("10.7.0", "highlight(lang, code, ...args) has been deprecated."), Lr("10.7.0", `Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`), B = O, w = y), R === void 0 && (R = !0);
    const $ = {
      code: w,
      language: B
    };
    q("before:highlight", $);
    const X = $.result ? $.result : d($.language, $.code, R);
    return X.code = $.code, q("after:highlight", X), X;
  }
  function d(O, y, R, w) {
    const B = /* @__PURE__ */ Object.create(null);
    function $(U, A) {
      return U.keywords[A];
    }
    function X() {
      if (!Q.keywords) {
        Ee.addText(J);
        return;
      }
      let U = 0;
      Q.keywordPatternRe.lastIndex = 0;
      let A = Q.keywordPatternRe.exec(J), k = "";
      for (; A; ) {
        k += J.substring(U, A.index);
        const G = Pe.case_insensitive ? A[0].toLowerCase() : A[0], re = $(Q, G);
        if (re) {
          const [Ce, mt] = re;
          if (Ee.addText(k), k = "", B[G] = (B[G] || 0) + 1, B[G] <= Y2 && (_e += mt), Ce.startsWith("_"))
            k += A[0];
          else {
            const Or = Pe.classNameAliases[Ce] || Ce;
            le(A[0], Or);
          }
        } else
          k += A[0];
        U = Q.keywordPatternRe.lastIndex, A = Q.keywordPatternRe.exec(J);
      }
      k += J.substring(U), Ee.addText(k);
    }
    function de() {
      if (J === "") return;
      let U = null;
      if (typeof Q.subLanguage == "string") {
        if (!e[Q.subLanguage]) {
          Ee.addText(J);
          return;
        }
        U = d(Q.subLanguage, J, !0, j[Q.subLanguage]), j[Q.subLanguage] = /** @type {CompiledMode} */
        U._top;
      } else
        U = _(J, Q.subLanguage.length ? Q.subLanguage : null);
      Q.relevance > 0 && (_e += U.relevance), Ee.__addSublanguage(U._emitter, U.language);
    }
    function pe() {
      Q.subLanguage != null ? de() : X(), J = "";
    }
    function le(U, A) {
      U !== "" && (Ee.startScope(A), Ee.addText(U), Ee.endScope());
    }
    function he(U, A) {
      let k = 1;
      const G = A.length - 1;
      for (; k <= G; ) {
        if (!U._emit[k]) {
          k++;
          continue;
        }
        const re = Pe.classNameAliases[U[k]] || U[k], Ce = A[k];
        re ? le(Ce, re) : (J = Ce, X(), J = ""), k++;
      }
    }
    function We(U, A) {
      return U.scope && typeof U.scope == "string" && Ee.openNode(Pe.classNameAliases[U.scope] || U.scope), U.beginScope && (U.beginScope._wrap ? (le(J, Pe.classNameAliases[U.beginScope._wrap] || U.beginScope._wrap), J = "") : U.beginScope._multi && (he(U.beginScope, A), J = "")), Q = Object.create(U, { parent: { value: Q } }), Q;
    }
    function De(U, A, k) {
      let G = o2(U.endRe, k);
      if (G) {
        if (U["on:end"]) {
          const re = new z_(U);
          U["on:end"](A, re), re.isMatchIgnored && (G = !1);
        }
        if (G) {
          for (; U.endsParent && U.parent; )
            U = U.parent;
          return U;
        }
      }
      if (U.endsWithParent)
        return De(U.parent, A, k);
    }
    function et(U) {
      return Q.matcher.regexIndex === 0 ? (J += U[0], 1) : (Tt = !0, 0);
    }
    function Ke(U) {
      const A = U[0], k = U.rule, G = new z_(k), re = [k.__beforeBegin, k["on:begin"]];
      for (const Ce of re)
        if (Ce && (Ce(U, G), G.isMatchIgnored))
          return et(A);
      return k.skip ? J += A : (k.excludeBegin && (J += A), pe(), !k.returnBegin && !k.excludeBegin && (J = A)), We(k, U), k.returnBegin ? 0 : A.length;
    }
    function st(U) {
      const A = U[0], k = y.substring(U.index), G = De(Q, U, k);
      if (!G)
        return X_;
      const re = Q;
      Q.endScope && Q.endScope._wrap ? (pe(), le(A, Q.endScope._wrap)) : Q.endScope && Q.endScope._multi ? (pe(), he(Q.endScope, U)) : re.skip ? J += A : (re.returnEnd || re.excludeEnd || (J += A), pe(), re.excludeEnd && (J = A));
      do
        Q.scope && Ee.closeNode(), !Q.skip && !Q.subLanguage && (_e += Q.relevance), Q = Q.parent;
      while (Q !== G.parent);
      return G.starts && We(G.starts, U), re.returnEnd ? 0 : A.length;
    }
    function Ut() {
      const U = [];
      for (let A = Q; A !== Pe; A = A.parent)
        A.scope && U.unshift(A.scope);
      U.forEach((A) => Ee.openNode(A));
    }
    let lt = {};
    function ct(U, A) {
      const k = A && A[0];
      if (J += U, k == null)
        return pe(), 0;
      if (lt.type === "begin" && A.type === "end" && lt.index === A.index && k === "") {
        if (J += y.slice(A.index, A.index + 1), !i) {
          const G = new Error(`0 width match regex (${O})`);
          throw G.languageName = O, G.badRule = lt.rule, G;
        }
        return 1;
      }
      if (lt = A, A.type === "begin")
        return Ke(A);
      if (A.type === "illegal" && !R) {
        const G = new Error('Illegal lexeme "' + k + '" for mode "' + (Q.scope || "<unnamed>") + '"');
        throw G.mode = Q, G;
      } else if (A.type === "end") {
        const G = st(A);
        if (G !== X_)
          return G;
      }
      if (A.type === "illegal" && k === "")
        return J += `
`, 1;
      if (Ge > 1e5 && Ge > A.index * 3)
        throw new Error("potential infinite loop, way more iterations than matches");
      return J += k, k.length;
    }
    const Pe = I(O);
    if (!Pe)
      throw _r(o.replace("{}", O)), new Error('Unknown language: "' + O + '"');
    const ae = U2(Pe);
    let Qe = "", Q = w || ae;
    const j = {}, Ee = new s.__emitter(s);
    Ut();
    let J = "", _e = 0, Fe = 0, Ge = 0, Tt = !1;
    try {
      if (Pe.__emitTokens)
        Pe.__emitTokens(y, Ee);
      else {
        for (Q.matcher.considerAll(); ; ) {
          Ge++, Tt ? Tt = !1 : Q.matcher.considerAll(), Q.matcher.lastIndex = Fe;
          const U = Q.matcher.exec(y);
          if (!U) break;
          const A = y.substring(Fe, U.index), k = ct(A, U);
          Fe = U.index + k;
        }
        ct(y.substring(Fe));
      }
      return Ee.finalize(), Qe = Ee.toHTML(), {
        language: O,
        value: Qe,
        relevance: _e,
        illegal: !1,
        _emitter: Ee,
        _top: Q
      };
    } catch (U) {
      if (U.message && U.message.includes("Illegal"))
        return {
          language: O,
          value: Ml(y),
          illegal: !0,
          relevance: 0,
          _illegalBy: {
            message: U.message,
            index: Fe,
            context: y.slice(Fe - 100, Fe + 100),
            mode: U.mode,
            resultSoFar: Qe
          },
          _emitter: Ee
        };
      if (i)
        return {
          language: O,
          value: Ml(y),
          illegal: !1,
          relevance: 0,
          errorRaised: U,
          _emitter: Ee,
          _top: Q
        };
      throw U;
    }
  }
  function p(O) {
    const y = {
      value: Ml(O),
      illegal: !1,
      relevance: 0,
      _top: a,
      _emitter: new s.__emitter(s)
    };
    return y._emitter.addText(O), y;
  }
  function _(O, y) {
    y = y || s.languages || Object.keys(e);
    const R = p(O), w = y.filter(I).filter(x).map(
      (pe) => d(pe, O, !1)
    );
    w.unshift(R);
    const B = w.sort((pe, le) => {
      if (pe.relevance !== le.relevance) return le.relevance - pe.relevance;
      if (pe.language && le.language) {
        if (I(pe.language).supersetOf === le.language)
          return 1;
        if (I(le.language).supersetOf === pe.language)
          return -1;
      }
      return 0;
    }), [$, X] = B, de = $;
    return de.secondBest = X, de;
  }
  function m(O, y, R) {
    const w = y && n[y] || R;
    O.classList.add("hljs"), O.classList.add(`language-${w}`);
  }
  function f(O) {
    let y = null;
    const R = c(O);
    if (l(R)) return;
    if (q(
      "before:highlightElement",
      { el: O, language: R }
    ), O.dataset.highlighted) {
      console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.", O);
      return;
    }
    if (O.children.length > 0 && (s.ignoreUnescapedHTML || (console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."), console.warn("https://github.com/highlightjs/highlight.js/wiki/security"), console.warn("The element with unescaped HTML:"), console.warn(O)), s.throwUnescapedHTML))
      throw new V2(
        "One of your code blocks includes unescaped HTML.",
        O.innerHTML
      );
    y = O;
    const w = y.textContent, B = R ? u(w, { language: R, ignoreIllegals: !0 }) : _(w);
    O.innerHTML = B.value, O.dataset.highlighted = "yes", m(O, R, B.language), O.result = {
      language: B.language,
      // TODO: remove with version 11.0
      re: B.relevance,
      relevance: B.relevance
    }, B.secondBest && (O.secondBest = {
      language: B.secondBest.language,
      relevance: B.secondBest.relevance
    }), q("after:highlightElement", { el: O, result: B, text: w });
  }
  function g(O) {
    s = Z_(s, O);
  }
  const S = () => {
    h(), Lr("10.6.0", "initHighlighting() deprecated.  Use highlightAll() now.");
  };
  function E() {
    h(), Lr("10.6.0", "initHighlightingOnLoad() deprecated.  Use highlightAll() now.");
  }
  let b = !1;
  function h() {
    function O() {
      h();
    }
    if (document.readyState === "loading") {
      b || window.addEventListener("DOMContentLoaded", O, !1), b = !0;
      return;
    }
    document.querySelectorAll(s.cssSelector).forEach(f);
  }
  function T(O, y) {
    let R = null;
    try {
      R = y(t);
    } catch (w) {
      if (_r("Language definition for '{}' could not be registered.".replace("{}", O)), i)
        _r(w);
      else
        throw w;
      R = a;
    }
    R.name || (R.name = O), e[O] = R, R.rawDefinition = y.bind(null, t), R.aliases && N(R.aliases, { languageName: O });
  }
  function C(O) {
    delete e[O];
    for (const y of Object.keys(n))
      n[y] === O && delete n[y];
  }
  function v() {
    return Object.keys(e);
  }
  function I(O) {
    return O = (O || "").toLowerCase(), e[O] || e[n[O]];
  }
  function N(O, { languageName: y }) {
    typeof O == "string" && (O = [O]), O.forEach((R) => {
      n[R.toLowerCase()] = y;
    });
  }
  function x(O) {
    const y = I(O);
    return y && !y.disableAutodetect;
  }
  function P(O) {
    O["before:highlightBlock"] && !O["before:highlightElement"] && (O["before:highlightElement"] = (y) => {
      O["before:highlightBlock"](
        Object.assign({ block: y.el }, y)
      );
    }), O["after:highlightBlock"] && !O["after:highlightElement"] && (O["after:highlightElement"] = (y) => {
      O["after:highlightBlock"](
        Object.assign({ block: y.el }, y)
      );
    });
  }
  function Y(O) {
    P(O), r.push(O);
  }
  function Z(O) {
    const y = r.indexOf(O);
    y !== -1 && r.splice(y, 1);
  }
  function q(O, y) {
    const R = O;
    r.forEach(function(w) {
      w[R] && w[R](y);
    });
  }
  function V(O) {
    return Lr("10.7.0", "highlightBlock will be removed entirely in v12.0"), Lr("10.7.0", "Please use highlightElement now."), f(O);
  }
  Object.assign(t, {
    highlight: u,
    highlightAuto: _,
    highlightAll: h,
    highlightElement: f,
    // TODO: Remove with v12 API
    highlightBlock: V,
    configure: g,
    initHighlighting: S,
    initHighlightingOnLoad: E,
    registerLanguage: T,
    unregisterLanguage: C,
    listLanguages: v,
    getLanguage: I,
    registerAliases: N,
    autoDetection: x,
    inherit: Z_,
    addPlugin: Y,
    removePlugin: Z
  }), t.debugMode = function() {
    i = !1;
  }, t.safeMode = function() {
    i = !0;
  }, t.versionString = G2, t.regex = {
    concat: vr,
    lookahead: Uh,
    either: Pu,
    optional: r2,
    anyNumberOfTimes: n2
  };
  for (const O in Jo)
    typeof Jo[O] == "object" && Fh(Jo[O]);
  return Object.assign(t, Jo), t;
}, si = Kh({});
si.newInstance = () => Kh({});
var $2 = si;
si.HighlightJS = si;
si.default = si;
const z2 = /* @__PURE__ */ Ds($2), j_ = {}, q2 = "hljs-";
function W2(t) {
  const e = z2.newInstance();
  return t && o(t), {
    highlight: n,
    highlightAuto: r,
    listLanguages: i,
    register: o,
    registerAlias: a,
    registered: s
  };
  function n(l, c, u) {
    const d = u || j_, p = typeof d.prefix == "string" ? d.prefix : q2;
    if (!e.getLanguage(l))
      throw new Error("Unknown language: `" + l + "` is not registered");
    e.configure({ __emitter: K2, classPrefix: p });
    const _ = (
      /** @type {HighlightResult & {_emitter: HastEmitter}} */
      e.highlight(c, { ignoreIllegals: !0, language: l })
    );
    if (_.errorRaised)
      throw new Error("Could not highlight with `Highlight.js`", {
        cause: _.errorRaised
      });
    const m = _._emitter.root, f = (
      /** @type {RootData} */
      m.data
    );
    return f.language = _.language, f.relevance = _.relevance, m;
  }
  function r(l, c) {
    const d = (c || j_).subset || i();
    let p = -1, _ = 0, m;
    for (; ++p < d.length; ) {
      const f = d[p];
      if (!e.getLanguage(f)) continue;
      const g = n(f, l, c);
      g.data && g.data.relevance !== void 0 && g.data.relevance > _ && (_ = g.data.relevance, m = g);
    }
    return m || {
      type: "root",
      children: [],
      data: { language: void 0, relevance: _ }
    };
  }
  function i() {
    return e.listLanguages();
  }
  function o(l, c) {
    if (typeof l == "string")
      e.registerLanguage(l, c);
    else {
      let u;
      for (u in l)
        Object.hasOwn(l, u) && e.registerLanguage(u, l[u]);
    }
  }
  function a(l, c) {
    if (typeof l == "string")
      e.registerAliases(
        // Note: copy needed because hljs doesn’t accept readonly arrays yet.
        typeof c == "string" ? c : [...c],
        { languageName: l }
      );
    else {
      let u;
      for (u in l)
        if (Object.hasOwn(l, u)) {
          const d = l[u];
          e.registerAliases(
            // Note: copy needed because hljs doesn’t accept readonly arrays yet.
            typeof d == "string" ? d : [...d],
            { languageName: u }
          );
        }
    }
  }
  function s(l) {
    return !!e.getLanguage(l);
  }
}
class K2 {
  /**
   * @param {Readonly<HljsOptions>} options
   *   Configuration.
   * @returns
   *   Instance.
   */
  constructor(e) {
    this.options = e, this.root = {
      type: "root",
      children: [],
      data: { language: void 0, relevance: 0 }
    }, this.stack = [this.root];
  }
  /**
   * @param {string} value
   *   Text to add.
   * @returns {undefined}
   *   Nothing.
   *
   */
  addText(e) {
    if (e === "") return;
    const n = this.stack[this.stack.length - 1], r = n.children[n.children.length - 1];
    r && r.type === "text" ? r.value += e : n.children.push({ type: "text", value: e });
  }
  /**
   *
   * @param {unknown} rawName
   *   Name to add.
   * @returns {undefined}
   *   Nothing.
   */
  startScope(e) {
    this.openNode(String(e));
  }
  /**
   * @returns {undefined}
   *   Nothing.
   */
  endScope() {
    this.closeNode();
  }
  /**
   * @param {HastEmitter} other
   *   Other emitter.
   * @param {string} name
   *   Name of the sublanguage.
   * @returns {undefined}
   *   Nothing.
   */
  __addSublanguage(e, n) {
    const r = this.stack[this.stack.length - 1], i = (
      /** @type {Array<ElementContent>} */
      e.root.children
    );
    n ? r.children.push({
      type: "element",
      tagName: "span",
      properties: { className: [n] },
      children: i
    }) : r.children.push(...i);
  }
  /**
   * @param {string} name
   *   Name to add.
   * @returns {undefined}
   *   Nothing.
   */
  openNode(e) {
    const n = this, r = e.split(".").map(function(a, s) {
      return s ? a + "_".repeat(s) : n.options.classPrefix + a;
    }), i = this.stack[this.stack.length - 1], o = {
      type: "element",
      tagName: "span",
      properties: { className: r },
      children: []
    };
    i.children.push(o), this.stack.push(o);
  }
  /**
   * @returns {undefined}
   *   Nothing.
   */
  closeNode() {
    this.stack.pop();
  }
  /**
   * @returns {undefined}
   *   Nothing.
   */
  finalize() {
  }
  /**
   * @returns {string}
   *   Nothing.
   */
  toHTML() {
    return "";
  }
}
const Q2 = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/, J_ = new Oe("linwiteditor-video-plugin"), Ri = "video_action", Z2 = xe.create({
  name: "video",
  group: "block",
  addAttributes() {
    return {
      src: {
        default: null,
        parseHTML: (t) => {
          const e = t.getAttribute("src");
          if (e) return e;
          const n = t.querySelector("source");
          return n ? n.getAttribute("src") : null;
        },
        renderHTML: (t) => ({ src: t.src })
      },
      poster: {
        default: null,
        parseHTML: (t) => t.getAttribute("poster"),
        renderHTML: (t) => ({ poster: t.poster })
      },
      width: {
        default: 350,
        parseHTML: (t) => `${t.getAttribute("width") ?? ""}`
      },
      controls: {
        default: !0,
        parseHTML: (t) => `${t.getAttribute("controls") ?? "true"}`
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: "video",
        getAttrs: (t) => ({
          src: t.getAttribute("src"),
          poster: t.getAttribute("poster")
        })
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return [
      "video",
      { controls: "true", ...t, src: null },
      ["source", { src: t.src }]
    ];
  },
  addCommands() {
    return {
      setVideo: (t) => ({ commands: e }) => e.insertContent(`<video controls="true" style="width: 100%" src="${t}" />`),
      toggleVideo: () => ({ commands: t }) => t.toggleNode(this.name, "paragraph"),
      uploadVideo: (t) => () => {
        const e = typeof this.options.uploadHeaders == "object" ? this.options.uploadHeaders : typeof this.options.uploadHeaders == "function" ? this.options.uploadHeaders() : {};
        if (this.options.uploaderEvent && this.options.uploaderEvent.onUploadBefore && this.options.uploaderEvent.onUploadBefore(t, this.options.uploadUrl, e) === !1)
          return !1;
        const n = Ms(), { state: { tr: r }, view: i, schema: o } = this.editor;
        r.selection.empty || r.deleteSelection(), i.dispatch(r.setMeta(Ri, {
          type: "add",
          id: n,
          pos: r.selection.from
        }));
        const a = this.options.uploader || bu(this.options.uploadUrl), s = this.options.uploadFormName || "video";
        return a(t, this.options.uploadUrl, e, s).then((l) => {
          var c;
          if ((c = this.options.uploaderEvent) != null && c.onSuccess) {
            const u = this.options.uploaderEvent.onSuccess(t, l);
            if (typeof u == "boolean" && !u)
              return;
            typeof u == "object" && (l = u);
          }
          if (l.errorCode === 0 && l.data && l.data.src) {
            let d = J_.getState(this.editor.state).find(void 0, void 0, (p) => p.id == n);
            i.dispatch(i.state.tr.insert(d[0].from, o.nodes.video.create({
              src: l.data.src,
              poster: l.data.poster,
              width: l.data.width || 350,
              controls: l.data.controls || "true"
            })).setMeta(Ri, { type: "remove", id: n }));
          } else
            i.dispatch(r.setMeta(Ri, { type: "remove", id: n })), this.options.uploaderEvent && this.options.uploaderEvent.onFailed && this.options.uploaderEvent.onFailed(t, l);
        }).catch((l) => {
          const { state: { tr: c }, view: u } = this.editor;
          u.dispatch(c.setMeta(Ri, { type: "remove", id: n })), this.options.uploaderEvent && this.options.uploaderEvent.onError && this.options.uploaderEvent.onError(t, l);
        }), !0;
      }
    };
  },
  addNodeView() {
    return (t) => {
      const e = document.createElement("div");
      if (!this.editor.isEditable)
        return {
          dom: e
        };
      const { src: n, width: r, align: i } = t.node.attrs;
      return e.classList.add(`align-${i}`), e.innerHTML = `
                  <div class="linwiteditor-resize-wrapper">
                      <div class="linwiteditor-resize">
                          <div class="linwiteditor-resize-btn-top-left" data-position="left" draggable="true"></div>
                          <div class="linwiteditor-resize-btn-top-right" data-position="right" draggable="true"></div>
                          <div class="linwiteditor-resize-btn-bottom-left" data-position="left" draggable="true"></div>
                          <div class="linwiteditor-resize-btn-bottom-right" data-position="right" draggable="true"></div>
                      </div>
                      <video controls="controls" width="${r}" class="resize-obj">
                          <source src="${n}">
                      </video>
                  </div>
                `, Ug(e, this.editor.view.dom, (o) => this.editor.commands.updateAttributes("video", o)), {
        dom: e
      };
    };
  },
  addInputRules() {
    return [
      cu({
        find: Q2,
        type: this.type,
        getAttributes: (t) => {
          const [, , e] = t;
          return { src: e };
        }
      })
    ];
  },
  addProseMirrorPlugins() {
    const t = this.editor;
    return [
      new Te({
        key: J_,
        state: {
          init: () => ye.empty,
          apply: (e, n) => {
            const r = e.getMeta(Ri);
            return n = n.map(e.mapping, e.doc), r && r.type === "add" ? n = n.add(e.doc, [Bg(r)]) : r && r.type === "remove" && (n = n.remove(n.find(
              void 0,
              void 0,
              (i) => i.id == r.id
            ))), n;
          }
        },
        props: {
          decorations(e) {
            return this.getState(e);
          },
          handleDOMEvents: {
            drop(e, n) {
              if (!(n.dataTransfer && n.dataTransfer.files && n.dataTransfer.files.length)) return !1;
              const i = Array.from(n.dataTransfer.files).filter((c) => /video/i.test(c.type));
              if (i.length === 0) return !1;
              n.preventDefault();
              const { state: { tr: o, doc: a }, dispatch: s } = e, l = e.posAtCoords({ left: n.clientX, top: n.clientY });
              return s(o.setSelection(K.create(a, l.pos)).scrollIntoView()), i.forEach((c) => {
                t.commands.uploadVideo(c);
              }), !0;
            }
          }
        }
      })
    ];
  }
}), X2 = xe.create({
  name: "iframe",
  group: "block",
  atom: !0,
  addOptions() {
    return {
      allowFullscreen: !0,
      HTMLAttributes: {
        class: "iframe-wrapper"
      }
    };
  },
  addAttributes() {
    return {
      src: {
        default: null
      },
      width: {
        default: "100%"
      },
      frameborder: {
        default: 0
      },
      allowfullscreen: {
        default: this.options.allowFullscreen,
        parseHTML: () => this.options.allowFullscreen
      }
    };
  },
  parseHTML() {
    return [{
      tag: "iframe"
    }];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["div", this.options.HTMLAttributes, ["iframe", t]];
  },
  addCommands() {
    return {
      setIframe: (t) => ({ tr: e, dispatch: n }) => {
        const { selection: r } = e, i = this.type.create(t);
        return n && e.replaceRangeWith(r.from, r.to, i), !0;
      }
    };
  }
});
class j2 {
  constructor({
    editor: e,
    element: n,
    view: r,
    tippyOptions: i = {},
    updateDelay: o = 250,
    updateAtMouseUp: a = !1,
    shouldShow: s
  }) {
    M(this, "editor");
    M(this, "element");
    M(this, "view");
    M(this, "preventHide", !1);
    M(this, "tippy");
    M(this, "tippyOptions");
    M(this, "updateDelay");
    M(this, "updateDebounceTimer");
    M(this, "updateInMouseUp", !1);
    M(this, "shouldShow", ({
      view: e,
      state: n,
      from: r,
      to: i
    }) => {
      const { doc: o, selection: a } = n, { empty: s } = a, l = !o.textBetween(r, i).length && au(n.selection), c = this.element.contains(document.activeElement);
      return !(!(e.hasFocus() || c) || s || l || !this.editor.isEditable);
    });
    M(this, "mousedownHandler", () => {
      this.preventHide = !0;
    });
    M(this, "mouseupHandler", () => {
      setTimeout(() => {
        const { view: e } = this.editor, { state: n } = e, r = n.selection.from !== n.selection.to;
        if (this.updateDelay > 0 && r) {
          this.handleDebouncedUpdate(e);
          return;
        }
        this.updateHandler(e, !0, !0);
      });
    });
    M(this, "dragstartHandler", () => {
      this.hide();
    });
    M(this, "focusHandler", () => {
      setTimeout(() => this.update(this.editor.view));
    });
    M(this, "blurHandler", ({ event: e }) => {
      var n;
      if (this.preventHide) {
        this.preventHide = !1;
        return;
      }
      e != null && e.relatedTarget && ((n = this.element.parentNode) != null && n.contains(e.relatedTarget)) || this.hide();
    });
    M(this, "tippyBlurHandler", (e) => {
      this.blurHandler({ event: e });
    });
    M(this, "handleDebouncedUpdate", (e, n) => {
      const r = !(n != null && n.selection.eq(e.state.selection)), i = !(n != null && n.doc.eq(e.state.doc));
      !r && !i || (this.updateDebounceTimer && clearTimeout(this.updateDebounceTimer), this.updateDebounceTimer = window.setTimeout(() => {
        this.updateHandler(e, r, i, n);
      }, this.updateDelay));
    });
    M(this, "updateHandler", (e, n, r, i) => {
      var _, m, f;
      const { state: o, composing: a } = e, { selection: s } = o;
      if (a || !n && !r)
        return;
      this.createTooltip();
      const { ranges: c } = s, u = Math.min(...c.map((g) => g.$from.pos)), d = Math.max(...c.map((g) => g.$to.pos));
      if (!((_ = this.shouldShow) == null ? void 0 : _.call(this, {
        editor: this.editor,
        view: e,
        state: o,
        oldState: i,
        from: u,
        to: d
      }))) {
        this.hide();
        return;
      }
      (f = this.tippy) == null || f.setProps({
        getReferenceClientRect: ((m = this.tippyOptions) == null ? void 0 : m.getReferenceClientRect) || (() => {
          if (eg(o.selection)) {
            let g = e.nodeDOM(u);
            const S = g.dataset.nodeViewWrapper ? g : g.querySelector("[data-node-view-wrapper]");
            if (S && (g = S.firstChild), g)
              return g.getBoundingClientRect();
          }
          return Xi(e, u, d);
        })
      }), this.show();
    });
    this.editor = e, this.element = n, this.view = r, this.updateDelay = o, this.updateInMouseUp = a, s && (this.shouldShow = s), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.updateInMouseUp && this.view.dom.addEventListener("mouseup", this.mouseupHandler), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.tippyOptions = i, this.element.remove(), this.element.style.visibility = "visible";
  }
  createTooltip() {
    const { element: e } = this.editor.options, n = !!e.parentElement;
    this.tippy || !n || (this.tippy = Me(e, {
      duration: 0,
      getReferenceClientRect: null,
      content: this.element,
      interactive: !0,
      trigger: "manual",
      placement: "top",
      hideOnClick: "toggle",
      ...this.tippyOptions
    }), this.tippy.popper.firstChild && this.tippy.popper.firstChild.addEventListener("blur", this.tippyBlurHandler));
  }
  update(e, n) {
    var s;
    const { state: r } = e;
    if (this.updateInMouseUp) {
      if (r.selection.empty) {
        this.hide();
        return;
      }
      const { from: l, to: c, head: u } = r.selection, d = l == 1 && c == r.doc.content.size - 1, p = u == 1, _ = u == r.doc.content.size - 1;
      if (!d && !p && !_) {
        const m = !(n != null && n.selection.eq(e.state.selection));
        (s = this.tippy) != null && s.state.isVisible && m && this.hide();
        return;
      }
    }
    const i = r.selection.from !== r.selection.to;
    if (this.updateDelay > 0 && i) {
      this.handleDebouncedUpdate(e, n);
      return;
    }
    const o = !(n != null && n.selection.eq(e.state.selection)), a = !(n != null && n.doc.eq(e.state.doc));
    this.updateHandler(e, o, a, n);
  }
  show() {
    var e;
    (e = this.tippy) == null || e.show();
  }
  hide() {
    var e;
    (e = this.tippy) == null || e.hide();
  }
  destroy() {
    var e, n;
    (e = this.tippy) != null && e.popper.firstChild && this.tippy.popper.firstChild.removeEventListener(
      "blur",
      this.tippyBlurHandler
    ), (n = this.tippy) == null || n.destroy(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.updateInMouseUp && this.view.dom.removeEventListener("mouseup", this.mouseupHandler), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler);
  }
}
const J2 = (t) => new Te({
  key: typeof t.pluginKey == "string" ? new Oe(t.pluginKey) : t.pluginKey,
  view: (e) => new j2({ view: e, ...t })
});
class Bs extends HTMLElement {
  constructor() {
    super();
    M(this, "editor");
    M(this, "items", []);
    M(this, "tippyInstance");
    M(this, "activeOnClick", !0);
  }
  isActive(n) {
    var r;
    return n.isActive ? n.isActive(this.editor.linwitDocEditor) : (r = this.editor) == null ? void 0 : r.isActive(n.id);
  }
  refreshActive() {
    for (let n of this.items) {
      const r = this.querySelector(`#${n.id}`);
      r && (this.isActive(n) ? r.classList.add("active") : r.classList.remove("active"));
    }
  }
  connectedCallback() {
    var n;
    this.innerHTML = `
            <div class="linwiteditor-bubble-menu">
               ${this.items.map((r) => `<div class="linwiteditor-bubble-menu-item ${this.isActive(r) ? "active" : ""}" id="${r.id}">${r.icon}</div>`).join("")}
            </div>
        `;
    for (let r of this.items)
      r.holder = (n = r.onInit) == null ? void 0 : n.call(r, this.editor.linwitDocEditor, this.tippyInstance, this);
    this.querySelector("div").addEventListener("click", (r) => {
      this.items.forEach((i) => {
        const o = r.target.closest(`#${i.id}`);
        o && (this.onItemClick(i), this.activeOnClick && (o.classList.contains("active") ? o.classList.remove("active") : o.classList.add("active")));
      });
    }), this.querySelectorAll(".linwiteditor-bubble-menu-item").forEach((r, i) => {
      const o = this.items[i].title;
      o && Me(r, {
        appendTo: this.closest(".linwiteditor-container"),
        content: te(o),
        theme: "aietip",
        arrow: !0
        // trigger:"click",
        // interactive:true,
      });
    });
  }
  set instance(n) {
    this.tippyInstance = n;
  }
  initItemsByOptions(n, r) {
    if (r && r.length > 0)
      for (let i of r) {
        const o = typeof i == "string" ? n.getItem(i) : i;
        o && this.items.push(o);
      }
    else
      this.items = n.getAllItem();
  }
  onCreate(n, r) {
    this.editor = n.editor;
  }
  onItemClick(n) {
    var r;
    (r = n.onClick) == null || r.call(n, this.editor.linwitDocEditor, this.tippyInstance, this, n.holder);
  }
  onTransaction(n) {
  }
  // @ts-ignore
  onEditableChange(n) {
  }
}
const eL = {
  id: "edit",
  title: "edit-link",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.41421 15.89L16.5563 5.74786L15.1421 4.33365L5 14.4758V15.89H6.41421ZM7.24264 17.89H3V13.6474L14.435 2.21233C14.8256 1.8218 15.4587 1.8218 15.8492 2.21233L18.6777 5.04075C19.0682 5.43128 19.0682 6.06444 18.6777 6.45497L7.24264 17.89ZM3 19.89H21V21.89H3V19.89Z"></path></svg>',
  onInit: (t, e, n) => {
    const r = new To();
    r.setContent(`
            <div style="width: 250px">${te("link-address")} </div>
             <div style="width: 250px">
             <input type="text" id="href" style="width: 250px">
            </div>
            
            <div style="margin-top: 10px">${te("link-open-type")}</div>
            <div>
            <select id="target" style="width: 250px">
                <option value="">${te("default")}</option>
                <option value="_blank">${te("link-open-blank")}</option>
            </select>
            </div>
        `), r.onConfirmClick((i) => {
      const o = i.popper.querySelector("#href").value;
      if (o.trim() === "") {
        t.innerEditor.chain().focus().extendMarkRange("link").unsetLink().run();
        return;
      }
      let a = i.popper.querySelector("#target").value;
      a.trim() === "" && (a = null), t.innerEditor.chain().focus().extendMarkRange("link").setLink({
        href: o,
        target: a,
        rel: null
      }).run();
    }), r.onShow((i) => {
      const o = t.innerEditor.getAttributes("link");
      o && o.href && (i.popper.querySelector("#href").value = o.href), o && o.target && (i.popper.querySelector("#target").value = o.target);
    }), r.setTrigger(n.querySelector("#edit"), "right");
  }
}, tL = {
  id: "unlink",
  title: "unlink",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 17H22V19H19V22H17V17ZM7 7H2V5H5V2H7V7ZM18.364 15.5355L16.9497 14.1213L18.364 12.7071C20.3166 10.7545 20.3166 7.58866 18.364 5.63604C16.4113 3.68342 13.2455 3.68342 11.2929 5.63604L9.87868 7.05025L8.46447 5.63604L9.87868 4.22183C12.6123 1.48816 17.0445 1.48816 19.7782 4.22183C22.5118 6.9555 22.5118 11.3877 19.7782 14.1213L18.364 15.5355ZM15.5355 18.364L14.1213 19.7782C11.3877 22.5118 6.9555 22.5118 4.22183 19.7782C1.48816 17.0445 1.48816 12.6123 4.22183 9.87868L5.63604 8.46447L7.05025 9.87868L5.63604 11.2929C3.68342 13.2455 3.68342 16.4113 5.63604 18.364C7.58866 20.3166 10.7545 20.3166 12.7071 18.364L14.1213 16.9497L15.5355 18.364ZM14.8284 7.75736L16.2426 9.17157L9.17157 16.2426L7.75736 14.8284L14.8284 7.75736Z"></path></svg>',
  onClick: (t) => {
    t.innerEditor.chain().focus().unsetLink().run();
  }
}, nL = {
  id: "visit",
  title: "visit-link",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10 6V8H5V19H16V14H18V20C18 20.5523 17.5523 21 17 21H4C3.44772 21 3 20.5523 3 20V7C3 6.44772 3.44772 6 4 6H10ZM21 3V11H19L18.9999 6.413L11.2071 14.2071L9.79289 12.7929L17.5849 5H13V3H21Z"></path></svg>',
  onClick: (t) => {
    window.open(t.innerEditor.getAttributes("link").href, "_blank");
  }
};
class Uu {
  constructor(e) {
    M(this, "record", {});
    for (let n of e)
      this.push(n);
  }
  push(e) {
    this.record[e.id.toLowerCase()] = e;
  }
  getItem(e) {
    return this.record[e.toLowerCase()];
  }
  getAllItem() {
    return Object.values(this.record);
  }
}
const rL = new Uu(
  [eL, tL, nL]
);
class iL extends Bs {
  constructor() {
    super();
  }
  onCreate(e, n) {
    var r;
    super.onCreate(e, n), this.initItemsByOptions(rL, (r = n == null ? void 0 : n.link) == null ? void 0 : r.bubbleMenuItems), this.activeOnClick = !1;
  }
}
const oL = {
  id: "AlignLeft",
  title: "align-left",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z"></path></svg>',
  onClick: (t) => {
    const e = t.innerEditor.getAttributes("image");
    e.align = "left", t.innerEditor.chain().setImage(e).run();
  }
}, aL = {
  id: "AlignCenter",
  title: "align-center",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z"></path></svg>',
  onClick: ({ innerEditor: t }) => {
    const e = t.getAttributes("image");
    e.align = "center", t.chain().setImage(e).run();
  }
}, sL = {
  id: "AlignRight",
  title: "align-right",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM7 19H21V21H7V19ZM3 14H21V16H3V14ZM7 9H21V11H7V9Z"></path></svg>',
  onClick: ({ innerEditor: t }) => {
    const e = t.getAttributes("image");
    e.align = "right", t.chain().setImage(e).run();
  }
}, lL = {
  id: "delete",
  title: "delete",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 4V2H17V4H22V6H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V6H2V4H7ZM6 6V20H18V6H6ZM9 9H11V17H9V9ZM13 9H15V17H13V9Z"></path></svg>',
  onClick: ({ innerEditor: t }) => {
    t.commands.deleteSelection();
  }
}, cL = {
  id: "imageLink",
  title: "link",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.6572 14.8282L16.2429 13.414L17.6572 11.9998C19.2193 10.4377 19.2193 7.90506 17.6572 6.34296C16.0951 4.78086 13.5624 4.78086 12.0003 6.34296L10.5861 7.75717L9.17188 6.34296L10.5861 4.92875C12.9292 2.5856 16.7282 2.5856 19.0714 4.92875C21.4145 7.27189 21.4145 11.0709 19.0714 13.414L17.6572 14.8282ZM14.8287 17.6567L13.4145 19.0709C11.0714 21.414 7.27238 21.414 4.92923 19.0709C2.58609 16.7277 2.58609 12.9287 4.92923 10.5856L6.34345 9.17139L7.75766 10.5856L6.34345 11.9998C4.78135 13.5619 4.78135 16.0946 6.34345 17.6567C7.90555 19.2188 10.4382 19.2188 12.0003 17.6567L13.4145 16.2425L14.8287 17.6567ZM14.8287 7.75717L16.2429 9.17139L9.17188 16.2425L7.75766 14.8282L14.8287 7.75717Z"></path></svg>',
  isActive: (t) => {
    const e = t == null ? void 0 : t.getAttributes("image");
    return !!(e && e.href);
  },
  onInit: ({ innerEditor: t }, e, n) => {
    const r = new To();
    r.setContent(`
            <div style="width: 250px">${te("link-address")}</div>
             <div style="width: 250px">
             <input type="text" id="href" style="width: 250px">
            </div>
            
            <div style="margin-top: 10px">${te("link-open-type")}</div>
            <div>
            <select id="target" style="width: 250px">
               <option value="">${te("default")}</option>
               <option value="_blank">${te("link-open-blank")}</option>
            </select>
            </div>
        `), r.cancelText = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 17H22V19H19V22H17V17ZM7 7H2V5H5V2H7V7ZM18.364 15.5355L16.9497 14.1213L18.364 12.7071C20.3166 10.7545 20.3166 7.58866 18.364 5.63604C16.4113 3.68342 13.2455 3.68342 11.2929 5.63604L9.87868 7.05025L8.46447 5.63604L9.87868 4.22183C12.6123 1.48816 17.0445 1.48816 19.7782 4.22183C22.5118 6.9555 22.5118 11.3877 19.7782 14.1213L18.364 15.5355ZM15.5355 18.364L14.1213 19.7782C11.3877 22.5118 6.9555 22.5118 4.22183 19.7782C1.48816 17.0445 1.48816 12.6123 4.22183 9.87868L5.63604 8.46447L7.05025 9.87868L5.63604 11.2929C3.68342 13.2455 3.68342 16.4113 5.63604 18.364C7.58866 20.3166 10.7545 20.3166 12.7071 18.364L14.1213 16.9497L15.5355 18.364ZM14.8284 7.75736L16.2426 9.17157L9.17157 16.2426L7.75736 14.8284L14.8284 7.75736Z"></path></svg>
${te("unlink")}`, r.onCancelClick(() => {
      t.chain().updateAttributes("image", {
        href: null,
        target: null
      }).run();
    }), r.onConfirmClick((i) => {
      const o = i.popper.querySelector("#href").value;
      if (o.trim() === "") {
        t.chain().updateAttributes("image", {
          href: null
        }).run();
        return;
      }
      let a = i.popper.querySelector("#target").value;
      a.trim() === "" && (a = null), t.chain().updateAttributes("image", {
        href: o,
        target: a
      }).run();
    }), r.onShow((i) => {
      const o = t == null ? void 0 : t.getAttributes("image");
      o && o.href ? i.popper.querySelector("#href").value = o.href : i.popper.querySelector("#href").value = "", o && o.target ? i.popper.querySelector("#target").value = o.target : i.popper.querySelector("#target").value = "";
    }), r.setTrigger(n.querySelector("#imageLink"), "bottom");
  }
}, uL = {
  id: "imageProperty",
  title: "image-property",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 3C20.5523 3 21 3.44772 21 4V5.757L19 7.757V5H5V13.1L9 9.1005L13.328 13.429L11.9132 14.8422L9 11.9289L5 15.928V19H15.533L16.2414 19.0012L17.57 17.671L18.8995 19H19V16.242L21 14.242V20C21 20.5523 20.5523 21 20 21H4C3.45 21 3 20.55 3 20V4C3 3.44772 3.44772 3 4 3H20ZM21.7782 7.80761L23.1924 9.22183L15.4142 17L13.9979 16.9979L14 15.5858L21.7782 7.80761ZM15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7Z"></path></svg>',
  onInit: ({ innerEditor: t }, e, n) => {
    const r = new To();
    r.setContent(`
            <div style="width: 250px">Alt</div>
            <div style="width: 250px">
             <input type="text" id="alt" style="width: 250px">
            </div>
            
            <div style="width: 250px;margin-top: 10px">Title</div>
            <div style="width: 250px">
             <input type="text" id="title" style="width: 250px">
            </div>
            
            <div style="margin-top: 10px">${te("image-size")}</div>
            <div>
            <select id="width" style="width: 250px">
               <option value="">${te("image-keep-current")}</option>
               <option value="auto">${te("image-original-size")}</option>
               <option value="30%">30%</option>
               <option value="50%">50%</option>
               <option value="75%">75%</option>
               <option value="100%">100%</option>
            </select>
            </div>
        `), r.onConfirmClick((i) => {
      const o = i.popper.querySelector("#alt").value, a = i.popper.querySelector("#title").value;
      t.chain().updateAttributes("image", {
        alt: o,
        title: a
      }).run();
      let s = i.popper.querySelector("#width").value;
      s && t.chain().updateAttributes("image", {
        width: s
      }).run();
    }), r.onShow((i) => {
      const o = t == null ? void 0 : t.getAttributes("image");
      o && (i.popper.querySelector("#alt").value = o.alt || "", i.popper.querySelector("#title").value = o.title || "");
    }), r.setTrigger(n.querySelector("#imageProperty"), "bottom");
  }
}, dL = new Uu(
  [oL, aL, sL, cL, uL, lL]
);
class pL extends Bs {
  constructor() {
    super();
  }
  onCreate(e, n) {
    var r;
    super.onCreate(e, n), this.initItemsByOptions(dL, (r = n == null ? void 0 : n.image) == null ? void 0 : r.bubbleMenuItems), this.activeOnClick = !1;
  }
  onTransaction(e) {
    e.editor.isActive("image") && this.refreshActive();
  }
}
class _L extends Bs {
  constructor() {
    super(), this.items = [
      {
        id: "insert-column-left",
        title: "insert-column-left",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H14C13.4477 21 13 20.5523 13 20V4C13 3.44772 13.4477 3 14 3H20ZM19 5H15V19H19V5ZM6 7C8.76142 7 11 9.23858 11 12C11 14.7614 8.76142 17 6 17C3.23858 17 1 14.7614 1 12C1 9.23858 3.23858 7 6 7ZM7 9H5V10.999L3 11V13L5 12.999V15H7V12.999L9 13V11L7 10.999V9Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().addColumnBefore().run();
        }
      },
      {
        id: "insert-column-right",
        title: "insert-column-right",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M10 3C10.5523 3 11 3.44772 11 4V20C11 20.5523 10.5523 21 10 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H10ZM9 5H5V19H9V5ZM18 7C20.7614 7 23 9.23858 23 12C23 14.7614 20.7614 17 18 17C15.2386 17 13 14.7614 13 12C13 9.23858 15.2386 7 18 7ZM19 9H17V10.999L15 11V13L17 12.999V15H19V12.999L21 13V11L19 10.999V9Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().addColumnAfter().run();
        }
      },
      {
        id: "insert-row-top",
        title: "insert-row-top",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M20 13C20.5523 13 21 13.4477 21 14V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V14C3 13.4477 3.44772 13 4 13H20ZM19 15H5V19H19V15ZM12 1C14.7614 1 17 3.23858 17 6C17 8.76142 14.7614 11 12 11C9.23858 11 7 8.76142 7 6C7 3.23858 9.23858 1 12 1ZM13 3H11V4.999L9 5V7L11 6.999V9H13V6.999L15 7V5L13 4.999V3Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().addRowBefore().run();
        }
      },
      {
        id: "insert-row-bottom",
        title: "insert-row-bottom",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 13C14.7614 13 17 15.2386 17 18C17 20.7614 14.7614 23 12 23C9.23858 23 7 20.7614 7 18C7 15.2386 9.23858 13 12 13ZM13 15H11V16.999L9 17V19L11 18.999V21H13V18.999L15 19V17L13 16.999V15ZM20 3C20.5523 3 21 3.44772 21 4V10C21 10.5523 20.5523 11 20 11H4C3.44772 11 3 10.5523 3 10V4C3 3.44772 3.44772 3 4 3H20ZM5 5V9H19V5H5Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().addRowAfter().run();
        }
      },
      {
        id: "delete-column",
        title: "delete-column",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 3C12.5523 3 13 3.44772 13 4L12.9998 11.9998C13.8355 11.372 14.8743 11 16 11C18.7614 11 21 13.2386 21 16C21 18.7614 18.7614 21 16 21C14.9681 21 14.0092 20.6874 13.2129 20.1518L13 20C13 20.5523 12.5523 21 12 21H6C5.44772 21 5 20.5523 5 20V4C5 3.44772 5.44772 3 6 3H12ZM11 5H7V19H11V5ZM19 15H13V17H19V15Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().deleteColumn().run();
        }
      },
      {
        id: "delete-row",
        title: "delete-row",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M20 5C20.5523 5 21 5.44772 21 6V12C21 12.5523 20.5523 13 20 13C20.628 13.8355 21 14.8743 21 16C21 18.7614 18.7614 21 16 21C13.2386 21 11 18.7614 11 16C11 14.8743 11.372 13.8355 11.9998 12.9998L4 13C3.44772 13 3 12.5523 3 12V6C3 5.44772 3.44772 5 4 5H20ZM13 15V17H19V15H13ZM19 7H5V11H19V7Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().deleteRow().run();
        }
      },
      {
        id: "merge-cells-horizontal",
        title: "merge-cells-horizontal",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V10.999H7V9L10 12L7 15V13H5V19H11V17H13V19H19V13H17V15L14 12L17 9V10.999H19V5H13V7H11V5ZM13 13V15H11V13H13ZM13 9V11H11V9H13Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().mergeCells().run();
        }
      },
      {
        id: "merge-cells-vertical",
        title: "merge-cells-vertical",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M21 20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20C20.5523 3 21 3.44772 21 4V20ZM19 11V5H13.001V7H15L12 10L9 7H11V5H5V11H7V13H5V19H11V17H9L12 14L15 17H13.001V19H19V13H17V11H19ZM11 13H9V11H11V13ZM15 13H13V11H15V13Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().mergeCells().run();
        }
      },
      {
        id: "split-cells-horizontal",
        title: "split-cells-horizontal",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM11 5H5V19H11V15H13V19H19V5H13V9H11V5ZM15 9L18 12L15 15V13H9V15L6 12L9 9V11H15V9Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().splitCell().run();
        }
      },
      {
        id: "split-cells-vertical",
        title: "split-cells-vertical",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M20 3C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3H20ZM19 5H5V10.999L9 11V13H5V19H19V13H15V11L19 10.999V5ZM12 6L15 9H13V15H15L12 18L9 15H11V9H9L12 6Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().splitCell().run();
        }
      },
      {
        id: "delete",
        title: "delete-table",
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 4V2H17V4H22V6H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V6H2V4H7ZM6 6V20H18V6H6ZM9 9H11V17H9V9ZM13 9H15V17H13V9Z"></path></svg>',
        onClick: ({ innerEditor: e }) => {
          e == null || e.chain().focus().deleteTable().run();
        }
      }
    ];
  }
  onCreate(e, n) {
    super.onCreate(e, n), this.activeOnClick = !1;
  }
  connectedCallback() {
    super.connectedCallback(), this.checkSelectionAndShow(this.editor);
  }
  onTransaction(e) {
    this.checkSelectionAndShow(e.editor);
  }
  checkSelectionAndShow(e) {
    const { state: { selection: n }, view: r } = e;
    if (n instanceof ve)
      if (this.isAllTableSelected(n))
        this.showItems(["delete"]);
      else if (this.isOneCellSelected(n)) {
        const i = ["insert-column-left", "insert-column-right", "delete-column", "insert-row-top", "insert-row-bottom", "delete-row"];
        if (e.can().splitCell()) {
          const o = r.nodeDOM(n.$anchorCell.pos), a = o.getAttribute("colspan"), s = o.getAttribute("rowspan");
          a && Number(a) > 1 ? i.push("split-cells-horizontal") : s && Number(s) > 1 && i.push("split-cells-vertical");
        }
        this.showItems(i);
      } else this.isColumnSelected(n, r) ? this.showItems(["insert-column-left", "insert-column-right", "delete-column", "merge-cells-vertical"]) : this.isRowSelected(n, r) ? this.showItems(["insert-row-top", "insert-row-bottom", "delete-row", "merge-cells-horizontal"]) : this.showItems(["merge-cells-horizontal"]);
    else
      this.showItems(["insert-column-left", "insert-column-right", "delete-column", "insert-row-top", "insert-row-bottom", "delete-row"]);
  }
  showItems(e) {
    this.querySelectorAll(".linwiteditor-bubble-menu-item").forEach((n) => {
      n.style.display = "none";
    }), e.forEach((n) => {
      const r = this.querySelector(`#${n}`);
      r && (r.style.display = "");
    });
  }
  isAllTableSelected(e) {
    const n = we.get(e.$anchorCell.node(-1)), r = n.cellsInRect({
      top: 0,
      left: 0,
      right: n.width,
      bottom: n.height
    });
    return e.ranges.length == r.length;
  }
  isOneCellSelected(e) {
    return e.ranges.length == 1;
  }
  isColumnSelected(e, n) {
    let r = -1;
    for (let i of e.ranges)
      if (r == -1)
        r = n.coordsAtPos(i.$from.pos).left;
      else if (r != n.coordsAtPos(i.$from.pos).left)
        return !1;
    return !0;
  }
  isRowSelected(e, n) {
    let r = -1;
    for (let i of e.ranges)
      if (r == -1)
        r = n.coordsAtPos(i.$from.pos).bottom;
      else if (r != n.coordsAtPos(i.$from.pos).bottom)
        return !1;
    return !0;
  }
}
const ss = {
  check: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M10.0007 15.1709L19.1931 5.97852L20.6073 7.39273L10.0007 17.9993L3.63672 11.6354L5.05093 10.2212L10.0007 15.1709Z"></path></svg>',
  refresh: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5.46257 4.43262C7.21556 2.91688 9.5007 2 12 2C17.5228 2 22 6.47715 22 12C22 14.1361 21.3302 16.1158 20.1892 17.7406L17 12H20C20 7.58172 16.4183 4 12 4C9.84982 4 7.89777 4.84827 6.46023 6.22842L5.46257 4.43262ZM18.5374 19.5674C16.7844 21.0831 14.4993 22 12 22C6.47715 22 2 17.5228 2 12C2 9.86386 2.66979 7.88416 3.8108 6.25944L7 12H4C4 16.4183 7.58172 20 12 20C14.1502 20 16.1022 19.1517 17.5398 17.7716L18.5374 19.5674Z" fill="currentColor"></path></svg>',
  aiPanelStart: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.1716 10.9999L10.8076 5.63589L12.2218 4.22168L20 11.9999L12.2218 19.778L10.8076 18.3638L16.1716 12.9999H4V10.9999H16.1716Z"></path></svg>',
  aiPanelStop: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 7V17C6 17.5523 6.44772 18 7 18H17C17.5523 18 18 17.5523 18 17V7C18 6.44772 17.5523 6 17 6H7C6.44772 6 6 6.44772 6 7Z"></path></svg>'
};
class Qh {
  constructor(e, n) {
    M(this, "delay");
    M(this, "appending", !1);
    M(this, "isFinished", !1);
    M(this, "textarea");
    M(this, "textQueue", []);
    this.delay = e, this.textarea = n;
  }
  appendText(e) {
    this.textQueue.push(e), this.processQueue();
  }
  finished() {
    this.isFinished = !0;
  }
  processQueue() {
    if (this.appending || this.textQueue.length === 0)
      return;
    if (this.isFinished) {
      this.textarea.value += this.textQueue.join(""), this.textarea.style.height = `${this.textarea.scrollHeight}px`, this.textarea.scrollTop = this.textarea.scrollHeight;
      return;
    }
    const e = this.textQueue.shift();
    this.appending = !0;
    let n = 0;
    const r = setInterval(() => {
      n < e.length ? (this.textarea.value += e[n], this.textarea.style.height = `${this.textarea.scrollHeight}px`, this.textarea.scrollTop = this.textarea.scrollHeight, n++) : (clearInterval(r), this.appending = !1, this.processQueue());
    }, this.delay);
  }
}
const Zh = (t) => {
  const { view: e, state: n } = t, { head: r, from: i, to: o } = n.selection;
  if (i == 1 && o == n.doc.content.size - 1) {
    const a = Xi(e, i, o), l = e.dom.closest(".linwiteditor-container").getBoundingClientRect(), c = a.bottom > l.bottom ? l.bottom : a.bottom;
    let u = a.height > l.height ? l.height / 2 : a.height;
    const d = a.top < l.top ? l.top : a.top;
    let p = a.left;
    if (a.width == 0) {
      const _ = e.dom.getBoundingClientRect();
      p = _.left + _.right / 2, u -= 50;
    }
    return {
      ...a,
      top: d,
      left: p,
      height: u,
      bottom: c
    };
  } else {
    const a = Xi(e, r, r);
    return {
      ...a,
      height: a.height - 10
    };
  }
}, mL = [
  {
    prompt: `<content>{content}</content>
请帮我优化一下这段内容，并直接返回优化后的结果。
注意：你应该先判断一下这句话是中文还是英文，如果是中文，请给我返回中文的内容，如果是英文，请给我返回英文内容，只需要返回内容即可，不需要告知我是中文还是英文。`,
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M15.1986 9.94447C14.7649 9.5337 14.4859 8.98613 14.4085 8.39384L14.0056 5.31138L11.275 6.79724C10.7503 7.08274 10.1433 7.17888 9.55608 7.06948L6.49998 6.50015L7.06931 9.55625C7.17871 10.1435 7.08257 10.7505 6.79707 11.2751L5.31121 14.0057L8.39367 14.4086C8.98596 14.4861 9.53353 14.7651 9.94431 15.1987L12.0821 17.4557L13.4178 14.6486C13.6745 14.1092 14.109 13.6747 14.6484 13.418L17.4555 12.0823L15.1986 9.94447ZM15.2238 15.5079L13.0111 20.1581C12.8687 20.4573 12.5107 20.5844 12.2115 20.442C12.1448 20.4103 12.0845 20.3665 12.0337 20.3129L8.49229 16.5741C8.39749 16.474 8.27113 16.4096 8.13445 16.3918L3.02816 15.7243C2.69958 15.6814 2.46804 15.3802 2.51099 15.0516C2.52056 14.9784 2.54359 14.9075 2.5789 14.8426L5.04031 10.3192C5.1062 10.1981 5.12839 10.058 5.10314 9.92253L4.16 4.85991C4.09931 4.53414 4.3142 4.22086 4.63997 4.16017C4.7126 4.14664 4.78711 4.14664 4.85974 4.16017L9.92237 5.10331C10.0579 5.12855 10.198 5.10637 10.319 5.04048L14.8424 2.57907C15.1335 2.42068 15.4979 2.52825 15.6562 2.81931C15.6916 2.88421 15.7146 2.95507 15.7241 3.02833L16.3916 8.13462C16.4095 8.2713 16.4739 8.39766 16.5739 8.49245L20.3127 12.0338C20.5533 12.2617 20.5636 12.6415 20.3357 12.8821C20.2849 12.9357 20.2246 12.9795 20.1579 13.0112L15.5078 15.224C15.3833 15.2832 15.283 15.3835 15.2238 15.5079ZM16.0206 17.435L17.4348 16.0208L21.6775 20.2634L20.2633 21.6776L16.0206 17.435Z"></path></svg>',
    title: "improve-writing"
  },
  {
    prompt: `<content>{content}</content>
请帮我检查一下这段内容，是否有拼写错误或者语法上的错误。
注意：你应该先判断一下这句话是中文还是英文，如果是中文，请给我返回中文的内容，如果是英文，请给我返回英文内容，只需要返回内容即可，不需要告知我是中文还是英文。`,
    icon: ' <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 19C12.8284 19 13.5 19.6716 13.5 20.5C13.5 21.3284 12.8284 22 12 22C11.1716 22 10.5 21.3284 10.5 20.5C10.5 19.6716 11.1716 19 12 19ZM6.5 19C7.32843 19 8 19.6716 8 20.5C8 21.3284 7.32843 22 6.5 22C5.67157 22 5 21.3284 5 20.5C5 19.6716 5.67157 19 6.5 19ZM17.5 19C18.3284 19 19 19.6716 19 20.5C19 21.3284 18.3284 22 17.5 22C16.6716 22 16 21.3284 16 20.5C16 19.6716 16.6716 19 17.5 19ZM13 2V4H19V6L17.0322 6.0006C16.2423 8.3666 14.9984 10.5065 13.4107 12.302C14.9544 13.6737 16.7616 14.7204 18.7379 15.3443L18.2017 17.2736C15.8917 16.5557 13.787 15.3326 12.0005 13.7257C10.214 15.332 8.10914 16.5553 5.79891 17.2734L5.26257 15.3442C7.2385 14.7203 9.04543 13.6737 10.5904 12.3021C9.46307 11.0285 8.50916 9.58052 7.76789 8.00128L10.0074 8.00137C10.5706 9.03952 11.2401 10.0037 11.9998 10.8772C13.2283 9.46508 14.2205 7.81616 14.9095 6.00101L5 6V4H11V2H13Z"></path></svg>',
    title: "check-spelling-and-grammar"
  },
  {
    prompt: `<content>{content}</content>
这句话的内容较长，帮我简化一下这个内容，并直接返回简化后的内容结果。
注意：你应该先判断一下这句话是中文还是英文，如果是中文，请给我返回中文的内容，如果是英文，请给我返回英文内容，只需要返回内容即可，不需要告知我是中文还是英文。`,
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M21 6.75736L19 8.75736V4H10V9H5V20H19V17.2426L21 15.2426V21.0082C21 21.556 20.5551 22 20.0066 22H3.9934C3.44476 22 3 21.5501 3 20.9932V8L9.00319 2H19.9978C20.5513 2 21 2.45531 21 2.9918V6.75736ZM21.7782 8.80761L23.1924 10.2218L15.4142 18L13.9979 17.9979L14 16.5858L21.7782 8.80761Z"></path></svg>',
    title: "make-shorter"
  },
  {
    prompt: `<content>{content}</content>
这句话的内容较简短，帮我简单的优化和丰富一下内容，并直接返回优化后的结果。注意：优化的内容不能超过原来内容的 2 倍。
注意：你应该先判断一下这句话是中文还是英文，如果是中文，请给我返回中文的内容，如果是英文，请给我返回英文内容，只需要返回内容即可，不需要告知我是中文还是英文。`,
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M20 2C20.5523 2 21 2.44772 21 3V6.757L19 8.757V4H5V20H19V17.242L21 15.242V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V3C3 2.44772 3.44772 2 4 2H20ZM21.7782 8.80761L23.1924 10.2218L15.4142 18L13.9979 17.9979L14 16.5858L21.7782 8.80761ZM13 12V14H8V12H13ZM16 8V10H8V8H16Z"></path></svg>',
    title: "make-longer"
  },
  "<hr/>",
  {
    prompt: `<content>{content}</content>
请帮我翻译以上内容，在翻译之前，想先判断一下这个内容是不是中文，如果是中文，则翻译为英文，如果是其他语言，则需要翻译为中文，注意，你只需要返回翻译的结果，不需要对此进行任何解释，不需要除了翻译结果以外的其他任何内容。`,
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 15V17C5 18.0544 5.81588 18.9182 6.85074 18.9945L7 19H10V21H7C4.79086 21 3 19.2091 3 17V15H5ZM18 10L22.4 21H20.245L19.044 18H14.954L13.755 21H11.601L16 10H18ZM17 12.8852L15.753 16H18.245L17 12.8852ZM8 2V4H12V11H8V14H6V11H2V4H6V2H8ZM17 3C19.2091 3 21 4.79086 21 7V9H19V7C19 5.89543 18.1046 5 17 5H14V3H17ZM6 6H4V9H6V6ZM10 6H8V9H10V6Z"></path></svg>',
    title: "translate"
  },
  {
    prompt: `<content>{content}</content>
请帮我总结以上内容，并直接返回总结的结果
注意：你应该先判断一下这句话是中文还是英文，如果是中文，请给我返回中文的内容，如果是英文，请给我返回英文内容，只需要返回内容即可，不需要告知我是中文还是英文。`,
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M18 3C19.6569 3 21 4.34315 21 6C21 7.65685 19.6569 9 18 9H15C13.6941 9 12.5831 8.16562 12.171 7.0009L11 7C9.9 7 9 7.9 9 9L9.0009 9.17102C10.1656 9.58312 11 10.6941 11 12C11 13.3059 10.1656 14.4169 9.0009 14.829L9 15C9 16.1 9.9 17 11 17L12.1707 17.0001C12.5825 15.8349 13.6937 15 15 15H18C19.6569 15 21 16.3431 21 18C21 19.6569 19.6569 21 18 21H15C13.6941 21 12.5831 20.1656 12.171 19.0009L11 19C8.79 19 7 17.21 7 15H5C3.34315 15 2 13.6569 2 12C2 10.3431 3.34315 9 5 9H7C7 6.79086 8.79086 5 11 5L12.1707 5.00009C12.5825 3.83485 13.6937 3 15 3H18ZM18 17H15C14.4477 17 14 17.4477 14 18C14 18.5523 14.4477 19 15 19H18C18.5523 19 19 18.5523 19 18C19 17.4477 18.5523 17 18 17ZM8 11H5C4.44772 11 4 11.4477 4 12C4 12.5523 4.44772 13 5 13H8C8.55228 13 9 12.5523 9 12C9 11.4477 8.55228 11 8 11ZM18 5H15C14.4477 5 14 5.44772 14 6C14 6.55228 14.4477 7 15 7H18C18.5523 7 19 6.55228 19 6C19 5.44772 18.5523 5 18 5Z"></path></svg>',
    title: "summarize"
  }
], em = (t, e, n) => {
  var r, i;
  if (t.aiClient)
    t.aiClient.stop();
  else {
    const o = e.querySelector("textarea");
    o.value = "";
    const { selection: a, doc: s } = t.editor.state, l = s.textBetween(a.from, a.to), c = t.editor.linwitDocEditor.options, u = zn.get((r = c.ai) == null ? void 0 : r.bubblePanelModel);
    if (u) {
      const d = new Qh(30, o);
      u.chat(l, n, {
        onStart(p) {
          t.aiClient = p, e.querySelector(".linwiteditor-ai-panel-actions").style.display = "none", e.querySelector(".loader").style.display = "block", e.querySelector(".linwiteditor-ai-panel-body-content").style.display = "block", e.querySelector("#go").innerHTML = ss.aiPanelStop;
        },
        onStop() {
          t.aiClient = void 0, e.querySelector("#go").innerHTML = ss.aiPanelStart, e.querySelector(".linwiteditor-ai-panel-footer").style.display = "block", e.querySelector(".loader").style.display = "none", e.querySelector(".linwiteditor-ai-panel-actions").style.display = "none", d.finished();
        },
        onMessage(p) {
          d.appendText(p.content);
        }
      });
    } else
      console.error('AI model name config error. can not get AI model by name: "' + ((i = c.ai) == null ? void 0 : i.bubblePanelModel) + '", please check config "options.ai.bubblePanelModel"');
  }
}, fL = (t, e) => {
  const n = document.createElement("div");
  return n.classList.add("linwiteditor-ai-panel"), n.innerHTML = `
        <div class="linwiteditor-ai-panel-body">
            <div class="linwiteditor-ai-panel-body-content" style="display: none"><div class="loader">${ss.refresh}</div><textarea readonly></textarea></div>
            <div class="linwiteditor-ai-panel-body-input"><input id="prompt" placeholder="${te("placeholder-tell-ai-what-to-do-next")}" type="text" />
            <button type="button" id="go" style="width: 30px;height: 30px">${ss.aiPanelStart}</button></div>
            <div class="linwiteditor-ai-panel-body-tips"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 17C9 17 16 18 19 21H20C20.5523 21 21 20.5523 21 20V13.937C21.8626 13.715 22.5 12.9319 22.5 12C22.5 11.0681 21.8626 10.285 21 10.063V4C21 3.44772 20.5523 3 20 3H19C16 6 9 7 9 7H5C3.89543 7 3 7.89543 3 9V15C3 16.1046 3.89543 17 5 17H6L7 22H9V17ZM11 8.6612C11.6833 8.5146 12.5275 8.31193 13.4393 8.04373C15.1175 7.55014 17.25 6.77262 19 5.57458V18.4254C17.25 17.2274 15.1175 16.4499 13.4393 15.9563C12.5275 15.6881 11.6833 15.4854 11 15.3388V8.6612ZM5 9H9V15H5V9Z" fill="currentColor"></path></svg>
            ${te("tip-you-can-enter-text-above-or-select-the-operation-below")}</div>
        </div>
        <div class="linwiteditor-ai-panel-footer" style="display: none">
        <div class="linwiteditor-ai-panel-footer-tips">${te("you-can-do-the-following")}</div>
        <p id="insert"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2 18H12V20H2V18ZM2 11H22V13H2V11ZM2 4H22V6H2V4ZM18 18V15H20V18H23V20H20V23H18V20H15V18H18Z" fill="currentColor"></path></svg> 
        ${te("ai-append")}</p>
        <p id="replace"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.071 4.92902L11.4852 6.34323L6.82834 11.0001L16.0002 11.0002L16.0002 13.0002L6.82839 13.0001L11.4852 17.6569L10.071 19.0712L2.99994 12.0001L10.071 4.92902ZM18.0001 19V5.00003H20.0001V19H18.0001Z" fill="currentColor"></path></svg> 
        ${te("ai-replace")}</p>
        <hr/>
        <p id="hide"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 4V6H15V4H9Z" fill="currentColor"></path></svg> 
        ${te("ai-cancel")}</p>
        </div>
        
        <!--linwiteditor-ai-panel-actions-->
        <div class="linwiteditor-ai-panel-footer linwiteditor-ai-panel-actions" >
        <div class="linwiteditor-ai-panel-footer-tips">${te("you-can-do-the-following")}</div>
        ${e.map((r) => typeof r == "string" ? r : `<p data-prompt="${r.prompt}">${r.icon} ${te(r.title)} </p>`).join("")}
        </div>
        `, n.querySelector("#replace").addEventListener("click", () => {
    var i, o, a;
    const r = n.querySelector("textarea");
    r.value && ((i = t.editor) == null || i.insertMarkdown(r.value), (o = t.aiPanelInstance) == null || o.hide(), (a = t.tippyInstance) == null || a.show());
  }), n.querySelector("#insert").addEventListener("click", () => {
    var i, o, a, s;
    const r = n.querySelector("textarea");
    if (r.value) {
      const { state: { selection: l, doc: c } } = t.editor;
      (i = t.editor) == null || i.commands.setTextSelection(K.create(c, l.to)), (o = t.editor) == null || o.insertMarkdown(r.value), (a = t.aiPanelInstance) == null || a.hide(), l.from != l.to && ((s = t.tippyInstance) == null || s.show());
    }
  }), n.querySelector("#hide").addEventListener("click", () => {
    var i, o;
    (i = t.aiPanelInstance) == null || i.hide();
    const { state: { selection: r } } = t.editor;
    r.from != r.to && ((o = t.tippyInstance) == null || o.show());
  }), n.querySelector("#go").addEventListener("click", () => {
    const r = n.querySelector("#prompt").value;
    em(t, n, r);
  }), n.querySelectorAll(".linwiteditor-ai-panel-actions p").forEach((r) => {
    const i = r.getAttribute("data-prompt");
    r.addEventListener("click", () => {
      em(t, n, i);
    });
  }), n.addEventListener("click", (r) => {
    var i, o;
    r.target === n && ((i = t.aiPanelInstance) == null || i.hide(), (o = t.tippyInstance) == null || o.show());
  }), n;
}, gL = {
  id: "ai",
  title: "ai",
  icon: `<div style="display: flex;height: 20px">
                      <div style="width: 18px;height: 18px;display: inline-block" >
                            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="rgba(100,205,138,1)"><path d="M13.5 2C13.5 2.44425 13.3069 2.84339 13 3.11805V5H18C19.6569 5 21 6.34315 21 8V18C21 19.6569 19.6569 21 18 21H6C4.34315 21 3 19.6569 3 18V8C3 6.34315 4.34315 5 6 5H11V3.11805C10.6931 2.84339 10.5 2.44425 10.5 2C10.5 1.17157 11.1716 0.5 12 0.5C12.8284 0.5 13.5 1.17157 13.5 2ZM6 7C5.44772 7 5 7.44772 5 8V18C5 18.5523 5.44772 19 6 19H18C18.5523 19 19 18.5523 19 18V8C19 7.44772 18.5523 7 18 7H13H11H6ZM2 10H0V16H2V10ZM22 10H24V16H22V10ZM9 14.5C9.82843 14.5 10.5 13.8284 10.5 13C10.5 12.1716 9.82843 11.5 9 11.5C8.17157 11.5 7.5 12.1716 7.5 13C7.5 13.8284 8.17157 14.5 9 14.5ZM15 14.5C15.8284 14.5 16.5 13.8284 16.5 13C16.5 12.1716 15.8284 11.5 15 11.5C14.1716 11.5 13.5 12.1716 13.5 13C13.5 13.8284 14.1716 14.5 15 14.5Z"></path></svg>
                      </div>
                     <div style="width: 18px;height: 18px;display: inline-block" >
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 14L8 10H16L12 14Z"></path></svg>
                     </div>
                 </div>
                `,
  onInit: ({ innerEditor: t }, e, n) => {
    var o;
    const r = { editor: t, tippyInstance: e }, i = ((o = t.linwitDocEditor.options.ai) == null ? void 0 : o.bubblePanelMenus) || mL;
    return r.aiPanelInstance = Me(n.querySelector("#ai"), {
      content: fL(r, i),
      appendTo: t.view.dom.closest(".linwiteditor-container"),
      trigger: "click",
      interactive: !0,
      arrow: !1,
      placement: "bottom",
      getReferenceClientRect: () => Zh(t),
      onShow: (a) => {
        window.setTimeout(() => {
          var s;
          return (s = a.popper.querySelector("#prompt")) == null ? void 0 : s.focus();
        }, 0);
      }
    }), r;
  },
  onClick: (t, e, n, r) => {
    var i;
    (i = r.tippyInstance) == null || i.hide();
  }
}, hL = {
  id: "bold",
  title: "bold",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 11H12.5C13.8807 11 15 9.88071 15 8.5C15 7.11929 13.8807 6 12.5 6H8V11ZM18 15.5C18 17.9853 15.9853 20 13.5 20H6V4H12.5C14.9853 4 17 6.01472 17 8.5C17 9.70431 16.5269 10.7981 15.7564 11.6058C17.0979 12.3847 18 13.837 18 15.5ZM8 13V18H13.5C14.8807 18 16 16.8807 16 15.5C16 14.1193 14.8807 13 13.5 13H8Z"></path></svg>',
  onClick: ({ innerEditor: t }) => {
    t.chain().toggleBold().run();
  }
}, EL = {
  id: "underline",
  title: "underline",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 3V12C8 14.2091 9.79086 16 12 16C14.2091 16 16 14.2091 16 12V3H18V12C18 15.3137 15.3137 18 12 18C8.68629 18 6 15.3137 6 12V3H8ZM4 20H20V22H4V20Z"></path></svg>',
  onClick: ({ innerEditor: t }) => {
    t.chain().toggleUnderline().run();
  }
}, SL = {
  id: "code",
  title: "code",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M23 11.9998L15.9289 19.0708L14.5147 17.6566L20.1716 11.9998L14.5147 6.34292L15.9289 4.92871L23 11.9998ZM3.82843 11.9998L9.48528 17.6566L8.07107 19.0708L1 11.9998L8.07107 4.92871L9.48528 6.34292L3.82843 11.9998Z"></path></svg>',
  onClick: ({ innerEditor: t }) => {
    t.chain().toggleCode().run();
  }
}, bL = {
  id: "strike",
  title: "strike",
  icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.1538 14C17.3846 14.5161 17.5 15.0893 17.5 15.7196C17.5 17.0625 16.9762 18.1116 15.9286 18.867C14.8809 19.6223 13.4335 20 11.5862 20C9.94674 20 8.32335 19.6185 6.71592 18.8555V16.6009C8.23538 17.4783 9.7908 17.917 11.3822 17.917C13.9333 17.917 15.2128 17.1846 15.2208 15.7196C15.2208 15.0939 15.0049 14.5598 14.5731 14.1173C14.5339 14.0772 14.4939 14.0381 14.4531 14H3V12H21V14H17.1538ZM13.076 11H7.62908C7.4566 10.8433 7.29616 10.6692 7.14776 10.4778C6.71592 9.92084 6.5 9.24559 6.5 8.45207C6.5 7.21602 6.96583 6.165 7.89749 5.299C8.82916 4.43299 10.2706 4 12.2219 4C13.6934 4 15.1009 4.32808 16.4444 4.98426V7.13591C15.2448 6.44921 13.9293 6.10587 12.4978 6.10587C10.0187 6.10587 8.77917 6.88793 8.77917 8.45207C8.77917 8.87172 8.99709 9.23796 9.43293 9.55079C9.86878 9.86362 10.4066 10.1135 11.0463 10.3004C11.6665 10.4816 12.3431 10.7148 13.076 11H13.076Z"></path></svg>',
  onClick: ({ innerEditor: t }) => {
    t.chain().toggleStrike().run();
  }
}, TL = {
  id: "italic",
  title: "italic",
  icon: ' <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 20H7V18H9.92661L12.0425 6H9V4H17V6H14.0734L11.9575 18H15V20Z"></path></svg>',
  onClick: ({ innerEditor: t }) => {
    t.chain().toggleItalic().run();
  }
}, CL = [
  { title: "英语" },
  { title: "中文" },
  { title: "日语" },
  { title: "法语" },
  { title: "德语" },
  { title: "葡萄牙语" },
  { title: "西班牙语" }
], yL = (t, e, n) => {
  var r, i, o, a;
  if (t.aiClient)
    t.aiClient.stop();
  else {
    const { selection: s, doc: l } = t.editor.state, c = l.textBetween(s.from, s.to);
    let u = ((a = (o = (i = (r = t.editor) == null ? void 0 : r.linwitDocEditor.options.ai) == null ? void 0 : i.translate) == null ? void 0 : o.prompt) == null ? void 0 : a.call(o, e, c)) || `你是一个${e}翻译专家，精通多个国家的语言，请帮我把以下 <content> 标签里内容翻译为: ${e}，并返回翻译后结果。您需要翻译的内容是：
<content>${c}</content>`;
    const d = zn.get("auto");
    if (d) {
      const p = new Qh(30, n);
      d.chat("", u, {
        onStart(_) {
          t.aiClient = _;
        },
        onStop() {
          t.aiClient = void 0, p.finished();
        },
        onMessage(_) {
          p.appendText(_.content);
        }
      });
    } else
      console.error("AI model name config error.");
  }
}, vL = (t) => {
  const e = document.createElement("div");
  return e.classList.add("linwiteditor-translate-result-panel"), e.innerHTML = `
    <textarea rows="5" readonly></textarea>
    <div>
     <button type="button" id="cancel"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17 6H22V8H20V21C20 21.5523 19.5523 22 19 22H5C4.44772 22 4 21.5523 4 21V8H2V6H7V3C7 2.44772 7.44772 2 8 2H16C16.5523 2 17 2.44772 17 3V6ZM18 8H6V20H18V8ZM9 4V6H15V4H9Z" fill="currentColor"></path></svg> 
        ${te("ai-cancel")}</button>
     <button type="button" id="append"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2 18H12V20H2V18ZM2 11H22V13H2V11ZM2 4H22V6H2V4ZM18 18V15H20V18H23V20H20V23H18V20H15V18H18Z" fill="currentColor"></path></svg> 
${te("ai-append")}</button>
     <button type="button" id="replace"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.071 4.92902L11.4852 6.34323L6.82834 11.0001L16.0002 11.0002L16.0002 13.0002L6.82839 13.0001L11.4852 17.6569L10.071 19.0712L2.99994 12.0001L10.071 4.92902ZM18.0001 19V5.00003H20.0001V19H18.0001Z" fill="currentColor"></path></svg> 
       ${te("ai-replace")}</button>
</div>
    `, e.querySelector("#cancel").addEventListener("click", () => {
    var n, r;
    (n = t.translateResultInstance) == null || n.hide(), (r = t.tippyInstance) == null || r.show();
  }), e.querySelector("#append").addEventListener("click", () => {
    var i, o, a;
    (i = t.translateResultInstance) == null || i.hide();
    const { state: { selection: n, doc: r } } = t.editor;
    (o = t.editor) == null || o.commands.setTextSelection(K.create(r, n.to)), (a = t.editor) == null || a.insertMarkdown(e.querySelector("textarea").value);
  }), e.querySelector("#replace").addEventListener("click", () => {
    var n, r;
    (n = t.translateResultInstance) == null || n.hide(), (r = t.editor) == null || r.insertMarkdown(e.querySelector("textarea").value);
  }), e;
}, RL = (t, e) => {
  const n = document.createElement("div");
  n.classList.add("linwiteditor-translate-panel"), n.innerHTML = `
      <div class="linwiteditor-translate-panel-body">
        ${e.map((i) => typeof i == "string" ? `<p data-lang="${i}">${te(i)} </p>` : `<p data-lang="${i.language || i.title}">${te(i.title)} </p>`).join("")}
        </div>
        `;
  const r = t.editor.view.dom.closest(".linwiteditor-container");
  return t.translateResultInstance = Me(n, {
    content: vL(t),
    appendTo: r,
    placement: "bottom",
    interactive: !0,
    trigger: "click",
    arrow: !1,
    getReferenceClientRect() {
      return r.getBoundingClientRect();
    },
    offset: [0, -r.getBoundingClientRect().height + 100],
    onTrigger: (i, o) => {
      var l;
      const a = o.target && o.target.getAttribute("data-lang");
      if (!a) {
        i.disable();
        return;
      }
      const s = i.popper.querySelector("textarea");
      s.value = "", (l = t.translatePanelInstance) == null || l.hide(), yL(t, a, s);
    },
    onUntrigger: (i) => {
      i.enable();
    }
  }), n;
}, OL = {
  id: "translate",
  title: "translate",
  icon: `<div style="display: flex;height: 20px">
                      <div style="width: 18px;height: 18px;display: inline-block" >
                      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M5 15V17C5 18.0544 5.81588 18.9182 6.85074 18.9945L7 19H10V21H7C4.79086 21 3 19.2091 3 17V15H5ZM18 10L22.4 21H20.245L19.044 18H14.954L13.755 21H11.601L16 10H18ZM17 12.8852L15.753 16H18.245L17 12.8852ZM8 2V4H12V11H8V14H6V11H2V4H6V2H8ZM17 3C19.2091 3 21 4.79086 21 7V9H19V7C19 5.89543 18.1046 5 17 5H14V3H17ZM6 6H4V9H6V6ZM10 6H8V9H10V6Z"></path></svg>
                      </div>
                     <div style="width: 18px;height: 18px;display: inline-block" >
                        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M12 14L8 10H16L12 14Z"></path></svg>
                     </div>
                 </div>
                `,
  onInit: ({ innerEditor: t }, e, n) => {
    var o, a;
    const r = { editor: t, tippyInstance: e }, i = ((a = (o = t.linwitDocEditor.options.ai) == null ? void 0 : o.translate) == null ? void 0 : a.translateMenuItems) || CL;
    return r.translatePanelInstance = Me(n.querySelector("#translate"), {
      content: RL(r, i),
      appendTo: t.view.dom.closest(".linwiteditor-container"),
      placement: "bottom",
      trigger: "click",
      interactive: !0,
      arrow: !1
    }), r;
  }
}, NL = new Uu(
  [gL, hL, TL, EL, bL, OL, SL]
), AL = (t, e) => {
  if (!t || t.length === 0)
    return t;
  let n = 0;
  for (; n < t.length; )
    e(t[n], n, t) ? t.splice(n, 1) : ++n;
  return t;
};
class IL extends Bs {
  constructor() {
    super();
  }
  onCreate(e, n) {
    var r, i, o, a;
    if (super.onCreate(e, n), this.initItemsByOptions(NL, (r = n == null ? void 0 : n.textSelectionBubbleMenu) == null ? void 0 : r.items), ((i = n.ai) == null ? void 0 : i.bubblePanelEnable) === !1)
      AL(this.items, (s) => s.id === "ai");
    else if ((o = n.ai) != null && o.bubblePanelIcon) {
      for (let s of this.items)
        if (s.id === "ai") {
          s.icon = (a = n.ai) == null ? void 0 : a.bubblePanelIcon;
          break;
        }
    }
  }
}
oe("linwiteditor-bubble-link", iL);
oe("linwiteditor-bubble-image", pL);
oe("linwiteditor-bubble-table", _L);
oe("linwiteditor-bubble-text", IL);
function Us(t, e) {
  return Se.create({
    name: t,
    addOptions() {
      return {
        ...e
      };
    },
    addProseMirrorPlugins() {
      return this.options.element ? [
        J2({
          pluginKey: this.options.pluginKey,
          editor: this.editor,
          element: this.options.element,
          tippyOptions: this.options.tippyOptions,
          updateDelay: this.options.updateDelay,
          shouldShow: this.options.shouldShow,
          updateAtMouseUp: this.options.updateAtMouseUp
        })
      ] : [];
    }
  });
}
const xL = (t) => {
  var r;
  const e = ((r = t.options.textSelectionBubbleMenu) == null ? void 0 : r.elementTagName) || "linwiteditor-bubble-text", n = document.createElement(e);
  return t.eventComponents.push(n), Us("textSelectionBubble", {
    pluginKey: "textSelectionBubble",
    element: n,
    updateDelay: 0,
    updateAtMouseUp: !0,
    tippyOptions: {
      appendTo: t.container,
      arrow: !1,
      placement: "bottom",
      getReferenceClientRect: () => Zh(t.innerEditor),
      onCreate(i) {
        n.instance = i;
      }
    },
    shouldShow: ({ editor: i }) => {
      if (!i.isEditable)
        return !1;
      const { state: { selection: o } } = i;
      return !o.empty && Rs(i.state.doc, {
        from: o.from,
        to: o.to
      }).trim().length > 0 && !i.isActive("link") && !i.isActive("image") && !i.isActive("codeBlock") && !(o instanceof ve);
    }
  });
}, DL = (t) => {
  const e = document.createElement("linwiteditor-bubble-link");
  return t.eventComponents.push(e), Us("linkBubble", {
    pluginKey: "linkBubble",
    element: e,
    tippyOptions: {
      appendTo: t.container,
      placement: "bottom",
      arrow: !1,
      onCreate(n) {
        e.instance = n;
      }
    },
    shouldShow: ({ editor: n }) => n.isEditable && n.isActive("link")
  });
}, wL = (t) => {
  const e = document.createElement("linwiteditor-bubble-image");
  return t.eventComponents.push(e), Us("imageBubble", {
    pluginKey: "imageBubble",
    element: e,
    tippyOptions: {
      appendTo: t.container,
      placement: "top-start",
      arrow: !1,
      getReferenceClientRect: () => {
        const { ranges: n } = t.innerEditor.state.selection, r = Math.min(...n.map((u) => u.$from.pos)), i = Math.max(...n.map((u) => u.$to.pos)), { view: o } = t.innerEditor, s = o.nodeDOM(r).querySelector("img"), l = Xi(o, r, i), c = s.getBoundingClientRect();
        return {
          ...l,
          left: c.left + c.width * 0.5 - 100
        };
      },
      onCreate(n) {
        e.instance = n;
      }
    },
    shouldShow: ({ editor: n }) => n.isEditable && n.isActive("image")
  });
}, ML = (t) => {
  const e = document.createElement("linwiteditor-bubble-table");
  return t.eventComponents.push(e), Us("tableBubble", {
    pluginKey: "tableBubble",
    element: e,
    tippyOptions: {
      placement: "top",
      appendTo: t.container,
      arrow: !1,
      getReferenceClientRect: () => {
        const n = t.innerEditor.state.selection, { ranges: r } = n, i = Math.min(...r.map((d) => d.$from.pos)), o = Math.max(...r.map((d) => d.$to.pos)), { view: a, state: s } = t.innerEditor, l = Xi(a, i, o), c = s.selection.$from.posAtIndex(0, 1), u = a.coordsAtPos(c);
        return {
          ...l,
          top: u.top
        };
      }
    },
    shouldShow: ({ editor: n }) => {
      const { state: { selection: r } } = n;
      return n.isEditable && n.isActive("table") && r instanceof ve;
    }
  });
}, LL = (t) => {
  var i, o;
  const e = [];
  return t.options.editable === !1 || (((i = t == null ? void 0 : t.options.textSelectionBubbleMenu) == null ? void 0 : i.enable) !== !1 && e.push(xL(t)), e.push(DL(t)), ((o = t.options.image) == null ? void 0 : o.bubbleMenuEnable) !== !1 && e.push(wL(t)), e.push(ML(t))), e;
}, kL = Se.create({
  name: "placeholder",
  addOptions() {
    return {
      emptyEditorClass: "is-editor-empty",
      emptyNodeClass: "is-empty",
      placeholder: "Write something …",
      showOnlyWhenEditable: !0,
      showOnlyCurrent: !0,
      includeChildren: !1
    };
  },
  addProseMirrorPlugins() {
    return [
      new Te({
        key: new Oe("placeholder"),
        props: {
          decorations: ({ doc: t, selection: e }) => {
            const n = this.editor.isEditable || !this.options.showOnlyWhenEditable, { anchor: r } = e, i = [];
            if (!n)
              return null;
            const o = this.editor.isEmpty;
            return t.descendants((a, s) => {
              const l = r >= s && r <= s + a.nodeSize, c = !a.isLeaf && As(a);
              if ((l || !this.options.showOnlyCurrent) && c) {
                const u = [this.options.emptyNodeClass];
                o && u.push(this.options.emptyEditorClass);
                const d = Be.node(s, s + a.nodeSize, {
                  class: u.join(" "),
                  "data-placeholder": typeof this.options.placeholder == "function" ? this.options.placeholder({
                    editor: this.editor,
                    node: a,
                    pos: s,
                    hasAnchor: l
                  }) : this.options.placeholder
                });
                i.push(d);
              }
              return this.options.includeChildren;
            }), ye.create(t, i);
          }
        }
      })
    ];
  }
});
function PL(t) {
  var e;
  const { char: n, allowSpaces: r, allowToIncludeChar: i, allowedPrefixes: o, startOfLine: a, $position: s } = t, l = r && !i, c = zC(n), u = new RegExp(`\\s${c}$`), d = a ? "^" : "", p = i ? "" : c, _ = l ? new RegExp(`${d}${c}.*?(?=\\s${p}|$)`, "gm") : new RegExp(`${d}(?:^)?${c}[^\\s${p}]*`, "gm"), m = ((e = s.nodeBefore) === null || e === void 0 ? void 0 : e.isText) && s.nodeBefore.text;
  if (!m)
    return null;
  const f = s.pos - m.length, g = Array.from(m.matchAll(_)).pop();
  if (!g || g.input === void 0 || g.index === void 0)
    return null;
  const S = g.input.slice(Math.max(0, g.index - 1), g.index), E = new RegExp(`^[${o == null ? void 0 : o.join("")}\0]?$`).test(S);
  if (o !== null && !E)
    return null;
  const b = f + g.index;
  let h = b + g[0].length;
  return l && u.test(m.slice(h - 1, h + 1)) && (g[0] += " ", h += 1), b < s.pos && h >= s.pos ? {
    range: {
      from: b,
      to: h
    },
    query: g[0].slice(n.length),
    text: g[0]
  } : null;
}
const FL = new Oe("suggestion");
function Xh({ pluginKey: t = FL, editor: e, char: n = "@", allowSpaces: r = !1, allowToIncludeChar: i = !1, allowedPrefixes: o = [" "], startOfLine: a = !1, decorationTag: s = "span", decorationClass: l = "suggestion", command: c = () => null, items: u = () => [], render: d = () => ({}), allow: p = () => !0, findSuggestionMatch: _ = PL }) {
  let m;
  const f = d == null ? void 0 : d(), g = new Te({
    key: t,
    view() {
      return {
        update: async (S, E) => {
          var b, h, T, C, v, I, N;
          const x = (b = this.key) === null || b === void 0 ? void 0 : b.getState(E), P = (h = this.key) === null || h === void 0 ? void 0 : h.getState(S.state), Y = x.active && P.active && x.range.from !== P.range.from, Z = !x.active && P.active, q = x.active && !P.active, V = !Z && !q && x.query !== P.query, O = Z || Y && V, y = V || Y, R = q || Y && V;
          if (!O && !y && !R)
            return;
          const w = R && !O ? x : P, B = S.dom.querySelector(`[data-decoration-id="${w.decorationId}"]`);
          m = {
            editor: e,
            range: w.range,
            query: w.query,
            text: w.text,
            items: [],
            command: ($) => c({
              editor: e,
              range: w.range,
              props: $
            }),
            decorationNode: B,
            // virtual node for popper.js or tippy.js
            // this can be used for building popups without a DOM node
            clientRect: B ? () => {
              var $;
              const { decorationId: X } = ($ = this.key) === null || $ === void 0 ? void 0 : $.getState(e.state), de = S.dom.querySelector(`[data-decoration-id="${X}"]`);
              return (de == null ? void 0 : de.getBoundingClientRect()) || null;
            } : null
          }, O && ((T = f == null ? void 0 : f.onBeforeStart) === null || T === void 0 || T.call(f, m)), y && ((C = f == null ? void 0 : f.onBeforeUpdate) === null || C === void 0 || C.call(f, m)), (y || O) && (m.items = await u({
            editor: e,
            query: w.query
          })), R && ((v = f == null ? void 0 : f.onExit) === null || v === void 0 || v.call(f, m)), y && ((I = f == null ? void 0 : f.onUpdate) === null || I === void 0 || I.call(f, m)), O && ((N = f == null ? void 0 : f.onStart) === null || N === void 0 || N.call(f, m));
        },
        destroy: () => {
          var S;
          m && ((S = f == null ? void 0 : f.onExit) === null || S === void 0 || S.call(f, m));
        }
      };
    },
    state: {
      // Initialize the plugin's internal state.
      init() {
        return {
          active: !1,
          range: {
            from: 0,
            to: 0
          },
          query: null,
          text: null,
          composing: !1
        };
      },
      // Apply changes to the plugin state from a view transaction.
      apply(S, E, b, h) {
        const { isEditable: T } = e, { composing: C } = e.view, { selection: v } = S, { empty: I, from: N } = v, x = { ...E };
        if (x.composing = C, T && (I || e.view.composing)) {
          (N < E.range.from || N > E.range.to) && !C && !E.composing && (x.active = !1);
          const P = _({
            char: n,
            allowSpaces: r,
            allowToIncludeChar: i,
            allowedPrefixes: o,
            startOfLine: a,
            $position: v.$from
          }), Y = `id_${Math.floor(Math.random() * 4294967295)}`;
          P && p({
            editor: e,
            state: h,
            range: P.range,
            isActive: E.active
          }) ? (x.active = !0, x.decorationId = E.decorationId ? E.decorationId : Y, x.range = P.range, x.query = P.query, x.text = P.text) : x.active = !1;
        } else
          x.active = !1;
        return x.active || (x.decorationId = null, x.range = { from: 0, to: 0 }, x.query = null, x.text = null), x;
      }
    },
    props: {
      // Call the keydown hook if suggestion is active.
      handleKeyDown(S, E) {
        var b;
        const { active: h, range: T } = g.getState(S.state);
        return h && ((b = f == null ? void 0 : f.onKeyDown) === null || b === void 0 ? void 0 : b.call(f, { view: S, event: E, range: T })) || !1;
      },
      // Setup decorator on the currently active suggestion.
      decorations(S) {
        const { active: E, range: b, decorationId: h } = g.getState(S);
        return E ? ye.create(S.doc, [
          Be.inline(b.from, b.to, {
            nodeName: s,
            class: l,
            "data-decoration-id": h
          })
        ]) : null;
      }
    }
  });
  return g;
}
const BL = new Oe("mention"), UL = xe.create({
  name: "mention",
  priority: 101,
  addOptions() {
    return {
      HTMLAttributes: {},
      renderText({ options: t, node: e }) {
        var n;
        return `${t.suggestion.char}${(n = e.attrs.label) !== null && n !== void 0 ? n : e.attrs.id}`;
      },
      deleteTriggerWithBackspace: !1,
      renderHTML({ options: t, node: e }) {
        var n;
        return [
          "span",
          me(this.HTMLAttributes, t.HTMLAttributes),
          `${t.suggestion.char}${(n = e.attrs.label) !== null && n !== void 0 ? n : e.attrs.id}`
        ];
      },
      suggestion: {
        char: "@",
        pluginKey: BL,
        command: ({ editor: t, range: e, props: n }) => {
          var r, i, o;
          const a = t.view.state.selection.$to.nodeAfter;
          ((r = a == null ? void 0 : a.text) === null || r === void 0 ? void 0 : r.startsWith(" ")) && (e.to += 1), t.chain().focus().insertContentAt(e, [
            {
              type: this.name,
              attrs: n
            },
            {
              type: "text",
              text: " "
            }
          ]).run(), (o = (i = t.view.dom.ownerDocument.defaultView) === null || i === void 0 ? void 0 : i.getSelection()) === null || o === void 0 || o.collapseToEnd();
        },
        allow: ({ state: t, range: e }) => {
          const n = t.doc.resolve(e.from), r = t.schema.nodes[this.name];
          return !!n.parent.type.contentMatch.matchType(r);
        }
      }
    };
  },
  group: "inline",
  inline: !0,
  selectable: !1,
  atom: !0,
  addAttributes() {
    return {
      id: {
        default: null,
        parseHTML: (t) => t.getAttribute("data-id"),
        renderHTML: (t) => t.id ? {
          "data-id": t.id
        } : {}
      },
      label: {
        default: null,
        parseHTML: (t) => t.getAttribute("data-label"),
        renderHTML: (t) => t.label ? {
          "data-label": t.label
        } : {}
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: `span[data-type="${this.name}"]`
      }
    ];
  },
  renderHTML({ node: t, HTMLAttributes: e }) {
    if (this.options.renderLabel !== void 0)
      return console.warn("renderLabel is deprecated use renderText and renderHTML instead"), [
        "span",
        me({ "data-type": this.name }, this.options.HTMLAttributes, e),
        this.options.renderLabel({
          options: this.options,
          node: t
        })
      ];
    const n = { ...this.options };
    n.HTMLAttributes = me({ "data-type": this.name }, this.options.HTMLAttributes, e);
    const r = this.options.renderHTML({
      options: n,
      node: t
    });
    return typeof r == "string" ? [
      "span",
      me({ "data-type": this.name }, this.options.HTMLAttributes, e),
      r
    ] : r;
  },
  renderText({ node: t }) {
    return this.options.renderLabel !== void 0 ? (console.warn("renderLabel is deprecated use renderText and renderHTML instead"), this.options.renderLabel({
      options: this.options,
      node: t
    })) : this.options.renderText({
      options: this.options,
      node: t
    });
  },
  addKeyboardShortcuts() {
    return {
      Backspace: () => this.editor.commands.command(({ tr: t, state: e }) => {
        let n = !1;
        const { selection: r } = e, { empty: i, anchor: o } = r;
        return i ? (e.doc.nodesBetween(o - 1, o, (a, s) => {
          if (a.type.name === this.name)
            return n = !0, t.insertText(this.options.deleteTriggerWithBackspace ? "" : this.options.suggestion.char || "", s, s + a.nodeSize), !1;
        }), n) : !1;
      })
    };
  },
  addProseMirrorPlugins() {
    return [
      Xh({
        editor: this.editor,
        ...this.options.suggestion
      })
    ];
  }
}), HL = (t) => UL.configure({
  HTMLAttributes: {
    class: "mention"
  },
  suggestion: {
    items: ({ query: e }) => t(e),
    render: () => {
      let e, n, r = 0, i;
      const o = () => {
        e.innerHTML = `
                            <div class="items">
                             ${i.items.map((a, s) => `<button type="button" class="item ${s === r ? "item-selected" : ""}" data-index="${s}"> @${a.label || a}</button>`).join("")}
                            </div>
                            `, e.addEventListener("click", (a) => {
          const s = a.target.closest(".item");
          if (s) {
            const l = Number(s.getAttribute("data-index")), c = i.items[l];
            c && c.id ? i.command(c) : i.command({ id: c });
          }
        });
      };
      return {
        onStart: (a) => {
          e = document.createElement("div"), e.classList.add("suggestion"), i = a, a.clientRect && (o(), n = Me("body", {
            getReferenceClientRect: a.clientRect,
            appendTo: () => a.editor.view.dom.closest(".linwiteditor-container"),
            content: e,
            showOnCreate: !0,
            interactive: !0,
            allowHTML: !0,
            trigger: "manual",
            placement: "bottom-start",
            arrow: !1
          }));
        },
        onUpdate(a) {
          i = a, a.clientRect && (o(), n[0].setProps({
            getReferenceClientRect: a.clientRect
          }));
        },
        onKeyDown(a) {
          if (a.event.key === "Escape")
            return n[0].hide(), !0;
          if (a.event.key === "ArrowUp")
            return r = (r + i.items.length - 1) % i.items.length, o(), !0;
          if (a.event.key === "ArrowDown")
            return r = (r + 1) % i.items.length, o(), !0;
          if (a.event.key === "Enter") {
            const s = i.items[r];
            return s && s.id ? i.command(s) : i.command({ id: s }), !0;
          }
          return !1;
        },
        onExit() {
          n[0].destroy(), e.remove();
        }
      };
    }
  }
}), GL = [
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21 19V21H19V19H21ZM17 19V21H15V19H17ZM13 19V21H11V19H13ZM9 19V21H7V19H9ZM5 19V21H3V19H5ZM21 15V17H19V15H21ZM5 15V17H3V15H5ZM5 11V13H3V11H5ZM16 3C18.6874 3 20.8817 5.12366 20.9954 7.78322L21 8V13H19V8C19 6.40893 17.7447 5.09681 16.1756 5.00512L16 5H11V3H16ZM5 7V9H3V7H5ZM5 3V5H3V3H5ZM9 3V5H7V3H9Z" fill="currentColor"></path></svg>',
    name: "AI 续写",
    prompt: "请帮我继续扩展这段话的内容",
    model: "auto"
  },
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 5.25C16.7949 5.25 18.25 3.79493 18.25 2H19.75C19.75 3.79493 21.2051 5.25 23 5.25V6.75C21.2051 6.75 19.75 8.20507 19.75 10H18.25C18.25 8.20507 16.7949 6.75 15 6.75V5.25ZM4 7C4 5.89543 4.89543 5 6 5H13V3H6C3.79086 3 2 4.79086 2 7V17C2 19.2091 3.79086 21 6 21H18C20.2091 21 22 19.2091 22 17V12H20V17C20 18.1046 19.1046 19 18 19H6C4.89543 19 4 18.1046 4 17V7Z" fill="currentColor"></path></svg>',
    name: "AI 提问",
    prompt: "",
    model: "auto"
  },
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 15V17C5 18.0544 5.81588 18.9182 6.85074 18.9945L7 19H10V21H7C4.79086 21 3 19.2091 3 17V15H5ZM18 10L22.4 21H20.245L19.044 18H14.954L13.755 21H11.601L16 10H18ZM17 12.8852L15.753 16H18.245L17 12.8852ZM8 2V4H12V11H8V14H6V11H2V4H6V2H8ZM17 3C19.2091 3 21 4.79086 21 7V9H19V7C19 5.89543 18.1046 5 17 5H14V3H17ZM6 6H4V9H6V6ZM10 6H8V9H10V6Z" fill="currentColor"></path></svg>',
    name: "AI 翻译",
    prompt: "请帮我翻译以上内容，在翻译之前，想先判断一下这个内容是不是中文，如果是中文，则翻译为英文，如果是其他语言，则需要翻译为中文，注意，你只需要返回翻译的结果，不需要对此进行任何解释，不需要除了翻译结果以外的其他任何内容。",
    model: "auto"
  },
  {
    icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 3C20.5523 3 21 3.44772 21 4V5.757L19 7.757V5H5V13.1L9 9.1005L13.328 13.429L11.9132 14.8422L9 11.9289L5 15.928V19H15.533L16.2414 19.0012L17.57 17.671L18.8995 19H19V16.242L21 14.242V20C21 20.5523 20.5523 21 20 21H4C3.45 21 3 20.55 3 20V4C3 3.44772 3.44772 3 4 3H20ZM21.7782 7.80761L23.1924 9.22183L15.4142 17L13.9979 16.9979L14 15.5858L21.7782 7.80761ZM15.5 7C16.3284 7 17 7.67157 17 8.5C17 9.32843 16.3284 10 15.5 10C14.6716 10 14 9.32843 14 8.5C14 7.67157 14.6716 7 15.5 7Z" fill="currentColor"></path></svg>',
    name: "AI 生图",
    prompt: "请根据以上的内容，生成一张图片，并把图片返回给我",
    model: "auto"
  }
], VL = Se.create({
  name: "aiCommand",
  // @ts-ignore
  addOptions() {
    const t = [
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 6V21H11V6H5V4H19V6H13Z" fill="currentColor"></path></svg>',
        click: (r) => {
          r.chain().setParagraph().run();
        }
      },
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20H11V13H4V20H2V4H4V11H11V4H13V20ZM21.0005 8V20H19.0005L19 10.204L17 10.74V8.67L19.5005 8H21.0005Z" fill="currentColor"></path></svg>',
        click: (r) => {
          r.chain().setHeading({ level: 1 }).run();
        }
      },
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 4V11H11V4H13V20H11V13H4V20H2V4H4ZM18.5 8C20.5711 8 22.25 9.67893 22.25 11.75C22.25 12.6074 21.9623 13.3976 21.4781 14.0292L21.3302 14.2102L18.0343 18H22V20H15L14.9993 18.444L19.8207 12.8981C20.0881 12.5908 20.25 12.1893 20.25 11.75C20.25 10.7835 19.4665 10 18.5 10C17.5818 10 16.8288 10.7071 16.7558 11.6065L16.75 11.75H14.75C14.75 9.67893 16.4289 8 18.5 8Z" fill="currentColor"></path></svg>',
        click: (r) => {
          r.chain().setHeading({ level: 2 }).run();
        }
      },
      {
        icon: ' <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M22 8L21.9984 10L19.4934 12.883C21.0823 13.3184 22.25 14.7728 22.25 16.5C22.25 18.5711 20.5711 20.25 18.5 20.25C16.674 20.25 15.1528 18.9449 14.8184 17.2166L16.7821 16.8352C16.9384 17.6413 17.6481 18.25 18.5 18.25C19.4665 18.25 20.25 17.4665 20.25 16.5C20.25 15.5335 19.4665 14.75 18.5 14.75C18.214 14.75 17.944 14.8186 17.7056 14.9403L16.3992 13.3932L19.3484 10H15V8H22ZM4 4V11H11V4H13V20H11V13H4V20H2V4H4Z" fill="currentColor"></path></svg>',
        click: (r) => {
          r.chain().setHeading({ level: 3 }).run();
        }
      },
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="none" d="M0 0h24v24H0z"></path><path d="M21 3C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H21ZM20 5H4V19H20V5ZM18 15V17H6V15H18Z"></path></svg>',
        click: (r) => {
          r.chain().toggleContainer("warning").run();
        }
      },
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.58341 17.3211C3.55316 16.2274 3 15 3 13.0103C3 9.51086 5.45651 6.37366 9.03059 4.82318L9.92328 6.20079C6.58804 8.00539 5.93618 10.346 5.67564 11.822C6.21263 11.5443 6.91558 11.4466 7.60471 11.5105C9.40908 11.6778 10.8312 13.159 10.8312 15C10.8312 16.933 9.26416 18.5 7.33116 18.5C6.2581 18.5 5.23196 18.0095 4.58341 17.3211ZM14.5834 17.3211C13.5532 16.2274 13 15 13 13.0103C13 9.51086 15.4565 6.37366 19.0306 4.82318L19.9233 6.20079C16.588 8.00539 15.9362 10.346 15.6756 11.822C16.2126 11.5443 16.9156 11.4466 17.6047 11.5105C19.4091 11.6778 20.8312 13.159 20.8312 15C20.8312 16.933 19.2642 18.5 17.3312 18.5C16.2581 18.5 15.232 18.0095 14.5834 17.3211Z" fill="currentColor"></path></svg>',
        click: (r) => {
          r.chain().toggleBlockquote().run();
        }
      },
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 4H21V6H8V4ZM3 3.5H6V6.5H3V3.5ZM3 10.5H6V13.5H3V10.5ZM3 17.5H6V20.5H3V17.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z" fill="currentColor"></path></svg>',
        click: (r) => {
          r.chain().toggleBulletList().run();
        }
      },
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8 4H21V6H8V4ZM5 3V6H6V7H3V6H4V4H3V3H5ZM3 14V11.5H5V11H3V10H6V12.5H4V13H6V14H3ZM5 19.5H3V18.5H5V18H3V17H6V21H3V20H5V19.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z" fill="currentColor"></path></svg>',
        click: (r) => {
          r.chain().toggleOrderedList().run();
        }
      },
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM3 19H17V21H3V19ZM3 14H21V16H3V14ZM3 9H17V11H3V9Z"></path></svg>',
        click: (r) => {
          r.chain().setTextAlign("left").run();
        }
      },
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 4H21V6H3V4ZM5 19H19V21H5V19ZM3 14H21V16H3V14ZM5 9H19V11H5V9Z"></path></svg>',
        click: (r) => {
          r.chain().setTextAlign("center").run();
        }
      },
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 3H20C20.5523 3 21 3.44772 21 4V20C21 20.5523 20.5523 21 20 21H4C3.44772 21 3 20.5523 3 20V4C3 3.44772 3.44772 3 4 3ZM5 5V19H19V5H5ZM11.0026 16L6.75999 11.7574L8.17421 10.3431L11.0026 13.1716L16.6595 7.51472L18.0737 8.92893L11.0026 16Z"></path></svg>',
        click: (r) => {
          r.chain().toggleTaskList().run();
        }
      },
      {
        icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3ZM4 5V19H20V5H4ZM20 12L16.4645 15.5355L15.0503 14.1213L17.1716 12L15.0503 9.87868L16.4645 8.46447L20 12ZM6.82843 12L8.94975 14.1213L7.53553 15.5355L4 12L7.53553 8.46447L8.94975 9.87868L6.82843 12ZM11.2443 17H9.11597L12.7557 7H14.884L11.2443 17Z"></path></svg>',
        click: (r) => {
          r.chain().toggleCodeBlock().run();
        }
      }
    ], e = 6, n = t.length - 1;
    return {
      suggestion: {
        char: "/",
        command: ({ editor: r, range: i, props: o }) => {
          if (r.chain().focus().deleteRange(i).run(), o && o.aiItem) {
            const a = o.aiItem;
            if (a.onClick)
              a.onClick(o.event, r.linwitDocEditor);
            else {
              const s = r.state.selection.$head.parent.textContent, l = a.model, c = zn.get(a.model);
              c ? c == null || c.chat(s, a.prompt, new Aa(r)) : console.error("Ai model config error. can not find the type:" + l + " at command menu");
            }
          } else
            t.length < o.index && t[o.index].click(r);
        },
        render: () => {
          let r, i, o = 0, a;
          const s = () => {
            r.innerHTML = `
                            <div class="ai-command-container">
                                <div class="ai-command-container-header">
                                ${t.map((l, c) => `<div class="ai-command-container-header-item item ${o === c ? "active" : ""}" data-index="index">${l.icon}</div>`).join("")}
                                </div>
                                <hr/>
                                ${a.items.map((l, c) => `<div class="ai-command-container-item item ${o === n + 1 + c ? "active" : ""}" data-index="${n + 1 + c}">${l.icon} ${l.name}</div>`).join("")}
                            </div>
                            `, r.addEventListener("click", (l) => {
              const c = l.target.closest(".item");
              if (c) {
                const u = Number(c.getAttribute("data-index"));
                a.command({
                  index: u,
                  event: l,
                  aiItem: u > n ? a.items[u - n - 1] : null
                });
              }
            });
          };
          return {
            onStart: (l) => {
              r = document.createElement("div"), r.classList.add("suggestion"), a = l, l.clientRect && (s(), i = Me("body", {
                getReferenceClientRect: l.clientRect,
                appendTo: () => l.editor.view.dom.closest(".linwiteditor-container"),
                content: r,
                showOnCreate: !0,
                interactive: !0,
                allowHTML: !0,
                trigger: "manual",
                placement: "right-start",
                arrow: !1
              })[0]);
            },
            onUpdate(l) {
              a = l, l.clientRect && (i == null || i.setProps({
                getReferenceClientRect: l.clientRect
              }));
            },
            onKeyDown(l) {
              return l.event.key === "Escape" ? (i == null || i.hide(), !0) : l.event.key === "ArrowUp" ? (o <= n ? (o -= e, o < 0 && (o = n + a.items.length)) : (o -= 1, o < 0 && (o = n + a.items.length)), s(), !0) : l.event.key === "ArrowDown" ? (o < n ? (o += e, o > n && (o = n + 1)) : (o += 1, o > n + a.items.length && (o = 0)), s(), !0) : l.event.key === "ArrowLeft" ? (o -= 1, o < 0 && (o = n + a.items.length), s(), !0) : l.event.key === "ArrowRight" ? (o += 1, o > n + a.items.length && (o = 0), s(), !0) : l.event.key === "Enter" ? (a.command({
                index: o,
                event: l.event,
                aiItem: o > n ? a.items[o - n - 1] : null
              }), !0) : !1;
            },
            onExit() {
              i == null || i.destroy(), r.remove();
            }
          };
        }
      }
    };
  },
  addProseMirrorPlugins() {
    return [
      Xh({
        editor: this.editor,
        ...this.options.suggestion
      })
    ];
  }
}), YL = Se.create({
  addProseMirrorPlugins() {
    const t = this.editor;
    return [
      new Te({
        key: new Oe("selection-marker"),
        props: {
          decorations(e) {
            return e.selection.empty || t.isFocused || !t.isEditable ? null : ye.create(e.doc, [
              Be.inline(
                e.selection.from,
                e.selection.to,
                { class: "selection-marker" }
              )
            ]);
          }
        }
      })
    ];
  }
}), Ll = (t) => {
  const e = document.createElement("div");
  return e.innerHTML = t, e.firstElementChild;
}, $L = (t, e) => {
  const n = new RegExp(`<${e}[^>]*>(.*?)</${e}>`, "gi");
  return t.replace(n, (r, i) => i);
}, zL = (t, e) => {
  for (let n of e)
    t = $L(t, n);
  return t;
}, qL = (t, e, n) => {
  function r(u) {
    const d = document.createDocumentFragment();
    for (; u.firstChild; ) {
      const p = u.removeChild(u.firstChild), _ = i(p);
      _ && d.appendChild(_);
    }
    return d;
  }
  function i(u) {
    var d;
    if (u.nodeType === Node.ELEMENT_NODE) {
      const p = u;
      if (e.includes(p.tagName.toLowerCase())) {
        if (!(((d = p.textContent) == null ? void 0 : d.trim()) || ""))
          return p;
        for (; p.attributes.length > 0; )
          p.removeAttribute(p.attributes[0].name);
        return p.appendChild(r(p)), p;
      } else
        return r(p);
    } else if (u.nodeType === Node.TEXT_NODE && u.textContent && u.textContent.trim().length > 0)
      return u;
    return null;
  }
  function o(u) {
    const d = u.querySelectorAll("br");
    for (let p = 0; p < d.length - 1; p++) {
      const _ = d[p], m = d[p + 1];
      if (_.nextSibling === m) {
        let f = _.previousSibling;
        const g = [];
        for (; f && f.nodeName !== "P"; )
          g.unshift(f), f = f.previousSibling;
        const S = document.createElement("p");
        g.forEach((E) => S.appendChild(E)), _.replaceWith(S), m.remove(), p++;
      }
    }
  }
  t = t.replace(/(\n)/gm, " ");
  const s = new DOMParser().parseFromString(t, "text/html"), l = i(s.body), c = document.createElement("div");
  return l && (c.appendChild(l), o(c)), c.innerHTML;
}, WL = (t) => {
  var i;
  const e = t.documentElement.getAttributeNames();
  if (e && e.length > 0)
    for (let o of e) {
      const a = t.documentElement.getAttribute(o);
      if (a != null && a.includes("microsoft") || a != null && a.includes("excel"))
        return !0;
    }
  let n = t.getElementsByTagName("meta");
  for (let o of n) {
    let a = o.getAttribute("name"), s = o.getAttribute("content");
    if (a && a.toLowerCase() === "generator" && (s != null && s.includes("Microsoft") || s != null && s.includes("LibreOffice") || s != null && s.includes("OpenOffice")))
      return !0;
  }
  const r = (i = t.body.innerHTML) == null ? void 0 : i.trim();
  return !!(r != null && r.startsWith("<table") && (r != null && r.endsWith("</table>")));
}, KL = (t) => {
  const e = document.createElement("div");
  return e.innerHTML = t, e.querySelectorAll("p").forEach((r) => {
    (!r.textContent || r.textContent.trim() === "") && (r.querySelector("img") || r.remove());
  }), e.innerHTML;
}, QL = (t) => {
  const n = new DOMParser().parseFromString(t, "text/html"), r = document.createDocumentFragment(), i = n.body.children;
  for (let a of i)
    a.hasAttribute("data-pm-slice") ? a.childNodes.forEach((s) => {
      r.appendChild(s.cloneNode(!0));
    }) : r.appendChild(a.cloneNode(!0));
  const o = document.createElement("div");
  return o.appendChild(r), o.innerHTML;
}, Lc = (t) => {
  if (!t) return "";
  const n = new DOMParser().parseFromString(t, "text/html"), r = n.querySelectorAll("ul");
  r && r.forEach((s) => {
    var l;
    if ((l = s.getAttribute("class")) != null && l.includes("task-list")) {
      s.getAttributeNames().forEach((d) => {
        s.removeAttribute(d);
      }), s.setAttribute("data-type", "taskList");
      const c = s.firstElementChild;
      if ((c == null ? void 0 : c.tagName) === "P") {
        const d = document.createDocumentFragment();
        c.childNodes.forEach((p) => {
          d.append(p.cloneNode(!0));
        }), c.replaceWith(d);
      }
      s.querySelectorAll("li").forEach((d) => {
        d.getAttributeNames().forEach((_) => {
          s.removeAttribute(_);
        });
        const p = d.querySelector("input[type='checkbox']");
        p && (d.setAttribute("data-type", "taskItem"), d.setAttribute("data-checked", p.hasAttribute("checked") ? "true" : "false"));
      });
    }
  });
  const i = n.querySelectorAll("li");
  i && i.forEach((s) => {
    s.innerHTML || (s.innerHTML = "<p></p>");
  });
  const o = n.querySelectorAll("body>p>img");
  if (o.length > 0) {
    const s = n.querySelector("body");
    for (const l of o) {
      const c = l.parentNode, u = Array.prototype.indexOf.call(s.children, c);
      s.insertBefore(l, s.children[u]);
    }
  }
  let a = "";
  return n.body.childNodes.forEach((s) => {
    if (s.nodeType === Node.TEXT_NODE)
      a += s.textContent;
    else if (s.nodeType === Node.ELEMENT_NODE) {
      const l = s;
      l === n.body.firstChild && l.tagName === "P" || l.querySelector("img") && l.tagName !== "A" ? a += l.innerHTML : a += l.outerHTML;
    }
  }), a;
}, jh = ["info", "warning", "danger"], ZL = /^:::([a-z]+)?[\s\n]$/, XL = xe.create({
  name: "container",
  group: "block",
  content: "block+",
  defining: !0,
  addOptions() {
    return {
      HTMLAttributes: {
        class: "container-wrapper"
      },
      typeItems: jh,
      defaultType: null
    };
  },
  addAttributes() {
    return {
      containerClass: {
        default: this.options.defaultType,
        parseHTML: (t) => {
          for (let e of t.classList)
            if (e != "container-wrapper")
              return e;
        },
        renderHTML: (t) => ({
          class: t.containerClass
        })
      }
    };
  },
  parseHTML() {
    return [
      {
        tag: "div.container-wrapper"
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["div", me(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setContainer: (t) => ({ commands: e }) => (t || (t = this.options.defaultType), e.wrapIn(this.name, { containerClass: t })),
      toggleContainer: (t) => ({ commands: e }) => (t || (t = this.options.defaultType), e.toggleWrap(this.name, { containerClass: t })),
      unsetContainer: () => ({ commands: t }) => t.lift(this.name)
    };
  },
  addInputRules() {
    return [
      Sr({
        find: ZL,
        type: this.type,
        getAttributes: (t) => ({
          containerClass: t[1]
        })
      })
    ];
  },
  addNodeView() {
    return ({ node: t, editor: e }) => {
      const n = document.createElement("div");
      n.classList.add("container-wrapper"), n.classList.add(t.attrs.containerClass);
      let r = n, i = null;
      if (e.isEditable) {
        n.style.position = "relative", n.appendChild(Ll(`<div class="linwiteditor-container-tools">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C17.5222 2 22 5.97778 22 10.8889C22 13.9556 19.5111 16.4444 16.4444 16.4444H14.4778C13.5556 16.4444 12.8111 17.1889 12.8111 18.1111C12.8111 18.5333 12.9778 18.9222 13.2333 19.2111C13.5 19.5111 13.6667 19.9 13.6667 20.3333C13.6667 21.2556 12.9 22 12 22C6.47778 22 2 17.5222 2 12C2 6.47778 6.47778 2 12 2ZM10.8111 18.1111C10.8111 16.0843 12.451 14.4444 14.4778 14.4444H16.4444C18.4065 14.4444 20 12.851 20 10.8889C20 7.1392 16.4677 4 12 4C7.58235 4 4 7.58235 4 12C4 16.19 7.2226 19.6285 11.324 19.9718C10.9948 19.4168 10.8111 18.7761 10.8111 18.1111ZM7.5 12C6.67157 12 6 11.3284 6 10.5C6 9.67157 6.67157 9 7.5 9C8.32843 9 9 9.67157 9 10.5C9 11.3284 8.32843 12 7.5 12ZM16.5 12C15.6716 12 15 11.3284 15 10.5C15 9.67157 15.6716 9 16.5 9C17.3284 9 18 9.67157 18 10.5C18 11.3284 17.3284 12 16.5 12ZM12 9C11.1716 9 10.5 8.32843 10.5 7.5C10.5 6.67157 11.1716 6 12 6C12.8284 6 13.5 6.67157 13.5 7.5C13.5 8.32843 12.8284 9 12 9Z"></path></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 14L8 10H16L12 14Z"></path></svg>
</div>`)), r = Ll("<div></div>"), n.appendChild(r);
        const o = () => {
          const a = Ll(`<div>
<div class="linwiteditor-container-tools-body">
    <div>${te("type")}</div>
    <div class="linwiteditor-container-tools-body-color-items">${this.options.typeItems.map((s) => `<div class="linwiteditor-container-tools-body-color-box ${s}" title="${s}"></div>`).join("")}</div>
</div>`);
          return a.addEventListener("click", (s) => {
            s.target instanceof HTMLElement && s.target.classList.contains("linwiteditor-container-tools-body-color-box") && e.commands.updateAttributes(this.name, {
              containerClass: s.target.getAttribute("title")
            });
          }), a;
        };
        i = Me(n.querySelector(".linwiteditor-container-tools"), {
          content: o(),
          appendTo: () => n.closest(".linwiteditor-container"),
          placement: "bottom-end",
          trigger: "click",
          interactive: !0,
          arrow: !1,
          offset: [8, 0],
          aria: {
            content: null,
            expanded: !1
          }
        });
      }
      return {
        dom: n,
        contentDOM: r,
        destroy() {
          i == null || i.destroy();
        }
      };
    };
  }
}), jL = Mg.extend({
  addAttributes() {
    var t;
    return {
      ...(t = this.parent) == null ? void 0 : t.call(this),
      id: {
        default: null
      }
    };
  }
}), JL = Se.create({
  name: "saveExt",
  addKeyboardShortcuts() {
    return {
      "Mod-s": ({ editor: t }) => this.options.onSave ? this.options.onSave(t.linwitDocEditor) : !1
    };
  }
}), ek = xe.create({
  name: "figure",
  content: "block+",
  group: "block",
  defining: !0,
  draggable: !0,
  selectable: !0,
  addOptions() {
    return {
      HTMLAttributes: {
        dir: "auto"
      }
    };
  },
  parseHTML() {
    return [{ tag: "figure" }];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["figure", me(this.options.HTMLAttributes, t), 0];
  }
}), tk = xe.create({
  name: "figcaption",
  content: "inline*",
  group: "block",
  defining: !0,
  addOptions() {
    return {
      HTMLAttributes: {
        dir: "auto"
      }
    };
  },
  parseHTML() {
    return [{ tag: "figcaption" }];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["figcaption", me(this.options.HTMLAttributes, t), 0];
  }
}), nk = Se.create({
  name: "pasteExt",
  priority: 1e3,
  addProseMirrorPlugins() {
    return [
      new Te({
        key: new Oe("linwiteditor-paste"),
        props: {
          handlePaste: (t, e) => {
            if (t.props.editable && !t.props.editable(t.state) || !e.clipboardData) return !1;
            const n = e.clipboardData.getData("text/plain");
            let r = e.clipboardData.getData("text/html");
            if (!r && n) {
              const i = this.editor.parseMarkdown(n);
              if (i) {
                const { state: { tr: o }, dispatch: a } = t;
                return a(o.replaceSelection(new H(i, 0, 0)).scrollIntoView()), !0;
              }
            } else if (r) {
              r = QL(r);
              const { options: i } = this.editor.linwitDocEditor;
              if (i.htmlPasteConfig) {
                if (i.htmlPasteConfig.pasteAsText)
                  r = qL(r, ["p", "br"]);
                else if (i.htmlPasteConfig.pasteClean) {
                  r = zL(r, ["a", "span", "strong", "b", "em", "i", "u"]);
                  const s = new DOMParser().parseFromString(r, "text/html").documentElement.querySelector("body");
                  s && (s == null || s.querySelectorAll("*").forEach((l) => {
                    l.removeAttribute("style");
                  }), r = s == null ? void 0 : s.innerHTML);
                }
                if (i.htmlPasteConfig.removeEmptyParagraphs !== !1 && (r = KL(r)), i.htmlPasteConfig.pasteProcessor && (r = i.htmlPasteConfig.pasteProcessor(r)), r)
                  return this.editor.commands.insertContent(r), !0;
              } else if (n && r) {
                const a = new DOMParser().parseFromString(r, "text/html"), s = a.querySelector("table");
                if (s && WL(a))
                  return this.editor.commands.insertContent(s.outerHTML, {
                    parseOptions: {
                      preserveWhitespace: !1
                    }
                  }), !0;
              }
            }
          }
        }
      })
    ];
  }
}), rk = Se.create({
  name: "className",
  addOptions() {
    return {
      types: [
        "heading",
        "paragraph",
        "container",
        "codeBlock",
        "blockquote",
        "bulletList",
        "orderedList",
        "listItem",
        "taskList",
        "taskItem",
        "image",
        "video",
        "table",
        "iframe"
      ]
    };
  },
  addGlobalAttributes() {
    return [
      {
        types: this.options.types,
        attributes: {
          class: {
            defaultValue: "",
            parseHTML: (t) => t.getAttribute("class"),
            renderHTML: (t) => t.class ? {
              class: t.class
            } : {}
          }
        }
      }
    ];
  },
  addCommands() {
    return {
      setClassName: (t, e) => ({ chain: n }) => !t || !this.options.types.includes(t) ? !1 : n().updateAttributes(t, { class: e }).run()
    };
  },
  onTransaction({ editor: t, transaction: e }) {
    e.steps.length > 0 && e.steps.forEach((n) => {
      if (n instanceof He) {
        let r = !1;
        if (n.getMap().forEach((i, o, a, s) => {
          s == a + 2 && (r = !0);
        }), r) {
          const o = n.slice.content.lastChild;
          o && !o.textContent && t.commands.updateAttributes(o.type, { ...o.attrs, class: "" });
        }
      }
    });
  }
}), ik = (t, e) => {
  var r, i, o, a, s, l, c, u, d, p, _, m, f, g, S, E, b, h, T, C, v, I, N, x, P, Y, Z, q, V, O, y;
  const n = [lO.configure({
    codeBlock: !1,
    heading: !1
  })];
  return n.push(
    cO,
    dO,
    pO,
    jL,
    gO.configure({
      uploadUrl: (r = e.attachment) == null ? void 0 : r.uploadUrl,
      uploadHeaders: (i = e.attachment) == null ? void 0 : i.uploadHeaders,
      uploadFormName: (o = e.attachment) == null ? void 0 : o.uploadFormName,
      uploader: ((a = e.attachment) == null ? void 0 : a.uploader) || e.uploader,
      uploaderEvent: (s = e.attachment) == null ? void 0 : s.uploaderEvent
    }),
    hO,
    YL,
    bO.configure({
      multicolor: !0
    }),
    TO,
    CO,
    yO,
    vO.configure({
      types: ["heading", "paragraph"]
    }),
    RO,
    IO.configure({
      allowBase64: typeof ((l = e.image) == null ? void 0 : l.allowBase64) > "u" ? !0 : (c = e.image) == null ? void 0 : c.allowBase64,
      defaultSize: ((u = e.image) == null ? void 0 : u.defaultSize) || 350,
      uploadUrl: (d = e.image) == null ? void 0 : d.uploadUrl,
      uploadHeaders: (p = e.image) == null ? void 0 : p.uploadHeaders,
      uploadFormName: (_ = e.image) == null ? void 0 : _.uploadFormName,
      uploader: ((m = e.image) == null ? void 0 : m.uploader) || e.uploader,
      uploaderEvent: (f = e.image) == null ? void 0 : f.uploaderEvent
    }),
    wN.configure({
      resizable: !0,
      lastColumnResizable: !0,
      allowTableNodeSelection: !0
    }),
    MN,
    LN,
    kN,
    PN.configure({
      textCounter: typeof (e == null ? void 0 : e.textCounter) == "function" ? e.textCounter : (R) => R.length
    }),
    oA.configure({
      openOnClick: !1,
      autolink: typeof ((g = e.link) == null ? void 0 : g.autolink) > "u" ? !0 : (S = e.link) == null ? void 0 : S.autolink,
      HTMLAttributes: {
        ref: (E = e == null ? void 0 : e.link) == null ? void 0 : E.rel,
        class: (b = e == null ? void 0 : e.link) == null ? void 0 : b.class
      }
    }),
    aA,
    sA,
    lA,
    uA.configure({
      nested: !0
    }),
    _I.configure({
      lowlight: W2(XM),
      defaultLanguage: "auto",
      languageClassPrefix: "language-",
      languages: ((h = e.codeBlock) == null ? void 0 : h.languages) || Eh,
      codeExplainAi: ((C = (T = e.ai) == null ? void 0 : T.codeBlock) == null ? void 0 : C.codeExplain) || {
        model: "auto",
        prompt: ((v = e.codeBlock) == null ? void 0 : v.codeExplainPrompt) || "帮我对这个代码进行解释，返回代码的解释内容，注意，不需要对代码的注释进行解释"
      },
      codeCommentsAi: ((N = (I = e.ai) == null ? void 0 : I.codeBlock) == null ? void 0 : N.codeComments) || {
        model: "auto",
        prompt: ((x = e.codeBlock) == null ? void 0 : x.codeCommentsPrompt) || "帮我对这个代码添加代码注释，并返回添加注释的代码，注意只需要返回代码。"
      }
    }),
    Z2.configure({
      uploadUrl: (P = e.video) == null ? void 0 : P.uploadUrl,
      uploadHeaders: (Y = e.video) == null ? void 0 : Y.uploadHeaders,
      uploadFormName: (Z = e.video) == null ? void 0 : Z.uploadFormName,
      uploader: ((q = e.video) == null ? void 0 : q.uploader) || e.uploader,
      uploaderEvent: (V = e.video) == null ? void 0 : V.uploaderEvent
    }),
    X2,
    ek,
    tk,
    JL.configure({
      onSave: e.onSave
    }),
    nk,
    rk,
    XL.configure({
      defaultType: ((O = e.container) == null ? void 0 : O.defaultType) || "warning",
      typeItems: ((y = e.container) == null ? void 0 : y.typeItems) || jh
    }),
    ...LL(t)
  ), e.placeholder && n.push(kL.configure({
    placeholder: e.placeholder
  })), n.push(VL.configure({
    suggestion: {
      items: (R) => {
        var B;
        return ((B = e.ai) == null ? void 0 : B.commands) || GL;
      }
    }
  })), e.onMentionQuery && n.push(HL(e.onMentionQuery)), n;
}, ok = {
  ////commons
  default: "默认",
  delete: "删除",
  confirm: "确定",
  cancel: "取消",
  resize: "调整大小",
  type: "类型",
  //menu tips
  undo: "撤销",
  redo: "重做",
  brush: "格式刷",
  container: "高亮块",
  eraser: "清除格式",
  heading: "正文/标题",
  "font-family": "字体",
  "font-size": "字号",
  bold: "加粗",
  italic: "斜体",
  underline: "下划线",
  strike: "删除线",
  link: "链接",
  "source-code": "源代码",
  code: "行内代码",
  subscript: "下标",
  superscript: "上标",
  hr: "分割线",
  todo: "任务列表",
  emoji: "表情",
  highlight: "高亮",
  "font-color": "字体颜色",
  align: "对齐",
  "line-height": "行高",
  "bullet-list": "无序列表",
  "ordered-list": "有序列表",
  "indent-decrease": "减少缩进",
  "indent-increase": "增加缩进",
  break: "强制换行",
  image: "图片",
  video: "视频",
  attachment: "附件",
  quote: "引用",
  "code-block": "代码块",
  table: "表格",
  printer: "打印",
  fullscreen: "全屏",
  ai: "人工智能",
  "menu-group": "菜单组",
  /////
  paragraph: "正文",
  h1: "标题 1",
  h2: "标题 2",
  h3: "标题 3",
  h4: "标题 4",
  h5: "标题 5",
  h6: "标题 6",
  ////colors panel
  standardColors: "标准色",
  historyColors: "最近使用",
  ////table
  insertTable: "插入表格",
  row: "行",
  column: "列",
  ////alignment
  "align-left": "居左对齐",
  "align-right": "居右对齐",
  "align-center": "居中对齐",
  "align-justify": "两端对齐",
  ////table
  "insert-column-left": "左侧插入列",
  "insert-column-right": "右侧插入列",
  "insert-row-top": "上方插入行",
  "insert-row-bottom": "下方插入行",
  "delete-column": "删除当前列",
  "delete-row": "删除当前行",
  "merge-cells-horizontal": "合并单元格",
  "merge-cells-vertical": "合并单元格",
  "split-cells-horizontal": "解除合并单元格",
  "split-cells-vertical": "解除合并单元格",
  "delete-table": "删除表格",
  ////link
  "edit-link": "编辑链接",
  unlink: "取消链接",
  "visit-link": "访问链接",
  "link-address": "链接地址",
  "link-open-type": "打开方式",
  "link-open-blank": "新窗口",
  ////font
  "default-font-size": "字号",
  "default-font-family": "默认字体",
  ////code block
  "codeblock-ai-auto-comment": "自动注释",
  "codeblock-ai-code-explain": "代码解释",
  //// image
  "image-property": "图片属性",
  "image-size": "图片大小",
  "image-keep-current": "保持当前",
  "image-original-size": "图片原始大小",
  //// ai
  "placeholder-tell-ai-what-to-do-next": "告诉 AI 下一步应该如何？比如：帮我翻译成英语",
  "tip-you-can-enter-text-above-or-select-the-operation-below": "提示：您可以在上面输入文字或者选择下方的操作",
  "you-can-do-the-following": "您可以进行以下操作:",
  "improve-writing": "改进写作",
  "check-spelling-and-grammar": "检查拼写和语法",
  "make-shorter": "简化内容",
  "make-longer": "丰富内容",
  translate: "翻译",
  summarize: "总结",
  "ai-append": "追加",
  "ai-replace": "替换",
  "ai-cancel": "舍弃",
  ///ai menus
  "ai-continuation": "AI 续写",
  "ai-optimization": "AI 优化",
  "ai-proofreading": "AI 校对",
  "ai-translation": "AI 翻译"
}, ak = {
  ////commons
  default: "Default",
  delete: "Delete",
  confirm: "Confirm",
  cancel: "Cancel",
  resize: "Resize",
  type: "Type",
  //menu tips
  undo: "Undo",
  redo: "Redo",
  brush: "Format Painter",
  container: "Highlight container",
  eraser: "clear format",
  heading: "Paragraph/Heading",
  "font-family": "Font Family",
  "font-size": "Font Size",
  bold: "Bold",
  italic: "Italics",
  underline: "Underline",
  strike: "Strikethrough",
  link: "Link",
  "source-code": "Source code",
  code: "Inline code",
  subscript: "Subscript",
  superscript: "Superscript",
  hr: "Dividing line",
  todo: "Task list",
  emoji: "Emoji expression",
  highlight: "Highlight",
  "font-color": "Font color",
  align: "Alignment",
  "line-height": "Line height",
  "bullet-list": "Unordered list",
  "ordered-list": "Ordered list",
  "indent-decrease": "Decrease indent",
  "indent-increase": "Increase indent",
  break: "Force line break",
  image: "Image",
  video: "video",
  attachment: "Attachment",
  quote: "Quote",
  "code-block": "Code block",
  table: "Table",
  printer: "Print",
  fullscreen: "Full screen",
  ai: "AI",
  "menu-group": "Menu Group",
  /////
  paragraph: "Paragraph",
  h1: "H1",
  h2: "H2",
  h3: "H3",
  h4: "H4",
  h5: "H5",
  h6: "H6",
  ////colors panel
  standardColors: "Standard colors",
  historyColors: "Recently used colors",
  ////table
  insertTable: "Insert Table",
  row: "Row",
  column: "Column",
  ////alignment
  "align-left": "Align left",
  "align-right": "Align right",
  "align-center": "Align center",
  "align-justify": "Align justify",
  ////table
  "insert-column-left": "Insert column left",
  "insert-column-right": "Insert column right",
  "insert-row-top": "Insert row top",
  "insert-row-bottom": "Insert row bottom",
  "delete-column": "Delete column",
  "delete-row": "Delete row",
  "merge-cells-horizontal": "Merge cells",
  "merge-cells-vertical": "Merge cells",
  "split-cells-horizontal": "Split cells",
  "split-cells-vertical": "Split cells",
  "delete-table": "Delete table",
  ///link
  "edit-link": "Edit link",
  unlink: "Unlink",
  "visit-link": "Visit link",
  "link-address": "Link address",
  "link-open-type": "Open type",
  "link-open-blank": "Blank",
  ////font
  "default-font-size": "Size",
  "default-font-family": "Default font",
  ////code block
  "codeblock-ai-auto-comment": "auto comment",
  "codeblock-ai-code-explain": "code explain",
  //// image
  "image-property": "Image property",
  "image-size": "Image size",
  "image-keep-current": "Keep current",
  "image-original-size": "Image original size",
  //// ai
  "placeholder-tell-ai-what-to-do-next": "Tell AI what to do next? e.g., help me translate into English",
  "tip-you-can-enter-text-above-or-select-the-operation-below": "Tip: You can enter text above or select the operation below",
  "you-can-do-the-following": "You can do the following:",
  "improve-writing": "Improve your writing",
  "check-spelling-and-grammar": "Check spelling and grammar",
  "make-shorter": "Make shorter",
  "make-longer": "Make longer",
  translate: "Translate",
  summarize: "Summarize",
  "ai-append": "Append",
  "ai-replace": "Replace",
  "ai-cancel": "Cancel",
  ///ai menus
  "ai-continuation": "Continuation",
  "ai-optimization": "Optimization",
  "ai-proofreading": "Proofreading",
  "ai-translation": "Translation"
}, tm = {};
function sk(t) {
  let e = tm[t];
  if (e)
    return e;
  e = tm[t] = [];
  for (let n = 0; n < 128; n++) {
    const r = String.fromCharCode(n);
    e.push(r);
  }
  for (let n = 0; n < t.length; n++) {
    const r = t.charCodeAt(n);
    e[r] = "%" + ("0" + r.toString(16).toUpperCase()).slice(-2);
  }
  return e;
}
function li(t, e) {
  typeof e != "string" && (e = li.defaultChars);
  const n = sk(e);
  return t.replace(/(%[a-f0-9]{2})+/gi, function(r) {
    let i = "";
    for (let o = 0, a = r.length; o < a; o += 3) {
      const s = parseInt(r.slice(o + 1, o + 3), 16);
      if (s < 128) {
        i += n[s];
        continue;
      }
      if ((s & 224) === 192 && o + 3 < a) {
        const l = parseInt(r.slice(o + 4, o + 6), 16);
        if ((l & 192) === 128) {
          const c = s << 6 & 1984 | l & 63;
          c < 128 ? i += "��" : i += String.fromCharCode(c), o += 3;
          continue;
        }
      }
      if ((s & 240) === 224 && o + 6 < a) {
        const l = parseInt(r.slice(o + 4, o + 6), 16), c = parseInt(r.slice(o + 7, o + 9), 16);
        if ((l & 192) === 128 && (c & 192) === 128) {
          const u = s << 12 & 61440 | l << 6 & 4032 | c & 63;
          u < 2048 || u >= 55296 && u <= 57343 ? i += "���" : i += String.fromCharCode(u), o += 6;
          continue;
        }
      }
      if ((s & 248) === 240 && o + 9 < a) {
        const l = parseInt(r.slice(o + 4, o + 6), 16), c = parseInt(r.slice(o + 7, o + 9), 16), u = parseInt(r.slice(o + 10, o + 12), 16);
        if ((l & 192) === 128 && (c & 192) === 128 && (u & 192) === 128) {
          let d = s << 18 & 1835008 | l << 12 & 258048 | c << 6 & 4032 | u & 63;
          d < 65536 || d > 1114111 ? i += "����" : (d -= 65536, i += String.fromCharCode(55296 + (d >> 10), 56320 + (d & 1023))), o += 9;
          continue;
        }
      }
      i += "�";
    }
    return i;
  });
}
li.defaultChars = ";/?:@&=+$,#";
li.componentChars = "";
const nm = {};
function lk(t) {
  let e = nm[t];
  if (e)
    return e;
  e = nm[t] = [];
  for (let n = 0; n < 128; n++) {
    const r = String.fromCharCode(n);
    /^[0-9a-z]$/i.test(r) ? e.push(r) : e.push("%" + ("0" + n.toString(16).toUpperCase()).slice(-2));
  }
  for (let n = 0; n < t.length; n++)
    e[t.charCodeAt(n)] = t[n];
  return e;
}
function yo(t, e, n) {
  typeof e != "string" && (n = e, e = yo.defaultChars), typeof n > "u" && (n = !0);
  const r = lk(e);
  let i = "";
  for (let o = 0, a = t.length; o < a; o++) {
    const s = t.charCodeAt(o);
    if (n && s === 37 && o + 2 < a && /^[0-9a-f]{2}$/i.test(t.slice(o + 1, o + 3))) {
      i += t.slice(o, o + 3), o += 2;
      continue;
    }
    if (s < 128) {
      i += r[s];
      continue;
    }
    if (s >= 55296 && s <= 57343) {
      if (s >= 55296 && s <= 56319 && o + 1 < a) {
        const l = t.charCodeAt(o + 1);
        if (l >= 56320 && l <= 57343) {
          i += encodeURIComponent(t[o] + t[o + 1]), o++;
          continue;
        }
      }
      i += "%EF%BF%BD";
      continue;
    }
    i += encodeURIComponent(t[o]);
  }
  return i;
}
yo.defaultChars = ";/?:@&=+$,-_.!~*'()#";
yo.componentChars = "-_.!~*'()";
function Hu(t) {
  let e = "";
  return e += t.protocol || "", e += t.slashes ? "//" : "", e += t.auth ? t.auth + "@" : "", t.hostname && t.hostname.indexOf(":") !== -1 ? e += "[" + t.hostname + "]" : e += t.hostname || "", e += t.port ? ":" + t.port : "", e += t.pathname || "", e += t.search || "", e += t.hash || "", e;
}
function ls() {
  this.protocol = null, this.slashes = null, this.auth = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.pathname = null;
}
const ck = /^([a-z0-9.+-]+:)/i, uk = /:[0-9]*$/, dk = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, pk = ["<", ">", '"', "`", " ", "\r", `
`, "	"], _k = ["{", "}", "|", "\\", "^", "`"].concat(pk), mk = ["'"].concat(_k), rm = ["%", "/", "?", ";", "#"].concat(mk), im = ["/", "?", "#"], fk = 255, om = /^[+a-z0-9A-Z_-]{0,63}$/, gk = /^([+a-z0-9A-Z_-]{0,63})(.*)$/, am = {
  javascript: !0,
  "javascript:": !0
}, sm = {
  http: !0,
  https: !0,
  ftp: !0,
  gopher: !0,
  file: !0,
  "http:": !0,
  "https:": !0,
  "ftp:": !0,
  "gopher:": !0,
  "file:": !0
};
function Gu(t, e) {
  if (t && t instanceof ls) return t;
  const n = new ls();
  return n.parse(t, e), n;
}
ls.prototype.parse = function(t, e) {
  let n, r, i, o = t;
  if (o = o.trim(), !e && t.split("#").length === 1) {
    const c = dk.exec(o);
    if (c)
      return this.pathname = c[1], c[2] && (this.search = c[2]), this;
  }
  let a = ck.exec(o);
  if (a && (a = a[0], n = a.toLowerCase(), this.protocol = a, o = o.substr(a.length)), (e || a || o.match(/^\/\/[^@\/]+@[^@\/]+/)) && (i = o.substr(0, 2) === "//", i && !(a && am[a]) && (o = o.substr(2), this.slashes = !0)), !am[a] && (i || a && !sm[a])) {
    let c = -1;
    for (let m = 0; m < im.length; m++)
      r = o.indexOf(im[m]), r !== -1 && (c === -1 || r < c) && (c = r);
    let u, d;
    c === -1 ? d = o.lastIndexOf("@") : d = o.lastIndexOf("@", c), d !== -1 && (u = o.slice(0, d), o = o.slice(d + 1), this.auth = u), c = -1;
    for (let m = 0; m < rm.length; m++)
      r = o.indexOf(rm[m]), r !== -1 && (c === -1 || r < c) && (c = r);
    c === -1 && (c = o.length), o[c - 1] === ":" && c--;
    const p = o.slice(0, c);
    o = o.slice(c), this.parseHost(p), this.hostname = this.hostname || "";
    const _ = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
    if (!_) {
      const m = this.hostname.split(/\./);
      for (let f = 0, g = m.length; f < g; f++) {
        const S = m[f];
        if (S && !S.match(om)) {
          let E = "";
          for (let b = 0, h = S.length; b < h; b++)
            S.charCodeAt(b) > 127 ? E += "x" : E += S[b];
          if (!E.match(om)) {
            const b = m.slice(0, f), h = m.slice(f + 1), T = S.match(gk);
            T && (b.push(T[1]), h.unshift(T[2])), h.length && (o = h.join(".") + o), this.hostname = b.join(".");
            break;
          }
        }
      }
    }
    this.hostname.length > fk && (this.hostname = ""), _ && (this.hostname = this.hostname.substr(1, this.hostname.length - 2));
  }
  const s = o.indexOf("#");
  s !== -1 && (this.hash = o.substr(s), o = o.slice(0, s));
  const l = o.indexOf("?");
  return l !== -1 && (this.search = o.substr(l), o = o.slice(0, l)), o && (this.pathname = o), sm[n] && this.hostname && !this.pathname && (this.pathname = ""), this;
};
ls.prototype.parseHost = function(t) {
  let e = uk.exec(t);
  e && (e = e[0], e !== ":" && (this.port = e.substr(1)), t = t.substr(0, t.length - e.length)), t && (this.hostname = t);
};
const hk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  decode: li,
  encode: yo,
  format: Hu,
  parse: Gu
}, Symbol.toStringTag, { value: "Module" })), Jh = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, eE = /[\0-\x1F\x7F-\x9F]/, Ek = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/, Vu = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/, tE = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/, nE = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/, Sk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Any: Jh,
  Cc: eE,
  Cf: Ek,
  P: Vu,
  S: tE,
  Z: nE
}, Symbol.toStringTag, { value: "Module" })), bk = new Uint16Array(
  // prettier-ignore
  'ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTǇǋǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉ǲኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻ǲᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤĳạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ﬃɩᾹ\0\0᾽g;耀ﬀig;耀ﬄ;쀀𝔣lig;耀ﬁlig;쀀fjƀaltῙ῜ῡt;晭ig;耀ﬂns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒α‚‰‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସǳ⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗǈⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼ǲ㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map((t) => t.charCodeAt(0))
), Tk = new Uint16Array(
  // prettier-ignore
  "Ȁaglq	\x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map((t) => t.charCodeAt(0))
);
var kl;
const Ck = /* @__PURE__ */ new Map([
  [0, 65533],
  // C1 Unicode control character reference replacements
  [128, 8364],
  [130, 8218],
  [131, 402],
  [132, 8222],
  [133, 8230],
  [134, 8224],
  [135, 8225],
  [136, 710],
  [137, 8240],
  [138, 352],
  [139, 8249],
  [140, 338],
  [142, 381],
  [145, 8216],
  [146, 8217],
  [147, 8220],
  [148, 8221],
  [149, 8226],
  [150, 8211],
  [151, 8212],
  [152, 732],
  [153, 8482],
  [154, 353],
  [155, 8250],
  [156, 339],
  [158, 382],
  [159, 376]
]), yk = (
  // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins
  (kl = String.fromCodePoint) !== null && kl !== void 0 ? kl : function(t) {
    let e = "";
    return t > 65535 && (t -= 65536, e += String.fromCharCode(t >>> 10 & 1023 | 55296), t = 56320 | t & 1023), e += String.fromCharCode(t), e;
  }
);
function vk(t) {
  var e;
  return t >= 55296 && t <= 57343 || t > 1114111 ? 65533 : (e = Ck.get(t)) !== null && e !== void 0 ? e : t;
}
var Ye;
(function(t) {
  t[t.NUM = 35] = "NUM", t[t.SEMI = 59] = "SEMI", t[t.EQUALS = 61] = "EQUALS", t[t.ZERO = 48] = "ZERO", t[t.NINE = 57] = "NINE", t[t.LOWER_A = 97] = "LOWER_A", t[t.LOWER_F = 102] = "LOWER_F", t[t.LOWER_X = 120] = "LOWER_X", t[t.LOWER_Z = 122] = "LOWER_Z", t[t.UPPER_A = 65] = "UPPER_A", t[t.UPPER_F = 70] = "UPPER_F", t[t.UPPER_Z = 90] = "UPPER_Z";
})(Ye || (Ye = {}));
const Rk = 32;
var Bn;
(function(t) {
  t[t.VALUE_LENGTH = 49152] = "VALUE_LENGTH", t[t.BRANCH_LENGTH = 16256] = "BRANCH_LENGTH", t[t.JUMP_TABLE = 127] = "JUMP_TABLE";
})(Bn || (Bn = {}));
function kc(t) {
  return t >= Ye.ZERO && t <= Ye.NINE;
}
function Ok(t) {
  return t >= Ye.UPPER_A && t <= Ye.UPPER_F || t >= Ye.LOWER_A && t <= Ye.LOWER_F;
}
function Nk(t) {
  return t >= Ye.UPPER_A && t <= Ye.UPPER_Z || t >= Ye.LOWER_A && t <= Ye.LOWER_Z || kc(t);
}
function Ak(t) {
  return t === Ye.EQUALS || Nk(t);
}
var Ve;
(function(t) {
  t[t.EntityStart = 0] = "EntityStart", t[t.NumericStart = 1] = "NumericStart", t[t.NumericDecimal = 2] = "NumericDecimal", t[t.NumericHex = 3] = "NumericHex", t[t.NamedEntity = 4] = "NamedEntity";
})(Ve || (Ve = {}));
var Dn;
(function(t) {
  t[t.Legacy = 0] = "Legacy", t[t.Strict = 1] = "Strict", t[t.Attribute = 2] = "Attribute";
})(Dn || (Dn = {}));
class Ik {
  constructor(e, n, r) {
    this.decodeTree = e, this.emitCodePoint = n, this.errors = r, this.state = Ve.EntityStart, this.consumed = 1, this.result = 0, this.treeIndex = 0, this.excess = 1, this.decodeMode = Dn.Strict;
  }
  /** Resets the instance to make it reusable. */
  startEntity(e) {
    this.decodeMode = e, this.state = Ve.EntityStart, this.result = 0, this.treeIndex = 0, this.excess = 1, this.consumed = 1;
  }
  /**
   * Write an entity to the decoder. This can be called multiple times with partial entities.
   * If the entity is incomplete, the decoder will return -1.
   *
   * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
   * entity is incomplete, and resume when the next string is written.
   *
   * @param string The string containing the entity (or a continuation of the entity).
   * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  write(e, n) {
    switch (this.state) {
      case Ve.EntityStart:
        return e.charCodeAt(n) === Ye.NUM ? (this.state = Ve.NumericStart, this.consumed += 1, this.stateNumericStart(e, n + 1)) : (this.state = Ve.NamedEntity, this.stateNamedEntity(e, n));
      case Ve.NumericStart:
        return this.stateNumericStart(e, n);
      case Ve.NumericDecimal:
        return this.stateNumericDecimal(e, n);
      case Ve.NumericHex:
        return this.stateNumericHex(e, n);
      case Ve.NamedEntity:
        return this.stateNamedEntity(e, n);
    }
  }
  /**
   * Switches between the numeric decimal and hexadecimal states.
   *
   * Equivalent to the `Numeric character reference state` in the HTML spec.
   *
   * @param str The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNumericStart(e, n) {
    return n >= e.length ? -1 : (e.charCodeAt(n) | Rk) === Ye.LOWER_X ? (this.state = Ve.NumericHex, this.consumed += 1, this.stateNumericHex(e, n + 1)) : (this.state = Ve.NumericDecimal, this.stateNumericDecimal(e, n));
  }
  addToNumericResult(e, n, r, i) {
    if (n !== r) {
      const o = r - n;
      this.result = this.result * Math.pow(i, o) + parseInt(e.substr(n, o), i), this.consumed += o;
    }
  }
  /**
   * Parses a hexadecimal numeric entity.
   *
   * Equivalent to the `Hexademical character reference state` in the HTML spec.
   *
   * @param str The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNumericHex(e, n) {
    const r = n;
    for (; n < e.length; ) {
      const i = e.charCodeAt(n);
      if (kc(i) || Ok(i))
        n += 1;
      else
        return this.addToNumericResult(e, r, n, 16), this.emitNumericEntity(i, 3);
    }
    return this.addToNumericResult(e, r, n, 16), -1;
  }
  /**
   * Parses a decimal numeric entity.
   *
   * Equivalent to the `Decimal character reference state` in the HTML spec.
   *
   * @param str The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNumericDecimal(e, n) {
    const r = n;
    for (; n < e.length; ) {
      const i = e.charCodeAt(n);
      if (kc(i))
        n += 1;
      else
        return this.addToNumericResult(e, r, n, 10), this.emitNumericEntity(i, 2);
    }
    return this.addToNumericResult(e, r, n, 10), -1;
  }
  /**
   * Validate and emit a numeric entity.
   *
   * Implements the logic from the `Hexademical character reference start
   * state` and `Numeric character reference end state` in the HTML spec.
   *
   * @param lastCp The last code point of the entity. Used to see if the
   *               entity was terminated with a semicolon.
   * @param expectedLength The minimum number of characters that should be
   *                       consumed. Used to validate that at least one digit
   *                       was consumed.
   * @returns The number of characters that were consumed.
   */
  emitNumericEntity(e, n) {
    var r;
    if (this.consumed <= n)
      return (r = this.errors) === null || r === void 0 || r.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
    if (e === Ye.SEMI)
      this.consumed += 1;
    else if (this.decodeMode === Dn.Strict)
      return 0;
    return this.emitCodePoint(vk(this.result), this.consumed), this.errors && (e !== Ye.SEMI && this.errors.missingSemicolonAfterCharacterReference(), this.errors.validateNumericCharacterReference(this.result)), this.consumed;
  }
  /**
   * Parses a named entity.
   *
   * Equivalent to the `Named character reference state` in the HTML spec.
   *
   * @param str The string containing the entity (or a continuation of the entity).
   * @param offset The current offset.
   * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
   */
  stateNamedEntity(e, n) {
    const { decodeTree: r } = this;
    let i = r[this.treeIndex], o = (i & Bn.VALUE_LENGTH) >> 14;
    for (; n < e.length; n++, this.excess++) {
      const a = e.charCodeAt(n);
      if (this.treeIndex = xk(r, i, this.treeIndex + Math.max(1, o), a), this.treeIndex < 0)
        return this.result === 0 || // If we are parsing an attribute
        this.decodeMode === Dn.Attribute && // We shouldn't have consumed any characters after the entity,
        (o === 0 || // And there should be no invalid characters.
        Ak(a)) ? 0 : this.emitNotTerminatedNamedEntity();
      if (i = r[this.treeIndex], o = (i & Bn.VALUE_LENGTH) >> 14, o !== 0) {
        if (a === Ye.SEMI)
          return this.emitNamedEntityData(this.treeIndex, o, this.consumed + this.excess);
        this.decodeMode !== Dn.Strict && (this.result = this.treeIndex, this.consumed += this.excess, this.excess = 0);
      }
    }
    return -1;
  }
  /**
   * Emit a named entity that was not terminated with a semicolon.
   *
   * @returns The number of characters consumed.
   */
  emitNotTerminatedNamedEntity() {
    var e;
    const { result: n, decodeTree: r } = this, i = (r[n] & Bn.VALUE_LENGTH) >> 14;
    return this.emitNamedEntityData(n, i, this.consumed), (e = this.errors) === null || e === void 0 || e.missingSemicolonAfterCharacterReference(), this.consumed;
  }
  /**
   * Emit a named entity.
   *
   * @param result The index of the entity in the decode tree.
   * @param valueLength The number of bytes in the entity.
   * @param consumed The number of characters consumed.
   *
   * @returns The number of characters consumed.
   */
  emitNamedEntityData(e, n, r) {
    const { decodeTree: i } = this;
    return this.emitCodePoint(n === 1 ? i[e] & ~Bn.VALUE_LENGTH : i[e + 1], r), n === 3 && this.emitCodePoint(i[e + 2], r), r;
  }
  /**
   * Signal to the parser that the end of the input was reached.
   *
   * Remaining data will be emitted and relevant errors will be produced.
   *
   * @returns The number of characters consumed.
   */
  end() {
    var e;
    switch (this.state) {
      case Ve.NamedEntity:
        return this.result !== 0 && (this.decodeMode !== Dn.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
      case Ve.NumericDecimal:
        return this.emitNumericEntity(0, 2);
      case Ve.NumericHex:
        return this.emitNumericEntity(0, 3);
      case Ve.NumericStart:
        return (e = this.errors) === null || e === void 0 || e.absenceOfDigitsInNumericCharacterReference(this.consumed), 0;
      case Ve.EntityStart:
        return 0;
    }
  }
}
function rE(t) {
  let e = "";
  const n = new Ik(t, (r) => e += yk(r));
  return function(i, o) {
    let a = 0, s = 0;
    for (; (s = i.indexOf("&", s)) >= 0; ) {
      e += i.slice(a, s), n.startEntity(o);
      const c = n.write(
        i,
        // Skip the "&"
        s + 1
      );
      if (c < 0) {
        a = s + n.end();
        break;
      }
      a = s + c, s = c === 0 ? a + 1 : a;
    }
    const l = e + i.slice(a);
    return e = "", l;
  };
}
function xk(t, e, n, r) {
  const i = (e & Bn.BRANCH_LENGTH) >> 7, o = e & Bn.JUMP_TABLE;
  if (i === 0)
    return o !== 0 && r === o ? n : -1;
  if (o) {
    const l = r - o;
    return l < 0 || l >= i ? -1 : t[n + l] - 1;
  }
  let a = n, s = a + i - 1;
  for (; a <= s; ) {
    const l = a + s >>> 1, c = t[l];
    if (c < r)
      a = l + 1;
    else if (c > r)
      s = l - 1;
    else
      return t[l + i];
  }
  return -1;
}
const Dk = rE(bk);
rE(Tk);
function iE(t, e = Dn.Legacy) {
  return Dk(t, e);
}
function wk(t) {
  return Object.prototype.toString.call(t);
}
function Yu(t) {
  return wk(t) === "[object String]";
}
const Mk = Object.prototype.hasOwnProperty;
function Lk(t, e) {
  return Mk.call(t, e);
}
function Hs(t) {
  return Array.prototype.slice.call(arguments, 1).forEach(function(n) {
    if (n) {
      if (typeof n != "object")
        throw new TypeError(n + "must be object");
      Object.keys(n).forEach(function(r) {
        t[r] = n[r];
      });
    }
  }), t;
}
function oE(t, e, n) {
  return [].concat(t.slice(0, e), n, t.slice(e + 1));
}
function $u(t) {
  return !(t >= 55296 && t <= 57343 || t >= 64976 && t <= 65007 || (t & 65535) === 65535 || (t & 65535) === 65534 || t >= 0 && t <= 8 || t === 11 || t >= 14 && t <= 31 || t >= 127 && t <= 159 || t > 1114111);
}
function cs(t) {
  if (t > 65535) {
    t -= 65536;
    const e = 55296 + (t >> 10), n = 56320 + (t & 1023);
    return String.fromCharCode(e, n);
  }
  return String.fromCharCode(t);
}
const aE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, kk = /&([a-z#][a-z0-9]{1,31});/gi, Pk = new RegExp(aE.source + "|" + kk.source, "gi"), Fk = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
function Bk(t, e) {
  if (e.charCodeAt(0) === 35 && Fk.test(e)) {
    const r = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);
    return $u(r) ? cs(r) : t;
  }
  const n = iE(t);
  return n !== t ? n : t;
}
function Uk(t) {
  return t.indexOf("\\") < 0 ? t : t.replace(aE, "$1");
}
function ci(t) {
  return t.indexOf("\\") < 0 && t.indexOf("&") < 0 ? t : t.replace(Pk, function(e, n, r) {
    return n || Bk(e, r);
  });
}
const Hk = /[&<>"]/, Gk = /[&<>"]/g, Vk = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;"
};
function Yk(t) {
  return Vk[t];
}
function qn(t) {
  return Hk.test(t) ? t.replace(Gk, Yk) : t;
}
const $k = /[.?*+^$[\]\\(){}|-]/g;
function zk(t) {
  return t.replace($k, "\\$&");
}
function Ae(t) {
  switch (t) {
    case 9:
    case 32:
      return !0;
  }
  return !1;
}
function uo(t) {
  if (t >= 8192 && t <= 8202)
    return !0;
  switch (t) {
    case 9:
    case 10:
    case 11:
    case 12:
    case 13:
    case 32:
    case 160:
    case 5760:
    case 8239:
    case 8287:
    case 12288:
      return !0;
  }
  return !1;
}
function po(t) {
  return Vu.test(t) || tE.test(t);
}
function _o(t) {
  switch (t) {
    case 33:
    case 34:
    case 35:
    case 36:
    case 37:
    case 38:
    case 39:
    case 40:
    case 41:
    case 42:
    case 43:
    case 44:
    case 45:
    case 46:
    case 47:
    case 58:
    case 59:
    case 60:
    case 61:
    case 62:
    case 63:
    case 64:
    case 91:
    case 92:
    case 93:
    case 94:
    case 95:
    case 96:
    case 123:
    case 124:
    case 125:
    case 126:
      return !0;
    default:
      return !1;
  }
}
function Gs(t) {
  return t = t.trim().replace(/\s+/g, " "), "ẞ".toLowerCase() === "Ṿ" && (t = t.replace(/ẞ/g, "ß")), t.toLowerCase().toUpperCase();
}
const qk = { mdurl: hk, ucmicro: Sk }, Wk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  arrayReplaceAt: oE,
  assign: Hs,
  escapeHtml: qn,
  escapeRE: zk,
  fromCodePoint: cs,
  has: Lk,
  isMdAsciiPunct: _o,
  isPunctChar: po,
  isSpace: Ae,
  isString: Yu,
  isValidEntityCode: $u,
  isWhiteSpace: uo,
  lib: qk,
  normalizeReference: Gs,
  unescapeAll: ci,
  unescapeMd: Uk
}, Symbol.toStringTag, { value: "Module" }));
function Kk(t, e, n) {
  let r, i, o, a;
  const s = t.posMax, l = t.pos;
  for (t.pos = e + 1, r = 1; t.pos < s; ) {
    if (o = t.src.charCodeAt(t.pos), o === 93 && (r--, r === 0)) {
      i = !0;
      break;
    }
    if (a = t.pos, t.md.inline.skipToken(t), o === 91) {
      if (a === t.pos - 1)
        r++;
      else if (n)
        return t.pos = l, -1;
    }
  }
  let c = -1;
  return i && (c = t.pos), t.pos = l, c;
}
function Qk(t, e, n) {
  let r, i = e;
  const o = {
    ok: !1,
    pos: 0,
    str: ""
  };
  if (t.charCodeAt(i) === 60) {
    for (i++; i < n; ) {
      if (r = t.charCodeAt(i), r === 10 || r === 60)
        return o;
      if (r === 62)
        return o.pos = i + 1, o.str = ci(t.slice(e + 1, i)), o.ok = !0, o;
      if (r === 92 && i + 1 < n) {
        i += 2;
        continue;
      }
      i++;
    }
    return o;
  }
  let a = 0;
  for (; i < n && (r = t.charCodeAt(i), !(r === 32 || r < 32 || r === 127)); ) {
    if (r === 92 && i + 1 < n) {
      if (t.charCodeAt(i + 1) === 32)
        break;
      i += 2;
      continue;
    }
    if (r === 40 && (a++, a > 32))
      return o;
    if (r === 41) {
      if (a === 0)
        break;
      a--;
    }
    i++;
  }
  return e === i || a !== 0 || (o.str = ci(t.slice(e, i)), o.pos = i, o.ok = !0), o;
}
function Zk(t, e, n, r) {
  let i, o = e;
  const a = {
    // if `true`, this is a valid link title
    ok: !1,
    // if `true`, this link can be continued on the next line
    can_continue: !1,
    // if `ok`, it's the position of the first character after the closing marker
    pos: 0,
    // if `ok`, it's the unescaped title
    str: "",
    // expected closing marker character code
    marker: 0
  };
  if (r)
    a.str = r.str, a.marker = r.marker;
  else {
    if (o >= n)
      return a;
    let s = t.charCodeAt(o);
    if (s !== 34 && s !== 39 && s !== 40)
      return a;
    e++, o++, s === 40 && (s = 41), a.marker = s;
  }
  for (; o < n; ) {
    if (i = t.charCodeAt(o), i === a.marker)
      return a.pos = o + 1, a.str += ci(t.slice(e, o)), a.ok = !0, a;
    if (i === 40 && a.marker === 41)
      return a;
    i === 92 && o + 1 < n && o++, o++;
  }
  return a.can_continue = !0, a.str += ci(t.slice(e, o)), a;
}
const Xk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  parseLinkDestination: Qk,
  parseLinkLabel: Kk,
  parseLinkTitle: Zk
}, Symbol.toStringTag, { value: "Module" })), an = {};
an.code_inline = function(t, e, n, r, i) {
  const o = t[e];
  return "<code" + i.renderAttrs(o) + ">" + qn(o.content) + "</code>";
};
an.code_block = function(t, e, n, r, i) {
  const o = t[e];
  return "<pre" + i.renderAttrs(o) + "><code>" + qn(t[e].content) + `</code></pre>
`;
};
an.fence = function(t, e, n, r, i) {
  const o = t[e], a = o.info ? ci(o.info).trim() : "";
  let s = "", l = "";
  if (a) {
    const u = a.split(/(\s+)/g);
    s = u[0], l = u.slice(2).join("");
  }
  let c;
  if (n.highlight ? c = n.highlight(o.content, s, l) || qn(o.content) : c = qn(o.content), c.indexOf("<pre") === 0)
    return c + `
`;
  if (a) {
    const u = o.attrIndex("class"), d = o.attrs ? o.attrs.slice() : [];
    u < 0 ? d.push(["class", n.langPrefix + s]) : (d[u] = d[u].slice(), d[u][1] += " " + n.langPrefix + s);
    const p = {
      attrs: d
    };
    return `<pre><code${i.renderAttrs(p)}>${c}</code></pre>
`;
  }
  return `<pre><code${i.renderAttrs(o)}>${c}</code></pre>
`;
};
an.image = function(t, e, n, r, i) {
  const o = t[e];
  return o.attrs[o.attrIndex("alt")][1] = i.renderInlineAsText(o.children, n, r), i.renderToken(t, e, n);
};
an.hardbreak = function(t, e, n) {
  return n.xhtmlOut ? `<br />
` : `<br>
`;
};
an.softbreak = function(t, e, n) {
  return n.breaks ? n.xhtmlOut ? `<br />
` : `<br>
` : `
`;
};
an.text = function(t, e) {
  return qn(t[e].content);
};
an.html_block = function(t, e) {
  return t[e].content;
};
an.html_inline = function(t, e) {
  return t[e].content;
};
function mi() {
  this.rules = Hs({}, an);
}
mi.prototype.renderAttrs = function(e) {
  let n, r, i;
  if (!e.attrs)
    return "";
  for (i = "", n = 0, r = e.attrs.length; n < r; n++)
    i += " " + qn(e.attrs[n][0]) + '="' + qn(e.attrs[n][1]) + '"';
  return i;
};
mi.prototype.renderToken = function(e, n, r) {
  const i = e[n];
  let o = "";
  if (i.hidden)
    return "";
  i.block && i.nesting !== -1 && n && e[n - 1].hidden && (o += `
`), o += (i.nesting === -1 ? "</" : "<") + i.tag, o += this.renderAttrs(i), i.nesting === 0 && r.xhtmlOut && (o += " /");
  let a = !1;
  if (i.block && (a = !0, i.nesting === 1 && n + 1 < e.length)) {
    const s = e[n + 1];
    (s.type === "inline" || s.hidden || s.nesting === -1 && s.tag === i.tag) && (a = !1);
  }
  return o += a ? `>
` : ">", o;
};
mi.prototype.renderInline = function(t, e, n) {
  let r = "";
  const i = this.rules;
  for (let o = 0, a = t.length; o < a; o++) {
    const s = t[o].type;
    typeof i[s] < "u" ? r += i[s](t, o, e, n, this) : r += this.renderToken(t, o, e);
  }
  return r;
};
mi.prototype.renderInlineAsText = function(t, e, n) {
  let r = "";
  for (let i = 0, o = t.length; i < o; i++)
    switch (t[i].type) {
      case "text":
        r += t[i].content;
        break;
      case "image":
        r += this.renderInlineAsText(t[i].children, e, n);
        break;
      case "html_inline":
      case "html_block":
        r += t[i].content;
        break;
      case "softbreak":
      case "hardbreak":
        r += `
`;
        break;
    }
  return r;
};
mi.prototype.render = function(t, e, n) {
  let r = "";
  const i = this.rules;
  for (let o = 0, a = t.length; o < a; o++) {
    const s = t[o].type;
    s === "inline" ? r += this.renderInline(t[o].children, e, n) : typeof i[s] < "u" ? r += i[s](t, o, e, n, this) : r += this.renderToken(t, o, e, n);
  }
  return r;
};
function bt() {
  this.__rules__ = [], this.__cache__ = null;
}
bt.prototype.__find__ = function(t) {
  for (let e = 0; e < this.__rules__.length; e++)
    if (this.__rules__[e].name === t)
      return e;
  return -1;
};
bt.prototype.__compile__ = function() {
  const t = this, e = [""];
  t.__rules__.forEach(function(n) {
    n.enabled && n.alt.forEach(function(r) {
      e.indexOf(r) < 0 && e.push(r);
    });
  }), t.__cache__ = {}, e.forEach(function(n) {
    t.__cache__[n] = [], t.__rules__.forEach(function(r) {
      r.enabled && (n && r.alt.indexOf(n) < 0 || t.__cache__[n].push(r.fn));
    });
  });
};
bt.prototype.at = function(t, e, n) {
  const r = this.__find__(t), i = n || {};
  if (r === -1)
    throw new Error("Parser rule not found: " + t);
  this.__rules__[r].fn = e, this.__rules__[r].alt = i.alt || [], this.__cache__ = null;
};
bt.prototype.before = function(t, e, n, r) {
  const i = this.__find__(t), o = r || {};
  if (i === -1)
    throw new Error("Parser rule not found: " + t);
  this.__rules__.splice(i, 0, {
    name: e,
    enabled: !0,
    fn: n,
    alt: o.alt || []
  }), this.__cache__ = null;
};
bt.prototype.after = function(t, e, n, r) {
  const i = this.__find__(t), o = r || {};
  if (i === -1)
    throw new Error("Parser rule not found: " + t);
  this.__rules__.splice(i + 1, 0, {
    name: e,
    enabled: !0,
    fn: n,
    alt: o.alt || []
  }), this.__cache__ = null;
};
bt.prototype.push = function(t, e, n) {
  const r = n || {};
  this.__rules__.push({
    name: t,
    enabled: !0,
    fn: e,
    alt: r.alt || []
  }), this.__cache__ = null;
};
bt.prototype.enable = function(t, e) {
  Array.isArray(t) || (t = [t]);
  const n = [];
  return t.forEach(function(r) {
    const i = this.__find__(r);
    if (i < 0) {
      if (e)
        return;
      throw new Error("Rules manager: invalid rule name " + r);
    }
    this.__rules__[i].enabled = !0, n.push(r);
  }, this), this.__cache__ = null, n;
};
bt.prototype.enableOnly = function(t, e) {
  Array.isArray(t) || (t = [t]), this.__rules__.forEach(function(n) {
    n.enabled = !1;
  }), this.enable(t, e);
};
bt.prototype.disable = function(t, e) {
  Array.isArray(t) || (t = [t]);
  const n = [];
  return t.forEach(function(r) {
    const i = this.__find__(r);
    if (i < 0) {
      if (e)
        return;
      throw new Error("Rules manager: invalid rule name " + r);
    }
    this.__rules__[i].enabled = !1, n.push(r);
  }, this), this.__cache__ = null, n;
};
bt.prototype.getRules = function(t) {
  return this.__cache__ === null && this.__compile__(), this.__cache__[t] || [];
};
function $t(t, e, n) {
  this.type = t, this.tag = e, this.attrs = null, this.map = null, this.nesting = n, this.level = 0, this.children = null, this.content = "", this.markup = "", this.info = "", this.meta = null, this.block = !1, this.hidden = !1;
}
$t.prototype.attrIndex = function(e) {
  if (!this.attrs)
    return -1;
  const n = this.attrs;
  for (let r = 0, i = n.length; r < i; r++)
    if (n[r][0] === e)
      return r;
  return -1;
};
$t.prototype.attrPush = function(e) {
  this.attrs ? this.attrs.push(e) : this.attrs = [e];
};
$t.prototype.attrSet = function(e, n) {
  const r = this.attrIndex(e), i = [e, n];
  r < 0 ? this.attrPush(i) : this.attrs[r] = i;
};
$t.prototype.attrGet = function(e) {
  const n = this.attrIndex(e);
  let r = null;
  return n >= 0 && (r = this.attrs[n][1]), r;
};
$t.prototype.attrJoin = function(e, n) {
  const r = this.attrIndex(e);
  r < 0 ? this.attrPush([e, n]) : this.attrs[r][1] = this.attrs[r][1] + " " + n;
};
function sE(t, e, n) {
  this.src = t, this.env = n, this.tokens = [], this.inlineMode = !1, this.md = e;
}
sE.prototype.Token = $t;
const jk = /\r\n?|\n/g, Jk = /\0/g;
function eP(t) {
  let e;
  e = t.src.replace(jk, `
`), e = e.replace(Jk, "�"), t.src = e;
}
function tP(t) {
  let e;
  t.inlineMode ? (e = new t.Token("inline", "", 0), e.content = t.src, e.map = [0, 1], e.children = [], t.tokens.push(e)) : t.md.block.parse(t.src, t.md, t.env, t.tokens);
}
function nP(t) {
  const e = t.tokens;
  for (let n = 0, r = e.length; n < r; n++) {
    const i = e[n];
    i.type === "inline" && t.md.inline.parse(i.content, t.md, t.env, i.children);
  }
}
function rP(t) {
  return /^<a[>\s]/i.test(t);
}
function iP(t) {
  return /^<\/a\s*>/i.test(t);
}
function oP(t) {
  const e = t.tokens;
  if (t.md.options.linkify)
    for (let n = 0, r = e.length; n < r; n++) {
      if (e[n].type !== "inline" || !t.md.linkify.pretest(e[n].content))
        continue;
      let i = e[n].children, o = 0;
      for (let a = i.length - 1; a >= 0; a--) {
        const s = i[a];
        if (s.type === "link_close") {
          for (a--; i[a].level !== s.level && i[a].type !== "link_open"; )
            a--;
          continue;
        }
        if (s.type === "html_inline" && (rP(s.content) && o > 0 && o--, iP(s.content) && o++), !(o > 0) && s.type === "text" && t.md.linkify.test(s.content)) {
          const l = s.content;
          let c = t.md.linkify.match(l);
          const u = [];
          let d = s.level, p = 0;
          c.length > 0 && c[0].index === 0 && a > 0 && i[a - 1].type === "text_special" && (c = c.slice(1));
          for (let _ = 0; _ < c.length; _++) {
            const m = c[_].url, f = t.md.normalizeLink(m);
            if (!t.md.validateLink(f))
              continue;
            let g = c[_].text;
            c[_].schema ? c[_].schema === "mailto:" && !/^mailto:/i.test(g) ? g = t.md.normalizeLinkText("mailto:" + g).replace(/^mailto:/, "") : g = t.md.normalizeLinkText(g) : g = t.md.normalizeLinkText("http://" + g).replace(/^http:\/\//, "");
            const S = c[_].index;
            if (S > p) {
              const T = new t.Token("text", "", 0);
              T.content = l.slice(p, S), T.level = d, u.push(T);
            }
            const E = new t.Token("link_open", "a", 1);
            E.attrs = [["href", f]], E.level = d++, E.markup = "linkify", E.info = "auto", u.push(E);
            const b = new t.Token("text", "", 0);
            b.content = g, b.level = d, u.push(b);
            const h = new t.Token("link_close", "a", -1);
            h.level = --d, h.markup = "linkify", h.info = "auto", u.push(h), p = c[_].lastIndex;
          }
          if (p < l.length) {
            const _ = new t.Token("text", "", 0);
            _.content = l.slice(p), _.level = d, u.push(_);
          }
          e[n].children = i = oE(i, a, u);
        }
      }
    }
}
const lE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/, aP = /\((c|tm|r)\)/i, sP = /\((c|tm|r)\)/ig, lP = {
  c: "©",
  r: "®",
  tm: "™"
};
function cP(t, e) {
  return lP[e.toLowerCase()];
}
function uP(t) {
  let e = 0;
  for (let n = t.length - 1; n >= 0; n--) {
    const r = t[n];
    r.type === "text" && !e && (r.content = r.content.replace(sP, cP)), r.type === "link_open" && r.info === "auto" && e--, r.type === "link_close" && r.info === "auto" && e++;
  }
}
function dP(t) {
  let e = 0;
  for (let n = t.length - 1; n >= 0; n--) {
    const r = t[n];
    r.type === "text" && !e && lE.test(r.content) && (r.content = r.content.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/mg, "$1—").replace(/(^|\s)--(?=\s|$)/mg, "$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, "$1–")), r.type === "link_open" && r.info === "auto" && e--, r.type === "link_close" && r.info === "auto" && e++;
  }
}
function pP(t) {
  let e;
  if (t.md.options.typographer)
    for (e = t.tokens.length - 1; e >= 0; e--)
      t.tokens[e].type === "inline" && (aP.test(t.tokens[e].content) && uP(t.tokens[e].children), lE.test(t.tokens[e].content) && dP(t.tokens[e].children));
}
const _P = /['"]/, lm = /['"]/g, cm = "’";
function ea(t, e, n) {
  return t.slice(0, e) + n + t.slice(e + 1);
}
function mP(t, e) {
  let n;
  const r = [];
  for (let i = 0; i < t.length; i++) {
    const o = t[i], a = t[i].level;
    for (n = r.length - 1; n >= 0 && !(r[n].level <= a); n--)
      ;
    if (r.length = n + 1, o.type !== "text")
      continue;
    let s = o.content, l = 0, c = s.length;
    e:
      for (; l < c; ) {
        lm.lastIndex = l;
        const u = lm.exec(s);
        if (!u)
          break;
        let d = !0, p = !0;
        l = u.index + 1;
        const _ = u[0] === "'";
        let m = 32;
        if (u.index - 1 >= 0)
          m = s.charCodeAt(u.index - 1);
        else
          for (n = i - 1; n >= 0 && !(t[n].type === "softbreak" || t[n].type === "hardbreak"); n--)
            if (t[n].content) {
              m = t[n].content.charCodeAt(t[n].content.length - 1);
              break;
            }
        let f = 32;
        if (l < c)
          f = s.charCodeAt(l);
        else
          for (n = i + 1; n < t.length && !(t[n].type === "softbreak" || t[n].type === "hardbreak"); n++)
            if (t[n].content) {
              f = t[n].content.charCodeAt(0);
              break;
            }
        const g = _o(m) || po(String.fromCharCode(m)), S = _o(f) || po(String.fromCharCode(f)), E = uo(m), b = uo(f);
        if (b ? d = !1 : S && (E || g || (d = !1)), E ? p = !1 : g && (b || S || (p = !1)), f === 34 && u[0] === '"' && m >= 48 && m <= 57 && (p = d = !1), d && p && (d = g, p = S), !d && !p) {
          _ && (o.content = ea(o.content, u.index, cm));
          continue;
        }
        if (p)
          for (n = r.length - 1; n >= 0; n--) {
            let h = r[n];
            if (r[n].level < a)
              break;
            if (h.single === _ && r[n].level === a) {
              h = r[n];
              let T, C;
              _ ? (T = e.md.options.quotes[2], C = e.md.options.quotes[3]) : (T = e.md.options.quotes[0], C = e.md.options.quotes[1]), o.content = ea(o.content, u.index, C), t[h.token].content = ea(
                t[h.token].content,
                h.pos,
                T
              ), l += C.length - 1, h.token === i && (l += T.length - 1), s = o.content, c = s.length, r.length = n;
              continue e;
            }
          }
        d ? r.push({
          token: i,
          pos: u.index,
          single: _,
          level: a
        }) : p && _ && (o.content = ea(o.content, u.index, cm));
      }
  }
}
function fP(t) {
  if (t.md.options.typographer)
    for (let e = t.tokens.length - 1; e >= 0; e--)
      t.tokens[e].type !== "inline" || !_P.test(t.tokens[e].content) || mP(t.tokens[e].children, t);
}
function gP(t) {
  let e, n;
  const r = t.tokens, i = r.length;
  for (let o = 0; o < i; o++) {
    if (r[o].type !== "inline") continue;
    const a = r[o].children, s = a.length;
    for (e = 0; e < s; e++)
      a[e].type === "text_special" && (a[e].type = "text");
    for (e = n = 0; e < s; e++)
      a[e].type === "text" && e + 1 < s && a[e + 1].type === "text" ? a[e + 1].content = a[e].content + a[e + 1].content : (e !== n && (a[n] = a[e]), n++);
    e !== n && (a.length = n);
  }
}
const Pl = [
  ["normalize", eP],
  ["block", tP],
  ["inline", nP],
  ["linkify", oP],
  ["replacements", pP],
  ["smartquotes", fP],
  // `text_join` finds `text_special` tokens (for escape sequences)
  // and joins them with the rest of the text
  ["text_join", gP]
];
function zu() {
  this.ruler = new bt();
  for (let t = 0; t < Pl.length; t++)
    this.ruler.push(Pl[t][0], Pl[t][1]);
}
zu.prototype.process = function(t) {
  const e = this.ruler.getRules("");
  for (let n = 0, r = e.length; n < r; n++)
    e[n](t);
};
zu.prototype.State = sE;
function sn(t, e, n, r) {
  this.src = t, this.md = e, this.env = n, this.tokens = r, this.bMarks = [], this.eMarks = [], this.tShift = [], this.sCount = [], this.bsCount = [], this.blkIndent = 0, this.line = 0, this.lineMax = 0, this.tight = !1, this.ddIndent = -1, this.listIndent = -1, this.parentType = "root", this.level = 0;
  const i = this.src;
  for (let o = 0, a = 0, s = 0, l = 0, c = i.length, u = !1; a < c; a++) {
    const d = i.charCodeAt(a);
    if (!u)
      if (Ae(d)) {
        s++, d === 9 ? l += 4 - l % 4 : l++;
        continue;
      } else
        u = !0;
    (d === 10 || a === c - 1) && (d !== 10 && a++, this.bMarks.push(o), this.eMarks.push(a), this.tShift.push(s), this.sCount.push(l), this.bsCount.push(0), u = !1, s = 0, l = 0, o = a + 1);
  }
  this.bMarks.push(i.length), this.eMarks.push(i.length), this.tShift.push(0), this.sCount.push(0), this.bsCount.push(0), this.lineMax = this.bMarks.length - 1;
}
sn.prototype.push = function(t, e, n) {
  const r = new $t(t, e, n);
  return r.block = !0, n < 0 && this.level--, r.level = this.level, n > 0 && this.level++, this.tokens.push(r), r;
};
sn.prototype.isEmpty = function(e) {
  return this.bMarks[e] + this.tShift[e] >= this.eMarks[e];
};
sn.prototype.skipEmptyLines = function(e) {
  for (let n = this.lineMax; e < n && !(this.bMarks[e] + this.tShift[e] < this.eMarks[e]); e++)
    ;
  return e;
};
sn.prototype.skipSpaces = function(e) {
  for (let n = this.src.length; e < n; e++) {
    const r = this.src.charCodeAt(e);
    if (!Ae(r))
      break;
  }
  return e;
};
sn.prototype.skipSpacesBack = function(e, n) {
  if (e <= n)
    return e;
  for (; e > n; )
    if (!Ae(this.src.charCodeAt(--e)))
      return e + 1;
  return e;
};
sn.prototype.skipChars = function(e, n) {
  for (let r = this.src.length; e < r && this.src.charCodeAt(e) === n; e++)
    ;
  return e;
};
sn.prototype.skipCharsBack = function(e, n, r) {
  if (e <= r)
    return e;
  for (; e > r; )
    if (n !== this.src.charCodeAt(--e))
      return e + 1;
  return e;
};
sn.prototype.getLines = function(e, n, r, i) {
  if (e >= n)
    return "";
  const o = new Array(n - e);
  for (let a = 0, s = e; s < n; s++, a++) {
    let l = 0;
    const c = this.bMarks[s];
    let u = c, d;
    for (s + 1 < n || i ? d = this.eMarks[s] + 1 : d = this.eMarks[s]; u < d && l < r; ) {
      const p = this.src.charCodeAt(u);
      if (Ae(p))
        p === 9 ? l += 4 - (l + this.bsCount[s]) % 4 : l++;
      else if (u - c < this.tShift[s])
        l++;
      else
        break;
      u++;
    }
    l > r ? o[a] = new Array(l - r + 1).join(" ") + this.src.slice(u, d) : o[a] = this.src.slice(u, d);
  }
  return o.join("");
};
sn.prototype.Token = $t;
const hP = 65536;
function Fl(t, e) {
  const n = t.bMarks[e] + t.tShift[e], r = t.eMarks[e];
  return t.src.slice(n, r);
}
function um(t) {
  const e = [], n = t.length;
  let r = 0, i = t.charCodeAt(r), o = !1, a = 0, s = "";
  for (; r < n; )
    i === 124 && (o ? (s += t.substring(a, r - 1), a = r) : (e.push(s + t.substring(a, r)), s = "", a = r + 1)), o = i === 92, r++, i = t.charCodeAt(r);
  return e.push(s + t.substring(a)), e;
}
function EP(t, e, n, r) {
  if (e + 2 > n)
    return !1;
  let i = e + 1;
  if (t.sCount[i] < t.blkIndent || t.sCount[i] - t.blkIndent >= 4)
    return !1;
  let o = t.bMarks[i] + t.tShift[i];
  if (o >= t.eMarks[i])
    return !1;
  const a = t.src.charCodeAt(o++);
  if (a !== 124 && a !== 45 && a !== 58 || o >= t.eMarks[i])
    return !1;
  const s = t.src.charCodeAt(o++);
  if (s !== 124 && s !== 45 && s !== 58 && !Ae(s) || a === 45 && Ae(s))
    return !1;
  for (; o < t.eMarks[i]; ) {
    const h = t.src.charCodeAt(o);
    if (h !== 124 && h !== 45 && h !== 58 && !Ae(h))
      return !1;
    o++;
  }
  let l = Fl(t, e + 1), c = l.split("|");
  const u = [];
  for (let h = 0; h < c.length; h++) {
    const T = c[h].trim();
    if (!T) {
      if (h === 0 || h === c.length - 1)
        continue;
      return !1;
    }
    if (!/^:?-+:?$/.test(T))
      return !1;
    T.charCodeAt(T.length - 1) === 58 ? u.push(T.charCodeAt(0) === 58 ? "center" : "right") : T.charCodeAt(0) === 58 ? u.push("left") : u.push("");
  }
  if (l = Fl(t, e).trim(), l.indexOf("|") === -1 || t.sCount[e] - t.blkIndent >= 4)
    return !1;
  c = um(l), c.length && c[0] === "" && c.shift(), c.length && c[c.length - 1] === "" && c.pop();
  const d = c.length;
  if (d === 0 || d !== u.length)
    return !1;
  if (r)
    return !0;
  const p = t.parentType;
  t.parentType = "table";
  const _ = t.md.block.ruler.getRules("blockquote"), m = t.push("table_open", "table", 1), f = [e, 0];
  m.map = f;
  const g = t.push("thead_open", "thead", 1);
  g.map = [e, e + 1];
  const S = t.push("tr_open", "tr", 1);
  S.map = [e, e + 1];
  for (let h = 0; h < c.length; h++) {
    const T = t.push("th_open", "th", 1);
    u[h] && (T.attrs = [["style", "text-align:" + u[h]]]);
    const C = t.push("inline", "", 0);
    C.content = c[h].trim(), C.children = [], t.push("th_close", "th", -1);
  }
  t.push("tr_close", "tr", -1), t.push("thead_close", "thead", -1);
  let E, b = 0;
  for (i = e + 2; i < n && !(t.sCount[i] < t.blkIndent); i++) {
    let h = !1;
    for (let C = 0, v = _.length; C < v; C++)
      if (_[C](t, i, n, !0)) {
        h = !0;
        break;
      }
    if (h || (l = Fl(t, i).trim(), !l) || t.sCount[i] - t.blkIndent >= 4 || (c = um(l), c.length && c[0] === "" && c.shift(), c.length && c[c.length - 1] === "" && c.pop(), b += d - c.length, b > hP))
      break;
    if (i === e + 2) {
      const C = t.push("tbody_open", "tbody", 1);
      C.map = E = [e + 2, 0];
    }
    const T = t.push("tr_open", "tr", 1);
    T.map = [i, i + 1];
    for (let C = 0; C < d; C++) {
      const v = t.push("td_open", "td", 1);
      u[C] && (v.attrs = [["style", "text-align:" + u[C]]]);
      const I = t.push("inline", "", 0);
      I.content = c[C] ? c[C].trim() : "", I.children = [], t.push("td_close", "td", -1);
    }
    t.push("tr_close", "tr", -1);
  }
  return E && (t.push("tbody_close", "tbody", -1), E[1] = i), t.push("table_close", "table", -1), f[1] = i, t.parentType = p, t.line = i, !0;
}
function SP(t, e, n) {
  if (t.sCount[e] - t.blkIndent < 4)
    return !1;
  let r = e + 1, i = r;
  for (; r < n; ) {
    if (t.isEmpty(r)) {
      r++;
      continue;
    }
    if (t.sCount[r] - t.blkIndent >= 4) {
      r++, i = r;
      continue;
    }
    break;
  }
  t.line = i;
  const o = t.push("code_block", "code", 0);
  return o.content = t.getLines(e, i, 4 + t.blkIndent, !1) + `
`, o.map = [e, t.line], !0;
}
function bP(t, e, n, r) {
  let i = t.bMarks[e] + t.tShift[e], o = t.eMarks[e];
  if (t.sCount[e] - t.blkIndent >= 4 || i + 3 > o)
    return !1;
  const a = t.src.charCodeAt(i);
  if (a !== 126 && a !== 96)
    return !1;
  let s = i;
  i = t.skipChars(i, a);
  let l = i - s;
  if (l < 3)
    return !1;
  const c = t.src.slice(s, i), u = t.src.slice(i, o);
  if (a === 96 && u.indexOf(String.fromCharCode(a)) >= 0)
    return !1;
  if (r)
    return !0;
  let d = e, p = !1;
  for (; d++, !(d >= n || (i = s = t.bMarks[d] + t.tShift[d], o = t.eMarks[d], i < o && t.sCount[d] < t.blkIndent)); )
    if (t.src.charCodeAt(i) === a && !(t.sCount[d] - t.blkIndent >= 4) && (i = t.skipChars(i, a), !(i - s < l) && (i = t.skipSpaces(i), !(i < o)))) {
      p = !0;
      break;
    }
  l = t.sCount[e], t.line = d + (p ? 1 : 0);
  const _ = t.push("fence", "code", 0);
  return _.info = u, _.content = t.getLines(e + 1, d, l, !0), _.markup = c, _.map = [e, t.line], !0;
}
function TP(t, e, n, r) {
  let i = t.bMarks[e] + t.tShift[e], o = t.eMarks[e];
  const a = t.lineMax;
  if (t.sCount[e] - t.blkIndent >= 4 || t.src.charCodeAt(i) !== 62)
    return !1;
  if (r)
    return !0;
  const s = [], l = [], c = [], u = [], d = t.md.block.ruler.getRules("blockquote"), p = t.parentType;
  t.parentType = "blockquote";
  let _ = !1, m;
  for (m = e; m < n; m++) {
    const b = t.sCount[m] < t.blkIndent;
    if (i = t.bMarks[m] + t.tShift[m], o = t.eMarks[m], i >= o)
      break;
    if (t.src.charCodeAt(i++) === 62 && !b) {
      let T = t.sCount[m] + 1, C, v;
      t.src.charCodeAt(i) === 32 ? (i++, T++, v = !1, C = !0) : t.src.charCodeAt(i) === 9 ? (C = !0, (t.bsCount[m] + T) % 4 === 3 ? (i++, T++, v = !1) : v = !0) : C = !1;
      let I = T;
      for (s.push(t.bMarks[m]), t.bMarks[m] = i; i < o; ) {
        const N = t.src.charCodeAt(i);
        if (Ae(N))
          N === 9 ? I += 4 - (I + t.bsCount[m] + (v ? 1 : 0)) % 4 : I++;
        else
          break;
        i++;
      }
      _ = i >= o, l.push(t.bsCount[m]), t.bsCount[m] = t.sCount[m] + 1 + (C ? 1 : 0), c.push(t.sCount[m]), t.sCount[m] = I - T, u.push(t.tShift[m]), t.tShift[m] = i - t.bMarks[m];
      continue;
    }
    if (_)
      break;
    let h = !1;
    for (let T = 0, C = d.length; T < C; T++)
      if (d[T](t, m, n, !0)) {
        h = !0;
        break;
      }
    if (h) {
      t.lineMax = m, t.blkIndent !== 0 && (s.push(t.bMarks[m]), l.push(t.bsCount[m]), u.push(t.tShift[m]), c.push(t.sCount[m]), t.sCount[m] -= t.blkIndent);
      break;
    }
    s.push(t.bMarks[m]), l.push(t.bsCount[m]), u.push(t.tShift[m]), c.push(t.sCount[m]), t.sCount[m] = -1;
  }
  const f = t.blkIndent;
  t.blkIndent = 0;
  const g = t.push("blockquote_open", "blockquote", 1);
  g.markup = ">";
  const S = [e, 0];
  g.map = S, t.md.block.tokenize(t, e, m);
  const E = t.push("blockquote_close", "blockquote", -1);
  E.markup = ">", t.lineMax = a, t.parentType = p, S[1] = t.line;
  for (let b = 0; b < u.length; b++)
    t.bMarks[b + e] = s[b], t.tShift[b + e] = u[b], t.sCount[b + e] = c[b], t.bsCount[b + e] = l[b];
  return t.blkIndent = f, !0;
}
function CP(t, e, n, r) {
  const i = t.eMarks[e];
  if (t.sCount[e] - t.blkIndent >= 4)
    return !1;
  let o = t.bMarks[e] + t.tShift[e];
  const a = t.src.charCodeAt(o++);
  if (a !== 42 && a !== 45 && a !== 95)
    return !1;
  let s = 1;
  for (; o < i; ) {
    const c = t.src.charCodeAt(o++);
    if (c !== a && !Ae(c))
      return !1;
    c === a && s++;
  }
  if (s < 3)
    return !1;
  if (r)
    return !0;
  t.line = e + 1;
  const l = t.push("hr", "hr", 0);
  return l.map = [e, t.line], l.markup = Array(s + 1).join(String.fromCharCode(a)), !0;
}
function dm(t, e) {
  const n = t.eMarks[e];
  let r = t.bMarks[e] + t.tShift[e];
  const i = t.src.charCodeAt(r++);
  if (i !== 42 && i !== 45 && i !== 43)
    return -1;
  if (r < n) {
    const o = t.src.charCodeAt(r);
    if (!Ae(o))
      return -1;
  }
  return r;
}
function pm(t, e) {
  const n = t.bMarks[e] + t.tShift[e], r = t.eMarks[e];
  let i = n;
  if (i + 1 >= r)
    return -1;
  let o = t.src.charCodeAt(i++);
  if (o < 48 || o > 57)
    return -1;
  for (; ; ) {
    if (i >= r)
      return -1;
    if (o = t.src.charCodeAt(i++), o >= 48 && o <= 57) {
      if (i - n >= 10)
        return -1;
      continue;
    }
    if (o === 41 || o === 46)
      break;
    return -1;
  }
  return i < r && (o = t.src.charCodeAt(i), !Ae(o)) ? -1 : i;
}
function yP(t, e) {
  const n = t.level + 2;
  for (let r = e + 2, i = t.tokens.length - 2; r < i; r++)
    t.tokens[r].level === n && t.tokens[r].type === "paragraph_open" && (t.tokens[r + 2].hidden = !0, t.tokens[r].hidden = !0, r += 2);
}
function vP(t, e, n, r) {
  let i, o, a, s, l = e, c = !0;
  if (t.sCount[l] - t.blkIndent >= 4 || t.listIndent >= 0 && t.sCount[l] - t.listIndent >= 4 && t.sCount[l] < t.blkIndent)
    return !1;
  let u = !1;
  r && t.parentType === "paragraph" && t.sCount[l] >= t.blkIndent && (u = !0);
  let d, p, _;
  if ((_ = pm(t, l)) >= 0) {
    if (d = !0, a = t.bMarks[l] + t.tShift[l], p = Number(t.src.slice(a, _ - 1)), u && p !== 1) return !1;
  } else if ((_ = dm(t, l)) >= 0)
    d = !1;
  else
    return !1;
  if (u && t.skipSpaces(_) >= t.eMarks[l])
    return !1;
  if (r)
    return !0;
  const m = t.src.charCodeAt(_ - 1), f = t.tokens.length;
  d ? (s = t.push("ordered_list_open", "ol", 1), p !== 1 && (s.attrs = [["start", p]])) : s = t.push("bullet_list_open", "ul", 1);
  const g = [l, 0];
  s.map = g, s.markup = String.fromCharCode(m);
  let S = !1;
  const E = t.md.block.ruler.getRules("list"), b = t.parentType;
  for (t.parentType = "list"; l < n; ) {
    o = _, i = t.eMarks[l];
    const h = t.sCount[l] + _ - (t.bMarks[l] + t.tShift[l]);
    let T = h;
    for (; o < i; ) {
      const V = t.src.charCodeAt(o);
      if (V === 9)
        T += 4 - (T + t.bsCount[l]) % 4;
      else if (V === 32)
        T++;
      else
        break;
      o++;
    }
    const C = o;
    let v;
    C >= i ? v = 1 : v = T - h, v > 4 && (v = 1);
    const I = h + v;
    s = t.push("list_item_open", "li", 1), s.markup = String.fromCharCode(m);
    const N = [l, 0];
    s.map = N, d && (s.info = t.src.slice(a, _ - 1));
    const x = t.tight, P = t.tShift[l], Y = t.sCount[l], Z = t.listIndent;
    if (t.listIndent = t.blkIndent, t.blkIndent = I, t.tight = !0, t.tShift[l] = C - t.bMarks[l], t.sCount[l] = T, C >= i && t.isEmpty(l + 1) ? t.line = Math.min(t.line + 2, n) : t.md.block.tokenize(t, l, n, !0), (!t.tight || S) && (c = !1), S = t.line - l > 1 && t.isEmpty(t.line - 1), t.blkIndent = t.listIndent, t.listIndent = Z, t.tShift[l] = P, t.sCount[l] = Y, t.tight = x, s = t.push("list_item_close", "li", -1), s.markup = String.fromCharCode(m), l = t.line, N[1] = l, l >= n || t.sCount[l] < t.blkIndent || t.sCount[l] - t.blkIndent >= 4)
      break;
    let q = !1;
    for (let V = 0, O = E.length; V < O; V++)
      if (E[V](t, l, n, !0)) {
        q = !0;
        break;
      }
    if (q)
      break;
    if (d) {
      if (_ = pm(t, l), _ < 0)
        break;
      a = t.bMarks[l] + t.tShift[l];
    } else if (_ = dm(t, l), _ < 0)
      break;
    if (m !== t.src.charCodeAt(_ - 1))
      break;
  }
  return d ? s = t.push("ordered_list_close", "ol", -1) : s = t.push("bullet_list_close", "ul", -1), s.markup = String.fromCharCode(m), g[1] = l, t.line = l, t.parentType = b, c && yP(t, f), !0;
}
function RP(t, e, n, r) {
  let i = t.bMarks[e] + t.tShift[e], o = t.eMarks[e], a = e + 1;
  if (t.sCount[e] - t.blkIndent >= 4 || t.src.charCodeAt(i) !== 91)
    return !1;
  function s(E) {
    const b = t.lineMax;
    if (E >= b || t.isEmpty(E))
      return null;
    let h = !1;
    if (t.sCount[E] - t.blkIndent > 3 && (h = !0), t.sCount[E] < 0 && (h = !0), !h) {
      const v = t.md.block.ruler.getRules("reference"), I = t.parentType;
      t.parentType = "reference";
      let N = !1;
      for (let x = 0, P = v.length; x < P; x++)
        if (v[x](t, E, b, !0)) {
          N = !0;
          break;
        }
      if (t.parentType = I, N)
        return null;
    }
    const T = t.bMarks[E] + t.tShift[E], C = t.eMarks[E];
    return t.src.slice(T, C + 1);
  }
  let l = t.src.slice(i, o + 1);
  o = l.length;
  let c = -1;
  for (i = 1; i < o; i++) {
    const E = l.charCodeAt(i);
    if (E === 91)
      return !1;
    if (E === 93) {
      c = i;
      break;
    } else if (E === 10) {
      const b = s(a);
      b !== null && (l += b, o = l.length, a++);
    } else if (E === 92 && (i++, i < o && l.charCodeAt(i) === 10)) {
      const b = s(a);
      b !== null && (l += b, o = l.length, a++);
    }
  }
  if (c < 0 || l.charCodeAt(c + 1) !== 58)
    return !1;
  for (i = c + 2; i < o; i++) {
    const E = l.charCodeAt(i);
    if (E === 10) {
      const b = s(a);
      b !== null && (l += b, o = l.length, a++);
    } else if (!Ae(E)) break;
  }
  const u = t.md.helpers.parseLinkDestination(l, i, o);
  if (!u.ok)
    return !1;
  const d = t.md.normalizeLink(u.str);
  if (!t.md.validateLink(d))
    return !1;
  i = u.pos;
  const p = i, _ = a, m = i;
  for (; i < o; i++) {
    const E = l.charCodeAt(i);
    if (E === 10) {
      const b = s(a);
      b !== null && (l += b, o = l.length, a++);
    } else if (!Ae(E)) break;
  }
  let f = t.md.helpers.parseLinkTitle(l, i, o);
  for (; f.can_continue; ) {
    const E = s(a);
    if (E === null) break;
    l += E, i = o, o = l.length, a++, f = t.md.helpers.parseLinkTitle(l, i, o, f);
  }
  let g;
  for (i < o && m !== i && f.ok ? (g = f.str, i = f.pos) : (g = "", i = p, a = _); i < o; ) {
    const E = l.charCodeAt(i);
    if (!Ae(E))
      break;
    i++;
  }
  if (i < o && l.charCodeAt(i) !== 10 && g)
    for (g = "", i = p, a = _; i < o; ) {
      const E = l.charCodeAt(i);
      if (!Ae(E))
        break;
      i++;
    }
  if (i < o && l.charCodeAt(i) !== 10)
    return !1;
  const S = Gs(l.slice(1, c));
  return S ? (r || (typeof t.env.references > "u" && (t.env.references = {}), typeof t.env.references[S] > "u" && (t.env.references[S] = { title: g, href: d }), t.line = a), !0) : !1;
}
const OP = [
  "address",
  "article",
  "aside",
  "base",
  "basefont",
  "blockquote",
  "body",
  "caption",
  "center",
  "col",
  "colgroup",
  "dd",
  "details",
  "dialog",
  "dir",
  "div",
  "dl",
  "dt",
  "fieldset",
  "figcaption",
  "figure",
  "footer",
  "form",
  "frame",
  "frameset",
  "h1",
  "h2",
  "h3",
  "h4",
  "h5",
  "h6",
  "head",
  "header",
  "hr",
  "html",
  "iframe",
  "legend",
  "li",
  "link",
  "main",
  "menu",
  "menuitem",
  "nav",
  "noframes",
  "ol",
  "optgroup",
  "option",
  "p",
  "param",
  "search",
  "section",
  "summary",
  "table",
  "tbody",
  "td",
  "tfoot",
  "th",
  "thead",
  "title",
  "tr",
  "track",
  "ul"
], NP = "[a-zA-Z_:][a-zA-Z0-9:._-]*", AP = "[^\"'=<>`\\x00-\\x20]+", IP = "'[^']*'", xP = '"[^"]*"', DP = "(?:" + AP + "|" + IP + "|" + xP + ")", wP = "(?:\\s+" + NP + "(?:\\s*=\\s*" + DP + ")?)", cE = "<[A-Za-z][A-Za-z0-9\\-]*" + wP + "*\\s*\\/?>", uE = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>", MP = "<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->", LP = "<[?][\\s\\S]*?[?]>", kP = "<![A-Za-z][^>]*>", PP = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>", FP = new RegExp("^(?:" + cE + "|" + uE + "|" + MP + "|" + LP + "|" + kP + "|" + PP + ")"), BP = new RegExp("^(?:" + cE + "|" + uE + ")"), kr = [
  [/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, !0],
  [/^<!--/, /-->/, !0],
  [/^<\?/, /\?>/, !0],
  [/^<![A-Z]/, />/, !0],
  [/^<!\[CDATA\[/, /\]\]>/, !0],
  [new RegExp("^</?(" + OP.join("|") + ")(?=(\\s|/?>|$))", "i"), /^$/, !0],
  [new RegExp(BP.source + "\\s*$"), /^$/, !1]
];
function UP(t, e, n, r) {
  let i = t.bMarks[e] + t.tShift[e], o = t.eMarks[e];
  if (t.sCount[e] - t.blkIndent >= 4 || !t.md.options.html || t.src.charCodeAt(i) !== 60)
    return !1;
  let a = t.src.slice(i, o), s = 0;
  for (; s < kr.length && !kr[s][0].test(a); s++)
    ;
  if (s === kr.length)
    return !1;
  if (r)
    return kr[s][2];
  let l = e + 1;
  if (!kr[s][1].test(a)) {
    for (; l < n && !(t.sCount[l] < t.blkIndent); l++)
      if (i = t.bMarks[l] + t.tShift[l], o = t.eMarks[l], a = t.src.slice(i, o), kr[s][1].test(a)) {
        a.length !== 0 && l++;
        break;
      }
  }
  t.line = l;
  const c = t.push("html_block", "", 0);
  return c.map = [e, l], c.content = t.getLines(e, l, t.blkIndent, !0), !0;
}
function HP(t, e, n, r) {
  let i = t.bMarks[e] + t.tShift[e], o = t.eMarks[e];
  if (t.sCount[e] - t.blkIndent >= 4)
    return !1;
  let a = t.src.charCodeAt(i);
  if (a !== 35 || i >= o)
    return !1;
  let s = 1;
  for (a = t.src.charCodeAt(++i); a === 35 && i < o && s <= 6; )
    s++, a = t.src.charCodeAt(++i);
  if (s > 6 || i < o && !Ae(a))
    return !1;
  if (r)
    return !0;
  o = t.skipSpacesBack(o, i);
  const l = t.skipCharsBack(o, 35, i);
  l > i && Ae(t.src.charCodeAt(l - 1)) && (o = l), t.line = e + 1;
  const c = t.push("heading_open", "h" + String(s), 1);
  c.markup = "########".slice(0, s), c.map = [e, t.line];
  const u = t.push("inline", "", 0);
  u.content = t.src.slice(i, o).trim(), u.map = [e, t.line], u.children = [];
  const d = t.push("heading_close", "h" + String(s), -1);
  return d.markup = "########".slice(0, s), !0;
}
function GP(t, e, n) {
  const r = t.md.block.ruler.getRules("paragraph");
  if (t.sCount[e] - t.blkIndent >= 4)
    return !1;
  const i = t.parentType;
  t.parentType = "paragraph";
  let o = 0, a, s = e + 1;
  for (; s < n && !t.isEmpty(s); s++) {
    if (t.sCount[s] - t.blkIndent > 3)
      continue;
    if (t.sCount[s] >= t.blkIndent) {
      let _ = t.bMarks[s] + t.tShift[s];
      const m = t.eMarks[s];
      if (_ < m && (a = t.src.charCodeAt(_), (a === 45 || a === 61) && (_ = t.skipChars(_, a), _ = t.skipSpaces(_), _ >= m))) {
        o = a === 61 ? 1 : 2;
        break;
      }
    }
    if (t.sCount[s] < 0)
      continue;
    let p = !1;
    for (let _ = 0, m = r.length; _ < m; _++)
      if (r[_](t, s, n, !0)) {
        p = !0;
        break;
      }
    if (p)
      break;
  }
  if (!o)
    return !1;
  const l = t.getLines(e, s, t.blkIndent, !1).trim();
  t.line = s + 1;
  const c = t.push("heading_open", "h" + String(o), 1);
  c.markup = String.fromCharCode(a), c.map = [e, t.line];
  const u = t.push("inline", "", 0);
  u.content = l, u.map = [e, t.line - 1], u.children = [];
  const d = t.push("heading_close", "h" + String(o), -1);
  return d.markup = String.fromCharCode(a), t.parentType = i, !0;
}
function VP(t, e, n) {
  const r = t.md.block.ruler.getRules("paragraph"), i = t.parentType;
  let o = e + 1;
  for (t.parentType = "paragraph"; o < n && !t.isEmpty(o); o++) {
    if (t.sCount[o] - t.blkIndent > 3 || t.sCount[o] < 0)
      continue;
    let c = !1;
    for (let u = 0, d = r.length; u < d; u++)
      if (r[u](t, o, n, !0)) {
        c = !0;
        break;
      }
    if (c)
      break;
  }
  const a = t.getLines(e, o, t.blkIndent, !1).trim();
  t.line = o;
  const s = t.push("paragraph_open", "p", 1);
  s.map = [e, t.line];
  const l = t.push("inline", "", 0);
  return l.content = a, l.map = [e, t.line], l.children = [], t.push("paragraph_close", "p", -1), t.parentType = i, !0;
}
const ta = [
  // First 2 params - rule name & source. Secondary array - list of rules,
  // which can be terminated by this one.
  ["table", EP, ["paragraph", "reference"]],
  ["code", SP],
  ["fence", bP, ["paragraph", "reference", "blockquote", "list"]],
  ["blockquote", TP, ["paragraph", "reference", "blockquote", "list"]],
  ["hr", CP, ["paragraph", "reference", "blockquote", "list"]],
  ["list", vP, ["paragraph", "reference", "blockquote"]],
  ["reference", RP],
  ["html_block", UP, ["paragraph", "reference", "blockquote"]],
  ["heading", HP, ["paragraph", "reference", "blockquote"]],
  ["lheading", GP],
  ["paragraph", VP]
];
function Vs() {
  this.ruler = new bt();
  for (let t = 0; t < ta.length; t++)
    this.ruler.push(ta[t][0], ta[t][1], { alt: (ta[t][2] || []).slice() });
}
Vs.prototype.tokenize = function(t, e, n) {
  const r = this.ruler.getRules(""), i = r.length, o = t.md.options.maxNesting;
  let a = e, s = !1;
  for (; a < n && (t.line = a = t.skipEmptyLines(a), !(a >= n || t.sCount[a] < t.blkIndent)); ) {
    if (t.level >= o) {
      t.line = n;
      break;
    }
    const l = t.line;
    let c = !1;
    for (let u = 0; u < i; u++)
      if (c = r[u](t, a, n, !1), c) {
        if (l >= t.line)
          throw new Error("block rule didn't increment state.line");
        break;
      }
    if (!c) throw new Error("none of the block rules matched");
    t.tight = !s, t.isEmpty(t.line - 1) && (s = !0), a = t.line, a < n && t.isEmpty(a) && (s = !0, a++, t.line = a);
  }
};
Vs.prototype.parse = function(t, e, n, r) {
  if (!t)
    return;
  const i = new this.State(t, e, n, r);
  this.tokenize(i, i.line, i.lineMax);
};
Vs.prototype.State = sn;
function vo(t, e, n, r) {
  this.src = t, this.env = n, this.md = e, this.tokens = r, this.tokens_meta = Array(r.length), this.pos = 0, this.posMax = this.src.length, this.level = 0, this.pending = "", this.pendingLevel = 0, this.cache = {}, this.delimiters = [], this._prev_delimiters = [], this.backticks = {}, this.backticksScanned = !1, this.linkLevel = 0;
}
vo.prototype.pushPending = function() {
  const t = new $t("text", "", 0);
  return t.content = this.pending, t.level = this.pendingLevel, this.tokens.push(t), this.pending = "", t;
};
vo.prototype.push = function(t, e, n) {
  this.pending && this.pushPending();
  const r = new $t(t, e, n);
  let i = null;
  return n < 0 && (this.level--, this.delimiters = this._prev_delimiters.pop()), r.level = this.level, n > 0 && (this.level++, this._prev_delimiters.push(this.delimiters), this.delimiters = [], i = { delimiters: this.delimiters }), this.pendingLevel = this.level, this.tokens.push(r), this.tokens_meta.push(i), r;
};
vo.prototype.scanDelims = function(t, e) {
  const n = this.posMax, r = this.src.charCodeAt(t), i = t > 0 ? this.src.charCodeAt(t - 1) : 32;
  let o = t;
  for (; o < n && this.src.charCodeAt(o) === r; )
    o++;
  const a = o - t, s = o < n ? this.src.charCodeAt(o) : 32, l = _o(i) || po(String.fromCharCode(i)), c = _o(s) || po(String.fromCharCode(s)), u = uo(i), d = uo(s), p = !d && (!c || u || l), _ = !u && (!l || d || c);
  return { can_open: p && (e || !_ || l), can_close: _ && (e || !p || c), length: a };
};
vo.prototype.Token = $t;
function YP(t) {
  switch (t) {
    case 10:
    case 33:
    case 35:
    case 36:
    case 37:
    case 38:
    case 42:
    case 43:
    case 45:
    case 58:
    case 60:
    case 61:
    case 62:
    case 64:
    case 91:
    case 92:
    case 93:
    case 94:
    case 95:
    case 96:
    case 123:
    case 125:
    case 126:
      return !0;
    default:
      return !1;
  }
}
function $P(t, e) {
  let n = t.pos;
  for (; n < t.posMax && !YP(t.src.charCodeAt(n)); )
    n++;
  return n === t.pos ? !1 : (e || (t.pending += t.src.slice(t.pos, n)), t.pos = n, !0);
}
const zP = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;
function qP(t, e) {
  if (!t.md.options.linkify || t.linkLevel > 0) return !1;
  const n = t.pos, r = t.posMax;
  if (n + 3 > r || t.src.charCodeAt(n) !== 58 || t.src.charCodeAt(n + 1) !== 47 || t.src.charCodeAt(n + 2) !== 47) return !1;
  const i = t.pending.match(zP);
  if (!i) return !1;
  const o = i[1], a = t.md.linkify.matchAtStart(t.src.slice(n - o.length));
  if (!a) return !1;
  let s = a.url;
  if (s.length <= o.length) return !1;
  s = s.replace(/\*+$/, "");
  const l = t.md.normalizeLink(s);
  if (!t.md.validateLink(l)) return !1;
  if (!e) {
    t.pending = t.pending.slice(0, -o.length);
    const c = t.push("link_open", "a", 1);
    c.attrs = [["href", l]], c.markup = "linkify", c.info = "auto";
    const u = t.push("text", "", 0);
    u.content = t.md.normalizeLinkText(s);
    const d = t.push("link_close", "a", -1);
    d.markup = "linkify", d.info = "auto";
  }
  return t.pos += s.length - o.length, !0;
}
function WP(t, e) {
  let n = t.pos;
  if (t.src.charCodeAt(n) !== 10)
    return !1;
  const r = t.pending.length - 1, i = t.posMax;
  if (!e)
    if (r >= 0 && t.pending.charCodeAt(r) === 32)
      if (r >= 1 && t.pending.charCodeAt(r - 1) === 32) {
        let o = r - 1;
        for (; o >= 1 && t.pending.charCodeAt(o - 1) === 32; ) o--;
        t.pending = t.pending.slice(0, o), t.push("hardbreak", "br", 0);
      } else
        t.pending = t.pending.slice(0, -1), t.push("softbreak", "br", 0);
    else
      t.push("softbreak", "br", 0);
  for (n++; n < i && Ae(t.src.charCodeAt(n)); )
    n++;
  return t.pos = n, !0;
}
const qu = [];
for (let t = 0; t < 256; t++)
  qu.push(0);
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(t) {
  qu[t.charCodeAt(0)] = 1;
});
function KP(t, e) {
  let n = t.pos;
  const r = t.posMax;
  if (t.src.charCodeAt(n) !== 92 || (n++, n >= r)) return !1;
  let i = t.src.charCodeAt(n);
  if (i === 10) {
    for (e || t.push("hardbreak", "br", 0), n++; n < r && (i = t.src.charCodeAt(n), !!Ae(i)); )
      n++;
    return t.pos = n, !0;
  }
  let o = t.src[n];
  if (i >= 55296 && i <= 56319 && n + 1 < r) {
    const s = t.src.charCodeAt(n + 1);
    s >= 56320 && s <= 57343 && (o += t.src[n + 1], n++);
  }
  const a = "\\" + o;
  if (!e) {
    const s = t.push("text_special", "", 0);
    i < 256 && qu[i] !== 0 ? s.content = o : s.content = a, s.markup = a, s.info = "escape";
  }
  return t.pos = n + 1, !0;
}
function QP(t, e) {
  let n = t.pos;
  if (t.src.charCodeAt(n) !== 96)
    return !1;
  const i = n;
  n++;
  const o = t.posMax;
  for (; n < o && t.src.charCodeAt(n) === 96; )
    n++;
  const a = t.src.slice(i, n), s = a.length;
  if (t.backticksScanned && (t.backticks[s] || 0) <= i)
    return e || (t.pending += a), t.pos += s, !0;
  let l = n, c;
  for (; (c = t.src.indexOf("`", l)) !== -1; ) {
    for (l = c + 1; l < o && t.src.charCodeAt(l) === 96; )
      l++;
    const u = l - c;
    if (u === s) {
      if (!e) {
        const d = t.push("code_inline", "code", 0);
        d.markup = a, d.content = t.src.slice(n, c).replace(/\n/g, " ").replace(/^ (.+) $/, "$1");
      }
      return t.pos = l, !0;
    }
    t.backticks[u] = c;
  }
  return t.backticksScanned = !0, e || (t.pending += a), t.pos += s, !0;
}
function ZP(t, e) {
  const n = t.pos, r = t.src.charCodeAt(n);
  if (e || r !== 126)
    return !1;
  const i = t.scanDelims(t.pos, !0);
  let o = i.length;
  const a = String.fromCharCode(r);
  if (o < 2)
    return !1;
  let s;
  o % 2 && (s = t.push("text", "", 0), s.content = a, o--);
  for (let l = 0; l < o; l += 2)
    s = t.push("text", "", 0), s.content = a + a, t.delimiters.push({
      marker: r,
      length: 0,
      // disable "rule of 3" length checks meant for emphasis
      token: t.tokens.length - 1,
      end: -1,
      open: i.can_open,
      close: i.can_close
    });
  return t.pos += i.length, !0;
}
function _m(t, e) {
  let n;
  const r = [], i = e.length;
  for (let o = 0; o < i; o++) {
    const a = e[o];
    if (a.marker !== 126 || a.end === -1)
      continue;
    const s = e[a.end];
    n = t.tokens[a.token], n.type = "s_open", n.tag = "s", n.nesting = 1, n.markup = "~~", n.content = "", n = t.tokens[s.token], n.type = "s_close", n.tag = "s", n.nesting = -1, n.markup = "~~", n.content = "", t.tokens[s.token - 1].type === "text" && t.tokens[s.token - 1].content === "~" && r.push(s.token - 1);
  }
  for (; r.length; ) {
    const o = r.pop();
    let a = o + 1;
    for (; a < t.tokens.length && t.tokens[a].type === "s_close"; )
      a++;
    a--, o !== a && (n = t.tokens[a], t.tokens[a] = t.tokens[o], t.tokens[o] = n);
  }
}
function XP(t) {
  const e = t.tokens_meta, n = t.tokens_meta.length;
  _m(t, t.delimiters);
  for (let r = 0; r < n; r++)
    e[r] && e[r].delimiters && _m(t, e[r].delimiters);
}
const dE = {
  tokenize: ZP,
  postProcess: XP
};
function jP(t, e) {
  const n = t.pos, r = t.src.charCodeAt(n);
  if (e || r !== 95 && r !== 42)
    return !1;
  const i = t.scanDelims(t.pos, r === 42);
  for (let o = 0; o < i.length; o++) {
    const a = t.push("text", "", 0);
    a.content = String.fromCharCode(r), t.delimiters.push({
      // Char code of the starting marker (number).
      //
      marker: r,
      // Total length of these series of delimiters.
      //
      length: i.length,
      // A position of the token this delimiter corresponds to.
      //
      token: t.tokens.length - 1,
      // If this delimiter is matched as a valid opener, `end` will be
      // equal to its position, otherwise it's `-1`.
      //
      end: -1,
      // Boolean flags that determine if this delimiter could open or close
      // an emphasis.
      //
      open: i.can_open,
      close: i.can_close
    });
  }
  return t.pos += i.length, !0;
}
function mm(t, e) {
  const n = e.length;
  for (let r = n - 1; r >= 0; r--) {
    const i = e[r];
    if (i.marker !== 95 && i.marker !== 42 || i.end === -1)
      continue;
    const o = e[i.end], a = r > 0 && e[r - 1].end === i.end + 1 && // check that first two markers match and adjacent
    e[r - 1].marker === i.marker && e[r - 1].token === i.token - 1 && // check that last two markers are adjacent (we can safely assume they match)
    e[i.end + 1].token === o.token + 1, s = String.fromCharCode(i.marker), l = t.tokens[i.token];
    l.type = a ? "strong_open" : "em_open", l.tag = a ? "strong" : "em", l.nesting = 1, l.markup = a ? s + s : s, l.content = "";
    const c = t.tokens[o.token];
    c.type = a ? "strong_close" : "em_close", c.tag = a ? "strong" : "em", c.nesting = -1, c.markup = a ? s + s : s, c.content = "", a && (t.tokens[e[r - 1].token].content = "", t.tokens[e[i.end + 1].token].content = "", r--);
  }
}
function JP(t) {
  const e = t.tokens_meta, n = t.tokens_meta.length;
  mm(t, t.delimiters);
  for (let r = 0; r < n; r++)
    e[r] && e[r].delimiters && mm(t, e[r].delimiters);
}
const pE = {
  tokenize: jP,
  postProcess: JP
};
function e3(t, e) {
  let n, r, i, o, a = "", s = "", l = t.pos, c = !0;
  if (t.src.charCodeAt(t.pos) !== 91)
    return !1;
  const u = t.pos, d = t.posMax, p = t.pos + 1, _ = t.md.helpers.parseLinkLabel(t, t.pos, !0);
  if (_ < 0)
    return !1;
  let m = _ + 1;
  if (m < d && t.src.charCodeAt(m) === 40) {
    for (c = !1, m++; m < d && (n = t.src.charCodeAt(m), !(!Ae(n) && n !== 10)); m++)
      ;
    if (m >= d)
      return !1;
    if (l = m, i = t.md.helpers.parseLinkDestination(t.src, m, t.posMax), i.ok) {
      for (a = t.md.normalizeLink(i.str), t.md.validateLink(a) ? m = i.pos : a = "", l = m; m < d && (n = t.src.charCodeAt(m), !(!Ae(n) && n !== 10)); m++)
        ;
      if (i = t.md.helpers.parseLinkTitle(t.src, m, t.posMax), m < d && l !== m && i.ok)
        for (s = i.str, m = i.pos; m < d && (n = t.src.charCodeAt(m), !(!Ae(n) && n !== 10)); m++)
          ;
    }
    (m >= d || t.src.charCodeAt(m) !== 41) && (c = !0), m++;
  }
  if (c) {
    if (typeof t.env.references > "u")
      return !1;
    if (m < d && t.src.charCodeAt(m) === 91 ? (l = m + 1, m = t.md.helpers.parseLinkLabel(t, m), m >= 0 ? r = t.src.slice(l, m++) : m = _ + 1) : m = _ + 1, r || (r = t.src.slice(p, _)), o = t.env.references[Gs(r)], !o)
      return t.pos = u, !1;
    a = o.href, s = o.title;
  }
  if (!e) {
    t.pos = p, t.posMax = _;
    const f = t.push("link_open", "a", 1), g = [["href", a]];
    f.attrs = g, s && g.push(["title", s]), t.linkLevel++, t.md.inline.tokenize(t), t.linkLevel--, t.push("link_close", "a", -1);
  }
  return t.pos = m, t.posMax = d, !0;
}
function t3(t, e) {
  let n, r, i, o, a, s, l, c, u = "";
  const d = t.pos, p = t.posMax;
  if (t.src.charCodeAt(t.pos) !== 33 || t.src.charCodeAt(t.pos + 1) !== 91)
    return !1;
  const _ = t.pos + 2, m = t.md.helpers.parseLinkLabel(t, t.pos + 1, !1);
  if (m < 0)
    return !1;
  if (o = m + 1, o < p && t.src.charCodeAt(o) === 40) {
    for (o++; o < p && (n = t.src.charCodeAt(o), !(!Ae(n) && n !== 10)); o++)
      ;
    if (o >= p)
      return !1;
    for (c = o, s = t.md.helpers.parseLinkDestination(t.src, o, t.posMax), s.ok && (u = t.md.normalizeLink(s.str), t.md.validateLink(u) ? o = s.pos : u = ""), c = o; o < p && (n = t.src.charCodeAt(o), !(!Ae(n) && n !== 10)); o++)
      ;
    if (s = t.md.helpers.parseLinkTitle(t.src, o, t.posMax), o < p && c !== o && s.ok)
      for (l = s.str, o = s.pos; o < p && (n = t.src.charCodeAt(o), !(!Ae(n) && n !== 10)); o++)
        ;
    else
      l = "";
    if (o >= p || t.src.charCodeAt(o) !== 41)
      return t.pos = d, !1;
    o++;
  } else {
    if (typeof t.env.references > "u")
      return !1;
    if (o < p && t.src.charCodeAt(o) === 91 ? (c = o + 1, o = t.md.helpers.parseLinkLabel(t, o), o >= 0 ? i = t.src.slice(c, o++) : o = m + 1) : o = m + 1, i || (i = t.src.slice(_, m)), a = t.env.references[Gs(i)], !a)
      return t.pos = d, !1;
    u = a.href, l = a.title;
  }
  if (!e) {
    r = t.src.slice(_, m);
    const f = [];
    t.md.inline.parse(
      r,
      t.md,
      t.env,
      f
    );
    const g = t.push("image", "img", 0), S = [["src", u], ["alt", ""]];
    g.attrs = S, g.children = f, g.content = r, l && S.push(["title", l]);
  }
  return t.pos = o, t.posMax = p, !0;
}
const n3 = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/, r3 = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
function i3(t, e) {
  let n = t.pos;
  if (t.src.charCodeAt(n) !== 60)
    return !1;
  const r = t.pos, i = t.posMax;
  for (; ; ) {
    if (++n >= i) return !1;
    const a = t.src.charCodeAt(n);
    if (a === 60) return !1;
    if (a === 62) break;
  }
  const o = t.src.slice(r + 1, n);
  if (r3.test(o)) {
    const a = t.md.normalizeLink(o);
    if (!t.md.validateLink(a))
      return !1;
    if (!e) {
      const s = t.push("link_open", "a", 1);
      s.attrs = [["href", a]], s.markup = "autolink", s.info = "auto";
      const l = t.push("text", "", 0);
      l.content = t.md.normalizeLinkText(o);
      const c = t.push("link_close", "a", -1);
      c.markup = "autolink", c.info = "auto";
    }
    return t.pos += o.length + 2, !0;
  }
  if (n3.test(o)) {
    const a = t.md.normalizeLink("mailto:" + o);
    if (!t.md.validateLink(a))
      return !1;
    if (!e) {
      const s = t.push("link_open", "a", 1);
      s.attrs = [["href", a]], s.markup = "autolink", s.info = "auto";
      const l = t.push("text", "", 0);
      l.content = t.md.normalizeLinkText(o);
      const c = t.push("link_close", "a", -1);
      c.markup = "autolink", c.info = "auto";
    }
    return t.pos += o.length + 2, !0;
  }
  return !1;
}
function o3(t) {
  return /^<a[>\s]/i.test(t);
}
function a3(t) {
  return /^<\/a\s*>/i.test(t);
}
function s3(t) {
  const e = t | 32;
  return e >= 97 && e <= 122;
}
function l3(t, e) {
  if (!t.md.options.html)
    return !1;
  const n = t.posMax, r = t.pos;
  if (t.src.charCodeAt(r) !== 60 || r + 2 >= n)
    return !1;
  const i = t.src.charCodeAt(r + 1);
  if (i !== 33 && i !== 63 && i !== 47 && !s3(i))
    return !1;
  const o = t.src.slice(r).match(FP);
  if (!o)
    return !1;
  if (!e) {
    const a = t.push("html_inline", "", 0);
    a.content = o[0], o3(a.content) && t.linkLevel++, a3(a.content) && t.linkLevel--;
  }
  return t.pos += o[0].length, !0;
}
const c3 = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i, u3 = /^&([a-z][a-z0-9]{1,31});/i;
function d3(t, e) {
  const n = t.pos, r = t.posMax;
  if (t.src.charCodeAt(n) !== 38 || n + 1 >= r) return !1;
  if (t.src.charCodeAt(n + 1) === 35) {
    const o = t.src.slice(n).match(c3);
    if (o) {
      if (!e) {
        const a = o[1][0].toLowerCase() === "x" ? parseInt(o[1].slice(1), 16) : parseInt(o[1], 10), s = t.push("text_special", "", 0);
        s.content = $u(a) ? cs(a) : cs(65533), s.markup = o[0], s.info = "entity";
      }
      return t.pos += o[0].length, !0;
    }
  } else {
    const o = t.src.slice(n).match(u3);
    if (o) {
      const a = iE(o[0]);
      if (a !== o[0]) {
        if (!e) {
          const s = t.push("text_special", "", 0);
          s.content = a, s.markup = o[0], s.info = "entity";
        }
        return t.pos += o[0].length, !0;
      }
    }
  }
  return !1;
}
function fm(t) {
  const e = {}, n = t.length;
  if (!n) return;
  let r = 0, i = -2;
  const o = [];
  for (let a = 0; a < n; a++) {
    const s = t[a];
    if (o.push(0), (t[r].marker !== s.marker || i !== s.token - 1) && (r = a), i = s.token, s.length = s.length || 0, !s.close) continue;
    e.hasOwnProperty(s.marker) || (e[s.marker] = [-1, -1, -1, -1, -1, -1]);
    const l = e[s.marker][(s.open ? 3 : 0) + s.length % 3];
    let c = r - o[r] - 1, u = c;
    for (; c > l; c -= o[c] + 1) {
      const d = t[c];
      if (d.marker === s.marker && d.open && d.end < 0) {
        let p = !1;
        if ((d.close || s.open) && (d.length + s.length) % 3 === 0 && (d.length % 3 !== 0 || s.length % 3 !== 0) && (p = !0), !p) {
          const _ = c > 0 && !t[c - 1].open ? o[c - 1] + 1 : 0;
          o[a] = a - c + _, o[c] = _, s.open = !1, d.end = a, d.close = !1, u = -1, i = -2;
          break;
        }
      }
    }
    u !== -1 && (e[s.marker][(s.open ? 3 : 0) + (s.length || 0) % 3] = u);
  }
}
function p3(t) {
  const e = t.tokens_meta, n = t.tokens_meta.length;
  fm(t.delimiters);
  for (let r = 0; r < n; r++)
    e[r] && e[r].delimiters && fm(e[r].delimiters);
}
function _3(t) {
  let e, n, r = 0;
  const i = t.tokens, o = t.tokens.length;
  for (e = n = 0; e < o; e++)
    i[e].nesting < 0 && r--, i[e].level = r, i[e].nesting > 0 && r++, i[e].type === "text" && e + 1 < o && i[e + 1].type === "text" ? i[e + 1].content = i[e].content + i[e + 1].content : (e !== n && (i[n] = i[e]), n++);
  e !== n && (i.length = n);
}
const Bl = [
  ["text", $P],
  ["linkify", qP],
  ["newline", WP],
  ["escape", KP],
  ["backticks", QP],
  ["strikethrough", dE.tokenize],
  ["emphasis", pE.tokenize],
  ["link", e3],
  ["image", t3],
  ["autolink", i3],
  ["html_inline", l3],
  ["entity", d3]
], Ul = [
  ["balance_pairs", p3],
  ["strikethrough", dE.postProcess],
  ["emphasis", pE.postProcess],
  // rules for pairs separate '**' into its own text tokens, which may be left unused,
  // rule below merges unused segments back with the rest of the text
  ["fragments_join", _3]
];
function Ro() {
  this.ruler = new bt();
  for (let t = 0; t < Bl.length; t++)
    this.ruler.push(Bl[t][0], Bl[t][1]);
  this.ruler2 = new bt();
  for (let t = 0; t < Ul.length; t++)
    this.ruler2.push(Ul[t][0], Ul[t][1]);
}
Ro.prototype.skipToken = function(t) {
  const e = t.pos, n = this.ruler.getRules(""), r = n.length, i = t.md.options.maxNesting, o = t.cache;
  if (typeof o[e] < "u") {
    t.pos = o[e];
    return;
  }
  let a = !1;
  if (t.level < i) {
    for (let s = 0; s < r; s++)
      if (t.level++, a = n[s](t, !0), t.level--, a) {
        if (e >= t.pos)
          throw new Error("inline rule didn't increment state.pos");
        break;
      }
  } else
    t.pos = t.posMax;
  a || t.pos++, o[e] = t.pos;
};
Ro.prototype.tokenize = function(t) {
  const e = this.ruler.getRules(""), n = e.length, r = t.posMax, i = t.md.options.maxNesting;
  for (; t.pos < r; ) {
    const o = t.pos;
    let a = !1;
    if (t.level < i) {
      for (let s = 0; s < n; s++)
        if (a = e[s](t, !1), a) {
          if (o >= t.pos)
            throw new Error("inline rule didn't increment state.pos");
          break;
        }
    }
    if (a) {
      if (t.pos >= r)
        break;
      continue;
    }
    t.pending += t.src[t.pos++];
  }
  t.pending && t.pushPending();
};
Ro.prototype.parse = function(t, e, n, r) {
  const i = new this.State(t, e, n, r);
  this.tokenize(i);
  const o = this.ruler2.getRules(""), a = o.length;
  for (let s = 0; s < a; s++)
    o[s](i);
};
Ro.prototype.State = vo;
function m3(t) {
  const e = {};
  t = t || {}, e.src_Any = Jh.source, e.src_Cc = eE.source, e.src_Z = nE.source, e.src_P = Vu.source, e.src_ZPCc = [e.src_Z, e.src_P, e.src_Cc].join("|"), e.src_ZCc = [e.src_Z, e.src_Cc].join("|");
  const n = "[><｜]";
  return e.src_pseudo_letter = "(?:(?!" + n + "|" + e.src_ZPCc + ")" + e.src_Any + ")", e.src_ip4 = "(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)", e.src_auth = "(?:(?:(?!" + e.src_ZCc + "|[@/\\[\\]()]).)+@)?", e.src_port = "(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?", e.src_host_terminator = "(?=$|" + n + "|" + e.src_ZPCc + ")(?!" + (t["---"] ? "-(?!--)|" : "-|") + "_|:\\d|\\.-|\\.(?!$|" + e.src_ZPCc + "))", e.src_path = "(?:[/?#](?:(?!" + e.src_ZCc + "|" + n + `|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!` + e.src_ZCc + "|\\]).)*\\]|\\((?:(?!" + e.src_ZCc + "|[)]).)*\\)|\\{(?:(?!" + e.src_ZCc + '|[}]).)*\\}|\\"(?:(?!' + e.src_ZCc + `|["]).)+\\"|\\'(?:(?!` + e.src_ZCc + "|[']).)+\\'|\\'(?=" + e.src_pseudo_letter + "|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!" + e.src_ZCc + "|[.]|$)|" + (t["---"] ? "\\-(?!--(?:[^-]|$))(?:-*)|" : "\\-+|") + // allow `,,,` in paths
  ",(?!" + e.src_ZCc + "|$)|;(?!" + e.src_ZCc + "|$)|\\!+(?!" + e.src_ZCc + "|[!]|$)|\\?(?!" + e.src_ZCc + "|[?]|$))+|\\/)?", e.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*', e.src_xn = "xn--[a-z0-9\\-]{1,59}", e.src_domain_root = // Allow letters & digits (http://test1)
  "(?:" + e.src_xn + "|" + e.src_pseudo_letter + "{1,63})", e.src_domain = "(?:" + e.src_xn + "|(?:" + e.src_pseudo_letter + ")|(?:" + e.src_pseudo_letter + "(?:-|" + e.src_pseudo_letter + "){0,61}" + e.src_pseudo_letter + "))", e.src_host = "(?:(?:(?:(?:" + e.src_domain + ")\\.)*" + e.src_domain + "))", e.tpl_host_fuzzy = "(?:" + e.src_ip4 + "|(?:(?:(?:" + e.src_domain + ")\\.)+(?:%TLDS%)))", e.tpl_host_no_ip_fuzzy = "(?:(?:(?:" + e.src_domain + ")\\.)+(?:%TLDS%))", e.src_host_strict = e.src_host + e.src_host_terminator, e.tpl_host_fuzzy_strict = e.tpl_host_fuzzy + e.src_host_terminator, e.src_host_port_strict = e.src_host + e.src_port + e.src_host_terminator, e.tpl_host_port_fuzzy_strict = e.tpl_host_fuzzy + e.src_port + e.src_host_terminator, e.tpl_host_port_no_ip_fuzzy_strict = e.tpl_host_no_ip_fuzzy + e.src_port + e.src_host_terminator, e.tpl_host_fuzzy_test = "localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:" + e.src_ZPCc + "|>|$))", e.tpl_email_fuzzy = "(^|" + n + '|"|\\(|' + e.src_ZCc + ")(" + e.src_email_name + "@" + e.tpl_host_fuzzy_strict + ")", e.tpl_link_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation.
  // but can start with > (markdown blockquote)
  "(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|" + e.src_ZPCc + "))((?![$+<=>^`|｜])" + e.tpl_host_port_fuzzy_strict + e.src_path + ")", e.tpl_link_no_ip_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation.
  // but can start with > (markdown blockquote)
  "(^|(?![.:/\\-_@])(?:[$+<=>^`|｜]|" + e.src_ZPCc + "))((?![$+<=>^`|｜])" + e.tpl_host_port_no_ip_fuzzy_strict + e.src_path + ")", e;
}
function Pc(t) {
  return Array.prototype.slice.call(arguments, 1).forEach(function(n) {
    n && Object.keys(n).forEach(function(r) {
      t[r] = n[r];
    });
  }), t;
}
function Ys(t) {
  return Object.prototype.toString.call(t);
}
function f3(t) {
  return Ys(t) === "[object String]";
}
function g3(t) {
  return Ys(t) === "[object Object]";
}
function h3(t) {
  return Ys(t) === "[object RegExp]";
}
function gm(t) {
  return Ys(t) === "[object Function]";
}
function E3(t) {
  return t.replace(/[.?*+^$[\]\\(){}|-]/g, "\\$&");
}
const _E = {
  fuzzyLink: !0,
  fuzzyEmail: !0,
  fuzzyIP: !1
};
function S3(t) {
  return Object.keys(t || {}).reduce(function(e, n) {
    return e || _E.hasOwnProperty(n);
  }, !1);
}
const b3 = {
  "http:": {
    validate: function(t, e, n) {
      const r = t.slice(e);
      return n.re.http || (n.re.http = new RegExp(
        "^\\/\\/" + n.re.src_auth + n.re.src_host_port_strict + n.re.src_path,
        "i"
      )), n.re.http.test(r) ? r.match(n.re.http)[0].length : 0;
    }
  },
  "https:": "http:",
  "ftp:": "http:",
  "//": {
    validate: function(t, e, n) {
      const r = t.slice(e);
      return n.re.no_http || (n.re.no_http = new RegExp(
        "^" + n.re.src_auth + // Don't allow single-level domains, because of false positives like '//test'
        // with code comments
        "(?:localhost|(?:(?:" + n.re.src_domain + ")\\.)+" + n.re.src_domain_root + ")" + n.re.src_port + n.re.src_host_terminator + n.re.src_path,
        "i"
      )), n.re.no_http.test(r) ? e >= 3 && t[e - 3] === ":" || e >= 3 && t[e - 3] === "/" ? 0 : r.match(n.re.no_http)[0].length : 0;
    }
  },
  "mailto:": {
    validate: function(t, e, n) {
      const r = t.slice(e);
      return n.re.mailto || (n.re.mailto = new RegExp(
        "^" + n.re.src_email_name + "@" + n.re.src_host_strict,
        "i"
      )), n.re.mailto.test(r) ? r.match(n.re.mailto)[0].length : 0;
    }
  }
}, T3 = "a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]", C3 = "biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");
function y3(t) {
  t.__index__ = -1, t.__text_cache__ = "";
}
function v3(t) {
  return function(e, n) {
    const r = e.slice(n);
    return t.test(r) ? r.match(t)[0].length : 0;
  };
}
function hm() {
  return function(t, e) {
    e.normalize(t);
  };
}
function us(t) {
  const e = t.re = m3(t.__opts__), n = t.__tlds__.slice();
  t.onCompile(), t.__tlds_replaced__ || n.push(T3), n.push(e.src_xn), e.src_tlds = n.join("|");
  function r(s) {
    return s.replace("%TLDS%", e.src_tlds);
  }
  e.email_fuzzy = RegExp(r(e.tpl_email_fuzzy), "i"), e.link_fuzzy = RegExp(r(e.tpl_link_fuzzy), "i"), e.link_no_ip_fuzzy = RegExp(r(e.tpl_link_no_ip_fuzzy), "i"), e.host_fuzzy_test = RegExp(r(e.tpl_host_fuzzy_test), "i");
  const i = [];
  t.__compiled__ = {};
  function o(s, l) {
    throw new Error('(LinkifyIt) Invalid schema "' + s + '": ' + l);
  }
  Object.keys(t.__schemas__).forEach(function(s) {
    const l = t.__schemas__[s];
    if (l === null)
      return;
    const c = { validate: null, link: null };
    if (t.__compiled__[s] = c, g3(l)) {
      h3(l.validate) ? c.validate = v3(l.validate) : gm(l.validate) ? c.validate = l.validate : o(s, l), gm(l.normalize) ? c.normalize = l.normalize : l.normalize ? o(s, l) : c.normalize = hm();
      return;
    }
    if (f3(l)) {
      i.push(s);
      return;
    }
    o(s, l);
  }), i.forEach(function(s) {
    t.__compiled__[t.__schemas__[s]] && (t.__compiled__[s].validate = t.__compiled__[t.__schemas__[s]].validate, t.__compiled__[s].normalize = t.__compiled__[t.__schemas__[s]].normalize);
  }), t.__compiled__[""] = { validate: null, normalize: hm() };
  const a = Object.keys(t.__compiled__).filter(function(s) {
    return s.length > 0 && t.__compiled__[s];
  }).map(E3).join("|");
  t.re.schema_test = RegExp("(^|(?!_)(?:[><｜]|" + e.src_ZPCc + "))(" + a + ")", "i"), t.re.schema_search = RegExp("(^|(?!_)(?:[><｜]|" + e.src_ZPCc + "))(" + a + ")", "ig"), t.re.schema_at_start = RegExp("^" + t.re.schema_search.source, "i"), t.re.pretest = RegExp(
    "(" + t.re.schema_test.source + ")|(" + t.re.host_fuzzy_test.source + ")|@",
    "i"
  ), y3(t);
}
function R3(t, e) {
  const n = t.__index__, r = t.__last_index__, i = t.__text_cache__.slice(n, r);
  this.schema = t.__schema__.toLowerCase(), this.index = n + e, this.lastIndex = r + e, this.raw = i, this.text = i, this.url = i;
}
function Fc(t, e) {
  const n = new R3(t, e);
  return t.__compiled__[n.schema].normalize(n, t), n;
}
function At(t, e) {
  if (!(this instanceof At))
    return new At(t, e);
  e || S3(t) && (e = t, t = {}), this.__opts__ = Pc({}, _E, e), this.__index__ = -1, this.__last_index__ = -1, this.__schema__ = "", this.__text_cache__ = "", this.__schemas__ = Pc({}, b3, t), this.__compiled__ = {}, this.__tlds__ = C3, this.__tlds_replaced__ = !1, this.re = {}, us(this);
}
At.prototype.add = function(e, n) {
  return this.__schemas__[e] = n, us(this), this;
};
At.prototype.set = function(e) {
  return this.__opts__ = Pc(this.__opts__, e), this;
};
At.prototype.test = function(e) {
  if (this.__text_cache__ = e, this.__index__ = -1, !e.length)
    return !1;
  let n, r, i, o, a, s, l, c, u;
  if (this.re.schema_test.test(e)) {
    for (l = this.re.schema_search, l.lastIndex = 0; (n = l.exec(e)) !== null; )
      if (o = this.testSchemaAt(e, n[2], l.lastIndex), o) {
        this.__schema__ = n[2], this.__index__ = n.index + n[1].length, this.__last_index__ = n.index + n[0].length + o;
        break;
      }
  }
  return this.__opts__.fuzzyLink && this.__compiled__["http:"] && (c = e.search(this.re.host_fuzzy_test), c >= 0 && (this.__index__ < 0 || c < this.__index__) && (r = e.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null && (a = r.index + r[1].length, (this.__index__ < 0 || a < this.__index__) && (this.__schema__ = "", this.__index__ = a, this.__last_index__ = r.index + r[0].length))), this.__opts__.fuzzyEmail && this.__compiled__["mailto:"] && (u = e.indexOf("@"), u >= 0 && (i = e.match(this.re.email_fuzzy)) !== null && (a = i.index + i[1].length, s = i.index + i[0].length, (this.__index__ < 0 || a < this.__index__ || a === this.__index__ && s > this.__last_index__) && (this.__schema__ = "mailto:", this.__index__ = a, this.__last_index__ = s))), this.__index__ >= 0;
};
At.prototype.pretest = function(e) {
  return this.re.pretest.test(e);
};
At.prototype.testSchemaAt = function(e, n, r) {
  return this.__compiled__[n.toLowerCase()] ? this.__compiled__[n.toLowerCase()].validate(e, r, this) : 0;
};
At.prototype.match = function(e) {
  const n = [];
  let r = 0;
  this.__index__ >= 0 && this.__text_cache__ === e && (n.push(Fc(this, r)), r = this.__last_index__);
  let i = r ? e.slice(r) : e;
  for (; this.test(i); )
    n.push(Fc(this, r)), i = i.slice(this.__last_index__), r += this.__last_index__;
  return n.length ? n : null;
};
At.prototype.matchAtStart = function(e) {
  if (this.__text_cache__ = e, this.__index__ = -1, !e.length) return null;
  const n = this.re.schema_at_start.exec(e);
  if (!n) return null;
  const r = this.testSchemaAt(e, n[2], n[0].length);
  return r ? (this.__schema__ = n[2], this.__index__ = n.index + n[1].length, this.__last_index__ = n.index + n[0].length + r, Fc(this, 0)) : null;
};
At.prototype.tlds = function(e, n) {
  return e = Array.isArray(e) ? e : [e], n ? (this.__tlds__ = this.__tlds__.concat(e).sort().filter(function(r, i, o) {
    return r !== o[i - 1];
  }).reverse(), us(this), this) : (this.__tlds__ = e.slice(), this.__tlds_replaced__ = !0, us(this), this);
};
At.prototype.normalize = function(e) {
  e.schema || (e.url = "http://" + e.url), e.schema === "mailto:" && !/^mailto:/i.test(e.url) && (e.url = "mailto:" + e.url);
};
At.prototype.onCompile = function() {
};
const Qr = 2147483647, jt = 36, Wu = 1, mo = 26, O3 = 38, N3 = 700, mE = 72, fE = 128, gE = "-", A3 = /^xn--/, I3 = /[^\0-\x7F]/, x3 = /[\x2E\u3002\uFF0E\uFF61]/g, D3 = {
  overflow: "Overflow: input needs wider integers to process",
  "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  "invalid-input": "Invalid input"
}, Hl = jt - Wu, Jt = Math.floor, Gl = String.fromCharCode;
function Nn(t) {
  throw new RangeError(D3[t]);
}
function w3(t, e) {
  const n = [];
  let r = t.length;
  for (; r--; )
    n[r] = e(t[r]);
  return n;
}
function hE(t, e) {
  const n = t.split("@");
  let r = "";
  n.length > 1 && (r = n[0] + "@", t = n[1]), t = t.replace(x3, ".");
  const i = t.split("."), o = w3(i, e).join(".");
  return r + o;
}
function EE(t) {
  const e = [];
  let n = 0;
  const r = t.length;
  for (; n < r; ) {
    const i = t.charCodeAt(n++);
    if (i >= 55296 && i <= 56319 && n < r) {
      const o = t.charCodeAt(n++);
      (o & 64512) == 56320 ? e.push(((i & 1023) << 10) + (o & 1023) + 65536) : (e.push(i), n--);
    } else
      e.push(i);
  }
  return e;
}
const M3 = (t) => String.fromCodePoint(...t), L3 = function(t) {
  return t >= 48 && t < 58 ? 26 + (t - 48) : t >= 65 && t < 91 ? t - 65 : t >= 97 && t < 123 ? t - 97 : jt;
}, Em = function(t, e) {
  return t + 22 + 75 * (t < 26) - ((e != 0) << 5);
}, SE = function(t, e, n) {
  let r = 0;
  for (t = n ? Jt(t / N3) : t >> 1, t += Jt(t / e); t > Hl * mo >> 1; r += jt)
    t = Jt(t / Hl);
  return Jt(r + (Hl + 1) * t / (t + O3));
}, bE = function(t) {
  const e = [], n = t.length;
  let r = 0, i = fE, o = mE, a = t.lastIndexOf(gE);
  a < 0 && (a = 0);
  for (let s = 0; s < a; ++s)
    t.charCodeAt(s) >= 128 && Nn("not-basic"), e.push(t.charCodeAt(s));
  for (let s = a > 0 ? a + 1 : 0; s < n; ) {
    const l = r;
    for (let u = 1, d = jt; ; d += jt) {
      s >= n && Nn("invalid-input");
      const p = L3(t.charCodeAt(s++));
      p >= jt && Nn("invalid-input"), p > Jt((Qr - r) / u) && Nn("overflow"), r += p * u;
      const _ = d <= o ? Wu : d >= o + mo ? mo : d - o;
      if (p < _)
        break;
      const m = jt - _;
      u > Jt(Qr / m) && Nn("overflow"), u *= m;
    }
    const c = e.length + 1;
    o = SE(r - l, c, l == 0), Jt(r / c) > Qr - i && Nn("overflow"), i += Jt(r / c), r %= c, e.splice(r++, 0, i);
  }
  return String.fromCodePoint(...e);
}, TE = function(t) {
  const e = [];
  t = EE(t);
  const n = t.length;
  let r = fE, i = 0, o = mE;
  for (const l of t)
    l < 128 && e.push(Gl(l));
  const a = e.length;
  let s = a;
  for (a && e.push(gE); s < n; ) {
    let l = Qr;
    for (const u of t)
      u >= r && u < l && (l = u);
    const c = s + 1;
    l - r > Jt((Qr - i) / c) && Nn("overflow"), i += (l - r) * c, r = l;
    for (const u of t)
      if (u < r && ++i > Qr && Nn("overflow"), u === r) {
        let d = i;
        for (let p = jt; ; p += jt) {
          const _ = p <= o ? Wu : p >= o + mo ? mo : p - o;
          if (d < _)
            break;
          const m = d - _, f = jt - _;
          e.push(
            Gl(Em(_ + m % f, 0))
          ), d = Jt(m / f);
        }
        e.push(Gl(Em(d, 0))), o = SE(i, c, s === a), i = 0, ++s;
      }
    ++i, ++r;
  }
  return e.join("");
}, k3 = function(t) {
  return hE(t, function(e) {
    return A3.test(e) ? bE(e.slice(4).toLowerCase()) : e;
  });
}, P3 = function(t) {
  return hE(t, function(e) {
    return I3.test(e) ? "xn--" + TE(e) : e;
  });
}, CE = {
  /**
   * A string representing the current Punycode.js version number.
   * @memberOf punycode
   * @type String
   */
  version: "2.3.1",
  /**
   * An object of methods to convert from JavaScript's internal character
   * representation (UCS-2) to Unicode code points, and back.
   * @see <https://mathiasbynens.be/notes/javascript-encoding>
   * @memberOf punycode
   * @type Object
   */
  ucs2: {
    decode: EE,
    encode: M3
  },
  decode: bE,
  encode: TE,
  toASCII: P3,
  toUnicode: k3
}, F3 = {
  options: {
    // Enable HTML tags in source
    html: !1,
    // Use '/' to close single tags (<br />)
    xhtmlOut: !1,
    // Convert '\n' in paragraphs into <br>
    breaks: !1,
    // CSS language prefix for fenced blocks
    langPrefix: "language-",
    // autoconvert URL-like texts to links
    linkify: !1,
    // Enable some language-neutral replacements + quotes beautification
    typographer: !1,
    // Double + single quotes replacement pairs, when typographer enabled,
    // and smartquotes on. Could be either a String or an Array.
    //
    // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
    // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
    quotes: "“”‘’",
    /* “”‘’ */
    // Highlighter function. Should return escaped HTML,
    // or '' if the source string is not changed and should be escaped externaly.
    // If result starts with <pre... internal wrapper is skipped.
    //
    // function (/*str, lang*/) { return ''; }
    //
    highlight: null,
    // Internal protection, recursion limit
    maxNesting: 100
  },
  components: {
    core: {},
    block: {},
    inline: {}
  }
}, B3 = {
  options: {
    // Enable HTML tags in source
    html: !1,
    // Use '/' to close single tags (<br />)
    xhtmlOut: !1,
    // Convert '\n' in paragraphs into <br>
    breaks: !1,
    // CSS language prefix for fenced blocks
    langPrefix: "language-",
    // autoconvert URL-like texts to links
    linkify: !1,
    // Enable some language-neutral replacements + quotes beautification
    typographer: !1,
    // Double + single quotes replacement pairs, when typographer enabled,
    // and smartquotes on. Could be either a String or an Array.
    //
    // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
    // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
    quotes: "“”‘’",
    /* “”‘’ */
    // Highlighter function. Should return escaped HTML,
    // or '' if the source string is not changed and should be escaped externaly.
    // If result starts with <pre... internal wrapper is skipped.
    //
    // function (/*str, lang*/) { return ''; }
    //
    highlight: null,
    // Internal protection, recursion limit
    maxNesting: 20
  },
  components: {
    core: {
      rules: [
        "normalize",
        "block",
        "inline",
        "text_join"
      ]
    },
    block: {
      rules: [
        "paragraph"
      ]
    },
    inline: {
      rules: [
        "text"
      ],
      rules2: [
        "balance_pairs",
        "fragments_join"
      ]
    }
  }
}, U3 = {
  options: {
    // Enable HTML tags in source
    html: !0,
    // Use '/' to close single tags (<br />)
    xhtmlOut: !0,
    // Convert '\n' in paragraphs into <br>
    breaks: !1,
    // CSS language prefix for fenced blocks
    langPrefix: "language-",
    // autoconvert URL-like texts to links
    linkify: !1,
    // Enable some language-neutral replacements + quotes beautification
    typographer: !1,
    // Double + single quotes replacement pairs, when typographer enabled,
    // and smartquotes on. Could be either a String or an Array.
    //
    // For example, you can use '«»„“' for Russian, '„“‚‘' for German,
    // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp).
    quotes: "“”‘’",
    /* “”‘’ */
    // Highlighter function. Should return escaped HTML,
    // or '' if the source string is not changed and should be escaped externaly.
    // If result starts with <pre... internal wrapper is skipped.
    //
    // function (/*str, lang*/) { return ''; }
    //
    highlight: null,
    // Internal protection, recursion limit
    maxNesting: 20
  },
  components: {
    core: {
      rules: [
        "normalize",
        "block",
        "inline",
        "text_join"
      ]
    },
    block: {
      rules: [
        "blockquote",
        "code",
        "fence",
        "heading",
        "hr",
        "html_block",
        "lheading",
        "list",
        "reference",
        "paragraph"
      ]
    },
    inline: {
      rules: [
        "autolink",
        "backticks",
        "emphasis",
        "entity",
        "escape",
        "html_inline",
        "image",
        "link",
        "newline",
        "text"
      ],
      rules2: [
        "balance_pairs",
        "emphasis",
        "fragments_join"
      ]
    }
  }
}, H3 = {
  default: F3,
  zero: B3,
  commonmark: U3
}, G3 = /^(vbscript|javascript|file|data):/, V3 = /^data:image\/(gif|png|jpeg|webp);/;
function Y3(t) {
  const e = t.trim().toLowerCase();
  return G3.test(e) ? V3.test(e) : !0;
}
const yE = ["http:", "https:", "mailto:"];
function $3(t) {
  const e = Gu(t, !0);
  if (e.hostname && (!e.protocol || yE.indexOf(e.protocol) >= 0))
    try {
      e.hostname = CE.toASCII(e.hostname);
    } catch {
    }
  return yo(Hu(e));
}
function z3(t) {
  const e = Gu(t, !0);
  if (e.hostname && (!e.protocol || yE.indexOf(e.protocol) >= 0))
    try {
      e.hostname = CE.toUnicode(e.hostname);
    } catch {
    }
  return li(Hu(e), li.defaultChars + "%");
}
function Bt(t, e) {
  if (!(this instanceof Bt))
    return new Bt(t, e);
  e || Yu(t) || (e = t || {}, t = "default"), this.inline = new Ro(), this.block = new Vs(), this.core = new zu(), this.renderer = new mi(), this.linkify = new At(), this.validateLink = Y3, this.normalizeLink = $3, this.normalizeLinkText = z3, this.utils = Wk, this.helpers = Hs({}, Xk), this.options = {}, this.configure(t), e && this.set(e);
}
Bt.prototype.set = function(t) {
  return Hs(this.options, t), this;
};
Bt.prototype.configure = function(t) {
  const e = this;
  if (Yu(t)) {
    const n = t;
    if (t = H3[n], !t)
      throw new Error('Wrong `markdown-it` preset "' + n + '", check name');
  }
  if (!t)
    throw new Error("Wrong `markdown-it` preset, can't be empty");
  return t.options && e.set(t.options), t.components && Object.keys(t.components).forEach(function(n) {
    t.components[n].rules && e[n].ruler.enableOnly(t.components[n].rules), t.components[n].rules2 && e[n].ruler2.enableOnly(t.components[n].rules2);
  }), this;
};
Bt.prototype.enable = function(t, e) {
  let n = [];
  Array.isArray(t) || (t = [t]), ["core", "block", "inline"].forEach(function(i) {
    n = n.concat(this[i].ruler.enable(t, !0));
  }, this), n = n.concat(this.inline.ruler2.enable(t, !0));
  const r = t.filter(function(i) {
    return n.indexOf(i) < 0;
  });
  if (r.length && !e)
    throw new Error("MarkdownIt. Failed to enable unknown rule(s): " + r);
  return this;
};
Bt.prototype.disable = function(t, e) {
  let n = [];
  Array.isArray(t) || (t = [t]), ["core", "block", "inline"].forEach(function(i) {
    n = n.concat(this[i].ruler.disable(t, !0));
  }, this), n = n.concat(this.inline.ruler2.disable(t, !0));
  const r = t.filter(function(i) {
    return n.indexOf(i) < 0;
  });
  if (r.length && !e)
    throw new Error("MarkdownIt. Failed to disable unknown rule(s): " + r);
  return this;
};
Bt.prototype.use = function(t) {
  const e = [this].concat(Array.prototype.slice.call(arguments, 1));
  return t.apply(t, e), this;
};
Bt.prototype.parse = function(t, e) {
  if (typeof t != "string")
    throw new Error("Input data should be a String");
  const n = new this.core.State(t, this, e);
  return this.core.process(n), n.tokens;
};
Bt.prototype.render = function(t, e) {
  return e = e || {}, this.renderer.render(this.parse(t, e), this.options, e);
};
Bt.prototype.parseInline = function(t, e) {
  const n = new this.core.State(t, this, e);
  return n.inlineMode = !0, this.core.process(n), n.tokens;
};
Bt.prototype.renderInline = function(t, e) {
  return e = e || {}, this.renderer.render(this.parseInline(t, e), this.options, e);
};
function q3(t, e, n) {
  function r(p) {
    return p.trim().split(" ", 2)[0] === e;
  }
  function i(p, _, m, f, g) {
    return p[_].nesting === 1 && p[_].attrJoin("class", e), g.renderToken(p, _, m, f, g);
  }
  n = n || {};
  const o = 3, a = n.marker || ":", s = a.charCodeAt(0), l = a.length, c = n.validate || r, u = n.render || i;
  function d(p, _, m, f) {
    let g, S = !1, E = p.bMarks[_] + p.tShift[_], b = p.eMarks[_];
    if (s !== p.src.charCodeAt(E))
      return !1;
    for (g = E + 1; g <= b && a[(g - E) % l] === p.src[g]; g++)
      ;
    const h = Math.floor((g - E) / l);
    if (h < o)
      return !1;
    g -= (g - E) % l;
    const T = p.src.slice(E, g), C = p.src.slice(g, b);
    if (!c(C, T))
      return !1;
    if (f)
      return !0;
    let v = _;
    for (; v++, !(v >= m || (E = p.bMarks[v] + p.tShift[v], b = p.eMarks[v], E < b && p.sCount[v] < p.blkIndent)); )
      if (s === p.src.charCodeAt(E) && !(p.sCount[v] - p.blkIndent >= 4)) {
        for (g = E + 1; g <= b && a[(g - E) % l] === p.src[g]; g++)
          ;
        if (!(Math.floor((g - E) / l) < h) && (g -= (g - E) % l, g = p.skipSpaces(g), !(g < b))) {
          S = !0;
          break;
        }
      }
    const I = p.parentType, N = p.lineMax;
    p.parentType = "container", p.lineMax = v;
    const x = p.push("container_" + e + "_open", "div", 1);
    x.markup = T, x.block = !0, x.info = C, x.map = [_, v], p.md.block.tokenize(p, _ + 1, v);
    const P = p.push("container_" + e + "_close", "div", -1);
    return P.markup = p.src.slice(E, g), P.block = !0, p.parentType = I, p.lineMax = N, p.line = v + (S ? 1 : 0), !0;
  }
  t.block.ruler.before("fence", "container_" + e, d, {
    alt: ["paragraph", "reference", "blockquote", "list"]
  }), t.renderer.rules["container_" + e + "_open"] = u, t.renderer.rules["container_" + e + "_close"] = u;
}
var Bc = !0, vE = !1, RE = !1, W3 = function(t, e) {
  e && (Bc = !e.enabled, vE = !!e.label, RE = !!e.labelAfter), t.core.ruler.after("inline", "github-task-lists", function(n) {
    for (var r = n.tokens, i = 2; i < r.length; i++)
      Q3(r, i) && (Z3(r[i], n.Token), Sm(r[i - 2], "class", "task-list-item" + (Bc ? "" : " enabled")), Sm(r[K3(r, i - 2)], "class", "contains-task-list"));
  });
};
function Sm(t, e, n) {
  var r = t.attrIndex(e), i = [e, n];
  r < 0 ? t.attrPush(i) : t.attrs[r] = i;
}
function K3(t, e) {
  for (var n = t[e].level - 1, r = e - 1; r >= 0; r--)
    if (t[r].level === n)
      return r;
  return -1;
}
function Q3(t, e) {
  return t4(t[e]) && n4(t[e - 1]) && r4(t[e - 2]) && i4(t[e]);
}
function Z3(t, e) {
  if (t.children.unshift(X3(t, e)), t.children[1].content = t.children[1].content.slice(3), t.content = t.content.slice(3), vE)
    if (RE) {
      t.children.pop();
      var n = "task-item-" + Math.ceil(Math.random() * (1e4 * 1e3) - 1e3);
      t.children[0].content = t.children[0].content.slice(0, -1) + ' id="' + n + '">', t.children.push(e4(t.content, n, e));
    } else
      t.children.unshift(j3(e)), t.children.push(J3(e));
}
function X3(t, e) {
  var n = new e("html_inline", "", 0), r = Bc ? ' disabled="" ' : "";
  return t.content.indexOf("[ ] ") === 0 ? n.content = '<input class="task-list-item-checkbox"' + r + 'type="checkbox">' : (t.content.indexOf("[x] ") === 0 || t.content.indexOf("[X] ") === 0) && (n.content = '<input class="task-list-item-checkbox" checked=""' + r + 'type="checkbox">'), n;
}
function j3(t) {
  var e = new t("html_inline", "", 0);
  return e.content = "<label>", e;
}
function J3(t) {
  var e = new t("html_inline", "", 0);
  return e.content = "</label>", e;
}
function e4(t, e, n) {
  var r = new n("html_inline", "", 0);
  return r.content = '<label class="task-list-item-label" for="' + e + '">' + t + "</label>", r.attrs = [{ for: e }], r;
}
function t4(t) {
  return t.type === "inline";
}
function n4(t) {
  return t.type === "paragraph_open";
}
function r4(t) {
  return t.type === "list_item_open";
}
function i4(t) {
  return t.content.indexOf("[ ] ") === 0 || t.content.indexOf("[x] ") === 0 || t.content.indexOf("[X] ") === 0;
}
const o4 = /* @__PURE__ */ Ds(W3);
function a4(t) {
  for (var e = 1; e < arguments.length; e++) {
    var n = arguments[e];
    for (var r in n)
      n.hasOwnProperty(r) && (t[r] = n[r]);
  }
  return t;
}
function Uc(t, e) {
  return Array(e + 1).join(t);
}
function s4(t) {
  return t.replace(/^\n*/, "");
}
function l4(t) {
  for (var e = t.length; e > 0 && t[e - 1] === `
`; ) e--;
  return t.substring(0, e);
}
var c4 = [
  "ADDRESS",
  "ARTICLE",
  "ASIDE",
  "AUDIO",
  "BLOCKQUOTE",
  "BODY",
  "CANVAS",
  "CENTER",
  "DD",
  "DIR",
  "DIV",
  "DL",
  "DT",
  "FIELDSET",
  "FIGCAPTION",
  "FIGURE",
  "FOOTER",
  "FORM",
  "FRAMESET",
  "H1",
  "H2",
  "H3",
  "H4",
  "H5",
  "H6",
  "HEADER",
  "HGROUP",
  "HR",
  "HTML",
  "ISINDEX",
  "LI",
  "MAIN",
  "MENU",
  "NAV",
  "NOFRAMES",
  "NOSCRIPT",
  "OL",
  "OUTPUT",
  "P",
  "PRE",
  "SECTION",
  "TABLE",
  "TBODY",
  "TD",
  "TFOOT",
  "TH",
  "THEAD",
  "TR",
  "UL"
];
function Ku(t) {
  return Qu(t, c4);
}
var OE = [
  "AREA",
  "BASE",
  "BR",
  "COL",
  "COMMAND",
  "EMBED",
  "HR",
  "IMG",
  "INPUT",
  "KEYGEN",
  "LINK",
  "META",
  "PARAM",
  "SOURCE",
  "TRACK",
  "WBR"
];
function NE(t) {
  return Qu(t, OE);
}
function u4(t) {
  return IE(t, OE);
}
var AE = [
  "A",
  "TABLE",
  "THEAD",
  "TBODY",
  "TFOOT",
  "TH",
  "TD",
  "IFRAME",
  "SCRIPT",
  "AUDIO",
  "VIDEO"
];
function d4(t) {
  return Qu(t, AE);
}
function p4(t) {
  return IE(t, AE);
}
function Qu(t, e) {
  return e.indexOf(t.nodeName) >= 0;
}
function IE(t, e) {
  return t.getElementsByTagName && e.some(function(n) {
    return t.getElementsByTagName(n).length;
  });
}
var at = {};
at.paragraph = {
  filter: "p",
  replacement: function(t) {
    return `

` + t + `

`;
  }
};
at.lineBreak = {
  filter: "br",
  replacement: function(t, e, n) {
    return n.br + `
`;
  }
};
at.heading = {
  filter: ["h1", "h2", "h3", "h4", "h5", "h6"],
  replacement: function(t, e, n) {
    var r = Number(e.nodeName.charAt(1));
    if (n.headingStyle === "setext" && r < 3) {
      var i = Uc(r === 1 ? "=" : "-", t.length);
      return `

` + t + `
` + i + `

`;
    } else
      return `

` + Uc("#", r) + " " + t + `

`;
  }
};
at.blockquote = {
  filter: "blockquote",
  replacement: function(t) {
    return t = t.replace(/^\n+|\n+$/g, ""), t = t.replace(/^/gm, "> "), `

` + t + `

`;
  }
};
at.list = {
  filter: ["ul", "ol"],
  replacement: function(t, e) {
    var n = e.parentNode;
    return n.nodeName === "LI" && n.lastElementChild === e ? `
` + t : `

` + t + `

`;
  }
};
at.listItem = {
  filter: "li",
  replacement: function(t, e, n) {
    t = t.replace(/^\n+/, "").replace(/\n+$/, `
`).replace(/\n/gm, `
    `);
    var r = n.bulletListMarker + "   ", i = e.parentNode;
    if (i.nodeName === "OL") {
      var o = i.getAttribute("start"), a = Array.prototype.indexOf.call(i.children, e);
      r = (o ? Number(o) + a : a + 1) + ".  ";
    }
    return r + t + (e.nextSibling && !/\n$/.test(t) ? `
` : "");
  }
};
at.indentedCodeBlock = {
  filter: function(t, e) {
    return e.codeBlockStyle === "indented" && t.nodeName === "PRE" && t.firstChild && t.firstChild.nodeName === "CODE";
  },
  replacement: function(t, e, n) {
    return `

    ` + e.firstChild.textContent.replace(/\n/g, `
    `) + `

`;
  }
};
at.fencedCodeBlock = {
  filter: function(t, e) {
    return e.codeBlockStyle === "fenced" && t.nodeName === "PRE" && t.firstChild && t.firstChild.nodeName === "CODE";
  },
  replacement: function(t, e, n) {
    for (var r = e.firstChild.getAttribute("class") || "", i = (r.match(/language-(\S+)/) || [null, ""])[1], o = e.firstChild.textContent, a = n.fence.charAt(0), s = 3, l = new RegExp("^" + a + "{3,}", "gm"), c; c = l.exec(o); )
      c[0].length >= s && (s = c[0].length + 1);
    var u = Uc(a, s);
    return `

` + u + i + `
` + o.replace(/\n$/, "") + `
` + u + `

`;
  }
};
at.horizontalRule = {
  filter: "hr",
  replacement: function(t, e, n) {
    return `

` + n.hr + `

`;
  }
};
at.inlineLink = {
  filter: function(t, e) {
    return e.linkStyle === "inlined" && t.nodeName === "A" && t.getAttribute("href");
  },
  replacement: function(t, e) {
    var n = e.getAttribute("href");
    n && (n = n.replace(/([()])/g, "\\$1"));
    var r = ds(e.getAttribute("title"));
    return r && (r = ' "' + r.replace(/"/g, '\\"') + '"'), "[" + t + "](" + n + r + ")";
  }
};
at.referenceLink = {
  filter: function(t, e) {
    return e.linkStyle === "referenced" && t.nodeName === "A" && t.getAttribute("href");
  },
  replacement: function(t, e, n) {
    var r = e.getAttribute("href"), i = ds(e.getAttribute("title"));
    i && (i = ' "' + i + '"');
    var o, a;
    switch (n.linkReferenceStyle) {
      case "collapsed":
        o = "[" + t + "][]", a = "[" + t + "]: " + r + i;
        break;
      case "shortcut":
        o = "[" + t + "]", a = "[" + t + "]: " + r + i;
        break;
      default:
        var s = this.references.length + 1;
        o = "[" + t + "][" + s + "]", a = "[" + s + "]: " + r + i;
    }
    return this.references.push(a), o;
  },
  references: [],
  append: function(t) {
    var e = "";
    return this.references.length && (e = `

` + this.references.join(`
`) + `

`, this.references = []), e;
  }
};
at.emphasis = {
  filter: ["em", "i"],
  replacement: function(t, e, n) {
    return t.trim() ? n.emDelimiter + t + n.emDelimiter : "";
  }
};
at.strong = {
  filter: ["strong", "b"],
  replacement: function(t, e, n) {
    return t.trim() ? n.strongDelimiter + t + n.strongDelimiter : "";
  }
};
at.code = {
  filter: function(t) {
    var e = t.previousSibling || t.nextSibling, n = t.parentNode.nodeName === "PRE" && !e;
    return t.nodeName === "CODE" && !n;
  },
  replacement: function(t) {
    if (!t) return "";
    t = t.replace(/\r?\n|\r/g, " ");
    for (var e = /^`|^ .*?[^ ].* $|`$/.test(t) ? " " : "", n = "`", r = t.match(/`+/gm) || []; r.indexOf(n) !== -1; ) n = n + "`";
    return n + e + t + e + n;
  }
};
at.image = {
  filter: "img",
  replacement: function(t, e) {
    var n = ds(e.getAttribute("alt")), r = e.getAttribute("src") || "", i = ds(e.getAttribute("title")), o = i ? ' "' + i + '"' : "";
    return r ? "![" + n + "](" + r + o + ")" : "";
  }
};
function ds(t) {
  return t ? t.replace(/(\n+\s*)+/g, `
`) : "";
}
function xE(t) {
  this.options = t, this._keep = [], this._remove = [], this.blankRule = {
    replacement: t.blankReplacement
  }, this.keepReplacement = t.keepReplacement, this.defaultRule = {
    replacement: t.defaultReplacement
  }, this.array = [];
  for (var e in t.rules) this.array.push(t.rules[e]);
}
xE.prototype = {
  add: function(t, e) {
    this.array.unshift(e);
  },
  keep: function(t) {
    this._keep.unshift({
      filter: t,
      replacement: this.keepReplacement
    });
  },
  remove: function(t) {
    this._remove.unshift({
      filter: t,
      replacement: function() {
        return "";
      }
    });
  },
  forNode: function(t) {
    if (t.isBlank) return this.blankRule;
    var e;
    return (e = Vl(this.array, t, this.options)) || (e = Vl(this._keep, t, this.options)) || (e = Vl(this._remove, t, this.options)) ? e : this.defaultRule;
  },
  forEach: function(t) {
    for (var e = 0; e < this.array.length; e++) t(this.array[e], e);
  }
};
function Vl(t, e, n) {
  for (var r = 0; r < t.length; r++) {
    var i = t[r];
    if (_4(i, e, n)) return i;
  }
}
function _4(t, e, n) {
  var r = t.filter;
  if (typeof r == "string") {
    if (r === e.nodeName.toLowerCase()) return !0;
  } else if (Array.isArray(r)) {
    if (r.indexOf(e.nodeName.toLowerCase()) > -1) return !0;
  } else if (typeof r == "function") {
    if (r.call(t, e, n)) return !0;
  } else
    throw new TypeError("`filter` needs to be a string, array, or function");
}
function m4(t) {
  var e = t.element, n = t.isBlock, r = t.isVoid, i = t.isPre || function(d) {
    return d.nodeName === "PRE";
  };
  if (!(!e.firstChild || i(e))) {
    for (var o = null, a = !1, s = null, l = bm(s, e, i); l !== e; ) {
      if (l.nodeType === 3 || l.nodeType === 4) {
        var c = l.data.replace(/[ \r\n\t]+/g, " ");
        if ((!o || / $/.test(o.data)) && !a && c[0] === " " && (c = c.substr(1)), !c) {
          l = Yl(l);
          continue;
        }
        l.data = c, o = l;
      } else if (l.nodeType === 1)
        n(l) || l.nodeName === "BR" ? (o && (o.data = o.data.replace(/ $/, "")), o = null, a = !1) : r(l) || i(l) ? (o = null, a = !0) : o && (a = !1);
      else {
        l = Yl(l);
        continue;
      }
      var u = bm(s, l, i);
      s = l, l = u;
    }
    o && (o.data = o.data.replace(/ $/, ""), o.data || Yl(o));
  }
}
function Yl(t) {
  var e = t.nextSibling || t.parentNode;
  return t.parentNode.removeChild(t), e;
}
function bm(t, e, n) {
  return t && t.parentNode === e || n(e) ? e.nextSibling || e.parentNode : e.firstChild || e.nextSibling || e.parentNode;
}
var Zu = typeof window < "u" ? window : {};
function f4() {
  var t = Zu.DOMParser, e = !1;
  try {
    new t().parseFromString("", "text/html") && (e = !0);
  } catch {
  }
  return e;
}
function g4() {
  var t = function() {
  };
  return h4() ? t.prototype.parseFromString = function(e) {
    var n = new window.ActiveXObject("htmlfile");
    return n.designMode = "on", n.open(), n.write(e), n.close(), n;
  } : t.prototype.parseFromString = function(e) {
    var n = document.implementation.createHTMLDocument("");
    return n.open(), n.write(e), n.close(), n;
  }, t;
}
function h4() {
  var t = !1;
  try {
    document.implementation.createHTMLDocument("").open();
  } catch {
    Zu.ActiveXObject && (t = !0);
  }
  return t;
}
var E4 = f4() ? Zu.DOMParser : g4();
function S4(t, e) {
  var n;
  if (typeof t == "string") {
    var r = b4().parseFromString(
      // DOM parsers arrange elements in the <head> and <body>.
      // Wrapping in a custom element ensures elements are reliably arranged in
      // a single element.
      '<x-turndown id="turndown-root">' + t + "</x-turndown>",
      "text/html"
    );
    n = r.getElementById("turndown-root");
  } else
    n = t.cloneNode(!0);
  return m4({
    element: n,
    isBlock: Ku,
    isVoid: NE,
    isPre: e.preformattedCode ? T4 : null
  }), n;
}
var $l;
function b4() {
  return $l = $l || new E4(), $l;
}
function T4(t) {
  return t.nodeName === "PRE" || t.nodeName === "CODE";
}
function C4(t, e) {
  return t.isBlock = Ku(t), t.isCode = t.nodeName === "CODE" || t.parentNode.isCode, t.isBlank = y4(t), t.flankingWhitespace = v4(t, e), t;
}
function y4(t) {
  return !NE(t) && !d4(t) && /^\s*$/i.test(t.textContent) && !u4(t) && !p4(t);
}
function v4(t, e) {
  if (t.isBlock || e.preformattedCode && t.isCode)
    return { leading: "", trailing: "" };
  var n = R4(t.textContent);
  return n.leadingAscii && Tm("left", t, e) && (n.leading = n.leadingNonAscii), n.trailingAscii && Tm("right", t, e) && (n.trailing = n.trailingNonAscii), { leading: n.leading, trailing: n.trailing };
}
function R4(t) {
  var e = t.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);
  return {
    leading: e[1],
    // whole string for whitespace-only strings
    leadingAscii: e[2],
    leadingNonAscii: e[3],
    trailing: e[4],
    // empty for whitespace-only strings
    trailingNonAscii: e[5],
    trailingAscii: e[6]
  };
}
function Tm(t, e, n) {
  var r, i, o;
  return t === "left" ? (r = e.previousSibling, i = / $/) : (r = e.nextSibling, i = /^ /), r && (r.nodeType === 3 ? o = i.test(r.nodeValue) : n.preformattedCode && r.nodeName === "CODE" ? o = !1 : r.nodeType === 1 && !Ku(r) && (o = i.test(r.textContent))), o;
}
var O4 = Array.prototype.reduce, N4 = [
  [/\\/g, "\\\\"],
  [/\*/g, "\\*"],
  [/^-/g, "\\-"],
  [/^\+ /g, "\\+ "],
  [/^(=+)/g, "\\$1"],
  [/^(#{1,6}) /g, "\\$1 "],
  [/`/g, "\\`"],
  [/^~~~/g, "\\~~~"],
  [/\[/g, "\\["],
  [/\]/g, "\\]"],
  [/^>/g, "\\>"],
  [/_/g, "\\_"],
  [/^(\d+)\. /g, "$1\\. "]
];
function ps(t) {
  if (!(this instanceof ps)) return new ps(t);
  var e = {
    rules: at,
    headingStyle: "setext",
    hr: "* * *",
    bulletListMarker: "*",
    codeBlockStyle: "indented",
    fence: "```",
    emDelimiter: "_",
    strongDelimiter: "**",
    linkStyle: "inlined",
    linkReferenceStyle: "full",
    br: "  ",
    preformattedCode: !1,
    blankReplacement: function(n, r) {
      return r.isBlock ? `

` : "";
    },
    keepReplacement: function(n, r) {
      return r.isBlock ? `

` + r.outerHTML + `

` : r.outerHTML;
    },
    defaultReplacement: function(n, r) {
      return r.isBlock ? `

` + n + `

` : n;
    }
  };
  this.options = a4({}, e, t), this.rules = new xE(this.options);
}
ps.prototype = {
  /**
   * The entry point for converting a string or DOM node to Markdown
   * @public
   * @param {String|HTMLElement} input The string or DOM node to convert
   * @returns A Markdown representation of the input
   * @type String
   */
  turndown: function(t) {
    if (!x4(t))
      throw new TypeError(
        t + " is not a string, or an element/document/fragment node."
      );
    if (t === "") return "";
    var e = DE.call(this, new S4(t, this.options));
    return A4.call(this, e);
  },
  /**
   * Add one or more plugins
   * @public
   * @param {Function|Array} plugin The plugin or array of plugins to add
   * @returns The Turndown instance for chaining
   * @type Object
   */
  use: function(t) {
    if (Array.isArray(t))
      for (var e = 0; e < t.length; e++) this.use(t[e]);
    else if (typeof t == "function")
      t(this);
    else
      throw new TypeError("plugin must be a Function or an Array of Functions");
    return this;
  },
  /**
   * Adds a rule
   * @public
   * @param {String} key The unique key of the rule
   * @param {Object} rule The rule
   * @returns The Turndown instance for chaining
   * @type Object
   */
  addRule: function(t, e) {
    return this.rules.add(t, e), this;
  },
  /**
   * Keep a node (as HTML) that matches the filter
   * @public
   * @param {String|Array|Function} filter The unique key of the rule
   * @returns The Turndown instance for chaining
   * @type Object
   */
  keep: function(t) {
    return this.rules.keep(t), this;
  },
  /**
   * Remove a node that matches the filter
   * @public
   * @param {String|Array|Function} filter The unique key of the rule
   * @returns The Turndown instance for chaining
   * @type Object
   */
  remove: function(t) {
    return this.rules.remove(t), this;
  },
  /**
   * Escapes Markdown syntax
   * @public
   * @param {String} string The string to escape
   * @returns A string with Markdown syntax escaped
   * @type String
   */
  escape: function(t) {
    return N4.reduce(function(e, n) {
      return e.replace(n[0], n[1]);
    }, t);
  }
};
function DE(t) {
  var e = this;
  return O4.call(t.childNodes, function(n, r) {
    r = new C4(r, e.options);
    var i = "";
    return r.nodeType === 3 ? i = r.isCode ? r.nodeValue : e.escape(r.nodeValue) : r.nodeType === 1 && (i = I4.call(e, r)), wE(n, i);
  }, "");
}
function A4(t) {
  var e = this;
  return this.rules.forEach(function(n) {
    typeof n.append == "function" && (t = wE(t, n.append(e.options)));
  }), t.replace(/^[\t\r\n]+/, "").replace(/[\t\r\n\s]+$/, "");
}
function I4(t) {
  var e = this.rules.forNode(t), n = DE.call(this, t), r = t.flankingWhitespace;
  return (r.leading || r.trailing) && (n = n.trim()), r.leading + e.replacement(n, t, this.options) + r.trailing;
}
function wE(t, e) {
  var n = l4(t), r = s4(e), i = Math.max(t.length - n.length, e.length - r.length), o = `

`.substring(0, i);
  return n + o + r;
}
function x4(t) {
  return t != null && (typeof t == "string" || t.nodeType && (t.nodeType === 1 || t.nodeType === 9 || t.nodeType === 11));
}
var Cm = /highlight-(?:text|source)-([a-z0-9]+)/;
function D4(t) {
  t.addRule("highlightedCodeBlock", {
    filter: function(e) {
      var n = e.firstChild;
      return e.nodeName === "DIV" && Cm.test(e.className) && n && n.nodeName === "PRE";
    },
    replacement: function(e, n, r) {
      var i = n.className || "", o = (i.match(Cm) || [null, ""])[1];
      return `

` + r.fence + o + `
` + n.firstChild.textContent + `
` + r.fence + `

`;
    }
  });
}
function w4(t) {
  t.addRule("strikethrough", {
    filter: ["del", "s", "strike"],
    replacement: function(e) {
      return "~" + e + "~";
    }
  });
}
var M4 = Array.prototype.indexOf, L4 = Array.prototype.every, ui = {};
ui.tableCell = {
  filter: ["th", "td"],
  replacement: function(t, e) {
    return Xu(LE(e)) ? t : Hc(t, e);
  }
};
ui.tableRow = {
  filter: "tr",
  replacement: function(t, e) {
    const n = LE(e);
    if (Xu(n)) return t;
    var r = "", i = { left: ":--", right: "--:", center: ":-:" };
    if (k4(e)) {
      const l = kE(n);
      for (var o = 0; o < l; o++) {
        const c = l >= e.childNodes.length ? null : e.childNodes[o];
        var a = "---", s = c ? (c.getAttribute("align") || "").toLowerCase() : "";
        s && (a = i[s] || a), c ? r += Hc(a, e.childNodes[o]) : r += Hc(a, null, o);
      }
    }
    return `
` + t + (r ? `
` + r : "");
  }
};
ui.table = {
  // Only convert tables with a heading row.
  // Tables with no heading row are kept using `keep` (see below).
  filter: function(t) {
    return t.nodeName === "TABLE";
  },
  replacement: function(t, e) {
    if (Xu(e)) return t;
    t = t.replace(/\n+/g, `
`);
    var n = t.trim().split(`
`);
    n.length >= 2 && (n = n[1]);
    var r = n.indexOf("| ---") === 0, i = kE(e), o = "";
    return i && !r && (o = "|" + "     |".repeat(i) + `
|` + " --- |".repeat(i)), `

` + o + t + `

`;
  }
};
ui.tableSection = {
  filter: ["thead", "tbody", "tfoot"],
  replacement: function(t) {
    return t;
  }
};
function k4(t) {
  var e = t.parentNode;
  return e.nodeName === "THEAD" || e.firstChild === t && (e.nodeName === "TABLE" || P4(e)) && L4.call(t.childNodes, function(n) {
    return n.nodeName === "TH";
  });
}
function P4(t) {
  var e = t.previousSibling;
  return t.nodeName === "TBODY" && (!e || e.nodeName === "THEAD" && /^\s*$/i.test(e.textContent));
}
function Hc(t, e = null, n = null) {
  n === null && (n = M4.call(e.parentNode.childNodes, e));
  var r = " ";
  n === 0 && (r = "| ");
  let i = t.trim().replace(/\n\r/g, "<br>").replace(/\n/g, "<br>");
  for (i = i.replace(/\|+/g, "\\|"); i.length < 3; ) i += " ";
  return e && (i = F4(i, e, " ")), r + i + " |";
}
function ME(t) {
  if (!t.childNodes) return !1;
  for (let e = 0; e < t.childNodes.length; e++) {
    const n = t.childNodes[e];
    if (n.nodeName === "TABLE" || ME(n)) return !0;
  }
  return !1;
}
function Xu(t) {
  return !!(!t || !t.rows || t.rows.length === 1 && t.rows[0].childNodes.length <= 1 || ME(t));
}
function LE(t) {
  let e = t.parentNode;
  for (; e.nodeName !== "TABLE"; )
    if (e = e.parentNode, !e) return null;
  return e;
}
function F4(t, e, n) {
  const r = e.getAttribute("colspan") || 1;
  for (let i = 1; i < r; i++)
    t += " | " + n.repeat(3);
  return t;
}
function kE(t) {
  let e = 0;
  for (let n = 0; n < t.rows.length; n++) {
    const i = t.rows[n].childNodes.length;
    i > e && (e = i);
  }
  return e;
}
function PE(t) {
  t.keep(function(n) {
    return n.nodeName === "TABLE";
  });
  for (var e in ui) t.addRule(e, ui[e]);
}
function B4(t) {
  t.addRule("taskListItems", {
    filter: function(e) {
      return e.type === "checkbox" && e.parentNode.nodeName === "LI";
    },
    replacement: function(e, n) {
      return (n.checked ? "[x]" : "[ ]") + " ";
    }
  });
}
function U4(t) {
  t.use([
    D4,
    w4,
    PE,
    B4
  ]);
}
const ju = Bt({
  html: !0,
  linkify: !0,
  typographer: !0
});
ju.use(q3, "container-wrapper", {
  validate: function(t) {
    return !0;
  },
  render: function(t, e) {
    return t[e].nesting === 1 ? `<div class="container-wrapper ${t[e].info.trim().split(" ")[0]}">` : "</div>";
  }
});
ju.use(o4, {
  enabled: !0,
  label: !0
});
const Rr = new ps({
  headingStyle: "atx",
  hr: "---",
  bulletListMarker: "-",
  codeBlockStyle: "fenced",
  fence: "```",
  emDelimiter: "_",
  strongDelimiter: "**",
  linkStyle: "inlined",
  linkReferenceStyle: "full",
  preformattedCode: !1
});
Rr.use(U4);
Rr.use(PE);
Rr.addRule("strikethrough", {
  filter: ["del", "s", "strike"],
  replacement: function(t) {
    return "~~" + t + "~~";
  }
});
Rr.keep((t) => !(t && t.nodeName === "DIV"));
Rr.addRule("checkbox", {
  filter: (t) => {
    var e, n;
    if (t.tagName === "INPUT" && t.getAttribute("type") === "checkbox")
      return !0;
    if (t.tagName === "LABEL" && ((e = t.firstElementChild) == null ? void 0 : e.tagName) === "INPUT" && ((n = t.firstElementChild) == null ? void 0 : n.getAttribute("type")) === "checkbox")
      return !0;
  },
  replacement: function(t, e) {
    var n;
    return e.type === "checkbox" ? e.checked ? "[x]" : "[ ]" : e.tagName === "LABEL" && ((n = e.firstElementChild) == null ? void 0 : n.type) === "checkbox" ? e.firstElementChild.checked ? "[x]" : "[ ]" : null;
  }
});
Rr.addRule("container", {
  // match <div class="container-wrapper warning">...</div>
  // filter: ['div'],
  filter: (t) => t.tagName === "DIV" && t.classList.contains("container-wrapper"),
  replacement: function(t, e) {
    let n = "";
    for (let r of e.classList)
      if (r != "container-wrapper") {
        n = r;
        break;
      }
    return `:::${n}
` + t.trim() + `
:::
`;
  }
});
const _s = (t) => {
  if (!t) return t;
  const e = ju.render(t).trim();
  return e ? Lc(e.includes("<pre") ? e : e.replace(/\n/g, "")) : t;
}, H4 = (t) => {
  if (!t) return t;
  const n = new DOMParser().parseFromString(t, "text/html");
  n.querySelectorAll("colgroup").forEach((a) => a.remove()), n.querySelectorAll("li").forEach((a) => {
    const s = a.querySelector("div");
    if (s && !s.querySelector("img")) {
      if (s.firstElementChild) {
        const c = document.createDocumentFragment();
        c.append(" "), s.firstElementChild.childNodes.forEach((u) => {
          c.append(u.cloneNode(!0));
        }), s.replaceWith(c);
      }
    }
  });
  const o = n.body.innerHTML;
  return Rr.turndown(o);
};
oe("linwiteditor-header", xg);
oe("linwiteditor-footer", Dg);
const G4 = {
  theme: "light",
  lang: "zh",
  contentRetentionKey: "ai-editor-content",
  editable: !0,
  draggable: !0,
  placeholder: "",
  toolbarSize: "small"
};
class V4 extends $C {
  constructor(n, r = {}) {
    super(r);
    M(this, "linwitDocEditor");
    this.linwitDocEditor = n;
  }
  parseHtml(n) {
    function r(o) {
      return new window.DOMParser().parseFromString(`<body>${o}</body>`, "text/html").body;
    }
    return $r.fromSchema(this.schema).parse(r(n), {}).content;
  }
  parseMarkdown(n) {
    const r = _s(n);
    return this.parseHtml(r);
  }
  insertMarkdown(n) {
    this.commands.insertContent(_s(n));
  }
}
class rB {
  constructor(e) {
    M(this, "customLayout", !1);
    M(this, "innerEditor");
    M(this, "container");
    M(this, "header");
    M(this, "mainEl");
    M(this, "footer");
    M(this, "options");
    M(this, "eventComponents", []);
    this.options = { ...G4, ...e }, this.initI18nAndInnerEditor();
  }
  initI18nAndInnerEditor() {
    const e = this.options.i18n || {}, n = {
      // de: {translation: {...de, ...i18nConfig.de}},
      en: { translation: { ...ak, ...e.en } },
      // pt: {translation: {...pt, ...i18nConfig.pt}},
      zh: { translation: { ...ok, ...e.zh } }
      // es: {translation: {...es, ...i18nConfig.es}},
      // hi: {translation: {...hi, ...i18nConfig.hi}},
      // id: {translation: {...id, ...i18nConfig.id}},
      // ja: {translation: {...ja, ...i18nConfig.ja}},
      // ko: {translation: {...ko, ...i18nConfig.ko}},
      // th: {translation: {...th, ...i18nConfig.th}},
      // vi: {translation: {...vi, ...i18nConfig.vi}},
    };
    for (let r of Object.keys(e))
      r != "de" && r != "en" && r != "pt" && r != "zh" && (n[r] = {
        translation: { ...e[r] }
      });
    Je.init({
      lng: this.options.lang,
      resources: n
    }, (r, i) => {
      this.initInnerEditor();
    });
  }
  initInnerEditor() {
    const e = typeof this.options.element == "string" ? document.querySelector(this.options.element) : this.options.element;
    e.classList.add(`linwiteditor-theme-${this.options.theme}`), this.container = e.querySelector(".linwiteditor-container"), this.container ? this.customLayout = !0 : (this.container = document.createElement("div"), this.container.classList.add("linwiteditor-container")), e.appendChild(this.container), this.mainEl = document.createElement("div"), this.mainEl.style.flexGrow = "1", this.mainEl.style.overflow = "auto", this.header = new xg(), this.eventComponents.push(this.header), this.footer = new Dg(), this.footer.initDraggable(this.options.draggable), this.eventComponents.push(this.footer);
    let n = this.options.content;
    if (typeof n == "string" && (this.options.contentIsMarkdown ? n = _s(n) : n = Lc(n)), this.options.contentRetention && this.options.contentRetentionKey) {
      const r = localStorage.getItem(this.options.contentRetentionKey);
      if (r)
        try {
          n = JSON.parse(r);
        } catch (i) {
          console.error(i, "Can not parse the cache content from localStorage.");
        }
    }
    this.innerEditor = new V4(this, {
      ...this.options,
      element: this.mainEl,
      content: n,
      editable: this.options.editable,
      extensions: this.getExtensions(),
      onCreate: (r) => this.onCreate(r),
      onTransaction: (r) => this.onTransaction(r),
      onFocus: () => {
        var r, i;
        return (i = (r = this.options) == null ? void 0 : r.onFocus) == null ? void 0 : i.call(r, this);
      },
      onBlur: () => {
        var r, i;
        return (i = (r = this.options) == null ? void 0 : r.onBlur) == null ? void 0 : i.call(r, this);
      },
      onDestroy: () => {
        var r, i;
        return (i = (r = this.options) == null ? void 0 : r.onDestroy) == null ? void 0 : i.call(r, this);
      },
      editorProps: {
        attributes: {
          class: "linwiteditor-content"
        }
      }
    });
  }
  getExtensions() {
    let e = ik(this, this.options);
    if (this.options.onCreateBefore) {
      const n = this.options.onCreateBefore(this, e);
      n && (e = n);
    }
    return e;
  }
  onCreate(e) {
    this.innerEditor.view.dom.style.height = "calc(100% - 20px)", this.eventComponents.forEach((o) => {
      o.onCreate && o.onCreate(e, this.options);
    }), (this.container.querySelector(".linwiteditor-container-header") || this.container).appendChild(this.header), (this.container.querySelector(".linwiteditor-container-main") || this.container).appendChild(this.mainEl), (this.container.querySelector(".linwiteditor-container-footer") || this.container).appendChild(this.footer), this.options.ai && zn.init(this.innerEditor, this.options.ai), this.options.onCreated && this.options.onCreated(this);
  }
  onTransaction(e) {
    var n, r;
    if (this.eventComponents.forEach((i) => {
      i.onTransaction && i.onTransaction(e);
    }), !e.transaction.getMeta("ignoreChanged") && ((r = (n = this.options).onTransaction) == null || r.call(n, this, e.transaction), e.transaction.docChanged && this.options.onChange && this.options.onChange(this), e.transaction.docChanged && this.options.contentRetention && this.options.contentRetentionKey)) {
      const i = e.editor.getHTML();
      if (i === "<p></p>" || i === "")
        localStorage.removeItem(this.options.contentRetentionKey);
      else {
        const o = e.editor.getJSON();
        localStorage.setItem(this.options.contentRetentionKey, JSON.stringify(o));
      }
    }
  }
  getHtml() {
    return this.innerEditor.getHTML();
  }
  getJson() {
    return this.innerEditor.getJSON();
  }
  getText() {
    return this.innerEditor.getText();
  }
  getSelectedText() {
    const e = this.innerEditor.state.selection;
    return e.empty ? "" : Rs(this.innerEditor.state.doc, { from: e.from, to: e.to });
  }
  getMarkdown() {
    return H4(this.getHtml());
  }
  getOptions() {
    return this.options;
  }
  getAttributes(e) {
    return this.innerEditor.getAttributes(e);
  }
  setAttributes(e, n) {
    this.innerEditor.commands.updateAttributes(e, n);
  }
  isActive(e, n) {
    return typeof e == "object" || !n ? this.innerEditor.isActive(e) : this.innerEditor.isActive(e, n);
  }
  commands() {
    return this.innerEditor.commands;
  }
  commandsChain() {
    return this.innerEditor.chain();
  }
  getOutline() {
    const e = this.innerEditor.state.doc, n = [];
    return e.descendants((r, i) => {
      if (r.type.name === "heading") {
        const o = `linwiteditor-heading-${n.length + 1}`;
        if (r.attrs.id !== o) {
          const { state: { tr: s }, view: { dispatch: l } } = this.innerEditor;
          l(s.setNodeMarkup(i, void 0, {
            ...r.attrs,
            id: o
          }).setMeta("ignoreChanged", !0));
        }
        let a = "";
        r.descendants((s) => {
          s.text && (a += s.text);
        }), n.push({
          id: o,
          text: a,
          level: r.attrs.level,
          pos: i,
          size: r.nodeSize
        });
      }
    }), n;
  }
  focus() {
    return this.innerEditor.commands.focus(), this;
  }
  focusPos(e) {
    return this.innerEditor.commands.focus(e), this;
  }
  focusStart() {
    return this.innerEditor.commands.focus("start"), this;
  }
  focusEnd() {
    return this.innerEditor.commands.focus("end"), this;
  }
  isFocused() {
    return this.innerEditor.isFocused;
  }
  blur() {
    return this.innerEditor.commands.blur(), this;
  }
  insert(e) {
    return typeof e == "string" && (e = Lc(e)), this.innerEditor.commands.insertContent(e), this;
  }
  insertMarkdown(e) {
    return this.innerEditor.insertMarkdown(e), this;
  }
  setEditable(e) {
    return this.options.editable = e, this.innerEditor.setEditable(e, !0), this.eventComponents.forEach((n) => {
      n.onEditableChange(e);
    }), this;
  }
  setContent(e) {
    return this.focus().clear().insert(e), this;
  }
  setMarkdownContent(e) {
    const n = _s(e);
    return this.setContent(n);
  }
  clear() {
    return this.innerEditor.commands.clearContent(!0), this;
  }
  isEmpty() {
    return this.innerEditor.isEmpty;
  }
  changeLang(e) {
    return this.destroy(), this.options.lang = e, Je.changeLanguage(e), this.initInnerEditor(), this;
  }
  changeTheme(e) {
    const n = typeof this.options.element == "string" ? document.querySelector(this.options.element) : this.options.element;
    e || (e = this.options.theme === "dark" ? "light" : "dark"), n.classList.remove(`linwiteditor-theme-${this.options.theme}`), n.classList.add(`linwiteditor-theme-${e}`), this.options.theme = e;
  }
  removeRetention() {
    return this.options.contentRetentionKey && localStorage.removeItem(this.options.contentRetentionKey), this;
  }
  destroy() {
    var e, n, r, i;
    (n = (e = this.options).onDestroy) == null || n.call(e, this), this.innerEditor.destroy(), this.eventComponents = [], this.customLayout ? ((r = this.header) == null || r.remove(), this.mainEl.remove(), (i = this.footer) == null || i.remove()) : this.container.remove();
  }
  isDestroyed() {
    return this.innerEditor.isDestroyed;
  }
}
export {
  rB as AiEditor,
  zn as AiModelManager,
  tR as CustomAiModel,
  V4 as InnerEditor,
  nR as OpenaiAiModel,
  Qv as SparkAiModel,
  Zv as WenXinAiModel
};
