sveast 0.9.2 → 0.9.4

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.
Files changed (54) hide show
  1. package/README.md +76 -3
  2. package/core.js +1 -1
  3. package/entities.js +1 -1
  4. package/index.d.ts +437 -7
  5. package/index.js +1 -1
  6. package/is-valid-type.js +1 -1
  7. package/lexer.js +3 -3
  8. package/module.js +1 -1
  9. package/package.json +6 -1
  10. package/parse-imports-exports.js +1 -1
  11. package/parse-module.js +1 -1
  12. package/parse-sections.js +1 -1
  13. package/parse.js +1 -1
  14. package/runes.js +1 -1
  15. package/scope.d.ts +1792 -0
  16. package/scope.js +1 -0
  17. package/shared-2by923ar.js +3 -0
  18. package/shared-3371ehgf.js +2 -0
  19. package/shared-4wqe6a27.js +5 -0
  20. package/shared-4zk9ntab.js +2 -0
  21. package/shared-artd3d80.js +2 -0
  22. package/shared-c9gzmr05.js +2 -0
  23. package/shared-h6c4cer7.js +2 -0
  24. package/shared-hjcsmz9f.js +2 -0
  25. package/shared-jxkrk6hx.js +10 -0
  26. package/{shared-k5pfyxpa.js → shared-n0fpkmn8.js} +2 -2
  27. package/shared-n1wnwhk8.js +3 -0
  28. package/shared-nbaaegmc.js +2 -0
  29. package/shared-rh41v5ez.js +3 -0
  30. package/shared-shxvsq2a.js +2 -0
  31. package/shared-stdj6se1.js +2 -0
  32. package/{shared-3yc3kmnb.js → shared-v0nj05q2.js} +2 -2
  33. package/shared-vjpq32kx.js +2 -0
  34. package/shared-xyqvjc3m.js +10 -0
  35. package/shared-znzncsf2.js +2 -0
  36. package/typescript.d.ts +3 -2
  37. package/typescript.js +1 -1
  38. package/walk.d.ts +248 -7
  39. package/walk.js +1 -1
  40. package/shared-00hyas4z.js +0 -2
  41. package/shared-40v3xx3k.js +0 -2
  42. package/shared-4y1phpr0.js +0 -3
  43. package/shared-5kdpxrm3.js +0 -5
  44. package/shared-a454y0yc.js +0 -2
  45. package/shared-fcgh2ks8.js +0 -2
  46. package/shared-ff56bedk.js +0 -2
  47. package/shared-np5jnnrw.js +0 -2
  48. package/shared-r6mb2ytj.js +0 -2
  49. package/shared-t30czg6b.js +0 -2
  50. package/shared-tgpdmrqm.js +0 -3
  51. package/shared-wkbh341y.js +0 -2
  52. package/shared-x7fez4k2.js +0 -3
  53. package/shared-yxr92tk5.js +0 -10
  54. package/shared-zd01zsyh.js +0 -10
@@ -0,0 +1,10 @@
1
+ var pt={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"},lt="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",zt={5:lt,"5module":lt+" export import",6:lt+" const class extends export import super"},Ct=/^in(stanceof)?$/,jt=/\p{ID_Start}/u,Gt=/[\p{ID_Continue}\u200c\u200d]/u;function m(t,e){if(t<65)return t===36;if(t<91)return!0;if(t<97)return t===95;if(t<123)return!0;if(t>65535&&e===!1)return!1;return t>=170&&jt.test(String.fromCodePoint(t))}function S(t,e){if(t<48)return t===36;if(t<58)return!0;if(t<65)return!1;if(t<91)return!0;if(t<97)return t===95;if(t<123)return!0;if(t>65535&&e===!1)return!1;return t>=170&&Gt.test(String.fromCodePoint(t))}var b=function(e,i){if(i===void 0)i={};this.label=e,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function T(t,e){return new b(t,{beforeExpr:!0,binop:e})}var P={beforeExpr:!0},E={startsExpr:!0},dt={};function y(t,e){if(e===void 0)e={};return e.keyword=t,dt[t]=new b(t,e)}var a={num:new b("num",E),regexp:new b("regexp",E),string:new b("string",E),name:new b("name",E),privateId:new b("privateId",E),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(",",P),semi:new b(";",P),colon:new b(":",P),dot:new b("."),question:new b("?",P),questionDot:new b("?."),arrow:new b("=>",P),template:new b("template"),invalidTemplate:new b("invalidTemplate"),ellipsis:new b("...",P),backQuote:new b("`",E),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:T("||",1),logicalAND:T("&&",2),bitwiseOR:T("|",3),bitwiseXOR:T("^",4),bitwiseAND:T("&",5),equality:T("==/!=/===/!==",6),relational:T("</>/<=/>=",7),bitShift:T("<</>>/>>>",8),plusMin:new b("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:T("%",10),star:T("*",10),slash:T("/",10),starstar:new b("**",{beforeExpr:!0}),coalesce:T("??",1),_break:y("break"),_case:y("case",P),_catch:y("catch"),_continue:y("continue"),_debugger:y("debugger"),_default:y("default",P),_do:y("do",{isLoop:!0,beforeExpr:!0}),_else:y("else",P),_finally:y("finally"),_for:y("for",{isLoop:!0}),_function:y("function",E),_if:y("if"),_return:y("return",P),_switch:y("switch"),_throw:y("throw",P),_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",E),_super:y("super",E),_class:y("class",E),_extends:y("extends",P),_export:y("export"),_import:y("import",E),_null:y("null",E),_true:y("true",E),_false:y("false",E),_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})},N=/\r\n?|\n|\u2028|\u2029/,Ht=new RegExp(N.source,"g");function z(t){return t===10||t===13||t===8232||t===8233}function At(t,e,i){if(i===void 0)i=t.length;for(var s=e;s<i;s++){var n=t.charCodeAt(s);if(z(n))return s<i-1&&n===13&&t.charCodeAt(s+1)===10?s+2:s+1}return-1}var Et=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,w=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Nt=Object.prototype,{hasOwnProperty:Yt,toString:Qt}=Nt,Q=Object.hasOwn||function(t,e){return Yt.call(t,e)},gt=Array.isArray||function(t){return Qt.call(t)==="[object Array]"},wt=Object.create(null);function Z(t){return wt[t]||(wt[t]=new RegExp("^(?:"+t.replace(/ /g,"|")+")$"))}function st(t){if(t<=65535)return String.fromCharCode(t);return t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320)}var Kt=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Y=function(e,i){this.line=e,this.column=i};Y.prototype.offset=function(e){return new Y(this.line,this.column+e)};var rt=function(e,i,s){if(this.start=i,this.end=s,e.sourceFile!==null)this.source=e.sourceFile};function Tt(t,e){for(var i=1,s=0;;){var n=At(t,s,e);if(n<0)return new Y(i,e-s);++i,s=n}}var ct={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},St=!1;function Xt(t){var e={};for(var i in ct)e[i]=t&&Q(t,i)?t[i]:ct[i];if(e.ecmaVersion==="latest")e.ecmaVersion=1e8;else if(e.ecmaVersion==null){if(!St&&typeof console==="object"&&console.warn)St=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
2
+ Defaulting to 2020, but this will stop working in the future.`);e.ecmaVersion=11}else if(e.ecmaVersion>=2015)e.ecmaVersion-=2009;if(e.allowReserved==null)e.allowReserved=e.ecmaVersion<5;if(!t||t.allowHashBang==null)e.allowHashBang=e.ecmaVersion>=14;if(gt(e.onToken)){var s=e.onToken;e.onToken=function(n){return s.push(n)}}if(gt(e.onComment))e.onComment=Jt(e,e.onComment);if(e.sourceType==="commonjs"&&e.allowAwaitOutsideFunction)throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return e}function Jt(t,e){return function(i,s,n,o,h,p){var c={type:i?"Block":"Line",value:s,start:n,end:o};if(t.locations)c.loc=new rt(this,h,p);if(t.ranges)c.range=[n,o];e.push(c)}}var O=1,B=2,mt=4,Pt=8,vt=16,It=32,at=64,_t=128,D=256,K=512,Lt=1024,nt=O|B|D;function xt(t,e){return B|(t?mt:0)|(e?Pt:0)}var tt=0,yt=1,R=2,Rt=3,Vt=4,Ft=5,r=function(e,i,s){this.options=e=Xt(e),this.sourceFile=e.sourceFile,this.keywords=Z(zt[e.ecmaVersion>=6?6:e.sourceType==="module"?"5module":5]);var n="";if(e.allowReserved!==!0){if(n=pt[e.ecmaVersion>=6?6:e.ecmaVersion===5?5:3],e.sourceType==="module")n+=" await"}this.reservedWords=Z(n);var o=(n?n+" ":"")+pt.strict;if(this.reservedWordsStrict=Z(o),this.reservedWordsStrictBind=Z(o+" "+pt.strictBind),this.input=String(i),this.containsEsc=!1,this.pos=s||0,this.curLine=1,e.startLocation)this.lineStart=this.pos-e.startLocation.column,this.curLine=e.startLocation.line;else if(s){if(this.lineStart=this.input.lastIndexOf(`
3
+ `,s-1)+1,this.options.locations)this.curLine=this.input.slice(0,this.lineStart).split(N).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=e.sourceType==="module",this.strict=this.inModule||e.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&&e.allowHashBang&&this.input.slice(0,2)==="#!")this.skipLineComment(2);this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?B:O),this.regexpState=null,this.privateNameStack=[]},I={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}};r.prototype.parse=function(){var e=this,i=this.options.program||this.startNode();return this.nextToken(),this.catchStackOverflow(function(){return e.parseTopLevel(i)})};I.inFunction.get=function(){return(this.currentVarScope().flags&B)>0};I.inGenerator.get=function(){return(this.currentVarScope().flags&Pt)>0};I.inAsync.get=function(){return(this.currentVarScope().flags&mt)>0};I.canAwait.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t],i=e.flags;if(i&(D|K))return!1;if(i&B)return(i&mt)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};I.allowReturn.get=function(){if(this.inFunction)return!0;if(this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&O)return!0;return!1};I.allowSuper.get=function(){var t=this.currentThisScope(),e=t.flags;return(e&at)>0||this.options.allowSuperOutsideMethod};I.allowDirectSuper.get=function(){return(this.currentThisScope().flags&_t)>0};I.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};I.allowNewDotTarget.get=function(){for(var t=this.scopeStack.length-1;t>=0;t--){var e=this.scopeStack[t],i=e.flags;if(i&(D|K)||i&B&&!(i&vt))return!0}return!1};I.allowUsing.get=function(){var t=this.currentScope(),e=t.flags;if(e&Lt)return!1;if(!this.inModule&&e&O)return!1;return!0};I.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&D)>0};r.extend=function(){var e=[],i=arguments.length;while(i--)e[i]=arguments[i];var s=this;for(var n=0;n<e.length;n++)s=e[n](s);return s};r.parse=function(e,i){return new this(i,e).parse()};r.parseExpressionAt=function(e,i,s){var n=new this(s,e,i);return n.nextToken(),n.parseExpression()};r.tokenizer=function(e,i){return new this(i,e)};Object.defineProperties(r.prototype,I);var A=r.prototype,Zt=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;A.strictDirective=function(t){if(this.options.ecmaVersion<5)return!1;for(;;){w.lastIndex=t,t+=w.exec(this.input)[0].length;var e=Zt.exec(this.input.slice(t));if(!e)return!1;if((e[1]||e[2])==="use strict"){w.lastIndex=t+e[0].length;var i=w.exec(this.input),s=i.index+i[0].length,n=this.input.charAt(s);return n===";"||n==="}"||N.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(n)||n==="!"&&this.input.charAt(s+1)==="=")}if(t+=e[0].length,w.lastIndex=t,t+=w.exec(this.input)[0].length,this.input[t]===";")t++}};A.eat=function(t){if(this.type===t)return this.next(),!0;else return!1};A.isContextual=function(t){return this.type===a.name&&this.value===t&&!this.containsEsc};A.eatContextual=function(t){if(!this.isContextual(t))return!1;return this.next(),!0};A.catchStackOverflow=function(t){try{return t()}catch(e){if(e instanceof Error&&(/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message)||/\btoo much recursion\b/i.test(e.message)))this.raise(this.start,"Not enough stack space to parse input");else throw e}};A.expectContextual=function(t){if(!this.eatContextual(t))this.unexpected()};A.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||N.test(this.input.slice(this.lastTokEnd,this.start))};A.insertSemicolon=function(){if(this.canInsertSemicolon()){if(this.options.onInsertedSemicolon)this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc);return!0}};A.semicolon=function(){if(!this.eat(a.semi)&&!this.insertSemicolon())this.unexpected()};A.afterTrailingComma=function(t,e){if(this.type===t){if(this.options.onTrailingComma)this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc);if(!e)this.next();return!0}};A.expect=function(t){this.eat(t)||this.unexpected()};A.unexpected=function(t){this.raise(t!=null?t:this.start,"Unexpected token")};var ot=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};A.checkPatternErrors=function(t,e){if(!t)return;if(t.trailingComma>-1)this.raiseRecoverable(t.trailingComma,"Comma is not permitted after the rest element");var i=e?t.parenthesizedAssign:t.parenthesizedBind;if(i>-1)this.raiseRecoverable(i,e?"Assigning to rvalue":"Parenthesized pattern")};A.checkExpressionErrors=function(t,e){if(!t)return!1;var{shorthandAssign:i,doubleProto:s}=t;if(!e)return i>=0||s>=0;if(i>=0)this.raise(i,"Shorthand property assignments are valid only in destructuring patterns");if(s>=0)this.raiseRecoverable(s,"Redefinition of __proto__ property")};A.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")};A.isSimpleAssignTarget=function(t){if(t.type==="ParenthesizedExpression")return this.isSimpleAssignTarget(t.expression);return t.type==="Identifier"||t.type==="MemberExpression"};var u=r.prototype;u.parseTopLevel=function(t){var e=Object.create(null);if(!t.body)t.body=[];while(this.type!==a.eof){var i=this.parseStatement(null,!0,e);t.body.push(i)}if(this.inModule)for(var s=0,n=Object.keys(this.undefinedExports);s<n.length;s+=1){var o=n[s];this.raiseRecoverable(this.undefinedExports[o].start,"Export '"+o+"' is not defined")}return this.adaptDirectivePrologue(t.body),this.next(),t.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(t,"Program")};var bt={kind:"loop"},$t={kind:"switch"};u.isLet=function(t){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;w.lastIndex=this.pos;var e=w.exec(this.input),i=this.pos+e[0].length,s=this.fullCharCodeAt(i);if(s===91||s===92)return!0;if(t)return!1;if(s===123)return!0;if(m(s)){var n=i;do i+=s<=65535?1:2;while(S(s=this.fullCharCodeAt(i)));if(s===92)return!0;var o=this.input.slice(n,i);if(!Ct.test(o))return!0}return!1};u.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;w.lastIndex=this.pos;var t=w.exec(this.input),e=this.pos+t[0].length,i;return!N.test(this.input.slice(this.pos,e))&&this.input.slice(e,e+8)==="function"&&(e+8===this.input.length||!(S(i=this.fullCharCodeAt(e+8))||i===92))};u.isUsingKeyword=function(t,e){if(this.options.ecmaVersion<17||!this.isContextual(t?"await":"using"))return!1;w.lastIndex=this.pos;var i=w.exec(this.input),s=this.pos+i[0].length;if(N.test(this.input.slice(this.pos,s)))return!1;if(t){var n=s+5,o;if(this.input.slice(s,n)!=="using"||n===this.input.length||S(o=this.fullCharCodeAt(n))||o===92)return!1;w.lastIndex=n;var h=w.exec(this.input);if(s=n+h[0].length,h&&N.test(this.input.slice(n,s)))return!1}var p=this.fullCharCodeAt(s);if(!m(p)&&p!==92)return!1;var c=s;do s+=p<=65535?1:2;while(S(p=this.fullCharCodeAt(s)));if(p===92)return!0;var f=this.input.slice(c,s);if(Ct.test(f))return!1;if(e&&!t&&f==="of"){w.lastIndex=s;var v=w.exec(this.input);if(s=s+v[0].length,this.input.charCodeAt(s)!==61||(p=this.input.charCodeAt(s+1))===61||p===62)return!1}return!0};u.isAwaitUsing=function(t){return this.isUsingKeyword(!0,t)};u.isUsing=function(t){return this.isUsingKeyword(!1,t)};u.parseStatement=function(t,e,i){var s=this.type,n=this.startNode(),o;if(this.isLet(t))s=a._var,o="let";switch(s){case a._break:case a._continue:return this.parseBreakContinueStatement(n,s.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(t&&(this.strict||t!=="if"&&t!=="label")&&this.options.ecmaVersion>=6)this.unexpected();return this.parseFunctionStatement(n,!1,!t);case a._class:if(t)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(o=o||this.value,t&&o!=="var")this.unexpected();return this.parseVarStatement(n,o);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&&s===a._import){w.lastIndex=this.pos;var h=w.exec(this.input),p=this.pos+h[0].length,c=this.input.charCodeAt(p);if(c===40||c===46)return this.parseExpressionStatement(n,this.parseExpression())}if(!this.options.allowImportExportEverywhere){if(!e)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 s===a._import?this.parseImport(n):this.parseExport(n,i);default:if(this.isAsyncFunction()){if(t)this.unexpected();return this.next(),this.parseFunctionStatement(n,!0,!t)}var f=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(f){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(t)this.raise(this.start,"Using declaration is not allowed in single-statement positions");if(f==="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,f),this.semicolon(),this.finishNode(n,"VariableDeclaration")}var v=this.value,k=this.parseExpression();if(s===a.name&&k.type==="Identifier"&&this.eat(a.colon))return this.parseLabeledStatement(n,v,k,t);else return this.parseExpressionStatement(n,k)}};u.parseBreakContinueStatement=function(t,e){var i=e==="break";if(this.next(),this.eat(a.semi)||this.insertSemicolon())t.label=null;else if(this.type!==a.name)this.unexpected();else t.label=this.parseIdent(),this.semicolon();var s=0;for(;s<this.labels.length;++s){var n=this.labels[s];if(t.label==null||n.name===t.label.name){if(n.kind!=null&&(i||n.kind==="loop"))break;if(t.label&&i)break}}if(s===this.labels.length)this.raise(t.start,"Unsyntactic "+e);return this.finishNode(t,i?"BreakStatement":"ContinueStatement")};u.parseDebuggerStatement=function(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")};u.parseDoStatement=function(t){if(this.next(),this.labels.push(bt),t.body=this.parseStatement("do"),this.labels.pop(),this.expect(a._while),t.test=this.parseParenExpression(),this.options.ecmaVersion>=6)this.eat(a.semi);else this.semicolon();return this.finishNode(t,"DoWhileStatement")};u.parseForStatement=function(t){this.next();var e=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(bt),this.enterScope(0),this.expect(a.parenL),this.type===a.semi){if(e>-1)this.unexpected(e);return this.parseFor(t,null)}var i=this.isLet();if(this.type===a._var||this.type===a._const||i){var s=this.startNode(),n=i?"let":this.value;return this.next(),this.parseVar(s,!0,n),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(t,s,e)}var o=this.isContextual("let"),h=!1,p=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(p){var c=this.startNode();if(this.next(),p==="await using"){if(!this.canAwait)this.raise(this.start,"Await using cannot appear outside of async function");this.next()}return this.parseVar(c,!0,p),this.finishNode(c,"VariableDeclaration"),this.parseForAfterInit(t,c,e)}var f=this.containsEsc,v=new ot,k=this.start,C=e>-1?this.parseExprSubscripts(v,"await"):this.parseExpression(!0,v);if(this.type===a._in||(h=this.options.ecmaVersion>=6&&this.isContextual("of"))){if(e>-1){if(this.type===a._in)this.unexpected(e);t.await=!0}else if(h&&this.options.ecmaVersion>=8){if(C.start===k&&!f&&C.type==="Identifier"&&C.name==="async")this.unexpected();else if(this.options.ecmaVersion>=9)t.await=!1}if(o&&h)this.raise(C.start,"The left-hand side of a for-of loop may not start with 'let'.");return this.toAssignable(C,!1,v),this.checkLValPattern(C),this.parseForIn(t,C)}else this.checkExpressionErrors(v,!0);if(e>-1)this.unexpected(e);return this.parseFor(t,C)};u.parseForAfterInit=function(t,e,i){if((this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&e.declarations.length===1){if(this.type===a._in){if((e.kind==="using"||e.kind==="await using")&&!e.declarations[0].init)this.raise(this.start,"Using declaration is not allowed in for-in loops");if(this.options.ecmaVersion>=9&&i>-1)this.unexpected(i)}else if(this.options.ecmaVersion>=9)t.await=i>-1;return this.parseForIn(t,e)}if(i>-1)this.unexpected(i);return this.parseFor(t,e)};u.parseFunctionStatement=function(t,e,i){return this.next(),this.parseFunction(t,H|(i?0:ut),!1,e)};u.parseIfStatement=function(t){return this.next(),t.test=this.parseParenExpression(),t.consequent=this.parseStatement("if"),t.alternate=this.eat(a._else)?this.parseStatement("if"):null,this.finishNode(t,"IfStatement")};u.parseReturnStatement=function(t){if(!this.allowReturn)this.raise(this.start,"'return' outside of function");if(this.next(),this.eat(a.semi)||this.insertSemicolon())t.argument=null;else t.argument=this.parseExpression(),this.semicolon();return this.finishNode(t,"ReturnStatement")};u.parseSwitchStatement=function(t){this.next(),t.discriminant=this.parseParenExpression(),t.cases=[],this.expect(a.braceL),this.labels.push($t),this.enterScope(Lt);var e;for(var i=!1;this.type!==a.braceR;)if(this.type===a._case||this.type===a._default){var s=this.type===a._case;if(e)this.finishNode(e,"SwitchCase");if(t.cases.push(e=this.startNode()),e.consequent=[],this.next(),s)e.test=this.parseExpression();else{if(i)this.raiseRecoverable(this.lastTokStart,"Multiple default clauses");i=!0,e.test=null}this.expect(a.colon)}else{if(!e)this.unexpected();e.consequent.push(this.parseStatement(null))}if(this.exitScope(),e)this.finishNode(e,"SwitchCase");return this.next(),this.labels.pop(),this.finishNode(t,"SwitchStatement")};u.parseThrowStatement=function(t){if(this.next(),N.test(this.input.slice(this.lastTokEnd,this.start)))this.raise(this.lastTokEnd,"Illegal newline after throw");return t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")};var te=[];u.parseCatchClauseParam=function(){var t=this.parseBindingAtom(),e=t.type==="Identifier";return this.enterScope(e?It:0),this.checkLValPattern(t,e?Vt:R),this.expect(a.parenR),t};u.parseTryStatement=function(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.type===a._catch){var e=this.startNode();if(this.next(),this.eat(a.parenL))e.param=this.parseCatchClauseParam();else{if(this.options.ecmaVersion<10)this.unexpected();e.param=null,this.enterScope(0)}e.body=this.parseBlock(!1),this.exitScope(),t.handler=this.finishNode(e,"CatchClause")}if(t.finalizer=this.eat(a._finally)?this.parseBlock():null,!t.handler&&!t.finalizer)this.raise(t.start,"Missing catch or finally clause");return this.finishNode(t,"TryStatement")};u.parseVarStatement=function(t,e,i){return this.next(),this.parseVar(t,!1,e,i),this.semicolon(),this.finishNode(t,"VariableDeclaration")};u.parseWhileStatement=function(t){return this.next(),t.test=this.parseParenExpression(),this.labels.push(bt),t.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(t,"WhileStatement")};u.parseWithStatement=function(t){if(this.strict)this.raise(this.start,"'with' in strict mode");return this.next(),t.object=this.parseParenExpression(),t.body=this.parseStatement("with"),this.finishNode(t,"WithStatement")};u.parseEmptyStatement=function(t){return this.next(),this.finishNode(t,"EmptyStatement")};u.parseLabeledStatement=function(t,e,i,s){for(var n=0,o=this.labels;n<o.length;n+=1){var h=o[n];if(h.name===e)this.raise(i.start,"Label '"+e+"' is already declared")}var p=this.type.isLoop?"loop":this.type===a._switch?"switch":null;for(var c=this.labels.length-1;c>=0;c--){var f=this.labels[c];if(f.statementStart===t.start)f.statementStart=this.start,f.kind=p;else break}return this.labels.push({name:e,kind:p,statementStart:this.start}),t.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),t.label=i,this.finishNode(t,"LabeledStatement")};u.parseExpressionStatement=function(t,e){return t.expression=e,this.semicolon(),this.finishNode(t,"ExpressionStatement")};u.parseBlock=function(t,e,i){if(t===void 0)t=!0;if(e===void 0)e=this.startNode();if(e.body=[],this.expect(a.braceL),t)this.enterScope(0);while(this.type!==a.braceR){var s=this.parseStatement(null);e.body.push(s)}if(i)this.strict=!1;if(this.next(),t)this.exitScope();return this.finishNode(e,"BlockStatement")};u.parseFor=function(t,e){return t.init=e,this.expect(a.semi),t.test=this.type===a.semi?null:this.parseExpression(),this.expect(a.semi),t.update=this.type===a.parenR?null:this.parseExpression(),this.expect(a.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,"ForStatement")};u.parseForIn=function(t,e){var i=this.type===a._in;if(this.next(),e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier"))this.raise(e.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer");return t.left=e,t.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(a.parenR),t.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(t,i?"ForInStatement":"ForOfStatement")};u.parseVar=function(t,e,i,s){t.declarations=[],t.kind=i;for(;;){var n=this.startNode();if(this.parseVarId(n,i),this.eat(a.eq))n.init=this.parseMaybeAssign(e);else if(!s&&i==="const"&&!(this.type===a._in||this.options.ecmaVersion>=6&&this.isContextual("of")))this.unexpected();else if(!s&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==a._in&&!this.isContextual("of"))this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration");else if(!s&&n.id.type!=="Identifier"&&!(e&&(this.type===a._in||this.isContextual("of"))))this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value");else n.init=null;if(t.declarations.push(this.finishNode(n,"VariableDeclarator")),!this.eat(a.comma))break}return t};u.parseVarId=function(t,e){t.id=e==="using"||e==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(t.id,e==="var"?yt:R,!1)};var H=1,ut=2,Ot=4;u.parseFunction=function(t,e,i,s,n){if(this.initFunction(t),this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s){if(this.type===a.star&&e&ut)this.unexpected();t.generator=this.eat(a.star)}if(this.options.ecmaVersion>=8)t.async=!!s;if(e&H){if(t.id=e&Ot&&this.type!==a.name?null:this.parseIdent(),t.id&&!(e&ut))this.checkLValSimple(t.id,this.strict||t.generator||t.async?this.treatFunctionsAsVar?yt:R:Rt)}var o=this.yieldPos,h=this.awaitPos,p=this.awaitIdentPos;if(this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(xt(t.async,t.generator)),!(e&H))t.id=this.type===a.name?this.parseIdent():null;return this.parseFunctionParams(t),this.parseFunctionBody(t,i,!1,n),this.yieldPos=o,this.awaitPos=h,this.awaitIdentPos=p,this.finishNode(t,e&H?"FunctionDeclaration":"FunctionExpression")};u.parseFunctionParams=function(t){this.expect(a.parenL),t.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};u.parseClass=function(t,e){this.next();var i=this.strict;this.strict=!0,this.parseClassId(t,e),this.parseClassSuper(t);var s=this.enterClassBody(),n=this.startNode(),o=!1;n.body=[],this.expect(a.braceL);while(this.type!==a.braceR){var h=this.parseClassElement(t.superClass!==null);if(h){if(n.body.push(h),h.type==="MethodDefinition"&&h.kind==="constructor"){if(o)this.raiseRecoverable(h.start,"Duplicate constructor in the same class");o=!0}else if(h.key&&h.key.type==="PrivateIdentifier"&&ee(s,h))this.raiseRecoverable(h.key.start,"Identifier '#"+h.key.name+"' has already been declared")}}return this.strict=i,this.next(),t.body=this.finishNode(n,"ClassBody"),this.exitClassBody(),this.finishNode(t,e?"ClassDeclaration":"ClassExpression")};u.parseClassElement=function(t){if(this.eat(a.semi))return null;var e=this.options.ecmaVersion,i=this.startNode(),s="",n=!1,o=!1,h="method",p=!1;if(this.eatContextual("static")){if(e>=13&&this.eat(a.braceL))return this.parseClassStaticBlock(i),i;if(this.isClassElementNameStart()||this.type===a.star)p=!0;else s="static"}if(i.static=p,!s&&e>=8&&this.eatContextual("async"))if((this.isClassElementNameStart()||this.type===a.star)&&!this.canInsertSemicolon())o=!0;else s="async";if(!s&&(e>=9||!o)&&this.eat(a.star))n=!0;if(!s&&!o&&!n){var c=this.value;if(this.eatContextual("get")||this.eatContextual("set"))if(this.isClassElementNameStart())h=c;else s=c}if(s)i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier");else this.parseClassElementName(i);if(e<13||this.type===a.parenL||h!=="method"||n||o){var f=!i.static&&et(i,"constructor"),v=f&&t;if(f&&h!=="method")this.raise(i.key.start,"Constructor can't have get/set modifier");i.kind=f?"constructor":h,this.parseClassMethod(i,n,o,v)}else this.parseClassField(i);return i};u.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};u.parseClassElementName=function(t){if(this.type===a.privateId){if(this.value==="constructor")this.raise(this.start,"Classes can't have an element named '#constructor'");t.computed=!1,t.key=this.parsePrivateIdent()}else this.parsePropertyName(t)};u.parseClassMethod=function(t,e,i,s){var n=t.key;if(t.kind==="constructor"){if(e)this.raise(n.start,"Constructor can't be a generator");if(i)this.raise(n.start,"Constructor can't be an async method")}else if(t.static&&et(t,"prototype"))this.raise(n.start,"Classes may not have a static property named prototype");var o=t.value=this.parseMethod(e,i,s);if(t.kind==="get"&&o.params.length!==0)this.raiseRecoverable(o.start,"getter should have no params");if(t.kind==="set"&&o.params.length!==1)this.raiseRecoverable(o.start,"setter should have exactly one param");if(t.kind==="set"&&o.params[0].type==="RestElement")this.raiseRecoverable(o.params[0].start,"Setter cannot use rest params");return this.finishNode(t,"MethodDefinition")};u.parseClassField=function(t){if(et(t,"constructor"))this.raise(t.key.start,"Classes can't have a field named 'constructor'");else if(t.static&&et(t,"prototype"))this.raise(t.key.start,"Classes can't have a static field named 'prototype'");if(this.eat(a.eq))this.enterScope(K|at),t.value=this.parseMaybeAssign(),this.exitScope();else t.value=null;return this.semicolon(),this.finishNode(t,"PropertyDefinition")};u.parseClassStaticBlock=function(t){t.body=[];var e=this.labels;this.labels=[],this.enterScope(D|at);while(this.type!==a.braceR){var i=this.parseStatement(null);t.body.push(i)}return this.next(),this.exitScope(),this.labels=e,this.finishNode(t,"StaticBlock")};u.parseClassId=function(t,e){if(this.type===a.name){if(t.id=this.parseIdent(),e)this.checkLValSimple(t.id,R,!1)}else{if(e===!0)this.unexpected();t.id=null}};u.parseClassSuper=function(t){t.superClass=this.eat(a._extends)?this.parseExprSubscripts(null,!1):null};u.enterClassBody=function(){var t={declared:Object.create(null),used:[]};return this.privateNameStack.push(t),t.declared};u.exitClassBody=function(){var t=this.privateNameStack.pop(),{declared:e,used:i}=t;if(!this.options.checkPrivateFields)return;var s=this.privateNameStack.length,n=s===0?null:this.privateNameStack[s-1];for(var o=0;o<i.length;++o){var h=i[o];if(!Q(e,h.name))if(n)n.used.push(h);else this.raiseRecoverable(h.start,"Private field '#"+h.name+"' must be declared in an enclosing class")}};function ee(t,e){var i=e.key.name,s=t[i],n="true";if(e.type==="MethodDefinition"&&(e.kind==="get"||e.kind==="set"))n=(e.static?"s":"i")+e.kind;if(s==="iget"&&n==="iset"||s==="iset"&&n==="iget"||s==="sget"&&n==="sset"||s==="sset"&&n==="sget")return t[i]="true",!1;else if(!s)return t[i]=n,!1;else return!0}function et(t,e){var{computed:i,key:s}=t;return!i&&(s.type==="Identifier"&&s.name===e||s.type==="Literal"&&s.value===e)}u.parseExportAllDeclaration=function(t,e){if(this.options.ecmaVersion>=11)if(this.eatContextual("as"))t.exported=this.parseModuleExportName(),this.checkExport(e,t.exported,this.lastTokStart);else t.exported=null;if(this.expectContextual("from"),this.type!==a.string)this.unexpected();if(t.source=this.parseExprAtom(),this.options.ecmaVersion>=16)t.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(t,"ExportAllDeclaration")};u.parseExport=function(t,e){if(this.next(),this.eat(a.star))return this.parseExportAllDeclaration(t,e);if(this.eat(a._default))return this.checkExport(e,"default",this.lastTokStart),t.declaration=this.parseExportDefaultDeclaration(),this.finishNode(t,"ExportDefaultDeclaration");if(this.shouldParseExportStatement()){if(t.declaration=this.parseExportDeclaration(t),t.declaration.type==="VariableDeclaration")this.checkVariableExport(e,t.declaration.declarations);else this.checkExport(e,t.declaration.id,t.declaration.id.start);if(t.specifiers=[],t.source=null,this.options.ecmaVersion>=16)t.attributes=[]}else{if(t.declaration=null,t.specifiers=this.parseExportSpecifiers(e),this.eatContextual("from")){if(this.type!==a.string)this.unexpected();if(t.source=this.parseExprAtom(),this.options.ecmaVersion>=16)t.attributes=this.parseWithClause()}else{for(var i=0,s=t.specifiers;i<s.length;i+=1){var n=s[i];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(t.source=null,this.options.ecmaVersion>=16)t.attributes=[]}this.semicolon()}return this.finishNode(t,"ExportNamedDeclaration")};u.parseExportDeclaration=function(t){return this.parseStatement(null)};u.parseExportDefaultDeclaration=function(){var t;if(this.type===a._function||(t=this.isAsyncFunction())){var e=this.startNode();if(this.next(),t)this.next();return this.parseFunction(e,H|Ot,!1,t)}else if(this.type===a._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var s=this.parseMaybeAssign();return this.semicolon(),s}};u.checkExport=function(t,e,i){if(!t)return;if(typeof e!=="string")e=e.type==="Identifier"?e.name:e.value;if(Q(t,e))this.raiseRecoverable(i,"Duplicate export '"+e+"'");t[e]=!0};u.checkPatternExport=function(t,e){var i=e.type;if(i==="Identifier")this.checkExport(t,e,e.start);else if(i==="ObjectPattern")for(var s=0,n=e.properties;s<n.length;s+=1){var o=n[s];this.checkPatternExport(t,o)}else if(i==="ArrayPattern")for(var h=0,p=e.elements;h<p.length;h+=1){var c=p[h];if(c)this.checkPatternExport(t,c)}else if(i==="Property")this.checkPatternExport(t,e.value);else if(i==="AssignmentPattern")this.checkPatternExport(t,e.left);else if(i==="RestElement")this.checkPatternExport(t,e.argument)};u.checkVariableExport=function(t,e){if(!t)return;for(var i=0,s=e;i<s.length;i+=1){var n=s[i];this.checkPatternExport(t,n.id)}};u.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};u.parseExportSpecifier=function(t){var e=this.startNode();return e.local=this.parseModuleExportName(),e.exported=this.eatContextual("as")?this.parseModuleExportName():e.local,this.checkExport(t,e.exported,e.exported.start),this.finishNode(e,"ExportSpecifier")};u.parseExportSpecifiers=function(t){var e=[],i=!0;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.parseExportSpecifier(t))}return e};u.parseImport=function(t){if(this.next(),this.type===a.string)t.specifiers=te,t.source=this.parseExprAtom();else t.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),t.source=this.type===a.string?this.parseExprAtom():this.unexpected();if(this.options.ecmaVersion>=16)t.attributes=this.parseWithClause();return this.semicolon(),this.finishNode(t,"ImportDeclaration")};u.parseImportSpecifier=function(){var t=this.startNode();if(t.imported=this.parseModuleExportName(),this.eatContextual("as"))t.local=this.parseIdent();else this.checkUnreserved(t.imported),t.local=t.imported;return this.checkLValSimple(t.local,R),this.finishNode(t,"ImportSpecifier")};u.parseImportDefaultSpecifier=function(){var t=this.startNode();return t.local=this.parseIdent(),this.checkLValSimple(t.local,R),this.finishNode(t,"ImportDefaultSpecifier")};u.parseImportNamespaceSpecifier=function(){var t=this.startNode();return this.next(),this.expectContextual("as"),t.local=this.parseIdent(),this.checkLValSimple(t.local,R),this.finishNode(t,"ImportNamespaceSpecifier")};u.parseImportSpecifiers=function(){var t=[],e=!0;if(this.type===a.name){if(t.push(this.parseImportDefaultSpecifier()),!this.eat(a.comma))return t}if(this.type===a.star)return t.push(this.parseImportNamespaceSpecifier()),t;this.expect(a.braceL);while(!this.eat(a.braceR)){if(!e){if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break}else e=!1;t.push(this.parseImportSpecifier())}return t};u.parseWithClause=function(){var t=[];if(!this.eat(a._with))return t;this.expect(a.braceL);var e={},i=!0;while(!this.eat(a.braceR)){if(!i){if(this.expect(a.comma),this.afterTrailingComma(a.braceR))break}else i=!1;var s=this.parseImportAttribute(),n=s.key.type==="Identifier"?s.key.name:s.key.value;if(Q(e,n))this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+n+"'");e[n]=!0,t.push(s)}return t};u.parseImportAttribute=function(){var t=this.startNode();if(t.key=this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(a.colon),this.type!==a.string)this.unexpected();return t.value=this.parseExprAtom(),this.finishNode(t,"ImportAttribute")};u.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===a.string){var t=this.parseLiteral(this.value);if(Kt.test(t.value))this.raise(t.start,"An export name cannot include a lone surrogate.");return t}return this.parseIdent(!0)};u.adaptDirectivePrologue=function(t){for(var e=0;e<t.length&&this.isDirectiveCandidate(t[e]);++e)t[e].directive=t[e].expression.raw.slice(1,-1)};u.isDirectiveCandidate=function(t){return this.options.ecmaVersion>=5&&t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value==="string"&&(this.input[t.start]==='"'||this.input[t.start]==="'")};var _=r.prototype;_.toAssignable=function(t,e,i){if(this.options.ecmaVersion>=6&&t)switch(t.type){case"Identifier":if(this.inAsync&&t.name==="await")this.raise(t.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":if(t.type="ObjectPattern",i)this.checkPatternErrors(i,!0);for(var s=0,n=t.properties;s<n.length;s+=1){var o=n[s];if(this.toAssignable(o,e),o.type==="RestElement"&&(o.argument.type==="ArrayPattern"||o.argument.type==="ObjectPattern"))this.raise(o.argument.start,"Unexpected token")}break;case"Property":if(t.kind!=="init")this.raise(t.key.start,"Object pattern can't contain getter or setter");this.toAssignable(t.value,e);break;case"ArrayExpression":if(t.type="ArrayPattern",i)this.checkPatternErrors(i,!0);this.toAssignableList(t.elements,e);break;case"SpreadElement":if(t.type="RestElement",this.toAssignable(t.argument,e),t.argument.type==="AssignmentPattern")this.raise(t.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":if(t.operator!=="=")this.raise(t.left.end,"Only '=' operator can be used for specifying default value.");t.type="AssignmentPattern",delete t.operator,this.toAssignable(t.left,e);break;case"ParenthesizedExpression":this.toAssignable(t.expression,e,i);break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!e)break;default:this.raise(t.start,"Assigning to rvalue")}else if(i)this.checkPatternErrors(i,!0);return t};_.toAssignableList=function(t,e){var i=t.length;for(var s=0;s<i;s++){var n=t[s];if(n)this.toAssignable(n,e)}if(i){var o=t[i-1];if(this.options.ecmaVersion===6&&e&&o&&o.type==="RestElement"&&o.argument.type!=="Identifier")this.unexpected(o.argument.start)}return t};_.parseSpread=function(t){var e=this.startNode();return this.next(),e.argument=this.parseMaybeAssign(!1,t),this.finishNode(e,"SpreadElement")};_.parseRestBinding=function(){var t=this.startNode();if(this.next(),this.options.ecmaVersion===6&&this.type!==a.name)this.unexpected();return t.argument=this.parseBindingAtom(),this.finishNode(t,"RestElement")};_.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case a.bracketL:var t=this.startNode();return this.next(),t.elements=this.parseBindingList(a.bracketR,!0,!0),this.finishNode(t,"ArrayPattern");case a.braceL:return this.parseObj(!0)}return this.parseIdent()};_.parseBindingList=function(t,e,i,s){var n=[],o=!0;while(!this.eat(t)){if(o)o=!1;else this.expect(a.comma);if(e&&this.type===a.comma)n.push(null);else if(i&&this.afterTrailingComma(t))break;else if(this.type===a.ellipsis){var h=this.parseRestBinding();if(this.parseBindingListItem(h),n.push(h),this.type===a.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");this.expect(t);break}else n.push(this.parseAssignableListItem(s))}return n};_.parseAssignableListItem=function(t){var e=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(e),e};_.parseBindingListItem=function(t){return t};_.parseMaybeDefault=function(t,e,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(a.eq))return i;var s=this.startNodeAt(t,e);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};_.checkLValSimple=function(t,e,i){if(e===void 0)e=tt;var s=e!==tt;switch(t.type){case"Identifier":if(this.strict&&this.reservedWordsStrictBind.test(t.name))this.raiseRecoverable(t.start,(s?"Binding ":"Assigning to ")+t.name+" in strict mode");if(s){if(e===R&&t.name==="let")this.raiseRecoverable(t.start,"let is disallowed as a lexically bound name");if(i){if(Q(i,t.name))this.raiseRecoverable(t.start,"Argument name clash");i[t.name]=!0}if(e!==Ft)this.declareName(t.name,e,t.start)}break;case"ChainExpression":this.raiseRecoverable(t.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(s)this.raiseRecoverable(t.start,"Binding member expression");break;case"ParenthesizedExpression":if(s)this.raiseRecoverable(t.start,"Binding parenthesized expression");return this.checkLValSimple(t.expression,e,i);default:this.raise(t.start,(s?"Binding":"Assigning to")+" rvalue")}};_.checkLValPattern=function(t,e,i){if(e===void 0)e=tt;switch(t.type){case"ObjectPattern":for(var s=0,n=t.properties;s<n.length;s+=1){var o=n[s];this.checkLValInnerPattern(o,e,i)}break;case"ArrayPattern":for(var h=0,p=t.elements;h<p.length;h+=1){var c=p[h];if(c)this.checkLValInnerPattern(c,e,i)}break;default:this.checkLValSimple(t,e,i)}};_.checkLValInnerPattern=function(t,e,i){if(e===void 0)e=tt;switch(t.type){case"Property":this.checkLValInnerPattern(t.value,e,i);break;case"AssignmentPattern":this.checkLValPattern(t.left,e,i);break;case"RestElement":this.checkLValPattern(t.argument,e,i);break;default:this.checkLValPattern(t,e,i)}};var L=function(e,i,s,n,o){this.token=e,this.isExpr=!!i,this.preserveSpace=!!s,this.override=n,this.generator=!!o},g={b_stat:new L("{",!1),b_expr:new L("{",!0),b_tmpl:new L("${",!1),p_stat:new L("(",!1),p_expr:new L("(",!0),q_tmpl:new L("`",!0,!0,function(t){return t.tryReadTemplateToken()}),f_stat:new L("function",!1),f_expr:new L("function",!0),f_expr_gen:new L("function",!0,!1,null,!0),f_gen:new L("function",!1,!1,null,!0)},j=r.prototype;j.initialContext=function(){return[g.b_stat]};j.curContext=function(){return this.context[this.context.length-1]};j.braceIsBlock=function(t){var e=this.curContext();if(e===g.f_expr||e===g.f_stat)return!0;if(t===a.colon&&(e===g.b_stat||e===g.b_expr))return!e.isExpr;if(t===a._return||t===a.name&&this.exprAllowed)return N.test(this.input.slice(this.lastTokEnd,this.start));if(t===a._else||t===a.semi||t===a.eof||t===a.parenR||t===a.arrow)return!0;if(t===a.braceL)return e===g.b_stat;if(t===a._var||t===a._const||t===a.name)return!1;return!this.exprAllowed};j.inGeneratorContext=function(){for(var t=this.context.length-1;t>=1;t--){var e=this.context[t];if(e.token==="function")return e.generator}return!1};j.updateContext=function(t){var e,i=this.type;if(i.keyword&&t===a.dot)this.exprAllowed=!1;else if(e=i.updateContext)e.call(this,t);else this.exprAllowed=i.beforeExpr};j.overrideContext=function(t){if(this.curContext()!==t)this.context[this.context.length-1]=t};a.parenR.updateContext=a.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var t=this.context.pop();if(t===g.b_stat&&this.curContext().token==="function")t=this.context.pop();this.exprAllowed=!t.isExpr};a.braceL.updateContext=function(t){this.context.push(this.braceIsBlock(t)?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(t){var e=t===a._if||t===a._for||t===a._with||t===a._while;this.context.push(e?g.p_stat:g.p_expr),this.exprAllowed=!0};a.incDec.updateContext=function(){};a._function.updateContext=a._class.updateContext=function(t){if(t.beforeExpr&&t!==a._else&&!(t===a.semi&&this.curContext()!==g.p_stat)&&!(t===a._return&&N.test(this.input.slice(this.lastTokEnd,this.start)))&&!((t===a.colon||t===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(t){if(t===a._function){var e=this.context.length-1;if(this.context[e]===g.f_expr)this.context[e]=g.f_expr_gen;else this.context[e]=g.f_gen}this.exprAllowed=!0};a.name.updateContext=function(t){var e=!1;if(this.options.ecmaVersion>=6&&t!==a.dot){if(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())e=!0}this.exprAllowed=e};var d=r.prototype;d.checkPropClash=function(t,e,i){if(this.options.ecmaVersion>=9&&t.type==="SpreadElement")return;if(this.options.ecmaVersion>=6&&(t.computed||t.method||t.shorthand))return;var s=t.key,n;switch(s.type){case"Identifier":n=s.name;break;case"Literal":n=String(s.value);break;default:return}var o=t.kind;if(this.options.ecmaVersion>=6){if(n==="__proto__"&&o==="init"){if(e.proto)if(i){if(i.doubleProto<0)i.doubleProto=s.start}else this.raiseRecoverable(s.start,"Redefinition of __proto__ property");e.proto=!0}return}n="$"+n;var h=e[n];if(h){var p;if(o==="init")p=this.strict&&h.init||h.get||h.set;else p=h.init||h[o];if(p)this.raiseRecoverable(s.start,"Redefinition of property")}else h=e[n]={init:!1,get:!1,set:!1};h[o]=!0};d.parseExpression=function(t,e){var i=this;return this.catchStackOverflow(function(){var{start:s,startLoc:n}=i,o=i.parseMaybeAssign(t,e);if(i.type===a.comma){var h=i.startNodeAt(s,n);h.expressions=[o];while(i.eat(a.comma))h.expressions.push(i.parseMaybeAssign(t,e));return i.finishNode(h,"SequenceExpression")}return o})};d.parseMaybeAssign=function(t,e,i){if(this.isContextual("yield"))if(this.inGenerator)return this.parseYield(t);else this.exprAllowed=!1;var s=!1,n=-1,o=-1,h=-1;if(e)n=e.parenthesizedAssign,o=e.trailingComma,h=e.doubleProto,e.parenthesizedAssign=e.trailingComma=-1;else e=new ot,s=!0;var p=this.start,c=this.startLoc;if(this.type===a.parenL||this.type===a.name)this.potentialArrowAt=this.start,this.potentialArrowInForAwait=t==="await";var f=this.parseMaybeConditional(t,e);if(i)f=i.call(this,f,p,c);if(this.type.isAssign){var v=this.startNodeAt(p,c);if(v.operator=this.value,this.type===a.eq)f=this.toAssignable(f,!1,e);if(!s)e.parenthesizedAssign=e.trailingComma=e.doubleProto=-1;if(e.shorthandAssign>=f.start)e.shorthandAssign=-1;if(this.type===a.eq)this.checkLValPattern(f);else this.checkLValSimple(f);if(v.left=f,this.next(),v.right=this.parseMaybeAssign(t),h>-1)e.doubleProto=h;return this.finishNode(v,"AssignmentExpression")}else if(s)this.checkExpressionErrors(e,!0);if(n>-1)e.parenthesizedAssign=n;if(o>-1)e.trailingComma=o;return f};d.parseMaybeConditional=function(t,e){var i=this.start,s=this.startLoc,n=this.parseExprOps(t,e);if(this.checkExpressionErrors(e))return n;if(!(n.type==="ArrowFunctionExpression"&&n.start===i)&&this.eat(a.question)){var o=this.startNodeAt(i,s);return o.test=n,o.consequent=this.parseMaybeAssign(),this.expect(a.colon),o.alternate=this.parseMaybeAssign(t),this.finishNode(o,"ConditionalExpression")}return n};d.parseExprOps=function(t,e){var i=this.start,s=this.startLoc,n=this.parseMaybeUnary(e,!1,!1,t);if(this.checkExpressionErrors(e))return n;return n.start===i&&n.type==="ArrowFunctionExpression"?n:this.parseExprOp(n,i,s,-1,t)};d.parseExprOp=function(t,e,i,s,n){var o=this.type.binop;if(o!=null&&(!n||this.type!==a._in)){if(o>s){var h=this.type===a.logicalOR||this.type===a.logicalAND,p=this.type===a.coalesce;if(p)o=a.logicalAND.binop;var c=this.value;this.next();var f=this.start,v=this.startLoc,k=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,n),f,v,o,n),C=this.buildBinary(e,i,t,k,c,h||p);if(h&&this.type===a.coalesce||p&&(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(C,e,i,s,n)}}return t};d.buildBinary=function(t,e,i,s,n,o){if(s.type==="PrivateIdentifier")this.raise(s.start,"Private identifier can only be left side of binary expression");var h=this.startNodeAt(t,e);return h.left=i,h.operator=n,h.right=s,this.finishNode(h,o?"LogicalExpression":"BinaryExpression")};d.parseMaybeUnary=function(t,e,i,s){var n=this.start,o=this.startLoc,h;if(this.isContextual("await")&&this.canAwait)h=this.parseAwait(s),e=!0;else if(this.type.prefix){var p=this.startNode(),c=this.type===a.incDec;if(p.operator=this.value,p.prefix=!0,this.next(),p.argument=this.parseMaybeUnary(null,!0,c,s),this.checkExpressionErrors(t,!0),c)this.checkLValSimple(p.argument);else if(this.strict&&p.operator==="delete"&&Bt(p.argument))this.raiseRecoverable(p.start,"Deleting local variable in strict mode");else if(p.operator==="delete"&&ft(p.argument))this.raiseRecoverable(p.start,"Private fields can not be deleted");else e=!0;h=this.finishNode(p,c?"UpdateExpression":"UnaryExpression")}else if(!e&&this.type===a.privateId){if((s||this.privateNameStack.length===0)&&this.options.checkPrivateFields)this.unexpected();if(h=this.parsePrivateIdent(),this.type!==a._in)this.unexpected()}else{if(h=this.parseExprSubscripts(t,s),this.checkExpressionErrors(t))return h;while(this.type.postfix&&!this.canInsertSemicolon()){var f=this.startNodeAt(n,o);f.operator=this.value,f.prefix=!1,f.argument=h,this.checkLValSimple(h),this.next(),h=this.finishNode(f,"UpdateExpression")}}if(!i&&!(h.type==="ArrowFunctionExpression"&&h.start===n)&&this.eat(a.starstar))if(e)this.unexpected(this.lastTokStart);else return this.buildBinary(n,o,h,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return h};function Bt(t){return t.type==="Identifier"||t.type==="ParenthesizedExpression"&&Bt(t.expression)}function ft(t){return t.type==="MemberExpression"&&t.property.type==="PrivateIdentifier"||t.type==="ChainExpression"&&ft(t.expression)||t.type==="ParenthesizedExpression"&&ft(t.expression)}d.parseExprSubscripts=function(t,e){var i=this.start,s=this.startLoc,n=this.parseExprAtom(t,e);if(n.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return n;var o=this.parseSubscripts(n,i,s,!1,e);if(t&&o.type==="MemberExpression"){if(t.parenthesizedAssign>=o.start)t.parenthesizedAssign=-1;if(t.parenthesizedBind>=o.start)t.parenthesizedBind=-1;if(t.trailingComma>=o.start)t.trailingComma=-1}return o};d.parseSubscripts=function(t,e,i,s,n){var o=this.options.ecmaVersion>=8&&t.type==="Identifier"&&t.name==="async"&&this.lastTokEnd===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.potentialArrowAt===t.start,h=!1;while(!0){var p=this.parseSubscript(t,e,i,s,o,h,n);if(p.optional)h=!0;if(p===t||p.type==="ArrowFunctionExpression"){if(h){var c=this.startNodeAt(e,i);c.expression=p,p=this.finishNode(c,"ChainExpression")}return p}t=p}};d.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(a.arrow)};d.parseSubscriptAsyncArrow=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!0,s)};d.parseSubscript=function(t,e,i,s,n,o,h){var p=this.options.ecmaVersion>=11,c=p&&this.eat(a.questionDot);if(s&&c)this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var f=this.eat(a.bracketL);if(f||c&&this.type!==a.parenL&&this.type!==a.backQuote||this.eat(a.dot)){var v=this.startNodeAt(e,i);if(v.object=t,f)v.property=this.parseExpression(),this.expect(a.bracketR);else if(this.type===a.privateId&&t.type!=="Super")v.property=this.parsePrivateIdent();else v.property=this.parseIdent(this.options.allowReserved!=="never");if(v.computed=!!f,p)v.optional=c;t=this.finishNode(v,"MemberExpression")}else if(!s&&this.eat(a.parenL)){var k=new ot,C=this.yieldPos,G=this.awaitPos,U=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var J=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1,k);if(n&&!c&&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=C,this.awaitPos=G,this.awaitIdentPos=U,this.parseSubscriptAsyncArrow(e,i,J,h)}this.checkExpressionErrors(k,!0),this.yieldPos=C||this.yieldPos,this.awaitPos=G||this.awaitPos,this.awaitIdentPos=U||this.awaitIdentPos;var q=this.startNodeAt(e,i);if(q.callee=t,q.arguments=J,p)q.optional=c;t=this.finishNode(q,"CallExpression")}else if(this.type===a.backQuote){if(c||o)this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var W=this.startNodeAt(e,i);W.tag=t,W.quasi=this.parseTemplate({isTagged:!0}),t=this.finishNode(W,"TaggedTemplateExpression")}return t};d.parseExprAtom=function(t,e,i){if(this.type===a.slash)this.readRegexp();var s,n=this.potentialArrowAt===this.start;switch(this.type){case a._super:if(!this.allowSuper)this.raise(this.start,"'super' keyword outside a method");if(s=this.startNode(),this.next(),this.type===a.parenL&&!this.allowDirectSuper)this.raise(s.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(s,"Super");case a._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case a.name:var o=this.start,h=this.startLoc,p=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!p&&c.name==="async"&&!this.canInsertSemicolon()&&this.eat(a._function))return this.overrideContext(g.f_expr),this.parseFunction(this.startNodeAt(o,h),0,!1,!0,e);if(n&&!this.canInsertSemicolon()){if(this.eat(a.arrow))return this.parseArrowExpression(this.startNodeAt(o,h),[c],!1,e);if(this.options.ecmaVersion>=8&&c.name==="async"&&this.type===a.name&&!p&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc)){if(c=this.parseIdent(!1),this.canInsertSemicolon()||!this.eat(a.arrow))this.unexpected();return this.parseArrowExpression(this.startNodeAt(o,h),[c],!0,e)}}return c;case a.regexp:var f=this.value;return s=this.parseLiteral(f.value),s.regex={pattern:f.pattern,flags:f.flags},s;case a.num:case a.string:return this.parseLiteral(this.value);case a._null:case a._true:case a._false:return s=this.startNode(),s.value=this.type===a._null?null:this.type===a._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case a.parenL:var v=this.start,k=this.parseParenAndDistinguishExpression(n,e);if(t){if(t.parenthesizedAssign<0&&!this.isSimpleAssignTarget(k))t.parenthesizedAssign=v;if(t.parenthesizedBind<0)t.parenthesizedBind=v}return k;case a.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(a.bracketR,!0,!0,t),this.finishNode(s,"ArrayExpression");case a.braceL:return this.overrideContext(g.b_expr),this.parseObj(!1,t);case a._function:return s=this.startNode(),this.next(),this.parseFunction(s,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(i);else return this.unexpected();default:return this.parseExprAtomDefault()}};d.parseExprAtomDefault=function(){this.unexpected()};d.parseExprImport=function(t){var e=this.startNode();if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword import");if(this.next(),this.type===a.parenL&&!t)return this.parseDynamicImport(e);else if(this.type===a.dot){var i=this.startNodeAt(e.start,e.loc&&e.loc.start);return i.name="import",e.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(e)}else this.unexpected()};d.parseDynamicImport=function(t){if(this.next(),t.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)if(!this.eat(a.parenR))if(this.expect(a.comma),!this.afterTrailingComma(a.parenR)){if(t.options=this.parseMaybeAssign(),!this.eat(a.parenR)){if(this.expect(a.comma),!this.afterTrailingComma(a.parenR))this.unexpected()}}else t.options=null;else t.options=null;else if(!this.eat(a.parenR)){var e=this.start;if(this.eat(a.comma)&&this.eat(a.parenR))this.raiseRecoverable(e,"Trailing comma is not allowed in import()");else this.unexpected(e)}return this.finishNode(t,"ImportExpression")};d.parseImportMeta=function(t){this.next();var e=this.containsEsc;if(t.property=this.parseIdent(!0),t.property.name!=="meta")this.raiseRecoverable(t.property.start,"The only valid meta property for import is 'import.meta'");if(e)this.raiseRecoverable(t.start,"'import.meta' must not contain escaped characters");if(this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere)this.raiseRecoverable(t.start,"Cannot use 'import.meta' outside a module");return this.finishNode(t,"MetaProperty")};d.parseLiteral=function(t){var e=this.startNode();if(e.value=t,e.raw=this.input.slice(this.start,this.end),e.raw.charCodeAt(e.raw.length-1)===110)e.bigint=e.value!=null?e.value.toString():e.raw.slice(0,-1).replace(/_/g,"");return this.next(),this.finishNode(e,"Literal")};d.parseParenExpression=function(){this.expect(a.parenL);var t=this.parseExpression();return this.expect(a.parenR),t};d.shouldParseArrow=function(t){return!this.canInsertSemicolon()};d.parseParenAndDistinguishExpression=function(t,e){var i=this.start,s=this.startLoc,n,o=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var h=this.start,p=this.startLoc,c=[],f=!0,v=!1,k=new ot,C=this.yieldPos,G=this.awaitPos,U;this.yieldPos=0,this.awaitPos=0;while(this.type!==a.parenR)if(f?f=!1:this.expect(a.comma),o&&this.afterTrailingComma(a.parenR,!0)){v=!0;break}else if(this.type===a.ellipsis){if(U=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===a.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else c.push(this.parseMaybeAssign(!1,k,this.parseParenItem));var J=this.lastTokEnd,q=this.lastTokEndLoc;if(this.expect(a.parenR),t&&this.shouldParseArrow(c)&&this.eat(a.arrow))return this.checkPatternErrors(k,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=C,this.awaitPos=G,this.parseParenArrowList(i,s,c,e);if(!c.length||v)this.unexpected(this.lastTokStart);if(U)this.unexpected(U);if(this.checkExpressionErrors(k,!0),this.yieldPos=C||this.yieldPos,this.awaitPos=G||this.awaitPos,c.length>1)n=this.startNodeAt(h,p),n.expressions=c,this.finishNodeAt(n,"SequenceExpression",J,q);else n=c[0]}else n=this.parseParenExpression();if(this.options.preserveParens){var W=this.startNodeAt(i,s);return W.expression=n,this.finishNode(W,"ParenthesizedExpression")}else return n};d.parseParenItem=function(t){return t};d.parseParenArrowList=function(t,e,i,s){return this.parseArrowExpression(this.startNodeAt(t,e),i,!1,s)};var ie=[];d.parseNew=function(){if(this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword new");var t=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===a.dot){var e=this.startNodeAt(t.start,t.loc&&t.loc.start);e.name="new",t.meta=this.finishNode(e,"Identifier"),this.next();var i=this.containsEsc;if(t.property=this.parseIdent(!0),t.property.name!=="target")this.raiseRecoverable(t.property.start,"The only valid meta property for new is 'new.target'");if(i)this.raiseRecoverable(t.start,"'new.target' must not contain escaped characters");if(!this.allowNewDotTarget)this.raiseRecoverable(t.start,"'new.target' can only be used in functions and class static block");return this.finishNode(t,"MetaProperty")}var s=this.start,n=this.startLoc;if(t.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,n,!0,!1),t.callee.type==="Super")this.raiseRecoverable(s,"Invalid use of 'super'");if(this.eat(a.parenL))t.arguments=this.parseExprList(a.parenR,this.options.ecmaVersion>=8,!1);else t.arguments=ie;return this.finishNode(t,"NewExpression")};d.parseTemplateElement=function(t){var e=t.isTagged,i=this.startNode();if(this.type===a.invalidTemplate){if(!e)this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal");i.value={raw:this.value.replace(/\r\n?/g,`
4
+ `),cooked:null}}else i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
5
+ `),cooked:this.value};return this.next(),i.tail=this.type===a.backQuote,this.finishNode(i,"TemplateElement")};d.parseTemplate=function(t){if(t===void 0)t={};var e=t.isTagged;if(e===void 0)e=!1;var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:e});i.quasis=[s];while(!s.tail){if(this.type===a.eof)this.raise(this.pos,"Unterminated template literal");this.expect(a.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(a.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:e}))}return this.next(),this.finishNode(i,"TemplateLiteral")};d.isAsyncProp=function(t){return!t.computed&&t.key.type==="Identifier"&&t.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)&&!N.test(this.input.slice(this.lastTokEnd,this.start))};d.parseObj=function(t,e){var i=this.startNode(),s=!0,n={};i.properties=[],this.next();while(!this.eat(a.braceR)){if(!s){if(this.expect(a.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(a.braceR))break}else s=!1;var o=this.parseProperty(t,e);if(!t)this.checkPropClash(o,n,e);i.properties.push(o)}return this.finishNode(i,t?"ObjectPattern":"ObjectExpression")};d.parseProperty=function(t,e){var i=this.startNode(),s,n,o,h;if(this.options.ecmaVersion>=9&&this.eat(a.ellipsis)){if(t){if(i.argument=this.parseIdent(!1),this.type===a.comma)this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");return this.finishNode(i,"RestElement")}if(i.argument=this.parseMaybeAssign(!1,e),this.type===a.comma&&e&&e.trailingComma<0)e.trailingComma=this.start;return this.finishNode(i,"SpreadElement")}if(this.options.ecmaVersion>=6){if(i.method=!1,i.shorthand=!1,t||e)o=this.start,h=this.startLoc;if(!t)s=this.eat(a.star)}var p=this.containsEsc;if(this.parsePropertyName(i),!t&&!p&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i))n=!0,s=this.options.ecmaVersion>=9&&this.eat(a.star),this.parsePropertyName(i);else n=!1;return this.parsePropertyValue(i,t,s,n,o,h,e,p),this.finishNode(i,"Property")};d.parseGetterSetter=function(t){var e=t.key.name;this.parsePropertyName(t),t.value=this.parseMethod(!1),t.kind=e;var i=t.kind==="get"?0:1;if(t.value.params.length!==i){var s=t.value.start;if(t.kind==="get")this.raiseRecoverable(s,"getter should have no params");else this.raiseRecoverable(s,"setter should have exactly one param")}else if(t.kind==="set"&&t.value.params[0].type==="RestElement")this.raiseRecoverable(t.value.params[0].start,"Setter cannot use rest params")};d.parsePropertyValue=function(t,e,i,s,n,o,h,p){if((i||s)&&this.type===a.colon)this.unexpected();if(this.eat(a.colon))t.value=e?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,h),t.kind="init";else if(this.options.ecmaVersion>=6&&this.type===a.parenL){if(e)this.unexpected();t.method=!0,t.value=this.parseMethod(i,s),t.kind="init"}else if(!e&&!p&&this.options.ecmaVersion>=5&&!t.computed&&t.key.type==="Identifier"&&(t.key.name==="get"||t.key.name==="set")&&(this.type!==a.comma&&this.type!==a.braceR&&this.type!==a.eq)){if(i||s)this.unexpected();this.parseGetterSetter(t)}else if(this.options.ecmaVersion>=6&&!t.computed&&t.key.type==="Identifier"){if(i||s)this.unexpected();if(this.checkUnreserved(t.key),t.key.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=n;if(e)t.value=this.parseMaybeDefault(n,o,this.copyNode(t.key));else if(this.type===a.eq&&h){if(h.shorthandAssign<0)h.shorthandAssign=this.start;t.value=this.parseMaybeDefault(n,o,this.copyNode(t.key))}else t.value=this.copyNode(t.key);t.kind="init",t.shorthand=!0}else this.unexpected()};d.parsePropertyName=function(t){if(this.options.ecmaVersion>=6)if(this.eat(a.bracketL))return t.computed=!0,t.key=this.parseMaybeAssign(),this.expect(a.bracketR),t.key;else t.computed=!1;return t.key=this.type===a.num||this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};d.initFunction=function(t){if(t.id=null,this.options.ecmaVersion>=6)t.generator=t.expression=!1;if(this.options.ecmaVersion>=8)t.async=!1};d.parseMethod=function(t,e,i){var s=this.startNode(),n=this.yieldPos,o=this.awaitPos,h=this.awaitIdentPos;if(this.initFunction(s),this.options.ecmaVersion>=6)s.generator=t;if(this.options.ecmaVersion>=8)s.async=!!e;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(xt(e,s.generator)|at|(i?_t:0)),this.expect(a.parenL),s.params=this.parseBindingList(a.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=n,this.awaitPos=o,this.awaitIdentPos=h,this.finishNode(s,"FunctionExpression")};d.parseArrowExpression=function(t,e,i,s){var n=this.yieldPos,o=this.awaitPos,h=this.awaitIdentPos;if(this.enterScope(xt(i,!1)|vt),this.initFunction(t),this.options.ecmaVersion>=8)t.async=!!i;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,t.params=this.toAssignableList(e,!0),this.parseFunctionBody(t,!0,!1,s),this.yieldPos=n,this.awaitPos=o,this.awaitIdentPos=h,this.finishNode(t,"ArrowFunctionExpression")};d.parseFunctionBody=function(t,e,i,s){var n=e&&this.type!==a.braceL,o=this.strict,h=!1;if(n)t.body=this.parseMaybeAssign(s),t.expression=!0,this.checkParams(t,!1);else{var p=this.options.ecmaVersion>=7&&!this.isSimpleParamList(t.params);if(!o||p){if(h=this.strictDirective(this.end),h&&p)this.raiseRecoverable(t.start,"Illegal 'use strict' directive in function with non-simple parameter list")}var c=this.labels;if(this.labels=[],h)this.strict=!0;if(this.checkParams(t,!o&&!h&&!e&&!i&&this.isSimpleParamList(t.params)),this.strict&&t.id)this.checkLValSimple(t.id,Ft);t.body=this.parseBlock(!1,void 0,h&&!o),t.expression=!1,this.adaptDirectivePrologue(t.body.body),this.labels=c}this.exitScope()};d.isSimpleParamList=function(t){for(var e=0,i=t;e<i.length;e+=1){var s=i[e];if(s.type!=="Identifier")return!1}return!0};d.checkParams=function(t,e){var i=Object.create(null);for(var s=0,n=t.params;s<n.length;s+=1){var o=n[s];this.checkLValInnerPattern(o,yt,e?null:i)}};d.parseExprList=function(t,e,i,s){var n=[],o=!0;while(!this.eat(t)){if(!o){if(this.expect(a.comma),e&&this.afterTrailingComma(t))break}else o=!1;var h=void 0;if(i&&this.type===a.comma)h=null;else if(this.type===a.ellipsis){if(h=this.parseSpread(s),s&&this.type===a.comma&&s.trailingComma<0)s.trailingComma=this.start}else h=this.parseMaybeAssign(!1,s);n.push(h)}return n};d.checkUnreserved=function(t){var{start:e,end:i,name:s}=t;if(this.inGenerator&&s==="yield")this.raiseRecoverable(e,"Cannot use 'yield' as identifier inside a generator");if(this.inAsync&&s==="await")this.raiseRecoverable(e,"Cannot use 'await' as identifier inside an async function");if(!(this.currentThisScope().flags&nt)&&s==="arguments")this.raiseRecoverable(e,"Cannot use 'arguments' in class field initializer");if(this.inClassStaticBlock&&(s==="arguments"||s==="await"))this.raise(e,"Cannot use "+s+" in class static initialization block");if(this.keywords.test(s))this.raise(e,"Unexpected keyword '"+s+"'");if(this.options.ecmaVersion<6&&this.input.slice(e,i).indexOf("\\")!==-1)return;var n=this.strict?this.reservedWordsStrict:this.reservedWords;if(n.test(s)){if(!this.inAsync&&s==="await")this.raiseRecoverable(e,"Cannot use keyword 'await' outside an async function");this.raiseRecoverable(e,"The keyword '"+s+"' is reserved")}};d.parseIdent=function(t){var e=this.parseIdentNode();if(this.next(!!t),this.finishNode(e,"Identifier"),!t){if(this.checkUnreserved(e),e.name==="await"&&!this.awaitIdentPos)this.awaitIdentPos=e.start}return e};d.parseIdentNode=function(){var t=this.startNode();if(this.type===a.name)t.name=this.value;else if(this.type.keyword){if(t.name=this.type.keyword,(t.name==="class"||t.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46))this.context.pop();this.type=a.name}else this.unexpected();return t};d.parsePrivateIdent=function(){var t=this.startNode();if(this.type===a.privateId)t.name=this.value;else this.unexpected();if(this.next(),this.finishNode(t,"PrivateIdentifier"),this.options.checkPrivateFields)if(this.privateNameStack.length===0)this.raise(t.start,"Private field '#"+t.name+"' must be declared in an enclosing class");else this.privateNameStack[this.privateNameStack.length-1].used.push(t);return t};d.parseYield=function(t){if(!this.yieldPos)this.yieldPos=this.start;var e=this.startNode();if(this.next(),this.type===a.semi||this.canInsertSemicolon()||this.type!==a.star&&!this.type.startsExpr)e.delegate=!1,e.argument=null;else e.delegate=this.eat(a.star),e.argument=this.parseMaybeAssign(t);return this.finishNode(e,"YieldExpression")};d.parseAwait=function(t){if(!this.awaitPos)this.awaitPos=this.start;var e=this.startNode();return this.next(),e.argument=this.parseMaybeUnary(null,!0,!1,t),this.finishNode(e,"AwaitExpression")};var it=r.prototype;it.raise=function(t,e){var i=Tt(this.input,t);if(e+=" ("+i.line+":"+i.column+")",this.sourceFile)e+=" in "+this.sourceFile;var s=SyntaxError(e);throw s.pos=t,s.loc=i,s.raisedAt=this.pos,s};it.raiseRecoverable=it.raise;it.curPosition=function(){if(this.options.locations)return new Y(this.curLine,this.pos-this.lineStart)};var F=r.prototype,se=function(e){this.flags=e,this.var=[],this.lexical=[],this.functions=[]};F.enterScope=function(t){this.scopeStack.push(new se(t))};F.exitScope=function(){this.scopeStack.pop()};F.treatFunctionsAsVarInScope=function(t){return t.flags&B||!this.inModule&&t.flags&O};F.declareName=function(t,e,i){var s=!1;if(e===R){var n=this.currentScope();if(s=n.lexical.indexOf(t)>-1||n.functions.indexOf(t)>-1||n.var.indexOf(t)>-1,n.lexical.push(t),this.inModule&&n.flags&O)delete this.undefinedExports[t]}else if(e===Vt){var o=this.currentScope();o.lexical.push(t)}else if(e===Rt){var h=this.currentScope();if(this.treatFunctionsAsVar)s=h.lexical.indexOf(t)>-1;else s=h.lexical.indexOf(t)>-1||h.var.indexOf(t)>-1;h.functions.push(t)}else for(var p=this.scopeStack.length-1;p>=0;--p){var c=this.scopeStack[p];if(c.lexical.indexOf(t)>-1&&!(c.flags&It&&c.lexical[0]===t)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(t)>-1){s=!0;break}if(c.var.push(t),this.inModule&&c.flags&O)delete this.undefinedExports[t];if(c.flags&nt)break}if(s)this.raiseRecoverable(i,"Identifier '"+t+"' has already been declared")};F.checkLocalExport=function(t){if(this.scopeStack[0].lexical.indexOf(t.name)===-1&&this.scopeStack[0].var.indexOf(t.name)===-1)this.undefinedExports[t.name]=t};F.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};F.currentVarScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&(nt|K|D))return e}};F.currentThisScope=function(){for(var t=this.scopeStack.length-1;;t--){var e=this.scopeStack[t];if(e.flags&(nt|K|D)&&!(e.flags&vt))return e}};var ht=function(e,i,s){if(this.type="",this.start=i,this.end=0,e.options.locations)this.loc=new rt(e,s);if(e.options.directSourceFile)this.sourceFile=e.options.directSourceFile;if(e.options.ranges)this.range=[i,0]},X=r.prototype;X.startNode=function(){return new ht(this,this.start,this.startLoc)};X.startNodeAt=function(t,e){return new ht(this,t,e)};function Mt(t,e,i,s){if(t.type=e,t.end=i,this.options.locations)t.loc.end=s;if(this.options.ranges)t.range[1]=i;return t}X.finishNode=function(t,e){return Mt.call(this,t,e,this.lastTokEnd,this.lastTokEndLoc)};X.finishNodeAt=function(t,e,i,s){return Mt.call(this,t,e,i,s)};X.copyNode=function(t){var e=new ht(this,t.start,this.startLoc);for(var i in t)e[i]=t[i];return e};var Dt=function(){};Dt.prototype.reset=function(){};r.prototype.validateRegExpFlags=function(){};r.prototype.validateRegExpPattern=function(){};var kt=function(e){if(this.type=e.type,this.value=e.value,this.start=e.start,this.end=e.end,e.options.locations)this.loc=new rt(e,e.startLoc,e.endLoc);if(e.options.ranges)this.range=[e.start,e.end]},x=r.prototype;x.next=function(t){if(!t&&this.type.keyword&&this.containsEsc)this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword);if(this.options.onToken)this.options.onToken(new kt(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 kt(this)};if(typeof Symbol<"u")x[Symbol.iterator]=function(){var t=this;return{next:function(){var e=t.getToken();return{done:e.type===a.eof,value:e}}}};x.nextToken=function(){var t=this.curContext();if(!t||!t.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(t.override)return t.override(this);else this.readToken(this.fullCharCodeAtPos())};x.readToken=function(t){if(m(t,this.options.ecmaVersion>=6)||t===92)return this.readWord();return this.getTokenFromCode(t)};x.fullCharCodeAt=function(t){var e=this.input.charCodeAt(t);if(e<=55295||e>=56320)return e;var i=this.input.charCodeAt(t+1);return i<=56319||i>=57344?e:(e<<10)+i-56613888};x.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};x.skipBlockComment=function(){var t=this.options.onComment&&this.curPosition(),e=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1)this.raise(this.pos-2,"Unterminated comment");if(this.pos=i+2,this.options.locations)for(var s=void 0,n=e;(s=At(this.input,n,this.pos))>-1;)++this.curLine,n=this.lineStart=s;if(this.options.onComment)this.options.onComment(!0,this.input.slice(e+2,i),e,this.pos,t,this.curPosition())};x.skipLineComment=function(t){var e=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=t);while(this.pos<this.input.length&&!z(s))s=this.input.charCodeAt(++this.pos);if(this.options.onComment)this.options.onComment(!1,this.input.slice(e+t,this.pos),e,this.pos,i,this.curPosition())};x.skipSpace=function(){t:while(this.pos<this.input.length){var t=this.input.charCodeAt(this.pos);switch(t){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(t>8&&t<14||t>=5760&&Et.test(String.fromCharCode(t)))++this.pos;else break t}}};x.finishToken=function(t,e){if(this.end=this.pos,this.options.locations)this.endLoc=this.curPosition();var i=this.type;this.type=t,this.value=e,this.updateContext(i)};x.readToken_dot=function(){var t=this.input.charCodeAt(this.pos+1);if(t>=48&&t<=57)return this.readNumber(!0);var e=this.input.charCodeAt(this.pos+2);if(this.options.ecmaVersion>=6&&t===46&&e===46)return this.pos+=3,this.finishToken(a.ellipsis);else return++this.pos,this.finishToken(a.dot)};x.readToken_slash=function(){var t=this.input.charCodeAt(this.pos+1);if(this.exprAllowed)return++this.pos,this.readRegexp();if(t===61)return this.finishOp(a.assign,2);return this.finishOp(a.slash,1)};x.readToken_mult_modulo_exp=function(t){var e=this.input.charCodeAt(this.pos+1),i=1,s=t===42?a.star:a.modulo;if(this.options.ecmaVersion>=7&&t===42&&e===42)++i,s=a.starstar,e=this.input.charCodeAt(this.pos+2);if(e===61)return this.finishOp(a.assign,i+1);return this.finishOp(s,i)};x.readToken_pipe_amp=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(a.assign,3)}return this.finishOp(t===124?a.logicalOR:a.logicalAND,2)}if(e===61)return this.finishOp(a.assign,2);return this.finishOp(t===124?a.bitwiseOR:a.bitwiseAND,1)};x.readToken_caret=function(){var t=this.input.charCodeAt(this.pos+1);if(t===61)return this.finishOp(a.assign,2);return this.finishOp(a.bitwiseXOR,1)};x.readToken_plus_min=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===t){if(e===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||N.test(this.input.slice(this.lastTokEnd,this.pos))))return this.skipLineComment(3),this.skipSpace(),this.nextToken();return this.finishOp(a.incDec,2)}if(e===61)return this.finishOp(a.assign,2);return this.finishOp(a.plusMin,1)};x.readToken_lt_gt=function(t){var e=this.input.charCodeAt(this.pos+1),i=1;if(e===t){if(i=t===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61)return this.finishOp(a.assign,i+1);return this.finishOp(a.bitShift,i)}if(e===33&&t===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(e===61)i=2;return this.finishOp(a.relational,i)};x.readToken_eq_excl=function(t){var e=this.input.charCodeAt(this.pos+1);if(e===61)return this.finishOp(a.equality,this.input.charCodeAt(this.pos+2)===61?3:2);if(t===61&&e===62&&this.options.ecmaVersion>=6)return this.pos+=2,this.finishToken(a.arrow);return this.finishOp(t===61?a.eq:a.prefix,1)};x.readToken_question=function(){var t=this.options.ecmaVersion;if(t>=11){var e=this.input.charCodeAt(this.pos+1);if(e===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(a.questionDot,2)}if(e===63){if(t>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(a.assign,3)}return this.finishOp(a.coalesce,2)}}return this.finishOp(a.question,1)};x.readToken_numberSign=function(){var t=this.options.ecmaVersion,e=35;if(t>=13){if(++this.pos,e=this.fullCharCodeAtPos(),m(e,!0)||e===92)return this.finishToken(a.privateId,this.readWord1())}this.raise(this.pos,"Unexpected character '"+st(e)+"'")};x.getTokenFromCode=function(t){switch(t){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 e=this.input.charCodeAt(this.pos+1);if(e===120||e===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(e===111||e===79)return this.readRadixNumber(8);if(e===98||e===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(t);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(t);case 124:case 38:return this.readToken_pipe_amp(t);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(t);case 60:case 62:return this.readToken_lt_gt(t);case 61:case 33:return this.readToken_eq_excl(t);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 '"+st(t)+"'")};x.finishOp=function(t,e){var i=this.input.slice(this.pos,this.pos+e);return this.pos+=e,this.finishToken(t,i)};x.readRegexp=function(){var t,e,i=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(N.test(s))this.raise(i,"Unterminated regular expression");if(!t){if(s==="[")e=!0;else if(s==="]"&&e)e=!1;else if(s==="/"&&!e)break;t=s==="\\"}else t=!1;++this.pos}var n=this.input.slice(i,this.pos);++this.pos;var o=this.pos,h=this.readWord1();if(this.containsEsc)this.unexpected(o);var p=this.regexpState||(this.regexpState=new Dt(this));p.reset(i,n,h),this.validateRegExpFlags(p),this.validateRegExpPattern(p);var c=null;try{c=new RegExp(n,h)}catch(f){}return this.finishToken(a.regexp,{pattern:n,flags:h,value:c})};x.readInt=function(t,e,i){var s=this.options.ecmaVersion>=12&&e===void 0,n=i&&this.input.charCodeAt(this.pos)===48,o=this.pos,h=0,p=0;for(var c=0,f=e==null?1/0:e;c<f;++c,++this.pos){var v=this.input.charCodeAt(this.pos),k=void 0;if(s&&v===95){if(n)this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals");if(p===95)this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore");if(c===0)this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits");p=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>=t)break;p=v,h=h*t+k}if(s&&p===95)this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits");if(this.pos===o||e!=null&&this.pos-o!==e)return null;return h};function ae(t,e){if(e)return parseInt(t,8);return parseFloat(t.replace(/_/g,""))}function Ut(t){if(typeof BigInt!=="function")return null;return BigInt(t.replace(/_/g,""))}x.readRadixNumber=function(t){var e=this.pos;this.pos+=2;var i=this.readInt(t);if(i==null)this.raise(this.start+2,"Expected number in radix "+t);if(this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110)i=Ut(this.input.slice(e,this.pos)),++this.pos;else if(m(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(a.num,i)};x.readNumber=function(t){var e=this.pos;if(!t&&this.readInt(10,void 0,!0)===null)this.raise(e,"Invalid number");var i=this.pos-e>=2&&this.input.charCodeAt(e)===48;if(i&&this.strict)this.raise(e,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!t&&this.options.ecmaVersion>=11&&s===110){var n=Ut(this.input.slice(e,this.pos));if(++this.pos,m(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");return this.finishToken(a.num,n)}if(i&&/[89]/.test(this.input.slice(e,this.pos)))i=!1;if(s===46&&!i)++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos);if((s===69||s===101)&&!i){if(s=this.input.charCodeAt(++this.pos),s===43||s===45)++this.pos;if(this.readInt(10)===null)this.raise(e,"Invalid number")}if(m(this.fullCharCodeAtPos()))this.raise(this.pos,"Identifier directly after number");var o=ae(this.input.slice(e,this.pos),i);return this.finishToken(a.num,o)};x.readCodePoint=function(){var t=this.input.charCodeAt(this.pos),e;if(t===123){if(this.options.ecmaVersion<6)this.unexpected();var i=++this.pos;if(e=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,e>1114111)this.invalidStringToken(i,"Code point out of bounds")}else e=this.readHexChar(4);return e};x.readString=function(t){var e="",i=++this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===t)break;if(s===92)e+=this.input.slice(i,this.pos),e+=this.readEscapedChar(!1),i=this.pos;else if(s===8232||s===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(s))this.raise(this.start,"Unterminated string constant");++this.pos}}return e+=this.input.slice(i,this.pos++),this.finishToken(a.string,e)};var qt={};x.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(t){if(t===qt)this.readInvalidTemplateToken();else throw t}this.inTemplateElement=!1};x.invalidStringToken=function(t,e){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw qt;else this.raise(t,e)};x.readTmplToken=function(){var t="",e=this.pos;for(;;){if(this.pos>=this.input.length)this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123){if(this.pos===this.start&&(this.type===a.template||this.type===a.invalidTemplate))if(i===36)return this.pos+=2,this.finishToken(a.dollarBraceL);else return++this.pos,this.finishToken(a.backQuote);return t+=this.input.slice(e,this.pos),this.finishToken(a.template,t)}if(i===92)t+=this.input.slice(e,this.pos),t+=this.readEscapedChar(!0),e=this.pos;else if(z(i)){switch(t+=this.input.slice(e,this.pos),++this.pos,i){case 13:if(this.input.charCodeAt(this.pos)===10)++this.pos;case 10:t+=`
6
+ `;break;default:t+=String.fromCharCode(i);break}if(this.options.locations)++this.curLine,this.lineStart=this.pos;e=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
+ `)++this.pos;case`
8
+ `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};x.readEscapedChar=function(t){var e=this.input.charCodeAt(++this.pos);switch(++this.pos,e){case 110:return`
9
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return st(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(t){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(e>=48&&e<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],n=parseInt(s,8);if(n>255)s=s.slice(0,-1),n=parseInt(s,8);if(this.pos+=s.length-1,e=this.input.charCodeAt(this.pos),(s!=="0"||e===56||e===57)&&(this.strict||t))this.invalidStringToken(this.pos-1-s.length,t?"Octal literal in template string":"Octal literal in strict mode");return String.fromCharCode(n)}if(z(e)){if(this.options.locations)this.lineStart=this.pos,++this.curLine;return""}return String.fromCharCode(e)}};x.readHexChar=function(t){var e=this.pos,i=this.readInt(16,t);if(i===null)this.invalidStringToken(e,"Bad character escape sequence");return i};x.readWord1=function(){this.containsEsc=!1;var t="",e=!0,i=this.pos,s=this.options.ecmaVersion>=6;while(this.pos<this.input.length){var n=this.fullCharCodeAtPos();if(S(n,s))this.pos+=n<=65535?1:2;else if(n===92){this.containsEsc=!0,t+=this.input.slice(i,this.pos);var o=this.pos;if(this.input.charCodeAt(++this.pos)!==117)this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX");++this.pos;var h=this.readCodePoint();if(!(e?m:S)(h,s))this.invalidStringToken(o,"Invalid Unicode escape");t+=st(h),i=this.pos}else break;e=!1}return t+this.input.slice(i,this.pos)};x.readWord=function(){var t=this.readWord1(),e=a.name;if(this.keywords.test(t))e=dt[t];return this.finishToken(e,t)};var ne="8.18.0";r.acorn={Parser:r,version:ne,defaultOptions:ct,Position:Y,SourceLocation:rt,getLineInfo:Tt,Node:ht,TokenType:b,tokTypes:a,keywordTypes:dt,TokContext:L,tokContexts:g,isIdentifierChar:S,isIdentifierStart:m,Token:kt,isNewLine:z,lineBreak:N,lineBreakG:Ht,nonASCIIwhitespace:Et};function M(t){return(e)=>t(e)}function re(...t){return r.extend(...t)}function V(t,e,i){for(let s=e;s<i;s++){let n=t.charCodeAt(s);if(n===10||n===13||n===8232||n===8233)return!0}return!1}var Wt=new WeakMap;function l(t,e){if(t===void 0)return!1;if(t.length<16)return t.includes(e);let i=Wt.get(t);if(i===void 0||i.length>t.length)i={names:new Set,length:0},Wt.set(t,i);while(i.length<t.length)i.names.add(t[i.length++]);return i.names.has(e)}
10
+ export{m,S,r,M,re,V,l};
@@ -0,0 +1,2 @@
1
+ var W=new Set(["$state","$state.raw","$derived","$derived.by","$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"]),P=new Set(["$state","$derived","$props","$bindable","$effect","$inspect","$host"]);
2
+ export{W,P};
package/typescript.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /**
2
- * TypeScript support for `createParser` from `sveast/core`, so it parses
3
- * `<script lang="ts">` and `parseModule(source, { typescript: true })`.
2
+ * TypeScript support for `createParser` from `sveast/core` and
3
+ * `createModuleParser` from `sveast/module`, so they parse
4
+ * `<script lang="ts">` and `typescript: true`.
4
5
  */
5
6
  export declare const typescript: TypeScriptSupport;
6
7
 
package/typescript.js CHANGED
@@ -1 +1 @@
1
- import"./shared-zd01zsyh.js";import"./shared-5kdpxrm3.js";import"./shared-yxr92tk5.js";import"./shared-np5jnnrw.js";import{a}from"./shared-00hyas4z.js";import{ct}from"./shared-fcgh2ks8.js";var t=ct(a);export{t as typescript};
1
+ import"./shared-xyqvjc3m.js";import"./shared-4wqe6a27.js";import"./shared-jxkrk6hx.js";import"./shared-c9gzmr05.js";import{c}from"./shared-vjpq32kx.js";import{vt}from"./shared-h6c4cer7.js";var t=vt(c);export{t as typescript};
package/walk.d.ts CHANGED
@@ -1,10 +1,4 @@
1
- /**
2
- * The fields of each node type that hold child nodes, in source order.
3
- * Typed against the AST, so a node type without an entry, or a key that
4
- * isn't one of its fields, fails typechecking. `tests/walk.test.ts` checks
5
- * the rest against the corpus: no field that holds a node is missing, and
6
- * children come in source order.
7
- */
1
+ /** The fields of each node type that hold child nodes, in source order. */
8
2
  export declare const visitorKeys: {
9
3
  readonly Root: readonly ["module", "instance", "fragment", "css"];
10
4
  readonly Script: readonly ["attributes", "content"];
@@ -124,6 +118,7 @@ export declare const visitorKeys: {
124
118
  readonly AwaitExpression: readonly ["argument"];
125
119
  readonly ImportExpression: readonly ["source", "options", "arguments"];
126
120
  readonly ChainExpression: readonly ["expression"];
121
+ readonly ParenthesizedExpression: readonly ["expression"];
127
122
  readonly MetaProperty: readonly ["meta", "property"];
128
123
  readonly ObjectPattern: readonly ["decorators", "properties", "typeAnnotation"];
129
124
  readonly ArrayPattern: readonly ["decorators", "elements", "typeAnnotation"];
@@ -256,6 +251,220 @@ export declare const markupVisitorKeys: {
256
251
  readonly SnippetBlock: readonly ["body"];
257
252
  };
258
253
 
254
+ /**
255
+ * {@link visitorKeys} without TypeScript's types: a {@link walk} with it
256
+ * reaches every value and binding but no type annotation, type
257
+ * parameter, type argument, `implements` clause or type in `as` and
258
+ * `satisfies`, so an `Identifier` it reaches in a TypeScript node is
259
+ * never a type's name. It still enters a declaration that holds only
260
+ * types, such as `type T = ...`, `interface I {}` or an index signature,
261
+ * but not its children, and of `declare function f(): void` it visits
262
+ * only the name. The
263
+ * TypeScript nodes it enters children of hold values: `as`,
264
+ * `satisfies`, `<T>a`, `a!` and `a<T>` hold their expression, an enum
265
+ * its members, a namespace its body, `import a = b` and `export =` their
266
+ * value, and a parameter property its parameter.
267
+ */
268
+ export declare const valueVisitorKeys: {
269
+ readonly FunctionDeclaration: readonly ["id", "params", "body"];
270
+ readonly FunctionExpression: readonly ["id", "params", "body"];
271
+ readonly ArrowFunctionExpression: readonly ["params", "body"];
272
+ readonly ClassDeclaration: readonly ["decorators", "id", "superClass", "body"];
273
+ readonly ClassExpression: readonly ["decorators", "id", "superClass", "body"];
274
+ readonly MethodDefinition: readonly ["decorators", "key", "value"];
275
+ readonly PropertyDefinition: readonly ["decorators", "key", "value"];
276
+ readonly Identifier: readonly ["decorators"];
277
+ readonly CallExpression: readonly ["callee", "arguments"];
278
+ readonly NewExpression: readonly ["callee", "arguments"];
279
+ readonly TaggedTemplateExpression: readonly ["tag", "quasi"];
280
+ readonly RestElement: readonly ["decorators", "argument"];
281
+ readonly ObjectPattern: readonly ["decorators", "properties"];
282
+ readonly ArrayPattern: readonly ["decorators", "elements"];
283
+ readonly TSTypeAnnotation: readonly [];
284
+ readonly TSTypeParameterDeclaration: readonly [];
285
+ readonly TSTypeParameterInstantiation: readonly [];
286
+ readonly TSTypeParameter: readonly [];
287
+ readonly TSArrayType: readonly [];
288
+ readonly TSTupleType: readonly [];
289
+ readonly TSNamedTupleMember: readonly [];
290
+ readonly TSOptionalType: readonly [];
291
+ readonly TSRestType: readonly [];
292
+ readonly TSUnionType: readonly [];
293
+ readonly TSIntersectionType: readonly [];
294
+ readonly TSConditionalType: readonly [];
295
+ readonly TSInferType: readonly [];
296
+ readonly TSParenthesizedType: readonly [];
297
+ readonly TSTypeOperator: readonly [];
298
+ readonly TSIndexedAccessType: readonly [];
299
+ readonly TSMappedType: readonly [];
300
+ readonly TSLiteralType: readonly [];
301
+ readonly TSTypeReference: readonly [];
302
+ readonly TSTypeQuery: readonly [];
303
+ readonly TSImportType: readonly [];
304
+ readonly TSTypeLiteral: readonly [];
305
+ readonly TSPropertySignature: readonly [];
306
+ readonly TSMethodSignature: readonly [];
307
+ readonly TSCallSignatureDeclaration: readonly [];
308
+ readonly TSConstructSignatureDeclaration: readonly [];
309
+ readonly TSFunctionType: readonly [];
310
+ readonly TSConstructorType: readonly [];
311
+ readonly TSIndexSignature: readonly [];
312
+ readonly TSTypePredicate: readonly [];
313
+ readonly TSInterfaceDeclaration: readonly [];
314
+ readonly TSInterfaceBody: readonly [];
315
+ readonly TSExpressionWithTypeArguments: readonly [];
316
+ readonly TSTypeAliasDeclaration: readonly [];
317
+ readonly TSNamespaceExportDeclaration: readonly [];
318
+ readonly TSDeclareFunction: readonly ["id"];
319
+ readonly TSDeclareMethod: readonly [];
320
+ readonly TSAsExpression: readonly ["expression"];
321
+ readonly TSSatisfiesExpression: readonly ["expression"];
322
+ readonly TSTypeAssertion: readonly ["expression"];
323
+ readonly TSInstantiationExpression: readonly ["expression"];
324
+ readonly Root: readonly ["module", "instance", "fragment", "css"];
325
+ readonly Script: readonly ["attributes", "content"];
326
+ readonly Fragment: readonly ["nodes"];
327
+ readonly Text: readonly [];
328
+ readonly Comment: readonly [];
329
+ readonly ExpressionTag: readonly ["expression"];
330
+ readonly HtmlTag: readonly ["expression"];
331
+ readonly ConstTag: readonly ["declaration"];
332
+ readonly DeclarationTag: readonly ["declaration"];
333
+ readonly DebugTag: readonly ["identifiers"];
334
+ readonly RenderTag: readonly ["expression"];
335
+ readonly AttachTag: readonly ["expression"];
336
+ readonly Attribute: readonly ["value"];
337
+ readonly SpreadAttribute: readonly ["expression"];
338
+ readonly AnimateDirective: readonly ["expression"];
339
+ readonly BindDirective: readonly ["expression"];
340
+ readonly ClassDirective: readonly ["expression"];
341
+ readonly LetDirective: readonly ["expression"];
342
+ readonly OnDirective: readonly ["expression"];
343
+ readonly StyleDirective: readonly ["value"];
344
+ readonly TransitionDirective: readonly ["expression"];
345
+ readonly UseDirective: readonly ["expression"];
346
+ readonly Component: readonly ["attributes", "fragment"];
347
+ readonly TitleElement: readonly ["attributes", "fragment"];
348
+ readonly SlotElement: readonly ["attributes", "fragment"];
349
+ readonly RegularElement: readonly ["attributes", "fragment"];
350
+ readonly SvelteBody: readonly ["attributes", "fragment"];
351
+ readonly SvelteBoundary: readonly ["attributes", "fragment"];
352
+ readonly SvelteComponent: readonly ["expression", "attributes", "fragment"];
353
+ readonly SvelteDocument: readonly ["attributes", "fragment"];
354
+ readonly SvelteElement: readonly ["tag", "attributes", "fragment"];
355
+ readonly SvelteFragment: readonly ["attributes", "fragment"];
356
+ readonly SvelteHead: readonly ["attributes", "fragment"];
357
+ readonly SvelteOptions: readonly ["attributes", "fragment"];
358
+ readonly SvelteSelf: readonly ["attributes", "fragment"];
359
+ readonly SvelteWindow: readonly ["attributes", "fragment"];
360
+ readonly IfBlock: readonly ["test", "consequent", "alternate"];
361
+ readonly EachBlock: readonly ["expression", "context", "key", "body", "fallback"];
362
+ readonly AwaitBlock: readonly ["expression", "pending", "value", "then", "error", "catch"];
363
+ readonly KeyBlock: readonly ["expression", "fragment"];
364
+ readonly SnippetBlock: readonly ["expression", "parameters", "body"];
365
+ readonly StyleSheet: readonly ["attributes", "children"];
366
+ readonly Rule: readonly ["prelude", "block"];
367
+ readonly Atrule: readonly ["block"];
368
+ readonly SelectorList: readonly ["children"];
369
+ readonly ComplexSelector: readonly ["children"];
370
+ readonly RelativeSelector: readonly ["combinator", "selectors"];
371
+ readonly Combinator: readonly [];
372
+ readonly TypeSelector: readonly [];
373
+ readonly IdSelector: readonly [];
374
+ readonly ClassSelector: readonly [];
375
+ readonly AttributeSelector: readonly [];
376
+ readonly PseudoElementSelector: readonly ["args"];
377
+ readonly PseudoClassSelector: readonly ["args"];
378
+ readonly Percentage: readonly [];
379
+ readonly Nth: readonly [];
380
+ readonly NestingSelector: readonly [];
381
+ readonly Block: readonly ["children"];
382
+ readonly Declaration: readonly [];
383
+ readonly Program: readonly ["body"];
384
+ readonly ExpressionStatement: readonly ["expression"];
385
+ readonly BlockStatement: readonly ["body"];
386
+ readonly StaticBlock: readonly ["body"];
387
+ readonly EmptyStatement: readonly [];
388
+ readonly DebuggerStatement: readonly [];
389
+ readonly WithStatement: readonly ["object", "body"];
390
+ readonly ReturnStatement: readonly ["argument"];
391
+ readonly LabeledStatement: readonly ["label", "body"];
392
+ readonly BreakStatement: readonly ["label"];
393
+ readonly ContinueStatement: readonly ["label"];
394
+ readonly IfStatement: readonly ["test", "consequent", "alternate"];
395
+ readonly SwitchStatement: readonly ["discriminant", "cases"];
396
+ readonly SwitchCase: readonly ["test", "consequent"];
397
+ readonly ThrowStatement: readonly ["argument"];
398
+ readonly TryStatement: readonly ["block", "handler", "finalizer"];
399
+ readonly CatchClause: readonly ["param", "body"];
400
+ readonly WhileStatement: readonly ["test", "body"];
401
+ readonly DoWhileStatement: readonly ["body", "test"];
402
+ readonly ForStatement: readonly ["init", "test", "update", "body"];
403
+ readonly ForInStatement: readonly ["left", "right", "body"];
404
+ readonly ForOfStatement: readonly ["left", "right", "body"];
405
+ readonly VariableDeclaration: readonly ["declarations"];
406
+ readonly VariableDeclarator: readonly ["id", "init"];
407
+ readonly ClassBody: readonly ["body"];
408
+ readonly Property: readonly ["decorators", "key", "value"];
409
+ readonly ThisExpression: readonly [];
410
+ readonly Super: readonly [];
411
+ readonly Literal: readonly [];
412
+ readonly PrivateIdentifier: readonly [];
413
+ readonly ArrayExpression: readonly ["elements"];
414
+ readonly ObjectExpression: readonly ["properties"];
415
+ readonly UnaryExpression: readonly ["argument"];
416
+ readonly UpdateExpression: readonly ["argument"];
417
+ readonly BinaryExpression: readonly ["left", "right"];
418
+ readonly LogicalExpression: readonly ["left", "right"];
419
+ readonly AssignmentExpression: readonly ["left", "right"];
420
+ readonly MemberExpression: readonly ["object", "property"];
421
+ readonly ConditionalExpression: readonly ["test", "consequent", "alternate"];
422
+ readonly SequenceExpression: readonly ["expressions"];
423
+ readonly TemplateLiteral: readonly ["quasis", "expressions"];
424
+ readonly TemplateElement: readonly [];
425
+ readonly SpreadElement: readonly ["argument"];
426
+ readonly YieldExpression: readonly ["argument"];
427
+ readonly AwaitExpression: readonly ["argument"];
428
+ readonly ImportExpression: readonly ["source", "options", "arguments"];
429
+ readonly ChainExpression: readonly ["expression"];
430
+ readonly ParenthesizedExpression: readonly ["expression"];
431
+ readonly MetaProperty: readonly ["meta", "property"];
432
+ readonly AssignmentPattern: readonly ["decorators", "left", "right"];
433
+ readonly ImportDeclaration: readonly ["specifiers", "source", "attributes"];
434
+ readonly ImportSpecifier: readonly ["imported", "local"];
435
+ readonly ImportDefaultSpecifier: readonly ["local"];
436
+ readonly ImportNamespaceSpecifier: readonly ["local"];
437
+ readonly ImportAttribute: readonly ["key", "value"];
438
+ readonly ExportNamedDeclaration: readonly ["declaration", "specifiers", "source", "attributes"];
439
+ readonly ExportSpecifier: readonly ["local", "exported"];
440
+ readonly ExportDefaultDeclaration: readonly ["declaration"];
441
+ readonly ExportAllDeclaration: readonly ["exported", "source", "attributes"];
442
+ readonly Decorator: readonly ["expression"];
443
+ readonly TSAnyKeyword: readonly [];
444
+ readonly TSBigIntKeyword: readonly [];
445
+ readonly TSBooleanKeyword: readonly [];
446
+ readonly TSNeverKeyword: readonly [];
447
+ readonly TSNullKeyword: readonly [];
448
+ readonly TSNumberKeyword: readonly [];
449
+ readonly TSObjectKeyword: readonly [];
450
+ readonly TSStringKeyword: readonly [];
451
+ readonly TSSymbolKeyword: readonly [];
452
+ readonly TSUndefinedKeyword: readonly [];
453
+ readonly TSUnknownKeyword: readonly [];
454
+ readonly TSVoidKeyword: readonly [];
455
+ readonly TSThisType: readonly [];
456
+ readonly TSQualifiedName: readonly ["left", "right"];
457
+ readonly TSEnumDeclaration: readonly ["id", "members"];
458
+ readonly TSEnumMember: readonly ["id", "initializer"];
459
+ readonly TSModuleDeclaration: readonly ["id", "body"];
460
+ readonly TSModuleBlock: readonly ["body"];
461
+ readonly TSImportEqualsDeclaration: readonly ["id", "moduleReference"];
462
+ readonly TSExternalModuleReference: readonly ["expression"];
463
+ readonly TSExportAssignment: readonly ["expression"];
464
+ readonly TSParameterProperty: readonly ["parameter"];
465
+ readonly TSNonNullExpression: readonly ["expression"];
466
+ };
467
+
259
468
  /**
260
469
  * Return it from `enter` or `leave` to end the walk: no further `enter` or
261
470
  * `leave` calls, including `leave` on the node's ancestors.
@@ -295,6 +504,22 @@ export interface Visitor {
295
504
  */
296
505
  export declare function walk(node: AST.SvelteNode, visitor: Visitor, keys?: VisitorKeys): void;
297
506
 
507
+ /**
508
+ * Calls `callback` with each of `node`'s child nodes in source order, as
509
+ * {@link walk} would visit them, with the field that holds the child and
510
+ * its index when the field is an array. Allocates nothing. `keys` is as
511
+ * in {@link walk}.
512
+ */
513
+ export declare function forEachChild(node: AST.SvelteNode, callback: (child: AST.SvelteNode, key: string, index: number | null) => void, keys?: VisitorKeys): void;
514
+
515
+ /**
516
+ * `node`'s child nodes in source order, as {@link walk} would visit them.
517
+ * The array is made on the first call for each node and `keys`, and the
518
+ * same one is returned after, so don't change it; a node that
519
+ * {@link walk} replaces later isn't in it. `keys` is as in {@link walk}.
520
+ */
521
+ export declare function children(node: AST.SvelteNode, keys?: VisitorKeys): readonly AST.SvelteNode[];
522
+
298
523
  type Namespace = "html" | "svg" | "mathml";
299
524
 
300
525
  export declare namespace AST {
@@ -1945,6 +2170,20 @@ export declare function extractIdentifiers(pattern: Pattern | TSParameterPropert
1945
2170
  */
1946
2171
  export declare function isReference(node: AST.SvelteNode, parent: AST.SvelteNode | null): boolean;
1947
2172
 
2173
+ /**
2174
+ * The `{ line, column }` of `offset` in `text`, line from 1 and column
2175
+ * from 0, as {@link createLocator}'s function gives it, without keeping
2176
+ * a locator: the lines of the last 64 texts are kept, so calls for
2177
+ * several files in any order cost a lookup each after the first.
2178
+ *
2179
+ * ```ts
2180
+ * import { locate } from "sveast";
2181
+ *
2182
+ * `${file}:${locate(source, node.start).line}`;
2183
+ * ```
2184
+ */
2185
+ export declare function locate(text: string, offset: number): Position;
2186
+
1948
2187
  /**
1949
2188
  * A function from an offset in `text` to its line, from 1, and column,
1950
2189
  * from 0, in UTF-16 code units: what `loc: true` gives the node that
@@ -1967,3 +2206,5 @@ export declare function isReference(node: AST.SvelteNode, parent: AST.SvelteNode
1967
2206
  * ```
1968
2207
  */
1969
2208
  export declare function createLocator(text: string): (offset: number) => Position;
2209
+
2210
+ export declare function skipTypeWrappers(node: AST.SvelteNode): AST.SvelteNode;
package/walk.js CHANGED
@@ -1 +1 @@
1
- import{w,G,R,yt,fe,d,O}from"./shared-ff56bedk.js";import{xt}from"./shared-5kdpxrm3.js";export{d as SKIP,fe as STOP,xt as createLocator,w as extractIdentifiers,G as isReference,yt as markupVisitorKeys,R as visitorKeys,O as walk};
1
+ import{p,I,Nt,Ct,x,Pt,g,j,y,L,_t,It}from"./shared-4zk9ntab.js";import{Lt}from"./shared-4wqe6a27.js";export{y as SKIP,j as STOP,It as children,Lt as createLocator,p as extractIdentifiers,_t as forEachChild,I as isReference,Nt as locate,Pt as markupVisitorKeys,Ct as skipTypeWrappers,g as valueVisitorKeys,x as visitorKeys,L as walk};
@@ -1,2 +0,0 @@
1
- import{K}from"./shared-zd01zsyh.js";import{he,ue}from"./shared-yxr92tk5.js";import{q}from"./shared-np5jnnrw.js";var a=K(he,q,ue);
2
- export{a};
@@ -1,2 +0,0 @@
1
- var a=/<!--[\s\S]*?-->|<script\s+(?:[^>]*|(?:[^=>'"/]+=(?:"[^"]*"|'[^']*'|[^>\s]+)\s+)*)lang=(["'])?([^"' >]+)\1[^>]*>/y;function s(n){if(n===32||n<=13&&n>=9)return!0;if(n<160)return!1;return n===160||n===5760||n>=8192&&n<=8202||n===8232||n===8233||n===8239||n===8287||n===12288||n===65279}function t(n,r){let e=r;while(e<n.length&&s(n.charCodeAt(e)))e++;return e}function V(n){let r=n.indexOf("<");while(r!==-1){let e=n.charCodeAt(r+1);if(e===33||e===115){a.lastIndex=r;let i=a.exec(n);if(i){if(e===115)return i[2]==="ts";r=n.indexOf("<",a.lastIndex);continue}}r=n.indexOf("<",r+1)}return!1}var b=new Set("area base br col command embed hr img input keygen link meta param source track wbr".split(" "));function C(n){return b.has(n)||n.charCodeAt(0)===33&&n.toLowerCase()==="!doctype"}function M(n,r){let e=r;while(e<n.length){let i=n.charCodeAt(e);if(i===47&&n.charCodeAt(e+1)===42){let o=n.indexOf("*/",e+2);e=o===-1?n.length:o+2}else if(i===34||i===39){e++;while(e<n.length){let o=n.charCodeAt(e);if(o===i||o===10)break;e+=o===92?2:1}e++}else if(i===60&&n.startsWith("</style",e))break;else e++}return Math.min(e,n.length)}var u=34,c=39,h=47,p=61,d=62,l=(n)=>n===u||n===c;function v(n,r,e){let i=r;for(;i<n.length;i++){let o=n.charCodeAt(i);if(s(o)||o===h||o===d)break;if(e&&(l(o)||o===p))break}return i}function F(n,r){let e=n.charCodeAt(r);return s(e)||l(e)||e===p||e===60||e===d||e===96||e===h&&n.charCodeAt(r+1)===d}var f={li:["li"],dt:["dt","dd"],dd:["dt","dd"],p:"address article aside blockquote div dl fieldset footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol p pre section table ul".split(" "),rt:["rt","rp"],rp:["rt","rp"],optgroup:["optgroup"],option:["option","optgroup"],thead:["tbody","tfoot"],tbody:["tbody","tfoot"],tfoot:["tbody"],tr:["tr","tbody"],td:["td","th","tr"],th:["td","th","tr"]};function B(n,r){return Object.hasOwn(f,n)&&f[n].includes(r)}
2
- export{B,s,t,V,C,M,l,v,F};
@@ -1,3 +0,0 @@
1
- var H={await:1,case:1,default:1,delete:1,extends:1,in:1,instanceof:1,new:1,of:1,return:1,throw:1,typeof:1,void:1,yield:1,do:2,else:2,finally:2,try:2,for:4,if:4,while:4,with:4,import:5,export:6};var L=Array(g(128,0)).fill(null);for(let e of Object.entries(H)){let A=g(e[0].charCodeAt(0),e[0].length),t=L[A]??[];t.push(e),L[A]=t}function g(e,A){return e*11+A}function V(e,A,t){let a=e.charCodeAt(A);if(a>=128||t-A>10)return 3;let E=g(a,t-A),n=L[E];if(n===null)return 3;for(let o=0;o<n.length;o++)if(e.startsWith(n[o][0],A))return n[o][1];return 3}var x=/\s/,D=new Uint8Array(128);for(let e of["az","AZ","09","__","$$","\\\\"])for(let A=e.charCodeAt(0);A<=e.charCodeAt(1);A++)D[A]=1;function r(e){return e>=128?!x.test(String.fromCharCode(e)):D[e]===1}function T(e){return e<128?e===32||e>=9&&e<=13:x.test(String.fromCharCode(e))}function W(e,A,t){K(e,v(e,A),A,t,void 0)}function ye(e,A){K(e,e.length-1,!1,void 0,A)}function K(e,A,t,a,E){let n=e.length,o=[],i=e.startsWith("#!")?b(e,2):0,O=0,d=!1,R=!1,s=-1,h=()=>{if(O=0,o.length===0)s=-1};while(i<=A){let c=e.charCodeAt(i);if(c===32||c===10||T(c)){i++;continue}if(c===47){let f=e.charCodeAt(i+1);if(f===47){i=b(e,i+2);continue}if(f===42){let l=e.indexOf("*/",i+2);i=l===-1?n:l+2;continue}}let M=d,y=R;if(d=!1,R=!1,r(c)||c===35){let f=i;i++;while(i<n){let U=e.charCodeAt(i);if(U===92)i+=2;else if(r(U))i++;else break}let l=M?3:V(e,f,i);if(a!==void 0&&o.length===0&&(l===6?t||B(e,i):l===5&&w(e,i)))i=Math.max(i,a(s!==-1&&l===6?s:f,f)),h();else if(l===6)O=2;else if(l===4)R=!0,O=3;else O=l===1||l===2?l:3;continue}switch(i++,c){case 34:case 39:{let f=i-1;i=k(e,i,c),E?.(f,i,!1),O=3;break}case 96:{let f=i;i=C(e,i,o),E?.(f,p(e,i),!0),O=e.charCodeAt(i-1)===123?1:3;break}case 47:{let f=O===3?-1:S(e,i);if(f===-1)O=1;else{i=f;while(i<n&&r(e.charCodeAt(i)))i++;O=3}break}case 40:o.push(y?1:0),O=1;break;case 41:O=o.pop()===1?2:3;break;case 123:o.push(O===1?3:2),O=0;break;case 125:{let f=o.pop();if(f===4){let l=i;i=C(e,i,o),E?.(l,p(e,i),!0),O=e.charCodeAt(i-1)===123?1:3}else if(f===3)O=3;else h();break}case 59:h();break;case 93:O=3;break;case 46:if(u(e.charCodeAt(i))){while(i<n&&r(e.charCodeAt(i)))i++;O=3}else if(e.startsWith("..",i))i+=2,O=1;else d=!0,O=1;break;case 63:if(e.charCodeAt(i)===46&&!u(e.charCodeAt(i+1)))i++,d=!0;O=1;break;case 33:O=O===3&&!T(e.charCodeAt(i-2))?3:1;break;case 43:case 45:if(e.charCodeAt(i)===c&&O===3)i++;else O=1;break;case 61:if(O=e.charCodeAt(i)===62?2:1,O===2)i++;break;case 64:if(o.length===0&&s===-1)s=i-1;O=1;break;default:O=1}}}function N(e,A,t){let a=e.length,E=[],n=A,o=1,i=!1;while(n<a){let O=e.charCodeAt(n);if(O===32||O===10||T(O)){n++;continue}if(O===47){let R=e.charCodeAt(n+1);if(R===47){n=b(e,n+2);continue}if(R===42){let s=e.indexOf("*/",n+2);n=s===-1?a:s+2;continue}}let d=i;if(i=!1,r(O)||O===35){let R=n;n++;while(n<a){let h=e.charCodeAt(n);if(h===92)n+=2;else if(r(h))n++;else break}if(!d&&t?.(R,n))return-1;let s=d?3:V(e,R,n);o=s===1||s===2||s===4?1:3;continue}switch(n++,O){case 34:case 39:n=k(e,n,O),o=3;break;case 96:n=C(e,n,E),o=e.charCodeAt(n-1)===123?1:3;break;case 47:{let R=o===3?-1:S(e,n);if(R===-1)o=1;else{n=R;while(n<a&&r(e.charCodeAt(n)))n++;o=3}break}case 40:E.push(0),o=1;break;case 41:if(E.length===0)return n-1;E.pop(),o=3;break;case 123:E.push(o===1?3:2),o=0;break;case 125:{if(E.length===0)return n-1;let R=E.pop();if(R===4)n=C(e,n,E),o=e.charCodeAt(n-1)===123?1:3;else o=R===3?3:0;break}case 93:o=3;break;case 46:if(u(e.charCodeAt(n))){while(n<a&&r(e.charCodeAt(n)))n++;o=3}else if(e.startsWith("..",n))n+=2,o=1;else i=!0,o=1;break;case 63:if(e.charCodeAt(n)===46&&!u(e.charCodeAt(n+1)))n++,i=!0;o=1;break;case 33:o=o===3&&!T(e.charCodeAt(n-2))?3:1;break;case 43:case 45:if(e.charCodeAt(n)===O&&o===3)n++;else o=1;break;case 61:if(e.charCodeAt(n)===62)n++;o=1;break;default:o=1}}return a}function u(e){return e>=48&&e<=57}function b(e,A){for(let t=A;t<e.length;t++){let a=e.charCodeAt(t);if(a===10||a===13||a===8232||a===8233)return t}return e.length}function k(e,A,t){for(let a=A;a<e.length;a++){let E=e.charCodeAt(a);if(E===t)return a+1;if(E===92)a+=e.startsWith(`\r
2
- `,a+1)?2:1;else if(E===10||E===13)return a}return e.length}function C(e,A,t){for(let a=A;a<e.length;a++){let E=e.charCodeAt(a);if(E===96)return a+1;if(E===92)a++;else if(E===36&&e.charCodeAt(a+1)===123)return t.push(4),a+2}return e.length}function p(e,A){let t=e.charCodeAt(A-1);if(t===96)return A-1;if(t===123&&e.charCodeAt(A-2)===36)return A-2;return A}function S(e,A){let t=!1;for(let a=A;a<e.length;a++){let E=e.charCodeAt(a);if(E===10||E===13||E===8232||E===8233)return-1;if(E===92)a++;else if(E===91)t=!0;else if(E===93)t=!1;else if(E===47&&!t)return a+1}return-1}function m(e,A){for(let t=A;t<e.length;t++){let a=e.charCodeAt(t);if(T(a))continue;if(a===47){let E=e.charCodeAt(t+1);if(E===47){t=b(e,t+2)-1;continue}if(E===42){let n=e.indexOf("*/",t+2);if(n===-1)return e.length;t=n+1;continue}}return t}return e.length}function _(e,A,t){return e.charCodeAt(A)===t.charCodeAt(0)&&e.startsWith(t,A)&&!r(e.charCodeAt(A+t.length))}function w(e,A){let t=e.charCodeAt(m(e,A));return t!==40&&t!==46}function B(e,A){let t=m(e,A);if(_(e,t,"import"))return!0;if(_(e,t,"type"))t=m(e,t+4);let a=e.charCodeAt(t);if(a===42)return!0;if(a!==123)return!1;for(t++;t<e.length;t++){let E=e.charCodeAt(t);if(E===125)break;if(E===34||E===39)t=k(e,t+1,E)-1;else if(E===47)t=Math.max(t,m(e,t)-1)}return _(e,m(e,t+1),"from")}var P=/import|export/g;function v(e,A){let t=-1;P.lastIndex=0;for(let a=P.exec(e);a!==null;a=P.exec(e)){let E=a.index,n=E+6;if(!r(e.charCodeAt(E-1))&&!r(e.charCodeAt(n))&&(e.charCodeAt(E)===105?w(e,n):A||B(e,n)))t=E}return t}
3
- export{r,W,ye,N,u,m,_};
@@ -1,5 +0,0 @@
1
- var m=Array(2048).fill(void 0);function g(){m.fill(void 0)}function ft(e,n,t,r){let i=r&2047,o=m[i];if(o!==void 0&&o.length===t-n&&e.startsWith(o,n))return o;let b=e.slice(n,t);return m[i]=b,b}var d="",s=[0],l=0,c=0,u;function T(e){g(),d=e,s=[0],l=0,c=0,u=void 0}function h(e){while(l<=e){let n=d.indexOf(`
2
- `,l);if(n===-1){l=Number.POSITIVE_INFINITY;return}l=n+1,s.push(l)}}function y(e){let n=[0],t=e.indexOf(`
3
- `);while(t!==-1)n.push(t+1),t=e.indexOf(`
4
- `,t+1);return n}function x(e,n,t){let r=0,i=e.length-1;if(n>=e[t])r=t;else i=t-1;if(r<i&&n<e[r+1])i=r;while(r<i){let o=r+i+1>>>1;if(e[o]<=n)r=o;else i=o-1}return r}function p(e){return h(e),c=x(s,e,c),{line:c+1,column:e-s[c],character:e}}var a=/\r\n?|\n|\u2028|\u2029/g,w=/[\r\u2028\u2029]/;function dt(e){if(u===void 0){u=w.test(d)?[]:null,a.lastIndex=0;while(u!==null&&a.exec(d)!==null)u.push(a.lastIndex)}if(u===null)return h(e),x(s,e,c);let n=0,t=u.length;while(n<t){let r=n+t>>>1;if(u[r]<=e)n=r+1;else t=r}return n}function k(e){let{line:n,column:t}=p(e);return{line:n,column:t}}function mt(e){while(s.length<=e+1&&l!==Number.POSITIVE_INFINITY)h(l);if(e>=s.length)return;let n=e+1<s.length?s[e+1]-1:d.length;return d.slice(s[e],n)}function xt(e){let n,t=0;return(r)=>(n??=y(e),t=x(n,r,t),{line:t+1,column:r-n[t]})}function f(e){return typeof e==="object"&&e!==null&&typeof E(e).type==="string"}function E(e){return e}function L(e,n){let t=E(e);for(let r in t){let i=t[r];if(Array.isArray(i)){for(let o=0;o<i.length;o++)if(f(i[o]))i[o]=n(i[o])}else if(f(i))t[r]=n(i)}}function J(e,...n){if(!n.some((t)=>t===e.type))throw Error(`expected ${n.join(" or ")}, got ${e.type}`)}
5
- export{ft,T,p,dt,k,mt,xt,f,E,L,J};
@@ -1,2 +0,0 @@
1
- import{T}from"./shared-5kdpxrm3.js";import{pt}from"./shared-yxr92tk5.js";import{W}from"./shared-4y1phpr0.js";function b(t,r,o){T(t);let e={isTypeScript:r.typescript??!1,typescript:o,loc:!1,comments:!1,root:{comments:[]}};return pt(e,t,(s)=>W(t,r.localExports??!0,s))}
2
- export{b};
@@ -1,2 +0,0 @@
1
- function ct(t){return{support:"typescript",parser:t}}function ht(t){return{support:"entities",names:t}}function U(t){return t&&"parser"in t?t.parser:void 0}function ut(t){return t&&"names"in t?t.names:void 0}function z(){throw Error('sveast: parsing TypeScript needs `typescript` from "sveast/typescript": createParser({ typescript }) or createModuleParser({ typescript })')}
2
- export{ct,ht,U,ut,z};