@vibecheck-ai/mcp 24.6.9 → 24.6.12

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 (41) hide show
  1. package/README.md +1 -1
  2. package/dist/APITruthEngine-IZRR3NT5-LPFUOMLD.js +9 -0
  3. package/dist/CredentialsEngine-B66ANCBB-HY5ZQTSX.js +9 -0
  4. package/dist/EnvVarEngine-ZFNW2XKP-6HRTZULP.js +9 -0
  5. package/dist/ErrorHandlingEngine-FG65SFRB-4NEANCMF.js +11 -0
  6. package/dist/FrameworkPackEngine-RRBJW4MC-KH7WRXXS.js +12 -0
  7. package/dist/GhostRouteEngine-UMYBCOCL-MSZOPVZY.js +9 -0
  8. package/dist/LogicGapEngine-OK5UKZQ5-YGXZDERB.js +11 -0
  9. package/dist/PhantomDepEngine-5O7Z7MDE-4A37GGL4.js +10 -0
  10. package/dist/SecurityEngine-MVMRPKLH-BNP7IC46.js +9 -0
  11. package/dist/VersionHallucinationEngine-673DJ26J-BD4SK6JX.js +9 -0
  12. package/dist/chokidar-CI5VJY5M.js +2414 -0
  13. package/dist/chunk-43XAAYST.js +863 -0
  14. package/dist/chunk-5DADZJ3D.js +650 -0
  15. package/dist/chunk-DDTUTWRY.js +605 -0
  16. package/dist/chunk-DGNNNAVK.js +304 -0
  17. package/dist/chunk-F34MHA6A.js +772 -0
  18. package/dist/chunk-FGMVY5QW.js +42 -0
  19. package/dist/chunk-FMRX5OVJ.js +1968 -0
  20. package/dist/chunk-FRK2XZX5.js +213309 -0
  21. package/dist/chunk-J52EUKKW.js +196 -0
  22. package/dist/chunk-JZSHXEYP.js +915 -0
  23. package/dist/chunk-LQSBUKYZ.js +551 -0
  24. package/dist/chunk-MUP4JXOF.js +219 -0
  25. package/dist/chunk-NR36RTVO.js +152 -0
  26. package/dist/chunk-QGPX6H6L.js +3044 -0
  27. package/dist/chunk-QYXENOVK.js +499 -0
  28. package/dist/chunk-RR5ETBSV.js +66 -0
  29. package/dist/chunk-WUHPSW7M.js +11130 -0
  30. package/dist/chunk-YWUMPN4Z.js +53 -0
  31. package/dist/dist-HFMJ3GIR.js +1091 -0
  32. package/dist/dist-JUOVMQEA.js +9 -0
  33. package/dist/dist-NXITTS32-O3XLWR6T.js +386 -0
  34. package/dist/dist-Y2Z46SBD.js +22 -0
  35. package/dist/fingerprint-NOJ7TDB6-K6SB7LCZ.js +9 -0
  36. package/dist/index.js +5462 -4676
  37. package/dist/semantic-WW6XVII4.js +8544 -0
  38. package/dist/transformers.node-K4WKH4PR.js +45809 -0
  39. package/dist/tree-sitter-AGICL65I.js +1412 -0
  40. package/dist/tree-sitter-H5E7LKR4-MKO3NNLJ.js +9 -0
  41. package/package.json +7 -6
@@ -0,0 +1,1412 @@
1
+ import { createRequire } from 'module';
2
+ import { fileURLToPath } from 'url';
3
+ import { dirname } from 'path';
4
+ import { __commonJS, __require } from './chunk-YWUMPN4Z.js';
5
+
6
+ createRequire(import.meta.url);
7
+ const __filename$1 = fileURLToPath(import.meta.url);
8
+ const __dirname$1 = dirname(__filename$1);
9
+
10
+ // ../../node_modules/.pnpm/web-tree-sitter@0.22.6/node_modules/web-tree-sitter/tree-sitter.js
11
+ var require_tree_sitter = __commonJS({
12
+ "../../node_modules/.pnpm/web-tree-sitter@0.22.6/node_modules/web-tree-sitter/tree-sitter.js"(exports$1, module) {
13
+ var Module = void 0 !== Module ? Module : {};
14
+ var TreeSitter = (function() {
15
+ var initPromise, document = "object" == typeof window ? { currentScript: window.document.currentScript } : null;
16
+ class Parser {
17
+ constructor() {
18
+ this.initialize();
19
+ }
20
+ initialize() {
21
+ throw new Error("cannot construct a Parser before calling `init()`");
22
+ }
23
+ static init(moduleOptions) {
24
+ return initPromise || (Module = Object.assign({}, Module, moduleOptions), initPromise = new Promise(((resolveInitPromise) => {
25
+ var moduleOverrides = Object.assign({}, Module), arguments_ = [], thisProgram = "./this.program", quit_ = (e, t) => {
26
+ throw t;
27
+ }, ENVIRONMENT_IS_WEB = "object" == typeof window, ENVIRONMENT_IS_WORKER = "function" == typeof importScripts, ENVIRONMENT_IS_NODE = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node, scriptDirectory = "", read_, readAsync, readBinary;
28
+ function locateFile(e) {
29
+ return Module.locateFile ? Module.locateFile(e, scriptDirectory) : scriptDirectory + e;
30
+ }
31
+ if (ENVIRONMENT_IS_NODE) {
32
+ var fs = __require("fs"), nodePath = __require("path");
33
+ scriptDirectory = ENVIRONMENT_IS_WORKER ? nodePath.dirname(scriptDirectory) + "/" : __dirname$1 + "/", read_ = (e, t) => (e = isFileURI(e) ? new URL(e) : nodePath.normalize(e), fs.readFileSync(e, t ? void 0 : "utf8")), readBinary = (e) => {
34
+ var t = read_(e, true);
35
+ return t.buffer || (t = new Uint8Array(t)), t;
36
+ }, readAsync = (e, t, _, s = true) => {
37
+ e = isFileURI(e) ? new URL(e) : nodePath.normalize(e), fs.readFile(e, s ? void 0 : "utf8", ((e2, r) => {
38
+ e2 ? _(e2) : t(s ? r.buffer : r);
39
+ }));
40
+ }, !Module.thisProgram && process.argv.length > 1 && (thisProgram = process.argv[1].replace(/\\/g, "/")), arguments_ = process.argv.slice(2), "undefined" != typeof module && (module.exports = Module), quit_ = (e, t) => {
41
+ throw process.exitCode = e, t;
42
+ };
43
+ } else (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) && (ENVIRONMENT_IS_WORKER ? scriptDirectory = self.location.href : void 0 !== document && document.currentScript && (scriptDirectory = document.currentScript.src), scriptDirectory = scriptDirectory.startsWith("blob:") ? "" : scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1), read_ = (e) => {
44
+ var t = new XMLHttpRequest();
45
+ return t.open("GET", e, false), t.send(null), t.responseText;
46
+ }, ENVIRONMENT_IS_WORKER && (readBinary = (e) => {
47
+ var t = new XMLHttpRequest();
48
+ return t.open("GET", e, false), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response);
49
+ }), readAsync = (e, t, _) => {
50
+ var s = new XMLHttpRequest();
51
+ s.open("GET", e, true), s.responseType = "arraybuffer", s.onload = () => {
52
+ 200 == s.status || 0 == s.status && s.response ? t(s.response) : _();
53
+ }, s.onerror = _, s.send(null);
54
+ });
55
+ var out = Module.print || console.log.bind(console), err = Module.printErr || console.error.bind(console);
56
+ Object.assign(Module, moduleOverrides), moduleOverrides = null, Module.arguments && (arguments_ = Module.arguments), Module.thisProgram && (thisProgram = Module.thisProgram), Module.quit && (quit_ = Module.quit);
57
+ var dynamicLibraries = Module.dynamicLibraries || [], wasmBinary, wasmMemory;
58
+ Module.wasmBinary && (wasmBinary = Module.wasmBinary), "object" != typeof WebAssembly && abort("no native wasm support detected");
59
+ var ABORT = false, EXITSTATUS, HEAP8, HEAPU8, HEAP16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
60
+ function updateMemoryViews() {
61
+ var e = wasmMemory.buffer;
62
+ Module.HEAP8 = HEAP8 = new Int8Array(e), Module.HEAP16 = HEAP16 = new Int16Array(e), Module.HEAPU8 = HEAPU8 = new Uint8Array(e), Module.HEAPU16 = new Uint16Array(e), Module.HEAP32 = HEAP32 = new Int32Array(e), Module.HEAPU32 = HEAPU32 = new Uint32Array(e), Module.HEAPF32 = HEAPF32 = new Float32Array(e), Module.HEAPF64 = HEAPF64 = new Float64Array(e);
63
+ }
64
+ var INITIAL_MEMORY = Module.INITIAL_MEMORY || 33554432;
65
+ wasmMemory = Module.wasmMemory ? Module.wasmMemory : new WebAssembly.Memory({ initial: INITIAL_MEMORY / 65536, maximum: 32768 }), updateMemoryViews(), INITIAL_MEMORY = wasmMemory.buffer.byteLength;
66
+ var __ATPRERUN__ = [], __ATINIT__ = [], __ATMAIN__ = [], __ATPOSTRUN__ = [], __RELOC_FUNCS__ = [], runtimeInitialized = false;
67
+ function preRun() {
68
+ if (Module.preRun) for ("function" == typeof Module.preRun && (Module.preRun = [Module.preRun]); Module.preRun.length; ) addOnPreRun(Module.preRun.shift());
69
+ callRuntimeCallbacks(__ATPRERUN__);
70
+ }
71
+ function initRuntime() {
72
+ runtimeInitialized = true, callRuntimeCallbacks(__RELOC_FUNCS__), callRuntimeCallbacks(__ATINIT__);
73
+ }
74
+ function preMain() {
75
+ callRuntimeCallbacks(__ATMAIN__);
76
+ }
77
+ function postRun() {
78
+ if (Module.postRun) for ("function" == typeof Module.postRun && (Module.postRun = [Module.postRun]); Module.postRun.length; ) addOnPostRun(Module.postRun.shift());
79
+ callRuntimeCallbacks(__ATPOSTRUN__);
80
+ }
81
+ function addOnPreRun(e) {
82
+ __ATPRERUN__.unshift(e);
83
+ }
84
+ function addOnInit(e) {
85
+ __ATINIT__.unshift(e);
86
+ }
87
+ function addOnPostRun(e) {
88
+ __ATPOSTRUN__.unshift(e);
89
+ }
90
+ var runDependencies = 0, dependenciesFulfilled = null;
91
+ function getUniqueRunDependency(e) {
92
+ return e;
93
+ }
94
+ function addRunDependency(e) {
95
+ runDependencies++, Module.monitorRunDependencies?.(runDependencies);
96
+ }
97
+ function removeRunDependency(e) {
98
+ if (runDependencies--, Module.monitorRunDependencies?.(runDependencies), 0 == runDependencies && (dependenciesFulfilled)) {
99
+ var t = dependenciesFulfilled;
100
+ dependenciesFulfilled = null, t();
101
+ }
102
+ }
103
+ function abort(e) {
104
+ throw Module.onAbort?.(e), err(e = "Aborted(" + e + ")"), ABORT = true, EXITSTATUS = 1, e += ". Build with -sASSERTIONS for more info.", new WebAssembly.RuntimeError(e);
105
+ }
106
+ var dataURIPrefix = "data:application/octet-stream;base64,", isDataURI = (e) => e.startsWith(dataURIPrefix), isFileURI = (e) => e.startsWith("file://"), wasmBinaryFile;
107
+ function getBinarySync(e) {
108
+ if (e == wasmBinaryFile && wasmBinary) return new Uint8Array(wasmBinary);
109
+ if (readBinary) return readBinary(e);
110
+ throw "both async and sync fetching of the wasm failed";
111
+ }
112
+ function getBinaryPromise(e) {
113
+ if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
114
+ if ("function" == typeof fetch && !isFileURI(e)) return fetch(e, { credentials: "same-origin" }).then(((t) => {
115
+ if (!t.ok) throw `failed to load wasm binary file at '${e}'`;
116
+ return t.arrayBuffer();
117
+ })).catch((() => getBinarySync(e)));
118
+ if (readAsync) return new Promise(((t, _) => {
119
+ readAsync(e, ((e2) => t(new Uint8Array(e2))), _);
120
+ }));
121
+ }
122
+ return Promise.resolve().then((() => getBinarySync(e)));
123
+ }
124
+ function instantiateArrayBuffer(e, t, _) {
125
+ return getBinaryPromise(e).then(((e2) => WebAssembly.instantiate(e2, t))).then(_, ((e2) => {
126
+ err(`failed to asynchronously prepare wasm: ${e2}`), abort(e2);
127
+ }));
128
+ }
129
+ function instantiateAsync(e, t, _, s) {
130
+ return e || "function" != typeof WebAssembly.instantiateStreaming || isDataURI(t) || isFileURI(t) || ENVIRONMENT_IS_NODE || "function" != typeof fetch ? instantiateArrayBuffer(t, _, s) : fetch(t, { credentials: "same-origin" }).then(((e2) => WebAssembly.instantiateStreaming(e2, _).then(s, (function(e3) {
131
+ return err(`wasm streaming compile failed: ${e3}`), err("falling back to ArrayBuffer instantiation"), instantiateArrayBuffer(t, _, s);
132
+ }))));
133
+ }
134
+ function createWasm() {
135
+ var e = { env: wasmImports, wasi_snapshot_preview1: wasmImports, "GOT.mem": new Proxy(wasmImports, GOTHandler), "GOT.func": new Proxy(wasmImports, GOTHandler) };
136
+ function t(e2, t2) {
137
+ wasmExports = e2.exports, wasmExports = relocateExports(wasmExports, 1024);
138
+ var _ = getDylinkMetadata(t2);
139
+ return _.neededDynlibs && (dynamicLibraries = _.neededDynlibs.concat(dynamicLibraries)), mergeLibSymbols(wasmExports), LDSO.init(), loadDylibs(), addOnInit(wasmExports.__wasm_call_ctors), __RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs), removeRunDependency(), wasmExports;
140
+ }
141
+ if (addRunDependency(), Module.instantiateWasm) try {
142
+ return Module.instantiateWasm(e, t);
143
+ } catch (e2) {
144
+ return err(`Module.instantiateWasm callback failed with error: ${e2}`), false;
145
+ }
146
+ return instantiateAsync(wasmBinary, wasmBinaryFile, e, (function(e2) {
147
+ t(e2.instance, e2.module);
148
+ })), {};
149
+ }
150
+ wasmBinaryFile = "tree-sitter.wasm", isDataURI(wasmBinaryFile) || (wasmBinaryFile = locateFile(wasmBinaryFile));
151
+ function ExitStatus(e) {
152
+ this.name = "ExitStatus", this.message = `Program terminated with exit(${e})`, this.status = e;
153
+ }
154
+ var GOT = {}, currentModuleWeakSymbols = /* @__PURE__ */ new Set([]), GOTHandler = { get(e, t) {
155
+ var _ = GOT[t];
156
+ return _ || (_ = GOT[t] = new WebAssembly.Global({ value: "i32", mutable: true })), currentModuleWeakSymbols.has(t) || (_.required = true), _;
157
+ } }, callRuntimeCallbacks = (e) => {
158
+ for (; e.length > 0; ) e.shift()(Module);
159
+ }, UTF8Decoder = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0, UTF8ArrayToString = (e, t, _) => {
160
+ for (var s = t + _, r = t; e[r] && !(r >= s); ) ++r;
161
+ if (r - t > 16 && e.buffer && UTF8Decoder) return UTF8Decoder.decode(e.subarray(t, r));
162
+ for (var a = ""; t < r; ) {
163
+ var o = e[t++];
164
+ if (128 & o) {
165
+ var n = 63 & e[t++];
166
+ if (192 != (224 & o)) {
167
+ var l = 63 & e[t++];
168
+ if ((o = 224 == (240 & o) ? (15 & o) << 12 | n << 6 | l : (7 & o) << 18 | n << 12 | l << 6 | 63 & e[t++]) < 65536) a += String.fromCharCode(o);
169
+ else {
170
+ var d = o - 65536;
171
+ a += String.fromCharCode(55296 | d >> 10, 56320 | 1023 & d);
172
+ }
173
+ } else a += String.fromCharCode((31 & o) << 6 | n);
174
+ } else a += String.fromCharCode(o);
175
+ }
176
+ return a;
177
+ }, getDylinkMetadata = (e) => {
178
+ var t = 0, _ = 0;
179
+ function s() {
180
+ for (var _2 = 0, s2 = 1; ; ) {
181
+ var r2 = e[t++];
182
+ if (_2 += (127 & r2) * s2, s2 *= 128, !(128 & r2)) break;
183
+ }
184
+ return _2;
185
+ }
186
+ function r() {
187
+ var _2 = s();
188
+ return UTF8ArrayToString(e, (t += _2) - _2, _2);
189
+ }
190
+ function a(e2, t2) {
191
+ if (e2) throw new Error(t2);
192
+ }
193
+ var o = "dylink.0";
194
+ if (e instanceof WebAssembly.Module) {
195
+ var n = WebAssembly.Module.customSections(e, o);
196
+ 0 === n.length && (o = "dylink", n = WebAssembly.Module.customSections(e, o)), a(0 === n.length, "need dylink section"), _ = (e = new Uint8Array(n[0])).length;
197
+ } else {
198
+ a(!(1836278016 == new Uint32Array(new Uint8Array(e.subarray(0, 24)).buffer)[0]), "need to see wasm magic number"), a(0 !== e[8], "need the dylink section to be first"), t = 9;
199
+ var l = s();
200
+ _ = t + l, o = r();
201
+ }
202
+ var d = { neededDynlibs: [], tlsExports: /* @__PURE__ */ new Set(), weakImports: /* @__PURE__ */ new Set() };
203
+ if ("dylink" == o) {
204
+ d.memorySize = s(), d.memoryAlign = s(), d.tableSize = s(), d.tableAlign = s();
205
+ for (var u = s(), m = 0; m < u; ++m) {
206
+ var c = r();
207
+ d.neededDynlibs.push(c);
208
+ }
209
+ } else {
210
+ a("dylink.0" !== o);
211
+ for (; t < _; ) {
212
+ var w = e[t++], p = s();
213
+ if (1 === w) d.memorySize = s(), d.memoryAlign = s(), d.tableSize = s(), d.tableAlign = s();
214
+ else if (2 === w) for (u = s(), m = 0; m < u; ++m) c = r(), d.neededDynlibs.push(c);
215
+ else if (3 === w) for (var h = s(); h--; ) {
216
+ var g = r();
217
+ 256 & s() && d.tlsExports.add(g);
218
+ }
219
+ else if (4 === w) for (h = s(); h--; ) {
220
+ r(), g = r();
221
+ 1 == (3 & s()) && d.weakImports.add(g);
222
+ }
223
+ else t += p;
224
+ }
225
+ }
226
+ return d;
227
+ };
228
+ function getValue(e, t = "i8") {
229
+ switch (t.endsWith("*") && (t = "*"), t) {
230
+ case "i1":
231
+ case "i8":
232
+ return HEAP8[e];
233
+ case "i16":
234
+ return HEAP16[e >> 1];
235
+ case "i32":
236
+ return HEAP32[e >> 2];
237
+ case "i64":
238
+ abort("to do getValue(i64) use WASM_BIGINT");
239
+ case "float":
240
+ return HEAPF32[e >> 2];
241
+ case "double":
242
+ return HEAPF64[e >> 3];
243
+ case "*":
244
+ return HEAPU32[e >> 2];
245
+ default:
246
+ abort(`invalid type for getValue: ${t}`);
247
+ }
248
+ }
249
+ var newDSO = (e, t, _) => {
250
+ var s = { refcount: 1 / 0, name: e, exports: _, global: true };
251
+ return LDSO.loadedLibsByName[e] = s, null != t && (LDSO.loadedLibsByHandle[t] = s), s;
252
+ }, LDSO = { loadedLibsByName: {}, loadedLibsByHandle: {}, init() {
253
+ newDSO("__main__", 0, wasmImports);
254
+ } }, ___heap_base = 78096, zeroMemory = (e, t) => (HEAPU8.fill(0, e, e + t), e), alignMemory = (e, t) => Math.ceil(e / t) * t, getMemory = (e) => {
255
+ if (runtimeInitialized) return zeroMemory(_malloc(e), e);
256
+ var t = ___heap_base, _ = t + alignMemory(e, 16);
257
+ return ___heap_base = _, GOT.__heap_base.value = _, t;
258
+ }, isInternalSym = (e) => ["__cpp_exception", "__c_longjmp", "__wasm_apply_data_relocs", "__dso_handle", "__tls_size", "__tls_align", "__set_stack_limits", "_emscripten_tls_init", "__wasm_init_tls", "__wasm_call_ctors", "__start_em_asm", "__stop_em_asm", "__start_em_js", "__stop_em_js"].includes(e) || e.startsWith("__em_js__"), uleb128Encode = (e, t) => {
259
+ e < 128 ? t.push(e) : t.push(e % 128 | 128, e >> 7);
260
+ }, sigToWasmTypes = (e) => {
261
+ for (var t = { i: "i32", j: "i64", f: "f32", d: "f64", e: "externref", p: "i32" }, _ = { parameters: [], results: "v" == e[0] ? [] : [t[e[0]]] }, s = 1; s < e.length; ++s) _.parameters.push(t[e[s]]);
262
+ return _;
263
+ }, generateFuncType = (e, t) => {
264
+ var _ = e.slice(0, 1), s = e.slice(1), r = { i: 127, p: 127, j: 126, f: 125, d: 124, e: 111 };
265
+ t.push(96), uleb128Encode(s.length, t);
266
+ for (var a = 0; a < s.length; ++a) t.push(r[s[a]]);
267
+ "v" == _ ? t.push(0) : t.push(1, r[_]);
268
+ }, convertJsFunctionToWasm = (e, t) => {
269
+ if ("function" == typeof WebAssembly.Function) return new WebAssembly.Function(sigToWasmTypes(t), e);
270
+ var _ = [1];
271
+ generateFuncType(t, _);
272
+ var s = [0, 97, 115, 109, 1, 0, 0, 0, 1];
273
+ uleb128Encode(_.length, s), s.push(..._), s.push(2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0);
274
+ var r = new WebAssembly.Module(new Uint8Array(s));
275
+ return new WebAssembly.Instance(r, { e: { f: e } }).exports.f;
276
+ }, wasmTableMirror = [], wasmTable = new WebAssembly.Table({ initial: 27, element: "anyfunc" }), getWasmTableEntry = (e) => {
277
+ var t = wasmTableMirror[e];
278
+ return t || (e >= wasmTableMirror.length && (wasmTableMirror.length = e + 1), wasmTableMirror[e] = t = wasmTable.get(e)), t;
279
+ }, updateTableMap = (e, t) => {
280
+ if (functionsInTableMap) for (var _ = e; _ < e + t; _++) {
281
+ var s = getWasmTableEntry(_);
282
+ s && functionsInTableMap.set(s, _);
283
+ }
284
+ }, functionsInTableMap, getFunctionAddress = (e) => (functionsInTableMap || (functionsInTableMap = /* @__PURE__ */ new WeakMap(), updateTableMap(0, wasmTable.length)), functionsInTableMap.get(e) || 0), freeTableIndexes = [], getEmptyTableSlot = () => {
285
+ if (freeTableIndexes.length) return freeTableIndexes.pop();
286
+ try {
287
+ wasmTable.grow(1);
288
+ } catch (e) {
289
+ if (!(e instanceof RangeError)) throw e;
290
+ throw "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";
291
+ }
292
+ return wasmTable.length - 1;
293
+ }, setWasmTableEntry = (e, t) => {
294
+ wasmTable.set(e, t), wasmTableMirror[e] = wasmTable.get(e);
295
+ }, addFunction = (e, t) => {
296
+ var _ = getFunctionAddress(e);
297
+ if (_) return _;
298
+ var s = getEmptyTableSlot();
299
+ try {
300
+ setWasmTableEntry(s, e);
301
+ } catch (_2) {
302
+ if (!(_2 instanceof TypeError)) throw _2;
303
+ var r = convertJsFunctionToWasm(e, t);
304
+ setWasmTableEntry(s, r);
305
+ }
306
+ return functionsInTableMap.set(e, s), s;
307
+ }, updateGOT = (e, t) => {
308
+ for (var _ in e) if (!isInternalSym(_)) {
309
+ var s = e[_];
310
+ _.startsWith("orig$") && (_ = _.split("$")[1], t = true), GOT[_] ||= new WebAssembly.Global({ value: "i32", mutable: true }), (t || 0 == GOT[_].value) && ("function" == typeof s ? GOT[_].value = addFunction(s) : "number" == typeof s ? GOT[_].value = s : err(`unhandled export type for '${_}': ${typeof s}`));
311
+ }
312
+ }, relocateExports = (e, t, _) => {
313
+ var s = {};
314
+ for (var r in e) {
315
+ var a = e[r];
316
+ "object" == typeof a && (a = a.value), "number" == typeof a && (a += t), s[r] = a;
317
+ }
318
+ return updateGOT(s, _), s;
319
+ }, isSymbolDefined = (e) => {
320
+ var t = wasmImports[e];
321
+ return !(!t || t.stub);
322
+ }, dynCallLegacy = (e, t, _) => (0, Module["dynCall_" + e])(t, ..._), dynCall = (e, t, _ = []) => e.includes("j") ? dynCallLegacy(e, t, _) : getWasmTableEntry(t)(..._), createInvokeFunction = (e) => function() {
323
+ var t = stackSave();
324
+ try {
325
+ return dynCall(e, arguments[0], Array.prototype.slice.call(arguments, 1));
326
+ } catch (e2) {
327
+ if (stackRestore(t), e2 !== e2 + 0) throw e2;
328
+ _setThrew(1, 0);
329
+ }
330
+ }, resolveGlobalSymbol = (e, t = false) => {
331
+ var _;
332
+ return t && "orig$" + e in wasmImports && (e = "orig$" + e), isSymbolDefined(e) ? _ = wasmImports[e] : e.startsWith("invoke_") && (_ = wasmImports[e] = createInvokeFunction(e.split("_")[1])), { sym: _, name: e };
333
+ }, UTF8ToString = (e, t) => e ? UTF8ArrayToString(HEAPU8, e, t) : "", loadWebAssemblyModule = (binary, flags, libName, localScope, handle) => {
334
+ var metadata = getDylinkMetadata(binary);
335
+ function loadModule() {
336
+ {
337
+ var memAlign = Math.pow(2, metadata.memoryAlign), memoryBase = metadata.memorySize ? alignMemory(getMemory(metadata.memorySize + memAlign), memAlign) : 0, tableBase = metadata.tableSize ? wasmTable.length : 0;
338
+ }
339
+ var tableGrowthNeeded = tableBase + metadata.tableSize - wasmTable.length, moduleExports;
340
+ function resolveSymbol(e) {
341
+ var t = resolveGlobalSymbol(e).sym;
342
+ return !t && localScope && (t = localScope[e]), t || (t = moduleExports[e]), t;
343
+ }
344
+ tableGrowthNeeded > 0 && wasmTable.grow(tableGrowthNeeded);
345
+ var proxyHandler = { get(e, t) {
346
+ switch (t) {
347
+ case "__memory_base":
348
+ return memoryBase;
349
+ case "__table_base":
350
+ return tableBase;
351
+ }
352
+ if (t in wasmImports && !wasmImports[t].stub) return wasmImports[t];
353
+ var _;
354
+ t in e || (e[t] = (...e2) => (_ ||= resolveSymbol(t), _(...e2)));
355
+ return e[t];
356
+ } }, proxy = new Proxy({}, proxyHandler), info = { "GOT.mem": new Proxy({}, GOTHandler), "GOT.func": new Proxy({}, GOTHandler), env: proxy, wasi_snapshot_preview1: proxy };
357
+ function postInstantiation(module, instance) {
358
+ function addEmAsm(addr, body) {
359
+ for (var args = [], arity = 0; arity < 16 && -1 != body.indexOf("$" + arity); arity++) args.push("$" + arity);
360
+ args = args.join(",");
361
+ var func = `(${args}) => { ${body} };`;
362
+ eval(func);
363
+ }
364
+ if (updateTableMap(tableBase, metadata.tableSize), moduleExports = relocateExports(instance.exports, memoryBase), flags.allowUndefined || reportUndefinedSymbols(), "__start_em_asm" in moduleExports) for (var start = moduleExports.__start_em_asm, stop = moduleExports.__stop_em_asm; start < stop; ) {
365
+ var jsString = UTF8ToString(start);
366
+ addEmAsm(start, jsString), start = HEAPU8.indexOf(0, start) + 1;
367
+ }
368
+ function addEmJs(name, cSig, body) {
369
+ var jsArgs = [];
370
+ if (cSig = cSig.slice(1, -1), "void" != cSig) for (var i in cSig = cSig.split(","), cSig) {
371
+ var jsArg = cSig[i].split(" ").pop();
372
+ jsArgs.push(jsArg.replace("*", ""));
373
+ }
374
+ var func = `(${jsArgs}) => ${body};`;
375
+ moduleExports[name] = eval(func);
376
+ }
377
+ for (var name in moduleExports) if (name.startsWith("__em_js__")) {
378
+ var start = moduleExports[name], jsString = UTF8ToString(start), parts = jsString.split("<::>");
379
+ addEmJs(name.replace("__em_js__", ""), parts[0], parts[1]), delete moduleExports[name];
380
+ }
381
+ var applyRelocs = moduleExports.__wasm_apply_data_relocs;
382
+ applyRelocs && (runtimeInitialized ? applyRelocs() : __RELOC_FUNCS__.push(applyRelocs));
383
+ var init = moduleExports.__wasm_call_ctors;
384
+ return init && (runtimeInitialized ? init() : __ATINIT__.push(init)), moduleExports;
385
+ }
386
+ if (flags.loadAsync) {
387
+ if (binary instanceof WebAssembly.Module) {
388
+ var instance = new WebAssembly.Instance(binary, info);
389
+ return Promise.resolve(postInstantiation(binary, instance));
390
+ }
391
+ return WebAssembly.instantiate(binary, info).then(((e) => postInstantiation(e.module, e.instance)));
392
+ }
393
+ var module = binary instanceof WebAssembly.Module ? binary : new WebAssembly.Module(binary), instance = new WebAssembly.Instance(module, info);
394
+ return postInstantiation(module, instance);
395
+ }
396
+ return currentModuleWeakSymbols = metadata.weakImports, flags.loadAsync ? metadata.neededDynlibs.reduce(((e, t) => e.then((() => loadDynamicLibrary(t, flags)))), Promise.resolve()).then(loadModule) : (metadata.neededDynlibs.forEach(((e) => loadDynamicLibrary(e, flags, localScope))), loadModule());
397
+ }, mergeLibSymbols = (e, t) => {
398
+ for (var [_, s] of Object.entries(e)) {
399
+ const e2 = (e3) => {
400
+ isSymbolDefined(e3) || (wasmImports[e3] = s);
401
+ };
402
+ e2(_);
403
+ const t2 = "__main_argc_argv";
404
+ "main" == _ && e2(t2), _ == t2 && e2("main"), _.startsWith("dynCall_") && !Module.hasOwnProperty(_) && (Module[_] = s);
405
+ }
406
+ }, asyncLoad = (e, t, _, s) => {
407
+ var r = getUniqueRunDependency(`al ${e}`);
408
+ readAsync(e, ((e2) => {
409
+ t(new Uint8Array(e2)), r && removeRunDependency();
410
+ }), ((t2) => {
411
+ if (!_) throw `Loading data file "${e}" failed.`;
412
+ _();
413
+ })), r && addRunDependency();
414
+ };
415
+ function loadDynamicLibrary(e, t = { global: true, nodelete: true }, _, s) {
416
+ var r = LDSO.loadedLibsByName[e];
417
+ if (r) return t.global ? r.global || (r.global = true, mergeLibSymbols(r.exports)) : _, t.nodelete && r.refcount !== 1 / 0 && (r.refcount = 1 / 0), r.refcount++, !t.loadAsync || Promise.resolve(true);
418
+ function a() {
419
+ var o2 = locateFile(e);
420
+ if (t.loadAsync) return new Promise((function(e2, t2) {
421
+ asyncLoad(o2, e2, t2);
422
+ }));
423
+ if (!readBinary) throw new Error(`${o2}: file not found, and synchronous loading of external files is not available`);
424
+ return readBinary(o2);
425
+ }
426
+ function o() {
427
+ return t.loadAsync ? a().then(((r2) => loadWebAssemblyModule(r2, t, e, _))) : loadWebAssemblyModule(a(), t, e, _);
428
+ }
429
+ function n(t2) {
430
+ r.global ? mergeLibSymbols(t2) : _, r.exports = t2;
431
+ }
432
+ return (r = newDSO(e, s, "loading")).refcount = t.nodelete ? 1 / 0 : 1, r.global = t.global, t.loadAsync ? o().then(((e2) => (n(e2), true))) : (n(o()), true);
433
+ }
434
+ var reportUndefinedSymbols = () => {
435
+ for (var [e, t] of Object.entries(GOT)) if (0 == t.value) {
436
+ var _ = resolveGlobalSymbol(e, true).sym;
437
+ if (!_ && !t.required) continue;
438
+ if ("function" == typeof _) t.value = addFunction(_, _.sig);
439
+ else {
440
+ if ("number" != typeof _) throw new Error(`bad export type for '${e}': ${typeof _}`);
441
+ t.value = _;
442
+ }
443
+ }
444
+ }, loadDylibs = () => {
445
+ dynamicLibraries.length ? (addRunDependency(), dynamicLibraries.reduce(((e, t) => e.then((() => loadDynamicLibrary(t, { loadAsync: true, global: true, nodelete: true, allowUndefined: true })))), Promise.resolve()).then((() => {
446
+ reportUndefinedSymbols(), removeRunDependency();
447
+ }))) : reportUndefinedSymbols();
448
+ }; Module.noExitRuntime || true;
449
+ function setValue(e, t, _ = "i8") {
450
+ switch (_.endsWith("*") && (_ = "*"), _) {
451
+ case "i1":
452
+ case "i8":
453
+ HEAP8[e] = t;
454
+ break;
455
+ case "i16":
456
+ HEAP16[e >> 1] = t;
457
+ break;
458
+ case "i32":
459
+ HEAP32[e >> 2] = t;
460
+ break;
461
+ case "i64":
462
+ abort("to do setValue(i64) use WASM_BIGINT");
463
+ case "float":
464
+ HEAPF32[e >> 2] = t;
465
+ break;
466
+ case "double":
467
+ HEAPF64[e >> 3] = t;
468
+ break;
469
+ case "*":
470
+ HEAPU32[e >> 2] = t;
471
+ break;
472
+ default:
473
+ abort(`invalid type for setValue: ${_}`);
474
+ }
475
+ }
476
+ var ___memory_base = new WebAssembly.Global({ value: "i32", mutable: false }, 1024), ___stack_pointer = new WebAssembly.Global({ value: "i32", mutable: true }, 78096), ___table_base = new WebAssembly.Global({ value: "i32", mutable: false }, 1), nowIsMonotonic = 1, __emscripten_get_now_is_monotonic = () => nowIsMonotonic;
477
+ __emscripten_get_now_is_monotonic.sig = "i";
478
+ var _abort = () => {
479
+ abort("");
480
+ };
481
+ _abort.sig = "v";
482
+ var _emscripten_get_now;
483
+ _emscripten_get_now = () => performance.now(), _emscripten_get_now.sig = "d";
484
+ var _emscripten_memcpy_js = (e, t, _) => HEAPU8.copyWithin(e, t, t + _);
485
+ _emscripten_memcpy_js.sig = "vppp";
486
+ var getHeapMax = () => 2147483648, growMemory = (e) => {
487
+ var t = (e - wasmMemory.buffer.byteLength + 65535) / 65536;
488
+ try {
489
+ return wasmMemory.grow(t), updateMemoryViews(), 1;
490
+ } catch (e2) {
491
+ }
492
+ }, _emscripten_resize_heap = (e) => {
493
+ var t = HEAPU8.length;
494
+ e >>>= 0;
495
+ var _ = getHeapMax();
496
+ if (e > _) return false;
497
+ for (var s, r, a = 1; a <= 4; a *= 2) {
498
+ var o = t * (1 + 0.2 / a);
499
+ o = Math.min(o, e + 100663296);
500
+ var n = Math.min(_, (s = Math.max(e, o)) + ((r = 65536) - s % r) % r);
501
+ if (growMemory(n)) return true;
502
+ }
503
+ return false;
504
+ };
505
+ _emscripten_resize_heap.sig = "ip";
506
+ var _fd_close = (e) => 52;
507
+ _fd_close.sig = "ii";
508
+ function _fd_seek(e, t, _, s, r) {
509
+ return 70;
510
+ }
511
+ _fd_seek.sig = "iiiiip";
512
+ var printCharBuffers = [null, [], []], printChar = (e, t) => {
513
+ var _ = printCharBuffers[e];
514
+ 0 === t || 10 === t ? ((1 === e ? out : err)(UTF8ArrayToString(_, 0)), _.length = 0) : _.push(t);
515
+ }, _fd_write = (e, t, _, s) => {
516
+ for (var r = 0, a = 0; a < _; a++) {
517
+ var o = HEAPU32[t >> 2], n = HEAPU32[t + 4 >> 2];
518
+ t += 8;
519
+ for (var l = 0; l < n; l++) printChar(e, HEAPU8[o + l]);
520
+ r += n;
521
+ }
522
+ return HEAPU32[s >> 2] = r, 0;
523
+ };
524
+ function _tree_sitter_log_callback(e, t) {
525
+ if (currentLogCallback) {
526
+ const _ = UTF8ToString(t);
527
+ currentLogCallback(_, 0 !== e);
528
+ }
529
+ }
530
+ function _tree_sitter_parse_callback(e, t, _, s, r) {
531
+ const a = currentParseCallback(t, { row: _, column: s });
532
+ "string" == typeof a ? (setValue(r, a.length, "i32"), stringToUTF16(a, e, 10240)) : setValue(r, 0, "i32");
533
+ }
534
+ _fd_write.sig = "iippp";
535
+ var _proc_exit = (e) => {
536
+ EXITSTATUS = e, quit_(e, new ExitStatus(e));
537
+ };
538
+ _proc_exit.sig = "vi";
539
+ var exitJS = (e, t) => {
540
+ EXITSTATUS = e, _proc_exit(e);
541
+ }, handleException = (e) => {
542
+ if (e instanceof ExitStatus || "unwind" == e) return EXITSTATUS;
543
+ quit_(1, e);
544
+ }, lengthBytesUTF8 = (e) => {
545
+ for (var t = 0, _ = 0; _ < e.length; ++_) {
546
+ var s = e.charCodeAt(_);
547
+ s <= 127 ? t++ : s <= 2047 ? t += 2 : s >= 55296 && s <= 57343 ? (t += 4, ++_) : t += 3;
548
+ }
549
+ return t;
550
+ }, stringToUTF8Array = (e, t, _, s) => {
551
+ if (!(s > 0)) return 0;
552
+ for (var r = _, a = _ + s - 1, o = 0; o < e.length; ++o) {
553
+ var n = e.charCodeAt(o);
554
+ if (n >= 55296 && n <= 57343) n = 65536 + ((1023 & n) << 10) | 1023 & e.charCodeAt(++o);
555
+ if (n <= 127) {
556
+ if (_ >= a) break;
557
+ t[_++] = n;
558
+ } else if (n <= 2047) {
559
+ if (_ + 1 >= a) break;
560
+ t[_++] = 192 | n >> 6, t[_++] = 128 | 63 & n;
561
+ } else if (n <= 65535) {
562
+ if (_ + 2 >= a) break;
563
+ t[_++] = 224 | n >> 12, t[_++] = 128 | n >> 6 & 63, t[_++] = 128 | 63 & n;
564
+ } else {
565
+ if (_ + 3 >= a) break;
566
+ t[_++] = 240 | n >> 18, t[_++] = 128 | n >> 12 & 63, t[_++] = 128 | n >> 6 & 63, t[_++] = 128 | 63 & n;
567
+ }
568
+ }
569
+ return t[_] = 0, _ - r;
570
+ }, stringToUTF8 = (e, t, _) => stringToUTF8Array(e, HEAPU8, t, _), stringToUTF8OnStack = (e) => {
571
+ var t = lengthBytesUTF8(e) + 1, _ = stackAlloc(t);
572
+ return stringToUTF8(e, _, t), _;
573
+ }, stringToUTF16 = (e, t, _) => {
574
+ if (_ ??= 2147483647, _ < 2) return 0;
575
+ for (var s = t, r = (_ -= 2) < 2 * e.length ? _ / 2 : e.length, a = 0; a < r; ++a) {
576
+ var o = e.charCodeAt(a);
577
+ HEAP16[t >> 1] = o, t += 2;
578
+ }
579
+ return HEAP16[t >> 1] = 0, t - s;
580
+ }, AsciiToString = (e) => {
581
+ for (var t = ""; ; ) {
582
+ var _ = HEAPU8[e++];
583
+ if (!_) return t;
584
+ t += String.fromCharCode(_);
585
+ }
586
+ }, wasmImports = { __heap_base: ___heap_base, __indirect_function_table: wasmTable, __memory_base: ___memory_base, __stack_pointer: ___stack_pointer, __table_base: ___table_base, _emscripten_get_now_is_monotonic: __emscripten_get_now_is_monotonic, abort: _abort, emscripten_get_now: _emscripten_get_now, emscripten_memcpy_js: _emscripten_memcpy_js, emscripten_resize_heap: _emscripten_resize_heap, fd_close: _fd_close, fd_seek: _fd_seek, fd_write: _fd_write, memory: wasmMemory, tree_sitter_log_callback: _tree_sitter_log_callback, tree_sitter_parse_callback: _tree_sitter_parse_callback }, wasmExports = createWasm(), _malloc = Module._malloc = (e) => (_malloc = Module._malloc = wasmExports.malloc)(e); Module._calloc = (e, t) => (Module._calloc = wasmExports.calloc)(e, t); Module._realloc = (e, t) => (Module._realloc = wasmExports.realloc)(e, t); Module._free = (e) => (Module._free = wasmExports.free)(e); Module._ts_language_symbol_count = (e) => (Module._ts_language_symbol_count = wasmExports.ts_language_symbol_count)(e); Module._ts_language_state_count = (e) => (Module._ts_language_state_count = wasmExports.ts_language_state_count)(e); Module._ts_language_version = (e) => (Module._ts_language_version = wasmExports.ts_language_version)(e); Module._ts_language_field_count = (e) => (Module._ts_language_field_count = wasmExports.ts_language_field_count)(e); Module._ts_language_next_state = (e, t, _) => (Module._ts_language_next_state = wasmExports.ts_language_next_state)(e, t, _); Module._ts_language_symbol_name = (e, t) => (Module._ts_language_symbol_name = wasmExports.ts_language_symbol_name)(e, t); Module._ts_language_symbol_for_name = (e, t, _, s) => (Module._ts_language_symbol_for_name = wasmExports.ts_language_symbol_for_name)(e, t, _, s); Module._strncmp = (e, t, _) => (Module._strncmp = wasmExports.strncmp)(e, t, _); Module._ts_language_symbol_type = (e, t) => (Module._ts_language_symbol_type = wasmExports.ts_language_symbol_type)(e, t); Module._ts_language_field_name_for_id = (e, t) => (Module._ts_language_field_name_for_id = wasmExports.ts_language_field_name_for_id)(e, t); Module._ts_lookahead_iterator_new = (e, t) => (Module._ts_lookahead_iterator_new = wasmExports.ts_lookahead_iterator_new)(e, t); Module._ts_lookahead_iterator_delete = (e) => (Module._ts_lookahead_iterator_delete = wasmExports.ts_lookahead_iterator_delete)(e); Module._ts_lookahead_iterator_reset_state = (e, t) => (Module._ts_lookahead_iterator_reset_state = wasmExports.ts_lookahead_iterator_reset_state)(e, t); Module._ts_lookahead_iterator_reset = (e, t, _) => (Module._ts_lookahead_iterator_reset = wasmExports.ts_lookahead_iterator_reset)(e, t, _); Module._ts_lookahead_iterator_next = (e) => (Module._ts_lookahead_iterator_next = wasmExports.ts_lookahead_iterator_next)(e); Module._ts_lookahead_iterator_current_symbol = (e) => (Module._ts_lookahead_iterator_current_symbol = wasmExports.ts_lookahead_iterator_current_symbol)(e); Module._memset = (e, t, _) => (Module._memset = wasmExports.memset)(e, t, _); Module._memcpy = (e, t, _) => (Module._memcpy = wasmExports.memcpy)(e, t, _); Module._ts_parser_delete = (e) => (Module._ts_parser_delete = wasmExports.ts_parser_delete)(e); Module._ts_parser_reset = (e) => (Module._ts_parser_reset = wasmExports.ts_parser_reset)(e); Module._ts_parser_set_language = (e, t) => (Module._ts_parser_set_language = wasmExports.ts_parser_set_language)(e, t); Module._ts_parser_timeout_micros = (e) => (Module._ts_parser_timeout_micros = wasmExports.ts_parser_timeout_micros)(e); Module._ts_parser_set_timeout_micros = (e, t, _) => (Module._ts_parser_set_timeout_micros = wasmExports.ts_parser_set_timeout_micros)(e, t, _); Module._ts_parser_set_included_ranges = (e, t, _) => (Module._ts_parser_set_included_ranges = wasmExports.ts_parser_set_included_ranges)(e, t, _); Module._memmove = (e, t, _) => (Module._memmove = wasmExports.memmove)(e, t, _); Module._memcmp = (e, t, _) => (Module._memcmp = wasmExports.memcmp)(e, t, _); Module._ts_query_new = (e, t, _, s, r) => (Module._ts_query_new = wasmExports.ts_query_new)(e, t, _, s, r); Module._ts_query_delete = (e) => (Module._ts_query_delete = wasmExports.ts_query_delete)(e); Module._iswspace = (e) => (Module._iswspace = wasmExports.iswspace)(e); Module._iswalnum = (e) => (Module._iswalnum = wasmExports.iswalnum)(e); Module._ts_query_pattern_count = (e) => (Module._ts_query_pattern_count = wasmExports.ts_query_pattern_count)(e); Module._ts_query_capture_count = (e) => (Module._ts_query_capture_count = wasmExports.ts_query_capture_count)(e); Module._ts_query_string_count = (e) => (Module._ts_query_string_count = wasmExports.ts_query_string_count)(e); Module._ts_query_capture_name_for_id = (e, t, _) => (Module._ts_query_capture_name_for_id = wasmExports.ts_query_capture_name_for_id)(e, t, _); Module._ts_query_string_value_for_id = (e, t, _) => (Module._ts_query_string_value_for_id = wasmExports.ts_query_string_value_for_id)(e, t, _); Module._ts_query_predicates_for_pattern = (e, t, _) => (Module._ts_query_predicates_for_pattern = wasmExports.ts_query_predicates_for_pattern)(e, t, _); Module._ts_query_disable_capture = (e, t, _) => (Module._ts_query_disable_capture = wasmExports.ts_query_disable_capture)(e, t, _); Module._ts_tree_copy = (e) => (Module._ts_tree_copy = wasmExports.ts_tree_copy)(e); Module._ts_tree_delete = (e) => (Module._ts_tree_delete = wasmExports.ts_tree_delete)(e); Module._ts_init = () => (Module._ts_init = wasmExports.ts_init)(); Module._ts_parser_new_wasm = () => (Module._ts_parser_new_wasm = wasmExports.ts_parser_new_wasm)(); Module._ts_parser_enable_logger_wasm = (e, t) => (Module._ts_parser_enable_logger_wasm = wasmExports.ts_parser_enable_logger_wasm)(e, t); Module._ts_parser_parse_wasm = (e, t, _, s, r) => (Module._ts_parser_parse_wasm = wasmExports.ts_parser_parse_wasm)(e, t, _, s, r); Module._ts_parser_included_ranges_wasm = (e) => (Module._ts_parser_included_ranges_wasm = wasmExports.ts_parser_included_ranges_wasm)(e); Module._ts_language_type_is_named_wasm = (e, t) => (Module._ts_language_type_is_named_wasm = wasmExports.ts_language_type_is_named_wasm)(e, t); Module._ts_language_type_is_visible_wasm = (e, t) => (Module._ts_language_type_is_visible_wasm = wasmExports.ts_language_type_is_visible_wasm)(e, t); Module._ts_tree_root_node_wasm = (e) => (Module._ts_tree_root_node_wasm = wasmExports.ts_tree_root_node_wasm)(e); Module._ts_tree_root_node_with_offset_wasm = (e) => (Module._ts_tree_root_node_with_offset_wasm = wasmExports.ts_tree_root_node_with_offset_wasm)(e); Module._ts_tree_edit_wasm = (e) => (Module._ts_tree_edit_wasm = wasmExports.ts_tree_edit_wasm)(e); Module._ts_tree_included_ranges_wasm = (e) => (Module._ts_tree_included_ranges_wasm = wasmExports.ts_tree_included_ranges_wasm)(e); Module._ts_tree_get_changed_ranges_wasm = (e, t) => (Module._ts_tree_get_changed_ranges_wasm = wasmExports.ts_tree_get_changed_ranges_wasm)(e, t); Module._ts_tree_cursor_new_wasm = (e) => (Module._ts_tree_cursor_new_wasm = wasmExports.ts_tree_cursor_new_wasm)(e); Module._ts_tree_cursor_delete_wasm = (e) => (Module._ts_tree_cursor_delete_wasm = wasmExports.ts_tree_cursor_delete_wasm)(e); Module._ts_tree_cursor_reset_wasm = (e) => (Module._ts_tree_cursor_reset_wasm = wasmExports.ts_tree_cursor_reset_wasm)(e); Module._ts_tree_cursor_reset_to_wasm = (e, t) => (Module._ts_tree_cursor_reset_to_wasm = wasmExports.ts_tree_cursor_reset_to_wasm)(e, t); Module._ts_tree_cursor_goto_first_child_wasm = (e) => (Module._ts_tree_cursor_goto_first_child_wasm = wasmExports.ts_tree_cursor_goto_first_child_wasm)(e); Module._ts_tree_cursor_goto_last_child_wasm = (e) => (Module._ts_tree_cursor_goto_last_child_wasm = wasmExports.ts_tree_cursor_goto_last_child_wasm)(e); Module._ts_tree_cursor_goto_first_child_for_index_wasm = (e) => (Module._ts_tree_cursor_goto_first_child_for_index_wasm = wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(e); Module._ts_tree_cursor_goto_first_child_for_position_wasm = (e) => (Module._ts_tree_cursor_goto_first_child_for_position_wasm = wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(e); Module._ts_tree_cursor_goto_next_sibling_wasm = (e) => (Module._ts_tree_cursor_goto_next_sibling_wasm = wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(e); Module._ts_tree_cursor_goto_previous_sibling_wasm = (e) => (Module._ts_tree_cursor_goto_previous_sibling_wasm = wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(e); Module._ts_tree_cursor_goto_descendant_wasm = (e, t) => (Module._ts_tree_cursor_goto_descendant_wasm = wasmExports.ts_tree_cursor_goto_descendant_wasm)(e, t); Module._ts_tree_cursor_goto_parent_wasm = (e) => (Module._ts_tree_cursor_goto_parent_wasm = wasmExports.ts_tree_cursor_goto_parent_wasm)(e); Module._ts_tree_cursor_current_node_type_id_wasm = (e) => (Module._ts_tree_cursor_current_node_type_id_wasm = wasmExports.ts_tree_cursor_current_node_type_id_wasm)(e); Module._ts_tree_cursor_current_node_state_id_wasm = (e) => (Module._ts_tree_cursor_current_node_state_id_wasm = wasmExports.ts_tree_cursor_current_node_state_id_wasm)(e); Module._ts_tree_cursor_current_node_is_named_wasm = (e) => (Module._ts_tree_cursor_current_node_is_named_wasm = wasmExports.ts_tree_cursor_current_node_is_named_wasm)(e); Module._ts_tree_cursor_current_node_is_missing_wasm = (e) => (Module._ts_tree_cursor_current_node_is_missing_wasm = wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(e); Module._ts_tree_cursor_current_node_id_wasm = (e) => (Module._ts_tree_cursor_current_node_id_wasm = wasmExports.ts_tree_cursor_current_node_id_wasm)(e); Module._ts_tree_cursor_start_position_wasm = (e) => (Module._ts_tree_cursor_start_position_wasm = wasmExports.ts_tree_cursor_start_position_wasm)(e); Module._ts_tree_cursor_end_position_wasm = (e) => (Module._ts_tree_cursor_end_position_wasm = wasmExports.ts_tree_cursor_end_position_wasm)(e); Module._ts_tree_cursor_start_index_wasm = (e) => (Module._ts_tree_cursor_start_index_wasm = wasmExports.ts_tree_cursor_start_index_wasm)(e); Module._ts_tree_cursor_end_index_wasm = (e) => (Module._ts_tree_cursor_end_index_wasm = wasmExports.ts_tree_cursor_end_index_wasm)(e); Module._ts_tree_cursor_current_field_id_wasm = (e) => (Module._ts_tree_cursor_current_field_id_wasm = wasmExports.ts_tree_cursor_current_field_id_wasm)(e); Module._ts_tree_cursor_current_depth_wasm = (e) => (Module._ts_tree_cursor_current_depth_wasm = wasmExports.ts_tree_cursor_current_depth_wasm)(e); Module._ts_tree_cursor_current_descendant_index_wasm = (e) => (Module._ts_tree_cursor_current_descendant_index_wasm = wasmExports.ts_tree_cursor_current_descendant_index_wasm)(e); Module._ts_tree_cursor_current_node_wasm = (e) => (Module._ts_tree_cursor_current_node_wasm = wasmExports.ts_tree_cursor_current_node_wasm)(e); Module._ts_node_symbol_wasm = (e) => (Module._ts_node_symbol_wasm = wasmExports.ts_node_symbol_wasm)(e); Module._ts_node_field_name_for_child_wasm = (e, t) => (Module._ts_node_field_name_for_child_wasm = wasmExports.ts_node_field_name_for_child_wasm)(e, t); Module._ts_node_children_by_field_id_wasm = (e, t) => (Module._ts_node_children_by_field_id_wasm = wasmExports.ts_node_children_by_field_id_wasm)(e, t); Module._ts_node_first_child_for_byte_wasm = (e) => (Module._ts_node_first_child_for_byte_wasm = wasmExports.ts_node_first_child_for_byte_wasm)(e); Module._ts_node_first_named_child_for_byte_wasm = (e) => (Module._ts_node_first_named_child_for_byte_wasm = wasmExports.ts_node_first_named_child_for_byte_wasm)(e); Module._ts_node_grammar_symbol_wasm = (e) => (Module._ts_node_grammar_symbol_wasm = wasmExports.ts_node_grammar_symbol_wasm)(e); Module._ts_node_child_count_wasm = (e) => (Module._ts_node_child_count_wasm = wasmExports.ts_node_child_count_wasm)(e); Module._ts_node_named_child_count_wasm = (e) => (Module._ts_node_named_child_count_wasm = wasmExports.ts_node_named_child_count_wasm)(e); Module._ts_node_child_wasm = (e, t) => (Module._ts_node_child_wasm = wasmExports.ts_node_child_wasm)(e, t); Module._ts_node_named_child_wasm = (e, t) => (Module._ts_node_named_child_wasm = wasmExports.ts_node_named_child_wasm)(e, t); Module._ts_node_child_by_field_id_wasm = (e, t) => (Module._ts_node_child_by_field_id_wasm = wasmExports.ts_node_child_by_field_id_wasm)(e, t); Module._ts_node_next_sibling_wasm = (e) => (Module._ts_node_next_sibling_wasm = wasmExports.ts_node_next_sibling_wasm)(e); Module._ts_node_prev_sibling_wasm = (e) => (Module._ts_node_prev_sibling_wasm = wasmExports.ts_node_prev_sibling_wasm)(e); Module._ts_node_next_named_sibling_wasm = (e) => (Module._ts_node_next_named_sibling_wasm = wasmExports.ts_node_next_named_sibling_wasm)(e); Module._ts_node_prev_named_sibling_wasm = (e) => (Module._ts_node_prev_named_sibling_wasm = wasmExports.ts_node_prev_named_sibling_wasm)(e); Module._ts_node_descendant_count_wasm = (e) => (Module._ts_node_descendant_count_wasm = wasmExports.ts_node_descendant_count_wasm)(e); Module._ts_node_parent_wasm = (e) => (Module._ts_node_parent_wasm = wasmExports.ts_node_parent_wasm)(e); Module._ts_node_descendant_for_index_wasm = (e) => (Module._ts_node_descendant_for_index_wasm = wasmExports.ts_node_descendant_for_index_wasm)(e); Module._ts_node_named_descendant_for_index_wasm = (e) => (Module._ts_node_named_descendant_for_index_wasm = wasmExports.ts_node_named_descendant_for_index_wasm)(e); Module._ts_node_descendant_for_position_wasm = (e) => (Module._ts_node_descendant_for_position_wasm = wasmExports.ts_node_descendant_for_position_wasm)(e); Module._ts_node_named_descendant_for_position_wasm = (e) => (Module._ts_node_named_descendant_for_position_wasm = wasmExports.ts_node_named_descendant_for_position_wasm)(e); Module._ts_node_start_point_wasm = (e) => (Module._ts_node_start_point_wasm = wasmExports.ts_node_start_point_wasm)(e); Module._ts_node_end_point_wasm = (e) => (Module._ts_node_end_point_wasm = wasmExports.ts_node_end_point_wasm)(e); Module._ts_node_start_index_wasm = (e) => (Module._ts_node_start_index_wasm = wasmExports.ts_node_start_index_wasm)(e); Module._ts_node_end_index_wasm = (e) => (Module._ts_node_end_index_wasm = wasmExports.ts_node_end_index_wasm)(e); Module._ts_node_to_string_wasm = (e) => (Module._ts_node_to_string_wasm = wasmExports.ts_node_to_string_wasm)(e); Module._ts_node_children_wasm = (e) => (Module._ts_node_children_wasm = wasmExports.ts_node_children_wasm)(e); Module._ts_node_named_children_wasm = (e) => (Module._ts_node_named_children_wasm = wasmExports.ts_node_named_children_wasm)(e); Module._ts_node_descendants_of_type_wasm = (e, t, _, s, r, a, o) => (Module._ts_node_descendants_of_type_wasm = wasmExports.ts_node_descendants_of_type_wasm)(e, t, _, s, r, a, o); Module._ts_node_is_named_wasm = (e) => (Module._ts_node_is_named_wasm = wasmExports.ts_node_is_named_wasm)(e); Module._ts_node_has_changes_wasm = (e) => (Module._ts_node_has_changes_wasm = wasmExports.ts_node_has_changes_wasm)(e); Module._ts_node_has_error_wasm = (e) => (Module._ts_node_has_error_wasm = wasmExports.ts_node_has_error_wasm)(e); Module._ts_node_is_error_wasm = (e) => (Module._ts_node_is_error_wasm = wasmExports.ts_node_is_error_wasm)(e); Module._ts_node_is_missing_wasm = (e) => (Module._ts_node_is_missing_wasm = wasmExports.ts_node_is_missing_wasm)(e); Module._ts_node_is_extra_wasm = (e) => (Module._ts_node_is_extra_wasm = wasmExports.ts_node_is_extra_wasm)(e); Module._ts_node_parse_state_wasm = (e) => (Module._ts_node_parse_state_wasm = wasmExports.ts_node_parse_state_wasm)(e); Module._ts_node_next_parse_state_wasm = (e) => (Module._ts_node_next_parse_state_wasm = wasmExports.ts_node_next_parse_state_wasm)(e); Module._ts_query_matches_wasm = (e, t, _, s, r, a, o, n, l, d) => (Module._ts_query_matches_wasm = wasmExports.ts_query_matches_wasm)(e, t, _, s, r, a, o, n, l, d); Module._ts_query_captures_wasm = (e, t, _, s, r, a, o, n, l, d) => (Module._ts_query_captures_wasm = wasmExports.ts_query_captures_wasm)(e, t, _, s, r, a, o, n, l, d); Module._iswalpha = (e) => (Module._iswalpha = wasmExports.iswalpha)(e); Module._iswblank = (e) => (Module._iswblank = wasmExports.iswblank)(e); Module._iswdigit = (e) => (Module._iswdigit = wasmExports.iswdigit)(e); Module._iswlower = (e) => (Module._iswlower = wasmExports.iswlower)(e); Module._iswupper = (e) => (Module._iswupper = wasmExports.iswupper)(e); Module._iswxdigit = (e) => (Module._iswxdigit = wasmExports.iswxdigit)(e); Module._memchr = (e, t, _) => (Module._memchr = wasmExports.memchr)(e, t, _); Module._strlen = (e) => (Module._strlen = wasmExports.strlen)(e); Module._strcmp = (e, t) => (Module._strcmp = wasmExports.strcmp)(e, t); Module._strncat = (e, t, _) => (Module._strncat = wasmExports.strncat)(e, t, _); Module._strncpy = (e, t, _) => (Module._strncpy = wasmExports.strncpy)(e, t, _); Module._towlower = (e) => (Module._towlower = wasmExports.towlower)(e); Module._towupper = (e) => (Module._towupper = wasmExports.towupper)(e); var _setThrew = (e, t) => (_setThrew = wasmExports.setThrew)(e, t), stackSave = () => (stackSave = wasmExports.stackSave)(), stackRestore = (e) => (stackRestore = wasmExports.stackRestore)(e), stackAlloc = (e) => (stackAlloc = wasmExports.stackAlloc)(e); Module.dynCall_jiji = (e, t, _, s, r) => (Module.dynCall_jiji = wasmExports.dynCall_jiji)(e, t, _, s, r); Module._orig$ts_parser_timeout_micros = (e) => (Module._orig$ts_parser_timeout_micros = wasmExports.orig$ts_parser_timeout_micros)(e); Module._orig$ts_parser_set_timeout_micros = (e, t) => (Module._orig$ts_parser_set_timeout_micros = wasmExports.orig$ts_parser_set_timeout_micros)(e, t); var calledRun;
587
+ function callMain(e = []) {
588
+ var t = resolveGlobalSymbol("main").sym;
589
+ if (t) {
590
+ e.unshift(thisProgram);
591
+ var _ = e.length, s = stackAlloc(4 * (_ + 1)), r = s;
592
+ e.forEach(((e2) => {
593
+ HEAPU32[r >> 2] = stringToUTF8OnStack(e2), r += 4;
594
+ })), HEAPU32[r >> 2] = 0;
595
+ try {
596
+ var a = t(_, s);
597
+ return exitJS(a, true), a;
598
+ } catch (e2) {
599
+ return handleException(e2);
600
+ }
601
+ }
602
+ }
603
+ function run(e = arguments_) {
604
+ function t() {
605
+ calledRun || (calledRun = true, Module.calledRun = true, ABORT || (initRuntime(), preMain(), Module.onRuntimeInitialized && Module.onRuntimeInitialized(), shouldRunNow && callMain(e), postRun()));
606
+ }
607
+ runDependencies > 0 || (preRun(), runDependencies > 0 || (Module.setStatus ? (Module.setStatus("Running..."), setTimeout((function() {
608
+ setTimeout((function() {
609
+ Module.setStatus("");
610
+ }), 1), t();
611
+ }), 1)) : t()));
612
+ }
613
+ if (Module.AsciiToString = AsciiToString, Module.stringToUTF16 = stringToUTF16, dependenciesFulfilled = function e() {
614
+ calledRun || run(), calledRun || (dependenciesFulfilled = e);
615
+ }, Module.preInit) for ("function" == typeof Module.preInit && (Module.preInit = [Module.preInit]); Module.preInit.length > 0; ) Module.preInit.pop()();
616
+ var shouldRunNow = true;
617
+ Module.noInitialRun && (shouldRunNow = false), run();
618
+ const C = Module, INTERNAL = {}, SIZE_OF_INT = 4, SIZE_OF_CURSOR = 4 * SIZE_OF_INT, SIZE_OF_NODE = 5 * SIZE_OF_INT, SIZE_OF_POINT = 2 * SIZE_OF_INT, SIZE_OF_RANGE = 2 * SIZE_OF_INT + 2 * SIZE_OF_POINT, ZERO_POINT = { row: 0, column: 0 }, QUERY_WORD_REGEX = /[\w-.]*/g, PREDICATE_STEP_TYPE_CAPTURE = 1, PREDICATE_STEP_TYPE_STRING = 2, LANGUAGE_FUNCTION_REGEX = /^_?tree_sitter_\w+/;
619
+ let VERSION, MIN_COMPATIBLE_VERSION, TRANSFER_BUFFER, currentParseCallback, currentLogCallback;
620
+ class ParserImpl {
621
+ static init() {
622
+ TRANSFER_BUFFER = C._ts_init(), VERSION = getValue(TRANSFER_BUFFER, "i32"), MIN_COMPATIBLE_VERSION = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
623
+ }
624
+ initialize() {
625
+ C._ts_parser_new_wasm(), this[0] = getValue(TRANSFER_BUFFER, "i32"), this[1] = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
626
+ }
627
+ delete() {
628
+ C._ts_parser_delete(this[0]), C._free(this[1]), this[0] = 0, this[1] = 0;
629
+ }
630
+ setLanguage(e) {
631
+ let t;
632
+ if (e) {
633
+ if (e.constructor !== Language) throw new Error("Argument must be a Language");
634
+ {
635
+ t = e[0];
636
+ const _ = C._ts_language_version(t);
637
+ if (_ < MIN_COMPATIBLE_VERSION || VERSION < _) throw new Error(`Incompatible language version ${_}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`);
638
+ }
639
+ } else t = 0, e = null;
640
+ return this.language = e, C._ts_parser_set_language(this[0], t), this;
641
+ }
642
+ getLanguage() {
643
+ return this.language;
644
+ }
645
+ parse(e, t, _) {
646
+ if ("string" == typeof e) currentParseCallback = (t2, _2) => e.slice(t2);
647
+ else {
648
+ if ("function" != typeof e) throw new Error("Argument must be a string or a function");
649
+ currentParseCallback = e;
650
+ }
651
+ this.logCallback ? (currentLogCallback = this.logCallback, C._ts_parser_enable_logger_wasm(this[0], 1)) : (currentLogCallback = null, C._ts_parser_enable_logger_wasm(this[0], 0));
652
+ let s = 0, r = 0;
653
+ if (_?.includedRanges) {
654
+ s = _.includedRanges.length, r = C._calloc(s, SIZE_OF_RANGE);
655
+ let e2 = r;
656
+ for (let t2 = 0; t2 < s; t2++) marshalRange(e2, _.includedRanges[t2]), e2 += SIZE_OF_RANGE;
657
+ }
658
+ const a = C._ts_parser_parse_wasm(this[0], this[1], t ? t[0] : 0, r, s);
659
+ if (!a) throw currentParseCallback = null, currentLogCallback = null, new Error("Parsing failed");
660
+ const o = new Tree(INTERNAL, a, this.language, currentParseCallback);
661
+ return currentParseCallback = null, currentLogCallback = null, o;
662
+ }
663
+ reset() {
664
+ C._ts_parser_reset(this[0]);
665
+ }
666
+ getIncludedRanges() {
667
+ C._ts_parser_included_ranges_wasm(this[0]);
668
+ const e = getValue(TRANSFER_BUFFER, "i32"), t = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), _ = new Array(e);
669
+ if (e > 0) {
670
+ let s = t;
671
+ for (let t2 = 0; t2 < e; t2++) _[t2] = unmarshalRange(s), s += SIZE_OF_RANGE;
672
+ C._free(t);
673
+ }
674
+ return _;
675
+ }
676
+ getTimeoutMicros() {
677
+ return C._ts_parser_timeout_micros(this[0]);
678
+ }
679
+ setTimeoutMicros(e) {
680
+ C._ts_parser_set_timeout_micros(this[0], e);
681
+ }
682
+ setLogger(e) {
683
+ if (e) {
684
+ if ("function" != typeof e) throw new Error("Logger callback must be a function");
685
+ } else e = null;
686
+ return this.logCallback = e, this;
687
+ }
688
+ getLogger() {
689
+ return this.logCallback;
690
+ }
691
+ }
692
+ class Tree {
693
+ constructor(e, t, _, s) {
694
+ assertInternal(e), this[0] = t, this.language = _, this.textCallback = s;
695
+ }
696
+ copy() {
697
+ const e = C._ts_tree_copy(this[0]);
698
+ return new Tree(INTERNAL, e, this.language, this.textCallback);
699
+ }
700
+ delete() {
701
+ C._ts_tree_delete(this[0]), this[0] = 0;
702
+ }
703
+ edit(e) {
704
+ marshalEdit(e), C._ts_tree_edit_wasm(this[0]);
705
+ }
706
+ get rootNode() {
707
+ return C._ts_tree_root_node_wasm(this[0]), unmarshalNode(this);
708
+ }
709
+ rootNodeWithOffset(e, t) {
710
+ const _ = TRANSFER_BUFFER + SIZE_OF_NODE;
711
+ return setValue(_, e, "i32"), marshalPoint(_ + SIZE_OF_INT, t), C._ts_tree_root_node_with_offset_wasm(this[0]), unmarshalNode(this);
712
+ }
713
+ getLanguage() {
714
+ return this.language;
715
+ }
716
+ walk() {
717
+ return this.rootNode.walk();
718
+ }
719
+ getChangedRanges(e) {
720
+ if (e.constructor !== Tree) throw new TypeError("Argument must be a Tree");
721
+ C._ts_tree_get_changed_ranges_wasm(this[0], e[0]);
722
+ const t = getValue(TRANSFER_BUFFER, "i32"), _ = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), s = new Array(t);
723
+ if (t > 0) {
724
+ let e2 = _;
725
+ for (let _2 = 0; _2 < t; _2++) s[_2] = unmarshalRange(e2), e2 += SIZE_OF_RANGE;
726
+ C._free(_);
727
+ }
728
+ return s;
729
+ }
730
+ getIncludedRanges() {
731
+ C._ts_tree_included_ranges_wasm(this[0]);
732
+ const e = getValue(TRANSFER_BUFFER, "i32"), t = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), _ = new Array(e);
733
+ if (e > 0) {
734
+ let s = t;
735
+ for (let t2 = 0; t2 < e; t2++) _[t2] = unmarshalRange(s), s += SIZE_OF_RANGE;
736
+ C._free(t);
737
+ }
738
+ return _;
739
+ }
740
+ }
741
+ class Node {
742
+ constructor(e, t) {
743
+ assertInternal(e), this.tree = t;
744
+ }
745
+ get typeId() {
746
+ return marshalNode(this), C._ts_node_symbol_wasm(this.tree[0]);
747
+ }
748
+ get grammarId() {
749
+ return marshalNode(this), C._ts_node_grammar_symbol_wasm(this.tree[0]);
750
+ }
751
+ get type() {
752
+ return this.tree.language.types[this.typeId] || "ERROR";
753
+ }
754
+ get grammarType() {
755
+ return this.tree.language.types[this.grammarId] || "ERROR";
756
+ }
757
+ get endPosition() {
758
+ return marshalNode(this), C._ts_node_end_point_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
759
+ }
760
+ get endIndex() {
761
+ return marshalNode(this), C._ts_node_end_index_wasm(this.tree[0]);
762
+ }
763
+ get text() {
764
+ return getText(this.tree, this.startIndex, this.endIndex);
765
+ }
766
+ get parseState() {
767
+ return marshalNode(this), C._ts_node_parse_state_wasm(this.tree[0]);
768
+ }
769
+ get nextParseState() {
770
+ return marshalNode(this), C._ts_node_next_parse_state_wasm(this.tree[0]);
771
+ }
772
+ get isNamed() {
773
+ return marshalNode(this), 1 === C._ts_node_is_named_wasm(this.tree[0]);
774
+ }
775
+ get hasError() {
776
+ return marshalNode(this), 1 === C._ts_node_has_error_wasm(this.tree[0]);
777
+ }
778
+ get hasChanges() {
779
+ return marshalNode(this), 1 === C._ts_node_has_changes_wasm(this.tree[0]);
780
+ }
781
+ get isError() {
782
+ return marshalNode(this), 1 === C._ts_node_is_error_wasm(this.tree[0]);
783
+ }
784
+ get isMissing() {
785
+ return marshalNode(this), 1 === C._ts_node_is_missing_wasm(this.tree[0]);
786
+ }
787
+ get isExtra() {
788
+ return marshalNode(this), 1 === C._ts_node_is_extra_wasm(this.tree[0]);
789
+ }
790
+ equals(e) {
791
+ return this.id === e.id;
792
+ }
793
+ child(e) {
794
+ return marshalNode(this), C._ts_node_child_wasm(this.tree[0], e), unmarshalNode(this.tree);
795
+ }
796
+ namedChild(e) {
797
+ return marshalNode(this), C._ts_node_named_child_wasm(this.tree[0], e), unmarshalNode(this.tree);
798
+ }
799
+ childForFieldId(e) {
800
+ return marshalNode(this), C._ts_node_child_by_field_id_wasm(this.tree[0], e), unmarshalNode(this.tree);
801
+ }
802
+ childForFieldName(e) {
803
+ const t = this.tree.language.fields.indexOf(e);
804
+ return -1 !== t ? this.childForFieldId(t) : null;
805
+ }
806
+ fieldNameForChild(e) {
807
+ marshalNode(this);
808
+ const t = C._ts_node_field_name_for_child_wasm(this.tree[0], e);
809
+ if (!t) return null;
810
+ return AsciiToString(t);
811
+ }
812
+ childrenForFieldName(e) {
813
+ const t = this.tree.language.fields.indexOf(e);
814
+ return -1 !== t && 0 !== t ? this.childrenForFieldId(t) : [];
815
+ }
816
+ childrenForFieldId(e) {
817
+ marshalNode(this), C._ts_node_children_by_field_id_wasm(this.tree[0], e);
818
+ const t = getValue(TRANSFER_BUFFER, "i32"), _ = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), s = new Array(t);
819
+ if (t > 0) {
820
+ let e2 = _;
821
+ for (let _2 = 0; _2 < t; _2++) s[_2] = unmarshalNode(this.tree, e2), e2 += SIZE_OF_NODE;
822
+ C._free(_);
823
+ }
824
+ return s;
825
+ }
826
+ firstChildForIndex(e) {
827
+ marshalNode(this);
828
+ return setValue(TRANSFER_BUFFER + SIZE_OF_NODE, e, "i32"), C._ts_node_first_child_for_byte_wasm(this.tree[0]), unmarshalNode(this.tree);
829
+ }
830
+ firstNamedChildForIndex(e) {
831
+ marshalNode(this);
832
+ return setValue(TRANSFER_BUFFER + SIZE_OF_NODE, e, "i32"), C._ts_node_first_named_child_for_byte_wasm(this.tree[0]), unmarshalNode(this.tree);
833
+ }
834
+ get childCount() {
835
+ return marshalNode(this), C._ts_node_child_count_wasm(this.tree[0]);
836
+ }
837
+ get namedChildCount() {
838
+ return marshalNode(this), C._ts_node_named_child_count_wasm(this.tree[0]);
839
+ }
840
+ get firstChild() {
841
+ return this.child(0);
842
+ }
843
+ get firstNamedChild() {
844
+ return this.namedChild(0);
845
+ }
846
+ get lastChild() {
847
+ return this.child(this.childCount - 1);
848
+ }
849
+ get lastNamedChild() {
850
+ return this.namedChild(this.namedChildCount - 1);
851
+ }
852
+ get children() {
853
+ if (!this._children) {
854
+ marshalNode(this), C._ts_node_children_wasm(this.tree[0]);
855
+ const e = getValue(TRANSFER_BUFFER, "i32"), t = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
856
+ if (this._children = new Array(e), e > 0) {
857
+ let _ = t;
858
+ for (let t2 = 0; t2 < e; t2++) this._children[t2] = unmarshalNode(this.tree, _), _ += SIZE_OF_NODE;
859
+ C._free(t);
860
+ }
861
+ }
862
+ return this._children;
863
+ }
864
+ get namedChildren() {
865
+ if (!this._namedChildren) {
866
+ marshalNode(this), C._ts_node_named_children_wasm(this.tree[0]);
867
+ const e = getValue(TRANSFER_BUFFER, "i32"), t = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32");
868
+ if (this._namedChildren = new Array(e), e > 0) {
869
+ let _ = t;
870
+ for (let t2 = 0; t2 < e; t2++) this._namedChildren[t2] = unmarshalNode(this.tree, _), _ += SIZE_OF_NODE;
871
+ C._free(t);
872
+ }
873
+ }
874
+ return this._namedChildren;
875
+ }
876
+ descendantsOfType(e, t, _) {
877
+ Array.isArray(e) || (e = [e]), t || (t = ZERO_POINT), _ || (_ = ZERO_POINT);
878
+ const s = [], r = this.tree.language.types;
879
+ for (let t2 = 0, _2 = r.length; t2 < _2; t2++) e.includes(r[t2]) && s.push(t2);
880
+ const a = C._malloc(SIZE_OF_INT * s.length);
881
+ for (let e2 = 0, t2 = s.length; e2 < t2; e2++) setValue(a + e2 * SIZE_OF_INT, s[e2], "i32");
882
+ marshalNode(this), C._ts_node_descendants_of_type_wasm(this.tree[0], a, s.length, t.row, t.column, _.row, _.column);
883
+ const o = getValue(TRANSFER_BUFFER, "i32"), n = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), l = new Array(o);
884
+ if (o > 0) {
885
+ let e2 = n;
886
+ for (let t2 = 0; t2 < o; t2++) l[t2] = unmarshalNode(this.tree, e2), e2 += SIZE_OF_NODE;
887
+ }
888
+ return C._free(n), C._free(a), l;
889
+ }
890
+ get nextSibling() {
891
+ return marshalNode(this), C._ts_node_next_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
892
+ }
893
+ get previousSibling() {
894
+ return marshalNode(this), C._ts_node_prev_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
895
+ }
896
+ get nextNamedSibling() {
897
+ return marshalNode(this), C._ts_node_next_named_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
898
+ }
899
+ get previousNamedSibling() {
900
+ return marshalNode(this), C._ts_node_prev_named_sibling_wasm(this.tree[0]), unmarshalNode(this.tree);
901
+ }
902
+ get descendantCount() {
903
+ return marshalNode(this), C._ts_node_descendant_count_wasm(this.tree[0]);
904
+ }
905
+ get parent() {
906
+ return marshalNode(this), C._ts_node_parent_wasm(this.tree[0]), unmarshalNode(this.tree);
907
+ }
908
+ descendantForIndex(e, t = e) {
909
+ if ("number" != typeof e || "number" != typeof t) throw new Error("Arguments must be numbers");
910
+ marshalNode(this);
911
+ const _ = TRANSFER_BUFFER + SIZE_OF_NODE;
912
+ return setValue(_, e, "i32"), setValue(_ + SIZE_OF_INT, t, "i32"), C._ts_node_descendant_for_index_wasm(this.tree[0]), unmarshalNode(this.tree);
913
+ }
914
+ namedDescendantForIndex(e, t = e) {
915
+ if ("number" != typeof e || "number" != typeof t) throw new Error("Arguments must be numbers");
916
+ marshalNode(this);
917
+ const _ = TRANSFER_BUFFER + SIZE_OF_NODE;
918
+ return setValue(_, e, "i32"), setValue(_ + SIZE_OF_INT, t, "i32"), C._ts_node_named_descendant_for_index_wasm(this.tree[0]), unmarshalNode(this.tree);
919
+ }
920
+ descendantForPosition(e, t = e) {
921
+ if (!isPoint(e) || !isPoint(t)) throw new Error("Arguments must be {row, column} objects");
922
+ marshalNode(this);
923
+ const _ = TRANSFER_BUFFER + SIZE_OF_NODE;
924
+ return marshalPoint(_, e), marshalPoint(_ + SIZE_OF_POINT, t), C._ts_node_descendant_for_position_wasm(this.tree[0]), unmarshalNode(this.tree);
925
+ }
926
+ namedDescendantForPosition(e, t = e) {
927
+ if (!isPoint(e) || !isPoint(t)) throw new Error("Arguments must be {row, column} objects");
928
+ marshalNode(this);
929
+ const _ = TRANSFER_BUFFER + SIZE_OF_NODE;
930
+ return marshalPoint(_, e), marshalPoint(_ + SIZE_OF_POINT, t), C._ts_node_named_descendant_for_position_wasm(this.tree[0]), unmarshalNode(this.tree);
931
+ }
932
+ walk() {
933
+ return marshalNode(this), C._ts_tree_cursor_new_wasm(this.tree[0]), new TreeCursor(INTERNAL, this.tree);
934
+ }
935
+ toString() {
936
+ marshalNode(this);
937
+ const e = C._ts_node_to_string_wasm(this.tree[0]), t = AsciiToString(e);
938
+ return C._free(e), t;
939
+ }
940
+ }
941
+ class TreeCursor {
942
+ constructor(e, t) {
943
+ assertInternal(e), this.tree = t, unmarshalTreeCursor(this);
944
+ }
945
+ delete() {
946
+ marshalTreeCursor(this), C._ts_tree_cursor_delete_wasm(this.tree[0]), this[0] = this[1] = this[2] = 0;
947
+ }
948
+ reset(e) {
949
+ marshalNode(e), marshalTreeCursor(this, TRANSFER_BUFFER + SIZE_OF_NODE), C._ts_tree_cursor_reset_wasm(this.tree[0]), unmarshalTreeCursor(this);
950
+ }
951
+ resetTo(e) {
952
+ marshalTreeCursor(this, TRANSFER_BUFFER), marshalTreeCursor(e, TRANSFER_BUFFER + SIZE_OF_CURSOR), C._ts_tree_cursor_reset_to_wasm(this.tree[0], e.tree[0]), unmarshalTreeCursor(this);
953
+ }
954
+ get nodeType() {
955
+ return this.tree.language.types[this.nodeTypeId] || "ERROR";
956
+ }
957
+ get nodeTypeId() {
958
+ return marshalTreeCursor(this), C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0]);
959
+ }
960
+ get nodeStateId() {
961
+ return marshalTreeCursor(this), C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0]);
962
+ }
963
+ get nodeId() {
964
+ return marshalTreeCursor(this), C._ts_tree_cursor_current_node_id_wasm(this.tree[0]);
965
+ }
966
+ get nodeIsNamed() {
967
+ return marshalTreeCursor(this), 1 === C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0]);
968
+ }
969
+ get nodeIsMissing() {
970
+ return marshalTreeCursor(this), 1 === C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0]);
971
+ }
972
+ get nodeText() {
973
+ marshalTreeCursor(this);
974
+ const e = C._ts_tree_cursor_start_index_wasm(this.tree[0]), t = C._ts_tree_cursor_end_index_wasm(this.tree[0]);
975
+ return getText(this.tree, e, t);
976
+ }
977
+ get startPosition() {
978
+ return marshalTreeCursor(this), C._ts_tree_cursor_start_position_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
979
+ }
980
+ get endPosition() {
981
+ return marshalTreeCursor(this), C._ts_tree_cursor_end_position_wasm(this.tree[0]), unmarshalPoint(TRANSFER_BUFFER);
982
+ }
983
+ get startIndex() {
984
+ return marshalTreeCursor(this), C._ts_tree_cursor_start_index_wasm(this.tree[0]);
985
+ }
986
+ get endIndex() {
987
+ return marshalTreeCursor(this), C._ts_tree_cursor_end_index_wasm(this.tree[0]);
988
+ }
989
+ get currentNode() {
990
+ return marshalTreeCursor(this), C._ts_tree_cursor_current_node_wasm(this.tree[0]), unmarshalNode(this.tree);
991
+ }
992
+ get currentFieldId() {
993
+ return marshalTreeCursor(this), C._ts_tree_cursor_current_field_id_wasm(this.tree[0]);
994
+ }
995
+ get currentFieldName() {
996
+ return this.tree.language.fields[this.currentFieldId];
997
+ }
998
+ get currentDepth() {
999
+ return marshalTreeCursor(this), C._ts_tree_cursor_current_depth_wasm(this.tree[0]);
1000
+ }
1001
+ get currentDescendantIndex() {
1002
+ return marshalTreeCursor(this), C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0]);
1003
+ }
1004
+ gotoFirstChild() {
1005
+ marshalTreeCursor(this);
1006
+ const e = C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);
1007
+ return unmarshalTreeCursor(this), 1 === e;
1008
+ }
1009
+ gotoLastChild() {
1010
+ marshalTreeCursor(this);
1011
+ const e = C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);
1012
+ return unmarshalTreeCursor(this), 1 === e;
1013
+ }
1014
+ gotoFirstChildForIndex(e) {
1015
+ marshalTreeCursor(this), setValue(TRANSFER_BUFFER + SIZE_OF_CURSOR, e, "i32");
1016
+ const t = C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);
1017
+ return unmarshalTreeCursor(this), 1 === t;
1018
+ }
1019
+ gotoFirstChildForPosition(e) {
1020
+ marshalTreeCursor(this), marshalPoint(TRANSFER_BUFFER + SIZE_OF_CURSOR, e);
1021
+ const t = C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);
1022
+ return unmarshalTreeCursor(this), 1 === t;
1023
+ }
1024
+ gotoNextSibling() {
1025
+ marshalTreeCursor(this);
1026
+ const e = C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);
1027
+ return unmarshalTreeCursor(this), 1 === e;
1028
+ }
1029
+ gotoPreviousSibling() {
1030
+ marshalTreeCursor(this);
1031
+ const e = C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);
1032
+ return unmarshalTreeCursor(this), 1 === e;
1033
+ }
1034
+ gotoDescendant(e) {
1035
+ marshalTreeCursor(this), C._ts_tree_cursor_goto_descendant_wasm(this.tree[0], e), unmarshalTreeCursor(this);
1036
+ }
1037
+ gotoParent() {
1038
+ marshalTreeCursor(this);
1039
+ const e = C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);
1040
+ return unmarshalTreeCursor(this), 1 === e;
1041
+ }
1042
+ }
1043
+ class Language {
1044
+ constructor(e, t) {
1045
+ assertInternal(e), this[0] = t, this.types = new Array(C._ts_language_symbol_count(this[0]));
1046
+ for (let e2 = 0, t2 = this.types.length; e2 < t2; e2++) C._ts_language_symbol_type(this[0], e2) < 2 && (this.types[e2] = UTF8ToString(C._ts_language_symbol_name(this[0], e2)));
1047
+ this.fields = new Array(C._ts_language_field_count(this[0]) + 1);
1048
+ for (let e2 = 0, t2 = this.fields.length; e2 < t2; e2++) {
1049
+ const t3 = C._ts_language_field_name_for_id(this[0], e2);
1050
+ this.fields[e2] = 0 !== t3 ? UTF8ToString(t3) : null;
1051
+ }
1052
+ }
1053
+ get version() {
1054
+ return C._ts_language_version(this[0]);
1055
+ }
1056
+ get fieldCount() {
1057
+ return this.fields.length - 1;
1058
+ }
1059
+ get stateCount() {
1060
+ return C._ts_language_state_count(this[0]);
1061
+ }
1062
+ fieldIdForName(e) {
1063
+ const t = this.fields.indexOf(e);
1064
+ return -1 !== t ? t : null;
1065
+ }
1066
+ fieldNameForId(e) {
1067
+ return this.fields[e] || null;
1068
+ }
1069
+ idForNodeType(e, t) {
1070
+ const _ = lengthBytesUTF8(e), s = C._malloc(_ + 1);
1071
+ stringToUTF8(e, s, _ + 1);
1072
+ const r = C._ts_language_symbol_for_name(this[0], s, _, t);
1073
+ return C._free(s), r || null;
1074
+ }
1075
+ get nodeTypeCount() {
1076
+ return C._ts_language_symbol_count(this[0]);
1077
+ }
1078
+ nodeTypeForId(e) {
1079
+ const t = C._ts_language_symbol_name(this[0], e);
1080
+ return t ? UTF8ToString(t) : null;
1081
+ }
1082
+ nodeTypeIsNamed(e) {
1083
+ return !!C._ts_language_type_is_named_wasm(this[0], e);
1084
+ }
1085
+ nodeTypeIsVisible(e) {
1086
+ return !!C._ts_language_type_is_visible_wasm(this[0], e);
1087
+ }
1088
+ nextState(e, t) {
1089
+ return C._ts_language_next_state(this[0], e, t);
1090
+ }
1091
+ lookaheadIterator(e) {
1092
+ const t = C._ts_lookahead_iterator_new(this[0], e);
1093
+ return t ? new LookaheadIterable(INTERNAL, t, this) : null;
1094
+ }
1095
+ query(e) {
1096
+ const t = lengthBytesUTF8(e), _ = C._malloc(t + 1);
1097
+ stringToUTF8(e, _, t + 1);
1098
+ const s = C._ts_query_new(this[0], _, t, TRANSFER_BUFFER, TRANSFER_BUFFER + SIZE_OF_INT);
1099
+ if (!s) {
1100
+ const t2 = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), s2 = getValue(TRANSFER_BUFFER, "i32"), r2 = UTF8ToString(_, s2).length, a2 = e.substr(r2, 100).split("\n")[0];
1101
+ let o2, n2 = a2.match(QUERY_WORD_REGEX)[0];
1102
+ switch (t2) {
1103
+ case 2:
1104
+ o2 = new RangeError(`Bad node name '${n2}'`);
1105
+ break;
1106
+ case 3:
1107
+ o2 = new RangeError(`Bad field name '${n2}'`);
1108
+ break;
1109
+ case 4:
1110
+ o2 = new RangeError(`Bad capture name @${n2}`);
1111
+ break;
1112
+ case 5:
1113
+ o2 = new TypeError(`Bad pattern structure at offset ${r2}: '${a2}'...`), n2 = "";
1114
+ break;
1115
+ default:
1116
+ o2 = new SyntaxError(`Bad syntax at offset ${r2}: '${a2}'...`), n2 = "";
1117
+ }
1118
+ throw o2.index = r2, o2.length = n2.length, C._free(_), o2;
1119
+ }
1120
+ const r = C._ts_query_string_count(s), a = C._ts_query_capture_count(s), o = C._ts_query_pattern_count(s), n = new Array(a), l = new Array(r);
1121
+ for (let e2 = 0; e2 < a; e2++) {
1122
+ const t2 = C._ts_query_capture_name_for_id(s, e2, TRANSFER_BUFFER), _2 = getValue(TRANSFER_BUFFER, "i32");
1123
+ n[e2] = UTF8ToString(t2, _2);
1124
+ }
1125
+ for (let e2 = 0; e2 < r; e2++) {
1126
+ const t2 = C._ts_query_string_value_for_id(s, e2, TRANSFER_BUFFER), _2 = getValue(TRANSFER_BUFFER, "i32");
1127
+ l[e2] = UTF8ToString(t2, _2);
1128
+ }
1129
+ const d = new Array(o), u = new Array(o), m = new Array(o), c = new Array(o), w = new Array(o);
1130
+ for (let e2 = 0; e2 < o; e2++) {
1131
+ const t2 = C._ts_query_predicates_for_pattern(s, e2, TRANSFER_BUFFER), _2 = getValue(TRANSFER_BUFFER, "i32");
1132
+ c[e2] = [], w[e2] = [];
1133
+ const r2 = [];
1134
+ let a2 = t2;
1135
+ for (let t3 = 0; t3 < _2; t3++) {
1136
+ const t4 = getValue(a2, "i32");
1137
+ a2 += SIZE_OF_INT;
1138
+ const _3 = getValue(a2, "i32");
1139
+ if (a2 += SIZE_OF_INT, t4 === PREDICATE_STEP_TYPE_CAPTURE) r2.push({ type: "capture", name: n[_3] });
1140
+ else if (t4 === PREDICATE_STEP_TYPE_STRING) r2.push({ type: "string", value: l[_3] });
1141
+ else if (r2.length > 0) {
1142
+ if ("string" !== r2[0].type) throw new Error("Predicates must begin with a literal value");
1143
+ const t5 = r2[0].value;
1144
+ let _4, s2 = true, a3 = true;
1145
+ switch (t5) {
1146
+ case "any-not-eq?":
1147
+ case "not-eq?":
1148
+ s2 = false;
1149
+ case "any-eq?":
1150
+ case "eq?":
1151
+ if (3 !== r2.length) throw new Error(`Wrong number of arguments to \`#${t5}\` predicate. Expected 2, got ${r2.length - 1}`);
1152
+ if ("capture" !== r2[1].type) throw new Error(`First argument of \`#${t5}\` predicate must be a capture. Got "${r2[1].value}"`);
1153
+ if (a3 = !t5.startsWith("any-"), "capture" === r2[2].type) {
1154
+ const t6 = r2[1].name, _5 = r2[2].name;
1155
+ w[e2].push(((e3) => {
1156
+ const r3 = [], o3 = [];
1157
+ for (const s3 of e3) s3.name === t6 && r3.push(s3.node), s3.name === _5 && o3.push(s3.node);
1158
+ const n3 = (e4, t7, _6) => _6 ? e4.text === t7.text : e4.text !== t7.text;
1159
+ return a3 ? r3.every(((e4) => o3.some(((t7) => n3(e4, t7, s2))))) : r3.some(((e4) => o3.some(((t7) => n3(e4, t7, s2)))));
1160
+ }));
1161
+ } else {
1162
+ _4 = r2[1].name;
1163
+ const t6 = r2[2].value, o3 = (e3) => e3.text === t6, n3 = (e3) => e3.text !== t6;
1164
+ w[e2].push(((e3) => {
1165
+ const t7 = [];
1166
+ for (const s3 of e3) s3.name === _4 && t7.push(s3.node);
1167
+ const r3 = s2 ? o3 : n3;
1168
+ return a3 ? t7.every(r3) : t7.some(r3);
1169
+ }));
1170
+ }
1171
+ break;
1172
+ case "any-not-match?":
1173
+ case "not-match?":
1174
+ s2 = false;
1175
+ case "any-match?":
1176
+ case "match?":
1177
+ if (3 !== r2.length) throw new Error(`Wrong number of arguments to \`#${t5}\` predicate. Expected 2, got ${r2.length - 1}.`);
1178
+ if ("capture" !== r2[1].type) throw new Error(`First argument of \`#${t5}\` predicate must be a capture. Got "${r2[1].value}".`);
1179
+ if ("string" !== r2[2].type) throw new Error(`Second argument of \`#${t5}\` predicate must be a string. Got @${r2[2].value}.`);
1180
+ _4 = r2[1].name;
1181
+ const o2 = new RegExp(r2[2].value);
1182
+ a3 = !t5.startsWith("any-"), w[e2].push(((e3) => {
1183
+ const t6 = [];
1184
+ for (const s3 of e3) s3.name === _4 && t6.push(s3.node.text);
1185
+ const r3 = (e4, t7) => t7 ? o2.test(e4) : !o2.test(e4);
1186
+ return 0 === t6.length ? !s2 : a3 ? t6.every(((e4) => r3(e4, s2))) : t6.some(((e4) => r3(e4, s2)));
1187
+ }));
1188
+ break;
1189
+ case "set!":
1190
+ if (r2.length < 2 || r2.length > 3) throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${r2.length - 1}.`);
1191
+ if (r2.some(((e3) => "string" !== e3.type))) throw new Error('Arguments to `#set!` predicate must be a strings.".');
1192
+ d[e2] || (d[e2] = {}), d[e2][r2[1].value] = r2[2] ? r2[2].value : null;
1193
+ break;
1194
+ case "is?":
1195
+ case "is-not?":
1196
+ if (r2.length < 2 || r2.length > 3) throw new Error(`Wrong number of arguments to \`#${t5}\` predicate. Expected 1 or 2. Got ${r2.length - 1}.`);
1197
+ if (r2.some(((e3) => "string" !== e3.type))) throw new Error(`Arguments to \`#${t5}\` predicate must be a strings.".`);
1198
+ const n2 = "is?" === t5 ? u : m;
1199
+ n2[e2] || (n2[e2] = {}), n2[e2][r2[1].value] = r2[2] ? r2[2].value : null;
1200
+ break;
1201
+ case "not-any-of?":
1202
+ s2 = false;
1203
+ case "any-of?":
1204
+ if (r2.length < 2) throw new Error(`Wrong number of arguments to \`#${t5}\` predicate. Expected at least 1. Got ${r2.length - 1}.`);
1205
+ if ("capture" !== r2[1].type) throw new Error(`First argument of \`#${t5}\` predicate must be a capture. Got "${r2[1].value}".`);
1206
+ for (let e3 = 2; e3 < r2.length; e3++) if ("string" !== r2[e3].type) throw new Error(`Arguments to \`#${t5}\` predicate must be a strings.".`);
1207
+ _4 = r2[1].name;
1208
+ const l2 = r2.slice(2).map(((e3) => e3.value));
1209
+ w[e2].push(((e3) => {
1210
+ const t6 = [];
1211
+ for (const s3 of e3) s3.name === _4 && t6.push(s3.node.text);
1212
+ return 0 === t6.length ? !s2 : t6.every(((e4) => l2.includes(e4))) === s2;
1213
+ }));
1214
+ break;
1215
+ default:
1216
+ c[e2].push({ operator: t5, operands: r2.slice(1) });
1217
+ }
1218
+ r2.length = 0;
1219
+ }
1220
+ }
1221
+ Object.freeze(d[e2]), Object.freeze(u[e2]), Object.freeze(m[e2]);
1222
+ }
1223
+ return C._free(_), new Query(INTERNAL, s, n, w, c, Object.freeze(d), Object.freeze(u), Object.freeze(m));
1224
+ }
1225
+ static load(e) {
1226
+ let t;
1227
+ if (e instanceof Uint8Array) t = Promise.resolve(e);
1228
+ else {
1229
+ const _ = e;
1230
+ if ("undefined" != typeof process && process.versions && process.versions.node) {
1231
+ const e2 = __require("fs");
1232
+ t = Promise.resolve(e2.readFileSync(_));
1233
+ } else t = fetch(_).then(((e2) => e2.arrayBuffer().then(((t2) => {
1234
+ if (e2.ok) return new Uint8Array(t2);
1235
+ {
1236
+ const _2 = new TextDecoder("utf-8").decode(t2);
1237
+ throw new Error(`Language.load failed with status ${e2.status}.
1238
+
1239
+ ${_2}`);
1240
+ }
1241
+ }))));
1242
+ }
1243
+ return t.then(((e2) => loadWebAssemblyModule(e2, { loadAsync: true }))).then(((e2) => {
1244
+ const t2 = Object.keys(e2), _ = t2.find(((e3) => LANGUAGE_FUNCTION_REGEX.test(e3) && !e3.includes("external_scanner_")));
1245
+ _ || console.log(`Couldn't find language function in WASM file. Symbols:
1246
+ ${JSON.stringify(t2, null, 2)}`);
1247
+ const s = e2[_]();
1248
+ return new Language(INTERNAL, s);
1249
+ }));
1250
+ }
1251
+ }
1252
+ class LookaheadIterable {
1253
+ constructor(e, t, _) {
1254
+ assertInternal(e), this[0] = t, this.language = _;
1255
+ }
1256
+ get currentTypeId() {
1257
+ return C._ts_lookahead_iterator_current_symbol(this[0]);
1258
+ }
1259
+ get currentType() {
1260
+ return this.language.types[this.currentTypeId] || "ERROR";
1261
+ }
1262
+ delete() {
1263
+ C._ts_lookahead_iterator_delete(this[0]), this[0] = 0;
1264
+ }
1265
+ resetState(e) {
1266
+ return C._ts_lookahead_iterator_reset_state(this[0], e);
1267
+ }
1268
+ reset(e, t) {
1269
+ return !!C._ts_lookahead_iterator_reset(this[0], e[0], t) && (this.language = e, true);
1270
+ }
1271
+ [Symbol.iterator]() {
1272
+ const e = this;
1273
+ return { next: () => C._ts_lookahead_iterator_next(e[0]) ? { done: false, value: e.currentType } : { done: true, value: "" } };
1274
+ }
1275
+ }
1276
+ class Query {
1277
+ constructor(e, t, _, s, r, a, o, n) {
1278
+ assertInternal(e), this[0] = t, this.captureNames = _, this.textPredicates = s, this.predicates = r, this.setProperties = a, this.assertedProperties = o, this.refutedProperties = n, this.exceededMatchLimit = false;
1279
+ }
1280
+ delete() {
1281
+ C._ts_query_delete(this[0]), this[0] = 0;
1282
+ }
1283
+ matches(e, { startPosition: t = ZERO_POINT, endPosition: _ = ZERO_POINT, startIndex: s = 0, endIndex: r = 0, matchLimit: a = 4294967295, maxStartDepth: o = 4294967295 } = {}) {
1284
+ if ("number" != typeof a) throw new Error("Arguments must be numbers");
1285
+ marshalNode(e), C._ts_query_matches_wasm(this[0], e.tree[0], t.row, t.column, _.row, _.column, s, r, a, o);
1286
+ const n = getValue(TRANSFER_BUFFER, "i32"), l = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), d = getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), u = new Array(n);
1287
+ this.exceededMatchLimit = Boolean(d);
1288
+ let m = 0, c = l;
1289
+ for (let t2 = 0; t2 < n; t2++) {
1290
+ const t3 = getValue(c, "i32");
1291
+ c += SIZE_OF_INT;
1292
+ const _2 = getValue(c, "i32");
1293
+ c += SIZE_OF_INT;
1294
+ const s2 = new Array(_2);
1295
+ if (c = unmarshalCaptures(this, e.tree, c, s2), this.textPredicates[t3].every(((e2) => e2(s2)))) {
1296
+ u[m] = { pattern: t3, captures: s2 };
1297
+ const e2 = this.setProperties[t3];
1298
+ e2 && (u[m].setProperties = e2);
1299
+ const _3 = this.assertedProperties[t3];
1300
+ _3 && (u[m].assertedProperties = _3);
1301
+ const r2 = this.refutedProperties[t3];
1302
+ r2 && (u[m].refutedProperties = r2), m++;
1303
+ }
1304
+ }
1305
+ return u.length = m, C._free(l), u;
1306
+ }
1307
+ captures(e, { startPosition: t = ZERO_POINT, endPosition: _ = ZERO_POINT, startIndex: s = 0, endIndex: r = 0, matchLimit: a = 4294967295, maxStartDepth: o = 4294967295 } = {}) {
1308
+ if ("number" != typeof a) throw new Error("Arguments must be numbers");
1309
+ marshalNode(e), C._ts_query_captures_wasm(this[0], e.tree[0], t.row, t.column, _.row, _.column, s, r, a, o);
1310
+ const n = getValue(TRANSFER_BUFFER, "i32"), l = getValue(TRANSFER_BUFFER + SIZE_OF_INT, "i32"), d = getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), u = [];
1311
+ this.exceededMatchLimit = Boolean(d);
1312
+ const m = [];
1313
+ let c = l;
1314
+ for (let t2 = 0; t2 < n; t2++) {
1315
+ const t3 = getValue(c, "i32");
1316
+ c += SIZE_OF_INT;
1317
+ const _2 = getValue(c, "i32");
1318
+ c += SIZE_OF_INT;
1319
+ const s2 = getValue(c, "i32");
1320
+ if (c += SIZE_OF_INT, m.length = _2, c = unmarshalCaptures(this, e.tree, c, m), this.textPredicates[t3].every(((e2) => e2(m)))) {
1321
+ const e2 = m[s2], _3 = this.setProperties[t3];
1322
+ _3 && (e2.setProperties = _3);
1323
+ const r2 = this.assertedProperties[t3];
1324
+ r2 && (e2.assertedProperties = r2);
1325
+ const a2 = this.refutedProperties[t3];
1326
+ a2 && (e2.refutedProperties = a2), u.push(e2);
1327
+ }
1328
+ }
1329
+ return C._free(l), u;
1330
+ }
1331
+ predicatesForPattern(e) {
1332
+ return this.predicates[e];
1333
+ }
1334
+ disableCapture(e) {
1335
+ const t = lengthBytesUTF8(e), _ = C._malloc(t + 1);
1336
+ stringToUTF8(e, _, t + 1), C._ts_query_disable_capture(this[0], _, t), C._free(_);
1337
+ }
1338
+ didExceedMatchLimit() {
1339
+ return this.exceededMatchLimit;
1340
+ }
1341
+ }
1342
+ function getText(e, t, _) {
1343
+ const s = _ - t;
1344
+ let r = e.textCallback(t, null, _);
1345
+ for (t += r.length; t < _; ) {
1346
+ const s2 = e.textCallback(t, null, _);
1347
+ if (!(s2 && s2.length > 0)) break;
1348
+ t += s2.length, r += s2;
1349
+ }
1350
+ return t > _ && (r = r.slice(0, s)), r;
1351
+ }
1352
+ function unmarshalCaptures(e, t, _, s) {
1353
+ for (let r = 0, a = s.length; r < a; r++) {
1354
+ const a2 = getValue(_, "i32"), o = unmarshalNode(t, _ += SIZE_OF_INT);
1355
+ _ += SIZE_OF_NODE, s[r] = { name: e.captureNames[a2], node: o };
1356
+ }
1357
+ return _;
1358
+ }
1359
+ function assertInternal(e) {
1360
+ if (e !== INTERNAL) throw new Error("Illegal constructor");
1361
+ }
1362
+ function isPoint(e) {
1363
+ return e && "number" == typeof e.row && "number" == typeof e.column;
1364
+ }
1365
+ function marshalNode(e) {
1366
+ let t = TRANSFER_BUFFER;
1367
+ setValue(t, e.id, "i32"), t += SIZE_OF_INT, setValue(t, e.startIndex, "i32"), t += SIZE_OF_INT, setValue(t, e.startPosition.row, "i32"), t += SIZE_OF_INT, setValue(t, e.startPosition.column, "i32"), t += SIZE_OF_INT, setValue(t, e[0], "i32");
1368
+ }
1369
+ function unmarshalNode(e, t = TRANSFER_BUFFER) {
1370
+ const _ = getValue(t, "i32");
1371
+ if (0 === _) return null;
1372
+ const s = getValue(t += SIZE_OF_INT, "i32"), r = getValue(t += SIZE_OF_INT, "i32"), a = getValue(t += SIZE_OF_INT, "i32"), o = getValue(t += SIZE_OF_INT, "i32"), n = new Node(INTERNAL, e);
1373
+ return n.id = _, n.startIndex = s, n.startPosition = { row: r, column: a }, n[0] = o, n;
1374
+ }
1375
+ function marshalTreeCursor(e, t = TRANSFER_BUFFER) {
1376
+ setValue(t + 0 * SIZE_OF_INT, e[0], "i32"), setValue(t + 1 * SIZE_OF_INT, e[1], "i32"), setValue(t + 2 * SIZE_OF_INT, e[2], "i32"), setValue(t + 3 * SIZE_OF_INT, e[3], "i32");
1377
+ }
1378
+ function unmarshalTreeCursor(e) {
1379
+ e[0] = getValue(TRANSFER_BUFFER + 0 * SIZE_OF_INT, "i32"), e[1] = getValue(TRANSFER_BUFFER + 1 * SIZE_OF_INT, "i32"), e[2] = getValue(TRANSFER_BUFFER + 2 * SIZE_OF_INT, "i32"), e[3] = getValue(TRANSFER_BUFFER + 3 * SIZE_OF_INT, "i32");
1380
+ }
1381
+ function marshalPoint(e, t) {
1382
+ setValue(e, t.row, "i32"), setValue(e + SIZE_OF_INT, t.column, "i32");
1383
+ }
1384
+ function unmarshalPoint(e) {
1385
+ return { row: getValue(e, "i32") >>> 0, column: getValue(e + SIZE_OF_INT, "i32") >>> 0 };
1386
+ }
1387
+ function marshalRange(e, t) {
1388
+ marshalPoint(e, t.startPosition), marshalPoint(e += SIZE_OF_POINT, t.endPosition), setValue(e += SIZE_OF_POINT, t.startIndex, "i32"), setValue(e += SIZE_OF_INT, t.endIndex, "i32"), e += SIZE_OF_INT;
1389
+ }
1390
+ function unmarshalRange(e) {
1391
+ const t = {};
1392
+ return t.startPosition = unmarshalPoint(e), e += SIZE_OF_POINT, t.endPosition = unmarshalPoint(e), e += SIZE_OF_POINT, t.startIndex = getValue(e, "i32") >>> 0, e += SIZE_OF_INT, t.endIndex = getValue(e, "i32") >>> 0, t;
1393
+ }
1394
+ function marshalEdit(e) {
1395
+ let t = TRANSFER_BUFFER;
1396
+ marshalPoint(t, e.startPosition), t += SIZE_OF_POINT, marshalPoint(t, e.oldEndPosition), t += SIZE_OF_POINT, marshalPoint(t, e.newEndPosition), t += SIZE_OF_POINT, setValue(t, e.startIndex, "i32"), t += SIZE_OF_INT, setValue(t, e.oldEndIndex, "i32"), t += SIZE_OF_INT, setValue(t, e.newEndIndex, "i32"), t += SIZE_OF_INT;
1397
+ }
1398
+ for (const e of Object.getOwnPropertyNames(ParserImpl.prototype)) Object.defineProperty(Parser.prototype, e, { value: ParserImpl.prototype[e], enumerable: false, writable: false });
1399
+ Parser.Language = Language, Module.onRuntimeInitialized = () => {
1400
+ ParserImpl.init(), resolveInitPromise();
1401
+ };
1402
+ })));
1403
+ }
1404
+ }
1405
+ return Parser;
1406
+ })();
1407
+ "object" == typeof exports$1 && (module.exports = TreeSitter);
1408
+ }
1409
+ });
1410
+ var treeSitterAGICL65I = require_tree_sitter();
1411
+
1412
+ export { treeSitterAGICL65I as default };