sveast 0.6.0 → 0.7.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.
- package/README.md +35 -3
- package/core.js +1 -1
- package/entities.js +1 -1
- package/index.d.ts +80 -0
- package/index.js +1 -1
- package/is-valid-type.js +1 -1
- package/lexer.d.ts +79 -0
- package/lexer.js +2 -0
- package/package.json +6 -1
- package/parse-imports-exports.js +1 -1
- package/parse-module.js +1 -1
- package/parse.js +1 -1
- package/{shared-y4gayx8p.js → shared-1xjsv3h6.js} +2 -2
- package/{shared-f8ty80r9.js → shared-as9can03.js} +8 -8
- package/shared-b37zemjd.js +2 -0
- package/shared-drsxcq8p.js +2 -0
- package/{shared-9f69x2q9.js → shared-g16dt48m.js} +2 -2
- package/shared-gyydaea2.js +3 -0
- package/shared-mwp38arc.js +2 -0
- package/shared-pmkdz7sc.js +3 -0
- package/shared-pt7hcxxy.js +2 -0
- package/shared-pyjcz2f8.js +12 -0
- package/shared-qnfwr59k.js +2 -0
- package/{shared-c4vs4cam.js → shared-yr6e6h72.js} +2 -2
- package/typescript.js +1 -1
- package/walk.js +1 -1
- package/shared-0ehch67h.js +0 -2
- package/shared-3xek95jd.js +0 -12
- package/shared-88pt6me6.js +0 -2
- package/shared-c1jf0gfc.js +0 -2
- package/shared-etx1q7m5.js +0 -3
- package/shared-nqsechtt.js +0 -2
- package/shared-rfyyd11j.js +0 -3
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var ht={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},pt="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",qt={5:pt,"5module":pt+" export import",6:pt+" const class extends export import super"},St=/^in(stanceof)?$/,zt=/\p{ID_Start}/u,Wt=/[\p{ID_Continue}\u200c\u200d]/u;function
|
|
2
|
-
Defaulting to 2020, but this will stop working in the future.`);i.ecmaVersion=11}else if(i.ecmaVersion>=2015)i.ecmaVersion-=2009;if(i.allowReserved==null)i.allowReserved=i.ecmaVersion<5;if(!e||e.allowHashBang==null)i.allowHashBang=i.ecmaVersion>=14;if(kt(i.onToken)){var r=i.onToken;i.onToken=function(
|
|
3
|
-
`,r-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(T).length}else this.lineStart=0;if(this.type=a.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=i.sourceType==="module",this.strict=this.inModule||i.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&i.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?B:O),this.regexpState=null,this.privateNameStack=[]},_={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};t.prototype.parse=function(){var i=this,s=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return i.parseTopLevel(s)})};_.inFunction.get=function(){return(this.currentVarScope().flags&B)>0};_.inGenerator.get=function(){return(this.currentVarScope().flags&Tt)>0};_.inAsync.get=function(){return(this.currentVarScope().flags&dt)>0};_.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var i=this.scopeStack[e],s=i.flags;if(s&(M|Q))return!1;if(s&B)return(s&dt)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};_.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&O)return!0;return!1};_.allowSuper.get=function(){var e=this.currentThisScope(),i=e.flags;return(i&rt)>0||this.options.allowSuperOutsideMethod};_.allowDirectSuper.get=function(){return(this.currentThisScope().flags&It)>0};_.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};_.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var i=this.scopeStack[e],s=i.flags;if(s&(M|Q)||s&B&&!(s&mt))return!0}return!1};_.allowUsing.get=function(){var e=this.currentScope(),i=e.flags;if(i&_t)return!1;if(!this.inModule&&i&O)return!1;return!0};_.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&M)>0};t.extend=function(){var i=[],s=arguments.length;while(s--)i[s]=arguments[s];var r=this;for(var o=0;o<i.length;o++)r=i[o](r);return r};t.parse=function(i,s){return new this(s,i).parse()};t.parseExpressionAt=function(i,s,r){var o=new this(r,i,s);return o.nextToken(),o.parseExpression()};t.tokenizer=function(i,s){return new this(s,i)};Object.defineProperties(t.prototype,_);var N=t.prototype,Xt=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;N.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){C.lastIndex=e,e+=C.exec(this.input)[0].length;var i=Xt.exec(this.input.slice(e));if(!i)return!1;if((i[1]||i[2])==="use strict"){C.lastIndex=e+i[0].length;var s=C.exec(this.input),r=s.index+s[0].length,o=this.input.charAt(r);return o===";"||o==="}"||T.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(o)||o==="!"&&this.input.charAt(r+1)==="=")}if(e+=i[0].length,C.lastIndex=e,e+=C.exec(this.input)[0].length,this.input[e]===";")e++}};N.eat=function(e){if(this.type===e)return this.next(),!0;else return!1};N.isContextual=function(e){return this.type===a.name&&this.value===e&&!this.containsEsc};N.eatContextual=function(e){if(!this.isContextual(e))return!1;return this.next(),!0};N.catchStackOverflow=function(e){try{return e()}catch(i){if(i instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(i.message)||/\btoo much recursion\b/i.test(i.message)))this.raise(this.start,"Not enough stack space to parse input");else throw i}};N.expectContextual=function(e){if(!this.eatContextual(e))this.unexpected()};N.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||T.test(this.input.slice(this.lastTokEnd,this.start))};N.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};N.semicolon=function(){if(!this.eat(a.semi)&&!this.insertSemicolon())this.unexpected()};N.afterTrailingComma=function(e,i){if(this.type===e){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!i)this.next();return!0}};N.expect=function(e){this.eat(e)||this.unexpected()};N.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};var nt=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};N.checkPatternErrors=function(e,i){if(!e)return;if(e.trailingComma>-1)this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var s=i?e.parenthesizedAssign:e.parenthesizedBind;if(s>-1)this.raiseRecoverable(s,i?"Assigning to rvalue":"Parenthesized pattern")};N.checkExpressionErrors=function(e,i){if(!e)return!1;var{shorthandAssign:s,doubleProto:r}=e;if(!i)return s>=0||r>=0;if(s>=0)this.raise(s,"Shorthand property assignments are valid only in destructuring patterns");if(r>=0)this.raiseRecoverable(r,"Redefinition of __proto__ property")};N.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};N.isSimpleAssignTarget=function(e){if(e.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(e.expression);return e.type==="Identifier"||e.type==="MemberExpression"};var f=t.prototype;f.parseTopLevel=function(e){var i=Object.create(null);if(!e.body)e.body=[];while(this.type!==a.eof){var s=this.parseStatement(null,!0,i);e.body.push(s)}if(this.inModule)for(var r=0,o=Object.keys(this.undefinedExports);r<o.length;r+=1){var h=o[r];this.raiseRecoverable(this.undefinedExports[h].start,"Export '"+h+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var yt={kind:"loop"},Jt={kind:"switch"};f.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;C.lastIndex=this.pos;var i=C.exec(this.input),s=this.pos+i[0].length,r=this.fullCharCodeAt(s);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(n(r)){var o=s;do s+=r<=65535?1:2;while(l(r=this.fullCharCodeAt(s)));if(r===92)return!0;var h=this.input.slice(o,s);if(!St.test(h))return!0}return!1};f.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;C.lastIndex=this.pos;var e=C.exec(this.input),i=this.pos+e[0].length,s;return!T.test(this.input.slice(this.pos,i))&&this.input.slice(i,i+8)==="function"&&(i+8===this.input.length||!(l(s=this.fullCharCodeAt(i+8))||s===92))};f.isUsingKeyword=function(e,i){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;C.lastIndex=this.pos;var s=C.exec(this.input),r=this.pos+s[0].length;if(T.test(this.input.slice(this.pos,r)))return!1;if(e){var o=r+5,h;if(this.input.slice(r,o)!=="using"||o===this.input.length||l(h=this.fullCharCodeAt(o))||h===92)return!1;C.lastIndex=o;var p=C.exec(this.input);if(r=o+p[0].length,p&&T.test(this.input.slice(o,r)))return!1}var c=this.fullCharCodeAt(r);if(!n(c)&&c!==92)return!1;var u=r;do r+=c<=65535?1:2;while(l(c=this.fullCharCodeAt(r)));if(c===92)return!0;var d=this.input.slice(u,r);if(St.test(d))return!1;if(i&&!e&&d==="of"){C.lastIndex=r;var x=C.exec(this.input);if(r=r+x[0].length,this.input.charCodeAt(r)!==61||(c=this.input.charCodeAt(r+1))===61||c===62)return!1}return!0};f.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};f.isUsing=function(e){return this.isUsingKeyword(!1,e)};f.parseStatement=function(e,i,s){var r=this.type,o=this.startNode(),h;if(this.isLet(e))r=a._var,h="let";switch(r){case a._break:case a._continue:return this.parseBreakContinueStatement(o,r.keyword);case a._debugger:return this.parseDebuggerStatement(o);case a._do:return this.parseDoStatement(o);case a._for:return this.parseForStatement(o);case a._function:if(e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(o,!1,!e);case a._class:if(e)this.unexpected();return this.parseClass(o,!0);case a._if:return this.parseIfStatement(o);case a._return:return this.parseReturnStatement(o);case a._switch:return this.parseSwitchStatement(o);case a._throw:return this.parseThrowStatement(o);case a._try:return this.parseTryStatement(o);case a._const:case a._var:if(h=h||this.value,e&&h!=="var")this.unexpected();return this.parseVarStatement(o,h);case a._while:return this.parseWhileStatement(o);case a._with:return this.parseWithStatement(o);case a.braceL:return this.parseBlock(!0,o);case a.semi:return this.parseEmptyStatement(o);case a._export:case a._import:if(this.options.ecmaVersion>10&&r===a._import){C.lastIndex=this.pos;var p=C.exec(this.input),c=this.pos+p[0].length,u=this.input.charCodeAt(c);if(u===40||u===46)return this.parseExpressionStatement(o,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!i)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return r===a._import?this.parseImport(o):this.parseExport(o,s);default:if(this.isAsyncFunction()){if(e)this.unexpected();return this.next(),this.parseFunctionStatement(o,!0,!e)}var d=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(d){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(e)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(d==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(o,!1,d),this.semicolon(),this.finishNode(o,"VariableDeclaration")}var x=this.value,g=this.parseExpression();if(r===a.name&&g.type==="Identifier"&&this.eat(a.colon))return this.parseLabeledStatement(o,x,g,e);else return this.parseExpressionStatement(o,g)}};f.parseBreakContinueStatement=function(e,i){var s=i==="break";if(this.next(),this.eat(a.semi)||this.insertSemicolon())e.label=null;else if(this.type!==a.name)this.unexpected();else e.label=this.parseIdent(),this.semicolon();var r=0;for(;r<this.labels.length;++r){var o=this.labels[r];if(e.label==null||o.name===e.label.name){if(o.kind!=null&&(s||o.kind==="loop"))break;if(e.label&&s)break}}if(r===this.labels.length)this.raise(e.start,"Unsyntactic "+i);return this.finishNode(e,s?"BreakStatement":"ContinueStatement")};f.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};f.parseDoStatement=function(e){if(this.next(),this.labels.push(yt),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(a._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(a.semi);else this.semicolon();return this.finishNode(e,"DoWhileStatement")};f.parseForStatement=function(e){this.next();var i=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(yt),this.enterScope(0),this.expect(a.parenL),this.type===a.semi){if(i>-1)this.unexpected(i);return this.parseFor(e,null)}var s=this.isLet();if(this.type===a._var||this.type===a._const||s){var r=this.startNode(),o=s?"let":this.value;return this.next(),this.parseVar(r,!0,o),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,i)}var h=this.isContextual("let"),p=!1,c=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(c){var u=this.startNode();if(this.next(),c==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(u,!0,c),this.finishNode(u,"VariableDeclaration"),this.parseForAfterInit(e,u,i)}var d=this.containsEsc,x=new nt,g=this.start,A=i>-1?this.parseExprSubscripts(x,"await"):this.parseExpression(!0,x);if(this.type===a._in||(p=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(i>-1){if(this.type===a._in)this.unexpected(i);e.await=!0}else if(p&&this.options.ecmaVersion>=8){if(A.start===g&&!d&&A.type==="Identifier"&&A.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)e.await=!1}if(h&&p)this.raise(A.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(A,!1,x),this.checkLValPattern(A),this.parseForIn(e,A)}else this.checkExpressionErrors(x,!0);if(i>-1)this.unexpected(i);return this.parseFor(e,A)};f.parseForAfterInit=function(e,i,s){if((this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&i.declarations.length===1){if(this.type===a._in){if((i.kind==="using"||i.kind==="await using")&&!i.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&s>-1)this.unexpected(s)}else if(this.options.ecmaVersion>=9)e.await=s>-1;return this.parseForIn(e,i)}if(s>-1)this.unexpected(s);return this.parseFor(e,i)};f.parseFunctionStatement=function(e,i,s){return this.next(),this.parseFunction(e,G|(s?0:ct),!1,i)};f.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(a._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};f.parseReturnStatement=function(e){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(a.semi)||this.insertSemicolon())e.argument=null;else e.argument=this.parseExpression(),this.semicolon();return this.finishNode(e,"ReturnStatement")};f.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(a.braceL),this.labels.push(Jt),this.enterScope(_t);var i;for(var s=!1;this.type!==a.braceR;)if(this.type===a._case||this.type===a._default){var r=this.type===a._case;if(i)this.finishNode(i,"SwitchCase");if(e.cases.push(i=this.startNode()),i.consequent=[],this.next(),r)i.test=this.parseExpression();else{if(s)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");s=!0,i.test=null}this.expect(a.colon)}else{if(!i)this.unexpected();i.consequent.push(this.parseStatement(null))}if(this.exitScope(),i)this.finishNode(i,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};f.parseThrowStatement=function(e){if(this.next(),T.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Zt=[];f.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),i=e.type==="Identifier";return this.enterScope(i?Pt:0),this.checkLValPattern(e,i?Rt:V),this.expect(a.parenR),e};f.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===a._catch){var i=this.startNode();if(this.next(),this.eat(a.parenL))i.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();i.param=null,this.enterScope(0)}i.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(i,"CatchClause")}if(e.finalizer=this.eat(a._finally)?this.parseBlock():null,!e.handler&&!e.finalizer)this.raise(e.start,"Missing catch or finally clause");return this.finishNode(e,"TryStatement")};f.parseVarStatement=function(e,i,s){return this.next(),this.parseVar(e,!1,i,s),this.semicolon(),this.finishNode(e,"VariableDeclaration")};f.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(yt),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};f.parseWithStatement=function(e){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};f.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};f.parseLabeledStatement=function(e,i,s,r){for(var o=0,h=this.labels;o<h.length;o+=1){var p=h[o];if(p.name===i)this.raise(s.start,"Label '"+i+"' is already declared")}var c=this.type.isLoop?"loop":this.type===a._switch?"switch":null;for(var u=this.labels.length-1;u>=0;u--){var d=this.labels[u];if(d.statementStart===e.start)d.statementStart=this.start,d.kind=c;else break}return this.labels.push({name:i,kind:c,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")};f.parseExpressionStatement=function(e,i){return e.expression=i,this.semicolon(),this.finishNode(e,"ExpressionStatement")};f.parseBlock=function(e,i,s){if(e===void 0)e=!0;if(i===void 0)i=this.startNode();if(i.body=[],this.expect(a.braceL),e)this.enterScope(0);while(this.type!==a.braceR){var r=this.parseStatement(null);i.body.push(r)}if(s)this.strict=!1;if(this.next(),e)this.exitScope();return this.finishNode(i,"BlockStatement")};f.parseFor=function(e,i){return e.init=i,this.expect(a.semi),e.test=this.type===a.semi?null:this.parseExpression(),this.expect(a.semi),e.update=this.type===a.parenR?null:this.parseExpression(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};f.parseForIn=function(e,i){var s=this.type===a._in;if(this.next(),i.type==="VariableDeclaration"&&i.declarations[0].init!=null&&(!s||this.options.ecmaVersion<8||this.strict||i.kind!=="var"||i.declarations[0].id.type!=="Identifier"))this.raise(i.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer");return e.left=i,e.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")};f.parseVar=function(e,i,s,r){e.declarations=[],e.kind=s;for(;;){var o=this.startNode();if(this.parseVarId(o,s),this.eat(a.eq))o.init=this.parseMaybeAssign(i);else if(!r&&s==="const"&&!(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!r&&(s==="using"||s==="await using")&&this.options.ecmaVersion>=17&&this.type!==a._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+s+" declaration");else if(!r&&o.id.type!=="Identifier"&&!(i&&(this.type===a._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else o.init=null;if(e.declarations.push(this.finishNode(o,"VariableDeclarator")),!this.eat(a.comma))break}return e};f.parseVarId=function(e,i){e.id=i==="using"||i==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,i==="var"?xt:V,!1)};var G=1,ct=2,Ft=4;f.parseFunction=function(e,i,s,r,o){if(this.initFunction(e),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r){if(this.type===a.star&&i&ct)this.unexpected();e.generator=this.eat(a.star)}if(this.options.ecmaVersion>=8)e.async=!!r;if(i&G){if(e.id=i&Ft&&this.type!==a.name?null:this.parseIdent(),e.id&&!(i&ct))this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?xt:V:Lt)}var h=this.yieldPos,p=this.awaitPos,c=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(vt(e.async,e.generator)),!(i&G))e.id=this.type===a.name?this.parseIdent():null;return this.parseFunctionParams(e),this.parseFunctionBody(e,s,!1,o),this.yieldPos=h,this.awaitPos=p,this.awaitIdentPos=c,this.finishNode(e,i&G?"FunctionDeclaration":"FunctionExpression")};f.parseFunctionParams=function(e){this.expect(a.parenL),e.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};f.parseClass=function(e,i){this.next();var s=this.strict;this.strict=!0,this.parseClassId(e,i),this.parseClassSuper(e);var r=this.enterClassBody(),o=this.startNode(),h=!1;o.body=[],this.expect(a.braceL);while(this.type!==a.braceR){var p=this.parseClassElement(e.superClass!==null);if(p){if(o.body.push(p),p.type==="MethodDefinition"&&p.kind==="constructor"){if(h)this.raiseRecoverable(p.start,"Duplicate constructor in the same class");h=!0}else if(p.key&&p.key.type==="PrivateIdentifier"&&$t(r,p))this.raiseRecoverable(p.key.start,"Identifier '#"+p.key.name+"' has already been declared")}}return this.strict=s,this.next(),e.body=this.finishNode(o,"ClassBody"),this.exitClassBody(),this.finishNode(e,i?"ClassDeclaration":"ClassExpression")};f.parseClassElement=function(e){if(this.eat(a.semi))return null;var i=this.options.ecmaVersion,s=this.startNode(),r="",o=!1,h=!1,p="method",c=!1;if(this.eatContextual("static")){if(i>=13&&this.eat(a.braceL))return this.parseClassStaticBlock(s),s;if(this.isClassElementNameStart()||this.type===a.star)c=!0;else r="static"}if(s.static=c,!r&&i>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===a.star)&&!this.canInsertSemicolon())h=!0;else r="async";if(!r&&(i>=9||!h)&&this.eat(a.star))o=!0;if(!r&&!h&&!o){var u=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())p=u;else r=u}if(r)s.computed=!1,s.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),s.key.name=r,this.finishNode(s.key,"Identifier");else this.parseClassElementName(s);if(i<13||this.type===a.parenL||p!=="method"||o||h){var d=!s.static&&tt(s,"constructor"),x=d&&e;if(d&&p!=="method")this.raise(s.key.start,"Constructor can't have get/set modifier");s.kind=d?"constructor":p,this.parseClassMethod(s,o,h,x)}else this.parseClassField(s);return s};f.isClassElementNameStart=function(){return this.type===a.name||this.type===a.privateId||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword};f.parseClassElementName=function(e){if(this.type===a.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");e.computed=!1,e.key=this.parsePrivateIdent()}else this.parsePropertyName(e)};f.parseClassMethod=function(e,i,s,r){var o=e.key;if(e.kind==="constructor"){if(i)this.raise(o.start,"Constructor can't be a generator");if(s)this.raise(o.start,"Constructor can't be an async method")}else if(e.static&&tt(e,"prototype"))this.raise(o.start,"Classes may not have a static property named prototype");var h=e.value=this.parseMethod(i,s,r);if(e.kind==="get"&&h.params.length!==0)this.raiseRecoverable(h.start,"getter should have no params");if(e.kind==="set"&&h.params.length!==1)this.raiseRecoverable(h.start,"setter should have exactly one param");if(e.kind==="set"&&h.params[0].type==="RestElement")this.raiseRecoverable(h.params[0].start,"Setter cannot use rest params");return this.finishNode(e,"MethodDefinition")};f.parseClassField=function(e){if(tt(e,"constructor"))this.raise(e.key.start,"Classes can't have a field named 'constructor'");else if(e.static&&tt(e,"prototype"))this.raise(e.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(a.eq))this.enterScope(Q|rt),e.value=this.parseMaybeAssign(),this.exitScope();else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};f.parseClassStaticBlock=function(e){e.body=[];var i=this.labels;this.labels=[],this.enterScope(M|rt);while(this.type!==a.braceR){var s=this.parseStatement(null);e.body.push(s)}return this.next(),this.exitScope(),this.labels=i,this.finishNode(e,"StaticBlock")};f.parseClassId=function(e,i){if(this.type===a.name){if(e.id=this.parseIdent(),i)this.checkLValSimple(e.id,V,!1)}else{if(i===!0)this.unexpected();e.id=null}};f.parseClassSuper=function(e){e.superClass=this.eat(a._extends)?this.parseExprSubscripts(null,!1):null};f.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};f.exitClassBody=function(){var e=this.privateNameStack.pop(),{declared:i,used:s}=e;if(!this.options.checkPrivateFields)return;var r=this.privateNameStack.length,o=r===0?null:this.privateNameStack[r-1];for(var h=0;h<s.length;++h){var p=s[h];if(!Y(i,p.name))if(o)o.used.push(p);else this.raiseRecoverable(p.start,"Private field '#"+p.name+"' must be declared in an enclosing class")}};function $t(e,i){var s=i.key.name,r=e[s],o="true";if(i.type==="MethodDefinition"&&(i.kind==="get"||i.kind==="set"))o=(i.static?"s":"i")+i.kind;if(r==="iget"&&o==="iset"||r==="iset"&&o==="iget"||r==="sget"&&o==="sset"||r==="sset"&&o==="sget")return e[s]="true",!1;else if(!r)return e[s]=o,!1;else return!0}function tt(e,i){var{computed:s,key:r}=e;return!s&&(r.type==="Identifier"&&r.name===i||r.type==="Literal"&&r.value===i)}f.parseExportAllDeclaration=function(e,i){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))e.exported=this.parseModuleExportName(),this.checkExport(i,e.exported,this.lastTokStart);else e.exported=null;if(this.expectContextual("from"),this.type!==a.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};f.parseExport=function(e,i){if(this.next(),this.eat(a.star))return this.parseExportAllDeclaration(e,i);if(this.eat(a._default))return this.checkExport(i,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration")this.checkVariableExport(i,e.declaration.declarations);else this.checkExport(i,e.declaration.id,e.declaration.id.start);if(e.specifiers=[],e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(i),this.eatContextual("from")){if(this.type!==a.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause()}else{for(var s=0,r=e.specifiers;s<r.length;s+=1){var o=r[s];if(this.checkUnreserved(o.local),this.checkLocalExport(o.local),o.local.type==="Literal")this.raise(o.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};f.parseExportDeclaration=function(e){return this.parseStatement(null)};f.parseExportDefaultDeclaration=function(){var e;if(this.type===a._function||(e=this.isAsyncFunction())){var i=this.startNode();if(this.next(),e)this.next();return this.parseFunction(i,G|Ft,!1,e)}else if(this.type===a._class){var s=this.startNode();return this.parseClass(s,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}};f.checkExport=function(e,i,s){if(!e)return;if(typeof i!=="string")i=i.type==="Identifier"?i.name:i.value;if(Y(e,i))this.raiseRecoverable(s,"Duplicate export '"+i+"'");e[i]=!0};f.checkPatternExport=function(e,i){var s=i.type;if(s==="Identifier")this.checkExport(e,i,i.start);else if(s==="ObjectPattern")for(var r=0,o=i.properties;r<o.length;r+=1){var h=o[r];this.checkPatternExport(e,h)}else if(s==="ArrayPattern")for(var p=0,c=i.elements;p<c.length;p+=1){var u=c[p];if(u)this.checkPatternExport(e,u)}else if(s==="Property")this.checkPatternExport(e,i.value);else if(s==="AssignmentPattern")this.checkPatternExport(e,i.left);else if(s==="RestElement")this.checkPatternExport(e,i.argument)};f.checkVariableExport=function(e,i){if(!e)return;for(var s=0,r=i;s<r.length;s+=1){var o=r[s];this.checkPatternExport(e,o.id)}};f.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};f.parseExportSpecifier=function(e){var i=this.startNode();return i.local=this.parseModuleExportName(),i.exported=this.eatContextual("as")?this.parseModuleExportName():i.local,this.checkExport(e,i.exported,i.exported.start),this.finishNode(i,"ExportSpecifier")};f.parseExportSpecifiers=function(e){var i=[],s=!0;this.expect(a.braceL);while(!this.eat(a.braceR)){if(!s){if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break}else s=!1;i.push(this.parseExportSpecifier(e))}return i};f.parseImport=function(e){if(this.next(),this.type===a.string)e.specifiers=Zt,e.source=this.parseExprAtom();else e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===a.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ImportDeclaration")};f.parseImportSpecifier=function(){var e=this.startNode();if(e.imported=this.parseModuleExportName(),this.eatContextual("as"))e.local=this.parseIdent();else this.checkUnreserved(e.imported),e.local=e.imported;return this.checkLValSimple(e.local,V),this.finishNode(e,"ImportSpecifier")};f.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,V),this.finishNode(e,"ImportDefaultSpecifier")};f.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,V),this.finishNode(e,"ImportNamespaceSpecifier")};f.parseImportSpecifiers=function(){var e=[],i=!0;if(this.type===a.name){if(e.push(this.parseImportDefaultSpecifier()),!this.eat(a.comma))return e}if(this.type===a.star)return e.push(this.parseImportNamespaceSpecifier()),e;this.expect(a.braceL);while(!this.eat(a.braceR)){if(!i){if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break}else i=!1;e.push(this.parseImportSpecifier())}return e};f.parseWithClause=function(){var e=[];if(!this.eat(a._with))return e;this.expect(a.braceL);var i={},s=!0;while(!this.eat(a.braceR)){if(!s){if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break}else s=!1;var r=this.parseImportAttribute(),o=r.key.type==="Identifier"?r.key.name:r.key.value;if(Y(i,o))this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+o+"'");i[o]=!0,e.push(r)}return e};f.parseImportAttribute=function(){var e=this.startNode();if(e.key=this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(a.colon),this.type!==a.string)this.unexpected();return e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};f.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===a.string){var e=this.parseLiteral(this.value);if(Yt.test(e.value))this.raise(e.start,"An export name cannot include a lone surrogate.");return e}return this.parseIdent(!0)};f.adaptDirectivePrologue=function(e){for(var i=0;i<e.length&&this.isDirectiveCandidate(e[i]);++i)e[i].directive=e[i].expression.raw.slice(1,-1)};f.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value==="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var L=t.prototype;L.toAssignable=function(e,i,s){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":if(this.inAsync&&e.name==="await")this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(e.type="ObjectPattern",s)this.checkPatternErrors(s,!0);for(var r=0,o=e.properties;r<o.length;r+=1){var h=o[r];if(this.toAssignable(h,i),h.type==="RestElement"&&(h.argument.type==="ArrayPattern"||h.argument.type==="ObjectPattern"))this.raise(h.argument.start,"Unexpected token")}break;case"Property":if(e.kind!=="init")this.raise(e.key.start,"Object pattern can't contain getter or setter");this.toAssignable(e.value,i);break;case"ArrayExpression":if(e.type="ArrayPattern",s)this.checkPatternErrors(s,!0);this.toAssignableList(e.elements,i);break;case"SpreadElement":if(e.type="RestElement",this.toAssignable(e.argument,i),e.argument.type==="AssignmentPattern")this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(e.operator!=="=")this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,i);break;case"ParenthesizedExpression":this.toAssignable(e.expression,i,s);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!i)break;default:this.raise(e.start,"Assigning to rvalue")}else if(s)this.checkPatternErrors(s,!0);return e};L.toAssignableList=function(e,i){var s=e.length;for(var r=0;r<s;r++){var o=e[r];if(o)this.toAssignable(o,i)}if(s){var h=e[s-1];if(this.options.ecmaVersion===6&&i&&h&&h.type==="RestElement"&&h.argument.type!=="Identifier")this.unexpected(h.argument.start)}return e};L.parseSpread=function(e){var i=this.startNode();return this.next(),i.argument=this.parseMaybeAssign(!1,e),this.finishNode(i,"SpreadElement")};L.parseRestBinding=function(){var e=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==a.name)this.unexpected();return e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};L.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case a.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(a.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case a.braceL:return this.parseObj(!0)}return this.parseIdent()};L.parseBindingList=function(e,i,s,r){var o=[],h=!0;while(!this.eat(e)){if(h)h=!1;else this.expect(a.comma);if(i&&this.type===a.comma)o.push(null);else if(s&&this.afterTrailingComma(e))break;else if(this.type===a.ellipsis){var p=this.parseRestBinding();if(this.parseBindingListItem(p),o.push(p),this.type===a.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(e);break}else o.push(this.parseAssignableListItem(r))}return o};L.parseAssignableListItem=function(e){var i=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(i),i};L.parseBindingListItem=function(e){return e};L.parseMaybeDefault=function(e,i,s){if(s=s||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(a.eq))return s;var r=this.startNodeAt(e,i);return r.left=s,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};L.checkLValSimple=function(e,i,s){if(i===void 0)i=Z;var r=i!==Z;switch(e.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(e.name))this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode");if(r){if(i===V&&e.name==="let")this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name");if(s){if(Y(s,e.name))this.raiseRecoverable(e.start,"Argument name clash");s[e.name]=!0}if(i!==Vt)this.declareName(e.name,i,e.start)}break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(r)this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":if(r)this.raiseRecoverable(e.start,"Binding parenthesized expression");return this.checkLValSimple(e.expression,i,s);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};L.checkLValPattern=function(e,i,s){if(i===void 0)i=Z;switch(e.type){case"ObjectPattern":for(var r=0,o=e.properties;r<o.length;r+=1){var h=o[r];this.checkLValInnerPattern(h,i,s)}break;case"ArrayPattern":for(var p=0,c=e.elements;p<c.length;p+=1){var u=c[p];if(u)this.checkLValInnerPattern(u,i,s)}break;default:this.checkLValSimple(e,i,s)}};L.checkLValInnerPattern=function(e,i,s){if(i===void 0)i=Z;switch(e.type){case"Property":this.checkLValInnerPattern(e.value,i,s);break;case"AssignmentPattern":this.checkLValPattern(e.left,i,s);break;case"RestElement":this.checkLValPattern(e.argument,i,s);break;default:this.checkLValPattern(e,i,s)}};var R=function(i,s,r,o,h){this.token=i,this.isExpr=!!s,this.preserveSpace=!!r,this.override=o,this.generator=!!h},w={b_stat:new R("{",!1),b_expr:new R("{",!0),b_tmpl:new R("${",!1),p_stat:new R("(",!1),p_expr:new R("(",!0),q_tmpl:new R("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new R("function",!1),f_expr:new R("function",!0),f_expr_gen:new R("function",!0,!1,null,!0),f_gen:new R("function",!1,!1,null,!0)},W=t.prototype;W.initialContext=function(){return[w.b_stat]};W.curContext=function(){return this.context[this.context.length-1]};W.braceIsBlock=function(e){var i=this.curContext();if(i===w.f_expr||i===w.f_stat)return!0;if(e===a.colon&&(i===w.b_stat||i===w.b_expr))return!i.isExpr;if(e===a._return||e===a.name&&this.exprAllowed)return T.test(this.input.slice(this.lastTokEnd,this.start));if(e===a._else||e===a.semi||e===a.eof||e===a.parenR||e===a.arrow)return!0;if(e===a.braceL)return i===w.b_stat;if(e===a._var||e===a._const||e===a.name)return!1;return!this.exprAllowed};W.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var i=this.context[e];if(i.token==="function")return i.generator}return!1};W.updateContext=function(e){var i,s=this.type;if(s.keyword&&e===a.dot)this.exprAllowed=!1;else if(i=s.updateContext)i.call(this,e);else this.exprAllowed=s.beforeExpr};W.overrideContext=function(e){if(this.curContext()!==e)this.context[this.context.length-1]=e};a.parenR.updateContext=a.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();if(e===w.b_stat&&this.curContext().token==="function")e=this.context.pop();this.exprAllowed=!e.isExpr};a.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?w.b_stat:w.b_expr),this.exprAllowed=!0};a.dollarBraceL.updateContext=function(){this.context.push(w.b_tmpl),this.exprAllowed=!0};a.parenL.updateContext=function(e){var i=e===a._if||e===a._for||e===a._with||e===a._while;this.context.push(i?w.p_stat:w.p_expr),this.exprAllowed=!0};a.incDec.updateContext=function(){};a._function.updateContext=a._class.updateContext=function(e){if(e.beforeExpr&&e!==a._else&&!(e===a.semi&&this.curContext()!==w.p_stat)&&!(e===a._return&&T.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===a.colon||e===a.braceL)&&this.curContext()===w.b_stat))this.context.push(w.f_expr);else this.context.push(w.f_stat);this.exprAllowed=!1};a.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};a.backQuote.updateContext=function(){if(this.curContext()===w.q_tmpl)this.context.pop();else this.context.push(w.q_tmpl);this.exprAllowed=!1};a.star.updateContext=function(e){if(e===a._function){var i=this.context.length-1;if(this.context[i]===w.f_expr)this.context[i]=w.f_expr_gen;else this.context[i]=w.f_gen}this.exprAllowed=!0};a.name.updateContext=function(e){var i=!1;if(this.options.ecmaVersion>=6&&e!==a.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())i=!0}this.exprAllowed=i};var m=t.prototype;m.checkPropClash=function(e,i,s){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))return;var r=e.key,o;switch(r.type){case"Identifier":o=r.name;break;case"Literal":o=String(r.value);break;default:return}var h=e.kind;if(this.options.ecmaVersion>=6){if(o==="__proto__"&&h==="init"){if(i.proto)if(s){if(s.doubleProto<0)s.doubleProto=r.start}else this.raiseRecoverable(r.start,"Redefinition of __proto__ property");i.proto=!0}return}o="$"+o;var p=i[o];if(p){var c;if(h==="init")c=this.strict&&p.init||p.get||p.set;else c=p.init||p[h];if(c)this.raiseRecoverable(r.start,"Redefinition of property")}else p=i[o]={init:!1,get:!1,set:!1};p[h]=!0};m.parseExpression=function(e,i){var s=this;return this.catchStackOverflow(function(){var{start:r,startLoc:o}=s,h=s.parseMaybeAssign(e,i);if(s.type===a.comma){var p=s.startNodeAt(r,o);p.expressions=[h];while(s.eat(a.comma))p.expressions.push(s.parseMaybeAssign(e,i));return s.finishNode(p,"SequenceExpression")}return h})};m.parseMaybeAssign=function(e,i,s){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(e);else this.exprAllowed=!1;var r=!1,o=-1,h=-1,p=-1;if(i)o=i.parenthesizedAssign,h=i.trailingComma,p=i.doubleProto,i.parenthesizedAssign=i.trailingComma=-1;else i=new nt,r=!0;var c=this.start,u=this.startLoc;if(this.type===a.parenL||this.type===a.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await";var d=this.parseMaybeConditional(e,i);if(s)d=s.call(this,d,c,u);if(this.type.isAssign){var x=this.startNodeAt(c,u);if(x.operator=this.value,this.type===a.eq)d=this.toAssignable(d,!1,i);if(!r)i.parenthesizedAssign=i.trailingComma=i.doubleProto=-1;if(i.shorthandAssign>=d.start)i.shorthandAssign=-1;if(this.type===a.eq)this.checkLValPattern(d);else this.checkLValSimple(d);if(x.left=d,this.next(),x.right=this.parseMaybeAssign(e),p>-1)i.doubleProto=p;return this.finishNode(x,"AssignmentExpression")}else if(r)this.checkExpressionErrors(i,!0);if(o>-1)i.parenthesizedAssign=o;if(h>-1)i.trailingComma=h;return d};m.parseMaybeConditional=function(e,i){var s=this.start,r=this.startLoc,o=this.parseExprOps(e,i);if(this.checkExpressionErrors(i))return o;if(!(o.type==="ArrowFunctionExpression"&&o.start===s)&&this.eat(a.question)){var h=this.startNodeAt(s,r);return h.test=o,h.consequent=this.parseMaybeAssign(),this.expect(a.colon),h.alternate=this.parseMaybeAssign(e),this.finishNode(h,"ConditionalExpression")}return o};m.parseExprOps=function(e,i){var s=this.start,r=this.startLoc,o=this.parseMaybeUnary(i,!1,!1,e);if(this.checkExpressionErrors(i))return o;return o.start===s&&o.type==="ArrowFunctionExpression"?o:this.parseExprOp(o,s,r,-1,e)};m.parseExprOp=function(e,i,s,r,o){var h=this.type.binop;if(h!=null&&(!o||this.type!==a._in)){if(h>r){var p=this.type===a.logicalOR||this.type===a.logicalAND,c=this.type===a.coalesce;if(c)h=a.logicalAND.binop;var u=this.value;this.next();var d=this.start,x=this.startLoc,g=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,o),d,x,h,o),A=this.buildBinary(i,s,e,g,u,p||c);if(p&&this.type===a.coalesce||c&&(this.type===a.logicalOR||this.type===a.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(A,i,s,r,o)}}return e};m.buildBinary=function(e,i,s,r,o,h){if(r.type==="PrivateIdentifier")this.raise(r.start,"Private identifier can only be left side of binary expression");var p=this.startNodeAt(e,i);return p.left=s,p.operator=o,p.right=r,this.finishNode(p,h?"LogicalExpression":"BinaryExpression")};m.parseMaybeUnary=function(e,i,s,r){var o=this.start,h=this.startLoc,p;if(this.isContextual("await")&&this.canAwait)p=this.parseAwait(r),i=!0;else if(this.type.prefix){var c=this.startNode(),u=this.type===a.incDec;if(c.operator=this.value,c.prefix=!0,this.next(),c.argument=this.parseMaybeUnary(null,!0,u,r),this.checkExpressionErrors(e,!0),u)this.checkLValSimple(c.argument);else if(this.strict&&c.operator==="delete"&&Ot(c.argument))this.raiseRecoverable(c.start,"Deleting local variable in strict mode");else if(c.operator==="delete"&&ut(c.argument))this.raiseRecoverable(c.start,"Private fields can not be deleted");else i=!0;p=this.finishNode(c,u?"UpdateExpression":"UnaryExpression")}else if(!i&&this.type===a.privateId){if((r||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(p=this.parsePrivateIdent(),this.type!==a._in)this.unexpected()}else{if(p=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return p;while(this.type.postfix&&!this.canInsertSemicolon()){var d=this.startNodeAt(o,h);d.operator=this.value,d.prefix=!1,d.argument=p,this.checkLValSimple(p),this.next(),p=this.finishNode(d,"UpdateExpression")}}if(!s&&!(p.type==="ArrowFunctionExpression"&&p.start===o)&&this.eat(a.starstar))if(i)this.unexpected(this.lastTokStart);else return this.buildBinary(o,h,p,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return p};function Ot(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Ot(e.expression)}function ut(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&ut(e.expression)||e.type==="ParenthesizedExpression"&&ut(e.expression)}m.parseExprSubscripts=function(e,i){var s=this.start,r=this.startLoc,o=this.parseExprAtom(e,i);if(o.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return o;var h=this.parseSubscripts(o,s,r,!1,i);if(e&&h.type==="MemberExpression"){if(e.parenthesizedAssign>=h.start)e.parenthesizedAssign=-1;if(e.parenthesizedBind>=h.start)e.parenthesizedBind=-1;if(e.trailingComma>=h.start)e.trailingComma=-1}return h};m.parseSubscripts=function(e,i,s,r,o){var h=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,p=!1;while(!0){var c=this.parseSubscript(e,i,s,r,h,p,o);if(c.optional)p=!0;if(c===e||c.type==="ArrowFunctionExpression"){if(p){var u=this.startNodeAt(i,s);u.expression=c,c=this.finishNode(u,"ChainExpression")}return c}e=c}};m.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(a.arrow)};m.parseSubscriptAsyncArrow=function(e,i,s,r){return this.parseArrowExpression(this.startNodeAt(e,i),s,!0,r)};m.parseSubscript=function(e,i,s,r,o,h,p){var c=this.options.ecmaVersion>=11,u=c&&this.eat(a.questionDot);if(r&&u)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var d=this.eat(a.bracketL);if(d||u&&this.type!==a.parenL&&this.type!==a.backQuote||this.eat(a.dot)){var x=this.startNodeAt(i,s);if(x.object=e,d)x.property=this.parseExpression(),this.expect(a.bracketR);else if(this.type===a.privateId&&e.type!=="Super")x.property=this.parsePrivateIdent();else x.property=this.parseIdent(this.options.allowReserved!=="never");if(x.computed=!!d,c)x.optional=u;e=this.finishNode(x,"MemberExpression")}else if(!r&&this.eat(a.parenL)){var g=new nt,A=this.yieldPos,j=this.awaitPos,D=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var X=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1,g);if(o&&!u&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(g,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=A,this.awaitPos=j,this.awaitIdentPos=D,this.parseSubscriptAsyncArrow(i,s,X,p)}this.checkExpressionErrors(g,!0),this.yieldPos=A||this.yieldPos,this.awaitPos=j||this.awaitPos,this.awaitIdentPos=D||this.awaitIdentPos;var U=this.startNodeAt(i,s);if(U.callee=e,U.arguments=X,c)U.optional=u;e=this.finishNode(U,"CallExpression")}else if(this.type===a.backQuote){if(u||h)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var q=this.startNodeAt(i,s);q.tag=e,q.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(q,"TaggedTemplateExpression")}return e};m.parseExprAtom=function(e,i,s){if(this.type===a.slash)this.readRegexp();var r,o=this.potentialArrowAt===this.start;switch(this.type){case a._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(r=this.startNode(),this.next(),this.type===a.parenL&&!this.allowDirectSuper)this.raise(r.start,"super() call outside constructor of a subclass");if(this.type!==a.dot&&this.type!==a.bracketL&&this.type!==a.parenL)this.unexpected();return this.finishNode(r,"Super");case a._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case a.name:var h=this.start,p=this.startLoc,c=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!c&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(w.f_expr),this.parseFunction(this.startNodeAt(h,p),0,!1,!0,i);if(o&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(h,p),[u],!1,i);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===a.name&&!c&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(u=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(a.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(h,p),[u],!0,i)}}return u;case a.regexp:var d=this.value;return r=this.parseLiteral(d.value),r.regex={pattern:d.pattern,flags:d.flags},r;case a.num:case a.string:return this.parseLiteral(this.value);case a._null:case a._true:case a._false:return r=this.startNode(),r.value=this.type===a._null?null:this.type===a._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case a.parenL:var x=this.start,g=this.parseParenAndDistinguishExpression(o,i);if(e){if(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(g))e.parenthesizedAssign=x;if(e.parenthesizedBind<0)e.parenthesizedBind=x}return g;case a.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(a.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case a.braceL:return this.overrideContext(w.b_expr),this.parseObj(!1,e);case a._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case a._class:return this.parseClass(this.startNode(),!1);case a._new:return this.parseNew();case a.backQuote:return this.parseTemplate();case a._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(s);else return this.unexpected();default:return this.parseExprAtomDefault()}};m.parseExprAtomDefault=function(){this.unexpected()};m.parseExprImport=function(e){var i=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===a.parenL&&!e)return this.parseDynamicImport(i);else if(this.type===a.dot){var s=this.startNodeAt(i.start,i.loc&&i.loc.start);return s.name="import",i.meta=this.finishNode(s,"Identifier"),this.parseImportMeta(i)}else this.unexpected()};m.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(a.parenR))if(this.expect(a.comma),!this.afterTrailingComma(a.parenR)){if(e.options=this.parseMaybeAssign(),!this.eat(a.parenR)){if(this.expect(a.comma),!this.afterTrailingComma(a.parenR))this.unexpected()}}else e.options=null;else e.options=null;else if(!this.eat(a.parenR)){var i=this.start;if(this.eat(a.comma)&&this.eat(a.parenR))this.raiseRecoverable(i,"Trailing comma is not allowed in import()");else this.unexpected(i)}return this.finishNode(e,"ImportExpression")};m.parseImportMeta=function(e){this.next();var i=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="meta")this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'");if(i)this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module");return this.finishNode(e,"MetaProperty")};m.parseLiteral=function(e){var i=this.startNode();if(i.value=e,i.raw=this.input.slice(this.start,this.end),i.raw.charCodeAt(i.raw.length-1)===110)i.bigint=i.value!=null?i.value.toString():i.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(i,"Literal")};m.parseParenExpression=function(){this.expect(a.parenL);var e=this.parseExpression();return this.expect(a.parenR),e};m.shouldParseArrow=function(e){return!this.canInsertSemicolon()};m.parseParenAndDistinguishExpression=function(e,i){var s=this.start,r=this.startLoc,o,h=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var p=this.start,c=this.startLoc,u=[],d=!0,x=!1,g=new nt,A=this.yieldPos,j=this.awaitPos,D;this.yieldPos=0,this.awaitPos=0;while(this.type!==a.parenR)if(d?d=!1:this.expect(a.comma),h&&this.afterTrailingComma(a.parenR,!0)){x=!0;break}else if(this.type===a.ellipsis){if(D=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===a.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,g,this.parseParenItem));var X=this.lastTokEnd,U=this.lastTokEndLoc;if(this.expect(a.parenR),e&&this.shouldParseArrow(u)&&this.eat(a.arrow))return this.checkPatternErrors(g,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=A,this.awaitPos=j,this.parseParenArrowList(s,r,u,i);if(!u.length||x)this.unexpected(this.lastTokStart);if(D)this.unexpected(D);if(this.checkExpressionErrors(g,!0),this.yieldPos=A||this.yieldPos,this.awaitPos=j||this.awaitPos,u.length>1)o=this.startNodeAt(p,c),o.expressions=u,this.finishNodeAt(o,"SequenceExpression",X,U);else o=u[0]}else o=this.parseParenExpression();if(this.options.preserveParens){var q=this.startNodeAt(s,r);return q.expression=o,this.finishNode(q,"ParenthesizedExpression")}else return o};m.parseParenItem=function(e){return e};m.parseParenArrowList=function(e,i,s,r){return this.parseArrowExpression(this.startNodeAt(e,i),s,!1,r)};var te=[];m.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===a.dot){var i=this.startNodeAt(e.start,e.loc&&e.loc.start);i.name="new",e.meta=this.finishNode(i,"Identifier"),this.next();var s=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="target")this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'");if(s)this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block");return this.finishNode(e,"MetaProperty")}var r=this.start,o=this.startLoc;if(e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,o,!0,!1),e.callee.type==="Super")this.raiseRecoverable(r,"Invalid use of 'super'");if(this.eat(a.parenL))e.arguments=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1);else e.arguments=te;return this.finishNode(e,"NewExpression")};m.parseTemplateElement=function(e){var i=e.isTagged,s=this.startNode();if(this.type===a.invalidTemplate){if(!i)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");s.value={raw:this.value.replace(/\r\n?/g,`
|
|
1
|
+
var ht={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},pt="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",qt={5:pt,"5module":pt+" export import",6:pt+" const class extends export import super"},St=/^in(stanceof)?$/,zt=/\p{ID_Start}/u,Wt=/[\p{ID_Continue}\u200c\u200d]/u;function o(e,i){if(e<65)return e===36;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e>65535&&i===!1)return!1;return e>=170&&zt.test(String.fromCodePoint(e))}function c(e,i){if(e<48)return e===36;if(e<58)return!0;if(e<65)return!1;if(e<91)return!0;if(e<97)return e===95;if(e<123)return!0;if(e>65535&&i===!1)return!1;return e>=170&&Wt.test(String.fromCodePoint(e))}var b=function(i,s){if(s===void 0)s={};this.label=i,this.keyword=s.keyword,this.beforeExpr=!!s.beforeExpr,this.startsExpr=!!s.startsExpr,this.isLoop=!!s.isLoop,this.isAssign=!!s.isAssign,this.prefix=!!s.prefix,this.postfix=!!s.postfix,this.binop=s.binop||null,this.updateContext=null};function P(e,i){return new b(e,{beforeExpr:!0,binop:i})}var I={beforeExpr:!0},N={startsExpr:!0},ft={};function y(e,i){if(i===void 0)i={};return i.keyword=e,ft[e]=new b(e,i)}var a={num:new b("num",N),regexp:new b("regexp",N),string:new b("string",N),name:new b("name",N),privateId:new b("privateId",N),eof:new b("eof"),bracketL:new b("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new b("]"),braceL:new b("{",{beforeExpr:!0,startsExpr:!0}),braceR:new b("}"),parenL:new b("(",{beforeExpr:!0,startsExpr:!0}),parenR:new b(")"),comma:new b(",",I),semi:new b(";",I),colon:new b(":",I),dot:new b("."),question:new b("?",I),questionDot:new b("?."),arrow:new b("=>",I),template:new b("template"),invalidTemplate:new b("invalidTemplate"),ellipsis:new b("...",I),backQuote:new b("`",N),dollarBraceL:new b("${",{beforeExpr:!0,startsExpr:!0}),eq:new b("=",{beforeExpr:!0,isAssign:!0}),assign:new b("_=",{beforeExpr:!0,isAssign:!0}),incDec:new b("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new b("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:P("||",1),logicalAND:P("&&",2),bitwiseOR:P("|",3),bitwiseXOR:P("^",4),bitwiseAND:P("&",5),equality:P("==/!=/===/!==",6),relational:P("</>/<=/>=",7),bitShift:P("<</>>/>>>",8),plusMin:new b("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:P("%",10),star:P("*",10),slash:P("/",10),starstar:new b("**",{beforeExpr:!0}),coalesce:P("??",1),_break:y("break"),_case:y("case",I),_catch:y("catch"),_continue:y("continue"),_debugger:y("debugger"),_default:y("default",I),_do:y("do",{isLoop:!0,beforeExpr:!0}),_else:y("else",I),_finally:y("finally"),_for:y("for",{isLoop:!0}),_function:y("function",N),_if:y("if"),_return:y("return",I),_switch:y("switch"),_throw:y("throw",I),_try:y("try"),_var:y("var"),_const:y("const"),_while:y("while",{isLoop:!0}),_with:y("with"),_new:y("new",{beforeExpr:!0,startsExpr:!0}),_this:y("this",N),_super:y("super",N),_class:y("class",N),_extends:y("extends",I),_export:y("export"),_import:y("import",N),_null:y("null",N),_true:y("true",N),_false:y("false",N),_in:y("in",{beforeExpr:!0,binop:7}),_instanceof:y("instanceof",{beforeExpr:!0,binop:7}),_typeof:y("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:y("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:y("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},T=/\r\n?|\n|\u2028|\u2029/,jt=new RegExp(T.source,"g");function z(e){return e===10||e===13||e===8232||e===8233}function Ct(e,i,s){if(s===void 0)s=e.length;for(var r=i;r<s;r++){var n=e.charCodeAt(r);if(z(n))return r<s-1&&n===13&&e.charCodeAt(r+1)===10?r+2:r+1}return-1}var At=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,w=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Nt=Object.prototype,{hasOwnProperty:Gt,toString:Ht}=Nt,Y=Object.hasOwn||function(e,i){return Gt.call(e,i)},kt=Array.isArray||function(e){return Ht.call(e)==="[object Array]"},gt=Object.create(null);function J(e){return gt[e]||(gt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function it(e){if(e<=65535)return String.fromCharCode(e);return e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320)}var Yt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,H=function(i,s){this.line=i,this.column=s};H.prototype.offset=function(i){return new H(this.line,this.column+i)};var st=function(i,s,r){if(this.start=s,this.end=r,i.sourceFile!==null)this.source=i.sourceFile};function Et(e,i){for(var s=1,r=0;;){var n=Ct(e,r,i);if(n<0)return new H(s,i-r);++s,r=n}}var lt={ecmaVersion:null,sourceType:"script",strict:!1,onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,startLocation:null,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},wt=!1;function Qt(e){var i={};for(var s in lt)i[s]=e&&Y(e,s)?e[s]:lt[s];if(i.ecmaVersion==="latest")i.ecmaVersion=1e8;else if(i.ecmaVersion==null){if(!wt&&typeof console==="object"&&console.warn)wt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2
|
+
Defaulting to 2020, but this will stop working in the future.`);i.ecmaVersion=11}else if(i.ecmaVersion>=2015)i.ecmaVersion-=2009;if(i.allowReserved==null)i.allowReserved=i.ecmaVersion<5;if(!e||e.allowHashBang==null)i.allowHashBang=i.ecmaVersion>=14;if(kt(i.onToken)){var r=i.onToken;i.onToken=function(n){return r.push(n)}}if(kt(i.onComment))i.onComment=Kt(i,i.onComment);if(i.sourceType==="commonjs"&&i.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return i}function Kt(e,i){return function(s,r,n,h,p,l){var u={type:s?"Block":"Line",value:r,start:n,end:h};if(e.locations)u.loc=new st(this,p,l);if(e.ranges)u.range=[n,h];i.push(u)}}var O=1,B=2,dt=4,Tt=8,mt=16,Pt=32,rt=64,It=128,M=256,Q=512,_t=1024,at=O|B|M;function vt(e,i){return B|(e?dt:0)|(i?Tt:0)}var Z=0,xt=1,V=2,Lt=3,Rt=4,Vt=5,t=function(i,s,r){this.options=i=Qt(i),this.sourceFile=i.sourceFile,this.keywords=J(qt[i.ecmaVersion>=6?6:i.sourceType==="module"?"5module":5]);var n="";if(i.allowReserved!==!0){if(n=ht[i.ecmaVersion>=6?6:i.ecmaVersion===5?5:3],i.sourceType==="module")n+=" await"}this.reservedWords=J(n);var h=(n?n+" ":"")+ht.strict;if(this.reservedWordsStrict=J(h),this.reservedWordsStrictBind=J(h+" "+ht.strictBind),this.input=String(s),this.containsEsc=!1,this.pos=r||0,this.curLine=1,i.startLocation)this.lineStart=this.pos-i.startLocation.column,this.curLine=i.startLocation.line;else if(r){if(this.lineStart=this.input.lastIndexOf(`
|
|
3
|
+
`,r-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(T).length}else this.lineStart=0;if(this.type=a.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=i.sourceType==="module",this.strict=this.inModule||i.strict===!0||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&i.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?B:O),this.regexpState=null,this.privateNameStack=[]},_={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowReturn:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},allowUsing:{configurable:!0},inClassStaticBlock:{configurable:!0}};t.prototype.parse=function(){var i=this,s=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return i.parseTopLevel(s)})};_.inFunction.get=function(){return(this.currentVarScope().flags&B)>0};_.inGenerator.get=function(){return(this.currentVarScope().flags&Tt)>0};_.inAsync.get=function(){return(this.currentVarScope().flags&dt)>0};_.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var i=this.scopeStack[e],s=i.flags;if(s&(M|Q))return!1;if(s&B)return(s&dt)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};_.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&O)return!0;return!1};_.allowSuper.get=function(){var e=this.currentThisScope(),i=e.flags;return(i&rt)>0||this.options.allowSuperOutsideMethod};_.allowDirectSuper.get=function(){return(this.currentThisScope().flags&It)>0};_.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};_.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var i=this.scopeStack[e],s=i.flags;if(s&(M|Q)||s&B&&!(s&mt))return!0}return!1};_.allowUsing.get=function(){var e=this.currentScope(),i=e.flags;if(i&_t)return!1;if(!this.inModule&&i&O)return!1;return!0};_.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&M)>0};t.extend=function(){var i=[],s=arguments.length;while(s--)i[s]=arguments[s];var r=this;for(var n=0;n<i.length;n++)r=i[n](r);return r};t.parse=function(i,s){return new this(s,i).parse()};t.parseExpressionAt=function(i,s,r){var n=new this(r,i,s);return n.nextToken(),n.parseExpression()};t.tokenizer=function(i,s){return new this(s,i)};Object.defineProperties(t.prototype,_);var C=t.prototype,Xt=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;C.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){w.lastIndex=e,e+=w.exec(this.input)[0].length;var i=Xt.exec(this.input.slice(e));if(!i)return!1;if((i[1]||i[2])==="use strict"){w.lastIndex=e+i[0].length;var s=w.exec(this.input),r=s.index+s[0].length,n=this.input.charAt(r);return n===";"||n==="}"||T.test(s[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||n==="!"&&this.input.charAt(r+1)==="=")}if(e+=i[0].length,w.lastIndex=e,e+=w.exec(this.input)[0].length,this.input[e]===";")e++}};C.eat=function(e){if(this.type===e)return this.next(),!0;else return!1};C.isContextual=function(e){return this.type===a.name&&this.value===e&&!this.containsEsc};C.eatContextual=function(e){if(!this.isContextual(e))return!1;return this.next(),!0};C.catchStackOverflow=function(e){try{return e()}catch(i){if(i instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(i.message)||/\btoo much recursion\b/i.test(i.message)))this.raise(this.start,"Not enough stack space to parse input");else throw i}};C.expectContextual=function(e){if(!this.eatContextual(e))this.unexpected()};C.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||T.test(this.input.slice(this.lastTokEnd,this.start))};C.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};C.semicolon=function(){if(!this.eat(a.semi)&&!this.insertSemicolon())this.unexpected()};C.afterTrailingComma=function(e,i){if(this.type===e){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!i)this.next();return!0}};C.expect=function(e){this.eat(e)||this.unexpected()};C.unexpected=function(e){this.raise(e!=null?e:this.start,"Unexpected token")};var nt=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};C.checkPatternErrors=function(e,i){if(!e)return;if(e.trailingComma>-1)this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var s=i?e.parenthesizedAssign:e.parenthesizedBind;if(s>-1)this.raiseRecoverable(s,i?"Assigning to rvalue":"Parenthesized pattern")};C.checkExpressionErrors=function(e,i){if(!e)return!1;var{shorthandAssign:s,doubleProto:r}=e;if(!i)return s>=0||r>=0;if(s>=0)this.raise(s,"Shorthand property assignments are valid only in destructuring patterns");if(r>=0)this.raiseRecoverable(r,"Redefinition of __proto__ property")};C.checkYieldAwaitInDefaultParams=function(){if(this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos))this.raise(this.yieldPos,"Yield expression cannot be a default value");if(this.awaitPos)this.raise(this.awaitPos,"Await expression cannot be a default value")};C.isSimpleAssignTarget=function(e){if(e.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(e.expression);return e.type==="Identifier"||e.type==="MemberExpression"};var f=t.prototype;f.parseTopLevel=function(e){var i=Object.create(null);if(!e.body)e.body=[];while(this.type!==a.eof){var s=this.parseStatement(null,!0,i);e.body.push(s)}if(this.inModule)for(var r=0,n=Object.keys(this.undefinedExports);r<n.length;r+=1){var h=n[r];this.raiseRecoverable(this.undefinedExports[h].start,"Export '"+h+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var yt={kind:"loop"},Jt={kind:"switch"};f.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;w.lastIndex=this.pos;var i=w.exec(this.input),s=this.pos+i[0].length,r=this.fullCharCodeAt(s);if(r===91||r===92)return!0;if(e)return!1;if(r===123)return!0;if(o(r)){var n=s;do s+=r<=65535?1:2;while(c(r=this.fullCharCodeAt(s)));if(r===92)return!0;var h=this.input.slice(n,s);if(!St.test(h))return!0}return!1};f.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;w.lastIndex=this.pos;var e=w.exec(this.input),i=this.pos+e[0].length,s;return!T.test(this.input.slice(this.pos,i))&&this.input.slice(i,i+8)==="function"&&(i+8===this.input.length||!(c(s=this.fullCharCodeAt(i+8))||s===92))};f.isUsingKeyword=function(e,i){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;w.lastIndex=this.pos;var s=w.exec(this.input),r=this.pos+s[0].length;if(T.test(this.input.slice(this.pos,r)))return!1;if(e){var n=r+5,h;if(this.input.slice(r,n)!=="using"||n===this.input.length||c(h=this.fullCharCodeAt(n))||h===92)return!1;w.lastIndex=n;var p=w.exec(this.input);if(r=n+p[0].length,p&&T.test(this.input.slice(n,r)))return!1}var l=this.fullCharCodeAt(r);if(!o(l)&&l!==92)return!1;var u=r;do r+=l<=65535?1:2;while(c(l=this.fullCharCodeAt(r)));if(l===92)return!0;var d=this.input.slice(u,r);if(St.test(d))return!1;if(i&&!e&&d==="of"){w.lastIndex=r;var v=w.exec(this.input);if(r=r+v[0].length,this.input.charCodeAt(r)!==61||(l=this.input.charCodeAt(r+1))===61||l===62)return!1}return!0};f.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};f.isUsing=function(e){return this.isUsingKeyword(!1,e)};f.parseStatement=function(e,i,s){var r=this.type,n=this.startNode(),h;if(this.isLet(e))r=a._var,h="let";switch(r){case a._break:case a._continue:return this.parseBreakContinueStatement(n,r.keyword);case a._debugger:return this.parseDebuggerStatement(n);case a._do:return this.parseDoStatement(n);case a._for:return this.parseForStatement(n);case a._function:if(e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(n,!1,!e);case a._class:if(e)this.unexpected();return this.parseClass(n,!0);case a._if:return this.parseIfStatement(n);case a._return:return this.parseReturnStatement(n);case a._switch:return this.parseSwitchStatement(n);case a._throw:return this.parseThrowStatement(n);case a._try:return this.parseTryStatement(n);case a._const:case a._var:if(h=h||this.value,e&&h!=="var")this.unexpected();return this.parseVarStatement(n,h);case a._while:return this.parseWhileStatement(n);case a._with:return this.parseWithStatement(n);case a.braceL:return this.parseBlock(!0,n);case a.semi:return this.parseEmptyStatement(n);case a._export:case a._import:if(this.options.ecmaVersion>10&&r===a._import){w.lastIndex=this.pos;var p=w.exec(this.input),l=this.pos+p[0].length,u=this.input.charCodeAt(l);if(u===40||u===46)return this.parseExpressionStatement(n,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!i)this.raise(this.start,"'import' and 'export' may only appear at the top level");if(!this.inModule)this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")}return r===a._import?this.parseImport(n):this.parseExport(n,s);default:if(this.isAsyncFunction()){if(e)this.unexpected();return this.next(),this.parseFunctionStatement(n,!0,!e)}var d=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(d){if(!this.allowUsing)this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");if(e)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(d==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.next(),this.parseVar(n,!1,d),this.semicolon(),this.finishNode(n,"VariableDeclaration")}var v=this.value,k=this.parseExpression();if(r===a.name&&k.type==="Identifier"&&this.eat(a.colon))return this.parseLabeledStatement(n,v,k,e);else return this.parseExpressionStatement(n,k)}};f.parseBreakContinueStatement=function(e,i){var s=i==="break";if(this.next(),this.eat(a.semi)||this.insertSemicolon())e.label=null;else if(this.type!==a.name)this.unexpected();else e.label=this.parseIdent(),this.semicolon();var r=0;for(;r<this.labels.length;++r){var n=this.labels[r];if(e.label==null||n.name===e.label.name){if(n.kind!=null&&(s||n.kind==="loop"))break;if(e.label&&s)break}}if(r===this.labels.length)this.raise(e.start,"Unsyntactic "+i);return this.finishNode(e,s?"BreakStatement":"ContinueStatement")};f.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};f.parseDoStatement=function(e){if(this.next(),this.labels.push(yt),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(a._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(a.semi);else this.semicolon();return this.finishNode(e,"DoWhileStatement")};f.parseForStatement=function(e){this.next();var i=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(yt),this.enterScope(0),this.expect(a.parenL),this.type===a.semi){if(i>-1)this.unexpected(i);return this.parseFor(e,null)}var s=this.isLet();if(this.type===a._var||this.type===a._const||s){var r=this.startNode(),n=s?"let":this.value;return this.next(),this.parseVar(r,!0,n),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,i)}var h=this.isContextual("let"),p=!1,l=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(l){var u=this.startNode();if(this.next(),l==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(u,!0,l),this.finishNode(u,"VariableDeclaration"),this.parseForAfterInit(e,u,i)}var d=this.containsEsc,v=new nt,k=this.start,S=i>-1?this.parseExprSubscripts(v,"await"):this.parseExpression(!0,v);if(this.type===a._in||(p=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(i>-1){if(this.type===a._in)this.unexpected(i);e.await=!0}else if(p&&this.options.ecmaVersion>=8){if(S.start===k&&!d&&S.type==="Identifier"&&S.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)e.await=!1}if(h&&p)this.raise(S.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(S,!1,v),this.checkLValPattern(S),this.parseForIn(e,S)}else this.checkExpressionErrors(v,!0);if(i>-1)this.unexpected(i);return this.parseFor(e,S)};f.parseForAfterInit=function(e,i,s){if((this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&i.declarations.length===1){if(this.type===a._in){if((i.kind==="using"||i.kind==="await using")&&!i.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&s>-1)this.unexpected(s)}else if(this.options.ecmaVersion>=9)e.await=s>-1;return this.parseForIn(e,i)}if(s>-1)this.unexpected(s);return this.parseFor(e,i)};f.parseFunctionStatement=function(e,i,s){return this.next(),this.parseFunction(e,G|(s?0:ct),!1,i)};f.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(a._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};f.parseReturnStatement=function(e){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(a.semi)||this.insertSemicolon())e.argument=null;else e.argument=this.parseExpression(),this.semicolon();return this.finishNode(e,"ReturnStatement")};f.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(a.braceL),this.labels.push(Jt),this.enterScope(_t);var i;for(var s=!1;this.type!==a.braceR;)if(this.type===a._case||this.type===a._default){var r=this.type===a._case;if(i)this.finishNode(i,"SwitchCase");if(e.cases.push(i=this.startNode()),i.consequent=[],this.next(),r)i.test=this.parseExpression();else{if(s)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");s=!0,i.test=null}this.expect(a.colon)}else{if(!i)this.unexpected();i.consequent.push(this.parseStatement(null))}if(this.exitScope(),i)this.finishNode(i,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};f.parseThrowStatement=function(e){if(this.next(),T.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Zt=[];f.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),i=e.type==="Identifier";return this.enterScope(i?Pt:0),this.checkLValPattern(e,i?Rt:V),this.expect(a.parenR),e};f.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===a._catch){var i=this.startNode();if(this.next(),this.eat(a.parenL))i.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();i.param=null,this.enterScope(0)}i.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(i,"CatchClause")}if(e.finalizer=this.eat(a._finally)?this.parseBlock():null,!e.handler&&!e.finalizer)this.raise(e.start,"Missing catch or finally clause");return this.finishNode(e,"TryStatement")};f.parseVarStatement=function(e,i,s){return this.next(),this.parseVar(e,!1,i,s),this.semicolon(),this.finishNode(e,"VariableDeclaration")};f.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(yt),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};f.parseWithStatement=function(e){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};f.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};f.parseLabeledStatement=function(e,i,s,r){for(var n=0,h=this.labels;n<h.length;n+=1){var p=h[n];if(p.name===i)this.raise(s.start,"Label '"+i+"' is already declared")}var l=this.type.isLoop?"loop":this.type===a._switch?"switch":null;for(var u=this.labels.length-1;u>=0;u--){var d=this.labels[u];if(d.statementStart===e.start)d.statementStart=this.start,d.kind=l;else break}return this.labels.push({name:i,kind:l,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=s,this.finishNode(e,"LabeledStatement")};f.parseExpressionStatement=function(e,i){return e.expression=i,this.semicolon(),this.finishNode(e,"ExpressionStatement")};f.parseBlock=function(e,i,s){if(e===void 0)e=!0;if(i===void 0)i=this.startNode();if(i.body=[],this.expect(a.braceL),e)this.enterScope(0);while(this.type!==a.braceR){var r=this.parseStatement(null);i.body.push(r)}if(s)this.strict=!1;if(this.next(),e)this.exitScope();return this.finishNode(i,"BlockStatement")};f.parseFor=function(e,i){return e.init=i,this.expect(a.semi),e.test=this.type===a.semi?null:this.parseExpression(),this.expect(a.semi),e.update=this.type===a.parenR?null:this.parseExpression(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};f.parseForIn=function(e,i){var s=this.type===a._in;if(this.next(),i.type==="VariableDeclaration"&&i.declarations[0].init!=null&&(!s||this.options.ecmaVersion<8||this.strict||i.kind!=="var"||i.declarations[0].id.type!=="Identifier"))this.raise(i.start,(s?"for-in":"for-of")+" loop variable declaration may not have an initializer");return e.left=i,e.right=s?this.parseExpression():this.parseMaybeAssign(),this.expect(a.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,s?"ForInStatement":"ForOfStatement")};f.parseVar=function(e,i,s,r){e.declarations=[],e.kind=s;for(;;){var n=this.startNode();if(this.parseVarId(n,s),this.eat(a.eq))n.init=this.parseMaybeAssign(i);else if(!r&&s==="const"&&!(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!r&&(s==="using"||s==="await using")&&this.options.ecmaVersion>=17&&this.type!==a._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+s+" declaration");else if(!r&&n.id.type!=="Identifier"&&!(i&&(this.type===a._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else n.init=null;if(e.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(a.comma))break}return e};f.parseVarId=function(e,i){e.id=i==="using"||i==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,i==="var"?xt:V,!1)};var G=1,ct=2,Ft=4;f.parseFunction=function(e,i,s,r,n){if(this.initFunction(e),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r){if(this.type===a.star&&i&ct)this.unexpected();e.generator=this.eat(a.star)}if(this.options.ecmaVersion>=8)e.async=!!r;if(i&G){if(e.id=i&Ft&&this.type!==a.name?null:this.parseIdent(),e.id&&!(i&ct))this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?xt:V:Lt)}var h=this.yieldPos,p=this.awaitPos,l=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(vt(e.async,e.generator)),!(i&G))e.id=this.type===a.name?this.parseIdent():null;return this.parseFunctionParams(e),this.parseFunctionBody(e,s,!1,n),this.yieldPos=h,this.awaitPos=p,this.awaitIdentPos=l,this.finishNode(e,i&G?"FunctionDeclaration":"FunctionExpression")};f.parseFunctionParams=function(e){this.expect(a.parenL),e.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};f.parseClass=function(e,i){this.next();var s=this.strict;this.strict=!0,this.parseClassId(e,i),this.parseClassSuper(e);var r=this.enterClassBody(),n=this.startNode(),h=!1;n.body=[],this.expect(a.braceL);while(this.type!==a.braceR){var p=this.parseClassElement(e.superClass!==null);if(p){if(n.body.push(p),p.type==="MethodDefinition"&&p.kind==="constructor"){if(h)this.raiseRecoverable(p.start,"Duplicate constructor in the same class");h=!0}else if(p.key&&p.key.type==="PrivateIdentifier"&&$t(r,p))this.raiseRecoverable(p.key.start,"Identifier '#"+p.key.name+"' has already been declared")}}return this.strict=s,this.next(),e.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(e,i?"ClassDeclaration":"ClassExpression")};f.parseClassElement=function(e){if(this.eat(a.semi))return null;var i=this.options.ecmaVersion,s=this.startNode(),r="",n=!1,h=!1,p="method",l=!1;if(this.eatContextual("static")){if(i>=13&&this.eat(a.braceL))return this.parseClassStaticBlock(s),s;if(this.isClassElementNameStart()||this.type===a.star)l=!0;else r="static"}if(s.static=l,!r&&i>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===a.star)&&!this.canInsertSemicolon())h=!0;else r="async";if(!r&&(i>=9||!h)&&this.eat(a.star))n=!0;if(!r&&!h&&!n){var u=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())p=u;else r=u}if(r)s.computed=!1,s.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),s.key.name=r,this.finishNode(s.key,"Identifier");else this.parseClassElementName(s);if(i<13||this.type===a.parenL||p!=="method"||n||h){var d=!s.static&&tt(s,"constructor"),v=d&&e;if(d&&p!=="method")this.raise(s.key.start,"Constructor can't have get/set modifier");s.kind=d?"constructor":p,this.parseClassMethod(s,n,h,v)}else this.parseClassField(s);return s};f.isClassElementNameStart=function(){return this.type===a.name||this.type===a.privateId||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword};f.parseClassElementName=function(e){if(this.type===a.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");e.computed=!1,e.key=this.parsePrivateIdent()}else this.parsePropertyName(e)};f.parseClassMethod=function(e,i,s,r){var n=e.key;if(e.kind==="constructor"){if(i)this.raise(n.start,"Constructor can't be a generator");if(s)this.raise(n.start,"Constructor can't be an async method")}else if(e.static&&tt(e,"prototype"))this.raise(n.start,"Classes may not have a static property named prototype");var h=e.value=this.parseMethod(i,s,r);if(e.kind==="get"&&h.params.length!==0)this.raiseRecoverable(h.start,"getter should have no params");if(e.kind==="set"&&h.params.length!==1)this.raiseRecoverable(h.start,"setter should have exactly one param");if(e.kind==="set"&&h.params[0].type==="RestElement")this.raiseRecoverable(h.params[0].start,"Setter cannot use rest params");return this.finishNode(e,"MethodDefinition")};f.parseClassField=function(e){if(tt(e,"constructor"))this.raise(e.key.start,"Classes can't have a field named 'constructor'");else if(e.static&&tt(e,"prototype"))this.raise(e.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(a.eq))this.enterScope(Q|rt),e.value=this.parseMaybeAssign(),this.exitScope();else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};f.parseClassStaticBlock=function(e){e.body=[];var i=this.labels;this.labels=[],this.enterScope(M|rt);while(this.type!==a.braceR){var s=this.parseStatement(null);e.body.push(s)}return this.next(),this.exitScope(),this.labels=i,this.finishNode(e,"StaticBlock")};f.parseClassId=function(e,i){if(this.type===a.name){if(e.id=this.parseIdent(),i)this.checkLValSimple(e.id,V,!1)}else{if(i===!0)this.unexpected();e.id=null}};f.parseClassSuper=function(e){e.superClass=this.eat(a._extends)?this.parseExprSubscripts(null,!1):null};f.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};f.exitClassBody=function(){var e=this.privateNameStack.pop(),{declared:i,used:s}=e;if(!this.options.checkPrivateFields)return;var r=this.privateNameStack.length,n=r===0?null:this.privateNameStack[r-1];for(var h=0;h<s.length;++h){var p=s[h];if(!Y(i,p.name))if(n)n.used.push(p);else this.raiseRecoverable(p.start,"Private field '#"+p.name+"' must be declared in an enclosing class")}};function $t(e,i){var s=i.key.name,r=e[s],n="true";if(i.type==="MethodDefinition"&&(i.kind==="get"||i.kind==="set"))n=(i.static?"s":"i")+i.kind;if(r==="iget"&&n==="iset"||r==="iset"&&n==="iget"||r==="sget"&&n==="sset"||r==="sset"&&n==="sget")return e[s]="true",!1;else if(!r)return e[s]=n,!1;else return!0}function tt(e,i){var{computed:s,key:r}=e;return!s&&(r.type==="Identifier"&&r.name===i||r.type==="Literal"&&r.value===i)}f.parseExportAllDeclaration=function(e,i){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))e.exported=this.parseModuleExportName(),this.checkExport(i,e.exported,this.lastTokStart);else e.exported=null;if(this.expectContextual("from"),this.type!==a.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};f.parseExport=function(e,i){if(this.next(),this.eat(a.star))return this.parseExportAllDeclaration(e,i);if(this.eat(a._default))return this.checkExport(i,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration")this.checkVariableExport(i,e.declaration.declarations);else this.checkExport(i,e.declaration.id,e.declaration.id.start);if(e.specifiers=[],e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(i),this.eatContextual("from")){if(this.type!==a.string)this.unexpected();if(e.source=this.parseExprAtom(),this.options.ecmaVersion>=16)e.attributes=this.parseWithClause()}else{for(var s=0,r=e.specifiers;s<r.length;s+=1){var n=r[s];if(this.checkUnreserved(n.local),this.checkLocalExport(n.local),n.local.type==="Literal")this.raise(n.local.start,"A string literal cannot be used as an exported binding without `from`.")}if(e.source=null,this.options.ecmaVersion>=16)e.attributes=[]}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};f.parseExportDeclaration=function(e){return this.parseStatement(null)};f.parseExportDefaultDeclaration=function(){var e;if(this.type===a._function||(e=this.isAsyncFunction())){var i=this.startNode();if(this.next(),e)this.next();return this.parseFunction(i,G|Ft,!1,e)}else if(this.type===a._class){var s=this.startNode();return this.parseClass(s,"nullableID")}else{var r=this.parseMaybeAssign();return this.semicolon(),r}};f.checkExport=function(e,i,s){if(!e)return;if(typeof i!=="string")i=i.type==="Identifier"?i.name:i.value;if(Y(e,i))this.raiseRecoverable(s,"Duplicate export '"+i+"'");e[i]=!0};f.checkPatternExport=function(e,i){var s=i.type;if(s==="Identifier")this.checkExport(e,i,i.start);else if(s==="ObjectPattern")for(var r=0,n=i.properties;r<n.length;r+=1){var h=n[r];this.checkPatternExport(e,h)}else if(s==="ArrayPattern")for(var p=0,l=i.elements;p<l.length;p+=1){var u=l[p];if(u)this.checkPatternExport(e,u)}else if(s==="Property")this.checkPatternExport(e,i.value);else if(s==="AssignmentPattern")this.checkPatternExport(e,i.left);else if(s==="RestElement")this.checkPatternExport(e,i.argument)};f.checkVariableExport=function(e,i){if(!e)return;for(var s=0,r=i;s<r.length;s+=1){var n=r[s];this.checkPatternExport(e,n.id)}};f.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};f.parseExportSpecifier=function(e){var i=this.startNode();return i.local=this.parseModuleExportName(),i.exported=this.eatContextual("as")?this.parseModuleExportName():i.local,this.checkExport(e,i.exported,i.exported.start),this.finishNode(i,"ExportSpecifier")};f.parseExportSpecifiers=function(e){var i=[],s=!0;this.expect(a.braceL);while(!this.eat(a.braceR)){if(!s){if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break}else s=!1;i.push(this.parseExportSpecifier(e))}return i};f.parseImport=function(e){if(this.next(),this.type===a.string)e.specifiers=Zt,e.source=this.parseExprAtom();else e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===a.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)e.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(e,"ImportDeclaration")};f.parseImportSpecifier=function(){var e=this.startNode();if(e.imported=this.parseModuleExportName(),this.eatContextual("as"))e.local=this.parseIdent();else this.checkUnreserved(e.imported),e.local=e.imported;return this.checkLValSimple(e.local,V),this.finishNode(e,"ImportSpecifier")};f.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,V),this.finishNode(e,"ImportDefaultSpecifier")};f.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,V),this.finishNode(e,"ImportNamespaceSpecifier")};f.parseImportSpecifiers=function(){var e=[],i=!0;if(this.type===a.name){if(e.push(this.parseImportDefaultSpecifier()),!this.eat(a.comma))return e}if(this.type===a.star)return e.push(this.parseImportNamespaceSpecifier()),e;this.expect(a.braceL);while(!this.eat(a.braceR)){if(!i){if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break}else i=!1;e.push(this.parseImportSpecifier())}return e};f.parseWithClause=function(){var e=[];if(!this.eat(a._with))return e;this.expect(a.braceL);var i={},s=!0;while(!this.eat(a.braceR)){if(!s){if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break}else s=!1;var r=this.parseImportAttribute(),n=r.key.type==="Identifier"?r.key.name:r.key.value;if(Y(i,n))this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+n+"'");i[n]=!0,e.push(r)}return e};f.parseImportAttribute=function(){var e=this.startNode();if(e.key=this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(a.colon),this.type!==a.string)this.unexpected();return e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};f.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===a.string){var e=this.parseLiteral(this.value);if(Yt.test(e.value))this.raise(e.start,"An export name cannot include a lone surrogate.");return e}return this.parseIdent(!0)};f.adaptDirectivePrologue=function(e){for(var i=0;i<e.length&&this.isDirectiveCandidate(e[i]);++i)e[i].directive=e[i].expression.raw.slice(1,-1)};f.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value==="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var L=t.prototype;L.toAssignable=function(e,i,s){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":if(this.inAsync&&e.name==="await")this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(e.type="ObjectPattern",s)this.checkPatternErrors(s,!0);for(var r=0,n=e.properties;r<n.length;r+=1){var h=n[r];if(this.toAssignable(h,i),h.type==="RestElement"&&(h.argument.type==="ArrayPattern"||h.argument.type==="ObjectPattern"))this.raise(h.argument.start,"Unexpected token")}break;case"Property":if(e.kind!=="init")this.raise(e.key.start,"Object pattern can't contain getter or setter");this.toAssignable(e.value,i);break;case"ArrayExpression":if(e.type="ArrayPattern",s)this.checkPatternErrors(s,!0);this.toAssignableList(e.elements,i);break;case"SpreadElement":if(e.type="RestElement",this.toAssignable(e.argument,i),e.argument.type==="AssignmentPattern")this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(e.operator!=="=")this.raise(e.left.end,"Only '=' operator can be used for specifying default value.");e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,i);break;case"ParenthesizedExpression":this.toAssignable(e.expression,i,s);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!i)break;default:this.raise(e.start,"Assigning to rvalue")}else if(s)this.checkPatternErrors(s,!0);return e};L.toAssignableList=function(e,i){var s=e.length;for(var r=0;r<s;r++){var n=e[r];if(n)this.toAssignable(n,i)}if(s){var h=e[s-1];if(this.options.ecmaVersion===6&&i&&h&&h.type==="RestElement"&&h.argument.type!=="Identifier")this.unexpected(h.argument.start)}return e};L.parseSpread=function(e){var i=this.startNode();return this.next(),i.argument=this.parseMaybeAssign(!1,e),this.finishNode(i,"SpreadElement")};L.parseRestBinding=function(){var e=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==a.name)this.unexpected();return e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};L.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case a.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(a.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case a.braceL:return this.parseObj(!0)}return this.parseIdent()};L.parseBindingList=function(e,i,s,r){var n=[],h=!0;while(!this.eat(e)){if(h)h=!1;else this.expect(a.comma);if(i&&this.type===a.comma)n.push(null);else if(s&&this.afterTrailingComma(e))break;else if(this.type===a.ellipsis){var p=this.parseRestBinding();if(this.parseBindingListItem(p),n.push(p),this.type===a.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(e);break}else n.push(this.parseAssignableListItem(r))}return n};L.parseAssignableListItem=function(e){var i=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(i),i};L.parseBindingListItem=function(e){return e};L.parseMaybeDefault=function(e,i,s){if(s=s||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(a.eq))return s;var r=this.startNodeAt(e,i);return r.left=s,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};L.checkLValSimple=function(e,i,s){if(i===void 0)i=Z;var r=i!==Z;switch(e.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(e.name))this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode");if(r){if(i===V&&e.name==="let")this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name");if(s){if(Y(s,e.name))this.raiseRecoverable(e.start,"Argument name clash");s[e.name]=!0}if(i!==Vt)this.declareName(e.name,i,e.start)}break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(r)this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":if(r)this.raiseRecoverable(e.start,"Binding parenthesized expression");return this.checkLValSimple(e.expression,i,s);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue")}};L.checkLValPattern=function(e,i,s){if(i===void 0)i=Z;switch(e.type){case"ObjectPattern":for(var r=0,n=e.properties;r<n.length;r+=1){var h=n[r];this.checkLValInnerPattern(h,i,s)}break;case"ArrayPattern":for(var p=0,l=e.elements;p<l.length;p+=1){var u=l[p];if(u)this.checkLValInnerPattern(u,i,s)}break;default:this.checkLValSimple(e,i,s)}};L.checkLValInnerPattern=function(e,i,s){if(i===void 0)i=Z;switch(e.type){case"Property":this.checkLValInnerPattern(e.value,i,s);break;case"AssignmentPattern":this.checkLValPattern(e.left,i,s);break;case"RestElement":this.checkLValPattern(e.argument,i,s);break;default:this.checkLValPattern(e,i,s)}};var R=function(i,s,r,n,h){this.token=i,this.isExpr=!!s,this.preserveSpace=!!r,this.override=n,this.generator=!!h},g={b_stat:new R("{",!1),b_expr:new R("{",!0),b_tmpl:new R("${",!1),p_stat:new R("(",!1),p_expr:new R("(",!0),q_tmpl:new R("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new R("function",!1),f_expr:new R("function",!0),f_expr_gen:new R("function",!0,!1,null,!0),f_gen:new R("function",!1,!1,null,!0)},W=t.prototype;W.initialContext=function(){return[g.b_stat]};W.curContext=function(){return this.context[this.context.length-1]};W.braceIsBlock=function(e){var i=this.curContext();if(i===g.f_expr||i===g.f_stat)return!0;if(e===a.colon&&(i===g.b_stat||i===g.b_expr))return!i.isExpr;if(e===a._return||e===a.name&&this.exprAllowed)return T.test(this.input.slice(this.lastTokEnd,this.start));if(e===a._else||e===a.semi||e===a.eof||e===a.parenR||e===a.arrow)return!0;if(e===a.braceL)return i===g.b_stat;if(e===a._var||e===a._const||e===a.name)return!1;return!this.exprAllowed};W.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var i=this.context[e];if(i.token==="function")return i.generator}return!1};W.updateContext=function(e){var i,s=this.type;if(s.keyword&&e===a.dot)this.exprAllowed=!1;else if(i=s.updateContext)i.call(this,e);else this.exprAllowed=s.beforeExpr};W.overrideContext=function(e){if(this.curContext()!==e)this.context[this.context.length-1]=e};a.parenR.updateContext=a.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();if(e===g.b_stat&&this.curContext().token==="function")e=this.context.pop();this.exprAllowed=!e.isExpr};a.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?g.b_stat:g.b_expr),this.exprAllowed=!0};a.dollarBraceL.updateContext=function(){this.context.push(g.b_tmpl),this.exprAllowed=!0};a.parenL.updateContext=function(e){var i=e===a._if||e===a._for||e===a._with||e===a._while;this.context.push(i?g.p_stat:g.p_expr),this.exprAllowed=!0};a.incDec.updateContext=function(){};a._function.updateContext=a._class.updateContext=function(e){if(e.beforeExpr&&e!==a._else&&!(e===a.semi&&this.curContext()!==g.p_stat)&&!(e===a._return&&T.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===a.colon||e===a.braceL)&&this.curContext()===g.b_stat))this.context.push(g.f_expr);else this.context.push(g.f_stat);this.exprAllowed=!1};a.colon.updateContext=function(){if(this.curContext().token==="function")this.context.pop();this.exprAllowed=!0};a.backQuote.updateContext=function(){if(this.curContext()===g.q_tmpl)this.context.pop();else this.context.push(g.q_tmpl);this.exprAllowed=!1};a.star.updateContext=function(e){if(e===a._function){var i=this.context.length-1;if(this.context[i]===g.f_expr)this.context[i]=g.f_expr_gen;else this.context[i]=g.f_gen}this.exprAllowed=!0};a.name.updateContext=function(e){var i=!1;if(this.options.ecmaVersion>=6&&e!==a.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())i=!0}this.exprAllowed=i};var m=t.prototype;m.checkPropClash=function(e,i,s){if(this.options.ecmaVersion>=9&&e.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))return;var r=e.key,n;switch(r.type){case"Identifier":n=r.name;break;case"Literal":n=String(r.value);break;default:return}var h=e.kind;if(this.options.ecmaVersion>=6){if(n==="__proto__"&&h==="init"){if(i.proto)if(s){if(s.doubleProto<0)s.doubleProto=r.start}else this.raiseRecoverable(r.start,"Redefinition of __proto__ property");i.proto=!0}return}n="$"+n;var p=i[n];if(p){var l;if(h==="init")l=this.strict&&p.init||p.get||p.set;else l=p.init||p[h];if(l)this.raiseRecoverable(r.start,"Redefinition of property")}else p=i[n]={init:!1,get:!1,set:!1};p[h]=!0};m.parseExpression=function(e,i){var s=this;return this.catchStackOverflow(function(){var{start:r,startLoc:n}=s,h=s.parseMaybeAssign(e,i);if(s.type===a.comma){var p=s.startNodeAt(r,n);p.expressions=[h];while(s.eat(a.comma))p.expressions.push(s.parseMaybeAssign(e,i));return s.finishNode(p,"SequenceExpression")}return h})};m.parseMaybeAssign=function(e,i,s){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(e);else this.exprAllowed=!1;var r=!1,n=-1,h=-1,p=-1;if(i)n=i.parenthesizedAssign,h=i.trailingComma,p=i.doubleProto,i.parenthesizedAssign=i.trailingComma=-1;else i=new nt,r=!0;var l=this.start,u=this.startLoc;if(this.type===a.parenL||this.type===a.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await";var d=this.parseMaybeConditional(e,i);if(s)d=s.call(this,d,l,u);if(this.type.isAssign){var v=this.startNodeAt(l,u);if(v.operator=this.value,this.type===a.eq)d=this.toAssignable(d,!1,i);if(!r)i.parenthesizedAssign=i.trailingComma=i.doubleProto=-1;if(i.shorthandAssign>=d.start)i.shorthandAssign=-1;if(this.type===a.eq)this.checkLValPattern(d);else this.checkLValSimple(d);if(v.left=d,this.next(),v.right=this.parseMaybeAssign(e),p>-1)i.doubleProto=p;return this.finishNode(v,"AssignmentExpression")}else if(r)this.checkExpressionErrors(i,!0);if(n>-1)i.parenthesizedAssign=n;if(h>-1)i.trailingComma=h;return d};m.parseMaybeConditional=function(e,i){var s=this.start,r=this.startLoc,n=this.parseExprOps(e,i);if(this.checkExpressionErrors(i))return n;if(!(n.type==="ArrowFunctionExpression"&&n.start===s)&&this.eat(a.question)){var h=this.startNodeAt(s,r);return h.test=n,h.consequent=this.parseMaybeAssign(),this.expect(a.colon),h.alternate=this.parseMaybeAssign(e),this.finishNode(h,"ConditionalExpression")}return n};m.parseExprOps=function(e,i){var s=this.start,r=this.startLoc,n=this.parseMaybeUnary(i,!1,!1,e);if(this.checkExpressionErrors(i))return n;return n.start===s&&n.type==="ArrowFunctionExpression"?n:this.parseExprOp(n,s,r,-1,e)};m.parseExprOp=function(e,i,s,r,n){var h=this.type.binop;if(h!=null&&(!n||this.type!==a._in)){if(h>r){var p=this.type===a.logicalOR||this.type===a.logicalAND,l=this.type===a.coalesce;if(l)h=a.logicalAND.binop;var u=this.value;this.next();var d=this.start,v=this.startLoc,k=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,n),d,v,h,n),S=this.buildBinary(i,s,e,k,u,p||l);if(p&&this.type===a.coalesce||l&&(this.type===a.logicalOR||this.type===a.logicalAND))this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");return this.parseExprOp(S,i,s,r,n)}}return e};m.buildBinary=function(e,i,s,r,n,h){if(r.type==="PrivateIdentifier")this.raise(r.start,"Private identifier can only be left side of binary expression");var p=this.startNodeAt(e,i);return p.left=s,p.operator=n,p.right=r,this.finishNode(p,h?"LogicalExpression":"BinaryExpression")};m.parseMaybeUnary=function(e,i,s,r){var n=this.start,h=this.startLoc,p;if(this.isContextual("await")&&this.canAwait)p=this.parseAwait(r),i=!0;else if(this.type.prefix){var l=this.startNode(),u=this.type===a.incDec;if(l.operator=this.value,l.prefix=!0,this.next(),l.argument=this.parseMaybeUnary(null,!0,u,r),this.checkExpressionErrors(e,!0),u)this.checkLValSimple(l.argument);else if(this.strict&&l.operator==="delete"&&Ot(l.argument))this.raiseRecoverable(l.start,"Deleting local variable in strict mode");else if(l.operator==="delete"&&ut(l.argument))this.raiseRecoverable(l.start,"Private fields can not be deleted");else i=!0;p=this.finishNode(l,u?"UpdateExpression":"UnaryExpression")}else if(!i&&this.type===a.privateId){if((r||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(p=this.parsePrivateIdent(),this.type!==a._in)this.unexpected()}else{if(p=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return p;while(this.type.postfix&&!this.canInsertSemicolon()){var d=this.startNodeAt(n,h);d.operator=this.value,d.prefix=!1,d.argument=p,this.checkLValSimple(p),this.next(),p=this.finishNode(d,"UpdateExpression")}}if(!s&&!(p.type==="ArrowFunctionExpression"&&p.start===n)&&this.eat(a.starstar))if(i)this.unexpected(this.lastTokStart);else return this.buildBinary(n,h,p,this.parseMaybeUnary(null,!1,!1,r),"**",!1);else return p};function Ot(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Ot(e.expression)}function ut(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&ut(e.expression)||e.type==="ParenthesizedExpression"&&ut(e.expression)}m.parseExprSubscripts=function(e,i){var s=this.start,r=this.startLoc,n=this.parseExprAtom(e,i);if(n.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return n;var h=this.parseSubscripts(n,s,r,!1,i);if(e&&h.type==="MemberExpression"){if(e.parenthesizedAssign>=h.start)e.parenthesizedAssign=-1;if(e.parenthesizedBind>=h.start)e.parenthesizedBind=-1;if(e.trailingComma>=h.start)e.trailingComma=-1}return h};m.parseSubscripts=function(e,i,s,r,n){var h=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,p=!1;while(!0){var l=this.parseSubscript(e,i,s,r,h,p,n);if(l.optional)p=!0;if(l===e||l.type==="ArrowFunctionExpression"){if(p){var u=this.startNodeAt(i,s);u.expression=l,l=this.finishNode(u,"ChainExpression")}return l}e=l}};m.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(a.arrow)};m.parseSubscriptAsyncArrow=function(e,i,s,r){return this.parseArrowExpression(this.startNodeAt(e,i),s,!0,r)};m.parseSubscript=function(e,i,s,r,n,h,p){var l=this.options.ecmaVersion>=11,u=l&&this.eat(a.questionDot);if(r&&u)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var d=this.eat(a.bracketL);if(d||u&&this.type!==a.parenL&&this.type!==a.backQuote||this.eat(a.dot)){var v=this.startNodeAt(i,s);if(v.object=e,d)v.property=this.parseExpression(),this.expect(a.bracketR);else if(this.type===a.privateId&&e.type!=="Super")v.property=this.parsePrivateIdent();else v.property=this.parseIdent(this.options.allowReserved!=="never");if(v.computed=!!d,l)v.optional=u;e=this.finishNode(v,"MemberExpression")}else if(!r&&this.eat(a.parenL)){var k=new nt,S=this.yieldPos,j=this.awaitPos,D=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var X=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1,k);if(n&&!u&&this.shouldParseAsyncArrow()){if(this.checkPatternErrors(k,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0)this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function");return this.yieldPos=S,this.awaitPos=j,this.awaitIdentPos=D,this.parseSubscriptAsyncArrow(i,s,X,p)}this.checkExpressionErrors(k,!0),this.yieldPos=S||this.yieldPos,this.awaitPos=j||this.awaitPos,this.awaitIdentPos=D||this.awaitIdentPos;var U=this.startNodeAt(i,s);if(U.callee=e,U.arguments=X,l)U.optional=u;e=this.finishNode(U,"CallExpression")}else if(this.type===a.backQuote){if(u||h)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var q=this.startNodeAt(i,s);q.tag=e,q.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(q,"TaggedTemplateExpression")}return e};m.parseExprAtom=function(e,i,s){if(this.type===a.slash)this.readRegexp();var r,n=this.potentialArrowAt===this.start;switch(this.type){case a._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(r=this.startNode(),this.next(),this.type===a.parenL&&!this.allowDirectSuper)this.raise(r.start,"super() call outside constructor of a subclass");if(this.type!==a.dot&&this.type!==a.bracketL&&this.type!==a.parenL)this.unexpected();return this.finishNode(r,"Super");case a._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case a.name:var h=this.start,p=this.startLoc,l=this.containsEsc,u=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!l&&u.name==="async"&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(g.f_expr),this.parseFunction(this.startNodeAt(h,p),0,!1,!0,i);if(n&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(h,p),[u],!1,i);if(this.options.ecmaVersion>=8&&u.name==="async"&&this.type===a.name&&!l&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(u=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(a.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(h,p),[u],!0,i)}}return u;case a.regexp:var d=this.value;return r=this.parseLiteral(d.value),r.regex={pattern:d.pattern,flags:d.flags},r;case a.num:case a.string:return this.parseLiteral(this.value);case a._null:case a._true:case a._false:return r=this.startNode(),r.value=this.type===a._null?null:this.type===a._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case a.parenL:var v=this.start,k=this.parseParenAndDistinguishExpression(n,i);if(e){if(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(k))e.parenthesizedAssign=v;if(e.parenthesizedBind<0)e.parenthesizedBind=v}return k;case a.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(a.bracketR,!0,!0,e),this.finishNode(r,"ArrayExpression");case a.braceL:return this.overrideContext(g.b_expr),this.parseObj(!1,e);case a._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case a._class:return this.parseClass(this.startNode(),!1);case a._new:return this.parseNew();case a.backQuote:return this.parseTemplate();case a._import:if(this.options.ecmaVersion>=11)return this.parseExprImport(s);else return this.unexpected();default:return this.parseExprAtomDefault()}};m.parseExprAtomDefault=function(){this.unexpected()};m.parseExprImport=function(e){var i=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===a.parenL&&!e)return this.parseDynamicImport(i);else if(this.type===a.dot){var s=this.startNodeAt(i.start,i.loc&&i.loc.start);return s.name="import",i.meta=this.finishNode(s,"Identifier"),this.parseImportMeta(i)}else this.unexpected()};m.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(a.parenR))if(this.expect(a.comma),!this.afterTrailingComma(a.parenR)){if(e.options=this.parseMaybeAssign(),!this.eat(a.parenR)){if(this.expect(a.comma),!this.afterTrailingComma(a.parenR))this.unexpected()}}else e.options=null;else e.options=null;else if(!this.eat(a.parenR)){var i=this.start;if(this.eat(a.comma)&&this.eat(a.parenR))this.raiseRecoverable(i,"Trailing comma is not allowed in import()");else this.unexpected(i)}return this.finishNode(e,"ImportExpression")};m.parseImportMeta=function(e){this.next();var i=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="meta")this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'");if(i)this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module");return this.finishNode(e,"MetaProperty")};m.parseLiteral=function(e){var i=this.startNode();if(i.value=e,i.raw=this.input.slice(this.start,this.end),i.raw.charCodeAt(i.raw.length-1)===110)i.bigint=i.value!=null?i.value.toString():i.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(i,"Literal")};m.parseParenExpression=function(){this.expect(a.parenL);var e=this.parseExpression();return this.expect(a.parenR),e};m.shouldParseArrow=function(e){return!this.canInsertSemicolon()};m.parseParenAndDistinguishExpression=function(e,i){var s=this.start,r=this.startLoc,n,h=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var p=this.start,l=this.startLoc,u=[],d=!0,v=!1,k=new nt,S=this.yieldPos,j=this.awaitPos,D;this.yieldPos=0,this.awaitPos=0;while(this.type!==a.parenR)if(d?d=!1:this.expect(a.comma),h&&this.afterTrailingComma(a.parenR,!0)){v=!0;break}else if(this.type===a.ellipsis){if(D=this.start,u.push(this.parseParenItem(this.parseRestBinding())),this.type===a.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else u.push(this.parseMaybeAssign(!1,k,this.parseParenItem));var X=this.lastTokEnd,U=this.lastTokEndLoc;if(this.expect(a.parenR),e&&this.shouldParseArrow(u)&&this.eat(a.arrow))return this.checkPatternErrors(k,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=S,this.awaitPos=j,this.parseParenArrowList(s,r,u,i);if(!u.length||v)this.unexpected(this.lastTokStart);if(D)this.unexpected(D);if(this.checkExpressionErrors(k,!0),this.yieldPos=S||this.yieldPos,this.awaitPos=j||this.awaitPos,u.length>1)n=this.startNodeAt(p,l),n.expressions=u,this.finishNodeAt(n,"SequenceExpression",X,U);else n=u[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var q=this.startNodeAt(s,r);return q.expression=n,this.finishNode(q,"ParenthesizedExpression")}else return n};m.parseParenItem=function(e){return e};m.parseParenArrowList=function(e,i,s,r){return this.parseArrowExpression(this.startNodeAt(e,i),s,!1,r)};var te=[];m.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===a.dot){var i=this.startNodeAt(e.start,e.loc&&e.loc.start);i.name="new",e.meta=this.finishNode(i,"Identifier"),this.next();var s=this.containsEsc;if(e.property=this.parseIdent(!0),e.property.name!=="target")this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'");if(s)this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block");return this.finishNode(e,"MetaProperty")}var r=this.start,n=this.startLoc;if(e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),r,n,!0,!1),e.callee.type==="Super")this.raiseRecoverable(r,"Invalid use of 'super'");if(this.eat(a.parenL))e.arguments=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1);else e.arguments=te;return this.finishNode(e,"NewExpression")};m.parseTemplateElement=function(e){var i=e.isTagged,s=this.startNode();if(this.type===a.invalidTemplate){if(!i)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");s.value={raw:this.value.replace(/\r\n?/g,`
|
|
4
4
|
`),cooked:null}}else s.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
5
|
-
`),cooked:this.value};return this.next(),s.tail=this.type===a.backQuote,this.finishNode(s,"TemplateElement")};m.parseTemplate=function(e){if(e===void 0)e={};var i=e.isTagged;if(i===void 0)i=!1;var s=this.startNode();this.next(),s.expressions=[];var r=this.parseTemplateElement({isTagged:i});s.quasis=[r];while(!r.tail){if(this.type===a.eof)this.raise(this.pos,"Unterminated template literal");this.expect(a.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(a.braceR),s.quasis.push(r=this.parseTemplateElement({isTagged:i}))}return this.next(),this.finishNode(s,"TemplateLiteral")};m.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===a.name||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===a.star)&&!T.test(this.input.slice(this.lastTokEnd,this.start))};m.parseObj=function(e,i){var s=this.startNode(),r=!0,o={};s.properties=[],this.next();while(!this.eat(a.braceR)){if(!r){if(this.expect(a.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(a.braceR))break}else r=!1;var h=this.parseProperty(e,i);if(!e)this.checkPropClash(h,o,i);s.properties.push(h)}return this.finishNode(s,e?"ObjectPattern":"ObjectExpression")};m.parseProperty=function(e,i){var s=this.startNode(),r,o,h,p;if(this.options.ecmaVersion>=9&&this.eat(a.ellipsis)){if(e){if(s.argument=this.parseIdent(!1),this.type===a.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(s,"RestElement")}if(s.argument=this.parseMaybeAssign(!1,i),this.type===a.comma&&i&&i.trailingComma<0)i.trailingComma=this.start;return this.finishNode(s,"SpreadElement")}if(this.options.ecmaVersion>=6){if(s.method=!1,s.shorthand=!1,e||i)h=this.start,p=this.startLoc;if(!e)r=this.eat(a.star)}var c=this.containsEsc;if(this.parsePropertyName(s),!e&&!c&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(s))o=!0,r=this.options.ecmaVersion>=9&&this.eat(a.star),this.parsePropertyName(s);else o=!1;return this.parsePropertyValue(s,e,r,o,h,p,i,c),this.finishNode(s,"Property")};m.parseGetterSetter=function(e){var i=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=i;var s=e.kind==="get"?0:1;if(e.value.params.length!==s){var r=e.value.start;if(e.kind==="get")this.raiseRecoverable(r,"getter should have no params");else this.raiseRecoverable(r,"setter should have exactly one param")}else if(e.kind==="set"&&e.value.params[0].type==="RestElement")this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};m.parsePropertyValue=function(e,i,s,r,o,h,p,c){if((s||r)&&this.type===a.colon)this.unexpected();if(this.eat(a.colon))e.value=i?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,p),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===a.parenL){if(i)this.unexpected();e.method=!0,e.value=this.parseMethod(s,r),e.kind="init"}else if(!i&&!c&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&(this.type!==a.comma&&this.type!==a.braceR&&this.type!==a.eq)){if(s||r)this.unexpected();this.parseGetterSetter(e)}else if(this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"){if(s||r)this.unexpected();if(this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=o;if(i)e.value=this.parseMaybeDefault(o,h,this.copyNode(e.key));else if(this.type===a.eq&&p){if(p.shorthandAssign<0)p.shorthandAssign=this.start;e.value=this.parseMaybeDefault(o,h,this.copyNode(e.key))}else e.value=this.copyNode(e.key);e.kind="init",e.shorthand=!0}else this.unexpected()};m.parsePropertyName=function(e){if(this.options.ecmaVersion>=6)if(this.eat(a.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(a.bracketR),e.key;else e.computed=!1;return e.key=this.type===a.num||this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};m.initFunction=function(e){if(e.id=null,this.options.ecmaVersion>=6)e.generator=e.expression=!1;if(this.options.ecmaVersion>=8)e.async=!1};m.parseMethod=function(e,i,s){var r=this.startNode(),o=this.yieldPos,h=this.awaitPos,p=this.awaitIdentPos;if(this.initFunction(r),this.options.ecmaVersion>=6)r.generator=e;if(this.options.ecmaVersion>=8)r.async=!!i;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(vt(i,r.generator)|rt|(s?It:0)),this.expect(a.parenL),r.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=o,this.awaitPos=h,this.awaitIdentPos=p,this.finishNode(r,"FunctionExpression")};m.parseArrowExpression=function(e,i,s,r){var o=this.yieldPos,h=this.awaitPos,p=this.awaitIdentPos;if(this.enterScope(vt(s,!1)|mt),this.initFunction(e),this.options.ecmaVersion>=8)e.async=!!s;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(i,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=o,this.awaitPos=h,this.awaitIdentPos=p,this.finishNode(e,"ArrowFunctionExpression")};m.parseFunctionBody=function(e,i,s,r){var o=i&&this.type!==a.braceL,h=this.strict,p=!1;if(o)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var c=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);if(!h||c){if(p=this.strictDirective(this.end),p&&c)this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var u=this.labels;if(this.labels=[],p)this.strict=!0;if(this.checkParams(e,!h&&!p&&!i&&!s&&this.isSimpleParamList(e.params)),this.strict&&e.id)this.checkLValSimple(e.id,Vt);e.body=this.parseBlock(!1,void 0,p&&!h),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};m.isSimpleParamList=function(e){for(var i=0,s=e;i<s.length;i+=1){var r=s[i];if(r.type!=="Identifier")return!1}return!0};m.checkParams=function(e,i){var s=Object.create(null);for(var r=0,o=e.params;r<o.length;r+=1){var h=o[r];this.checkLValInnerPattern(h,xt,i?null:s)}};m.parseExprList=function(e,i,s,r){var o=[],h=!0;while(!this.eat(e)){if(!h){if(this.expect(a.comma),i&&this.afterTrailingComma(e))break}else h=!1;var p=void 0;if(s&&this.type===a.comma)p=null;else if(this.type===a.ellipsis){if(p=this.parseSpread(r),r&&this.type===a.comma&&r.trailingComma<0)r.trailingComma=this.start}else p=this.parseMaybeAssign(!1,r);o.push(p)}return o};m.checkUnreserved=function(e){var{start:i,end:s,name:r}=e;if(this.inGenerator&&r==="yield")this.raiseRecoverable(i,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&r==="await")this.raiseRecoverable(i,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&at)&&r==="arguments")this.raiseRecoverable(i,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(r==="arguments"||r==="await"))this.raise(i,"Cannot use "+r+" in class static initialization block");if(this.keywords.test(r))this.raise(i,"Unexpected keyword '"+r+"'");if(this.options.ecmaVersion<6&&this.input.slice(i,s).indexOf("\\")!==-1)return;var o=this.strict?this.reservedWordsStrict:this.reservedWords;if(o.test(r)){if(!this.inAsync&&r==="await")this.raiseRecoverable(i,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(i,"The keyword '"+r+"' is reserved")}};m.parseIdent=function(e){var i=this.parseIdentNode();if(this.next(!!e),this.finishNode(i,"Identifier"),!e){if(this.checkUnreserved(i),i.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=i.start}return i};m.parseIdentNode=function(){var e=this.startNode();if(this.type===a.name)e.name=this.value;else if(this.type.keyword){if(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=a.name}else this.unexpected();return e};m.parsePrivateIdent=function(){var e=this.startNode();if(this.type===a.privateId)e.name=this.value;else this.unexpected();if(this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(e);return e};m.parseYield=function(e){if(!this.yieldPos)this.yieldPos=this.start;var i=this.startNode();if(this.next(),this.type===a.semi||this.canInsertSemicolon()||this.type!==a.star&&!this.type.startsExpr)i.delegate=!1,i.argument=null;else i.delegate=this.eat(a.star),i.argument=this.parseMaybeAssign(e);return this.finishNode(i,"YieldExpression")};m.parseAwait=function(e){if(!this.awaitPos)this.awaitPos=this.start;var i=this.startNode();return this.next(),i.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(i,"AwaitExpression")};var et=t.prototype;et.raise=function(e,i){var s=Et(this.input,e);if(i+=" ("+s.line+":"+s.column+")",this.sourceFile)i+=" in "+this.sourceFile;var r=SyntaxError(i);throw r.pos=e,r.loc=s,r.raisedAt=this.pos,r};et.raiseRecoverable=et.raise;et.curPosition=function(){if(this.options.locations)return new H(this.curLine,this.pos-this.lineStart)};var F=t.prototype,ee=function(i){this.flags=i,this.var=[],this.lexical=[],this.functions=[]};F.enterScope=function(e){this.scopeStack.push(new ee(e))};F.exitScope=function(){this.scopeStack.pop()};F.treatFunctionsAsVarInScope=function(e){return e.flags&B||!this.inModule&&e.flags&O};F.declareName=function(e,i,s){var r=!1;if(i===V){var o=this.currentScope();if(r=o.lexical.indexOf(e)>-1||o.functions.indexOf(e)>-1||o.var.indexOf(e)>-1,o.lexical.push(e),this.inModule&&o.flags&O)delete this.undefinedExports[e]}else if(i===Rt){var h=this.currentScope();h.lexical.push(e)}else if(i===Lt){var p=this.currentScope();if(this.treatFunctionsAsVar)r=p.lexical.indexOf(e)>-1;else r=p.lexical.indexOf(e)>-1||p.var.indexOf(e)>-1;p.functions.push(e)}else for(var c=this.scopeStack.length-1;c>=0;--c){var u=this.scopeStack[c];if(u.lexical.indexOf(e)>-1&&!(u.flags&Pt&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){r=!0;break}if(u.var.push(e),this.inModule&&u.flags&O)delete this.undefinedExports[e];if(u.flags&at)break}if(r)this.raiseRecoverable(s,"Identifier '"+e+"' has already been declared")};F.checkLocalExport=function(e){if(this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1)this.undefinedExports[e.name]=e};F.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};F.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var i=this.scopeStack[e];if(i.flags&(at|Q|M))return i}};F.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var i=this.scopeStack[e];if(i.flags&(at|Q|M)&&!(i.flags&mt))return i}};var ot=function(i,s,r){if(this.type="",this.start=s,this.end=0,i.options.locations)this.loc=new st(i,r);if(i.options.directSourceFile)this.sourceFile=i.options.directSourceFile;if(i.options.ranges)this.range=[s,0]},K=t.prototype;K.startNode=function(){return new ot(this,this.start,this.startLoc)};K.startNodeAt=function(e,i){return new ot(this,e,i)};function Bt(e,i,s,r){if(e.type=i,e.end=s,this.options.locations)e.loc.end=r;if(this.options.ranges)e.range[1]=s;return e}K.finishNode=function(e,i){return Bt.call(this,e,i,this.lastTokEnd,this.lastTokEndLoc)};K.finishNodeAt=function(e,i,s,r){return Bt.call(this,e,i,s,r)};K.copyNode=function(e){var i=new ot(this,e.start,this.startLoc);for(var s in e)i[s]=e[s];return i};var Mt=function(){};Mt.prototype.reset=function(){};t.prototype.validateRegExpFlags=function(){};t.prototype.validateRegExpPattern=function(){};var bt=function(i){if(this.type=i.type,this.value=i.value,this.start=i.start,this.end=i.end,i.options.locations)this.loc=new st(i,i.startLoc,i.endLoc);if(i.options.ranges)this.range=[i.start,i.end]},y=t.prototype;y.next=function(e){if(!e&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new bt(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};y.getToken=function(){return this.next(),new bt(this)};if(typeof Symbol<"u")y[Symbol.iterator]=function(){var e=this;return{next:function(){var i=e.getToken();return{done:i.type===a.eof,value:i}}}};y.nextToken=function(){var e=this.curContext();if(!e||!e.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(a.eof);if(e.override)return e.override(this);else this.readToken(this.fullCharCodeAtPos())};y.readToken=function(e){if(n(e,this.options.ecmaVersion>=6)||e===92)return this.readWord();return this.getTokenFromCode(e)};y.fullCharCodeAt=function(e){var i=this.input.charCodeAt(e);if(i<=55295||i>=56320)return i;var s=this.input.charCodeAt(e+1);return s<=56319||s>=57344?i:(i<<10)+s-56613888};y.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};y.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),i=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(s===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=s+2,this.options.locations)for(var r=void 0,o=i;(r=Ct(this.input,o,this.pos))>-1;)++this.curLine,o=this.lineStart=r;if(this.options.onComment)this.options.onComment(!0,this.input.slice(i+2,s),i,this.pos,e,this.curPosition())};y.skipLineComment=function(e){var i=this.pos,s=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);while(this.pos<this.input.length&&!z(r))r=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(i+e,this.pos),i,this.pos,s,this.curPosition())};y.skipSpace=function(){t:while(this.pos<this.input.length){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(e>8&&e<14||e>=5760&&At.test(String.fromCharCode(e)))++this.pos;else break t}}};y.finishToken=function(e,i){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var s=this.type;this.type=e,this.value=i,this.updateContext(s)};y.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var i=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&e===46&&i===46)return this.pos+=3,this.finishToken(a.ellipsis);else return++this.pos,this.finishToken(a.dot)};y.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(e===61)return this.finishOp(a.assign,2);return this.finishOp(a.slash,1)};y.readToken_mult_modulo_exp=function(e){var i=this.input.charCodeAt(this.pos+1),s=1,r=e===42?a.star:a.modulo;if(this.options.ecmaVersion>=7&&e===42&&i===42)++s,r=a.starstar,i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(a.assign,s+1);return this.finishOp(r,s)};y.readToken_pipe_amp=function(e){var i=this.input.charCodeAt(this.pos+1);if(i===e){if(this.options.ecmaVersion>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(a.assign,3)}return this.finishOp(e===124?a.logicalOR:a.logicalAND,2)}if(i===61)return this.finishOp(a.assign,2);return this.finishOp(e===124?a.bitwiseOR:a.bitwiseAND,1)};y.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);if(e===61)return this.finishOp(a.assign,2);return this.finishOp(a.bitwiseXOR,1)};y.readToken_plus_min=function(e){var i=this.input.charCodeAt(this.pos+1);if(i===e){if(i===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||T.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(a.incDec,2)}if(i===61)return this.finishOp(a.assign,2);return this.finishOp(a.plusMin,1)};y.readToken_lt_gt=function(e){var i=this.input.charCodeAt(this.pos+1),s=1;if(i===e){if(s=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+s)===61)return this.finishOp(a.assign,s+1);return this.finishOp(a.bitShift,s)}if(i===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(i===61)s=2;return this.finishOp(a.relational,s)};y.readToken_eq_excl=function(e){var i=this.input.charCodeAt(this.pos+1);if(i===61)return this.finishOp(a.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(e===61&&i===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(a.arrow);return this.finishOp(e===61?a.eq:a.prefix,1)};y.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var i=this.input.charCodeAt(this.pos+1);if(i===46){var s=this.input.charCodeAt(this.pos+2);if(s<48||s>57)return this.finishOp(a.questionDot,2)}if(i===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(a.assign,3)}return this.finishOp(a.coalesce,2)}}return this.finishOp(a.question,1)};y.readToken_numberSign=function(){var e=this.options.ecmaVersion,i=35;if(e>=13){if(++this.pos,i=this.fullCharCodeAtPos(),n(i,!0)||i===92)return this.finishToken(a.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+it(i)+"'")};y.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(a.parenL);case 41:return++this.pos,this.finishToken(a.parenR);case 59:return++this.pos,this.finishToken(a.semi);case 44:return++this.pos,this.finishToken(a.comma);case 91:return++this.pos,this.finishToken(a.bracketL);case 93:return++this.pos,this.finishToken(a.bracketR);case 123:return++this.pos,this.finishToken(a.braceL);case 125:return++this.pos,this.finishToken(a.braceR);case 58:return++this.pos,this.finishToken(a.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(a.backQuote);case 48:var i=this.input.charCodeAt(this.pos+1);if(i===120||i===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(i===111||i===79)return this.readRadixNumber(8);if(i===98||i===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(a.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+it(e)+"'")};y.finishOp=function(e,i){var s=this.input.slice(this.pos,this.pos+i);return this.pos+=i,this.finishToken(e,s)};y.readRegexp=function(){var e,i,s=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(s,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(T.test(r))this.raise(s,"Unterminated regular expression");if(!e){if(r==="[")i=!0;else if(r==="]"&&i)i=!1;else if(r==="/"&&!i)break;e=r==="\\"}else e=!1;++this.pos}var o=this.input.slice(s,this.pos);++this.pos;var h=this.pos,p=this.readWord1();if(this.containsEsc)this.unexpected(h);var c=this.regexpState||(this.regexpState=new Mt(this));c.reset(s,o,p),this.validateRegExpFlags(c),this.validateRegExpPattern(c);var u=null;try{u=new RegExp(o,p)}catch(d){}return this.finishToken(a.regexp,{pattern:o,flags:p,value:u})};y.readInt=function(e,i,s){var r=this.options.ecmaVersion>=12&&i===void 0,o=s&&this.input.charCodeAt(this.pos)===48,h=this.pos,p=0,c=0;for(var u=0,d=i==null?1/0:i;u<d;++u,++this.pos){var x=this.input.charCodeAt(this.pos),g=void 0;if(r&&x===95){if(o)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(c===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(u===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");c=x;continue}if(x>=97)g=x-97+10;else if(x>=65)g=x-65+10;else if(x>=48&&x<=57)g=x-48;else g=1/0;if(g>=e)break;c=x,p=p*e+g}if(r&&c===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===h||i!=null&&this.pos-h!==i)return null;return p};function ie(e,i){if(i)return parseInt(e,8);return parseFloat(e.replace(/_/g,""))}function Dt(e){if(typeof BigInt!=="function")return null;return BigInt(e.replace(/_/g,""))}y.readRadixNumber=function(e){var i=this.pos;this.pos+=2;var s=this.readInt(e);if(s==null)this.raise(this.start+2,"Expected number in radix "+e);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)s=Dt(this.input.slice(i,this.pos)),++this.pos;else if(n(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(a.num,s)};y.readNumber=function(e){var i=this.pos;if(!e&&this.readInt(10,void 0,!0)===null)this.raise(i,"Invalid number");var s=this.pos-i>=2&&this.input.charCodeAt(i)===48;if(s&&this.strict)this.raise(i,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!s&&!e&&this.options.ecmaVersion>=11&&r===110){var o=Dt(this.input.slice(i,this.pos));if(++this.pos,n(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(a.num,o)}if(s&&/[89]/.test(this.input.slice(i,this.pos)))s=!1;if(r===46&&!s)++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos);if((r===69||r===101)&&!s){if(r=this.input.charCodeAt(++this.pos),r===43||r===45)++this.pos;if(this.readInt(10)===null)this.raise(i,"Invalid number")}if(n(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var h=ie(this.input.slice(i,this.pos),s);return this.finishToken(a.num,h)};y.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),i;if(e===123){if(this.options.ecmaVersion<6)this.unexpected();var s=++this.pos;if(i=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,i>1114111)this.invalidStringToken(s,"Code point out of bounds")}else i=this.readHexChar(4);return i};y.readString=function(e){var i="",s=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;if(r===92)i+=this.input.slice(s,this.pos),i+=this.readEscapedChar(!1),s=this.pos;else if(r===8232||r===8233){if(this.options.ecmaVersion<10)this.raise(this.start,"Unterminated string constant");if(++this.pos,this.options.locations)this.curLine++,this.lineStart=this.pos}else{if(z(r))this.raise(this.start,"Unterminated string constant");++this.pos}}return i+=this.input.slice(s,this.pos++),this.finishToken(a.string,i)};var Ut={};y.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Ut)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};y.invalidStringToken=function(e,i){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ut;else this.raise(e,i)};y.readTmplToken=function(){var e="",i=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(s===96||s===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===a.template||this.type===a.invalidTemplate))if(s===36)return this.pos+=2,this.finishToken(a.dollarBraceL);else return++this.pos,this.finishToken(a.backQuote);return e+=this.input.slice(i,this.pos),this.finishToken(a.template,e)}if(s===92)e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!0),i=this.pos;else if(z(s)){switch(e+=this.input.slice(i,this.pos),++this.pos,s){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:e+=`
|
|
6
|
-
`;break;default:e+=String.fromCharCode(s);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;i=this.pos}else++this.pos}};
|
|
5
|
+
`),cooked:this.value};return this.next(),s.tail=this.type===a.backQuote,this.finishNode(s,"TemplateElement")};m.parseTemplate=function(e){if(e===void 0)e={};var i=e.isTagged;if(i===void 0)i=!1;var s=this.startNode();this.next(),s.expressions=[];var r=this.parseTemplateElement({isTagged:i});s.quasis=[r];while(!r.tail){if(this.type===a.eof)this.raise(this.pos,"Unterminated template literal");this.expect(a.dollarBraceL),s.expressions.push(this.parseExpression()),this.expect(a.braceR),s.quasis.push(r=this.parseTemplateElement({isTagged:i}))}return this.next(),this.finishNode(s,"TemplateLiteral")};m.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===a.name||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===a.star)&&!T.test(this.input.slice(this.lastTokEnd,this.start))};m.parseObj=function(e,i){var s=this.startNode(),r=!0,n={};s.properties=[],this.next();while(!this.eat(a.braceR)){if(!r){if(this.expect(a.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(a.braceR))break}else r=!1;var h=this.parseProperty(e,i);if(!e)this.checkPropClash(h,n,i);s.properties.push(h)}return this.finishNode(s,e?"ObjectPattern":"ObjectExpression")};m.parseProperty=function(e,i){var s=this.startNode(),r,n,h,p;if(this.options.ecmaVersion>=9&&this.eat(a.ellipsis)){if(e){if(s.argument=this.parseIdent(!1),this.type===a.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(s,"RestElement")}if(s.argument=this.parseMaybeAssign(!1,i),this.type===a.comma&&i&&i.trailingComma<0)i.trailingComma=this.start;return this.finishNode(s,"SpreadElement")}if(this.options.ecmaVersion>=6){if(s.method=!1,s.shorthand=!1,e||i)h=this.start,p=this.startLoc;if(!e)r=this.eat(a.star)}var l=this.containsEsc;if(this.parsePropertyName(s),!e&&!l&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(s))n=!0,r=this.options.ecmaVersion>=9&&this.eat(a.star),this.parsePropertyName(s);else n=!1;return this.parsePropertyValue(s,e,r,n,h,p,i,l),this.finishNode(s,"Property")};m.parseGetterSetter=function(e){var i=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=i;var s=e.kind==="get"?0:1;if(e.value.params.length!==s){var r=e.value.start;if(e.kind==="get")this.raiseRecoverable(r,"getter should have no params");else this.raiseRecoverable(r,"setter should have exactly one param")}else if(e.kind==="set"&&e.value.params[0].type==="RestElement")this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};m.parsePropertyValue=function(e,i,s,r,n,h,p,l){if((s||r)&&this.type===a.colon)this.unexpected();if(this.eat(a.colon))e.value=i?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,p),e.kind="init";else if(this.options.ecmaVersion>=6&&this.type===a.parenL){if(i)this.unexpected();e.method=!0,e.value=this.parseMethod(s,r),e.kind="init"}else if(!i&&!l&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&(this.type!==a.comma&&this.type!==a.braceR&&this.type!==a.eq)){if(s||r)this.unexpected();this.parseGetterSetter(e)}else if(this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"){if(s||r)this.unexpected();if(this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=n;if(i)e.value=this.parseMaybeDefault(n,h,this.copyNode(e.key));else if(this.type===a.eq&&p){if(p.shorthandAssign<0)p.shorthandAssign=this.start;e.value=this.parseMaybeDefault(n,h,this.copyNode(e.key))}else e.value=this.copyNode(e.key);e.kind="init",e.shorthand=!0}else this.unexpected()};m.parsePropertyName=function(e){if(this.options.ecmaVersion>=6)if(this.eat(a.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(a.bracketR),e.key;else e.computed=!1;return e.key=this.type===a.num||this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};m.initFunction=function(e){if(e.id=null,this.options.ecmaVersion>=6)e.generator=e.expression=!1;if(this.options.ecmaVersion>=8)e.async=!1};m.parseMethod=function(e,i,s){var r=this.startNode(),n=this.yieldPos,h=this.awaitPos,p=this.awaitIdentPos;if(this.initFunction(r),this.options.ecmaVersion>=6)r.generator=e;if(this.options.ecmaVersion>=8)r.async=!!i;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(vt(i,r.generator)|rt|(s?It:0)),this.expect(a.parenL),r.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,!1,!0,!1),this.yieldPos=n,this.awaitPos=h,this.awaitIdentPos=p,this.finishNode(r,"FunctionExpression")};m.parseArrowExpression=function(e,i,s,r){var n=this.yieldPos,h=this.awaitPos,p=this.awaitIdentPos;if(this.enterScope(vt(s,!1)|mt),this.initFunction(e),this.options.ecmaVersion>=8)e.async=!!s;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(i,!0),this.parseFunctionBody(e,!0,!1,r),this.yieldPos=n,this.awaitPos=h,this.awaitIdentPos=p,this.finishNode(e,"ArrowFunctionExpression")};m.parseFunctionBody=function(e,i,s,r){var n=i&&this.type!==a.braceL,h=this.strict,p=!1;if(n)e.body=this.parseMaybeAssign(r),e.expression=!0,this.checkParams(e,!1);else{var l=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);if(!h||l){if(p=this.strictDirective(this.end),p&&l)this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var u=this.labels;if(this.labels=[],p)this.strict=!0;if(this.checkParams(e,!h&&!p&&!i&&!s&&this.isSimpleParamList(e.params)),this.strict&&e.id)this.checkLValSimple(e.id,Vt);e.body=this.parseBlock(!1,void 0,p&&!h),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=u}this.exitScope()};m.isSimpleParamList=function(e){for(var i=0,s=e;i<s.length;i+=1){var r=s[i];if(r.type!=="Identifier")return!1}return!0};m.checkParams=function(e,i){var s=Object.create(null);for(var r=0,n=e.params;r<n.length;r+=1){var h=n[r];this.checkLValInnerPattern(h,xt,i?null:s)}};m.parseExprList=function(e,i,s,r){var n=[],h=!0;while(!this.eat(e)){if(!h){if(this.expect(a.comma),i&&this.afterTrailingComma(e))break}else h=!1;var p=void 0;if(s&&this.type===a.comma)p=null;else if(this.type===a.ellipsis){if(p=this.parseSpread(r),r&&this.type===a.comma&&r.trailingComma<0)r.trailingComma=this.start}else p=this.parseMaybeAssign(!1,r);n.push(p)}return n};m.checkUnreserved=function(e){var{start:i,end:s,name:r}=e;if(this.inGenerator&&r==="yield")this.raiseRecoverable(i,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&r==="await")this.raiseRecoverable(i,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&at)&&r==="arguments")this.raiseRecoverable(i,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(r==="arguments"||r==="await"))this.raise(i,"Cannot use "+r+" in class static initialization block");if(this.keywords.test(r))this.raise(i,"Unexpected keyword '"+r+"'");if(this.options.ecmaVersion<6&&this.input.slice(i,s).indexOf("\\")!==-1)return;var n=this.strict?this.reservedWordsStrict:this.reservedWords;if(n.test(r)){if(!this.inAsync&&r==="await")this.raiseRecoverable(i,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(i,"The keyword '"+r+"' is reserved")}};m.parseIdent=function(e){var i=this.parseIdentNode();if(this.next(!!e),this.finishNode(i,"Identifier"),!e){if(this.checkUnreserved(i),i.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=i.start}return i};m.parseIdentNode=function(){var e=this.startNode();if(this.type===a.name)e.name=this.value;else if(this.type.keyword){if(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=a.name}else this.unexpected();return e};m.parsePrivateIdent=function(){var e=this.startNode();if(this.type===a.privateId)e.name=this.value;else this.unexpected();if(this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(e);return e};m.parseYield=function(e){if(!this.yieldPos)this.yieldPos=this.start;var i=this.startNode();if(this.next(),this.type===a.semi||this.canInsertSemicolon()||this.type!==a.star&&!this.type.startsExpr)i.delegate=!1,i.argument=null;else i.delegate=this.eat(a.star),i.argument=this.parseMaybeAssign(e);return this.finishNode(i,"YieldExpression")};m.parseAwait=function(e){if(!this.awaitPos)this.awaitPos=this.start;var i=this.startNode();return this.next(),i.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(i,"AwaitExpression")};var et=t.prototype;et.raise=function(e,i){var s=Et(this.input,e);if(i+=" ("+s.line+":"+s.column+")",this.sourceFile)i+=" in "+this.sourceFile;var r=SyntaxError(i);throw r.pos=e,r.loc=s,r.raisedAt=this.pos,r};et.raiseRecoverable=et.raise;et.curPosition=function(){if(this.options.locations)return new H(this.curLine,this.pos-this.lineStart)};var F=t.prototype,ee=function(i){this.flags=i,this.var=[],this.lexical=[],this.functions=[]};F.enterScope=function(e){this.scopeStack.push(new ee(e))};F.exitScope=function(){this.scopeStack.pop()};F.treatFunctionsAsVarInScope=function(e){return e.flags&B||!this.inModule&&e.flags&O};F.declareName=function(e,i,s){var r=!1;if(i===V){var n=this.currentScope();if(r=n.lexical.indexOf(e)>-1||n.functions.indexOf(e)>-1||n.var.indexOf(e)>-1,n.lexical.push(e),this.inModule&&n.flags&O)delete this.undefinedExports[e]}else if(i===Rt){var h=this.currentScope();h.lexical.push(e)}else if(i===Lt){var p=this.currentScope();if(this.treatFunctionsAsVar)r=p.lexical.indexOf(e)>-1;else r=p.lexical.indexOf(e)>-1||p.var.indexOf(e)>-1;p.functions.push(e)}else for(var l=this.scopeStack.length-1;l>=0;--l){var u=this.scopeStack[l];if(u.lexical.indexOf(e)>-1&&!(u.flags&Pt&&u.lexical[0]===e)||!this.treatFunctionsAsVarInScope(u)&&u.functions.indexOf(e)>-1){r=!0;break}if(u.var.push(e),this.inModule&&u.flags&O)delete this.undefinedExports[e];if(u.flags&at)break}if(r)this.raiseRecoverable(s,"Identifier '"+e+"' has already been declared")};F.checkLocalExport=function(e){if(this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1)this.undefinedExports[e.name]=e};F.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};F.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var i=this.scopeStack[e];if(i.flags&(at|Q|M))return i}};F.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var i=this.scopeStack[e];if(i.flags&(at|Q|M)&&!(i.flags&mt))return i}};var ot=function(i,s,r){if(this.type="",this.start=s,this.end=0,i.options.locations)this.loc=new st(i,r);if(i.options.directSourceFile)this.sourceFile=i.options.directSourceFile;if(i.options.ranges)this.range=[s,0]},K=t.prototype;K.startNode=function(){return new ot(this,this.start,this.startLoc)};K.startNodeAt=function(e,i){return new ot(this,e,i)};function Bt(e,i,s,r){if(e.type=i,e.end=s,this.options.locations)e.loc.end=r;if(this.options.ranges)e.range[1]=s;return e}K.finishNode=function(e,i){return Bt.call(this,e,i,this.lastTokEnd,this.lastTokEndLoc)};K.finishNodeAt=function(e,i,s,r){return Bt.call(this,e,i,s,r)};K.copyNode=function(e){var i=new ot(this,e.start,this.startLoc);for(var s in e)i[s]=e[s];return i};var Mt=function(){};Mt.prototype.reset=function(){};t.prototype.validateRegExpFlags=function(){};t.prototype.validateRegExpPattern=function(){};var bt=function(i){if(this.type=i.type,this.value=i.value,this.start=i.start,this.end=i.end,i.options.locations)this.loc=new st(i,i.startLoc,i.endLoc);if(i.options.ranges)this.range=[i.start,i.end]},x=t.prototype;x.next=function(e){if(!e&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new bt(this));this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};x.getToken=function(){return this.next(),new bt(this)};if(typeof Symbol<"u")x[Symbol.iterator]=function(){var e=this;return{next:function(){var i=e.getToken();return{done:i.type===a.eof,value:i}}}};x.nextToken=function(){var e=this.curContext();if(!e||!e.preserveSpace)this.skipSpace();if(this.start=this.pos,this.options.locations)this.startLoc=this.curPosition();if(this.pos>=this.input.length)return this.finishToken(a.eof);if(e.override)return e.override(this);else this.readToken(this.fullCharCodeAtPos())};x.readToken=function(e){if(o(e,this.options.ecmaVersion>=6)||e===92)return this.readWord();return this.getTokenFromCode(e)};x.fullCharCodeAt=function(e){var i=this.input.charCodeAt(e);if(i<=55295||i>=56320)return i;var s=this.input.charCodeAt(e+1);return s<=56319||s>=57344?i:(i<<10)+s-56613888};x.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};x.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),i=this.pos,s=this.input.indexOf("*/",this.pos+=2);if(s===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=s+2,this.options.locations)for(var r=void 0,n=i;(r=Ct(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=r;if(this.options.onComment)this.options.onComment(!0,this.input.slice(i+2,s),i,this.pos,e,this.curPosition())};x.skipLineComment=function(e){var i=this.pos,s=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);while(this.pos<this.input.length&&!z(r))r=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(i+e,this.pos),i,this.pos,s,this.curPosition())};x.skipSpace=function(){t:while(this.pos<this.input.length){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:if(this.input.charCodeAt(this.pos+1)===10)++this.pos;case 10:case 8232:case 8233:if(++this.pos,this.options.locations)++this.curLine,this.lineStart=this.pos;break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(e>8&&e<14||e>=5760&&At.test(String.fromCharCode(e)))++this.pos;else break t}}};x.finishToken=function(e,i){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var s=this.type;this.type=e,this.value=i,this.updateContext(s)};x.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var i=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&e===46&&i===46)return this.pos+=3,this.finishToken(a.ellipsis);else return++this.pos,this.finishToken(a.dot)};x.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(e===61)return this.finishOp(a.assign,2);return this.finishOp(a.slash,1)};x.readToken_mult_modulo_exp=function(e){var i=this.input.charCodeAt(this.pos+1),s=1,r=e===42?a.star:a.modulo;if(this.options.ecmaVersion>=7&&e===42&&i===42)++s,r=a.starstar,i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(a.assign,s+1);return this.finishOp(r,s)};x.readToken_pipe_amp=function(e){var i=this.input.charCodeAt(this.pos+1);if(i===e){if(this.options.ecmaVersion>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(a.assign,3)}return this.finishOp(e===124?a.logicalOR:a.logicalAND,2)}if(i===61)return this.finishOp(a.assign,2);return this.finishOp(e===124?a.bitwiseOR:a.bitwiseAND,1)};x.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);if(e===61)return this.finishOp(a.assign,2);return this.finishOp(a.bitwiseXOR,1)};x.readToken_plus_min=function(e){var i=this.input.charCodeAt(this.pos+1);if(i===e){if(i===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||T.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(a.incDec,2)}if(i===61)return this.finishOp(a.assign,2);return this.finishOp(a.plusMin,1)};x.readToken_lt_gt=function(e){var i=this.input.charCodeAt(this.pos+1),s=1;if(i===e){if(s=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+s)===61)return this.finishOp(a.assign,s+1);return this.finishOp(a.bitShift,s)}if(i===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45)return this.skipLineComment(4),this.skipSpace(),this.nextToken();if(i===61)s=2;return this.finishOp(a.relational,s)};x.readToken_eq_excl=function(e){var i=this.input.charCodeAt(this.pos+1);if(i===61)return this.finishOp(a.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(e===61&&i===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(a.arrow);return this.finishOp(e===61?a.eq:a.prefix,1)};x.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var i=this.input.charCodeAt(this.pos+1);if(i===46){var s=this.input.charCodeAt(this.pos+2);if(s<48||s>57)return this.finishOp(a.questionDot,2)}if(i===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(a.assign,3)}return this.finishOp(a.coalesce,2)}}return this.finishOp(a.question,1)};x.readToken_numberSign=function(){var e=this.options.ecmaVersion,i=35;if(e>=13){if(++this.pos,i=this.fullCharCodeAtPos(),o(i,!0)||i===92)return this.finishToken(a.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+it(i)+"'")};x.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(a.parenL);case 41:return++this.pos,this.finishToken(a.parenR);case 59:return++this.pos,this.finishToken(a.semi);case 44:return++this.pos,this.finishToken(a.comma);case 91:return++this.pos,this.finishToken(a.bracketL);case 93:return++this.pos,this.finishToken(a.bracketR);case 123:return++this.pos,this.finishToken(a.braceL);case 125:return++this.pos,this.finishToken(a.braceR);case 58:return++this.pos,this.finishToken(a.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(a.backQuote);case 48:var i=this.input.charCodeAt(this.pos+1);if(i===120||i===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(i===111||i===79)return this.readRadixNumber(8);if(i===98||i===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(a.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+it(e)+"'")};x.finishOp=function(e,i){var s=this.input.slice(this.pos,this.pos+i);return this.pos+=i,this.finishToken(e,s)};x.readRegexp=function(){var e,i,s=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(s,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(T.test(r))this.raise(s,"Unterminated regular expression");if(!e){if(r==="[")i=!0;else if(r==="]"&&i)i=!1;else if(r==="/"&&!i)break;e=r==="\\"}else e=!1;++this.pos}var n=this.input.slice(s,this.pos);++this.pos;var h=this.pos,p=this.readWord1();if(this.containsEsc)this.unexpected(h);var l=this.regexpState||(this.regexpState=new Mt(this));l.reset(s,n,p),this.validateRegExpFlags(l),this.validateRegExpPattern(l);var u=null;try{u=new RegExp(n,p)}catch(d){}return this.finishToken(a.regexp,{pattern:n,flags:p,value:u})};x.readInt=function(e,i,s){var r=this.options.ecmaVersion>=12&&i===void 0,n=s&&this.input.charCodeAt(this.pos)===48,h=this.pos,p=0,l=0;for(var u=0,d=i==null?1/0:i;u<d;++u,++this.pos){var v=this.input.charCodeAt(this.pos),k=void 0;if(r&&v===95){if(n)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(l===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(u===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");l=v;continue}if(v>=97)k=v-97+10;else if(v>=65)k=v-65+10;else if(v>=48&&v<=57)k=v-48;else k=1/0;if(k>=e)break;l=v,p=p*e+k}if(r&&l===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===h||i!=null&&this.pos-h!==i)return null;return p};function ie(e,i){if(i)return parseInt(e,8);return parseFloat(e.replace(/_/g,""))}function Dt(e){if(typeof BigInt!=="function")return null;return BigInt(e.replace(/_/g,""))}x.readRadixNumber=function(e){var i=this.pos;this.pos+=2;var s=this.readInt(e);if(s==null)this.raise(this.start+2,"Expected number in radix "+e);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)s=Dt(this.input.slice(i,this.pos)),++this.pos;else if(o(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(a.num,s)};x.readNumber=function(e){var i=this.pos;if(!e&&this.readInt(10,void 0,!0)===null)this.raise(i,"Invalid number");var s=this.pos-i>=2&&this.input.charCodeAt(i)===48;if(s&&this.strict)this.raise(i,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!s&&!e&&this.options.ecmaVersion>=11&&r===110){var n=Dt(this.input.slice(i,this.pos));if(++this.pos,o(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(a.num,n)}if(s&&/[89]/.test(this.input.slice(i,this.pos)))s=!1;if(r===46&&!s)++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos);if((r===69||r===101)&&!s){if(r=this.input.charCodeAt(++this.pos),r===43||r===45)++this.pos;if(this.readInt(10)===null)this.raise(i,"Invalid number")}if(o(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var h=ie(this.input.slice(i,this.pos),s);return this.finishToken(a.num,h)};x.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),i;if(e===123){if(this.options.ecmaVersion<6)this.unexpected();var s=++this.pos;if(i=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,i>1114111)this.invalidStringToken(s,"Code point out of bounds")}else i=this.readHexChar(4);return i};x.readString=function(e){var i="",s=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;if(r===92)i+=this.input.slice(s,this.pos),i+=this.readEscapedChar(!1),s=this.pos;else if(r===8232||r===8233){if(this.options.ecmaVersion<10)this.raise(this.start,"Unterminated string constant");if(++this.pos,this.options.locations)this.curLine++,this.lineStart=this.pos}else{if(z(r))this.raise(this.start,"Unterminated string constant");++this.pos}}return i+=this.input.slice(s,this.pos++),this.finishToken(a.string,i)};var Ut={};x.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===Ut)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};x.invalidStringToken=function(e,i){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Ut;else this.raise(e,i)};x.readTmplToken=function(){var e="",i=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var s=this.input.charCodeAt(this.pos);if(s===96||s===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===a.template||this.type===a.invalidTemplate))if(s===36)return this.pos+=2,this.finishToken(a.dollarBraceL);else return++this.pos,this.finishToken(a.backQuote);return e+=this.input.slice(i,this.pos),this.finishToken(a.template,e)}if(s===92)e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!0),i=this.pos;else if(z(s)){switch(e+=this.input.slice(i,this.pos),++this.pos,s){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:e+=`
|
|
6
|
+
`;break;default:e+=String.fromCharCode(s);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;i=this.pos}else++this.pos}};x.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(a.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":if(this.input[this.pos+1]===`
|
|
7
7
|
`)++this.pos;case`
|
|
8
|
-
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};
|
|
9
|
-
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return it(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(e){var s=this.pos-1;this.invalidStringToken(s,"Invalid escape sequence in template string")}default:if(i>=48&&i<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],
|
|
10
|
-
export{
|
|
8
|
+
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};x.readEscapedChar=function(e){var i=this.input.charCodeAt(++this.pos);switch(++this.pos,i){case 110:return`
|
|
9
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return it(this.readCodePoint());case 116:return"\t";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:if(this.options.locations)this.lineStart=this.pos,++this.curLine;return"";case 56:case 57:if(this.strict)this.invalidStringToken(this.pos-1,"Invalid escape sequence");if(e){var s=this.pos-1;this.invalidStringToken(s,"Invalid escape sequence in template string")}default:if(i>=48&&i<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(r,8);if(n>255)r=r.slice(0,-1),n=parseInt(r,8);if(this.pos+=r.length-1,i=this.input.charCodeAt(this.pos),(r!=="0"||i===56||i===57)&&(this.strict||e))this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(n)}if(z(i)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(i)}};x.readHexChar=function(e){var i=this.pos,s=this.readInt(16,e);if(s===null)this.invalidStringToken(i,"Bad character escape sequence");return s};x.readWord1=function(){this.containsEsc=!1;var e="",i=!0,s=this.pos,r=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var n=this.fullCharCodeAtPos();if(c(n,r))this.pos+=n<=65535?1:2;else if(n===92){this.containsEsc=!0,e+=this.input.slice(s,this.pos);var h=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var p=this.readCodePoint();if(!(i?o:c)(p,r))this.invalidStringToken(h,"Invalid Unicode escape");e+=it(p),s=this.pos}else break;i=!1}return e+this.input.slice(s,this.pos)};x.readWord=function(){var e=this.readWord1(),i=a.name;if(this.keywords.test(e))i=ft[e];return this.finishToken(i,e)};var se="8.18.0";t.acorn={Parser:t,version:se,defaultOptions:lt,Position:H,SourceLocation:st,getLineInfo:Et,Node:ot,TokenType:b,tokTypes:a,keywordTypes:ft,TokContext:R,tokContexts:g,isIdentifierChar:c,isIdentifierStart:o,Token:bt,isNewLine:z,lineBreak:T,lineBreakG:jt,nonASCIIwhitespace:At};function A(e){return(i)=>e(i)}function E(...e){return t.extend(...e)}
|
|
10
|
+
export{o,c,t,A,E};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function l(e){return typeof e==="object"&&e!==null&&typeof m(e).type==="string"}function m(e){return e}function x(e,t){let n=m(e);for(let o in n){let s=n[o];if(Array.isArray(s)){for(let r=0;r<s.length;r++)if(l(s[r]))s[r]=t(s[r])}else if(l(s))n[o]=t(s)}}function g(e,...t){if(!t.some((n)=>n===e.type))throw Error(`expected ${t.join(" or ")}, got ${e.type}`)}
|
|
2
|
+
export{l,m,x,g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var b=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376],p=/[:!]/;function
|
|
2
|
-
export{
|
|
1
|
+
var b=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376],p=/[:!]/;function F(e){let n;return()=>(n??=m(e),n)}function m(e){let n=new Map,a=0,t="";for(let u of e.split(" ")){let o=u.search(p);t=t.slice(0,Number.parseInt(u[0],36))+u.slice(1,o);let r=Number.parseInt(u.slice(o+1),36);if(n.set(`${t};`,r),u[o]==="!")n.set(t,r);a=Math.max(a,t.length+1)}return{table:n,longest:a}}var Re=F("0amp!12 1pos:13 0gt!1q 0lt!1o 0quot!y"),l=(e)=>e>=48&&e<=57,E=(e)=>l(e)||e>=65&&e<=70||e>=97&&e<=102,g=(e)=>l(e)||e>=65&&e<=90||e>=97&&e<=122,c=0;function y(e,n,a,t){if(e.charCodeAt(n)===35){let i=(e.charCodeAt(n+1)|32)===120,f=n+(i?2:1),s=f;while(s<e.length&&(i?E:l)(e.charCodeAt(s)))s++;if(s===f)return 0;return c=e.charCodeAt(s)===59?s+1:s,Number.parseInt(e.slice(f,s),i?16:10)}let{table:u,longest:o}=t(),r=n;while(r-n<o&&g(e.charCodeAt(r)))r++;if(e.charCodeAt(r)===59){let i=u.get(e.slice(n,r+1));if(i!==void 0)return c=r+1,i}for(let i=r;i>n;i--){let f=u.get(e.slice(n,i));if(f===void 0)continue;if(a){let s=e.charCodeAt(i);if(g(s)||s===95||s===61)continue}return c=i,f}return 0}function d(e,n){if(e===10&&!n)return 32;if(e<128)return e;if(e<=159)return b[e-128];if(e>=55296&&e<=57343)return 0;if(e<=196607)return e;if(e>=917504&&e<=917631||e>=917760&&e<=917999)return e;return 0}function N(e,n,a){let t=e.indexOf("&");if(t===-1)return e;let u="",o=0;while(t!==-1){let r=y(e,t+1,n,a);if(r)u+=e.slice(o,t)+String.fromCodePoint(d(r,n)),o=c;t=e.indexOf("&",r?o:t+1)}return u+e.slice(o)}
|
|
2
|
+
export{F,Re,N};
|