@aistastudio/myc 0.3.14 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -25
- package/dist/code_index_worker.ts +4 -4
- package/dist/myc.js +2089 -995
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -30,19 +30,25 @@ The runtime is bound to `bun:sqlite` (no native bindings on the Node side).
|
|
|
30
30
|
**It will not start on plain Node.js or Deno.** Bun ≥ 1.3.0 is required and
|
|
31
31
|
pinned in `package.json` → `engines.bun`.
|
|
32
32
|
|
|
33
|
-
**SQLite ≥ 3.
|
|
34
|
-
`trusted_schema = OFF`, so every write fails.
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
**SQLite ≥ 3.50.4.** The floor has two reasons. Below 3.44.0, FTS5 cannot be
|
|
34
|
+
written from triggers under `trusted_schema = OFF`, so every write fails. And on
|
|
35
|
+
3.43.2 and 3.46.0, parallel myc processes were measured running one background
|
|
36
|
+
job two or three times, with a failing job reporting "database disk image is
|
|
37
|
+
malformed"; the cause is not known, so myc refuses every library below what a
|
|
38
|
+
supported setup gives it. Nothing supported loses anything: on Linux, Bun links
|
|
39
|
+
its own SQLite (3.50.4 in Bun 1.3.0, the minimum in `engines.bun`; 3.53.0 in
|
|
40
|
+
Bun 1.3.14), and on macOS, where Bun would use the system SQLite — 3.43.2 on
|
|
41
|
+
macOS 14 — the package ships its own: `vendor/sqlite/libmyc-sqlite3.dylib`,
|
|
37
42
|
SQLite 3.53.4 built from the official amalgamation for arm64 and x86_64
|
|
38
43
|
(`scripts/build-sqlite.ts`), chosen before anything else except an explicit
|
|
39
44
|
`MYC_SQLITE=/path/to/libsqlite3.dylib`. If the SQLite in use is still below
|
|
40
|
-
3.
|
|
41
|
-
command, `myc init` included, refuses with
|
|
42
|
-
what to do, instead of creating a
|
|
43
|
-
to 3.51.2 myc works but warns
|
|
44
|
-
|
|
45
|
-
`myc doctor` names the SQLite in use and where
|
|
45
|
+
3.50.4 — a broken install, an unsupported Bun, or `MYC_SQLITE` pointing at an
|
|
46
|
+
old library — every command, `myc init` included, refuses with
|
|
47
|
+
`precond.sqlite_unsupported` and says what to do, instead of creating a
|
|
48
|
+
workspace it cannot write to. From 3.50.4 up to 3.51.2 myc works but warns
|
|
49
|
+
(`WARN degraded.sqlite_old`): that band is not proven safe for the queue, and on
|
|
50
|
+
Linux the cure is `bun upgrade`. `myc doctor` names the SQLite in use and where
|
|
51
|
+
it came from.
|
|
46
52
|
|
|
47
53
|
Install Bun: https://bun.sh
|
|
48
54
|
|
|
@@ -51,8 +57,8 @@ Install Bun: https://bun.sh
|
|
|
51
57
|
Installation is one command:
|
|
52
58
|
|
|
53
59
|
```bash
|
|
54
|
-
bun install -g @aistastudio/myc # 5.
|
|
55
|
-
myc --version # myc 0.3
|
|
60
|
+
bun install -g @aistastudio/myc # 5.11 MB compressed, 15.80 MB unpacked, 16 files; no models pulled
|
|
61
|
+
myc --version # myc 0.4.3 (schema 1)
|
|
56
62
|
```
|
|
57
63
|
|
|
58
64
|
It runs on macOS and Linux. On Windows, use WSL and install Bun and myc inside
|
|
@@ -228,7 +234,7 @@ and `run`, `statusline --then`, `wire` and `unwire` ask.
|
|
|
228
234
|
Code intelligence is built in, and it is the same engine the alternatives use:
|
|
229
235
|
tree-sitter, with grammars fetched on demand rather than shipped. Symbols,
|
|
230
236
|
callers and code search work for TypeScript, TSX, JavaScript (js, jsx, mjs,
|
|
231
|
-
cjs) and
|
|
237
|
+
cjs), Python and C# — the languages myc has definition rules for. The grammar
|
|
232
238
|
package holds 36; a language is added as a pair, a rule and a catalog entry,
|
|
233
239
|
so a grammar that would yield no symbols is never offered. Every other file
|
|
234
240
|
still gets `code grep`, anchors and staleness.
|
|
@@ -460,8 +466,8 @@ last-writer-wins over whole records.
|
|
|
460
466
|
|
|
461
467
|
**Guards are proved by mutation.** Every refusal and every invariant is
|
|
462
468
|
accompanied by a mutation that removes it; a guard whose removal breaks no test
|
|
463
|
-
is treated as absent. The full suite:
|
|
464
|
-
(`bun test`, 2026-
|
|
469
|
+
is treated as absent. The full suite: 4192 pass / 0 fail / 16 skip
|
|
470
|
+
(`bun test`, 2026-10-02).
|
|
465
471
|
|
|
466
472
|
## What myc does
|
|
467
473
|
|
|
@@ -471,8 +477,9 @@ ranked hybrid search; the code index above; hooks and MCP for four agents;
|
|
|
471
477
|
the machine-wide queue for heavy commands; the status line; import from beads;
|
|
472
478
|
a local web interface (`myc viz`: graph, queue, board, cards, search, health —
|
|
473
479
|
edits go through the same write path as the CLI); git worktrees and nested
|
|
474
|
-
repositories;
|
|
475
|
-
|
|
480
|
+
repositories; a team server over Postgres with tokens, roles and ACL
|
|
481
|
+
(`myc serve`, see below); sync through git or through that server; and a
|
|
482
|
+
`doctor` that compares claims with a recount.
|
|
476
483
|
|
|
477
484
|
The full list — each capability with the release it arrived in and a command
|
|
478
485
|
that shows it on your machine, every command checked against this build's
|
|
@@ -492,14 +499,84 @@ In short: the core, memory, semantics and the human interface (M0–M2, M7) are
|
|
|
492
499
|
done or nearly done, and so is English output for every CLI and MCP line; code
|
|
493
500
|
intelligence (M3, including the built-in replacement for graft) and the
|
|
494
501
|
heavy-command queue have shipped, with tasks still open; the team milestone
|
|
495
|
-
(M4: `myc serve`, ACL, network sync, Postgres) is
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
502
|
+
(M4: `myc serve`, ACL, network sync, Postgres) is built and running — 10 of its
|
|
503
|
+
15 tasks are closed, and what is left is its own acceptance (a week of two
|
|
504
|
+
people and four agents on one server), hybrid search on Postgres, SSE deltas,
|
|
505
|
+
the `leader` and `full` MCP profiles, and a bulk SQLite→Postgres migration;
|
|
506
|
+
swarm self-learning (M5: routing by cost and outcome, with a shared pool of
|
|
507
|
+
agent statistics) and distillation (M6) have not started.
|
|
508
|
+
|
|
509
|
+
What that means in practice: **myc is a local tool first, and a team server
|
|
510
|
+
second — and the two are not the same thing.** Everything works locally over
|
|
511
|
+
files in git. The server exists, is tested against a live Postgres and is
|
|
512
|
+
described below, but only part of the CLI speaks to it; the rest refuses out
|
|
513
|
+
loud rather than quietly writing somewhere else.
|
|
514
|
+
|
|
515
|
+
## The team server
|
|
516
|
+
|
|
517
|
+
One command gives a server you can actually use — no manual steps:
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
docker compose -f deploy/compose.yml up -d
|
|
521
|
+
docker compose -f deploy/compose.yml logs server | grep 'bootstrap token'
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
Postgres runs the schema itself on an empty volume, and the server registers
|
|
525
|
+
the first tenant and mints the first token from `MYC_BOOTSTRAP_*`. That sample
|
|
526
|
+
deployment is not production: the password is in the open, there is no TLS,
|
|
527
|
+
and the database sits in a volume next to it. TLS is the deployment's job —
|
|
528
|
+
put a reverse proxy in front and let it set `X-Forwarded-Proto`.
|
|
529
|
+
|
|
530
|
+
Without containers it is the same binary:
|
|
531
|
+
|
|
532
|
+
```bash
|
|
533
|
+
myc serve --pg postgres://myc_app:…@host/myc --apply-schema # empty db only
|
|
534
|
+
myc serve --pg … --add-tenant acme
|
|
535
|
+
myc serve --pg … --add-token acme:anna --role owner # secret printed once
|
|
536
|
+
myc serve --pg … --port 8080
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
Everything but the liveness probe `/v1/health` needs a token. A token stores
|
|
540
|
+
only its sha256, so a copy of the database gives no access and nobody can read
|
|
541
|
+
a secret back. Roles are `owner`, `maintainer`, `member`, `agent`, `viewer`;
|
|
542
|
+
rights are `read`, `write`, `claim`, `sync`, `admin`, and `--scopes` narrows
|
|
543
|
+
what a role means. `sync` is deliberately not part of `read`: a replica is not
|
|
544
|
+
filtered by the visibility predicate, so the right to pull one is the right to
|
|
545
|
+
see everything in the workspace. The admin page at `/v1/admin` asks a browser
|
|
546
|
+
for a token in a form and keeps it in an HttpOnly, SameSite=Strict cookie.
|
|
547
|
+
|
|
548
|
+
A client points at the server through the environment, never the command line
|
|
549
|
+
(arguments are visible in `ps`, in shell history and in hook logs):
|
|
550
|
+
|
|
551
|
+
```bash
|
|
552
|
+
export MYC_SERVER=https://myc.example/acme # workspace in the path
|
|
553
|
+
export MYC_TOKEN=myc_…
|
|
554
|
+
myc ready
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
**Only part of the CLI speaks to a server, and this is the important part.**
|
|
558
|
+
Working remotely today: `create`/`task`/`bug`/`epic`/`msg`, `update`, `claim`,
|
|
559
|
+
`list`, `ready`, `show`, `prime` and `sync`. Everything else — `close`,
|
|
560
|
+
`remember`, `recall`, `comment`, `link`, `dep`, `attempt`, `search`, `code` —
|
|
561
|
+
refuses with `precond.no_remote` instead of silently using the local database,
|
|
562
|
+
because seeing someone else's tasks and taking them for the team's is worse
|
|
563
|
+
than an error. So the server is a place where replicas **meet**, not yet a
|
|
564
|
+
place where the whole working loop lives.
|
|
565
|
+
|
|
566
|
+
That is why the normal shape today is: every machine keeps its own local
|
|
567
|
+
workspace and exchanges through the server.
|
|
568
|
+
|
|
569
|
+
```bash
|
|
570
|
+
myc sync # both ways; --push-only, --pull-only, --dry-run
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
The exchange carries operations, not rows: deduplicated by `op_id`, replayed
|
|
574
|
+
through the same CRDT path as a git merge (per-field LWW, add-wins edges,
|
|
575
|
+
G-counters), with a cursor per site, so repeating it changes nothing and an
|
|
576
|
+
interrupted exchange resumes.
|
|
577
|
+
|
|
578
|
+
Step by step, for a real host with TLS, tokens per person, backups and what
|
|
579
|
+
to do when something refuses: [`docs/deploy.md`](docs/deploy.md).
|
|
503
580
|
|
|
504
581
|
## Syncing between machines
|
|
505
582
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var N0=Object.create;var{getPrototypeOf:I0,defineProperty:H0,getOwnPropertyNames:b0}=Object;var h0=Object.prototype.hasOwnProperty;function x0(Q){return this[Q]}var y0,f0,g0=(Q,Z,$)=>{var J=Q!=null&&typeof Q==="object";if(J){var q=Z?y0??=new WeakMap:f0??=new WeakMap,H=q.get(Q);if(H)return H}$=Q!=null?N0(I0(Q)):{};let U=Z||!Q||!Q.__esModule?H0($,"default",{value:Q,enumerable:!0}):$;for(let Y of b0(Q))if(!h0.call(U,Y))H0(U,Y,{get:x0.bind(Q,Y),enumerable:!0});if(J)q.set(Q,U);return U};var M0=(Q,Z)=>()=>(Z||Q((Z={exports:{}}).exports,Z),Z.exports);var t=import.meta.require;var Y0=M0((m,g)=>{var __dirname="/Users/egortaranin/src/memory/node_modules/.bun/web-tree-sitter@0.24.7/node_modules/web-tree-sitter",X=typeof X<"u"?X:{},c0=typeof window=="object",r=typeof importScripts=="function",U0=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",m0=function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{constructor(){this.initialize()}initialize(){throw Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){if(initPromise)return initPromise;return X=Object.assign({},X,moduleOptions),initPromise=new Promise((resolveInitPromise)=>{var moduleOverrides=Object.assign({},X),arguments_=[],thisProgram="./this.program",quit_=(Q,Z)=>{throw Z},scriptDirectory="";function locateFile(Q){if(X.locateFile)return X.locateFile(Q,scriptDirectory);return scriptDirectory+Q}var readAsync,readBinary;if(U0){var fs=t("fs"),nodePath=t("path");if(scriptDirectory=__dirname+"/",readBinary=(Q)=>{Q=isFileURI(Q)?new URL(Q):nodePath.normalize(Q);var Z=fs.readFileSync(Q);return Z},readAsync=(Q,Z=!0)=>{return Q=isFileURI(Q)?new URL(Q):nodePath.normalize(Q),new Promise(($,J)=>{fs.readFile(Q,Z?void 0:"utf8",(q,H)=>{if(q)J(q);else $(Z?H.buffer:H)})})},!X.thisProgram&&process.argv.length>1)thisProgram=process.argv[1].replace(/\\/g,"/");if(arguments_=process.argv.slice(2),typeof g<"u")g.exports=X;quit_=(Q,Z)=>{throw process.exitCode=Q,Z}}else if(c0||r){if(r)scriptDirectory=self.location.href;else if(typeof document<"u"&&document.currentScript)scriptDirectory=document.currentScript.src;if(scriptDirectory.startsWith("blob:"))scriptDirectory="";else scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1);{if(r)readBinary=(Q)=>{var Z=new XMLHttpRequest;return Z.open("GET",Q,!1),Z.responseType="arraybuffer",Z.send(null),new Uint8Array(Z.response)};readAsync=(Q)=>{if(isFileURI(Q))return new Promise((Z,$)=>{var J=new XMLHttpRequest;J.open("GET",Q,!0),J.responseType="arraybuffer",J.onload=()=>{if(J.status==200||J.status==0&&J.response)$(J.response);Z(J.status)},J.onerror=Z,J.send(null)});return fetch(Q,{credentials:"same-origin"}).then((Z)=>{if(Z.ok)return Z.arrayBuffer();return Promise.reject(Error(Z.status+" : "+Z.url))})}}}var out=X.print||console.log.bind(console),err=X.printErr||console.error.bind(console);if(Object.assign(X,moduleOverrides),moduleOverrides=null,X.arguments)arguments_=X.arguments;if(X.thisProgram)thisProgram=X.thisProgram;if(X.quit)quit_=X.quit;var dynamicLibraries=X.dynamicLibraries||[],wasmBinary;if(X.wasmBinary)wasmBinary=X.wasmBinary;var wasmMemory,ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP_DATA_VIEW;function updateMemoryViews(){var Q=wasmMemory.buffer;X.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(Q),X.HEAP8=HEAP8=new Int8Array(Q),X.HEAP16=HEAP16=new Int16Array(Q),X.HEAPU8=HEAPU8=new Uint8Array(Q),X.HEAPU16=HEAPU16=new Uint16Array(Q),X.HEAP32=HEAP32=new Int32Array(Q),X.HEAPU32=HEAPU32=new Uint32Array(Q),X.HEAPF32=HEAPF32=new Float32Array(Q),X.HEAPF64=HEAPF64=new Float64Array(Q)}if(X.wasmMemory)wasmMemory=X.wasmMemory;else{var INITIAL_MEMORY=X.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(X.preRun){if(typeof X.preRun=="function")X.preRun=[X.preRun];while(X.preRun.length)addOnPreRun(X.preRun.shift())}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(X.postRun){if(typeof X.postRun=="function")X.postRun=[X.postRun];while(X.postRun.length)addOnPostRun(X.postRun.shift())}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(Q){__ATPRERUN__.unshift(Q)}function addOnInit(Q){__ATINIT__.unshift(Q)}function addOnPostRun(Q){__ATPOSTRUN__.unshift(Q)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(Q){return Q}function addRunDependency(Q){runDependencies++,X.monitorRunDependencies?.(runDependencies)}function removeRunDependency(Q){if(runDependencies--,X.monitorRunDependencies?.(runDependencies),runDependencies==0){if(runDependencyWatcher!==null)clearInterval(runDependencyWatcher),runDependencyWatcher=null;if(dependenciesFulfilled){var Z=dependenciesFulfilled;dependenciesFulfilled=null,Z()}}}function abort(Q){X.onAbort?.(Q),Q="Aborted("+Q+")",err(Q),ABORT=!0,EXITSTATUS=1,Q+=". Build with -sASSERTIONS for more info.";var Z=new WebAssembly.RuntimeError(Q);throw Z}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=(Q)=>Q.startsWith(dataURIPrefix),isFileURI=(Q)=>Q.startsWith("file://");function findWasmBinary(){var Q="tree-sitter.wasm";if(!isDataURI(Q))return locateFile(Q);return Q}var wasmBinaryFile;function getBinarySync(Q){if(Q==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(Q);throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(Q){if(!wasmBinary)return readAsync(Q).then((Z)=>new Uint8Array(Z),()=>getBinarySync(Q));return Promise.resolve().then(()=>getBinarySync(Q))}function instantiateArrayBuffer(Q,Z,$){return getBinaryPromise(Q).then((J)=>WebAssembly.instantiate(J,Z)).then($,(J)=>{err(`failed to asynchronously prepare wasm: ${J}`),abort(J)})}function instantiateAsync(Q,Z,$,J){if(!Q&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(Z)&&!isFileURI(Z)&&!U0&&typeof fetch=="function")return fetch(Z,{credentials:"same-origin"}).then((q)=>{var H=WebAssembly.instantiateStreaming(q,$);return H.then(J,function(U){return err(`wasm streaming compile failed: ${U}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(Z,$,J)})});return instantiateArrayBuffer(Z,$,J)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}function createWasm(){var Q=getWasmImports();function Z(J,q){wasmExports=J.exports,wasmExports=relocateExports(wasmExports,1024);var H=getDylinkMetadata(q);if(H.neededDynlibs)dynamicLibraries=H.neededDynlibs.concat(dynamicLibraries);return mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}addRunDependency("wasm-instantiate");function $(J){Z(J.instance,J.module)}if(X.instantiateWasm)try{return X.instantiateWasm(Q,Z)}catch(J){return err(`Module.instantiateWasm callback failed with error: ${J}`),!1}if(!wasmBinaryFile)wasmBinaryFile=findWasmBinary();return instantiateAsync(wasmBinary,wasmBinaryFile,Q,$),{}}var ASM_CONSTS={};function ExitStatus(Q){this.name="ExitStatus",this.message=`Program terminated with exit(${Q})`,this.status=Q}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(Q,Z){var $=GOT[Z];if(!$)$=GOT[Z]=new WebAssembly.Global({value:"i32",mutable:!0});if(!currentModuleWeakSymbols.has(Z))$.required=!0;return $}},LE_HEAP_LOAD_F32=(Q)=>HEAP_DATA_VIEW.getFloat32(Q,!0),LE_HEAP_LOAD_F64=(Q)=>HEAP_DATA_VIEW.getFloat64(Q,!0),LE_HEAP_LOAD_I16=(Q)=>HEAP_DATA_VIEW.getInt16(Q,!0),LE_HEAP_LOAD_I32=(Q)=>HEAP_DATA_VIEW.getInt32(Q,!0),LE_HEAP_LOAD_U32=(Q)=>HEAP_DATA_VIEW.getUint32(Q,!0),LE_HEAP_STORE_F32=(Q,Z)=>HEAP_DATA_VIEW.setFloat32(Q,Z,!0),LE_HEAP_STORE_F64=(Q,Z)=>HEAP_DATA_VIEW.setFloat64(Q,Z,!0),LE_HEAP_STORE_I16=(Q,Z)=>HEAP_DATA_VIEW.setInt16(Q,Z,!0),LE_HEAP_STORE_I32=(Q,Z)=>HEAP_DATA_VIEW.setInt32(Q,Z,!0),LE_HEAP_STORE_U32=(Q,Z)=>HEAP_DATA_VIEW.setUint32(Q,Z,!0),callRuntimeCallbacks=(Q)=>{while(Q.length>0)Q.shift()(X)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=(Q,Z,$)=>{var J=Z+$,q=Z;while(Q[q]&&!(q>=J))++q;if(q-Z>16&&Q.buffer&&UTF8Decoder)return UTF8Decoder.decode(Q.subarray(Z,q));var H="";while(Z<q){var U=Q[Z++];if(!(U&128)){H+=String.fromCharCode(U);continue}var Y=Q[Z++]&63;if((U&224)==192){H+=String.fromCharCode((U&31)<<6|Y);continue}var j=Q[Z++]&63;if((U&240)==224)U=(U&15)<<12|Y<<6|j;else U=(U&7)<<18|Y<<12|j<<6|Q[Z++]&63;if(U<65536)H+=String.fromCharCode(U);else{var W=U-65536;H+=String.fromCharCode(55296|W>>10,56320|W&1023)}}return H},getDylinkMetadata=(Q)=>{var Z=0,$=0;function J(){return Q[Z++]}function q(){var B=0,_=1;while(!0){var A=Q[Z++];if(B+=(A&127)*_,_*=128,!(A&128))break}return B}function H(){var B=q();return Z+=B,UTF8ArrayToString(Q,Z-B,B)}function U(B,_){if(B)throw Error(_)}var Y="dylink.0";if(Q instanceof WebAssembly.Module){var j=WebAssembly.Module.customSections(Q,Y);if(j.length===0)Y="dylink",j=WebAssembly.Module.customSections(Q,Y);U(j.length===0,"need dylink section"),Q=new Uint8Array(j[0]),$=Q.length}else{var W=new Uint32Array(new Uint8Array(Q.subarray(0,24)).buffer),k=W[0]==1836278016||W[0]==6386541;U(!k,"need to see wasm magic number"),U(Q[8]!==0,"need the dylink section to be first"),Z=9;var F=q();$=Z+F,Y=H()}var z={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(Y=="dylink"){z.memorySize=q(),z.memoryAlign=q(),z.tableSize=q(),z.tableAlign=q();var G=q();for(var K=0;K<G;++K){var w=H();z.neededDynlibs.push(w)}}else{U(Y!=="dylink.0");var D=1,V=2,R=3,T=4,S=256,b=3,L=1;while(Z<$){var E=J(),h=q();if(E===D)z.memorySize=q(),z.memoryAlign=q(),z.tableSize=q(),z.tableAlign=q();else if(E===V){var G=q();for(var K=0;K<G;++K)w=H(),z.neededDynlibs.push(w)}else if(E===R){var N=q();while(N--){var y=H(),x=q();if(x&S)z.tlsExports.add(y)}}else if(E===T){var N=q();while(N--){var q0=H(),y=H(),x=q();if((x&b)==L)z.weakImports.add(y)}}else Z+=h}}return z};function getValue(Q,Z="i8"){if(Z.endsWith("*"))Z="*";switch(Z){case"i1":return HEAP8[Q];case"i8":return HEAP8[Q];case"i16":return LE_HEAP_LOAD_I16((Q>>1)*2);case"i32":return LE_HEAP_LOAD_I32((Q>>2)*4);case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return LE_HEAP_LOAD_F32((Q>>2)*4);case"double":return LE_HEAP_LOAD_F64((Q>>3)*8);case"*":return LE_HEAP_LOAD_U32((Q>>2)*4);default:abort(`invalid type for getValue: ${Z}`)}}var newDSO=(Q,Z,$)=>{var J={refcount:1/0,name:Q,exports:$,global:!0};if(LDSO.loadedLibsByName[Q]=J,Z!=null)LDSO.loadedLibsByHandle[Z]=J;return J},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78112,zeroMemory=(Q,Z)=>{return HEAPU8.fill(0,Q,Q+Z),Q},alignMemory=(Q,Z)=>Math.ceil(Q/Z)*Z,getMemory=(Q)=>{if(runtimeInitialized)return zeroMemory(_malloc(Q),Q);var Z=___heap_base,$=Z+alignMemory(Q,16);return ___heap_base=$,GOT.__heap_base.value=$,Z},isInternalSym=(Q)=>["__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(Q)||Q.startsWith("__em_js__"),uleb128Encode=(Q,Z)=>{if(Q<128)Z.push(Q);else Z.push(Q%128|128,Q>>7)},sigToWasmTypes=(Q)=>{var Z={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},$={parameters:[],results:Q[0]=="v"?[]:[Z[Q[0]]]};for(var J=1;J<Q.length;++J)$.parameters.push(Z[Q[J]]);return $},generateFuncType=(Q,Z)=>{var $=Q.slice(0,1),J=Q.slice(1),q={i:127,p:127,j:126,f:125,d:124,e:111};Z.push(96),uleb128Encode(J.length,Z);for(var H=0;H<J.length;++H)Z.push(q[J[H]]);if($=="v")Z.push(0);else Z.push(1,q[$])},convertJsFunctionToWasm=(Q,Z)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(Z),Q);var $=[1];generateFuncType(Z,$);var J=[0,97,115,109,1,0,0,0,1];uleb128Encode($.length,J),J.push(...$),J.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var q=new WebAssembly.Module(new Uint8Array(J)),H=new WebAssembly.Instance(q,{e:{f:Q}}),U=H.exports.f;return U},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:28,element:"anyfunc"}),getWasmTableEntry=(Q)=>{var Z=wasmTableMirror[Q];if(!Z){if(Q>=wasmTableMirror.length)wasmTableMirror.length=Q+1;wasmTableMirror[Q]=Z=wasmTable.get(Q)}return Z},updateTableMap=(Q,Z)=>{if(functionsInTableMap)for(var $=Q;$<Q+Z;$++){var J=getWasmTableEntry($);if(J)functionsInTableMap.set(J,$)}},functionsInTableMap,getFunctionAddress=(Q)=>{if(!functionsInTableMap)functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length);return functionsInTableMap.get(Q)||0},freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(Q){if(!(Q instanceof RangeError))throw Q;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return wasmTable.length-1},setWasmTableEntry=(Q,Z)=>{wasmTable.set(Q,Z),wasmTableMirror[Q]=wasmTable.get(Q)},addFunction=(Q,Z)=>{var $=getFunctionAddress(Q);if($)return $;var J=getEmptyTableSlot();try{setWasmTableEntry(J,Q)}catch(H){if(!(H instanceof TypeError))throw H;var q=convertJsFunctionToWasm(Q,Z);setWasmTableEntry(J,q)}return functionsInTableMap.set(Q,J),J},updateGOT=(Q,Z)=>{for(var $ in Q){if(isInternalSym($))continue;var J=Q[$];if($.startsWith("orig$"))$=$.split("$")[1],Z=!0;if(GOT[$]||=new WebAssembly.Global({value:"i32",mutable:!0}),Z||GOT[$].value==0)if(typeof J=="function")GOT[$].value=addFunction(J);else if(typeof J=="number")GOT[$].value=J;else err(`unhandled export type for '${$}': ${typeof J}`)}},relocateExports=(Q,Z,$)=>{var J={};for(var q in Q){var H=Q[q];if(typeof H=="object")H=H.value;if(typeof H=="number")H+=Z;J[q]=H}return updateGOT(J,$),J},isSymbolDefined=(Q)=>{var Z=wasmImports[Q];if(!Z||Z.stub)return!1;return!0},dynCallLegacy=(Q,Z,$)=>{Q=Q.replace(/p/g,"i");var J=X["dynCall_"+Q];return J(Z,...$)},dynCall=(Q,Z,$=[])=>{if(Q.includes("j"))return dynCallLegacy(Q,Z,$);var J=getWasmTableEntry(Z)(...$);return J},stackSave=()=>_emscripten_stack_get_current(),stackRestore=(Q)=>__emscripten_stack_restore(Q),createInvokeFunction=(Q)=>(Z,...$)=>{var J=stackSave();try{return dynCall(Q,Z,$)}catch(q){if(stackRestore(J),q!==q+0)throw q;_setThrew(1,0)}},resolveGlobalSymbol=(Q,Z=!1)=>{var $;if(Z&&"orig$"+Q in wasmImports)Q="orig$"+Q;if(isSymbolDefined(Q))$=wasmImports[Q];else if(Q.startsWith("invoke_"))$=wasmImports[Q]=createInvokeFunction(Q.split("_")[1]);return{sym:$,name:Q}},UTF8ToString=(Q,Z)=>Q?UTF8ArrayToString(HEAPU8,Q,Z):"",loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;if(handle)HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize)}else memoryBase=LE_HEAP_LOAD_U32((handle+12>>2)*4),tableBase=LE_HEAP_LOAD_U32((handle+20>>2)*4);var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;if(tableGrowthNeeded>0)wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(Q){var Z=resolveGlobalSymbol(Q).sym;if(!Z&&localScope)Z=localScope[Q];if(!Z)Z=moduleExports[Q];return Z}var proxyHandler={get(Q,Z){switch(Z){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(Z in wasmImports&&!wasmImports[Z].stub)return wasmImports[Z];if(!(Z in Q)){var $;Q[Z]=(...J)=>{return $||=resolveSymbol(Z),$(...J)}}return Q[Z]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),!flags.allowUndefined)reportUndefinedSymbols();function addEmAsm(addr,body){var args=[],arity=0;for(;arity<16;arity++)if(body.indexOf("$"+arity)!=-1)args.push("$"+arity);else break;args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports){var{__start_em_asm:start,__stop_em_asm:stop}=moduleExports;while(start<stop){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;if(applyRelocs)if(runtimeInitialized)applyRelocs();else __RELOC_FUNCS__.push(applyRelocs);var init=moduleExports.__wasm_call_ctors;if(init)if(runtimeInitialized)init();else __ATINIT__.push(init);return moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then((Q)=>postInstantiation(Q.module,Q.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}if(flags.loadAsync)return metadata.neededDynlibs.reduce((Q,Z)=>Q.then(()=>loadDynamicLibrary(Z,flags,localScope)),Promise.resolve()).then(loadModule);return metadata.neededDynlibs.forEach((Q)=>loadDynamicLibrary(Q,flags,localScope)),loadModule()},mergeLibSymbols=(Q,Z)=>{for(var[$,J]of Object.entries(Q)){let q=(U)=>{if(!isSymbolDefined(U))wasmImports[U]=J};q($);let H="__main_argc_argv";if($=="main")q(H);if($==H)q("main");if($.startsWith("dynCall_")&&!X.hasOwnProperty($))X[$]=J}},asyncLoad=(Q,Z,$,J)=>{var q=!J?getUniqueRunDependency(`al ${Q}`):"";if(readAsync(Q).then((H)=>{if(Z(new Uint8Array(H)),q)removeRunDependency(q)},(H)=>{if($)$();else throw`Loading data file "${Q}" failed.`}),q)addRunDependency(q)};function loadDynamicLibrary(Q,Z={global:!0,nodelete:!0},$,J){var q=LDSO.loadedLibsByName[Q];if(q){if(!Z.global){if($)Object.assign($,q.exports)}else if(!q.global)q.global=!0,mergeLibSymbols(q.exports,Q);if(Z.nodelete&&q.refcount!==1/0)q.refcount=1/0;if(q.refcount++,J)LDSO.loadedLibsByHandle[J]=q;return Z.loadAsync?Promise.resolve(!0):!0}q=newDSO(Q,J,"loading"),q.refcount=Z.nodelete?1/0:1,q.global=Z.global;function H(){if(J){var j=LE_HEAP_LOAD_U32((J+28>>2)*4),W=LE_HEAP_LOAD_U32((J+32>>2)*4);if(j&&W){var k=HEAP8.slice(j,j+W);return Z.loadAsync?Promise.resolve(k):k}}var F=locateFile(Q);if(Z.loadAsync)return new Promise(function(z,G){asyncLoad(F,z,G)});if(!readBinary)throw Error(`${F}: file not found, and synchronous loading of external files is not available`);return readBinary(F)}function U(){if(Z.loadAsync)return H().then((j)=>loadWebAssemblyModule(j,Z,Q,$,J));return loadWebAssemblyModule(H(),Z,Q,$,J)}function Y(j){if(q.global)mergeLibSymbols(j,Q);else if($)Object.assign($,j);q.exports=j}if(Z.loadAsync)return U().then((j)=>{return Y(j),!0});return Y(U()),!0}var reportUndefinedSymbols=()=>{for(var[Q,Z]of Object.entries(GOT))if(Z.value==0){var $=resolveGlobalSymbol(Q,!0).sym;if(!$&&!Z.required)continue;if(typeof $=="function")Z.value=addFunction($,$.sig);else if(typeof $=="number")Z.value=$;else throw Error(`bad export type for '${Q}': ${typeof $}`)}},loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((Q,Z)=>Q.then(()=>loadDynamicLibrary(Z,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},noExitRuntime=X.noExitRuntime||!0;function setValue(Q,Z,$="i8"){if($.endsWith("*"))$="*";switch($){case"i1":HEAP8[Q]=Z;break;case"i8":HEAP8[Q]=Z;break;case"i16":LE_HEAP_STORE_I16((Q>>1)*2,Z);break;case"i32":LE_HEAP_STORE_I32((Q>>2)*4,Z);break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":LE_HEAP_STORE_F32((Q>>2)*4,Z);break;case"double":LE_HEAP_STORE_F64((Q>>3)*8,Z);break;case"*":LE_HEAP_STORE_U32((Q>>2)*4,Z);break;default:abort(`invalid type for setValue: ${$}`)}}var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78112),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=()=>{abort("")};__abort_js.sig="v";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=()=>nowIsMonotonic;__emscripten_get_now_is_monotonic.sig="i";var __emscripten_memcpy_js=(Q,Z,$)=>HEAPU8.copyWithin(Q,Z,Z+$);__emscripten_memcpy_js.sig="vppp";var _emscripten_date_now=()=>Date.now();_emscripten_date_now.sig="d";var _emscripten_get_now=()=>performance.now();_emscripten_get_now.sig="d";var getHeapMax=()=>2147483648,growMemory=(Q)=>{var Z=wasmMemory.buffer,$=(Q-Z.byteLength+65535)/65536;try{return wasmMemory.grow($),updateMemoryViews(),1}catch(J){}},_emscripten_resize_heap=(Q)=>{var Z=HEAPU8.length;Q>>>=0;var $=getHeapMax();if(Q>$)return!1;var J=(j,W)=>j+(W-j%W)%W;for(var q=1;q<=4;q*=2){var H=Z*(1+0.2/q);H=Math.min(H,Q+100663296);var U=Math.min($,J(Math.max(Q,H),65536)),Y=growMemory(U);if(Y)return!0}return!1};_emscripten_resize_heap.sig="ip";var _fd_close=(Q)=>52;_fd_close.sig="ii";var convertI32PairToI53Checked=(Q,Z)=>Z+2097152>>>0<4194305-!!Q?(Q>>>0)+Z*4294967296:NaN;function _fd_seek(Q,Z,$,J,q){var H=convertI32PairToI53Checked(Z,$);return 70}_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=(Q,Z)=>{var $=printCharBuffers[Q];if(Z===0||Z===10)(Q===1?out:err)(UTF8ArrayToString($,0)),$.length=0;else $.push(Z)},_fd_write=(Q,Z,$,J)=>{var q=0;for(var H=0;H<$;H++){var U=LE_HEAP_LOAD_U32((Z>>2)*4),Y=LE_HEAP_LOAD_U32((Z+4>>2)*4);Z+=8;for(var j=0;j<Y;j++)printChar(Q,HEAPU8[U+j]);q+=Y}return LE_HEAP_STORE_U32((J>>2)*4,q),0};_fd_write.sig="iippp";function _tree_sitter_log_callback(Q,Z){if(currentLogCallback){let $=UTF8ToString(Z);currentLogCallback($,Q!==0)}}function _tree_sitter_parse_callback(Q,Z,$,J,q){let U=currentParseCallback(Z,{row:$,column:J});if(typeof U==="string")setValue(q,U.length,"i32"),stringToUTF16(U,Q,10240);else setValue(q,0,"i32")}var runtimeKeepaliveCounter=0,keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=(Q)=>{if(EXITSTATUS=Q,!keepRuntimeAlive())X.onExit?.(Q),ABORT=!0;quit_(Q,new ExitStatus(Q))};_proc_exit.sig="vi";var exitJS=(Q,Z)=>{EXITSTATUS=Q,_proc_exit(Q)},handleException=(Q)=>{if(Q instanceof ExitStatus||Q=="unwind")return EXITSTATUS;quit_(1,Q)},lengthBytesUTF8=(Q)=>{var Z=0;for(var $=0;$<Q.length;++$){var J=Q.charCodeAt($);if(J<=127)Z++;else if(J<=2047)Z+=2;else if(J>=55296&&J<=57343)Z+=4,++$;else Z+=3}return Z},stringToUTF8Array=(Q,Z,$,J)=>{if(!(J>0))return 0;var q=$,H=$+J-1;for(var U=0;U<Q.length;++U){var Y=Q.charCodeAt(U);if(Y>=55296&&Y<=57343){var j=Q.charCodeAt(++U);Y=65536+((Y&1023)<<10)|j&1023}if(Y<=127){if($>=H)break;Z[$++]=Y}else if(Y<=2047){if($+1>=H)break;Z[$++]=192|Y>>6,Z[$++]=128|Y&63}else if(Y<=65535){if($+2>=H)break;Z[$++]=224|Y>>12,Z[$++]=128|Y>>6&63,Z[$++]=128|Y&63}else{if($+3>=H)break;Z[$++]=240|Y>>18,Z[$++]=128|Y>>12&63,Z[$++]=128|Y>>6&63,Z[$++]=128|Y&63}}return Z[$]=0,$-q},stringToUTF8=(Q,Z,$)=>stringToUTF8Array(Q,HEAPU8,Z,$),stackAlloc=(Q)=>__emscripten_stack_alloc(Q),stringToUTF8OnStack=(Q)=>{var Z=lengthBytesUTF8(Q)+1,$=stackAlloc(Z);return stringToUTF8(Q,$,Z),$},stringToUTF16=(Q,Z,$)=>{if($??=2147483647,$<2)return 0;$-=2;var J=Z,q=$<Q.length*2?$/2:Q.length;for(var H=0;H<q;++H){var U=Q.charCodeAt(H);LE_HEAP_STORE_I16((Z>>1)*2,U),Z+=2}return LE_HEAP_STORE_I16((Z>>1)*2,0),Z-J},AsciiToString=(Q)=>{var Z="";while(!0){var $=HEAPU8[Q++];if(!$)return Z;Z+=String.fromCharCode($)}},wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_get_now:_emscripten_get_now,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(),___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),___wasm_apply_data_relocs=()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),_malloc=X._malloc=(Q)=>(_malloc=X._malloc=wasmExports.malloc)(Q),_calloc=X._calloc=(Q,Z)=>(_calloc=X._calloc=wasmExports.calloc)(Q,Z),_realloc=X._realloc=(Q,Z)=>(_realloc=X._realloc=wasmExports.realloc)(Q,Z),_free=X._free=(Q)=>(_free=X._free=wasmExports.free)(Q),_ts_language_symbol_count=X._ts_language_symbol_count=(Q)=>(_ts_language_symbol_count=X._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(Q),_ts_language_state_count=X._ts_language_state_count=(Q)=>(_ts_language_state_count=X._ts_language_state_count=wasmExports.ts_language_state_count)(Q),_ts_language_version=X._ts_language_version=(Q)=>(_ts_language_version=X._ts_language_version=wasmExports.ts_language_version)(Q),_ts_language_field_count=X._ts_language_field_count=(Q)=>(_ts_language_field_count=X._ts_language_field_count=wasmExports.ts_language_field_count)(Q),_ts_language_next_state=X._ts_language_next_state=(Q,Z,$)=>(_ts_language_next_state=X._ts_language_next_state=wasmExports.ts_language_next_state)(Q,Z,$),_ts_language_symbol_name=X._ts_language_symbol_name=(Q,Z)=>(_ts_language_symbol_name=X._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(Q,Z),_ts_language_symbol_for_name=X._ts_language_symbol_for_name=(Q,Z,$,J)=>(_ts_language_symbol_for_name=X._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(Q,Z,$,J),_strncmp=X._strncmp=(Q,Z,$)=>(_strncmp=X._strncmp=wasmExports.strncmp)(Q,Z,$),_ts_language_symbol_type=X._ts_language_symbol_type=(Q,Z)=>(_ts_language_symbol_type=X._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(Q,Z),_ts_language_field_name_for_id=X._ts_language_field_name_for_id=(Q,Z)=>(_ts_language_field_name_for_id=X._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(Q,Z),_ts_lookahead_iterator_new=X._ts_lookahead_iterator_new=(Q,Z)=>(_ts_lookahead_iterator_new=X._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(Q,Z),_ts_lookahead_iterator_delete=X._ts_lookahead_iterator_delete=(Q)=>(_ts_lookahead_iterator_delete=X._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(Q),_ts_lookahead_iterator_reset_state=X._ts_lookahead_iterator_reset_state=(Q,Z)=>(_ts_lookahead_iterator_reset_state=X._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(Q,Z),_ts_lookahead_iterator_reset=X._ts_lookahead_iterator_reset=(Q,Z,$)=>(_ts_lookahead_iterator_reset=X._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(Q,Z,$),_ts_lookahead_iterator_next=X._ts_lookahead_iterator_next=(Q)=>(_ts_lookahead_iterator_next=X._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(Q),_ts_lookahead_iterator_current_symbol=X._ts_lookahead_iterator_current_symbol=(Q)=>(_ts_lookahead_iterator_current_symbol=X._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(Q),_memset=X._memset=(Q,Z,$)=>(_memset=X._memset=wasmExports.memset)(Q,Z,$),_memcpy=X._memcpy=(Q,Z,$)=>(_memcpy=X._memcpy=wasmExports.memcpy)(Q,Z,$),_ts_parser_delete=X._ts_parser_delete=(Q)=>(_ts_parser_delete=X._ts_parser_delete=wasmExports.ts_parser_delete)(Q),_ts_parser_reset=X._ts_parser_reset=(Q)=>(_ts_parser_reset=X._ts_parser_reset=wasmExports.ts_parser_reset)(Q),_ts_parser_set_language=X._ts_parser_set_language=(Q,Z)=>(_ts_parser_set_language=X._ts_parser_set_language=wasmExports.ts_parser_set_language)(Q,Z),_ts_parser_timeout_micros=X._ts_parser_timeout_micros=(Q)=>(_ts_parser_timeout_micros=X._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(Q),_ts_parser_set_timeout_micros=X._ts_parser_set_timeout_micros=(Q,Z,$)=>(_ts_parser_set_timeout_micros=X._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(Q,Z,$),_ts_parser_set_included_ranges=X._ts_parser_set_included_ranges=(Q,Z,$)=>(_ts_parser_set_included_ranges=X._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(Q,Z,$),_memmove=X._memmove=(Q,Z,$)=>(_memmove=X._memmove=wasmExports.memmove)(Q,Z,$),_memcmp=X._memcmp=(Q,Z,$)=>(_memcmp=X._memcmp=wasmExports.memcmp)(Q,Z,$),_ts_query_new=X._ts_query_new=(Q,Z,$,J,q)=>(_ts_query_new=X._ts_query_new=wasmExports.ts_query_new)(Q,Z,$,J,q),_ts_query_delete=X._ts_query_delete=(Q)=>(_ts_query_delete=X._ts_query_delete=wasmExports.ts_query_delete)(Q),_iswspace=X._iswspace=(Q)=>(_iswspace=X._iswspace=wasmExports.iswspace)(Q),_iswalnum=X._iswalnum=(Q)=>(_iswalnum=X._iswalnum=wasmExports.iswalnum)(Q),_ts_query_pattern_count=X._ts_query_pattern_count=(Q)=>(_ts_query_pattern_count=X._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(Q),_ts_query_capture_count=X._ts_query_capture_count=(Q)=>(_ts_query_capture_count=X._ts_query_capture_count=wasmExports.ts_query_capture_count)(Q),_ts_query_string_count=X._ts_query_string_count=(Q)=>(_ts_query_string_count=X._ts_query_string_count=wasmExports.ts_query_string_count)(Q),_ts_query_capture_name_for_id=X._ts_query_capture_name_for_id=(Q,Z,$)=>(_ts_query_capture_name_for_id=X._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(Q,Z,$),_ts_query_string_value_for_id=X._ts_query_string_value_for_id=(Q,Z,$)=>(_ts_query_string_value_for_id=X._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(Q,Z,$),_ts_query_predicates_for_pattern=X._ts_query_predicates_for_pattern=(Q,Z,$)=>(_ts_query_predicates_for_pattern=X._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(Q,Z,$),_ts_query_disable_capture=X._ts_query_disable_capture=(Q,Z,$)=>(_ts_query_disable_capture=X._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(Q,Z,$),_ts_tree_copy=X._ts_tree_copy=(Q)=>(_ts_tree_copy=X._ts_tree_copy=wasmExports.ts_tree_copy)(Q),_ts_tree_delete=X._ts_tree_delete=(Q)=>(_ts_tree_delete=X._ts_tree_delete=wasmExports.ts_tree_delete)(Q),_ts_init=X._ts_init=()=>(_ts_init=X._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=X._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=X._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=X._ts_parser_enable_logger_wasm=(Q,Z)=>(_ts_parser_enable_logger_wasm=X._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(Q,Z),_ts_parser_parse_wasm=X._ts_parser_parse_wasm=(Q,Z,$,J,q)=>(_ts_parser_parse_wasm=X._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(Q,Z,$,J,q),_ts_parser_included_ranges_wasm=X._ts_parser_included_ranges_wasm=(Q)=>(_ts_parser_included_ranges_wasm=X._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(Q),_ts_language_type_is_named_wasm=X._ts_language_type_is_named_wasm=(Q,Z)=>(_ts_language_type_is_named_wasm=X._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(Q,Z),_ts_language_type_is_visible_wasm=X._ts_language_type_is_visible_wasm=(Q,Z)=>(_ts_language_type_is_visible_wasm=X._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(Q,Z),_ts_tree_root_node_wasm=X._ts_tree_root_node_wasm=(Q)=>(_ts_tree_root_node_wasm=X._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(Q),_ts_tree_root_node_with_offset_wasm=X._ts_tree_root_node_with_offset_wasm=(Q)=>(_ts_tree_root_node_with_offset_wasm=X._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(Q),_ts_tree_edit_wasm=X._ts_tree_edit_wasm=(Q)=>(_ts_tree_edit_wasm=X._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(Q),_ts_tree_included_ranges_wasm=X._ts_tree_included_ranges_wasm=(Q)=>(_ts_tree_included_ranges_wasm=X._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(Q),_ts_tree_get_changed_ranges_wasm=X._ts_tree_get_changed_ranges_wasm=(Q,Z)=>(_ts_tree_get_changed_ranges_wasm=X._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(Q,Z),_ts_tree_cursor_new_wasm=X._ts_tree_cursor_new_wasm=(Q)=>(_ts_tree_cursor_new_wasm=X._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(Q),_ts_tree_cursor_delete_wasm=X._ts_tree_cursor_delete_wasm=(Q)=>(_ts_tree_cursor_delete_wasm=X._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(Q),_ts_tree_cursor_reset_wasm=X._ts_tree_cursor_reset_wasm=(Q)=>(_ts_tree_cursor_reset_wasm=X._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(Q),_ts_tree_cursor_reset_to_wasm=X._ts_tree_cursor_reset_to_wasm=(Q,Z)=>(_ts_tree_cursor_reset_to_wasm=X._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(Q,Z),_ts_tree_cursor_goto_first_child_wasm=X._ts_tree_cursor_goto_first_child_wasm=(Q)=>(_ts_tree_cursor_goto_first_child_wasm=X._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(Q),_ts_tree_cursor_goto_last_child_wasm=X._ts_tree_cursor_goto_last_child_wasm=(Q)=>(_ts_tree_cursor_goto_last_child_wasm=X._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(Q),_ts_tree_cursor_goto_first_child_for_index_wasm=X._ts_tree_cursor_goto_first_child_for_index_wasm=(Q)=>(_ts_tree_cursor_goto_first_child_for_index_wasm=X._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(Q),_ts_tree_cursor_goto_first_child_for_position_wasm=X._ts_tree_cursor_goto_first_child_for_position_wasm=(Q)=>(_ts_tree_cursor_goto_first_child_for_position_wasm=X._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(Q),_ts_tree_cursor_goto_next_sibling_wasm=X._ts_tree_cursor_goto_next_sibling_wasm=(Q)=>(_ts_tree_cursor_goto_next_sibling_wasm=X._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(Q),_ts_tree_cursor_goto_previous_sibling_wasm=X._ts_tree_cursor_goto_previous_sibling_wasm=(Q)=>(_ts_tree_cursor_goto_previous_sibling_wasm=X._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(Q),_ts_tree_cursor_goto_descendant_wasm=X._ts_tree_cursor_goto_descendant_wasm=(Q,Z)=>(_ts_tree_cursor_goto_descendant_wasm=X._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(Q,Z),_ts_tree_cursor_goto_parent_wasm=X._ts_tree_cursor_goto_parent_wasm=(Q)=>(_ts_tree_cursor_goto_parent_wasm=X._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(Q),_ts_tree_cursor_current_node_type_id_wasm=X._ts_tree_cursor_current_node_type_id_wasm=(Q)=>(_ts_tree_cursor_current_node_type_id_wasm=X._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(Q),_ts_tree_cursor_current_node_state_id_wasm=X._ts_tree_cursor_current_node_state_id_wasm=(Q)=>(_ts_tree_cursor_current_node_state_id_wasm=X._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(Q),_ts_tree_cursor_current_node_is_named_wasm=X._ts_tree_cursor_current_node_is_named_wasm=(Q)=>(_ts_tree_cursor_current_node_is_named_wasm=X._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(Q),_ts_tree_cursor_current_node_is_missing_wasm=X._ts_tree_cursor_current_node_is_missing_wasm=(Q)=>(_ts_tree_cursor_current_node_is_missing_wasm=X._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(Q),_ts_tree_cursor_current_node_id_wasm=X._ts_tree_cursor_current_node_id_wasm=(Q)=>(_ts_tree_cursor_current_node_id_wasm=X._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(Q),_ts_tree_cursor_start_position_wasm=X._ts_tree_cursor_start_position_wasm=(Q)=>(_ts_tree_cursor_start_position_wasm=X._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(Q),_ts_tree_cursor_end_position_wasm=X._ts_tree_cursor_end_position_wasm=(Q)=>(_ts_tree_cursor_end_position_wasm=X._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(Q),_ts_tree_cursor_start_index_wasm=X._ts_tree_cursor_start_index_wasm=(Q)=>(_ts_tree_cursor_start_index_wasm=X._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(Q),_ts_tree_cursor_end_index_wasm=X._ts_tree_cursor_end_index_wasm=(Q)=>(_ts_tree_cursor_end_index_wasm=X._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(Q),_ts_tree_cursor_current_field_id_wasm=X._ts_tree_cursor_current_field_id_wasm=(Q)=>(_ts_tree_cursor_current_field_id_wasm=X._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(Q),_ts_tree_cursor_current_depth_wasm=X._ts_tree_cursor_current_depth_wasm=(Q)=>(_ts_tree_cursor_current_depth_wasm=X._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(Q),_ts_tree_cursor_current_descendant_index_wasm=X._ts_tree_cursor_current_descendant_index_wasm=(Q)=>(_ts_tree_cursor_current_descendant_index_wasm=X._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(Q),_ts_tree_cursor_current_node_wasm=X._ts_tree_cursor_current_node_wasm=(Q)=>(_ts_tree_cursor_current_node_wasm=X._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(Q),_ts_node_symbol_wasm=X._ts_node_symbol_wasm=(Q)=>(_ts_node_symbol_wasm=X._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(Q),_ts_node_field_name_for_child_wasm=X._ts_node_field_name_for_child_wasm=(Q,Z)=>(_ts_node_field_name_for_child_wasm=X._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(Q,Z),_ts_node_children_by_field_id_wasm=X._ts_node_children_by_field_id_wasm=(Q,Z)=>(_ts_node_children_by_field_id_wasm=X._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(Q,Z),_ts_node_first_child_for_byte_wasm=X._ts_node_first_child_for_byte_wasm=(Q)=>(_ts_node_first_child_for_byte_wasm=X._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(Q),_ts_node_first_named_child_for_byte_wasm=X._ts_node_first_named_child_for_byte_wasm=(Q)=>(_ts_node_first_named_child_for_byte_wasm=X._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(Q),_ts_node_grammar_symbol_wasm=X._ts_node_grammar_symbol_wasm=(Q)=>(_ts_node_grammar_symbol_wasm=X._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(Q),_ts_node_child_count_wasm=X._ts_node_child_count_wasm=(Q)=>(_ts_node_child_count_wasm=X._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(Q),_ts_node_named_child_count_wasm=X._ts_node_named_child_count_wasm=(Q)=>(_ts_node_named_child_count_wasm=X._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(Q),_ts_node_child_wasm=X._ts_node_child_wasm=(Q,Z)=>(_ts_node_child_wasm=X._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(Q,Z),_ts_node_named_child_wasm=X._ts_node_named_child_wasm=(Q,Z)=>(_ts_node_named_child_wasm=X._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(Q,Z),_ts_node_child_by_field_id_wasm=X._ts_node_child_by_field_id_wasm=(Q,Z)=>(_ts_node_child_by_field_id_wasm=X._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(Q,Z),_ts_node_next_sibling_wasm=X._ts_node_next_sibling_wasm=(Q)=>(_ts_node_next_sibling_wasm=X._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(Q),_ts_node_prev_sibling_wasm=X._ts_node_prev_sibling_wasm=(Q)=>(_ts_node_prev_sibling_wasm=X._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(Q),_ts_node_next_named_sibling_wasm=X._ts_node_next_named_sibling_wasm=(Q)=>(_ts_node_next_named_sibling_wasm=X._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(Q),_ts_node_prev_named_sibling_wasm=X._ts_node_prev_named_sibling_wasm=(Q)=>(_ts_node_prev_named_sibling_wasm=X._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(Q),_ts_node_descendant_count_wasm=X._ts_node_descendant_count_wasm=(Q)=>(_ts_node_descendant_count_wasm=X._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(Q),_ts_node_parent_wasm=X._ts_node_parent_wasm=(Q)=>(_ts_node_parent_wasm=X._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(Q),_ts_node_descendant_for_index_wasm=X._ts_node_descendant_for_index_wasm=(Q)=>(_ts_node_descendant_for_index_wasm=X._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(Q),_ts_node_named_descendant_for_index_wasm=X._ts_node_named_descendant_for_index_wasm=(Q)=>(_ts_node_named_descendant_for_index_wasm=X._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(Q),_ts_node_descendant_for_position_wasm=X._ts_node_descendant_for_position_wasm=(Q)=>(_ts_node_descendant_for_position_wasm=X._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(Q),_ts_node_named_descendant_for_position_wasm=X._ts_node_named_descendant_for_position_wasm=(Q)=>(_ts_node_named_descendant_for_position_wasm=X._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(Q),_ts_node_start_point_wasm=X._ts_node_start_point_wasm=(Q)=>(_ts_node_start_point_wasm=X._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(Q),_ts_node_end_point_wasm=X._ts_node_end_point_wasm=(Q)=>(_ts_node_end_point_wasm=X._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(Q),_ts_node_start_index_wasm=X._ts_node_start_index_wasm=(Q)=>(_ts_node_start_index_wasm=X._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(Q),_ts_node_end_index_wasm=X._ts_node_end_index_wasm=(Q)=>(_ts_node_end_index_wasm=X._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(Q),_ts_node_to_string_wasm=X._ts_node_to_string_wasm=(Q)=>(_ts_node_to_string_wasm=X._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(Q),_ts_node_children_wasm=X._ts_node_children_wasm=(Q)=>(_ts_node_children_wasm=X._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(Q),_ts_node_named_children_wasm=X._ts_node_named_children_wasm=(Q)=>(_ts_node_named_children_wasm=X._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(Q),_ts_node_descendants_of_type_wasm=X._ts_node_descendants_of_type_wasm=(Q,Z,$,J,q,H,U)=>(_ts_node_descendants_of_type_wasm=X._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(Q,Z,$,J,q,H,U),_ts_node_is_named_wasm=X._ts_node_is_named_wasm=(Q)=>(_ts_node_is_named_wasm=X._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(Q),_ts_node_has_changes_wasm=X._ts_node_has_changes_wasm=(Q)=>(_ts_node_has_changes_wasm=X._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(Q),_ts_node_has_error_wasm=X._ts_node_has_error_wasm=(Q)=>(_ts_node_has_error_wasm=X._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(Q),_ts_node_is_error_wasm=X._ts_node_is_error_wasm=(Q)=>(_ts_node_is_error_wasm=X._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(Q),_ts_node_is_missing_wasm=X._ts_node_is_missing_wasm=(Q)=>(_ts_node_is_missing_wasm=X._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(Q),_ts_node_is_extra_wasm=X._ts_node_is_extra_wasm=(Q)=>(_ts_node_is_extra_wasm=X._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(Q),_ts_node_parse_state_wasm=X._ts_node_parse_state_wasm=(Q)=>(_ts_node_parse_state_wasm=X._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(Q),_ts_node_next_parse_state_wasm=X._ts_node_next_parse_state_wasm=(Q)=>(_ts_node_next_parse_state_wasm=X._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(Q),_ts_query_matches_wasm=X._ts_query_matches_wasm=(Q,Z,$,J,q,H,U,Y,j,W,k)=>(_ts_query_matches_wasm=X._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(Q,Z,$,J,q,H,U,Y,j,W,k),_ts_query_captures_wasm=X._ts_query_captures_wasm=(Q,Z,$,J,q,H,U,Y,j,W,k)=>(_ts_query_captures_wasm=X._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(Q,Z,$,J,q,H,U,Y,j,W,k),_iswalpha=X._iswalpha=(Q)=>(_iswalpha=X._iswalpha=wasmExports.iswalpha)(Q),_iswblank=X._iswblank=(Q)=>(_iswblank=X._iswblank=wasmExports.iswblank)(Q),_iswdigit=X._iswdigit=(Q)=>(_iswdigit=X._iswdigit=wasmExports.iswdigit)(Q),_iswlower=X._iswlower=(Q)=>(_iswlower=X._iswlower=wasmExports.iswlower)(Q),_iswupper=X._iswupper=(Q)=>(_iswupper=X._iswupper=wasmExports.iswupper)(Q),_iswxdigit=X._iswxdigit=(Q)=>(_iswxdigit=X._iswxdigit=wasmExports.iswxdigit)(Q),_memchr=X._memchr=(Q,Z,$)=>(_memchr=X._memchr=wasmExports.memchr)(Q,Z,$),_strlen=X._strlen=(Q)=>(_strlen=X._strlen=wasmExports.strlen)(Q),_strcmp=X._strcmp=(Q,Z)=>(_strcmp=X._strcmp=wasmExports.strcmp)(Q,Z),_strncat=X._strncat=(Q,Z,$)=>(_strncat=X._strncat=wasmExports.strncat)(Q,Z,$),_strncpy=X._strncpy=(Q,Z,$)=>(_strncpy=X._strncpy=wasmExports.strncpy)(Q,Z,$),_towlower=X._towlower=(Q)=>(_towlower=X._towlower=wasmExports.towlower)(Q),_towupper=X._towupper=(Q)=>(_towupper=X._towupper=wasmExports.towupper)(Q),_setThrew=(Q,Z)=>(_setThrew=wasmExports.setThrew)(Q,Z),__emscripten_stack_restore=(Q)=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(Q),__emscripten_stack_alloc=(Q)=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(Q),_emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),dynCall_jiji=X.dynCall_jiji=(Q,Z,$,J,q)=>(dynCall_jiji=X.dynCall_jiji=wasmExports.dynCall_jiji)(Q,Z,$,J,q),_orig$ts_parser_timeout_micros=X._orig$ts_parser_timeout_micros=(Q)=>(_orig$ts_parser_timeout_micros=X._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(Q),_orig$ts_parser_set_timeout_micros=X._orig$ts_parser_set_timeout_micros=(Q,Z)=>(_orig$ts_parser_set_timeout_micros=X._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(Q,Z);X.AsciiToString=AsciiToString,X.stringToUTF16=stringToUTF16;var calledRun;dependenciesFulfilled=function Q(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=Q};function callMain(Q=[]){var Z=resolveGlobalSymbol("main").sym;if(!Z)return;Q.unshift(thisProgram);var $=Q.length,J=stackAlloc(($+1)*4),q=J;Q.forEach((U)=>{LE_HEAP_STORE_U32((q>>2)*4,stringToUTF8OnStack(U)),q+=4}),LE_HEAP_STORE_U32((q>>2)*4,0);try{var H=Z($,J);return exitJS(H,!0),H}catch(U){return handleException(U)}}function run(Q=arguments_){if(runDependencies>0)return;if(preRun(),runDependencies>0)return;function Z(){if(calledRun)return;if(calledRun=!0,X.calledRun=!0,ABORT)return;if(initRuntime(),preMain(),X.onRuntimeInitialized?.(),shouldRunNow)callMain(Q);postRun()}if(X.setStatus)X.setStatus("Running..."),setTimeout(function(){setTimeout(function(){X.setStatus("")},1),Z()},1);else Z()}if(X.preInit){if(typeof X.preInit=="function")X.preInit=[X.preInit];while(X.preInit.length>0)X.preInit.pop()()}var shouldRunNow=!0;if(X.noInitialRun)shouldRunNow=!1;run();let C=X,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+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(Q){let Z;if(!Q)Z=0,Q=null;else if(Q.constructor===Language){Z=Q[0];let $=C._ts_language_version(Z);if($<MIN_COMPATIBLE_VERSION||VERSION<$)throw Error(`Incompatible language version ${$}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`)}else throw Error("Argument must be a Language");return this.language=Q,C._ts_parser_set_language(this[0],Z),this}getLanguage(){return this.language}parse(Q,Z,$){if(typeof Q==="string")currentParseCallback=(Y,j)=>Q.slice(Y);else if(typeof Q==="function")currentParseCallback=Q;else throw Error("Argument must be a string or a function");if(this.logCallback)currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1);else currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0);let J=0,q=0;if($?.includedRanges){J=$.includedRanges.length,q=C._calloc(J,SIZE_OF_RANGE);let Y=q;for(let j=0;j<J;j++)marshalRange(Y,$.includedRanges[j]),Y+=SIZE_OF_RANGE}let H=C._ts_parser_parse_wasm(this[0],this[1],Z?Z[0]:0,q,J);if(!H)throw currentParseCallback=null,currentLogCallback=null,Error("Parsing failed");let U=new Tree(INTERNAL,H,this.language,currentParseCallback);return currentParseCallback=null,currentLogCallback=null,U}reset(){C._ts_parser_reset(this[0])}getIncludedRanges(){C._ts_parser_included_ranges_wasm(this[0]);let Q=getValue(TRANSFER_BUFFER,"i32"),Z=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),$=Array(Q);if(Q>0){let J=Z;for(let q=0;q<Q;q++)$[q]=unmarshalRange(J),J+=SIZE_OF_RANGE;C._free(Z)}return $}getTimeoutMicros(){return C._ts_parser_timeout_micros(this[0])}setTimeoutMicros(Q){C._ts_parser_set_timeout_micros(this[0],Q)}setLogger(Q){if(!Q)Q=null;else if(typeof Q!=="function")throw Error("Logger callback must be a function");return this.logCallback=Q,this}getLogger(){return this.logCallback}}class Tree{constructor(Q,Z,$,J){assertInternal(Q),this[0]=Z,this.language=$,this.textCallback=J}copy(){let Q=C._ts_tree_copy(this[0]);return new Tree(INTERNAL,Q,this.language,this.textCallback)}delete(){C._ts_tree_delete(this[0]),this[0]=0}edit(Q){marshalEdit(Q),C._ts_tree_edit_wasm(this[0])}get rootNode(){return C._ts_tree_root_node_wasm(this[0]),unmarshalNode(this)}rootNodeWithOffset(Q,Z){let $=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue($,Q,"i32"),marshalPoint($+SIZE_OF_INT,Z),C._ts_tree_root_node_with_offset_wasm(this[0]),unmarshalNode(this)}getLanguage(){return this.language}walk(){return this.rootNode.walk()}getChangedRanges(Q){if(Q.constructor!==Tree)throw TypeError("Argument must be a Tree");C._ts_tree_get_changed_ranges_wasm(this[0],Q[0]);let Z=getValue(TRANSFER_BUFFER,"i32"),$=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),J=Array(Z);if(Z>0){let q=$;for(let H=0;H<Z;H++)J[H]=unmarshalRange(q),q+=SIZE_OF_RANGE;C._free($)}return J}getIncludedRanges(){C._ts_tree_included_ranges_wasm(this[0]);let Q=getValue(TRANSFER_BUFFER,"i32"),Z=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),$=Array(Q);if(Q>0){let J=Z;for(let q=0;q<Q;q++)$[q]=unmarshalRange(J),J+=SIZE_OF_RANGE;C._free(Z)}return $}}class Node{constructor(Q,Z){assertInternal(Q),this.tree=Z}get typeId(){return marshalNode(this),C._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return marshalNode(this),C._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get endPosition(){return marshalNode(this),C._ts_node_end_point_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endIndex(){return marshalNode(this),C._ts_node_end_index_wasm(this.tree[0])}get text(){return getText(this.tree,this.startIndex,this.endIndex)}get parseState(){return marshalNode(this),C._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return marshalNode(this),C._ts_node_next_parse_state_wasm(this.tree[0])}get isNamed(){return marshalNode(this),C._ts_node_is_named_wasm(this.tree[0])===1}get hasError(){return marshalNode(this),C._ts_node_has_error_wasm(this.tree[0])===1}get hasChanges(){return marshalNode(this),C._ts_node_has_changes_wasm(this.tree[0])===1}get isError(){return marshalNode(this),C._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return marshalNode(this),C._ts_node_is_missing_wasm(this.tree[0])===1}get isExtra(){return marshalNode(this),C._ts_node_is_extra_wasm(this.tree[0])===1}equals(Q){return this.id===Q.id}child(Q){return marshalNode(this),C._ts_node_child_wasm(this.tree[0],Q),unmarshalNode(this.tree)}namedChild(Q){return marshalNode(this),C._ts_node_named_child_wasm(this.tree[0],Q),unmarshalNode(this.tree)}childForFieldId(Q){return marshalNode(this),C._ts_node_child_by_field_id_wasm(this.tree[0],Q),unmarshalNode(this.tree)}childForFieldName(Q){let Z=this.tree.language.fields.indexOf(Q);if(Z!==-1)return this.childForFieldId(Z);return null}fieldNameForChild(Q){marshalNode(this);let Z=C._ts_node_field_name_for_child_wasm(this.tree[0],Q);if(!Z)return null;return AsciiToString(Z)}childrenForFieldName(Q){let Z=this.tree.language.fields.indexOf(Q);if(Z!==-1&&Z!==0)return this.childrenForFieldId(Z);return[]}childrenForFieldId(Q){marshalNode(this),C._ts_node_children_by_field_id_wasm(this.tree[0],Q);let Z=getValue(TRANSFER_BUFFER,"i32"),$=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),J=Array(Z);if(Z>0){let q=$;for(let H=0;H<Z;H++)J[H]=unmarshalNode(this.tree,q),q+=SIZE_OF_NODE;C._free($)}return J}firstChildForIndex(Q){marshalNode(this);let Z=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(Z,Q,"i32"),C._ts_node_first_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}firstNamedChildForIndex(Q){marshalNode(this);let Z=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(Z,Q,"i32"),C._ts_node_first_named_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}get childCount(){return marshalNode(this),C._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return marshalNode(this),C._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){marshalNode(this),C._ts_node_children_wasm(this.tree[0]);let Q=getValue(TRANSFER_BUFFER,"i32"),Z=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._children=Array(Q),Q>0){let $=Z;for(let J=0;J<Q;J++)this._children[J]=unmarshalNode(this.tree,$),$+=SIZE_OF_NODE;C._free(Z)}}return this._children}get namedChildren(){if(!this._namedChildren){marshalNode(this),C._ts_node_named_children_wasm(this.tree[0]);let Q=getValue(TRANSFER_BUFFER,"i32"),Z=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._namedChildren=Array(Q),Q>0){let $=Z;for(let J=0;J<Q;J++)this._namedChildren[J]=unmarshalNode(this.tree,$),$+=SIZE_OF_NODE;C._free(Z)}}return this._namedChildren}descendantsOfType(Q,Z,$){if(!Array.isArray(Q))Q=[Q];if(!Z)Z=ZERO_POINT;if(!$)$=ZERO_POINT;let J=[],q=this.tree.language.types;for(let W=0,k=q.length;W<k;W++)if(Q.includes(q[W]))J.push(W);let H=C._malloc(SIZE_OF_INT*J.length);for(let W=0,k=J.length;W<k;W++)setValue(H+W*SIZE_OF_INT,J[W],"i32");marshalNode(this),C._ts_node_descendants_of_type_wasm(this.tree[0],H,J.length,Z.row,Z.column,$.row,$.column);let U=getValue(TRANSFER_BUFFER,"i32"),Y=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),j=Array(U);if(U>0){let W=Y;for(let k=0;k<U;k++)j[k]=unmarshalNode(this.tree,W),W+=SIZE_OF_NODE}return C._free(Y),C._free(H),j}get nextSibling(){return marshalNode(this),C._ts_node_next_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousSibling(){return marshalNode(this),C._ts_node_prev_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get nextNamedSibling(){return marshalNode(this),C._ts_node_next_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousNamedSibling(){return marshalNode(this),C._ts_node_prev_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get descendantCount(){return marshalNode(this),C._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return marshalNode(this),C._ts_node_parent_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForIndex(Q,Z=Q){if(typeof Q!=="number"||typeof Z!=="number")throw Error("Arguments must be numbers");marshalNode(this);let $=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue($,Q,"i32"),setValue($+SIZE_OF_INT,Z,"i32"),C._ts_node_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForIndex(Q,Z=Q){if(typeof Q!=="number"||typeof Z!=="number")throw Error("Arguments must be numbers");marshalNode(this);let $=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue($,Q,"i32"),setValue($+SIZE_OF_INT,Z,"i32"),C._ts_node_named_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForPosition(Q,Z=Q){if(!isPoint(Q)||!isPoint(Z))throw Error("Arguments must be {row, column} objects");marshalNode(this);let $=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint($,Q),marshalPoint($+SIZE_OF_POINT,Z),C._ts_node_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForPosition(Q,Z=Q){if(!isPoint(Q)||!isPoint(Z))throw Error("Arguments must be {row, column} objects");marshalNode(this);let $=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint($,Q),marshalPoint($+SIZE_OF_POINT,Z),C._ts_node_named_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}walk(){return marshalNode(this),C._ts_tree_cursor_new_wasm(this.tree[0]),new TreeCursor(INTERNAL,this.tree)}toString(){marshalNode(this);let Q=C._ts_node_to_string_wasm(this.tree[0]),Z=AsciiToString(Q);return C._free(Q),Z}}class TreeCursor{constructor(Q,Z){assertInternal(Q),this.tree=Z,unmarshalTreeCursor(this)}delete(){marshalTreeCursor(this),C._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(Q){marshalNode(Q),marshalTreeCursor(this,TRANSFER_BUFFER+SIZE_OF_NODE),C._ts_tree_cursor_reset_wasm(this.tree[0]),unmarshalTreeCursor(this)}resetTo(Q){marshalTreeCursor(this,TRANSFER_BUFFER),marshalTreeCursor(Q,TRANSFER_BUFFER+SIZE_OF_CURSOR),C._ts_tree_cursor_reset_to_wasm(this.tree[0],Q.tree[0]),unmarshalTreeCursor(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_start_index_wasm(this.tree[0]),Z=C._ts_tree_cursor_end_index_wasm(this.tree[0]);return getText(this.tree,Q,Z)}get startPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_start_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_end_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get startIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_end_index_wasm(this.tree[0])}get currentNode(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_wasm(this.tree[0]),unmarshalNode(this.tree)}get currentFieldId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return marshalTreeCursor(this),C._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}gotoFirstChild(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),Q===1}gotoLastChild(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),Q===1}gotoFirstChildForIndex(Q){marshalTreeCursor(this),setValue(TRANSFER_BUFFER+SIZE_OF_CURSOR,Q,"i32");let Z=C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return unmarshalTreeCursor(this),Z===1}gotoFirstChildForPosition(Q){marshalTreeCursor(this),marshalPoint(TRANSFER_BUFFER+SIZE_OF_CURSOR,Q);let Z=C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return unmarshalTreeCursor(this),Z===1}gotoNextSibling(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),Q===1}gotoPreviousSibling(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),Q===1}gotoDescendant(Q){marshalTreeCursor(this),C._ts_tree_cursor_goto_descendant_wasm(this.tree[0],Q),unmarshalTreeCursor(this)}gotoParent(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return unmarshalTreeCursor(this),Q===1}}class Language{constructor(Q,Z){assertInternal(Q),this[0]=Z,this.types=Array(C._ts_language_symbol_count(this[0]));for(let $=0,J=this.types.length;$<J;$++)if(C._ts_language_symbol_type(this[0],$)<2)this.types[$]=UTF8ToString(C._ts_language_symbol_name(this[0],$));this.fields=Array(C._ts_language_field_count(this[0])+1);for(let $=0,J=this.fields.length;$<J;$++){let q=C._ts_language_field_name_for_id(this[0],$);if(q!==0)this.fields[$]=UTF8ToString(q);else this.fields[$]=null}}get version(){return C._ts_language_version(this[0])}get fieldCount(){return this.fields.length-1}get stateCount(){return C._ts_language_state_count(this[0])}fieldIdForName(Q){let Z=this.fields.indexOf(Q);if(Z!==-1)return Z;else return null}fieldNameForId(Q){return this.fields[Q]||null}idForNodeType(Q,Z){let $=lengthBytesUTF8(Q),J=C._malloc($+1);stringToUTF8(Q,J,$+1);let q=C._ts_language_symbol_for_name(this[0],J,$,Z);return C._free(J),q||null}get nodeTypeCount(){return C._ts_language_symbol_count(this[0])}nodeTypeForId(Q){let Z=C._ts_language_symbol_name(this[0],Q);return Z?UTF8ToString(Z):null}nodeTypeIsNamed(Q){return C._ts_language_type_is_named_wasm(this[0],Q)?!0:!1}nodeTypeIsVisible(Q){return C._ts_language_type_is_visible_wasm(this[0],Q)?!0:!1}nextState(Q,Z){return C._ts_language_next_state(this[0],Q,Z)}lookaheadIterator(Q){let Z=C._ts_lookahead_iterator_new(this[0],Q);if(Z)return new LookaheadIterable(INTERNAL,Z,this);return null}query(Q){let Z=lengthBytesUTF8(Q),$=C._malloc(Z+1);stringToUTF8(Q,$,Z+1);let J=C._ts_query_new(this[0],$,Z,TRANSFER_BUFFER,TRANSFER_BUFFER+SIZE_OF_INT);if(!J){let K=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),w=getValue(TRANSFER_BUFFER,"i32"),D=UTF8ToString($,w).length,V=Q.substr(D,100).split(`
|
|
3
|
-
`)[0],R=V.match(QUERY_WORD_REGEX)[0],T;switch(K){case 2:T=RangeError(`Bad node name '${R}'`);break;case 3:T=RangeError(`Bad field name '${R}'`);break;case 4:T=RangeError(`Bad capture name @${R}`);break;case 5:T=TypeError(`Bad pattern structure at offset ${
|
|
2
|
+
var I0=Object.create;var{getPrototypeOf:b0,defineProperty:U0,getOwnPropertyNames:h0}=Object;var x0=Object.prototype.hasOwnProperty;function y0(Q){return this[Q]}var f0,g0,M0=(Q,Z,$)=>{var J=Q!=null&&typeof Q==="object";if(J){var q=Z?f0??=new WeakMap:g0??=new WeakMap,H=q.get(Q);if(H)return H}$=Q!=null?I0(b0(Q)):{};let Y=Z||!Q||!Q.__esModule?U0($,"default",{value:Q,enumerable:!0}):$;for(let U of h0(Q))if(!x0.call(Y,U))U0(Y,U,{get:y0.bind(Q,U),enumerable:!0});if(J)q.set(Q,Y);return Y};var c0=(Q,Z)=>()=>(Z||Q((Z={exports:{}}).exports,Z),Z.exports);var t=import.meta.require;var K0=c0((p,g)=>{var __dirname="/Users/egortaranin/src/memory/node_modules/.bun/web-tree-sitter@0.24.7/node_modules/web-tree-sitter",X=typeof X<"u"?X:{},m0=typeof window=="object",r=typeof importScripts=="function",V0=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",p0=function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{constructor(){this.initialize()}initialize(){throw Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){if(initPromise)return initPromise;return X=Object.assign({},X,moduleOptions),initPromise=new Promise((resolveInitPromise)=>{var moduleOverrides=Object.assign({},X),arguments_=[],thisProgram="./this.program",quit_=(Q,Z)=>{throw Z},scriptDirectory="";function locateFile(Q){if(X.locateFile)return X.locateFile(Q,scriptDirectory);return scriptDirectory+Q}var readAsync,readBinary;if(V0){var fs=t("fs"),nodePath=t("path");if(scriptDirectory=__dirname+"/",readBinary=(Q)=>{Q=isFileURI(Q)?new URL(Q):nodePath.normalize(Q);var Z=fs.readFileSync(Q);return Z},readAsync=(Q,Z=!0)=>{return Q=isFileURI(Q)?new URL(Q):nodePath.normalize(Q),new Promise(($,J)=>{fs.readFile(Q,Z?void 0:"utf8",(q,H)=>{if(q)J(q);else $(Z?H.buffer:H)})})},!X.thisProgram&&process.argv.length>1)thisProgram=process.argv[1].replace(/\\/g,"/");if(arguments_=process.argv.slice(2),typeof g<"u")g.exports=X;quit_=(Q,Z)=>{throw process.exitCode=Q,Z}}else if(m0||r){if(r)scriptDirectory=self.location.href;else if(typeof document<"u"&&document.currentScript)scriptDirectory=document.currentScript.src;if(scriptDirectory.startsWith("blob:"))scriptDirectory="";else scriptDirectory=scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1);{if(r)readBinary=(Q)=>{var Z=new XMLHttpRequest;return Z.open("GET",Q,!1),Z.responseType="arraybuffer",Z.send(null),new Uint8Array(Z.response)};readAsync=(Q)=>{if(isFileURI(Q))return new Promise((Z,$)=>{var J=new XMLHttpRequest;J.open("GET",Q,!0),J.responseType="arraybuffer",J.onload=()=>{if(J.status==200||J.status==0&&J.response)$(J.response);Z(J.status)},J.onerror=Z,J.send(null)});return fetch(Q,{credentials:"same-origin"}).then((Z)=>{if(Z.ok)return Z.arrayBuffer();return Promise.reject(Error(Z.status+" : "+Z.url))})}}}var out=X.print||console.log.bind(console),err=X.printErr||console.error.bind(console);if(Object.assign(X,moduleOverrides),moduleOverrides=null,X.arguments)arguments_=X.arguments;if(X.thisProgram)thisProgram=X.thisProgram;if(X.quit)quit_=X.quit;var dynamicLibraries=X.dynamicLibraries||[],wasmBinary;if(X.wasmBinary)wasmBinary=X.wasmBinary;var wasmMemory,ABORT=!1,EXITSTATUS,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP_DATA_VIEW;function updateMemoryViews(){var Q=wasmMemory.buffer;X.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(Q),X.HEAP8=HEAP8=new Int8Array(Q),X.HEAP16=HEAP16=new Int16Array(Q),X.HEAPU8=HEAPU8=new Uint8Array(Q),X.HEAPU16=HEAPU16=new Uint16Array(Q),X.HEAP32=HEAP32=new Int32Array(Q),X.HEAPU32=HEAPU32=new Uint32Array(Q),X.HEAPF32=HEAPF32=new Float32Array(Q),X.HEAPF64=HEAPF64=new Float64Array(Q)}if(X.wasmMemory)wasmMemory=X.wasmMemory;else{var INITIAL_MEMORY=X.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768})}updateMemoryViews();var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function preRun(){if(X.preRun){if(typeof X.preRun=="function")X.preRun=[X.preRun];while(X.preRun.length)addOnPreRun(X.preRun.shift())}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function postRun(){if(X.postRun){if(typeof X.postRun=="function")X.postRun=[X.postRun];while(X.postRun.length)addOnPostRun(X.postRun.shift())}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(Q){__ATPRERUN__.unshift(Q)}function addOnInit(Q){__ATINIT__.unshift(Q)}function addOnPostRun(Q){__ATPOSTRUN__.unshift(Q)}var runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(Q){return Q}function addRunDependency(Q){runDependencies++,X.monitorRunDependencies?.(runDependencies)}function removeRunDependency(Q){if(runDependencies--,X.monitorRunDependencies?.(runDependencies),runDependencies==0){if(runDependencyWatcher!==null)clearInterval(runDependencyWatcher),runDependencyWatcher=null;if(dependenciesFulfilled){var Z=dependenciesFulfilled;dependenciesFulfilled=null,Z()}}}function abort(Q){X.onAbort?.(Q),Q="Aborted("+Q+")",err(Q),ABORT=!0,EXITSTATUS=1,Q+=". Build with -sASSERTIONS for more info.";var Z=new WebAssembly.RuntimeError(Q);throw Z}var dataURIPrefix="data:application/octet-stream;base64,",isDataURI=(Q)=>Q.startsWith(dataURIPrefix),isFileURI=(Q)=>Q.startsWith("file://");function findWasmBinary(){var Q="tree-sitter.wasm";if(!isDataURI(Q))return locateFile(Q);return Q}var wasmBinaryFile;function getBinarySync(Q){if(Q==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(Q);throw"both async and sync fetching of the wasm failed"}function getBinaryPromise(Q){if(!wasmBinary)return readAsync(Q).then((Z)=>new Uint8Array(Z),()=>getBinarySync(Q));return Promise.resolve().then(()=>getBinarySync(Q))}function instantiateArrayBuffer(Q,Z,$){return getBinaryPromise(Q).then((J)=>WebAssembly.instantiate(J,Z)).then($,(J)=>{err(`failed to asynchronously prepare wasm: ${J}`),abort(J)})}function instantiateAsync(Q,Z,$,J){if(!Q&&typeof WebAssembly.instantiateStreaming=="function"&&!isDataURI(Z)&&!isFileURI(Z)&&!V0&&typeof fetch=="function")return fetch(Z,{credentials:"same-origin"}).then((q)=>{var H=WebAssembly.instantiateStreaming(q,$);return H.then(J,function(Y){return err(`wasm streaming compile failed: ${Y}`),err("falling back to ArrayBuffer instantiation"),instantiateArrayBuffer(Z,$,J)})});return instantiateArrayBuffer(Z,$,J)}function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}function createWasm(){var Q=getWasmImports();function Z(J,q){wasmExports=J.exports,wasmExports=relocateExports(wasmExports,1024);var H=getDylinkMetadata(q);if(H.neededDynlibs)dynamicLibraries=H.neededDynlibs.concat(dynamicLibraries);return mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),addOnInit(wasmExports.__wasm_call_ctors),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),removeRunDependency("wasm-instantiate"),wasmExports}addRunDependency("wasm-instantiate");function $(J){Z(J.instance,J.module)}if(X.instantiateWasm)try{return X.instantiateWasm(Q,Z)}catch(J){return err(`Module.instantiateWasm callback failed with error: ${J}`),!1}if(!wasmBinaryFile)wasmBinaryFile=findWasmBinary();return instantiateAsync(wasmBinary,wasmBinaryFile,Q,$),{}}var ASM_CONSTS={};function ExitStatus(Q){this.name="ExitStatus",this.message=`Program terminated with exit(${Q})`,this.status=Q}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(Q,Z){var $=GOT[Z];if(!$)$=GOT[Z]=new WebAssembly.Global({value:"i32",mutable:!0});if(!currentModuleWeakSymbols.has(Z))$.required=!0;return $}},LE_HEAP_LOAD_F32=(Q)=>HEAP_DATA_VIEW.getFloat32(Q,!0),LE_HEAP_LOAD_F64=(Q)=>HEAP_DATA_VIEW.getFloat64(Q,!0),LE_HEAP_LOAD_I16=(Q)=>HEAP_DATA_VIEW.getInt16(Q,!0),LE_HEAP_LOAD_I32=(Q)=>HEAP_DATA_VIEW.getInt32(Q,!0),LE_HEAP_LOAD_U32=(Q)=>HEAP_DATA_VIEW.getUint32(Q,!0),LE_HEAP_STORE_F32=(Q,Z)=>HEAP_DATA_VIEW.setFloat32(Q,Z,!0),LE_HEAP_STORE_F64=(Q,Z)=>HEAP_DATA_VIEW.setFloat64(Q,Z,!0),LE_HEAP_STORE_I16=(Q,Z)=>HEAP_DATA_VIEW.setInt16(Q,Z,!0),LE_HEAP_STORE_I32=(Q,Z)=>HEAP_DATA_VIEW.setInt32(Q,Z,!0),LE_HEAP_STORE_U32=(Q,Z)=>HEAP_DATA_VIEW.setUint32(Q,Z,!0),callRuntimeCallbacks=(Q)=>{while(Q.length>0)Q.shift()(X)},UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,UTF8ArrayToString=(Q,Z,$)=>{var J=Z+$,q=Z;while(Q[q]&&!(q>=J))++q;if(q-Z>16&&Q.buffer&&UTF8Decoder)return UTF8Decoder.decode(Q.subarray(Z,q));var H="";while(Z<q){var Y=Q[Z++];if(!(Y&128)){H+=String.fromCharCode(Y);continue}var U=Q[Z++]&63;if((Y&224)==192){H+=String.fromCharCode((Y&31)<<6|U);continue}var j=Q[Z++]&63;if((Y&240)==224)Y=(Y&15)<<12|U<<6|j;else Y=(Y&7)<<18|U<<12|j<<6|Q[Z++]&63;if(Y<65536)H+=String.fromCharCode(Y);else{var W=Y-65536;H+=String.fromCharCode(55296|W>>10,56320|W&1023)}}return H},getDylinkMetadata=(Q)=>{var Z=0,$=0;function J(){return Q[Z++]}function q(){var B=0,E=1;while(!0){var P=Q[Z++];if(B+=(P&127)*E,E*=128,!(P&128))break}return B}function H(){var B=q();return Z+=B,UTF8ArrayToString(Q,Z-B,B)}function Y(B,E){if(B)throw Error(E)}var U="dylink.0";if(Q instanceof WebAssembly.Module){var j=WebAssembly.Module.customSections(Q,U);if(j.length===0)U="dylink",j=WebAssembly.Module.customSections(Q,U);Y(j.length===0,"need dylink section"),Q=new Uint8Array(j[0]),$=Q.length}else{var W=new Uint32Array(new Uint8Array(Q.subarray(0,24)).buffer),k=W[0]==1836278016||W[0]==6386541;Y(!k,"need to see wasm magic number"),Y(Q[8]!==0,"need the dylink section to be first"),Z=9;var F=q();$=Z+F,U=H()}var z={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(U=="dylink"){z.memorySize=q(),z.memoryAlign=q(),z.tableSize=q(),z.tableAlign=q();var G=q();for(var K=0;K<G;++K){var w=H();z.neededDynlibs.push(w)}}else{Y(U!=="dylink.0");var O=1,V=2,R=3,T=4,v=256,b=3,_=1;while(Z<$){var A=J(),h=q();if(A===O)z.memorySize=q(),z.memoryAlign=q(),z.tableSize=q(),z.tableAlign=q();else if(A===V){var G=q();for(var K=0;K<G;++K)w=H(),z.neededDynlibs.push(w)}else if(A===R){var N=q();while(N--){var y=H(),x=q();if(x&v)z.tlsExports.add(y)}}else if(A===T){var N=q();while(N--){var Y0=H(),y=H(),x=q();if((x&b)==_)z.weakImports.add(y)}}else Z+=h}}return z};function getValue(Q,Z="i8"){if(Z.endsWith("*"))Z="*";switch(Z){case"i1":return HEAP8[Q];case"i8":return HEAP8[Q];case"i16":return LE_HEAP_LOAD_I16((Q>>1)*2);case"i32":return LE_HEAP_LOAD_I32((Q>>2)*4);case"i64":abort("to do getValue(i64) use WASM_BIGINT");case"float":return LE_HEAP_LOAD_F32((Q>>2)*4);case"double":return LE_HEAP_LOAD_F64((Q>>3)*8);case"*":return LE_HEAP_LOAD_U32((Q>>2)*4);default:abort(`invalid type for getValue: ${Z}`)}}var newDSO=(Q,Z,$)=>{var J={refcount:1/0,name:Q,exports:$,global:!0};if(LDSO.loadedLibsByName[Q]=J,Z!=null)LDSO.loadedLibsByHandle[Z]=J;return J},LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=78112,zeroMemory=(Q,Z)=>{return HEAPU8.fill(0,Q,Q+Z),Q},alignMemory=(Q,Z)=>Math.ceil(Q/Z)*Z,getMemory=(Q)=>{if(runtimeInitialized)return zeroMemory(_malloc(Q),Q);var Z=___heap_base,$=Z+alignMemory(Q,16);return ___heap_base=$,GOT.__heap_base.value=$,Z},isInternalSym=(Q)=>["__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(Q)||Q.startsWith("__em_js__"),uleb128Encode=(Q,Z)=>{if(Q<128)Z.push(Q);else Z.push(Q%128|128,Q>>7)},sigToWasmTypes=(Q)=>{var Z={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},$={parameters:[],results:Q[0]=="v"?[]:[Z[Q[0]]]};for(var J=1;J<Q.length;++J)$.parameters.push(Z[Q[J]]);return $},generateFuncType=(Q,Z)=>{var $=Q.slice(0,1),J=Q.slice(1),q={i:127,p:127,j:126,f:125,d:124,e:111};Z.push(96),uleb128Encode(J.length,Z);for(var H=0;H<J.length;++H)Z.push(q[J[H]]);if($=="v")Z.push(0);else Z.push(1,q[$])},convertJsFunctionToWasm=(Q,Z)=>{if(typeof WebAssembly.Function=="function")return new WebAssembly.Function(sigToWasmTypes(Z),Q);var $=[1];generateFuncType(Z,$);var J=[0,97,115,109,1,0,0,0,1];uleb128Encode($.length,J),J.push(...$),J.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var q=new WebAssembly.Module(new Uint8Array(J)),H=new WebAssembly.Instance(q,{e:{f:Q}}),Y=H.exports.f;return Y},wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:28,element:"anyfunc"}),getWasmTableEntry=(Q)=>{var Z=wasmTableMirror[Q];if(!Z){if(Q>=wasmTableMirror.length)wasmTableMirror.length=Q+1;wasmTableMirror[Q]=Z=wasmTable.get(Q)}return Z},updateTableMap=(Q,Z)=>{if(functionsInTableMap)for(var $=Q;$<Q+Z;$++){var J=getWasmTableEntry($);if(J)functionsInTableMap.set(J,$)}},functionsInTableMap,getFunctionAddress=(Q)=>{if(!functionsInTableMap)functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length);return functionsInTableMap.get(Q)||0},freeTableIndexes=[],getEmptyTableSlot=()=>{if(freeTableIndexes.length)return freeTableIndexes.pop();try{wasmTable.grow(1)}catch(Q){if(!(Q instanceof RangeError))throw Q;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return wasmTable.length-1},setWasmTableEntry=(Q,Z)=>{wasmTable.set(Q,Z),wasmTableMirror[Q]=wasmTable.get(Q)},addFunction=(Q,Z)=>{var $=getFunctionAddress(Q);if($)return $;var J=getEmptyTableSlot();try{setWasmTableEntry(J,Q)}catch(H){if(!(H instanceof TypeError))throw H;var q=convertJsFunctionToWasm(Q,Z);setWasmTableEntry(J,q)}return functionsInTableMap.set(Q,J),J},updateGOT=(Q,Z)=>{for(var $ in Q){if(isInternalSym($))continue;var J=Q[$];if($.startsWith("orig$"))$=$.split("$")[1],Z=!0;if(GOT[$]||=new WebAssembly.Global({value:"i32",mutable:!0}),Z||GOT[$].value==0)if(typeof J=="function")GOT[$].value=addFunction(J);else if(typeof J=="number")GOT[$].value=J;else err(`unhandled export type for '${$}': ${typeof J}`)}},relocateExports=(Q,Z,$)=>{var J={};for(var q in Q){var H=Q[q];if(typeof H=="object")H=H.value;if(typeof H=="number")H+=Z;J[q]=H}return updateGOT(J,$),J},isSymbolDefined=(Q)=>{var Z=wasmImports[Q];if(!Z||Z.stub)return!1;return!0},dynCallLegacy=(Q,Z,$)=>{Q=Q.replace(/p/g,"i");var J=X["dynCall_"+Q];return J(Z,...$)},dynCall=(Q,Z,$=[])=>{if(Q.includes("j"))return dynCallLegacy(Q,Z,$);var J=getWasmTableEntry(Z)(...$);return J},stackSave=()=>_emscripten_stack_get_current(),stackRestore=(Q)=>__emscripten_stack_restore(Q),createInvokeFunction=(Q)=>(Z,...$)=>{var J=stackSave();try{return dynCall(Q,Z,$)}catch(q){if(stackRestore(J),q!==q+0)throw q;_setThrew(1,0)}},resolveGlobalSymbol=(Q,Z=!1)=>{var $;if(Z&&"orig$"+Q in wasmImports)Q="orig$"+Q;if(isSymbolDefined(Q))$=wasmImports[Q];else if(Q.startsWith("invoke_"))$=wasmImports[Q]=createInvokeFunction(Q.split("_")[1]);return{sym:$,name:Q}},UTF8ToString=(Q,Z)=>Q?UTF8ArrayToString(HEAPU8,Q,Z):"",loadWebAssemblyModule=(binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);currentModuleWeakSymbols=metadata.weakImports;function loadModule(){var firstLoad=!handle||!HEAP8[handle+8];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;if(handle)HEAP8[handle+8]=1,LE_HEAP_STORE_U32((handle+12>>2)*4,memoryBase),LE_HEAP_STORE_I32((handle+16>>2)*4,metadata.memorySize),LE_HEAP_STORE_U32((handle+20>>2)*4,tableBase),LE_HEAP_STORE_I32((handle+24>>2)*4,metadata.tableSize)}else memoryBase=LE_HEAP_LOAD_U32((handle+12>>2)*4),tableBase=LE_HEAP_LOAD_U32((handle+20>>2)*4);var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length;if(tableGrowthNeeded>0)wasmTable.grow(tableGrowthNeeded);var moduleExports;function resolveSymbol(Q){var Z=resolveGlobalSymbol(Q).sym;if(!Z&&localScope)Z=localScope[Q];if(!Z)Z=moduleExports[Q];return Z}var proxyHandler={get(Q,Z){switch(Z){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(Z in wasmImports&&!wasmImports[Z].stub)return wasmImports[Z];if(!(Z in Q)){var $;Q[Z]=(...J)=>{return $||=resolveSymbol(Z),$(...J)}}return Q[Z]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),!flags.allowUndefined)reportUndefinedSymbols();function addEmAsm(addr,body){var args=[],arity=0;for(;arity<16;arity++)if(body.indexOf("$"+arity)!=-1)args.push("$"+arity);else break;args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if("__start_em_asm"in moduleExports){var{__start_em_asm:start,__stop_em_asm:stop}=moduleExports;while(start<stop){var jsString=UTF8ToString(start);addEmAsm(start,jsString),start=HEAPU8.indexOf(0,start)+1}}function addEmJs(name,cSig,body){var jsArgs=[];if(cSig=cSig.slice(1,-1),cSig!="void"){cSig=cSig.split(",");for(var i in cSig){var jsArg=cSig[i].split(" ").pop();jsArgs.push(jsArg.replace("*",""))}}var func=`(${jsArgs}) => ${body};`;moduleExports[name]=eval(func)}for(var name in moduleExports)if(name.startsWith("__em_js__")){var start=moduleExports[name],jsString=UTF8ToString(start),parts=jsString.split("<::>");addEmJs(name.replace("__em_js__",""),parts[0],parts[1]),delete moduleExports[name]}var applyRelocs=moduleExports.__wasm_apply_data_relocs;if(applyRelocs)if(runtimeInitialized)applyRelocs();else __RELOC_FUNCS__.push(applyRelocs);var init=moduleExports.__wasm_call_ctors;if(init)if(runtimeInitialized)init();else __ATINIT__.push(init);return moduleExports}if(flags.loadAsync){if(binary instanceof WebAssembly.Module){var instance=new WebAssembly.Instance(binary,info);return Promise.resolve(postInstantiation(binary,instance))}return WebAssembly.instantiate(binary,info).then((Q)=>postInstantiation(Q.module,Q.instance))}var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}if(flags.loadAsync)return metadata.neededDynlibs.reduce((Q,Z)=>Q.then(()=>loadDynamicLibrary(Z,flags,localScope)),Promise.resolve()).then(loadModule);return metadata.neededDynlibs.forEach((Q)=>loadDynamicLibrary(Q,flags,localScope)),loadModule()},mergeLibSymbols=(Q,Z)=>{for(var[$,J]of Object.entries(Q)){let q=(Y)=>{if(!isSymbolDefined(Y))wasmImports[Y]=J};q($);let H="__main_argc_argv";if($=="main")q(H);if($==H)q("main");if($.startsWith("dynCall_")&&!X.hasOwnProperty($))X[$]=J}},asyncLoad=(Q,Z,$,J)=>{var q=!J?getUniqueRunDependency(`al ${Q}`):"";if(readAsync(Q).then((H)=>{if(Z(new Uint8Array(H)),q)removeRunDependency(q)},(H)=>{if($)$();else throw`Loading data file "${Q}" failed.`}),q)addRunDependency(q)};function loadDynamicLibrary(Q,Z={global:!0,nodelete:!0},$,J){var q=LDSO.loadedLibsByName[Q];if(q){if(!Z.global){if($)Object.assign($,q.exports)}else if(!q.global)q.global=!0,mergeLibSymbols(q.exports,Q);if(Z.nodelete&&q.refcount!==1/0)q.refcount=1/0;if(q.refcount++,J)LDSO.loadedLibsByHandle[J]=q;return Z.loadAsync?Promise.resolve(!0):!0}q=newDSO(Q,J,"loading"),q.refcount=Z.nodelete?1/0:1,q.global=Z.global;function H(){if(J){var j=LE_HEAP_LOAD_U32((J+28>>2)*4),W=LE_HEAP_LOAD_U32((J+32>>2)*4);if(j&&W){var k=HEAP8.slice(j,j+W);return Z.loadAsync?Promise.resolve(k):k}}var F=locateFile(Q);if(Z.loadAsync)return new Promise(function(z,G){asyncLoad(F,z,G)});if(!readBinary)throw Error(`${F}: file not found, and synchronous loading of external files is not available`);return readBinary(F)}function Y(){if(Z.loadAsync)return H().then((j)=>loadWebAssemblyModule(j,Z,Q,$,J));return loadWebAssemblyModule(H(),Z,Q,$,J)}function U(j){if(q.global)mergeLibSymbols(j,Q);else if($)Object.assign($,j);q.exports=j}if(Z.loadAsync)return Y().then((j)=>{return U(j),!0});return U(Y()),!0}var reportUndefinedSymbols=()=>{for(var[Q,Z]of Object.entries(GOT))if(Z.value==0){var $=resolveGlobalSymbol(Q,!0).sym;if(!$&&!Z.required)continue;if(typeof $=="function")Z.value=addFunction($,$.sig);else if(typeof $=="number")Z.value=$;else throw Error(`bad export type for '${Q}': ${typeof $}`)}},loadDylibs=()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs"),dynamicLibraries.reduce((Q,Z)=>Q.then(()=>loadDynamicLibrary(Z,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})),Promise.resolve()).then(()=>{reportUndefinedSymbols(),removeRunDependency("loadDylibs")})},noExitRuntime=X.noExitRuntime||!0;function setValue(Q,Z,$="i8"){if($.endsWith("*"))$="*";switch($){case"i1":HEAP8[Q]=Z;break;case"i8":HEAP8[Q]=Z;break;case"i16":LE_HEAP_STORE_I16((Q>>1)*2,Z);break;case"i32":LE_HEAP_STORE_I32((Q>>2)*4,Z);break;case"i64":abort("to do setValue(i64) use WASM_BIGINT");case"float":LE_HEAP_STORE_F32((Q>>2)*4,Z);break;case"double":LE_HEAP_STORE_F64((Q>>3)*8,Z);break;case"*":LE_HEAP_STORE_U32((Q>>2)*4,Z);break;default:abort(`invalid type for setValue: ${$}`)}}var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78112),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=()=>{abort("")};__abort_js.sig="v";var nowIsMonotonic=1,__emscripten_get_now_is_monotonic=()=>nowIsMonotonic;__emscripten_get_now_is_monotonic.sig="i";var __emscripten_memcpy_js=(Q,Z,$)=>HEAPU8.copyWithin(Q,Z,Z+$);__emscripten_memcpy_js.sig="vppp";var _emscripten_date_now=()=>Date.now();_emscripten_date_now.sig="d";var _emscripten_get_now=()=>performance.now();_emscripten_get_now.sig="d";var getHeapMax=()=>2147483648,growMemory=(Q)=>{var Z=wasmMemory.buffer,$=(Q-Z.byteLength+65535)/65536;try{return wasmMemory.grow($),updateMemoryViews(),1}catch(J){}},_emscripten_resize_heap=(Q)=>{var Z=HEAPU8.length;Q>>>=0;var $=getHeapMax();if(Q>$)return!1;var J=(j,W)=>j+(W-j%W)%W;for(var q=1;q<=4;q*=2){var H=Z*(1+0.2/q);H=Math.min(H,Q+100663296);var Y=Math.min($,J(Math.max(Q,H),65536)),U=growMemory(Y);if(U)return!0}return!1};_emscripten_resize_heap.sig="ip";var _fd_close=(Q)=>52;_fd_close.sig="ii";var convertI32PairToI53Checked=(Q,Z)=>Z+2097152>>>0<4194305-!!Q?(Q>>>0)+Z*4294967296:NaN;function _fd_seek(Q,Z,$,J,q){var H=convertI32PairToI53Checked(Z,$);return 70}_fd_seek.sig="iiiiip";var printCharBuffers=[null,[],[]],printChar=(Q,Z)=>{var $=printCharBuffers[Q];if(Z===0||Z===10)(Q===1?out:err)(UTF8ArrayToString($,0)),$.length=0;else $.push(Z)},_fd_write=(Q,Z,$,J)=>{var q=0;for(var H=0;H<$;H++){var Y=LE_HEAP_LOAD_U32((Z>>2)*4),U=LE_HEAP_LOAD_U32((Z+4>>2)*4);Z+=8;for(var j=0;j<U;j++)printChar(Q,HEAPU8[Y+j]);q+=U}return LE_HEAP_STORE_U32((J>>2)*4,q),0};_fd_write.sig="iippp";function _tree_sitter_log_callback(Q,Z){if(currentLogCallback){let $=UTF8ToString(Z);currentLogCallback($,Q!==0)}}function _tree_sitter_parse_callback(Q,Z,$,J,q){let Y=currentParseCallback(Z,{row:$,column:J});if(typeof Y==="string")setValue(q,Y.length,"i32"),stringToUTF16(Y,Q,10240);else setValue(q,0,"i32")}var runtimeKeepaliveCounter=0,keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0,_proc_exit=(Q)=>{if(EXITSTATUS=Q,!keepRuntimeAlive())X.onExit?.(Q),ABORT=!0;quit_(Q,new ExitStatus(Q))};_proc_exit.sig="vi";var exitJS=(Q,Z)=>{EXITSTATUS=Q,_proc_exit(Q)},handleException=(Q)=>{if(Q instanceof ExitStatus||Q=="unwind")return EXITSTATUS;quit_(1,Q)},lengthBytesUTF8=(Q)=>{var Z=0;for(var $=0;$<Q.length;++$){var J=Q.charCodeAt($);if(J<=127)Z++;else if(J<=2047)Z+=2;else if(J>=55296&&J<=57343)Z+=4,++$;else Z+=3}return Z},stringToUTF8Array=(Q,Z,$,J)=>{if(!(J>0))return 0;var q=$,H=$+J-1;for(var Y=0;Y<Q.length;++Y){var U=Q.charCodeAt(Y);if(U>=55296&&U<=57343){var j=Q.charCodeAt(++Y);U=65536+((U&1023)<<10)|j&1023}if(U<=127){if($>=H)break;Z[$++]=U}else if(U<=2047){if($+1>=H)break;Z[$++]=192|U>>6,Z[$++]=128|U&63}else if(U<=65535){if($+2>=H)break;Z[$++]=224|U>>12,Z[$++]=128|U>>6&63,Z[$++]=128|U&63}else{if($+3>=H)break;Z[$++]=240|U>>18,Z[$++]=128|U>>12&63,Z[$++]=128|U>>6&63,Z[$++]=128|U&63}}return Z[$]=0,$-q},stringToUTF8=(Q,Z,$)=>stringToUTF8Array(Q,HEAPU8,Z,$),stackAlloc=(Q)=>__emscripten_stack_alloc(Q),stringToUTF8OnStack=(Q)=>{var Z=lengthBytesUTF8(Q)+1,$=stackAlloc(Z);return stringToUTF8(Q,$,Z),$},stringToUTF16=(Q,Z,$)=>{if($??=2147483647,$<2)return 0;$-=2;var J=Z,q=$<Q.length*2?$/2:Q.length;for(var H=0;H<q;++H){var Y=Q.charCodeAt(H);LE_HEAP_STORE_I16((Z>>1)*2,Y),Z+=2}return LE_HEAP_STORE_I16((Z>>1)*2,0),Z-J},AsciiToString=(Q)=>{var Z="";while(!0){var $=HEAPU8[Q++];if(!$)return Z;Z+=String.fromCharCode($)}},wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,_emscripten_memcpy_js:__emscripten_memcpy_js,emscripten_get_now:_emscripten_get_now,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(),___wasm_call_ctors=()=>(___wasm_call_ctors=wasmExports.__wasm_call_ctors)(),___wasm_apply_data_relocs=()=>(___wasm_apply_data_relocs=wasmExports.__wasm_apply_data_relocs)(),_malloc=X._malloc=(Q)=>(_malloc=X._malloc=wasmExports.malloc)(Q),_calloc=X._calloc=(Q,Z)=>(_calloc=X._calloc=wasmExports.calloc)(Q,Z),_realloc=X._realloc=(Q,Z)=>(_realloc=X._realloc=wasmExports.realloc)(Q,Z),_free=X._free=(Q)=>(_free=X._free=wasmExports.free)(Q),_ts_language_symbol_count=X._ts_language_symbol_count=(Q)=>(_ts_language_symbol_count=X._ts_language_symbol_count=wasmExports.ts_language_symbol_count)(Q),_ts_language_state_count=X._ts_language_state_count=(Q)=>(_ts_language_state_count=X._ts_language_state_count=wasmExports.ts_language_state_count)(Q),_ts_language_version=X._ts_language_version=(Q)=>(_ts_language_version=X._ts_language_version=wasmExports.ts_language_version)(Q),_ts_language_field_count=X._ts_language_field_count=(Q)=>(_ts_language_field_count=X._ts_language_field_count=wasmExports.ts_language_field_count)(Q),_ts_language_next_state=X._ts_language_next_state=(Q,Z,$)=>(_ts_language_next_state=X._ts_language_next_state=wasmExports.ts_language_next_state)(Q,Z,$),_ts_language_symbol_name=X._ts_language_symbol_name=(Q,Z)=>(_ts_language_symbol_name=X._ts_language_symbol_name=wasmExports.ts_language_symbol_name)(Q,Z),_ts_language_symbol_for_name=X._ts_language_symbol_for_name=(Q,Z,$,J)=>(_ts_language_symbol_for_name=X._ts_language_symbol_for_name=wasmExports.ts_language_symbol_for_name)(Q,Z,$,J),_strncmp=X._strncmp=(Q,Z,$)=>(_strncmp=X._strncmp=wasmExports.strncmp)(Q,Z,$),_ts_language_symbol_type=X._ts_language_symbol_type=(Q,Z)=>(_ts_language_symbol_type=X._ts_language_symbol_type=wasmExports.ts_language_symbol_type)(Q,Z),_ts_language_field_name_for_id=X._ts_language_field_name_for_id=(Q,Z)=>(_ts_language_field_name_for_id=X._ts_language_field_name_for_id=wasmExports.ts_language_field_name_for_id)(Q,Z),_ts_lookahead_iterator_new=X._ts_lookahead_iterator_new=(Q,Z)=>(_ts_lookahead_iterator_new=X._ts_lookahead_iterator_new=wasmExports.ts_lookahead_iterator_new)(Q,Z),_ts_lookahead_iterator_delete=X._ts_lookahead_iterator_delete=(Q)=>(_ts_lookahead_iterator_delete=X._ts_lookahead_iterator_delete=wasmExports.ts_lookahead_iterator_delete)(Q),_ts_lookahead_iterator_reset_state=X._ts_lookahead_iterator_reset_state=(Q,Z)=>(_ts_lookahead_iterator_reset_state=X._ts_lookahead_iterator_reset_state=wasmExports.ts_lookahead_iterator_reset_state)(Q,Z),_ts_lookahead_iterator_reset=X._ts_lookahead_iterator_reset=(Q,Z,$)=>(_ts_lookahead_iterator_reset=X._ts_lookahead_iterator_reset=wasmExports.ts_lookahead_iterator_reset)(Q,Z,$),_ts_lookahead_iterator_next=X._ts_lookahead_iterator_next=(Q)=>(_ts_lookahead_iterator_next=X._ts_lookahead_iterator_next=wasmExports.ts_lookahead_iterator_next)(Q),_ts_lookahead_iterator_current_symbol=X._ts_lookahead_iterator_current_symbol=(Q)=>(_ts_lookahead_iterator_current_symbol=X._ts_lookahead_iterator_current_symbol=wasmExports.ts_lookahead_iterator_current_symbol)(Q),_memset=X._memset=(Q,Z,$)=>(_memset=X._memset=wasmExports.memset)(Q,Z,$),_memcpy=X._memcpy=(Q,Z,$)=>(_memcpy=X._memcpy=wasmExports.memcpy)(Q,Z,$),_ts_parser_delete=X._ts_parser_delete=(Q)=>(_ts_parser_delete=X._ts_parser_delete=wasmExports.ts_parser_delete)(Q),_ts_parser_reset=X._ts_parser_reset=(Q)=>(_ts_parser_reset=X._ts_parser_reset=wasmExports.ts_parser_reset)(Q),_ts_parser_set_language=X._ts_parser_set_language=(Q,Z)=>(_ts_parser_set_language=X._ts_parser_set_language=wasmExports.ts_parser_set_language)(Q,Z),_ts_parser_timeout_micros=X._ts_parser_timeout_micros=(Q)=>(_ts_parser_timeout_micros=X._ts_parser_timeout_micros=wasmExports.ts_parser_timeout_micros)(Q),_ts_parser_set_timeout_micros=X._ts_parser_set_timeout_micros=(Q,Z,$)=>(_ts_parser_set_timeout_micros=X._ts_parser_set_timeout_micros=wasmExports.ts_parser_set_timeout_micros)(Q,Z,$),_ts_parser_set_included_ranges=X._ts_parser_set_included_ranges=(Q,Z,$)=>(_ts_parser_set_included_ranges=X._ts_parser_set_included_ranges=wasmExports.ts_parser_set_included_ranges)(Q,Z,$),_memmove=X._memmove=(Q,Z,$)=>(_memmove=X._memmove=wasmExports.memmove)(Q,Z,$),_memcmp=X._memcmp=(Q,Z,$)=>(_memcmp=X._memcmp=wasmExports.memcmp)(Q,Z,$),_ts_query_new=X._ts_query_new=(Q,Z,$,J,q)=>(_ts_query_new=X._ts_query_new=wasmExports.ts_query_new)(Q,Z,$,J,q),_ts_query_delete=X._ts_query_delete=(Q)=>(_ts_query_delete=X._ts_query_delete=wasmExports.ts_query_delete)(Q),_iswspace=X._iswspace=(Q)=>(_iswspace=X._iswspace=wasmExports.iswspace)(Q),_iswalnum=X._iswalnum=(Q)=>(_iswalnum=X._iswalnum=wasmExports.iswalnum)(Q),_ts_query_pattern_count=X._ts_query_pattern_count=(Q)=>(_ts_query_pattern_count=X._ts_query_pattern_count=wasmExports.ts_query_pattern_count)(Q),_ts_query_capture_count=X._ts_query_capture_count=(Q)=>(_ts_query_capture_count=X._ts_query_capture_count=wasmExports.ts_query_capture_count)(Q),_ts_query_string_count=X._ts_query_string_count=(Q)=>(_ts_query_string_count=X._ts_query_string_count=wasmExports.ts_query_string_count)(Q),_ts_query_capture_name_for_id=X._ts_query_capture_name_for_id=(Q,Z,$)=>(_ts_query_capture_name_for_id=X._ts_query_capture_name_for_id=wasmExports.ts_query_capture_name_for_id)(Q,Z,$),_ts_query_string_value_for_id=X._ts_query_string_value_for_id=(Q,Z,$)=>(_ts_query_string_value_for_id=X._ts_query_string_value_for_id=wasmExports.ts_query_string_value_for_id)(Q,Z,$),_ts_query_predicates_for_pattern=X._ts_query_predicates_for_pattern=(Q,Z,$)=>(_ts_query_predicates_for_pattern=X._ts_query_predicates_for_pattern=wasmExports.ts_query_predicates_for_pattern)(Q,Z,$),_ts_query_disable_capture=X._ts_query_disable_capture=(Q,Z,$)=>(_ts_query_disable_capture=X._ts_query_disable_capture=wasmExports.ts_query_disable_capture)(Q,Z,$),_ts_tree_copy=X._ts_tree_copy=(Q)=>(_ts_tree_copy=X._ts_tree_copy=wasmExports.ts_tree_copy)(Q),_ts_tree_delete=X._ts_tree_delete=(Q)=>(_ts_tree_delete=X._ts_tree_delete=wasmExports.ts_tree_delete)(Q),_ts_init=X._ts_init=()=>(_ts_init=X._ts_init=wasmExports.ts_init)(),_ts_parser_new_wasm=X._ts_parser_new_wasm=()=>(_ts_parser_new_wasm=X._ts_parser_new_wasm=wasmExports.ts_parser_new_wasm)(),_ts_parser_enable_logger_wasm=X._ts_parser_enable_logger_wasm=(Q,Z)=>(_ts_parser_enable_logger_wasm=X._ts_parser_enable_logger_wasm=wasmExports.ts_parser_enable_logger_wasm)(Q,Z),_ts_parser_parse_wasm=X._ts_parser_parse_wasm=(Q,Z,$,J,q)=>(_ts_parser_parse_wasm=X._ts_parser_parse_wasm=wasmExports.ts_parser_parse_wasm)(Q,Z,$,J,q),_ts_parser_included_ranges_wasm=X._ts_parser_included_ranges_wasm=(Q)=>(_ts_parser_included_ranges_wasm=X._ts_parser_included_ranges_wasm=wasmExports.ts_parser_included_ranges_wasm)(Q),_ts_language_type_is_named_wasm=X._ts_language_type_is_named_wasm=(Q,Z)=>(_ts_language_type_is_named_wasm=X._ts_language_type_is_named_wasm=wasmExports.ts_language_type_is_named_wasm)(Q,Z),_ts_language_type_is_visible_wasm=X._ts_language_type_is_visible_wasm=(Q,Z)=>(_ts_language_type_is_visible_wasm=X._ts_language_type_is_visible_wasm=wasmExports.ts_language_type_is_visible_wasm)(Q,Z),_ts_tree_root_node_wasm=X._ts_tree_root_node_wasm=(Q)=>(_ts_tree_root_node_wasm=X._ts_tree_root_node_wasm=wasmExports.ts_tree_root_node_wasm)(Q),_ts_tree_root_node_with_offset_wasm=X._ts_tree_root_node_with_offset_wasm=(Q)=>(_ts_tree_root_node_with_offset_wasm=X._ts_tree_root_node_with_offset_wasm=wasmExports.ts_tree_root_node_with_offset_wasm)(Q),_ts_tree_edit_wasm=X._ts_tree_edit_wasm=(Q)=>(_ts_tree_edit_wasm=X._ts_tree_edit_wasm=wasmExports.ts_tree_edit_wasm)(Q),_ts_tree_included_ranges_wasm=X._ts_tree_included_ranges_wasm=(Q)=>(_ts_tree_included_ranges_wasm=X._ts_tree_included_ranges_wasm=wasmExports.ts_tree_included_ranges_wasm)(Q),_ts_tree_get_changed_ranges_wasm=X._ts_tree_get_changed_ranges_wasm=(Q,Z)=>(_ts_tree_get_changed_ranges_wasm=X._ts_tree_get_changed_ranges_wasm=wasmExports.ts_tree_get_changed_ranges_wasm)(Q,Z),_ts_tree_cursor_new_wasm=X._ts_tree_cursor_new_wasm=(Q)=>(_ts_tree_cursor_new_wasm=X._ts_tree_cursor_new_wasm=wasmExports.ts_tree_cursor_new_wasm)(Q),_ts_tree_cursor_delete_wasm=X._ts_tree_cursor_delete_wasm=(Q)=>(_ts_tree_cursor_delete_wasm=X._ts_tree_cursor_delete_wasm=wasmExports.ts_tree_cursor_delete_wasm)(Q),_ts_tree_cursor_reset_wasm=X._ts_tree_cursor_reset_wasm=(Q)=>(_ts_tree_cursor_reset_wasm=X._ts_tree_cursor_reset_wasm=wasmExports.ts_tree_cursor_reset_wasm)(Q),_ts_tree_cursor_reset_to_wasm=X._ts_tree_cursor_reset_to_wasm=(Q,Z)=>(_ts_tree_cursor_reset_to_wasm=X._ts_tree_cursor_reset_to_wasm=wasmExports.ts_tree_cursor_reset_to_wasm)(Q,Z),_ts_tree_cursor_goto_first_child_wasm=X._ts_tree_cursor_goto_first_child_wasm=(Q)=>(_ts_tree_cursor_goto_first_child_wasm=X._ts_tree_cursor_goto_first_child_wasm=wasmExports.ts_tree_cursor_goto_first_child_wasm)(Q),_ts_tree_cursor_goto_last_child_wasm=X._ts_tree_cursor_goto_last_child_wasm=(Q)=>(_ts_tree_cursor_goto_last_child_wasm=X._ts_tree_cursor_goto_last_child_wasm=wasmExports.ts_tree_cursor_goto_last_child_wasm)(Q),_ts_tree_cursor_goto_first_child_for_index_wasm=X._ts_tree_cursor_goto_first_child_for_index_wasm=(Q)=>(_ts_tree_cursor_goto_first_child_for_index_wasm=X._ts_tree_cursor_goto_first_child_for_index_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_index_wasm)(Q),_ts_tree_cursor_goto_first_child_for_position_wasm=X._ts_tree_cursor_goto_first_child_for_position_wasm=(Q)=>(_ts_tree_cursor_goto_first_child_for_position_wasm=X._ts_tree_cursor_goto_first_child_for_position_wasm=wasmExports.ts_tree_cursor_goto_first_child_for_position_wasm)(Q),_ts_tree_cursor_goto_next_sibling_wasm=X._ts_tree_cursor_goto_next_sibling_wasm=(Q)=>(_ts_tree_cursor_goto_next_sibling_wasm=X._ts_tree_cursor_goto_next_sibling_wasm=wasmExports.ts_tree_cursor_goto_next_sibling_wasm)(Q),_ts_tree_cursor_goto_previous_sibling_wasm=X._ts_tree_cursor_goto_previous_sibling_wasm=(Q)=>(_ts_tree_cursor_goto_previous_sibling_wasm=X._ts_tree_cursor_goto_previous_sibling_wasm=wasmExports.ts_tree_cursor_goto_previous_sibling_wasm)(Q),_ts_tree_cursor_goto_descendant_wasm=X._ts_tree_cursor_goto_descendant_wasm=(Q,Z)=>(_ts_tree_cursor_goto_descendant_wasm=X._ts_tree_cursor_goto_descendant_wasm=wasmExports.ts_tree_cursor_goto_descendant_wasm)(Q,Z),_ts_tree_cursor_goto_parent_wasm=X._ts_tree_cursor_goto_parent_wasm=(Q)=>(_ts_tree_cursor_goto_parent_wasm=X._ts_tree_cursor_goto_parent_wasm=wasmExports.ts_tree_cursor_goto_parent_wasm)(Q),_ts_tree_cursor_current_node_type_id_wasm=X._ts_tree_cursor_current_node_type_id_wasm=(Q)=>(_ts_tree_cursor_current_node_type_id_wasm=X._ts_tree_cursor_current_node_type_id_wasm=wasmExports.ts_tree_cursor_current_node_type_id_wasm)(Q),_ts_tree_cursor_current_node_state_id_wasm=X._ts_tree_cursor_current_node_state_id_wasm=(Q)=>(_ts_tree_cursor_current_node_state_id_wasm=X._ts_tree_cursor_current_node_state_id_wasm=wasmExports.ts_tree_cursor_current_node_state_id_wasm)(Q),_ts_tree_cursor_current_node_is_named_wasm=X._ts_tree_cursor_current_node_is_named_wasm=(Q)=>(_ts_tree_cursor_current_node_is_named_wasm=X._ts_tree_cursor_current_node_is_named_wasm=wasmExports.ts_tree_cursor_current_node_is_named_wasm)(Q),_ts_tree_cursor_current_node_is_missing_wasm=X._ts_tree_cursor_current_node_is_missing_wasm=(Q)=>(_ts_tree_cursor_current_node_is_missing_wasm=X._ts_tree_cursor_current_node_is_missing_wasm=wasmExports.ts_tree_cursor_current_node_is_missing_wasm)(Q),_ts_tree_cursor_current_node_id_wasm=X._ts_tree_cursor_current_node_id_wasm=(Q)=>(_ts_tree_cursor_current_node_id_wasm=X._ts_tree_cursor_current_node_id_wasm=wasmExports.ts_tree_cursor_current_node_id_wasm)(Q),_ts_tree_cursor_start_position_wasm=X._ts_tree_cursor_start_position_wasm=(Q)=>(_ts_tree_cursor_start_position_wasm=X._ts_tree_cursor_start_position_wasm=wasmExports.ts_tree_cursor_start_position_wasm)(Q),_ts_tree_cursor_end_position_wasm=X._ts_tree_cursor_end_position_wasm=(Q)=>(_ts_tree_cursor_end_position_wasm=X._ts_tree_cursor_end_position_wasm=wasmExports.ts_tree_cursor_end_position_wasm)(Q),_ts_tree_cursor_start_index_wasm=X._ts_tree_cursor_start_index_wasm=(Q)=>(_ts_tree_cursor_start_index_wasm=X._ts_tree_cursor_start_index_wasm=wasmExports.ts_tree_cursor_start_index_wasm)(Q),_ts_tree_cursor_end_index_wasm=X._ts_tree_cursor_end_index_wasm=(Q)=>(_ts_tree_cursor_end_index_wasm=X._ts_tree_cursor_end_index_wasm=wasmExports.ts_tree_cursor_end_index_wasm)(Q),_ts_tree_cursor_current_field_id_wasm=X._ts_tree_cursor_current_field_id_wasm=(Q)=>(_ts_tree_cursor_current_field_id_wasm=X._ts_tree_cursor_current_field_id_wasm=wasmExports.ts_tree_cursor_current_field_id_wasm)(Q),_ts_tree_cursor_current_depth_wasm=X._ts_tree_cursor_current_depth_wasm=(Q)=>(_ts_tree_cursor_current_depth_wasm=X._ts_tree_cursor_current_depth_wasm=wasmExports.ts_tree_cursor_current_depth_wasm)(Q),_ts_tree_cursor_current_descendant_index_wasm=X._ts_tree_cursor_current_descendant_index_wasm=(Q)=>(_ts_tree_cursor_current_descendant_index_wasm=X._ts_tree_cursor_current_descendant_index_wasm=wasmExports.ts_tree_cursor_current_descendant_index_wasm)(Q),_ts_tree_cursor_current_node_wasm=X._ts_tree_cursor_current_node_wasm=(Q)=>(_ts_tree_cursor_current_node_wasm=X._ts_tree_cursor_current_node_wasm=wasmExports.ts_tree_cursor_current_node_wasm)(Q),_ts_node_symbol_wasm=X._ts_node_symbol_wasm=(Q)=>(_ts_node_symbol_wasm=X._ts_node_symbol_wasm=wasmExports.ts_node_symbol_wasm)(Q),_ts_node_field_name_for_child_wasm=X._ts_node_field_name_for_child_wasm=(Q,Z)=>(_ts_node_field_name_for_child_wasm=X._ts_node_field_name_for_child_wasm=wasmExports.ts_node_field_name_for_child_wasm)(Q,Z),_ts_node_children_by_field_id_wasm=X._ts_node_children_by_field_id_wasm=(Q,Z)=>(_ts_node_children_by_field_id_wasm=X._ts_node_children_by_field_id_wasm=wasmExports.ts_node_children_by_field_id_wasm)(Q,Z),_ts_node_first_child_for_byte_wasm=X._ts_node_first_child_for_byte_wasm=(Q)=>(_ts_node_first_child_for_byte_wasm=X._ts_node_first_child_for_byte_wasm=wasmExports.ts_node_first_child_for_byte_wasm)(Q),_ts_node_first_named_child_for_byte_wasm=X._ts_node_first_named_child_for_byte_wasm=(Q)=>(_ts_node_first_named_child_for_byte_wasm=X._ts_node_first_named_child_for_byte_wasm=wasmExports.ts_node_first_named_child_for_byte_wasm)(Q),_ts_node_grammar_symbol_wasm=X._ts_node_grammar_symbol_wasm=(Q)=>(_ts_node_grammar_symbol_wasm=X._ts_node_grammar_symbol_wasm=wasmExports.ts_node_grammar_symbol_wasm)(Q),_ts_node_child_count_wasm=X._ts_node_child_count_wasm=(Q)=>(_ts_node_child_count_wasm=X._ts_node_child_count_wasm=wasmExports.ts_node_child_count_wasm)(Q),_ts_node_named_child_count_wasm=X._ts_node_named_child_count_wasm=(Q)=>(_ts_node_named_child_count_wasm=X._ts_node_named_child_count_wasm=wasmExports.ts_node_named_child_count_wasm)(Q),_ts_node_child_wasm=X._ts_node_child_wasm=(Q,Z)=>(_ts_node_child_wasm=X._ts_node_child_wasm=wasmExports.ts_node_child_wasm)(Q,Z),_ts_node_named_child_wasm=X._ts_node_named_child_wasm=(Q,Z)=>(_ts_node_named_child_wasm=X._ts_node_named_child_wasm=wasmExports.ts_node_named_child_wasm)(Q,Z),_ts_node_child_by_field_id_wasm=X._ts_node_child_by_field_id_wasm=(Q,Z)=>(_ts_node_child_by_field_id_wasm=X._ts_node_child_by_field_id_wasm=wasmExports.ts_node_child_by_field_id_wasm)(Q,Z),_ts_node_next_sibling_wasm=X._ts_node_next_sibling_wasm=(Q)=>(_ts_node_next_sibling_wasm=X._ts_node_next_sibling_wasm=wasmExports.ts_node_next_sibling_wasm)(Q),_ts_node_prev_sibling_wasm=X._ts_node_prev_sibling_wasm=(Q)=>(_ts_node_prev_sibling_wasm=X._ts_node_prev_sibling_wasm=wasmExports.ts_node_prev_sibling_wasm)(Q),_ts_node_next_named_sibling_wasm=X._ts_node_next_named_sibling_wasm=(Q)=>(_ts_node_next_named_sibling_wasm=X._ts_node_next_named_sibling_wasm=wasmExports.ts_node_next_named_sibling_wasm)(Q),_ts_node_prev_named_sibling_wasm=X._ts_node_prev_named_sibling_wasm=(Q)=>(_ts_node_prev_named_sibling_wasm=X._ts_node_prev_named_sibling_wasm=wasmExports.ts_node_prev_named_sibling_wasm)(Q),_ts_node_descendant_count_wasm=X._ts_node_descendant_count_wasm=(Q)=>(_ts_node_descendant_count_wasm=X._ts_node_descendant_count_wasm=wasmExports.ts_node_descendant_count_wasm)(Q),_ts_node_parent_wasm=X._ts_node_parent_wasm=(Q)=>(_ts_node_parent_wasm=X._ts_node_parent_wasm=wasmExports.ts_node_parent_wasm)(Q),_ts_node_descendant_for_index_wasm=X._ts_node_descendant_for_index_wasm=(Q)=>(_ts_node_descendant_for_index_wasm=X._ts_node_descendant_for_index_wasm=wasmExports.ts_node_descendant_for_index_wasm)(Q),_ts_node_named_descendant_for_index_wasm=X._ts_node_named_descendant_for_index_wasm=(Q)=>(_ts_node_named_descendant_for_index_wasm=X._ts_node_named_descendant_for_index_wasm=wasmExports.ts_node_named_descendant_for_index_wasm)(Q),_ts_node_descendant_for_position_wasm=X._ts_node_descendant_for_position_wasm=(Q)=>(_ts_node_descendant_for_position_wasm=X._ts_node_descendant_for_position_wasm=wasmExports.ts_node_descendant_for_position_wasm)(Q),_ts_node_named_descendant_for_position_wasm=X._ts_node_named_descendant_for_position_wasm=(Q)=>(_ts_node_named_descendant_for_position_wasm=X._ts_node_named_descendant_for_position_wasm=wasmExports.ts_node_named_descendant_for_position_wasm)(Q),_ts_node_start_point_wasm=X._ts_node_start_point_wasm=(Q)=>(_ts_node_start_point_wasm=X._ts_node_start_point_wasm=wasmExports.ts_node_start_point_wasm)(Q),_ts_node_end_point_wasm=X._ts_node_end_point_wasm=(Q)=>(_ts_node_end_point_wasm=X._ts_node_end_point_wasm=wasmExports.ts_node_end_point_wasm)(Q),_ts_node_start_index_wasm=X._ts_node_start_index_wasm=(Q)=>(_ts_node_start_index_wasm=X._ts_node_start_index_wasm=wasmExports.ts_node_start_index_wasm)(Q),_ts_node_end_index_wasm=X._ts_node_end_index_wasm=(Q)=>(_ts_node_end_index_wasm=X._ts_node_end_index_wasm=wasmExports.ts_node_end_index_wasm)(Q),_ts_node_to_string_wasm=X._ts_node_to_string_wasm=(Q)=>(_ts_node_to_string_wasm=X._ts_node_to_string_wasm=wasmExports.ts_node_to_string_wasm)(Q),_ts_node_children_wasm=X._ts_node_children_wasm=(Q)=>(_ts_node_children_wasm=X._ts_node_children_wasm=wasmExports.ts_node_children_wasm)(Q),_ts_node_named_children_wasm=X._ts_node_named_children_wasm=(Q)=>(_ts_node_named_children_wasm=X._ts_node_named_children_wasm=wasmExports.ts_node_named_children_wasm)(Q),_ts_node_descendants_of_type_wasm=X._ts_node_descendants_of_type_wasm=(Q,Z,$,J,q,H,Y)=>(_ts_node_descendants_of_type_wasm=X._ts_node_descendants_of_type_wasm=wasmExports.ts_node_descendants_of_type_wasm)(Q,Z,$,J,q,H,Y),_ts_node_is_named_wasm=X._ts_node_is_named_wasm=(Q)=>(_ts_node_is_named_wasm=X._ts_node_is_named_wasm=wasmExports.ts_node_is_named_wasm)(Q),_ts_node_has_changes_wasm=X._ts_node_has_changes_wasm=(Q)=>(_ts_node_has_changes_wasm=X._ts_node_has_changes_wasm=wasmExports.ts_node_has_changes_wasm)(Q),_ts_node_has_error_wasm=X._ts_node_has_error_wasm=(Q)=>(_ts_node_has_error_wasm=X._ts_node_has_error_wasm=wasmExports.ts_node_has_error_wasm)(Q),_ts_node_is_error_wasm=X._ts_node_is_error_wasm=(Q)=>(_ts_node_is_error_wasm=X._ts_node_is_error_wasm=wasmExports.ts_node_is_error_wasm)(Q),_ts_node_is_missing_wasm=X._ts_node_is_missing_wasm=(Q)=>(_ts_node_is_missing_wasm=X._ts_node_is_missing_wasm=wasmExports.ts_node_is_missing_wasm)(Q),_ts_node_is_extra_wasm=X._ts_node_is_extra_wasm=(Q)=>(_ts_node_is_extra_wasm=X._ts_node_is_extra_wasm=wasmExports.ts_node_is_extra_wasm)(Q),_ts_node_parse_state_wasm=X._ts_node_parse_state_wasm=(Q)=>(_ts_node_parse_state_wasm=X._ts_node_parse_state_wasm=wasmExports.ts_node_parse_state_wasm)(Q),_ts_node_next_parse_state_wasm=X._ts_node_next_parse_state_wasm=(Q)=>(_ts_node_next_parse_state_wasm=X._ts_node_next_parse_state_wasm=wasmExports.ts_node_next_parse_state_wasm)(Q),_ts_query_matches_wasm=X._ts_query_matches_wasm=(Q,Z,$,J,q,H,Y,U,j,W,k)=>(_ts_query_matches_wasm=X._ts_query_matches_wasm=wasmExports.ts_query_matches_wasm)(Q,Z,$,J,q,H,Y,U,j,W,k),_ts_query_captures_wasm=X._ts_query_captures_wasm=(Q,Z,$,J,q,H,Y,U,j,W,k)=>(_ts_query_captures_wasm=X._ts_query_captures_wasm=wasmExports.ts_query_captures_wasm)(Q,Z,$,J,q,H,Y,U,j,W,k),_iswalpha=X._iswalpha=(Q)=>(_iswalpha=X._iswalpha=wasmExports.iswalpha)(Q),_iswblank=X._iswblank=(Q)=>(_iswblank=X._iswblank=wasmExports.iswblank)(Q),_iswdigit=X._iswdigit=(Q)=>(_iswdigit=X._iswdigit=wasmExports.iswdigit)(Q),_iswlower=X._iswlower=(Q)=>(_iswlower=X._iswlower=wasmExports.iswlower)(Q),_iswupper=X._iswupper=(Q)=>(_iswupper=X._iswupper=wasmExports.iswupper)(Q),_iswxdigit=X._iswxdigit=(Q)=>(_iswxdigit=X._iswxdigit=wasmExports.iswxdigit)(Q),_memchr=X._memchr=(Q,Z,$)=>(_memchr=X._memchr=wasmExports.memchr)(Q,Z,$),_strlen=X._strlen=(Q)=>(_strlen=X._strlen=wasmExports.strlen)(Q),_strcmp=X._strcmp=(Q,Z)=>(_strcmp=X._strcmp=wasmExports.strcmp)(Q,Z),_strncat=X._strncat=(Q,Z,$)=>(_strncat=X._strncat=wasmExports.strncat)(Q,Z,$),_strncpy=X._strncpy=(Q,Z,$)=>(_strncpy=X._strncpy=wasmExports.strncpy)(Q,Z,$),_towlower=X._towlower=(Q)=>(_towlower=X._towlower=wasmExports.towlower)(Q),_towupper=X._towupper=(Q)=>(_towupper=X._towupper=wasmExports.towupper)(Q),_setThrew=(Q,Z)=>(_setThrew=wasmExports.setThrew)(Q,Z),__emscripten_stack_restore=(Q)=>(__emscripten_stack_restore=wasmExports._emscripten_stack_restore)(Q),__emscripten_stack_alloc=(Q)=>(__emscripten_stack_alloc=wasmExports._emscripten_stack_alloc)(Q),_emscripten_stack_get_current=()=>(_emscripten_stack_get_current=wasmExports.emscripten_stack_get_current)(),dynCall_jiji=X.dynCall_jiji=(Q,Z,$,J,q)=>(dynCall_jiji=X.dynCall_jiji=wasmExports.dynCall_jiji)(Q,Z,$,J,q),_orig$ts_parser_timeout_micros=X._orig$ts_parser_timeout_micros=(Q)=>(_orig$ts_parser_timeout_micros=X._orig$ts_parser_timeout_micros=wasmExports.orig$ts_parser_timeout_micros)(Q),_orig$ts_parser_set_timeout_micros=X._orig$ts_parser_set_timeout_micros=(Q,Z)=>(_orig$ts_parser_set_timeout_micros=X._orig$ts_parser_set_timeout_micros=wasmExports.orig$ts_parser_set_timeout_micros)(Q,Z);X.AsciiToString=AsciiToString,X.stringToUTF16=stringToUTF16;var calledRun;dependenciesFulfilled=function Q(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=Q};function callMain(Q=[]){var Z=resolveGlobalSymbol("main").sym;if(!Z)return;Q.unshift(thisProgram);var $=Q.length,J=stackAlloc(($+1)*4),q=J;Q.forEach((Y)=>{LE_HEAP_STORE_U32((q>>2)*4,stringToUTF8OnStack(Y)),q+=4}),LE_HEAP_STORE_U32((q>>2)*4,0);try{var H=Z($,J);return exitJS(H,!0),H}catch(Y){return handleException(Y)}}function run(Q=arguments_){if(runDependencies>0)return;if(preRun(),runDependencies>0)return;function Z(){if(calledRun)return;if(calledRun=!0,X.calledRun=!0,ABORT)return;if(initRuntime(),preMain(),X.onRuntimeInitialized?.(),shouldRunNow)callMain(Q);postRun()}if(X.setStatus)X.setStatus("Running..."),setTimeout(function(){setTimeout(function(){X.setStatus("")},1),Z()},1);else Z()}if(X.preInit){if(typeof X.preInit=="function")X.preInit=[X.preInit];while(X.preInit.length>0)X.preInit.pop()()}var shouldRunNow=!0;if(X.noInitialRun)shouldRunNow=!1;run();let C=X,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+/,VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32")}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0}setLanguage(Q){let Z;if(!Q)Z=0,Q=null;else if(Q.constructor===Language){Z=Q[0];let $=C._ts_language_version(Z);if($<MIN_COMPATIBLE_VERSION||VERSION<$)throw Error(`Incompatible language version ${$}. Compatibility range ${MIN_COMPATIBLE_VERSION} through ${VERSION}.`)}else throw Error("Argument must be a Language");return this.language=Q,C._ts_parser_set_language(this[0],Z),this}getLanguage(){return this.language}parse(Q,Z,$){if(typeof Q==="string")currentParseCallback=(U,j)=>Q.slice(U);else if(typeof Q==="function")currentParseCallback=Q;else throw Error("Argument must be a string or a function");if(this.logCallback)currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1);else currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0);let J=0,q=0;if($?.includedRanges){J=$.includedRanges.length,q=C._calloc(J,SIZE_OF_RANGE);let U=q;for(let j=0;j<J;j++)marshalRange(U,$.includedRanges[j]),U+=SIZE_OF_RANGE}let H=C._ts_parser_parse_wasm(this[0],this[1],Z?Z[0]:0,q,J);if(!H)throw currentParseCallback=null,currentLogCallback=null,Error("Parsing failed");let Y=new Tree(INTERNAL,H,this.language,currentParseCallback);return currentParseCallback=null,currentLogCallback=null,Y}reset(){C._ts_parser_reset(this[0])}getIncludedRanges(){C._ts_parser_included_ranges_wasm(this[0]);let Q=getValue(TRANSFER_BUFFER,"i32"),Z=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),$=Array(Q);if(Q>0){let J=Z;for(let q=0;q<Q;q++)$[q]=unmarshalRange(J),J+=SIZE_OF_RANGE;C._free(Z)}return $}getTimeoutMicros(){return C._ts_parser_timeout_micros(this[0])}setTimeoutMicros(Q){C._ts_parser_set_timeout_micros(this[0],Q)}setLogger(Q){if(!Q)Q=null;else if(typeof Q!=="function")throw Error("Logger callback must be a function");return this.logCallback=Q,this}getLogger(){return this.logCallback}}class Tree{constructor(Q,Z,$,J){assertInternal(Q),this[0]=Z,this.language=$,this.textCallback=J}copy(){let Q=C._ts_tree_copy(this[0]);return new Tree(INTERNAL,Q,this.language,this.textCallback)}delete(){C._ts_tree_delete(this[0]),this[0]=0}edit(Q){marshalEdit(Q),C._ts_tree_edit_wasm(this[0])}get rootNode(){return C._ts_tree_root_node_wasm(this[0]),unmarshalNode(this)}rootNodeWithOffset(Q,Z){let $=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue($,Q,"i32"),marshalPoint($+SIZE_OF_INT,Z),C._ts_tree_root_node_with_offset_wasm(this[0]),unmarshalNode(this)}getLanguage(){return this.language}walk(){return this.rootNode.walk()}getChangedRanges(Q){if(Q.constructor!==Tree)throw TypeError("Argument must be a Tree");C._ts_tree_get_changed_ranges_wasm(this[0],Q[0]);let Z=getValue(TRANSFER_BUFFER,"i32"),$=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),J=Array(Z);if(Z>0){let q=$;for(let H=0;H<Z;H++)J[H]=unmarshalRange(q),q+=SIZE_OF_RANGE;C._free($)}return J}getIncludedRanges(){C._ts_tree_included_ranges_wasm(this[0]);let Q=getValue(TRANSFER_BUFFER,"i32"),Z=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),$=Array(Q);if(Q>0){let J=Z;for(let q=0;q<Q;q++)$[q]=unmarshalRange(J),J+=SIZE_OF_RANGE;C._free(Z)}return $}}class Node{constructor(Q,Z){assertInternal(Q),this.tree=Z}get typeId(){return marshalNode(this),C._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return marshalNode(this),C._ts_node_grammar_symbol_wasm(this.tree[0])}get type(){return this.tree.language.types[this.typeId]||"ERROR"}get grammarType(){return this.tree.language.types[this.grammarId]||"ERROR"}get endPosition(){return marshalNode(this),C._ts_node_end_point_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endIndex(){return marshalNode(this),C._ts_node_end_index_wasm(this.tree[0])}get text(){return getText(this.tree,this.startIndex,this.endIndex)}get parseState(){return marshalNode(this),C._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return marshalNode(this),C._ts_node_next_parse_state_wasm(this.tree[0])}get isNamed(){return marshalNode(this),C._ts_node_is_named_wasm(this.tree[0])===1}get hasError(){return marshalNode(this),C._ts_node_has_error_wasm(this.tree[0])===1}get hasChanges(){return marshalNode(this),C._ts_node_has_changes_wasm(this.tree[0])===1}get isError(){return marshalNode(this),C._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return marshalNode(this),C._ts_node_is_missing_wasm(this.tree[0])===1}get isExtra(){return marshalNode(this),C._ts_node_is_extra_wasm(this.tree[0])===1}equals(Q){return this.id===Q.id}child(Q){return marshalNode(this),C._ts_node_child_wasm(this.tree[0],Q),unmarshalNode(this.tree)}namedChild(Q){return marshalNode(this),C._ts_node_named_child_wasm(this.tree[0],Q),unmarshalNode(this.tree)}childForFieldId(Q){return marshalNode(this),C._ts_node_child_by_field_id_wasm(this.tree[0],Q),unmarshalNode(this.tree)}childForFieldName(Q){let Z=this.tree.language.fields.indexOf(Q);if(Z!==-1)return this.childForFieldId(Z);return null}fieldNameForChild(Q){marshalNode(this);let Z=C._ts_node_field_name_for_child_wasm(this.tree[0],Q);if(!Z)return null;return AsciiToString(Z)}childrenForFieldName(Q){let Z=this.tree.language.fields.indexOf(Q);if(Z!==-1&&Z!==0)return this.childrenForFieldId(Z);return[]}childrenForFieldId(Q){marshalNode(this),C._ts_node_children_by_field_id_wasm(this.tree[0],Q);let Z=getValue(TRANSFER_BUFFER,"i32"),$=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),J=Array(Z);if(Z>0){let q=$;for(let H=0;H<Z;H++)J[H]=unmarshalNode(this.tree,q),q+=SIZE_OF_NODE;C._free($)}return J}firstChildForIndex(Q){marshalNode(this);let Z=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(Z,Q,"i32"),C._ts_node_first_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}firstNamedChildForIndex(Q){marshalNode(this);let Z=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue(Z,Q,"i32"),C._ts_node_first_named_child_for_byte_wasm(this.tree[0]),unmarshalNode(this.tree)}get childCount(){return marshalNode(this),C._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return marshalNode(this),C._ts_node_named_child_count_wasm(this.tree[0])}get firstChild(){return this.child(0)}get firstNamedChild(){return this.namedChild(0)}get lastChild(){return this.child(this.childCount-1)}get lastNamedChild(){return this.namedChild(this.namedChildCount-1)}get children(){if(!this._children){marshalNode(this),C._ts_node_children_wasm(this.tree[0]);let Q=getValue(TRANSFER_BUFFER,"i32"),Z=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._children=Array(Q),Q>0){let $=Z;for(let J=0;J<Q;J++)this._children[J]=unmarshalNode(this.tree,$),$+=SIZE_OF_NODE;C._free(Z)}}return this._children}get namedChildren(){if(!this._namedChildren){marshalNode(this),C._ts_node_named_children_wasm(this.tree[0]);let Q=getValue(TRANSFER_BUFFER,"i32"),Z=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");if(this._namedChildren=Array(Q),Q>0){let $=Z;for(let J=0;J<Q;J++)this._namedChildren[J]=unmarshalNode(this.tree,$),$+=SIZE_OF_NODE;C._free(Z)}}return this._namedChildren}descendantsOfType(Q,Z,$){if(!Array.isArray(Q))Q=[Q];if(!Z)Z=ZERO_POINT;if(!$)$=ZERO_POINT;let J=[],q=this.tree.language.types;for(let W=0,k=q.length;W<k;W++)if(Q.includes(q[W]))J.push(W);let H=C._malloc(SIZE_OF_INT*J.length);for(let W=0,k=J.length;W<k;W++)setValue(H+W*SIZE_OF_INT,J[W],"i32");marshalNode(this),C._ts_node_descendants_of_type_wasm(this.tree[0],H,J.length,Z.row,Z.column,$.row,$.column);let Y=getValue(TRANSFER_BUFFER,"i32"),U=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),j=Array(Y);if(Y>0){let W=U;for(let k=0;k<Y;k++)j[k]=unmarshalNode(this.tree,W),W+=SIZE_OF_NODE}return C._free(U),C._free(H),j}get nextSibling(){return marshalNode(this),C._ts_node_next_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousSibling(){return marshalNode(this),C._ts_node_prev_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get nextNamedSibling(){return marshalNode(this),C._ts_node_next_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get previousNamedSibling(){return marshalNode(this),C._ts_node_prev_named_sibling_wasm(this.tree[0]),unmarshalNode(this.tree)}get descendantCount(){return marshalNode(this),C._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return marshalNode(this),C._ts_node_parent_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForIndex(Q,Z=Q){if(typeof Q!=="number"||typeof Z!=="number")throw Error("Arguments must be numbers");marshalNode(this);let $=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue($,Q,"i32"),setValue($+SIZE_OF_INT,Z,"i32"),C._ts_node_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForIndex(Q,Z=Q){if(typeof Q!=="number"||typeof Z!=="number")throw Error("Arguments must be numbers");marshalNode(this);let $=TRANSFER_BUFFER+SIZE_OF_NODE;return setValue($,Q,"i32"),setValue($+SIZE_OF_INT,Z,"i32"),C._ts_node_named_descendant_for_index_wasm(this.tree[0]),unmarshalNode(this.tree)}descendantForPosition(Q,Z=Q){if(!isPoint(Q)||!isPoint(Z))throw Error("Arguments must be {row, column} objects");marshalNode(this);let $=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint($,Q),marshalPoint($+SIZE_OF_POINT,Z),C._ts_node_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}namedDescendantForPosition(Q,Z=Q){if(!isPoint(Q)||!isPoint(Z))throw Error("Arguments must be {row, column} objects");marshalNode(this);let $=TRANSFER_BUFFER+SIZE_OF_NODE;return marshalPoint($,Q),marshalPoint($+SIZE_OF_POINT,Z),C._ts_node_named_descendant_for_position_wasm(this.tree[0]),unmarshalNode(this.tree)}walk(){return marshalNode(this),C._ts_tree_cursor_new_wasm(this.tree[0]),new TreeCursor(INTERNAL,this.tree)}toString(){marshalNode(this);let Q=C._ts_node_to_string_wasm(this.tree[0]),Z=AsciiToString(Q);return C._free(Q),Z}}class TreeCursor{constructor(Q,Z){assertInternal(Q),this.tree=Z,unmarshalTreeCursor(this)}delete(){marshalTreeCursor(this),C._ts_tree_cursor_delete_wasm(this.tree[0]),this[0]=this[1]=this[2]=0}reset(Q){marshalNode(Q),marshalTreeCursor(this,TRANSFER_BUFFER+SIZE_OF_NODE),C._ts_tree_cursor_reset_wasm(this.tree[0]),unmarshalTreeCursor(this)}resetTo(Q){marshalTreeCursor(this,TRANSFER_BUFFER),marshalTreeCursor(Q,TRANSFER_BUFFER+SIZE_OF_CURSOR),C._ts_tree_cursor_reset_to_wasm(this.tree[0],Q.tree[0]),unmarshalTreeCursor(this)}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_start_index_wasm(this.tree[0]),Z=C._ts_tree_cursor_end_index_wasm(this.tree[0]);return getText(this.tree,Q,Z)}get startPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_start_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get endPosition(){return marshalTreeCursor(this),C._ts_tree_cursor_end_position_wasm(this.tree[0]),unmarshalPoint(TRANSFER_BUFFER)}get startIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_end_index_wasm(this.tree[0])}get currentNode(){return marshalTreeCursor(this),C._ts_tree_cursor_current_node_wasm(this.tree[0]),unmarshalNode(this.tree)}get currentFieldId(){return marshalTreeCursor(this),C._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return marshalTreeCursor(this),C._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return marshalTreeCursor(this),C._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}gotoFirstChild(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),Q===1}gotoLastChild(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return unmarshalTreeCursor(this),Q===1}gotoFirstChildForIndex(Q){marshalTreeCursor(this),setValue(TRANSFER_BUFFER+SIZE_OF_CURSOR,Q,"i32");let Z=C._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return unmarshalTreeCursor(this),Z===1}gotoFirstChildForPosition(Q){marshalTreeCursor(this),marshalPoint(TRANSFER_BUFFER+SIZE_OF_CURSOR,Q);let Z=C._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return unmarshalTreeCursor(this),Z===1}gotoNextSibling(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),Q===1}gotoPreviousSibling(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return unmarshalTreeCursor(this),Q===1}gotoDescendant(Q){marshalTreeCursor(this),C._ts_tree_cursor_goto_descendant_wasm(this.tree[0],Q),unmarshalTreeCursor(this)}gotoParent(){marshalTreeCursor(this);let Q=C._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return unmarshalTreeCursor(this),Q===1}}class Language{constructor(Q,Z){assertInternal(Q),this[0]=Z,this.types=Array(C._ts_language_symbol_count(this[0]));for(let $=0,J=this.types.length;$<J;$++)if(C._ts_language_symbol_type(this[0],$)<2)this.types[$]=UTF8ToString(C._ts_language_symbol_name(this[0],$));this.fields=Array(C._ts_language_field_count(this[0])+1);for(let $=0,J=this.fields.length;$<J;$++){let q=C._ts_language_field_name_for_id(this[0],$);if(q!==0)this.fields[$]=UTF8ToString(q);else this.fields[$]=null}}get version(){return C._ts_language_version(this[0])}get fieldCount(){return this.fields.length-1}get stateCount(){return C._ts_language_state_count(this[0])}fieldIdForName(Q){let Z=this.fields.indexOf(Q);if(Z!==-1)return Z;else return null}fieldNameForId(Q){return this.fields[Q]||null}idForNodeType(Q,Z){let $=lengthBytesUTF8(Q),J=C._malloc($+1);stringToUTF8(Q,J,$+1);let q=C._ts_language_symbol_for_name(this[0],J,$,Z);return C._free(J),q||null}get nodeTypeCount(){return C._ts_language_symbol_count(this[0])}nodeTypeForId(Q){let Z=C._ts_language_symbol_name(this[0],Q);return Z?UTF8ToString(Z):null}nodeTypeIsNamed(Q){return C._ts_language_type_is_named_wasm(this[0],Q)?!0:!1}nodeTypeIsVisible(Q){return C._ts_language_type_is_visible_wasm(this[0],Q)?!0:!1}nextState(Q,Z){return C._ts_language_next_state(this[0],Q,Z)}lookaheadIterator(Q){let Z=C._ts_lookahead_iterator_new(this[0],Q);if(Z)return new LookaheadIterable(INTERNAL,Z,this);return null}query(Q){let Z=lengthBytesUTF8(Q),$=C._malloc(Z+1);stringToUTF8(Q,$,Z+1);let J=C._ts_query_new(this[0],$,Z,TRANSFER_BUFFER,TRANSFER_BUFFER+SIZE_OF_INT);if(!J){let K=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),w=getValue(TRANSFER_BUFFER,"i32"),O=UTF8ToString($,w).length,V=Q.substr(O,100).split(`
|
|
3
|
+
`)[0],R=V.match(QUERY_WORD_REGEX)[0],T;switch(K){case 2:T=RangeError(`Bad node name '${R}'`);break;case 3:T=RangeError(`Bad field name '${R}'`);break;case 4:T=RangeError(`Bad capture name @${R}`);break;case 5:T=TypeError(`Bad pattern structure at offset ${O}: '${V}'...`),R="";break;default:T=SyntaxError(`Bad syntax at offset ${O}: '${V}'...`),R="";break}throw T.index=O,T.length=R.length,C._free($),T}let q=C._ts_query_string_count(J),H=C._ts_query_capture_count(J),Y=C._ts_query_pattern_count(J),U=Array(H),j=Array(q);for(let K=0;K<H;K++){let w=C._ts_query_capture_name_for_id(J,K,TRANSFER_BUFFER),O=getValue(TRANSFER_BUFFER,"i32");U[K]=UTF8ToString(w,O)}for(let K=0;K<q;K++){let w=C._ts_query_string_value_for_id(J,K,TRANSFER_BUFFER),O=getValue(TRANSFER_BUFFER,"i32");j[K]=UTF8ToString(w,O)}let W=Array(Y),k=Array(Y),F=Array(Y),z=Array(Y),G=Array(Y);for(let K=0;K<Y;K++){let w=C._ts_query_predicates_for_pattern(J,K,TRANSFER_BUFFER),O=getValue(TRANSFER_BUFFER,"i32");z[K]=[],G[K]=[];let V=[],R=w;for(let T=0;T<O;T++){let v=getValue(R,"i32");R+=SIZE_OF_INT;let b=getValue(R,"i32");if(R+=SIZE_OF_INT,v===PREDICATE_STEP_TYPE_CAPTURE)V.push({type:"capture",name:U[b]});else if(v===PREDICATE_STEP_TYPE_STRING)V.push({type:"string",value:j[b]});else if(V.length>0){if(V[0].type!=="string")throw Error("Predicates must begin with a literal value");let _=V[0].value,A=!0,h=!0,N;switch(_){case"any-not-eq?":case"not-eq?":A=!1;case"any-eq?":case"eq?":if(V.length!==3)throw Error(`Wrong number of arguments to \`#${_}\` predicate. Expected 2, got ${V.length-1}`);if(V[1].type!=="capture")throw Error(`First argument of \`#${_}\` predicate must be a capture. Got "${V[1].value}"`);if(h=!_.startsWith("any-"),V[2].type==="capture"){let B=V[1].name,E=V[2].name;G[K].push((P)=>{let L=[],I=[];for(let S of P){if(S.name===B)L.push(S.node);if(S.name===E)I.push(S.node)}let M=(S,f,N0)=>N0?S.text===f.text:S.text!==f.text;return h?L.every((S)=>I.some((f)=>M(S,f,A))):L.some((S)=>I.some((f)=>M(S,f,A)))})}else{N=V[1].name;let B=V[2].value,E=(L)=>L.text===B,P=(L)=>L.text!==B;G[K].push((L)=>{let I=[];for(let S of L)if(S.name===N)I.push(S.node);let M=A?E:P;return h?I.every(M):I.some(M)})}break;case"any-not-match?":case"not-match?":A=!1;case"any-match?":case"match?":if(V.length!==3)throw Error(`Wrong number of arguments to \`#${_}\` predicate. Expected 2, got ${V.length-1}.`);if(V[1].type!=="capture")throw Error(`First argument of \`#${_}\` predicate must be a capture. Got "${V[1].value}".`);if(V[2].type!=="string")throw Error(`Second argument of \`#${_}\` predicate must be a string. Got @${V[2].value}.`);N=V[1].name;let y=new RegExp(V[2].value);h=!_.startsWith("any-"),G[K].push((B)=>{let E=[];for(let L of B)if(L.name===N)E.push(L.node.text);let P=(L,I)=>I?y.test(L):!y.test(L);if(E.length===0)return!A;return h?E.every((L)=>P(L,A)):E.some((L)=>P(L,A))});break;case"set!":if(V.length<2||V.length>3)throw Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${V.length-1}.`);if(V.some((B)=>B.type!=="string"))throw Error('Arguments to `#set!` predicate must be a strings.".');if(!W[K])W[K]={};W[K][V[1].value]=V[2]?V[2].value:null;break;case"is?":case"is-not?":if(V.length<2||V.length>3)throw Error(`Wrong number of arguments to \`#${_}\` predicate. Expected 1 or 2. Got ${V.length-1}.`);if(V.some((B)=>B.type!=="string"))throw Error(`Arguments to \`#${_}\` predicate must be a strings.".`);let x=_==="is?"?k:F;if(!x[K])x[K]={};x[K][V[1].value]=V[2]?V[2].value:null;break;case"not-any-of?":A=!1;case"any-of?":if(V.length<2)throw Error(`Wrong number of arguments to \`#${_}\` predicate. Expected at least 1. Got ${V.length-1}.`);if(V[1].type!=="capture")throw Error(`First argument of \`#${_}\` predicate must be a capture. Got "${V[1].value}".`);for(let B=2;B<V.length;B++)if(V[B].type!=="string")throw Error(`Arguments to \`#${_}\` predicate must be a strings.".`);N=V[1].name;let Y0=V.slice(2).map((B)=>B.value);G[K].push((B)=>{let E=[];for(let P of B)if(P.name===N)E.push(P.node.text);if(E.length===0)return!A;return E.every((P)=>Y0.includes(P))===A});break;default:z[K].push({operator:_,operands:V.slice(1)})}V.length=0}}Object.freeze(W[K]),Object.freeze(k[K]),Object.freeze(F[K])}return C._free($),new Query(INTERNAL,J,U,G,z,Object.freeze(W),Object.freeze(k),Object.freeze(F))}static load(Q){let Z;if(Q instanceof Uint8Array)Z=Promise.resolve(Q);else{let $=Q;if(typeof process<"u"&&process.versions&&process.versions.node){let J=t("fs");Z=Promise.resolve(J.readFileSync($))}else Z=fetch($).then((J)=>J.arrayBuffer().then((q)=>{if(J.ok)return new Uint8Array(q);else{let H=new TextDecoder("utf-8").decode(q);throw Error(`Language.load failed with status ${J.status}.
|
|
4
4
|
|
|
5
|
-
${H}`)}}))}return Z.then(($)=>loadWebAssemblyModule($,{loadAsync:!0})).then(($)=>{let J=Object.keys($),q=J.find((
|
|
6
|
-
${JSON.stringify(J,null,2)}`);let H=$[q]();return new Language(INTERNAL,H)})}}class LookaheadIterable{constructor(Q,Z,$){assertInternal(Q),this[0]=Z,this.language=$}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(Q){return C._ts_lookahead_iterator_reset_state(this[0],Q)}reset(Q,Z){if(C._ts_lookahead_iterator_reset(this[0],Q[0],Z))return this.language=Q,!0;return!1}[Symbol.iterator](){let Q=this;return{next(){if(C._ts_lookahead_iterator_next(Q[0]))return{done:!1,value:Q.currentType};return{done:!0,value:""}}}}}class Query{constructor(Q,Z,$,J,q,H,U,Y){assertInternal(Q),this[0]=Z,this.captureNames=$,this.textPredicates=J,this.predicates=q,this.setProperties=H,this.assertedProperties=U,this.refutedProperties=Y,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(Q,{startPosition:Z=ZERO_POINT,endPosition:$=ZERO_POINT,startIndex:J=0,endIndex:q=0,matchLimit:H=4294967295,maxStartDepth:U=4294967295,timeoutMicros:Y=0}={}){if(typeof H!=="number")throw Error("Arguments must be numbers");marshalNode(Q),C._ts_query_matches_wasm(this[0],Q.tree[0],Z.row,Z.column,$.row,$.column,J,q,H,U,Y);let j=getValue(TRANSFER_BUFFER,"i32"),W=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),k=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),F=Array(j);this.exceededMatchLimit=Boolean(k);let z=0,G=W;for(let K=0;K<j;K++){let w=getValue(G,"i32");G+=SIZE_OF_INT;let D=getValue(G,"i32");G+=SIZE_OF_INT;let V=Array(D);if(G=unmarshalCaptures(this,Q.tree,G,V),this.textPredicates[w].every((R)=>R(V))){F[z]={pattern:w,captures:V};let R=this.setProperties[w];if(R)F[z].setProperties=R;let T=this.assertedProperties[w];if(T)F[z].assertedProperties=T;let S=this.refutedProperties[w];if(S)F[z].refutedProperties=S;z++}}return F.length=z,C._free(W),F}captures(Q,{startPosition:Z=ZERO_POINT,endPosition:$=ZERO_POINT,startIndex:J=0,endIndex:q=0,matchLimit:H=4294967295,maxStartDepth:U=4294967295,timeoutMicros:Y=0}={}){if(typeof H!=="number")throw Error("Arguments must be numbers");marshalNode(Q),C._ts_query_captures_wasm(this[0],Q.tree[0],Z.row,Z.column,$.row,$.column,J,q,H,U,Y);let j=getValue(TRANSFER_BUFFER,"i32"),W=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),k=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),F=[];this.exceededMatchLimit=Boolean(k);let z=[],G=W;for(let K=0;K<j;K++){let w=getValue(G,"i32");G+=SIZE_OF_INT;let D=getValue(G,"i32");G+=SIZE_OF_INT;let V=getValue(G,"i32");if(G+=SIZE_OF_INT,z.length=D,G=unmarshalCaptures(this,Q.tree,G,z),this.textPredicates[w].every((R)=>R(z))){let R=z[V],T=this.setProperties[w];if(T)R.setProperties=T;let S=this.assertedProperties[w];if(S)R.assertedProperties=S;let b=this.refutedProperties[w];if(b)R.refutedProperties=b;F.push(R)}}return C._free(W),F}predicatesForPattern(Q){return this.predicates[Q]}disableCapture(Q){let Z=lengthBytesUTF8(Q),$=C._malloc(Z+1);stringToUTF8(Q,$,Z+1),C._ts_query_disable_capture(this[0],$,Z),C._free($)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(Q,Z,$){let J=$-Z,q=Q.textCallback(Z,null,$);Z+=q.length;while(Z<$){let H=Q.textCallback(Z,null,$);if(H&&H.length>0)Z+=H.length,q+=H;else break}if(Z>$)q=q.slice(0,J);return q}function unmarshalCaptures(Q,Z,$,J){for(let q=0,H=J.length;q<H;q++){let U=getValue($,"i32");$+=SIZE_OF_INT;let Y=unmarshalNode(Z,$);$+=SIZE_OF_NODE,J[q]={name:Q.captureNames[U],node:Y}}return $}function assertInternal(Q){if(Q!==INTERNAL)throw Error("Illegal constructor")}function isPoint(Q){return Q&&typeof Q.row==="number"&&typeof Q.column==="number"}function marshalNode(Q){let Z=TRANSFER_BUFFER;setValue(Z,Q.id,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q.startIndex,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q.startPosition.row,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q.startPosition.column,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q[0],"i32")}function unmarshalNode(Q,Z=TRANSFER_BUFFER){let $=getValue(Z,"i32");if(Z+=SIZE_OF_INT,$===0)return null;let J=getValue(Z,"i32");Z+=SIZE_OF_INT;let q=getValue(Z,"i32");Z+=SIZE_OF_INT;let H=getValue(Z,"i32");Z+=SIZE_OF_INT;let U=getValue(Z,"i32"),Y=new Node(INTERNAL,Q);return Y.id=$,Y.startIndex=J,Y.startPosition={row:q,column:H},Y[0]=U,Y}function marshalTreeCursor(Q,Z=TRANSFER_BUFFER){setValue(Z+0*SIZE_OF_INT,Q[0],"i32"),setValue(Z+1*SIZE_OF_INT,Q[1],"i32"),setValue(Z+2*SIZE_OF_INT,Q[2],"i32"),setValue(Z+3*SIZE_OF_INT,Q[3],"i32")}function unmarshalTreeCursor(Q){Q[0]=getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,"i32"),Q[1]=getValue(TRANSFER_BUFFER+1*SIZE_OF_INT,"i32"),Q[2]=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),Q[3]=getValue(TRANSFER_BUFFER+3*SIZE_OF_INT,"i32")}function marshalPoint(Q,Z){setValue(Q,Z.row,"i32"),setValue(Q+SIZE_OF_INT,Z.column,"i32")}function unmarshalPoint(Q){return{row:getValue(Q,"i32")>>>0,column:getValue(Q+SIZE_OF_INT,"i32")>>>0}}function marshalRange(Q,Z){marshalPoint(Q,Z.startPosition),Q+=SIZE_OF_POINT,marshalPoint(Q,Z.endPosition),Q+=SIZE_OF_POINT,setValue(Q,Z.startIndex,"i32"),Q+=SIZE_OF_INT,setValue(Q,Z.endIndex,"i32"),Q+=SIZE_OF_INT}function unmarshalRange(Q){let Z={};return Z.startPosition=unmarshalPoint(Q),Q+=SIZE_OF_POINT,Z.endPosition=unmarshalPoint(Q),Q+=SIZE_OF_POINT,Z.startIndex=getValue(Q,"i32")>>>0,Q+=SIZE_OF_INT,Z.endIndex=getValue(Q,"i32")>>>0,Z}function marshalEdit(Q){let Z=TRANSFER_BUFFER;marshalPoint(Z,Q.startPosition),Z+=SIZE_OF_POINT,marshalPoint(Z,Q.oldEndPosition),Z+=SIZE_OF_POINT,marshalPoint(Z,Q.newEndPosition),Z+=SIZE_OF_POINT,setValue(Z,Q.startIndex,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q.oldEndIndex,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q.newEndIndex,"i32"),Z+=SIZE_OF_INT}for(let Q of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,Q,{value:ParserImpl.prototype[Q],enumerable:!1,writable:!1});Parser.Language=Language,X.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}})}}return Parser}();if(typeof m==="object")g.exports=m0});var d=g0(Y0(),1);import{delimiter as OQ,join as t0}from"path";import{existsSync as FQ,statSync as p0}from"fs";import{homedir as u0}from"os";import{delimiter as V0,dirname as c,join as u}from"path";import{fileURLToPath as a}from"url";var s={"web-tree-sitter":"0.24.7","tree-sitter-wasms":"0.1.13"};var l0=s["tree-sitter-wasms"];function i0(Q){return`https://cdn.jsdelivr.net/npm/tree-sitter-wasms@${l0}/out/tree-sitter-${Q}.wasm`}function p(Q,Z,$,J){return{name:Q,file:`tree-sitter-${Q}.wasm`,url:i0(Q),sha256:Z,bytes:$,langs:J}}var K0={typescript:p("typescript","8515404dceed38e1ed86aa34b09fcf3379fff1b4ff9dd3967bcd6d1eb5ac3d8f",2342690,["ts"]),tsx:p("tsx","6aa3b2c70e76f5d48eafef1093e9c4de383e13f2fdde2f4e9b98a378f6a8f1b6",2411272,["tsx"]),javascript:p("javascript","63812b9e275d26851264734868d27a1656bd44a2ef6eb3e85e6b03728c595ab5",647334,["js","jsx"]),python:p("python","9056d0fb0c337810d019fae350e8167786119da98f0f282aceae7ab89ee8253b",476105,["py"])},n0=(()=>{let Q={};for(let Z of Object.values(K0))for(let $ of Z.langs)Q[$]=Z.name;return Q})();function e(Q){let Z=n0[Q];if(Z===void 0)throw Error(`no grammar for language "${Q}"`);return K0[Z]}function o0(Q=process.env){let Z=Q.MYC_GRAMMARS_DIR;if(Z!==void 0&&Z!=="")return Z;return u(u0(),".cache","myc","grammars")}function j0(Q){try{return u(c(a(import.meta.url)),"..","vendor",Q)}catch{return null}}function d0(){try{let Q=Bun.resolveSync("tree-sitter-wasms/package.json",c(a(import.meta.url)));return u(c(Q),"out")}catch{return null}}function Q0(Q=process.env){let Z=Q.MYC_TREE_SITTER_GRAMMAR_DIR;if(Z!==void 0&&Z!=="")return Z.split(V0).filter((H)=>H.length>0);let $=[o0(Q)],J=j0("tree-sitter-grammars");if(J!==null)$.push(J);let q=d0();if(q!==null)$.push(q);return $}function Z0(Q=process.env){let Z=Q.MYC_TREE_SITTER_DIR;if(Z!==void 0&&Z!=="")return Z.split(V0).filter((q)=>q.length>0);let $=[],J=j0("tree-sitter");if(J!==null)$.push(J);try{let q=Bun.resolveSync("web-tree-sitter/package.json",c(a(import.meta.url)));$.push(c(q))}catch{}return $}var l="tree-sitter.wasm";function W0(Q,Z,$){for(let J of Q){let q=u(J,Z);try{let H=p0(q);if(!H.isFile())continue;if($!==void 0&&H.size!==$)continue;return q}catch{continue}}return null}function z0(Q,Z=process.env){let $=e(Q);return W0(Q0(Z),$.file,$.bytes)}function C0(Q=process.env){return W0(Z0(Q),l)}function G0(Q){if(Q<1024)return`${Q} B`;let Z=["KB","MB","GB"],$=Q/1024,J=0;while($>=1024&&J<Z.length-1)$/=1024,J++;return`${$.toFixed(1)} ${Z[J]}`}class F0 extends Error{lang;constructor(Q){super(`tree-sitter grammar for "${Q}" is not loaded: call await loadLang("${Q}") before listDefs`);this.lang=Q;this.name="GrammarNotLoadedError"}}var n={function_declaration:"function",generator_function_declaration:"function",class_declaration:"class",abstract_class_declaration:"class",interface_declaration:"interface",enum_declaration:"enum",type_alias_declaration:"type",method_definition:"method"},r0={function_definition:"function",class_definition:"class"},s0=new Set(["arrow_function","function_expression","function","generator_function"]),w0={ts:{kinds:n,declarators:!0,methodByParent:[]},tsx:{kinds:n,declarators:!0,methodByParent:[]},js:{kinds:n,declarators:!0,methodByParent:[]},jsx:{kinds:n,declarators:!0,methodByParent:[]},py:{kinds:r0,declarators:!1,methodByParent:["block"]}},_Q=Object.keys(w0),o=null,$0=new Map,k0=new Map;class X0 extends Error{hint;constructor(Q,Z){super(Q);this.hint=Z;this.name="MissingResourceError"}}class R0 extends X0{searched;constructor(Q){super(`tree-sitter runtime not found: ${l} is in none of the directories [${Q.join(", ")}]. It ships with myc, so its absence means a broken install: reinstall the package or set MYC_TREE_SITTER_DIR to the directory that has the file`,"bun add -g @aistastudio/myc");this.searched=Q;this.name="RuntimeMissingError"}}class B0 extends X0{lang;searched;constructor(Q,Z){let $=e(Q);super(`tree-sitter grammar for "${Q}" is not downloaded: ${$.file} (${G0($.bytes)}) is in none of the directories [${Z.join(", ")}]`,`myc code fetch ${Q}`);this.lang=Q;this.searched=Z;this.name="GrammarMissingError"}}function a0(){let Q=C0();if(Q===null)throw new R0(Z0());return Q.slice(0,Q.length-l.length-1)}function e0(Q){let Z=z0(Q);if(Z===null)throw new B0(Q,Q0());return Z}async function QQ(){if(o===null){let Q=a0();o=d.default.init({locateFile:(Z)=>t0(Q,Z)}).catch((Z)=>{throw o=null,Z})}return o}async function T0(Q){let Z=$0.get(Q);if(Z===void 0)Z=(async()=>{await QQ();let $=await d.default.Language.load(e0(Q)),J=new d.default;return J.setLanguage($),J})().catch(($)=>{throw $0.delete(Q),$}),$0.set(Q,Z);k0.set(Q,await Z)}function ZQ(Q){let Z=k0.get(Q);if(Z===void 0)throw new F0(Q);return Z}function $Q(Q){let Z=Q.childForFieldName("name");if(Z===null)return null;let $=Z.text;return $.length>0?$:null}function XQ(Q){let Z=Q.childForFieldName("value");return Z!==null&&s0.has(Z.type)}function JQ(Q,Z){if(Z.length===0)return!1;let $=Q.parent;while($!==null&&$.type==="decorated_definition")$=$.parent;if($===null||!Z.includes($.type))return!1;let J=$.parent;return J!==null&&J.type.endsWith("class_definition")}function D0(Q,Z){let $=w0[Z],J=$.kinds[Q.type];if(J!==void 0)return JQ(Q,$.methodByParent)?"method":J;if($.declarators&&Q.type==="variable_declarator"&&XQ(Q))return"function";return null}function O0(Q){return $Q(Q)}function L0(Q,Z,$,J={}){let q=$.startPosition.row+1;return{name:Q,kind:Z,startLine:q,endLine:J.naiveEnd===!0?q:$.endPosition.row+1}}function _0(Q){return ZQ(Q)}var qQ=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier"]),HQ=new Set(["formal_parameters","required_parameter","optional_parameter","rest_pattern","object_pattern","array_pattern","pair_pattern","object_assignment_pattern","import_clause","namespace_import","parameters","lambda_parameters","default_parameter","typed_parameter","typed_default_parameter","as_pattern_target"]),UQ=new Set(["import_specifier","export_specifier","aliased_import"]),YQ=new Set(["jsx_opening_element","jsx_self_closing_element","jsx_closing_element"]),E0=new Set(["call_expression","call"]),VQ=new Set(["member_expression","attribute"]);function v(Q,Z,$){let J=Q.childForFieldName(Z);return J!==null&&J.id===$.id}function KQ(Q){let Z=Q.parent,$=Z===null?null:Z.parent;return $!==null&&$.childForFieldName("source")!==null}function jQ(Q){let Z=Q.parent;if(Z===null)return null;if(E0.has(Z.type)&&v(Z,"function",Q))return"call";if(Z.type==="new_expression"&&v(Z,"constructor",Q))return"new";return null}function WQ(Q){let Z=Q.parent;if(Z===null)return null;let $=Z.type;if(UQ.has($)){if(!v(Z,"name",Q))return null;return $==="export_specifier"&&!KQ(Z)?"read":"import"}if(YQ.has($))return v(Z,"name",Q)?"read":null;if($==="jsx_attribute")return null;if(HQ.has($))return null;if(v(Z,"name",Q))return null;if($==="pair"&&v(Z,"key",Q))return null;if($==="keyword_argument"&&v(Z,"name",Q))return null;if($==="catch_clause"&&v(Z,"parameter",Q))return null;if(E0.has($)&&v(Z,"function",Q))return"call";if($==="new_expression"&&v(Z,"constructor",Q))return"new";if(VQ.has($)){if(v(Z,"property",Q)||v(Z,"attribute",Q))return jQ(Z)??"prop";return"read"}if($==="dotted_name")return"import";if(Q.type==="type_identifier")return"type";if($==="extends_clause"||$==="implements_clause")return"type";if(Q.type==="property_identifier")return"prop";return"read"}function A0(Q,Z,$={}){let q=_0(Z).parse(Q);try{let H=[],U=[],Y=new Set,j=[],W=$.naiveOwner===!0,k=(F)=>{let z=!1,G=D0(F,Z);if(G!==null){let K=O0(F);if(K!==null)H.push(L0(K,G,F,$)),j.push({name:K,start:F.startPosition.row+1}),z=!0}if(qQ.has(F.type)){let K=WQ(F);if(K!==null){let w=F.text;if(w.length>0){let D=W||j.length===0?null:j[j.length-1],V=F.startPosition.row+1,R=D===null?"":D.name,T=D===null?0:D.start,S=`${w}\x00${V}\x00${K}\x00${T}`;if(!Y.has(S))Y.add(S),U.push({name:w,line:V,kind:K,from:R,fromStart:T})}}}for(let K=0;K<F.namedChildCount;K++){let w=F.namedChild(K);if(w!==null)k(w)}if(z)j.pop()};return k(q.rootNode),{defs:H,refs:U}}finally{q.delete()}}var P0=process.env.MYC_TREE_SITTER_DIR,S0=process.env.MYC_TREE_SITTER_GRAMMAR_DIR;if(P0===void 0||P0===""||S0===void 0||S0==="")throw Error("parse worker started without tree-sitter directories: MYC_TREE_SITTER_DIR and MYC_TREE_SITTER_GRAMMAR_DIR are set by the main thread (ParsePool). There is nothing "+"to look them up with here \u2014 node_modules does not exist across the thread boundary");var J0=globalThis;J0.onmessage=(Q)=>{let{id:Z,source:$,lang:J}=Q.data;(async()=>{try{await T0(J);let{defs:q,refs:H}=A0($,J);J0.postMessage({id:Z,defs:q,refs:H})}catch(q){J0.postMessage({id:Z,error:q instanceof Error?q.message:String(q)})}})()};
|
|
5
|
+
${H}`)}}))}return Z.then(($)=>loadWebAssemblyModule($,{loadAsync:!0})).then(($)=>{let J=Object.keys($),q=J.find((Y)=>LANGUAGE_FUNCTION_REGEX.test(Y)&&!Y.includes("external_scanner_"));if(!q)console.log(`Couldn't find language function in WASM file. Symbols:
|
|
6
|
+
${JSON.stringify(J,null,2)}`);let H=$[q]();return new Language(INTERNAL,H)})}}class LookaheadIterable{constructor(Q,Z,$){assertInternal(Q),this[0]=Z,this.language=$}get currentTypeId(){return C._ts_lookahead_iterator_current_symbol(this[0])}get currentType(){return this.language.types[this.currentTypeId]||"ERROR"}delete(){C._ts_lookahead_iterator_delete(this[0]),this[0]=0}resetState(Q){return C._ts_lookahead_iterator_reset_state(this[0],Q)}reset(Q,Z){if(C._ts_lookahead_iterator_reset(this[0],Q[0],Z))return this.language=Q,!0;return!1}[Symbol.iterator](){let Q=this;return{next(){if(C._ts_lookahead_iterator_next(Q[0]))return{done:!1,value:Q.currentType};return{done:!0,value:""}}}}}class Query{constructor(Q,Z,$,J,q,H,Y,U){assertInternal(Q),this[0]=Z,this.captureNames=$,this.textPredicates=J,this.predicates=q,this.setProperties=H,this.assertedProperties=Y,this.refutedProperties=U,this.exceededMatchLimit=!1}delete(){C._ts_query_delete(this[0]),this[0]=0}matches(Q,{startPosition:Z=ZERO_POINT,endPosition:$=ZERO_POINT,startIndex:J=0,endIndex:q=0,matchLimit:H=4294967295,maxStartDepth:Y=4294967295,timeoutMicros:U=0}={}){if(typeof H!=="number")throw Error("Arguments must be numbers");marshalNode(Q),C._ts_query_matches_wasm(this[0],Q.tree[0],Z.row,Z.column,$.row,$.column,J,q,H,Y,U);let j=getValue(TRANSFER_BUFFER,"i32"),W=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),k=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),F=Array(j);this.exceededMatchLimit=Boolean(k);let z=0,G=W;for(let K=0;K<j;K++){let w=getValue(G,"i32");G+=SIZE_OF_INT;let O=getValue(G,"i32");G+=SIZE_OF_INT;let V=Array(O);if(G=unmarshalCaptures(this,Q.tree,G,V),this.textPredicates[w].every((R)=>R(V))){F[z]={pattern:w,captures:V};let R=this.setProperties[w];if(R)F[z].setProperties=R;let T=this.assertedProperties[w];if(T)F[z].assertedProperties=T;let v=this.refutedProperties[w];if(v)F[z].refutedProperties=v;z++}}return F.length=z,C._free(W),F}captures(Q,{startPosition:Z=ZERO_POINT,endPosition:$=ZERO_POINT,startIndex:J=0,endIndex:q=0,matchLimit:H=4294967295,maxStartDepth:Y=4294967295,timeoutMicros:U=0}={}){if(typeof H!=="number")throw Error("Arguments must be numbers");marshalNode(Q),C._ts_query_captures_wasm(this[0],Q.tree[0],Z.row,Z.column,$.row,$.column,J,q,H,Y,U);let j=getValue(TRANSFER_BUFFER,"i32"),W=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),k=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),F=[];this.exceededMatchLimit=Boolean(k);let z=[],G=W;for(let K=0;K<j;K++){let w=getValue(G,"i32");G+=SIZE_OF_INT;let O=getValue(G,"i32");G+=SIZE_OF_INT;let V=getValue(G,"i32");if(G+=SIZE_OF_INT,z.length=O,G=unmarshalCaptures(this,Q.tree,G,z),this.textPredicates[w].every((R)=>R(z))){let R=z[V],T=this.setProperties[w];if(T)R.setProperties=T;let v=this.assertedProperties[w];if(v)R.assertedProperties=v;let b=this.refutedProperties[w];if(b)R.refutedProperties=b;F.push(R)}}return C._free(W),F}predicatesForPattern(Q){return this.predicates[Q]}disableCapture(Q){let Z=lengthBytesUTF8(Q),$=C._malloc(Z+1);stringToUTF8(Q,$,Z+1),C._ts_query_disable_capture(this[0],$,Z),C._free($)}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(Q,Z,$){let J=$-Z,q=Q.textCallback(Z,null,$);Z+=q.length;while(Z<$){let H=Q.textCallback(Z,null,$);if(H&&H.length>0)Z+=H.length,q+=H;else break}if(Z>$)q=q.slice(0,J);return q}function unmarshalCaptures(Q,Z,$,J){for(let q=0,H=J.length;q<H;q++){let Y=getValue($,"i32");$+=SIZE_OF_INT;let U=unmarshalNode(Z,$);$+=SIZE_OF_NODE,J[q]={name:Q.captureNames[Y],node:U}}return $}function assertInternal(Q){if(Q!==INTERNAL)throw Error("Illegal constructor")}function isPoint(Q){return Q&&typeof Q.row==="number"&&typeof Q.column==="number"}function marshalNode(Q){let Z=TRANSFER_BUFFER;setValue(Z,Q.id,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q.startIndex,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q.startPosition.row,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q.startPosition.column,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q[0],"i32")}function unmarshalNode(Q,Z=TRANSFER_BUFFER){let $=getValue(Z,"i32");if(Z+=SIZE_OF_INT,$===0)return null;let J=getValue(Z,"i32");Z+=SIZE_OF_INT;let q=getValue(Z,"i32");Z+=SIZE_OF_INT;let H=getValue(Z,"i32");Z+=SIZE_OF_INT;let Y=getValue(Z,"i32"),U=new Node(INTERNAL,Q);return U.id=$,U.startIndex=J,U.startPosition={row:q,column:H},U[0]=Y,U}function marshalTreeCursor(Q,Z=TRANSFER_BUFFER){setValue(Z+0*SIZE_OF_INT,Q[0],"i32"),setValue(Z+1*SIZE_OF_INT,Q[1],"i32"),setValue(Z+2*SIZE_OF_INT,Q[2],"i32"),setValue(Z+3*SIZE_OF_INT,Q[3],"i32")}function unmarshalTreeCursor(Q){Q[0]=getValue(TRANSFER_BUFFER+0*SIZE_OF_INT,"i32"),Q[1]=getValue(TRANSFER_BUFFER+1*SIZE_OF_INT,"i32"),Q[2]=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),Q[3]=getValue(TRANSFER_BUFFER+3*SIZE_OF_INT,"i32")}function marshalPoint(Q,Z){setValue(Q,Z.row,"i32"),setValue(Q+SIZE_OF_INT,Z.column,"i32")}function unmarshalPoint(Q){return{row:getValue(Q,"i32")>>>0,column:getValue(Q+SIZE_OF_INT,"i32")>>>0}}function marshalRange(Q,Z){marshalPoint(Q,Z.startPosition),Q+=SIZE_OF_POINT,marshalPoint(Q,Z.endPosition),Q+=SIZE_OF_POINT,setValue(Q,Z.startIndex,"i32"),Q+=SIZE_OF_INT,setValue(Q,Z.endIndex,"i32"),Q+=SIZE_OF_INT}function unmarshalRange(Q){let Z={};return Z.startPosition=unmarshalPoint(Q),Q+=SIZE_OF_POINT,Z.endPosition=unmarshalPoint(Q),Q+=SIZE_OF_POINT,Z.startIndex=getValue(Q,"i32")>>>0,Q+=SIZE_OF_INT,Z.endIndex=getValue(Q,"i32")>>>0,Z}function marshalEdit(Q){let Z=TRANSFER_BUFFER;marshalPoint(Z,Q.startPosition),Z+=SIZE_OF_POINT,marshalPoint(Z,Q.oldEndPosition),Z+=SIZE_OF_POINT,marshalPoint(Z,Q.newEndPosition),Z+=SIZE_OF_POINT,setValue(Z,Q.startIndex,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q.oldEndIndex,"i32"),Z+=SIZE_OF_INT,setValue(Z,Q.newEndIndex,"i32"),Z+=SIZE_OF_INT}for(let Q of Object.getOwnPropertyNames(ParserImpl.prototype))Object.defineProperty(Parser.prototype,Q,{value:ParserImpl.prototype[Q],enumerable:!1,writable:!1});Parser.Language=Language,X.onRuntimeInitialized=()=>{ParserImpl.init(),resolveInitPromise()}})}}return Parser}();if(typeof p==="object")g.exports=p0});var d=M0(K0(),1);import{delimiter as AQ,join as r0}from"path";import{existsSync as BQ,statSync as u0}from"fs";import{homedir as l0}from"os";import{delimiter as j0,dirname as m,join as u}from"path";import{fileURLToPath as a}from"url";var s={"web-tree-sitter":"0.24.7","tree-sitter-wasms":"0.1.13"};var i0=s["tree-sitter-wasms"];function n0(Q){return`https://cdn.jsdelivr.net/npm/tree-sitter-wasms@${i0}/out/tree-sitter-${Q}.wasm`}function c(Q,Z,$,J){return{name:Q,file:`tree-sitter-${Q}.wasm`,url:n0(Q),sha256:Z,bytes:$,langs:J}}var W0={typescript:c("typescript","8515404dceed38e1ed86aa34b09fcf3379fff1b4ff9dd3967bcd6d1eb5ac3d8f",2342690,["ts"]),tsx:c("tsx","6aa3b2c70e76f5d48eafef1093e9c4de383e13f2fdde2f4e9b98a378f6a8f1b6",2411272,["tsx"]),javascript:c("javascript","63812b9e275d26851264734868d27a1656bd44a2ef6eb3e85e6b03728c595ab5",647334,["js","jsx"]),python:c("python","9056d0fb0c337810d019fae350e8167786119da98f0f282aceae7ab89ee8253b",476105,["py"]),c_sharp:c("c_sharp","6266a7e32d68a3459104d994dc848df15d5672b0ea8e86d327274b694f8e6991",3978594,["cs"])},o0=(()=>{let Q={};for(let Z of Object.values(W0))for(let $ of Z.langs)Q[$]=Z.name;return Q})();function e(Q){let Z=o0[Q];if(Z===void 0)throw Error(`no grammar for language "${Q}"`);return W0[Z]}function d0(Q=process.env){let Z=Q.MYC_GRAMMARS_DIR;if(Z!==void 0&&Z!=="")return Z;return u(l0(),".cache","myc","grammars")}function z0(Q){try{return u(m(a(import.meta.url)),"..","vendor",Q)}catch{return null}}function t0(){try{let Q=Bun.resolveSync("tree-sitter-wasms/package.json",m(a(import.meta.url)));return u(m(Q),"out")}catch{return null}}function Q0(Q=process.env){let Z=Q.MYC_TREE_SITTER_GRAMMAR_DIR;if(Z!==void 0&&Z!=="")return Z.split(j0).filter((H)=>H.length>0);let $=[d0(Q)],J=z0("tree-sitter-grammars");if(J!==null)$.push(J);let q=t0();if(q!==null)$.push(q);return $}function Z0(Q=process.env){let Z=Q.MYC_TREE_SITTER_DIR;if(Z!==void 0&&Z!=="")return Z.split(j0).filter((q)=>q.length>0);let $=[],J=z0("tree-sitter");if(J!==null)$.push(J);try{let q=Bun.resolveSync("web-tree-sitter/package.json",m(a(import.meta.url)));$.push(m(q))}catch{}return $}var l="tree-sitter.wasm";function G0(Q,Z,$){for(let J of Q){let q=u(J,Z);try{let H=u0(q);if(!H.isFile())continue;if($!==void 0&&H.size!==$)continue;return q}catch{continue}}return null}function C0(Q,Z=process.env){let $=e(Q);return G0(Q0(Z),$.file,$.bytes)}function F0(Q=process.env){return G0(Z0(Q),l)}function w0(Q){if(Q<1024)return`${Q} B`;let Z=["KB","MB","GB"],$=Q/1024,J=0;while($>=1024&&J<Z.length-1)$/=1024,J++;return`${$.toFixed(1)} ${Z[J]}`}class k0 extends Error{lang;constructor(Q){super(`tree-sitter grammar for "${Q}" is not loaded: call await loadLang("${Q}") before listDefs`);this.lang=Q;this.name="GrammarNotLoadedError"}}var n={function_declaration:"function",generator_function_declaration:"function",class_declaration:"class",abstract_class_declaration:"class",interface_declaration:"interface",enum_declaration:"enum",type_alias_declaration:"type",method_definition:"method"},s0={function_definition:"function",class_definition:"class"},a0={class_declaration:"class",record_declaration:"class",interface_declaration:"interface",enum_declaration:"enum",struct_declaration:"type",record_struct_declaration:"type",delegate_declaration:"type",method_declaration:"method",constructor_declaration:"method",destructor_declaration:"method",local_function_statement:"function"},e0=new Set(["arrow_function","function_expression","function","generator_function"]),R0={ts:{kinds:n,declarators:!0,methodByParent:[]},tsx:{kinds:n,declarators:!0,methodByParent:[]},js:{kinds:n,declarators:!0,methodByParent:[]},jsx:{kinds:n,declarators:!0,methodByParent:[]},py:{kinds:s0,declarators:!1,methodByParent:["block"]},cs:{kinds:a0,declarators:!1,methodByParent:[]}},SQ=Object.keys(R0),o=null,$0=new Map,B0=new Map;class X0 extends Error{hint;constructor(Q,Z){super(Q);this.hint=Z;this.name="MissingResourceError"}}class T0 extends X0{searched;constructor(Q){super(`tree-sitter runtime not found: ${l} is in none of the directories [${Q.join(", ")}]. It ships with myc, so its absence means a broken install: reinstall the package or set MYC_TREE_SITTER_DIR to the directory that has the file`,"bun add -g @aistastudio/myc");this.searched=Q;this.name="RuntimeMissingError"}}class D0 extends X0{lang;searched;constructor(Q,Z){let $=e(Q);super(`tree-sitter grammar for "${Q}" is not downloaded: ${$.file} (${w0($.bytes)}) is in none of the directories [${Z.join(", ")}]`,`myc code fetch ${Q}`);this.lang=Q;this.searched=Z;this.name="GrammarMissingError"}}function QQ(){let Q=F0();if(Q===null)throw new T0(Z0());return Q.slice(0,Q.length-l.length-1)}function ZQ(Q){let Z=C0(Q);if(Z===null)throw new D0(Q,Q0());return Z}async function $Q(){if(o===null){let Q=QQ();o=d.default.init({locateFile:(Z)=>r0(Q,Z)}).catch((Z)=>{throw o=null,Z})}return o}async function O0(Q){let Z=$0.get(Q);if(Z===void 0)Z=(async()=>{await $Q();let $=await d.default.Language.load(ZQ(Q)),J=new d.default;return J.setLanguage($),J})().catch(($)=>{throw $0.delete(Q),$}),$0.set(Q,Z);B0.set(Q,await Z)}function XQ(Q){let Z=B0.get(Q);if(Z===void 0)throw new k0(Q);return Z}function JQ(Q){let Z=Q.childForFieldName("name");if(Z===null)return null;let $=Z.text;return $.length>0?$:null}function qQ(Q){let Z=Q.childForFieldName("value");return Z!==null&&e0.has(Z.type)}function HQ(Q,Z){if(Z.length===0)return!1;let $=Q.parent;while($!==null&&$.type==="decorated_definition")$=$.parent;if($===null||!Z.includes($.type))return!1;let J=$.parent;return J!==null&&J.type.endsWith("class_definition")}function L0(Q,Z){let $=R0[Z],J=$.kinds[Q.type];if(J!==void 0)return HQ(Q,$.methodByParent)?"method":J;if($.declarators&&Q.type==="variable_declarator"&&qQ(Q))return"function";return null}function _0(Q){return JQ(Q)}function E0(Q,Z,$,J={}){let q=$.startPosition.row+1;return{name:Q,kind:Z,startLine:q,endLine:J.naiveEnd===!0?q:$.endPosition.row+1}}function A0(Q){return XQ(Q)}var YQ=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier"]),UQ=new Set(["formal_parameters","required_parameter","optional_parameter","rest_pattern","object_pattern","array_pattern","pair_pattern","object_assignment_pattern","import_clause","namespace_import","parameters","lambda_parameters","default_parameter","typed_parameter","typed_default_parameter","as_pattern_target","name_equals"]),VQ=new Set(["import_specifier","export_specifier","aliased_import"]),KQ=new Set(["jsx_opening_element","jsx_self_closing_element","jsx_closing_element"]),q0=new Set(["call_expression","call","invocation_expression"]),jQ=new Set(["member_expression","attribute"]);function D(Q,Z,$){let J=Q.childForFieldName(Z);return J!==null&&J.id===$.id}function WQ(Q){let Z=Q.parent,$=Z===null?null:Z.parent;return $!==null&&$.childForFieldName("source")!==null}function J0(Q){let Z=Q.parent;if(Z===null)return null;if(q0.has(Z.type)&&D(Z,"function",Q))return"call";if(Z.type==="new_expression"&&D(Z,"constructor",Q))return"new";return null}function zQ(Q){let Z=Q,$=Q.parent;while($!==null&&$.type==="qualified_name")Z=$,$=$.parent;if($===null)return!1;if($.type!=="namespace_declaration"&&$.type!=="file_scoped_namespace_declaration")return!1;return D($,"name",Z)}function GQ(Q){let Z=Q.parent;while(Z!==null){if(Z.type==="using_directive")return!0;Z=Z.parent}return!1}function CQ(Q){let Z=Q.parent;if(Z===null)return"type";if(Z.type==="member_access_expression"&&D(Z,"name",Q))return J0(Z)??"prop";if(q0.has(Z.type)&&D(Z,"function",Q))return"call";if(Z.type==="object_creation_expression"&&D(Z,"type",Q))return"new";return"type"}function FQ(Q){let Z=Q.parent;if(Z===null)return null;let $=Z.type;if(VQ.has($)){if(!D(Z,"name",Q))return null;return $==="export_specifier"&&!WQ(Z)?"read":"import"}if(KQ.has($))return D(Z,"name",Q)?"read":null;if($==="jsx_attribute")return null;if(UQ.has($))return null;if($==="variable_declarator"&&!D(Z,"value",Q))return null;if($==="member_access_expression"){if(D(Z,"name",Q))return J0(Z)??"prop";return"read"}if($==="generic_name")return CQ(Z);if($==="type_argument_list")return"type";if($==="qualified_name"||$==="alias_qualified_name"){if(zQ(Q))return null;if(GQ(Q))return"import";return"type"}if($==="using_directive")return"import";if($==="attribute"&&D(Z,"name",Q))return"type";if($==="object_creation_expression"&&D(Z,"type",Q))return"new";if($==="for_each_statement"&&D(Z,"left",Q))return null;if(D(Z,"name",Q))return null;if($==="pair"&&D(Z,"key",Q))return null;if($==="keyword_argument"&&D(Z,"name",Q))return null;if($==="catch_clause"&&D(Z,"parameter",Q))return null;if(q0.has($)&&D(Z,"function",Q))return"call";if($==="new_expression"&&D(Z,"constructor",Q))return"new";if(jQ.has($)){if(D(Z,"property",Q)||D(Z,"attribute",Q))return J0(Z)??"prop";return"read"}if($==="dotted_name")return"import";if(Q.type==="type_identifier")return"type";if(D(Z,"type",Q))return"type";if($==="base_list")return"type";if($==="extends_clause"||$==="implements_clause")return"type";if(Q.type==="property_identifier")return"prop";return"read"}function P0(Q,Z,$={}){let q=A0(Z).parse(Q);try{let H=[],Y=[],U=new Set,j=[],W=$.naiveOwner===!0,k=(F)=>{let z=!1,G=L0(F,Z);if(G!==null){let K=_0(F);if(K!==null)H.push(E0(K,G,F,$)),j.push({name:K,start:F.startPosition.row+1}),z=!0}if(YQ.has(F.type)){let K=FQ(F);if(K!==null){let w=F.text;if(w.length>0){let O=W||j.length===0?null:j[j.length-1],V=F.startPosition.row+1,R=O===null?"":O.name,T=O===null?0:O.start,v=`${w}\x00${V}\x00${K}\x00${T}`;if(!U.has(v))U.add(v),Y.push({name:w,line:V,kind:K,from:R,fromStart:T})}}}for(let K=0;K<F.namedChildCount;K++){let w=F.namedChild(K);if(w!==null)k(w)}if(z)j.pop()};return k(q.rootNode),{defs:H,refs:Y}}finally{q.delete()}}var S0=process.env.MYC_TREE_SITTER_DIR,v0=process.env.MYC_TREE_SITTER_GRAMMAR_DIR;if(S0===void 0||S0===""||v0===void 0||v0==="")throw Error("parse worker started without tree-sitter directories: MYC_TREE_SITTER_DIR and MYC_TREE_SITTER_GRAMMAR_DIR are set by the main thread (ParsePool). There is nothing "+"to look them up with here \u2014 node_modules does not exist across the thread boundary");var H0=globalThis;H0.onmessage=(Q)=>{let{id:Z,source:$,lang:J}=Q.data;(async()=>{try{await O0(J);let{defs:q,refs:H}=P0($,J);H0.postMessage({id:Z,defs:q,refs:H})}catch(q){H0.postMessage({id:Z,error:q instanceof Error?q.message:String(q)})}})()};
|