@gsc-basic/components 1.0.1 → 1.0.3

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 (164) hide show
  1. package/README.md +59 -0
  2. package/dist/es/index.js +48 -30
  3. package/dist/es/node_modules/@codemirror/autocomplete/dist/index.js +15 -15
  4. package/dist/es/node_modules/@codemirror/commands/dist/index.js +31 -25
  5. package/dist/es/node_modules/@codemirror/lang-java/dist/index.js +3 -3
  6. package/dist/es/node_modules/@codemirror/lang-javascript/dist/index.js +8 -8
  7. package/dist/es/node_modules/@codemirror/lang-json/dist/index.js +1 -1
  8. package/dist/es/node_modules/@codemirror/lang-python/dist/index.js +1 -1
  9. package/dist/es/node_modules/@codemirror/lang-sql/dist/index.js +6 -6
  10. package/dist/es/node_modules/@codemirror/lang-xml/dist/index.js +3 -3
  11. package/dist/es/node_modules/@codemirror/lang-yaml/dist/index.js +1 -1
  12. package/dist/es/node_modules/@codemirror/language/dist/index.js +77 -77
  13. package/dist/es/node_modules/@codemirror/lint/dist/index.js +7 -7
  14. package/dist/es/node_modules/@codemirror/search/dist/index.js +432 -465
  15. package/dist/es/node_modules/@codemirror/state/dist/index.js +272 -268
  16. package/dist/es/node_modules/@codemirror/view/dist/index.js +1732 -1647
  17. package/dist/es/node_modules/@lezer/common/dist/index.js +191 -190
  18. package/dist/es/node_modules/@lezer/lr/dist/index.js +5 -3
  19. package/dist/es/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +178 -0
  20. package/dist/es/node_modules/@tanstack/form-core/dist/esm/EventClient.js +13 -0
  21. package/dist/es/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +406 -0
  22. package/dist/es/node_modules/@tanstack/form-core/dist/esm/FormApi.js +772 -0
  23. package/dist/es/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +55 -0
  24. package/dist/es/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +109 -0
  25. package/dist/es/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +45 -0
  26. package/dist/es/node_modules/@tanstack/form-core/dist/esm/utils.js +213 -0
  27. package/dist/es/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +29 -0
  28. package/dist/es/node_modules/@tanstack/store/dist/esm/derived.js +74 -0
  29. package/dist/es/node_modules/@tanstack/store/dist/esm/scheduler.js +79 -0
  30. package/dist/es/node_modules/@tanstack/store/dist/esm/store.js +21 -0
  31. package/dist/es/node_modules/@tanstack/store/dist/esm/types.js +6 -0
  32. package/dist/es/node_modules/@tanstack/table-core/build/lib/index.js +1885 -0
  33. package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useField.js +38 -0
  34. package/dist/es/node_modules/@tanstack/vue-form/dist/esm/useForm.js +33 -0
  35. package/dist/es/node_modules/@tanstack/vue-store/dist/esm/index.js +48 -0
  36. package/dist/es/node_modules/@tanstack/vue-table/build/lib/index.js +159 -0
  37. package/dist/es/node_modules/@vueuse/core/dist/index.js +1 -1
  38. package/dist/es/node_modules/codemirror/dist/index.js +3 -3
  39. package/dist/es/src/Button/index.js +6 -0
  40. package/dist/es/src/Button/src/Button.css +1 -0
  41. package/dist/es/src/Button/src/Button.vue.js +41 -0
  42. package/dist/es/src/Button/src/Button2.css +1 -0
  43. package/dist/es/src/CodeEditor/src/index.css +1 -1
  44. package/dist/es/src/CodeEditor/src/index.vue.js +54 -51
  45. package/dist/es/src/CodeEditor/src/index2.css +1 -1
  46. package/dist/es/src/ConfigProvider/index.js +1 -2
  47. package/dist/es/src/ConfigProvider/src/useGlobalConfig.js +9 -9
  48. package/dist/es/src/Form/index.js +6 -0
  49. package/dist/es/src/Form/src/Form.css +1 -0
  50. package/dist/es/src/Form/src/Form.vue.js +208 -0
  51. package/dist/es/src/Form/src/styles/form.css +1 -0
  52. package/dist/es/src/Grid/index.js +6 -0
  53. package/dist/es/src/Grid/src/Grid.css +1 -0
  54. package/dist/es/src/Grid/src/Grid.vue.js +180 -0
  55. package/dist/es/src/Grid/src/components/ActionBar.css +1 -0
  56. package/dist/es/src/Grid/src/components/ActionBar.vue.js +65 -0
  57. package/dist/es/src/Grid/src/components/CellEditor.css +1 -0
  58. package/dist/es/src/Grid/src/components/CellEditor.vue.js +132 -0
  59. package/dist/es/src/Grid/src/components/CellEditor2.css +1 -0
  60. package/dist/es/src/Grid/src/components/ColumnFilter.css +1 -0
  61. package/dist/es/src/Grid/src/components/ColumnFilter.vue.js +72 -0
  62. package/dist/es/src/Grid/src/components/ColumnSettings.css +1 -0
  63. package/dist/es/src/Grid/src/components/ColumnSettings.vue.js +109 -0
  64. package/dist/es/src/Grid/src/components/DataTable.css +1 -0
  65. package/dist/es/src/Grid/src/components/DataTable.vue.js +556 -0
  66. package/dist/es/src/Grid/src/components/Pager.css +1 -0
  67. package/dist/es/src/Grid/src/components/Pager.vue.js +64 -0
  68. package/dist/es/src/Grid/src/components/QueryBar.css +1 -0
  69. package/dist/es/src/Grid/src/components/QueryBar.vue.js +156 -0
  70. package/dist/es/src/Grid/src/composables/useCellEditor.js +20 -0
  71. package/dist/es/src/Grid/src/composables/useGridTable.js +213 -0
  72. package/dist/es/src/Grid/src/styles/table.css +1 -0
  73. package/dist/es/src/Overlay/index.js +61 -0
  74. package/dist/es/src/Overlay/src/Message.css +1 -0
  75. package/dist/es/src/Overlay/src/Message.vue.js +36 -0
  76. package/dist/es/src/Overlay/src/Message2.css +1 -0
  77. package/dist/es/src/Overlay/src/Modal.css +1 -0
  78. package/dist/es/src/Overlay/src/Modal.vue.js +67 -0
  79. package/dist/es/src/Overlay/src/Modal2.css +1 -0
  80. package/dist/es/src/Overlay/src/Notice.css +1 -0
  81. package/dist/es/src/Overlay/src/Notice.vue.js +37 -0
  82. package/dist/es/src/Overlay/src/Notice2.css +1 -0
  83. package/dist/es/src/ScaleScreen/src/index.vue.js +2 -2
  84. package/dist/es/src/VideoBackground/src/index.vue.js +8 -8
  85. package/dist/es/src/index.js +35 -19
  86. package/dist/es/src/locale/lang/en-US.js +40 -0
  87. package/dist/es/src/locale/lang/ja-JP.js +42 -2
  88. package/dist/es/src/locale/lang/zh-CN.js +42 -2
  89. package/dist/es/src/styles/tokens.css +1 -1
  90. package/dist/lib/index.js +1 -1
  91. package/dist/lib/node_modules/@codemirror/commands/dist/index.js +1 -1
  92. package/dist/lib/node_modules/@codemirror/language/dist/index.js +1 -1
  93. package/dist/lib/node_modules/@codemirror/search/dist/index.js +2 -2
  94. package/dist/lib/node_modules/@codemirror/state/dist/index.js +4 -4
  95. package/dist/lib/node_modules/@codemirror/view/dist/index.js +5 -5
  96. package/dist/lib/node_modules/@lezer/common/dist/index.js +1 -1
  97. package/dist/lib/node_modules/@lezer/lr/dist/index.js +1 -1
  98. package/dist/lib/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.js +1 -0
  99. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/EventClient.js +1 -0
  100. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FieldApi.js +1 -0
  101. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/FormApi.js +1 -0
  102. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/ValidationLogic.js +1 -0
  103. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/metaHelper.js +1 -0
  104. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/standardSchemaValidator.js +1 -0
  105. package/dist/lib/node_modules/@tanstack/form-core/dist/esm/utils.js +1 -0
  106. package/dist/lib/node_modules/@tanstack/pacer-lite/dist/lite-throttler.js +1 -0
  107. package/dist/lib/node_modules/@tanstack/store/dist/esm/derived.js +1 -0
  108. package/dist/lib/node_modules/@tanstack/store/dist/esm/scheduler.js +1 -0
  109. package/dist/lib/node_modules/@tanstack/store/dist/esm/store.js +1 -0
  110. package/dist/lib/node_modules/@tanstack/store/dist/esm/types.js +1 -0
  111. package/dist/lib/node_modules/@tanstack/table-core/build/lib/index.js +4 -0
  112. package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useField.js +1 -0
  113. package/dist/lib/node_modules/@tanstack/vue-form/dist/esm/useForm.js +1 -0
  114. package/dist/lib/node_modules/@tanstack/vue-store/dist/esm/index.js +1 -0
  115. package/dist/lib/node_modules/@tanstack/vue-table/build/lib/index.js +1 -0
  116. package/dist/lib/src/Button/index.js +1 -0
  117. package/dist/lib/src/Button/src/Button.css +1 -0
  118. package/dist/lib/src/Button/src/Button.vue.js +1 -0
  119. package/dist/lib/src/Button/src/Button2.css +1 -0
  120. package/dist/lib/src/CodeEditor/src/index.css +1 -1
  121. package/dist/lib/src/CodeEditor/src/index.vue.js +1 -1
  122. package/dist/lib/src/CodeEditor/src/index2.css +1 -1
  123. package/dist/lib/src/ConfigProvider/index.js +1 -1
  124. package/dist/lib/src/Form/index.js +1 -0
  125. package/dist/lib/src/Form/src/Form.css +1 -0
  126. package/dist/lib/src/Form/src/Form.vue.js +1 -0
  127. package/dist/lib/src/Form/src/styles/form.css +1 -0
  128. package/dist/lib/src/Grid/index.js +1 -0
  129. package/dist/lib/src/Grid/src/Grid.css +1 -0
  130. package/dist/lib/src/Grid/src/Grid.vue.js +1 -0
  131. package/dist/lib/src/Grid/src/components/ActionBar.css +1 -0
  132. package/dist/lib/src/Grid/src/components/ActionBar.vue.js +1 -0
  133. package/dist/lib/src/Grid/src/components/CellEditor.css +1 -0
  134. package/dist/lib/src/Grid/src/components/CellEditor.vue.js +1 -0
  135. package/dist/lib/src/Grid/src/components/CellEditor2.css +1 -0
  136. package/dist/lib/src/Grid/src/components/ColumnFilter.css +1 -0
  137. package/dist/lib/src/Grid/src/components/ColumnFilter.vue.js +1 -0
  138. package/dist/lib/src/Grid/src/components/ColumnSettings.css +1 -0
  139. package/dist/lib/src/Grid/src/components/ColumnSettings.vue.js +1 -0
  140. package/dist/lib/src/Grid/src/components/DataTable.css +1 -0
  141. package/dist/lib/src/Grid/src/components/DataTable.vue.js +1 -0
  142. package/dist/lib/src/Grid/src/components/Pager.css +1 -0
  143. package/dist/lib/src/Grid/src/components/Pager.vue.js +1 -0
  144. package/dist/lib/src/Grid/src/components/QueryBar.css +1 -0
  145. package/dist/lib/src/Grid/src/components/QueryBar.vue.js +1 -0
  146. package/dist/lib/src/Grid/src/composables/useCellEditor.js +1 -0
  147. package/dist/lib/src/Grid/src/composables/useGridTable.js +1 -0
  148. package/dist/lib/src/Grid/src/styles/table.css +1 -0
  149. package/dist/lib/src/Overlay/index.js +1 -0
  150. package/dist/lib/src/Overlay/src/Message.css +1 -0
  151. package/dist/lib/src/Overlay/src/Message.vue.js +1 -0
  152. package/dist/lib/src/Overlay/src/Message2.css +1 -0
  153. package/dist/lib/src/Overlay/src/Modal.css +1 -0
  154. package/dist/lib/src/Overlay/src/Modal.vue.js +1 -0
  155. package/dist/lib/src/Overlay/src/Modal2.css +1 -0
  156. package/dist/lib/src/Overlay/src/Notice.css +1 -0
  157. package/dist/lib/src/Overlay/src/Notice.vue.js +1 -0
  158. package/dist/lib/src/Overlay/src/Notice2.css +1 -0
  159. package/dist/lib/src/index.js +1 -1
  160. package/dist/lib/src/locale/lang/en-US.js +1 -1
  161. package/dist/lib/src/locale/lang/ja-JP.js +1 -1
  162. package/dist/lib/src/locale/lang/zh-CN.js +1 -1
  163. package/dist/lib/src/styles/tokens.css +1 -1
  164. package/package.json +11 -8
@@ -1,8 +1,8 @@
1
- import { EditorView as x, ViewPlugin as Z, getPanel as R, Decoration as d, showPanel as ee, runScopeHandlers as me } from "../../view/dist/index.js";
2
- import { StateField as te, StateEffect as A, Prec as pe, EditorSelection as g, Facet as ne, combineConfig as re, codePointAt as ge, codePointSize as xe, fromCodePoint as Se, CharCategory as p, EditorState as ye, RangeSetBuilder as Me, findClusterBreak as ie } from "../../state/dist/index.js";
3
- import h from "../../../crelt/index.js";
4
- const J = typeof String.prototype.normalize == "function" ? (t) => t.normalize("NFKD") : (t) => t;
5
- class v {
1
+ import { getPanel as J, showDialog as he, EditorView as S, ViewPlugin as U, Decoration as f, showPanel as ae, runScopeHandlers as ue } from "../../view/dist/index.js";
2
+ import { StateEffect as Q, EditorSelection as p, StateField as fe, Prec as de, codePointAt as me, codePointSize as ge, Facet as X, combineConfig as Y, CharCategory as g, EditorState as pe, RangeSetBuilder as xe, fromCodePoint as Se, findClusterBreak as Z } from "../../state/dist/index.js";
3
+ import m from "../../../crelt/index.js";
4
+ const K = typeof String.prototype.normalize == "function" ? (r) => r.normalize("NFKD") : (r) => r;
5
+ class C {
6
6
  /**
7
7
  Create a text cursor. The query is the search string, `from` to
8
8
  `to` provides the region to search.
@@ -16,8 +16,8 @@ class v {
16
16
  [`.normalize("NFKD")`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)
17
17
  (when supported).
18
18
  */
19
- constructor(e, n, r = 0, i = e.length, s, l) {
20
- this.test = l, this.value = { from: 0, to: 0 }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(r, i), this.bufferStart = r, this.normalize = s ? (o) => s(J(o)) : J, this.query = this.normalize(n);
19
+ constructor(e, t, n = 0, i = e.length, s, l) {
20
+ this.test = l, this.value = { from: 0, to: 0 }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, i), this.bufferStart = n, this.normalize = s ? (c) => s(K(c)) : K, this.query = this.normalize(t);
21
21
  }
22
22
  peek() {
23
23
  if (this.bufferPos == this.buffer.length) {
@@ -25,7 +25,7 @@ class v {
25
25
  return -1;
26
26
  this.bufferPos = 0, this.buffer = this.iter.value;
27
27
  }
28
- return ge(this.buffer, this.bufferPos);
28
+ return me(this.buffer, this.bufferPos);
29
29
  }
30
30
  /**
31
31
  Look for the next match. Updates the iterator's
@@ -48,46 +48,46 @@ class v {
48
48
  let e = this.peek();
49
49
  if (e < 0)
50
50
  return this.done = !0, this;
51
- let n = Se(e), r = this.bufferStart + this.bufferPos;
52
- this.bufferPos += xe(e);
53
- let i = this.normalize(n);
51
+ let t = Se(e), n = this.bufferStart + this.bufferPos;
52
+ this.bufferPos += ge(e);
53
+ let i = this.normalize(t);
54
54
  if (i.length)
55
- for (let s = 0, l = r; ; s++) {
56
- let o = i.charCodeAt(s), c = this.match(o, l, this.bufferPos + this.bufferStart);
55
+ for (let s = 0, l = n; ; s++) {
56
+ let c = i.charCodeAt(s), o = this.match(c, l, this.bufferPos + this.bufferStart);
57
57
  if (s == i.length - 1) {
58
- if (c)
59
- return this.value = c, this;
58
+ if (o)
59
+ return this.value = o, this;
60
60
  break;
61
61
  }
62
- l == r && s < n.length && n.charCodeAt(s) == o && l++;
62
+ l == n && s < t.length && t.charCodeAt(s) == c && l++;
63
63
  }
64
64
  }
65
65
  }
66
- match(e, n, r) {
66
+ match(e, t, n) {
67
67
  let i = null;
68
68
  for (let s = 0; s < this.matches.length; s += 2) {
69
- let l = this.matches[s], o = !1;
70
- this.query.charCodeAt(l) == e && (l == this.query.length - 1 ? i = { from: this.matches[s + 1], to: r } : (this.matches[s]++, o = !0)), o || (this.matches.splice(s, 2), s -= 2);
69
+ let l = this.matches[s], c = !1;
70
+ this.query.charCodeAt(l) == e && (l == this.query.length - 1 ? i = { from: this.matches[s + 1], to: n } : (this.matches[s]++, c = !0)), c || (this.matches.splice(s, 2), s -= 2);
71
71
  }
72
- return this.query.charCodeAt(0) == e && (this.query.length == 1 ? i = { from: n, to: r } : this.matches.push(1, n)), i && this.test && !this.test(i.from, i.to, this.buffer, this.bufferStart) && (i = null), i;
72
+ return this.query.charCodeAt(0) == e && (this.query.length == 1 ? i = { from: t, to: n } : this.matches.push(1, t)), i && this.test && !this.test(i.from, i.to, this.buffer, this.bufferStart) && (i = null), i;
73
73
  }
74
74
  }
75
- typeof Symbol < "u" && (v.prototype[Symbol.iterator] = function() {
75
+ typeof Symbol < "u" && (C.prototype[Symbol.iterator] = function() {
76
76
  return this;
77
77
  });
78
- const se = { from: -1, to: -1, match: /* @__PURE__ */ /.*/.exec("") }, N = "gm" + (/x/.unicode == null ? "" : "u");
79
- class le {
78
+ const ee = { from: -1, to: -1, match: /* @__PURE__ */ /.*/.exec("") }, _ = "gm" + (/x/.unicode == null ? "" : "u");
79
+ class te {
80
80
  /**
81
81
  Create a cursor that will search the given range in the given
82
82
  document. `query` should be the raw pattern (as you'd pass it to
83
83
  `new RegExp`).
84
84
  */
85
- constructor(e, n, r, i = 0, s = e.length) {
86
- if (this.text = e, this.to = s, this.curLine = "", this.done = !1, this.value = se, /\\[sWDnr]|\n|\r|\[\^/.test(n))
87
- return new oe(e, n, r, i, s);
88
- this.re = new RegExp(n, N + (r?.ignoreCase ? "i" : "")), this.test = r?.test, this.iter = e.iter();
85
+ constructor(e, t, n, i = 0, s = e.length) {
86
+ if (this.text = e, this.to = s, this.curLine = "", this.done = !1, this.value = ee, /\\[sWDnr]|\n|\r|\[\^/.test(t))
87
+ return new re(e, t, n, i, s);
88
+ this.re = new RegExp(t, _ + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
89
89
  let l = e.lineAt(i);
90
- this.curLineStart = l.from, this.matchPos = P(e, i), this.getLine(this.curLineStart);
90
+ this.curLineStart = l.from, this.matchPos = D(e, i), this.getLine(this.curLineStart);
91
91
  }
92
92
  getLine(e) {
93
93
  this.iter.next(e), this.iter.lineBreak ? this.curLine = "" : (this.curLine = this.iter.value, this.curLineStart + this.curLine.length > this.to && (this.curLine = this.curLine.slice(0, this.to - this.curLineStart)), this.iter.next());
@@ -101,11 +101,11 @@ class le {
101
101
  next() {
102
102
  for (let e = this.matchPos - this.curLineStart; ; ) {
103
103
  this.re.lastIndex = e;
104
- let n = this.matchPos <= this.to && this.re.exec(this.curLine);
105
- if (n) {
106
- let r = this.curLineStart + n.index, i = r + n[0].length;
107
- if (this.matchPos = P(this.text, i + (r == i ? 1 : 0)), r == this.curLineStart + this.curLine.length && this.nextLine(), (r < i || r > this.value.to) && (!this.test || this.test(r, i, n)))
108
- return this.value = { from: r, to: i, match: n }, this;
104
+ let t = this.matchPos <= this.to && this.re.exec(this.curLine);
105
+ if (t) {
106
+ let n = this.curLineStart + t.index, i = n + t[0].length;
107
+ if (this.matchPos = D(this.text, i + (n == i ? 1 : 0)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < i || n > this.value.to) && (!this.test || this.test(n, i, t)))
108
+ return this.value = { from: n, to: i, match: t }, this;
109
109
  e = this.matchPos - this.curLineStart;
110
110
  } else if (this.curLineStart + this.curLine.length < this.to)
111
111
  this.nextLine(), e = 0;
@@ -114,29 +114,29 @@ class le {
114
114
  }
115
115
  }
116
116
  }
117
- const Q = /* @__PURE__ */ new WeakMap();
118
- class b {
119
- constructor(e, n) {
120
- this.from = e, this.text = n;
117
+ const T = /* @__PURE__ */ new WeakMap();
118
+ class v {
119
+ constructor(e, t) {
120
+ this.from = e, this.text = t;
121
121
  }
122
122
  get to() {
123
123
  return this.from + this.text.length;
124
124
  }
125
- static get(e, n, r) {
126
- let i = Q.get(e);
127
- if (!i || i.from >= r || i.to <= n) {
128
- let o = new b(n, e.sliceString(n, r));
129
- return Q.set(e, o), o;
125
+ static get(e, t, n) {
126
+ let i = T.get(e);
127
+ if (!i || i.from >= n || i.to <= t) {
128
+ let c = new v(t, e.sliceString(t, n));
129
+ return T.set(e, c), c;
130
130
  }
131
- if (i.from == n && i.to == r)
131
+ if (i.from == t && i.to == n)
132
132
  return i;
133
133
  let { text: s, from: l } = i;
134
- return l > n && (s = e.sliceString(n, l) + s, l = n), i.to < r && (s += e.sliceString(i.to, r)), Q.set(e, new b(l, s)), new b(n, s.slice(n - l, r - l));
134
+ return l > t && (s = e.sliceString(t, l) + s, l = t), i.to < n && (s += e.sliceString(i.to, n)), T.set(e, new v(l, s)), new v(t, s.slice(t - l, n - l));
135
135
  }
136
136
  }
137
- class oe {
138
- constructor(e, n, r, i, s) {
139
- this.text = e, this.to = s, this.done = !1, this.value = se, this.matchPos = P(e, i), this.re = new RegExp(n, N + (r?.ignoreCase ? "i" : "")), this.test = r?.test, this.flat = b.get(e, i, this.chunkEnd(
137
+ class re {
138
+ constructor(e, t, n, i, s) {
139
+ this.text = e, this.to = s, this.done = !1, this.value = ee, this.matchPos = D(e, i), this.re = new RegExp(t, _ + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = v.get(e, i, this.chunkEnd(
140
140
  i + 5e3
141
141
  /* Chunk.Base */
142
142
  ));
@@ -146,642 +146,609 @@ class oe {
146
146
  }
147
147
  next() {
148
148
  for (; ; ) {
149
- let e = this.re.lastIndex = this.matchPos - this.flat.from, n = this.re.exec(this.flat.text);
150
- if (n && !n[0] && n.index == e && (this.re.lastIndex = e + 1, n = this.re.exec(this.flat.text)), n) {
151
- let r = this.flat.from + n.index, i = r + n[0].length;
152
- if ((this.flat.to >= this.to || n.index + n[0].length <= this.flat.text.length - 10) && (!this.test || this.test(r, i, n)))
153
- return this.value = { from: r, to: i, match: n }, this.matchPos = P(this.text, i + (r == i ? 1 : 0)), this;
149
+ let e = this.re.lastIndex = this.matchPos - this.flat.from, t = this.re.exec(this.flat.text);
150
+ if (t && !t[0] && t.index == e && (this.re.lastIndex = e + 1, t = this.re.exec(this.flat.text)), t) {
151
+ let n = this.flat.from + t.index, i = n + t[0].length;
152
+ if ((this.flat.to >= this.to || t.index + t[0].length <= this.flat.text.length - 10) && (!this.test || this.test(n, i, t)))
153
+ return this.value = { from: n, to: i, match: t }, this.matchPos = D(this.text, i + (n == i ? 1 : 0)), this;
154
154
  }
155
155
  if (this.flat.to == this.to)
156
156
  return this.done = !0, this;
157
- this.flat = b.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
157
+ this.flat = v.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
158
158
  }
159
159
  }
160
160
  }
161
- typeof Symbol < "u" && (le.prototype[Symbol.iterator] = oe.prototype[Symbol.iterator] = function() {
161
+ typeof Symbol < "u" && (te.prototype[Symbol.iterator] = re.prototype[Symbol.iterator] = function() {
162
162
  return this;
163
163
  });
164
- function be(t) {
164
+ function Me(r) {
165
165
  try {
166
- return new RegExp(t, N), !0;
166
+ return new RegExp(r, _), !0;
167
167
  } catch {
168
168
  return !1;
169
169
  }
170
170
  }
171
- function P(t, e) {
172
- if (e >= t.length)
171
+ function D(r, e) {
172
+ if (e >= r.length)
173
173
  return e;
174
- let n = t.lineAt(e), r;
175
- for (; e < n.to && (r = n.text.charCodeAt(e - n.from)) >= 56320 && r < 57344; )
174
+ let t = r.lineAt(e), n;
175
+ for (; e < t.to && (n = t.text.charCodeAt(e - t.from)) >= 56320 && n < 57344; )
176
176
  e++;
177
177
  return e;
178
178
  }
179
- function _(t) {
180
- let e = String(t.state.doc.lineAt(t.state.selection.main.head).number), n = h("input", { class: "cm-textfield", name: "line", value: e }), r = h("form", {
181
- class: "cm-gotoLine",
182
- onkeydown: (s) => {
183
- s.keyCode == 27 ? (s.preventDefault(), t.dispatch({ effects: L.of(!1) }), t.focus()) : s.keyCode == 13 && (s.preventDefault(), i());
184
- },
185
- onsubmit: (s) => {
186
- s.preventDefault(), i();
187
- }
188
- }, h("label", t.state.phrase("Go to line"), ": ", n), " ", h("button", { class: "cm-button", type: "submit" }, t.state.phrase("go")), h("button", {
189
- name: "close",
190
- onclick: () => {
191
- t.dispatch({ effects: L.of(!1) }), t.focus();
192
- },
193
- "aria-label": t.state.phrase("close"),
194
- type: "button"
195
- }, ["×"]));
196
- function i() {
197
- let s = /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.value);
198
- if (!s)
179
+ const ye = (r) => {
180
+ let { state: e } = r, t = String(e.doc.lineAt(r.state.selection.main.head).number), { close: n, result: i } = he(r, {
181
+ label: e.phrase("Go to line"),
182
+ input: { type: "text", name: "line", value: t },
183
+ focus: !0,
184
+ submitLabel: e.phrase("go")
185
+ });
186
+ return i.then((s) => {
187
+ let l = s && /^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);
188
+ if (!l) {
189
+ r.dispatch({ effects: n });
199
190
  return;
200
- let { state: l } = t, o = l.doc.lineAt(l.selection.main.head), [, c, a, u, m] = s, E = u ? +u.slice(1) : 0, k = a ? +a : o.number;
201
- if (a && m) {
202
- let O = k / 100;
203
- c && (O = O * (c == "-" ? -1 : 1) + o.number / l.doc.lines), k = Math.round(l.doc.lines * O);
204
- } else a && c && (k = k * (c == "-" ? -1 : 1) + o.number);
205
- let G = l.doc.line(Math.max(1, Math.min(l.doc.lines, k))), j = g.cursor(G.from + Math.max(0, Math.min(E, G.length)));
206
- t.dispatch({
207
- effects: [L.of(!1), x.scrollIntoView(j.from, { y: "center" })],
208
- selection: j
209
- }), t.focus();
210
- }
211
- return { dom: r };
212
- }
213
- const L = /* @__PURE__ */ A.define(), U = /* @__PURE__ */ te.define({
214
- create() {
215
- return !0;
216
- },
217
- update(t, e) {
218
- for (let n of e.effects)
219
- n.is(L) && (t = n.value);
220
- return t;
221
- },
222
- provide: (t) => ee.from(t, (e) => e ? _ : null)
223
- }), ve = (t) => {
224
- let e = R(t, _);
225
- if (!e) {
226
- let n = [L.of(!0)];
227
- t.state.field(U, !1) == null && n.push(A.appendConfig.of([U, Ce])), t.dispatch({ effects: n }), e = R(t, _);
228
- }
229
- return e && e.dom.querySelector("input").select(), !0;
230
- }, Ce = /* @__PURE__ */ x.baseTheme({
231
- ".cm-panel.cm-gotoLine": {
232
- padding: "2px 6px 4px",
233
- position: "relative",
234
- "& label": { fontSize: "80%" },
235
- "& [name=close]": {
236
- position: "absolute",
237
- top: "0",
238
- bottom: "0",
239
- right: "4px",
240
- backgroundColor: "inherit",
241
- border: "none",
242
- font: "inherit",
243
- padding: "0"
244
191
  }
245
- }
246
- }), ke = {
192
+ let c = e.doc.lineAt(e.selection.main.head), [, o, h, a, d] = l, A = a ? +a.slice(1) : 0, k = h ? +h : c.number;
193
+ if (h && d) {
194
+ let I = k / 100;
195
+ o && (I = I * (o == "-" ? -1 : 1) + c.number / e.doc.lines), k = Math.round(e.doc.lines * I);
196
+ } else h && o && (k = k * (o == "-" ? -1 : 1) + c.number);
197
+ let V = e.doc.line(Math.max(1, Math.min(e.doc.lines, k))), H = p.cursor(V.from + Math.max(0, Math.min(A, V.length)));
198
+ r.dispatch({
199
+ effects: [n, S.scrollIntoView(H.from, { y: "center" })],
200
+ selection: H
201
+ });
202
+ }), !0;
203
+ }, ve = {
247
204
  highlightWordAroundCursor: !1,
248
205
  minSelectionLength: 1,
249
206
  maxMatches: 100,
250
207
  wholeWords: !1
251
- }, Le = /* @__PURE__ */ ne.define({
252
- combine(t) {
253
- return re(t, ke, {
254
- highlightWordAroundCursor: (e, n) => e || n,
208
+ }, Ce = /* @__PURE__ */ X.define({
209
+ combine(r) {
210
+ return Y(r, ve, {
211
+ highlightWordAroundCursor: (e, t) => e || t,
255
212
  minSelectionLength: Math.min,
256
213
  maxMatches: Math.min
257
214
  });
258
215
  }
259
216
  });
260
- function Ue(t) {
261
- return [Fe, Ee];
217
+ function Je(r) {
218
+ return [Ae, We];
262
219
  }
263
- const We = /* @__PURE__ */ d.mark({ class: "cm-selectionMatch" }), Ae = /* @__PURE__ */ d.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
264
- function X(t, e, n, r) {
265
- return (n == 0 || t(e.sliceDoc(n - 1, n)) != p.Word) && (r == e.doc.length || t(e.sliceDoc(r, r + 1)) != p.Word);
220
+ const be = /* @__PURE__ */ f.mark({ class: "cm-selectionMatch" }), ke = /* @__PURE__ */ f.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
221
+ function G(r, e, t, n) {
222
+ return (t == 0 || r(e.sliceDoc(t - 1, t)) != g.Word) && (n == e.doc.length || r(e.sliceDoc(n, n + 1)) != g.Word);
266
223
  }
267
- function De(t, e, n, r) {
268
- return t(e.sliceDoc(n, n + 1)) == p.Word && t(e.sliceDoc(r - 1, r)) == p.Word;
224
+ function Le(r, e, t, n) {
225
+ return r(e.sliceDoc(t, t + 1)) == g.Word && r(e.sliceDoc(n - 1, n)) == g.Word;
269
226
  }
270
- const Ee = /* @__PURE__ */ Z.fromClass(class {
271
- constructor(t) {
272
- this.decorations = this.getDeco(t);
273
- }
274
- update(t) {
275
- (t.selectionSet || t.docChanged || t.viewportChanged) && (this.decorations = this.getDeco(t.view));
276
- }
277
- getDeco(t) {
278
- let e = t.state.facet(Le), { state: n } = t, r = n.selection;
279
- if (r.ranges.length > 1)
280
- return d.none;
281
- let i = r.main, s, l = null;
227
+ const We = /* @__PURE__ */ U.fromClass(class {
228
+ constructor(r) {
229
+ this.decorations = this.getDeco(r);
230
+ }
231
+ update(r) {
232
+ (r.selectionSet || r.docChanged || r.viewportChanged) && (this.decorations = this.getDeco(r.view));
233
+ }
234
+ getDeco(r) {
235
+ let e = r.state.facet(Ce), { state: t } = r, n = t.selection;
236
+ if (n.ranges.length > 1)
237
+ return f.none;
238
+ let i = n.main, s, l = null;
282
239
  if (i.empty) {
283
240
  if (!e.highlightWordAroundCursor)
284
- return d.none;
285
- let c = n.wordAt(i.head);
286
- if (!c)
287
- return d.none;
288
- l = n.charCategorizer(i.head), s = n.sliceDoc(c.from, c.to);
241
+ return f.none;
242
+ let o = t.wordAt(i.head);
243
+ if (!o)
244
+ return f.none;
245
+ l = t.charCategorizer(i.head), s = t.sliceDoc(o.from, o.to);
289
246
  } else {
290
- let c = i.to - i.from;
291
- if (c < e.minSelectionLength || c > 200)
292
- return d.none;
247
+ let o = i.to - i.from;
248
+ if (o < e.minSelectionLength || o > 200)
249
+ return f.none;
293
250
  if (e.wholeWords) {
294
- if (s = n.sliceDoc(i.from, i.to), l = n.charCategorizer(i.head), !(X(l, n, i.from, i.to) && De(l, n, i.from, i.to)))
295
- return d.none;
296
- } else if (s = n.sliceDoc(i.from, i.to), !s)
297
- return d.none;
251
+ if (s = t.sliceDoc(i.from, i.to), l = t.charCategorizer(i.head), !(G(l, t, i.from, i.to) && Le(l, t, i.from, i.to)))
252
+ return f.none;
253
+ } else if (s = t.sliceDoc(i.from, i.to), !s)
254
+ return f.none;
298
255
  }
299
- let o = [];
300
- for (let c of t.visibleRanges) {
301
- let a = new v(n.doc, s, c.from, c.to);
302
- for (; !a.next().done; ) {
303
- let { from: u, to: m } = a.value;
304
- if ((!l || X(l, n, u, m)) && (i.empty && u <= i.from && m >= i.to ? o.push(Ae.range(u, m)) : (u >= i.to || m <= i.from) && o.push(We.range(u, m)), o.length > e.maxMatches))
305
- return d.none;
256
+ let c = [];
257
+ for (let o of r.visibleRanges) {
258
+ let h = new C(t.doc, s, o.from, o.to);
259
+ for (; !h.next().done; ) {
260
+ let { from: a, to: d } = h.value;
261
+ if ((!l || G(l, t, a, d)) && (i.empty && a <= i.from && d >= i.to ? c.push(ke.range(a, d)) : (a >= i.to || d <= i.from) && c.push(be.range(a, d)), c.length > e.maxMatches))
262
+ return f.none;
306
263
  }
307
264
  }
308
- return d.set(o);
265
+ return f.set(c);
309
266
  }
310
267
  }, {
311
- decorations: (t) => t.decorations
312
- }), Fe = /* @__PURE__ */ x.baseTheme({
268
+ decorations: (r) => r.decorations
269
+ }), Ae = /* @__PURE__ */ S.baseTheme({
313
270
  ".cm-selectionMatch": { backgroundColor: "#99ff7780" },
314
271
  ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
315
- }), qe = ({ state: t, dispatch: e }) => {
316
- let { selection: n } = t, r = g.create(n.ranges.map((i) => t.wordAt(i.head) || g.cursor(i.head)), n.mainIndex);
317
- return r.eq(n) ? !1 : (e(t.update({ selection: r })), !0);
272
+ }), Ee = ({ state: r, dispatch: e }) => {
273
+ let { selection: t } = r, n = p.create(t.ranges.map((i) => r.wordAt(i.head) || p.cursor(i.head)), t.mainIndex);
274
+ return n.eq(t) ? !1 : (e(r.update({ selection: n })), !0);
318
275
  };
319
- function Re(t, e) {
320
- let { main: n, ranges: r } = t.selection, i = t.wordAt(n.head), s = i && i.from == n.from && i.to == n.to;
321
- for (let l = !1, o = new v(t.doc, e, r[r.length - 1].to); ; )
322
- if (o.next(), o.done) {
276
+ function Fe(r, e) {
277
+ let { main: t, ranges: n } = r.selection, i = r.wordAt(t.head), s = i && i.from == t.from && i.to == t.to;
278
+ for (let l = !1, c = new C(r.doc, e, n[n.length - 1].to); ; )
279
+ if (c.next(), c.done) {
323
280
  if (l)
324
281
  return null;
325
- o = new v(t.doc, e, 0, Math.max(0, r[r.length - 1].from - 1)), l = !0;
282
+ c = new C(r.doc, e, 0, Math.max(0, n[n.length - 1].from - 1)), l = !0;
326
283
  } else {
327
- if (l && r.some((c) => c.from == o.value.from))
284
+ if (l && n.some((o) => o.from == c.value.from))
328
285
  continue;
329
286
  if (s) {
330
- let c = t.wordAt(o.value.from);
331
- if (!c || c.from != o.value.from || c.to != o.value.to)
287
+ let o = r.wordAt(c.value.from);
288
+ if (!o || o.from != c.value.from || o.to != c.value.to)
332
289
  continue;
333
290
  }
334
- return o.value;
291
+ return c.value;
335
292
  }
336
293
  }
337
- const Pe = ({ state: t, dispatch: e }) => {
338
- let { ranges: n } = t.selection;
339
- if (n.some((s) => s.from === s.to))
340
- return qe({ state: t, dispatch: e });
341
- let r = t.sliceDoc(n[0].from, n[0].to);
342
- if (t.selection.ranges.some((s) => t.sliceDoc(s.from, s.to) != r))
294
+ const De = ({ state: r, dispatch: e }) => {
295
+ let { ranges: t } = r.selection;
296
+ if (t.some((s) => s.from === s.to))
297
+ return Ee({ state: r, dispatch: e });
298
+ let n = r.sliceDoc(t[0].from, t[0].to);
299
+ if (r.selection.ranges.some((s) => r.sliceDoc(s.from, s.to) != n))
343
300
  return !1;
344
- let i = Re(t, r);
345
- return i ? (e(t.update({
346
- selection: t.selection.addRange(g.range(i.from, i.to), !1),
347
- effects: x.scrollIntoView(i.to)
301
+ let i = Fe(r, n);
302
+ return i ? (e(r.update({
303
+ selection: r.selection.addRange(p.range(i.from, i.to), !1),
304
+ effects: S.scrollIntoView(i.to)
348
305
  })), !0) : !1;
349
- }, C = /* @__PURE__ */ ne.define({
350
- combine(t) {
351
- return re(t, {
306
+ }, b = /* @__PURE__ */ X.define({
307
+ combine(r) {
308
+ return Y(r, {
352
309
  top: !1,
353
310
  caseSensitive: !1,
354
311
  literal: !1,
355
312
  regexp: !1,
356
313
  wholeWord: !1,
357
- createPanel: (e) => new Ve(e),
358
- scrollToMatch: (e) => x.scrollIntoView(e)
314
+ createPanel: (e) => new Ne(e),
315
+ scrollToMatch: (e) => S.scrollIntoView(e)
359
316
  });
360
317
  }
361
318
  });
362
- class ce {
319
+ class ne {
363
320
  /**
364
321
  Create a query object.
365
322
  */
366
323
  constructor(e) {
367
- this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || be(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord;
324
+ this.search = e.search, this.caseSensitive = !!e.caseSensitive, this.literal = !!e.literal, this.regexp = !!e.regexp, this.replace = e.replace || "", this.valid = !!this.search && (!this.regexp || Me(this.search)), this.unquoted = this.unquote(this.search), this.wholeWord = !!e.wholeWord, this.test = e.test;
368
325
  }
369
326
  /**
370
327
  @internal
371
328
  */
372
329
  unquote(e) {
373
- return this.literal ? e : e.replace(/\\([nrt\\])/g, (n, r) => r == "n" ? `
374
- ` : r == "r" ? "\r" : r == "t" ? " " : "\\");
330
+ return this.literal ? e : e.replace(/\\([nrt\\])/g, (t, n) => n == "n" ? `
331
+ ` : n == "r" ? "\r" : n == "t" ? " " : "\\");
375
332
  }
376
333
  /**
377
334
  Compare this query to another query.
378
335
  */
379
336
  eq(e) {
380
- return this.search == e.search && this.replace == e.replace && this.caseSensitive == e.caseSensitive && this.regexp == e.regexp && this.wholeWord == e.wholeWord;
337
+ return this.search == e.search && this.replace == e.replace && this.caseSensitive == e.caseSensitive && this.regexp == e.regexp && this.wholeWord == e.wholeWord && this.test == e.test;
381
338
  }
382
339
  /**
383
340
  @internal
384
341
  */
385
342
  create() {
386
- return this.regexp ? new we(this) : new Te(this);
343
+ return this.regexp ? new Te(this) : new we(this);
387
344
  }
388
345
  /**
389
346
  Get a search cursor for this query, searching through the given
390
347
  range in the given state.
391
348
  */
392
- getCursor(e, n = 0, r) {
393
- let i = e.doc ? e : ye.create({ doc: e });
394
- return r == null && (r = i.doc.length), this.regexp ? M(this, i, n, r) : y(this, i, n, r);
349
+ getCursor(e, t = 0, n) {
350
+ let i = e.doc ? e : pe.create({ doc: e });
351
+ return n == null && (n = i.doc.length), this.regexp ? y(this, i, t, n) : M(this, i, t, n);
395
352
  }
396
353
  }
397
- class ae {
354
+ class ie {
398
355
  constructor(e) {
399
356
  this.spec = e;
400
357
  }
401
358
  }
402
- function y(t, e, n, r) {
403
- return new v(e.doc, t.unquoted, n, r, t.caseSensitive ? void 0 : (i) => i.toLowerCase(), t.wholeWord ? Ie(e.doc, e.charCategorizer(e.selection.main.head)) : void 0);
359
+ function Re(r, e, t) {
360
+ return (n, i, s, l) => {
361
+ if (t && !t(n, i, s, l))
362
+ return !1;
363
+ let c = n >= l && i <= l + s.length ? s.slice(n - l, i - l) : e.doc.sliceString(n, i);
364
+ return r(c, e, n, i);
365
+ };
366
+ }
367
+ function M(r, e, t, n) {
368
+ let i;
369
+ return r.wholeWord && (i = qe(e.doc, e.charCategorizer(e.selection.main.head))), r.test && (i = Re(r.test, e, i)), new C(e.doc, r.unquoted, t, n, r.caseSensitive ? void 0 : (s) => s.toLowerCase(), i);
404
370
  }
405
- function Ie(t, e) {
406
- return (n, r, i, s) => ((s > n || s + i.length < r) && (s = Math.max(0, n - 2), i = t.sliceString(s, Math.min(t.length, r + 2))), (e(I(i, n - s)) != p.Word || e(T(i, n - s)) != p.Word) && (e(T(i, r - s)) != p.Word || e(I(i, r - s)) != p.Word));
371
+ function qe(r, e) {
372
+ return (t, n, i, s) => ((s > t || s + i.length < n) && (s = Math.max(0, t - 2), i = r.sliceString(s, Math.min(r.length, n + 2))), (e(R(i, t - s)) != g.Word || e(q(i, t - s)) != g.Word) && (e(q(i, n - s)) != g.Word || e(R(i, n - s)) != g.Word));
407
373
  }
408
- class Te extends ae {
374
+ class we extends ie {
409
375
  constructor(e) {
410
376
  super(e);
411
377
  }
412
- nextMatch(e, n, r) {
413
- let i = y(this.spec, e, r, e.doc.length).nextOverlapping();
378
+ nextMatch(e, t, n) {
379
+ let i = M(this.spec, e, n, e.doc.length).nextOverlapping();
414
380
  if (i.done) {
415
- let s = Math.min(e.doc.length, n + this.spec.unquoted.length);
416
- i = y(this.spec, e, 0, s).nextOverlapping();
381
+ let s = Math.min(e.doc.length, t + this.spec.unquoted.length);
382
+ i = M(this.spec, e, 0, s).nextOverlapping();
417
383
  }
418
- return i.done || i.value.from == n && i.value.to == r ? null : i.value;
384
+ return i.done || i.value.from == t && i.value.to == n ? null : i.value;
419
385
  }
420
386
  // Searching in reverse is, rather than implementing an inverted search
421
387
  // cursor, done by scanning chunk after chunk forward.
422
- prevMatchInRange(e, n, r) {
423
- for (let i = r; ; ) {
424
- let s = Math.max(n, i - 1e4 - this.spec.unquoted.length), l = y(this.spec, e, s, i), o = null;
388
+ prevMatchInRange(e, t, n) {
389
+ for (let i = n; ; ) {
390
+ let s = Math.max(t, i - 1e4 - this.spec.unquoted.length), l = M(this.spec, e, s, i), c = null;
425
391
  for (; !l.nextOverlapping().done; )
426
- o = l.value;
427
- if (o)
428
- return o;
429
- if (s == n)
392
+ c = l.value;
393
+ if (c)
394
+ return c;
395
+ if (s == t)
430
396
  return null;
431
397
  i -= 1e4;
432
398
  }
433
399
  }
434
- prevMatch(e, n, r) {
435
- let i = this.prevMatchInRange(e, 0, n);
436
- return i || (i = this.prevMatchInRange(e, Math.max(0, r - this.spec.unquoted.length), e.doc.length)), i && (i.from != n || i.to != r) ? i : null;
400
+ prevMatch(e, t, n) {
401
+ let i = this.prevMatchInRange(e, 0, t);
402
+ return i || (i = this.prevMatchInRange(e, Math.max(0, n - this.spec.unquoted.length), e.doc.length)), i && (i.from != t || i.to != n) ? i : null;
437
403
  }
438
404
  getReplacement(e) {
439
405
  return this.spec.unquote(this.spec.replace);
440
406
  }
441
- matchAll(e, n) {
442
- let r = y(this.spec, e, 0, e.doc.length), i = [];
443
- for (; !r.next().done; ) {
444
- if (i.length >= n)
407
+ matchAll(e, t) {
408
+ let n = M(this.spec, e, 0, e.doc.length), i = [];
409
+ for (; !n.next().done; ) {
410
+ if (i.length >= t)
445
411
  return null;
446
- i.push(r.value);
412
+ i.push(n.value);
447
413
  }
448
414
  return i;
449
415
  }
450
- highlight(e, n, r, i) {
451
- let s = y(this.spec, e, Math.max(0, n - this.spec.unquoted.length), Math.min(r + this.spec.unquoted.length, e.doc.length));
416
+ highlight(e, t, n, i) {
417
+ let s = M(this.spec, e, Math.max(0, t - this.spec.unquoted.length), Math.min(n + this.spec.unquoted.length, e.doc.length));
452
418
  for (; !s.next().done; )
453
419
  i(s.value.from, s.value.to);
454
420
  }
455
421
  }
456
- function M(t, e, n, r) {
457
- return new le(e.doc, t.search, {
458
- ignoreCase: !t.caseSensitive,
459
- test: t.wholeWord ? $e(e.charCategorizer(e.selection.main.head)) : void 0
460
- }, n, r);
422
+ function Pe(r, e, t) {
423
+ return (n, i, s) => (!t || t(n, i, s)) && r(s[0], e, n, i);
424
+ }
425
+ function y(r, e, t, n) {
426
+ let i;
427
+ return r.wholeWord && (i = Ie(e.charCategorizer(e.selection.main.head))), r.test && (i = Pe(r.test, e, i)), new te(e.doc, r.search, { ignoreCase: !r.caseSensitive, test: i }, t, n);
461
428
  }
462
- function I(t, e) {
463
- return t.slice(ie(t, e, !1), e);
429
+ function R(r, e) {
430
+ return r.slice(Z(r, e, !1), e);
464
431
  }
465
- function T(t, e) {
466
- return t.slice(e, ie(t, e));
432
+ function q(r, e) {
433
+ return r.slice(e, Z(r, e));
467
434
  }
468
- function $e(t) {
469
- return (e, n, r) => !r[0].length || (t(I(r.input, r.index)) != p.Word || t(T(r.input, r.index)) != p.Word) && (t(T(r.input, r.index + r[0].length)) != p.Word || t(I(r.input, r.index + r[0].length)) != p.Word);
435
+ function Ie(r) {
436
+ return (e, t, n) => !n[0].length || (r(R(n.input, n.index)) != g.Word || r(q(n.input, n.index)) != g.Word) && (r(q(n.input, n.index + n[0].length)) != g.Word || r(R(n.input, n.index + n[0].length)) != g.Word);
470
437
  }
471
- class we extends ae {
472
- nextMatch(e, n, r) {
473
- let i = M(this.spec, e, r, e.doc.length).next();
474
- return i.done && (i = M(this.spec, e, 0, n).next()), i.done ? null : i.value;
438
+ class Te extends ie {
439
+ nextMatch(e, t, n) {
440
+ let i = y(this.spec, e, n, e.doc.length).next();
441
+ return i.done && (i = y(this.spec, e, 0, t).next()), i.done ? null : i.value;
475
442
  }
476
- prevMatchInRange(e, n, r) {
443
+ prevMatchInRange(e, t, n) {
477
444
  for (let i = 1; ; i++) {
478
445
  let s = Math.max(
479
- n,
480
- r - i * 1e4
446
+ t,
447
+ n - i * 1e4
481
448
  /* FindPrev.ChunkSize */
482
- ), l = M(this.spec, e, s, r), o = null;
449
+ ), l = y(this.spec, e, s, n), c = null;
483
450
  for (; !l.next().done; )
484
- o = l.value;
485
- if (o && (s == n || o.from > s + 10))
486
- return o;
487
- if (s == n)
451
+ c = l.value;
452
+ if (c && (s == t || c.from > s + 10))
453
+ return c;
454
+ if (s == t)
488
455
  return null;
489
456
  }
490
457
  }
491
- prevMatch(e, n, r) {
492
- return this.prevMatchInRange(e, 0, n) || this.prevMatchInRange(e, r, e.doc.length);
458
+ prevMatch(e, t, n) {
459
+ return this.prevMatchInRange(e, 0, t) || this.prevMatchInRange(e, n, e.doc.length);
493
460
  }
494
461
  getReplacement(e) {
495
- return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (n, r) => {
496
- if (r == "&")
462
+ return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g, (t, n) => {
463
+ if (n == "&")
497
464
  return e.match[0];
498
- if (r == "$")
465
+ if (n == "$")
499
466
  return "$";
500
- for (let i = r.length; i > 0; i--) {
501
- let s = +r.slice(0, i);
467
+ for (let i = n.length; i > 0; i--) {
468
+ let s = +n.slice(0, i);
502
469
  if (s > 0 && s < e.match.length)
503
- return e.match[s] + r.slice(i);
470
+ return e.match[s] + n.slice(i);
504
471
  }
505
- return n;
472
+ return t;
506
473
  });
507
474
  }
508
- matchAll(e, n) {
509
- let r = M(this.spec, e, 0, e.doc.length), i = [];
510
- for (; !r.next().done; ) {
511
- if (i.length >= n)
475
+ matchAll(e, t) {
476
+ let n = y(this.spec, e, 0, e.doc.length), i = [];
477
+ for (; !n.next().done; ) {
478
+ if (i.length >= t)
512
479
  return null;
513
- i.push(r.value);
480
+ i.push(n.value);
514
481
  }
515
482
  return i;
516
483
  }
517
- highlight(e, n, r, i) {
518
- let s = M(this.spec, e, Math.max(
484
+ highlight(e, t, n, i) {
485
+ let s = y(this.spec, e, Math.max(
519
486
  0,
520
- n - 250
487
+ t - 250
521
488
  /* RegExp.HighlightMargin */
522
- ), Math.min(r + 250, e.doc.length));
489
+ ), Math.min(n + 250, e.doc.length));
523
490
  for (; !s.next().done; )
524
491
  i(s.value.from, s.value.to);
525
492
  }
526
493
  }
527
- const W = /* @__PURE__ */ A.define(), V = /* @__PURE__ */ A.define(), S = /* @__PURE__ */ te.define({
528
- create(t) {
529
- return new z(B(t).create(), null);
494
+ const L = /* @__PURE__ */ Q.define(), z = /* @__PURE__ */ Q.define(), x = /* @__PURE__ */ fe.define({
495
+ create(r) {
496
+ return new O($(r).create(), null);
530
497
  },
531
- update(t, e) {
532
- for (let n of e.effects)
533
- n.is(W) ? t = new z(n.value.create(), t.panel) : n.is(V) && (t = new z(t.query, n.value ? H : null));
534
- return t;
498
+ update(r, e) {
499
+ for (let t of e.effects)
500
+ t.is(L) ? r = new O(t.value.create(), r.panel) : t.is(z) && (r = new O(r.query, t.value ? B : null));
501
+ return r;
535
502
  },
536
- provide: (t) => ee.from(t, (e) => e.panel)
503
+ provide: (r) => ae.from(r, (e) => e.panel)
537
504
  });
538
- class z {
539
- constructor(e, n) {
540
- this.query = e, this.panel = n;
505
+ class O {
506
+ constructor(e, t) {
507
+ this.query = e, this.panel = t;
541
508
  }
542
509
  }
543
- const Oe = /* @__PURE__ */ d.mark({ class: "cm-searchMatch" }), Qe = /* @__PURE__ */ d.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), ze = /* @__PURE__ */ Z.fromClass(class {
544
- constructor(t) {
545
- this.view = t, this.decorations = this.highlight(t.state.field(S));
546
- }
547
- update(t) {
548
- let e = t.state.field(S);
549
- (e != t.startState.field(S) || t.docChanged || t.selectionSet || t.viewportChanged) && (this.decorations = this.highlight(e));
550
- }
551
- highlight({ query: t, panel: e }) {
552
- if (!e || !t.spec.valid)
553
- return d.none;
554
- let { view: n } = this, r = new Me();
555
- for (let i = 0, s = n.visibleRanges, l = s.length; i < l; i++) {
556
- let { from: o, to: c } = s[i];
557
- for (; i < l - 1 && c > s[i + 1].from - 500; )
558
- c = s[++i].to;
559
- t.highlight(n.state, o, c, (a, u) => {
560
- let m = n.state.selection.ranges.some((E) => E.from == a && E.to == u);
561
- r.add(a, u, m ? Qe : Oe);
510
+ const Oe = /* @__PURE__ */ f.mark({ class: "cm-searchMatch" }), $e = /* @__PURE__ */ f.mark({ class: "cm-searchMatch cm-searchMatch-selected" }), Qe = /* @__PURE__ */ U.fromClass(class {
511
+ constructor(r) {
512
+ this.view = r, this.decorations = this.highlight(r.state.field(x));
513
+ }
514
+ update(r) {
515
+ let e = r.state.field(x);
516
+ (e != r.startState.field(x) || r.docChanged || r.selectionSet || r.viewportChanged) && (this.decorations = this.highlight(e));
517
+ }
518
+ highlight({ query: r, panel: e }) {
519
+ if (!e || !r.spec.valid)
520
+ return f.none;
521
+ let { view: t } = this, n = new xe();
522
+ for (let i = 0, s = t.visibleRanges, l = s.length; i < l; i++) {
523
+ let { from: c, to: o } = s[i];
524
+ for (; i < l - 1 && o > s[i + 1].from - 500; )
525
+ o = s[++i].to;
526
+ r.highlight(t.state, c, o, (h, a) => {
527
+ let d = t.state.selection.ranges.some((A) => A.from == h && A.to == a);
528
+ n.add(h, a, d ? $e : Oe);
562
529
  });
563
530
  }
564
- return r.finish();
531
+ return n.finish();
565
532
  }
566
533
  }, {
567
- decorations: (t) => t.decorations
534
+ decorations: (r) => r.decorations
568
535
  });
569
- function D(t) {
536
+ function W(r) {
570
537
  return (e) => {
571
- let n = e.state.field(S, !1);
572
- return n && n.query.spec.valid ? t(e, n) : fe(e);
538
+ let t = e.state.field(x, !1);
539
+ return t && t.query.spec.valid ? r(e, t) : ce(e);
573
540
  };
574
541
  }
575
- const $ = /* @__PURE__ */ D((t, { query: e }) => {
576
- let { to: n } = t.state.selection.main, r = e.nextMatch(t.state, n, n);
577
- if (!r)
542
+ const w = /* @__PURE__ */ W((r, { query: e }) => {
543
+ let { to: t } = r.state.selection.main, n = e.nextMatch(r.state, t, t);
544
+ if (!n)
578
545
  return !1;
579
- let i = g.single(r.from, r.to), s = t.state.facet(C);
580
- return t.dispatch({
546
+ let i = p.single(n.from, n.to), s = r.state.facet(b);
547
+ return r.dispatch({
581
548
  selection: i,
582
- effects: [K(t, r), s.scrollToMatch(i.main, t)],
549
+ effects: [N(r, n), s.scrollToMatch(i.main, r)],
583
550
  userEvent: "select.search"
584
- }), ue(t), !0;
585
- }), w = /* @__PURE__ */ D((t, { query: e }) => {
586
- let { state: n } = t, { from: r } = n.selection.main, i = e.prevMatch(n, r, r);
551
+ }), le(r), !0;
552
+ }), P = /* @__PURE__ */ W((r, { query: e }) => {
553
+ let { state: t } = r, { from: n } = t.selection.main, i = e.prevMatch(t, n, n);
587
554
  if (!i)
588
555
  return !1;
589
- let s = g.single(i.from, i.to), l = t.state.facet(C);
590
- return t.dispatch({
556
+ let s = p.single(i.from, i.to), l = r.state.facet(b);
557
+ return r.dispatch({
591
558
  selection: s,
592
- effects: [K(t, i), l.scrollToMatch(s.main, t)],
559
+ effects: [N(r, i), l.scrollToMatch(s.main, r)],
593
560
  userEvent: "select.search"
594
- }), ue(t), !0;
595
- }), _e = /* @__PURE__ */ D((t, { query: e }) => {
596
- let n = e.matchAll(t.state, 1e3);
597
- return !n || !n.length ? !1 : (t.dispatch({
598
- selection: g.create(n.map((r) => g.range(r.from, r.to))),
561
+ }), le(r), !0;
562
+ }), _e = /* @__PURE__ */ W((r, { query: e }) => {
563
+ let t = e.matchAll(r.state, 1e3);
564
+ return !t || !t.length ? !1 : (r.dispatch({
565
+ selection: p.create(t.map((n) => p.range(n.from, n.to))),
599
566
  userEvent: "select.search.matches"
600
567
  }), !0);
601
- }), Be = ({ state: t, dispatch: e }) => {
602
- let n = t.selection;
603
- if (n.ranges.length > 1 || n.main.empty)
568
+ }), ze = ({ state: r, dispatch: e }) => {
569
+ let t = r.selection;
570
+ if (t.ranges.length > 1 || t.main.empty)
604
571
  return !1;
605
- let { from: r, to: i } = n.main, s = [], l = 0;
606
- for (let o = new v(t.doc, t.sliceDoc(r, i)); !o.next().done; ) {
572
+ let { from: n, to: i } = t.main, s = [], l = 0;
573
+ for (let c = new C(r.doc, r.sliceDoc(n, i)); !c.next().done; ) {
607
574
  if (s.length > 1e3)
608
575
  return !1;
609
- o.value.from == r && (l = s.length), s.push(g.range(o.value.from, o.value.to));
576
+ c.value.from == n && (l = s.length), s.push(p.range(c.value.from, c.value.to));
610
577
  }
611
- return e(t.update({
612
- selection: g.create(s, l),
578
+ return e(r.update({
579
+ selection: p.create(s, l),
613
580
  userEvent: "select.search.matches"
614
581
  })), !0;
615
- }, Y = /* @__PURE__ */ D((t, { query: e }) => {
616
- let { state: n } = t, { from: r, to: i } = n.selection.main;
617
- if (n.readOnly)
582
+ }, j = /* @__PURE__ */ W((r, { query: e }) => {
583
+ let { state: t } = r, { from: n, to: i } = t.selection.main;
584
+ if (t.readOnly)
618
585
  return !1;
619
- let s = e.nextMatch(n, r, r);
586
+ let s = e.nextMatch(t, n, n);
620
587
  if (!s)
621
588
  return !1;
622
- let l = s, o = [], c, a, u = [];
623
- l.from == r && l.to == i && (a = n.toText(e.getReplacement(l)), o.push({ from: l.from, to: l.to, insert: a }), l = e.nextMatch(n, l.from, l.to), u.push(x.announce.of(n.phrase("replaced match on line $", n.doc.lineAt(r).number) + ".")));
624
- let m = t.state.changes(o);
625
- return l && (c = g.single(l.from, l.to).map(m), u.push(K(t, l)), u.push(n.facet(C).scrollToMatch(c.main, t))), t.dispatch({
626
- changes: m,
627
- selection: c,
628
- effects: u,
589
+ let l = s, c = [], o, h, a = [];
590
+ l.from == n && l.to == i && (h = t.toText(e.getReplacement(l)), c.push({ from: l.from, to: l.to, insert: h }), l = e.nextMatch(t, l.from, l.to), a.push(S.announce.of(t.phrase("replaced match on line $", t.doc.lineAt(n).number) + ".")));
591
+ let d = r.state.changes(c);
592
+ return l && (o = p.single(l.from, l.to).map(d), a.push(N(r, l)), a.push(t.facet(b).scrollToMatch(o.main, r))), r.dispatch({
593
+ changes: d,
594
+ selection: o,
595
+ effects: a,
629
596
  userEvent: "input.replace"
630
597
  }), !0;
631
- }), Ne = /* @__PURE__ */ D((t, { query: e }) => {
632
- if (t.state.readOnly)
598
+ }), Be = /* @__PURE__ */ W((r, { query: e }) => {
599
+ if (r.state.readOnly)
633
600
  return !1;
634
- let n = e.matchAll(t.state, 1e9).map((i) => {
601
+ let t = e.matchAll(r.state, 1e9).map((i) => {
635
602
  let { from: s, to: l } = i;
636
603
  return { from: s, to: l, insert: e.getReplacement(i) };
637
604
  });
638
- if (!n.length)
605
+ if (!t.length)
639
606
  return !1;
640
- let r = t.state.phrase("replaced $ matches", n.length) + ".";
641
- return t.dispatch({
642
- changes: n,
643
- effects: x.announce.of(r),
607
+ let n = r.state.phrase("replaced $ matches", t.length) + ".";
608
+ return r.dispatch({
609
+ changes: t,
610
+ effects: S.announce.of(n),
644
611
  userEvent: "input.replace.all"
645
612
  }), !0;
646
613
  });
647
- function H(t) {
648
- return t.state.facet(C).createPanel(t);
614
+ function B(r) {
615
+ return r.state.facet(b).createPanel(r);
649
616
  }
650
- function B(t, e) {
651
- var n, r, i, s, l;
652
- let o = t.selection.main, c = o.empty || o.to > o.from + 100 ? "" : t.sliceDoc(o.from, o.to);
653
- if (e && !c)
617
+ function $(r, e) {
618
+ var t, n, i, s, l;
619
+ let c = r.selection.main, o = c.empty || c.to > c.from + 100 ? "" : r.sliceDoc(c.from, c.to);
620
+ if (e && !o)
654
621
  return e;
655
- let a = t.facet(C);
656
- return new ce({
657
- search: ((n = e?.literal) !== null && n !== void 0 ? n : a.literal) ? c : c.replace(/\n/g, "\\n"),
658
- caseSensitive: (r = e?.caseSensitive) !== null && r !== void 0 ? r : a.caseSensitive,
659
- literal: (i = e?.literal) !== null && i !== void 0 ? i : a.literal,
660
- regexp: (s = e?.regexp) !== null && s !== void 0 ? s : a.regexp,
661
- wholeWord: (l = e?.wholeWord) !== null && l !== void 0 ? l : a.wholeWord
622
+ let h = r.facet(b);
623
+ return new ne({
624
+ search: ((t = e?.literal) !== null && t !== void 0 ? t : h.literal) ? o : o.replace(/\n/g, "\\n"),
625
+ caseSensitive: (n = e?.caseSensitive) !== null && n !== void 0 ? n : h.caseSensitive,
626
+ literal: (i = e?.literal) !== null && i !== void 0 ? i : h.literal,
627
+ regexp: (s = e?.regexp) !== null && s !== void 0 ? s : h.regexp,
628
+ wholeWord: (l = e?.wholeWord) !== null && l !== void 0 ? l : h.wholeWord
662
629
  });
663
630
  }
664
- function he(t) {
665
- let e = R(t, H);
631
+ function se(r) {
632
+ let e = J(r, B);
666
633
  return e && e.dom.querySelector("[main-field]");
667
634
  }
668
- function ue(t) {
669
- let e = he(t);
670
- e && e == t.root.activeElement && e.select();
635
+ function le(r) {
636
+ let e = se(r);
637
+ e && e == r.root.activeElement && e.select();
671
638
  }
672
- const fe = (t) => {
673
- let e = t.state.field(S, !1);
639
+ const ce = (r) => {
640
+ let e = r.state.field(x, !1);
674
641
  if (e && e.panel) {
675
- let n = he(t);
676
- if (n && n != t.root.activeElement) {
677
- let r = B(t.state, e.query.spec);
678
- r.valid && t.dispatch({ effects: W.of(r) }), n.focus(), n.select();
642
+ let t = se(r);
643
+ if (t && t != r.root.activeElement) {
644
+ let n = $(r.state, e.query.spec);
645
+ n.valid && r.dispatch({ effects: L.of(n) }), t.focus(), t.select();
679
646
  }
680
647
  } else
681
- t.dispatch({ effects: [
682
- V.of(!0),
683
- e ? W.of(B(t.state, e.query.spec)) : A.appendConfig.of(Ke)
648
+ r.dispatch({ effects: [
649
+ z.of(!0),
650
+ e ? L.of($(r.state, e.query.spec)) : Q.appendConfig.of(He)
684
651
  ] });
685
652
  return !0;
686
- }, de = (t) => {
687
- let e = t.state.field(S, !1);
653
+ }, oe = (r) => {
654
+ let e = r.state.field(x, !1);
688
655
  if (!e || !e.panel)
689
656
  return !1;
690
- let n = R(t, H);
691
- return n && n.dom.contains(t.root.activeElement) && t.focus(), t.dispatch({ effects: V.of(!1) }), !0;
692
- }, Xe = [
693
- { key: "Mod-f", run: fe, scope: "editor search-panel" },
694
- { key: "F3", run: $, shift: w, scope: "editor search-panel", preventDefault: !0 },
695
- { key: "Mod-g", run: $, shift: w, scope: "editor search-panel", preventDefault: !0 },
696
- { key: "Escape", run: de, scope: "editor search-panel" },
697
- { key: "Mod-Shift-l", run: Be },
698
- { key: "Mod-Alt-g", run: ve },
699
- { key: "Mod-d", run: Pe, preventDefault: !0 }
657
+ let t = J(r, B);
658
+ return t && t.dom.contains(r.root.activeElement) && r.focus(), r.dispatch({ effects: z.of(!1) }), !0;
659
+ }, Ue = [
660
+ { key: "Mod-f", run: ce, scope: "editor search-panel" },
661
+ { key: "F3", run: w, shift: P, scope: "editor search-panel", preventDefault: !0 },
662
+ { key: "Mod-g", run: w, shift: P, scope: "editor search-panel", preventDefault: !0 },
663
+ { key: "Escape", run: oe, scope: "editor search-panel" },
664
+ { key: "Mod-Shift-l", run: ze },
665
+ { key: "Mod-Alt-g", run: ye },
666
+ { key: "Mod-d", run: De, preventDefault: !0 }
700
667
  ];
701
- class Ve {
668
+ class Ne {
702
669
  constructor(e) {
703
670
  this.view = e;
704
- let n = this.query = e.state.field(S).query.spec;
705
- this.commit = this.commit.bind(this), this.searchField = h("input", {
706
- value: n.search,
707
- placeholder: f(e, "Find"),
708
- "aria-label": f(e, "Find"),
671
+ let t = this.query = e.state.field(x).query.spec;
672
+ this.commit = this.commit.bind(this), this.searchField = m("input", {
673
+ value: t.search,
674
+ placeholder: u(e, "Find"),
675
+ "aria-label": u(e, "Find"),
709
676
  class: "cm-textfield",
710
677
  name: "search",
711
678
  form: "",
712
679
  "main-field": "true",
713
680
  onchange: this.commit,
714
681
  onkeyup: this.commit
715
- }), this.replaceField = h("input", {
716
- value: n.replace,
717
- placeholder: f(e, "Replace"),
718
- "aria-label": f(e, "Replace"),
682
+ }), this.replaceField = m("input", {
683
+ value: t.replace,
684
+ placeholder: u(e, "Replace"),
685
+ "aria-label": u(e, "Replace"),
719
686
  class: "cm-textfield",
720
687
  name: "replace",
721
688
  form: "",
722
689
  onchange: this.commit,
723
690
  onkeyup: this.commit
724
- }), this.caseField = h("input", {
691
+ }), this.caseField = m("input", {
725
692
  type: "checkbox",
726
693
  name: "case",
727
694
  form: "",
728
- checked: n.caseSensitive,
695
+ checked: t.caseSensitive,
729
696
  onchange: this.commit
730
- }), this.reField = h("input", {
697
+ }), this.reField = m("input", {
731
698
  type: "checkbox",
732
699
  name: "re",
733
700
  form: "",
734
- checked: n.regexp,
701
+ checked: t.regexp,
735
702
  onchange: this.commit
736
- }), this.wordField = h("input", {
703
+ }), this.wordField = m("input", {
737
704
  type: "checkbox",
738
705
  name: "word",
739
706
  form: "",
740
- checked: n.wholeWord,
707
+ checked: t.wholeWord,
741
708
  onchange: this.commit
742
709
  });
743
- function r(i, s, l) {
744
- return h("button", { class: "cm-button", name: i, onclick: s, type: "button" }, l);
710
+ function n(i, s, l) {
711
+ return m("button", { class: "cm-button", name: i, onclick: s, type: "button" }, l);
745
712
  }
746
- this.dom = h("div", { onkeydown: (i) => this.keydown(i), class: "cm-search" }, [
713
+ this.dom = m("div", { onkeydown: (i) => this.keydown(i), class: "cm-search" }, [
747
714
  this.searchField,
748
- r("next", () => $(e), [f(e, "next")]),
749
- r("prev", () => w(e), [f(e, "previous")]),
750
- r("select", () => _e(e), [f(e, "all")]),
751
- h("label", null, [this.caseField, f(e, "match case")]),
752
- h("label", null, [this.reField, f(e, "regexp")]),
753
- h("label", null, [this.wordField, f(e, "by word")]),
715
+ n("next", () => w(e), [u(e, "next")]),
716
+ n("prev", () => P(e), [u(e, "previous")]),
717
+ n("select", () => _e(e), [u(e, "all")]),
718
+ m("label", null, [this.caseField, u(e, "match case")]),
719
+ m("label", null, [this.reField, u(e, "regexp")]),
720
+ m("label", null, [this.wordField, u(e, "by word")]),
754
721
  ...e.state.readOnly ? [] : [
755
- h("br"),
722
+ m("br"),
756
723
  this.replaceField,
757
- r("replace", () => Y(e), [f(e, "replace")]),
758
- r("replaceAll", () => Ne(e), [f(e, "replace all")])
724
+ n("replace", () => j(e), [u(e, "replace")]),
725
+ n("replaceAll", () => Be(e), [u(e, "replace all")])
759
726
  ],
760
- h("button", {
727
+ m("button", {
761
728
  name: "close",
762
- onclick: () => de(e),
763
- "aria-label": f(e, "close"),
729
+ onclick: () => oe(e),
730
+ "aria-label": u(e, "close"),
764
731
  type: "button"
765
732
  }, ["×"])
766
733
  ]);
767
734
  }
768
735
  commit() {
769
- let e = new ce({
736
+ let e = new ne({
770
737
  search: this.searchField.value,
771
738
  caseSensitive: this.caseField.checked,
772
739
  regexp: this.reField.checked,
773
740
  wholeWord: this.wordField.checked,
774
741
  replace: this.replaceField.value
775
742
  });
776
- e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: W.of(e) }));
743
+ e.eq(this.query) || (this.query = e, this.view.dispatch({ effects: L.of(e) }));
777
744
  }
778
745
  keydown(e) {
779
- me(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? w : $)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), Y(this.view));
746
+ ue(this.view, e, "search-panel") ? e.preventDefault() : e.keyCode == 13 && e.target == this.searchField ? (e.preventDefault(), (e.shiftKey ? P : w)(this.view)) : e.keyCode == 13 && e.target == this.replaceField && (e.preventDefault(), j(this.view));
780
747
  }
781
748
  update(e) {
782
- for (let n of e.transactions)
783
- for (let r of n.effects)
784
- r.is(W) && !r.value.eq(this.query) && this.setQuery(r.value);
749
+ for (let t of e.transactions)
750
+ for (let n of t.effects)
751
+ n.is(L) && !n.value.eq(this.query) && this.setQuery(n.value);
785
752
  }
786
753
  setQuery(e) {
787
754
  this.query = e, this.searchField.value = e.search, this.replaceField.value = e.replace, this.caseField.checked = e.caseSensitive, this.reField.checked = e.regexp, this.wordField.checked = e.wholeWord;
@@ -793,32 +760,32 @@ class Ve {
793
760
  return 80;
794
761
  }
795
762
  get top() {
796
- return this.view.state.facet(C).top;
763
+ return this.view.state.facet(b).top;
797
764
  }
798
765
  }
799
- function f(t, e) {
800
- return t.state.phrase(e);
766
+ function u(r, e) {
767
+ return r.state.phrase(e);
801
768
  }
802
- const F = 30, q = /[\s\.,:;?!]/;
803
- function K(t, { from: e, to: n }) {
804
- let r = t.state.doc.lineAt(e), i = t.state.doc.lineAt(n).to, s = Math.max(r.from, e - F), l = Math.min(i, n + F), o = t.state.sliceDoc(s, l);
805
- if (s != r.from) {
806
- for (let c = 0; c < F; c++)
807
- if (!q.test(o[c + 1]) && q.test(o[c])) {
808
- o = o.slice(c);
769
+ const E = 30, F = /[\s\.,:;?!]/;
770
+ function N(r, { from: e, to: t }) {
771
+ let n = r.state.doc.lineAt(e), i = r.state.doc.lineAt(t).to, s = Math.max(n.from, e - E), l = Math.min(i, t + E), c = r.state.sliceDoc(s, l);
772
+ if (s != n.from) {
773
+ for (let o = 0; o < E; o++)
774
+ if (!F.test(c[o + 1]) && F.test(c[o])) {
775
+ c = c.slice(o);
809
776
  break;
810
777
  }
811
778
  }
812
779
  if (l != i) {
813
- for (let c = o.length - 1; c > o.length - F; c--)
814
- if (!q.test(o[c - 1]) && q.test(o[c])) {
815
- o = o.slice(0, c);
780
+ for (let o = c.length - 1; o > c.length - E; o--)
781
+ if (!F.test(c[o - 1]) && F.test(c[o])) {
782
+ c = c.slice(0, o);
816
783
  break;
817
784
  }
818
785
  }
819
- return x.announce.of(`${t.state.phrase("current match")}. ${o} ${t.state.phrase("on line")} ${r.number}.`);
786
+ return S.announce.of(`${r.state.phrase("current match")}. ${c} ${r.state.phrase("on line")} ${n.number}.`);
820
787
  }
821
- const He = /* @__PURE__ */ x.baseTheme({
788
+ const Ve = /* @__PURE__ */ S.baseTheme({
822
789
  ".cm-panel.cm-search": {
823
790
  padding: "2px 6px 4px",
824
791
  position: "relative",
@@ -847,26 +814,26 @@ const He = /* @__PURE__ */ x.baseTheme({
847
814
  "&dark .cm-searchMatch": { backgroundColor: "#00ffff8a" },
848
815
  "&light .cm-searchMatch-selected": { backgroundColor: "#ff6a0054" },
849
816
  "&dark .cm-searchMatch-selected": { backgroundColor: "#ff00ff8a" }
850
- }), Ke = [
851
- S,
852
- /* @__PURE__ */ pe.low(ze),
853
- He
817
+ }), He = [
818
+ x,
819
+ /* @__PURE__ */ de.low(Qe),
820
+ Ve
854
821
  ];
855
822
  export {
856
- le as RegExpCursor,
857
- v as SearchCursor,
858
- ce as SearchQuery,
859
- de as closeSearchPanel,
860
- $ as findNext,
861
- w as findPrevious,
862
- ve as gotoLine,
863
- Ue as highlightSelectionMatches,
864
- fe as openSearchPanel,
865
- Ne as replaceAll,
866
- Y as replaceNext,
867
- Xe as searchKeymap,
823
+ te as RegExpCursor,
824
+ C as SearchCursor,
825
+ ne as SearchQuery,
826
+ oe as closeSearchPanel,
827
+ w as findNext,
828
+ P as findPrevious,
829
+ ye as gotoLine,
830
+ Je as highlightSelectionMatches,
831
+ ce as openSearchPanel,
832
+ Be as replaceAll,
833
+ j as replaceNext,
834
+ Ue as searchKeymap,
868
835
  _e as selectMatches,
869
- Pe as selectNextOccurrence,
870
- Be as selectSelectionMatches,
871
- W as setSearchQuery
836
+ De as selectNextOccurrence,
837
+ ze as selectSelectionMatches,
838
+ L as setSearchQuery
872
839
  };