odm-client 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/mongodb-client.d.ts +9 -7
- package/dist/client/mongodb-index.d.ts +2 -2
- package/dist/cloudbase-index.cjs +1 -1
- package/dist/cloudbase-index.js +66 -56
- package/dist/decorators/index.d.ts +7 -0
- package/dist/deps/_commonjsHelpers-KaVRbhAgd4-5pgl5rkso.js +28 -0
- package/dist/deps/_commonjsHelpers-KaVRbhAgd4-r4alsdeis.js +1 -0
- package/dist/deps/acorn-DYjaOAP8Gz-29lcn4w0b.js +16 -0
- package/dist/deps/acorn-DYjaOAP8Gz-gyct7wut5.js +3005 -0
- package/dist/deps/angular-1bp1uAROl4-bz9b1prej.js +2533 -0
- package/dist/deps/angular-1bp1uAROl4-z3xa5q2km.js +3 -0
- package/dist/deps/babel-_P9jsDBVVy-ipfz7c01i.js +7217 -0
- package/dist/deps/babel-_P9jsDBVVy-kjb76ly0t.js +15 -0
- package/dist/deps/estree-Q-oFBmJEml-u09jq3zep.js +44 -0
- package/dist/deps/estree-Q-oFBmJEml-w9z7zljkf.js +4528 -0
- package/dist/deps/flow-j77MFvzLrn-kf5rv1yl1.js +20 -0
- package/dist/deps/flow-j77MFvzLrn-l8rtylmcl.js +27411 -0
- package/dist/deps/glimmer-ewQPb5nTUl-5p9240228.js +37 -0
- package/dist/deps/glimmer-ewQPb5nTUl-xsdp5ejns.js +2703 -0
- package/dist/deps/graphql-8EXR1_taGG-a4my17998.js +28 -0
- package/dist/deps/graphql-8EXR1_taGG-iqqy1396h.js +1221 -0
- package/dist/deps/html-dGbiW_CFWL-inuu6eaf1.js +25 -0
- package/dist/deps/html-dGbiW_CFWL-mq1pmq7je.js +2791 -0
- package/dist/deps/markdown-vAYIRClyWZ-el25zjeip.js +62 -0
- package/dist/deps/markdown-vAYIRClyWZ-f8svm8az3.js +3190 -0
- package/dist/deps/meriyah-d5_qqf88x--ntk7vora9.js +5 -0
- package/dist/deps/meriyah-d5_qqf88x--tbqv1nv9b.js +2645 -0
- package/dist/deps/postcss-Vz5bDQ3hJO-if8y8k5xi.js +4739 -0
- package/dist/deps/postcss-Vz5bDQ3hJO-rmv75nb4j.js +61 -0
- package/dist/deps/typescript-2hCq12HCbJ-n0w7fscoa.js +21 -0
- package/dist/deps/typescript-2hCq12HCbJ-yusfiayfb.js +12947 -0
- package/dist/deps/yaml-I5o0CrcX7J-ibk1yd293.js +4079 -0
- package/dist/deps/yaml-I5o0CrcX7J-xyc4o9p22.js +159 -0
- package/dist/generator/cloudbase-init-generator.d.ts +8 -0
- package/dist/generator/enum-generator.d.ts +3 -0
- package/dist/generator/index.d.ts +6 -0
- package/dist/generator/mongodb-init-generator.d.ts +9 -0
- package/dist/generator/parser.d.ts +21 -0
- package/dist/generator/table-generator.d.ts +3 -0
- package/dist/generator/type-generator.d.ts +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -29
- package/dist/index2.cjs +42770 -0
- package/dist/index2.js +242204 -0
- package/dist/mongodb-index.cjs +11 -11
- package/dist/mongodb-index.js +2103 -2106
- package/dist/types/index.d.ts +14 -0
- package/package.json +3 -1
- /package/dist/deps/{query-builder-h6B2D2BCoQ-4ajykqs3m.js → query-builder-h6B2D2BCoQ-f5zcr506g.js} +0 -0
- /package/dist/deps/{query-builder-h6B2D2BCoQ-wqso6i87o.js → query-builder-h6B2D2BCoQ-iw94q0kiz.js} +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";var hs=Object.defineProperty;var ps=(t,s,e)=>s in t?hs(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var f=(t,s,e)=>ps(t,typeof s!="symbol"?s+"":s,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var us=Object.defineProperty,Oe=(t,s)=>{for(var e in s)us(t,e,{get:s[e],enumerable:!0})},wt={};Oe(wt,{parsers:()=>ls});var It={};Oe(It,{__babel_estree:()=>sa,__js_expression:()=>Ct,__ts_expression:()=>St,__vue_event_binding:()=>bt,__vue_expression:()=>Ct,__vue_ts_event_binding:()=>Et,__vue_ts_expression:()=>St,babel:()=>bt,"babel-flow":()=>is,"babel-ts":()=>Et});function cs(t,s){if(t==null)return{};var e={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(s.indexOf(r)!==-1)continue;e[r]=t[r]}return e}var H=class{constructor(t,s,e){f(this,"line");f(this,"column");f(this,"index");this.line=t,this.column=s,this.index=e}},Pe=class{constructor(t,s){f(this,"start");f(this,"end");f(this,"filename");f(this,"identifierName");this.start=t,this.end=s}};function D(t,s){let{line:e,column:r,index:i}=t;return new H(e,r+s,i+s)}var Ze="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",ds={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Ze},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Ze}},et={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},de=t=>t.type==="UpdateExpression"?et.UpdateExpression[`${t.prefix}`]:et[t.type],ms={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:s})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
2
|
+
- Did you mean \`export { '${t}' as '${s}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:t})=>`'${t==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:t})=>`Unsyntactic ${t==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedImportAssert` parser plugin to suppress this error.",ImportBindingIsString:({importName:t})=>`A string literal cannot be used as an imported binding.
|
|
3
|
+
- Did you mean \`import { "${t}" as foo }\`?`,ImportCallArity:"`import()` requires exactly one or two arguments.",ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverDiscardElement:"'void' must be followed by an expression when not used in a binding position.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:t})=>`Expected number in radix ${t}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:t})=>`Escape sequence in keyword ${t}.`,InvalidIdentifier:({identifierName:t})=>`Invalid identifier ${t}.`,InvalidLhs:({ancestor:t})=>`Invalid left-hand side in ${de(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${de(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${de(t)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:t})=>`Unexpected character '${t}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:t})=>`Private name #${t} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:t})=>`Label '${t}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:t})=>`This experimental syntax requires enabling the parser plugin: ${t.map(s=>JSON.stringify(s)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:t})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${t.map(s=>JSON.stringify(s)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:t})=>`Duplicate key "${t}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:t})=>`An export name cannot include a lone surrogate, found '\\u${t.toString(16)}'.`,ModuleExportUndefined:({localName:t})=>`Export '${t}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:t})=>`Private names are only allowed in property accesses (\`obj.#${t}\`) or in \`in\` expressions (\`#${t} in obj\`).`,PrivateNameRedeclaration:({identifierName:t})=>`Duplicate private name #${t}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:t})=>`Unexpected keyword '${t}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:t})=>`Unexpected reserved word '${t}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:t,unexpected:s})=>`Unexpected token${s?` '${s}'.`:""}${t?`, expected "${t}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement.",UnexpectedVoidPattern:"Unexpected void binding.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:t,onlyValidPropertyName:s})=>`The only valid meta property for ${t} is ${t}.${s}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:t})=>`Identifier '${t}' has already been declared.`,VoidPatternCatchClauseParam:"A void binding can not be the catch clause parameter. Use `try { ... } catch { ... }` if you want to discard the caught error.",VoidPatternInitializer:"A void binding may not have an initializer.",YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",YieldNotInGeneratorFunction:"'yield' is only allowed within generator functions.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},fs={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:t})=>`Assigning to '${t}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:t})=>`Binding '${t}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},ys={ParseExpressionEmptyInput:"Unexpected parseExpression() input: The input is empty or contains only comments.",ParseExpressionExpectsEOF:({unexpected:t})=>`Unexpected parseExpression() input: The input should contain exactly one expression, but the first expression is followed by the unexpected character \`${String.fromCodePoint(t)}\`.`},xs=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Ps=Object.assign({PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic references are only supported when using the `"proposal": "hack"` version of the pipeline proposal.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:t})=>`Invalid topic token ${t}. In order to use ${t} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${t}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:t})=>`Hack-style pipe body cannot be an unparenthesized ${de({type:t})}; please wrap it in parentheses.`},{}),As=["message"];function tt(t,s,e){Object.defineProperty(t,s,{enumerable:!1,configurable:!0,value:e})}function gs({toMessage:t,code:s,reasonCode:e,syntaxPlugin:r}){let i=e==="MissingPlugin"||e==="MissingOneOfPlugins";return function a(n,o){let l=new SyntaxError;return l.code=s,l.reasonCode=e,l.loc=n,l.pos=n.index,l.syntaxPlugin=r,i&&(l.missingPlugin=o.missingPlugin),tt(l,"clone",function(h={}){let{line:c,column:d,index:m}=h.loc??n;return a(new H(c,d,m),Object.assign({},o,h.details))}),tt(l,"details",o),Object.defineProperty(l,"message",{configurable:!0,get(){let h=`${t(o)} (${n.line}:${n.column})`;return this.message=h,h},set(h){Object.defineProperty(this,"message",{value:h,writable:!0})}}),l}}function M(t,s){if(Array.isArray(t))return r=>M(r,t[0]);let e={};for(let r of Object.keys(t)){let i=t[r],a=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:n}=a,o=cs(a,As),l=typeof n=="string"?()=>n:n;e[r]=gs(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:r,toMessage:l},s?{syntaxPlugin:s}:{},o))}return e}var u=Object.assign({},M(ds),M(ms),M(fs),M(ys),M`pipelineOperator`(Ps));function Ts(){return{sourceType:"script",sourceFilename:void 0,startIndex:0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,allowYieldOutsideFunction:!1,plugins:[],strictMode:void 0,ranges:!1,tokens:!1,createImportExpressions:!0,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function bs(t){let s=Ts();if(t==null)return s;if(t.annexB!=null&&t.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");for(let e of Object.keys(s))t[e]!=null&&(s[e]=t[e]);if(s.startLine===1)t.startIndex==null&&s.startColumn>0?s.startIndex=s.startColumn:t.startColumn==null&&s.startIndex>0&&(s.startColumn=s.startIndex);else if(t.startColumn==null||t.startIndex==null)throw new Error("With a `startLine > 1` you must also specify `startIndex` and `startColumn`.");if(s.sourceType==="commonjs"){if(t.allowAwaitOutsideFunction!=null)throw new Error("The `allowAwaitOutsideFunction` option cannot be used with `sourceType: 'commonjs'`.");if(t.allowReturnOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowReturnOutsideFunction: true`, please remove the `allowReturnOutsideFunction` option or use `sourceType: 'script'`.");if(t.allowNewTargetOutsideFunction!=null)throw new Error("`sourceType: 'commonjs'` implies `allowNewTargetOutsideFunction: true`, please remove the `allowNewTargetOutsideFunction` option or use `sourceType: 'script'`.")}return s}var{defineProperty:Es}=Object,st=(t,s)=>{t&&Es(t,s,{enumerable:!1,value:t[s]})};function Z(t){return st(t.loc.start,"index"),st(t.loc.end,"index"),t}var Cs=t=>class extends t{parse(){let s=Z(super.parse());return this.optionFlags&256&&(s.tokens=s.tokens.map(Z)),s}parseRegExpLiteral({pattern:s,flags:e}){let r=null;try{r=new RegExp(s,e)}catch{}let i=this.estreeParseLiteral(r);return i.regex={pattern:s,flags:e},i}parseBigIntLiteral(s){let e;try{e=BigInt(s)}catch{e=null}let r=this.estreeParseLiteral(e);return r.bigint=String(r.value||s),r}parseDecimalLiteral(s){let e=this.estreeParseLiteral(null);return e.decimal=String(e.value||s),e}estreeParseLiteral(s){return this.parseLiteral(s,"Literal")}parseStringLiteral(s){return this.estreeParseLiteral(s)}parseNumericLiteral(s){return this.estreeParseLiteral(s)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(s){return this.estreeParseLiteral(s)}estreeParseChainExpression(s,e){let r=this.startNodeAtNode(s);return r.expression=s,this.finishNodeAt(r,"ChainExpression",e)}directiveToStmt(s){let e=s.value;delete s.value,this.castNodeTo(e,"Literal"),e.raw=e.extra.raw,e.value=e.extra.expressionValue;let r=this.castNodeTo(s,"ExpressionStatement");return r.expression=e,r.directive=e.extra.rawValue,delete e.extra,r}fillOptionalPropertiesForTSESLint(s){}cloneEstreeStringLiteral(s){let{start:e,end:r,loc:i,range:a,raw:n,value:o}=s,l=Object.create(s.constructor.prototype);return l.type="Literal",l.start=e,l.end=r,l.loc=i,l.range=a,l.raw=n,l.value=o,l}initFunction(s,e){super.initFunction(s,e),s.expression=!1}checkDeclaration(s){s!=null&&this.isObjectProperty(s)?this.checkDeclaration(s.value):super.checkDeclaration(s)}getObjectOrClassMethodParams(s){return s.value.params}isValidDirective(s){var e;return s.type==="ExpressionStatement"&&s.expression.type==="Literal"&&typeof s.expression.value=="string"&&!((e=s.expression.extra)!=null&&e.parenthesized)}parseBlockBody(s,e,r,i,a){super.parseBlockBody(s,e,r,i,a);let n=s.directives.map(o=>this.directiveToStmt(o));s.body=n.concat(s.body),delete s.directives}parsePrivateName(){let s=super.parsePrivateName();return this.convertPrivateNameToPrivateIdentifier(s)}convertPrivateNameToPrivateIdentifier(s){let e=super.getPrivateNameSV(s);return delete s.id,s.name=e,this.castNodeTo(s,"PrivateIdentifier")}isPrivateName(s){return s.type==="PrivateIdentifier"}getPrivateNameSV(s){return s.name}parseLiteral(s,e){let r=super.parseLiteral(s,e);return r.raw=r.extra.raw,delete r.extra,r}parseFunctionBody(s,e,r=!1){super.parseFunctionBody(s,e,r),s.expression=s.body.type!=="BlockStatement"}parseMethod(s,e,r,i,a,n,o=!1){let l=this.startNode();l.kind=s.kind,l=super.parseMethod(l,e,r,i,a,n,o),delete l.kind;let{typeParameters:h}=s;h&&(delete s.typeParameters,l.typeParameters=h,this.resetStartLocationFromNode(l,h));let c=this.castNodeTo(l,this.hasPlugin("typescript")&&!l.body?"TSEmptyBodyFunctionExpression":"FunctionExpression");return s.value=c,n==="ClassPrivateMethod"&&(s.computed=!1),this.hasPlugin("typescript")&&s.abstract?(delete s.abstract,this.finishNode(s,"TSAbstractMethodDefinition")):n==="ObjectMethod"?(s.kind==="method"&&(s.kind="init"),s.shorthand=!1,this.finishNode(s,"Property")):this.finishNode(s,"MethodDefinition")}nameIsConstructor(s){return s.type==="Literal"?s.value==="constructor":super.nameIsConstructor(s)}parseClassProperty(...s){let e=super.parseClassProperty(...s);return e.abstract&&this.hasPlugin("typescript")?(delete e.abstract,this.castNodeTo(e,"TSAbstractPropertyDefinition")):this.castNodeTo(e,"PropertyDefinition"),e}parseClassPrivateProperty(...s){let e=super.parseClassPrivateProperty(...s);return e.abstract&&this.hasPlugin("typescript")?this.castNodeTo(e,"TSAbstractPropertyDefinition"):this.castNodeTo(e,"PropertyDefinition"),e.computed=!1,e}parseClassAccessorProperty(s){let e=super.parseClassAccessorProperty(s);return e.abstract&&this.hasPlugin("typescript")?(delete e.abstract,this.castNodeTo(e,"TSAbstractAccessorProperty")):this.castNodeTo(e,"AccessorProperty"),e}parseObjectProperty(s,e,r,i){let a=super.parseObjectProperty(s,e,r,i);return a&&(a.kind="init",this.castNodeTo(a,"Property")),a}finishObjectProperty(s){return s.kind="init",this.finishNode(s,"Property")}isValidLVal(s,e,r,i){return s==="Property"?"value":super.isValidLVal(s,e,r,i)}isAssignable(s,e){return s!=null&&this.isObjectProperty(s)?this.isAssignable(s.value,e):super.isAssignable(s,e)}toAssignable(s,e=!1){if(s!=null&&this.isObjectProperty(s)){let{key:r,value:i}=s;this.isPrivateName(r)&&this.classScope.usePrivateName(this.getPrivateNameSV(r),r.loc.start),this.toAssignable(i,e)}else super.toAssignable(s,e)}toAssignableObjectExpressionProp(s,e,r){s.type==="Property"&&(s.kind==="get"||s.kind==="set")?this.raise(u.PatternHasAccessor,s.key):s.type==="Property"&&s.method?this.raise(u.PatternHasMethod,s.key):super.toAssignableObjectExpressionProp(s,e,r)}finishCallExpression(s,e){let r=super.finishCallExpression(s,e);return r.callee.type==="Import"?(this.castNodeTo(r,"ImportExpression"),r.source=r.arguments[0],r.options=r.arguments[1]??null,delete r.arguments,delete r.callee):r.type==="OptionalCallExpression"?this.castNodeTo(r,"CallExpression"):r.optional=!1,r}toReferencedArguments(s){s.type!=="ImportExpression"&&super.toReferencedArguments(s)}parseExport(s,e){var a;let r=this.state.lastTokStartLoc,i=super.parseExport(s,e);switch(i.type){case"ExportAllDeclaration":i.exported=null;break;case"ExportNamedDeclaration":i.specifiers.length===1&&i.specifiers[0].type==="ExportNamespaceSpecifier"&&(this.castNodeTo(i,"ExportAllDeclaration"),i.exported=i.specifiers[0].exported,delete i.specifiers);case"ExportDefaultDeclaration":{let{declaration:n}=i;(n==null?void 0:n.type)==="ClassDeclaration"&&((a=n.decorators)==null?void 0:a.length)>0&&n.start===i.start&&this.resetStartLocation(i,r)}break}return i}stopParseSubscript(s,e){let r=super.stopParseSubscript(s,e);return e.optionalChainMember?this.estreeParseChainExpression(r,s.loc.end):r}parseMember(s,e,r,i,a){let n=super.parseMember(s,e,r,i,a);return n.type==="OptionalMemberExpression"?this.castNodeTo(n,"MemberExpression"):n.optional=!1,n}isOptionalMemberExpression(s){return s.type==="ChainExpression"?s.expression.type==="MemberExpression":super.isOptionalMemberExpression(s)}hasPropertyAsPrivateName(s){return s.type==="ChainExpression"&&(s=s.expression),super.hasPropertyAsPrivateName(s)}isObjectProperty(s){return s.type==="Property"&&s.kind==="init"&&!s.method}isObjectMethod(s){return s.type==="Property"&&(s.method||s.kind==="get"||s.kind==="set")}castNodeTo(s,e){let r=super.castNodeTo(s,e);return this.fillOptionalPropertiesForTSESLint(r),r}cloneIdentifier(s){let e=super.cloneIdentifier(s);return this.fillOptionalPropertiesForTSESLint(e),e}cloneStringLiteral(s){return s.type==="Literal"?this.cloneEstreeStringLiteral(s):super.cloneStringLiteral(s)}finishNodeAt(s,e,r){return Z(super.finishNodeAt(s,e,r))}finishNode(s,e){let r=super.finishNode(s,e);return this.fillOptionalPropertiesForTSESLint(r),r}resetStartLocation(s,e){super.resetStartLocation(s,e),Z(s)}resetEndLocation(s,e=this.state.lastTokEndLoc){super.resetEndLocation(s,e),Z(s)}},he=class{constructor(t,s){f(this,"token");f(this,"preserveSpace");this.token=t,this.preserveSpace=!!s}},I={brace:new he("{"),j_oTag:new he("<tag"),j_cTag:new he("</tag"),j_expr:new he("<tag>...</tag>",!0)},T=!0,y=!0,Te=!0,ee=!0,_=!0,Ss=!0,Nt=class{constructor(t,s={}){f(this,"label");f(this,"keyword");f(this,"beforeExpr");f(this,"startsExpr");f(this,"rightAssociative");f(this,"isLoop");f(this,"isAssign");f(this,"prefix");f(this,"postfix");f(this,"binop");this.label=t,this.keyword=s.keyword,this.beforeExpr=!!s.beforeExpr,this.startsExpr=!!s.startsExpr,this.rightAssociative=!!s.rightAssociative,this.isLoop=!!s.isLoop,this.isAssign=!!s.isAssign,this.prefix=!!s.prefix,this.postfix=!!s.postfix,this.binop=s.binop!=null?s.binop:null}},Re=new Map;function E(t,s={}){s.keyword=t;let e=P(t,s);return Re.set(t,e),e}function v(t,s){return P(t,{beforeExpr:T,binop:s})}var ae=-1,Ue=[],je=[],_e=[],Ve=[],ze=[],He=[];function P(t,s={}){return++ae,je.push(t),_e.push(s.binop??-1),Ve.push(s.beforeExpr??!1),ze.push(s.startsExpr??!1),He.push(s.prefix??!1),Ue.push(new Nt(t,s)),ae}function b(t,s={}){return++ae,Re.set(t,ae),je.push(t),_e.push(s.binop??-1),Ve.push(s.beforeExpr??!1),ze.push(s.startsExpr??!1),He.push(s.prefix??!1),Ue.push(new Nt("name",s)),ae}var ws={bracketL:P("[",{beforeExpr:T,startsExpr:y}),bracketHashL:P("#[",{beforeExpr:T,startsExpr:y}),bracketBarL:P("[|",{beforeExpr:T,startsExpr:y}),bracketR:P("]"),bracketBarR:P("|]"),braceL:P("{",{beforeExpr:T,startsExpr:y}),braceBarL:P("{|",{beforeExpr:T,startsExpr:y}),braceHashL:P("#{",{beforeExpr:T,startsExpr:y}),braceR:P("}"),braceBarR:P("|}"),parenL:P("(",{beforeExpr:T,startsExpr:y}),parenR:P(")"),comma:P(",",{beforeExpr:T}),semi:P(";",{beforeExpr:T}),colon:P(":",{beforeExpr:T}),doubleColon:P("::",{beforeExpr:T}),dot:P("."),question:P("?",{beforeExpr:T}),questionDot:P("?."),arrow:P("=>",{beforeExpr:T}),template:P("template"),ellipsis:P("...",{beforeExpr:T}),backQuote:P("`",{startsExpr:y}),dollarBraceL:P("${",{beforeExpr:T,startsExpr:y}),templateTail:P("...`",{startsExpr:y}),templateNonTail:P("...${",{beforeExpr:T,startsExpr:y}),at:P("@"),hash:P("#",{startsExpr:y}),interpreterDirective:P("#!..."),eq:P("=",{beforeExpr:T,isAssign:ee}),assign:P("_=",{beforeExpr:T,isAssign:ee}),slashAssign:P("_=",{beforeExpr:T,isAssign:ee}),xorAssign:P("_=",{beforeExpr:T,isAssign:ee}),moduloAssign:P("_=",{beforeExpr:T,isAssign:ee}),incDec:P("++/--",{prefix:_,postfix:Ss,startsExpr:y}),bang:P("!",{beforeExpr:T,prefix:_,startsExpr:y}),tilde:P("~",{beforeExpr:T,prefix:_,startsExpr:y}),doubleCaret:P("^^",{startsExpr:y}),doubleAt:P("@@",{startsExpr:y}),pipeline:v("|>",0),nullishCoalescing:v("??",1),logicalOR:v("||",1),logicalAND:v("&&",2),bitwiseOR:v("|",3),bitwiseXOR:v("^",4),bitwiseAND:v("&",5),equality:v("==/!=/===/!==",6),lt:v("</>/<=/>=",7),gt:v("</>/<=/>=",7),relational:v("</>/<=/>=",7),bitShift:v("<</>>/>>>",8),bitShiftL:v("<</>>/>>>",8),bitShiftR:v("<</>>/>>>",8),plusMin:P("+/-",{beforeExpr:T,binop:9,prefix:_,startsExpr:y}),modulo:P("%",{binop:10,startsExpr:y}),star:P("*",{binop:10}),slash:v("/",10),exponent:P("**",{beforeExpr:T,binop:11,rightAssociative:!0}),_in:E("in",{beforeExpr:T,binop:7}),_instanceof:E("instanceof",{beforeExpr:T,binop:7}),_break:E("break"),_case:E("case",{beforeExpr:T}),_catch:E("catch"),_continue:E("continue"),_debugger:E("debugger"),_default:E("default",{beforeExpr:T}),_else:E("else",{beforeExpr:T}),_finally:E("finally"),_function:E("function",{startsExpr:y}),_if:E("if"),_return:E("return",{beforeExpr:T}),_switch:E("switch"),_throw:E("throw",{beforeExpr:T,prefix:_,startsExpr:y}),_try:E("try"),_var:E("var"),_const:E("const"),_with:E("with"),_new:E("new",{beforeExpr:T,startsExpr:y}),_this:E("this",{startsExpr:y}),_super:E("super",{startsExpr:y}),_class:E("class",{startsExpr:y}),_extends:E("extends",{beforeExpr:T}),_export:E("export"),_import:E("import",{startsExpr:y}),_null:E("null",{startsExpr:y}),_true:E("true",{startsExpr:y}),_false:E("false",{startsExpr:y}),_typeof:E("typeof",{beforeExpr:T,prefix:_,startsExpr:y}),_void:E("void",{beforeExpr:T,prefix:_,startsExpr:y}),_delete:E("delete",{beforeExpr:T,prefix:_,startsExpr:y}),_do:E("do",{isLoop:Te,beforeExpr:T}),_for:E("for",{isLoop:Te}),_while:E("while",{isLoop:Te}),_as:b("as",{startsExpr:y}),_assert:b("assert",{startsExpr:y}),_async:b("async",{startsExpr:y}),_await:b("await",{startsExpr:y}),_defer:b("defer",{startsExpr:y}),_from:b("from",{startsExpr:y}),_get:b("get",{startsExpr:y}),_let:b("let",{startsExpr:y}),_meta:b("meta",{startsExpr:y}),_of:b("of",{startsExpr:y}),_sent:b("sent",{startsExpr:y}),_set:b("set",{startsExpr:y}),_source:b("source",{startsExpr:y}),_static:b("static",{startsExpr:y}),_using:b("using",{startsExpr:y}),_yield:b("yield",{startsExpr:y}),_asserts:b("asserts",{startsExpr:y}),_checks:b("checks",{startsExpr:y}),_exports:b("exports",{startsExpr:y}),_global:b("global",{startsExpr:y}),_implements:b("implements",{startsExpr:y}),_intrinsic:b("intrinsic",{startsExpr:y}),_infer:b("infer",{startsExpr:y}),_is:b("is",{startsExpr:y}),_mixins:b("mixins",{startsExpr:y}),_proto:b("proto",{startsExpr:y}),_require:b("require",{startsExpr:y}),_satisfies:b("satisfies",{startsExpr:y}),_keyof:b("keyof",{startsExpr:y}),_readonly:b("readonly",{startsExpr:y}),_unique:b("unique",{startsExpr:y}),_abstract:b("abstract",{startsExpr:y}),_declare:b("declare",{startsExpr:y}),_enum:b("enum",{startsExpr:y}),_module:b("module",{startsExpr:y}),_namespace:b("namespace",{startsExpr:y}),_interface:b("interface",{startsExpr:y}),_type:b("type",{startsExpr:y}),_opaque:b("opaque",{startsExpr:y}),name:P("name",{startsExpr:y}),placeholder:P("%%",{startsExpr:y}),string:P("string",{startsExpr:y}),num:P("num",{startsExpr:y}),bigint:P("bigint",{startsExpr:y}),decimal:P("decimal",{startsExpr:y}),regexp:P("regexp",{startsExpr:y}),privateName:P("#name",{startsExpr:y}),eof:P("eof"),jsxName:P("jsxName"),jsxText:P("jsxText",{beforeExpr:T}),jsxTagStart:P("jsxTagStart",{startsExpr:y}),jsxTagEnd:P("jsxTagEnd")};function S(t){return t>=93&&t<=133}function Is(t){return t<=92}function L(t){return t>=58&&t<=133}function kt(t){return t>=58&&t<=137}function Ns(t){return Ve[t]}function re(t){return ze[t]}function ks(t){return t>=29&&t<=33}function rt(t){return t>=129&&t<=131}function vs(t){return t>=90&&t<=92}function qe(t){return t>=58&&t<=92}function Ds(t){return t>=39&&t<=59}function Fs(t){return t===34}function Ls(t){return He[t]}function Ms(t){return t>=121&&t<=123}function Bs(t){return t>=124&&t<=130}function q(t){return je[t]}function me(t){return _e[t]}function Os(t){return t===57}function ke(t){return t>=24&&t<=25}function vt(t){return Ue[t]}var $e="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",Dt="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",Rs=new RegExp("["+$e+"]"),Us=new RegExp("["+$e+Dt+"]");$e=Dt=null;var Ft=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],js=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239];function ve(t,s){let e=65536;for(let r=0,i=s.length;r<i;r+=2){if(e+=s[r],e>t)return!1;if(e+=s[r+1],e>=t)return!0}return!1}function B(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&Rs.test(String.fromCharCode(t)):ve(t,Ft)}function K(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&Us.test(String.fromCharCode(t)):ve(t,Ft)||ve(t,js)}var Ke={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},_s=new Set(Ke.keyword),Vs=new Set(Ke.strict),zs=new Set(Ke.strictBind);function Lt(t,s){return s&&t==="await"||t==="enum"}function Mt(t,s){return Lt(t,s)||Vs.has(t)}function Bt(t){return zs.has(t)}function Ot(t,s){return Mt(t,s)||Bt(t)}function Hs(t){return _s.has(t)}function qs(t,s,e){return t===64&&s===64&&B(e)}var $s=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Ks(t){return $s.has(t)}var Je=class{constructor(t){f(this,"flags",0);f(this,"names",new Map);f(this,"firstLexicalName","");this.flags=t}},We=class{constructor(t,s){f(this,"parser");f(this,"scopeStack",[]);f(this,"inModule");f(this,"undefinedExports",new Map);this.parser=t,this.inModule=s}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get allowNewTarget(){return(this.currentThisScopeFlags()&512)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let t=this.currentThisScopeFlags();return(t&64)>0&&(t&2)===0}get inStaticBlock(){for(let t=this.scopeStack.length-1;;t--){let{flags:s}=this.scopeStack[t];if(s&128)return!0;if(s&1731)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get inBareCaseStatement(){return(this.currentScope().flags&256)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(t){return new Je(t)}enter(t){this.scopeStack.push(this.createScope(t))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(t){return!!(t.flags&130||!this.parser.inModule&&t.flags&1)}declareName(t,s,e){let r=this.currentScope();if(s&8||s&16){this.checkRedeclarationInScope(r,t,s,e);let i=r.names.get(t)||0;s&16?i=i|4:(r.firstLexicalName||(r.firstLexicalName=t),i=i|2),r.names.set(t,i),s&8&&this.maybeExportDefined(r,t)}else if(s&4)for(let i=this.scopeStack.length-1;i>=0&&(r=this.scopeStack[i],this.checkRedeclarationInScope(r,t,s,e),r.names.set(t,(r.names.get(t)||0)|1),this.maybeExportDefined(r,t),!(r.flags&1667));--i);this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(t)}maybeExportDefined(t,s){this.parser.inModule&&t.flags&1&&this.undefinedExports.delete(s)}checkRedeclarationInScope(t,s,e,r){this.isRedeclaredInScope(t,s,e)&&this.parser.raise(u.VarRedeclaration,r,{identifierName:s})}isRedeclaredInScope(t,s,e){if(!(e&1))return!1;if(e&8)return t.names.has(s);let r=t.names.get(s)||0;return e&16?(r&2)>0||!this.treatFunctionsAsVarInScope(t)&&(r&1)>0:(r&2)>0&&!(t.flags&8&&t.firstLexicalName===s)||!this.treatFunctionsAsVarInScope(t)&&(r&4)>0}checkLocalExport(t){let{name:s}=t;this.scopeStack[0].names.has(s)||this.undefinedExports.set(s,t.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:s}=this.scopeStack[t];if(s&1667)return s}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:s}=this.scopeStack[t];if(s&1731&&!(s&4))return s}}},Js=class extends Je{constructor(){super(...arguments);f(this,"declareFunctions",new Set)}},Ws=class extends We{createScope(t){return new Js(t)}declareName(t,s,e){let r=this.currentScope();if(s&2048){this.checkRedeclarationInScope(r,t,s,e),this.maybeExportDefined(r,t),r.declareFunctions.add(t);return}super.declareName(t,s,e)}isRedeclaredInScope(t,s,e){if(super.isRedeclaredInScope(t,s,e))return!0;if(e&2048&&!t.declareFunctions.has(s)){let r=t.names.get(s);return(r&4)>0||(r&2)>0}return!1}checkLocalExport(t){this.scopeStack[0].declareFunctions.has(t.name)||super.checkLocalExport(t)}},Xs=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),g=M`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:t})=>`Cannot overwrite reserved type ${t}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:t,enumName:s})=>`Boolean enum members need to be initialized. Use either \`${t} = true,\` or \`${t} = false,\` in enum \`${s}\`.`,EnumDuplicateMemberName:({memberName:t,enumName:s})=>`Enum member names need to be unique, but the name \`${t}\` has already been used before in enum \`${s}\`.`,EnumInconsistentMemberValues:({enumName:t})=>`Enum \`${t}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:t,enumName:s})=>`Enum type \`${t}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${s}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:t})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:t,memberName:s,explicitType:e})=>`Enum \`${t}\` has type \`${e}\`, so the initializer of \`${s}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:t,memberName:s})=>`Symbol enum members cannot be initialized. Use \`${s},\` in enum \`${t}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:t,memberName:s})=>`The enum member initializer for \`${s}\` needs to be a literal (either a boolean, number, or string) in enum \`${t}\`.`,EnumInvalidMemberName:({enumName:t,memberName:s,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${s}\`, consider using \`${e}\`, in enum \`${t}\`.`,EnumNumberMemberNotInitialized:({enumName:t,memberName:s})=>`Number enum members need to be initialized, e.g. \`${s} = 1\` in enum \`${t}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:t})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${t}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:t})=>`Unexpected reserved type ${t}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:t,suggestion:s})=>`\`declare export ${t}\` is not supported. Use \`${s}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function Gs(t){return t.type==="DeclareExportAllDeclaration"||t.type==="DeclareExportDeclaration"&&(!t.declaration||t.declaration.type!=="TypeAlias"&&t.declaration.type!=="InterfaceDeclaration")}function it(t){return t.importKind==="type"||t.importKind==="typeof"}var Ys={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Qs(t,s){let e=[],r=[];for(let i=0;i<t.length;i++)(s(t[i],i,t)?e:r).push(t[i]);return[e,r]}var Zs=/\*?\s*@((?:no)?flow)\b/,er=t=>class extends t{constructor(){super(...arguments);f(this,"flowPragma")}getScopeHandler(){return Ws}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,r){e!==134&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,r)}addComment(e){if(this.flowPragma===void 0){let r=Zs.exec(e.value);if(r)if(r[1]==="flow")this.flowPragma="flow";else if(r[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let r=this.state.inType;this.state.inType=!0,this.expect(e||14);let i=this.flowParseType();return this.state.inType=r,i}flowParsePredicate(){let e=this.startNode(),r=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>r.index+1&&this.raise(g.UnexpectedSpaceBetweenModuloChecks,r),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let r=null,i=null;return this.match(54)?(this.state.inType=e,i=this.flowParsePredicate()):(r=this.flowParseType(),this.state.inType=e,this.match(54)&&(i=this.flowParsePredicate())),[r,i]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let r=e.id=this.parseIdentifier(),i=this.startNode(),a=this.startNode();this.match(47)?i.typeParameters=this.flowParseTypeParameterDeclaration():i.typeParameters=null,this.expect(10);let n=this.flowParseFunctionTypeParams();return i.params=n.params,i.rest=n.rest,i.this=n._this,this.expect(11),[i.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),a.typeAnnotation=this.finishNode(i,"FunctionTypeAnnotation"),r.typeAnnotation=this.finishNode(a,"TypeAnnotation"),this.resetEndLocation(r),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,r){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(r&&this.raise(g.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,r);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(134)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let r=e.body=this.startNode(),i=r.body=[];for(this.expect(5);!this.match(8);){let o=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(g.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),i.push(super.parseImport(o))):(this.expectContextual(125,g.UnsupportedStatementInDeclareModule),i.push(this.flowParseDeclare(o,!0)))}this.scope.exit(),this.expect(8),this.finishNode(r,"BlockStatement");let a=null,n=!1;return i.forEach(o=>{Gs(o)?(a==="CommonJS"&&this.raise(g.AmbiguousDeclareModuleKind,o),a="ES"):o.type==="DeclareModuleExports"&&(n&&this.raise(g.DuplicateDeclareModuleExports,o),a==="ES"&&this.raise(g.AmbiguousDeclareModuleKind,o),a="CommonJS",n=!0)}),e.kind=a||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,r){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!r){let i=this.state.value;throw this.raise(g.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:i,suggestion:Ys[i]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"?(e.default=!1,delete e.exportKind,this.castNodeTo(e,"DeclareExportDeclaration")):this.castNodeTo(e,"DeclareExportAllDeclaration");throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let r=this.flowParseTypeAlias(e);return this.castNodeTo(r,"DeclareTypeAlias"),r}flowParseDeclareOpaqueType(e){this.next();let r=this.flowParseOpaqueType(e,!0);return this.castNodeTo(r,"DeclareOpaqueType"),r}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,r){if(e.id=this.flowParseRestrictedIdentifier(!r,!0),this.scope.declareName(e.id.name,r?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!r&&this.eat(12));if(r){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:r,allowExact:!1,allowSpread:!1,allowProto:r,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(g.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,r,i){Xs.has(e)&&this.raise(i?g.AssignReservedType:g.UnexpectedReservedType,r,{reservedType:e})}flowParseRestrictedIdentifier(e,r){return this.checkReservedType(this.state.value,this.state.startLoc,r),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,r){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,r||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let r=this.state.startLoc,i=this.startNode(),a=this.flowParseVariance(),n=this.flowParseTypeAnnotatableIdentifier();return i.name=n.name,i.variance=a,i.bound=n.typeAnnotation,this.match(29)?(this.eat(29),i.default=this.flowParseType()):e&&this.raise(g.MissingTypeParamDefault,r),this.finishNode(i,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,r=this.startNode();r.params=[],this.state.inType=!0,this.match(47)||this.match(143)?this.next():this.unexpected();let i=!1;do{let a=this.flowParseTypeParameter(i);r.params.push(a),a.default&&(i=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(r,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==I.brace){let r=this.state.context;this.state.context=[r[0]];try{return e()}finally{this.state.context=r}}else return e()}flowParseTypeParameterInstantiationInExpression(){if(this.reScan_lt()===47)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),r=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(47);let i=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);this.state.noAnonFunctionType=i}),this.state.inType=r,!this.state.inType&&this.curContext()===I.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==47)return null;let e=this.startNode(),r=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=r,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(135)||this.match(134)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,r,i){return e.static=r,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=i,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,r){return e.static=r,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,r){let i=this.startNode();return e.static=r,e.value=this.flowParseObjectTypeMethodish(i),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:r,allowSpread:i,allowProto:a,allowInexact:n}){let o=this.state.inType;this.state.inType=!0;let l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let h,c,d=!1;for(r&&this.match(6)?(this.expect(6),h=9,c=!0):(this.expect(5),h=8,c=!1),l.exact=c;!this.match(h);){let A=!1,C=null,F=null,w=this.startNode();if(a&&this.isContextual(118)){let k=this.lookahead();k.type!==14&&k.type!==17&&(this.next(),C=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let k=this.lookahead();k.type!==14&&k.type!==17&&(this.next(),A=!0)}let N=this.flowParseVariance();if(this.eat(0))C!=null&&this.unexpected(C),this.eat(0)?(N&&this.unexpected(N.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(w,A))):l.indexers.push(this.flowParseObjectTypeIndexer(w,A,N));else if(this.match(10)||this.match(47))C!=null&&this.unexpected(C),N&&this.unexpected(N.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(w,A));else{let k="init";if(this.isContextual(99)||this.isContextual(104)){let Q=this.lookahead();kt(Q.type)&&(k=this.state.value,this.next())}let le=this.flowParseObjectTypeProperty(w,A,C,N,k,i,n??!c);le===null?(d=!0,F=this.state.lastTokStartLoc):l.properties.push(le)}this.flowObjectTypeSemicolon(),F&&!this.match(8)&&!this.match(9)&&this.raise(g.UnexpectedExplicitInexactInObject,F)}this.expect(h),i&&(l.inexact=d);let m=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=o,m}flowParseObjectTypeProperty(e,r,i,a,n,o,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(o?l||this.raise(g.InexactInsideExact,this.state.lastTokStartLoc):this.raise(g.InexactInsideNonObject,this.state.lastTokStartLoc),a&&this.raise(g.InexactVariance,a),null):(o||this.raise(g.UnexpectedSpreadType,this.state.lastTokStartLoc),i!=null&&this.unexpected(i),a&&this.raise(g.SpreadVariance,a),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=r,e.proto=i!=null,e.kind=n;let h=!1;return this.match(47)||this.match(10)?(e.method=!0,i!=null&&this.unexpected(i),a&&this.unexpected(a.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(n==="get"||n==="set")&&this.flowCheckGetterSetterParams(e),!o&&e.key.name==="constructor"&&e.value.this&&this.raise(g.ThisParamBannedInConstructor,e.value.this)):(n!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(h=!0),e.value=this.flowParseTypeInitialiser(),e.variance=a),e.optional=h,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let r=e.kind==="get"?0:1,i=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?g.GetterMayNotHaveThisParam:g.SetterMayNotHaveThisParam,e.value.this),i!==r&&this.raise(e.kind==="get"?u.BadGetterArity:u.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(u.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,r){e??(e=this.state.startLoc);let i=r||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let a=this.startNodeAt(e);a.qualification=i,a.id=this.flowParseRestrictedIdentifier(!0),i=this.finishNode(a,"QualifiedTypeIdentifier")}return i}flowParseGenericType(e,r){let i=this.startNodeAt(e);return i.typeParameters=null,i.id=this.flowParseQualifiedTypeIdentifier(e,r),this.match(47)&&(i.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(i,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let r=null,i=!1,a=null,n=this.startNode(),o=this.lookahead(),l=this.state.type===78;return o.type===14||o.type===17?(l&&!e&&this.raise(g.ThisParamMustBeFirst,n),r=this.parseIdentifier(l),this.eat(17)&&(i=!0,l&&this.raise(g.ThisParamMayNotBeOptional,n)),a=this.flowParseTypeInitialiser()):a=this.flowParseType(),n.name=r,n.optional=i,n.typeAnnotation=a,this.finishNode(n,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let r=this.startNodeAt(e.loc.start);return r.name=null,r.optional=!1,r.typeAnnotation=e,this.finishNode(r,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let r=null,i=null;for(this.match(78)&&(i=this.flowParseFunctionTypeParam(!0),i.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(r=this.flowParseFunctionTypeParam(!1)),{params:e,rest:r,_this:i}}flowIdentToTypeAnnotation(e,r,i){switch(i.name){case"any":return this.finishNode(r,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(r,"BooleanTypeAnnotation");case"mixed":return this.finishNode(r,"MixedTypeAnnotation");case"empty":return this.finishNode(r,"EmptyTypeAnnotation");case"number":return this.finishNode(r,"NumberTypeAnnotation");case"string":return this.finishNode(r,"StringTypeAnnotation");case"symbol":return this.finishNode(r,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(i.name),this.flowParseGenericType(e,i)}}flowParsePrimaryType(){let e=this.state.startLoc,r=this.startNode(),i,a,n=!1,o=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,a=this.flowParseTupleType(),this.state.noAnonFunctionType=o,a;case 47:{let l=this.startNode();return l.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),i=this.flowParseFunctionTypeParams(),l.params=i.params,l.rest=i.rest,l.this=i._this,this.expect(11),this.expect(19),l.returnType=this.flowParseType(),this.finishNode(l,"FunctionTypeAnnotation")}case 10:{let l=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(S(this.state.type)||this.match(78)){let h=this.lookahead().type;n=h!==17&&h!==14}else n=!0;if(n){if(this.state.noAnonFunctionType=!1,a=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),a;this.eat(12)}return a?i=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(a)]):i=this.flowParseFunctionTypeParams(),l.params=i.params,l.rest=i.rest,l.this=i._this,this.expect(11),this.expect(19),l.returnType=this.flowParseType(),l.typeParameters=null,this.finishNode(l,"FunctionTypeAnnotation")}case 134:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return r.value=this.match(85),this.next(),this.finishNode(r,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(135))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",r);if(this.match(136))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",r);throw this.raise(g.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 135:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 136:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(r,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(r,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(r,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(r,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(qe(this.state.type)){let l=q(this.state.type);return this.next(),super.createIdentifier(r,l)}else if(S(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,r,this.parseIdentifier())}throw this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,r=this.flowParsePrimaryType(),i=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let a=this.startNodeAt(e),n=this.eat(18);i=i||n,this.expect(0),!n&&this.match(3)?(a.elementType=r,this.next(),r=this.finishNode(a,"ArrayTypeAnnotation")):(a.objectType=r,a.indexType=this.flowParseType(),this.expect(3),i?(a.optional=n,r=this.finishNode(a,"OptionalIndexedAccessType")):r=this.finishNode(a,"IndexedAccessType"))}return r}flowParsePrefixType(){let e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let r=this.startNodeAt(e.loc.start);return r.params=[this.reinterpretTypeAsFunctionTypeParam(e)],r.rest=null,r.this=null,r.returnType=this.flowParseType(),r.typeParameters=null,this.finishNode(r,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let r=this.flowParseAnonFunctionWithoutParens();for(e.types=[r];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?r:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let r=this.flowParseIntersectionType();for(e.types=[r];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?r:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let r=this.flowParseUnionType();return this.state.inType=e,r}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let e=this.state.startLoc,r=this.parseIdentifier();return this.flowParseGenericType(e,r)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){let r=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(r.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(r)),r}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,r,i=!1){if(r){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,i));return}super.parseFunctionBody(e,!1,i)}parseFunctionBodyAndFinish(e,r,i=!1){if(this.match(14)){let a=this.startNode();[a.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=a.typeAnnotation?this.finishNode(a,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,r,i)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let i=this.lookahead();if(L(i.type)){let a=this.startNode();return this.next(),this.flowParseInterface(a)}}else if(this.isContextual(126)){let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}let r=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(r)&&(this.flowPragma=null),r}parseExpressionStatement(e,r,i){if(r.type==="Identifier"){if(r.name==="declare"){if(this.match(80)||S(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(S(this.state.type)){if(r.name==="interface")return this.flowParseInterface(e);if(r.name==="type")return this.flowParseTypeAlias(e);if(r.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,r,i)}shouldParseExportDeclaration(){let{type:e}=this.state;return e===126||rt(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===126||rt(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,r,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let m=this.lookaheadCharCode();if(m===44||m===61||m===58||m===41)return this.setOptionalParametersError(i),e}this.expect(17);let a=this.state.clone(),n=this.state.noArrowAt,o=this.startNodeAt(r),{consequent:l,failed:h}=this.tryParseConditionalConsequent(),[c,d]=this.getArrowLikeExpressions(l);if(h||d.length>0){let m=[...n];if(d.length>0){this.state=a,this.state.noArrowAt=m;for(let A=0;A<d.length;A++)m.push(d[A].start);({consequent:l,failed:h}=this.tryParseConditionalConsequent()),[c,d]=this.getArrowLikeExpressions(l)}h&&c.length>1&&this.raise(g.AmbiguousConditionalArrow,a.startLoc),h&&c.length===1&&(this.state=a,m.push(c[0].start),this.state.noArrowAt=m,{consequent:l,failed:h}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=n,this.expect(14),o.test=e,o.consequent=l,o.alternate=this.forwardNoArrowParamsConversionAt(o,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(o,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let e=this.parseMaybeAssignAllowIn(),r=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:r}}getArrowLikeExpressions(e,r){let i=[e],a=[];for(;i.length!==0;){let n=i.pop();n.type==="ArrowFunctionExpression"&&n.body.type!=="BlockStatement"?(n.typeParameters||!n.returnType?this.finishArrowValidation(n):a.push(n),i.push(n.body)):n.type==="ConditionalExpression"&&(i.push(n.consequent),i.push(n.alternate))}return r?(a.forEach(n=>this.finishArrowValidation(n)),[a,[]]):Qs(a,n=>n.params.every(o=>this.isAssignable(o,!0)))}finishArrowValidation(e){var r;this.toAssignableList(e.params,(r=e.extra)==null?void 0:r.trailingCommaLoc,!1),this.scope.enter(518),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,r){let i;return this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?(this.state.noArrowParamsConversionAt.push(this.state.start),i=r(),this.state.noArrowParamsConversionAt.pop()):i=r(),i}parseParenItem(e,r){let i=super.parseParenItem(e,r);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let a=this.startNodeAt(r);return a.expression=i,a.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(a,"TypeCastExpression")}return i}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let r=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(r)}else if(this.isContextual(131)){e.exportKind="type";let r=this.startNode();return this.next(),this.flowParseOpaqueType(r,!1)}else if(this.isContextual(129)){e.exportKind="type";let r=this.startNode();return this.next(),this.flowParseInterface(r)}else if(this.isContextual(126)){e.exportKind="value";let r=this.startNode();return this.next(),this.flowParseEnumDeclaration(r)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:r}=this.state,i=super.maybeParseExportNamespaceSpecifier(e);return i&&e.exportKind==="type"&&this.unexpected(r),i}parseClassId(e,r,i){super.parseClassId(e,r,i),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,r,i){let{startLoc:a}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,r))return;r.declare=!0}super.parseClassMember(e,r,i),r.declare&&(r.type!=="ClassProperty"&&r.type!=="ClassPrivateProperty"&&r.type!=="PropertyDefinition"?this.raise(g.DeclareClassElement,a):r.value&&this.raise(g.DeclareClassFieldInitializer,r.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),r="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(u.InvalidIdentifier,this.state.curPosition(),{identifierName:r}),this.finishToken(132,r)}getTokenFromCode(e){let r=this.input.charCodeAt(this.state.pos+1);e===123&&r===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?r===46?this.finishOp(18,2):this.finishOp(17,1):qs(e,r,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,r){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,r):super.isAssignable(e,r)}toAssignable(e,r=!1){!r&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,r)}toAssignableList(e,r,i){for(let a=0;a<e.length;a++){let n=e[a];(n==null?void 0:n.type)==="TypeCastExpression"&&(e[a]=this.typeCastToParameter(n))}super.toAssignableList(e,r,i)}toReferencedList(e,r){var i;for(let a=0;a<e.length;a++){let n=e[a];n&&n.type==="TypeCastExpression"&&!((i=n.extra)!=null&&i.parenthesized)&&(e.length>1||!r)&&this.raise(g.TypeCastInPattern,n.typeAnnotation)}return e}parseArrayLike(e,r,i){let a=super.parseArrayLike(e,r,i);return i!=null&&!this.state.maybeInArrowParameters&&this.toReferencedList(a.elements),a}isValidLVal(e,r,i,a){return e==="TypeCastExpression"||super.isValidLVal(e,r,i,a)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,r,i,a,n,o){if(r.variance&&this.unexpected(r.variance.loc.start),delete r.variance,this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,r,i,a,n,o),r.params&&n){let l=r.params;l.length>0&&this.isThisParam(l[0])&&this.raise(g.ThisParamBannedInConstructor,r)}else if(r.type==="MethodDefinition"&&n&&r.value.params){let l=r.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(g.ThisParamBannedInConstructor,r)}}pushClassPrivateMethod(e,r,i,a){r.variance&&this.unexpected(r.variance.loc.start),delete r.variance,this.match(47)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,r,i,a)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeArguments=this.flowParseTypeParameterInstantiationInExpression()),this.isContextual(113)){this.next();let r=e.implements=[];do{let i=this.startNode();i.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,r.push(this.finishNode(i,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let r=this.getObjectOrClassMethodParams(e);if(r.length>0){let i=r[0];this.isThisParam(i)&&e.kind==="get"?this.raise(g.GetterMayNotHaveThisParam,i):this.isThisParam(i)&&this.raise(g.SetterMayNotHaveThisParam,i)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,r,i,a,n,o,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let h;this.match(47)&&!o&&(h=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let c=super.parseObjPropValue(e,r,i,a,n,o,l);return h&&((c.value||c).typeParameters=h),c}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(g.PatternIsOptional,e),this.isThisParam(e)&&this.raise(g.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(g.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(g.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,r){let i=super.parseMaybeDefault(e,r);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(g.TypeBeforeInitializer,i.typeAnnotation),i}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(g.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,r,i){r.local=it(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(r,i))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;let r=this.lookaheadCharCode();return r===123||r===42}return!e&&this.isContextual(87)}applyImportPhase(e,r,i,a){if(super.applyImportPhase(e,r,i,a),r){if(!i&&this.match(65))return;e.exportKind=i==="type"?i:"value"}else i==="type"&&this.match(55)&&this.unexpected(),e.importKind=i==="type"||i==="typeof"?i:"value"}parseImportSpecifier(e,r,i,a,n){let o=e.imported,l=null;o.type==="Identifier"&&(o.name==="type"?l="type":o.name==="typeof"&&(l="typeof"));let h=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let d=this.parseIdentifier(!0);l!==null&&!L(this.state.type)?(e.imported=d,e.importKind=l,e.local=this.cloneIdentifier(d)):(e.imported=o,e.importKind=null,e.local=this.parseIdentifier())}else{if(l!==null&&L(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=l;else{if(r)throw this.raise(u.ImportBindingIsString,e,{importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(h=!0,e.local=this.cloneIdentifier(e.imported))}let c=it(e);return i&&c&&this.raise(g.ImportTypeShorthandOnlyInPureImport,e),(i||c)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),h&&!i&&!c&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,r){let i=e.kind;i!=="get"&&i!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,r)}parseVarId(e,r){super.parseVarId(e,r),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,r){if(this.match(14)){let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=i}return super.parseAsyncArrowFromCallExpression(e,r)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,r){let i=null,a;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(i=this.state.clone(),a=this.tryParse(()=>super.parseMaybeAssign(e,r),i),!a.error)return a.node;let{context:n}=this.state,o=n[n.length-1];(o===I.j_oTag||o===I.j_expr)&&n.pop()}if(a!=null&&a.error||this.match(47)){i=i||this.state.clone();let n,o=this.tryParse(h=>{var m;n=this.flowParseTypeParameterDeclaration();let c=this.forwardNoArrowParamsConversionAt(n,()=>{let A=super.parseMaybeAssign(e,r);return this.resetStartLocationFromNode(A,n),A});(m=c.extra)!=null&&m.parenthesized&&h();let d=this.maybeUnwrapTypeCastExpression(c);return d.type!=="ArrowFunctionExpression"&&h(),d.typeParameters=n,this.resetStartLocationFromNode(d,n),c},i),l=null;if(o.node&&this.maybeUnwrapTypeCastExpression(o.node).type==="ArrowFunctionExpression"){if(!o.error&&!o.aborted)return o.node.async&&this.raise(g.UnexpectedTypeParameterBeforeAsyncArrowFunction,n),o.node;l=o.node}if(a!=null&&a.node)return this.state=a.failState,a.node;if(l)return this.state=o.failState,l;throw a!=null&&a.thrown?a.error:o.thrown?o.error:this.raise(g.UnexpectedTokenAfterTypeParameter,n)}return super.parseMaybeAssign(e,r)}parseArrow(e){if(this.match(14)){let r=this.tryParse(()=>{let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let a=this.startNode();return[a.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=i,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),a});if(r.thrown)return null;r.error&&(this.state=r.failState),e.returnType=r.node.typeAnnotation?this.finishNode(r.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,r){this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start))?e.params=r:super.setArrowFunctionParameters(e,r)}checkParams(e,r,i,a=!0){if(!(i&&this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))){for(let n=0;n<e.params.length;n++)this.isThisParam(e.params[n])&&n>0&&this.raise(g.ThisParamMustBeFirst,e.params[n]);super.checkParams(e,r,i,a)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)))}parseSubscripts(e,r,i){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(r.index)){this.next();let a=this.startNodeAt(r);a.callee=e,a.arguments=super.parseCallExpressionArguments(),e=this.finishNode(a,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let a=this.state.clone(),n=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(r)||l(),a);if(!n.error&&!n.aborted)return n.node;let o=this.tryParse(()=>super.parseSubscripts(e,r,i),a);if(o.node&&!o.error)return o.node;if(n.node)return this.state=n.failState,n.node;if(o.node)return this.state=o.failState,o.node;throw n.error||o.error}return super.parseSubscripts(e,r,i)}parseSubscript(e,r,i,a){if(this.match(18)&&this.isLookaheadToken_lt()){if(a.optionalChainMember=!0,i)return a.stop=!0,e;this.next();let n=this.startNodeAt(r);return n.callee=e,n.typeArguments=this.flowParseTypeParameterInstantiationInExpression(),this.expect(10),n.arguments=this.parseCallExpressionArguments(),n.optional=!0,this.finishCallExpression(n,!0)}else if(!i&&this.shouldParseTypes()&&(this.match(47)||this.match(51))){let n=this.startNodeAt(r);n.callee=e;let o=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),n.arguments=super.parseCallExpressionArguments(),a.optionalChainMember&&(n.optional=!1),this.finishCallExpression(n,a.optionalChainMember)));if(o.node)return o.error&&(this.state=o.failState),o.node}return super.parseSubscript(e,r,i,a)}parseNewCallee(e){super.parseNewCallee(e);let r=null;this.shouldParseTypes()&&this.match(47)&&(r=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=r}parseAsyncArrowWithTypeParameters(e){let r=this.startNodeAt(e);if(this.parseFunctionParams(r,!1),!!this.parseArrow(r))return super.parseArrowExpression(r,void 0,!0)}readToken_mult_modulo(e){let r=this.input.charCodeAt(this.state.pos+1);if(e===42&&r===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let r=this.input.charCodeAt(this.state.pos+1);if(e===124&&r===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,r){let i=super.parseTopLevel(e,r);return this.state.hasFlowComment&&this.raise(g.UnterminatedFlowComment,this.state.curPosition()),i}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(g.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,r=2;for(;[32,9].includes(this.input.charCodeAt(e+r));)r++;let i=this.input.charCodeAt(r+e),a=this.input.charCodeAt(r+e+1);return i===58&&a===58?r+2:this.input.slice(r+e,r+e+12)==="flow-include"?r+12:i===58&&a!==58?r:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(u.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:r,memberName:i}){this.raise(g.EnumBooleanMemberNotInitialized,e,{memberName:i,enumName:r})}flowEnumErrorInvalidMemberInitializer(e,r){return this.raise(r.explicitType?r.explicitType==="symbol"?g.EnumInvalidMemberInitializerSymbolType:g.EnumInvalidMemberInitializerPrimaryType:g.EnumInvalidMemberInitializerUnknownType,e,r)}flowEnumErrorNumberMemberNotInitialized(e,r){this.raise(g.EnumNumberMemberNotInitialized,e,r)}flowEnumErrorStringMemberInconsistentlyInitialized(e,r){this.raise(g.EnumStringMemberInconsistentlyInitialized,e,r)}flowEnumMemberInit(){let e=this.state.startLoc,r=()=>this.match(12)||this.match(8);switch(this.state.type){case 135:{let i=this.parseNumericLiteral(this.state.value);return r()?{type:"number",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 134:{let i=this.parseStringLiteral(this.state.value);return r()?{type:"string",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}case 85:case 86:{let i=this.parseBooleanLiteral(this.match(85));return r()?{type:"boolean",loc:i.loc.start,value:i}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,r=this.parseIdentifier(!0),i=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:r,init:i}}flowEnumCheckExplicitTypeMismatch(e,r,i){let{explicitType:a}=r;a!==null&&a!==i&&this.flowEnumErrorInvalidMemberInitializer(e,r)}flowEnumMembers({enumName:e,explicitType:r}){let i=new Set,a={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},n=!1;for(;!this.match(8);){if(this.eat(21)){n=!0;break}let o=this.startNode(),{id:l,init:h}=this.flowEnumMemberRaw(),c=l.name;if(c==="")continue;/^[a-z]/.test(c)&&this.raise(g.EnumInvalidMemberName,l,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),i.has(c)&&this.raise(g.EnumDuplicateMemberName,l,{memberName:c,enumName:e}),i.add(c);let d={enumName:e,explicitType:r,memberName:c};switch(o.id=l,h.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"boolean"),o.init=h.value,a.booleanMembers.push(this.finishNode(o,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"number"),o.init=h.value,a.numberMembers.push(this.finishNode(o,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(h.loc,d,"string"),o.init=h.value,a.stringMembers.push(this.finishNode(o,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(h.loc,d);case"none":switch(r){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(h.loc,d);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(h.loc,d);break;default:a.defaultedMembers.push(this.finishNode(o,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:a,hasUnknownMembers:n}}flowEnumStringMembers(e,r,{enumName:i}){if(e.length===0)return r;if(r.length===0)return e;if(r.length>e.length){for(let a of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(a,{enumName:i});return r}else{for(let a of r)this.flowEnumErrorStringMemberInconsistentlyInitialized(a,{enumName:i});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!S(this.state.type))throw this.raise(g.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:r}=this.state;return this.next(),r!=="boolean"&&r!=="number"&&r!=="string"&&r!=="symbol"&&this.raise(g.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:r}),r}flowEnumBody(e,r){let i=r.name,a=r.loc.start,n=this.flowEnumParseExplicitType({enumName:i});this.expect(5);let{members:o,hasUnknownMembers:l}=this.flowEnumMembers({enumName:i,explicitType:n});switch(e.hasUnknownMembers=l,n){case"boolean":return e.explicitType=!0,e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let h=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let c=o.booleanMembers.length,d=o.numberMembers.length,m=o.stringMembers.length,A=o.defaultedMembers.length;if(!c&&!d&&!m&&!A)return h();if(!c&&!d)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!d&&!m&&c>=A){for(let C of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(C.loc.start,{enumName:i,memberName:C.id.name});return e.members=o.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!c&&!m&&d>=A){for(let C of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(C.loc.start,{enumName:i,memberName:C.id.name});return e.members=o.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(g.EnumInconsistentMemberValues,a,{enumName:i}),h()}}}flowParseEnumDeclaration(e){let r=this.parseIdentifier();return e.id=r,e.body=this.flowEnumBody(this.startNode(),r),this.finishNode(e,"EnumDeclaration")}jsxParseOpeningElementAfterName(e){return this.shouldParseTypes()&&(this.match(47)||this.match(51))&&(e.typeArguments=this.flowParseTypeParameterInstantiationInExpression()),super.jsxParseOpeningElementAfterName(e)}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let r=this.input.charCodeAt(e+1);return r!==60&&r!==61}return!1}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},tr=/\r\n|[\r\n\u2028\u2029]/,pe=new RegExp(tr.source,"g");function X(t){switch(t){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function at(t,s,e){for(let r=s;r<e;r++)if(X(t.charCodeAt(r)))return!0;return!1}var be=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ee=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function sr(t){switch(t){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var R=M`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:t})=>`Expected corresponding JSX closing tag for <${t}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:t,HTMLEntity:s})=>`Unexpected token \`${t}\`. Did you mean \`${s}\` or \`{'${t}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function V(t){return t?t.type==="JSXOpeningFragment"||t.type==="JSXClosingFragment":!1}function W(t){if(t.type==="JSXIdentifier")return t.name;if(t.type==="JSXNamespacedName")return t.namespace.name+":"+t.name.name;if(t.type==="JSXMemberExpression")return W(t.object)+"."+W(t.property);throw new Error("Node had unexpected type: "+t.type)}var rr=t=>class extends t{jsxReadToken(){let s="",e=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(R.UnterminatedJsxContent,this.state.startLoc);let r=this.input.charCodeAt(this.state.pos);switch(r){case 60:case 123:if(this.state.pos===this.state.start){r===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(143)):super.getTokenFromCode(r);return}s+=this.input.slice(e,this.state.pos),this.finishToken(142,s);return;case 38:s+=this.input.slice(e,this.state.pos),s+=this.jsxReadEntity(),e=this.state.pos;break;case 62:case 125:this.raise(R.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:r===125?"}":">"});default:X(r)?(s+=this.input.slice(e,this.state.pos),s+=this.jsxReadNewLine(!0),e=this.state.pos):++this.state.pos}}}jsxReadNewLine(s){let e=this.input.charCodeAt(this.state.pos),r;return++this.state.pos,e===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,r=s?`
|
|
4
|
+
`:`\r
|
|
5
|
+
`):r=String.fromCharCode(e),++this.state.curLine,this.state.lineStart=this.state.pos,r}jsxReadString(s){let e="",r=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(u.UnterminatedString,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);if(i===s)break;i===38?(e+=this.input.slice(r,this.state.pos),e+=this.jsxReadEntity(),r=this.state.pos):X(i)?(e+=this.input.slice(r,this.state.pos),e+=this.jsxReadNewLine(!1),r=this.state.pos):++this.state.pos}e+=this.input.slice(r,this.state.pos++),this.finishToken(134,e)}jsxReadEntity(){let s=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let e=10;this.codePointAtPos(this.state.pos)===120&&(e=16,++this.state.pos);let r=this.readInt(e,void 0,!1,"bail");if(r!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(r)}else{let e=0,r=!1;for(;e++<10&&this.state.pos<this.length&&!(r=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(r){this.input.slice(s,this.state.pos);let i;++this.state.pos}}return this.state.pos=s,"&"}jsxReadWord(){let s,e=this.state.pos;do s=this.input.charCodeAt(++this.state.pos);while(K(s)||s===45);this.finishToken(141,this.input.slice(e,this.state.pos))}jsxParseIdentifier(){let s=this.startNode();return this.match(141)?s.name=this.state.value:qe(this.state.type)?s.name=q(this.state.type):this.unexpected(),this.next(),this.finishNode(s,"JSXIdentifier")}jsxParseNamespacedName(){let s=this.state.startLoc,e=this.jsxParseIdentifier();if(!this.eat(14))return e;let r=this.startNodeAt(s);return r.namespace=e,r.name=this.jsxParseIdentifier(),this.finishNode(r,"JSXNamespacedName")}jsxParseElementName(){let s=this.state.startLoc,e=this.jsxParseNamespacedName();if(e.type==="JSXNamespacedName")return e;for(;this.eat(16);){let r=this.startNodeAt(s);r.object=e,r.property=this.jsxParseIdentifier(),e=this.finishNode(r,"JSXMemberExpression")}return e}jsxParseAttributeValue(){let s;switch(this.state.type){case 5:return s=this.startNode(),this.setContext(I.brace),this.next(),s=this.jsxParseExpressionContainer(s,I.j_oTag),s.expression.type==="JSXEmptyExpression"&&this.raise(R.AttributeIsEmpty,s),s;case 143:case 134:return this.parseExprAtom();default:throw this.raise(R.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let s=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(s,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(s){return this.next(),s.expression=this.parseExpression(),this.setContext(I.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(s,"JSXSpreadChild")}jsxParseExpressionContainer(s,e){var r;if(this.match(8))s.expression=this.jsxParseEmptyExpression();else{let i=this.parseExpression();i.type==="SequenceExpression"&&!((r=i.extra)!=null&&r.parenthesized)&&this.raise(R.UnexpectedSequenceExpression,i.expressions[1]),s.expression=i}return this.setContext(e),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(s,"JSXExpressionContainer")}jsxParseAttribute(){let s=this.startNode();return this.match(5)?(this.setContext(I.brace),this.next(),this.expect(21),s.argument=this.parseMaybeAssignAllowIn(),this.setContext(I.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(s,"JSXSpreadAttribute")):(s.name=this.jsxParseNamespacedName(),s.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(s,"JSXAttribute"))}jsxParseOpeningElementAt(s){let e=this.startNodeAt(s);return this.eat(144)?this.finishNode(e,"JSXOpeningFragment"):(e.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(e))}jsxParseOpeningElementAfterName(s){let e=[];for(;!this.match(56)&&!this.match(144);)e.push(this.jsxParseAttribute());return s.attributes=e,s.selfClosing=this.eat(56),this.expect(144),this.finishNode(s,"JSXOpeningElement")}jsxParseClosingElementAt(s){let e=this.startNodeAt(s);return this.eat(144)?this.finishNode(e,"JSXClosingFragment"):(e.name=this.jsxParseElementName(),this.expect(144),this.finishNode(e,"JSXClosingElement"))}jsxParseElementAt(s){let e=this.startNodeAt(s),r=[],i=this.jsxParseOpeningElementAt(s),a=null;if(!i.selfClosing){e:for(;;)switch(this.state.type){case 143:if(s=this.state.startLoc,this.next(),this.eat(56)){a=this.jsxParseClosingElementAt(s);break e}r.push(this.jsxParseElementAt(s));break;case 142:r.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let n=this.startNode();this.setContext(I.brace),this.next(),this.match(21)?r.push(this.jsxParseSpreadChild(n)):r.push(this.jsxParseExpressionContainer(n,I.j_expr));break}default:this.unexpected()}V(i)&&!V(a)&&a!==null?this.raise(R.MissingClosingTagFragment,a):!V(i)&&V(a)?this.raise(R.MissingClosingTagElement,a,{openingTagName:W(i.name)}):!V(i)&&!V(a)&&W(a.name)!==W(i.name)&&this.raise(R.MissingClosingTagElement,a,{openingTagName:W(i.name)})}if(V(i)?(e.openingFragment=i,e.closingFragment=a):(e.openingElement=i,e.closingElement=a),e.children=r,this.match(47))throw this.raise(R.UnwrappedAdjacentJSXElements,this.state.startLoc);return V(i)?this.finishNode(e,"JSXFragment"):this.finishNode(e,"JSXElement")}jsxParseElement(){let s=this.state.startLoc;return this.next(),this.jsxParseElementAt(s)}setContext(s){let{context:e}=this.state;e[e.length-1]=s}parseExprAtom(s){return this.match(143)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(143),this.jsxParseElement()):super.parseExprAtom(s)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(s){let e=this.curContext();if(e===I.j_expr){this.jsxReadToken();return}if(e===I.j_oTag||e===I.j_cTag){if(B(s)){this.jsxReadWord();return}if(s===62){++this.state.pos,this.finishToken(144);return}if((s===34||s===39)&&e===I.j_oTag){this.jsxReadString(s);return}}if(s===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(143);return}super.getTokenFromCode(s)}updateContext(s){let{context:e,type:r}=this.state;if(r===56&&s===143)e.splice(-2,2,I.j_cTag),this.state.canStartJSXElement=!1;else if(r===143)e.push(I.j_oTag);else if(r===144){let i=e[e.length-1];i===I.j_oTag&&s===56||i===I.j_cTag?(e.pop(),this.state.canStartJSXElement=e[e.length-1]===I.j_expr):(this.setContext(I.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=Ns(r)}},ir=class extends Je{constructor(){super(...arguments);f(this,"tsNames",new Map)}},ar=class extends We{constructor(){super(...arguments);f(this,"importsStack",[])}createScope(s){return this.importsStack.push(new Set),new ir(s)}enter(s){s===1024&&this.importsStack.push(new Set),super.enter(s)}exit(){let s=super.exit();return s===1024&&this.importsStack.pop(),s}hasImport(s,e){let r=this.importsStack.length;if(this.importsStack[r-1].has(s))return!0;if(!e&&r>1){for(let i=0;i<r-1;i++)if(this.importsStack[i].has(s))return!0}return!1}declareName(s,e,r){if(e&4096){this.hasImport(s,!0)&&this.parser.raise(u.VarRedeclaration,r,{identifierName:s}),this.importsStack[this.importsStack.length-1].add(s);return}let i=this.currentScope(),a=i.tsNames.get(s)||0;if(e&1024){this.maybeExportDefined(i,s),i.tsNames.set(s,a|16);return}super.declareName(s,e,r),e&2&&(e&1||(this.checkRedeclarationInScope(i,s,e,r),this.maybeExportDefined(i,s)),a=a|1),e&256&&(a=a|2),e&512&&(a=a|4),e&128&&(a=a|8),a&&i.tsNames.set(s,a)}isRedeclaredInScope(s,e,r){let i=s.tsNames.get(e);if((i&2)>0){if(r&256){let a=!!(r&512),n=(i&4)>0;return a!==n}return!0}return r&128&&(i&8)>0?s.names.get(e)&2?!!(r&1):!1:r&2&&(i&1)>0?!0:super.isRedeclaredInScope(s,e,r)}checkLocalExport(s){let{name:e}=s;if(this.hasImport(e))return;let r=this.scopeStack.length;for(let i=r-1;i>=0;i--){let a=this.scopeStack[i].tsNames.get(e);if((a&1)>0||(a&16)>0)return}super.checkLocalExport(s)}},nr=class{constructor(){f(this,"stacks",[])}enter(t){this.stacks.push(t)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function fe(t,s){return(t?2:0)|(s?1:0)}var or=class{constructor(){f(this,"sawUnambiguousESM",!1);f(this,"ambiguousScriptDifferentAst",!1)}sourceToOffsetPos(t){return t+this.startIndex}offsetToSourcePos(t){return t-this.startIndex}hasPlugin(t){if(typeof t=="string")return this.plugins.has(t);{let[s,e]=t;if(!this.hasPlugin(s))return!1;let r=this.plugins.get(s);for(let i of Object.keys(e))if((r==null?void 0:r[i])!==e[i])return!1;return!0}}getPluginOption(t,s){var e;return(e=this.plugins.get(t))==null?void 0:e[s]}};function Rt(t,s){t.trailingComments===void 0?t.trailingComments=s:t.trailingComments.unshift(...s)}function lr(t,s){t.leadingComments===void 0?t.leadingComments=s:t.leadingComments.unshift(...s)}function G(t,s){t.innerComments===void 0?t.innerComments=s:t.innerComments.unshift(...s)}function $(t,s,e){let r=null,i=s.length;for(;r===null&&i>0;)r=s[--i];r===null||r.start>e.start?G(t,e.comments):Rt(r,e.comments)}var hr=class extends or{addComment(t){this.filename&&(t.loc.filename=this.filename);let{commentsLen:s}=this.state;this.comments.length!==s&&(this.comments.length=s),this.comments.push(t),this.state.commentsLen++}processComment(t){let{commentStack:s}=this.state,e=s.length;if(e===0)return;let r=e-1,i=s[r];i.start===t.end&&(i.leadingNode=t,r--);let{start:a}=t;for(;r>=0;r--){let n=s[r],o=n.end;if(o>a)n.containingNode=t,this.finalizeComment(n),s.splice(r,1);else{o===a&&(n.trailingNode=t);break}}}finalizeComment(t){let{comments:s}=t;if(t.leadingNode!==null||t.trailingNode!==null)t.leadingNode!==null&&Rt(t.leadingNode,s),t.trailingNode!==null&&lr(t.trailingNode,s);else{let e=t.containingNode,r=t.start;if(this.input.charCodeAt(this.offsetToSourcePos(r)-1)===44)switch(e.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":$(e,e.properties,t);break;case"CallExpression":case"OptionalCallExpression":$(e,e.arguments,t);break;case"ImportExpression":$(e,[e.source,e.options??null],t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":$(e,e.params,t);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":$(e,e.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":$(e,e.specifiers,t);break;case"TSEnumDeclaration":G(e,s);break;case"TSEnumBody":$(e,e.members,t);break;default:G(e,s)}else G(e,s)}}finalizeRemainingComments(){let{commentStack:t}=this.state;for(let s=t.length-1;s>=0;s--)this.finalizeComment(t[s]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(t){let{commentStack:s}=this.state,{length:e}=s;if(e===0)return;let r=s[e-1];r.leadingNode===t&&(r.leadingNode=null)}takeSurroundingComments(t,s,e){let{commentStack:r}=this.state,i=r.length;if(i===0)return;let a=i-1;for(;a>=0;a--){let n=r[a],o=n.end;if(n.start===e)n.leadingNode=t;else if(o===s)n.trailingNode=t;else if(o<s)break}}},pr=class Ut{constructor(){f(this,"flags",1024);f(this,"startIndex");f(this,"curLine");f(this,"lineStart");f(this,"startLoc");f(this,"endLoc");f(this,"errors",[]);f(this,"potentialArrowAt",-1);f(this,"noArrowAt",[]);f(this,"noArrowParamsConversionAt",[]);f(this,"topicContext",{maxNumOfResolvableTopics:0,maxTopicIndex:null});f(this,"labels",[]);f(this,"commentsLen",0);f(this,"commentStack",[]);f(this,"pos",0);f(this,"type",140);f(this,"value",null);f(this,"start",0);f(this,"end",0);f(this,"lastTokEndLoc",null);f(this,"lastTokStartLoc",null);f(this,"context",[I.brace]);f(this,"firstInvalidTemplateEscapePos",null);f(this,"strictErrors",new Map);f(this,"tokensLength",0)}get strict(){return(this.flags&1)>0}set strict(s){s?this.flags|=1:this.flags&=-2}init({strictMode:s,sourceType:e,startIndex:r,startLine:i,startColumn:a}){this.strict=s===!1?!1:s===!0?!0:e==="module",this.startIndex=r,this.curLine=i,this.lineStart=-a,this.startLoc=this.endLoc=new H(i,a,r)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(s){s?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(s){s?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(s){s?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(s){s?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(s){s?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(s){s?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(s){s?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(s){s?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(s){s?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(s){s?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(s){s?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(s){s?this.flags|=4096:this.flags&=-4097}curPosition(){return new H(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let s=new Ut;return s.flags=this.flags,s.startIndex=this.startIndex,s.curLine=this.curLine,s.lineStart=this.lineStart,s.startLoc=this.startLoc,s.endLoc=this.endLoc,s.errors=this.errors.slice(),s.potentialArrowAt=this.potentialArrowAt,s.noArrowAt=this.noArrowAt.slice(),s.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),s.topicContext=this.topicContext,s.labels=this.labels.slice(),s.commentsLen=this.commentsLen,s.commentStack=this.commentStack.slice(),s.pos=this.pos,s.type=this.type,s.value=this.value,s.start=this.start,s.end=this.end,s.lastTokEndLoc=this.lastTokEndLoc,s.lastTokStartLoc=this.lastTokStartLoc,s.context=this.context.slice(),s.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,s.strictErrors=this.strictErrors,s.tokensLength=this.tokensLength,s}},ur=function(t){return t>=48&&t<=57},nt={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},ue={bin:t=>t===48||t===49,oct:t=>t>=48&&t<=55,dec:t=>t>=48&&t<=57,hex:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};function ot(t,s,e,r,i,a){let n=e,o=r,l=i,h="",c=null,d=e,{length:m}=s;for(;;){if(e>=m){a.unterminated(n,o,l),h+=s.slice(d,e);break}let A=s.charCodeAt(e);if(cr(t,A,s,e)){h+=s.slice(d,e);break}if(A===92){h+=s.slice(d,e);let C=dr(s,e,r,i,t==="template",a);C.ch===null&&!c?c={pos:e,lineStart:r,curLine:i}:h+=C.ch,{pos:e,lineStart:r,curLine:i}=C,d=e}else A===8232||A===8233?(++e,++i,r=e):A===10||A===13?t==="template"?(h+=s.slice(d,e)+`
|
|
6
|
+
`,++e,A===13&&s.charCodeAt(e)===10&&++e,++i,d=r=e):a.unterminated(n,o,l):++e}return{pos:e,str:h,firstInvalidLoc:c,lineStart:r,curLine:i}}function cr(t,s,e,r){return t==="template"?s===96||s===36&&e.charCodeAt(r+1)===123:s===(t==="double"?34:39)}function dr(t,s,e,r,i,a){let n=!i;s++;let o=h=>({pos:s,ch:h,lineStart:e,curLine:r}),l=t.charCodeAt(s++);switch(l){case 110:return o(`
|
|
7
|
+
`);case 114:return o("\r");case 120:{let h;return{code:h,pos:s}=De(t,s,e,r,2,!1,n,a),o(h===null?null:String.fromCharCode(h))}case 117:{let h;return{code:h,pos:s}=_t(t,s,e,r,n,a),o(h===null?null:String.fromCodePoint(h))}case 116:return o(" ");case 98:return o("\b");case 118:return o("\v");case 102:return o("\f");case 13:t.charCodeAt(s)===10&&++s;case 10:e=s,++r;case 8232:case 8233:return o("");case 56:case 57:if(i)return o(null);a.strictNumericEscape(s-1,e,r);default:if(l>=48&&l<=55){let h=s-1,c=/^[0-7]+/.exec(t.slice(h,s+2))[0],d=parseInt(c,8);d>255&&(c=c.slice(0,-1),d=parseInt(c,8)),s+=c.length-1;let m=t.charCodeAt(s);if(c!=="0"||m===56||m===57){if(i)return o(null);a.strictNumericEscape(h,e,r)}return o(String.fromCharCode(d))}return o(String.fromCharCode(l))}}function De(t,s,e,r,i,a,n,o){let l=s,h;return{n:h,pos:s}=jt(t,s,e,r,16,i,a,!1,o,!n),h===null&&(n?o.invalidEscapeSequence(l,e,r):s=l-1),{code:h,pos:s}}function jt(t,s,e,r,i,a,n,o,l,h){let c=s,d=i===16?nt.hex:nt.decBinOct,m=i===16?ue.hex:i===10?ue.dec:i===8?ue.oct:ue.bin,A=!1,C=0;for(let F=0,w=a??1/0;F<w;++F){let N=t.charCodeAt(s),k;if(N===95&&o!=="bail"){let le=t.charCodeAt(s-1),Q=t.charCodeAt(s+1);if(o){if(Number.isNaN(Q)||!m(Q)||d.has(le)||d.has(Q)){if(h)return{n:null,pos:s};l.unexpectedNumericSeparator(s,e,r)}}else{if(h)return{n:null,pos:s};l.numericSeparatorInEscapeSequence(s,e,r)}++s;continue}if(N>=97?k=N-97+10:N>=65?k=N-65+10:ur(N)?k=N-48:k=1/0,k>=i){if(k<=9&&h)return{n:null,pos:s};if(k<=9&&l.invalidDigit(s,e,r,i))k=0;else if(n)k=0,A=!0;else break}++s,C=C*i+k}return s===c||a!=null&&s-c!==a||A?{n:null,pos:s}:{n:C,pos:s}}function _t(t,s,e,r,i,a){let n=t.charCodeAt(s),o;if(n===123){if(++s,{code:o,pos:s}=De(t,s,e,r,t.indexOf("}",s)-s,!0,i,a),++s,o!==null&&o>1114111)if(i)a.invalidCodePoint(s,e,r);else return{code:null,pos:s}}else({code:o,pos:s}=De(t,s,e,r,4,!1,i,a));return{code:o,pos:s}}function te(t,s,e){return new H(e,t-s,t)}var mr=new Set([103,109,115,105,121,117,100,118]),fr=class{constructor(t){let s=t.startIndex||0;this.type=t.type,this.value=t.value,this.start=s+t.start,this.end=s+t.end,this.loc=new Pe(t.startLoc,t.endLoc)}},yr=class extends hr{constructor(s,e){super();f(this,"isLookahead");f(this,"tokens",[]);f(this,"errorHandlers_readInt",{invalidDigit:(s,e,r,i)=>this.optionFlags&2048?(this.raise(u.InvalidDigit,te(s,e,r),{radix:i}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(u.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(u.UnexpectedNumericSeparator)});f(this,"errorHandlers_readCodePoint",Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(u.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(u.InvalidCodePoint)}));f(this,"errorHandlers_readStringContents_string",Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(s,e,r)=>{this.recordStrictModeErrors(u.StrictNumericEscape,te(s,e,r))},unterminated:(s,e,r)=>{throw this.raise(u.UnterminatedString,te(s-1,e,r))}}));f(this,"errorHandlers_readStringContents_template",Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(u.StrictNumericEscape),unterminated:(s,e,r)=>{throw this.raise(u.UnterminatedTemplate,te(s,e,r))}}));this.state=new pr,this.state.init(s),this.input=e,this.length=e.length,this.comments=[],this.isLookahead=!1}pushToken(s){this.tokens.length=this.state.tokensLength,this.tokens.push(s),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&256&&this.pushToken(new fr(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(s){return this.match(s)?(this.next(),!0):!1}match(s){return this.state.type===s}createLookaheadState(s){return{pos:s.pos,value:null,type:s.type,start:s.start,end:s.end,context:[this.curContext()],inType:s.inType,startLoc:s.startLoc,lastTokEndLoc:s.lastTokEndLoc,curLine:s.curLine,lineStart:s.lineStart,curPosition:s.curPosition}}lookahead(){let s=this.state;this.state=this.createLookaheadState(s),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let e=this.state;return this.state=s,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(s){return be.lastIndex=s,be.test(this.input)?be.lastIndex:s}lookaheadCharCode(){return this.lookaheadCharCodeSince(this.state.pos)}lookaheadCharCodeSince(s){return this.input.charCodeAt(this.nextTokenStartSince(s))}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(s){return Ee.lastIndex=s,Ee.test(this.input)?Ee.lastIndex:s}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(s){let e=this.input.charCodeAt(s);if((e&64512)===55296&&++s<this.input.length){let r=this.input.charCodeAt(s);(r&64512)===56320&&(e=65536+((e&1023)<<10)+(r&1023))}return e}setStrict(s){this.state.strict=s,s&&(this.state.strictErrors.forEach(([e,r])=>this.raise(e,r)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(140);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(s){let e;this.isLookahead||(e=this.state.curPosition());let r=this.state.pos,i=this.input.indexOf(s,r+2);if(i===-1)throw this.raise(u.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+s.length,pe.lastIndex=r+2;pe.test(this.input)&&pe.lastIndex<=i;)++this.state.curLine,this.state.lineStart=pe.lastIndex;if(this.isLookahead)return;let a={type:"CommentBlock",value:this.input.slice(r+2,i),start:this.sourceToOffsetPos(r),end:this.sourceToOffsetPos(i+s.length),loc:new Pe(e,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(a),a}skipLineComment(s){let e=this.state.pos,r;this.isLookahead||(r=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=s);if(this.state.pos<this.length)for(;!X(i)&&++this.state.pos<this.length;)i=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let a=this.state.pos,n={type:"CommentLine",value:this.input.slice(e+s,a),start:this.sourceToOffsetPos(e),end:this.sourceToOffsetPos(a),loc:new Pe(r,this.state.curPosition())};return this.optionFlags&256&&this.pushToken(n),n}skipSpace(){let s=this.state.pos,e=this.optionFlags&4096?[]:null;e:for(;this.state.pos<this.length;){let r=this.input.charCodeAt(this.state.pos);switch(r){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let i=this.skipBlockComment("*/");i!==void 0&&(this.addComment(i),e==null||e.push(i));break}case 47:{let i=this.skipLineComment(2);i!==void 0&&(this.addComment(i),e==null||e.push(i));break}default:break e}break;default:if(sr(r))++this.state.pos;else if(r===45&&!this.inModule&&this.optionFlags&8192){let i=this.state.pos;if(this.input.charCodeAt(i+1)===45&&this.input.charCodeAt(i+2)===62&&(s===0||this.state.lineStart>s)){let a=this.skipLineComment(3);a!==void 0&&(this.addComment(a),e==null||e.push(a))}else break e}else if(r===60&&!this.inModule&&this.optionFlags&8192){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let a=this.skipLineComment(4);a!==void 0&&(this.addComment(a),e==null||e.push(a))}else break e}else break e}}if((e==null?void 0:e.length)>0){let r=this.state.pos,i={start:this.sourceToOffsetPos(s),end:this.sourceToOffsetPos(r),comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}finishToken(s,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let r=this.state.type;this.state.type=s,this.state.value=e,this.isLookahead||this.updateContext(r)}replaceToken(s){this.state.type=s,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let s=this.state.pos+1,e=this.codePointAtPos(s);if(e>=48&&e<=57)throw this.raise(u.UnexpectedDigitAfterHash,this.state.curPosition());B(e)?(++this.state.pos,this.finishToken(139,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(139,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let s=this.input.charCodeAt(this.state.pos+1);if(s>=48&&s<=57){this.readNumber(!0);return}s===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let s=this.input.charCodeAt(this.state.pos+1);if(s!==33)return!1;let e=this.state.pos;for(this.state.pos+=1;!X(s)&&++this.state.pos<this.length;)s=this.input.charCodeAt(this.state.pos);let r=this.input.slice(e+2,this.state.pos);return this.finishToken(28,r),!0}readToken_mult_modulo(s){let e=s===42?55:54,r=1,i=this.input.charCodeAt(this.state.pos+1);s===42&&i===42&&(r++,i=this.input.charCodeAt(this.state.pos+2),e=57),i===61&&!this.state.inType&&(r++,e=s===37?33:30),this.finishOp(e,r)}readToken_pipe_amp(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===s){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(s===124?41:42,2);return}if(s===124&&e===62){this.finishOp(39,2);return}if(e===61){this.finishOp(30,2);return}this.finishOp(s===124?43:45,1)}readToken_caret(){let s=this.input.charCodeAt(this.state.pos+1);s===61&&!this.state.inType?this.finishOp(32,2):s===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===s){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:s}=this.state,e=this.input.charCodeAt(s+1);if(e===60){if(this.input.charCodeAt(s+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(e===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:s}=this.state,e=this.input.charCodeAt(s+1);if(e===62){let r=this.input.charCodeAt(s+2)===62?3:2;if(this.input.charCodeAt(s+r)===61){this.finishOp(30,r+1);return}this.finishOp(52,r);return}if(e===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(s===61&&e===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(s===61?29:35,1)}readToken_question(){let s=this.input.charCodeAt(this.state.pos+1),e=this.input.charCodeAt(this.state.pos+2);s===63?e===61?this.finishOp(30,3):this.finishOp(40,2):s===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(s){switch(s){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(s);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(s);return;case 124:case 38:this.readToken_pipe_amp(s);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(s);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(s);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(B(s)){this.readWord(s);return}}throw this.raise(u.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(s)})}finishOp(s,e){let r=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(s,r)}readRegexp(){let s=this.state.startLoc,e=this.state.start+1,r,i,{pos:a}=this.state;for(;;++a){if(a>=this.length)throw this.raise(u.UnterminatedRegExp,D(s,1));let h=this.input.charCodeAt(a);if(X(h))throw this.raise(u.UnterminatedRegExp,D(s,1));if(r)r=!1;else{if(h===91)i=!0;else if(h===93&&i)i=!1;else if(h===47&&!i)break;r=h===92}}let n=this.input.slice(e,a);++a;let o="",l=()=>D(s,a+2-e);for(;a<this.length;){let h=this.codePointAtPos(a),c=String.fromCharCode(h);if(mr.has(h))h===118?o.includes("u")&&this.raise(u.IncompatibleRegExpUVFlags,l()):h===117&&o.includes("v")&&this.raise(u.IncompatibleRegExpUVFlags,l()),o.includes(c)&&this.raise(u.DuplicateRegExpFlags,l());else if(K(h)||h===92)this.raise(u.MalformedRegExpFlags,l());else break;++a,o+=c}this.state.pos=a,this.finishToken(138,{pattern:n,flags:o})}readInt(s,e,r=!1,i=!0){let{n:a,pos:n}=jt(this.input,this.state.pos,this.state.lineStart,this.state.curLine,s,e,r,i,this.errorHandlers_readInt,!1);return this.state.pos=n,a}readRadixNumber(s){let e=this.state.pos,r=this.state.curPosition(),i=!1;this.state.pos+=2;let a=this.readInt(s);a==null&&this.raise(u.InvalidDigit,D(r,2),{radix:s});let n=this.input.charCodeAt(this.state.pos);if(n===110)++this.state.pos,i=!0;else if(n===109)throw this.raise(u.InvalidDecimal,r);if(B(this.codePointAtPos(this.state.pos)))throw this.raise(u.NumberIdentifier,this.state.curPosition());if(i){let o=this.input.slice(e,this.state.pos).replace(/[_n]/g,"");this.finishToken(136,o);return}this.finishToken(135,a)}readNumber(s){let e=this.state.pos,r=this.state.curPosition(),i=!1,a=!1,n=!1;!s&&this.readInt(10)===null&&this.raise(u.InvalidNumber,this.state.curPosition());let o=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(o){let d=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(u.StrictOctalLiteral,r),!this.state.strict){let m=d.indexOf("_");m>0&&this.raise(u.ZeroDigitNumericSeparator,D(r,m))}n=o&&!/[89]/.test(d)}let l=this.input.charCodeAt(this.state.pos);if(l===46&&!n&&(++this.state.pos,this.readInt(10),i=!0,l=this.input.charCodeAt(this.state.pos)),(l===69||l===101)&&!n&&(l=this.input.charCodeAt(++this.state.pos),(l===43||l===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(u.InvalidOrMissingExponent,r),i=!0,l=this.input.charCodeAt(this.state.pos)),l===110&&((i||o)&&this.raise(u.InvalidBigIntLiteral,r),++this.state.pos,a=!0),B(this.codePointAtPos(this.state.pos)))throw this.raise(u.NumberIdentifier,this.state.curPosition());let h=this.input.slice(e,this.state.pos).replace(/[_mn]/g,"");if(a){this.finishToken(136,h);return}let c=n?parseInt(h,8):parseFloat(h);this.finishToken(135,c)}readCodePoint(s){let{code:e,pos:r}=_t(this.input,this.state.pos,this.state.lineStart,this.state.curLine,s,this.errorHandlers_readCodePoint);return this.state.pos=r,e}readString(s){let{str:e,pos:r,curLine:i,lineStart:a}=ot(s===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=r+1,this.state.lineStart=a,this.state.curLine=i,this.finishToken(134,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let s=this.input[this.state.pos],{str:e,firstInvalidLoc:r,pos:i,curLine:a,lineStart:n}=ot("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=n,this.state.curLine=a,r&&(this.state.firstInvalidTemplateEscapePos=new H(r.curLine,r.pos-r.lineStart,this.sourceToOffsetPos(r.pos))),this.input.codePointAt(i)===96?this.finishToken(24,r?null:s+e+"`"):(this.state.pos++,this.finishToken(25,r?null:s+e+"${"))}recordStrictModeErrors(s,e){let r=e.index;this.state.strict&&!this.state.strictErrors.has(r)?this.raise(s,e):this.state.strictErrors.set(r,[s,e])}readWord1(s){this.state.containsEsc=!1;let e="",r=this.state.pos,i=this.state.pos;for(s!==void 0&&(this.state.pos+=s<=65535?1:2);this.state.pos<this.length;){let a=this.codePointAtPos(this.state.pos);if(K(a))this.state.pos+=a<=65535?1:2;else if(a===92){this.state.containsEsc=!0,e+=this.input.slice(i,this.state.pos);let n=this.state.curPosition(),o=this.state.pos===r?B:K;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(u.MissingUnicodeEscape,this.state.curPosition()),i=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);l!==null&&(o(l)||this.raise(u.EscapedCharNotAnIdentifier,n),e+=String.fromCodePoint(l)),i=this.state.pos}else break}return e+this.input.slice(i,this.state.pos)}readWord(s){let e=this.readWord1(s),r=Re.get(e);r!==void 0?this.finishToken(r,q(r)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:s}=this.state;qe(s)&&this.state.containsEsc&&this.raise(u.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:q(s)})}raise(s,e,r={}){let i=e instanceof H?e:e.loc.start,a=s(i,r);if(!(this.optionFlags&2048))throw a;return this.isLookahead||this.state.errors.push(a),a}raiseOverwrite(s,e,r={}){let i=e instanceof H?e:e.loc.start,a=i.index,n=this.state.errors;for(let o=n.length-1;o>=0;o--){let l=n[o];if(l.loc.index===a)return n[o]=s(i,r);if(l.loc.index<a)break}return this.raise(s,e,r)}updateContext(s){}unexpected(s,e){throw this.raise(u.UnexpectedToken,s??this.state.startLoc,{expected:e?q(e):null})}expectPlugin(s,e){if(this.hasPlugin(s))return!0;throw this.raise(u.MissingPlugin,e??this.state.startLoc,{missingPlugin:[s]})}expectOnePlugin(s){if(!s.some(e=>this.hasPlugin(e)))throw this.raise(u.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:s})}errorBuilder(s){return(e,r,i)=>{this.raise(s,te(e,r,i))}}},xr=class{constructor(){f(this,"privateNames",new Set);f(this,"loneAccessors",new Map);f(this,"undefinedPrivateNames",new Map)}},Pr=class{constructor(t){f(this,"parser");f(this,"stack",[]);f(this,"undefinedPrivateNames",new Map);this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new xr)}exit(){let t=this.stack.pop(),s=this.current();for(let[e,r]of Array.from(t.undefinedPrivateNames))s?s.undefinedPrivateNames.has(e)||s.undefinedPrivateNames.set(e,r):this.parser.raise(u.InvalidPrivateFieldResolution,r,{identifierName:e})}declarePrivateName(t,s,e){let{privateNames:r,loneAccessors:i,undefinedPrivateNames:a}=this.current(),n=r.has(t);if(s&3){let o=n&&i.get(t);if(o){let l=o&4,h=s&4,c=o&3,d=s&3;n=c===d||l!==h,n||i.delete(t)}else n||i.set(t,s)}n&&this.parser.raise(u.PrivateNameRedeclaration,e,{identifierName:t}),r.add(t),a.delete(t)}usePrivateName(t,s){let e;for(e of this.stack)if(e.privateNames.has(t))return;e?e.undefinedPrivateNames.set(t,s):this.parser.raise(u.InvalidPrivateFieldResolution,s,{identifierName:t})}},Ae=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Vt=class extends Ae{constructor(s){super(s);f(this,"declarationErrors",new Map)}recordDeclarationError(s,e){let r=e.index;this.declarationErrors.set(r,[s,e])}clearDeclarationError(s){this.declarationErrors.delete(s)}iterateErrors(s){this.declarationErrors.forEach(s)}},Ar=class{constructor(t){f(this,"parser");f(this,"stack",[new Ae]);this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,s){let e=s.loc.start,{stack:r}=this,i=r.length-1,a=r[i];for(;!a.isCertainlyParameterDeclaration();){if(a.canBeArrowParameterDeclaration())a.recordDeclarationError(t,e);else return;a=r[--i]}this.parser.raise(t,e)}recordArrowParameterBindingError(t,s){let{stack:e}=this,r=e[e.length-1],i=s.loc.start;if(r.isCertainlyParameterDeclaration())this.parser.raise(t,i);else if(r.canBeArrowParameterDeclaration())r.recordDeclarationError(t,i);else return}recordAsyncArrowParametersError(t){let{stack:s}=this,e=s.length-1,r=s[e];for(;r.canBeArrowParameterDeclaration();)r.type===2&&r.recordDeclarationError(u.AwaitBindingIdentifier,t),r=s[--e]}validateAsPattern(){let{stack:t}=this,s=t[t.length-1];s.canBeArrowParameterDeclaration()&&s.iterateErrors(([e,r])=>{this.parser.raise(e,r);let i=t.length-2,a=t[i];for(;a.canBeArrowParameterDeclaration();)a.clearDeclarationError(r.index),a=t[--i]})}};function gr(){return new Ae(3)}function Tr(){return new Vt(1)}function br(){return new Vt(2)}function zt(){return new Ae}var Er=class extends yr{addExtra(t,s,e,r=!0){if(!t)return;let{extra:i}=t;i==null&&(i={},t.extra=i),r?i[s]=e:Object.defineProperty(i,s,{enumerable:r,value:e})}isContextual(t){return this.state.type===t&&!this.state.containsEsc}isUnparsedContextual(t,s){if(this.input.startsWith(s,t)){let e=this.input.charCodeAt(t+s.length);return!(K(e)||(e&64512)===55296)}return!1}isLookaheadContextual(t){let s=this.nextTokenStart();return this.isUnparsedContextual(s,t)}eatContextual(t){return this.isContextual(t)?(this.next(),!0):!1}expectContextual(t,s){if(!this.eatContextual(t)){if(s!=null)throw this.raise(s,this.state.startLoc);this.unexpected(null,t)}}canInsertSemicolon(){return this.match(140)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return at(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return at(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(13))||this.raise(u.MissingSemicolon,this.state.lastTokEndLoc)}expect(t,s){this.eat(t)||this.unexpected(s,t)}tryParse(t,s=this.state.clone()){let e={node:null};try{let r=t((i=null)=>{throw e.node=i,e});if(this.state.errors.length>s.errors.length){let i=this.state;return this.state=s,this.state.tokensLength=i.tokensLength,{node:r,error:i.errors[s.errors.length],thrown:!1,aborted:!1,failState:i}}return{node:r,error:null,thrown:!1,aborted:!1,failState:null}}catch(r){let i=this.state;if(this.state=s,r instanceof SyntaxError)return{node:null,error:r,thrown:!0,aborted:!1,failState:i};if(r===e)return{node:e.node,error:null,thrown:!1,aborted:!0,failState:i};throw r}}checkExpressionErrors(t,s){if(!t)return!1;let{shorthandAssignLoc:e,doubleProtoLoc:r,privateKeyLoc:i,optionalParametersLoc:a,voidPatternLoc:n}=t,o=!!e||!!r||!!a||!!i||!!n;if(!s)return o;e!=null&&this.raise(u.InvalidCoverInitializedName,e),r!=null&&this.raise(u.DuplicateProto,r),i!=null&&this.raise(u.UnexpectedPrivateField,i),a!=null&&this.unexpected(a),n!=null&&this.raise(u.InvalidCoverDiscardElement,n)}isLiteralPropertyName(){return kt(this.state.type)}isPrivateName(t){return t.type==="PrivateName"}getPrivateNameSV(t){return t.id.name}hasPropertyAsPrivateName(t){return(t.type==="MemberExpression"||t.type==="OptionalMemberExpression")&&this.isPrivateName(t.property)}isObjectProperty(t){return t.type==="ObjectProperty"}isObjectMethod(t){return t.type==="ObjectMethod"}initializeScopes(t=this.options.sourceType==="module"){let s=this.state.labels;this.state.labels=[];let e=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let r=this.inModule;this.inModule=t;let i=this.scope,a=this.getScopeHandler();this.scope=new a(this,t);let n=this.prodParam;this.prodParam=new nr;let o=this.classScope;this.classScope=new Pr(this);let l=this.expressionScope;return this.expressionScope=new Ar(this),()=>{this.state.labels=s,this.exportedIdentifiers=e,this.inModule=r,this.scope=i,this.prodParam=n,this.classScope=o,this.expressionScope=l}}enterInitialScopes(){let t=0;(this.inModule||this.optionFlags&1)&&(t|=2),this.optionFlags&32&&(t|=1);let s=!this.inModule&&this.options.sourceType==="commonjs";(s||this.optionFlags&2)&&(t|=4),this.prodParam.enter(t);let e=s?514:1;this.optionFlags&4&&(e|=512),this.optionFlags&16&&(e|=48),this.scope.enter(e)}checkDestructuringPrivate(t){let{privateKeyLoc:s}=t;s!==null&&this.expectPlugin("destructuringPrivate",s)}},ye=class{constructor(){f(this,"shorthandAssignLoc",null);f(this,"doubleProtoLoc",null);f(this,"privateKeyLoc",null);f(this,"optionalParametersLoc",null);f(this,"voidPatternLoc",null)}},Fe=class{constructor(t,s,e){f(this,"type","");this.start=s,this.end=0,this.loc=new Pe(e),(t==null?void 0:t.optionFlags)&128&&(this.range=[s,0]),t!=null&&t.filename&&(this.loc.filename=t.filename)}},lt=Fe.prototype,Cr=class extends Er{startNode(){let t=this.state.startLoc;return new Fe(this,t.index,t)}startNodeAt(t){return new Fe(this,t.index,t)}startNodeAtNode(t){return this.startNodeAt(t.loc.start)}finishNode(t,s){return this.finishNodeAt(t,s,this.state.lastTokEndLoc)}finishNodeAt(t,s,e){return t.type=s,t.end=e.index,t.loc.end=e,this.optionFlags&128&&(t.range[1]=e.index),this.optionFlags&4096&&this.processComment(t),t}resetStartLocation(t,s){t.start=s.index,t.loc.start=s,this.optionFlags&128&&(t.range[0]=s.index)}resetEndLocation(t,s=this.state.lastTokEndLoc){t.end=s.index,t.loc.end=s,this.optionFlags&128&&(t.range[1]=s.index)}resetStartLocationFromNode(t,s){this.resetStartLocation(t,s.loc.start)}castNodeTo(t,s){return t.type=s,t}cloneIdentifier(t){let{type:s,start:e,end:r,loc:i,range:a,name:n}=t,o=Object.create(lt);return o.type=s,o.start=e,o.end=r,o.loc=i,o.range=a,o.name=n,t.extra&&(o.extra=t.extra),o}cloneStringLiteral(t){let{type:s,start:e,end:r,loc:i,range:a,extra:n}=t,o=Object.create(lt);return o.type=s,o.start=e,o.end=r,o.loc=i,o.range=a,o.extra=n,o.value=t.value,o}},Le=t=>t.type==="ParenthesizedExpression"?Le(t.expression):t,Sr=class extends Cr{toAssignable(t,s=!1){var r,i,a;let e;switch((t.type==="ParenthesizedExpression"||(r=t.extra)!=null&&r.parenthesized)&&(e=Le(t),s?e.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(u.InvalidParenthesizedAssignment,t):e.type!=="CallExpression"&&e.type!=="MemberExpression"&&!this.isOptionalMemberExpression(e)&&this.raise(u.InvalidParenthesizedAssignment,t):this.raise(u.InvalidParenthesizedAssignment,t)),t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":break;case"ObjectExpression":this.castNodeTo(t,"ObjectPattern");for(let n=0,o=t.properties.length,l=o-1;n<o;n++){let h=t.properties[n],c=n===l;this.toAssignableObjectExpressionProp(h,c,s),c&&h.type==="RestElement"&&((i=t.extra)!=null&&i.trailingCommaLoc)&&this.raise(u.RestTrailingComma,t.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:n,value:o}=t;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.loc.start),this.toAssignable(o,s);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":this.castNodeTo(t,"ArrayPattern"),this.toAssignableList(t.elements,(a=t.extra)==null?void 0:a.trailingCommaLoc,s);break;case"AssignmentExpression":t.operator!=="="&&this.raise(u.MissingEqInAssignment,t.left.loc.end),this.castNodeTo(t,"AssignmentPattern"),delete t.operator,t.left.type==="VoidPattern"&&this.raise(u.VoidPatternInitializer,t.left),this.toAssignable(t.left,s);break;case"ParenthesizedExpression":this.toAssignable(e,s);break}}toAssignableObjectExpressionProp(t,s,e){if(t.type==="ObjectMethod")this.raise(t.kind==="get"||t.kind==="set"?u.PatternHasAccessor:u.PatternHasMethod,t.key);else if(t.type==="SpreadElement"){this.castNodeTo(t,"RestElement");let r=t.argument;this.checkToRestConversion(r,!1),this.toAssignable(r,e),s||this.raise(u.RestTrailingComma,t)}else this.toAssignable(t,e)}toAssignableList(t,s,e){let r=t.length-1;for(let i=0;i<=r;i++){let a=t[i];a&&(this.toAssignableListItem(t,i,e),a.type==="RestElement"&&(i<r?this.raise(u.RestTrailingComma,a):s&&this.raise(u.RestTrailingComma,s)))}}toAssignableListItem(t,s,e){let r=t[s];if(r.type==="SpreadElement"){this.castNodeTo(r,"RestElement");let i=r.argument;this.checkToRestConversion(i,!0),this.toAssignable(i,e)}else this.toAssignable(r,e)}isAssignable(t,s){switch(t.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":case"VoidPattern":return!0;case"ObjectExpression":{let e=t.properties.length-1;return t.properties.every((r,i)=>r.type!=="ObjectMethod"&&(i===e||r.type!=="SpreadElement")&&this.isAssignable(r))}case"ObjectProperty":return this.isAssignable(t.value);case"SpreadElement":return this.isAssignable(t.argument);case"ArrayExpression":return t.elements.every(e=>e===null||this.isAssignable(e));case"AssignmentExpression":return t.operator==="=";case"ParenthesizedExpression":return this.isAssignable(t.expression);case"MemberExpression":case"OptionalMemberExpression":return!s;default:return!1}}toReferencedList(t,s){return t}toReferencedListDeep(t,s){this.toReferencedList(t,s);for(let e of t)(e==null?void 0:e.type)==="ArrayExpression"&&this.toReferencedListDeep(e.elements)}parseSpread(t){let s=this.startNode();return this.next(),s.argument=this.parseMaybeAssignAllowIn(t,void 0),this.finishNode(s,"SpreadElement")}parseRestBinding(){let t=this.startNode();this.next();let s=this.parseBindingAtom();return s.type==="VoidPattern"&&this.raise(u.UnexpectedVoidPattern,s),t.argument=s,this.finishNode(t,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let t=this.startNode();return this.next(),t.elements=this.parseBindingList(3,93,1),this.finishNode(t,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0);case 88:return this.parseVoidPattern(null)}return this.parseIdentifier()}parseBindingList(t,s,e){let r=e&1,i=[],a=!0;for(;!this.eat(t);)if(a?a=!1:this.expect(12),r&&this.match(12))i.push(null);else{if(this.eat(t))break;if(this.match(21)){let n=this.parseRestBinding();if(e&2&&(n=this.parseFunctionParamType(n)),i.push(n),!this.checkCommaAfterRest(s)){this.expect(t);break}}else{let n=[];if(e&2)for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(u.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)n.push(this.parseDecorator());i.push(this.parseBindingElement(e,n))}}return i}parseBindingRestProperty(t){return this.next(),this.hasPlugin("discardBinding")&&this.match(88)?(t.argument=this.parseVoidPattern(null),this.raise(u.UnexpectedVoidPattern,t.argument)):t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:s}=this.state;if(t===21)return this.parseBindingRestProperty(this.startNode());let e=this.startNode();return t===139?(this.expectPlugin("destructuringPrivate",s),this.classScope.usePrivateName(this.state.value,s),e.key=this.parsePrivateName()):this.parsePropertyName(e),e.method=!1,this.parseObjPropValue(e,s,!1,!1,!0,!1)}parseBindingElement(t,s){let e=this.parseMaybeDefault();return t&2&&this.parseFunctionParamType(e),s.length&&(e.decorators=s,this.resetStartLocationFromNode(e,s[0])),this.parseMaybeDefault(e.loc.start,e)}parseFunctionParamType(t){return t}parseMaybeDefault(t,s){if(t??(t=this.state.startLoc),s=s??this.parseBindingAtom(),!this.eat(29))return s;let e=this.startNodeAt(t);return s.type==="VoidPattern"&&this.raise(u.VoidPatternInitializer,s),e.left=s,e.right=this.parseMaybeAssignAllowIn(),this.finishNode(e,"AssignmentPattern")}isValidLVal(t,s,e,r){switch(t){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties";case"VoidPattern":return!0;case"CallExpression":if(!s&&!this.state.strict&&this.optionFlags&8192)return!0}return!1}isOptionalMemberExpression(t){return t.type==="OptionalMemberExpression"}checkLVal(t,s,e=64,r=!1,i=!1,a=!1,n=!1){var F;let o=t.type;if(this.isObjectMethod(t))return;let l=this.isOptionalMemberExpression(t);if(l||o==="MemberExpression"){l&&(this.expectPlugin("optionalChainingAssign",t.loc.start),s.type!=="AssignmentExpression"&&this.raise(u.InvalidLhsOptionalChaining,t,{ancestor:s})),e!==64&&this.raise(u.InvalidPropertyBindingPattern,t);return}if(o==="Identifier"){this.checkIdentifier(t,e,i);let{name:w}=t;r&&(r.has(w)?this.raise(u.ParamDupe,t):r.add(w));return}else o==="VoidPattern"&&s.type==="CatchClause"&&this.raise(u.VoidPatternCatchClauseParam,t);let h=Le(t);n||(n=h.type==="CallExpression"&&(h.callee.type==="Import"||h.callee.type==="Super"));let c=this.isValidLVal(o,n,!(a||(F=t.extra)!=null&&F.parenthesized)&&s.type==="AssignmentExpression",e);if(c===!0)return;if(c===!1){let w=e===64?u.InvalidLhs:u.InvalidLhsBinding;this.raise(w,t,{ancestor:s});return}let d,m;typeof c=="string"?(d=c,m=o==="ParenthesizedExpression"):[d,m]=c;let A=o==="ArrayPattern"||o==="ObjectPattern"?{type:o}:s,C=t[d];if(Array.isArray(C))for(let w of C)w&&this.checkLVal(w,A,e,r,i,m,!0);else C&&this.checkLVal(C,A,e,r,i,m,n)}checkIdentifier(t,s,e=!1){this.state.strict&&(e?Ot(t.name,this.inModule):Bt(t.name))&&(s===64?this.raise(u.StrictEvalArguments,t,{referenceName:t.name}):this.raise(u.StrictEvalArgumentsBinding,t,{bindingName:t.name})),s&8192&&t.name==="let"&&this.raise(u.LetInLexicalBinding,t),s&64||this.declareNameFromIdentifier(t,s)}declareNameFromIdentifier(t,s){this.scope.declareName(t.name,s,t.loc.start)}checkToRestConversion(t,s){switch(t.type){case"ParenthesizedExpression":this.checkToRestConversion(t.expression,s);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(s)break;default:this.raise(u.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(12)?(this.raise(this.lookaheadCharCode()===t?u.RestTrailingComma:u.ElementAfterRest,this.state.startLoc),!0):!1}},Ce=/in(?:stanceof)?|as|satisfies/y;function wr(t){if(t==null)throw new Error(`Unexpected ${t} value.`);return t}function ht(t){if(!t)throw new Error("Assert fail")}var x=M`typescript`({AbstractMethodHasImplementation:({methodName:t})=>`Method '${t}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:t})=>`Property '${t}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:t})=>`'declare' is not allowed in ${t}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:t})=>`Accessibility modifier already seen: '${t}'.`,DuplicateModifier:({modifier:t})=>`Duplicate modifier: '${t}'.`,EmptyHeritageClauseType:({token:t})=>`'${t}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:t})=>`'${t[0]}' modifier cannot be used with '${t[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:t})=>`Index signatures cannot have an accessibility modifier ('${t}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidHeritageClauseType:({token:t})=>`'${t}' list can only include identifiers or qualified-names with optional type arguments.`,InvalidModifierOnAwaitUsingDeclaration:t=>`'${t}' modifier cannot appear on an await using declaration.`,InvalidModifierOnTypeMember:({modifier:t})=>`'${t}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:t})=>`'${t}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:t})=>`'${t}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifierOnUsingDeclaration:t=>`'${t}' modifier cannot appear on a using declaration.`,InvalidModifiersOrder:({orderedModifiers:t})=>`'${t[0]}' modifier must precede '${t[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifier:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:t})=>`Private elements cannot have an accessibility modifier ('${t}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:t})=>`Single type parameter ${t} should have a trailing comma. Example usage: <${t},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:t})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${t}.`,UsingDeclarationInAmbientContext:t=>`'${t}' declarations are not allowed in ambient contexts.`});function Ir(t){switch(t){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function pt(t){return t==="private"||t==="public"||t==="protected"}function Nr(t){return t==="in"||t==="out"}function Me(t){var s;if((s=t.extra)!=null&&s.parenthesized)return!1;switch(t.type){case"Identifier":return!0;case"MemberExpression":return!t.computed&&Me(t.object);case"TSInstantiationExpression":return Me(t.expression);default:return!1}}var kr=t=>class extends t{constructor(){super(...arguments);f(this,"tsParseInOutModifiers",this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:x.InvalidModifierOnTypeParameter}));f(this,"tsParseConstModifier",this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:x.InvalidModifierOnTypeParameterPositions}));f(this,"tsParseInOutConstModifiers",this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:x.InvalidModifierOnTypeParameter}))}getScopeHandler(){return ar}tsIsIdentifier(){return S(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(139)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,r,i){if(!S(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let a=this.state.value;if(e.includes(a)){if(i&&this.match(106)||r&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return a}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:r,stopOnStartOfClassStaticBlock:i,errorTemplate:a=x.InvalidModifierOnTypeMember},n){let o=(h,c,d,m)=>{c===d&&n[m]&&this.raise(x.InvalidModifiersOrder,h,{orderedModifiers:[d,m]})},l=(h,c,d,m)=>{(n[d]&&c===m||n[m]&&c===d)&&this.raise(x.IncompatibleModifiers,h,{modifiers:[d,m]})};for(;;){let{startLoc:h}=this.state,c=this.tsParseModifier(e.concat(r??[]),i,n.static);if(!c)break;pt(c)?n.accessibility?this.raise(x.DuplicateAccessibilityModifier,h,{modifier:c}):(o(h,c,c,"override"),o(h,c,c,"static"),o(h,c,c,"readonly"),n.accessibility=c):Nr(c)?(n[c]&&this.raise(x.DuplicateModifier,h,{modifier:c}),n[c]=!0,o(h,c,"in","out")):(Object.prototype.hasOwnProperty.call(n,c)?this.raise(x.DuplicateModifier,h,{modifier:c}):(o(h,c,"static","readonly"),o(h,c,"static","override"),o(h,c,"override","readonly"),o(h,c,"abstract","override"),l(h,c,"declare","override"),l(h,c,"static","abstract")),n[c]=!0),r!=null&&r.includes(c)&&this.raise(a,h,{modifier:c})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,r){let i=[];for(;!this.tsIsListTerminator(e);)i.push(r());return i}tsParseDelimitedList(e,r,i){return wr(this.tsParseDelimitedListWorker(e,r,!0,i))}tsParseDelimitedListWorker(e,r,i,a){let n=[],o=-1;for(;!this.tsIsListTerminator(e);){o=-1;let l=r();if(l==null)return;if(n.push(l),this.eat(12)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;i&&this.expect(12);return}return a&&(a.value=o),n}tsParseBracketedList(e,r,i,a,n){a||(i?this.expect(0):this.expect(47));let o=this.tsParseDelimitedList(e,r,n);return i?this.expect(3):this.expect(48),o}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(134)?e.argument=this.tsParseLiteralTypeNode():(this.raise(x.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=this.tsParseNonConditionalType()),this.eat(12)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName(3)),this.match(47)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseImportTypeOptions(){let e=this.startNode();this.expect(5);let r=this.startNode();return this.isContextual(76)?(r.method=!1,r.key=this.parseIdentifier(!0),r.computed=!1,r.shorthand=!1):this.unexpected(null,76),this.expect(14),r.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(r)],this.eat(12),this.expect(8),this.finishNode(e,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),r=[];for(this.expect(5);!this.match(8);){let i=this.state.type;S(i)||i===134?r.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(12)}return e.properties=r,this.next(),this.finishNode(e,"ObjectExpression")}tsParseEntityName(e){let r;if(e&1&&this.match(78))if(e&2)r=this.parseIdentifier(!0);else{let i=this.startNode();this.next(),r=this.finishNode(i,"ThisExpression")}else r=this.parseIdentifier(!!(e&1));for(;this.eat(16);){let i=this.startNodeAtNode(r);i.left=r,i.right=this.parseIdentifier(!!(e&1)),r=this.finishNode(i,"TSQualifiedName")}return r}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let r=this.startNodeAtNode(e);return r.parameterName=e,r.typeAnnotation=this.tsParseTypeAnnotation(!1),r.asserts=!1,this.finishNode(r,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let r=this.startNode();return e(r),r.name=this.tsParseTypeParameterName(),r.constraint=this.tsEatThenParseType(81),r.default=this.tsEatThenParseType(29),this.finishNode(r,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let r=this.startNode();this.match(47)||this.match(143)?this.next():this.unexpected();let i={value:-1};return r.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,i),r.params.length===0&&this.raise(x.EmptyTypeParameters,r),i.value!==-1&&this.addExtra(r,"trailingComma",i.value),this.finishNode(r,"TSTypeParameterDeclaration")}tsFillSignature(e,r){let i=e===19,a="params",n="returnType";r.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),r[a]=this.tsParseBindingListForSignature(),i?r[n]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(r[n]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let r of e){let{type:i}=r;(i==="AssignmentPattern"||i==="TSParameterProperty")&&this.raise(x.UnsupportedSignatureParameterKind,r,{type:i})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,r){return this.tsFillSignature(14,r),this.tsParseTypeMemberSemicolon(),this.finishNode(r,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),S(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let r=this.parseIdentifier();r.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(r),this.expect(3),e.parameters=[r];let i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,r){if(this.eat(17)&&(e.optional=!0),this.match(10)||this.match(47)){r&&this.raise(x.ReadonlyForMethodSignature,e);let i=e;i.kind&&this.match(47)&&this.raise(x.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon();let a="params",n="returnType";if(i.kind==="get")i[a].length>0&&(this.raise(u.BadGetterArity,this.state.curPosition()),this.isThisParam(i[a][0])&&this.raise(x.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(i.kind==="set"){if(i[a].length!==1)this.raise(u.BadSetterArity,this.state.curPosition());else{let o=i[a][0];this.isThisParam(o)&&this.raise(x.AccessorCannotDeclareThisParameter,this.state.curPosition()),o.type==="Identifier"&&o.optional&&this.raise(x.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),o.type==="RestElement"&&this.raise(x.SetAccessorCannotHaveRestParameter,this.state.curPosition())}i[n]&&this.raise(x.SetAccessorCannotHaveReturnType,i[n])}else i.kind="method";return this.finishNode(i,"TSMethodSignature")}else{let i=e;r&&(i.readonly=!0);let a=this.tsTryParseTypeAnnotation();return a&&(i.typeAnnotation=a),this.tsParseTypeMemberSemicolon(),this.finishNode(i,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let i=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(i,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}return this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e),this.tsTryParseIndexSignature(e)||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e),!this.match(10)&&!this.match(47)&&this.unexpected(null,10)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();return this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0),e.key=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(58),e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let r=!1;return e.elementTypes.forEach(i=>{let{type:a}=i;r&&a!=="TSRestType"&&a!=="TSOptionalType"&&!(a==="TSNamedTupleMember"&&i.optional)&&this.raise(x.OptionalTypeBeforeRequired,i),r||(r=a==="TSNamedTupleMember"&&i.optional||a==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,r=this.eat(21),{startLoc:i}=this.state,a,n,o,l,h=L(this.state.type)?this.lookaheadCharCode():null;if(h===58)a=!0,o=!1,n=this.parseIdentifier(!0),this.expect(14),l=this.tsParseType();else if(h===63){o=!0;let c=this.state.value,d=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(a=!0,n=this.createIdentifier(this.startNodeAt(i),c),this.expect(17),this.expect(14),l=this.tsParseType()):(a=!1,l=d,this.expect(17))}else l=this.tsParseType(),o=this.eat(17),a=this.eat(14);if(a){let c;n?(c=this.startNodeAt(i),c.optional=o,c.label=n,c.elementType=l,this.eat(17)&&(c.optional=!0,this.raise(x.TupleOptionalAfterType,this.state.lastTokStartLoc))):(c=this.startNodeAt(i),c.optional=o,this.raise(x.InvalidTupleMemberLabel,l),c.label=l,c.elementType=this.tsParseType()),l=this.finishNode(c,"TSNamedTupleMember")}else if(o){let c=this.startNodeAt(i);c.typeAnnotation=l,l=this.finishNode(c,"TSOptionalType")}if(r){let c=this.startNodeAt(e);c.typeAnnotation=l,l=this.finishNode(c,"TSRestType")}return l}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,r){let i=this.startNode();return e==="TSConstructorType"&&(i.abstract=!!r,r&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,i)),this.finishNode(i,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 135:case 136:case 134:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){{let e=this.state.startLoc,r=this.parseTemplateElement(!1),i=[r];if(r.tail){let a=this.startNodeAt(e),n=this.startNodeAt(e);return n.expressions=[],n.quasis=i,a.literal=this.finishNode(n,"TemplateLiteral"),this.finishNode(a,"TSLiteralType")}else{let a=[];for(;!r.tail;)a.push(this.tsParseType()),this.readTemplateContinuation(),i.push(r=this.parseTemplateElement(!1));let n=this.startNodeAt(e);return n.types=a,n.quasis=i,this.finishNode(n,"TSTemplateLiteralType")}}}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 134:case 135:case 136:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),r=this.lookahead();return r.type!==135&&r.type!==136&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:if(!(this.optionFlags&1024)){let e=this.state.startLoc;this.next();let r=this.tsParseType();return this.expect(11),this.addExtra(r,"parenthesized",!0),this.addExtra(r,"parenStart",e.index),r}return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(S(e)||e===88||e===84){let r=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":Ir(this.state.value);if(r!==void 0&&this.lookaheadCharCode()!==46){let i=this.startNode();return this.next(),this.finishNode(i,r)}return this.tsParseTypeReference()}}}throw this.unexpected()}tsParseArrayTypeOrHigher(){let{startLoc:e}=this.state,r=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let i=this.startNodeAt(e);i.elementType=r,this.expect(3),r=this.finishNode(i,"TSArrayType")}else{let i=this.startNodeAt(e);i.objectType=r,i.indexType=this.tsParseType(),this.expect(3),r=this.finishNode(i,"TSIndexedAccessType")}return r}tsParseTypeOperator(){let e=this.startNode(),r=this.state.value;return this.next(),e.operator=r,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),r==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(x.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let r=this.startNode();return r.name=this.tsParseTypeParameterName(),r.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(r,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return Ms(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,r,i){let a=this.startNode(),n=this.eat(i),o=[];do o.push(r());while(this.eat(i));return o.length===1&&!n?o[0]:(a.types=o,this.finishNode(a,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(S(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,r=e.length;try{return this.parseObjectLike(8,!0),e.length===r}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,r=e.length;try{return super.parseBindingList(3,93,1),e.length===r}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let r=this.startNode();this.expect(e);let i=this.startNode(),a=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(a&&this.match(78)){let l=this.tsParseThisTypeOrThisTypePredicate();return l.type==="TSThisType"?(i.parameterName=l,i.asserts=!0,i.typeAnnotation=null,l=this.finishNode(i,"TSTypePredicate")):(this.resetStartLocationFromNode(l,i),l.asserts=!0),r.typeAnnotation=l,this.finishNode(r,"TSTypeAnnotation")}let n=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!n)return a?(i.parameterName=this.parseIdentifier(),i.asserts=a,i.typeAnnotation=null,r.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(r,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,r);let o=this.tsParseTypeAnnotation(!1);return i.parameterName=n,i.typeAnnotation=o,i.asserts=a,r.typeAnnotation=this.finishNode(i,"TSTypePredicate"),this.finishNode(r,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!S(this.state.type)&&!this.match(78)?!1:(e&&this.raise(u.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,r=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),r.typeAnnotation=this.tsParseType()}),this.finishNode(r,"TSTypeAnnotation")}tsParseType(){ht(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let r=this.startNodeAtNode(e);return r.checkType=e,r.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),r.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),r.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(r,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(x.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let r=this.state.startLoc,i=this.tsParseDelimitedList("HeritageClauseElement",()=>{{let a=super.parseExprSubscripts();Me(a)||this.raise(x.InvalidHeritageClauseType,a.loc.start,{token:e});let n=e==="extends"?"TSInterfaceHeritage":"TSClassImplements";if(a.type==="TSInstantiationExpression")return a.type=n,a;let o=this.startNodeAtNode(a);return o.expression=a,(this.match(47)||this.match(51))&&(o.typeArguments=this.tsParseTypeArgumentsInExpression()),this.finishNode(o,n)}});return i.length||this.raise(x.EmptyHeritageClauseType,r,{token:e}),i}tsParseInterfaceDeclaration(e,r={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),r.declare&&(e.declare=!0),S(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(x.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let i=this.startNode();return i.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(i,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookaheadCharCode()!==46){let r=this.startNode();return this.next(),this.finishNode(r,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInTopLevelContext(e){if(this.curContext()!==I.brace){let r=this.state.context;this.state.context=[r[0]];try{return e()}finally{this.state.context=r}}else return e()}tsInType(e){let r=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=r}}tsInDisallowConditionalTypesContext(e){let r=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=r}}tsInAllowConditionalTypesContext(e){let r=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=r}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(134)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,r={}){return r.const&&(e.const=!0),r.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),e.body=this.tsParseEnumBody(),this.finishNode(e,"TSEnumDeclaration")}tsParseEnumBody(){let e=this.startNode();return this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,r=!1){return e.id=this.tsParseEntityName(1),e.id.type==="Identifier"&&this.checkIdentifier(e.id,1024),this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.kind="global",e.id=this.parseIdentifier()):this.match(134)?(e.kind="module",e.id=super.parseStringLiteral(this.state.value)):this.unexpected(),this.match(5)?(this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,r,i){e.id=r||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let a=this.tsParseModuleReference();return e.importKind==="type"&&a.type!=="TSExternalModuleReference"&&this.raise(x.ImportAliasHasImportType,a),e.moduleReference=a,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(134)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let r=this.state.clone(),i=e();return this.state=r,i}tsTryParseAndCatch(e){let r=this.tryParse(i=>e()||i());if(!(r.aborted||!r.node))return r.error&&(this.state=r.failState),r.node}tsTryParse(e){let r=this.state.clone(),i=e();if(i!==void 0&&i!==!1)return i;this.state=r}tsTryParseDeclare(e){if(this.isLineTerminator())return;let r=this.state.type;return this.tsInAmbientContext(()=>{switch(r){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 100:if(this.state.containsEsc)return;case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 107:if(this.isUsing())return this.raise(x.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.parseVarStatement(e,"using",!0);break;case 96:if(this.isAwaitUsing())return this.raise(x.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.next(),this.parseVarStatement(e,"await using",!0);break;case 129:{let i=this.tsParseInterfaceDeclaration(e,{declare:!0});if(i)return i}default:if(S(r))return this.tsParseDeclaration(e,this.state.type,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.type,!0,null)}tsParseDeclaration(e,r,i,a){switch(r){case 124:if(this.tsCheckLineTerminator(i)&&(this.match(80)||S(this.state.type)))return this.tsParseAbstractDeclaration(e,a);break;case 127:if(this.tsCheckLineTerminator(i)){if(this.match(134))return this.tsParseAmbientExternalModuleDeclaration(e);if(S(this.state.type))return e.kind="module",this.tsParseModuleOrNamespaceDeclaration(e)}break;case 128:if(this.tsCheckLineTerminator(i)&&S(this.state.type))return e.kind="namespace",this.tsParseModuleOrNamespaceDeclaration(e);break;case 130:if(this.tsCheckLineTerminator(i)&&S(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let r=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let i=this.tsTryParseAndCatch(()=>{let a=this.startNodeAt(e);return a.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(a),a.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),a});if(this.state.maybeInArrowParameters=r,!!i)return super.parseArrowExpression(i,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(x.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===I.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Bs(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,r){let i=r.length?r[0].loc.start:this.state.startLoc,a={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},a);let n=a.accessibility,o=a.override,l=a.readonly;!(e&4)&&(n||l||o)&&this.raise(x.UnexpectedParameterModifier,i);let h=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(h);let c=this.parseMaybeDefault(h.loc.start,h);if(n||l||o){let d=this.startNodeAt(i);return r.length&&(d.decorators=r),n&&(d.accessibility=n),l&&(d.readonly=l),o&&(d.override=o),c.type!=="Identifier"&&c.type!=="AssignmentPattern"&&this.raise(x.UnsupportedParameterPropertyKind,d),d.parameter=c,this.finishNode(d,"TSParameterProperty")}return r.length&&(h.decorators=r),c}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let r of e.params)r.type!=="Identifier"&&r.optional&&!this.state.isAmbientContext&&this.raise(x.PatternIsOptional,r)}setArrowFunctionParameters(e,r,i){super.setArrowFunctionParameters(e,r,i),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,r,i=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let a=r==="FunctionDeclaration"?"TSDeclareFunction":r==="ClassMethod"||r==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return a&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,a):a==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(x.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,a,i):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,r,i))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(r=>{(r==null?void 0:r.type)==="TSTypeCastExpression"&&this.raise(x.UnexpectedTypeAnnotation,r.typeAnnotation)})}toReferencedList(e,r){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,r,i){let a=super.parseArrayLike(e,r,i);return a.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(a.elements),a}parseSubscript(e,r,i,a){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let o=this.startNodeAt(r);return o.expression=e,this.finishNode(o,"TSNonNullExpression")}let n=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(i)return a.stop=!0,e;a.optionalChainMember=n=!0,this.next()}if(this.match(47)||this.match(51)){let o,l=this.tsTryParseAndCatch(()=>{if(!i&&this.atPossibleAsyncArrow(e)){let m=this.tsTryParseGenericAsyncArrowFunction(r);if(m)return a.stop=!0,m}let h=this.tsParseTypeArgumentsInExpression();if(!h)return;if(n&&!this.match(10)){o=this.state.curPosition();return}if(ke(this.state.type)){let m=super.parseTaggedTemplateExpression(e,r,a);return m.typeArguments=h,m}if(!i&&this.eat(10)){let m=this.startNodeAt(r);return m.callee=e,m.arguments=this.parseCallExpressionArguments(),this.tsCheckForInvalidTypeCasts(m.arguments),m.typeArguments=h,a.optionalChainMember&&(m.optional=n),this.finishCallExpression(m,a.optionalChainMember)}let c=this.state.type;if(c===48||c===52||c!==10&&re(c)&&!this.hasPrecedingLineBreak())return;let d=this.startNodeAt(r);return d.expression=e,d.typeArguments=h,this.finishNode(d,"TSInstantiationExpression")});if(o&&this.unexpected(o,10),l)return l.type==="TSInstantiationExpression"&&((this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(x.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(16)&&!this.match(18)&&(l.expression=super.stopParseSubscript(e,a))),l}return super.parseSubscript(e,r,i,a)}parseNewCallee(e){var i;super.parseNewCallee(e);let{callee:r}=e;r.type==="TSInstantiationExpression"&&!((i=r.extra)!=null&&i.parenthesized)&&(e.typeArguments=r.typeArguments,e.callee=r.expression)}parseExprOp(e,r,i){let a;if(me(58)>i&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(a=this.isContextual(120)))){let n=this.startNodeAt(r);return n.expression=e,n.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(a&&this.raise(u.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(n,a?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(n,r,i)}return super.parseExprOp(e,r,i)}checkReservedWord(e,r,i,a){this.state.isAmbientContext||super.checkReservedWord(e,r,i,a)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(x.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let r=this.lookaheadCharCode();return e?r===123||r===42:r!==61}return!e&&this.isContextual(87)}applyImportPhase(e,r,i,a){super.applyImportPhase(e,r,i,a),r?e.exportKind=i==="type"?"type":"value":e.importKind=i==="type"||i==="typeof"?i:"value"}parseImport(e){if(this.match(134))return e.importKind="value",super.parseImport(e);let r;if(S(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let i=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,i);r=super.parseImportSpecifiersAndAfter(e,i)}else r=super.parseImport(e);return r.importKind==="type"&&r.specifiers.length>1&&r.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(x.TypeImportCannotSpecifyDefaultAndNamed,r),r}parseExport(e,r){if(this.match(83)){let i=this.startNode();this.next();let a=null;this.isContextual(130)&&this.isPotentialImportPhase(!1)?a=this.parseMaybeImportPhase(i,!1):i.importKind="value";let n=this.tsParseImportEqualsDeclaration(i,a,!0);return e.attributes=[],e.declaration=n,e.exportKind="value",e.source=null,e.specifiers=[],this.finishNode(e,"ExportNamedDeclaration")}else if(this.eat(29)){let i=e;return i.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(i,"TSExportAssignment")}else if(this.eatContextual(93)){let i=e;return this.expectContextual(128),i.id=this.parseIdentifier(),this.semicolon(),this.finishNode(i,"TSNamespaceExportDeclaration")}else return super.parseExport(e,r)}isAbstractClass(){return this.isContextual(124)&&this.isLookaheadContextual("class")}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,r,i=!1){let{isAmbientContext:a}=this.state,n=super.parseVarStatement(e,r,i||a);if(!a)return n;if(!e.declare&&(r==="using"||r==="await using"))return this.raiseOverwrite(x.UsingDeclarationInAmbientContext,e,r),n;for(let{id:o,init:l}of n.declarations)l&&(r==="var"||r==="let"||o.typeAnnotation?this.raise(x.InitializerNotAllowedInAmbientContext,l):Dr(l,this.hasPlugin("estree"))||this.raise(x.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l));return n}parseStatementContent(e,r){if(!this.state.containsEsc)switch(this.state.type){case 75:{if(this.isLookaheadContextual("enum")){let i=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(i,{const:!0})}break}case 124:case 125:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let i=this.state.type,a=this.startNode();this.next();let n=i===125?this.tsTryParseDeclare(a):this.tsParseAbstractDeclaration(a,r);return n?(i===125&&(n.declare=!0),n):(a.expression=this.createIdentifier(this.startNodeAt(a.loc.start),i===125?"declare":"abstract"),this.semicolon(!1),this.finishNode(a,"ExpressionStatement"))}break}case 126:return this.tsParseEnumDeclaration(this.startNode());case 112:{if(this.lookaheadCharCode()===123){let i=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(i)}break}case 129:{let i=this.tsParseInterfaceDeclaration(this.startNode());if(i)return i;break}case 127:{if(this.nextTokenIsIdentifierOrStringLiteralOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,127,!1,r)}break}case 128:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return this.next(),this.tsParseDeclaration(i,128,!1,r)}break}case 130:{if(this.nextTokenIsIdentifierOnSameLine()){let i=this.startNode();return this.next(),this.tsParseTypeAliasDeclaration(i)}break}}return super.parseStatementContent(e,r)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,r){return r.some(i=>pt(i)?e.accessibility===i:!!e[i])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,r,i){let a=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:a,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:x.InvalidModifierOnTypeParameterPositions},r);let n=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(r,a)&&this.raise(x.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,r)):this.parseClassMemberWithIsStatic(e,r,i,!!r.static)};r.declare?this.tsInAmbientContext(n):n()}parseClassMemberWithIsStatic(e,r,i,a){let n=this.tsTryParseIndexSignature(r);if(n){e.body.push(n),r.abstract&&this.raise(x.IndexSignatureHasAbstract,r),r.accessibility&&this.raise(x.IndexSignatureHasAccessibility,r,{modifier:r.accessibility}),r.declare&&this.raise(x.IndexSignatureHasDeclare,r),r.override&&this.raise(x.IndexSignatureHasOverride,r);return}!this.state.inAbstractClass&&r.abstract&&this.raise(x.NonAbstractClassHasAbstractMethod,r),r.override&&(i.hadSuperClass||this.raise(x.OverrideNotInSubClass,r)),super.parseClassMemberWithIsStatic(e,r,i,a)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(x.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(x.ClassMethodHasDeclare,e)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,r,i){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let a=this.lookaheadCharCode();if(a===44||a===61||a===58||a===41)return this.setOptionalParametersError(i),e}return super.parseConditional(e,r,i)}parseParenItem(e,r){let i=super.parseParenItem(e,r);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(e)),this.match(14)){let a=this.startNodeAt(r);return a.expression=e,a.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(a,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let r=this.state.startLoc,i=this.eatContextual(125);if(i&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(x.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let a=S(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return a?((a.type==="TSInterfaceDeclaration"||a.type==="TSTypeAliasDeclaration"||i)&&(e.exportKind="type"),i&&a.type!=="TSImportEqualsDeclaration"&&(this.resetStartLocation(a,r),a.declare=!0),a):null}parseClassId(e,r,i,a){if((!r||i)&&this.isContextual(113))return;super.parseClassId(e,r,i,e.declare?1024:8331);let n=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);n&&(e.typeParameters=n)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let r=this.tsTryParseTypeAnnotation();r&&(e.typeAnnotation=r)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(x.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:r}=e;this.raise(x.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:r.type==="Identifier"&&!e.computed?r.name:`[${this.input.slice(this.offsetToSourcePos(r.start),this.offsetToSourcePos(r.end))}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(x.PrivateElementHasAbstract,e),e.accessibility&&this.raise(x.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(x.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,r,i,a,n,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&n&&this.raise(x.ConstructorHasTypeParameters,l);let{declare:h=!1,kind:c}=r;h&&(c==="get"||c==="set")&&this.raise(x.DeclareAccessor,r,{kind:c}),l&&(r.typeParameters=l),super.pushClassMethod(e,r,i,a,n,o)}pushClassPrivateMethod(e,r,i,a){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(r.typeParameters=n),super.pushClassPrivateMethod(e,r,i,a)}declareClassPrivateMethodInScope(e,r){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&e.value.body==null||super.declareClassPrivateMethodInScope(e,r))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeArguments=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,r,i,a,n,o,l){let h=this.tsTryParseTypeParameters(this.tsParseConstModifier);return h&&(e.typeParameters=h),super.parseObjPropValue(e,r,i,a,n,o,l)}parseFunctionParams(e,r){let i=this.tsTryParseTypeParameters(this.tsParseConstModifier);i&&(e.typeParameters=i),super.parseFunctionParams(e,r)}parseVarId(e,r){super.parseVarId(e,r),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let i=this.tsTryParseTypeAnnotation();i&&(e.id.typeAnnotation=i,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,r){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,r)}parseMaybeAssign(e,r){let i,a,n;if(this.hasPlugin("jsx")&&(this.match(143)||this.match(47))){if(i=this.state.clone(),a=this.tryParse(()=>super.parseMaybeAssign(e,r),i),!a.error)return a.node;let{context:h}=this.state,c=h[h.length-1];(c===I.j_oTag||c===I.j_expr)&&h.pop()}if(!(a!=null&&a.error)&&!this.match(47))return super.parseMaybeAssign(e,r);(!i||i===this.state)&&(i=this.state.clone());let o,l=this.tryParse(h=>{var d,m;o=this.tsParseTypeParameters(this.tsParseConstModifier);let c=super.parseMaybeAssign(e,r);if((c.type!=="ArrowFunctionExpression"||(d=c.extra)!=null&&d.parenthesized)&&h(),(o==null?void 0:o.params.length)!==0&&this.resetStartLocationFromNode(c,o),c.typeParameters=o,this.hasPlugin("jsx")&&c.typeParameters.params.length===1&&!((m=c.typeParameters.extra)!=null&&m.trailingComma)){let A=c.typeParameters.params[0];A.constraint||this.raise(x.SingleTypeParameterWithoutTrailingComma,D(A.loc.end,1),{typeParameterName:A.name.name})}return c},i);if(!l.error&&!l.aborted)return o&&this.reportReservedArrowTypeParam(o),l.node;if(!a&&(ht(!this.hasPlugin("jsx")),n=this.tryParse(()=>super.parseMaybeAssign(e,r),i),!n.error))return n.node;if(a!=null&&a.node)return this.state=a.failState,a.node;if(l.node)return this.state=l.failState,o&&this.reportReservedArrowTypeParam(o),l.node;if(n!=null&&n.node)return this.state=n.failState,n.node;throw(a==null?void 0:a.error)||l.error||(n==null?void 0:n.error)}reportReservedArrowTypeParam(e){var r;e.params.length===1&&!e.params[0].constraint&&!((r=e.extra)!=null&&r.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(x.ReservedArrowTypeParam,e)}parseMaybeUnary(e,r){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,r)}parseArrow(e){if(this.match(14)){let r=this.tryParse(i=>{let a=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&i(),a});if(r.aborted)return;r.thrown||(r.error&&(this.state=r.failState),e.returnType=r.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r),this.resetEndLocation(e),e}isAssignable(e,r){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,r);case"TSParameterProperty":return!0;default:return super.isAssignable(e,r)}}toAssignable(e,r=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,r);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":r?this.expressionScope.recordArrowParameterBindingError(x.UnexpectedTypeCastInParameter,e):this.raise(x.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,r);break;case"AssignmentExpression":!r&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,r)}}toAssignableParenthesizedExpression(e,r){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,r);break;default:super.toAssignable(e,r)}}checkToRestConversion(e,r){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,r)}}isValidLVal(e,r,i,a){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(a!==64||!i)&&["expression",!0];default:return super.isValidLVal(e,r,i,a)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,r){if(this.match(47)||this.match(51)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let a=super.parseMaybeDecoratorArguments(e,r);return a.typeArguments=i,a}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e,r)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,r){let i=super.parseMaybeDefault(e,r);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(x.TypeAnnotationAfterAssign,i.typeAnnotation),i}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(48,1);return}if(e===60){this.finishOp(47,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}toAssignableListItem(e,r,i){let a=e[r];a.type==="TSTypeCastExpression"&&(e[r]=this.typeCastToParameter(a)),super.toAssignableListItem(e,r,i)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}shouldParseArrow(e){return this.match(14)?e.every(r=>this.isAssignable(r,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let r=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());r&&(e.typeArguments=r)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let r=super.getGetterSetterExpectedParamCount(e),i=this.getObjectOrClassMethodParams(e)[0];return i&&this.isThisParam(i)?r+1:r}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),r=this.tsTryParseTypeAnnotation();return r&&(e.typeAnnotation=r,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:r,strict:i}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=r,this.state.strict=i}}parseClass(e,r,i){let a=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,r,i)}finally{this.state.inAbstractClass=a}}tsParseAbstractDeclaration(e,r){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(r,this.parseClass(e,!0,!1));if(this.isContextual(129))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(x.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e));throw this.unexpected(null,80)}parseMethod(e,r,i,a,n,o,l){let h=super.parseMethod(e,r,i,a,n,o,l);if((h.abstract||h.type==="TSAbstractMethodDefinition")&&(this.hasPlugin("estree")?h.value:h).body){let{key:c}=h;this.raise(x.AbstractMethodHasImplementation,h,{methodName:c.type==="Identifier"&&!h.computed?c.name:`[${this.input.slice(this.offsetToSourcePos(c.start),this.offsetToSourcePos(c.end))}]`})}return h}tsParseTypeParameterName(){return this.parseIdentifier()}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,r,i,a){return!r&&a?(this.parseTypeOnlyImportExportSpecifier(e,!1,i),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,r,i,a))}parseImportSpecifier(e,r,i,a,n){return!r&&a?(this.parseTypeOnlyImportExportSpecifier(e,!0,i),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,r,i,a,i?4098:4096))}parseTypeOnlyImportExportSpecifier(e,r,i){let a=r?"imported":"local",n=r?"local":"exported",o=e[a],l,h=!1,c=!0,d=o.loc.start;if(this.isContextual(93)){let A=this.parseIdentifier();if(this.isContextual(93)){let C=this.parseIdentifier();L(this.state.type)?(h=!0,o=A,l=r?this.parseIdentifier():this.parseModuleExportName(),c=!1):(l=C,c=!1)}else L(this.state.type)?(c=!1,l=r?this.parseIdentifier():this.parseModuleExportName()):(h=!0,o=A)}else L(this.state.type)&&(h=!0,r?(o=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(o.name,o.loc.start,!0,!0)):o=this.parseModuleExportName());h&&i&&this.raise(r?x.TypeModifierIsUsedInTypeImports:x.TypeModifierIsUsedInTypeExports,d),e[a]=o,e[n]=l;let m=r?"importKind":"exportKind";e[m]=h?"type":"value",c&&this.eatContextual(93)&&(e[n]=r?this.parseIdentifier():this.parseModuleExportName()),e[n]||(e[n]=this.cloneIdentifier(e[a])),r&&this.checkIdentifier(e[n],h?4098:4096)}fillOptionalPropertiesForTSESLint(e){switch(e.type){case"ExpressionStatement":e.directive??(e.directive=void 0);return;case"RestElement":e.value=void 0;case"Identifier":case"ArrayPattern":case"AssignmentPattern":case"ObjectPattern":e.decorators??(e.decorators=[]),e.optional??(e.optional=!1),e.typeAnnotation??(e.typeAnnotation=void 0);return;case"TSParameterProperty":e.accessibility??(e.accessibility=void 0),e.decorators??(e.decorators=[]),e.override??(e.override=!1),e.readonly??(e.readonly=!1),e.static??(e.static=!1);return;case"TSEmptyBodyFunctionExpression":e.body=null;case"TSDeclareFunction":case"FunctionDeclaration":case"FunctionExpression":case"ClassMethod":case"ClassPrivateMethod":e.declare??(e.declare=!1),e.returnType??(e.returnType=void 0),e.typeParameters??(e.typeParameters=void 0);return;case"Property":e.optional??(e.optional=!1);return;case"TSMethodSignature":case"TSPropertySignature":e.optional??(e.optional=!1);case"TSIndexSignature":e.accessibility??(e.accessibility=void 0),e.readonly??(e.readonly=!1),e.static??(e.static=!1);return;case"TSAbstractPropertyDefinition":case"PropertyDefinition":case"TSAbstractAccessorProperty":case"AccessorProperty":e.declare??(e.declare=!1),e.definite??(e.definite=!1),e.readonly??(e.readonly=!1),e.typeAnnotation??(e.typeAnnotation=void 0);case"TSAbstractMethodDefinition":case"MethodDefinition":e.accessibility??(e.accessibility=void 0),e.decorators??(e.decorators=[]),e.override??(e.override=!1),e.optional??(e.optional=!1);return;case"ClassExpression":e.id??(e.id=null);case"ClassDeclaration":e.abstract??(e.abstract=!1),e.declare??(e.declare=!1),e.decorators??(e.decorators=[]),e.implements??(e.implements=[]),e.superTypeArguments??(e.superTypeArguments=void 0),e.typeParameters??(e.typeParameters=void 0);return;case"TSTypeAliasDeclaration":case"VariableDeclaration":e.declare??(e.declare=!1);return;case"VariableDeclarator":e.definite??(e.definite=!1);return;case"TSEnumDeclaration":e.const??(e.const=!1),e.declare??(e.declare=!1);return;case"TSEnumMember":e.computed??(e.computed=!1);return;case"TSImportType":e.qualifier??(e.qualifier=null),e.options??(e.options=null),e.typeArguments??(e.typeArguments=null);return;case"TSInterfaceDeclaration":e.declare??(e.declare=!1),e.extends??(e.extends=[]);return;case"TSMappedType":e.optional??(e.optional=!1),e.readonly??(e.readonly=void 0);return;case"TSModuleDeclaration":e.declare??(e.declare=!1),e.global??(e.global=e.kind==="global");return;case"TSTypeParameter":e.const??(e.const=!1),e.in??(e.in=!1),e.out??(e.out=!1);return}}chStartsBindingIdentifierAndNotRelationalOperator(e,r){if(B(e)){if(Ce.lastIndex=r,Ce.test(this.input)){let i=this.codePointAtPos(Ce.lastIndex);if(!K(i)&&i!==92)return!1}return!0}else return e===92}nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine(){let e=this.nextTokenInLineStart(),r=this.codePointAtPos(e);return this.chStartsBindingIdentifierAndNotRelationalOperator(r,e)}nextTokenIsIdentifierOrStringLiteralOnSameLine(){let e=this.nextTokenInLineStart(),r=this.codePointAtPos(e);return this.chStartsBindingIdentifier(r,e)||r===34||r===39}};function vr(t){if(t.type!=="MemberExpression")return!1;let{computed:s,property:e}=t;return s&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:qt(t.object)}function Dr(t,s){var r;let{type:e}=t;if((r=t.extra)!=null&&r.parenthesized)return!1;if(s){if(e==="Literal"){let{value:i}=t;if(typeof i=="string"||typeof i=="boolean")return!0}}else if(e==="StringLiteral"||e==="BooleanLiteral")return!0;return!!(Ht(t,s)||Fr(t,s)||e==="TemplateLiteral"&&t.expressions.length===0||vr(t))}function Ht(t,s){return s?t.type==="Literal"&&(typeof t.value=="number"||"bigint"in t):t.type==="NumericLiteral"||t.type==="BigIntLiteral"}function Fr(t,s){if(t.type==="UnaryExpression"){let{operator:e,argument:r}=t;if(e==="-"&&Ht(r,s))return!0}return!1}function qt(t){return t.type==="Identifier"?!0:t.type!=="MemberExpression"||t.computed?!1:qt(t.object)}var ut=M`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),Lr=t=>class extends t{parsePlaceholder(s){if(this.match(133)){let e=this.startNode();return this.next(),this.assertNoSpace(),e.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(133),this.finishPlaceholder(e,s)}}finishPlaceholder(s,e){let r=s;return(!r.expectedNode||!r.type)&&(r=this.finishNode(r,"Placeholder")),r.expectedNode=e,r}getTokenFromCode(s){s===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(133,2):super.getTokenFromCode(s)}parseExprAtom(s){return this.parsePlaceholder("Expression")||super.parseExprAtom(s)}parseIdentifier(s){return this.parsePlaceholder("Identifier")||super.parseIdentifier(s)}checkReservedWord(s,e,r,i){s!==void 0&&super.checkReservedWord(s,e,r,i)}cloneIdentifier(s){let e=super.cloneIdentifier(s);return e.type==="Placeholder"&&(e.expectedNode=s.expectedNode),e}cloneStringLiteral(s){return s.type==="Placeholder"?this.cloneIdentifier(s):super.cloneStringLiteral(s)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(s,e,r,i){return s==="Placeholder"||super.isValidLVal(s,e,r,i)}toAssignable(s,e){s&&s.type==="Placeholder"&&s.expectedNode==="Expression"?s.expectedNode="Pattern":super.toAssignable(s,e)}chStartsBindingIdentifier(s,e){if(super.chStartsBindingIdentifier(s,e))return!0;let r=this.nextTokenStart();return this.input.charCodeAt(r)===37&&this.input.charCodeAt(r+1)===37}verifyBreakContinue(s,e){s.label&&s.label.type==="Placeholder"||super.verifyBreakContinue(s,e)}parseExpressionStatement(s,e){var i;if(e.type!=="Placeholder"||(i=e.extra)!=null&&i.parenthesized)return super.parseExpressionStatement(s,e);if(this.match(14)){let a=s;return a.label=this.finishPlaceholder(e,"Identifier"),this.next(),a.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(a,"LabeledStatement")}this.semicolon();let r=s;return r.name=e.name,this.finishPlaceholder(r,"Statement")}parseBlock(s,e,r){return this.parsePlaceholder("BlockStatement")||super.parseBlock(s,e,r)}parseFunctionId(s){return this.parsePlaceholder("Identifier")||super.parseFunctionId(s)}parseClass(s,e,r){let i=e?"ClassDeclaration":"ClassExpression";this.next();let a=this.state.strict,n=this.parsePlaceholder("Identifier");if(n)if(this.match(81)||this.match(133)||this.match(5))s.id=n;else{if(r||!e)return s.id=null,s.body=this.finishPlaceholder(n,"ClassBody"),this.finishNode(s,i);throw this.raise(ut.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(s,e,r);return super.parseClassSuper(s),s.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!s.superClass,a),this.finishNode(s,i)}parseExport(s,e){let r=this.parsePlaceholder("Identifier");if(!r)return super.parseExport(s,e);let i=s;if(!this.isContextual(98)&&!this.match(12))return i.specifiers=[],i.source=null,i.declaration=this.finishPlaceholder(r,"Declaration"),this.finishNode(i,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let a=this.startNode();return a.exported=r,i.specifiers=[this.finishNode(a,"ExportDefaultSpecifier")],super.parseExport(i,e)}isExportDefaultSpecifier(){if(this.match(65)){let s=this.nextTokenStart();if(this.isUnparsedContextual(s,"from")&&this.input.startsWith(q(133),this.nextTokenStartSince(s+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(s,e){var r;return(r=s.specifiers)!=null&&r.length?!0:super.maybeParseExportDefaultSpecifier(s,e)}checkExport(s){let{specifiers:e}=s;e!=null&&e.length&&(s.specifiers=e.filter(r=>r.exported.type==="Placeholder")),super.checkExport(s),s.specifiers=e}parseImport(s){let e=this.parsePlaceholder("Identifier");if(!e)return super.parseImport(s);if(s.specifiers=[],!this.isContextual(98)&&!this.match(12))return s.source=this.finishPlaceholder(e,"StringLiteral"),this.semicolon(),this.finishNode(s,"ImportDeclaration");let r=this.startNodeAtNode(e);return r.local=e,s.specifiers.push(this.finishNode(r,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(s)||this.parseNamedImportSpecifiers(s)),this.expectContextual(98),s.source=this.parseImportSource(),this.semicolon(),this.finishNode(s,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.offsetToSourcePos(this.state.lastTokEndLoc.index)&&this.raise(ut.UnexpectedSpace,this.state.lastTokEndLoc)}},Mr=t=>class extends t{parseV8Intrinsic(){if(this.match(54)){let s=this.state.startLoc,e=this.startNode();if(this.next(),S(this.state.type)){let r=this.parseIdentifierName(),i=this.createIdentifier(e,r);if(this.castNodeTo(i,"V8IntrinsicIdentifier"),this.match(10))return i}this.unexpected(s)}}parseExprAtom(s){return this.parseV8Intrinsic()||super.parseExprAtom(s)}},ct=["fsharp","hack"],dt=["^^","@@","^","%","#"];function Br(t){if(t.has("decorators")){if(t.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let s=t.get("decorators").decoratorsBeforeExport;if(s!=null&&typeof s!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let e=t.get("decorators").allowCallParenthesized;if(e!=null&&typeof e!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(t.has("flow")&&t.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(t.has("placeholders")&&t.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(t.has("pipelineOperator")){let s=t.get("pipelineOperator").proposal;if(!ct.includes(s)){let e=ct.map(r=>`"${r}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`)}if(s==="hack"){if(t.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(t.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let e=t.get("pipelineOperator").topicToken;if(!dt.includes(e)){let r=dt.map(i=>`"${i}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${r}.`)}}}if(t.has("moduleAttributes"))throw new Error("`moduleAttributes` has been removed in Babel 8, please migrate to import attributes instead.");if(t.has("importAssertions"))throw new Error("`importAssertions` has been removed in Babel 8, please use import attributes instead. To use the non-standard `assert` syntax you can enable the `deprecatedImportAssert` parser plugin.");if(!t.has("deprecatedImportAssert")&&t.has("importAttributes")&&t.get("importAttributes").deprecatedAssertSyntax)throw new Error("The 'importAttributes' plugin has been removed in Babel 8. If you need to enable support for the deprecated `assert` syntax, you can enable the `deprecatedImportAssert` parser plugin.");if(t.has("recordAndTuple"))throw new Error("The 'recordAndTuple' plugin has been removed in Babel 8. Please remove it from your configuration.");if(t.has("asyncDoExpressions")&&!t.has("doExpressions")){let s=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw s.missingPlugins="doExpressions",s}if(t.has("optionalChainingAssign")&&t.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.");if(t.has("discardBinding")&&t.get("discardBinding").syntaxType!=="void")throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.");{if(t.has("decimal"))throw new Error("The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.");if(t.has("importReflection"))throw new Error("The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.")}}var $t={estree:Cs,jsx:rr,flow:er,typescript:kr,v8intrinsic:Mr,placeholders:Lr},Or=Object.keys($t),Rr=class extends Sr{checkProto(t,s,e,r){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return e;let i=t.key;return(i.type==="Identifier"?i.name:i.value)==="__proto__"?s?(this.raise(u.RecordNoProto,i),!0):(e&&(r?r.doubleProtoLoc===null&&(r.doubleProtoLoc=i.loc.start):this.raise(u.DuplicateProto,i)),!0):e}shouldExitDescending(t,s){return t.type==="ArrowFunctionExpression"&&this.offsetToSourcePos(t.start)===s}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(140))throw this.raise(u.ParseExpressionEmptyInput,this.state.startLoc);let t=this.parseExpression();if(!this.match(140))throw this.raise(u.ParseExpressionExpectsEOF,this.state.startLoc,{unexpected:this.input.codePointAt(this.state.start)});return this.finalizeRemainingComments(),t.comments=this.comments,t.errors=this.state.errors,this.optionFlags&256&&(t.tokens=this.tokens),t}parseExpression(t,s){return t?this.disallowInAnd(()=>this.parseExpressionBase(s)):this.allowInAnd(()=>this.parseExpressionBase(s))}parseExpressionBase(t){let s=this.state.startLoc,e=this.parseMaybeAssign(t);if(this.match(12)){let r=this.startNodeAt(s);for(r.expressions=[e];this.eat(12);)r.expressions.push(this.parseMaybeAssign(t));return this.toReferencedList(r.expressions),this.finishNode(r,"SequenceExpression")}return e}parseMaybeAssignDisallowIn(t,s){return this.disallowInAnd(()=>this.parseMaybeAssign(t,s))}parseMaybeAssignAllowIn(t,s){return this.allowInAnd(()=>this.parseMaybeAssign(t,s))}setOptionalParametersError(t){t.optionalParametersLoc=this.state.startLoc}parseMaybeAssign(t,s){let e=this.state.startLoc,r=this.isContextual(108);if(r&&this.prodParam.hasYield){this.next();let o=this.parseYield(e);return s&&(o=s.call(this,o,e)),o}let i;t?i=!1:(t=new ye,i=!0);let{type:a}=this.state;(a===10||S(a))&&(this.state.potentialArrowAt=this.state.start);let n=this.parseMaybeConditional(t);if(s&&(n=s.call(this,n,e)),ks(this.state.type)){let o=this.startNodeAt(e),l=this.state.value;if(o.operator=l,this.match(29)){this.toAssignable(n,!0),o.left=n;let h=e.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=h&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=h&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=h&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null),t.voidPatternLoc!=null&&t.voidPatternLoc.index>=h&&(t.voidPatternLoc=null)}else o.left=n;return this.next(),o.right=this.parseMaybeAssign(),this.checkLVal(n,this.finishNode(o,"AssignmentExpression"),void 0,void 0,void 0,void 0,l==="||="||l==="&&="||l==="??="),o}else i&&this.checkExpressionErrors(t,!0);if(r){let{type:o}=this.state;if((this.hasPlugin("v8intrinsic")?re(o):re(o)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(u.YieldNotInGeneratorFunction,e),this.parseYield(e)}return n}parseMaybeConditional(t){let s=this.state.startLoc,e=this.state.potentialArrowAt,r=this.parseExprOps(t);return this.shouldExitDescending(r,e)?r:this.parseConditional(r,s,t)}parseConditional(t,s,e){if(this.eat(17)){let r=this.startNodeAt(s);return r.test=t,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(139)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let s=this.state.startLoc,e=this.state.potentialArrowAt,r=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(r,e)?r:this.parseExprOp(r,s,-1)}parseExprOp(t,s,e){if(this.isPrivateName(t)){let i=this.getPrivateNameSV(t);(e>=me(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(u.PrivateInExpectedIn,t,{identifierName:i}),this.classScope.usePrivateName(i,t.loc.start)}let r=this.state.type;if(Ds(r)&&(this.prodParam.hasIn||!this.match(58))){let i=me(r);if(i>e){if(r===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return t;this.checkPipelineAtInfixOperator(t,s)}let a=this.startNodeAt(s);a.left=t,a.operator=this.state.value;let n=r===41||r===42,o=r===40;o&&(i=me(42)),this.next(),a.right=this.parseExprOpRightExpr(r,i);let l=this.finishNode(a,n||o?"LogicalExpression":"BinaryExpression"),h=this.state.type;if(o&&(h===41||h===42)||n&&h===40)throw this.raise(u.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(l,s,e)}}return t}parseExprOpRightExpr(t,s){switch(this.state.startLoc,t){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(s))}default:return this.parseExprOpBaseRightExpr(t,s)}}parseExprOpBaseRightExpr(t,s){let e=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,Os(t)?s-1:s)}parseHackPipeBody(){var e;let{startLoc:t}=this.state,s=this.parseMaybeAssign();return xs.has(s.type)&&!((e=s.extra)!=null&&e.parenthesized)&&this.raise(u.PipeUnparenthesizedBody,t,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(u.PipeTopicUnused,t),s}checkExponentialAfterUnary(t){this.match(57)&&this.raise(u.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,s){let e=this.state.startLoc,r=this.isContextual(96);if(r&&this.recordAwaitIfAllowed()){this.next();let o=this.parseAwait(e);return s||this.checkExponentialAfterUnary(o),o}let i=this.match(34),a=this.startNode();if(Ls(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let o=this.match(89);if(this.next(),a.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(t,!0),this.state.strict&&o){let l=a.argument;l.type==="Identifier"?this.raise(u.StrictDelete,a):this.hasPropertyAsPrivateName(l)&&this.raise(u.DeletePrivateField,a)}if(!i)return s||this.checkExponentialAfterUnary(a),this.finishNode(a,"UnaryExpression")}let n=this.parseUpdate(a,i,t);if(r){let{type:o}=this.state;if((this.hasPlugin("v8intrinsic")?re(o):re(o)&&!this.match(54))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(u.AwaitNotInAsyncContext,e),this.parseAwait(e)}return n}parseUpdate(t,s,e){if(s){let a=t;return this.checkLVal(a.argument,this.finishNode(a,"UpdateExpression")),t}let r=this.state.startLoc,i=this.parseExprSubscripts(e);if(this.checkExpressionErrors(e,!1))return i;for(;Fs(this.state.type)&&!this.canInsertSemicolon();){let a=this.startNodeAt(r);a.operator=this.state.value,a.prefix=!1,a.argument=i,this.next(),this.checkLVal(i,i=this.finishNode(a,"UpdateExpression"))}return i}parseExprSubscripts(t){let s=this.state.startLoc,e=this.state.potentialArrowAt,r=this.parseExprAtom(t);return this.shouldExitDescending(r,e)?r:this.parseSubscripts(r,s)}parseSubscripts(t,s,e){let r={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(t),stop:!1};do t=this.parseSubscript(t,s,e,r),r.maybeAsyncArrow=!1;while(!r.stop);return t}parseSubscript(t,s,e,r){let{type:i}=this.state;if(!e&&i===15)return this.parseBind(t,s,e,r);if(ke(i))return this.parseTaggedTemplateExpression(t,s,r);let a=!1;if(i===18){if(e&&(this.raise(u.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(t,r);r.optionalChainMember=a=!0,this.next()}if(!e&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(t,s,r,a);{let n=this.eat(0);return n||a||this.eat(16)?this.parseMember(t,s,r,n,a):this.stopParseSubscript(t,r)}}stopParseSubscript(t,s){return s.stop=!0,t}parseMember(t,s,e,r,i){let a=this.startNodeAt(s);return a.object=t,a.computed=r,r?(a.property=this.parseExpression(),this.expect(3)):this.match(139)?(t.type==="Super"&&this.raise(u.SuperPrivateField,s),this.classScope.usePrivateName(this.state.value,this.state.startLoc),a.property=this.parsePrivateName()):a.property=this.parseIdentifier(!0),e.optionalChainMember?(a.optional=i,this.finishNode(a,"OptionalMemberExpression")):this.finishNode(a,"MemberExpression")}parseBind(t,s,e,r){let i=this.startNodeAt(s);return i.object=t,this.next(),i.callee=this.parseNoCallExpr(),r.stop=!0,this.parseSubscripts(this.finishNode(i,"BindExpression"),s,e)}parseCoverCallAndAsyncArrowHead(t,s,e,r){let i=this.state.maybeInArrowParameters,a=null;this.state.maybeInArrowParameters=!0,this.next();let n=this.startNodeAt(s);n.callee=t;let{maybeAsyncArrow:o,optionalChainMember:l}=e;o&&(this.expressionScope.enter(br()),a=new ye),l&&(n.optional=r),r?n.arguments=this.parseCallExpressionArguments():n.arguments=this.parseCallExpressionArguments(t.type!=="Super",n,a);let h=this.finishCallExpression(n,l);return o&&this.shouldParseAsyncArrow()&&!r?(e.stop=!0,this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),h=this.parseAsyncArrowFromCallExpression(this.startNodeAt(s),h)):(o&&(this.checkExpressionErrors(a,!0),this.expressionScope.exit()),this.toReferencedArguments(h)),this.state.maybeInArrowParameters=i,h}toReferencedArguments(t,s){this.toReferencedListDeep(t.arguments,s)}parseTaggedTemplateExpression(t,s,e){let r=this.startNodeAt(s);return r.tag=t,r.quasi=this.parseTemplate(!0),e.optionalChainMember&&this.raise(u.OptionalChainingNoTemplate,s),this.finishNode(r,"TaggedTemplateExpression")}atPossibleAsyncArrow(t){return t.type==="Identifier"&&t.name==="async"&&this.state.lastTokEndLoc.index===t.end&&!this.canInsertSemicolon()&&t.end-t.start===5&&this.offsetToSourcePos(t.start)===this.state.potentialArrowAt}finishCallExpression(t,s){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(u.ImportCallArity,t);else for(let e of t.arguments)e.type==="SpreadElement"&&this.raise(u.ImportCallSpreadArgument,e);return this.finishNode(t,s?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,s,e){let r=[],i=!0,a=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(11);){if(i)i=!1;else if(this.expect(12),this.match(11)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}r.push(this.parseExprListItem(11,!1,e,t))}return this.state.inFSharpPipelineDirectBody=a,r}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,s){var e;return this.resetPreviousNodeTrailingComments(s),this.expect(19),this.parseArrowExpression(t,s.arguments,!0,(e=s.extra)==null?void 0:e.trailingCommaLoc),s.innerComments&&G(t,s.innerComments),s.callee.trailingComments&&G(t,s.callee.trailingComments),t}parseNoCallExpr(){let t=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),t,!0)}parseExprAtom(t){let s,e=null,{type:r}=this.state;switch(r){case 79:return this.parseSuper();case 83:return s=this.startNode(),this.next(),this.match(16)?this.parseImportMetaPropertyOrPhaseCall(s):this.match(10)?this.optionFlags&512?this.parseImportCall(s):this.finishNode(s,"Import"):(this.raise(u.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(s,"Import"));case 78:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 135:return this.parseNumericLiteral(this.state.value);case 136:return this.parseBigIntLiteral(this.state.value);case 134:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let i=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(i)}case 0:return this.parseArrayLike(3,!1,t);case 5:return this.parseObjectLike(8,!1,!1,t);case 68:return this.parseFunctionOrFunctionSent();case 26:e=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(e,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{s=this.startNode(),this.next(),s.object=null;let i=s.callee=this.parseNoCallExpr();if(i.type==="MemberExpression")return this.finishNode(s,"BindExpression");throw this.raise(u.UnsupportedBind,i)}case 139:return this.raise(u.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let i=this.getPluginOption("pipelineOperator","proposal");if(i)return this.parseTopicReference(i);throw this.unexpected()}case 47:{let i=this.input.codePointAt(this.nextTokenStart());throw B(i)||i===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected()}default:if(S(r)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let i=this.state.potentialArrowAt===this.state.start,a=this.state.containsEsc,n=this.parseIdentifier();if(!a&&n.name==="async"&&!this.canInsertSemicolon()){let{type:o}=this.state;if(o===68)return this.resetPreviousNodeTrailingComments(n),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(n));if(S(o))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)):n;if(o===90)return this.resetPreviousNodeTrailingComments(n),this.parseDo(this.startNodeAtNode(n),!0)}return i&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(n),[n],!1)):n}else throw this.unexpected()}}parseTopicReferenceThenEqualsSign(t,s){let e=this.getPluginOption("pipelineOperator","proposal");if(e)return this.state.type=t,this.state.value=s,this.state.pos--,this.state.end--,this.state.endLoc=D(this.state.endLoc,-1),this.parseTopicReference(e);throw this.unexpected()}parseTopicReference(t){let s=this.startNode(),e=this.state.startLoc,r=this.state.type;return this.next(),this.finishTopicReference(s,e,t,r)}finishTopicReference(t,s,e,r){if(this.testTopicReferenceConfiguration(e,s,r))return this.topicReferenceIsAllowedInCurrentContext()||this.raise(u.PipeTopicUnbound,s),this.registerTopicReference(),this.finishNode(t,"TopicReference");throw this.raise(u.PipeTopicUnconfiguredToken,s,{token:q(r)})}testTopicReferenceConfiguration(t,s,e){switch(t){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:q(e)}]);case"smart":return e===27;default:throw this.raise(u.PipeTopicRequiresHackPipes,s)}}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(fe(!0,this.prodParam.hasYield));let s=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(u.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(t,s,!0)}parseDo(t,s){this.expectPlugin("doExpressions"),s&&this.expectPlugin("asyncDoExpressions"),t.async=s,this.next();let e=this.state.labels;return this.state.labels=[],s?(this.prodParam.enter(2),t.body=this.parseBlock(),this.prodParam.exit()):t.body=this.parseBlock(),this.state.labels=e,this.finishNode(t,"DoExpression")}parseSuper(){let t=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper?this.raise(u.SuperNotAllowed,t):this.scope.allowSuper||this.raise(u.UnexpectedSuper,t),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(u.UnsupportedSuper,t),this.finishNode(t,"Super")}parsePrivateName(){let t=this.startNode(),s=this.startNodeAt(D(this.state.startLoc,1)),e=this.state.value;return this.next(),t.id=this.createIdentifier(s,e),this.finishNode(t,"PrivateName")}parseFunctionOrFunctionSent(){let t=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let s=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(t,s,"sent")}return this.parseFunction(t)}parseMetaProperty(t,s,e){t.meta=s;let r=this.state.containsEsc;return t.property=this.parseIdentifier(!0),(t.property.name!==e||r)&&this.raise(u.UnsupportedMetaProperty,t.property,{target:s.name,onlyValidPropertyName:e}),this.finishNode(t,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(t){if(this.next(),this.isContextual(105)||this.isContextual(97)){let s=this.isContextual(105);return this.expectPlugin(s?"sourcePhaseImports":"deferredImportEvaluation"),this.next(),t.phase=s?"source":"defer",this.parseImportCall(t)}else{let s=this.createIdentifierAt(this.startNodeAtNode(t),"import",this.state.lastTokStartLoc);return this.isContextual(101)&&(this.inModule||this.raise(u.ImportMetaOutsideModule,s),this.sawUnambiguousESM=!0),this.parseMetaProperty(t,s,"meta")}}parseLiteralAtNode(t,s,e){return this.addExtra(e,"rawValue",t),this.addExtra(e,"raw",this.input.slice(this.offsetToSourcePos(e.start),this.state.end)),e.value=t,this.next(),this.finishNode(e,s)}parseLiteral(t,s){let e=this.startNode();return this.parseLiteralAtNode(t,s,e)}parseStringLiteral(t){return this.parseLiteral(t,"StringLiteral")}parseNumericLiteral(t){return this.parseLiteral(t,"NumericLiteral")}parseBigIntLiteral(t){{let s;try{s=BigInt(t)}catch{s=null}return this.parseLiteral(s,"BigIntLiteral")}}parseDecimalLiteral(t){return this.parseLiteral(t,"DecimalLiteral")}parseRegExpLiteral(t){let s=this.startNode();return this.addExtra(s,"raw",this.input.slice(this.offsetToSourcePos(s.start),this.state.end)),s.pattern=t.pattern,s.flags=t.flags,this.next(),this.finishNode(s,"RegExpLiteral")}parseBooleanLiteral(t){let s=this.startNode();return s.value=t,this.next(),this.finishNode(s,"BooleanLiteral")}parseNullLiteral(){let t=this.startNode();return this.next(),this.finishNode(t,"NullLiteral")}parseParenAndDistinguishExpression(t){let s=this.state.startLoc,e;this.next(),this.expressionScope.enter(Tr());let r=this.state.maybeInArrowParameters,i=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let a=this.state.startLoc,n=[],o=new ye,l=!0,h,c;for(;!this.match(11);){if(l)l=!1;else if(this.expect(12,o.optionalParametersLoc===null?null:o.optionalParametersLoc),this.match(11)){c=this.state.startLoc;break}if(this.match(21)){let A=this.state.startLoc;if(h=this.state.startLoc,n.push(this.parseParenItem(this.parseRestBinding(),A)),!this.checkCommaAfterRest(41))break}else n.push(this.parseMaybeAssignAllowInOrVoidPattern(11,o,this.parseParenItem))}let d=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=r,this.state.inFSharpPipelineDirectBody=i;let m=this.startNodeAt(s);return t&&this.shouldParseArrow(n)&&(m=this.parseArrow(m))?(this.checkDestructuringPrivate(o),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(m,n,!1),m):(this.expressionScope.exit(),n.length||this.unexpected(this.state.lastTokStartLoc),c&&this.unexpected(c),h&&this.unexpected(h),this.checkExpressionErrors(o,!0),this.toReferencedListDeep(n,!0),n.length>1?(e=this.startNodeAt(a),e.expressions=n,this.finishNode(e,"SequenceExpression"),this.resetEndLocation(e,d)):e=n[0],this.wrapParenthesis(s,e))}wrapParenthesis(t,s){if(!(this.optionFlags&1024))return this.addExtra(s,"parenthesized",!0),this.addExtra(s,"parenStart",t.index),this.takeSurroundingComments(s,t.index,this.state.lastTokEndLoc.index),s;let e=this.startNodeAt(t);return e.expression=s,this.finishNode(e,"ParenthesizedExpression")}shouldParseArrow(t){return!this.canInsertSemicolon()}parseArrow(t){if(this.eat(19))return t}parseParenItem(t,s){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(16)){let s=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let e=this.parseMetaProperty(t,s,"target");return this.scope.allowNewTarget||this.raise(u.UnexpectedNewTarget,e),e}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(10)){let s=this.parseExprList(11);this.toReferencedList(s),t.arguments=s}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let s=this.match(83),e=this.parseNoCallExpr();t.callee=e,s&&(e.type==="Import"||e.type==="ImportExpression")&&this.raise(u.ImportCallNotNewExpression,e)}parseTemplateElement(t){let{start:s,startLoc:e,end:r,value:i}=this.state,a=s+1,n=this.startNodeAt(D(e,1));i===null&&(t||this.raise(u.InvalidEscapeSequenceTemplate,D(this.state.firstInvalidTemplateEscapePos,1)));let o=this.match(24),l=o?-1:-2,h=r+l;n.value={raw:this.input.slice(a,h).replace(/\r\n?/g,`
|
|
8
|
+
`),cooked:i===null?null:i.slice(1,l)},n.tail=o,this.next();let c=this.finishNode(n,"TemplateElement");return this.resetEndLocation(c,D(this.state.lastTokEndLoc,l)),c}parseTemplate(t){let s=this.startNode(),e=this.parseTemplateElement(t),r=[e],i=[];for(;!e.tail;)i.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),r.push(e=this.parseTemplateElement(t));return s.expressions=i,s.quasis=r,this.finishNode(s,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(t,s,e,r){e&&this.expectPlugin("recordAndTuple");let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let a=!1,n=!0,o=this.startNode();for(o.properties=[],this.next();!this.match(t);){if(n)n=!1;else if(this.expect(12),this.match(t)){this.addTrailingCommaExtraToNode(o);break}let h;s?h=this.parseBindingProperty():(h=this.parsePropertyDefinition(r),a=this.checkProto(h,e,a,r)),e&&!this.isObjectProperty(h)&&h.type!=="SpreadElement"&&this.raise(u.InvalidRecordProperty,h),o.properties.push(h)}this.next(),this.state.inFSharpPipelineDirectBody=i;let l="ObjectExpression";return s?l="ObjectPattern":e&&(l="RecordExpression"),this.finishNode(o,l)}addTrailingCommaExtraToNode(t){this.addExtra(t,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(t,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(t){return!t.computed&&t.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(t){let s=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(u.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)s.push(this.parseDecorator());let e=this.startNode(),r=!1,i=!1,a;if(this.match(21))return s.length&&this.unexpected(),this.parseSpread();s.length&&(e.decorators=s,s=[]),e.method=!1,t&&(a=this.state.startLoc);let n=this.eat(55);this.parsePropertyNamePrefixOperator(e);let o=this.state.containsEsc;if(this.parsePropertyName(e,t),!n&&!o&&this.maybeAsyncOrAccessorProp(e)){let{key:l}=e,h=l.name;h==="async"&&!this.hasPrecedingLineBreak()&&(r=!0,this.resetPreviousNodeTrailingComments(l),n=this.eat(55),this.parsePropertyName(e)),(h==="get"||h==="set")&&(i=!0,this.resetPreviousNodeTrailingComments(l),e.kind=h,this.match(55)&&(n=!0,this.raise(u.AccessorIsGenerator,this.state.curPosition(),{kind:h}),this.next()),this.parsePropertyName(e))}return this.parseObjPropValue(e,a,n,r,!1,i,t)}getGetterSetterExpectedParamCount(t){return t.kind==="get"?0:1}getObjectOrClassMethodParams(t){return t.params}checkGetterSetterParams(t){var r;let s=this.getGetterSetterExpectedParamCount(t),e=this.getObjectOrClassMethodParams(t);e.length!==s&&this.raise(t.kind==="get"?u.BadGetterArity:u.BadSetterArity,t),t.kind==="set"&&((r=e[e.length-1])==null?void 0:r.type)==="RestElement"&&this.raise(u.BadSetterRestParameter,t)}parseObjectMethod(t,s,e,r,i){if(i){let a=this.parseMethod(t,s,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(a),a}if(e||s||this.match(10))return r&&this.unexpected(),t.kind="method",t.method=!0,this.parseMethod(t,s,e,!1,!1,"ObjectMethod")}parseObjectProperty(t,s,e,r){if(t.shorthand=!1,this.eat(14))return t.value=e?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(8,r),this.finishObjectProperty(t);if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.loc.start,!0,!1),e)t.value=this.parseMaybeDefault(s,this.cloneIdentifier(t.key));else if(this.match(29)){let i=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=i):this.raise(u.InvalidCoverInitializedName,i),t.value=this.parseMaybeDefault(s,this.cloneIdentifier(t.key))}else t.value=this.cloneIdentifier(t.key);return t.shorthand=!0,this.finishObjectProperty(t)}}finishObjectProperty(t){return this.finishNode(t,"ObjectProperty")}parseObjPropValue(t,s,e,r,i,a,n){let o=this.parseObjectMethod(t,e,r,i,a)||this.parseObjectProperty(t,s,i,n);return o||this.unexpected(),o}parsePropertyName(t,s){if(this.eat(0))t.computed=!0,t.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:e,value:r}=this.state,i;if(L(e))i=this.parseIdentifier(!0);else switch(e){case 135:i=this.parseNumericLiteral(r);break;case 134:i=this.parseStringLiteral(r);break;case 136:i=this.parseBigIntLiteral(r);break;case 139:{let a=this.state.startLoc;s!=null?s.privateKeyLoc===null&&(s.privateKeyLoc=a):this.raise(u.UnexpectedPrivateField,a),i=this.parsePrivateName();break}default:this.unexpected()}t.key=i,e!==139&&(t.computed=!1)}}initFunction(t,s){t.id=null,t.generator=!1,t.async=s}parseMethod(t,s,e,r,i,a,n=!1){this.initFunction(t,e),t.generator=s,this.scope.enter(530|(n?576:0)|(i?32:0)),this.prodParam.enter(fe(e,t.generator)),this.parseFunctionParams(t,r);let o=this.parseFunctionBodyAndFinish(t,a,!0);return this.prodParam.exit(),this.scope.exit(),o}parseArrayLike(t,s,e){s&&this.expectPlugin("recordAndTuple");let r=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let i=this.startNode();return this.next(),i.elements=this.parseExprList(t,!s,e,i),this.state.inFSharpPipelineDirectBody=r,this.finishNode(i,s?"TupleExpression":"ArrayExpression")}parseArrowExpression(t,s,e,r){this.scope.enter(518);let i=fe(e,!1);!this.match(5)&&this.prodParam.hasIn&&(i|=8),this.prodParam.enter(i),this.initFunction(t,e);let a=this.state.maybeInArrowParameters;return s&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(t,s,r)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=a,this.finishNode(t,"ArrowFunctionExpression")}setArrowFunctionParameters(t,s,e){this.toAssignableList(s,e,!1),t.params=s}parseFunctionBodyAndFinish(t,s,e=!1){return this.parseFunctionBody(t,!1,e),this.finishNode(t,s)}parseFunctionBody(t,s,e=!1){let r=s&&!this.match(5);if(this.expressionScope.enter(zt()),r)t.body=this.parseMaybeAssign(),this.checkParams(t,!1,s,!1);else{let i=this.state.strict,a=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),t.body=this.parseBlock(!0,!1,n=>{let o=!this.isSimpleParamList(t.params);n&&o&&this.raise(u.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?t.key.loc.end:t);let l=!i&&this.state.strict;this.checkParams(t,!this.state.strict&&!s&&!e&&!o,s,l),this.state.strict&&t.id&&this.checkIdentifier(t.id,65,l)}),this.prodParam.exit(),this.state.labels=a}this.expressionScope.exit()}isSimpleParameter(t){return t.type==="Identifier"}isSimpleParamList(t){for(let s=0,e=t.length;s<e;s++)if(!this.isSimpleParameter(t[s]))return!1;return!0}checkParams(t,s,e,r=!0){let i=!s&&new Set,a={type:"FormalParameters"};for(let n of t.params)this.checkLVal(n,a,5,i,r)}parseExprList(t,s,e,r){let i=[],a=!0;for(;!this.eat(t);){if(a)a=!1;else if(this.expect(12),this.match(t)){r&&this.addTrailingCommaExtraToNode(r),this.next();break}i.push(this.parseExprListItem(t,s,e))}return i}parseExprListItem(t,s,e,r){let i;if(this.match(12))s||this.raise(u.UnexpectedToken,this.state.curPosition(),{unexpected:","}),i=null;else if(this.match(21)){let a=this.state.startLoc;i=this.parseParenItem(this.parseSpread(e),a)}else if(this.match(17)){this.expectPlugin("partialApplication"),r||this.raise(u.UnexpectedArgumentPlaceholder,this.state.startLoc);let a=this.startNode();this.next(),i=this.finishNode(a,"ArgumentPlaceholder")}else i=this.parseMaybeAssignAllowInOrVoidPattern(t,e,this.parseParenItem);return i}parseIdentifier(t){let s=this.startNode(),e=this.parseIdentifierName(t);return this.createIdentifier(s,e)}createIdentifier(t,s){return t.name=s,t.loc.identifierName=s,this.finishNode(t,"Identifier")}createIdentifierAt(t,s,e){return t.name=s,t.loc.identifierName=s,this.finishNodeAt(t,"Identifier",e)}parseIdentifierName(t){let s,{startLoc:e,type:r}=this.state;L(r)?s=this.state.value:this.unexpected();let i=Is(r);return t?i&&this.replaceToken(132):this.checkReservedWord(s,e,i,!1),this.next(),s}checkReservedWord(t,s,e,r){if(!(t.length>10||!Ks(t))){if(e&&Hs(t)){this.raise(u.UnexpectedKeyword,s,{keyword:t});return}if((this.state.strict?r?Ot:Mt:Lt)(t,this.inModule)){this.raise(u.UnexpectedReservedWord,s,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(u.YieldBindingIdentifier,s);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(u.AwaitBindingIdentifier,s);return}if(this.scope.inStaticBlock){this.raise(u.AwaitBindingIdentifierInStaticBlock,s);return}this.expressionScope.recordAsyncArrowParametersError(s)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(u.ArgumentsInClass,s);return}}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t){let s=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(u.AwaitExpressionFormalParameter,s),this.eat(55)&&this.raise(u.ObsoleteAwaitStar,s),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(s.argument=this.parseMaybeUnary(null,!0)),this.finishNode(s,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===53||t===10||t===0||ke(t)||t===102&&!this.state.containsEsc||t===138||t===56||this.hasPlugin("v8intrinsic")&&t===54}parseYield(t){let s=this.startNodeAt(t);this.expressionScope.recordParameterInitializerError(u.YieldInParameter,s);let e=!1,r=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 140:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:r=this.parseMaybeAssign()}return s.delegate=e,s.argument=r,this.finishNode(s,"YieldExpression")}parseImportCall(t){if(this.next(),t.source=this.parseMaybeAssignAllowIn(),t.options=null,this.eat(12)){if(this.match(11))this.addTrailingCommaExtraToNode(t.source);else if(t.options=this.parseMaybeAssignAllowIn(),this.eat(12)&&(this.addTrailingCommaExtraToNode(t.options),!this.match(11))){do this.parseMaybeAssignAllowIn();while(this.eat(12)&&!this.match(11));this.raise(u.ImportCallArity,t)}}return this.expect(11),this.finishNode(t,"ImportExpression")}checkPipelineAtInfixOperator(t,s){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&t.type==="SequenceExpression"&&this.raise(u.PipelineHeadSequenceExpression,s)}parseSmartPipelineBodyInStyle(t,s){if(this.isSimpleReference(t)){let e=this.startNodeAt(s);return e.callee=t,this.finishNode(e,"PipelineBareFunction")}else{let e=this.startNodeAt(s);return this.checkSmartPipeTopicBodyEarlyErrors(s),e.expression=t,this.finishNode(e,"PipelineTopicExpression")}}isSimpleReference(t){switch(t.type){case"MemberExpression":return!t.computed&&this.isSimpleReference(t.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(t){if(this.match(19))throw this.raise(u.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(u.PipelineTopicUnused,t)}withTopicBindingContext(t){let s=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return t()}finally{this.state.topicContext=s}}withSmartMixTopicForbiddingContext(t){return t()}withSoloAwaitPermittingContext(t){let s=this.state.soloAwait;this.state.soloAwait=!0;try{return t()}finally{this.state.soloAwait=s}}allowInAnd(t){let s=this.prodParam.currentFlags();if(8&~s){this.prodParam.enter(s|8);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let s=this.prodParam.currentFlags();if(8&s){this.prodParam.enter(s&-9);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(t){let s=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let e=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let r=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,t);return this.state.inFSharpPipelineDirectBody=e,r}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let s=this.startNodeAt(this.state.endLoc);this.next();let e=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(s,8,"module")}finally{e()}return this.finishNode(t,"ModuleExpression")}parseVoidPattern(t){this.expectPlugin("discardBinding");let s=this.startNode();return t!=null&&(t.voidPatternLoc=this.state.startLoc),this.next(),this.finishNode(s,"VoidPattern")}parseMaybeAssignAllowInOrVoidPattern(t,s,e){if(s!=null&&this.match(88)){let r=this.lookaheadCharCode();if(r===44||r===(t===3?93:t===8?125:41)||r===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(s))}return this.parseMaybeAssignAllowIn(s,e)}parsePropertyNamePrefixOperator(t){}},Se={kind:1},Ur={kind:2},jr=/[\uD800-\uDFFF]/u,we=/in(?:stanceof)?/y;function _r(t,s,e){for(let r=0;r<t.length;r++){let i=t[r],{type:a}=i;typeof a=="number"&&(i.type=vt(a))}return t}var Vr=class extends Rr{parseTopLevel(t,s){return t.program=this.parseProgram(s,140,this.options.sourceType==="module"?"module":"script"),t.comments=this.comments,this.optionFlags&256&&(t.tokens=_r(this.tokens,this.input,this.startIndex)),this.finishNode(t,"File")}parseProgram(t,s,e){if(t.sourceType=e,t.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(t,!0,!0,s),this.inModule){if(!(this.optionFlags&64)&&this.scope.undefinedExports.size>0)for(let[i,a]of Array.from(this.scope.undefinedExports))this.raise(u.ModuleExportUndefined,a,{localName:i});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return s===140?r=this.finishNode(t,"Program"):r=this.finishNodeAt(t,"Program",D(this.state.startLoc,-1)),r}stmtToDirective(t){let s=this.castNodeTo(t,"Directive"),e=this.castNodeTo(t.expression,"DirectiveLiteral"),r=e.value,i=this.input.slice(this.offsetToSourcePos(e.start),this.offsetToSourcePos(e.end)),a=e.value=i.slice(1,-1);return this.addExtra(e,"raw",i),this.addExtra(e,"rawValue",a),this.addExtra(e,"expressionValue",r),s.value=e,delete t.expression,s}parseInterpreterDirective(){if(!this.match(28))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(107)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(107))return!1;let t=this.nextTokenInLineStart(),s=this.codePointAtPos(t);if(this.isUnparsedContextual(t,"of")){let e=this.lookaheadCharCodeSince(t+2);if(e!==61&&e!==58&&e!==59)return!1}return!!(this.chStartsBindingIdentifier(s,t)||this.isUnparsedContextual(t,"void"))}nextTokenIsIdentifierOnSameLine(){let t=this.nextTokenInLineStart(),s=this.codePointAtPos(t);return this.chStartsBindingIdentifier(s,t)}isAwaitUsing(){if(!this.isContextual(96))return!1;let t=this.nextTokenInLineStart();if(this.isUnparsedContextual(t,"using")){t=this.nextTokenInLineStartSince(t+5);let s=this.codePointAtPos(t);if(this.chStartsBindingIdentifier(s,t))return!0}return!1}chStartsBindingIdentifier(t,s){if(B(t)){if(we.lastIndex=s,we.test(this.input)){let e=this.codePointAtPos(we.lastIndex);if(!K(e)&&e!==92)return!1}return!0}else return t===92}chStartsBindingPattern(t){return t===91||t===123}hasFollowingBindingAtom(){let t=this.nextTokenStart(),s=this.codePointAtPos(t);return this.chStartsBindingPattern(s)||this.chStartsBindingIdentifier(s,t)}hasInLineFollowingBindingIdentifierOrBrace(){let t=this.nextTokenInLineStart(),s=this.codePointAtPos(t);return s===123||this.chStartsBindingIdentifier(s,t)}allowsUsing(){return(this.scope.inModule||!this.scope.inTopLevel)&&!this.scope.inBareCaseStatement}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(t=!1){let s=0;return this.options.annexB&&!this.state.strict&&(s|=4,t&&(s|=8)),this.parseStatementLike(s)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(t){let s=null;return this.match(26)&&(s=this.parseDecorators(!0)),this.parseStatementContent(t,s)}parseStatementContent(t,s){let e=this.state.type,r=this.startNode(),i=!!(t&2),a=!!(t&4),n=t&1;switch(e){case 60:return this.parseBreakContinueStatement(r,!0);case 63:return this.parseBreakContinueStatement(r,!1);case 64:return this.parseDebuggerStatement(r);case 90:return this.parseDoWhileStatement(r);case 91:return this.parseForStatement(r);case 68:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?u.StrictFunction:this.options.annexB?u.SloppyFunctionAnnexB:u.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!i&&a);case 80:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(s,r),!0);case 69:return this.parseIfStatement(r);case 70:return this.parseReturnStatement(r);case 71:return this.parseSwitchStatement(r);case 72:return this.parseThrowStatement(r);case 73:return this.parseTryStatement(r);case 96:if(this.isAwaitUsing())return this.allowsUsing()?i?this.recordAwaitIfAllowed()||this.raise(u.AwaitUsingNotInAsyncContext,r):this.raise(u.UnexpectedLexicalDeclaration,r):this.raise(u.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?i||this.raise(u.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(u.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 100:{if(this.state.containsEsc)break;let h=this.nextTokenStart(),c=this.codePointAtPos(h);if(c!==91&&(!i&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(c,h)&&c!==123))break}case 75:i||this.raise(u.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let h=this.state.value;return this.parseVarStatement(r,h)}case 92:return this.parseWhileStatement(r);case 76:return this.parseWithStatement(r);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(r);case 83:{let h=this.lookaheadCharCode();if(h===40||h===46)break}case 82:{!(this.optionFlags&8)&&!n&&this.raise(u.UnexpectedImportExport,this.state.startLoc),this.next();let h;return e===83?h=this.parseImport(r):h=this.parseExport(r,s),this.assertModuleNodeAllowed(h),h}default:if(this.isAsyncFunction())return i||this.raise(u.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let o=this.state.value,l=this.parseExpression();return S(e)&&l.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(r,o,l,t):this.parseExpressionStatement(r,l,s)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(u.ImportOutsideModule,t)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(t,s,e){var r;return t&&((r=s.decorators)!=null&&r.length?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(u.DecoratorsBeforeAfterExport,s.decorators[0]),s.decorators.unshift(...t)):s.decorators=t,this.resetStartLocationFromNode(s,t[0]),e&&this.resetStartLocationFromNode(e,s)),s}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(t){let s=[];do s.push(this.parseDecorator());while(this.match(26));if(this.match(82))t||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(u.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(u.UnexpectedLeadingDecorator,this.state.startLoc);return s}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let t=this.startNode();if(this.next(),this.hasPlugin("decorators")){let s=this.state.startLoc,e;if(this.match(10)){let r=this.state.startLoc;this.next(),e=this.parseExpression(),this.expect(11),e=this.wrapParenthesis(r,e);let i=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(e,r),this.getPluginOption("decorators","allowCallParenthesized")===!1&&t.expression!==e&&this.raise(u.DecoratorArgumentsOutsideParentheses,i)}else{for(e=this.parseIdentifier(!1);this.eat(16);){let r=this.startNodeAt(s);r.object=e,this.match(139)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),r.property=this.parsePrivateName()):r.property=this.parseIdentifier(!0),r.computed=!1,e=this.finishNode(r,"MemberExpression")}t.expression=this.parseMaybeDecoratorArguments(e,s)}}else t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t,s){if(this.eat(10)){let e=this.startNodeAt(s);return e.callee=t,e.arguments=this.parseCallExpressionArguments(),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return t}parseBreakContinueStatement(t,s){return this.next(),this.isLineTerminator()?t.label=null:(t.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(t,s),this.finishNode(t,s?"BreakStatement":"ContinueStatement")}verifyBreakContinue(t,s){let e;for(e=0;e<this.state.labels.length;++e){let r=this.state.labels[e];if((t.label==null||r.name===t.label.name)&&(r.kind!=null&&(s||r.kind===1)||t.label&&s))break}if(e===this.state.labels.length){let r=s?"BreakStatement":"ContinueStatement";this.raise(u.IllegalBreakContinue,t,{type:r})}}parseDebuggerStatement(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let t=this.parseExpression();return this.expect(11),t}parseDoWhileStatement(t){return this.next(),this.state.labels.push(Se),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),t.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(Se);let s=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(s=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return s!==null&&this.unexpected(s),this.parseFor(t,null);let e=this.isContextual(100);{let o=this.isAwaitUsing(),l=o||this.isForUsing(),h=e&&this.hasFollowingBindingAtom()||l;if(this.match(74)||this.match(75)||h){let c=this.startNode(),d;o?(d="await using",this.recordAwaitIfAllowed()||this.raise(u.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):d=this.state.value,this.next(),this.parseVar(c,!0,d);let m=this.finishNode(c,"VariableDeclaration"),A=this.match(58);return A&&l&&this.raise(u.ForInUsing,m),(A||this.isContextual(102))&&m.declarations.length===1?this.parseForIn(t,m,s):(s!==null&&this.unexpected(s),this.parseFor(t,m))}}let r=this.isContextual(95),i=new ye,a=this.parseExpression(!0,i),n=this.isContextual(102);if(n&&(e&&this.raise(u.ForOfLet,a),s===null&&r&&a.type==="Identifier"&&this.raise(u.ForOfAsync,a)),n||this.match(58)){this.checkDestructuringPrivate(i),this.toAssignable(a,!0);let o=n?"ForOfStatement":"ForInStatement";return this.checkLVal(a,{type:o}),this.parseForIn(t,a,s)}else this.checkExpressionErrors(i,!0);return s!==null&&this.unexpected(s),this.parseFor(t,a)}parseFunctionStatement(t,s,e){return this.next(),this.parseFunction(t,1|(e?2:0)|(s?8:0))}parseIfStatement(t){return this.next(),t.test=this.parseHeaderExpression(),t.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),t.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return this.prodParam.hasReturn||this.raise(u.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?t.argument=null:(t.argument=this.parseExpression(),this.semicolon()),this.finishNode(t,"ReturnStatement")}parseSwitchStatement(t){this.next(),t.discriminant=this.parseHeaderExpression();let s=t.cases=[];this.expect(5),this.state.labels.push(Ur),this.scope.enter(256);let e;for(let r;!this.match(8);)if(this.match(61)||this.match(65)){let i=this.match(61);e&&this.finishNode(e,"SwitchCase"),s.push(e=this.startNode()),e.consequent=[],this.next(),i?e.test=this.parseExpression():(r&&this.raise(u.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),r=!0,e.test=null),this.expect(14)}else e?e.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),e&&this.finishNode(e,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(t,"SwitchStatement")}parseThrowStatement(t){return this.next(),this.hasPrecedingLineBreak()&&this.raise(u.NewlineAfterThrow,this.state.lastTokEndLoc),t.argument=this.parseExpression(),this.semicolon(),this.finishNode(t,"ThrowStatement")}parseCatchClauseParam(){let t=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&t.type==="Identifier"?8:0),this.checkLVal(t,{type:"CatchClause"},9),t}parseTryStatement(t){if(this.next(),t.block=this.parseBlock(),t.handler=null,this.match(62)){let s=this.startNode();this.next(),this.match(10)?(this.expect(10),s.param=this.parseCatchClauseParam(),this.expect(11)):(s.param=null,this.scope.enter(0)),s.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),t.handler=this.finishNode(s,"CatchClause")}return t.finalizer=this.eat(67)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(u.NoCatchOrFinally,t),this.finishNode(t,"TryStatement")}parseVarStatement(t,s,e=!1){return this.next(),this.parseVar(t,!1,s,e),this.semicolon(),this.finishNode(t,"VariableDeclaration")}parseWhileStatement(t){return this.next(),t.test=this.parseHeaderExpression(),this.state.labels.push(Se),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(u.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(t,"WithStatement")}parseEmptyStatement(t){return this.next(),this.finishNode(t,"EmptyStatement")}parseLabeledStatement(t,s,e,r){for(let a of this.state.labels)a.name===s&&this.raise(u.LabelRedeclaration,e,{labelName:s});let i=vs(this.state.type)?1:this.match(71)?2:null;for(let a=this.state.labels.length-1;a>=0;a--){let n=this.state.labels[a];if(n.statementStart===t.start)n.statementStart=this.sourceToOffsetPos(this.state.start),n.kind=i;else break}return this.state.labels.push({name:s,kind:i,statementStart:this.sourceToOffsetPos(this.state.start)}),t.body=r&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),t.label=e,this.finishNode(t,"LabeledStatement")}parseExpressionStatement(t,s,e){return t.expression=s,this.semicolon(),this.finishNode(t,"ExpressionStatement")}parseBlock(t=!1,s=!0,e){let r=this.startNode();return t&&this.state.strictErrors.clear(),this.expect(5),s&&this.scope.enter(0),this.parseBlockBody(r,t,!1,8,e),s&&this.scope.exit(),this.finishNode(r,"BlockStatement")}isValidDirective(t){return t.type==="ExpressionStatement"&&t.expression.type==="StringLiteral"&&!t.expression.extra.parenthesized}parseBlockBody(t,s,e,r,i){let a=t.body=[],n=t.directives=[];this.parseBlockOrModuleBlockBody(a,s?n:void 0,e,r,i)}parseBlockOrModuleBlockBody(t,s,e,r,i){let a=this.state.strict,n=!1,o=!1;for(;!this.match(r);){let l=e?this.parseModuleItem():this.parseStatementListItem();if(s&&!o){if(this.isValidDirective(l)){let h=this.stmtToDirective(l);s.push(h),!n&&h.value.value==="use strict"&&(n=!0,this.setStrict(!0));continue}o=!0,this.state.strictErrors.clear()}t.push(l)}i==null||i.call(this,n),a||this.setStrict(!1),this.next()}parseFor(t,s){return t.init=s,this.semicolon(!1),t.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(11)?null:this.parseExpression(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,s,e){let r=this.match(58);return this.next(),r?e!==null&&this.unexpected(e):t.await=e!==null,s.type==="VariableDeclaration"&&s.declarations[0].init!=null&&(!r||!this.options.annexB||this.state.strict||s.kind!=="var"||s.declarations[0].id.type!=="Identifier")&&this.raise(u.ForInOfLoopInitializer,s,{type:r?"ForInStatement":"ForOfStatement"}),s.type==="AssignmentPattern"&&this.raise(u.InvalidLhs,s,{ancestor:{type:"ForStatement"}}),t.left=s,t.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),t.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,r?"ForInStatement":"ForOfStatement")}parseVar(t,s,e,r=!1){let i=t.declarations=[];for(t.kind=e;;){let a=this.startNode();if(this.parseVarId(a,e),a.init=this.eat(29)?s?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!r&&(a.id.type!=="Identifier"&&!(s&&(this.match(58)||this.isContextual(102)))?this.raise(u.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(e==="const"||e==="using"||e==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(u.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:e})),i.push(this.finishNode(a,"VariableDeclarator")),!this.eat(12))break}return t}parseVarId(t,s){let e=this.parseBindingAtom();s==="using"||s==="await using"?(e.type==="ArrayPattern"||e.type==="ObjectPattern")&&this.raise(u.UsingDeclarationHasBindingPattern,e.loc.start):e.type==="VoidPattern"&&this.raise(u.UnexpectedVoidPattern,e.loc.start),this.checkLVal(e,{type:"VariableDeclarator"},s==="var"?5:8201),t.id=e}parseAsyncFunctionExpression(t){return this.parseFunction(t,8)}parseFunction(t,s=0){let e=s&2,r=!!(s&1),i=r&&!(s&4),a=!!(s&8);this.initFunction(t,a),this.match(55)&&(e&&this.raise(u.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),r&&(t.id=this.parseFunctionId(i));let n=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(514),this.prodParam.enter(fe(a,t.generator)),r||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(t,r?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),r&&!e&&this.registerFunctionStatementId(t),this.state.maybeInArrowParameters=n,t}parseFunctionId(t){return t||S(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,s){this.expect(10),this.expressionScope.enter(gr()),t.params=this.parseBindingList(11,41,2|(s?4:0)),this.expressionScope.exit()}registerFunctionStatementId(t){t.id&&this.scope.declareName(t.id.name,!this.options.annexB||this.state.strict||t.generator||t.async?this.scope.treatFunctionsAsVar?5:8201:17,t.id.loc.start)}parseClass(t,s,e){this.next();let r=this.state.strict;return this.state.strict=!0,this.parseClassId(t,s,e),this.parseClassSuper(t),t.body=this.parseClassBody(!!t.superClass,r),this.finishNode(t,s?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(t){return t.type==="Identifier"&&t.name==="constructor"||t.type==="StringLiteral"&&t.value==="constructor"}isNonstaticConstructor(t){return!t.computed&&!t.static&&this.nameIsConstructor(t.key)}parseClassBody(t,s){this.classScope.enter();let e={hadConstructor:!1,hadSuperClass:t},r=[],i=this.startNode();if(i.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(r.length>0)throw this.raise(u.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){r.push(this.parseDecorator());continue}let a=this.startNode();r.length&&(a.decorators=r,this.resetStartLocationFromNode(a,r[0]),r=[]),this.parseClassMember(i,a,e),a.kind==="constructor"&&a.decorators&&a.decorators.length>0&&this.raise(u.DecoratorConstructor,a)}}),this.state.strict=s,this.next(),r.length)throw this.raise(u.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(i,"ClassBody")}parseClassMemberFromModifier(t,s){let e=this.parseIdentifier(!0);if(this.isClassMethod()){let r=s;return r.kind="method",r.computed=!1,r.key=e,r.static=!1,this.pushClassMethod(t,r,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let r=s;return r.computed=!1,r.key=e,r.static=!1,t.body.push(this.parseClassProperty(r)),!0}return this.resetPreviousNodeTrailingComments(e),!1}parseClassMember(t,s,e){let r=this.isContextual(106);if(r){if(this.parseClassMemberFromModifier(t,s))return;if(this.eat(5)){this.parseClassStaticBlock(t,s);return}}this.parseClassMemberWithIsStatic(t,s,e,r)}parseClassMemberWithIsStatic(t,s,e,r){let i=s,a=s,n=s,o=s,l=s,h=i,c=i;if(s.static=r,this.parsePropertyNamePrefixOperator(s),this.eat(55)){h.kind="method";let w=this.match(139);if(this.parseClassElementName(h),this.parsePostMemberNameModifiers(h),w){this.pushClassPrivateMethod(t,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(u.ConstructorIsGenerator,i.key),this.pushClassMethod(t,i,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&S(this.state.type),m=this.parseClassElementName(s),A=d?m.name:null,C=this.isPrivateName(m),F=this.state.startLoc;if(this.parsePostMemberNameModifiers(c),this.isClassMethod()){if(h.kind="method",C){this.pushClassPrivateMethod(t,a,!1,!1);return}let w=this.isNonstaticConstructor(i),N=!1;w&&(i.kind="constructor",e.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(u.DuplicateConstructor,m),w&&this.hasPlugin("typescript")&&s.override&&this.raise(u.OverrideOnConstructor,m),e.hadConstructor=!0,N=e.hadSuperClass),this.pushClassMethod(t,i,!1,!1,w,N)}else if(this.isClassProperty())C?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n);else if(A==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(m);let w=this.eat(55);c.optional&&this.unexpected(F),h.kind="method";let N=this.match(139);this.parseClassElementName(h),this.parsePostMemberNameModifiers(c),N?this.pushClassPrivateMethod(t,a,w,!0):(this.isNonstaticConstructor(i)&&this.raise(u.ConstructorIsAsync,i.key),this.pushClassMethod(t,i,w,!0,!1,!1))}else if((A==="get"||A==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(m),h.kind=A;let w=this.match(139);this.parseClassElementName(i),w?this.pushClassPrivateMethod(t,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(u.ConstructorIsAccessor,i.key),this.pushClassMethod(t,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(A==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(m);let w=this.match(139);this.parseClassElementName(n),this.pushClassAccessorProperty(t,l,w)}else this.isLineTerminator()?C?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n):this.unexpected()}parseClassElementName(t){let{type:s,value:e}=this.state;if((s===132||s===134)&&t.static&&e==="prototype"&&this.raise(u.StaticPrototype,this.state.startLoc),s===139){e==="constructor"&&this.raise(u.ConstructorClassPrivateField,this.state.startLoc);let r=this.parsePrivateName();return t.key=r,r}return this.parsePropertyName(t),t.key}parseClassStaticBlock(t,s){var i;this.scope.enter(720);let e=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let r=s.body=[];this.parseBlockOrModuleBlockBody(r,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=e,t.body.push(this.finishNode(s,"StaticBlock")),(i=s.decorators)!=null&&i.length&&this.raise(u.DecoratorStaticBlock,s)}pushClassProperty(t,s){!s.computed&&this.nameIsConstructor(s.key)&&this.raise(u.ConstructorClassField,s.key),t.body.push(this.parseClassProperty(s))}pushClassPrivateProperty(t,s){let e=this.parseClassPrivateProperty(s);t.body.push(e),this.classScope.declarePrivateName(this.getPrivateNameSV(e.key),0,e.key.loc.start)}pushClassAccessorProperty(t,s,e){!e&&!s.computed&&this.nameIsConstructor(s.key)&&this.raise(u.ConstructorClassField,s.key);let r=this.parseClassAccessorProperty(s);t.body.push(r),e&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.loc.start)}pushClassMethod(t,s,e,r,i,a){t.body.push(this.parseMethod(s,e,r,i,a,"ClassMethod",!0))}pushClassPrivateMethod(t,s,e,r){let i=this.parseMethod(s,e,r,!1,!1,"ClassPrivateMethod",!0);t.body.push(i);let a=i.kind==="get"?i.static?6:2:i.kind==="set"?i.static?5:1:0;this.declareClassPrivateMethodInScope(i,a)}declareClassPrivateMethodInScope(t,s){this.classScope.declarePrivateName(this.getPrivateNameSV(t.key),s,t.key.loc.start)}parsePostMemberNameModifiers(t){}parseClassPrivateProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassPrivateProperty")}parseClassProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassProperty")}parseClassAccessorProperty(t){return this.parseInitializer(t),this.semicolon(),this.finishNode(t,"ClassAccessorProperty")}parseInitializer(t){this.scope.enter(592),this.expressionScope.enter(zt()),this.prodParam.enter(0),t.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,s,e,r=8331){if(S(this.state.type))t.id=this.parseIdentifier(),s&&this.declareNameFromIdentifier(t.id,r);else if(e||!s)t.id=null;else throw this.raise(u.MissingClassName,this.state.startLoc)}parseClassSuper(t){t.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(t,s){var d;let e=this.parseMaybeImportPhase(t,!0),r=this.maybeParseExportDefaultSpecifier(t,e),i=!r||this.eat(12),a=i&&this.eatExportStar(t),n=a&&this.maybeParseExportNamespaceSpecifier(t),o=i&&(!n||this.eat(12)),l=r||a;if(a&&!n){if(r&&this.unexpected(),s)throw this.raise(u.UnsupportedDecoratorExport,t);return this.parseExportFrom(t,!0),this.sawUnambiguousESM=!0,this.finishNode(t,"ExportAllDeclaration")}let h=this.maybeParseExportNamedSpecifiers(t);r&&i&&!a&&!h&&this.unexpected(null,5),n&&o&&this.unexpected(null,98);let c;if(l||h){if(c=!1,s)throw this.raise(u.UnsupportedDecoratorExport,t);this.parseExportFrom(t,l)}else c=this.maybeParseExportDeclaration(t);if(l||h||c){let m=t;if(this.checkExport(m,!0,!1,!!m.source),((d=m.declaration)==null?void 0:d.type)==="ClassDeclaration")this.maybeTakeDecorators(s,m.declaration,m);else if(s)throw this.raise(u.UnsupportedDecoratorExport,t);return this.sawUnambiguousESM=!0,this.finishNode(m,"ExportNamedDeclaration")}if(this.eat(65)){let m=t,A=this.parseExportDefaultExpression();if(m.declaration=A,A.type==="ClassDeclaration")this.maybeTakeDecorators(s,A,m);else if(s)throw this.raise(u.UnsupportedDecoratorExport,t);return this.checkExport(m,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(m,"ExportDefaultDeclaration")}throw this.unexpected(null,5)}eatExportStar(t){return this.eat(55)}maybeParseExportDefaultSpecifier(t,s){if(s||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",s==null?void 0:s.loc.start);let e=s||this.parseIdentifier(!0),r=this.startNodeAtNode(e);return r.exported=e,t.specifiers=[this.finishNode(r,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(t){if(this.isContextual(93)){t.specifiers??(t.specifiers=[]);let s=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),s.exported=this.parseModuleExportName(),t.specifiers.push(this.finishNode(s,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(t){if(this.match(5)){let s=t;s.specifiers||(s.specifiers=[]);let e=s.exportKind==="type";return s.specifiers.push(...this.parseExportSpecifiers(e)),s.source=null,s.attributes=[],s.declaration=null,!0}return!1}maybeParseExportDeclaration(t){return this.shouldParseExportDeclaration()?(t.specifiers=[],t.source=null,t.attributes=[],t.declaration=this.parseExportDeclaration(t),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(68))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(80))return this.parseClass(t,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(u.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(u.UnsupportedDefaultExport,this.state.startLoc);let s=this.parseMaybeAssignAllowIn();return this.semicolon(),s}parseExportDeclaration(t){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(S(t)){if(t===95&&!this.state.containsEsc||t===100)return!1;if((t===130||t===129)&&!this.state.containsEsc){let r=this.nextTokenStart(),i=this.input.charCodeAt(r);if(i===123||this.chStartsBindingIdentifier(i,r)&&!this.input.startsWith("from",r))return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let s=this.nextTokenStart(),e=this.isUnparsedContextual(s,"from");if(this.input.charCodeAt(s)===44||S(this.state.type)&&e)return!0;if(this.match(65)&&e){let r=this.input.charCodeAt(this.nextTokenStartSince(s+4));return r===34||r===39}return!1}parseExportFrom(t,s){this.eatContextual(98)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t),this.checkJSONModuleImport(t)):s&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(u.DecoratorBeforeExport,this.state.startLoc),!0):this.isUsing()?(this.raise(u.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(this.raise(u.UsingDeclarationExport,this.state.startLoc),!0):t===74||t===75||t===68||t===80||this.isLet()||this.isAsyncFunction()}checkExport(t,s,e,r){var i,a;if(s){if(e){if(this.checkDuplicateExports(t,"default"),this.hasPlugin("exportDefaultFrom")){let n=t.declaration;n.type==="Identifier"&&n.name==="from"&&n.end-n.start===4&&!((i=n.extra)!=null&&i.parenthesized)&&this.raise(u.ExportDefaultFromAsIdentifier,n)}}else if((a=t.specifiers)!=null&&a.length)for(let n of t.specifiers){let{exported:o}=n,l=o.type==="Identifier"?o.name:o.value;if(this.checkDuplicateExports(n,l),!r&&n.local){let{local:h}=n;h.type!=="Identifier"?this.raise(u.ExportBindingIsString,n,{localName:h.value,exportName:l}):(this.checkReservedWord(h.name,h.loc.start,!0,!1),this.scope.checkLocalExport(h))}}else if(t.declaration){let n=t.declaration;if(n.type==="FunctionDeclaration"||n.type==="ClassDeclaration"){let{id:o}=n;if(!o)throw new Error("Assertion failure");this.checkDuplicateExports(t,o.name)}else if(n.type==="VariableDeclaration")for(let o of n.declarations)this.checkDeclaration(o.id)}}}checkDeclaration(t){if(t.type==="Identifier")this.checkDuplicateExports(t,t.name);else if(t.type==="ObjectPattern")for(let s of t.properties)this.checkDeclaration(s);else if(t.type==="ArrayPattern")for(let s of t.elements)s&&this.checkDeclaration(s);else t.type==="ObjectProperty"?this.checkDeclaration(t.value):t.type==="RestElement"?this.checkDeclaration(t.argument):t.type==="AssignmentPattern"&&this.checkDeclaration(t.left)}checkDuplicateExports(t,s){this.exportedIdentifiers.has(s)&&(s==="default"?this.raise(u.DuplicateDefaultExport,t):this.raise(u.DuplicateExport,t,{exportName:s})),this.exportedIdentifiers.add(s)}parseExportSpecifiers(t){let s=[],e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else if(this.expect(12),this.eat(8))break;let r=this.isContextual(130),i=this.match(134),a=this.startNode();a.local=this.parseModuleExportName(),s.push(this.parseExportSpecifier(a,i,t,r))}return s}parseExportSpecifier(t,s,e,r){return this.eatContextual(93)?t.exported=this.parseModuleExportName():s?t.exported=this.cloneStringLiteral(t.local):t.exported||(t.exported=this.cloneIdentifier(t.local)),this.finishNode(t,"ExportSpecifier")}parseModuleExportName(){if(this.match(134)){let t=this.parseStringLiteral(this.state.value),s=jr.exec(t.value);return s&&this.raise(u.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:s[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}isJSONModuleImport(t){return t.assertions!=null?t.assertions.some(({key:s,value:e})=>e.value==="json"&&(s.type==="Identifier"?s.name==="type":s.value==="type")):!1}checkImportReflection(t){var r;let{specifiers:s}=t,e=s.length===1?s[0].type:null;t.phase==="source"?e!=="ImportDefaultSpecifier"&&this.raise(u.SourcePhaseImportRequiresDefault,s[0].loc.start):t.phase==="defer"?e!=="ImportNamespaceSpecifier"&&this.raise(u.DeferImportRequiresNamespace,s[0].loc.start):t.module&&(e!=="ImportDefaultSpecifier"&&this.raise(u.ImportReflectionNotBinding,s[0].loc.start),((r=t.assertions)==null?void 0:r.length)>0&&this.raise(u.ImportReflectionHasAssertion,s[0].loc.start))}checkJSONModuleImport(t){if(this.isJSONModuleImport(t)&&t.type!=="ExportAllDeclaration"){let{specifiers:s}=t;if(s!=null){let e=s.find(r=>{let i;if(r.type==="ExportSpecifier"?i=r.local:r.type==="ImportSpecifier"&&(i=r.imported),i!==void 0)return i.type==="Identifier"?i.name!=="default":i.value!=="default"});e!==void 0&&this.raise(u.ImportJSONBindingNotDefault,e.loc.start)}}}isPotentialImportPhase(t){return t?!1:this.isContextual(105)||this.isContextual(97)}applyImportPhase(t,s,e,r){s||(this.hasPlugin("importReflection")&&(t.module=!1),e==="source"?(this.expectPlugin("sourcePhaseImports",r),t.phase="source"):e==="defer"?(this.expectPlugin("deferredImportEvaluation",r),t.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(t.phase=null))}parseMaybeImportPhase(t,s){if(!this.isPotentialImportPhase(s))return this.applyImportPhase(t,s,null),null;let e=this.startNode(),r=this.parseIdentifierName(!0),{type:i}=this.state;return(L(i)?i!==98||this.lookaheadCharCode()===102:i!==12)?(this.applyImportPhase(t,s,r,e.loc.start),null):(this.applyImportPhase(t,s,null),this.createIdentifier(e,r))}isPrecedingIdImportPhase(t){let{type:s}=this.state;return S(s)?s!==98||this.lookaheadCharCode()===102:s!==12}parseImport(t){return this.match(134)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,s){t.specifiers=[];let e=!this.maybeParseDefaultImportSpecifier(t,s)||this.eat(12),r=e&&this.maybeParseStarImportSpecifier(t);return e&&!r&&this.parseNamedImportSpecifiers(t),this.expectContextual(98),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){return t.specifiers??(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportReflection(t),this.checkJSONModuleImport(t),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(134)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(t,s,e){s.local=this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(s,e))}finishImportSpecifier(t,s,e=8201){return this.checkLVal(t.local,{type:s},e),this.finishNode(t,s)}parseImportAttributes(){this.expect(5);let t=[],s=new Set;do{if(this.match(8))break;let e=this.startNode(),r=this.state.value;if(s.has(r)&&this.raise(u.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),s.add(r),this.match(134)?e.key=this.parseStringLiteral(r):e.key=this.parseIdentifier(!0),this.expect(14),!this.match(134))throw this.raise(u.ModuleAttributeInvalidValue,this.state.startLoc);e.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(e,"ImportAttribute"))}while(this.eat(12));return this.expect(8),t}parseModuleAttributes(){let t=[],s=new Set;do{let e=this.startNode();if(e.key=this.parseIdentifier(!0),e.key.name!=="type"&&this.raise(u.ModuleAttributeDifferentFromType,e.key),s.has(e.key.name)&&this.raise(u.ModuleAttributesWithDuplicateKeys,e.key,{key:e.key.name}),s.add(e.key.name),this.expect(14),!this.match(134))throw this.raise(u.ModuleAttributeInvalidValue,this.state.startLoc);e.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(e,"ImportAttribute"))}while(this.eat(12));return t}maybeParseImportAttributes(t){let s;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),s=this.parseImportAttributes()}else this.isContextual(94)&&!this.hasPrecedingLineBreak()?(this.hasPlugin("deprecatedImportAssert")||this.raise(u.ImportAttributesUseAssert,this.state.startLoc),this.addExtra(t,"deprecatedAssertSyntax",!0),this.next(),s=this.parseImportAttributes()):s=[];t.attributes=s}maybeParseDefaultImportSpecifier(t,s){if(s){let e=this.startNodeAtNode(s);return e.local=s,t.specifiers.push(this.finishImportSpecifier(e,"ImportDefaultSpecifier")),!0}else if(L(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(55)){let s=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(t,s,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let s=!0;for(this.expect(5);!this.eat(8);){if(s)s=!1;else{if(this.eat(14))throw this.raise(u.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let e=this.startNode(),r=this.match(134),i=this.isContextual(130);e.imported=this.parseModuleExportName();let a=this.parseImportSpecifier(e,r,t.importKind==="type"||t.importKind==="typeof",i,void 0);t.specifiers.push(a)}}parseImportSpecifier(t,s,e,r,i){if(this.eatContextual(93))t.local=this.parseIdentifier();else{let{imported:a}=t;if(s)throw this.raise(u.ImportBindingIsString,t,{importName:a.value});this.checkReservedWord(a.name,t.loc.start,!0,!0),t.local||(t.local=this.cloneIdentifier(a))}return this.finishImportSpecifier(t,"ImportSpecifier",i)}isThisParam(t){return t.type==="Identifier"&&t.name==="this"}},Kt=class extends Vr{constructor(t,s,e){let r=bs(t);super(r,s),this.options=r,this.initializeScopes(),this.plugins=e,this.filename=r.sourceFilename,this.startIndex=r.startIndex;let i=0;r.allowAwaitOutsideFunction&&(i|=1),r.allowReturnOutsideFunction&&(i|=2),r.allowImportExportEverywhere&&(i|=8),r.allowSuperOutsideMethod&&(i|=16),r.allowUndeclaredExports&&(i|=64),r.allowNewTargetOutsideFunction&&(i|=4),r.allowYieldOutsideFunction&&(i|=32),r.ranges&&(i|=128),r.tokens&&(i|=256),r.createImportExpressions&&(i|=512),r.createParenthesizedExpressions&&(i|=1024),r.errorRecovery&&(i|=2048),r.attachComment&&(i|=4096),r.annexB&&(i|=8192),this.optionFlags=i}getScopeHandler(){return We}parse(){this.enterInitialScopes();let t=this.startNode(),s=this.startNode();this.nextToken(),t.errors=null;let e=this.parseTopLevel(t,s);return e.errors=this.state.errors,e.comments.length=this.state.commentsLen,e}};function Jt(t,s){if((s==null?void 0:s.sourceType)==="unambiguous"){s=Object.assign({},s);try{s.sourceType="module";let e=ie(s,t),r=e.parse();if(e.sawUnambiguousESM)return r;if(e.ambiguousScriptDifferentAst)try{return s.sourceType="script",ie(s,t).parse()}catch{}else r.program.sourceType="script";return r}catch(e){try{return s.sourceType="script",ie(s,t).parse()}catch{}throw e}}else return ie(s,t).parse()}function Wt(t,s){let e=ie(s,t);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function zr(t){let s={};for(let e of Object.keys(t))s[e]=vt(t[e]);return s}zr(ws);function ie(t,s){let e=Kt,r=new Map;if(t!=null&&t.plugins){for(let i of t.plugins){let a,n;typeof i=="string"?a=i:[a,n]=i,r.has(a)||r.set(a,n||{})}Br(r),e=Hr(r)}return new e(t,s,r)}var mt=new Map;function Hr(t){let s=[];for(let i of Or)t.has(i)&&s.push(i);let e=s.join("|"),r=mt.get(e);if(!r){r=Kt;for(let i of s)r=$t[i](r);mt.set(e,r)}return r}function Xt(t){return(s,e,r)=>{let i=!!(r!=null&&r.backwards);if(e===!1)return!1;let{length:a}=s,n=e;for(;n>=0&&n<a;){let o=s.charAt(n);if(t instanceof RegExp){if(!t.test(o))return n}else if(!t.includes(o))return n;i?n--:n++}return n===-1||n===a?n:!1}}var qr=Xt(" "),$r=Xt(/[^\n\r]/u);function Kr(t,s){if(s===!1)return!1;if(t.charAt(s)==="/"&&t.charAt(s+1)==="*"){for(let e=s+2;e<t.length;++e)if(t.charAt(e)==="*"&&t.charAt(e+1)==="/")return e+2}return s}var Jr=Kr,ft=t=>t===`
|
|
9
|
+
`||t==="\r"||t==="\u2028"||t==="\u2029";function Wr(t,s,e){let r=!!(e!=null&&e.backwards);if(s===!1)return!1;let i=t.charAt(s);if(r){if(t.charAt(s-1)==="\r"&&i===`
|
|
10
|
+
`)return s-2;if(ft(i))return s-1}else{if(i==="\r"&&t.charAt(s+1)===`
|
|
11
|
+
`)return s+2;if(ft(i))return s+1}return s}var Xr=Wr;function Gr(t,s){return s===!1?!1:t.charAt(s)==="/"&&t.charAt(s+1)==="/"?$r(t,s):s}var Yr=Gr;function Qr(t,s){let e=null,r=s;for(;r!==e;)e=r,r=qr(t,r),r=Jr(t,r),r=Yr(t,r),r=Xr(t,r);return r}var Zr=Qr;function ei(t){let s=[];for(let e of t)try{return e()}catch(r){s.push(r)}throw Object.assign(new Error("All combinations failed"),{errors:s})}function ti(t){if(!t.startsWith("#!"))return"";let s=t.indexOf(`
|
|
12
|
+
`);return s===-1?t:t.slice(0,s)}var Gt=ti,Xe=(t,s)=>(e,r,...i)=>e|1&&r==null?void 0:(s.call(r)??r[t]).apply(r,i),si=Array.prototype.findLast??function(t){for(let s=this.length-1;s>=0;s--){let e=this[s];if(t(e,s,this))return e}},ri=Xe("findLast",function(){if(Array.isArray(this))return si}),ii=ri;function ai(t){return this[t<0?this.length+t:t]}var ni=Xe("at",function(){if(Array.isArray(this)||typeof this=="string")return ai}),oi=ni;function U(t){var r,i,a;let s=((r=t.range)==null?void 0:r[0])??t.start,e=(a=((i=t.declaration)==null?void 0:i.decorators)??t.decorators)==null?void 0:a[0];return e?Math.min(U(e),s):s}function O(t){var s;return((s=t.range)==null?void 0:s[1])??t.end}function li(t){let s=new Set(t);return e=>s.has(e==null?void 0:e.type)}var Ge=li,hi=Ge(["Block","CommentBlock","MultiLine"]),Ye=hi,pi=Ge(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),ui=pi,Ie=new WeakMap;function ci(t){return Ie.has(t)||Ie.set(t,Ye(t)&&t.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(t.value)),Ie.get(t)}var di=ci;function mi(t){if(!Ye(t))return!1;let s=`*${t.value}*`.split(`
|
|
13
|
+
`);return s.length>1&&s.every(e=>e.trimStart()[0]==="*")}var Ne=new WeakMap;function fi(t){return Ne.has(t)||Ne.set(t,mi(t)),Ne.get(t)}var yt=fi;function yi(t){if(t.length<2)return;let s;for(let e=t.length-1;e>=0;e--){let r=t[e];if(s&&O(r)===U(s)&&yt(r)&&yt(s)&&(t.splice(e+1,1),r.value+="*//*"+s.value,r.range=[U(r),O(s)]),!ui(r)&&!Ye(r))throw new TypeError(`Unknown comment type: "${r.type}".`);s=r}}var xi=yi;function Pi(t){return t!==null&&typeof t=="object"}var Ai=Pi,se=null;function ne(t){if(se!==null&&typeof se.property){let s=se;return se=ne.prototype=null,s}return se=ne.prototype=t??Object.create(null),new ne}var gi=10;for(let t=0;t<=gi;t++)ne();function Ti(t){return ne(t)}function bi(t,s="type"){Ti(t);function e(r){let i=r[s],a=t[i];if(!Array.isArray(a))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:r});return a}return e}var Ei=bi,p=[["decorators","key","typeAnnotation","value"],[],["elementType"],["expression"],["expression","typeAnnotation"],["left","right"],["argument"],["directives","body"],["label"],["callee","typeArguments","arguments"],["body"],["decorators","id","typeParameters","superClass","superTypeArguments","mixins","implements","body","superTypeParameters"],["id","typeParameters"],["decorators","key","typeParameters","params","returnType","body"],["decorators","variance","key","typeAnnotation","value"],["name","typeAnnotation"],["test","consequent","alternate"],["checkType","extendsType","trueType","falseType"],["value"],["id","body"],["declaration","specifiers","source","attributes"],["id"],["id","typeParameters","extends","body"],["typeAnnotation"],["id","typeParameters","right"],["body","test"],["members"],["id","init"],["exported"],["left","right","body"],["id","typeParameters","params","predicate","returnType","body"],["id","params","body","typeParameters","returnType"],["key","value"],["local"],["objectType","indexType"],["typeParameter"],["types"],["node"],["object","property"],["argument","cases"],["pattern","body","guard"],["literal"],["decorators","key","value"],["expressions"],["qualification","id"],["decorators","key","typeAnnotation"],["typeParameters","params","returnType"],["expression","typeArguments"],["params"],["parameterName","typeAnnotation"]],Ci={AccessorProperty:p[0],AnyTypeAnnotation:p[1],ArgumentPlaceholder:p[1],ArrayExpression:["elements"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrayTypeAnnotation:p[2],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],AsConstExpression:p[3],AsExpression:p[4],AssignmentExpression:p[5],AssignmentPattern:["left","right","decorators","typeAnnotation"],AwaitExpression:p[6],BigIntLiteral:p[1],BigIntLiteralTypeAnnotation:p[1],BigIntTypeAnnotation:p[1],BinaryExpression:p[5],BindExpression:["object","callee"],BlockStatement:p[7],BooleanLiteral:p[1],BooleanLiteralTypeAnnotation:p[1],BooleanTypeAnnotation:p[1],BreakStatement:p[8],CallExpression:p[9],CatchClause:["param","body"],ChainExpression:p[3],ClassAccessorProperty:p[0],ClassBody:p[10],ClassDeclaration:p[11],ClassExpression:p[11],ClassImplements:p[12],ClassMethod:p[13],ClassPrivateMethod:p[13],ClassPrivateProperty:p[14],ClassProperty:p[14],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:p[15],ConditionalExpression:p[16],ConditionalTypeAnnotation:p[17],ContinueStatement:p[8],DebuggerStatement:p[1],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclaredPredicate:p[18],DeclareEnum:p[19],DeclareExportAllDeclaration:["source","attributes"],DeclareExportDeclaration:p[20],DeclareFunction:["id","predicate"],DeclareHook:p[21],DeclareInterface:p[22],DeclareModule:p[19],DeclareModuleExports:p[23],DeclareNamespace:p[19],DeclareOpaqueType:["id","typeParameters","supertype","lowerBound","upperBound"],DeclareTypeAlias:p[24],DeclareVariable:p[21],Decorator:p[3],Directive:p[18],DirectiveLiteral:p[1],DoExpression:p[10],DoWhileStatement:p[25],EmptyStatement:p[1],EmptyTypeAnnotation:p[1],EnumBigIntBody:p[26],EnumBigIntMember:p[27],EnumBooleanBody:p[26],EnumBooleanMember:p[27],EnumDeclaration:p[19],EnumDefaultedMember:p[21],EnumNumberBody:p[26],EnumNumberMember:p[27],EnumStringBody:p[26],EnumStringMember:p[27],EnumSymbolBody:p[26],ExistsTypeAnnotation:p[1],ExperimentalRestProperty:p[6],ExperimentalSpreadProperty:p[6],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportDefaultSpecifier:p[28],ExportNamedDeclaration:p[20],ExportNamespaceSpecifier:p[28],ExportSpecifier:["local","exported"],ExpressionStatement:p[3],File:["program"],ForInStatement:p[29],ForOfStatement:p[29],ForStatement:["init","test","update","body"],FunctionDeclaration:p[30],FunctionExpression:p[30],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:p[15],GenericTypeAnnotation:p[12],HookDeclaration:p[31],HookTypeAnnotation:["params","returnType","rest","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:p[16],ImportAttribute:p[32],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:p[33],ImportExpression:["source","options"],ImportNamespaceSpecifier:p[33],ImportSpecifier:["imported","local"],IndexedAccessType:p[34],InferredPredicate:p[1],InferTypeAnnotation:p[35],InterfaceDeclaration:p[22],InterfaceExtends:p[12],InterfaceTypeAnnotation:["extends","body"],InterpreterDirective:p[1],IntersectionTypeAnnotation:p[36],JsExpressionRoot:p[37],JsonRoot:p[37],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXClosingFragment:p[1],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:p[1],JSXExpressionContainer:p[3],JSXFragment:["openingFragment","children","closingFragment"],JSXIdentifier:p[1],JSXMemberExpression:p[38],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeArguments","attributes"],JSXOpeningFragment:p[1],JSXSpreadAttribute:p[6],JSXSpreadChild:p[3],JSXText:p[1],KeyofTypeAnnotation:p[6],LabeledStatement:["label","body"],Literal:p[1],LogicalExpression:p[5],MatchArrayPattern:["elements","rest"],MatchAsPattern:["pattern","target"],MatchBindingPattern:p[21],MatchExpression:p[39],MatchExpressionCase:p[40],MatchIdentifierPattern:p[21],MatchLiteralPattern:p[41],MatchMemberPattern:["base","property"],MatchObjectPattern:["properties","rest"],MatchObjectPatternProperty:["key","pattern"],MatchOrPattern:["patterns"],MatchRestPattern:p[6],MatchStatement:p[39],MatchStatementCase:p[40],MatchUnaryPattern:p[6],MatchWildcardPattern:p[1],MemberExpression:p[38],MetaProperty:["meta","property"],MethodDefinition:p[42],MixedTypeAnnotation:p[1],ModuleExpression:p[10],NeverTypeAnnotation:p[1],NewExpression:p[9],NGChainedExpression:p[43],NGEmptyExpression:p[1],NGMicrosyntax:p[10],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:p[1],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:p[32],NGPipeExpression:["left","right","arguments"],NGRoot:p[37],NullableTypeAnnotation:p[23],NullLiteral:p[1],NullLiteralTypeAnnotation:p[1],NumberLiteralTypeAnnotation:p[1],NumberTypeAnnotation:p[1],NumericLiteral:p[1],ObjectExpression:["properties"],ObjectMethod:p[13],ObjectPattern:["decorators","properties","typeAnnotation"],ObjectProperty:p[42],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeCallProperty:p[18],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeInternalSlot:["id","value"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:p[6],OpaqueType:["id","typeParameters","supertype","impltype","lowerBound","upperBound"],OptionalCallExpression:p[9],OptionalIndexedAccessType:p[34],OptionalMemberExpression:p[38],ParenthesizedExpression:p[3],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:p[1],PipelineTopicExpression:p[3],Placeholder:p[1],PrivateIdentifier:p[1],PrivateName:p[21],Program:p[7],Property:p[32],PropertyDefinition:p[14],QualifiedTypeIdentifier:p[44],QualifiedTypeofIdentifier:p[44],RegExpLiteral:p[1],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:p[6],SatisfiesExpression:p[4],SequenceExpression:p[43],SpreadElement:p[6],StaticBlock:p[10],StringLiteral:p[1],StringLiteralTypeAnnotation:p[1],StringTypeAnnotation:p[1],Super:p[1],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],SymbolTypeAnnotation:p[1],TaggedTemplateExpression:["tag","typeArguments","quasi"],TemplateElement:p[1],TemplateLiteral:["quasis","expressions"],ThisExpression:p[1],ThisTypeAnnotation:p[1],ThrowStatement:p[6],TopicReference:p[1],TryStatement:["block","handler","finalizer"],TSAbstractAccessorProperty:p[45],TSAbstractKeyword:p[1],TSAbstractMethodDefinition:p[32],TSAbstractPropertyDefinition:p[45],TSAnyKeyword:p[1],TSArrayType:p[2],TSAsExpression:p[4],TSAsyncKeyword:p[1],TSBigIntKeyword:p[1],TSBooleanKeyword:p[1],TSCallSignatureDeclaration:p[46],TSClassImplements:p[47],TSConditionalType:p[17],TSConstructorType:p[46],TSConstructSignatureDeclaration:p[46],TSDeclareFunction:p[31],TSDeclareKeyword:p[1],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSEnumBody:p[26],TSEnumDeclaration:p[19],TSEnumMember:["id","initializer"],TSExportAssignment:p[3],TSExportKeyword:p[1],TSExternalModuleReference:p[3],TSFunctionType:p[46],TSImportEqualsDeclaration:["id","moduleReference"],TSImportType:["options","qualifier","typeArguments","source"],TSIndexedAccessType:p[34],TSIndexSignature:["parameters","typeAnnotation"],TSInferType:p[35],TSInstantiationExpression:p[47],TSInterfaceBody:p[10],TSInterfaceDeclaration:p[22],TSInterfaceHeritage:p[47],TSIntersectionType:p[36],TSIntrinsicKeyword:p[1],TSJSDocAllType:p[1],TSJSDocNonNullableType:p[23],TSJSDocNullableType:p[23],TSJSDocUnknownType:p[1],TSLiteralType:p[41],TSMappedType:["key","constraint","nameType","typeAnnotation"],TSMethodSignature:["key","typeParameters","params","returnType"],TSModuleBlock:p[10],TSModuleDeclaration:p[19],TSNamedTupleMember:["label","elementType"],TSNamespaceExportDeclaration:p[21],TSNeverKeyword:p[1],TSNonNullExpression:p[3],TSNullKeyword:p[1],TSNumberKeyword:p[1],TSObjectKeyword:p[1],TSOptionalType:p[23],TSParameterProperty:["parameter","decorators"],TSParenthesizedType:p[23],TSPrivateKeyword:p[1],TSPropertySignature:["key","typeAnnotation"],TSProtectedKeyword:p[1],TSPublicKeyword:p[1],TSQualifiedName:p[5],TSReadonlyKeyword:p[1],TSRestType:p[23],TSSatisfiesExpression:p[4],TSStaticKeyword:p[1],TSStringKeyword:p[1],TSSymbolKeyword:p[1],TSTemplateLiteralType:["quasis","types"],TSThisType:p[1],TSTupleType:["elementTypes"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSTypeAnnotation:p[23],TSTypeAssertion:p[4],TSTypeLiteral:p[26],TSTypeOperator:p[23],TSTypeParameter:["name","constraint","default"],TSTypeParameterDeclaration:p[48],TSTypeParameterInstantiation:p[48],TSTypePredicate:p[49],TSTypeQuery:["exprName","typeArguments"],TSTypeReference:["typeName","typeArguments"],TSUndefinedKeyword:p[1],TSUnionType:p[36],TSUnknownKeyword:p[1],TSVoidKeyword:p[1],TupleTypeAnnotation:["types","elementTypes"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeAlias:p[24],TypeAnnotation:p[23],TypeCastExpression:p[4],TypeofTypeAnnotation:["argument","typeArguments"],TypeOperator:p[23],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:p[48],TypeParameterInstantiation:p[48],TypePredicate:p[49],UnaryExpression:p[6],UndefinedTypeAnnotation:p[1],UnionTypeAnnotation:p[36],UnknownTypeAnnotation:p[1],UpdateExpression:p[6],V8IntrinsicIdentifier:p[1],VariableDeclaration:["declarations"],VariableDeclarator:p[27],Variance:p[1],VoidPattern:p[1],VoidTypeAnnotation:p[1],WhileStatement:p[25],WithStatement:["object","body"],YieldExpression:p[6]},Si=Ei(Ci),wi=Si;function xe(t,s){if(!Ai(t))return t;if(Array.isArray(t)){for(let r=0;r<t.length;r++)t[r]=xe(t[r],s);return t}if(s.onEnter){let r=s.onEnter(t)??t;if(r!==t)return xe(r,s);t=r}let e=wi(t);for(let r=0;r<e.length;r++)t[e[r]]=xe(t[e[r]],s);return s.onLeave&&(t=s.onLeave(t)||t),t}var Ii=xe;Ge(["RegExpLiteral","BigIntLiteral","NumericLiteral","StringLiteral","DirectiveLiteral","Literal","JSXText","TemplateElement","StringLiteralTypeAnnotation","NumberLiteralTypeAnnotation","BigIntLiteralTypeAnnotation"]);function Ni(t,s){let{parser:e,text:r}=s,{comments:i}=t,a=e==="oxc"&&s.oxcAstType==="ts";xi(i);let n=t.type==="File"?t.program:t;n.interpreter&&(i.unshift(n.interpreter),delete n.interpreter),a&&t.hashbang&&(i.unshift(t.hashbang),delete t.hashbang),t.type==="Program"&&(t.range=[0,r.length]);let o;return t=Ii(t,{onEnter(l){switch(l.type){case"ParenthesizedExpression":{let{expression:h}=l,c=U(l);if(h.type==="TypeCastExpression")return h.range=[c,O(l)],h;let d=!1;if(!a){if(!o){o=[];for(let A of i)di(A)&&o.push(O(A))}let m=ii(0,o,A=>A<=c);d=m&&r.slice(m,c).trim().length===0}return d?void 0:(h.extra={...h.extra,parenthesized:!0},h)}case"TemplateLiteral":if(l.expressions.length!==l.quasis.length-1)throw new Error("Malformed template literal.");break;case"TemplateElement":if(e==="flow"||e==="hermes"||e==="espree"||e==="typescript"||a){let h=U(l)+1,c=O(l)-(l.tail?1:2);l.range=[h,c]}break;case"VariableDeclaration":{let h=oi(0,l.declarations,-1);h!=null&&h.init&&r[O(h)]!==";"&&(l.range=[U(l),O(h)]);break}case"TSParenthesizedType":return l.typeAnnotation;case"TopicReference":t.extra={...t.extra,__isUsingHackPipeline:!0};break;case"TSUnionType":case"TSIntersectionType":if(l.types.length===1)return l.types[0];break;case"ImportExpression":e==="hermes"&&l.attributes&&!l.options&&(l.options=l.attributes);break}},onLeave(l){switch(l.type){case"LogicalExpression":if(Yt(l))return Be(l);break;case"TSImportType":!l.source&&l.argument.type==="TSLiteralType"&&(l.source=l.argument.literal,delete l.argument);break}}}),t}function Yt(t){return t.type==="LogicalExpression"&&t.right.type==="LogicalExpression"&&t.operator===t.right.operator}function Be(t){return Yt(t)?Be({type:"LogicalExpression",operator:t.operator,left:Be({type:"LogicalExpression",operator:t.operator,left:t.left,right:t.right.left,range:[U(t.left),O(t.right.left)]}),right:t.right.right,range:[U(t),O(t)]}):t}var ki=Ni;function vi(t,s){let e=new SyntaxError(t+" ("+s.loc.start.line+":"+s.loc.start.column+")");return Object.assign(e,s)}var Qt=vi,xt="Unexpected parseExpression() input: ";function Di(t){let{message:s,loc:e,reasonCode:r}=t;if(!e)return t;let{line:i,column:a}=e,n=t;(r==="MissingPlugin"||r==="MissingOneOfPlugins")&&(s="Unexpected token.",n=void 0);let o=` (${i}:${a})`;return s.endsWith(o)&&(s=s.slice(0,-o.length)),s.startsWith(xt)&&(s=s.slice(xt.length)),Qt(s,{loc:{start:{line:i,column:a+1}},cause:n})}var Zt=Di,Fi=String.prototype.replaceAll??function(t,s){return t.global?this.replace(t,s):this.split(t).join(s)},Li=Xe("replaceAll",function(){if(typeof this=="string")return Fi}),ce=Li,Mi=/\*\/$/,Bi=/^\/\*\*?/,Oi=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,Ri=/(^|\s+)\/\/([^\n\r]*)/g,Pt=/^(\r?\n)+/,Ui=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,At=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,ji=/(\r?\n|^) *\* ?/g,_i=[];function Vi(t){let s=t.match(Oi);return s?s[0].trimStart():""}function zi(t){t=ce(0,t.replace(Bi,"").replace(Mi,""),ji,"$1");let s="";for(;s!==t;)s=t,t=ce(0,t,Ui,`
|
|
14
|
+
$1 $2
|
|
15
|
+
`);t=t.replace(Pt,"").trimEnd();let e=Object.create(null),r=ce(0,t,At,"").replace(Pt,"").trimEnd(),i;for(;i=At.exec(t);){let a=ce(0,i[2],Ri,"");if(typeof e[i[1]]=="string"||Array.isArray(e[i[1]])){let n=e[i[1]];e[i[1]]=[..._i,...Array.isArray(n)?n:[n],a]}else e[i[1]]=a}return{comments:r,pragmas:e}}var Hi=["noformat","noprettier"],qi=["format","prettier"];function es(t){let s=Gt(t);s&&(t=t.slice(s.length+1));let e=Vi(t),{pragmas:r,comments:i}=zi(e);return{shebang:s,text:t,pragmas:r,comments:i}}function $i(t){let{pragmas:s}=es(t);return qi.some(e=>Object.prototype.hasOwnProperty.call(s,e))}function Ki(t){let{pragmas:s}=es(t);return Hi.some(e=>Object.prototype.hasOwnProperty.call(s,e))}function Ji(t){return t=typeof t=="function"?{parse:t}:t,{astFormat:"estree",hasPragma:$i,hasIgnorePragma:Ki,locStart:U,locEnd:O,...t}}var oe=Ji,Qe="module",ts="commonjs";function Wi(t){if(typeof t=="string"){if(t=t.toLowerCase(),/\.(?:mjs|mts)$/iu.test(t))return Qe;if(/\.(?:cjs|cts)$/iu.test(t))return ts}}function Xi(t,s){let{type:e="JsExpressionRoot",rootMarker:r,text:i}=s,{tokens:a,comments:n}=t;return delete t.tokens,delete t.comments,{tokens:a,comments:n,type:e,node:t,range:[0,i.length],rootMarker:r}}var ss=Xi,Y=t=>oe(ea(t)),Gi={sourceType:Qe,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,attachComment:!1,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","moduleBlocks","asyncDoExpressions","destructuringPrivate","decoratorAutoAccessors","sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}],["discardBinding",{syntaxType:"void"}]],tokens:!1,ranges:!1},gt="v8intrinsic",Tt=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],j=(t,s=Gi)=>({...s,plugins:[...s.plugins,...t]}),Yi=/@(?:no)?flow\b/u;function Qi(t,s){if(s!=null&&s.endsWith(".js.flow"))return!0;let e=Gt(t);e&&(t=t.slice(e.length));let r=Zr(t,0);return r!==!1&&(t=t.slice(0,r)),Yi.test(t)}function Zi(t,s,e){let r=t(s,e),i=r.errors.find(a=>!ta.has(a.reasonCode));if(i)throw i;return r}function ea({isExpression:t=!1,optionsCombinations:s}){return(e,r={})=>{let{filepath:i}=r;if(typeof i!="string"&&(i=void 0),(r.parser==="babel"||r.parser==="__babel_estree")&&Qi(e,i))return r.parser="babel-flow",is.parse(e,r);let a=s,n=r.__babelSourceType??Wi(i);n&&n!==Qe&&(a=a.map(c=>({...c,sourceType:n,...n===ts?{allowReturnOutsideFunction:void 0,allowNewTargetOutsideFunction:void 0}:void 0})));let o=/%[A-Z]/u.test(e);e.includes("|>")?a=(o?[...Tt,gt]:Tt).flatMap(c=>a.map(d=>j([c],d))):o&&(a=a.map(c=>j([gt],c)));let l=t?Wt:Jt,h;try{h=ei(a.map(c=>()=>Zi(l,e,c)))}catch({errors:[c]}){throw Zt(c)}return t&&(h=ss(h,{text:e,rootMarker:r.rootMarker})),ki(h,{text:e})}}var ta=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","ImportAttributesUseAssert","DeclarationMissingInitializer"]),rs=[j(["jsx"])],bt=Y({optionsCombinations:rs}),Et=Y({optionsCombinations:[j(["jsx","typescript"]),j(["typescript"])]}),Ct=Y({isExpression:!0,optionsCombinations:[j(["jsx"])]}),St=Y({isExpression:!0,optionsCombinations:[j(["typescript"])]}),is=Y({optionsCombinations:[j(["jsx",["flow",{all:!0}],"flowComments"])]}),sa=Y({optionsCombinations:rs.map(t=>j(["estree"],t))}),as={};Oe(as,{json:()=>aa,"json-stringify":()=>la,json5:()=>na,jsonc:()=>oa});function ra(t){return Array.isArray(t)&&t.length>0}var ns=ra,os={tokens:!1,ranges:!1,attachComment:!1,createParenthesizedExpressions:!0};function ia(t){let s=Jt(t,os),{program:e}=s;if(e.body.length===0&&e.directives.length===0&&!e.interpreter)return s}function ge(t,s={}){let{allowComments:e=!0,allowEmpty:r=!1}=s,i;try{i=Wt(t,os)}catch(a){if(r&&a.code==="BABEL_PARSER_SYNTAX_ERROR"&&a.reasonCode==="ParseExpressionEmptyInput")try{i=ia(t)}catch{}if(!i)throw Zt(a)}if(!e&&ns(i.comments))throw z(i.comments[0],"Comment");return i=ss(i,{type:"JsonRoot",text:t}),i.node.type==="File"?delete i.node:J(i.node),i}function z(t,s){let[e,r]=[t.loc.start,t.loc.end].map(({line:i,column:a})=>({line:i,column:a+1}));return Qt(`${s} is not allowed in JSON.`,{loc:{start:e,end:r}})}function J(t){switch(t.type){case"ArrayExpression":for(let s of t.elements)s!==null&&J(s);return;case"ObjectExpression":for(let s of t.properties)J(s);return;case"ObjectProperty":if(t.computed)throw z(t.key,"Computed key");if(t.shorthand)throw z(t.key,"Shorthand property");t.key.type!=="Identifier"&&J(t.key),J(t.value);return;case"UnaryExpression":{let{operator:s,argument:e}=t;if(s!=="+"&&s!=="-")throw z(t,`Operator '${t.operator}'`);if(e.type==="NumericLiteral"||e.type==="Identifier"&&(e.name==="Infinity"||e.name==="NaN"))return;throw z(e,`Operator '${s}' before '${e.type}'`)}case"Identifier":if(t.name!=="Infinity"&&t.name!=="NaN"&&t.name!=="undefined")throw z(t,`Identifier '${t.name}'`);return;case"TemplateLiteral":if(ns(t.expressions))throw z(t.expressions[0],"'TemplateLiteral' with expression");for(let s of t.quasis)J(s);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw z(t,`'${t.type}'`)}}var aa=oe({parse:t=>ge(t),hasPragma:()=>!0,hasIgnorePragma:()=>!1}),na=oe(t=>ge(t)),oa=oe(t=>ge(t,{allowEmpty:!0})),la=oe({parse:t=>ge(t,{allowComments:!1}),astFormat:"estree-json"}),ls={...It,...as};exports.default=wt;exports.parsers=ls;
|