You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
146 KiB
16 lines
146 KiB
1 month ago
|
var di=Object.create;var we=Object.defineProperty;var mi=Object.getOwnPropertyDescriptor;var xi=Object.getOwnPropertyNames;var yi=Object.getPrototypeOf,gi=Object.prototype.hasOwnProperty;var Ze=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vi=(e,t)=>{for(var i in t)we(e,i,{get:t[i],enumerable:!0})},bi=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of xi(t))!gi.call(e,r)&&r!==i&&we(e,r,{get:()=>t[r],enumerable:!(s=mi(t,r))||s.enumerable});return e};var et=(e,t,i)=>(i=e!=null?di(yi(e)):{},bi(t||!e||!e.__esModule?we(i,"default",{value:e,enumerable:!0}):i,e));var Jt=Ze((Hs,qt)=>{qt.exports={}});var Ge=Ze((zs,Je)=>{"use strict";var rs=Jt(),as=/^[\da-fA-F]+$/,ns=/^\d+$/,Gt=new WeakMap;function Kt(e){e=e.Parser.acorn||e;let t=Gt.get(e);if(!t){let i=e.tokTypes,s=e.TokContext,r=e.TokenType,n=new s("<tag",!1),o=new s("</tag",!1),u=new s("<tag>...</tag>",!0,!0),p={tc_oTag:n,tc_cTag:o,tc_expr:u},d={jsxName:new r("jsxName"),jsxText:new r("jsxText",{beforeExpr:!0}),jsxTagStart:new r("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new r("jsxTagEnd")};d.jsxTagStart.updateContext=function(){this.context.push(u),this.context.push(n),this.exprAllowed=!1},d.jsxTagEnd.updateContext=function(l){let C=this.context.pop();C===n&&l===i.slash||C===o?(this.context.pop(),this.exprAllowed=this.curContext()===u):this.exprAllowed=!0},t={tokContexts:p,tokTypes:d},Gt.set(e,t)}return t}function ne(e){if(!e)return e;if(e.type==="JSXIdentifier")return e.name;if(e.type==="JSXNamespacedName")return e.namespace.name+":"+e.name.name;if(e.type==="JSXMemberExpression")return ne(e.object)+"."+ne(e.property)}Je.exports=function(e){return e=e||{},function(t){return os({allowNamespaces:e.allowNamespaces!==!1,allowNamespacedObjects:!!e.allowNamespacedObjects},t)}};Object.defineProperty(Je.exports,"tokTypes",{get:function(){return Kt(void 0).tokTypes},configurable:!0,enumerable:!0});function os(e,t){let i=t.acorn||void 0,s=Kt(i),r=i.tokTypes,n=s.tokTypes,o=i.tokContexts,u=s.tokContexts.tc_oTag,p=s.tokContexts.tc_cTag,d=s.tokContexts.tc_expr,l=i.isNewLine,C=i.isIdentifierStart,B=i.isIdentifierChar;return class extends t{static get acornJsx(){return s}jsx_readToken(){let h="",m=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let x=this.input.charCodeAt(this.pos);switch(x){case 60:case 123:return this.pos===this.start?x===60&&this.exprAllowed?(++this.pos,this.finishToken(n.jsxTagStart)):this.getTokenFromCode(x):(h+=this.input.slice(m,this.pos),this.finishToken(n.jsxText,h));case 38:h+=this.input.slice(m,this.pos),h+=this.jsx_readEntity(),m=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(x===62?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:l(x)?(h+=this.input.slice(m,this.pos),h+=this.jsx_readNewLine(!0),m=this.pos):++this.pos}}}jsx_readNewLine(h){let m=this.input.charCodeAt(this.pos),x;return++this.pos,m===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,x=h?`
|
||
|
`:`\r
|
||
|
`):x=String.fromCharCode(m),this.options.locations&&(++this.curLine,this.lineStart=this.pos),x}jsx_readString(h){let m="",x=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let g=this.input.charCodeAt(this.pos);if(g===h)break;g===38?(m+=this.input.slice(x,this.pos),m+=this.jsx_readEntity(),x=this.pos):l(g)?(m+=this.input.slice(x,this.pos),m+=this.jsx_readNewLine(!1),x=this.pos):++this.pos}return m+=this.input.slice(x,this.pos++),this.finishToken(r.string,m)}jsx_readEntity(){let h="",m=0,x,g=this.input[this.pos];g!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let w=++this.pos;for(;this.pos<this.input.length&&m++<10;){if(g=this.input[this.pos++],g===";"){h[0]==="#"?h[1]==="x"?(h=h.substr(2),as.test(h)&&(x=String.fromCharCode(parseInt(h,16)))):(h=h.substr(1),ns.test(h)&&(x=String.fromCharCode(parseInt(h,10)))):x=rs[h];break}h+=g}return x||(this.pos=w,"&")}jsx_readWord(){let h,m=this.pos;do h=this.input.charCodeAt(++this.pos);while(B(h)||h===45);return this.finishToken(n.jsxName,this.input.slice(m,this.pos))}jsx_parseIdentifier(){let h=this.startNode();return this.type===n.jsxName?h.name=this.value:this.type.keyword?h.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(h,"JSXIdentifier")}jsx_parseNamespacedName(){let h=this.start,m=this.startLoc,x=this.jsx_parseIdentifier();if(!e.allowNamespaces||!this.eat(r.colon))return x;var g=this.startNodeAt(h,m);return g.namespace=x,g.name=this.jsx_parseIdentifier(),this.finishNode(g,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===n.jsxTagEnd)return"";let h=this.start,m=this.startLoc,x=this.jsx_parseNamespacedName();for(this.type===r.dot&&x.type==="JSXNamespacedName"&&!e.allowNamespacedObjects&&this.unexpected();this.eat(r.dot);){let g=this.startNodeAt(h,m);g.object=x,g.property=this.jsx_parseIdentifier(),x=this.finishNode(g,"JSXMemberExpression")}return x}jsx_parseAttributeValue(){switch(this.type){case r.braceL:let h=this.jsx_parseExpressionContainer();return h.expression.type==="JSXEmptyExpression"&&this.raise(h.start,"JSX attributes must only be assigned a non-empty expression"),h;case n.jsxTagStart:case r.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let h=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(h,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let h=this.startNode();return this.next(),h.expression=this.type===r.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(r.braceR),this.finishNode(h,"JSXExpressionContainer")}jsx_parseAttribute(){let h=this.startNode();return this.eat(r.braceL)?(this.expect(r.ellipsis),h.argument=this.parseMaybeAssign(),this.expect(r.braceR),this.finishNode(h,"JSXSpreadAttribute")):(h.name=this.jsx_parseNamespacedName(),h.value=this.eat(r.eq)?this.jsx_parseAttributeValue():null,this.finishNode(h,"JSXAttribute"))}jsx_parseOpeningElementAt(h,m){let x=this.startNodeAt(h,m);x.attributes=[];let g=this.jsx_parseElementName();for(g&&(x.name=g);this.type!==r.slash&&this.type!==n.jsxTagEnd;)x.attributes.push(this.jsx_parseAttribute());return x.selfClosing=this.eat(r.slash),this.expect(n.jsxTagEnd),this.finishNode(x,g?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(h,m){let x=this.startNodeAt(h,m),g=this.jsx_parseElementName();return g&&(x.name=g),this.expect(n.jsxTagEnd),this.finishNode(x,g?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(h,m){let x=this.startNodeAt(h,m),g=[],w=this.jsx_parseOpeningElementAt(h,m),he=null;if(!w.selfClosing){e:for(;;)switch(this.type){case n.jsxTagStart:if(h=this.start,m=this.startLoc,this.next(),this.eat(r.slash)){he=this.jsx_parseClosingElementAt(h,m);break e}g.push(this.jsx_parseElementAt(h,m));break;case n.jsxText:g.push(this.parseExprAtom());break;case r.braceL:g.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}ne(he.name)!==ne(w.name)&&this.raise(he.start,"Expected correspon
|
||
|
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),tt(t.onToken)){var s=t.onToken;t.onToken=function(r){return s.push(r)}}return tt(t.onComment)&&(t.onComment=Vi(t,t.onComment)),t}function Vi(e,t){return function(i,s,r,n,o,u){var p={type:i?"Block":"Line",value:s,start:r,end:n};e.locations&&(p.loc=new xe(this,o,u)),e.ranges&&(p.range=[r,n]),t.push(p)}}var ie=1,Y=2,Be=4,lt=8,ft=16,dt=32,De=64,mt=128,re=256,Fe=ie|Y|re;function Me(e,t){return Y|(e?Be:0)|(t?lt:0)}var le=0,je=1,J=2,xt=3,yt=4,gt=5,T=function(t,i,s){this.options=t=Ni(t),this.sourceFile=t.sourceFile,this.keywords=G(_i[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var r="";t.allowReserved!==!0&&(r=Ae[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(r+=" await")),this.reservedWords=G(r);var n=(r?r+" ":"")+Ae.strict;this.reservedWordsStrict=G(n),this.reservedWordsStrictBind=G(n+" "+Ae.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(`
|
||
|
`,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(R).length):(this.pos=this.lineStart=0,this.curLine=1),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=t.sourceType==="module",this.strict=this.inModule||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&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(ie),this.regexpState=null,this.privateNameStack=[]},F={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};T.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};F.inFunction.get=function(){return(this.currentVarScope().flags&Y)>0};F.inGenerator.get=function(){return(this.currentVarScope().flags<)>0&&!this.currentVarScope().inClassFieldInit};F.inAsync.get=function(){return(this.currentVarScope().flags&Be)>0&&!this.currentVarScope().inClassFieldInit};F.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&re)return!1;if(t.flags&Y)return(t.flags&Be)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};F.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&De)>0||i||this.options.allowSuperOutsideMethod};F.allowDirectSuper.get=function(){return(this.currentThisScope().flags&mt)>0};F.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};F.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(Y|re))>0||i};F.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&re)>0};T.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var s=this,r=0;r<t.length;r++)s=t[r](s);return s};T.parse=function(t,i){return new this(i,t).parse()};T.parseExpressionAt=function(t,i,s){var r=new this(s,t,i);return r.nextToken(),r.parseExpression()};T.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(T.prototype,F);var k=T.prototype,Li=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;k.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){V.lastIndex=e,e+=V.exec(this.input)[0].length;var t=Li.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){V.lastIndex=e+t[0].length;var i=V.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return r===";"||r==="}"||R.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length,V.lastIndex=e,e+=V.exec(this.input)[0].length,this.input[e]===";"&&e++}};k.eat=function(e){return this.type===e?(this.next(),!0):!1};k.isContextual=function(e){return this.type===a.name&&this.value===e&&!this.containsEsc};k.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};k.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};k.canInsertSemicolon=function(){return this.type===a.eof||this.type===a.braceR||R.test(this.input.slice(this.lastTokEnd,this.start))};k.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};k.semicolon=function(){!this.eat(a.semi)&&!this.insertSemicolon()&&this.unexpected()};k.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),
|
||
|
`),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
||
|
`),cooked:this.value},this.next(),i.tail=this.type===a.backQuote,this.finishNode(i,"TemplateElement")};y.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(i.quasis=[s];!s.tail;)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:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};y.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===a.name||this.type===a.num||this.type===a.string||this.type===a.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===a.star)&&!R.test(this.input.slice(this.lastTokEnd,this.start))};y.parseObj=function(e,t){var i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(a.braceR);){if(s)s=!1;else if(this.expect(a.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(a.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,r,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};y.parseProperty=function(e,t){var i=this.startNode(),s,r,n,o;if(this.options.ecmaVersion>=9&&this.eat(a.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===a.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===a.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(n=this.start,o=this.startLoc),e||(s=this.eat(a.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(a.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,e,s,r,n,o,t,u),this.finishNode(i,"Property")};y.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var i=e.value.start;e.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};y.parsePropertyValue=function(e,t,i,s,r,n,o,u){(i||s)&&this.type===a.colon&&this.unexpected(),this.eat(a.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===a.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,s)):!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==a.comma&&this.type!==a.braceR&&this.type!==a.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),e.kind="init",t?e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key)):this.type===a.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};y.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(a.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(a.bracketR),e.key;e.computed=!1}return e.key=this.type===a.num||this.type===a.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};y.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};y.parseMethod=function(e,t,i){var s=this.startNode(),r=this.
|
||
|
`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};v.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":this.input[this.pos+1]===`
|
||
|
`&&++this.pos;case`
|
||
|
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};v.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
||
|
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return K(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(s,8);return r>255&&(s=s.slice(0,-1),r=parseInt(s,8)),this.pos+=s.length-1,t=this.input.charCodeAt(this.pos),(s!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return Q(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};v.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};v.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(z(r,s))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var o=this.readCodePoint();(t?U:z)(o,s)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=K(o),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};v.readWord=function(){var e=this.readWord1(),t=a.name;return this.keywords.test(e)&&(t=Oe[e]),this.finishToken(t,e)};var is="8.12.1";T.acorn={Parser:T,version:is,defaultOptions:Ve,Position:te,SourceLocation:xe,getLineInfo:ct,Node:ge,TokenType:S,tokTypes:a,keywordTypes:Oe,TokContext:D,tokContexts:_,isIdentifierChar:z,isIdentifierStart:U,Token:qe,isNewLine:Q,lineBreak:R,lineBreakG:wi,nonASCIIwhitespace:pt};var ni=et(Ge(),1);function us(e,t){let i=new SyntaxError(e+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(i,t)}var be=us;function ps(e){let t=[];for(let i of e)try{return i()}catch(s){t.push(s)}throw Object.assign(new Error("All combinations failed"),{errors:t})}var Se=ps;var hs=(e,t,i)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[i<0?t.length+i:i]:t.at(i)},W=hs;function cs(e){return Array.isArray(e)&&e.length>0}var Xt=cs;function P(e){var s,r,n;let t=((s=e.range)==null?void 0:s[0])??e.start,i=(n=((r=e.declaration)==null?void 0:r.decorators)??e.decorators)==null?void 0:n[0];return i?Math.min(P(i),t):t}function j(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function ls(e){let t=new Set(e);return i=>t.has(i==null?void 0:i.type)}var Wt=ls;var fs=Wt(["Block","CommentBlock","MultiLine"]),oe=fs;function ds(e){let t=`*${e.value}*`.split(`
|
||
|
`);return t.length>1&&t.every(i=>i.trimStart()[0]==="*")}var Ke=ds;function ms(e){return oe(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(e.value)}var Ht=ms;var ue=null;function pe(e){if(ue!==null&&typeof ue.property){let t=ue;return ue=pe.prototype=null,t}return ue=pe.prototype=e??Object.create(null),new pe}var xs=10;for(let e=0;e<=xs;e++)pe();function Xe(e){return pe(e)}function ys(e,t="type"){Xe(e);function i(s){let r=s[t],n=e[r];if(!Array.isArray(n))throw Object.assign(new Error(`Missing visitor keys for '${r}'.`),{node:s});return n}return i}var zt=ys;var Qt={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],ImportExpression:["source","options","attributes"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],Cl
|
||
|
`;e=Z(!1,e.replace(Cs,"").replace(Ss,""),Es,"$1");let i="";for(;i!==e;)i=e,e=Z(!1,e,ks,`${t}$1 $2${t}`);e=e.replace(Zt,"").trimEnd();let s=Object.create(null),r=Z(!1,e,ei,"").replace(Zt,"").trimEnd(),n;for(;n=ei.exec(e);){let o=Z(!1,n[2],Ts,"");if(typeof s[n[1]]=="string"||Array.isArray(s[n[1]])){let u=s[n[1]];s[n[1]]=[...ws,...Array.isArray(u)?u:[u],o]}else s[n[1]]=o}return{comments:r,pragmas:s}}function As(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(`
|
||
|
`);return t===-1?e:e.slice(0,t)}var si=As;function Ps(e){let t=si(e);t&&(e=e.slice(t.length+1));let i=ti(e),{pragmas:s,comments:r}=ii(i);return{shebang:t,text:e,pragmas:s,comments:r}}function ri(e){let{pragmas:t}=Ps(e);return Object.prototype.hasOwnProperty.call(t,"prettier")||Object.prototype.hasOwnProperty.call(t,"format")}function Is(e){return e=typeof e=="function"?{parse:e}:e,{astFormat:"estree",hasPragma:ri,locStart:P,locEnd:j,...e}}var Te=Is;function Ns(e){let{filepath:t}=e;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs"))return"script";if(t.endsWith(".mjs"))return"module"}}var ke=Ns;var Vs={ecmaVersion:"latest",allowReturnOutsideFunction:!0,allowSuperOutsideMethod:!0,locations:!0,ranges:!0};function Ls(e){let{message:t,loc:i}=e;if(!i)return e;let{line:s,column:r}=i;return be(t.replace(/ \(\d+:\d+\)$/u,""),{loc:{start:{line:s,column:r+1}},cause:e})}var ai,Rs=()=>(ai??(ai=T.extend((0,ni.default)())),ai);function Os(e,t){let i=Rs(),s=[],r=[],n=i.parse(e,{...Vs,sourceType:t,allowImportExportEverywhere:t==="module",onComment:s,onToken:r});return n.comments=s,n.tokens=r,n}function Bs(e,t={}){let i=ke(t),s=(i?[i]:["module","script"]).map(n=>()=>Os(e,n)),r;try{r=Se(s)}catch({errors:[n]}){throw Ls(n)}return _e(r,{text:e})}var oi=Te(Bs);var ci=et(Ge(),1);var E={Boolean:"Boolean",EOF:"<end>",Identifier:"Identifier",PrivateIdentifier:"PrivateIdentifier",Keyword:"Keyword",Null:"Null",Numeric:"Numeric",Punctuator:"Punctuator",String:"String",RegularExpression:"RegularExpression",Template:"Template",JSXIdentifier:"JSXIdentifier",JSXText:"JSXText"};function Ds(e,t){let i=e[0],s=W(!1,e,-1),r={type:E.Template,value:t.slice(i.start,s.end)};return i.loc&&(r.loc={start:i.loc.start,end:s.loc.end}),i.range&&(r.start=i.range[0],r.end=s.range[1],r.range=[r.start,r.end]),r}function ze(e,t){this._acornTokTypes=e,this._tokens=[],this._curlyBrace=null,this._code=t}ze.prototype={constructor:ze,translate(e,t){let i=e.type,s=this._acornTokTypes;if(i===s.name)e.type=E.Identifier,e.value==="static"&&(e.type=E.Keyword),t.ecmaVersion>5&&(e.value==="yield"||e.value==="let")&&(e.type=E.Keyword);else if(i===s.privateId)e.type=E.PrivateIdentifier;else if(i===s.semi||i===s.comma||i===s.parenL||i===s.parenR||i===s.braceL||i===s.braceR||i===s.dot||i===s.bracketL||i===s.colon||i===s.question||i===s.bracketR||i===s.ellipsis||i===s.arrow||i===s.jsxTagStart||i===s.incDec||i===s.starstar||i===s.jsxTagEnd||i===s.prefix||i===s.questionDot||i.binop&&!i.keyword||i.isAssign)e.type=E.Punctuator,e.value=this._code.slice(e.start,e.end);else if(i===s.jsxName)e.type=E.JSXIdentifier;else if(i.label==="jsxText"||i===s.jsxAttrValueToken)e.type=E.JSXText;else if(i.keyword)i.keyword==="true"||i.keyword==="false"?e.type=E.Boolean:i.keyword==="null"?e.type=E.Null:e.type=E.Keyword;else if(i===s.num)e.type=E.Numeric,e.value=this._code.slice(e.start,e.end);else if(i===s.string)t.jsxAttrValueToken?(t.jsxAttrValueToken=!1,e.type=E.JSXText):e.type=E.String,e.value=this._code.slice(e.start,e.end);else if(i===s.regexp){e.type=E.RegularExpression;let r=e.value;e.regex={flags:r.flags,pattern:r.pattern},e.value=`/${r.pattern}/${r.flags}`}return e},onToken(e,t){let i=this._acornTokTypes,s=t.tokens,r=this._tokens,n=()=>{s.push(Ds(this._tokens,this._code)),this._tokens=[]};if(e.type===i.eof){this._curlyBrace&&s.push(this.translate(this._curlyBrace,t));return}if(e.type===i.backQuote){this._curlyBrace&&(s.push(this.translate(this._curlyBrace,t)),this._curlyBrace=null),r.push(e),r.length>1&&n();return}if(e.type===i.dollarBraceL){r.push(e),n();return}if(e.type===i.braceR){this._curlyBrace&&s.push(this.translate(this._curlyBrace,t)),this._curlyBrace=e;return}if(e.type===i.template||e.type===i.invalidTemplate){this._curlyBrace&&(r.push(this._curlyBrace),this._curlyBrace=null),r.push(e);return}this._curlyBrace&&(s.push(this.translate(this._curlyBrace,t)),this._curlyBrace=null),s.push(this.translate(e,t))}};var ui=ze;var pi=[3,5,6,7,8,9,10,11,12,13,14,15,16];function Fs(){return W(!1,pi,-1)}function Ms(e=5){let t=e==="latest"?Fs():e;if(typeof t!="number")throw new Error(`ecmaVersion must be a number
|
||
|
`,this.lineStart-2)+1,--this.curLine;this.nextToken()}this.end>this.start&&(r+=` ${this.input.slice(this.start,this.end)}`),this.raise(this.start,r)}jsx_readString(s){let r=super.jsx_readString(s);return this.type===t.string&&(this[H].jsxAttrValueToken=!0),r}[Qe](s){return s.type==="TemplateElement"&&this[H].templateElements.push(s),s.type.includes("Function")&&!s.generator&&(s.generator=!1),s}}};var qs={_regular:null,_jsx:null,get regular(){return this._regular===null&&(this._regular=T.extend(Ye())),this._regular},get jsx(){return this._jsx===null&&(this._jsx=T.extend((0,ci.default)(),Ye())),this._jsx},get(e){return!!(e&&e.ecmaFeatures&&e.ecmaFeatures.jsx)?this.jsx:this.regular}};function li(e,t){let i=qs.get(t);return new i(t,e).parse()}var Js={ecmaVersion:"latest",range:!0,loc:!0,comment:!0,tokens:!0,sourceType:"module",ecmaFeatures:{jsx:!0,globalReturn:!0,impliedStrict:!1}};function Gs(e){let{message:t,lineNumber:i,column:s}=e;return typeof i!="number"?e:be(t,{loc:{start:{line:i,column:s}},cause:e})}function Ks(e,t={}){let i=ke(t),s=(i?[i]:["module","script"]).map(n=>()=>li(e,{...Js,sourceType:n})),r;try{r=Se(s)}catch({errors:[n]}){throw Gs(n)}return _e(r,{text:e})}var fi=Te(Ks);var Xs={acorn:oi,espree:fi};var ba=$e;export{ba as default,Xs as parsers};
|