@willbooster/web-tree-sitter 18.0.2 → 19.0.0

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.
@@ -1,6 +1,5 @@
1
- var pe=Object.defineProperty;var a=(e,t)=>pe(e,"name",{value:t,configurable:!0});var Oe=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(_){throw r=[_],_}};var Le=(e,t)=>{for(var r in t)pe(e,r,{get:t[r],enumerable:!0})};var Te={};Le(Te,{createRequire:()=>Ve,default:()=>We,readFile:()=>qe});var Ie,Ve,qe,We,Se=Oe(()=>{Ie=a(()=>{throw new Error("module is not available here")},"unavailable"),Ve=Ie,qe=Ie,We={}});var ae=class{static{a(this,"Edit")}startPosition;oldEndPosition;newEndPosition;startIndex;oldEndIndex;newEndIndex;constructor({startIndex:t,oldEndIndex:r,newEndIndex:_,startPosition:s,oldEndPosition:o,newEndPosition:l}){this.startIndex=t>>>0,this.oldEndIndex=r>>>0,this.newEndIndex=_>>>0,this.startPosition=s,this.oldEndPosition=o,this.newEndPosition=l}editPoint(t,r){let _=r,s={...t};if(r>=this.oldEndIndex){_=this.newEndIndex+(r-this.oldEndIndex);let o=t.row;s.row=this.newEndPosition.row+(t.row-this.oldEndPosition.row),s.column=o===this.oldEndPosition.row?this.newEndPosition.column+(t.column-this.oldEndPosition.column):t.column}else r>this.startIndex&&(_=this.newEndIndex,s.row=this.newEndPosition.row,s.column=this.newEndPosition.column);return{point:s,index:_}}editRange(t){let r={startIndex:t.startIndex,startPosition:{...t.startPosition},endIndex:t.endIndex,endPosition:{...t.endPosition}};return t.endIndex>=this.oldEndIndex?t.endIndex!==Number.MAX_SAFE_INTEGER&&(r.endIndex=this.newEndIndex+(t.endIndex-this.oldEndIndex),r.endPosition={row:this.newEndPosition.row+(t.endPosition.row-this.oldEndPosition.row),column:t.endPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(t.endPosition.column-this.oldEndPosition.column):t.endPosition.column},r.endIndex<this.newEndIndex&&(r.endIndex=Number.MAX_SAFE_INTEGER,r.endPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):t.endIndex>this.startIndex&&(r.endIndex=this.startIndex,r.endPosition={...this.startPosition}),t.startIndex>=this.oldEndIndex?(r.startIndex=this.newEndIndex+(t.startIndex-this.oldEndIndex),r.startPosition={row:this.newEndPosition.row+(t.startPosition.row-this.oldEndPosition.row),column:t.startPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(t.startPosition.column-this.oldEndPosition.column):t.startPosition.column},r.startIndex<this.newEndIndex&&(r.startIndex=Number.MAX_SAFE_INTEGER,r.startPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):t.startIndex>this.startIndex&&(r.startIndex=this.startIndex,r.startPosition={...this.startPosition}),r}};var oe=2,c=4,ne=4*c,I=5*c,O=2*c,j=2*c+2*O,S={row:0,column:0},x=Symbol("INTERNAL");function W(e){if(e!==x)throw new Error("Illegal constructor")}a(W,"assertInternal");function K(e){return!!e&&typeof e.row=="number"&&typeof e.column=="number"}a(K,"isPoint");function we(e){n=e}a(we,"setModule");var n;function D(e){try{return new FinalizationRegistry(e)}catch(t){console.error("Unsupported FinalizationRegistry:",t);return}}a(D,"newFinalizer");var ye=D(e=>{n._ts_lookahead_iterator_delete(e)}),X=class{static{a(this,"LookaheadIterator")}0=0;language;positioned=!1;constructor(t,r,_){W(t),this[0]=r,this.language=_,ye?.register(this,r,this)}get currentTypeId(){return this.positioned?n._ts_lookahead_iterator_current_symbol(this[0]):null}get currentType(){let t=this.currentTypeId;return t===null?null:this.language.types[t]??n.UTF8ToString(n._ts_language_symbol_name(this.language[0],t))}delete(){ye?.unregister(this),n._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(t,r){return n._ts_lookahead_iterator_reset(this[0],t[0],r)?(this.language=t,this.positioned=!1,!0):!1}resetState(t){return n._ts_lookahead_iterator_reset_state(this[0],t)?(this.positioned=!1,!0):!1}[Symbol.iterator](){return{next:a(()=>{this.positioned=!!n._ts_lookahead_iterator_next(this[0]);let t=this.currentType;return t===null?{done:!0,value:""}:{done:!1,value:t}},"next")}}};function _e(e,t,r,_){let s=r-t,o=e.textCallback(t,_);if(o){for(t+=o.length;t<r;){let l=e.textCallback(t,_);if(l&&l.length>0)t+=l.length,o+=l;else break}t>r&&(o=o.slice(0,s))}return o??""}a(_e,"getText");var be=D(e=>{n._ts_tree_delete(e)}),Y=class e{static{a(this,"Tree")}0=0;textCallback;language;constructor(t,r,_,s){W(t),this[0]=r,this.language=_,this.textCallback=s,be?.register(this,r,this)}copy(){let t=n._ts_tree_copy(this[0]);return new e(x,t,this.language,this.textCallback)}delete(){be?.unregister(this),n._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return n._ts_tree_root_node_wasm(this[0]),E(this)}rootNodeWithOffset(t,r){let _=d+I;return n.setValue(_,t,"i32"),F(_+c,r),n._ts_tree_root_node_with_offset_wasm(this[0]),E(this)}edit(t){Pe(t),n._ts_tree_edit_wasm(this[0])}walk(){return this.rootNode.walk()}getChangedRanges(t){if(!(t instanceof e))throw new TypeError("Argument must be a Tree");n._ts_tree_get_changed_ranges_wasm(this[0],t[0]);let r=n.getValue(d,"i32"),_=n.getValue(d+c,"i32"),s=new Array(r);if(r>0){let o=_;for(let l=0;l<r;l++)s[l]=J(o),o+=j;n._ts_free_wasm(_)}return s}getIncludedRanges(){n._ts_tree_included_ranges_wasm(this[0]);let t=n.getValue(d,"i32"),r=n.getValue(d+c,"i32"),_=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)_[o]=J(s),s+=j;n._ts_free_wasm(r)}return _}};var ve=D(e=>{P({handles:e}),n._ts_tree_cursor_delete_wasm(0)}),ee=class e{static{a(this,"TreeCursor")}handles=[0,0,0,0];tree;constructor(t,r){W(t),this.tree=r,L(this),ve?.register(this,this.handles,this)}copy(){return P(this),n._ts_tree_cursor_copy_wasm(this.tree[0]),new e(x,this.tree)}delete(){ve?.unregister(this),P(this),n._ts_tree_cursor_delete_wasm(this.tree[0]),this.handles.fill(0)}get currentNode(){return P(this),n._ts_tree_cursor_current_node_wasm(this.tree[0]),E(this.tree)}get currentFieldId(){return P(this),n._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return P(this),n._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return P(this),n._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return P(this),n._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return P(this),n._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return P(this),n._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return P(this),n._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return P(this),n._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){P(this);let t=n._ts_tree_cursor_start_index_wasm(this.tree[0]),r=n._ts_tree_cursor_end_index_wasm(this.tree[0]);n._ts_tree_cursor_start_position_wasm(this.tree[0]);let _=Q(d);return _e(this.tree,t,r,_)}get startPosition(){return P(this),n._ts_tree_cursor_start_position_wasm(this.tree[0]),Q(d)}get endPosition(){return P(this),n._ts_tree_cursor_end_position_wasm(this.tree[0]),Q(d)}get startIndex(){return P(this),n._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return P(this),n._ts_tree_cursor_end_index_wasm(this.tree[0])}gotoFirstChild(){P(this);let t=n._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return L(this),t===1}gotoLastChild(){P(this);let t=n._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return L(this),t===1}gotoParent(){P(this);let t=n._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return L(this),t===1}gotoNextSibling(){P(this);let t=n._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return L(this),t===1}gotoPreviousSibling(){P(this);let t=n._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return L(this),t===1}gotoDescendant(t){P(this),n._ts_tree_cursor_goto_descendant_wasm(this.tree[0],t),L(this)}gotoFirstChildForIndex(t){P(this),n.setValue(d+ne,t,"i32");let r=n._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return L(this),r===1}gotoFirstChildForPosition(t){P(this),F(d+ne,t);let r=n._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return L(this),r===1}reset(t){h(t),P(this,d+I),n._ts_tree_cursor_reset_wasm(t.tree[0]),L(this),this.tree=t.tree}resetTo(t){P(this,d),P(t,d+ne),n._ts_tree_cursor_reset_to_wasm(this.tree[0],t.tree[0]),L(this),this.tree=t.tree}};var te=class{static{a(this,"Node")}0=0;_children;_namedChildren;constructor(t,{id:r,tree:_,startIndex:s,startPosition:o,other:l}){W(t),this[0]=l,this.id=r,this.tree=_,this.startIndex=s,this.startPosition=o}id;startIndex;startPosition;tree;get typeId(){return h(this),n._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return h(this),n._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 isNamed(){return h(this),n._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return h(this),n._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return h(this),n._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return h(this),n._ts_node_is_missing_wasm(this.tree[0])===1}get hasChanges(){return h(this),n._ts_node_has_changes_wasm(this.tree[0])===1}get hasError(){return h(this),n._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return h(this),n._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return h(this),n._ts_node_end_point_wasm(this.tree[0]),Q(d)}get text(){return _e(this.tree,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return h(this),n._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return h(this),n._ts_node_next_parse_state_wasm(this.tree[0])}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return h(this),n._ts_node_child_wasm(this.tree[0],t),E(this.tree)}namedChild(t){return h(this),n._ts_node_named_child_wasm(this.tree[0],t),E(this.tree)}childForFieldId(t){return h(this),n._ts_node_child_by_field_id_wasm(this.tree[0],t),E(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1?this.childForFieldId(r):null}fieldNameForChild(t){h(this);let r=n._ts_node_field_name_for_child_wasm(this.tree[0],t);return r?n.AsciiToString(r):null}fieldNameForNamedChild(t){h(this);let r=n._ts_node_field_name_for_named_child_wasm(this.tree[0],t);return r?n.AsciiToString(r):null}childrenForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1&&r!==0?this.childrenForFieldId(r):[]}childrenForFieldId(t){h(this),n._ts_node_children_by_field_id_wasm(this.tree[0],t);let r=n.getValue(d,"i32"),_=n.getValue(d+c,"i32"),s=new Array(r);if(r>0){let o=_;for(let l=0;l<r;l++)s[l]=E(this.tree,o),o+=I;n._ts_free_wasm(_)}return s}firstChildForIndex(t){h(this);let r=d+I;return n.setValue(r,t,"i32"),n._ts_node_first_child_for_byte_wasm(this.tree[0]),E(this.tree)}firstNamedChildForIndex(t){h(this);let r=d+I;return n.setValue(r,t,"i32"),n._ts_node_first_named_child_for_byte_wasm(this.tree[0]),E(this.tree)}get childCount(){return h(this),n._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return h(this),n._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){h(this),n._ts_node_children_wasm(this.tree[0]);let t=n.getValue(d,"i32"),r=n.getValue(d+c,"i32");if(this._children=new Array(t),t>0){let _=r;for(let s=0;s<t;s++)this._children[s]=E(this.tree,_),_+=I;n._free(r)}}return this._children}get namedChildren(){if(!this._namedChildren){h(this),n._ts_node_named_children_wasm(this.tree[0]);let t=n.getValue(d,"i32"),r=n.getValue(d+c,"i32");if(this._namedChildren=new Array(t),t>0){let _=r;for(let s=0;s<t;s++)this._namedChildren[s]=E(this.tree,_),_+=I;n._free(r)}}return this._namedChildren}descendantsOfType(t,r=S,_=S){Array.isArray(t)||(t=[t]);let s=[],o=this.tree.language.types;for(let f=0,g=o.length;f<g;f++)t.includes(o[f])&&s.push(f);t.includes("ERROR")&&s.push(65535);let l=n._malloc(c*s.length);for(let f=0,g=s.length;f<g;f++)n.setValue(l+f*c,s[f],"i32");h(this),n._ts_node_descendants_of_type_wasm(this.tree[0],l,s.length,r.row,r.column,_.row,_.column);let u=n.getValue(d,"i32"),m=n.getValue(d+c,"i32"),w=new Array(u);if(u>0){let f=m;for(let g=0;g<u;g++)w[g]=E(this.tree,f),f+=I}return n._ts_free_wasm(m),n._free(l),w}get nextSibling(){return h(this),n._ts_node_next_sibling_wasm(this.tree[0]),E(this.tree)}get previousSibling(){return h(this),n._ts_node_prev_sibling_wasm(this.tree[0]),E(this.tree)}get nextNamedSibling(){return h(this),n._ts_node_next_named_sibling_wasm(this.tree[0]),E(this.tree)}get previousNamedSibling(){return h(this),n._ts_node_prev_named_sibling_wasm(this.tree[0]),E(this.tree)}get descendantCount(){return h(this),n._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return h(this),n._ts_node_parent_wasm(this.tree[0]),E(this.tree)}childWithDescendant(t){return t.tree!==this.tree?null:(h(this),h(t,1),n._ts_node_child_with_descendant_wasm(this.tree[0]),E(this.tree))}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");h(this);let _=d+I;return n.setValue(_,t,"i32"),n.setValue(_+c,r,"i32"),n._ts_node_descendant_for_index_wasm(this.tree[0]),E(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");h(this);let _=d+I;return n.setValue(_,t,"i32"),n.setValue(_+c,r,"i32"),n._ts_node_named_descendant_for_index_wasm(this.tree[0]),E(this.tree)}descendantForPosition(t,r=t){if(!K(t)||!K(r))throw new Error("Arguments must be {row, column} objects");h(this);let _=d+I;return F(_,t),F(_+O,r),n._ts_node_descendant_for_position_wasm(this.tree[0]),E(this.tree)}namedDescendantForPosition(t,r=t){if(!K(t)||!K(r))throw new Error("Arguments must be {row, column} objects");h(this);let _=d+I;return F(_,t),F(_+O,r),n._ts_node_named_descendant_for_position_wasm(this.tree[0]),E(this.tree)}walk(){return h(this),n._ts_tree_cursor_new_wasm(this.tree[0]),new ee(x,this.tree)}edit(t){let{point:r,index:_}=t.editPoint(this.startPosition,this.startIndex);this.startPosition=r,this.startIndex=_}toString(){h(this);let t=n._ts_node_to_string_wasm(this.tree[0]),r=n.AsciiToString(t);return n._ts_free_wasm(t),r}};function ie(e,t,r,_,s){for(let o=0,l=s.length;o<l;o++){let u=n.getValue(r,"i32");r+=c;let m=E(t,r);r+=I,s[o]={patternIndex:_,name:e.captureNames[u],node:m}}return r}a(ie,"unmarshalCaptures");function h(e,t=0){let r=d+t*I;n.setValue(r,e.id,"i32"),r+=c,n.setValue(r,e.startIndex,"i32"),r+=c,n.setValue(r,e.startPosition.row,"i32"),r+=c,n.setValue(r,e.startPosition.column,"i32"),r+=c,n.setValue(r,e[0],"i32")}a(h,"marshalNode");function E(e,t=d){let r=n.getValue(t,"i32");if(t+=c,r===0)return null;let _=n.getValue(t,"i32");t+=c;let s=n.getValue(t,"i32");t+=c;let o=n.getValue(t,"i32");t+=c;let l=n.getValue(t,"i32");return new te(x,{id:r,tree:e,startIndex:_,startPosition:{row:s,column:o},other:l})}a(E,"unmarshalNode");function P({handles:e},t=d){n.setValue(t+0*c,e[0],"i32"),n.setValue(t+1*c,e[1],"i32"),n.setValue(t+2*c,e[2],"i32"),n.setValue(t+3*c,e[3],"i32")}a(P,"marshalTreeCursor");function L({handles:e}){e[0]=n.getValue(d+0*c,"i32"),e[1]=n.getValue(d+1*c,"i32"),e[2]=n.getValue(d+2*c,"i32"),e[3]=n.getValue(d+3*c,"i32")}a(L,"unmarshalTreeCursor");function F(e,t){n.setValue(e,t.row,"i32"),n.setValue(e+c,t.column,"i32")}a(F,"marshalPoint");function Q(e){return{row:n.getValue(e,"i32")>>>0,column:n.getValue(e+c,"i32")>>>0}}a(Q,"unmarshalPoint");function Me(e,t){F(e,t.startPosition),e+=O,F(e,t.endPosition),e+=O,n.setValue(e,t.startIndex,"i32"),e+=c,n.setValue(e,t.endIndex,"i32")}a(Me,"marshalRange");function J(e){let t={};return t.startPosition=Q(e),e+=O,t.endPosition=Q(e),e+=O,t.startIndex=n.getValue(e,"i32")>>>0,e+=c,t.endIndex=n.getValue(e,"i32")>>>0,t}a(J,"unmarshalRange");function Pe(e,t=d){F(t,e.startPosition),t+=O,F(t,e.oldEndPosition),t+=O,F(t,e.newEndPosition),t+=O,n.setValue(t,e.startIndex,"i32"),t+=c,n.setValue(t,e.oldEndIndex,"i32"),t+=c,n.setValue(t,e.newEndIndex,"i32")}a(Pe,"marshalEdit");function Ee(e){let t=n.getValue(e,"i32"),r=n.getValue(e+=c,"i32"),_=n.getValue(e+c,"i32");return{major_version:t,minor_version:r,patch_version:_}}a(Ee,"unmarshalLanguageMetadata");var Ue=/^tree_sitter_\w+$/,Z=class{static{a(this,"Language")}0=0;types;fields;constructor(t,r){W(t),this[0]=r,this.types=new Array(n._ts_language_symbol_count(this[0]));for(let _=0,s=this.types.length;_<s;_++)n._ts_language_symbol_type(this[0],_)<2&&(this.types[_]=n.UTF8ToString(n._ts_language_symbol_name(this[0],_)));this.fields=new Array(n._ts_language_field_count(this[0])+1);for(let _=0,s=this.fields.length;_<s;_++){let o=n._ts_language_field_name_for_id(this[0],_);o!==0?this.fields[_]=n.UTF8ToString(o):this.fields[_]=null}}get name(){let t=n._ts_language_name(this[0]);return t===0?null:n.UTF8ToString(t)}get abiVersion(){return n._ts_language_abi_version(this[0])}get metadata(){return n._ts_language_metadata_wasm(this[0]),n.getValue(d,"i32")===0?null:Ee(d+c)}get fieldCount(){return this.fields.length-1}get stateCount(){return n._ts_language_state_count(this[0])}fieldIdForName(t){let r=this.fields.indexOf(t);return r!==-1?r:null}fieldNameForId(t){return this.fields[t]??null}idForNodeType(t,r){let _=n.lengthBytesUTF8(t),s=n._malloc(_+1);n.stringToUTF8(t,s,_+1);let o=n._ts_language_symbol_for_name(this[0],s,_,r?1:0);return n._free(s),o||null}get nodeTypeCount(){return n._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=n._ts_language_symbol_name(this[0],t);return r?n.UTF8ToString(r):null}nodeTypeIsNamed(t){return!!n._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return!!n._ts_language_type_is_visible_wasm(this[0],t)}get supertypes(){n._ts_language_supertypes_wasm(this[0]);let t=n.getValue(d,"i32"),r=n.getValue(d+c,"i32"),_=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)_[o]=n.getValue(s,"i16"),s+=oe}return _}subtypes(t){n._ts_language_subtypes_wasm(this[0],t);let r=n.getValue(d,"i32"),_=n.getValue(d+c,"i32"),s=new Array(r);if(r>0){let o=_;for(let l=0;l<r;l++)s[l]=n.getValue(o,"i16"),o+=oe}return s}nextState(t,r){return n._ts_language_next_state(this[0],t,r)}lookaheadIterator(t){let r=n._ts_lookahead_iterator_new(this[0],t);return r?new X(x,r,this):null}static async load(t){let r;if(t instanceof Uint8Array||t instanceof WebAssembly.Module)r=t;else{let s=await fetch(t);if(!s.ok){let l=await s.text();throw new Error(`Language.load failed with status ${s.status}.
1
+ var ee=Object.defineProperty;var a=(e,t)=>ee(e,"name",{value:t,configurable:!0});var Te=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(n){throw r=[n],n}};var Pe=(e,t)=>{for(var r in t)ee(e,r,{get:t[r],enumerable:!0})};var de={};Pe(de,{createRequire:()=>Re,default:()=>Fe,readFile:()=>ke});var le,Re,ke,Fe,ue=Te(()=>{le=a(()=>{throw new Error("module is not available here")},"unavailable"),Re=le,ke=le,Fe={}});var $=class{static{a(this,"Edit")}startPosition;oldEndPosition;newEndPosition;startIndex;oldEndIndex;newEndIndex;constructor({startIndex:t,oldEndIndex:r,newEndIndex:n,startPosition:s,oldEndPosition:o,newEndPosition:l}){this.startIndex=t>>>0,this.oldEndIndex=r>>>0,this.newEndIndex=n>>>0,this.startPosition=s,this.oldEndPosition=o,this.newEndPosition=l}editPoint(t,r){let n=r,s={...t};if(r>=this.oldEndIndex){n=this.newEndIndex+(r-this.oldEndIndex);let o=t.row;s.row=this.newEndPosition.row+(t.row-this.oldEndPosition.row),s.column=o===this.oldEndPosition.row?this.newEndPosition.column+(t.column-this.oldEndPosition.column):t.column}else r>this.startIndex&&(n=this.newEndIndex,s.row=this.newEndPosition.row,s.column=this.newEndPosition.column);return{point:s,index:n}}editRange(t){let r={startIndex:t.startIndex,startPosition:{...t.startPosition},endIndex:t.endIndex,endPosition:{...t.endPosition}};return t.endIndex>=this.oldEndIndex?t.endIndex!==Number.MAX_SAFE_INTEGER&&(r.endIndex=this.newEndIndex+(t.endIndex-this.oldEndIndex),r.endPosition={row:this.newEndPosition.row+(t.endPosition.row-this.oldEndPosition.row),column:t.endPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(t.endPosition.column-this.oldEndPosition.column):t.endPosition.column},r.endIndex<this.newEndIndex&&(r.endIndex=Number.MAX_SAFE_INTEGER,r.endPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):t.endIndex>this.startIndex&&(r.endIndex=this.startIndex,r.endPosition={...this.startPosition}),t.startIndex>=this.oldEndIndex?(r.startIndex=this.newEndIndex+(t.startIndex-this.oldEndIndex),r.startPosition={row:this.newEndPosition.row+(t.startPosition.row-this.oldEndPosition.row),column:t.startPosition.row===this.oldEndPosition.row?this.newEndPosition.column+(t.startPosition.column-this.oldEndPosition.column):t.startPosition.column},r.startIndex<this.newEndIndex&&(r.startIndex=Number.MAX_SAFE_INTEGER,r.startPosition={row:Number.MAX_SAFE_INTEGER,column:Number.MAX_SAFE_INTEGER})):t.startIndex>this.startIndex&&(r.startIndex=this.startIndex,r.startPosition={...this.startPosition}),r}};var X=2,u=4,D=4*u,b=5*u,M=2*u,F=2*u+2*M,K={row:0,column:0},p=Symbol("INTERNAL");function T(e){if(e!==p)throw new Error("Illegal constructor")}a(T,"assertInternal");function L(e){return!!e&&typeof e.row=="number"&&typeof e.column=="number"}a(L,"isPoint");function te(e){_=e}a(te,"setModule");var _;function S(e){try{return new FinalizationRegistry(e)}catch(t){console.error("Unsupported FinalizationRegistry:",t);return}}a(S,"newFinalizer");var re=S(e=>{_._ts_lookahead_iterator_delete(e)}),x=class{static{a(this,"LookaheadIterator")}0=0;language;positioned=!1;constructor(t,r,n){T(t),this[0]=r,this.language=n,re?.register(this,r,this)}get currentTypeId(){return this.positioned?_._ts_lookahead_iterator_current_symbol(this[0]):null}get currentType(){let t=this.currentTypeId;return t===null?null:this.language.types[t]??_.UTF8ToString(_._ts_language_symbol_name(this.language[0],t))}delete(){re?.unregister(this),_._ts_lookahead_iterator_delete(this[0]),this[0]=0}reset(t,r){return _._ts_lookahead_iterator_reset(this[0],t[0],r)?(this.language=t,this.positioned=!1,!0):!1}resetState(t){return _._ts_lookahead_iterator_reset_state(this[0],t)?(this.positioned=!1,!0):!1}[Symbol.iterator](){return{next:a(()=>{this.positioned=!!_._ts_lookahead_iterator_next(this[0]);let t=this.currentType;return t===null?{done:!0,value:""}:{done:!1,value:t}},"next")}}};function B(e,t,r,n){let s=r-t,o=e.textCallback(t,n);if(o){for(t+=o.length;t<r;){let l=e.textCallback(t,n);if(l&&l.length>0)t+=l.length,o+=l;else break}t>r&&(o=o.slice(0,s))}return o??""}a(B,"getText");var _e=S(e=>{_._ts_tree_delete(e)}),C=class e{static{a(this,"Tree")}0=0;textCallback;language;constructor(t,r,n,s){T(t),this[0]=r,this.language=n,this.textCallback=s,_e?.register(this,r,this)}copy(){let t=_._ts_tree_copy(this[0]);return new e(p,t,this.language,this.textCallback)}delete(){_e?.unregister(this),_._ts_tree_delete(this[0]),this[0]=0}get rootNode(){return _._ts_tree_root_node_wasm(this[0]),h(this)}rootNodeWithOffset(t,r){let n=d+b;return _.setValue(n,t,"i32"),y(n+u,r),_._ts_tree_root_node_with_offset_wasm(this[0]),h(this)}edit(t){ne(t),_._ts_tree_edit_wasm(this[0])}walk(){return this.rootNode.walk()}getChangedRanges(t){if(!(t instanceof e))throw new TypeError("Argument must be a Tree");_._ts_tree_get_changed_ranges_wasm(this[0],t[0]);let r=_.getValue(d,"i32"),n=_.getValue(d+u,"i32"),s=new Array(r);if(r>0){let o=n;for(let l=0;l<r;l++)s[l]=U(o),o+=F;_._ts_free_wasm(n)}return s}getIncludedRanges(){_._ts_tree_included_ranges_wasm(this[0]);let t=_.getValue(d,"i32"),r=_.getValue(d+u,"i32"),n=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)n[o]=U(s),s+=F;_._ts_free_wasm(r)}return n}};var se=S(e=>{g({handles:e}),_._ts_tree_cursor_delete_wasm(0)}),H=class e{static{a(this,"TreeCursor")}handles=[0,0,0,0];tree;constructor(t,r){T(t),this.tree=r,A(this),se?.register(this,this.handles,this)}copy(){return g(this),_._ts_tree_cursor_copy_wasm(this.tree[0]),new e(p,this.tree)}delete(){se?.unregister(this),g(this),_._ts_tree_cursor_delete_wasm(this.tree[0]),this.handles.fill(0)}get currentNode(){return g(this),_._ts_tree_cursor_current_node_wasm(this.tree[0]),h(this.tree)}get currentFieldId(){return g(this),_._ts_tree_cursor_current_field_id_wasm(this.tree[0])}get currentFieldName(){return this.tree.language.fields[this.currentFieldId]}get currentDepth(){return g(this),_._ts_tree_cursor_current_depth_wasm(this.tree[0])}get currentDescendantIndex(){return g(this),_._ts_tree_cursor_current_descendant_index_wasm(this.tree[0])}get nodeType(){return this.tree.language.types[this.nodeTypeId]||"ERROR"}get nodeTypeId(){return g(this),_._ts_tree_cursor_current_node_type_id_wasm(this.tree[0])}get nodeStateId(){return g(this),_._ts_tree_cursor_current_node_state_id_wasm(this.tree[0])}get nodeId(){return g(this),_._ts_tree_cursor_current_node_id_wasm(this.tree[0])}get nodeIsNamed(){return g(this),_._ts_tree_cursor_current_node_is_named_wasm(this.tree[0])===1}get nodeIsMissing(){return g(this),_._ts_tree_cursor_current_node_is_missing_wasm(this.tree[0])===1}get nodeText(){g(this);let t=_._ts_tree_cursor_start_index_wasm(this.tree[0]),r=_._ts_tree_cursor_end_index_wasm(this.tree[0]);_._ts_tree_cursor_start_position_wasm(this.tree[0]);let n=R(d);return B(this.tree,t,r,n)}get startPosition(){return g(this),_._ts_tree_cursor_start_position_wasm(this.tree[0]),R(d)}get endPosition(){return g(this),_._ts_tree_cursor_end_position_wasm(this.tree[0]),R(d)}get startIndex(){return g(this),_._ts_tree_cursor_start_index_wasm(this.tree[0])}get endIndex(){return g(this),_._ts_tree_cursor_end_index_wasm(this.tree[0])}gotoFirstChild(){g(this);let t=_._ts_tree_cursor_goto_first_child_wasm(this.tree[0]);return A(this),t===1}gotoLastChild(){g(this);let t=_._ts_tree_cursor_goto_last_child_wasm(this.tree[0]);return A(this),t===1}gotoParent(){g(this);let t=_._ts_tree_cursor_goto_parent_wasm(this.tree[0]);return A(this),t===1}gotoNextSibling(){g(this);let t=_._ts_tree_cursor_goto_next_sibling_wasm(this.tree[0]);return A(this),t===1}gotoPreviousSibling(){g(this);let t=_._ts_tree_cursor_goto_previous_sibling_wasm(this.tree[0]);return A(this),t===1}gotoDescendant(t){g(this),_._ts_tree_cursor_goto_descendant_wasm(this.tree[0],t),A(this)}gotoFirstChildForIndex(t){g(this),_.setValue(d+D,t,"i32");let r=_._ts_tree_cursor_goto_first_child_for_index_wasm(this.tree[0]);return A(this),r===1}gotoFirstChildForPosition(t){g(this),y(d+D,t);let r=_._ts_tree_cursor_goto_first_child_for_position_wasm(this.tree[0]);return A(this),r===1}reset(t){m(t),g(this,d+b),_._ts_tree_cursor_reset_wasm(t.tree[0]),A(this),this.tree=t.tree}resetTo(t){g(this,d),g(t,d+D),_._ts_tree_cursor_reset_to_wasm(this.tree[0],t.tree[0]),A(this),this.tree=t.tree}};var W=class{static{a(this,"Node")}0=0;_children;_namedChildren;constructor(t,{id:r,tree:n,startIndex:s,startPosition:o,other:l}){T(t),this[0]=l,this.id=r,this.tree=n,this.startIndex=s,this.startPosition=o}id;startIndex;startPosition;tree;get typeId(){return m(this),_._ts_node_symbol_wasm(this.tree[0])}get grammarId(){return m(this),_._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 isNamed(){return m(this),_._ts_node_is_named_wasm(this.tree[0])===1}get isExtra(){return m(this),_._ts_node_is_extra_wasm(this.tree[0])===1}get isError(){return m(this),_._ts_node_is_error_wasm(this.tree[0])===1}get isMissing(){return m(this),_._ts_node_is_missing_wasm(this.tree[0])===1}get hasChanges(){return m(this),_._ts_node_has_changes_wasm(this.tree[0])===1}get hasError(){return m(this),_._ts_node_has_error_wasm(this.tree[0])===1}get endIndex(){return m(this),_._ts_node_end_index_wasm(this.tree[0])}get endPosition(){return m(this),_._ts_node_end_point_wasm(this.tree[0]),R(d)}get text(){return B(this.tree,this.startIndex,this.endIndex,this.startPosition)}get parseState(){return m(this),_._ts_node_parse_state_wasm(this.tree[0])}get nextParseState(){return m(this),_._ts_node_next_parse_state_wasm(this.tree[0])}equals(t){return this.tree===t.tree&&this.id===t.id}child(t){return m(this),_._ts_node_child_wasm(this.tree[0],t),h(this.tree)}namedChild(t){return m(this),_._ts_node_named_child_wasm(this.tree[0],t),h(this.tree)}childForFieldId(t){return m(this),_._ts_node_child_by_field_id_wasm(this.tree[0],t),h(this.tree)}childForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1?this.childForFieldId(r):null}fieldNameForChild(t){m(this);let r=_._ts_node_field_name_for_child_wasm(this.tree[0],t);return r?_.AsciiToString(r):null}fieldNameForNamedChild(t){m(this);let r=_._ts_node_field_name_for_named_child_wasm(this.tree[0],t);return r?_.AsciiToString(r):null}childrenForFieldName(t){let r=this.tree.language.fields.indexOf(t);return r!==-1&&r!==0?this.childrenForFieldId(r):[]}childrenForFieldId(t){m(this),_._ts_node_children_by_field_id_wasm(this.tree[0],t);let r=_.getValue(d,"i32"),n=_.getValue(d+u,"i32"),s=new Array(r);if(r>0){let o=n;for(let l=0;l<r;l++)s[l]=h(this.tree,o),o+=b;_._ts_free_wasm(n)}return s}firstChildForIndex(t){m(this);let r=d+b;return _.setValue(r,t,"i32"),_._ts_node_first_child_for_byte_wasm(this.tree[0]),h(this.tree)}firstNamedChildForIndex(t){m(this);let r=d+b;return _.setValue(r,t,"i32"),_._ts_node_first_named_child_for_byte_wasm(this.tree[0]),h(this.tree)}get childCount(){return m(this),_._ts_node_child_count_wasm(this.tree[0])}get namedChildCount(){return m(this),_._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){m(this),_._ts_node_children_wasm(this.tree[0]);let t=_.getValue(d,"i32"),r=_.getValue(d+u,"i32");if(this._children=new Array(t),t>0){let n=r;for(let s=0;s<t;s++)this._children[s]=h(this.tree,n),n+=b;_._free(r)}}return this._children}get namedChildren(){if(!this._namedChildren){m(this),_._ts_node_named_children_wasm(this.tree[0]);let t=_.getValue(d,"i32"),r=_.getValue(d+u,"i32");if(this._namedChildren=new Array(t),t>0){let n=r;for(let s=0;s<t;s++)this._namedChildren[s]=h(this.tree,n),n+=b;_._free(r)}}return this._namedChildren}descendantsOfType(t,r=K,n=K){Array.isArray(t)||(t=[t]);let s=[],o=this.tree.language.types;for(let w=0,v=o.length;w<v;w++)t.includes(o[w])&&s.push(w);t.includes("ERROR")&&s.push(65535);let l=_._malloc(u*s.length);for(let w=0,v=s.length;w<v;w++)_.setValue(l+w*u,s[w],"i32");m(this),_._ts_node_descendants_of_type_wasm(this.tree[0],l,s.length,r.row,r.column,n.row,n.column);let c=_.getValue(d,"i32"),f=_.getValue(d+u,"i32"),E=new Array(c);if(c>0){let w=f;for(let v=0;v<c;v++)E[v]=h(this.tree,w),w+=b}return _._ts_free_wasm(f),_._free(l),E}get nextSibling(){return m(this),_._ts_node_next_sibling_wasm(this.tree[0]),h(this.tree)}get previousSibling(){return m(this),_._ts_node_prev_sibling_wasm(this.tree[0]),h(this.tree)}get nextNamedSibling(){return m(this),_._ts_node_next_named_sibling_wasm(this.tree[0]),h(this.tree)}get previousNamedSibling(){return m(this),_._ts_node_prev_named_sibling_wasm(this.tree[0]),h(this.tree)}get descendantCount(){return m(this),_._ts_node_descendant_count_wasm(this.tree[0])}get parent(){return m(this),_._ts_node_parent_wasm(this.tree[0]),h(this.tree)}childWithDescendant(t){return t.tree!==this.tree?null:(m(this),m(t,1),_._ts_node_child_with_descendant_wasm(this.tree[0]),h(this.tree))}descendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");m(this);let n=d+b;return _.setValue(n,t,"i32"),_.setValue(n+u,r,"i32"),_._ts_node_descendant_for_index_wasm(this.tree[0]),h(this.tree)}namedDescendantForIndex(t,r=t){if(typeof t!="number"||typeof r!="number")throw new Error("Arguments must be numbers");m(this);let n=d+b;return _.setValue(n,t,"i32"),_.setValue(n+u,r,"i32"),_._ts_node_named_descendant_for_index_wasm(this.tree[0]),h(this.tree)}descendantForPosition(t,r=t){if(!L(t)||!L(r))throw new Error("Arguments must be {row, column} objects");m(this);let n=d+b;return y(n,t),y(n+M,r),_._ts_node_descendant_for_position_wasm(this.tree[0]),h(this.tree)}namedDescendantForPosition(t,r=t){if(!L(t)||!L(r))throw new Error("Arguments must be {row, column} objects");m(this);let n=d+b;return y(n,t),y(n+M,r),_._ts_node_named_descendant_for_position_wasm(this.tree[0]),h(this.tree)}walk(){return m(this),_._ts_tree_cursor_new_wasm(this.tree[0]),new H(p,this.tree)}edit(t){let{point:r,index:n}=t.editPoint(this.startPosition,this.startIndex);this.startPosition=r,this.startIndex=n}toString(){m(this);let t=_._ts_node_to_string_wasm(this.tree[0]),r=_.AsciiToString(t);return _._ts_free_wasm(t),r}};function m(e,t=0){let r=d+t*b;_.setValue(r,e.id,"i32"),r+=u,_.setValue(r,e.startIndex,"i32"),r+=u,_.setValue(r,e.startPosition.row,"i32"),r+=u,_.setValue(r,e.startPosition.column,"i32"),r+=u,_.setValue(r,e[0],"i32")}a(m,"marshalNode");function h(e,t=d){let r=_.getValue(t,"i32");if(t+=u,r===0)return null;let n=_.getValue(t,"i32");t+=u;let s=_.getValue(t,"i32");t+=u;let o=_.getValue(t,"i32");t+=u;let l=_.getValue(t,"i32");return new W(p,{id:r,tree:e,startIndex:n,startPosition:{row:s,column:o},other:l})}a(h,"unmarshalNode");function g({handles:e},t=d){_.setValue(t+0*u,e[0],"i32"),_.setValue(t+1*u,e[1],"i32"),_.setValue(t+2*u,e[2],"i32"),_.setValue(t+3*u,e[3],"i32")}a(g,"marshalTreeCursor");function A({handles:e}){e[0]=_.getValue(d+0*u,"i32"),e[1]=_.getValue(d+1*u,"i32"),e[2]=_.getValue(d+2*u,"i32"),e[3]=_.getValue(d+3*u,"i32")}a(A,"unmarshalTreeCursor");function y(e,t){_.setValue(e,t.row,"i32"),_.setValue(e+u,t.column,"i32")}a(y,"marshalPoint");function R(e){return{row:_.getValue(e,"i32")>>>0,column:_.getValue(e+u,"i32")>>>0}}a(R,"unmarshalPoint");function ae(e,t){y(e,t.startPosition),e+=M,y(e,t.endPosition),e+=M,_.setValue(e,t.startIndex,"i32"),e+=u,_.setValue(e,t.endIndex,"i32")}a(ae,"marshalRange");function U(e){let t={};return t.startPosition=R(e),e+=M,t.endPosition=R(e),e+=M,t.startIndex=_.getValue(e,"i32")>>>0,e+=u,t.endIndex=_.getValue(e,"i32")>>>0,t}a(U,"unmarshalRange");function ne(e,t=d){y(t,e.startPosition),t+=M,y(t,e.oldEndPosition),t+=M,y(t,e.newEndPosition),t+=M,_.setValue(t,e.startIndex,"i32"),t+=u,_.setValue(t,e.oldEndIndex,"i32"),t+=u,_.setValue(t,e.newEndIndex,"i32")}a(ne,"marshalEdit");function ie(e){let t=_.getValue(e,"i32"),r=_.getValue(e+=u,"i32"),n=_.getValue(e+u,"i32");return{major_version:t,minor_version:r,patch_version:n}}a(ie,"unmarshalLanguageMetadata");var Se=/^tree_sitter_\w+$/,N=class{static{a(this,"Language")}0=0;types;fields;constructor(t,r){T(t),this[0]=r,this.types=new Array(_._ts_language_symbol_count(this[0]));for(let n=0,s=this.types.length;n<s;n++)_._ts_language_symbol_type(this[0],n)<2&&(this.types[n]=_.UTF8ToString(_._ts_language_symbol_name(this[0],n)));this.fields=new Array(_._ts_language_field_count(this[0])+1);for(let n=0,s=this.fields.length;n<s;n++){let o=_._ts_language_field_name_for_id(this[0],n);o!==0?this.fields[n]=_.UTF8ToString(o):this.fields[n]=null}}get name(){let t=_._ts_language_name(this[0]);return t===0?null:_.UTF8ToString(t)}get abiVersion(){return _._ts_language_abi_version(this[0])}get metadata(){return _._ts_language_metadata_wasm(this[0]),_.getValue(d,"i32")===0?null:ie(d+u)}get fieldCount(){return this.fields.length-1}get stateCount(){return _._ts_language_state_count(this[0])}fieldIdForName(t){let r=this.fields.indexOf(t);return r!==-1?r:null}fieldNameForId(t){return this.fields[t]??null}idForNodeType(t,r){let n=_.lengthBytesUTF8(t),s=_._malloc(n+1);_.stringToUTF8(t,s,n+1);let o=_._ts_language_symbol_for_name(this[0],s,n,r?1:0);return _._free(s),o||null}get nodeTypeCount(){return _._ts_language_symbol_count(this[0])}nodeTypeForId(t){let r=_._ts_language_symbol_name(this[0],t);return r?_.UTF8ToString(r):null}nodeTypeIsNamed(t){return!!_._ts_language_type_is_named_wasm(this[0],t)}nodeTypeIsVisible(t){return!!_._ts_language_type_is_visible_wasm(this[0],t)}get supertypes(){_._ts_language_supertypes_wasm(this[0]);let t=_.getValue(d,"i32"),r=_.getValue(d+u,"i32"),n=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)n[o]=_.getValue(s,"i16"),s+=X}return n}subtypes(t){_._ts_language_subtypes_wasm(this[0],t);let r=_.getValue(d,"i32"),n=_.getValue(d+u,"i32"),s=new Array(r);if(r>0){let o=n;for(let l=0;l<r;l++)s[l]=_.getValue(o,"i16"),o+=X}return s}nextState(t,r){return _._ts_language_next_state(this[0],t,r)}lookaheadIterator(t){let r=_._ts_lookahead_iterator_new(this[0],t);return r?new x(p,r,this):null}static async load(t){let r;if(t instanceof Uint8Array||t instanceof WebAssembly.Module)r=t;else{let s=await fetch(t);if(!s.ok){let l=await s.text();throw new Error(`Language.load failed with status ${s.status}.
2
2
 
3
- ${l}`)}let o=s.clone();try{r=await WebAssembly.compileStreaming(s)}catch(l){console.error("wasm streaming compile failed:",l),console.error("falling back to ArrayBuffer instantiation"),r=new Uint8Array(await o.arrayBuffer())}}let _=await n.loadWebAssemblyModule(r,{loadAsync:!0});return Ae(_,{sync:!1})}static loadSync(t){let r=n.loadWebAssemblyModule(t,{loadAsync:!1});return Ae(r,{sync:!0})}};function Ae(e,{sync:t}){let r=Object.keys(e),_=r.find(o=>Ue.test(o)&&!o.includes("external_scanner_"));if(!_)throw console.log(`Couldn't find language function in Wasm file. Symbols:
4
- ${JSON.stringify(r,null,2)}`),new Error(`Language.${t?"loadSync":"load"} failed: no language function found in Wasm file`);let s=e[_]();return new Z(x,s)}a(Ae,"loadFromWasmExports");async function De(moduleArg={}){var moduleRtn,Module=moduleArg,ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=!1;if(ENVIRONMENT_IS_NODE){let{createRequire:e}=await Promise.resolve().then(()=>(Se(),Te));var require=e(import.meta.url)}Module.currentQueryProgressCallback=null,Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null,Module.treeSitterSetMemoryLimit=function(e){return e?wasmMemory.buffer.byteLength>e||Module.treeSitterOriginalMemoryGrow?!1:(Module.treeSitterOriginalMemoryGrow=wasmMemory.grow,wasmMemory.grow=function(t){if(wasmMemory.buffer.byteLength+t*65536>e)throw new RangeError("Parse memory limit exceeded");return Module.treeSitterOriginalMemoryGrow.call(wasmMemory,t)},!0):(Module.treeSitterOriginalMemoryGrow&&(wasmMemory.grow=Module.treeSitterOriginalMemoryGrow,Module.treeSitterOriginalMemoryGrow=null),!0)};var arguments_=[],thisProgram="./this.program",quit_=a((e,t)=>{throw t},"quit_"),_scriptName=import.meta.url,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");_scriptName.startsWith("file:")&&(scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"),readBinary=a(e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},"readBinary"),readAsync=a(async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var r=fs.readFileSync(e,t?void 0:"utf8");return r},"readAsync"),(void 0).argv.length>1&&(thisProgram=(void 0).argv[1].replace(/\\/g,"/")),arguments_=(void 0).argv.slice(2),quit_=a((e,t)=>{throw(void 0).exitCode=e,t},"quit_")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}ENVIRONMENT_IS_WORKER&&(readBinary=a(e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},"readBinary")),readAsync=a(async e=>{if(isFileURI(e))return new Promise((r,_)=>{var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onload=()=>{if(s.status==200||s.status==0&&s.response){r(s.response);return}_(s.status)},s.onerror=_,s.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)},"readAsync")}var out=console.log.bind(console),err=console.error.bind(console),dynamicLibraries=[],wasmBinary,ABORT=!1,EXITSTATUS,isFileURI=a(e=>e.startsWith("file://"),"isFileURI"),readyPromiseResolve,readyPromiseReject,wasmMemory,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP64,HEAPU64,HEAP_DATA_VIEW,runtimeInitialized=!1;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e),Module.HEAP64=HEAP64=new BigInt64Array(e),Module.HEAPU64=HEAPU64=new BigUint64Array(e),Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(e),LE_HEAP_UPDATE()}a(updateMemoryViews,"updateMemoryViews");function initMemory(){if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var e=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:e/65536,maximum:32768})}updateMemoryViews()}a(initMemory,"initMemory");var __RELOC_FUNCS__=[];function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(onPreRuns)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}a(initRuntime,"initRuntime");function preMain(){}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(onPostRuns)}a(postRun,"postRun");function abort(e){Module.onAbort?.(e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject?.(t),t}a(abort,"abort");var wasmBinaryFile;function findWasmBinary(){return Module.locateFile?locateFile("web-tree-sitter.wasm"):new URL("web-tree-sitter.wasm",import.meta.url).href}a(findWasmBinary,"findWasmBinary");function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}a(getWasmBinary,"getWasmBinary");async function instantiateArrayBuffer(e,t){try{var r=await getWasmBinary(e),_=await WebAssembly.instantiate(r,t);return _}catch(s){err(`failed to asynchronously prepare wasm: ${s}`),abort(s)}}a(instantiateArrayBuffer,"instantiateArrayBuffer");async function instantiateAsync(e,t,r){if(!e&&!isFileURI(t)&&!ENVIRONMENT_IS_NODE)try{var _=fetch(t,{credentials:"same-origin"}),s=await WebAssembly.instantiateStreaming(_,r);return s}catch(o){err(`wasm streaming compile failed: ${o}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,r)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");async function createWasm(){function e(o,l){wasmExports=o.exports,wasmExports=relocateExports(wasmExports,1024);var u=getDylinkMetadata(l);u.neededDynlibs&&(dynamicLibraries=u.neededDynlibs.concat(dynamicLibraries));let m={malloc:wasmExports.ts_scanner_malloc_wasm,calloc:wasmExports.ts_scanner_calloc_wasm,realloc:wasmExports.ts_scanner_realloc_wasm};return Object.assign(wasmImports,m),updateGOT(m,!0),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),assignWasmExports(wasmExports),wasmExports}a(e,"receiveInstance");function t(o){return e(o.instance,o.module)}a(t,"receiveInstantiationResult");var r=getWasmImports();if(Module.instantiateWasm)return new Promise((o,l)=>{Module.instantiateWasm(r,(u,m)=>{o(e(u,m))})});wasmBinaryFile??=findWasmBinary();var _=await instantiateAsync(wasmBinary,wasmBinaryFile,r),s=t(_);return s}a(createWasm,"createWasm");class ExitStatus{static{a(this,"ExitStatus")}name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},LE_ATOMICS_NATIVE_BYTE_ORDER=[],LE_HEAP_LOAD_F32=a(e=>HEAP_DATA_VIEW.getFloat32(e,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=a(e=>HEAP_DATA_VIEW.getFloat64(e,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=a(e=>HEAP_DATA_VIEW.getInt16(e,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=a(e=>HEAP_DATA_VIEW.getInt32(e,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_I64=a(e=>HEAP_DATA_VIEW.getBigInt64(e,!0),"LE_HEAP_LOAD_I64"),LE_HEAP_LOAD_U32=a(e=>HEAP_DATA_VIEW.getUint32(e,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=a((e,t)=>HEAP_DATA_VIEW.setFloat32(e,t,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=a((e,t)=>HEAP_DATA_VIEW.setFloat64(e,t,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=a((e,t)=>HEAP_DATA_VIEW.setInt16(e,t,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=a((e,t)=>HEAP_DATA_VIEW.setInt32(e,t,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_I64=a((e,t)=>HEAP_DATA_VIEW.setBigInt64(e,t,!0),"LE_HEAP_STORE_I64"),LE_HEAP_STORE_U32=a((e,t)=>HEAP_DATA_VIEW.setUint32(e,t,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=a(e=>{for(;e.length>0;)e.shift()(Module)},"callRuntimeCallbacks"),onPostRuns=[],addOnPostRun=a(e=>onPostRuns.push(e),"addOnPostRun"),onPreRuns=[],addOnPreRun=a(e=>onPreRuns.push(e),"addOnPreRun"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,findStringEnd=a((e,t,r,_)=>{var s=t+r;if(_)return s;for(;e[t]&&!(t>=s);)++t;return t},"findStringEnd"),UTF8ArrayToString=a((e,t=0,r,_)=>{var s=findStringEnd(e,t,r,_);if(s-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,s));for(var o="";t<s;){var l=e[t++];if(!(l&128)){o+=String.fromCharCode(l);continue}var u=e[t++]&63;if((l&224)==192){o+=String.fromCharCode((l&31)<<6|u);continue}var m=e[t++]&63;if((l&240)==224?l=(l&15)<<12|u<<6|m:l=(l&7)<<18|u<<12|m<<6|e[t++]&63,l<65536)o+=String.fromCharCode(l);else{var w=l-65536;o+=String.fromCharCode(55296|w>>10,56320|w&1023)}}return o},"UTF8ArrayToString"),getDylinkMetadata=a(e=>{var t=0,r=0;function _(){return e[t++]}a(_,"getU8");function s(){for(var q=0,$=1;;){var he=e[t++];if(q+=(he&127)*$,$*=128,!(he&128))break}return q}a(s,"getLEB");function o(){var q=s();return t+=q,UTF8ArrayToString(e,t-q,q)}a(o,"getString");function l(){for(var q=s(),$=[];q--;)$.push(o());return $}a(l,"getStringList");function u(q,$){if(q)throw new Error($)}if(a(u,"failIf"),e instanceof WebAssembly.Module){var m=WebAssembly.Module.customSections(e,"dylink.0");u(m.length===0,"need dylink section"),e=new Uint8Array(m[0]),r=e.length}else{var w=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),f=w[0]==1836278016||w[0]==6386541;u(!f,"need to see wasm magic number"),u(e[8]!==0,"need the dylink section to be first"),t=9;var g=s();r=t+g;var v=o();u(v!=="dylink.0")}for(var b={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},C=1,N=2,V=3,p=4,A=5,y=256,R=3,M=1;t<r;){var k=_(),H=s();if(k===C)b.memorySize=s(),b.memoryAlign=s(),b.tableSize=s(),b.tableAlign=s();else if(k===N)b.neededDynlibs=l();else if(k===V)for(var T=s();T--;){var B=o(),G=s();G&y&&b.tlsExports.add(B)}else if(k===p)for(var T=s();T--;){var fe=o(),B=o(),G=s();(G&R)==M&&b.weakImports.add(B)}else k===A?b.runtimePaths=l():t+=H}return b},"getDylinkMetadata");function getValue(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":return HEAP8[e];case"i8":return HEAP8[e];case"i16":return LE_HEAP_LOAD_I16((e>>1)*2);case"i32":return LE_HEAP_LOAD_I32((e>>2)*4);case"i64":return LE_HEAP_LOAD_I64((e>>3)*8);case"float":return LE_HEAP_LOAD_F32((e>>2)*4);case"double":return LE_HEAP_LOAD_F64((e>>3)*8);case"*":return LE_HEAP_LOAD_U32((e>>2)*4);default:abort(`invalid type for getValue: ${t}`)}}a(getValue,"getValue");var newDSO=a((e,t,r)=>{var _={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=_,t!=null&&(LDSO.loadedLibsByHandle[t]=_),_},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=82720,alignMemory=a((e,t)=>Math.ceil(e/t)*t,"alignMemory"),getMemory=a(e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},"getMemory"),isInternalSym=a(e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),"isInternalSym"),uleb128EncodeWithLen=a(e=>{let t=e.length;return[t%128|128,t>>7,...e]},"uleb128EncodeWithLen"),wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111},generateTypePack=a(e=>uleb128EncodeWithLen(Array.from(e,t=>{var r=wasmTypeCodes[t];return r})),"generateTypePack"),convertJsFunctionToWasm=a((e,t)=>{var r=Uint8Array.of(0,97,115,109,1,0,0,0,1,...uleb128EncodeWithLen([1,96,...generateTypePack(t.slice(1)),...generateTypePack(t[0]==="v"?"":t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),_=new WebAssembly.Module(r),s=new WebAssembly.Instance(_,{e:{f:e}}),o=s.exports.f;return o},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:45,element:"anyfunc"}),getWasmTableEntry=a(e=>{var t=wasmTableMirror[e];return t||(wasmTableMirror[e]=t=wasmTable.get(e)),t},"getWasmTableEntry"),updateTableMap=a((e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var _=getWasmTableEntry(r);_&&functionsInTableMap.set(_,r)}},"updateTableMap"),functionsInTableMap,getFunctionAddress=a(e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>freeTableIndexes.length?freeTableIndexes.pop():wasmTable.grow(1),"getEmptyTableSlot"),setWasmTableEntry=a((e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},"setWasmTableEntry"),addFunction=a((e,t)=>{var r=getFunctionAddress(e);if(r)return r;var _=getEmptyTableSlot();try{setWasmTableEntry(_,e)}catch(o){if(!(o instanceof TypeError))throw o;var s=convertJsFunctionToWasm(e,t);setWasmTableEntry(_,s)}return functionsInTableMap.set(e,_),_},"addFunction"),updateGOT=a((e,t)=>{for(var r in e)if(!isInternalSym(r)){var _=e[r];GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[r].value==0)&&(typeof _=="function"?GOT[r].value=addFunction(_):typeof _=="number"?GOT[r].value=_:err(`unhandled export type for '${r}': ${typeof _}`))}},"updateGOT"),relocateExports=a((e,t,r)=>{var _={};for(var s in e){var o=e[s];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),_[s]=o}return updateGOT(_,r),_},"relocateExports"),isSymbolDefined=a(e=>{var t=wasmImports[e];return!(!t||t.stub)},"isSymbolDefined"),dynCall=a((e,t,r=[],_=!1)=>{var s=getWasmTableEntry(t),o=s(...r);function l(u){return u}return a(l,"convert"),o},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(e=>__emscripten_stack_restore(e),"stackRestore"),createInvokeFunction=a(e=>(t,...r)=>{var _=stackSave();try{return dynCall(e,t,r)}catch(s){if(stackRestore(_),s!==s+0)throw s;if(_setThrew(1,0),e[0]=="j")return 0n}},"createInvokeFunction"),resolveGlobalSymbol=a((e,t=!1)=>{var r;return isSymbolDefined(e)?r=wasmImports[e]:e.startsWith("invoke_")&&(r=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:r,name:e}},"resolveGlobalSymbol"),onPostCtors=[],addOnPostCtor=a(e=>onPostCtors.push(e),"addOnPostCtor"),UTF8ToString=a((e,t,r)=>e?UTF8ArrayToString(HEAPU8,e,t,r):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;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)),metadata.tableSize&&wasmTable.grow(metadata.tableSize);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub){var r=wasmImports[t];return r}if(!(t in e)){var _;e[t]=(...s)=>(_||=resolveSymbol(t),_(...s))}return e[t]}},proxy=new Proxy({},proxyHandler);currentModuleWeakSymbols=metadata.weakImports;var info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;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)}a(addEmJs,"addEmJs");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;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():addOnPostCtor(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync)return(async()=>{var e;return binary instanceof WebAssembly.Module?e=await WebAssembly.instantiate(binary,info):{module:binary,instance:e}=await WebAssembly.instantiate(binary,info),postInstantiation(binary,e)})();var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags={...flags,rpath:{parentLibPath:libName,paths:metadata.runtimePaths}},flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((e,t)=>{for(var[r,_]of Object.entries(e)){let s=a(l=>{isSymbolDefined(l)||(wasmImports[l]=_)},"setImport");s(r);let o="__main_argc_argv";r=="main"&&s(o),r==o&&s("main")}},"mergeLibSymbols"),asyncLoad=a(async e=>{var t=await readAsync(e);return new Uint8Array(t)},"asyncLoad");function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,_){var s=LDSO.loadedLibsByName[e];if(s)return t.global?s.global||(s.global=!0,mergeLibSymbols(s.exports,e)):r&&Object.assign(r,s.exports),t.nodelete&&s.refcount!==1/0&&(s.refcount=1/0),s.refcount++,_&&(LDSO.loadedLibsByHandle[_]=s),t.loadAsync?Promise.resolve(!0):!0;s=newDSO(e,_,"loading"),s.refcount=t.nodelete?1/0:1,s.global=t.global;function o(){if(_){var m=LE_HEAP_LOAD_U32((_+28>>2)*4),w=LE_HEAP_LOAD_U32((_+32>>2)*4);if(m&&w){var f=HEAP8.slice(m,m+w);return t.loadAsync?Promise.resolve(f):f}}var g=locateFile(e);if(t.loadAsync)return asyncLoad(g);if(!readBinary)throw new Error(`${g}: file not found, and synchronous loading of external files is not available`);return readBinary(g)}a(o,"loadLibData");function l(){return t.loadAsync?o().then(m=>loadWebAssemblyModule(m,t,e,r,_)):loadWebAssemblyModule(o(),t,e,r,_)}a(l,"getExports");function u(m){s.global?mergeLibSymbols(m,e):r&&Object.assign(r,m),s.exports=m}return a(u,"moduleLoaded"),t.loadAsync?l().then(m=>(u(m),!0)):(u(l()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else if(typeof r=="number")t.value=r;else throw new Error(`bad export type for '${e}': ${typeof r}`)}},"reportUndefinedSymbols"),runDependencies=0,dependenciesFulfilled=null,removeRunDependency=a(e=>{if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}},"removeRunDependency"),addRunDependency=a(e=>{runDependencies++,Module.monitorRunDependencies?.(runDependencies)},"addRunDependency"),loadDylibs=a(async()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs");for(var e of dynamicLibraries)await loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0});reportUndefinedSymbols(),removeRunDependency("loadDylibs")},"loadDylibs"),noExitRuntime=!0;function setValue(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[e]=t;break;case"i8":HEAP8[e]=t;break;case"i16":LE_HEAP_STORE_I16((e>>1)*2,t);break;case"i32":LE_HEAP_STORE_I32((e>>2)*4,t);break;case"i64":LE_HEAP_STORE_I64((e>>3)*8,BigInt(t));break;case"float":LE_HEAP_STORE_F32((e>>2)*4,t);break;case"double":LE_HEAP_STORE_F64((e>>3)*8,t);break;case"*":LE_HEAP_STORE_U32((e>>2)*4,t);break;default:abort(`invalid type for setValue: ${r}`)}}a(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=82720,___stack_low=17184,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},82720),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>abort(""),"__abort_js");__abort_js.sig="v";var runtimeKeepaliveCounter=0,__emscripten_runtime_keepalive_clear=a(()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0},"__emscripten_runtime_keepalive_clear");__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_throw_longjmp=a(()=>{throw 1/0},"__emscripten_throw_longjmp");__emscripten_throw_longjmp.sig="v";var timers={},handleException=a(e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},"handleException"),keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((e,t)=>{EXITSTATUS=e,_proc_exit(e)},"exitJS"),_exit=exitJS;_exit.sig="vi";var maybeExit=a(()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},"maybeExit"),callUserCallback=a(e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}},"callUserCallback"),_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now");_emscripten_get_now.sig="d";var __setitimer_js=a((e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var r=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:r,timeout_ms:t},0},"__setitimer_js");__setitimer_js.sig="iid";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(e=>{var t=wasmMemory.buffer.byteLength,r=(e-t+65535)/65536|0;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(e=>{var t=HEAPU8.length;e>>>=0;var r=getHeapMax();if(e>r)return!1;for(var _=1;_<=4;_*=2){var s=t*(1+0/_);s=Math.min(s,e+100663296);var o=Math.min(r,alignMemory(Math.max(e,s),65536)),l=growMemory(o);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";function _tree_sitter_log_callback(e,t){if(Module.currentLogCallback){let r=UTF8ToString(t);Module.currentLogCallback(r,e!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(e,t,r,_,s){let l=Module.currentParseCallback(t,{row:r,column:_});typeof l=="string"?(setValue(s,l.length,"i32"),stringToUTF16(l,e,10240)):setValue(s,0,"i32")}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");function _tree_sitter_progress_callback(e,t){return Module.currentProgressCallback?Module.currentProgressCallback({currentOffset:e,hasError:t!==0})===!0:!1}a(_tree_sitter_progress_callback,"_tree_sitter_progress_callback");function _tree_sitter_query_progress_callback(e){return Module.currentQueryProgressCallback?Module.currentQueryProgressCallback({currentOffset:e})===!0:!1}a(_tree_sitter_query_progress_callback,"_tree_sitter_query_progress_callback");var lengthBytesUTF8=a(e=>{for(var t=0,r=0;r<e.length;++r){var _=e.charCodeAt(r);_<=127?t++:_<=2047?t+=2:_>=55296&&_<=57343?(t+=4,++r):t+=3}return t},"lengthBytesUTF8"),stringToUTF8Array=a((e,t,r,_)=>{if(!(_>0))return 0;for(var s=r,o=r+_-1,l=0;l<e.length;++l){var u=e.codePointAt(l);if(u<=127){if(r>=o)break;t[r++]=u}else if(u<=2047){if(r+1>=o)break;t[r++]=192|u>>6,t[r++]=128|u&63}else if(u<=65535){if(r+2>=o)break;t[r++]=224|u>>12,t[r++]=128|u>>6&63,t[r++]=128|u&63}else{if(r+3>=o)break;t[r++]=240|u>>18,t[r++]=128|u>>12&63,t[r++]=128|u>>6&63,t[r++]=128|u&63,l++}}return t[r]=0,r-s},"stringToUTF8Array"),stringToUTF8=a((e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r),"stringToUTF8"),stackAlloc=a(e=>__emscripten_stack_alloc(e),"stackAlloc"),stringToUTF8OnStack=a(e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},"stringToUTF8OnStack"),AsciiToString=a(e=>{for(var t="";;){var r=HEAPU8[e++];if(!r)return t;t+=String.fromCharCode(r)}},"AsciiToString"),stringToUTF16=a((e,t,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var _=t,s=r<e.length*2?r/2:e.length,o=0;o<s;++o){var l=e.charCodeAt(o);LE_HEAP_STORE_I16((t>>1)*2,l),t+=2}return LE_HEAP_STORE_I16((t>>1)*2,0),t-_},"stringToUTF16");LE_ATOMICS_NATIVE_BYTE_ORDER=new Int8Array(new Int16Array([1]).buffer)[0]===1?[(e=>e),(e=>e),void 0,(e=>e)]:[(e=>e),(e=>((e&65280)<<8|(e&255)<<24)>>16),void 0,(e=>e>>24&255|e>>8&65280|(e&65280)<<8|(e&255)<<24)];function LE_HEAP_UPDATE(){HEAPU16.unsigned=(e=>e&65535),HEAPU32.unsigned=(e=>e>>>0)}if(a(LE_HEAP_UPDATE,"LE_HEAP_UPDATE"),initMemory(),Module.noExitRuntime&&(noExitRuntime=Module.noExitRuntime),Module.print&&(out=Module.print),Module.printErr&&(err=Module.printErr),Module.dynamicLibraries&&(dynamicLibraries=Module.dynamicLibraries),Module.wasmBinary&&(wasmBinary=Module.wasmBinary),Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.shift()();Module.setValue=setValue,Module.getValue=getValue,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,Module.loadWebAssemblyModule=loadWebAssemblyModule,Module.LE_HEAP_STORE_I64=LE_HEAP_STORE_I64;var ASM_CONSTS={},_free,_ts_range_edit,_ts_language_symbol_count,_ts_language_state_count,_ts_language_abi_version,_ts_language_name,_ts_language_field_count,_ts_language_next_state,_ts_language_symbol_name,_ts_language_symbol_for_name,_strncmp,_ts_language_symbol_type,_ts_language_field_name_for_id,_ts_lookahead_iterator_new,_ts_lookahead_iterator_delete,_ts_lookahead_iterator_reset_state,_ts_lookahead_iterator_reset,_ts_lookahead_iterator_next,_ts_lookahead_iterator_current_symbol,_ts_point_edit,_ts_parser_delete,_ts_parser_set_language,_ts_parser_reset,_ts_parser_set_included_ranges,_ts_query_new,_ts_query_delete,_ts_query_copy,_ts_query_pattern_count,_ts_query_capture_count,_ts_query_string_count,_ts_query_capture_name_for_id,_ts_query_capture_quantifier_for_id,_ts_query_string_value_for_id,_ts_query_predicates_for_pattern,_ts_query_start_byte_for_pattern,_ts_query_end_byte_for_pattern,_ts_query_is_pattern_rooted,_ts_query_is_pattern_non_local,_ts_query_is_pattern_guaranteed_at_step,_ts_query_disable_capture,_ts_query_disable_pattern,_memcmp,_ts_tree_copy,_ts_tree_delete,_malloc,_calloc,_realloc,_iswspace,_iswalnum,_ts_init,_ts_free_wasm,_ts_scanner_malloc_wasm,_ts_scanner_calloc_wasm,_ts_scanner_realloc_wasm,_ts_parser_new_wasm,_ts_parser_enable_logger_wasm,_ts_parser_parse_wasm,_ts_parser_parse_limited_wasm,_ts_parser_abort_limited_wasm,_ts_parser_included_ranges_wasm,_ts_language_type_is_named_wasm,_ts_language_type_is_visible_wasm,_ts_language_metadata_wasm,_ts_language_supertypes_wasm,_ts_language_subtypes_wasm,_ts_tree_root_node_wasm,_ts_tree_root_node_with_offset_wasm,_ts_tree_edit_wasm,_ts_tree_included_ranges_wasm,_ts_tree_get_changed_ranges_wasm,_ts_tree_cursor_new_wasm,_ts_tree_cursor_copy_wasm,_ts_tree_cursor_delete_wasm,_ts_tree_cursor_reset_wasm,_ts_tree_cursor_reset_to_wasm,_ts_tree_cursor_goto_first_child_wasm,_ts_tree_cursor_goto_last_child_wasm,_ts_tree_cursor_goto_first_child_for_index_wasm,_ts_tree_cursor_goto_first_child_for_position_wasm,_ts_tree_cursor_goto_next_sibling_wasm,_ts_tree_cursor_goto_previous_sibling_wasm,_ts_tree_cursor_goto_descendant_wasm,_ts_tree_cursor_goto_parent_wasm,_ts_tree_cursor_current_node_type_id_wasm,_ts_tree_cursor_current_node_state_id_wasm,_ts_tree_cursor_current_node_is_named_wasm,_ts_tree_cursor_current_node_is_missing_wasm,_ts_tree_cursor_current_node_id_wasm,_ts_tree_cursor_start_position_wasm,_ts_tree_cursor_end_position_wasm,_ts_tree_cursor_start_index_wasm,_ts_tree_cursor_end_index_wasm,_ts_tree_cursor_current_field_id_wasm,_ts_tree_cursor_current_depth_wasm,_ts_tree_cursor_current_descendant_index_wasm,_ts_tree_cursor_current_node_wasm,_ts_node_symbol_wasm,_ts_node_field_name_for_child_wasm,_ts_node_field_name_for_named_child_wasm,_ts_node_children_by_field_id_wasm,_ts_node_first_child_for_byte_wasm,_ts_node_first_named_child_for_byte_wasm,_ts_node_grammar_symbol_wasm,_ts_node_child_count_wasm,_ts_node_named_child_count_wasm,_ts_node_child_wasm,_ts_node_named_child_wasm,_ts_node_child_by_field_id_wasm,_ts_node_next_sibling_wasm,_ts_node_prev_sibling_wasm,_ts_node_next_named_sibling_wasm,_ts_node_prev_named_sibling_wasm,_ts_node_descendant_count_wasm,_ts_node_parent_wasm,_ts_node_child_with_descendant_wasm,_ts_node_descendant_for_index_wasm,_ts_node_named_descendant_for_index_wasm,_ts_node_descendant_for_position_wasm,_ts_node_named_descendant_for_position_wasm,_ts_node_start_point_wasm,_ts_node_end_point_wasm,_ts_node_start_index_wasm,_ts_node_end_index_wasm,_ts_node_to_string_wasm,_ts_node_children_wasm,_ts_node_named_children_wasm,_ts_node_descendants_of_type_wasm,_ts_node_is_named_wasm,_ts_node_has_changes_wasm,_ts_node_has_error_wasm,_ts_node_is_error_wasm,_ts_node_is_missing_wasm,_ts_node_is_extra_wasm,_ts_node_parse_state_wasm,_ts_node_next_parse_state_wasm,_ts_query_matches_wasm,_ts_query_captures_wasm,_memset,_memcpy,_memmove,_iswalpha,_iswblank,_iswdigit,_iswlower,_iswpunct,_iswupper,_iswxdigit,_memchr,__emscripten_timeout,_strlen,_strcmp,_strncat,_strncpy,_towlower,_towupper,_setThrew,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___wasm_apply_data_relocs;function assignWasmExports(e){Module._free=_free=e.free,Module._ts_range_edit=_ts_range_edit=e.ts_range_edit,Module._ts_language_symbol_count=_ts_language_symbol_count=e.ts_language_symbol_count,Module._ts_language_state_count=_ts_language_state_count=e.ts_language_state_count,Module._ts_language_abi_version=_ts_language_abi_version=e.ts_language_abi_version,Module._ts_language_name=_ts_language_name=e.ts_language_name,Module._ts_language_field_count=_ts_language_field_count=e.ts_language_field_count,Module._ts_language_next_state=_ts_language_next_state=e.ts_language_next_state,Module._ts_language_symbol_name=_ts_language_symbol_name=e.ts_language_symbol_name,Module._ts_language_symbol_for_name=_ts_language_symbol_for_name=e.ts_language_symbol_for_name,Module._strncmp=_strncmp=e.strncmp,Module._ts_language_symbol_type=_ts_language_symbol_type=e.ts_language_symbol_type,Module._ts_language_field_name_for_id=_ts_language_field_name_for_id=e.ts_language_field_name_for_id,Module._ts_lookahead_iterator_new=_ts_lookahead_iterator_new=e.ts_lookahead_iterator_new,Module._ts_lookahead_iterator_delete=_ts_lookahead_iterator_delete=e.ts_lookahead_iterator_delete,Module._ts_lookahead_iterator_reset_state=_ts_lookahead_iterator_reset_state=e.ts_lookahead_iterator_reset_state,Module._ts_lookahead_iterator_reset=_ts_lookahead_iterator_reset=e.ts_lookahead_iterator_reset,Module._ts_lookahead_iterator_next=_ts_lookahead_iterator_next=e.ts_lookahead_iterator_next,Module._ts_lookahead_iterator_current_symbol=_ts_lookahead_iterator_current_symbol=e.ts_lookahead_iterator_current_symbol,Module._ts_point_edit=_ts_point_edit=e.ts_point_edit,Module._ts_parser_delete=_ts_parser_delete=e.ts_parser_delete,Module._ts_parser_set_language=_ts_parser_set_language=e.ts_parser_set_language,Module._ts_parser_reset=_ts_parser_reset=e.ts_parser_reset,Module._ts_parser_set_included_ranges=_ts_parser_set_included_ranges=e.ts_parser_set_included_ranges,Module._ts_query_new=_ts_query_new=e.ts_query_new,Module._ts_query_delete=_ts_query_delete=e.ts_query_delete,Module._ts_query_copy=_ts_query_copy=e.ts_query_copy,Module._ts_query_pattern_count=_ts_query_pattern_count=e.ts_query_pattern_count,Module._ts_query_capture_count=_ts_query_capture_count=e.ts_query_capture_count,Module._ts_query_string_count=_ts_query_string_count=e.ts_query_string_count,Module._ts_query_capture_name_for_id=_ts_query_capture_name_for_id=e.ts_query_capture_name_for_id,Module._ts_query_capture_quantifier_for_id=_ts_query_capture_quantifier_for_id=e.ts_query_capture_quantifier_for_id,Module._ts_query_string_value_for_id=_ts_query_string_value_for_id=e.ts_query_string_value_for_id,Module._ts_query_predicates_for_pattern=_ts_query_predicates_for_pattern=e.ts_query_predicates_for_pattern,Module._ts_query_start_byte_for_pattern=_ts_query_start_byte_for_pattern=e.ts_query_start_byte_for_pattern,Module._ts_query_end_byte_for_pattern=_ts_query_end_byte_for_pattern=e.ts_query_end_byte_for_pattern,Module._ts_query_is_pattern_rooted=_ts_query_is_pattern_rooted=e.ts_query_is_pattern_rooted,Module._ts_query_is_pattern_non_local=_ts_query_is_pattern_non_local=e.ts_query_is_pattern_non_local,Module._ts_query_is_pattern_guaranteed_at_step=_ts_query_is_pattern_guaranteed_at_step=e.ts_query_is_pattern_guaranteed_at_step,Module._ts_query_disable_capture=_ts_query_disable_capture=e.ts_query_disable_capture,Module._ts_query_disable_pattern=_ts_query_disable_pattern=e.ts_query_disable_pattern,Module._memcmp=_memcmp=e.memcmp,Module._ts_tree_copy=_ts_tree_copy=e.ts_tree_copy,Module._ts_tree_delete=_ts_tree_delete=e.ts_tree_delete,Module._malloc=_malloc=e.malloc,Module._calloc=_calloc=e.calloc,Module._realloc=_realloc=e.realloc,Module._iswspace=_iswspace=e.iswspace,Module._iswalnum=_iswalnum=e.iswalnum,Module._ts_init=_ts_init=e.ts_init,Module._ts_free_wasm=_ts_free_wasm=e.ts_free_wasm,Module._ts_scanner_malloc_wasm=_ts_scanner_malloc_wasm=e.ts_scanner_malloc_wasm,Module._ts_scanner_calloc_wasm=_ts_scanner_calloc_wasm=e.ts_scanner_calloc_wasm,Module._ts_scanner_realloc_wasm=_ts_scanner_realloc_wasm=e.ts_scanner_realloc_wasm,Module._ts_parser_new_wasm=_ts_parser_new_wasm=e.ts_parser_new_wasm,Module._ts_parser_enable_logger_wasm=_ts_parser_enable_logger_wasm=e.ts_parser_enable_logger_wasm,Module._ts_parser_parse_wasm=_ts_parser_parse_wasm=e.ts_parser_parse_wasm,Module._ts_parser_parse_limited_wasm=_ts_parser_parse_limited_wasm=e.ts_parser_parse_limited_wasm,Module._ts_parser_abort_limited_wasm=_ts_parser_abort_limited_wasm=e.ts_parser_abort_limited_wasm,Module._ts_parser_included_ranges_wasm=_ts_parser_included_ranges_wasm=e.ts_parser_included_ranges_wasm,Module._ts_language_type_is_named_wasm=_ts_language_type_is_named_wasm=e.ts_language_type_is_named_wasm,Module._ts_language_type_is_visible_wasm=_ts_language_type_is_visible_wasm=e.ts_language_type_is_visible_wasm,Module._ts_language_metadata_wasm=_ts_language_metadata_wasm=e.ts_language_metadata_wasm,Module._ts_language_supertypes_wasm=_ts_language_supertypes_wasm=e.ts_language_supertypes_wasm,Module._ts_language_subtypes_wasm=_ts_language_subtypes_wasm=e.ts_language_subtypes_wasm,Module._ts_tree_root_node_wasm=_ts_tree_root_node_wasm=e.ts_tree_root_node_wasm,Module._ts_tree_root_node_with_offset_wasm=_ts_tree_root_node_with_offset_wasm=e.ts_tree_root_node_with_offset_wasm,Module._ts_tree_edit_wasm=_ts_tree_edit_wasm=e.ts_tree_edit_wasm,Module._ts_tree_included_ranges_wasm=_ts_tree_included_ranges_wasm=e.ts_tree_included_ranges_wasm,Module._ts_tree_get_changed_ranges_wasm=_ts_tree_get_changed_ranges_wasm=e.ts_tree_get_changed_ranges_wasm,Module._ts_tree_cursor_new_wasm=_ts_tree_cursor_new_wasm=e.ts_tree_cursor_new_wasm,Module._ts_tree_cursor_copy_wasm=_ts_tree_cursor_copy_wasm=e.ts_tree_cursor_copy_wasm,Module._ts_tree_cursor_delete_wasm=_ts_tree_cursor_delete_wasm=e.ts_tree_cursor_delete_wasm,Module._ts_tree_cursor_reset_wasm=_ts_tree_cursor_reset_wasm=e.ts_tree_cursor_reset_wasm,Module._ts_tree_cursor_reset_to_wasm=_ts_tree_cursor_reset_to_wasm=e.ts_tree_cursor_reset_to_wasm,Module._ts_tree_cursor_goto_first_child_wasm=_ts_tree_cursor_goto_first_child_wasm=e.ts_tree_cursor_goto_first_child_wasm,Module._ts_tree_cursor_goto_last_child_wasm=_ts_tree_cursor_goto_last_child_wasm=e.ts_tree_cursor_goto_last_child_wasm,Module._ts_tree_cursor_goto_first_child_for_index_wasm=_ts_tree_cursor_goto_first_child_for_index_wasm=e.ts_tree_cursor_goto_first_child_for_index_wasm,Module._ts_tree_cursor_goto_first_child_for_position_wasm=_ts_tree_cursor_goto_first_child_for_position_wasm=e.ts_tree_cursor_goto_first_child_for_position_wasm,Module._ts_tree_cursor_goto_next_sibling_wasm=_ts_tree_cursor_goto_next_sibling_wasm=e.ts_tree_cursor_goto_next_sibling_wasm,Module._ts_tree_cursor_goto_previous_sibling_wasm=_ts_tree_cursor_goto_previous_sibling_wasm=e.ts_tree_cursor_goto_previous_sibling_wasm,Module._ts_tree_cursor_goto_descendant_wasm=_ts_tree_cursor_goto_descendant_wasm=e.ts_tree_cursor_goto_descendant_wasm,Module._ts_tree_cursor_goto_parent_wasm=_ts_tree_cursor_goto_parent_wasm=e.ts_tree_cursor_goto_parent_wasm,Module._ts_tree_cursor_current_node_type_id_wasm=_ts_tree_cursor_current_node_type_id_wasm=e.ts_tree_cursor_current_node_type_id_wasm,Module._ts_tree_cursor_current_node_state_id_wasm=_ts_tree_cursor_current_node_state_id_wasm=e.ts_tree_cursor_current_node_state_id_wasm,Module._ts_tree_cursor_current_node_is_named_wasm=_ts_tree_cursor_current_node_is_named_wasm=e.ts_tree_cursor_current_node_is_named_wasm,Module._ts_tree_cursor_current_node_is_missing_wasm=_ts_tree_cursor_current_node_is_missing_wasm=e.ts_tree_cursor_current_node_is_missing_wasm,Module._ts_tree_cursor_current_node_id_wasm=_ts_tree_cursor_current_node_id_wasm=e.ts_tree_cursor_current_node_id_wasm,Module._ts_tree_cursor_start_position_wasm=_ts_tree_cursor_start_position_wasm=e.ts_tree_cursor_start_position_wasm,Module._ts_tree_cursor_end_position_wasm=_ts_tree_cursor_end_position_wasm=e.ts_tree_cursor_end_position_wasm,Module._ts_tree_cursor_start_index_wasm=_ts_tree_cursor_start_index_wasm=e.ts_tree_cursor_start_index_wasm,Module._ts_tree_cursor_end_index_wasm=_ts_tree_cursor_end_index_wasm=e.ts_tree_cursor_end_index_wasm,Module._ts_tree_cursor_current_field_id_wasm=_ts_tree_cursor_current_field_id_wasm=e.ts_tree_cursor_current_field_id_wasm,Module._ts_tree_cursor_current_depth_wasm=_ts_tree_cursor_current_depth_wasm=e.ts_tree_cursor_current_depth_wasm,Module._ts_tree_cursor_current_descendant_index_wasm=_ts_tree_cursor_current_descendant_index_wasm=e.ts_tree_cursor_current_descendant_index_wasm,Module._ts_tree_cursor_current_node_wasm=_ts_tree_cursor_current_node_wasm=e.ts_tree_cursor_current_node_wasm,Module._ts_node_symbol_wasm=_ts_node_symbol_wasm=e.ts_node_symbol_wasm,Module._ts_node_field_name_for_child_wasm=_ts_node_field_name_for_child_wasm=e.ts_node_field_name_for_child_wasm,Module._ts_node_field_name_for_named_child_wasm=_ts_node_field_name_for_named_child_wasm=e.ts_node_field_name_for_named_child_wasm,Module._ts_node_children_by_field_id_wasm=_ts_node_children_by_field_id_wasm=e.ts_node_children_by_field_id_wasm,Module._ts_node_first_child_for_byte_wasm=_ts_node_first_child_for_byte_wasm=e.ts_node_first_child_for_byte_wasm,Module._ts_node_first_named_child_for_byte_wasm=_ts_node_first_named_child_for_byte_wasm=e.ts_node_first_named_child_for_byte_wasm,Module._ts_node_grammar_symbol_wasm=_ts_node_grammar_symbol_wasm=e.ts_node_grammar_symbol_wasm,Module._ts_node_child_count_wasm=_ts_node_child_count_wasm=e.ts_node_child_count_wasm,Module._ts_node_named_child_count_wasm=_ts_node_named_child_count_wasm=e.ts_node_named_child_count_wasm,Module._ts_node_child_wasm=_ts_node_child_wasm=e.ts_node_child_wasm,Module._ts_node_named_child_wasm=_ts_node_named_child_wasm=e.ts_node_named_child_wasm,Module._ts_node_child_by_field_id_wasm=_ts_node_child_by_field_id_wasm=e.ts_node_child_by_field_id_wasm,Module._ts_node_next_sibling_wasm=_ts_node_next_sibling_wasm=e.ts_node_next_sibling_wasm,Module._ts_node_prev_sibling_wasm=_ts_node_prev_sibling_wasm=e.ts_node_prev_sibling_wasm,Module._ts_node_next_named_sibling_wasm=_ts_node_next_named_sibling_wasm=e.ts_node_next_named_sibling_wasm,Module._ts_node_prev_named_sibling_wasm=_ts_node_prev_named_sibling_wasm=e.ts_node_prev_named_sibling_wasm,Module._ts_node_descendant_count_wasm=_ts_node_descendant_count_wasm=e.ts_node_descendant_count_wasm,Module._ts_node_parent_wasm=_ts_node_parent_wasm=e.ts_node_parent_wasm,Module._ts_node_child_with_descendant_wasm=_ts_node_child_with_descendant_wasm=e.ts_node_child_with_descendant_wasm,Module._ts_node_descendant_for_index_wasm=_ts_node_descendant_for_index_wasm=e.ts_node_descendant_for_index_wasm,Module._ts_node_named_descendant_for_index_wasm=_ts_node_named_descendant_for_index_wasm=e.ts_node_named_descendant_for_index_wasm,Module._ts_node_descendant_for_position_wasm=_ts_node_descendant_for_position_wasm=e.ts_node_descendant_for_position_wasm,Module._ts_node_named_descendant_for_position_wasm=_ts_node_named_descendant_for_position_wasm=e.ts_node_named_descendant_for_position_wasm,Module._ts_node_start_point_wasm=_ts_node_start_point_wasm=e.ts_node_start_point_wasm,Module._ts_node_end_point_wasm=_ts_node_end_point_wasm=e.ts_node_end_point_wasm,Module._ts_node_start_index_wasm=_ts_node_start_index_wasm=e.ts_node_start_index_wasm,Module._ts_node_end_index_wasm=_ts_node_end_index_wasm=e.ts_node_end_index_wasm,Module._ts_node_to_string_wasm=_ts_node_to_string_wasm=e.ts_node_to_string_wasm,Module._ts_node_children_wasm=_ts_node_children_wasm=e.ts_node_children_wasm,Module._ts_node_named_children_wasm=_ts_node_named_children_wasm=e.ts_node_named_children_wasm,Module._ts_node_descendants_of_type_wasm=_ts_node_descendants_of_type_wasm=e.ts_node_descendants_of_type_wasm,Module._ts_node_is_named_wasm=_ts_node_is_named_wasm=e.ts_node_is_named_wasm,Module._ts_node_has_changes_wasm=_ts_node_has_changes_wasm=e.ts_node_has_changes_wasm,Module._ts_node_has_error_wasm=_ts_node_has_error_wasm=e.ts_node_has_error_wasm,Module._ts_node_is_error_wasm=_ts_node_is_error_wasm=e.ts_node_is_error_wasm,Module._ts_node_is_missing_wasm=_ts_node_is_missing_wasm=e.ts_node_is_missing_wasm,Module._ts_node_is_extra_wasm=_ts_node_is_extra_wasm=e.ts_node_is_extra_wasm,Module._ts_node_parse_state_wasm=_ts_node_parse_state_wasm=e.ts_node_parse_state_wasm,Module._ts_node_next_parse_state_wasm=_ts_node_next_parse_state_wasm=e.ts_node_next_parse_state_wasm,Module._ts_query_matches_wasm=_ts_query_matches_wasm=e.ts_query_matches_wasm,Module._ts_query_captures_wasm=_ts_query_captures_wasm=e.ts_query_captures_wasm,Module._memset=_memset=e.memset,Module._memcpy=_memcpy=e.memcpy,Module._memmove=_memmove=e.memmove,Module._iswalpha=_iswalpha=e.iswalpha,Module._iswblank=_iswblank=e.iswblank,Module._iswdigit=_iswdigit=e.iswdigit,Module._iswlower=_iswlower=e.iswlower,Module._iswpunct=_iswpunct=e.iswpunct,Module._iswupper=_iswupper=e.iswupper,Module._iswxdigit=_iswxdigit=e.iswxdigit,Module._memchr=_memchr=e.memchr,__emscripten_timeout=e._emscripten_timeout,Module._strlen=_strlen=e.strlen,Module._strcmp=_strcmp=e.strcmp,Module._strncat=_strncat=e.strncat,Module._strncpy=_strncpy=e.strncpy,Module._towlower=_towlower=e.towlower,Module._towupper=_towupper=e.towupper,_setThrew=e.setThrew,__emscripten_stack_restore=e._emscripten_stack_restore,__emscripten_stack_alloc=e._emscripten_stack_alloc,_emscripten_stack_get_current=e.emscripten_stack_get_current,___wasm_apply_data_relocs=e.__wasm_apply_data_relocs}a(assignWasmExports,"assignWasmExports");var wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_high:___stack_high,__stack_low:___stack_low,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_setitimer_js:__setitimer_js,emscripten_resize_heap:_emscripten_resize_heap,invoke_i,invoke_iii,invoke_iiiij,invoke_vi,invoke_vii,memory:wasmMemory,proc_exit:_proc_exit,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback,tree_sitter_query_progress_callback:_tree_sitter_query_progress_callback};function invoke_vi(e,t){var r=stackSave();try{getWasmTableEntry(e)(t)}catch(_){if(stackRestore(r),_!==_+0)throw _;_setThrew(1,0)}}a(invoke_vi,"invoke_vi");function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}a(invoke_i,"invoke_i");function invoke_iii(e,t,r){var _=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(s){if(stackRestore(_),s!==s+0)throw s;_setThrew(1,0)}}a(invoke_iii,"invoke_iii");function invoke_vii(e,t,r){var _=stackSave();try{getWasmTableEntry(e)(t,r)}catch(s){if(stackRestore(_),s!==s+0)throw s;_setThrew(1,0)}}a(invoke_vii,"invoke_vii");function invoke_iiiij(e,t,r,_,s){var o=stackSave();try{return getWasmTableEntry(e)(t,r,_,s)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}a(invoke_iiiij,"invoke_iiiij");function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,_=stackAlloc((r+1)*4),s=_;e.forEach(l=>{LE_HEAP_STORE_U32((s>>2)*4,stringToUTF8OnStack(l)),s+=4}),LE_HEAP_STORE_U32((s>>2)*4,0);try{var o=t(r,_);return exitJS(o,!0),o}catch(l){return handleException(l)}}}a(callMain,"callMain");function run(e=arguments_){if(runDependencies>0){dependenciesFulfilled=run;return}if(preRun(),runDependencies>0){dependenciesFulfilled=run;return}function t(){if(Module.calledRun=!0,!ABORT){initRuntime(),readyPromiseResolve?.(Module),Module.onRuntimeInitialized?.();var r=Module.noInitialRun||!1;r||callMain(e),postRun()}}a(t,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}a(run,"run");var wasmExports;return wasmExports=await createWasm(),run(),runtimeInitialized?moduleRtn=Module:moduleRtn=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),moduleRtn}a(De,"Module");var le=De;var re=null;async function Re(e){if(re)return re;let{wasmModule:t,...r}=e??{};if(!t)return re??=await le(r);let _=new Promise((s,o)=>{r.instantiateWasm=(l,u)=>(WebAssembly.instantiate(t,l).then(m=>{u(m,t)}).catch(o),{})});return re??=await Promise.race([le(r),_])}a(Re,"initializeBinding");function xe(){return!!re}a(xe,"checkModule");var d,se;function de(e){let t=n._ts_language_abi_version(e[0]);if(t<ce||t>se)throw new Error(`Incompatible language version 0x${(t>>>0).toString(16)}. Expected 0x${se.toString(16)}.`)}a(de,"assertSupportedLanguage");var ce,Fe=D(e=>{n._ts_parser_delete(e[0]),n._free(e[1])}),ue=class{static{a(this,"Parser")}0=0;1=0;logCallback=null;language=null;static async init(t){we(await Re(t)),d=n._ts_init(),se=n.getValue(d,"i32"),ce=n.getValue(d+c,"i32")}constructor(){this.initialize(),Fe?.register(this,[this[0],this[1]],this)}initialize(){if(!xe())throw new Error("cannot construct a Parser before calling `init()`");n._ts_parser_new_wasm(),this[0]=n.getValue(d,"i32"),this[1]=n.getValue(d+c,"i32")}delete(){Fe?.unregister(this),n._ts_parser_delete(this[0]),n._free(this[1]),this[0]=0,this[1]=0}setLanguage(t){let r;if(!t)r=0,this.language=null;else if(t.constructor===Z)r=t[0],de(t),this.language=t;else throw new Error("Argument must be a Language");return n._ts_parser_set_language(this[0],r),this}parse(t,r,_){let s=He(_?.maxMemoryBytes);if(typeof t=="string")n.currentParseCallback=o=>t.slice(o);else if(typeof t=="function")n.currentParseCallback=t;else throw new Error("Argument must be a string or a function");_?.progressCallback?n.currentProgressCallback=_.progressCallback:n.currentProgressCallback=null,this.logCallback?(n.currentLogCallback=this.logCallback,n._ts_parser_enable_logger_wasm(this[0],1)):(n.currentLogCallback=null,n._ts_parser_enable_logger_wasm(this[0],0));try{let o=s===void 0?Qe(this[0],this[1],r?r[0]:0,_?.includedRanges):Be(this[0],this[1],_?.includedRanges,s);if(!o)return null;if(!this.language)throw new Error("Parser must have a language to parse");return new Y(x,o,this.language,n.currentParseCallback)}finally{Ge()}}reset(){n._ts_parser_reset(this[0])}getIncludedRanges(){n._ts_parser_included_ranges_wasm(this[0]);let t=n.getValue(d,"i32"),r=n.getValue(d+c,"i32"),_=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)_[o]=J(s),s+=j;n._free(r)}return _}setLogger(t){if(!t)this.logCallback=null;else{if(typeof t!="function")throw new Error("Logger callback must be a function");this.logCallback=t}return this}getLogger(){return this.logCallback}};function He(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<=0||e>2147483647))throw new RangeError("maxMemoryBytes must be a positive integer no greater than 2147483647");return e}a(He,"validateMemoryLimit");function Ce(e){if(!e?.length)return[0,0];let t=n._calloc(e.length,j);if(!t)return[0,e.length];let r=t;for(let _ of e)Me(r,_),r+=j;return[t,e.length]}a(Ce,"prepareRanges");function Qe(e,t,r,_){let[s,o]=Ce(_);return o&&!s?0:n._ts_parser_parse_wasm(e,t,r,s,o)}a(Qe,"parseOrdinaryWasm");function Be(e,t,r,_){if(!n.treeSitterSetMemoryLimit(_))return 0;let s=0;try{let[o,l]=Ce(r);if(s=o,l&&!o)return 0;try{return n._ts_parser_parse_limited_wasm(e,t,o,l)}catch(u){throw n._ts_parser_abort_limited_wasm(),u}}finally{s&&n._free(s),n.treeSitterSetMemoryLimit(0)}}a(Be,"parseLimitedWasm");function Ge(){n.currentParseCallback=null,n.currentLogCallback=null,n.currentProgressCallback=null}a(Ge,"clearCallbacks");var $e=1,je=2,ze=/[\w-]+/g,Ze={Zero:0,ZeroOrOne:1,ZeroOrMore:2,One:3,OneOrMore:4},Ne=a(e=>e.type==="capture","isCaptureStep"),ge=a(e=>e.type==="string","isStringStep"),U={Syntax:1,NodeName:2,FieldName:3,CaptureName:4,PatternStructure:5},z=class e extends Error{constructor(r,_,s,o){super(e.formatMessage(r,_));this.kind=r;this.info=_;this.index=s;this.length=o;this.name="QueryError"}kind;info;index;length;static{a(this,"QueryError")}static formatMessage(r,_){switch(r){case U.NodeName:return`Bad node name '${_.word}'`;case U.FieldName:return`Bad field name '${_.word}'`;case U.CaptureName:return`Bad capture name @${_.word}`;case U.PatternStructure:return`Bad pattern structure at offset ${_.suffix}`;case U.Syntax:return`Bad syntax at offset ${_.suffix}`}}};function Ke(e,t,r,_){if(e.length!==3)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected 2, got ${e.length-1}`);if(!Ne(e[1]))throw new Error(`First argument of \`#${r}\` predicate must be a capture. Got "${e[1].value}"`);let s=r==="eq?"||r==="any-eq?",o=!r.startsWith("any-");if(Ne(e[2])){let l=e[1].name,u=e[2].name;_[t].push(m=>{let w=[],f=[];for(let v of m)v.name===l&&w.push(v.node),v.name===u&&f.push(v.node);let g=a((v,b,C)=>C?v.text===b.text:v.text!==b.text,"compare");return o?w.every(v=>f.some(b=>g(v,b,s))):w.some(v=>f.some(b=>g(v,b,s)))})}else{let l=e[1].name,u=e[2].value,m=a(f=>f.text===u,"matches"),w=a(f=>f.text!==u,"doesNotMatch");_[t].push(f=>{let g=[];for(let b of f)b.name===l&&g.push(b.node);let v=s?m:w;return o?g.every(v):g.some(v)})}}a(Ke,"parseAnyPredicate");function Xe(e,t,r,_){if(e.length!==3)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected 2, got ${e.length-1}.`);if(e[1].type!=="capture")throw new Error(`First argument of \`#${r}\` predicate must be a capture. Got "${e[1].value}".`);if(e[2].type!=="string")throw new Error(`Second argument of \`#${r}\` predicate must be a string. Got @${e[2].name}.`);let s=r==="match?"||r==="any-match?",o=!r.startsWith("any-"),l=e[1].name,u=new RegExp(e[2].value);_[t].push(m=>{let w=[];for(let g of m)g.name===l&&w.push(g.node.text);let f=a((g,v)=>v?u.test(g):!u.test(g),"test");return w.length===0?!s:o?w.every(g=>f(g,s)):w.some(g=>f(g,s))})}a(Xe,"parseMatchPredicate");function Ye(e,t,r,_){if(e.length<2)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected at least 1. Got ${e.length-1}.`);if(e[1].type!=="capture")throw new Error(`First argument of \`#${r}\` predicate must be a capture. Got "${e[1].value}".`);let s=r==="any-of?",o=e[1].name,l=e.slice(2);if(!l.every(ge))throw new Error(`Arguments to \`#${r}\` predicate must be strings.".`);let u=l.map(m=>m.value);_[t].push(m=>{let w=[];for(let f of m)f.name===o&&w.push(f.node.text);return w.length===0?!s:w.every(f=>u.includes(f))===s})}a(Ye,"parseAnyOfPredicate");function Je(e,t,r,_,s){if(e.length<2||e.length>3)throw new Error(`Wrong number of arguments to \`#${r}\` predicate. Expected 1 or 2. Got ${e.length-1}.`);if(!e.every(ge))throw new Error(`Arguments to \`#${r}\` predicate must be strings.".`);let o=r==="is?"?_:s;o[t]||(o[t]={}),o[t][e[1].value]=e[2]?.value??null}a(Je,"parseIsPredicate");function et(e,t,r){if(e.length<2||e.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${e.length-1}.`);if(!e.every(ge))throw new Error('Arguments to `#set!` predicate must be strings.".');r[t]||(r[t]={}),r[t][e[1].value]=e[2]?.value??null}a(et,"parseSetDirective");function tt(e,t,r,_,s,o,l,u,m,w,f){if(t===$e){let g=_[r];o.push({type:"capture",name:g})}else if(t===je)o.push({type:"string",value:s[r]});else if(o.length>0){if(o[0].type!=="string")throw new Error("Predicates must begin with a literal value");let g=o[0].value;switch(g){case"any-not-eq?":case"not-eq?":case"any-eq?":case"eq?":Ke(o,e,g,l);break;case"any-not-match?":case"not-match?":case"any-match?":case"match?":Xe(o,e,g,l);break;case"not-any-of?":case"any-of?":Ye(o,e,g,l);break;case"is?":case"is-not?":Je(o,e,g,w,f);break;case"set!":et(o,e,m);break;default:u[e].push({operator:g,operands:o.slice(1)})}o.length=0}}a(tt,"parsePattern");var ke=D(e=>{n._ts_query_delete(e)}),me=class{static{a(this,"Query")}0=0;exceededMatchLimit;textPredicates;captureNames;captureQuantifiers;predicates;setProperties;assertedProperties;refutedProperties;matchLimit;constructor(t,r){de(t);let _=n.lengthBytesUTF8(r),s=n._malloc(_+1);n.stringToUTF8(r,s,_+1);let o=n._ts_query_new(t[0],s,_,d,d+c);if(!o){let p=n.getValue(d+c,"i32"),A=n.getValue(d,"i32"),y=n.UTF8ToString(s,A).length,R=r.slice(y,y+100).split(`
5
- `)[0],M=R.match(ze)?.[0]??"";switch(n._free(s),p){case U.Syntax:throw new z(U.Syntax,{suffix:`${y}: '${R}'...`},y,0);case U.NodeName:throw new z(p,{word:M},y,M.length);case U.FieldName:throw new z(p,{word:M},y,M.length);case U.CaptureName:throw new z(p,{word:M},y,M.length);case U.PatternStructure:throw new z(p,{suffix:`${y}: '${R}'...`},y,0)}}let l=n._ts_query_string_count(o),u=n._ts_query_capture_count(o),m=n._ts_query_pattern_count(o),w=new Array(u),f=new Array(m),g=new Array(l);for(let p=0;p<u;p++){let A=n._ts_query_capture_name_for_id(o,p,d),y=n.getValue(d,"i32");w[p]=n.UTF8ToString(A,y)}for(let p=0;p<m;p++){let A=new Array(u);for(let y=0;y<u;y++){let R=n._ts_query_capture_quantifier_for_id(o,p,y);A[y]=R}f[p]=A}for(let p=0;p<l;p++){let A=n._ts_query_string_value_for_id(o,p,d),y=n.getValue(d,"i32");g[p]=n.UTF8ToString(A,y)}let v=new Array(m),b=new Array(m),C=new Array(m),N=new Array(m),V=new Array(m);for(let p=0;p<m;p++){let A=n._ts_query_predicates_for_pattern(o,p,d),y=n.getValue(d,"i32");N[p]=[],V[p]=[];let R=new Array,M=A;for(let k=0;k<y;k++){let H=n.getValue(M,"i32");M+=c;let T=n.getValue(M,"i32");M+=c,tt(p,H,T,w,g,R,V,N,v,b,C)}Object.freeze(V[p]),Object.freeze(N[p]),Object.freeze(v[p]),Object.freeze(b[p]),Object.freeze(C[p])}n._free(s),this[0]=o,this.captureNames=w,this.captureQuantifiers=f,this.textPredicates=V,this.predicates=N,this.setProperties=v,this.assertedProperties=b,this.refutedProperties=C,this.exceededMatchLimit=!1,ke?.register(this,o,this)}delete(){ke?.unregister(this),n._ts_query_delete(this[0]),this[0]=0}matches(t,r={}){let _=r.startPosition??S,s=r.endPosition??S,o=r.startIndex??0,l=r.endIndex??0,u=r.startContainingPosition??S,m=r.endContainingPosition??S,w=r.startContainingIndex??0,f=r.endContainingIndex??0,g=r.matchLimit??4294967295,v=r.maxStartDepth??4294967295,b=r.progressCallback;if(typeof g!="number")throw new Error("Arguments must be numbers");if(this.matchLimit=g,l!==0&&o>l)throw new Error("`startIndex` cannot be greater than `endIndex`");if(s!==S&&(_.row>s.row||_.row===s.row&&_.column>s.column))throw new Error("`startPosition` cannot be greater than `endPosition`");if(f!==0&&w>f)throw new Error("`startContainingIndex` cannot be greater than `endContainingIndex`");if(m!==S&&(u.row>m.row||u.row===m.row&&u.column>m.column))throw new Error("`startContainingPosition` cannot be greater than `endContainingPosition`");b&&(n.currentQueryProgressCallback=b),h(t),n._ts_query_matches_wasm(this[0],t.tree[0],_.row,_.column,s.row,s.column,o,l,u.row,u.column,m.row,m.column,w,f,g,v);let C=n.getValue(d,"i32"),N=n.getValue(d+c,"i32"),V=n.getValue(d+2*c,"i32"),p=new Array(C);this.exceededMatchLimit=!!V;let A=0,y=N;for(let R=0;R<C;R++){let M=n.getValue(y,"i32");y+=c;let k=n.getValue(y,"i32");y+=c;let H=new Array(k);if(y=ie(this,t.tree,y,M,H),this.textPredicates[M].every(T=>T(H))){p[A]={patternIndex:M,captures:H};let T=this.setProperties[M];p[A].setProperties=T;let B=this.assertedProperties[M];p[A].assertedProperties=B;let G=this.refutedProperties[M];p[A].refutedProperties=G,A++}}return p.length=A,n._ts_free_wasm(N),n.currentQueryProgressCallback=null,p}captures(t,r={}){let _=r.startPosition??S,s=r.endPosition??S,o=r.startIndex??0,l=r.endIndex??0,u=r.startContainingPosition??S,m=r.endContainingPosition??S,w=r.startContainingIndex??0,f=r.endContainingIndex??0,g=r.matchLimit??4294967295,v=r.maxStartDepth??4294967295,b=r.progressCallback;if(typeof g!="number")throw new Error("Arguments must be numbers");if(this.matchLimit=g,l!==0&&o>l)throw new Error("`startIndex` cannot be greater than `endIndex`");if(s!==S&&(_.row>s.row||_.row===s.row&&_.column>s.column))throw new Error("`startPosition` cannot be greater than `endPosition`");if(f!==0&&w>f)throw new Error("`startContainingIndex` cannot be greater than `endContainingIndex`");if(m!==S&&(u.row>m.row||u.row===m.row&&u.column>m.column))throw new Error("`startContainingPosition` cannot be greater than `endContainingPosition`");b&&(n.currentQueryProgressCallback=b),h(t),n._ts_query_captures_wasm(this[0],t.tree[0],_.row,_.column,s.row,s.column,o,l,u.row,u.column,m.row,m.column,w,f,g,v);let C=n.getValue(d,"i32"),N=n.getValue(d+c,"i32"),V=n.getValue(d+2*c,"i32"),p=new Array;this.exceededMatchLimit=!!V;let A=new Array,y=N;for(let R=0;R<C;R++){let M=n.getValue(y,"i32");y+=c;let k=n.getValue(y,"i32");y+=c;let H=n.getValue(y,"i32");if(y+=c,A.length=k,y=ie(this,t.tree,y,M,A),this.textPredicates[M].every(T=>T(A))){let T=A[H],B=this.setProperties[M];T.setProperties=B;let G=this.assertedProperties[M];T.assertedProperties=G;let fe=this.refutedProperties[M];T.refutedProperties=fe,p.push(T)}}return n._ts_free_wasm(N),n.currentQueryProgressCallback=null,p}predicatesForPattern(t){return this.predicates[t]}disableCapture(t){let r=n.lengthBytesUTF8(t),_=n._malloc(r+1);n.stringToUTF8(t,_,r+1),n._ts_query_disable_capture(this[0],_,r),n._free(_)}disablePattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);n._ts_query_disable_pattern(this[0],t)}didExceedMatchLimit(){return this.exceededMatchLimit}startIndexForPattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);return n._ts_query_start_byte_for_pattern(this[0],t)}endIndexForPattern(t){if(t>=this.predicates.length)throw new Error(`Pattern index is ${t} but the pattern count is ${this.predicates.length}`);return n._ts_query_end_byte_for_pattern(this[0],t)}patternCount(){return n._ts_query_pattern_count(this[0])}captureIndexForName(t){return this.captureNames.indexOf(t)}isPatternRooted(t){return n._ts_query_is_pattern_rooted(this[0],t)===1}isPatternNonLocal(t){return n._ts_query_is_pattern_non_local(this[0],t)===1}isPatternGuaranteedAtStep(t){return n._ts_query_is_pattern_guaranteed_at_step(this[0],t)===1}};export{Ze as CaptureQuantifier,ae as Edit,se as LANGUAGE_VERSION,Z as Language,X as LookaheadIterator,ce as MIN_COMPATIBLE_VERSION,te as Node,ue as Parser,me as Query,Y as Tree,ee as TreeCursor};
3
+ ${l}`)}let o=s.clone();try{r=await WebAssembly.compileStreaming(s)}catch(l){console.error("wasm streaming compile failed:",l),console.error("falling back to ArrayBuffer instantiation"),r=new Uint8Array(await o.arrayBuffer())}}let n=await _.loadWebAssemblyModule(r,{loadAsync:!0});return oe(n,{sync:!1})}static loadSync(t){let r=_.loadWebAssemblyModule(t,{loadAsync:!1});return oe(r,{sync:!0})}};function oe(e,{sync:t}){let r=Object.keys(e),n=r.find(o=>Se.test(o)&&!o.includes("external_scanner_"));if(!n)throw console.log(`Couldn't find language function in Wasm file. Symbols:
4
+ ${JSON.stringify(r,null,2)}`),new Error(`Language.${t?"loadSync":"load"} failed: no language function found in Wasm file`);let s=e[n]();return new N(p,s)}a(oe,"loadFromWasmExports");async function Ne(moduleArg={}){var moduleRtn,Module=moduleArg,ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof WorkerGlobalScope<"u",ENVIRONMENT_IS_NODE=!1;if(ENVIRONMENT_IS_NODE){let{createRequire:e}=await Promise.resolve().then(()=>(ue(),de));var require=e(import.meta.url)}Module.currentProgressCallback=null,Module.currentLogCallback=null,Module.currentParseCallback=null,Module.treeSitterSetMemoryLimit=function(e){return e?wasmMemory.buffer.byteLength>e||Module.treeSitterOriginalMemoryGrow?!1:(Module.treeSitterOriginalMemoryGrow=wasmMemory.grow,wasmMemory.grow=function(t){if(wasmMemory.buffer.byteLength+t*65536>e)throw new RangeError("Parse memory limit exceeded");return Module.treeSitterOriginalMemoryGrow.call(wasmMemory,t)},!0):(Module.treeSitterOriginalMemoryGrow&&(wasmMemory.grow=Module.treeSitterOriginalMemoryGrow,Module.treeSitterOriginalMemoryGrow=null),!0)};var arguments_=[],thisProgram="./this.program",quit_=a((e,t)=>{throw t},"quit_"),_scriptName=import.meta.url,scriptDirectory="";function locateFile(e){return Module.locateFile?Module.locateFile(e,scriptDirectory):scriptDirectory+e}a(locateFile,"locateFile");var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("fs");_scriptName.startsWith("file:")&&(scriptDirectory=require("path").dirname(require("url").fileURLToPath(_scriptName))+"/"),readBinary=a(e=>{e=isFileURI(e)?new URL(e):e;var t=fs.readFileSync(e);return t},"readBinary"),readAsync=a(async(e,t=!0)=>{e=isFileURI(e)?new URL(e):e;var r=fs.readFileSync(e,t?void 0:"utf8");return r},"readAsync"),(void 0).argv.length>1&&(thisProgram=(void 0).argv[1].replace(/\\/g,"/")),arguments_=(void 0).argv.slice(2),quit_=a((e,t)=>{throw(void 0).exitCode=e,t},"quit_")}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}ENVIRONMENT_IS_WORKER&&(readBinary=a(e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)},"readBinary")),readAsync=a(async e=>{if(isFileURI(e))return new Promise((r,n)=>{var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="arraybuffer",s.onload=()=>{if(s.status==200||s.status==0&&s.response){r(s.response);return}n(s.status)},s.onerror=n,s.send(null)});var t=await fetch(e,{credentials:"same-origin"});if(t.ok)return t.arrayBuffer();throw new Error(t.status+" : "+t.url)},"readAsync")}var out=console.log.bind(console),err=console.error.bind(console),dynamicLibraries=[],wasmBinary,ABORT=!1,EXITSTATUS,isFileURI=a(e=>e.startsWith("file://"),"isFileURI"),readyPromiseResolve,readyPromiseReject,wasmMemory,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64,HEAP64,HEAPU64,HEAP_DATA_VIEW,runtimeInitialized=!1;function updateMemoryViews(){var e=wasmMemory.buffer;Module.HEAP8=HEAP8=new Int8Array(e),Module.HEAP16=HEAP16=new Int16Array(e),Module.HEAPU8=HEAPU8=new Uint8Array(e),Module.HEAPU16=HEAPU16=new Uint16Array(e),Module.HEAP32=HEAP32=new Int32Array(e),Module.HEAPU32=HEAPU32=new Uint32Array(e),Module.HEAPF32=HEAPF32=new Float32Array(e),Module.HEAPF64=HEAPF64=new Float64Array(e),Module.HEAP64=HEAP64=new BigInt64Array(e),Module.HEAPU64=HEAPU64=new BigUint64Array(e),Module.HEAP_DATA_VIEW=HEAP_DATA_VIEW=new DataView(e),LE_HEAP_UPDATE()}a(updateMemoryViews,"updateMemoryViews");function initMemory(){if(Module.wasmMemory)wasmMemory=Module.wasmMemory;else{var e=Module.INITIAL_MEMORY||33554432;wasmMemory=new WebAssembly.Memory({initial:e/65536,maximum:32768})}updateMemoryViews()}a(initMemory,"initMemory");var __RELOC_FUNCS__=[];function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(onPreRuns)}a(preRun,"preRun");function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),wasmExports.__wasm_call_ctors(),callRuntimeCallbacks(onPostCtors)}a(initRuntime,"initRuntime");function preMain(){}a(preMain,"preMain");function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(onPostRuns)}a(postRun,"postRun");function abort(e){Module.onAbort?.(e),e="Aborted("+e+")",err(e),ABORT=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw readyPromiseReject?.(t),t}a(abort,"abort");var wasmBinaryFile;function findWasmBinary(){return Module.locateFile?locateFile("web-tree-sitter.wasm"):new URL("web-tree-sitter.wasm",import.meta.url).href}a(findWasmBinary,"findWasmBinary");function getBinarySync(e){if(e==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(e);throw"both async and sync fetching of the wasm failed"}a(getBinarySync,"getBinarySync");async function getWasmBinary(e){if(!wasmBinary)try{var t=await readAsync(e);return new Uint8Array(t)}catch{}return getBinarySync(e)}a(getWasmBinary,"getWasmBinary");async function instantiateArrayBuffer(e,t){try{var r=await getWasmBinary(e),n=await WebAssembly.instantiate(r,t);return n}catch(s){err(`failed to asynchronously prepare wasm: ${s}`),abort(s)}}a(instantiateArrayBuffer,"instantiateArrayBuffer");async function instantiateAsync(e,t,r){if(!e&&!isFileURI(t)&&!ENVIRONMENT_IS_NODE)try{var n=fetch(t,{credentials:"same-origin"}),s=await WebAssembly.instantiateStreaming(n,r);return s}catch(o){err(`wasm streaming compile failed: ${o}`),err("falling back to ArrayBuffer instantiation")}return instantiateArrayBuffer(t,r)}a(instantiateAsync,"instantiateAsync");function getWasmImports(){return{env:wasmImports,wasi_snapshot_preview1:wasmImports,"GOT.mem":new Proxy(wasmImports,GOTHandler),"GOT.func":new Proxy(wasmImports,GOTHandler)}}a(getWasmImports,"getWasmImports");async function createWasm(){function e(o,l){wasmExports=o.exports,wasmExports=relocateExports(wasmExports,1024);var c=getDylinkMetadata(l);c.neededDynlibs&&(dynamicLibraries=c.neededDynlibs.concat(dynamicLibraries));let f={malloc:wasmExports.ts_scanner_malloc_wasm,calloc:wasmExports.ts_scanner_calloc_wasm,realloc:wasmExports.ts_scanner_realloc_wasm};return Object.assign(wasmImports,f),updateGOT(f,!0),mergeLibSymbols(wasmExports,"main"),LDSO.init(),loadDylibs(),__RELOC_FUNCS__.push(wasmExports.__wasm_apply_data_relocs),assignWasmExports(wasmExports),wasmExports}a(e,"receiveInstance");function t(o){return e(o.instance,o.module)}a(t,"receiveInstantiationResult");var r=getWasmImports();if(Module.instantiateWasm)return new Promise((o,l)=>{Module.instantiateWasm(r,(c,f)=>{o(e(c,f))})});wasmBinaryFile??=findWasmBinary();var n=await instantiateAsync(wasmBinary,wasmBinaryFile,r),s=t(n);return s}a(createWasm,"createWasm");class ExitStatus{static{a(this,"ExitStatus")}name="ExitStatus";constructor(t){this.message=`Program terminated with exit(${t})`,this.status=t}}var GOT={},currentModuleWeakSymbols=new Set([]),GOTHandler={get(e,t){var r=GOT[t];return r||(r=GOT[t]=new WebAssembly.Global({value:"i32",mutable:!0})),currentModuleWeakSymbols.has(t)||(r.required=!0),r}},LE_ATOMICS_NATIVE_BYTE_ORDER=[],LE_HEAP_LOAD_F32=a(e=>HEAP_DATA_VIEW.getFloat32(e,!0),"LE_HEAP_LOAD_F32"),LE_HEAP_LOAD_F64=a(e=>HEAP_DATA_VIEW.getFloat64(e,!0),"LE_HEAP_LOAD_F64"),LE_HEAP_LOAD_I16=a(e=>HEAP_DATA_VIEW.getInt16(e,!0),"LE_HEAP_LOAD_I16"),LE_HEAP_LOAD_I32=a(e=>HEAP_DATA_VIEW.getInt32(e,!0),"LE_HEAP_LOAD_I32"),LE_HEAP_LOAD_I64=a(e=>HEAP_DATA_VIEW.getBigInt64(e,!0),"LE_HEAP_LOAD_I64"),LE_HEAP_LOAD_U32=a(e=>HEAP_DATA_VIEW.getUint32(e,!0),"LE_HEAP_LOAD_U32"),LE_HEAP_STORE_F32=a((e,t)=>HEAP_DATA_VIEW.setFloat32(e,t,!0),"LE_HEAP_STORE_F32"),LE_HEAP_STORE_F64=a((e,t)=>HEAP_DATA_VIEW.setFloat64(e,t,!0),"LE_HEAP_STORE_F64"),LE_HEAP_STORE_I16=a((e,t)=>HEAP_DATA_VIEW.setInt16(e,t,!0),"LE_HEAP_STORE_I16"),LE_HEAP_STORE_I32=a((e,t)=>HEAP_DATA_VIEW.setInt32(e,t,!0),"LE_HEAP_STORE_I32"),LE_HEAP_STORE_I64=a((e,t)=>HEAP_DATA_VIEW.setBigInt64(e,t,!0),"LE_HEAP_STORE_I64"),LE_HEAP_STORE_U32=a((e,t)=>HEAP_DATA_VIEW.setUint32(e,t,!0),"LE_HEAP_STORE_U32"),callRuntimeCallbacks=a(e=>{for(;e.length>0;)e.shift()(Module)},"callRuntimeCallbacks"),onPostRuns=[],addOnPostRun=a(e=>onPostRuns.push(e),"addOnPostRun"),onPreRuns=[],addOnPreRun=a(e=>onPreRuns.push(e),"addOnPreRun"),UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder:void 0,findStringEnd=a((e,t,r,n)=>{var s=t+r;if(n)return s;for(;e[t]&&!(t>=s);)++t;return t},"findStringEnd"),UTF8ArrayToString=a((e,t=0,r,n)=>{var s=findStringEnd(e,t,r,n);if(s-t>16&&e.buffer&&UTF8Decoder)return UTF8Decoder.decode(e.subarray(t,s));for(var o="";t<s;){var l=e[t++];if(!(l&128)){o+=String.fromCharCode(l);continue}var c=e[t++]&63;if((l&224)==192){o+=String.fromCharCode((l&31)<<6|c);continue}var f=e[t++]&63;if((l&240)==224?l=(l&15)<<12|c<<6|f:l=(l&7)<<18|c<<12|f<<6|e[t++]&63,l<65536)o+=String.fromCharCode(l);else{var E=l-65536;o+=String.fromCharCode(55296|E>>10,56320|E&1023)}}return o},"UTF8ArrayToString"),getDylinkMetadata=a(e=>{var t=0,r=0;function n(){return e[t++]}a(n,"getU8");function s(){for(var I=0,k=1;;){var Q=e[t++];if(I+=(Q&127)*k,k*=128,!(Q&128))break}return I}a(s,"getLEB");function o(){var I=s();return t+=I,UTF8ArrayToString(e,t-I,I)}a(o,"getString");function l(){for(var I=s(),k=[];I--;)k.push(o());return k}a(l,"getStringList");function c(I,k){if(I)throw new Error(k)}if(a(c,"failIf"),e instanceof WebAssembly.Module){var f=WebAssembly.Module.customSections(e,"dylink.0");c(f.length===0,"need dylink section"),e=new Uint8Array(f[0]),r=e.length}else{var E=new Uint32Array(new Uint8Array(e.subarray(0,24)).buffer),w=E[0]==1836278016||E[0]==6386541;c(!w,"need to see wasm magic number"),c(e[8]!==0,"need the dylink section to be first"),t=9;var v=s();r=t+v;var he=o();c(he!=="dylink.0")}for(var P={neededDynlibs:[],tlsExports:new Set,weakImports:new Set,runtimePaths:[]},we=1,be=2,pe=3,ye=4,ve=5,Me=256,Ae=3,Ee=1;t<r;){var O=n(),Ie=s();if(O===we)P.memorySize=s(),P.memoryAlign=s(),P.tableSize=s(),P.tableAlign=s();else if(O===be)P.neededDynlibs=l();else if(O===pe)for(var j=s();j--;){var z=o(),Z=s();Z&Me&&P.tlsExports.add(z)}else if(O===ye)for(var j=s();j--;){var He=o(),z=o(),Z=s();(Z&Ae)==Ee&&P.weakImports.add(z)}else O===ve?P.runtimePaths=l():t+=Ie}return P},"getDylinkMetadata");function getValue(e,t="i8"){switch(t.endsWith("*")&&(t="*"),t){case"i1":return HEAP8[e];case"i8":return HEAP8[e];case"i16":return LE_HEAP_LOAD_I16((e>>1)*2);case"i32":return LE_HEAP_LOAD_I32((e>>2)*4);case"i64":return LE_HEAP_LOAD_I64((e>>3)*8);case"float":return LE_HEAP_LOAD_F32((e>>2)*4);case"double":return LE_HEAP_LOAD_F64((e>>3)*8);case"*":return LE_HEAP_LOAD_U32((e>>2)*4);default:abort(`invalid type for getValue: ${t}`)}}a(getValue,"getValue");var newDSO=a((e,t,r)=>{var n={refcount:1/0,name:e,exports:r,global:!0};return LDSO.loadedLibsByName[e]=n,t!=null&&(LDSO.loadedLibsByHandle[t]=n),n},"newDSO"),LDSO={loadedLibsByName:{},loadedLibsByHandle:{},init(){newDSO("__main__",0,wasmImports)}},___heap_base=82672,alignMemory=a((e,t)=>Math.ceil(e/t)*t,"alignMemory"),getMemory=a(e=>{if(runtimeInitialized)return _calloc(e,1);var t=___heap_base,r=t+alignMemory(e,16);return ___heap_base=r,GOT.__heap_base.value=r,t},"getMemory"),isInternalSym=a(e=>["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm","__start_em_js","__stop_em_js"].includes(e)||e.startsWith("__em_js__"),"isInternalSym"),uleb128EncodeWithLen=a(e=>{let t=e.length;return[t%128|128,t>>7,...e]},"uleb128EncodeWithLen"),wasmTypeCodes={i:127,p:127,j:126,f:125,d:124,e:111},generateTypePack=a(e=>uleb128EncodeWithLen(Array.from(e,t=>{var r=wasmTypeCodes[t];return r})),"generateTypePack"),convertJsFunctionToWasm=a((e,t)=>{var r=Uint8Array.of(0,97,115,109,1,0,0,0,1,...uleb128EncodeWithLen([1,96,...generateTypePack(t.slice(1)),...generateTypePack(t[0]==="v"?"":t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),n=new WebAssembly.Module(r),s=new WebAssembly.Instance(n,{e:{f:e}}),o=s.exports.f;return o},"convertJsFunctionToWasm"),wasmTableMirror=[],wasmTable=new WebAssembly.Table({initial:44,element:"anyfunc"}),getWasmTableEntry=a(e=>{var t=wasmTableMirror[e];return t||(wasmTableMirror[e]=t=wasmTable.get(e)),t},"getWasmTableEntry"),updateTableMap=a((e,t)=>{if(functionsInTableMap)for(var r=e;r<e+t;r++){var n=getWasmTableEntry(r);n&&functionsInTableMap.set(n,r)}},"updateTableMap"),functionsInTableMap,getFunctionAddress=a(e=>(functionsInTableMap||(functionsInTableMap=new WeakMap,updateTableMap(0,wasmTable.length)),functionsInTableMap.get(e)||0),"getFunctionAddress"),freeTableIndexes=[],getEmptyTableSlot=a(()=>freeTableIndexes.length?freeTableIndexes.pop():wasmTable.grow(1),"getEmptyTableSlot"),setWasmTableEntry=a((e,t)=>{wasmTable.set(e,t),wasmTableMirror[e]=wasmTable.get(e)},"setWasmTableEntry"),addFunction=a((e,t)=>{var r=getFunctionAddress(e);if(r)return r;var n=getEmptyTableSlot();try{setWasmTableEntry(n,e)}catch(o){if(!(o instanceof TypeError))throw o;var s=convertJsFunctionToWasm(e,t);setWasmTableEntry(n,s)}return functionsInTableMap.set(e,n),n},"addFunction"),updateGOT=a((e,t)=>{for(var r in e)if(!isInternalSym(r)){var n=e[r];GOT[r]||=new WebAssembly.Global({value:"i32",mutable:!0}),(t||GOT[r].value==0)&&(typeof n=="function"?GOT[r].value=addFunction(n):typeof n=="number"?GOT[r].value=n:err(`unhandled export type for '${r}': ${typeof n}`))}},"updateGOT"),relocateExports=a((e,t,r)=>{var n={};for(var s in e){var o=e[s];typeof o=="object"&&(o=o.value),typeof o=="number"&&(o+=t),n[s]=o}return updateGOT(n,r),n},"relocateExports"),isSymbolDefined=a(e=>{var t=wasmImports[e];return!(!t||t.stub)},"isSymbolDefined"),dynCall=a((e,t,r=[],n=!1)=>{var s=getWasmTableEntry(t),o=s(...r);function l(c){return c}return a(l,"convert"),o},"dynCall"),stackSave=a(()=>_emscripten_stack_get_current(),"stackSave"),stackRestore=a(e=>__emscripten_stack_restore(e),"stackRestore"),createInvokeFunction=a(e=>(t,...r)=>{var n=stackSave();try{return dynCall(e,t,r)}catch(s){if(stackRestore(n),s!==s+0)throw s;if(_setThrew(1,0),e[0]=="j")return 0n}},"createInvokeFunction"),resolveGlobalSymbol=a((e,t=!1)=>{var r;return isSymbolDefined(e)?r=wasmImports[e]:e.startsWith("invoke_")&&(r=wasmImports[e]=createInvokeFunction(e.split("_")[1])),{sym:r,name:e}},"resolveGlobalSymbol"),onPostCtors=[],addOnPostCtor=a(e=>onPostCtors.push(e),"addOnPostCtor"),UTF8ToString=a((e,t,r)=>e?UTF8ArrayToString(HEAPU8,e,t,r):"","UTF8ToString"),loadWebAssemblyModule=a((binary,flags,libName,localScope,handle)=>{var metadata=getDylinkMetadata(binary);function loadModule(){var memAlign=Math.pow(2,metadata.memoryAlign),memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;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)),metadata.tableSize&&wasmTable.grow(metadata.tableSize);var moduleExports;function resolveSymbol(e){var t=resolveGlobalSymbol(e).sym;return!t&&localScope&&(t=localScope[e]),t||(t=moduleExports[e]),t}a(resolveSymbol,"resolveSymbol");var proxyHandler={get(e,t){switch(t){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(t in wasmImports&&!wasmImports[t].stub){var r=wasmImports[t];return r}if(!(t in e)){var n;e[t]=(...s)=>(n||=resolveSymbol(t),n(...s))}return e[t]}},proxy=new Proxy({},proxyHandler);currentModuleWeakSymbols=metadata.weakImports;var info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(module,instance){updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols();function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func=`(${args}) => { ${body} };`;ASM_CONSTS[start]=eval(func)}if(a(addEmAsm,"addEmAsm"),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;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)}a(addEmJs,"addEmJs");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;applyRelocs&&(runtimeInitialized?applyRelocs():__RELOC_FUNCS__.push(applyRelocs));var init=moduleExports.__wasm_call_ctors;return init&&(runtimeInitialized?init():addOnPostCtor(init)),moduleExports}if(a(postInstantiation,"postInstantiation"),flags.loadAsync)return(async()=>{var e;return binary instanceof WebAssembly.Module?e=await WebAssembly.instantiate(binary,info):{module:binary,instance:e}=await WebAssembly.instantiate(binary,info),postInstantiation(binary,e)})();var module=binary instanceof WebAssembly.Module?binary:new WebAssembly.Module(binary),instance=new WebAssembly.Instance(module,info);return postInstantiation(module,instance)}return a(loadModule,"loadModule"),flags={...flags,rpath:{parentLibPath:libName,paths:metadata.runtimePaths}},flags.loadAsync?metadata.neededDynlibs.reduce((e,t)=>e.then(()=>loadDynamicLibrary(t,flags,localScope)),Promise.resolve()).then(loadModule):(metadata.neededDynlibs.forEach(e=>loadDynamicLibrary(e,flags,localScope)),loadModule())},"loadWebAssemblyModule"),mergeLibSymbols=a((e,t)=>{for(var[r,n]of Object.entries(e)){let s=a(l=>{isSymbolDefined(l)||(wasmImports[l]=n)},"setImport");s(r);let o="__main_argc_argv";r=="main"&&s(o),r==o&&s("main")}},"mergeLibSymbols"),asyncLoad=a(async e=>{var t=await readAsync(e);return new Uint8Array(t)},"asyncLoad");function loadDynamicLibrary(e,t={global:!0,nodelete:!0},r,n){var s=LDSO.loadedLibsByName[e];if(s)return t.global?s.global||(s.global=!0,mergeLibSymbols(s.exports,e)):r&&Object.assign(r,s.exports),t.nodelete&&s.refcount!==1/0&&(s.refcount=1/0),s.refcount++,n&&(LDSO.loadedLibsByHandle[n]=s),t.loadAsync?Promise.resolve(!0):!0;s=newDSO(e,n,"loading"),s.refcount=t.nodelete?1/0:1,s.global=t.global;function o(){if(n){var f=LE_HEAP_LOAD_U32((n+28>>2)*4),E=LE_HEAP_LOAD_U32((n+32>>2)*4);if(f&&E){var w=HEAP8.slice(f,f+E);return t.loadAsync?Promise.resolve(w):w}}var v=locateFile(e);if(t.loadAsync)return asyncLoad(v);if(!readBinary)throw new Error(`${v}: file not found, and synchronous loading of external files is not available`);return readBinary(v)}a(o,"loadLibData");function l(){return t.loadAsync?o().then(f=>loadWebAssemblyModule(f,t,e,r,n)):loadWebAssemblyModule(o(),t,e,r,n)}a(l,"getExports");function c(f){s.global?mergeLibSymbols(f,e):r&&Object.assign(r,f),s.exports=f}return a(c,"moduleLoaded"),t.loadAsync?l().then(f=>(c(f),!0)):(c(l()),!0)}a(loadDynamicLibrary,"loadDynamicLibrary");var reportUndefinedSymbols=a(()=>{for(var[e,t]of Object.entries(GOT))if(t.value==0){var r=resolveGlobalSymbol(e,!0).sym;if(!r&&!t.required)continue;if(typeof r=="function")t.value=addFunction(r,r.sig);else if(typeof r=="number")t.value=r;else throw new Error(`bad export type for '${e}': ${typeof r}`)}},"reportUndefinedSymbols"),runDependencies=0,dependenciesFulfilled=null,removeRunDependency=a(e=>{if(runDependencies--,Module.monitorRunDependencies?.(runDependencies),runDependencies==0&&dependenciesFulfilled){var t=dependenciesFulfilled;dependenciesFulfilled=null,t()}},"removeRunDependency"),addRunDependency=a(e=>{runDependencies++,Module.monitorRunDependencies?.(runDependencies)},"addRunDependency"),loadDylibs=a(async()=>{if(!dynamicLibraries.length){reportUndefinedSymbols();return}addRunDependency("loadDylibs");for(var e of dynamicLibraries)await loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0});reportUndefinedSymbols(),removeRunDependency("loadDylibs")},"loadDylibs"),noExitRuntime=!0;function setValue(e,t,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":HEAP8[e]=t;break;case"i8":HEAP8[e]=t;break;case"i16":LE_HEAP_STORE_I16((e>>1)*2,t);break;case"i32":LE_HEAP_STORE_I32((e>>2)*4,t);break;case"i64":LE_HEAP_STORE_I64((e>>3)*8,BigInt(t));break;case"float":LE_HEAP_STORE_F32((e>>2)*4,t);break;case"double":LE_HEAP_STORE_F64((e>>3)*8,t);break;case"*":LE_HEAP_STORE_U32((e>>2)*4,t);break;default:abort(`invalid type for setValue: ${r}`)}}a(setValue,"setValue");var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_high=82672,___stack_low=17136,___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},82672),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),__abort_js=a(()=>abort(""),"__abort_js");__abort_js.sig="v";var runtimeKeepaliveCounter=0,__emscripten_runtime_keepalive_clear=a(()=>{noExitRuntime=!1,runtimeKeepaliveCounter=0},"__emscripten_runtime_keepalive_clear");__emscripten_runtime_keepalive_clear.sig="v";var __emscripten_throw_longjmp=a(()=>{throw 1/0},"__emscripten_throw_longjmp");__emscripten_throw_longjmp.sig="v";var timers={},handleException=a(e=>{if(e instanceof ExitStatus||e=="unwind")return EXITSTATUS;quit_(1,e)},"handleException"),keepRuntimeAlive=a(()=>noExitRuntime||runtimeKeepaliveCounter>0,"keepRuntimeAlive"),_proc_exit=a(e=>{EXITSTATUS=e,keepRuntimeAlive()||(Module.onExit?.(e),ABORT=!0),quit_(e,new ExitStatus(e))},"_proc_exit");_proc_exit.sig="vi";var exitJS=a((e,t)=>{EXITSTATUS=e,_proc_exit(e)},"exitJS"),_exit=exitJS;_exit.sig="vi";var maybeExit=a(()=>{if(!keepRuntimeAlive())try{_exit(EXITSTATUS)}catch(e){handleException(e)}},"maybeExit"),callUserCallback=a(e=>{if(!ABORT)try{e(),maybeExit()}catch(t){handleException(t)}},"callUserCallback"),_emscripten_get_now=a(()=>performance.now(),"_emscripten_get_now");_emscripten_get_now.sig="d";var __setitimer_js=a((e,t)=>{if(timers[e]&&(clearTimeout(timers[e].id),delete timers[e]),!t)return 0;var r=setTimeout(()=>{delete timers[e],callUserCallback(()=>__emscripten_timeout(e,_emscripten_get_now()))},t);return timers[e]={id:r,timeout_ms:t},0},"__setitimer_js");__setitimer_js.sig="iid";var getHeapMax=a(()=>2147483648,"getHeapMax"),growMemory=a(e=>{var t=wasmMemory.buffer.byteLength,r=(e-t+65535)/65536|0;try{return wasmMemory.grow(r),updateMemoryViews(),1}catch{}},"growMemory"),_emscripten_resize_heap=a(e=>{var t=HEAPU8.length;e>>>=0;var r=getHeapMax();if(e>r)return!1;for(var n=1;n<=4;n*=2){var s=t*(1+0/n);s=Math.min(s,e+100663296);var o=Math.min(r,alignMemory(Math.max(e,s),65536)),l=growMemory(o);if(l)return!0}return!1},"_emscripten_resize_heap");_emscripten_resize_heap.sig="ip";function _tree_sitter_log_callback(e,t){if(Module.currentLogCallback){let r=UTF8ToString(t);Module.currentLogCallback(r,e!==0)}}a(_tree_sitter_log_callback,"_tree_sitter_log_callback");function _tree_sitter_parse_callback(e,t,r,n,s){let l=Module.currentParseCallback(t,{row:r,column:n});typeof l=="string"?(setValue(s,l.length,"i32"),stringToUTF16(l,e,10240)):setValue(s,0,"i32")}a(_tree_sitter_parse_callback,"_tree_sitter_parse_callback");function _tree_sitter_progress_callback(e,t){return Module.currentProgressCallback?Module.currentProgressCallback({currentOffset:e,hasError:t!==0})===!0:!1}a(_tree_sitter_progress_callback,"_tree_sitter_progress_callback");var lengthBytesUTF8=a(e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:n>=55296&&n<=57343?(t+=4,++r):t+=3}return t},"lengthBytesUTF8"),stringToUTF8Array=a((e,t,r,n)=>{if(!(n>0))return 0;for(var s=r,o=r+n-1,l=0;l<e.length;++l){var c=e.codePointAt(l);if(c<=127){if(r>=o)break;t[r++]=c}else if(c<=2047){if(r+1>=o)break;t[r++]=192|c>>6,t[r++]=128|c&63}else if(c<=65535){if(r+2>=o)break;t[r++]=224|c>>12,t[r++]=128|c>>6&63,t[r++]=128|c&63}else{if(r+3>=o)break;t[r++]=240|c>>18,t[r++]=128|c>>12&63,t[r++]=128|c>>6&63,t[r++]=128|c&63,l++}}return t[r]=0,r-s},"stringToUTF8Array"),stringToUTF8=a((e,t,r)=>stringToUTF8Array(e,HEAPU8,t,r),"stringToUTF8"),stackAlloc=a(e=>__emscripten_stack_alloc(e),"stackAlloc"),stringToUTF8OnStack=a(e=>{var t=lengthBytesUTF8(e)+1,r=stackAlloc(t);return stringToUTF8(e,r,t),r},"stringToUTF8OnStack"),AsciiToString=a(e=>{for(var t="";;){var r=HEAPU8[e++];if(!r)return t;t+=String.fromCharCode(r)}},"AsciiToString"),stringToUTF16=a((e,t,r)=>{if(r??=2147483647,r<2)return 0;r-=2;for(var n=t,s=r<e.length*2?r/2:e.length,o=0;o<s;++o){var l=e.charCodeAt(o);LE_HEAP_STORE_I16((t>>1)*2,l),t+=2}return LE_HEAP_STORE_I16((t>>1)*2,0),t-n},"stringToUTF16");LE_ATOMICS_NATIVE_BYTE_ORDER=new Int8Array(new Int16Array([1]).buffer)[0]===1?[(e=>e),(e=>e),void 0,(e=>e)]:[(e=>e),(e=>((e&65280)<<8|(e&255)<<24)>>16),void 0,(e=>e>>24&255|e>>8&65280|(e&65280)<<8|(e&255)<<24)];function LE_HEAP_UPDATE(){HEAPU16.unsigned=(e=>e&65535),HEAPU32.unsigned=(e=>e>>>0)}if(a(LE_HEAP_UPDATE,"LE_HEAP_UPDATE"),initMemory(),Module.noExitRuntime&&(noExitRuntime=Module.noExitRuntime),Module.print&&(out=Module.print),Module.printErr&&(err=Module.printErr),Module.dynamicLibraries&&(dynamicLibraries=Module.dynamicLibraries),Module.wasmBinary&&(wasmBinary=Module.wasmBinary),Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.shift()();Module.setValue=setValue,Module.getValue=getValue,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,Module.loadWebAssemblyModule=loadWebAssemblyModule,Module.LE_HEAP_STORE_I64=LE_HEAP_STORE_I64;var ASM_CONSTS={},_free,_ts_range_edit,_ts_language_symbol_count,_ts_language_state_count,_ts_language_abi_version,_ts_language_name,_ts_language_field_count,_ts_language_next_state,_ts_language_symbol_name,_ts_language_symbol_for_name,_strncmp,_ts_language_symbol_type,_ts_language_field_name_for_id,_ts_lookahead_iterator_new,_ts_lookahead_iterator_delete,_ts_lookahead_iterator_reset_state,_ts_lookahead_iterator_reset,_ts_lookahead_iterator_next,_ts_lookahead_iterator_current_symbol,_ts_point_edit,_ts_parser_delete,_ts_parser_set_language,_ts_parser_reset,_ts_parser_set_included_ranges,_memcmp,_ts_tree_copy,_ts_tree_delete,_malloc,_calloc,_realloc,_ts_init,_ts_free_wasm,_ts_scanner_malloc_wasm,_ts_scanner_calloc_wasm,_ts_scanner_realloc_wasm,_ts_parser_new_wasm,_ts_parser_enable_logger_wasm,_ts_parser_parse_wasm,_ts_parser_parse_limited_wasm,_ts_parser_abort_limited_wasm,_ts_parser_included_ranges_wasm,_ts_language_type_is_named_wasm,_ts_language_type_is_visible_wasm,_ts_language_metadata_wasm,_ts_language_supertypes_wasm,_ts_language_subtypes_wasm,_ts_tree_root_node_wasm,_ts_tree_root_node_with_offset_wasm,_ts_tree_edit_wasm,_ts_tree_included_ranges_wasm,_ts_tree_get_changed_ranges_wasm,_ts_tree_cursor_new_wasm,_ts_tree_cursor_copy_wasm,_ts_tree_cursor_delete_wasm,_ts_tree_cursor_reset_wasm,_ts_tree_cursor_reset_to_wasm,_ts_tree_cursor_goto_first_child_wasm,_ts_tree_cursor_goto_last_child_wasm,_ts_tree_cursor_goto_first_child_for_index_wasm,_ts_tree_cursor_goto_first_child_for_position_wasm,_ts_tree_cursor_goto_next_sibling_wasm,_ts_tree_cursor_goto_previous_sibling_wasm,_ts_tree_cursor_goto_descendant_wasm,_ts_tree_cursor_goto_parent_wasm,_ts_tree_cursor_current_node_type_id_wasm,_ts_tree_cursor_current_node_state_id_wasm,_ts_tree_cursor_current_node_is_named_wasm,_ts_tree_cursor_current_node_is_missing_wasm,_ts_tree_cursor_current_node_id_wasm,_ts_tree_cursor_start_position_wasm,_ts_tree_cursor_end_position_wasm,_ts_tree_cursor_start_index_wasm,_ts_tree_cursor_end_index_wasm,_ts_tree_cursor_current_field_id_wasm,_ts_tree_cursor_current_depth_wasm,_ts_tree_cursor_current_descendant_index_wasm,_ts_tree_cursor_current_node_wasm,_ts_node_symbol_wasm,_ts_node_field_name_for_child_wasm,_ts_node_field_name_for_named_child_wasm,_ts_node_children_by_field_id_wasm,_ts_node_first_child_for_byte_wasm,_ts_node_first_named_child_for_byte_wasm,_ts_node_grammar_symbol_wasm,_ts_node_child_count_wasm,_ts_node_named_child_count_wasm,_ts_node_child_wasm,_ts_node_named_child_wasm,_ts_node_child_by_field_id_wasm,_ts_node_next_sibling_wasm,_ts_node_prev_sibling_wasm,_ts_node_next_named_sibling_wasm,_ts_node_prev_named_sibling_wasm,_ts_node_descendant_count_wasm,_ts_node_parent_wasm,_ts_node_child_with_descendant_wasm,_ts_node_descendant_for_index_wasm,_ts_node_named_descendant_for_index_wasm,_ts_node_descendant_for_position_wasm,_ts_node_named_descendant_for_position_wasm,_ts_node_start_point_wasm,_ts_node_end_point_wasm,_ts_node_start_index_wasm,_ts_node_end_index_wasm,_ts_node_to_string_wasm,_ts_node_children_wasm,_ts_node_named_children_wasm,_ts_node_descendants_of_type_wasm,_ts_node_is_named_wasm,_ts_node_has_changes_wasm,_ts_node_has_error_wasm,_ts_node_is_error_wasm,_ts_node_is_missing_wasm,_ts_node_is_extra_wasm,_ts_node_parse_state_wasm,_ts_node_next_parse_state_wasm,_memset,_memcpy,_memmove,_iswalnum,_iswalpha,_iswblank,_iswdigit,_iswlower,_iswpunct,_iswspace,_iswupper,_iswxdigit,_memchr,__emscripten_timeout,_strlen,_strcmp,_strncat,_strncpy,_towlower,_towupper,_setThrew,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,___wasm_apply_data_relocs;function assignWasmExports(e){Module._free=_free=e.free,Module._ts_range_edit=_ts_range_edit=e.ts_range_edit,Module._ts_language_symbol_count=_ts_language_symbol_count=e.ts_language_symbol_count,Module._ts_language_state_count=_ts_language_state_count=e.ts_language_state_count,Module._ts_language_abi_version=_ts_language_abi_version=e.ts_language_abi_version,Module._ts_language_name=_ts_language_name=e.ts_language_name,Module._ts_language_field_count=_ts_language_field_count=e.ts_language_field_count,Module._ts_language_next_state=_ts_language_next_state=e.ts_language_next_state,Module._ts_language_symbol_name=_ts_language_symbol_name=e.ts_language_symbol_name,Module._ts_language_symbol_for_name=_ts_language_symbol_for_name=e.ts_language_symbol_for_name,Module._strncmp=_strncmp=e.strncmp,Module._ts_language_symbol_type=_ts_language_symbol_type=e.ts_language_symbol_type,Module._ts_language_field_name_for_id=_ts_language_field_name_for_id=e.ts_language_field_name_for_id,Module._ts_lookahead_iterator_new=_ts_lookahead_iterator_new=e.ts_lookahead_iterator_new,Module._ts_lookahead_iterator_delete=_ts_lookahead_iterator_delete=e.ts_lookahead_iterator_delete,Module._ts_lookahead_iterator_reset_state=_ts_lookahead_iterator_reset_state=e.ts_lookahead_iterator_reset_state,Module._ts_lookahead_iterator_reset=_ts_lookahead_iterator_reset=e.ts_lookahead_iterator_reset,Module._ts_lookahead_iterator_next=_ts_lookahead_iterator_next=e.ts_lookahead_iterator_next,Module._ts_lookahead_iterator_current_symbol=_ts_lookahead_iterator_current_symbol=e.ts_lookahead_iterator_current_symbol,Module._ts_point_edit=_ts_point_edit=e.ts_point_edit,Module._ts_parser_delete=_ts_parser_delete=e.ts_parser_delete,Module._ts_parser_set_language=_ts_parser_set_language=e.ts_parser_set_language,Module._ts_parser_reset=_ts_parser_reset=e.ts_parser_reset,Module._ts_parser_set_included_ranges=_ts_parser_set_included_ranges=e.ts_parser_set_included_ranges,Module._memcmp=_memcmp=e.memcmp,Module._ts_tree_copy=_ts_tree_copy=e.ts_tree_copy,Module._ts_tree_delete=_ts_tree_delete=e.ts_tree_delete,Module._malloc=_malloc=e.malloc,Module._calloc=_calloc=e.calloc,Module._realloc=_realloc=e.realloc,Module._ts_init=_ts_init=e.ts_init,Module._ts_free_wasm=_ts_free_wasm=e.ts_free_wasm,Module._ts_scanner_malloc_wasm=_ts_scanner_malloc_wasm=e.ts_scanner_malloc_wasm,Module._ts_scanner_calloc_wasm=_ts_scanner_calloc_wasm=e.ts_scanner_calloc_wasm,Module._ts_scanner_realloc_wasm=_ts_scanner_realloc_wasm=e.ts_scanner_realloc_wasm,Module._ts_parser_new_wasm=_ts_parser_new_wasm=e.ts_parser_new_wasm,Module._ts_parser_enable_logger_wasm=_ts_parser_enable_logger_wasm=e.ts_parser_enable_logger_wasm,Module._ts_parser_parse_wasm=_ts_parser_parse_wasm=e.ts_parser_parse_wasm,Module._ts_parser_parse_limited_wasm=_ts_parser_parse_limited_wasm=e.ts_parser_parse_limited_wasm,Module._ts_parser_abort_limited_wasm=_ts_parser_abort_limited_wasm=e.ts_parser_abort_limited_wasm,Module._ts_parser_included_ranges_wasm=_ts_parser_included_ranges_wasm=e.ts_parser_included_ranges_wasm,Module._ts_language_type_is_named_wasm=_ts_language_type_is_named_wasm=e.ts_language_type_is_named_wasm,Module._ts_language_type_is_visible_wasm=_ts_language_type_is_visible_wasm=e.ts_language_type_is_visible_wasm,Module._ts_language_metadata_wasm=_ts_language_metadata_wasm=e.ts_language_metadata_wasm,Module._ts_language_supertypes_wasm=_ts_language_supertypes_wasm=e.ts_language_supertypes_wasm,Module._ts_language_subtypes_wasm=_ts_language_subtypes_wasm=e.ts_language_subtypes_wasm,Module._ts_tree_root_node_wasm=_ts_tree_root_node_wasm=e.ts_tree_root_node_wasm,Module._ts_tree_root_node_with_offset_wasm=_ts_tree_root_node_with_offset_wasm=e.ts_tree_root_node_with_offset_wasm,Module._ts_tree_edit_wasm=_ts_tree_edit_wasm=e.ts_tree_edit_wasm,Module._ts_tree_included_ranges_wasm=_ts_tree_included_ranges_wasm=e.ts_tree_included_ranges_wasm,Module._ts_tree_get_changed_ranges_wasm=_ts_tree_get_changed_ranges_wasm=e.ts_tree_get_changed_ranges_wasm,Module._ts_tree_cursor_new_wasm=_ts_tree_cursor_new_wasm=e.ts_tree_cursor_new_wasm,Module._ts_tree_cursor_copy_wasm=_ts_tree_cursor_copy_wasm=e.ts_tree_cursor_copy_wasm,Module._ts_tree_cursor_delete_wasm=_ts_tree_cursor_delete_wasm=e.ts_tree_cursor_delete_wasm,Module._ts_tree_cursor_reset_wasm=_ts_tree_cursor_reset_wasm=e.ts_tree_cursor_reset_wasm,Module._ts_tree_cursor_reset_to_wasm=_ts_tree_cursor_reset_to_wasm=e.ts_tree_cursor_reset_to_wasm,Module._ts_tree_cursor_goto_first_child_wasm=_ts_tree_cursor_goto_first_child_wasm=e.ts_tree_cursor_goto_first_child_wasm,Module._ts_tree_cursor_goto_last_child_wasm=_ts_tree_cursor_goto_last_child_wasm=e.ts_tree_cursor_goto_last_child_wasm,Module._ts_tree_cursor_goto_first_child_for_index_wasm=_ts_tree_cursor_goto_first_child_for_index_wasm=e.ts_tree_cursor_goto_first_child_for_index_wasm,Module._ts_tree_cursor_goto_first_child_for_position_wasm=_ts_tree_cursor_goto_first_child_for_position_wasm=e.ts_tree_cursor_goto_first_child_for_position_wasm,Module._ts_tree_cursor_goto_next_sibling_wasm=_ts_tree_cursor_goto_next_sibling_wasm=e.ts_tree_cursor_goto_next_sibling_wasm,Module._ts_tree_cursor_goto_previous_sibling_wasm=_ts_tree_cursor_goto_previous_sibling_wasm=e.ts_tree_cursor_goto_previous_sibling_wasm,Module._ts_tree_cursor_goto_descendant_wasm=_ts_tree_cursor_goto_descendant_wasm=e.ts_tree_cursor_goto_descendant_wasm,Module._ts_tree_cursor_goto_parent_wasm=_ts_tree_cursor_goto_parent_wasm=e.ts_tree_cursor_goto_parent_wasm,Module._ts_tree_cursor_current_node_type_id_wasm=_ts_tree_cursor_current_node_type_id_wasm=e.ts_tree_cursor_current_node_type_id_wasm,Module._ts_tree_cursor_current_node_state_id_wasm=_ts_tree_cursor_current_node_state_id_wasm=e.ts_tree_cursor_current_node_state_id_wasm,Module._ts_tree_cursor_current_node_is_named_wasm=_ts_tree_cursor_current_node_is_named_wasm=e.ts_tree_cursor_current_node_is_named_wasm,Module._ts_tree_cursor_current_node_is_missing_wasm=_ts_tree_cursor_current_node_is_missing_wasm=e.ts_tree_cursor_current_node_is_missing_wasm,Module._ts_tree_cursor_current_node_id_wasm=_ts_tree_cursor_current_node_id_wasm=e.ts_tree_cursor_current_node_id_wasm,Module._ts_tree_cursor_start_position_wasm=_ts_tree_cursor_start_position_wasm=e.ts_tree_cursor_start_position_wasm,Module._ts_tree_cursor_end_position_wasm=_ts_tree_cursor_end_position_wasm=e.ts_tree_cursor_end_position_wasm,Module._ts_tree_cursor_start_index_wasm=_ts_tree_cursor_start_index_wasm=e.ts_tree_cursor_start_index_wasm,Module._ts_tree_cursor_end_index_wasm=_ts_tree_cursor_end_index_wasm=e.ts_tree_cursor_end_index_wasm,Module._ts_tree_cursor_current_field_id_wasm=_ts_tree_cursor_current_field_id_wasm=e.ts_tree_cursor_current_field_id_wasm,Module._ts_tree_cursor_current_depth_wasm=_ts_tree_cursor_current_depth_wasm=e.ts_tree_cursor_current_depth_wasm,Module._ts_tree_cursor_current_descendant_index_wasm=_ts_tree_cursor_current_descendant_index_wasm=e.ts_tree_cursor_current_descendant_index_wasm,Module._ts_tree_cursor_current_node_wasm=_ts_tree_cursor_current_node_wasm=e.ts_tree_cursor_current_node_wasm,Module._ts_node_symbol_wasm=_ts_node_symbol_wasm=e.ts_node_symbol_wasm,Module._ts_node_field_name_for_child_wasm=_ts_node_field_name_for_child_wasm=e.ts_node_field_name_for_child_wasm,Module._ts_node_field_name_for_named_child_wasm=_ts_node_field_name_for_named_child_wasm=e.ts_node_field_name_for_named_child_wasm,Module._ts_node_children_by_field_id_wasm=_ts_node_children_by_field_id_wasm=e.ts_node_children_by_field_id_wasm,Module._ts_node_first_child_for_byte_wasm=_ts_node_first_child_for_byte_wasm=e.ts_node_first_child_for_byte_wasm,Module._ts_node_first_named_child_for_byte_wasm=_ts_node_first_named_child_for_byte_wasm=e.ts_node_first_named_child_for_byte_wasm,Module._ts_node_grammar_symbol_wasm=_ts_node_grammar_symbol_wasm=e.ts_node_grammar_symbol_wasm,Module._ts_node_child_count_wasm=_ts_node_child_count_wasm=e.ts_node_child_count_wasm,Module._ts_node_named_child_count_wasm=_ts_node_named_child_count_wasm=e.ts_node_named_child_count_wasm,Module._ts_node_child_wasm=_ts_node_child_wasm=e.ts_node_child_wasm,Module._ts_node_named_child_wasm=_ts_node_named_child_wasm=e.ts_node_named_child_wasm,Module._ts_node_child_by_field_id_wasm=_ts_node_child_by_field_id_wasm=e.ts_node_child_by_field_id_wasm,Module._ts_node_next_sibling_wasm=_ts_node_next_sibling_wasm=e.ts_node_next_sibling_wasm,Module._ts_node_prev_sibling_wasm=_ts_node_prev_sibling_wasm=e.ts_node_prev_sibling_wasm,Module._ts_node_next_named_sibling_wasm=_ts_node_next_named_sibling_wasm=e.ts_node_next_named_sibling_wasm,Module._ts_node_prev_named_sibling_wasm=_ts_node_prev_named_sibling_wasm=e.ts_node_prev_named_sibling_wasm,Module._ts_node_descendant_count_wasm=_ts_node_descendant_count_wasm=e.ts_node_descendant_count_wasm,Module._ts_node_parent_wasm=_ts_node_parent_wasm=e.ts_node_parent_wasm,Module._ts_node_child_with_descendant_wasm=_ts_node_child_with_descendant_wasm=e.ts_node_child_with_descendant_wasm,Module._ts_node_descendant_for_index_wasm=_ts_node_descendant_for_index_wasm=e.ts_node_descendant_for_index_wasm,Module._ts_node_named_descendant_for_index_wasm=_ts_node_named_descendant_for_index_wasm=e.ts_node_named_descendant_for_index_wasm,Module._ts_node_descendant_for_position_wasm=_ts_node_descendant_for_position_wasm=e.ts_node_descendant_for_position_wasm,Module._ts_node_named_descendant_for_position_wasm=_ts_node_named_descendant_for_position_wasm=e.ts_node_named_descendant_for_position_wasm,Module._ts_node_start_point_wasm=_ts_node_start_point_wasm=e.ts_node_start_point_wasm,Module._ts_node_end_point_wasm=_ts_node_end_point_wasm=e.ts_node_end_point_wasm,Module._ts_node_start_index_wasm=_ts_node_start_index_wasm=e.ts_node_start_index_wasm,Module._ts_node_end_index_wasm=_ts_node_end_index_wasm=e.ts_node_end_index_wasm,Module._ts_node_to_string_wasm=_ts_node_to_string_wasm=e.ts_node_to_string_wasm,Module._ts_node_children_wasm=_ts_node_children_wasm=e.ts_node_children_wasm,Module._ts_node_named_children_wasm=_ts_node_named_children_wasm=e.ts_node_named_children_wasm,Module._ts_node_descendants_of_type_wasm=_ts_node_descendants_of_type_wasm=e.ts_node_descendants_of_type_wasm,Module._ts_node_is_named_wasm=_ts_node_is_named_wasm=e.ts_node_is_named_wasm,Module._ts_node_has_changes_wasm=_ts_node_has_changes_wasm=e.ts_node_has_changes_wasm,Module._ts_node_has_error_wasm=_ts_node_has_error_wasm=e.ts_node_has_error_wasm,Module._ts_node_is_error_wasm=_ts_node_is_error_wasm=e.ts_node_is_error_wasm,Module._ts_node_is_missing_wasm=_ts_node_is_missing_wasm=e.ts_node_is_missing_wasm,Module._ts_node_is_extra_wasm=_ts_node_is_extra_wasm=e.ts_node_is_extra_wasm,Module._ts_node_parse_state_wasm=_ts_node_parse_state_wasm=e.ts_node_parse_state_wasm,Module._ts_node_next_parse_state_wasm=_ts_node_next_parse_state_wasm=e.ts_node_next_parse_state_wasm,Module._memset=_memset=e.memset,Module._memcpy=_memcpy=e.memcpy,Module._memmove=_memmove=e.memmove,Module._iswalnum=_iswalnum=e.iswalnum,Module._iswalpha=_iswalpha=e.iswalpha,Module._iswblank=_iswblank=e.iswblank,Module._iswdigit=_iswdigit=e.iswdigit,Module._iswlower=_iswlower=e.iswlower,Module._iswpunct=_iswpunct=e.iswpunct,Module._iswspace=_iswspace=e.iswspace,Module._iswupper=_iswupper=e.iswupper,Module._iswxdigit=_iswxdigit=e.iswxdigit,Module._memchr=_memchr=e.memchr,__emscripten_timeout=e._emscripten_timeout,Module._strlen=_strlen=e.strlen,Module._strcmp=_strcmp=e.strcmp,Module._strncat=_strncat=e.strncat,Module._strncpy=_strncpy=e.strncpy,Module._towlower=_towlower=e.towlower,Module._towupper=_towupper=e.towupper,_setThrew=e.setThrew,__emscripten_stack_restore=e._emscripten_stack_restore,__emscripten_stack_alloc=e._emscripten_stack_alloc,_emscripten_stack_get_current=e.emscripten_stack_get_current,___wasm_apply_data_relocs=e.__wasm_apply_data_relocs}a(assignWasmExports,"assignWasmExports");var wasmImports={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_high:___stack_high,__stack_low:___stack_low,__stack_pointer:___stack_pointer,__table_base:___table_base,_abort_js:__abort_js,_emscripten_runtime_keepalive_clear:__emscripten_runtime_keepalive_clear,_emscripten_throw_longjmp:__emscripten_throw_longjmp,_setitimer_js:__setitimer_js,emscripten_resize_heap:_emscripten_resize_heap,invoke_i,invoke_iii,invoke_iiiij,invoke_vi,invoke_vii,memory:wasmMemory,proc_exit:_proc_exit,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback,tree_sitter_progress_callback:_tree_sitter_progress_callback};function invoke_vi(e,t){var r=stackSave();try{getWasmTableEntry(e)(t)}catch(n){if(stackRestore(r),n!==n+0)throw n;_setThrew(1,0)}}a(invoke_vi,"invoke_vi");function invoke_i(e){var t=stackSave();try{return getWasmTableEntry(e)()}catch(r){if(stackRestore(t),r!==r+0)throw r;_setThrew(1,0)}}a(invoke_i,"invoke_i");function invoke_iii(e,t,r){var n=stackSave();try{return getWasmTableEntry(e)(t,r)}catch(s){if(stackRestore(n),s!==s+0)throw s;_setThrew(1,0)}}a(invoke_iii,"invoke_iii");function invoke_vii(e,t,r){var n=stackSave();try{getWasmTableEntry(e)(t,r)}catch(s){if(stackRestore(n),s!==s+0)throw s;_setThrew(1,0)}}a(invoke_vii,"invoke_vii");function invoke_iiiij(e,t,r,n,s){var o=stackSave();try{return getWasmTableEntry(e)(t,r,n,s)}catch(l){if(stackRestore(o),l!==l+0)throw l;_setThrew(1,0)}}a(invoke_iiiij,"invoke_iiiij");function callMain(e=[]){var t=resolveGlobalSymbol("main").sym;if(t){e.unshift(thisProgram);var r=e.length,n=stackAlloc((r+1)*4),s=n;e.forEach(l=>{LE_HEAP_STORE_U32((s>>2)*4,stringToUTF8OnStack(l)),s+=4}),LE_HEAP_STORE_U32((s>>2)*4,0);try{var o=t(r,n);return exitJS(o,!0),o}catch(l){return handleException(l)}}}a(callMain,"callMain");function run(e=arguments_){if(runDependencies>0){dependenciesFulfilled=run;return}if(preRun(),runDependencies>0){dependenciesFulfilled=run;return}function t(){if(Module.calledRun=!0,!ABORT){initRuntime(),readyPromiseResolve?.(Module),Module.onRuntimeInitialized?.();var r=Module.noInitialRun||!1;r||callMain(e),postRun()}}a(t,"doRun"),Module.setStatus?(Module.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>Module.setStatus(""),1),t()},1)):t()}a(run,"run");var wasmExports;return wasmExports=await createWasm(),run(),runtimeInitialized?moduleRtn=Module:moduleRtn=new Promise((e,t)=>{readyPromiseResolve=e,readyPromiseReject=t}),moduleRtn}a(Ne,"Module");var q=Ne;var V=null;async function me(e){if(V)return V;let{wasmModule:t,...r}=e??{};if(!t)return V??=await q(r);let n=new Promise((s,o)=>{r.instantiateWasm=(l,c)=>(WebAssembly.instantiate(t,l).then(f=>{c(f,t)}).catch(o),{})});return V??=await Promise.race([q(r),n])}a(me,"initializeBinding");function ce(){return!!V}a(ce,"checkModule");var d,G;function Oe(e){let t=_._ts_language_abi_version(e[0]);if(t<J||t>G)throw new Error(`Incompatible language version 0x${(t>>>0).toString(16)}. Expected 0x${G.toString(16)}.`)}a(Oe,"assertSupportedLanguage");var J,ge=S(e=>{_._ts_parser_delete(e[0]),_._free(e[1])}),Y=class{static{a(this,"Parser")}0=0;1=0;logCallback=null;language=null;static async init(t){te(await me(t)),d=_._ts_init(),G=_.getValue(d,"i32"),J=_.getValue(d+u,"i32")}constructor(){this.initialize(),ge?.register(this,[this[0],this[1]],this)}initialize(){if(!ce())throw new Error("cannot construct a Parser before calling `init()`");_._ts_parser_new_wasm(),this[0]=_.getValue(d,"i32"),this[1]=_.getValue(d+u,"i32")}delete(){ge?.unregister(this),_._ts_parser_delete(this[0]),_._free(this[1]),this[0]=0,this[1]=0}setLanguage(t){let r;if(!t)r=0,this.language=null;else if(t.constructor===N)r=t[0],Oe(t),this.language=t;else throw new Error("Argument must be a Language");return _._ts_parser_set_language(this[0],r),this}parse(t,r,n){let s=Le(n?.maxMemoryBytes);if(typeof t=="string")_.currentParseCallback=o=>t.slice(o);else if(typeof t=="function")_.currentParseCallback=t;else throw new Error("Argument must be a string or a function");n?.progressCallback?_.currentProgressCallback=n.progressCallback:_.currentProgressCallback=null,this.logCallback?(_.currentLogCallback=this.logCallback,_._ts_parser_enable_logger_wasm(this[0],1)):(_.currentLogCallback=null,_._ts_parser_enable_logger_wasm(this[0],0));try{let o=s===void 0?xe(this[0],this[1],r?r[0]:0,n?.includedRanges):Ce(this[0],this[1],n?.includedRanges,s);if(!o)return null;if(!this.language)throw new Error("Parser must have a language to parse");return new C(p,o,this.language,_.currentParseCallback)}finally{Ue()}}reset(){_._ts_parser_reset(this[0])}getIncludedRanges(){_._ts_parser_included_ranges_wasm(this[0]);let t=_.getValue(d,"i32"),r=_.getValue(d+u,"i32"),n=new Array(t);if(t>0){let s=r;for(let o=0;o<t;o++)n[o]=U(s),s+=F;_._free(r)}return n}setLogger(t){if(!t)this.logCallback=null;else{if(typeof t!="function")throw new Error("Logger callback must be a function");this.logCallback=t}return this}getLogger(){return this.logCallback}};function Le(e){if(e!==void 0&&(!Number.isSafeInteger(e)||e<=0||e>2147483647))throw new RangeError("maxMemoryBytes must be a positive integer no greater than 2147483647");return e}a(Le,"validateMemoryLimit");function fe(e){if(!e?.length)return[0,0];let t=_._calloc(e.length,F);if(!t)return[0,e.length];let r=t;for(let n of e)ae(r,n),r+=F;return[t,e.length]}a(fe,"prepareRanges");function xe(e,t,r,n){let[s,o]=fe(n);return o&&!s?0:_._ts_parser_parse_wasm(e,t,r,s,o)}a(xe,"parseOrdinaryWasm");function Ce(e,t,r,n){if(!_.treeSitterSetMemoryLimit(n))return 0;let s=0;try{let[o,l]=fe(r);if(s=o,l&&!o)return 0;try{return _._ts_parser_parse_limited_wasm(e,t,o,l)}catch(c){throw _._ts_parser_abort_limited_wasm(),c}}finally{s&&_._free(s),_.treeSitterSetMemoryLimit(0)}}a(Ce,"parseLimitedWasm");function Ue(){_.currentParseCallback=null,_.currentLogCallback=null,_.currentProgressCallback=null}a(Ue,"clearCallbacks");export{$ as Edit,G as LANGUAGE_VERSION,N as Language,x as LookaheadIterator,J as MIN_COMPATIBLE_VERSION,W as Node,Y as Parser,C as Tree,H as TreeCursor};
6
5
  //# sourceMappingURL=web-tree-sitter.web.js.map