@oomol-lab/open-flow 0.1.0-beta.3 → 0.1.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/browser/DesignerIcon-XKBRy_0Q.js +2066 -0
  2. package/dist/browser/{createResourceDialog-BkZns-oZ.js → createResourceDialog-Cf7QpXp6.js} +161 -160
  3. package/dist/browser/{dist-BMqL-qR5.js → dist-BMRLCebL.js} +291 -292
  4. package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
  5. package/dist/browser/{dist-CJpzJrLM.js → dist-Cc0y2Pli.js} +811 -812
  6. package/dist/browser/{dist-DUzA0Ukh.js → dist-Dg_VXC8f.js} +134 -135
  7. package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
  8. package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
  9. package/dist/browser/dist-DxahK_I8.js +2688 -0
  10. package/dist/browser/{dist-CPuF50D9.js → dist-meg_oHVR.js} +335 -335
  11. package/dist/browser/{esm-C2UUqIUP.js → esm-xWDFFpGd.js} +5 -6
  12. package/dist/browser/flow-authoring-module.d.ts +2 -2
  13. package/dist/browser/flow-authoring-node.d.ts +5 -2
  14. package/dist/browser/flow-authoring.d.ts +1 -1
  15. package/dist/browser/flow-authoring.js +489 -209
  16. package/dist/browser/flow-change.d.ts +110 -9
  17. package/dist/browser/flow-change.js +319 -96
  18. package/dist/browser/flow-notifications.d.ts +5 -0
  19. package/dist/browser/{diagnostics-SDCyFuxm.js → flowChanges-CeMiiZIO.js} +4234 -3825
  20. package/dist/browser/{flowRunInputEditorStore-CwvOiIiU.js → flowRunInputEditorStore-DDidwd8h.js} +10 -2
  21. package/dist/browser/{flowWorkspace-BZ_eiQNR.js → flowWorkspace-VnS8nLMT.js} +35268 -35081
  22. package/dist/browser/{getPseudoElementBounds-ESJExRFX.js → getPseudoElementBounds-5LArT6Xc.js} +1827 -2322
  23. package/dist/browser/icons-CRxvozBE.js +726 -0
  24. package/dist/browser/{typeScriptSession-mPCiA9sV.js → typeScriptSession-Bj2HDFRd.js} +256 -257
  25. package/dist/browser/waitNotificationInputs-ClCAEIAM.js +26 -0
  26. package/dist/browser/workbench.css +1 -1
  27. package/dist/browser/workbench.d.ts +1 -0
  28. package/dist/browser/workbench.js +851 -840
  29. package/dist/browser/{workbenchSelect-B2s1HV-Y.js → workbenchSelect-Cf1zlVm9.js} +479 -478
  30. package/dist/common/control-api-conformance.d.ts +1 -0
  31. package/dist/common/control-api-conformance.js +80 -19
  32. package/dist/common/control-api-errors.d.ts +4 -0
  33. package/dist/common/control-api.d.ts +26 -14
  34. package/dist/common/control-api.js +138 -89
  35. package/dist/common/flow-encoding.js +20 -8
  36. package/dist/common/flow-notifications.d.ts +5 -0
  37. package/dist/common/flow-semantics.d.ts +1 -0
  38. package/dist/common/flow-semantics.js +467 -381
  39. package/dist/common/run-events.js +2 -1
  40. package/dist/common/run-lifecycle.d.ts +17 -2
  41. package/dist/common/run-lifecycle.js +53 -2
  42. package/dist/common/scheduler.d.ts +64 -3
  43. package/dist/common/scheduler.js +417 -142
  44. package/dist/index.d.ts +1 -0
  45. package/package.json +1 -1
  46. package/dist/browser/dist-BpopSHwP.js +0 -1543
  47. package/dist/browser/dist-CUSrALSX.js +0 -1620
@@ -1,23 +1,23 @@
1
- import { _ as e, a as t, c as n, f as r, g as i, h as a, i as o, l as s, m as c, p as l, s as u, t as d, u as f, v as p, w as m, y as h } from "./dist-Mecbzdl2.js";
2
- import { D as g, S as _, a as v, b as y, m as b, n as x, o as S, r as C, t as w } from "./dist-BKuSVKCC.js";
3
- import { D as ee, N as T } from "./dist-CUSrALSX.js";
1
+ import { E as e, M as t } from "./dist-DxahK_I8.js";
2
+ import { _ as n, a as r, c as i, f as a, g as o, h as s, i as c, l, m as u, p as d, s as f, t as p, u as m, v as h, w as g, y as _ } from "./dist-Mecbzdl2.js";
3
+ import { D as v, S as y, a as b, b as x, m as S, n as ee, o as te, r as C, t as w } from "./dist-BKuSVKCC.js";
4
4
  //#region ../../node_modules/.bun/@codemirror+autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js
5
- var E = class {
5
+ var T = class {
6
6
  constructor(e, t, n, r) {
7
7
  this.state = e, this.pos = t, this.explicit = n, this.view = r, this.abortListeners = [], this.abortOnDocChange = !1;
8
8
  }
9
9
  tokenBefore(e) {
10
- let t = T(this.state).resolveInner(this.pos, -1);
11
- for (; t && e.indexOf(t.name) < 0;) t = t.parent;
12
- return t ? {
13
- from: t.from,
10
+ let n = t(this.state).resolveInner(this.pos, -1);
11
+ for (; n && e.indexOf(n.name) < 0;) n = n.parent;
12
+ return n ? {
13
+ from: n.from,
14
14
  to: this.pos,
15
- text: this.state.sliceDoc(t.from, this.pos),
16
- type: t.type
15
+ text: this.state.sliceDoc(n.from, this.pos),
16
+ type: n.type
17
17
  } : null;
18
18
  }
19
19
  matchBefore(e) {
20
- let t = this.state.doc.lineAt(this.pos), n = Math.max(t.from, this.pos - 250), r = t.text.slice(n - t.from, this.pos - t.from), i = r.search(k(e, !1));
20
+ let t = this.state.doc.lineAt(this.pos), n = Math.max(t.from, this.pos - 250), r = t.text.slice(n - t.from, this.pos - t.from), i = r.search(O(e, !1));
21
21
  return i < 0 ? null : {
22
22
  from: n + i,
23
23
  to: this.pos,
@@ -31,7 +31,7 @@ var E = class {
31
31
  e == "abort" && this.abortListeners && (this.abortListeners.push(t), n && n.onDocChange && (this.abortOnDocChange = !0));
32
32
  }
33
33
  };
34
- function te(e) {
34
+ function E(e) {
35
35
  let t = Object.keys(e).join(""), n = /\w/.test(t);
36
36
  return n && (t = t.replace(/\w/g, "")), `[${n ? "\\w" : ""}${t.replace(/[^\w\s]/g, "\\$&")}]`;
37
37
  }
@@ -41,7 +41,7 @@ function ne(e) {
41
41
  t[r[0]] = !0;
42
42
  for (let e = 1; e < r.length; e++) n[r[e]] = !0;
43
43
  }
44
- let r = te(t) + te(n) + "*$";
44
+ let r = E(t) + E(n) + "*$";
45
45
  return [RegExp("^" + r), new RegExp(r)];
46
46
  }
47
47
  function re(e) {
@@ -55,107 +55,107 @@ function re(e) {
55
55
  } : null;
56
56
  };
57
57
  }
58
- function ie(e, t) {
59
- return (n) => {
60
- for (let t = T(n.state).resolveInner(n.pos, -1); t; t = t.parent) {
61
- if (e.indexOf(t.name) > -1) return null;
62
- if (t.type.isTop) break;
58
+ function ie(e, n) {
59
+ return (r) => {
60
+ for (let n = t(r.state).resolveInner(r.pos, -1); n; n = n.parent) {
61
+ if (e.indexOf(n.name) > -1) return null;
62
+ if (n.type.isTop) break;
63
63
  }
64
- return t(n);
64
+ return n(r);
65
65
  };
66
66
  }
67
- var D = class {
67
+ var ae = class {
68
68
  constructor(e, t, n, r) {
69
69
  this.completion = e, this.source = t, this.match = n, this.score = r;
70
70
  }
71
71
  };
72
- function O(e) {
72
+ function D(e) {
73
73
  return e.selection.main.from;
74
74
  }
75
- function k(e, t) {
75
+ function O(e, t) {
76
76
  let { source: n } = e, r = t && n[0] != "^", i = n[n.length - 1] != "$";
77
77
  return !r && !i ? e : RegExp(`${r ? "^" : ""}(?:${n})${i ? "$" : ""}`, e.flags ?? (e.ignoreCase ? "i" : ""));
78
78
  }
79
- var A = /*@__PURE__*/ d.define();
80
- function ae(e, n, r, i) {
81
- let { main: a } = e.selection, o = r - a.from, s = i - a.from;
79
+ var k = /*@__PURE__*/ p.define();
80
+ function oe(e, t, n, i) {
81
+ let { main: a } = e.selection, o = n - a.from, s = i - a.from;
82
82
  return {
83
83
  ...e.changeByRange((c) => {
84
- if (c != a && r != i && e.sliceDoc(c.from + o, c.from + s) != e.sliceDoc(r, i)) return { range: c };
85
- let l = e.toText(n);
84
+ if (c != a && n != i && e.sliceDoc(c.from + o, c.from + s) != e.sliceDoc(n, i)) return { range: c };
85
+ let l = e.toText(t);
86
86
  return {
87
87
  changes: {
88
88
  from: c.from + o,
89
89
  to: i == a.from ? c.to : c.from + s,
90
90
  insert: l
91
91
  },
92
- range: t.cursor(c.from + o + l.length)
92
+ range: r.cursor(c.from + o + l.length)
93
93
  };
94
94
  }),
95
95
  scrollIntoView: !0,
96
96
  userEvent: "input.complete"
97
97
  };
98
98
  }
99
- var oe = /*@__PURE__*/ new WeakMap();
100
- function se(e) {
99
+ var se = /*@__PURE__*/ new WeakMap();
100
+ function ce(e) {
101
101
  if (!Array.isArray(e)) return e;
102
- let t = oe.get(e);
103
- return t || oe.set(e, t = re(e)), t;
102
+ let t = se.get(e);
103
+ return t || se.set(e, t = re(e)), t;
104
104
  }
105
- var j = /*@__PURE__*/ l.define(), M = /*@__PURE__*/ l.define(), ce = class {
106
- constructor(t) {
107
- this.pattern = t, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = [];
108
- for (let n = 0; n < t.length;) {
109
- let r = e(t, n), i = p(r);
105
+ var A = /*@__PURE__*/ d.define(), j = /*@__PURE__*/ d.define(), le = class {
106
+ constructor(e) {
107
+ this.pattern = e, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = [];
108
+ for (let t = 0; t < e.length;) {
109
+ let r = n(e, t), i = h(r);
110
110
  this.chars.push(r);
111
- let a = t.slice(n, n + i), o = a.toUpperCase();
112
- this.folded.push(e(o == a ? a.toLowerCase() : o, 0)), n += i;
111
+ let a = e.slice(t, t + i), o = a.toUpperCase();
112
+ this.folded.push(n(o == a ? a.toLowerCase() : o, 0)), t += i;
113
113
  }
114
- this.astral = t.length != this.chars.length;
114
+ this.astral = e.length != this.chars.length;
115
115
  }
116
116
  ret(e, t) {
117
117
  return this.score = e, this.matched = t, this;
118
118
  }
119
- match(t) {
119
+ match(e) {
120
120
  if (this.pattern.length == 0) return this.ret(-100, []);
121
- if (t.length < this.pattern.length) return null;
122
- let { chars: n, folded: r, any: i, precise: a, byWord: o } = this;
123
- if (n.length == 1) {
124
- let i = e(t, 0), a = p(i), o = a == t.length ? 0 : -100;
125
- if (i != n[0]) {
121
+ if (e.length < this.pattern.length) return null;
122
+ let { chars: t, folded: r, any: i, precise: a, byWord: o } = this;
123
+ if (t.length == 1) {
124
+ let i = n(e, 0), a = h(i), o = a == e.length ? 0 : -100;
125
+ if (i != t[0]) {
126
126
  if (i == r[0]) o += -200;
127
127
  else return null;
128
128
  }
129
129
  return this.ret(o, [0, a]);
130
130
  }
131
- let s = t.indexOf(this.pattern);
132
- if (s == 0) return this.ret(t.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]);
133
- let c = n.length, l = 0;
131
+ let s = e.indexOf(this.pattern);
132
+ if (s == 0) return this.ret(e.length == this.pattern.length ? 0 : -100, [0, this.pattern.length]);
133
+ let c = t.length, l = 0;
134
134
  if (s < 0) {
135
- for (let a = 0, o = Math.min(t.length, 200); a < o && l < c;) {
136
- let o = e(t, a);
137
- (o == n[l] || o == r[l]) && (i[l++] = a), a += p(o);
135
+ for (let a = 0, o = Math.min(e.length, 200); a < o && l < c;) {
136
+ let o = n(e, a);
137
+ (o == t[l] || o == r[l]) && (i[l++] = a), a += h(o);
138
138
  }
139
139
  if (l < c) return null;
140
140
  }
141
- let u = 0, d = 0, f = !1, h = 0, g = -1, _ = -1, v = /[a-z]/.test(t), y = !0;
142
- for (let i = 0, l = Math.min(t.length, 200), b = 0; i < l && d < c;) {
143
- let l = e(t, i);
144
- s < 0 && (u < c && l == n[u] && (a[u++] = i), h < c && (l == n[h] || l == r[h] ? (h == 0 && (g = i), _ = i + 1, h++) : h = 0));
145
- let x, S = l < 255 ? l >= 48 && l <= 57 || l >= 97 && l <= 122 ? 2 : +(l >= 65 && l <= 90) : (x = m(l)) == x.toLowerCase() ? x == x.toUpperCase() ? 0 : 2 : 1;
146
- (!i || S == 1 && v || b == 0 && S != 0) && (n[d] == l || r[d] == l && (f = !0) ? o[d++] = i : o.length && (y = !1)), b = S, i += p(l);
141
+ let u = 0, d = 0, f = !1, p = 0, m = -1, _ = -1, v = /[a-z]/.test(e), y = !0;
142
+ for (let i = 0, l = Math.min(e.length, 200), b = 0; i < l && d < c;) {
143
+ let l = n(e, i);
144
+ s < 0 && (u < c && l == t[u] && (a[u++] = i), p < c && (l == t[p] || l == r[p] ? (p == 0 && (m = i), _ = i + 1, p++) : p = 0));
145
+ let x, S = l < 255 ? l >= 48 && l <= 57 || l >= 97 && l <= 122 ? 2 : +(l >= 65 && l <= 90) : (x = g(l)) == x.toLowerCase() ? x == x.toUpperCase() ? 0 : 2 : 1;
146
+ (!i || S == 1 && v || b == 0 && S != 0) && (t[d] == l || r[d] == l && (f = !0) ? o[d++] = i : o.length && (y = !1)), b = S, i += h(l);
147
147
  }
148
- return d == c && o[0] == 0 && y ? this.result(-100 + (f ? -200 : 0), o, t) : h == c && g == 0 ? this.ret(-200 - t.length + (_ == t.length ? 0 : -100), [0, _]) : s > -1 ? this.ret(-700 - t.length, [s, s + this.pattern.length]) : h == c ? this.ret(-900 - t.length, [g, _]) : d == c ? this.result(-100 + (f ? -200 : 0) + -700 + (y ? 0 : -1100), o, t) : n.length == 2 ? null : this.result((i[0] ? -700 : 0) + -200 + -1100, i, t);
148
+ return d == c && o[0] == 0 && y ? this.result(-100 + (f ? -200 : 0), o, e) : p == c && m == 0 ? this.ret(-200 - e.length + (_ == e.length ? 0 : -100), [0, _]) : s > -1 ? this.ret(-700 - e.length, [s, s + this.pattern.length]) : p == c ? this.ret(-900 - e.length, [m, _]) : d == c ? this.result(-100 + (f ? -200 : 0) + -700 + (y ? 0 : -1100), o, e) : t.length == 2 ? null : this.result((i[0] ? -700 : 0) + -200 + -1100, i, e);
149
149
  }
150
- result(t, n, r) {
150
+ result(e, t, r) {
151
151
  let i = [], a = 0;
152
- for (let t of n) {
153
- let n = t + (this.astral ? p(e(r, t)) : 1);
154
- a && i[a - 1] == t ? i[a - 1] = n : (i[a++] = t, i[a++] = n);
152
+ for (let e of t) {
153
+ let t = e + (this.astral ? h(n(r, e)) : 1);
154
+ a && i[a - 1] == e ? i[a - 1] = t : (i[a++] = e, i[a++] = t);
155
155
  }
156
- return this.ret(t - r.length, i);
156
+ return this.ret(e - r.length, i);
157
157
  }
158
- }, le = class {
158
+ }, ue = class {
159
159
  constructor(e) {
160
160
  this.pattern = e, this.matched = [], this.score = 0, this.folded = e.toLowerCase();
161
161
  }
@@ -164,8 +164,8 @@ var j = /*@__PURE__*/ l.define(), M = /*@__PURE__*/ l.define(), ce = class {
164
164
  let t = e.slice(0, this.pattern.length), n = t == this.pattern ? 0 : t.toLowerCase() == this.folded ? -200 : null;
165
165
  return n == null ? null : (this.matched = [0, t.length], this.score = n + (e.length == this.pattern.length ? 0 : -100), this);
166
166
  }
167
- }, N = /*@__PURE__*/ u.define({ combine(e) {
168
- return h(e, {
167
+ }, M = /*@__PURE__*/ f.define({ combine(e) {
168
+ return _(e, {
169
169
  activateOnTyping: !0,
170
170
  activateOnCompletion: () => !1,
171
171
  activateOnTypingDelay: 100,
@@ -188,17 +188,17 @@ var j = /*@__PURE__*/ l.define(), M = /*@__PURE__*/ l.define(), ce = class {
188
188
  defaultKeymap: (e, t) => e && t,
189
189
  closeOnBlur: (e, t) => e && t,
190
190
  icons: (e, t) => e && t,
191
- tooltipClass: (e, t) => (n) => ue(e(n), t(n)),
192
- optionClass: (e, t) => (n) => ue(e(n), t(n)),
191
+ tooltipClass: (e, t) => (n) => N(e(n), t(n)),
192
+ optionClass: (e, t) => (n) => N(e(n), t(n)),
193
193
  addToOptions: (e, t) => e.concat(t),
194
194
  filterStrict: (e, t) => e || t
195
195
  });
196
196
  } });
197
- function ue(e, t) {
197
+ function N(e, t) {
198
198
  return e ? t ? e + " " + t : e : t;
199
199
  }
200
200
  function de(e, t, n, r, i, a) {
201
- let o = e.textDirection == x.RTL, s = o, c = !1, l = "top", u, d, f = t.left - i.left, p = i.right - t.right, m = r.right - r.left, h = r.bottom - r.top;
201
+ let o = e.textDirection == ee.RTL, s = o, c = !1, l = "top", u, d, f = t.left - i.left, p = i.right - t.right, m = r.right - r.left, h = r.bottom - r.top;
202
202
  if (s && f < Math.min(m, p) ? s = !1 : !s && p < Math.min(m, f) && (s = !0), m <= (s ? f : p)) u = Math.max(i.top, Math.min(n.top, i.bottom - h)) - t.top, d = Math.min(400, s ? f : p);
203
203
  else {
204
204
  c = !0, d = Math.min(400, (o ? t.right : i.right - t.left) - 30);
@@ -211,7 +211,7 @@ function de(e, t, n, r, i, a) {
211
211
  class: "cm-completionInfo-" + (c ? o ? "left-narrow" : "right-narrow" : s ? "left" : "right")
212
212
  };
213
213
  }
214
- var P = /*@__PURE__*/ l.define();
214
+ var P = /*@__PURE__*/ d.define();
215
215
  function fe(e) {
216
216
  let t = e.addToOptions.slice();
217
217
  return e.icons && t.push({
@@ -268,7 +268,7 @@ var pe = class {
268
268
  write: (e) => this.placeInfo(e),
269
269
  key: this
270
270
  }, this.space = null, this.currentClass = "";
271
- let r = e.state.field(t), { options: i, selected: a } = r.open, o = e.state.facet(N);
271
+ let r = e.state.field(t), { options: i, selected: a } = r.open, o = e.state.facet(M);
272
272
  this.optionContent = fe(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = F(i.length, a, o.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.updateTooltipClass(e.state), this.dom.addEventListener("mousedown", (n) => {
273
273
  let { options: r } = e.state.field(t).open;
274
274
  for (let t = n.target, i; t && t != this.dom; t = t.parentNode) if (t.nodeName == "LI" && (i = /-(\d+)$/.exec(t.id)) && +i[1] < r.length) {
@@ -281,7 +281,7 @@ var pe = class {
281
281
  }
282
282
  }), this.dom.addEventListener("focusout", (t) => {
283
283
  let n = e.state.field(this.stateField, !1);
284
- n && n.tooltip && e.state.facet(N).closeOnBlur && t.relatedTarget != e.contentDOM && e.dispatch({ effects: M.of(null) });
284
+ n && n.tooltip && e.state.facet(M).closeOnBlur && t.relatedTarget != e.contentDOM && e.dispatch({ effects: j.of(null) });
285
285
  }), this.showOptions(i, r.id);
286
286
  }
287
287
  mount() {
@@ -296,7 +296,7 @@ var pe = class {
296
296
  let t = e.state.field(this.stateField), n = e.startState.field(this.stateField);
297
297
  if (this.updateTooltipClass(e.state), t != n) {
298
298
  let { options: r, selected: i, disabled: a } = t.open;
299
- (!n.open || n.open.options != r) && (this.range = F(r.length, i, e.state.facet(N).maxRenderedOptions), this.showOptions(r, t.id)), this.updateSel(), a != n.open?.disabled && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!a);
299
+ (!n.open || n.open.options != r) && (this.range = F(r.length, i, e.state.facet(M).maxRenderedOptions), this.showOptions(r, t.id)), this.updateSel(), a != n.open?.disabled && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!a);
300
300
  }
301
301
  }
302
302
  updateTooltipClass(e) {
@@ -312,7 +312,7 @@ var pe = class {
312
312
  }
313
313
  updateSel() {
314
314
  let e = this.view.state.field(this.stateField), t = e.open;
315
- (t.selected > -1 && t.selected < this.range.from || t.selected >= this.range.to) && (this.range = F(t.options.length, t.selected, this.view.state.facet(N).maxRenderedOptions), this.showOptions(t.options, e.id));
315
+ (t.selected > -1 && t.selected < this.range.from || t.selected >= this.range.to) && (this.range = F(t.options.length, t.selected, this.view.state.facet(M).maxRenderedOptions), this.showOptions(t.options, e.id));
316
316
  let n = this.updateSelectedOption(t.selected);
317
317
  if (n) {
318
318
  this.destroyInfo();
@@ -322,7 +322,7 @@ var pe = class {
322
322
  if (!a) return;
323
323
  "then" in a ? a.then((t) => {
324
324
  t && this.view.state.field(this.stateField, !1) == e && this.addInfoPane(t, r);
325
- }).catch((e) => _(this.view.state, e, "completion info")) : (this.addInfoPane(a, r), n.setAttribute("aria-describedby", this.info.id));
325
+ }).catch((e) => y(this.view.state, e, "completion info")) : (this.addInfoPane(a, r), n.setAttribute("aria-describedby", this.info.id));
326
326
  }
327
327
  }
328
328
  addInfoPane(e, t) {
@@ -353,7 +353,7 @@ var pe = class {
353
353
  bottom: e.clientHeight
354
354
  };
355
355
  }
356
- return r.top > Math.min(i.bottom, t.bottom) - 10 || r.bottom < Math.max(i.top, t.top) + 10 ? null : this.view.state.facet(N).positionInfo(this.view, t, r, n, i, this.dom);
356
+ return r.top > Math.min(i.bottom, t.bottom) - 10 || r.bottom < Math.max(i.top, t.top) + 10 ? null : this.view.state.facet(M).positionInfo(this.view, t, r, n, i, this.dom);
357
357
  }
358
358
  placeInfo(e) {
359
359
  this.info && (e ? (e.style && (this.info.style.cssText = e.style), this.info.className = "cm-tooltip cm-completionInfo " + (e.class || "")) : this.info.style.cssText = "top: -1e6px");
@@ -413,15 +413,15 @@ function ge(e, t) {
413
413
  let e = typeof t == "string" ? t : t.name;
414
414
  r.some((t) => t.name == e) || r.push(typeof t == "string" ? { name: e } : t);
415
415
  }
416
- }, o = t.facet(N);
416
+ }, o = t.facet(M);
417
417
  for (let r of e) if (r.hasResult()) {
418
418
  let e = r.result.getMatch;
419
- if (r.result.filter === !1) for (let t of r.result.options) a(new D(t, r.source, e ? e(t) : [], 1e9 - n.length));
419
+ if (r.result.filter === !1) for (let t of r.result.options) a(new ae(t, r.source, e ? e(t) : [], 1e9 - n.length));
420
420
  else {
421
- let n = t.sliceDoc(r.from, r.to), s, c = o.filterStrict ? new le(n) : new ce(n);
421
+ let n = t.sliceDoc(r.from, r.to), s, c = o.filterStrict ? new ue(n) : new le(n);
422
422
  for (let t of r.result.options) if (s = c.match(t.label)) {
423
423
  let n = t.displayLabel ? e ? e(t, s.matched) : [] : s.matched, o = s.score + (t.boost || 0);
424
- if (a(new D(t, r.source, n, o)), typeof t.section == "object" && t.section.rank === "dynamic") {
424
+ if (a(new ae(t, r.source, n, o)), typeof t.section == "object" && t.section.rank === "dynamic") {
425
425
  let { name: e } = t.section;
426
426
  i ||= Object.create(null), i[e] = Math.max(o, i[e] || -1e9);
427
427
  }
@@ -454,7 +454,7 @@ var _e = class e {
454
454
  if (i && !o && t.some((e) => e.isPending)) return i.setDisabled();
455
455
  let s = ge(t, n);
456
456
  if (!s.length) return i && t.some((e) => e.isPending) ? i.setDisabled() : null;
457
- let c = n.facet(N).selectOnOpen ? 0 : -1;
457
+ let c = n.facet(M).selectOnOpen ? 0 : -1;
458
458
  if (i && i.selected != c && i.selected != -1) {
459
459
  let e = i.options[i.selected].completion;
460
460
  for (let t = 0; t < s.length; t++) if (s[t].completion == e) {
@@ -464,7 +464,7 @@ var _e = class e {
464
464
  }
465
465
  return new e(s, L(r, c), {
466
466
  pos: t.reduce((e, t) => t.hasResult() ? Math.min(e, t.from) : e, 1e8),
467
- create: we,
467
+ create: Ee,
468
468
  above: a.aboveCursor
469
469
  }, i ? i.timestamp : Date.now(), c, !1);
470
470
  }
@@ -485,10 +485,10 @@ var _e = class e {
485
485
  return new e(Se, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
486
486
  }
487
487
  update(t) {
488
- let { state: n } = t, r = n.facet(N), i = (r.override || n.languageDataAt("autocomplete", O(n)).map(se)).map((e) => (this.active.find((t) => t.source == e) || new z(e, +!!this.active.some((e) => e.state != 0))).update(t, r));
488
+ let { state: n } = t, r = n.facet(M), i = (r.override || n.languageDataAt("autocomplete", D(n)).map(ce)).map((e) => (this.active.find((t) => t.source == e) || new R(e, +!!this.active.some((e) => e.state != 0))).update(t, r));
489
489
  i.length == this.active.length && i.every((e, t) => e == this.active[t]) && (i = this.active);
490
- let a = this.open, o = t.effects.some((e) => e.is(V));
491
- a && t.docChanged && (a = a.map(t.changes)), t.selection || i.some((e) => e.hasResult() && t.changes.touchesRange(e.from, e.to)) || !ye(i, this.active) || o ? a = _e.build(i, n, this.id, a, r, o) : a && a.disabled && !i.some((e) => e.isPending) && (a = null), !a && i.every((e) => !e.isPending) && i.some((e) => e.hasResult()) && (i = i.map((e) => e.hasResult() ? new z(e.source, 0) : e));
490
+ let a = this.open, o = t.effects.some((e) => e.is(z));
491
+ a && t.docChanged && (a = a.map(t.changes)), t.selection || i.some((e) => e.hasResult() && t.changes.touchesRange(e.from, e.to)) || !ye(i, this.active) || o ? a = _e.build(i, n, this.id, a, r, o) : a && a.disabled && !i.some((e) => e.isPending) && (a = null), !a && i.every((e) => !e.isPending) && i.some((e) => e.hasResult()) && (i = i.map((e) => e.hasResult() ? new R(e.source, 0) : e));
492
492
  for (let e of t.effects) e.is(P) && (a &&= a.setSelected(e.value, this.id));
493
493
  return i == this.active && a == this.open ? this : new e(i, this.id, a);
494
494
  }
@@ -519,15 +519,15 @@ function L(e, t) {
519
519
  return t > -1 && (n["aria-activedescendant"] = e + "-" + t), n;
520
520
  }
521
521
  var Se = [];
522
- function R(e, t) {
522
+ function Ce(e, t) {
523
523
  if (e.isUserEvent("input.complete")) {
524
- let n = e.annotation(A);
524
+ let n = e.annotation(k);
525
525
  if (n && t.activateOnCompletion(n)) return 12;
526
526
  }
527
527
  let n = e.isUserEvent("input.type");
528
528
  return n && t.activateOnTyping ? 5 : n ? 1 : e.isUserEvent("delete.backward") ? 2 : e.selection ? 8 : e.docChanged ? 16 : 0;
529
529
  }
530
- var z = class e {
530
+ var R = class e {
531
531
  constructor(e, t, n = !1) {
532
532
  this.source = e, this.state = t, this.explicit = n;
533
533
  }
@@ -538,11 +538,11 @@ var z = class e {
538
538
  return this.state == 1;
539
539
  }
540
540
  update(t, n) {
541
- let r = R(t, n), i = this;
541
+ let r = Ce(t, n), i = this;
542
542
  (r & 8 || r & 16 && this.touches(t)) && (i = new e(i.source, 0)), r & 4 && i.state == 0 && (i = new e(this.source, 1)), i = i.updateFor(t, r);
543
- for (let n of t.effects) if (n.is(j)) i = new e(i.source, 1, n.value);
544
- else if (n.is(M)) i = new e(i.source, 0);
545
- else if (n.is(V)) for (let e of n.value) e.source == i.source && (i = e);
543
+ for (let n of t.effects) if (n.is(A)) i = new e(i.source, 1, n.value);
544
+ else if (n.is(j)) i = new e(i.source, 0);
545
+ else if (n.is(z)) for (let e of n.value) e.source == i.source && (i = e);
546
546
  return i;
547
547
  }
548
548
  updateFor(e, t) {
@@ -552,9 +552,9 @@ var z = class e {
552
552
  return this;
553
553
  }
554
554
  touches(e) {
555
- return e.changes.touchesRange(O(e.state));
555
+ return e.changes.touchesRange(D(e.state));
556
556
  }
557
- }, B = class e extends z {
557
+ }, we = class e extends R {
558
558
  constructor(e, t, n, r, i, a) {
559
559
  super(e, 3, t), this.limit = n, this.result = r, this.from = i, this.to = a;
560
560
  }
@@ -565,116 +565,116 @@ var z = class e {
565
565
  if (!(n & 3)) return this.map(t.changes);
566
566
  let r = this.result;
567
567
  r.map && !t.changes.empty && (r = r.map(r, t.changes));
568
- let i = t.changes.mapPos(this.from), a = t.changes.mapPos(this.to, 1), o = O(t.state);
569
- if (o > a || !r || n & 2 && (O(t.startState) == this.from || o < this.limit)) return new z(this.source, n & 4 ? 1 : 0);
568
+ let i = t.changes.mapPos(this.from), a = t.changes.mapPos(this.to, 1), o = D(t.state);
569
+ if (o > a || !r || n & 2 && (D(t.startState) == this.from || o < this.limit)) return new R(this.source, n & 4 ? 1 : 0);
570
570
  let s = t.changes.mapPos(this.limit);
571
- return Ce(r.validFor, t.state, i, a) ? new e(this.source, this.explicit, s, r, i, a) : r.update && (r = r.update(r, i, a, new E(t.state, o, !1))) ? new e(this.source, this.explicit, s, r, r.from, r.to ?? O(t.state)) : new z(this.source, 1, this.explicit);
571
+ return Te(r.validFor, t.state, i, a) ? new e(this.source, this.explicit, s, r, i, a) : r.update && (r = r.update(r, i, a, new T(t.state, o, !1))) ? new e(this.source, this.explicit, s, r, r.from, r.to ?? D(t.state)) : new R(this.source, 1, this.explicit);
572
572
  }
573
573
  map(t) {
574
574
  if (t.empty) return this;
575
575
  let n = this.result.map ? this.result.map(this.result, t) : this.result;
576
- return n ? new e(this.source, this.explicit, t.mapPos(this.limit), n, t.mapPos(this.from), t.mapPos(this.to, 1)) : new z(this.source, 0);
576
+ return n ? new e(this.source, this.explicit, t.mapPos(this.limit), n, t.mapPos(this.from), t.mapPos(this.to, 1)) : new R(this.source, 0);
577
577
  }
578
578
  touches(e) {
579
579
  return e.changes.touchesRange(this.from, this.to);
580
580
  }
581
581
  };
582
- function Ce(e, t, n, r) {
582
+ function Te(e, t, n, r) {
583
583
  if (!e) return !1;
584
584
  let i = t.sliceDoc(n, r);
585
- return typeof e == "function" ? e(i, n, r, t) : k(e, !0).test(i);
585
+ return typeof e == "function" ? e(i, n, r, t) : O(e, !0).test(i);
586
586
  }
587
- var V = /*@__PURE__*/ l.define({ map(e, t) {
587
+ var z = /*@__PURE__*/ d.define({ map(e, t) {
588
588
  return e.map((e) => e.map(t));
589
- } }), H = /*@__PURE__*/ c.define({
589
+ } }), B = /*@__PURE__*/ u.define({
590
590
  create() {
591
591
  return ve.start();
592
592
  },
593
593
  update(e, t) {
594
594
  return e.update(t);
595
595
  },
596
- provide: (e) => [g.from(e, (e) => e.tooltip), C.contentAttributes.from(e, (e) => e.attrs)]
596
+ provide: (e) => [v.from(e, (e) => e.tooltip), C.contentAttributes.from(e, (e) => e.attrs)]
597
597
  });
598
- function U(e, t) {
599
- let n = t.completion.apply || t.completion.label, r = e.state.field(H).active.find((e) => e.source == t.source);
600
- return r instanceof B && (typeof n == "string" ? e.dispatch({
601
- ...ae(e.state, n, r.from, r.to),
602
- annotations: A.of(t.completion)
598
+ function V(e, t) {
599
+ let n = t.completion.apply || t.completion.label, r = e.state.field(B).active.find((e) => e.source == t.source);
600
+ return r instanceof we && (typeof n == "string" ? e.dispatch({
601
+ ...oe(e.state, n, r.from, r.to),
602
+ annotations: k.of(t.completion)
603
603
  }) : n(e, t.completion, r.from, r.to), !0);
604
604
  }
605
- var we = /*@__PURE__*/ me(H, U);
606
- function W(e, t = "option") {
605
+ var Ee = /*@__PURE__*/ me(B, V);
606
+ function H(e, t = "option") {
607
607
  return (n) => {
608
- let r = n.state.field(H, !1);
609
- if (!r || !r.open || r.open.disabled || Date.now() - r.open.timestamp < n.state.facet(N).interactionDelay) return !1;
608
+ let r = n.state.field(B, !1);
609
+ if (!r || !r.open || r.open.disabled || Date.now() - r.open.timestamp < n.state.facet(M).interactionDelay) return !1;
610
610
  let i = 1, a;
611
- t == "page" && (a = b(n, r.open.tooltip)) && (i = Math.max(2, Math.floor(a.dom.offsetHeight / a.dom.querySelector("li").offsetHeight) - 1));
611
+ t == "page" && (a = S(n, r.open.tooltip)) && (i = Math.max(2, Math.floor(a.dom.offsetHeight / a.dom.querySelector("li").offsetHeight) - 1));
612
612
  let { length: o } = r.open.options, s = r.open.selected > -1 ? r.open.selected + i * (e ? 1 : -1) : e ? 0 : o - 1;
613
613
  return s < 0 ? s = t == "page" ? 0 : o - 1 : s >= o && (s = t == "page" ? o - 1 : 0), n.dispatch({ effects: P.of(s) }), !0;
614
614
  };
615
615
  }
616
- var Te = (e) => {
617
- let t = e.state.field(H, !1);
618
- return e.state.readOnly || !t || !t.open || t.open.selected < 0 || t.open.disabled || Date.now() - t.open.timestamp < e.state.facet(N).interactionDelay ? !1 : U(e, t.open.options[t.open.selected]);
619
- }, G = (e) => e.state.field(H, !1) ? (e.dispatch({ effects: j.of(!0) }), !0) : !1, Ee = (e) => {
620
- let t = e.state.field(H, !1);
621
- return !t || !t.active.some((e) => e.state != 0) ? !1 : (e.dispatch({ effects: M.of(null) }), !0);
622
- }, De = class {
616
+ var De = (e) => {
617
+ let t = e.state.field(B, !1);
618
+ return e.state.readOnly || !t || !t.open || t.open.selected < 0 || t.open.disabled || Date.now() - t.open.timestamp < e.state.facet(M).interactionDelay ? !1 : V(e, t.open.options[t.open.selected]);
619
+ }, U = (e) => e.state.field(B, !1) ? (e.dispatch({ effects: A.of(!0) }), !0) : !1, Oe = (e) => {
620
+ let t = e.state.field(B, !1);
621
+ return !t || !t.active.some((e) => e.state != 0) ? !1 : (e.dispatch({ effects: j.of(null) }), !0);
622
+ }, ke = class {
623
623
  constructor(e, t) {
624
624
  this.active = e, this.context = t, this.time = Date.now(), this.updates = [], this.done = void 0;
625
625
  }
626
- }, Oe = 50, ke = 1e3, Ae = /*@__PURE__*/ v.fromClass(class {
626
+ }, Ae = 50, je = 1e3, Me = /*@__PURE__*/ b.fromClass(class {
627
627
  constructor(e) {
628
628
  this.view = e, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.pendingStart = !1, this.composing = 0;
629
- for (let t of e.state.field(H).active) t.isPending && this.startQuery(t);
629
+ for (let t of e.state.field(B).active) t.isPending && this.startQuery(t);
630
630
  }
631
631
  update(e) {
632
- let t = e.state.field(H), n = e.state.facet(N);
633
- if (!e.selectionSet && !e.docChanged && e.startState.field(H) == t) return;
632
+ let t = e.state.field(B), n = e.state.facet(M);
633
+ if (!e.selectionSet && !e.docChanged && e.startState.field(B) == t) return;
634
634
  let r = e.transactions.some((e) => {
635
- let t = R(e, n);
635
+ let t = Ce(e, n);
636
636
  return t & 8 || (e.selection || e.docChanged) && !(t & 3);
637
637
  });
638
638
  for (let t = 0; t < this.running.length; t++) {
639
639
  let n = this.running[t];
640
- if (r || n.context.abortOnDocChange && e.docChanged || n.updates.length + e.transactions.length > Oe && Date.now() - n.time > ke) {
640
+ if (r || n.context.abortOnDocChange && e.docChanged || n.updates.length + e.transactions.length > Ae && Date.now() - n.time > je) {
641
641
  for (let e of n.context.abortListeners) try {
642
642
  e();
643
643
  } catch (e) {
644
- _(this.view.state, e);
644
+ y(this.view.state, e);
645
645
  }
646
646
  n.context.abortListeners = null, this.running.splice(t--, 1);
647
647
  } else n.updates.push(...e.transactions);
648
648
  }
649
- this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), e.transactions.some((e) => e.effects.some((e) => e.is(j))) && (this.pendingStart = !0);
649
+ this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), e.transactions.some((e) => e.effects.some((e) => e.is(A))) && (this.pendingStart = !0);
650
650
  let i = this.pendingStart ? 50 : n.activateOnTypingDelay;
651
651
  if (this.debounceUpdate = t.active.some((e) => e.isPending && !this.running.some((t) => t.active.source == e.source)) ? setTimeout(() => this.startUpdate(), i) : -1, this.composing != 0) for (let t of e.transactions) t.isUserEvent("input.type") ? this.composing = 2 : this.composing == 2 && t.selection && (this.composing = 3);
652
652
  }
653
653
  startUpdate() {
654
654
  this.debounceUpdate = -1, this.pendingStart = !1;
655
- let { state: e } = this.view, t = e.field(H);
655
+ let { state: e } = this.view, t = e.field(B);
656
656
  for (let e of t.active) e.isPending && !this.running.some((t) => t.active.source == e.source) && this.startQuery(e);
657
- this.running.length && t.open && t.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(N).updateSyncTime));
657
+ this.running.length && t.open && t.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(M).updateSyncTime));
658
658
  }
659
659
  startQuery(e) {
660
- let { state: t } = this.view, n = new E(t, O(t), e.explicit, this.view), r = new De(e, n);
660
+ let { state: t } = this.view, n = new T(t, D(t), e.explicit, this.view), r = new ke(e, n);
661
661
  this.running.push(r), Promise.resolve(e.source(n)).then((e) => {
662
662
  r.context.aborted || (r.done = e || null, this.scheduleAccept());
663
663
  }, (e) => {
664
- this.view.dispatch({ effects: M.of(null) }), _(this.view.state, e);
664
+ this.view.dispatch({ effects: j.of(null) }), y(this.view.state, e);
665
665
  });
666
666
  }
667
667
  scheduleAccept() {
668
- this.running.every((e) => e.done !== void 0) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(N).updateSyncTime));
668
+ this.running.every((e) => e.done !== void 0) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(M).updateSyncTime));
669
669
  }
670
670
  accept() {
671
671
  this.debounceAccept > -1 && clearTimeout(this.debounceAccept), this.debounceAccept = -1;
672
- let e = [], t = this.view.state.facet(N), n = this.view.state.field(H);
672
+ let e = [], t = this.view.state.facet(M), n = this.view.state.field(B);
673
673
  for (let r = 0; r < this.running.length; r++) {
674
674
  let i = this.running[r];
675
675
  if (i.done === void 0) continue;
676
676
  if (this.running.splice(r--, 1), i.done) {
677
- let n = O(i.updates.length ? i.updates[0].startState : this.view.state), r = Math.min(n, i.done.from + +!i.active.explicit), a = new B(i.active.source, i.active.explicit, r, i.done, i.done.from, i.done.to ?? n);
677
+ let n = D(i.updates.length ? i.updates[0].startState : this.view.state), r = Math.min(n, i.done.from + +!i.active.explicit), a = new we(i.active.source, i.active.explicit, r, i.done, i.done.from, i.done.to ?? n);
678
678
  for (let e of i.updates) a = a.update(e, t);
679
679
  if (a.hasResult()) {
680
680
  e.push(a);
@@ -684,34 +684,34 @@ var Te = (e) => {
684
684
  let a = n.active.find((e) => e.source == i.active.source);
685
685
  if (a && a.isPending) {
686
686
  if (i.done == null) {
687
- let n = new z(i.active.source, 0);
687
+ let n = new R(i.active.source, 0);
688
688
  for (let e of i.updates) n = n.update(e, t);
689
689
  n.isPending || e.push(n);
690
690
  } else this.startQuery(a);
691
691
  }
692
692
  }
693
- (e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: V.of(e) });
693
+ (e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: z.of(e) });
694
694
  }
695
695
  }, { eventHandlers: {
696
696
  blur(e) {
697
- let t = this.view.state.field(H, !1);
698
- if (t && t.tooltip && this.view.state.facet(N).closeOnBlur) {
699
- let n = t.open && b(this.view, t.open.tooltip);
700
- (!n || !n.dom.contains(e.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: M.of(null) }), 10);
697
+ let t = this.view.state.field(B, !1);
698
+ if (t && t.tooltip && this.view.state.facet(M).closeOnBlur) {
699
+ let n = t.open && S(this.view, t.open.tooltip);
700
+ (!n || !n.dom.contains(e.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: j.of(null) }), 10);
701
701
  }
702
702
  },
703
703
  compositionstart() {
704
704
  this.composing = 1;
705
705
  },
706
706
  compositionend() {
707
- this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: j.of(!1) }), 20), this.composing = 0;
707
+ this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: A.of(!1) }), 20), this.composing = 0;
708
708
  }
709
- } }), je = typeof navigator == "object" && /*@__PURE__*/ /Win/.test(navigator.platform), Me = /*@__PURE__*/ s.highest(/*@__PURE__*/ C.domEventHandlers({ keydown(e, t) {
710
- let n = t.state.field(H, !1);
711
- if (!n || !n.open || n.open.disabled || n.open.selected < 0 || e.key.length > 1 || e.ctrlKey && !(je && e.altKey) || e.metaKey) return !1;
709
+ } }), Ne = typeof navigator == "object" && /*@__PURE__*/ /Win/.test(navigator.platform), Pe = /*@__PURE__*/ l.highest(/*@__PURE__*/ C.domEventHandlers({ keydown(e, t) {
710
+ let n = t.state.field(B, !1);
711
+ if (!n || !n.open || n.open.disabled || n.open.selected < 0 || e.key.length > 1 || e.ctrlKey && !(Ne && e.altKey) || e.metaKey) return !1;
712
712
  let r = n.open.options[n.open.selected], i = n.active.find((e) => e.source == r.source), a = r.completion.commitCharacters || i.result.commitCharacters;
713
- return a && a.indexOf(e.key) > -1 && U(t, r), !1;
714
- } })), Ne = /*@__PURE__*/ C.baseTheme({
713
+ return a && a.indexOf(e.key) > -1 && V(t, r), !1;
714
+ } })), W = /*@__PURE__*/ C.baseTheme({
715
715
  ".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": {
716
716
  fontFamily: "monospace",
717
717
  whiteSpace: "nowrap",
@@ -808,68 +808,68 @@ var Te = (e) => {
808
808
  fontSize: "50%",
809
809
  verticalAlign: "middle"
810
810
  } }
811
- }), Pe = class {
811
+ }), Fe = class {
812
812
  constructor(e, t, n, r) {
813
813
  this.field = e, this.line = t, this.from = n, this.to = r;
814
814
  }
815
- }, Fe = class e {
815
+ }, Ie = class e {
816
816
  constructor(e, t, n) {
817
817
  this.field = e, this.from = t, this.to = n;
818
818
  }
819
819
  map(t) {
820
- let r = t.mapPos(this.from, -1, n.TrackDel), i = t.mapPos(this.to, 1, n.TrackDel);
821
- return r == null || i == null ? null : new e(this.field, r, i);
820
+ let n = t.mapPos(this.from, -1, i.TrackDel), r = t.mapPos(this.to, 1, i.TrackDel);
821
+ return n == null || r == null ? null : new e(this.field, n, r);
822
822
  }
823
- }, Ie = class e {
823
+ }, Le = class t {
824
824
  constructor(e, t) {
825
825
  this.lines = e, this.fieldPositions = t;
826
826
  }
827
- instantiate(e, t) {
828
- let n = [], r = [t], i = e.doc.lineAt(t), a = /^\s*/.exec(i.text)[0];
829
- for (let i of this.lines) {
830
- if (n.length) {
831
- let n = a, o = /^\t*/.exec(i)[0].length;
832
- for (let t = 0; t < o; t++) n += e.facet(ee);
833
- r.push(t + n.length - o), i = n + i.slice(o);
827
+ instantiate(t, n) {
828
+ let r = [], i = [n], a = t.doc.lineAt(n), o = /^\s*/.exec(a.text)[0];
829
+ for (let a of this.lines) {
830
+ if (r.length) {
831
+ let r = o, s = /^\t*/.exec(a)[0].length;
832
+ for (let n = 0; n < s; n++) r += t.facet(e);
833
+ i.push(n + r.length - s), a = r + a.slice(s);
834
834
  }
835
- n.push(i), t += i.length + 1;
835
+ r.push(a), n += a.length + 1;
836
836
  }
837
837
  return {
838
- text: n,
839
- ranges: this.fieldPositions.map((e) => new Fe(e.field, r[e.line] + e.from, r[e.line] + e.to))
838
+ text: r,
839
+ ranges: this.fieldPositions.map((e) => new Ie(e.field, i[e.line] + e.from, i[e.line] + e.to))
840
840
  };
841
841
  }
842
- static parse(t) {
842
+ static parse(e) {
843
843
  let n = [], r = [], i = [], a;
844
- for (let e of t.split(/\r\n?|\n/)) {
845
- for (; a = /[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(e);) {
846
- let t = a[1] ? +a[1] : null, o = a[2] || a[3] || "", s = -1;
847
- t === 0 && (t = 1e9);
844
+ for (let t of e.split(/\r\n?|\n/)) {
845
+ for (; a = /[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(t);) {
846
+ let e = a[1] ? +a[1] : null, o = a[2] || a[3] || "", s = -1;
847
+ e === 0 && (e = 1e9);
848
848
  let c = o.replace(/\\[{}]/g, (e) => e[1]);
849
- for (let e = 0; e < n.length; e++) (t == null ? c && n[e].name == c : n[e].seq == t) && (s = e);
849
+ for (let t = 0; t < n.length; t++) (e == null ? c && n[t].name == c : n[t].seq == e) && (s = t);
850
850
  if (s < 0) {
851
- let e = 0;
852
- for (; e < n.length && (t == null || n[e].seq != null && n[e].seq < t);) e++;
853
- n.splice(e, 0, {
854
- seq: t,
851
+ let t = 0;
852
+ for (; t < n.length && (e == null || n[t].seq != null && n[t].seq < e);) t++;
853
+ n.splice(t, 0, {
854
+ seq: e,
855
855
  name: c
856
- }), s = e;
856
+ }), s = t;
857
857
  for (let e of i) e.field >= s && e.field++;
858
858
  }
859
859
  for (let e of i) if (e.line == r.length && e.from > a.index) {
860
860
  let t = a[2] ? 3 + (a[1] || "").length : 2;
861
861
  e.from -= t, e.to -= t;
862
862
  }
863
- i.push(new Pe(s, r.length, a.index, a.index + c.length)), e = e.slice(0, a.index) + o + e.slice(a.index + a[0].length);
863
+ i.push(new Fe(s, r.length, a.index, a.index + c.length)), t = t.slice(0, a.index) + o + t.slice(a.index + a[0].length);
864
864
  }
865
- e = e.replace(/\\([{}])/g, (e, t, n) => {
865
+ t = t.replace(/\\([{}])/g, (e, t, n) => {
866
866
  for (let e of i) e.line == r.length && e.from > n && (e.from--, e.to--);
867
867
  return t;
868
- }), r.push(e);
868
+ }), r.push(t);
869
869
  }
870
- return new e(r, i);
870
+ return new t(r, i);
871
871
  }
872
- }, Le = /*@__PURE__*/ w.widget({ widget: /*@__PURE__*/ new class extends S {
872
+ }, Re = /*@__PURE__*/ w.widget({ widget: /*@__PURE__*/ new class extends te {
873
873
  toDOM() {
874
874
  let e = document.createElement("span");
875
875
  return e.className = "cm-snippetFieldPosition", e;
@@ -877,9 +877,9 @@ var Te = (e) => {
877
877
  ignoreEvent() {
878
878
  return !1;
879
879
  }
880
- }() }), Re = /*@__PURE__*/ w.mark({ class: "cm-snippetField" }), K = class e {
880
+ }() }), ze = /*@__PURE__*/ w.mark({ class: "cm-snippetField" }), G = class e {
881
881
  constructor(e, t) {
882
- this.ranges = e, this.active = t, this.deco = w.set(e.map((e) => (e.from == e.to ? Le : Re).range(e.from, e.to)), !0);
882
+ this.ranges = e, this.active = t, this.deco = w.set(e.map((e) => (e.from == e.to ? Re : ze).range(e.from, e.to)), !0);
883
883
  }
884
884
  map(t) {
885
885
  let n = [];
@@ -893,89 +893,89 @@ var Te = (e) => {
893
893
  selectionInsideField(e) {
894
894
  return e.ranges.every((e) => this.ranges.some((t) => t.field == this.active && t.from <= e.from && t.to >= e.to));
895
895
  }
896
- }, q = /*@__PURE__*/ l.define({ map(e, t) {
896
+ }, K = /*@__PURE__*/ d.define({ map(e, t) {
897
897
  return e && e.map(t);
898
- } }), ze = /*@__PURE__*/ l.define(), J = /*@__PURE__*/ c.define({
898
+ } }), Be = /*@__PURE__*/ d.define(), q = /*@__PURE__*/ u.define({
899
899
  create() {
900
900
  return null;
901
901
  },
902
902
  update(e, t) {
903
903
  for (let n of t.effects) {
904
- if (n.is(q)) return n.value;
905
- if (n.is(ze) && e) return new K(e.ranges, n.value);
904
+ if (n.is(K)) return n.value;
905
+ if (n.is(Be) && e) return new G(e.ranges, n.value);
906
906
  }
907
907
  return e && t.docChanged && (e = e.map(t.changes)), e && t.selection && !e.selectionInsideField(t.selection) && (e = null), e;
908
908
  },
909
909
  provide: (e) => C.decorations.from(e, (e) => e ? e.deco : w.none)
910
910
  });
911
- function Y(e, n) {
912
- return t.create(e.filter((e) => e.field == n).map((e) => t.range(e.from, e.to)));
911
+ function J(e, t) {
912
+ return r.create(e.filter((e) => e.field == t).map((e) => r.range(e.from, e.to)));
913
913
  }
914
- function Be(e) {
915
- let t = Ie.parse(e);
916
- return (e, n, r, o) => {
917
- let { text: s, ranges: c } = t.instantiate(e.state, r), { main: u } = e.state.selection, d = {
914
+ function Ve(e) {
915
+ let t = Le.parse(e);
916
+ return (e, n, r, i) => {
917
+ let { text: a, ranges: c } = t.instantiate(e.state, r), { main: l } = e.state.selection, u = {
918
918
  changes: {
919
919
  from: r,
920
- to: o == u.from ? u.to : o,
921
- insert: a.of(s)
920
+ to: i == l.from ? l.to : i,
921
+ insert: s.of(a)
922
922
  },
923
923
  scrollIntoView: !0,
924
- annotations: n ? [A.of(n), i.userEvent.of("input.complete")] : void 0
924
+ annotations: n ? [k.of(n), o.userEvent.of("input.complete")] : void 0
925
925
  };
926
- if (c.length && (d.selection = Y(c, 0)), c.some((e) => e.field > 0)) {
927
- let t = new K(c, 0), n = d.effects = [q.of(t)];
928
- e.state.field(J, !1) === void 0 && n.push(l.appendConfig.of([
929
- J,
930
- We,
931
- Ke,
932
- Ne
926
+ if (c.length && (u.selection = J(c, 0)), c.some((e) => e.field > 0)) {
927
+ let t = new G(c, 0), n = u.effects = [K.of(t)];
928
+ e.state.field(q, !1) === void 0 && n.push(d.appendConfig.of([
929
+ q,
930
+ Ge,
931
+ qe,
932
+ W
933
933
  ]));
934
934
  }
935
- e.dispatch(e.state.update(d));
935
+ e.dispatch(e.state.update(u));
936
936
  };
937
937
  }
938
- function Ve(e) {
938
+ function He(e) {
939
939
  return ({ state: t, dispatch: n }) => {
940
- let r = t.field(J, !1);
940
+ let r = t.field(q, !1);
941
941
  if (!r || e < 0 && r.active == 0) return !1;
942
942
  let i = r.active + e, a = e > 0 && !r.ranges.some((t) => t.field == i + e);
943
943
  return n(t.update({
944
- selection: Y(r.ranges, i),
945
- effects: q.of(a ? null : new K(r.ranges, i)),
944
+ selection: J(r.ranges, i),
945
+ effects: K.of(a ? null : new G(r.ranges, i)),
946
946
  scrollIntoView: !0
947
947
  })), !0;
948
948
  };
949
949
  }
950
- var He = [{
950
+ var Ue = [{
951
951
  key: "Tab",
952
- run: /* @__PURE__ */ Ve(1),
953
- shift: /* @__PURE__ */ Ve(-1)
952
+ run: /* @__PURE__ */ He(1),
953
+ shift: /* @__PURE__ */ He(-1)
954
954
  }, {
955
955
  key: "Escape",
956
- run: ({ state: e, dispatch: t }) => e.field(J, !1) ? (t(e.update({ effects: q.of(null) })), !0) : !1
957
- }], Ue = /*@__PURE__*/ u.define({ combine(e) {
958
- return e.length ? e[0] : He;
959
- } }), We = /*@__PURE__*/ s.highest(/*@__PURE__*/ y.compute([Ue], (e) => e.facet(Ue)));
960
- function Ge(e, t) {
956
+ run: ({ state: e, dispatch: t }) => e.field(q, !1) ? (t(e.update({ effects: K.of(null) })), !0) : !1
957
+ }], We = /*@__PURE__*/ f.define({ combine(e) {
958
+ return e.length ? e[0] : Ue;
959
+ } }), Ge = /*@__PURE__*/ l.highest(/*@__PURE__*/ x.compute([We], (e) => e.facet(We)));
960
+ function Ke(e, t) {
961
961
  return {
962
962
  ...t,
963
- apply: Be(e)
963
+ apply: Ve(e)
964
964
  };
965
965
  }
966
- var Ke = /*@__PURE__*/ C.domEventHandlers({ mousedown(e, t) {
967
- let n = t.state.field(J, !1), r;
966
+ var qe = /*@__PURE__*/ C.domEventHandlers({ mousedown(e, t) {
967
+ let n = t.state.field(q, !1), r;
968
968
  if (!n || (r = t.posAtCoords({
969
969
  x: e.clientX,
970
970
  y: e.clientY
971
971
  })) == null) return !1;
972
972
  let i = n.ranges.find((e) => e.from <= r && e.to >= r);
973
973
  return !i || i.field == n.active ? !1 : (t.dispatch({
974
- selection: Y(n.ranges, i.field),
975
- effects: q.of(n.ranges.some((e) => e.field > i.field) ? new K(n.ranges, i.field) : null),
974
+ selection: J(n.ranges, i.field),
975
+ effects: K.of(n.ranges.some((e) => e.field > i.field) ? new G(n.ranges, i.field) : null),
976
976
  scrollIntoView: !0
977
977
  }), !0);
978
- } }), X = {
978
+ } }), Y = {
979
979
  brackets: [
980
980
  "(",
981
981
  "[",
@@ -985,107 +985,107 @@ var Ke = /*@__PURE__*/ C.domEventHandlers({ mousedown(e, t) {
985
985
  ],
986
986
  before: ")]}:;>",
987
987
  stringPrefixes: []
988
- }, Z = /*@__PURE__*/ l.define({ map(e, t) {
989
- return t.mapPos(e, -1, n.TrackAfter) ?? void 0;
990
- } }), Q = /*@__PURE__*/ new class extends r {}();
991
- Q.startSide = 1, Q.endSide = -1;
992
- var qe = /*@__PURE__*/ c.define({
988
+ }, X = /*@__PURE__*/ d.define({ map(e, t) {
989
+ return t.mapPos(e, -1, i.TrackAfter) ?? void 0;
990
+ } }), Z = /*@__PURE__*/ new class extends a {}();
991
+ Z.startSide = 1, Z.endSide = -1;
992
+ var Q = /*@__PURE__*/ u.define({
993
993
  create() {
994
- return f.empty;
994
+ return m.empty;
995
995
  },
996
996
  update(e, t) {
997
997
  if (e = e.map(t.changes), t.selection) {
998
998
  let n = t.state.doc.lineAt(t.selection.main.head);
999
999
  e = e.update({ filter: (e) => e >= n.from && e <= n.to });
1000
1000
  }
1001
- for (let n of t.effects) n.is(Z) && (e = e.update({ add: [Q.range(n.value, n.value + 1)] }));
1001
+ for (let n of t.effects) n.is(X) && (e = e.update({ add: [Z.range(n.value, n.value + 1)] }));
1002
1002
  return e;
1003
1003
  }
1004
1004
  });
1005
1005
  function Je() {
1006
- return [$e, qe];
1006
+ return [$e, Q];
1007
1007
  }
1008
1008
  var Ye = "()[]{}<>«»»«[]{}";
1009
1009
  function Xe(e) {
1010
1010
  for (let t = 0; t < 16; t += 2) if (Ye.charCodeAt(t) == e) return Ye.charAt(t + 1);
1011
- return m(e < 128 ? e : e + 1);
1011
+ return g(e < 128 ? e : e + 1);
1012
1012
  }
1013
1013
  function Ze(e, t) {
1014
- return e.languageDataAt("closeBrackets", t)[0] || X;
1014
+ return e.languageDataAt("closeBrackets", t)[0] || Y;
1015
1015
  }
1016
- var Qe = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigator.userAgent), $e = /*@__PURE__*/ C.inputHandler.of((t, n, r, i) => {
1017
- if ((Qe ? t.composing : t.compositionStarted) || t.state.readOnly) return !1;
1018
- let a = t.state.selection.main;
1019
- if (i.length > 2 || i.length == 2 && p(e(i, 0)) == 1 || n != a.from || r != a.to) return !1;
1020
- let o = tt(t.state, i);
1021
- return o ? (t.dispatch(o), !0) : !1;
1016
+ var Qe = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigator.userAgent), $e = /*@__PURE__*/ C.inputHandler.of((e, t, r, i) => {
1017
+ if ((Qe ? e.composing : e.compositionStarted) || e.state.readOnly) return !1;
1018
+ let a = e.state.selection.main;
1019
+ if (i.length > 2 || i.length == 2 && h(n(i, 0)) == 1 || t != a.from || r != a.to) return !1;
1020
+ let o = tt(e.state, i);
1021
+ return o ? (e.dispatch(o), !0) : !1;
1022
1022
  }), et = [{
1023
1023
  key: "Backspace",
1024
- run: ({ state: n, dispatch: r }) => {
1025
- if (n.readOnly) return !1;
1026
- let i = Ze(n, n.selection.main.head).brackets || X.brackets, a = null, o = n.changeByRange((r) => {
1027
- if (r.empty) {
1028
- let a = rt(n.doc, r.head);
1029
- for (let o of i) if (o == a && $(n.doc, r.head) == Xe(e(o, 0))) return {
1024
+ run: ({ state: e, dispatch: t }) => {
1025
+ if (e.readOnly) return !1;
1026
+ let i = Ze(e, e.selection.main.head).brackets || Y.brackets, a = null, o = e.changeByRange((t) => {
1027
+ if (t.empty) {
1028
+ let a = rt(e.doc, t.head);
1029
+ for (let o of i) if (o == a && $(e.doc, t.head) == Xe(n(o, 0))) return {
1030
1030
  changes: {
1031
- from: r.head - o.length,
1032
- to: r.head + o.length
1031
+ from: t.head - o.length,
1032
+ to: t.head + o.length
1033
1033
  },
1034
- range: t.cursor(r.head - o.length)
1034
+ range: r.cursor(t.head - o.length)
1035
1035
  };
1036
1036
  }
1037
- return { range: a = r };
1037
+ return { range: a = t };
1038
1038
  });
1039
- return a || r(n.update(o, {
1039
+ return a || t(e.update(o, {
1040
1040
  scrollIntoView: !0,
1041
1041
  userEvent: "delete.backward"
1042
1042
  })), !a;
1043
1043
  }
1044
1044
  }];
1045
- function tt(t, n) {
1046
- let r = Ze(t, t.selection.main.head), i = r.brackets || X.brackets;
1045
+ function tt(e, t) {
1046
+ let r = Ze(e, e.selection.main.head), i = r.brackets || Y.brackets;
1047
1047
  for (let a of i) {
1048
- let o = Xe(e(a, 0));
1049
- if (n == a) return o == a ? ot(t, a, i.indexOf(a + a + a) > -1, r) : it(t, a, o, r.before || X.before);
1050
- if (n == o && nt(t, t.selection.main.from)) return at(t, a, o);
1048
+ let o = Xe(n(a, 0));
1049
+ if (t == a) return o == a ? ot(e, a, i.indexOf(a + a + a) > -1, r) : it(e, a, o, r.before || Y.before);
1050
+ if (t == o && nt(e, e.selection.main.from)) return at(e, a, o);
1051
1051
  }
1052
1052
  return null;
1053
1053
  }
1054
1054
  function nt(e, t) {
1055
1055
  let n = !1;
1056
- return e.field(qe).between(0, e.doc.length, (e) => {
1056
+ return e.field(Q).between(0, e.doc.length, (e) => {
1057
1057
  e == t && (n = !0);
1058
1058
  }), n;
1059
1059
  }
1060
- function $(t, n) {
1061
- let r = t.sliceString(n, n + 2);
1062
- return r.slice(0, p(e(r, 0)));
1060
+ function $(e, t) {
1061
+ let r = e.sliceString(t, t + 2);
1062
+ return r.slice(0, h(n(r, 0)));
1063
1063
  }
1064
- function rt(t, n) {
1065
- let r = t.sliceString(n - 2, n);
1066
- return p(e(r, 0)) == r.length ? r : r.slice(1);
1064
+ function rt(e, t) {
1065
+ let r = e.sliceString(t - 2, t);
1066
+ return h(n(r, 0)) == r.length ? r : r.slice(1);
1067
1067
  }
1068
- function it(e, n, r, i) {
1068
+ function it(e, t, n, i) {
1069
1069
  let a = null, o = e.changeByRange((o) => {
1070
1070
  if (!o.empty) return {
1071
1071
  changes: [{
1072
- insert: n,
1072
+ insert: t,
1073
1073
  from: o.from
1074
1074
  }, {
1075
- insert: r,
1075
+ insert: n,
1076
1076
  from: o.to
1077
1077
  }],
1078
- effects: Z.of(o.to + n.length),
1079
- range: t.range(o.anchor + n.length, o.head + n.length)
1078
+ effects: X.of(o.to + t.length),
1079
+ range: r.range(o.anchor + t.length, o.head + t.length)
1080
1080
  };
1081
1081
  let s = $(e.doc, o.head);
1082
1082
  return !s || /\s/.test(s) || i.indexOf(s) > -1 ? {
1083
1083
  changes: {
1084
- insert: n + r,
1084
+ insert: t + n,
1085
1085
  from: o.head
1086
1086
  },
1087
- effects: Z.of(o.head + n.length),
1088
- range: t.cursor(o.head + n.length)
1087
+ effects: X.of(o.head + t.length),
1088
+ range: r.cursor(o.head + t.length)
1089
1089
  } : { range: a = o };
1090
1090
  });
1091
1091
  return a ? null : e.update(o, {
@@ -1093,155 +1093,155 @@ function it(e, n, r, i) {
1093
1093
  userEvent: "input.type"
1094
1094
  });
1095
1095
  }
1096
- function at(e, n, r) {
1097
- let i = null, a = e.changeByRange((n) => n.empty && $(e.doc, n.head) == r ? {
1096
+ function at(e, t, n) {
1097
+ let i = null, a = e.changeByRange((t) => t.empty && $(e.doc, t.head) == n ? {
1098
1098
  changes: {
1099
- from: n.head,
1100
- to: n.head + r.length,
1101
- insert: r
1099
+ from: t.head,
1100
+ to: t.head + n.length,
1101
+ insert: n
1102
1102
  },
1103
- range: t.cursor(n.head + r.length)
1104
- } : i = { range: n });
1103
+ range: r.cursor(t.head + n.length)
1104
+ } : i = { range: t });
1105
1105
  return i ? null : e.update(a, {
1106
1106
  scrollIntoView: !0,
1107
1107
  userEvent: "input.type"
1108
1108
  });
1109
1109
  }
1110
- function ot(e, n, r, i) {
1111
- let a = i.stringPrefixes || X.stringPrefixes, s = null, c = e.changeByRange((i) => {
1110
+ function ot(e, t, n, i) {
1111
+ let a = i.stringPrefixes || Y.stringPrefixes, o = null, s = e.changeByRange((i) => {
1112
1112
  if (!i.empty) return {
1113
1113
  changes: [{
1114
- insert: n,
1114
+ insert: t,
1115
1115
  from: i.from
1116
1116
  }, {
1117
- insert: n,
1117
+ insert: t,
1118
1118
  from: i.to
1119
1119
  }],
1120
- effects: Z.of(i.to + n.length),
1121
- range: t.range(i.anchor + n.length, i.head + n.length)
1120
+ effects: X.of(i.to + t.length),
1121
+ range: r.range(i.anchor + t.length, i.head + t.length)
1122
1122
  };
1123
- let c = i.head, l = $(e.doc, c), u;
1124
- if (l == n) {
1125
- if (st(e, c)) return {
1123
+ let s = i.head, l = $(e.doc, s), u;
1124
+ if (l == t) {
1125
+ if (st(e, s)) return {
1126
1126
  changes: {
1127
- insert: n + n,
1128
- from: c
1127
+ insert: t + t,
1128
+ from: s
1129
1129
  },
1130
- effects: Z.of(c + n.length),
1131
- range: t.cursor(c + n.length)
1130
+ effects: X.of(s + t.length),
1131
+ range: r.cursor(s + t.length)
1132
1132
  };
1133
- if (nt(e, c)) {
1134
- let i = r && e.sliceDoc(c, c + n.length * 3) == n + n + n ? n + n + n : n;
1133
+ if (nt(e, s)) {
1134
+ let i = n && e.sliceDoc(s, s + t.length * 3) == t + t + t ? t + t + t : t;
1135
1135
  return {
1136
1136
  changes: {
1137
- from: c,
1138
- to: c + i.length,
1137
+ from: s,
1138
+ to: s + i.length,
1139
1139
  insert: i
1140
1140
  },
1141
- range: t.cursor(c + i.length)
1141
+ range: r.cursor(s + i.length)
1142
1142
  };
1143
1143
  }
1144
- } else if (r && e.sliceDoc(c - 2 * n.length, c) == n + n && (u = lt(e, c - 2 * n.length, a)) > -1 && st(e, u)) return {
1144
+ } else if (n && e.sliceDoc(s - 2 * t.length, s) == t + t && (u = lt(e, s - 2 * t.length, a)) > -1 && st(e, u)) return {
1145
1145
  changes: {
1146
- insert: n + n + n + n,
1147
- from: c
1146
+ insert: t + t + t + t,
1147
+ from: s
1148
1148
  },
1149
- effects: Z.of(c + n.length),
1150
- range: t.cursor(c + n.length)
1149
+ effects: X.of(s + t.length),
1150
+ range: r.cursor(s + t.length)
1151
1151
  };
1152
- else if (e.charCategorizer(c)(l) != o.Word && lt(e, c, a) > -1 && !ct(e, c, n, a)) return {
1152
+ else if (e.charCategorizer(s)(l) != c.Word && lt(e, s, a) > -1 && !ct(e, s, t, a)) return {
1153
1153
  changes: {
1154
- insert: n + n,
1155
- from: c
1154
+ insert: t + t,
1155
+ from: s
1156
1156
  },
1157
- effects: Z.of(c + n.length),
1158
- range: t.cursor(c + n.length)
1157
+ effects: X.of(s + t.length),
1158
+ range: r.cursor(s + t.length)
1159
1159
  };
1160
- return { range: s = i };
1160
+ return { range: o = i };
1161
1161
  });
1162
- return s ? null : e.update(c, {
1162
+ return o ? null : e.update(s, {
1163
1163
  scrollIntoView: !0,
1164
1164
  userEvent: "input.type"
1165
1165
  });
1166
1166
  }
1167
- function st(e, t) {
1168
- let n = T(e).resolveInner(t + 1);
1169
- return n.parent && n.from == t;
1167
+ function st(e, n) {
1168
+ let r = t(e).resolveInner(n + 1);
1169
+ return r.parent && r.from == n;
1170
1170
  }
1171
- function ct(e, t, n, r) {
1172
- let i = T(e).resolveInner(t, -1), a = r.reduce((e, t) => Math.max(e, t.length), 0);
1173
- for (let o = 0; o < 5; o++) {
1174
- let o = e.sliceDoc(i.from, Math.min(i.to, i.from + n.length + a)), s = o.indexOf(n);
1175
- if (!s || s > -1 && r.indexOf(o.slice(0, s)) > -1) {
1176
- let t = i.firstChild;
1177
- for (; t && t.from == i.from && t.to - t.from > n.length + s;) {
1178
- if (e.sliceDoc(t.to - n.length, t.to) == n) return !1;
1171
+ function ct(e, n, r, i) {
1172
+ let a = t(e).resolveInner(n, -1), o = i.reduce((e, t) => Math.max(e, t.length), 0);
1173
+ for (let t = 0; t < 5; t++) {
1174
+ let t = e.sliceDoc(a.from, Math.min(a.to, a.from + r.length + o)), s = t.indexOf(r);
1175
+ if (!s || s > -1 && i.indexOf(t.slice(0, s)) > -1) {
1176
+ let t = a.firstChild;
1177
+ for (; t && t.from == a.from && t.to - t.from > r.length + s;) {
1178
+ if (e.sliceDoc(t.to - r.length, t.to) == r) return !1;
1179
1179
  t = t.firstChild;
1180
1180
  }
1181
1181
  return !0;
1182
1182
  }
1183
- let c = i.to == t && i.parent;
1183
+ let c = a.to == n && a.parent;
1184
1184
  if (!c) break;
1185
- i = c;
1185
+ a = c;
1186
1186
  }
1187
1187
  return !1;
1188
1188
  }
1189
1189
  function lt(e, t, n) {
1190
1190
  let r = e.charCategorizer(t);
1191
- if (r(e.sliceDoc(t - 1, t)) != o.Word) return t;
1191
+ if (r(e.sliceDoc(t - 1, t)) != c.Word) return t;
1192
1192
  for (let i of n) {
1193
1193
  let n = t - i.length;
1194
- if (e.sliceDoc(n, t) == i && r(e.sliceDoc(n - 1, n)) != o.Word) return n;
1194
+ if (e.sliceDoc(n, t) == i && r(e.sliceDoc(n - 1, n)) != c.Word) return n;
1195
1195
  }
1196
1196
  return -1;
1197
1197
  }
1198
1198
  function ut(e = {}) {
1199
1199
  return [
1200
+ Pe,
1201
+ B,
1202
+ M.of(e),
1200
1203
  Me,
1201
- H,
1202
- N.of(e),
1203
- Ae,
1204
1204
  ft,
1205
- Ne
1205
+ W
1206
1206
  ];
1207
1207
  }
1208
1208
  var dt = [
1209
1209
  {
1210
1210
  key: "Ctrl-Space",
1211
- run: G
1211
+ run: U
1212
1212
  },
1213
1213
  {
1214
1214
  mac: "Alt-`",
1215
- run: G
1215
+ run: U
1216
1216
  },
1217
1217
  {
1218
1218
  mac: "Alt-i",
1219
- run: G
1219
+ run: U
1220
1220
  },
1221
1221
  {
1222
1222
  key: "Escape",
1223
- run: Ee
1223
+ run: Oe
1224
1224
  },
1225
1225
  {
1226
1226
  key: "ArrowDown",
1227
- run: /*@__PURE__*/ W(!0)
1227
+ run: /*@__PURE__*/ H(!0)
1228
1228
  },
1229
1229
  {
1230
1230
  key: "ArrowUp",
1231
- run: /*@__PURE__*/ W(!1)
1231
+ run: /*@__PURE__*/ H(!1)
1232
1232
  },
1233
1233
  {
1234
1234
  key: "PageDown",
1235
- run: /*@__PURE__*/ W(!0, "page")
1235
+ run: /*@__PURE__*/ H(!0, "page")
1236
1236
  },
1237
1237
  {
1238
1238
  key: "PageUp",
1239
- run: /*@__PURE__*/ W(!1, "page")
1239
+ run: /*@__PURE__*/ H(!1, "page")
1240
1240
  },
1241
1241
  {
1242
1242
  key: "Enter",
1243
- run: Te
1243
+ run: De
1244
1244
  }
1245
- ], ft = /*@__PURE__*/ s.highest(/*@__PURE__*/ y.computeN([N], (e) => e.facet(N).defaultKeymap ? [dt] : []));
1245
+ ], ft = /*@__PURE__*/ l.highest(/*@__PURE__*/ x.computeN([M], (e) => e.facet(M).defaultKeymap ? [dt] : []));
1246
1246
  //#endregion
1247
- export { re as a, ae as c, et as i, Be as l, ut as n, dt as o, Je as r, ie as s, E as t, Ge as u };
1247
+ export { re as a, oe as c, et as i, Ve as l, ut as n, dt as o, Je as r, ie as s, T as t, Ke as u };