| 10 | `)[this.startToken.line-1]}static parseEventArgs(e){var t=[];if(e.token(0).value==="("&&(e.token(1).value===")"||e.token(2).value===","||e.token(2).value===")")){e.matchOpToken("(");do t.push(e.requireTokenType("IDENTIFIER"));while(e.matchOpToken(","));e.requireOpToken(")")}return t}},y=class extends I{constructor(){super(),this.constructor.grammarName&&(this.type=this.constructor.grammarName)}evaluate(e){return e.meta.runtime.unifiedEval(this,e)}evalStatically(){throw new Error("This expression cannot be evaluated statically: "+this.type)}},d=class extends I{constructor(){super(),this.constructor.keyword&&(this.type=this.constructor.keyword+"Command")}execute(e){return e.meta.command=this,e.meta.runtime.unifiedExec(this,e)}findNext(e){return e.meta.runtime.findNext(this,e)}},S=class extends I{isFeature=!0;constructor(){super(),this.constructor.keyword&&(this.type=this.constructor.keyword+"Feature")}install(e,t,r,i){}static parseErrorAndFinally(e){var t,r,i;return e.matchToken("catch")&&(t=e.requireTokenType("IDENTIFIER").value,r=e.requireElement("commandList"),e.ensureTerminated(r)),e.matchToken("finally")&&(i=e.requireElement("commandList"),e.ensureTerminated(i)),{errorHandler:r,errorSymbol:t,finallyHandler:i}}};var J=class extends d{constructor(){super(),this.type="emptyCommandListCommand"}resolve(e){return this.findNext(e)}},K=class extends d{constructor(e,t){super(),this.type="unlessStatementModifier",this.root=e,this.args={conditional:t}}resolve(e,{conditional:t}){return t?this.next:this.root}},U=class extends I{constructor(e){super(),this.type="hyperscript",this.features=e}apply(e,t,r,i){for(let n of this.features)n.install(e,t,r,i)}},B=class extends S{constructor(e,t){super(),this.type="failedFeature",this.keyword=t,this.errors.push(e)}install(){}},X=class extends d{constructor(e,t){super(),this.type="failedCommand",this.keyword=t,this.errors.push(e)}resolve(){}},Z=class extends d{constructor(){super(),this.type="implicitReturn"}resolve(e){return e.meta.returned=!0,e.meta.resolve&&e.meta.resolve(),e.meta.runtime.HALT}};var qe={};N(qe,{ArrayLiteral:()=>ge,BooleanLiteral:()=>ye,NakedNamedArgumentList:()=>xe,NakedString:()=>j,NamedArgumentList:()=>V,NullLiteral:()=>Te,NumberLiteral:()=>ke,ObjectKey:()=>we,ObjectLiteral:()=>be,StringLike:()=>Se,StringLiteral:()=>Ee});var j=class s extends y{static grammarName="nakedString";constructor(e){super(),this.tokens=e}static parse(e){if(e.hasMore()){var t=e.consumeUntilWhitespace();return e.matchTokenType("WHITESPACE"),new s(t)}}evalStatically(){return this.resolve()}resolve(e){return this.tokens.map(function(t){return t.value}).join("")}},ye=class s extends y{static grammarName="boolean";static expressionType="leaf";constructor(e){super(),this.value=e}static parse(e){var t=e.matchToken("true")||e.matchToken("false");if(!t)return;let r=t.value==="true";return new s(r)}evalStatically(){return this.value}resolve(e){return this.value}},Te=class s extends y{static grammarName="null";static expressionType="leaf";constructor(){super()}static parse(e){if(e.matchToken("null"))return new s}evalStatically(){return null}resolve(e){return null}},ke=class s extends y{static grammarName="number";static expressionType="leaf";constructor(e,t){super(),this.value=e,this.numberToken=t}static parse(e){var t=e.matchTokenType("NUMBER");if(t){var r=t,i=parseFloat(t.value);return new s(i,r)}}evalStatically(){return this.value}resolve(e){return this.value}},Ee=class s extends y{static grammarName="string";static expressionType="leaf";constructor(e,t,r){super(),this.token=e,this.rawValue=t,this.args=r.length>0?{parts:r}:null}static parse(e){var t=e.matchTokenType("STRING");if(t){var r=t.value,i;if(t.template){var n=O.tokenize(r,!0),o=e.createChildParser(n);i=o.parseStringTemplate()}else i=[];return new s(t,r,i)}}evalStatically(){return this.args===null?this.rawValue:super.evalStatically()}resolve(e,{parts:t}={}){if(!t||t.length===0)return this.rawValue;for(var r="",i=0;i<t.length;i++){var n=t[i];n!==void 0&&(r+=n)}return r}},ge=class s extends y{static grammarName="arrayLiteral";static expressionType="leaf";constructor(e){super(),this.values=e,this.args={values:e}}static parse(e){if(e.matchOpToken("[")){var t=[];if(!e.matchOpToken("]")){do{var r=e.requireElement("expression");t.push(r)}while(e.matchOpToken(","));e.requireOpToken("]")}return new s(t)}}resolve(e,{values:t}){return t}},we=class s extends y{static grammarName="objectKey";constructor(e,t,r){super(),this.key=e,this.expr=t,this.args=r}static parse(e){var t;if(t=e.matchTokenType("STRING"))return new s(t.value,null,null);if(e.matchOpToken("[")){var r=e.parseElement("expression");return e.requireOpToken("]"),new s(null,r,{value:r})}else{var i="";do t=e.matchTokenType("IDENTIFIER")||e.matchOpToken("-"),t&&(i+=t.value);while(t);return new s(i,null,null)}}evalStatically(){return this.expr?super.evalStatically():this.key}resolve(e,{value:t}={}){return this.expr?t:this.key}},be=class s extends y{static grammarName="objectLiteral";static expressionType="leaf";constructor(e,t){super(),this.keyExpressions=e,this.valueExpressions=t,this.args={keys:e,values:t}}static parse(e){if(e.matchOpToken("{")){var t=[],r=[];if(!e.matchOpToken("}")){do{var i=e.requireElement("objectKey");e.requireOpToken(":");var n=e.requireElement("expression");r.push(n),t.push(i)}while(e.matchOpToken(",")&&!e.peekToken("}",0,"R_BRACE"));e.requireOpToken("}")}return new s(t,r)}}resolve(e,{keys:t,values:r}){for(var i={},n=0;n<t.length;n++)i[t[n]]=r[n];return i}},V=class s extends y{static grammarName="namedArgumentList";constructor(e,t){super(),this.fields=e,this.args={values:t}}static parseNaked(e){var t=[],r=[];if(e.currentToken().type==="IDENTIFIER")do{var i=e.requireTokenType("IDENTIFIER");e.requireOpToken(":");var n=e.requireElement("expression");r.push(n),t.push({name:i,value:n})}while(e.matchOpToken(","));return new s(t,r)}static parse(e){if(e.matchOpToken("(")){var t=s.parseNaked(e);return e.requireOpToken(")"),t}}resolve(e,{values:t}){for(var r={_namedArgList_:!0},i=0;i<t.length;i++){var n=this.fields[i];r[n.name.value]=t[i]}return r}},xe=class extends y{static grammarName="nakedNamedArgumentList";static parse=V.parseNaked},Se=class extends y{static grammarName="stringLike";static parse(e){return e.parseAnyOf(["string","nakedString"])}};var Ne=class{constructor(e,t,r,i){this.message=e,this.token=t,this.source=r,this.expected=i||null,this.line=t?.line??null,this.column=t?.column??null}},D=class extends Error{constructor(e){super(e.message),this.parseError=e}},F=class s{#t;constructor(e,t){this.#t=e,this.tokens=t}toString(){this.tokens.matched}static formatErrors(e){if(!e.length)return"";var t=e[0].source,r=t.split(` |