@burdenoff/microfe-technospam 2026.1102.1 → 2026.1102.2

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 (83) hide show
  1. package/dist/generated/wspace-types.d.ts +7468 -141
  2. package/dist/generated/wspace-types.d.ts.map +1 -1
  3. package/dist/node_modules/@codemirror/autocomplete/dist/index.js +527 -0
  4. package/dist/node_modules/@codemirror/autocomplete/dist/index.js.map +1 -0
  5. package/dist/node_modules/@codemirror/commands/dist/index.js +1108 -0
  6. package/dist/node_modules/@codemirror/commands/dist/index.js.map +1 -0
  7. package/dist/node_modules/@codemirror/lang-go/dist/index.js +206 -0
  8. package/dist/node_modules/@codemirror/lang-go/dist/index.js.map +1 -0
  9. package/dist/node_modules/@codemirror/lang-javascript/dist/index.js +321 -0
  10. package/dist/node_modules/@codemirror/lang-javascript/dist/index.js.map +1 -0
  11. package/dist/node_modules/@codemirror/lang-python/dist/index.js +265 -0
  12. package/dist/node_modules/@codemirror/lang-python/dist/index.js.map +1 -0
  13. package/dist/node_modules/@codemirror/language/dist/index.js +957 -0
  14. package/dist/node_modules/@codemirror/language/dist/index.js.map +1 -0
  15. package/dist/node_modules/@codemirror/legacy-modes/mode/ruby.js +164 -0
  16. package/dist/node_modules/@codemirror/legacy-modes/mode/ruby.js.map +1 -0
  17. package/dist/node_modules/@codemirror/legacy-modes/mode/shell.js +109 -0
  18. package/dist/node_modules/@codemirror/legacy-modes/mode/shell.js.map +1 -0
  19. package/dist/node_modules/@codemirror/state/dist/index.js +1739 -0
  20. package/dist/node_modules/@codemirror/state/dist/index.js.map +1 -0
  21. package/dist/node_modules/@codemirror/streamparser/dist/index.js +70 -0
  22. package/dist/node_modules/@codemirror/streamparser/dist/index.js.map +1 -0
  23. package/dist/node_modules/@codemirror/view/dist/index.js +5427 -0
  24. package/dist/node_modules/@codemirror/view/dist/index.js.map +1 -0
  25. package/dist/node_modules/@lezer/common/dist/index.js +896 -0
  26. package/dist/node_modules/@lezer/common/dist/index.js.map +1 -0
  27. package/dist/node_modules/@lezer/go/dist/index.js +215 -0
  28. package/dist/node_modules/@lezer/go/dist/index.js.map +1 -0
  29. package/dist/node_modules/@lezer/highlight/dist/index.js +395 -0
  30. package/dist/node_modules/@lezer/highlight/dist/index.js.map +1 -0
  31. package/dist/node_modules/@lezer/javascript/dist/index.js +437 -0
  32. package/dist/node_modules/@lezer/javascript/dist/index.js.map +1 -0
  33. package/dist/node_modules/@lezer/lr/dist/index.js +842 -0
  34. package/dist/node_modules/@lezer/lr/dist/index.js.map +1 -0
  35. package/dist/node_modules/@lezer/python/dist/index.js +352 -0
  36. package/dist/node_modules/@lezer/python/dist/index.js.map +1 -0
  37. package/dist/node_modules/@marijn/find-cluster-break/src/index.js +66 -0
  38. package/dist/node_modules/@marijn/find-cluster-break/src/index.js.map +1 -0
  39. package/dist/node_modules/style-mod/src/style-mod.js +74 -0
  40. package/dist/node_modules/style-mod/src/style-mod.js.map +1 -0
  41. package/dist/node_modules/w3c-keyname/index.js +90 -0
  42. package/dist/node_modules/w3c-keyname/index.js.map +1 -0
  43. package/dist/stories/fixtures/technospamFixtures.d.ts.map +1 -1
  44. package/dist/stories/journeys/Problems.stories.d.ts.map +1 -1
  45. package/dist/technospam/api/technospamApi.d.ts +39 -0
  46. package/dist/technospam/api/technospamApi.d.ts.map +1 -1
  47. package/dist/technospam/api/technospamApi.js +120 -86
  48. package/dist/technospam/api/technospamApi.js.map +1 -1
  49. package/dist/technospam/components/SubmissionViews.d.ts +6 -2
  50. package/dist/technospam/components/SubmissionViews.d.ts.map +1 -1
  51. package/dist/technospam/components/SubmissionViews.js +6 -5
  52. package/dist/technospam/components/SubmissionViews.js.map +1 -1
  53. package/dist/technospam/components/TechnoSpamErrorBoundary.d.ts +6 -0
  54. package/dist/technospam/components/TechnoSpamErrorBoundary.d.ts.map +1 -1
  55. package/dist/technospam/components/TechnoSpamErrorBoundary.js +2 -2
  56. package/dist/technospam/components/TechnoSpamErrorBoundary.js.map +1 -1
  57. package/dist/technospam/components/editor/CodeEditor.d.ts +26 -0
  58. package/dist/technospam/components/editor/CodeEditor.d.ts.map +1 -0
  59. package/dist/technospam/components/editor/CodeEditor.js +102 -0
  60. package/dist/technospam/components/editor/CodeEditor.js.map +1 -0
  61. package/dist/technospam/components/editor/RunOutputPanel.d.ts +14 -0
  62. package/dist/technospam/components/editor/RunOutputPanel.d.ts.map +1 -0
  63. package/dist/technospam/components/editor/RunOutputPanel.js +127 -0
  64. package/dist/technospam/components/editor/RunOutputPanel.js.map +1 -0
  65. package/dist/technospam/components/editor/editorLanguages.d.ts +11 -0
  66. package/dist/technospam/components/editor/editorLanguages.d.ts.map +1 -0
  67. package/dist/technospam/components/editor/editorLanguages.js +30 -0
  68. package/dist/technospam/components/editor/editorLanguages.js.map +1 -0
  69. package/dist/technospam/components/editor/editorTheme.d.ts +11 -0
  70. package/dist/technospam/components/editor/editorTheme.d.ts.map +1 -0
  71. package/dist/technospam/components/editor/editorTheme.js +120 -0
  72. package/dist/technospam/components/editor/editorTheme.js.map +1 -0
  73. package/dist/technospam/hooks/useSolutionRunner.d.ts +35 -0
  74. package/dist/technospam/hooks/useSolutionRunner.d.ts.map +1 -0
  75. package/dist/technospam/hooks/useSolutionRunner.js +66 -0
  76. package/dist/technospam/hooks/useSolutionRunner.js.map +1 -0
  77. package/dist/technospam/hooks/useTechnoSpamAnalytics.d.ts +1 -1
  78. package/dist/technospam/hooks/useTechnoSpamAnalytics.d.ts.map +1 -1
  79. package/dist/technospam/hooks/useTechnoSpamAnalytics.js.map +1 -1
  80. package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.d.ts.map +1 -1
  81. package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js +416 -263
  82. package/dist/technospam/pages/ApplicationsProblemDetailsPagePage.js.map +1 -1
  83. package/package.json +14 -4
@@ -0,0 +1,957 @@
1
+ import { EditorState as e, Facet as t, Prec as n, RangeSetBuilder as r, StateEffect as i, StateField as a, combineConfig as o, countColumn as s } from "../../state/dist/index.js";
2
+ import { StyleModule as c } from "../../../style-mod/src/style-mod.js";
3
+ import { Decoration as l, Direction as u, EditorView as d, ViewPlugin as f, logException as ee } from "../../view/dist/index.js";
4
+ import { IterMode as te, NodeProp as p, NodeSet as ne, NodeType as m, Parser as re, Tree as h, TreeFragment as g } from "../../../@lezer/common/dist/index.js";
5
+ import { highlightTree as ie, styleTags as ae, tagHighlighter as oe, tags as _ } from "../../../@lezer/highlight/dist/index.js";
6
+ import { StringStream as se } from "../../streamparser/dist/index.js";
7
+ //#region node_modules/@codemirror/language/dist/index.js
8
+ var v = /* @__PURE__ */ new p();
9
+ function y(e) {
10
+ return t.define({ combine: e ? (t) => t.concat(e) : void 0 });
11
+ }
12
+ var b = /* @__PURE__ */ new p(), x = class {
13
+ constructor(t, n, r = [], i = "") {
14
+ this.data = t, this.name = i, e.prototype.hasOwnProperty("tree") || Object.defineProperty(e.prototype, "tree", { get() {
15
+ return C(this);
16
+ } }), this.parser = n, this.extension = [O.of(this), e.languageData.of((e, t, n) => {
17
+ let r = S(e, t, n), i = r.type.prop(v);
18
+ if (!i) return [];
19
+ let a = e.facet(i), o = r.type.prop(b);
20
+ if (o) {
21
+ let i = r.resolve(t - r.from, n);
22
+ for (let t of o) if (t.test(i, e)) {
23
+ let n = e.facet(t.facet);
24
+ return t.type == "replace" ? n : n.concat(a);
25
+ }
26
+ }
27
+ return a;
28
+ })].concat(r);
29
+ }
30
+ isActiveAt(e, t, n = -1) {
31
+ return S(e, t, n).type.prop(v) == this.data;
32
+ }
33
+ findRegions(e) {
34
+ let t = e.facet(O);
35
+ if (t?.data == this.data) return [{
36
+ from: 0,
37
+ to: e.doc.length
38
+ }];
39
+ if (!t || !t.allowsNesting) return [];
40
+ let n = [], r = (e, t) => {
41
+ if (e.prop(v) == this.data) {
42
+ n.push({
43
+ from: t,
44
+ to: t + e.length
45
+ });
46
+ return;
47
+ }
48
+ let i = e.prop(p.mounted);
49
+ if (i) {
50
+ if (i.tree.prop(v) == this.data) {
51
+ if (i.overlay) for (let e of i.overlay) n.push({
52
+ from: e.from + t,
53
+ to: e.to + t
54
+ });
55
+ else n.push({
56
+ from: t,
57
+ to: t + e.length
58
+ });
59
+ return;
60
+ } else if (i.overlay) {
61
+ let e = n.length;
62
+ if (r(i.tree, i.overlay[0].from + t), n.length > e) return;
63
+ }
64
+ }
65
+ for (let n = 0; n < e.children.length; n++) {
66
+ let i = e.children[n];
67
+ i instanceof h && r(i, e.positions[n] + t);
68
+ }
69
+ };
70
+ return r(C(e), 0), n;
71
+ }
72
+ get allowsNesting() {
73
+ return !0;
74
+ }
75
+ };
76
+ x.setState = /* @__PURE__ */ i.define();
77
+ function S(e, t, n) {
78
+ let r = e.facet(O), i = C(e).topNode;
79
+ if (!r || r.allowsNesting) for (let e = i; e; e = e.enter(t, n, te.ExcludeBuffers | te.EnterBracketed)) e.type.isTop && (i = e);
80
+ return i;
81
+ }
82
+ var ce = class e extends x {
83
+ constructor(e, t, n) {
84
+ super(e, t, [], n), this.parser = t;
85
+ }
86
+ static define(t) {
87
+ let n = y(t.languageData);
88
+ return new e(n, t.parser.configure({ props: [v.add((e) => e.isTop ? n : void 0)] }), t.name);
89
+ }
90
+ configure(t, n) {
91
+ return new e(this.data, this.parser.configure(t), n || this.name);
92
+ }
93
+ get allowsNesting() {
94
+ return this.parser.hasWrappers();
95
+ }
96
+ };
97
+ function C(e) {
98
+ let t = e.field(x.state, !1);
99
+ return t ? t.tree : h.empty;
100
+ }
101
+ var le = class {
102
+ constructor(e) {
103
+ this.doc = e, this.cursorPos = 0, this.string = "", this.cursor = e.iter();
104
+ }
105
+ get length() {
106
+ return this.doc.length;
107
+ }
108
+ syncTo(e) {
109
+ return this.string = this.cursor.next(e - this.cursorPos).value, this.cursorPos = e + this.string.length, this.cursorPos - this.string.length;
110
+ }
111
+ chunk(e) {
112
+ return this.syncTo(e), this.string;
113
+ }
114
+ get lineChunks() {
115
+ return !0;
116
+ }
117
+ read(e, t) {
118
+ let n = this.cursorPos - this.string.length;
119
+ return e < n || t >= this.cursorPos ? this.doc.sliceString(e, t) : this.string.slice(e - n, t - n);
120
+ }
121
+ }, w = null, T = class e {
122
+ constructor(e, t, n = [], r, i, a, o, s) {
123
+ this.parser = e, this.state = t, this.fragments = n, this.tree = r, this.treeLen = i, this.viewport = a, this.skipped = o, this.scheduleOn = s, this.parse = null, this.tempSkipped = [];
124
+ }
125
+ static create(t, n, r) {
126
+ return new e(t, n, [], h.empty, 0, r, [], null);
127
+ }
128
+ startParse() {
129
+ return this.parser.startParse(new le(this.state.doc), this.fragments);
130
+ }
131
+ work(e, t) {
132
+ return t != null && t >= this.state.doc.length && (t = void 0), this.tree != h.empty && this.isDone(t ?? this.state.doc.length) ? (this.takeTree(), !0) : this.withContext(() => {
133
+ if (typeof e == "number") {
134
+ let t = Date.now() + e;
135
+ e = () => Date.now() > t;
136
+ }
137
+ for (this.parse ||= this.startParse(), t != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > t) && t < this.state.doc.length && this.parse.stopAt(t);;) {
138
+ let n = this.parse.advance();
139
+ if (n) if (this.fragments = this.withoutTempSkipped(g.addTree(n, this.fragments, this.parse.stoppedAt != null)), this.treeLen = this.parse.stoppedAt ?? this.state.doc.length, this.tree = n, this.parse = null, this.treeLen < (t ?? this.state.doc.length)) this.parse = this.startParse();
140
+ else return !0;
141
+ if (e()) return !1;
142
+ }
143
+ });
144
+ }
145
+ takeTree() {
146
+ let e, t;
147
+ this.parse && (e = this.parse.parsedPos) >= this.treeLen && ((this.parse.stoppedAt == null || this.parse.stoppedAt > e) && this.parse.stopAt(e), this.withContext(() => {
148
+ for (; !(t = this.parse.advance()););
149
+ }), this.treeLen = e, this.tree = t, this.fragments = this.withoutTempSkipped(g.addTree(this.tree, this.fragments, !0)), this.parse = null);
150
+ }
151
+ withContext(e) {
152
+ let t = w;
153
+ w = this;
154
+ try {
155
+ return e();
156
+ } finally {
157
+ w = t;
158
+ }
159
+ }
160
+ withoutTempSkipped(e) {
161
+ for (let t; t = this.tempSkipped.pop();) e = ue(e, t.from, t.to);
162
+ return e;
163
+ }
164
+ changes(t, n) {
165
+ let { fragments: r, tree: i, treeLen: a, viewport: o, skipped: s } = this;
166
+ if (this.takeTree(), !t.empty) {
167
+ let e = [];
168
+ if (t.iterChangedRanges((t, n, r, i) => e.push({
169
+ fromA: t,
170
+ toA: n,
171
+ fromB: r,
172
+ toB: i
173
+ })), r = g.applyChanges(r, e), i = h.empty, a = 0, o = {
174
+ from: t.mapPos(o.from, -1),
175
+ to: t.mapPos(o.to, 1)
176
+ }, this.skipped.length) {
177
+ s = [];
178
+ for (let e of this.skipped) {
179
+ let n = t.mapPos(e.from, 1), r = t.mapPos(e.to, -1);
180
+ n < r && s.push({
181
+ from: n,
182
+ to: r
183
+ });
184
+ }
185
+ }
186
+ }
187
+ return new e(this.parser, n, r, i, a, o, s, this.scheduleOn);
188
+ }
189
+ updateViewport(e) {
190
+ if (this.viewport.from == e.from && this.viewport.to == e.to) return !1;
191
+ this.viewport = e;
192
+ let t = this.skipped.length;
193
+ for (let t = 0; t < this.skipped.length; t++) {
194
+ let { from: n, to: r } = this.skipped[t];
195
+ n < e.to && r > e.from && (this.fragments = ue(this.fragments, n, r), this.skipped.splice(t--, 1));
196
+ }
197
+ return this.skipped.length >= t ? !1 : (this.reset(), !0);
198
+ }
199
+ reset() {
200
+ this.parse &&= (this.takeTree(), null);
201
+ }
202
+ skipUntilInView(e, t) {
203
+ this.skipped.push({
204
+ from: e,
205
+ to: t
206
+ });
207
+ }
208
+ static getSkippingParser(e) {
209
+ return new class extends re {
210
+ createParse(t, n, r) {
211
+ let i = r[0].from, a = r[r.length - 1].to;
212
+ return {
213
+ parsedPos: i,
214
+ advance() {
215
+ let t = w;
216
+ if (t) {
217
+ for (let e of r) t.tempSkipped.push(e);
218
+ e && (t.scheduleOn = t.scheduleOn ? Promise.all([t.scheduleOn, e]) : e);
219
+ }
220
+ return this.parsedPos = a, new h(m.none, [], [], a - i);
221
+ },
222
+ stoppedAt: null,
223
+ stopAt() {}
224
+ };
225
+ }
226
+ }();
227
+ }
228
+ isDone(e) {
229
+ e = Math.min(e, this.state.doc.length);
230
+ let t = this.fragments;
231
+ return this.treeLen >= e && t.length && t[0].from == 0 && t[0].to >= e;
232
+ }
233
+ static get() {
234
+ return w;
235
+ }
236
+ };
237
+ function ue(e, t, n) {
238
+ return g.applyChanges(e, [{
239
+ fromA: t,
240
+ toA: n,
241
+ fromB: t,
242
+ toB: n
243
+ }]);
244
+ }
245
+ var E = class e {
246
+ constructor(e) {
247
+ this.context = e, this.tree = e.tree;
248
+ }
249
+ apply(t) {
250
+ if (!t.docChanged && this.tree == this.context.tree) return this;
251
+ let n = this.context.changes(t.changes, t.state), r = this.context.treeLen == t.startState.doc.length ? void 0 : Math.max(t.changes.mapPos(this.context.treeLen), n.viewport.to);
252
+ return n.work(20, r) || n.takeTree(), new e(n);
253
+ }
254
+ static init(t) {
255
+ let n = Math.min(3e3, t.doc.length), r = T.create(t.facet(O).parser, t, {
256
+ from: 0,
257
+ to: n
258
+ });
259
+ return r.work(20, n) || r.takeTree(), new e(r);
260
+ }
261
+ };
262
+ x.state = /* @__PURE__ */ a.define({
263
+ create: E.init,
264
+ update(e, t) {
265
+ for (let e of t.effects) if (e.is(x.setState)) return e.value;
266
+ return t.startState.facet(O) == t.state.facet(O) ? e.apply(t) : E.init(t.state);
267
+ }
268
+ });
269
+ var de = (e) => {
270
+ let t = setTimeout(() => e(), 500);
271
+ return () => clearTimeout(t);
272
+ };
273
+ typeof requestIdleCallback < "u" && (de = (e) => {
274
+ let t = -1, n = setTimeout(() => {
275
+ t = requestIdleCallback(e, { timeout: 400 });
276
+ }, 100);
277
+ return () => t < 0 ? clearTimeout(n) : cancelIdleCallback(t);
278
+ });
279
+ var D = typeof navigator < "u" && navigator.scheduling?.isInputPending ? () => navigator.scheduling.isInputPending() : null, fe = /* @__PURE__ */ f.fromClass(class {
280
+ constructor(e) {
281
+ this.view = e, this.working = null, this.workScheduled = 0, this.chunkEnd = -1, this.chunkBudget = -1, this.work = this.work.bind(this), this.scheduleWork();
282
+ }
283
+ update(e) {
284
+ let t = this.view.state.field(x.state).context;
285
+ (t.updateViewport(e.view.viewport) || this.view.viewport.to > t.treeLen) && this.scheduleWork(), (e.docChanged || e.selectionSet) && (this.view.hasFocus && (this.chunkBudget += 50), this.scheduleWork()), this.checkAsyncSchedule(t);
286
+ }
287
+ scheduleWork() {
288
+ if (this.working) return;
289
+ let { state: e } = this.view, t = e.field(x.state);
290
+ (t.tree != t.context.tree || !t.context.isDone(e.doc.length)) && (this.working = de(this.work));
291
+ }
292
+ work(e) {
293
+ this.working = null;
294
+ let t = Date.now();
295
+ if (this.chunkEnd < t && (this.chunkEnd < 0 || this.view.hasFocus) && (this.chunkEnd = t + 3e4, this.chunkBudget = 3e3), this.chunkBudget <= 0) return;
296
+ let { state: n, viewport: { to: r } } = this.view, i = n.field(x.state);
297
+ if (i.tree == i.context.tree && i.context.isDone(r + 1e5)) return;
298
+ let a = Date.now() + Math.min(this.chunkBudget, 100, e && !D ? Math.max(25, e.timeRemaining() - 5) : 1e9), o = i.context.treeLen < r && n.doc.length > r + 1e3, s = i.context.work(() => D && D() || Date.now() > a, r + (o ? 0 : 1e5));
299
+ this.chunkBudget -= Date.now() - t, (s || this.chunkBudget <= 0) && (i.context.takeTree(), this.view.dispatch({ effects: x.setState.of(new E(i.context)) })), this.chunkBudget > 0 && !(s && !o) && this.scheduleWork(), this.checkAsyncSchedule(i.context);
300
+ }
301
+ checkAsyncSchedule(e) {
302
+ e.scheduleOn &&= (this.workScheduled++, e.scheduleOn.then(() => this.scheduleWork()).catch((e) => ee(this.view.state, e)).then(() => this.workScheduled--), null);
303
+ }
304
+ destroy() {
305
+ this.working && this.working();
306
+ }
307
+ isWorking() {
308
+ return !!(this.working || this.workScheduled > 0);
309
+ }
310
+ }, { eventHandlers: { focus() {
311
+ this.scheduleWork();
312
+ } } }), O = /* @__PURE__ */ t.define({
313
+ combine(e) {
314
+ return e.length ? e[0] : null;
315
+ },
316
+ enables: (e) => [
317
+ x.state,
318
+ fe,
319
+ d.contentAttributes.compute([e], (t) => {
320
+ let n = t.facet(e);
321
+ return n && n.name ? { "data-language": n.name } : {};
322
+ })
323
+ ]
324
+ }), pe = class {
325
+ constructor(e, t = []) {
326
+ this.language = e, this.support = t, this.extension = [e, t];
327
+ }
328
+ }, me = /* @__PURE__ */ t.define(), k = /* @__PURE__ */ t.define({ combine: (e) => {
329
+ if (!e.length) return " ";
330
+ let t = e[0];
331
+ if (!t || /\S/.test(t) || Array.from(t).some((e) => e != t[0])) throw Error("Invalid indent unit: " + JSON.stringify(e[0]));
332
+ return t;
333
+ } });
334
+ function A(e) {
335
+ let t = e.facet(k);
336
+ return t.charCodeAt(0) == 9 ? e.tabSize * t.length : t.length;
337
+ }
338
+ function j(e, t) {
339
+ let n = "", r = e.tabSize, i = e.facet(k)[0];
340
+ if (i == " ") {
341
+ for (; t >= r;) n += " ", t -= r;
342
+ i = " ";
343
+ }
344
+ for (let e = 0; e < t; e++) n += i;
345
+ return n;
346
+ }
347
+ function M(t, n) {
348
+ t instanceof e && (t = new N(t));
349
+ for (let e of t.state.facet(me)) {
350
+ let r = e(t, n);
351
+ if (r !== void 0) return r;
352
+ }
353
+ let r = C(t.state);
354
+ return r.length >= n ? he(t, r, n) : null;
355
+ }
356
+ var N = class {
357
+ constructor(e, t = {}) {
358
+ this.state = e, this.options = t, this.unit = A(e);
359
+ }
360
+ lineAt(e, t = 1) {
361
+ let n = this.state.doc.lineAt(e), { simulateBreak: r, simulateDoubleBreak: i } = this.options;
362
+ return r != null && r >= n.from && r <= n.to ? i && r == e ? {
363
+ text: "",
364
+ from: e
365
+ } : (t < 0 ? r < e : r <= e) ? {
366
+ text: n.text.slice(r - n.from),
367
+ from: r
368
+ } : {
369
+ text: n.text.slice(0, r - n.from),
370
+ from: n.from
371
+ } : n;
372
+ }
373
+ textAfterPos(e, t = 1) {
374
+ if (this.options.simulateDoubleBreak && e == this.options.simulateBreak) return "";
375
+ let { text: n, from: r } = this.lineAt(e, t);
376
+ return n.slice(e - r, Math.min(n.length, e + 100 - r));
377
+ }
378
+ column(e, t = 1) {
379
+ let { text: n, from: r } = this.lineAt(e, t), i = this.countColumn(n, e - r), a = this.options.overrideIndentation ? this.options.overrideIndentation(r) : -1;
380
+ return a > -1 && (i += a - this.countColumn(n, n.search(/\S|$/))), i;
381
+ }
382
+ countColumn(e, t = e.length) {
383
+ return s(e, this.state.tabSize, t);
384
+ }
385
+ lineIndent(e, t = 1) {
386
+ let { text: n, from: r } = this.lineAt(e, t), i = this.options.overrideIndentation;
387
+ if (i) {
388
+ let e = i(r);
389
+ if (e > -1) return e;
390
+ }
391
+ return this.countColumn(n, n.search(/\S|$/));
392
+ }
393
+ get simulatedBreak() {
394
+ return this.options.simulateBreak || null;
395
+ }
396
+ }, P = /* @__PURE__ */ new p();
397
+ function he(e, t, n) {
398
+ let r = t.resolveStack(n), i = t.resolveInner(n, -1).resolve(n, 0).enterUnfinishedNodesBefore(n);
399
+ if (i != r.node) {
400
+ let e = [];
401
+ for (let t = i; t && !(t.from < r.node.from || t.to > r.node.to || t.from == r.node.from && t.type == r.node.type); t = t.parent) e.push(t);
402
+ for (let t = e.length - 1; t >= 0; t--) r = {
403
+ node: e[t],
404
+ next: r
405
+ };
406
+ }
407
+ return F(r, e, n);
408
+ }
409
+ function F(e, t, n) {
410
+ for (let r = e; r; r = r.next) {
411
+ let e = _e(r.node);
412
+ if (e) return e(ye.create(t, n, r));
413
+ }
414
+ return 0;
415
+ }
416
+ function ge(e) {
417
+ return e.pos == e.options.simulateBreak && e.options.simulateDoubleBreak;
418
+ }
419
+ function _e(e) {
420
+ let t = e.type.prop(P);
421
+ if (t) return t;
422
+ let n = e.firstChild, r;
423
+ if (n && (r = n.type.prop(p.closedBy))) {
424
+ let t = e.lastChild, n = t && r.indexOf(t.name) > -1;
425
+ return (e) => I(e, !0, 1, void 0, n && !ge(e) ? t.from : void 0);
426
+ }
427
+ return e.parent == null ? ve : null;
428
+ }
429
+ function ve() {
430
+ return 0;
431
+ }
432
+ var ye = class e extends N {
433
+ constructor(e, t, n) {
434
+ super(e.state, e.options), this.base = e, this.pos = t, this.context = n;
435
+ }
436
+ get node() {
437
+ return this.context.node;
438
+ }
439
+ static create(t, n, r) {
440
+ return new e(t, n, r);
441
+ }
442
+ get textAfter() {
443
+ return this.textAfterPos(this.pos);
444
+ }
445
+ get baseIndent() {
446
+ return this.baseIndentFor(this.node);
447
+ }
448
+ baseIndentFor(e) {
449
+ let t = this.state.doc.lineAt(e.from);
450
+ for (;;) {
451
+ let n = e.resolve(t.from);
452
+ for (; n.parent && n.parent.from == n.from;) n = n.parent;
453
+ if (be(n, e)) break;
454
+ t = this.state.doc.lineAt(n.from);
455
+ }
456
+ return this.lineIndent(t.from);
457
+ }
458
+ continue() {
459
+ return F(this.context.next, this.base, this.pos);
460
+ }
461
+ };
462
+ function be(e, t) {
463
+ for (let n = t; n; n = n.parent) if (e == n) return !0;
464
+ return !1;
465
+ }
466
+ function xe(e) {
467
+ let t = e.node, n = t.childAfter(t.from), r = t.lastChild;
468
+ if (!n) return null;
469
+ let i = e.options.simulateBreak, a = e.state.doc.lineAt(n.from), o = i == null || i <= a.from ? a.to : Math.min(a.to, i);
470
+ for (let e = n.to;;) {
471
+ let i = t.childAfter(e);
472
+ if (!i || i == r) return null;
473
+ if (!i.type.isSkipped) {
474
+ if (i.from >= o) return null;
475
+ let e = /^ */.exec(a.text.slice(n.to - a.from))[0].length;
476
+ return {
477
+ from: n.from,
478
+ to: n.to + e
479
+ };
480
+ }
481
+ e = i.to;
482
+ }
483
+ }
484
+ function Se({ closing: e, align: t = !0, units: n = 1 }) {
485
+ return (r) => I(r, t, n, e);
486
+ }
487
+ function I(e, t, n, r, i) {
488
+ let a = e.textAfter, o = a.match(/^\s*/)[0].length, s = r && a.slice(o, o + r.length) == r || i == e.pos + o, c = t ? xe(e) : null;
489
+ return c ? s ? e.column(c.from) : e.column(c.to) : e.baseIndent + (s ? 0 : e.unit * n);
490
+ }
491
+ var Ce = (e) => e.baseIndent;
492
+ function we({ except: e, units: t = 1 } = {}) {
493
+ return (n) => {
494
+ let r = e && e.test(n.textAfter);
495
+ return n.baseIndent + (r ? 0 : t * n.unit);
496
+ };
497
+ }
498
+ var Te = 200;
499
+ function Ee() {
500
+ return e.transactionFilter.of((e) => {
501
+ if (!e.docChanged || !e.isUserEvent("input.type") && !e.isUserEvent("input.complete")) return e;
502
+ let t = e.startState.languageDataAt("indentOnInput", e.startState.selection.main.head);
503
+ if (!t.length) return e;
504
+ let n = e.newDoc, { head: r } = e.newSelection.main, i = n.lineAt(r);
505
+ if (r > i.from + Te) return e;
506
+ let a = n.sliceString(i.from, r);
507
+ if (!t.some((e) => e.test(a))) return e;
508
+ let { state: o } = e, s = -1, c = [];
509
+ for (let { head: e } of o.selection.ranges) {
510
+ let t = o.doc.lineAt(e);
511
+ if (t.from == s) continue;
512
+ s = t.from;
513
+ let n = M(o, t.from);
514
+ if (n == null) continue;
515
+ let r = /^\s*/.exec(t.text)[0], i = j(o, n);
516
+ r != i && c.push({
517
+ from: t.from,
518
+ to: t.from + r.length,
519
+ insert: i
520
+ });
521
+ }
522
+ return c.length ? [e, {
523
+ changes: c,
524
+ sequential: !0
525
+ }] : e;
526
+ });
527
+ }
528
+ var De = /* @__PURE__ */ new p();
529
+ function Oe(e) {
530
+ let t = e.firstChild, n = e.lastChild;
531
+ return t && t.to < n.from ? {
532
+ from: t.to,
533
+ to: n.type.isError ? e.to : n.from
534
+ } : null;
535
+ }
536
+ var L = class e {
537
+ constructor(e, t) {
538
+ this.specs = e;
539
+ let n;
540
+ function r(e) {
541
+ let t = c.newName();
542
+ return (n ||= Object.create(null))["." + t] = e, t;
543
+ }
544
+ let i = typeof t.all == "string" ? t.all : t.all ? r(t.all) : void 0, a = t.scope;
545
+ this.scope = a instanceof x ? (e) => e.prop(v) == a.data : a ? (e) => e == a : void 0, this.style = oe(e.map((e) => ({
546
+ tag: e.tag,
547
+ class: e.class || r(Object.assign({}, e, { tag: null }))
548
+ })), { all: i }).style, this.module = n ? new c(n) : null, this.themeType = t.themeType;
549
+ }
550
+ static define(t, n) {
551
+ return new e(t, n || {});
552
+ }
553
+ }, R = /* @__PURE__ */ t.define(), z = /* @__PURE__ */ t.define({ combine(e) {
554
+ return e.length ? [e[0]] : null;
555
+ } });
556
+ function B(e) {
557
+ let t = e.facet(R);
558
+ return t.length ? t : e.facet(z);
559
+ }
560
+ function ke(e, t) {
561
+ let n = [je], r;
562
+ return e instanceof L && (e.module && n.push(d.styleModule.of(e.module)), r = e.themeType), t?.fallback ? n.push(z.of(e)) : r ? n.push(R.computeN([d.darkTheme], (t) => t.facet(d.darkTheme) == (r == "dark") ? [e] : [])) : n.push(R.of(e)), n;
563
+ }
564
+ var Ae = class {
565
+ constructor(e) {
566
+ this.markCache = Object.create(null), this.tree = C(e.state), this.decorations = this.buildDeco(e, B(e.state)), this.decoratedTo = e.viewport.to;
567
+ }
568
+ update(e) {
569
+ let t = C(e.state), n = B(e.state), r = n != B(e.startState), { viewport: i } = e.view, a = e.changes.mapPos(this.decoratedTo, 1);
570
+ t.length < i.to && !r && t.type == this.tree.type && a >= i.to ? (this.decorations = this.decorations.map(e.changes), this.decoratedTo = a) : (t != this.tree || e.viewportChanged || r) && (this.tree = t, this.decorations = this.buildDeco(e.view, n), this.decoratedTo = i.to);
571
+ }
572
+ buildDeco(e, t) {
573
+ if (!t || !this.tree.length) return l.none;
574
+ let n = new r();
575
+ for (let { from: r, to: i } of e.visibleRanges) ie(this.tree, t, (e, t, r) => {
576
+ n.add(e, t, this.markCache[r] || (this.markCache[r] = l.mark({ class: r })));
577
+ }, r, i);
578
+ return n.finish();
579
+ }
580
+ }, je = /* @__PURE__ */ n.high(/* @__PURE__ */ f.fromClass(Ae, { decorations: (e) => e.decorations }));
581
+ _.meta, _.link, _.heading, _.emphasis, _.strong, _.strikethrough, _.keyword, _.atom, _.bool, _.url, _.contentSeparator, _.labelName, _.literal, _.inserted, _.string, _.deleted, _.regexp, _.escape, _.string, _.variableName, _.variableName, _.typeName, _.namespace, _.className, _.variableName, _.macroName, _.propertyName, _.comment, _.invalid;
582
+ var Me = /* @__PURE__ */ d.baseTheme({
583
+ "&.cm-focused .cm-matchingBracket": { backgroundColor: "#328c8252" },
584
+ "&.cm-focused .cm-nonmatchingBracket": { backgroundColor: "#bb555544" }
585
+ }), V = 1e4, H = "()[]{}", U = /* @__PURE__ */ t.define({ combine(e) {
586
+ return o(e, {
587
+ afterCursor: !0,
588
+ brackets: H,
589
+ maxScanDistance: V,
590
+ renderMatch: Fe
591
+ });
592
+ } }), Ne = /* @__PURE__ */ l.mark({ class: "cm-matchingBracket" }), Pe = /* @__PURE__ */ l.mark({ class: "cm-nonmatchingBracket" });
593
+ function Fe(e) {
594
+ let t = [], n = e.matched ? Ne : Pe;
595
+ return t.push(n.range(e.start.from, e.start.to)), e.end && t.push(n.range(e.end.from, e.end.to)), t;
596
+ }
597
+ function W(e) {
598
+ let t = [], n = e.facet(U);
599
+ for (let r of e.selection.ranges) {
600
+ if (!r.empty) continue;
601
+ let i = q(e, r.head, -1, n) || r.head > 0 && q(e, r.head - 1, 1, n) || n.afterCursor && (q(e, r.head, 1, n) || r.head < e.doc.length && q(e, r.head + 1, -1, n));
602
+ i && (t = t.concat(n.renderMatch(i, e)));
603
+ }
604
+ return l.set(t, !0);
605
+ }
606
+ var Ie = [/* @__PURE__ */ f.fromClass(class {
607
+ constructor(e) {
608
+ this.paused = !1, this.decorations = W(e.state);
609
+ }
610
+ update(e) {
611
+ (e.docChanged || e.selectionSet || this.paused) && (e.view.composing ? (this.decorations = this.decorations.map(e.changes), this.paused = !0) : (this.decorations = W(e.state), this.paused = !1));
612
+ }
613
+ }, { decorations: (e) => e.decorations }), Me];
614
+ function Le(e = {}) {
615
+ return [U.of(e), Ie];
616
+ }
617
+ var Re = /* @__PURE__ */ new p();
618
+ function G(e, t, n) {
619
+ let r = e.prop(t < 0 ? p.openedBy : p.closedBy);
620
+ if (r) return r;
621
+ if (e.name.length == 1) {
622
+ let r = n.indexOf(e.name);
623
+ if (r > -1 && r % 2 == +(t < 0)) return [n[r + t]];
624
+ }
625
+ return null;
626
+ }
627
+ function K(e) {
628
+ let t = e.type.prop(Re);
629
+ return t ? t(e.node) : e;
630
+ }
631
+ function q(e, t, n, r = {}) {
632
+ let i = r.maxScanDistance || V, a = r.brackets || H, o = C(e), s = o.resolveInner(t, n);
633
+ for (let r = s; r; r = r.parent) {
634
+ let i = G(r.type, n, a);
635
+ if (i && r.from < r.to) {
636
+ let o = K(r);
637
+ if (o && (n > 0 ? t >= o.from && t < o.to : t > o.from && t <= o.to)) return ze(e, t, n, r, o, i, a);
638
+ }
639
+ }
640
+ return Be(e, t, n, o, s.type, i, a);
641
+ }
642
+ function ze(e, t, n, r, i, a, o) {
643
+ let s = r.parent, c = {
644
+ from: i.from,
645
+ to: i.to
646
+ }, l = 0, u = s?.cursor();
647
+ if (u && (n < 0 ? u.childBefore(r.from) : u.childAfter(r.to))) do
648
+ if (n < 0 ? u.to <= r.from : u.from >= r.to) {
649
+ if (l == 0 && a.indexOf(u.type.name) > -1 && u.from < u.to) {
650
+ let e = K(u);
651
+ return {
652
+ start: c,
653
+ end: e ? {
654
+ from: e.from,
655
+ to: e.to
656
+ } : void 0,
657
+ matched: !0
658
+ };
659
+ } else if (G(u.type, n, o)) l++;
660
+ else if (G(u.type, -n, o)) {
661
+ if (l == 0) {
662
+ let e = K(u);
663
+ return {
664
+ start: c,
665
+ end: e && e.from < e.to ? {
666
+ from: e.from,
667
+ to: e.to
668
+ } : void 0,
669
+ matched: !1
670
+ };
671
+ }
672
+ l--;
673
+ }
674
+ }
675
+ while (n < 0 ? u.prevSibling() : u.nextSibling());
676
+ return {
677
+ start: c,
678
+ matched: !1
679
+ };
680
+ }
681
+ function Be(e, t, n, r, i, a, o) {
682
+ if (n < 0 ? !t : t == e.doc.length) return null;
683
+ let s = n < 0 ? e.sliceDoc(t - 1, t) : e.sliceDoc(t, t + 1), c = o.indexOf(s);
684
+ if (c < 0 || c % 2 == 0 != n > 0) return null;
685
+ let l = {
686
+ from: n < 0 ? t - 1 : t,
687
+ to: n > 0 ? t + 1 : t
688
+ }, u = e.doc.iterRange(t, n > 0 ? e.doc.length : 0), d = 0;
689
+ for (let e = 0; !u.next().done && e <= a;) {
690
+ let a = u.value;
691
+ n < 0 && (e += a.length);
692
+ let s = t + e * n;
693
+ for (let e = n > 0 ? 0 : a.length - 1, t = n > 0 ? a.length : -1; e != t; e += n) {
694
+ let t = o.indexOf(a[e]);
695
+ if (!(t < 0 || r.resolveInner(s + e, 1).type != i)) if (t % 2 == 0 == n > 0) d++;
696
+ else if (d == 1) return {
697
+ start: l,
698
+ end: {
699
+ from: s + e,
700
+ to: s + e + 1
701
+ },
702
+ matched: t >> 1 == c >> 1
703
+ };
704
+ else d--;
705
+ }
706
+ n > 0 && (e += a.length);
707
+ }
708
+ return u.done ? {
709
+ start: l,
710
+ matched: !1
711
+ } : null;
712
+ }
713
+ function Ve(e) {
714
+ return {
715
+ name: e.name || "",
716
+ token: e.token,
717
+ blankLine: e.blankLine || (() => {}),
718
+ startState: e.startState || (() => !0),
719
+ copyState: e.copyState || He,
720
+ indent: e.indent || (() => null),
721
+ languageData: e.languageData || {},
722
+ tokenTable: e.tokenTable || X,
723
+ mergeTokens: e.mergeTokens !== !1
724
+ };
725
+ }
726
+ function He(e) {
727
+ if (typeof e != "object") return e;
728
+ let t = {};
729
+ for (let n in e) {
730
+ let r = e[n];
731
+ t[n] = r instanceof Array ? r.slice() : r;
732
+ }
733
+ return t;
734
+ }
735
+ var J = /* @__PURE__ */ new WeakMap(), Ue = class e extends x {
736
+ constructor(e) {
737
+ let t = y(e.languageData), n = Ve(e), r, i = new class extends re {
738
+ createParse(e, t, n) {
739
+ return new Ke(r, e, t, n);
740
+ }
741
+ }();
742
+ super(t, i, [], e.name), this.topNode = et(t, this), r = this, this.streamParser = n, this.stateAfter = new p({ perNode: !0 }), this.tokenTable = e.tokenTable ? new Qe(n.tokenTable) : $e;
743
+ }
744
+ static define(t) {
745
+ return new e(t);
746
+ }
747
+ getIndent(e) {
748
+ let t, { overrideIndentation: n } = e.options;
749
+ n && (t = J.get(e.state), t != null && t < e.pos - 1e4 && (t = void 0));
750
+ let r = Y(this, e.node.tree, e.node.from, e.node.from, t ?? e.pos), i, a;
751
+ if (r ? (a = r.state, i = r.pos + 1) : (a = this.streamParser.startState(e.unit), i = e.node.from), e.pos - i > 1e4) return null;
752
+ for (; i < e.pos;) {
753
+ let t = e.state.doc.lineAt(i), r = Math.min(e.pos, t.to);
754
+ if (t.length) {
755
+ let i = n ? n(t.from) : -1, o = new se(t.text, e.state.tabSize, e.unit, i < 0 ? void 0 : i);
756
+ for (; o.pos < r - t.from;) qe(this.streamParser.token, o, a);
757
+ } else this.streamParser.blankLine(a, e.unit);
758
+ if (r == e.pos) break;
759
+ i = t.to + 1;
760
+ }
761
+ let o = e.lineAt(e.pos);
762
+ return n && t == null && J.set(e.state, o.from), this.streamParser.indent(a, /^\s*(.*)/.exec(o.text)[1], e);
763
+ }
764
+ get allowsNesting() {
765
+ return !1;
766
+ }
767
+ };
768
+ function Y(e, t, n, r, i) {
769
+ let a = n >= r && n + t.length <= i && t.prop(e.stateAfter);
770
+ if (a) return {
771
+ state: e.streamParser.copyState(a),
772
+ pos: n + t.length
773
+ };
774
+ for (let a = t.children.length - 1; a >= 0; a--) {
775
+ let o = t.children[a], s = n + t.positions[a], c = o instanceof h && s < i && Y(e, o, s, r, i);
776
+ if (c) return c;
777
+ }
778
+ return null;
779
+ }
780
+ function We(e, t, n, r, i) {
781
+ if (i && n <= 0 && r >= t.length) return t;
782
+ !i && n == 0 && t.type == e.topNode && (i = !0);
783
+ for (let a = t.children.length - 1; a >= 0; a--) {
784
+ let o = t.positions[a], s = t.children[a], c;
785
+ if (o < r && s instanceof h) {
786
+ if (!(c = We(e, s, n - o, r - o, i))) break;
787
+ return i ? new h(t.type, t.children.slice(0, a).concat(c), t.positions.slice(0, a + 1), o + c.length) : c;
788
+ }
789
+ }
790
+ return null;
791
+ }
792
+ function Ge(e, t, n, r, i) {
793
+ for (let i of t) {
794
+ let t = i.from + (i.openStart ? 25 : 0), a = i.to - (i.openEnd ? 25 : 0), o = t <= n && a > n && Y(e, i.tree, 0 - i.offset, n, a), s;
795
+ if (o && o.pos <= r && (s = We(e, i.tree, n + i.offset, o.pos + i.offset, !1))) return {
796
+ state: o.state,
797
+ tree: s
798
+ };
799
+ }
800
+ return {
801
+ state: e.streamParser.startState(i ? A(i) : 4),
802
+ tree: h.empty
803
+ };
804
+ }
805
+ var Ke = class {
806
+ constructor(e, t, n, r) {
807
+ this.lang = e, this.input = t, this.fragments = n, this.ranges = r, this.stoppedAt = null, this.chunks = [], this.chunkPos = [], this.chunk = [], this.chunkReused = void 0, this.rangeIndex = 0, this.to = r[r.length - 1].to;
808
+ let i = T.get(), a = r[0].from, { state: o, tree: s } = Ge(e, n, a, this.to, i?.state);
809
+ this.state = o, this.parsedPos = this.chunkStart = a + s.length;
810
+ for (let e = 0; e < s.children.length; e++) this.chunks.push(s.children[e]), this.chunkPos.push(s.positions[e]);
811
+ i && this.parsedPos < i.viewport.from - 1e5 && r.some((e) => e.from <= i.viewport.from && e.to >= i.viewport.from) && (this.state = this.lang.streamParser.startState(A(i.state)), i.skipUntilInView(this.parsedPos, i.viewport.from), this.parsedPos = i.viewport.from), this.moveRangeIndex();
812
+ }
813
+ advance() {
814
+ let e = T.get(), t = this.stoppedAt == null ? this.to : Math.min(this.to, this.stoppedAt), n = Math.min(t, this.chunkStart + 512);
815
+ for (e && (n = Math.min(n, e.viewport.to)); this.parsedPos < n;) this.parseLine(e);
816
+ return this.chunkStart < this.parsedPos && this.finishChunk(), this.parsedPos >= t ? this.finish() : e && this.parsedPos >= e.viewport.to ? (e.skipUntilInView(this.parsedPos, t), this.finish()) : null;
817
+ }
818
+ stopAt(e) {
819
+ this.stoppedAt = e;
820
+ }
821
+ lineAfter(e) {
822
+ let t = this.input.chunk(e);
823
+ if (this.input.lineChunks) t == "\n" && (t = "");
824
+ else {
825
+ let e = t.indexOf("\n");
826
+ e > -1 && (t = t.slice(0, e));
827
+ }
828
+ return e + t.length <= this.to ? t : t.slice(0, this.to - e);
829
+ }
830
+ nextLine() {
831
+ let e = this.parsedPos, t = this.lineAfter(e), n = e + t.length;
832
+ for (let e = this.rangeIndex;;) {
833
+ let r = this.ranges[e].to;
834
+ if (r >= n || (t = t.slice(0, r - (n - t.length)), e++, e == this.ranges.length)) break;
835
+ let i = this.ranges[e].from, a = this.lineAfter(i);
836
+ t += a, n = i + a.length;
837
+ }
838
+ return {
839
+ line: t,
840
+ end: n
841
+ };
842
+ }
843
+ skipGapsTo(e, t, n) {
844
+ for (;;) {
845
+ let r = this.ranges[this.rangeIndex].to, i = e + t;
846
+ if (n > 0 ? r > i : r >= i) break;
847
+ let a = this.ranges[++this.rangeIndex].from;
848
+ t += a - r;
849
+ }
850
+ return t;
851
+ }
852
+ moveRangeIndex() {
853
+ for (; this.ranges[this.rangeIndex].to < this.parsedPos;) this.rangeIndex++;
854
+ }
855
+ emitToken(e, t, n, r) {
856
+ let i = 4;
857
+ if (this.ranges.length > 1) {
858
+ r = this.skipGapsTo(t, r, 1), t += r;
859
+ let e = this.chunk.length;
860
+ r = this.skipGapsTo(n, r, -1), n += r, i += this.chunk.length - e;
861
+ }
862
+ let a = this.chunk.length - 4;
863
+ return this.lang.streamParser.mergeTokens && i == 4 && a >= 0 && this.chunk[a] == e && this.chunk[a + 2] == t ? this.chunk[a + 2] = n : this.chunk.push(e, t, n, i), r;
864
+ }
865
+ parseLine(e) {
866
+ let { line: t, end: n } = this.nextLine(), r = 0, { streamParser: i } = this.lang, a = new se(t, e ? e.state.tabSize : 4, e ? A(e.state) : 2);
867
+ if (a.eol()) i.blankLine(this.state, a.indentUnit);
868
+ else for (; !a.eol();) {
869
+ let e = qe(i.token, a, this.state);
870
+ if (e && (r = this.emitToken(this.lang.tokenTable.resolve(e), this.parsedPos + a.start, this.parsedPos + a.pos, r)), a.start > 1e4) break;
871
+ }
872
+ this.parsedPos = n, this.moveRangeIndex(), this.parsedPos < this.to && this.parsedPos++;
873
+ }
874
+ finishChunk() {
875
+ let e = h.build({
876
+ buffer: this.chunk,
877
+ start: this.chunkStart,
878
+ length: this.parsedPos - this.chunkStart,
879
+ nodeSet: Je,
880
+ topID: 0,
881
+ maxBufferLength: 512,
882
+ reused: this.chunkReused
883
+ });
884
+ e = new h(e.type, e.children, e.positions, e.length, [[this.lang.stateAfter, this.lang.streamParser.copyState(this.state)]]), this.chunks.push(e), this.chunkPos.push(this.chunkStart - this.ranges[0].from), this.chunk = [], this.chunkReused = void 0, this.chunkStart = this.parsedPos;
885
+ }
886
+ finish() {
887
+ return new h(this.lang.topNode, this.chunks, this.chunkPos, this.parsedPos - this.ranges[0].from).balance();
888
+ }
889
+ };
890
+ function qe(e, t, n) {
891
+ t.start = t.pos;
892
+ for (let r = 0; r < 10; r++) {
893
+ let r = e(t, n);
894
+ if (t.pos > t.start) return r;
895
+ }
896
+ throw Error("Stream parser failed to advance stream.");
897
+ }
898
+ var X = /* @__PURE__ */ Object.create(null), Z = [m.none], Je = /* @__PURE__ */ new ne(Z), Ye = [], Xe = /* @__PURE__ */ Object.create(null), Ze = /* @__PURE__ */ Object.create(null);
899
+ for (let [e, t] of [
900
+ ["variable", "variableName"],
901
+ ["variable-2", "variableName.special"],
902
+ ["string-2", "string.special"],
903
+ ["def", "variableName.definition"],
904
+ ["tag", "tagName"],
905
+ ["attribute", "attributeName"],
906
+ ["type", "typeName"],
907
+ ["builtin", "variableName.standard"],
908
+ ["qualifier", "modifier"],
909
+ ["error", "invalid"],
910
+ ["header", "heading"],
911
+ ["property", "propertyName"]
912
+ ]) Ze[e] = /* @__PURE__ */ $(X, t);
913
+ var Qe = class {
914
+ constructor(e) {
915
+ this.extra = e, this.table = Object.assign(Object.create(null), Ze);
916
+ }
917
+ resolve(e) {
918
+ return e ? this.table[e] || (this.table[e] = $(this.extra, e)) : 0;
919
+ }
920
+ }, $e = /* @__PURE__ */ new Qe(X);
921
+ function Q(e, t) {
922
+ Ye.indexOf(e) > -1 || (Ye.push(e), console.warn(t));
923
+ }
924
+ function $(e, t) {
925
+ let n = [];
926
+ for (let r of t.split(" ")) {
927
+ let t = [];
928
+ for (let n of r.split(".")) {
929
+ let r = e[n] || _[n];
930
+ r ? typeof r == "function" ? t.length ? t = t.map(r) : Q(n, `Modifier ${n} used at start of tag`) : t.length ? Q(n, `Tag ${n} used as modifier`) : t = Array.isArray(r) ? r : [r] : Q(n, `Unknown highlighting tag ${n}`);
931
+ }
932
+ for (let e of t) n.push(e);
933
+ }
934
+ if (!n.length) return 0;
935
+ let r = t.replace(/ /g, "_"), i = r + " " + n.map((e) => e.id), a = Xe[i];
936
+ if (a) return a.id;
937
+ let o = Xe[i] = m.define({
938
+ id: Z.length,
939
+ name: r,
940
+ props: [ae({ [r]: n })]
941
+ });
942
+ return Z.push(o), o.id;
943
+ }
944
+ function et(e, t) {
945
+ let n = m.define({
946
+ id: Z.length,
947
+ name: "Document",
948
+ props: [v.add(() => e), P.add(() => (e) => t.getIndent(e))],
949
+ top: !0
950
+ });
951
+ return Z.push(n), n;
952
+ }
953
+ u.RTL, u.LTR;
954
+ //#endregion
955
+ export { L as HighlightStyle, N as IndentContext, ce as LRLanguage, pe as LanguageSupport, Ue as StreamLanguage, Le as bracketMatching, we as continuedIndent, y as defineLanguageFacet, Se as delimitedIndent, Ce as flatIndent, Oe as foldInside, De as foldNodeProp, A as getIndentUnit, M as getIndentation, P as indentNodeProp, Ee as indentOnInput, j as indentString, k as indentUnit, q as matchBrackets, b as sublanguageProp, ke as syntaxHighlighting, C as syntaxTree };
956
+
957
+ //# sourceMappingURL=index.js.map