| 1584 | `){J8(q),J8(q);continue}J8(q),J8(q);continue}if(!FV4(O)&&O!=="{"&&O!=="}")break;J8(q)}if(q.i>A){let O=q.src.slice(A,q.i);if(/^-?\d+$/.test(O))return{type:"NUMBER",value:O,start:_,end:q.b};return{type:"WORD",value:O,start:_,end:q.b}}}return J8(q),{type:"WORD",value:z,start:_,end:q.b}}function V3z(q,K){let _=Z3z(q),z=N3z(q),Y={L:_,src:q,srcBytes:z,isAscii:z===q.length,nodeCount:0,deadline:performance.now()+(K??50),aborted:!1,inBacktick:0,stopToken:null};try{let $=E3z(Y);if(Y.aborted)return null;return $}catch{return null}}function N3z(q){let K=0;for(let _=0;_<q.length;_++){let z=q.charCodeAt(_);if(z<128)K++;else if(z<2048)K+=2;else if(z>=55296&&z<=56319)K+=4,_++;else K+=3}return K}function y3z(q){if(q.nodeCount++,q.nodeCount>50000)throw q.aborted=!0,Error("budget");if((q.nodeCount&127)===0&&performance.now()>q.deadline)throw q.aborted=!0,Error("timeout")}function h8(q,K,_,z,Y){return y3z(q),{type:K,text:tO6(q,_,z),startIndex:_,endIndex:z,children:Y}}function tO6(q,K,_){if(q.isAscii)return q.src.slice(K,_);let z=q.L;if(!z.byteTable)gV4(z,0);let Y=z.byteTable,$=0,A=q.src.length;while($<A){let w=$+A>>>1;if(Y[w]<K)$=w+1;else A=w}let O=$;$=O,A=q.src.length;while($<A){let w=$+A>>>1;if(Y[w]<_)$=w+1;else A=w}return q.src.slice(O,$)}function i5(q,K,_){return h8(q,K,_.start,_.end,[])}function E3z(q){let K=[];mq(q.L);while(!0){let Y=BY(q.L);if(u9(q.L,"cmd").type==="NEWLINE"){mq(q.L);continue}r5(q.L,Y);break}let _=q.L.b;while(q.L.i<q.L.len){let Y=BY(q.L),$=u9(q.L,"cmd");if($.type==="EOF")break;if($.type==="NEWLINE")continue;if($.type==="COMMENT"){K.push(i5(q,"comment",$));continue}r5(q.L,Y);let A=Qv(q,null);for(let O of A)K.push(O);if(A.length===0){let O=u9(q.L,"cmd");if(O.type==="EOF")break;if(O.type==="OP"&&O.value===";;"&&K.length>0)continue;K.push(h8(q,"ERROR",O.start,O.end,[]))}}let z=K.length>0?q.srcBytes:_;return h8(q,"program",_,z,K)}function BY(q){return q.b*65536+q.i}function r5(q,K){q.i=K&65535,q.b=K>>>16}function Qv(q,K){let _=[];while(!0){mq(q.L);let z=BY(q.L),Y=u9(q.L,"cmd");if(Y.type==="EOF"){r5(q.L,z);break}if(Y.type==="NEWLINE"){if(q.L.heredocs.length>0)wm1(q);continue}if(Y.type==="COMMENT"){_.push(i5(q,"comment",Y));continue}if(K&&Y.type==="OP"&&Y.value===K){r5(q.L,z);break}if(Y.type==="OP"&&(Y.value===")"||Y.value==="}"||Y.value===";;"||Y.value===";&"||Y.value===";;&"||Y.value==="))"||Y.value==="]]"||Y.value==="]")){r5(q.L,z);break}if(Y.type==="BACKTICK"&&q.inBacktick>0){r5(q.L,z);break}if(Y.type==="WORD"&&(Y.value==="then"||Y.value==="elif"||Y.value==="else"||Y.value==="fi"||Y.value==="do"||Y.value==="done"||Y.value==="esac")){r5(q.L,z);break}r5(q.L,z);let $=UV4(q);if(!$)break;_.push($),mq(q.L);let A=BY(q.L),O=u9(q.L,"cmd");if(O.type==="OP"&&(O.value===";"||O.value==="&")){let w=BY(q.L),j=u9(q.L,"cmd");if(r5(q.L,w),_.push(i5(q,O.value,O)),j.type==="EOF"||j.type==="OP"&&(j.value===")"||j.value==="}"||j.value===";;"||j.value===";&"||j.value===";;&")||j.type==="WORD"&&(j.value==="then"||j.value==="elif"||j.value==="else"||j.value==="fi"||j.value==="do"||j.value==="done"||j.value==="esac"))continue}else if(O.type==="NEWLINE"){if(q.L.heredocs.length>0)wm1(q);continue}else r5(q.L,A)}return _}function UV4(q){let K=CV4(q);if(!K)return null;while(!0){let _=BY(q.L),z=u9(q.L,"cmd");if(z.type==="OP"&&(z.value==="&&"||z.value==="||")){let Y=i5(q,z.value,z);Rr(q);let $=CV4(q);if(!$){K=h8(q,"list",K.startIndex,Y.endIndex,[K,Y]);break}if($.type==="redirected_statement"&&$.children.length>=2){let A=$.children[0],O=$.children.slice(1),w=h8(q,"list",K.startIndex,A.endIndex,[K,Y,A]),j=O[O.length-1];K=h8(q,"redirected_statement",w.startIndex,j.endIndex,[w,...O])}else K=h8(q,"list",K.startIndex,$.endIndex,[K,Y,$])}else{r5(q.L,_);break}}return K}function Rr(q){while(!0){let K=BY(q.L);if(u9(q.L,"cmd").type!=="NEWLINE"){r5(q.L,K);break}}}function CV4(q){let K=Hq6(q);if(!K)return null;let _=[K];while(!0){let Y=BY(q.L),$=u9(q.L,"cmd");if($.type==="OP"&&($.value==="|"||$.value==="|&")){let A=i5(q,$.value,$);Rr(q);let O=Hq6(q);if(!O){_.push(A);break}if(O.type==="redirected_statement"&&O.children.length>=2&&_.length>=1){let w=O.children[0],j=O.children.slice(1),H=[..._,A,w],J=h8(q,"pipeline",H[0].startIndex,w.endIndex,H),M=j[j.length-1],X=h8(q,"redirected_statement",J.startIndex,M.endIndex,[J,...j]);_.length=0,_.push(X),K=X;continue}_.push(A,O)}else{r5(q.L,Y);break}}if(_.length===1)return _[0];let z=_[_.length-1];return h8(q,"pipeline",_[0].startIndex,z.endIndex,_)}function Hq6(q){mq(q.L);let K=BY(q.L),_=u9(q.L,"cmd");if(_.type==="EOF")return r5(q.L,K),null;if(_.type==="OP"&&_.value==="!"){let z=i5(q,"!",_),Y=Hq6(q);if(!Y)return r5(q.L,K),null;if(Y.type==="redirected_statement"&&Y.children.length>=2){let $=Y.children[0],A=Y.children.slice(1),O=h8(q,"negated_command",z.startIndex,$.endIndex,[z,$]),w=A[A.length-1];return h8(q,"redirected_statement",O.startIndex,w.endIndex,[O,...A])}return h8(q,"negated_command",z.startIndex,Y.endIndex,[z,Y])}if(_.type==="OP"&&_.value==="("){let z=i5(q,"(",_),Y=Qv(q,")"),$=u9(q.L,"cmd"),A=$.type==="OP"&&$.value===")"?i5(q,")",$):h8(q,")",z.endIndex,z.endIndex,[]),O=h8(q,"subshell",z.startIndex,A.endIndex,[z,...Y,A]);return Lr(q,O)}if(_.type==="OP"&&_.value==="(("){let z=i5(q,"((",_),Y=Yo6(q,"))","var"),$=u9(q.L,"cmd"),A=$.value==="))"?i5(q,"))",$):h8(q,"))",z.endIndex,z.endIndex,[]);return h8(q,"compound_statement",z.startIndex,A.endIndex,[z,...Y,A])}if(_.type==="OP"&&_.value==="{"){let z=i5(q,"{",_),Y=Qv(q,"}"),$=u9(q.L,"cmd"),A=$.type==="OP"&&$.value==="}"?i5(q,"}",$):h8(q,"}",z.endIndex,z.endIndex,[]),O=h8(q,"compound_statement",z.startIndex,A.endIndex,[z,...Y,A]);return Lr(q,O)}if(_.type==="OP"&&(_.value==="["||_.value==="[[")){let z=i5(q,_.value,_),Y=_.value==="["?"]":"]]",$=BY(q.L),A=IV4(q,Y);if(mq(q.L),_.value==="["&&u8(q.L)!=="]"){r5(q.L,$);let H=q.stopToken;q.stopToken="]";let J=Hq6(q);if(q.stopToken=H,J&&J.type==="redirected_statement")A=J;else r5(q.L,$),A=IV4(q,Y);mq(q.L)}let O=u9(q.L,"arg"),w;if(O.value===Y)w=i5(q,Y,O);else w=h8(q,Y,z.endIndex,z.endIndex,[]);let j=A?[z,A,w]:[z,w];return h8(q,"test_command",z.startIndex,w.endIndex,j)}if(_.type==="WORD"){if(_.value==="if")return Lr(q,p3z(q,_),!0);if(_.value==="while"||_.value==="until")return Lr(q,B3z(q,_),!0);if(_.value==="for")return Lr(q,xV4(q,_),!0);if(_.value==="select")return Lr(q,xV4(q,_),!0);if(_.value==="case")return Lr(q,g3z(q,_),!0);if(_.value==="function")return d3z(q,_);if(f3z.has(_.value))return Lr(q,c3z(q,_));if(_.value==="unset"||_.value==="unsetenv")return Lr(q,l3z(q,_))}return r5(q.L,K),L3z(q)}function L3z(q){let K=q.L.b,_=[],z=[];while(!0){mq(q.L);let f=QV4(q);if(f){_.push(f);continue}let G=zN8(q);if(G){z.push(G);continue}break}mq(q.L);let Y=BY(q.L),$=u9(q.L,"cmd");if($.type==="EOF"||$.type==="NEWLINE"||$.type==="COMMENT"||$.type==="OP"&&$.value!=="{"&&$.value!=="["&&$.value!=="[["||$.type==="WORD"&&Pm1.has($.value)&&$.value!=="in"){if(r5(q.L,Y),_.length===1&&z.length===0)return _[0];if(z.length>0&&_.length===0){let f=z[z.length-1];return h8(q,"redirected_statement",z[0].startIndex,f.endIndex,z)}if(_.length>1&&z.length===0){let f=_[_.length-1];return h8(q,"variable_assignments",_[0].startIndex,f.endIndex,_)}if(_.length>0||z.length>0){let f=[..._,...z],G=f[f.length-1];return h8(q,"command",K,G.endIndex,f)}return null}r5(q.L,Y);let A=BY(q.L),O=dv(q,"cmd");if(O&&O.type==="word"){if(mq(q.L),u8(q.L)==="("&&u8(q.L,1)===")"){let f=u9(q.L,"cmd"),G=u9(q.L,"cmd"),Z=i5(q,"(",f),T=i5(q,")",G);mq(q.L),Rr(q);let v=Hq6(q);if(v){let V=[v];if(v.type==="redirected_statement"&&v.children.length>=2&&v.children[0].type==="compound_statement")V=v.children;let E=V[V.length-1];return h8(q,"function_definition",O.startIndex,E.endIndex,[O,Z,T,...V])}}}r5(q.L,A);let w=dv(q,"cmd");if(!w){if(_.length===1)return _[0];return null}let j=h8(q,"command_name",w.startIndex,w.endIndex,[w]),H=[],J=[],M=null;while(!0){mq(q.L);let f=zN8(q,!0);if(f){if(f.type==="heredoc_redirect")M=f;else if(f.type==="herestring_redirect")H.push(f);else J.push(f);continue}if(J.length>0)break;if(q.stopToken==="]"&&u8(q.L)==="]")break;let G=BY(q.L),Z=u9(q.L,"arg");if(Z.type==="EOF"||Z.type==="NEWLINE"||Z.type==="COMMENT"||Z.type==="OP"&&(Z.value==="|"||Z.value==="|&"||Z.value==="&&"||Z.value==="||"||Z.value===";"||Z.value===";;"||Z.value===";&"||Z.value===";;&"||Z.value==="&"||Z.value===")"||Z.value==="}"||Z.value==="))")){r5(q.L,G);break}r5(q.L,G);let T=dv(q,"arg");if(!T){if(u8(q.L)==="("){let v=u9(q.L,"cmd"),V=i5(q,"(",v),E=Qv(q,")"),S=u9(q.L,"cmd"),R=S.type==="OP"&&S.value===")"?i5(q,")",S):h8(q,")",V.endIndex,V.endIndex,[]);H.push(h8(q,"subshell",V.startIndex,R.endIndex,[V,...E,R]));continue}break}if(T.type==="word"&&T.text==="="){H.push(h8(q,"ERROR",T.startIndex,T.endIndex,[T]));continue}if((T.type==="word"||T.type==="concatenation")&&u8(q.L)==="("&&q.L.b===T.endIndex){H.push(h8(q,"ERROR",T.startIndex,T.endIndex,[T]));continue}H.push(T)}let X=[..._,...z,j,...H],P=X.length>0?X[X.length-1].endIndex:j.endIndex,W=X[0].startIndex,D=h8(q,"command",W,P,X);if(M){wm1(q);let f=q.L.heredocs.shift();if(f&&M.children.length>=2){let T=h8(q,"heredoc_body",f.bodyStart,f.bodyEnd,f.quoted?[]:S3z(q,f.bodyStart,f.bodyEnd)),v=h8(q,"heredoc_end",f.endStart,f.endEnd,[]);M.children.push(T,v),M.endIndex=f.endEnd,M.text=tO6(q,M.startIndex,f.endEnd)}let G=[...z,M,...J],Z=z.length>0?Math.min(D.startIndex,z[0].startIndex):D.startIndex;return h8(q,"redirected_statement",Z,M.endIndex,[D,...G])}if(J.length>0){let f=J[J.length-1];return h8(q,"redirected_statement",D.startIndex,f.endIndex,[D,...J])}return D}function Lr(q,K,_=!1){let z=[];while(!0){mq(q.L);let $=BY(q.L),A=zN8(q);if(!A)break;if(A.type==="herestring_redirect"&&!_){r5(q.L,$);break}z.push(A)}if(z.length===0)return K;let Y=z[z.length-1];return h8(q,"redirected_statement",K.startIndex,Y.endIndex,[K,...z])}function QV4(q){let K=BY(q.L);mq(q.L);let _=q.L.b;if(!cv(u8(q.L)))return r5(q.L,K),null;while(MU(u8(q.L)))J8(q.L);let z=q.L.b,Y=z;if(u8(q.L)==="["){J8(q.L);let D=1;while(q.L.i<q.L.len&&D>0){let f=u8(q.L);if(f==="[")D++;else if(f==="]")D--;J8(q.L)}Y=q.L.b}let $=u8(q.L),A=u8(q.L,1),O;if($==="="&&A!=="=")O="=";else if($==="+"&&A==="=")O="+=";else return r5(q.L,K),null;let w=h8(q,"variable_name",_,z,[]),j=w;if(Y>z){let D=h8(q,"[",z,z+1,[]),f=h3z(q,z+1,Y-1),G=h8(q,"]",Y-1,Y,[]);j=h8(q,"subscript",_,Y,[w,D,f,G])}let H=q.L.b;if(J8(q.L),O==="+=")J8(q.L);let J=q.L.b,M=h8(q,O,H,J,[]),X=null;if(u8(q.L)==="("){let D=u9(q.L,"cmd"),f=i5(q,"(",D),G=[f];while(!0){if(mq(q.L),u8(q.L)===")")break;let v=dv(q,"arg");if(!v)break;G.push(v)}let Z=u9(q.L,"cmd"),T=Z.value===")"?i5(q,")",Z):h8(q,")",f.endIndex,f.endIndex,[]);G.push(T),X=h8(q,"array",f.startIndex,T.endIndex,G)}else{let D=u8(q.L);if(D&&D!==" "&&D!=="\t"&&D!==` |