pagepilot-visual-editor 1.0.41 → 1.0.43
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/babel-BQODqR2n.js +7218 -0
- package/dist/babel-DWji6wpD.cjs +16 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/VariableLinkHint.d.ts +7 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/sanitizeAgainstSchema.d.ts +5 -3
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/variableEditActions.d.ts +2 -0
- package/dist/editor-sample/App/TemplatePanel/hooks/index.d.ts +1 -0
- package/dist/editor-sample/App/TemplatePanel/hooks/useClearHoverOnCanvasScroll.d.ts +1 -0
- package/dist/editor-sample/App/TemplatePanel/hooks/useDragSelection.d.ts +1 -2
- package/dist/editor-sample/App/hooks/page/useSaveHandler.d.ts +2 -1
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/DividerButton.styles.d.ts +4 -0
- package/dist/editor-sample/documents/blocks/helpers/block-wrappers/EditorBlockWrapper.styles.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/helpers/block-wrappers/TuneMenu.d.ts +4 -2
- package/dist/editor-sample/documents/blocks/helpers/block-wrappers/TuneMenu.styles.d.ts +1 -5
- package/dist/editor-sample/documents/editor/canvasScrollActivity.d.ts +5 -0
- package/dist/editor-sample/documents/editor/core.d.ts +199 -0
- package/dist/editor-sample/documents/editor/templateVariables.d.ts +6 -0
- package/dist/editor-sample/utils/rafThrottle.d.ts +4 -0
- package/dist/email-builder-core/blocks/EmailLayout/layoutType.d.ts +5 -0
- package/dist/estree-D0rbR2Tn.js +4824 -0
- package/dist/estree-DyF2pmOB.cjs +44 -0
- package/dist/{index-xCACDRV-.js → index-BUtnK58L.js} +1 -1
- package/dist/index-C-4OVLjk.cjs +1493 -0
- package/dist/{index-BVRFBf4A.cjs → index-DEnWBBqj.cjs} +1 -1
- package/dist/index-DvEcR48I.js +106322 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/render.cjs +70 -70
- package/dist/render.js +2035 -2029
- package/dist/{xlsx-DW2XG0Vs.cjs → xlsx-BsoVkcdE.cjs} +1 -1
- package/dist/{xlsx-QDrfGy9O.js → xlsx-D_Hwvvx2.js} +1 -1
- package/package.json +1 -1
- package/dist/index-D6uaGE9o.cjs +0 -1557
- package/dist/index-kjXqGRCj.js +0 -166284
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";var fs=Object.defineProperty;var ys=(t,s,e)=>s in t?fs(t,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[s]=e;var y=(t,s,e)=>ys(t,typeof s!="symbol"?s+"":s,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var xs=Object.defineProperty,Be=(t,s)=>{for(var e in s)xs(t,e,{get:s[e],enumerable:!0})},Nt={};Be(Nt,{parsers:()=>ms});var kt={};Be(kt,{__babel_estree:()=>Ta,__js_expression:()=>It,__ts_expression:()=>wt,__vue_event_binding:()=>Et,__vue_expression:()=>It,__vue_ts_event_binding:()=>Ct,__vue_ts_expression:()=>wt,babel:()=>Et,"babel-flow":()=>ps,"babel-ts":()=>Ct});var Ue=(t,s)=>(e,r,...i)=>e|1&&r==null?void 0:(s.call(r)??r[t]).apply(r,i),Ps=String.prototype.replaceAll??function(t,s){return t.global?this.replace(t,s):this.split(t).join(s)},gs=Ue("replaceAll",function(){if(typeof this=="string")return Ps}),X=gs,Ts=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),Re=Ts,L=class{constructor(t,s,e){this.line=void 0,this.column=void 0,e!==void 0&&(this.index=void 0),this.line=t,this.column=s,e!==void 0&&(this.index=e)}},Te=class{constructor(t,s){y(this,"start");y(this,"end");y(this,"filename");y(this,"identifierName");this.start=t,this.end=s}};function D(t,s){let{line:e,column:r,index:i}=t;return new L(e,r+s,i+s)}var et="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",bs={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:et},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:et}},tt={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"},fe=t=>t.type==="UpdateExpression"?tt.UpdateExpression[`${t.prefix}`]:tt[t.type],As={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)'.",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 { ... }'?",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.",ImportBindingIsString:({importName:t})=>`A string literal cannot be used as an imported binding.
|
|
3
|
+
- Did you mean \`import { "${t}" as foo }\`?`,ImportCallArity:({phase:t})=>`\`import${t?`.${t}`:""}()\` requires exactly one or two arguments.`,ImportCallNotNewExpression:({phase:t})=>`Cannot use new with import${t?`.${t}`:""}().`,ImportCallSpreadArgument:({phase:t})=>`\`...\` is not allowed in \`import${t?`.${t}`:""}()\`.`,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.",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 ${fe(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${fe(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${fe(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.",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.",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}.`,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.",SuperCallNotNewExpression:"Cannot use new with super(...).",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.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",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.",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."},Ss={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."},Es={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)}\`.`},Cs=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Is={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 ${fe({type:t})}; please wrap it in parentheses.`,PipelineUnparenthesized:"Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses."},ws={UnsupportedBind:"Binding should be performed on object property.",UnsupportedBindRHS:"The right-hand side of binding can not be super or import."};function st(t,s,e){Object.defineProperty(t,s,{enumerable:!1,configurable:!0,value:e})}function Ns({toMessage:t,code:s,reasonCode:e,syntaxPlugin:r}){let i=e==="MissingPlugin"||e==="MissingOneOfPlugins";return function a(n,o,l){let h=new SyntaxError;return h.code=s,h.reasonCode=e,h.loc=n,h.pos=o,h.syntaxPlugin=r,i&&(h.missingPlugin=l.missingPlugin),st(h,"clone",function(c={}){let{line:d,column:m,index:P=o}=c.loc??n;return a(new L(d,m),P,{...l,...c.details})}),st(h,"details",l),Object.defineProperty(h,"message",{configurable:!0,get(){let c=`${t(l)} (${n.line}:${n.column})`;return this.message=c,c},set(c){Object.defineProperty(this,"message",{value:c,writable:!0})}}),h}}function B(t,s){if(Array.isArray(t))return r=>B(r,t[0]);let e={};for(let r of Object.keys(t)){let i=t[r],{message:a,...n}=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,o=typeof a=="string"?()=>a:a;e[r]=Ns({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:r,toMessage:o,...s?{syntaxPlugin:s}:{},...n})}return e}var p={...B(bs),...B(As),...B(Ss),...B(Es),...B`pipelineOperator`(Is),...B`functionBind`(ws)};function ks(){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,locations:!0,tokens:!1,createImportExpressions:!0,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0}}function vs(t){let s=ks();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}function W(t){let{start:s,end:e}=t.loc;return t.loc.start=new L(s.line,s.column),t.loc.end=new L(e.line,e.column),t}var Ls=t=>class extends t{createPosition(s){return new L(s.line,s.column)}parse(){let s=super.parse();return this.optionFlags&512&&(s.tokens=s.tokens.map(W)),W(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}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.finishNodeAtNode(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.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(p.PatternHasAccessor,s.key):s.type==="Property"&&s.method?this.raise(p.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}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):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 W(super.finishNodeAt(s,e,r))}finishNodeAtNode(s,e,r){return W(super.finishNodeAtNode(s,e,r))}finishNode(s,e){let r=super.finishNode(s,e);return this.fillOptionalPropertiesForTSESLint(r),r}resetStartLocation(s,e){super.resetStartLocation(s,e),W(s)}resetEndLocation(s,e=this.state.lastTokEndLoc){super.resetEndLocation(s,e),W(s)}},A=!0,x=!0,Ee=!0,ee=!0,V=!0,Ms=!0,vt=class{constructor(t,s={}){y(this,"label");y(this,"keyword");y(this,"beforeExpr");y(this,"startsExpr");y(this,"rightAssociative");y(this,"isLoop");y(this,"isAssign");y(this,"prefix");y(this,"postfix");y(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}},je=new Map;function E(t,s={}){s.keyword=t;let e=T(t,s);return je.set(t,e),e}function v(t,s){return T(t,{beforeExpr:A,binop:s})}var ne=-1,_e=[],Ve=[],ze=[],He=[],$e=[],qe=[];function T(t,s={}){return++ne,Ve.push(t),ze.push(s.binop??-1),He.push(s.beforeExpr??!1),$e.push(s.startsExpr??!1),qe.push(s.prefix??!1),_e.push(new vt(t,s)),ne}function b(t,s={}){return++ne,je.set(t,ne),Ve.push(t),ze.push(s.binop??-1),He.push(s.beforeExpr??!1),$e.push(s.startsExpr??!1),qe.push(s.prefix??!1),_e.push(new vt("name",s)),ne}var Ds={bracketL:T("[",{beforeExpr:A,startsExpr:x}),bracketR:T("]"),braceL:T("{",{beforeExpr:A,startsExpr:x}),braceBarL:T("{|",{beforeExpr:A,startsExpr:x}),braceR:T("}"),braceBarR:T("|}"),parenL:T("(",{beforeExpr:A,startsExpr:x}),parenR:T(")"),comma:T(",",{beforeExpr:A}),semi:T(";",{beforeExpr:A}),colon:T(":",{beforeExpr:A}),doubleColon:T("::",{beforeExpr:A}),dot:T("."),question:T("?",{beforeExpr:A}),questionDot:T("?."),arrow:T("=>",{beforeExpr:A}),template:T("template"),ellipsis:T("...",{beforeExpr:A}),backQuote:T("`",{startsExpr:x}),dollarBraceL:T("${",{beforeExpr:A,startsExpr:x}),templateTail:T("...`",{startsExpr:x}),templateNonTail:T("...${",{beforeExpr:A,startsExpr:x}),at:T("@"),hash:T("#",{startsExpr:x}),interpreterDirective:T("#!..."),eq:T("=",{beforeExpr:A,isAssign:ee}),assign:T("_=",{beforeExpr:A,isAssign:ee}),slashAssign:T("_=",{beforeExpr:A,isAssign:ee}),xorAssign:T("_=",{beforeExpr:A,isAssign:ee}),moduloAssign:T("_=",{beforeExpr:A,isAssign:ee}),incDec:T("++/--",{prefix:V,postfix:Ms,startsExpr:x}),bang:T("!",{beforeExpr:A,prefix:V,startsExpr:x}),tilde:T("~",{beforeExpr:A,prefix:V,startsExpr:x}),doubleCaret:T("^^",{startsExpr:x}),doubleAt:T("@@",{startsExpr:x}),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:T("+/-",{beforeExpr:A,binop:9,prefix:V,startsExpr:x}),modulo:T("%",{binop:10,startsExpr:x}),star:T("*",{binop:10}),slash:v("/",10),exponent:T("**",{beforeExpr:A,binop:11,rightAssociative:!0}),_in:E("in",{beforeExpr:A,binop:7}),_instanceof:E("instanceof",{beforeExpr:A,binop:7}),_break:E("break"),_case:E("case",{beforeExpr:A}),_catch:E("catch"),_continue:E("continue"),_debugger:E("debugger"),_default:E("default",{beforeExpr:A}),_else:E("else",{beforeExpr:A}),_finally:E("finally"),_function:E("function",{startsExpr:x}),_if:E("if"),_return:E("return",{beforeExpr:A}),_switch:E("switch"),_throw:E("throw",{beforeExpr:A,prefix:V,startsExpr:x}),_try:E("try"),_var:E("var"),_const:E("const"),_with:E("with"),_new:E("new",{beforeExpr:A,startsExpr:x}),_this:E("this",{startsExpr:x}),_super:E("super",{startsExpr:x}),_class:E("class",{startsExpr:x}),_extends:E("extends",{beforeExpr:A}),_export:E("export"),_import:E("import",{startsExpr:x}),_null:E("null",{startsExpr:x}),_true:E("true",{startsExpr:x}),_false:E("false",{startsExpr:x}),_typeof:E("typeof",{beforeExpr:A,prefix:V,startsExpr:x}),_void:E("void",{beforeExpr:A,prefix:V,startsExpr:x}),_delete:E("delete",{beforeExpr:A,prefix:V,startsExpr:x}),_do:E("do",{isLoop:Ee,beforeExpr:A}),_for:E("for",{isLoop:Ee}),_while:E("while",{isLoop:Ee}),_as:b("as",{startsExpr:x}),_assert:b("assert",{startsExpr:x}),_async:b("async",{startsExpr:x}),_await:b("await",{startsExpr:x}),_defer:b("defer",{startsExpr:x}),_from:b("from",{startsExpr:x}),_get:b("get",{startsExpr:x}),_let:b("let",{startsExpr:x}),_meta:b("meta",{startsExpr:x}),_of:b("of",{startsExpr:x}),_sent:b("sent",{startsExpr:x}),_set:b("set",{startsExpr:x}),_source:b("source",{startsExpr:x}),_static:b("static",{startsExpr:x}),_using:b("using",{startsExpr:x}),_yield:b("yield",{startsExpr:x}),_asserts:b("asserts",{startsExpr:x}),_checks:b("checks",{startsExpr:x}),_exports:b("exports",{startsExpr:x}),_global:b("global",{startsExpr:x}),_implements:b("implements",{startsExpr:x}),_intrinsic:b("intrinsic",{startsExpr:x}),_infer:b("infer",{startsExpr:x}),_is:b("is",{startsExpr:x}),_mixins:b("mixins",{startsExpr:x}),_proto:b("proto",{startsExpr:x}),_require:b("require",{startsExpr:x}),_satisfies:b("satisfies",{startsExpr:x}),_keyof:b("keyof",{startsExpr:x}),_readonly:b("readonly",{startsExpr:x}),_unique:b("unique",{startsExpr:x}),_abstract:b("abstract",{startsExpr:x}),_declare:b("declare",{startsExpr:x}),_enum:b("enum",{startsExpr:x}),_module:b("module",{startsExpr:x}),_namespace:b("namespace",{startsExpr:x}),_interface:b("interface",{startsExpr:x}),_type:b("type",{startsExpr:x}),_opaque:b("opaque",{startsExpr:x}),name:T("name",{startsExpr:x}),placeholder:T("%%",{startsExpr:x}),string:T("string",{startsExpr:x}),num:T("num",{startsExpr:x}),bigint:T("bigint",{startsExpr:x}),regexp:T("regexp",{startsExpr:x}),privateName:T("#name",{startsExpr:x}),eof:T("eof"),jsxName:T("jsxName"),jsxText:T("jsxText",{beforeExpr:A}),jsxTagStart:T("jsxTagStart",{startsExpr:x}),jsxTagEnd:T("jsxTagEnd")};function C(t){return t>=89&&t<=129}function Os(t){return t<=88}function U(t){return t>=54&&t<=129}function Lt(t){return t>=54&&t<=132}function Fs(t){return He[t]}function re(t){return $e[t]}function Bs(t){return t>=25&&t<=29}function rt(t){return t>=125&&t<=127}function Us(t){return t>=86&&t<=88}function Ke(t){return t>=54&&t<=88}function it(t){return t>=35&&t<=55}function Rs(t){return t===30}function js(t){return qe[t]}function _s(t){return t>=117&&t<=119}function Vs(t){return t>=120&&t<=126}function q(t){return Ve[t]}function ye(t){return ze[t]}function zs(t){return t===53}function ve(t){return t>=20&&t<=21}function Mt(t){return _e[t]}var ce=class{constructor(t,s){y(this,"token");y(this,"preserveSpace");this.token=t,this.preserveSpace=!!s}},w={brace:new ce("{"),j_oTag:new ce("<tag"),j_cTag:new ce("</tag"),j_expr:new ce("<tag>...</tag>",!0)},Dt="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u037f\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u052f\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05d0-\\u05ea\\u05ef-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086a\\u0870-\\u0887\\u0889-\\u088f\\u08a0-\\u08c9\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u09fc\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0af9\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c39\\u0c3d\\u0c58-\\u0c5a\\u0c5c\\u0c5d\\u0c60\\u0c61\\u0c80\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cdc-\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d04-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d54-\\u0d56\\u0d5f-\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e86-\\u0e8a\\u0e8c-\\u0ea3\\u0ea5\\u0ea7-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f5\\u13f8-\\u13fd\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f8\\u1700-\\u1711\\u171f-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1878\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191e\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19b0-\\u19c9\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4c\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1c80-\\u1c8a\\u1c90-\\u1cba\\u1cbd-\\u1cbf\\u1ce9-\\u1cec\\u1cee-\\u1cf3\\u1cf5\\u1cf6\\u1cfa\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2118-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309b-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312f\\u3131-\\u318e\\u31a0-\\u31bf\\u31f0-\\u31ff\\u3400-\\u4dbf\\u4e00-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua69d\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua7dc\\ua7f1-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua8fd\\ua8fe\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\ua9e0-\\ua9e4\\ua9e6-\\ua9ef\\ua9fa-\\ua9fe\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa7e-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uab30-\\uab5a\\uab5c-\\uab69\\uab70-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",Hs="\\xb7\\u0300-\\u036f\\u0387\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u064b-\\u0669\\u0670\\u06d6-\\u06dc\\u06df-\\u06e4\\u06e7\\u06e8\\u06ea-\\u06ed\\u06f0-\\u06f9\\u0711\\u0730-\\u074a\\u07a6-\\u07b0\\u07c0-\\u07c9\\u07eb-\\u07f3\\u07fd\\u0816-\\u0819\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0859-\\u085b\\u0897-\\u089f\\u08ca-\\u08e1\\u08e3-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09cb-\\u09cd\\u09d7\\u09e2\\u09e3\\u09e6-\\u09ef\\u09fe\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2\\u0ae3\\u0ae6-\\u0aef\\u0afa-\\u0aff\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b55-\\u0b57\\u0b62\\u0b63\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c00-\\u0c04\\u0c3c\\u0c3e-\\u0c44\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62\\u0c63\\u0c66-\\u0c6f\\u0c81-\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2\\u0ce3\\u0ce6-\\u0cef\\u0cf3\\u0d00-\\u0d03\\u0d3b\\u0d3c\\u0d3e-\\u0d44\\u0d46-\\u0d48\\u0d4a-\\u0d4d\\u0d57\\u0d62\\u0d63\\u0d66-\\u0d6f\\u0d81-\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0de6-\\u0def\\u0df2\\u0df3\\u0e31\\u0e34-\\u0e3a\\u0e47-\\u0e4e\\u0e50-\\u0e59\\u0eb1\\u0eb4-\\u0ebc\\u0ec8-\\u0ece\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f3e\\u0f3f\\u0f71-\\u0f84\\u0f86\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u102b-\\u103e\\u1040-\\u1049\\u1056-\\u1059\\u105e-\\u1060\\u1062-\\u1064\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u1369-\\u1371\\u1712-\\u1715\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17b4-\\u17d3\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u180f-\\u1819\\u18a9\\u1920-\\u192b\\u1930-\\u193b\\u1946-\\u194f\\u19d0-\\u19da\\u1a17-\\u1a1b\\u1a55-\\u1a5e\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1ab0-\\u1abd\\u1abf-\\u1add\\u1ae0-\\u1aeb\\u1b00-\\u1b04\\u1b34-\\u1b44\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1b80-\\u1b82\\u1ba1-\\u1bad\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c24-\\u1c37\\u1c40-\\u1c49\\u1c50-\\u1c59\\u1cd0-\\u1cd2\\u1cd4-\\u1ce8\\u1ced\\u1cf4\\u1cf7-\\u1cf9\\u1dc0-\\u1dff\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2cef-\\u2cf1\\u2d7f\\u2de0-\\u2dff\\u302a-\\u302f\\u3099\\u309a\\u30fb\\ua620-\\ua629\\ua66f\\ua674-\\ua67d\\ua69e\\ua69f\\ua6f0\\ua6f1\\ua802\\ua806\\ua80b\\ua823-\\ua827\\ua82c\\ua880\\ua881\\ua8b4-\\ua8c5\\ua8d0-\\ua8d9\\ua8e0-\\ua8f1\\ua8ff-\\ua909\\ua926-\\ua92d\\ua947-\\ua953\\ua980-\\ua983\\ua9b3-\\ua9c0\\ua9d0-\\ua9d9\\ua9e5\\ua9f0-\\ua9f9\\uaa29-\\uaa36\\uaa43\\uaa4c\\uaa4d\\uaa50-\\uaa59\\uaa7b-\\uaa7d\\uaab0\\uaab2-\\uaab4\\uaab7\\uaab8\\uaabe\\uaabf\\uaac1\\uaaeb-\\uaaef\\uaaf5\\uaaf6\\uabe3-\\uabea\\uabec\\uabed\\uabf0-\\uabf9\\ufb1e\\ufe00-\\ufe0f\\ufe20-\\ufe2f\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f\\uff65",Ot=[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],$s=[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],qs=new RegExp("["+Dt+"]"),Ks=new RegExp("["+Dt+Hs+"]");function Le(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 R(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&qs.test(String.fromCharCode(t)):Le(t,Ot)}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&&Ks.test(String.fromCharCode(t)):Le(t,Ot)||Le(t,$s)}var We={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"]},Ws=new Set(We.keyword),Js=new Set(We.strict),Xs=new Set(We.strictBind);function Ft(t,s){return s&&t==="await"||t==="enum"}function Bt(t,s){return Ft(t,s)||Js.has(t)}function Ut(t){return Xs.has(t)}function Rt(t,s){return Bt(t,s)||Ut(t)}function Gs(t){return Ws.has(t)}function Ys(t,s,e){return t===64&&s===64&&R(e)}var Qs=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 Zs(t){return Qs.has(t)}var Je=class{constructor(t){y(this,"flags",0);y(this,"names",new Map);y(this,"firstLexicalName","");this.flags=t}},Xe=class{constructor(t,s){y(this,"parser");y(this,"scopeStack",[]);y(this,"inModule");y(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&3779)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&3715));--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(p.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.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&3715)return s}}currentThisScopeFlags(){for(let t=this.scopeStack.length-1;;t--){let{flags:s}=this.scopeStack[t];if(s&3779&&!(s&4))return s}}},er=class extends Je{constructor(){super(...arguments);y(this,"declareFunctions",new Set)}},tr=class extends Xe{createScope(t){return new er(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)}},sr=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),rr={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.",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:{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."},g=B`flow`(rr);function ir(t){return t.type==="DeclareExportAllDeclaration"||t.type==="DeclareExportDeclaration"&&(!t.declaration||t.declaration.type!=="TypeAlias"&&t.declaration.type!=="InterfaceDeclaration")}function at(t){return t.importKind==="type"||t.importKind==="typeof"}var ar={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function nr(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 or=/\*?\s*@((?:no)?flow)\b/,lr=t=>class extends t{constructor(){super(...arguments);y(this,"flowPragma")}getScopeHandler(){return tr}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,r){e!==130&&e!==9&&e!==24&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,r)}addComment(e){if(this.flowPragma===void 0){let r=or.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||10);let i=this.flowParseType();return this.state.inType=r,i}flowParsePredicate(){let e=this.startNode(),r=this.state.startLoc;return this.next(),this.expectContextual(106),this.state.lastTokStartLoc.index>r.index+1&&this.raise(g.UnexpectedSpaceBetweenModuloChecks,r),this.eat(6)?(e.value=super.parseExpression(),this.expect(7),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(e){let r=this.state.inType;this.state.inType=!0,this.expect(10);let i=null,a=null;return e&&this.match(50)?(this.state.inType=r,a=this.flowParsePredicate()):(i=this.flowParseType(),this.state.inType=r,this.match(50)&&(a=this.flowParsePredicate())),[i,a]}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(43)?i.typeParameters=this.flowParseTypeParameterDeclaration():i.typeParameters=null,this.expect(6);let n=this.flowParseFunctionTypeParams();return i.params=n.params,i.rest=n.rest,i.this=n._this,this.expect(7),[i.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!1),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.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,r){if(this.match(76))return this.flowParseDeclareClass(e);if(this.match(64))return this.flowParseDeclareFunction(e);if(this.match(70))return this.flowParseDeclareVariable(e);if(this.eatContextual(123))return this.match(12)?this.flowParseDeclareModuleExports(e):(r&&this.raise(g.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(126))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(127))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(125))return this.flowParseDeclareInterface(e);if(this.match(78))return this.flowParseDeclareExportDeclaration(e,r);throw this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(),this.scope.declareName(e.id.name,5,e.id.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(130)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let r=this.startNode(),i=r.body=[];for(this.expect(2);!this.match(4);){let o=this.startNode();this.match(79)?(this.next(),!this.isContextual(126)&&!this.match(83)&&this.raise(g.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),i.push(super.parseImport(o))):(this.expectContextual(121,g.UnsupportedStatementInDeclareModule),i.push(this.flowParseDeclare(o,!0)))}this.scope.exit(),this.expect(4),e.body=this.finishNode(r,"BlockStatement");let a=null,n=!1;return i.forEach(o=>{ir(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(78),this.eat(61))return this.match(64)||this.match(76)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(71)||this.isLet()||(this.isContextual(126)||this.isContextual(125))&&!r){let i=this.state.value;throw this.raise(g.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:i,suggestion:ar[i]})}if(this.match(70)||this.match(64)||this.match(76)||this.isContextual(127))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(51)||this.match(2)||this.isContextual(125)||this.isContextual(126)||this.isContextual(127)){let i=this.parseExport(e,null);return i.type==="ExportNamedDeclaration"?(i.default=!1,delete i.exportKind,this.castNodeTo(i,"DeclareExportDeclaration")):this.castNodeTo(i,"DeclareExportAllDeclaration")}throw this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(107),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){return this.next(),this.flowParseOpaqueType(e,!0)}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.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(!r&&this.eat(8));if(r){let i=[],a=[];if(this.eatContextual(113))do a.push(this.flowParseInterfaceExtends());while(this.eat(8));if(this.eatContextual(109))do i.push(this.flowParseClassImplements());while(this.eat(8));e.implements=i,e.mixins=a}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(43)?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){sr.has(e)&&this.raise(i?g.AssignReservedType:g.UnexpectedReservedType,r,{reservedType:e})}flowParseRestrictedIdentifierName(e,r){return this.checkReservedType(this.state.value,this.state.startLoc,r),this.parseIdentifierName(e)}flowParseRestrictedIdentifier(e,r){let i=this.startNode(),a=this.flowParseRestrictedIdentifierName(e,r);return this.createIdentifier(i,a)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(25),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,r){return this.expectContextual(126),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.start),this.match(43)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(10)&&(e.supertype=this.flowParseTypeInitialiser(10)),e.impltype=null,r||(e.impltype=this.flowParseTypeInitialiser(25)),this.semicolon(),this.finishNode(e,r?"DeclareOpaqueType":"OpaqueType")}flowParseTypeParameterBound(){if(this.match(10)||this.isContextual(77)){let e=this.startNode();return this.next(),e.typeAnnotation=this.flowParseType(),this.finishNode(e,"TypeAnnotation")}}flowParseTypeParameter(e=!1){let r=this.state.startLoc,i=this.startNode(),a=this.flowParseVariance();return i.name=this.flowParseRestrictedIdentifierName(),i.variance=a,i.bound=this.flowParseTypeParameterBound(),this.match(25)?(this.eat(25),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(43)||this.match(138)?this.next():this.unexpected();let i=!1;do{let a=this.flowParseTypeParameter(i);r.params.push(a),a.default&&(i=!0),this.match(44)||this.expect(8)}while(!this.match(44));return this.expect(44),this.state.inType=e,this.finishNode(r,"TypeParameterDeclaration")}flowInTopLevelContext(e){if(this.curContext()!==w.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()===43)return this.flowParseTypeParameterInstantiation()}flowParseTypeParameterInstantiation(){let e=this.startNode(),r=this.state.inType;return this.state.inType=!0,e.params=[],this.flowInTopLevelContext(()=>{this.expect(43);let i=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(44);)e.params.push(this.flowParseType()),this.match(44)||this.expect(8);this.state.noAnonFunctionType=i}),this.state.inType=r,!this.state.inType&&this.curContext()===w.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){if(this.reScan_lt()!==43)return null;let e=this.startNode(),r=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(43);!this.match(44);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(44)||this.expect(8);return this.expect(44),this.state.inType=r,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(125),e.extends=[],this.eat(77))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(8));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(131)||this.match(130)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,r,i){return e.static=r,this.lookahead().type===10?(e.id=this.parseIdentifier(!0),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(1),e.value=this.flowParseTypeInitialiser(),e.variance=i,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,r){return e.static=r,e.id=this.parseIdentifier(!0),this.expect(1),this.expect(1),this.match(43)||this.match(6)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e))):(e.method=!1,this.eat(13)&&(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(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(6),this.match(74)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(7),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(3)?(this.expect(3),h=5,c=!0):(this.expect(2),h=4,c=!1),l.exact=c;!this.match(h);){let P=!1,S=null,F=null,I=this.startNode();if(a&&this.isContextual(114)){let k=this.lookahead();k.type!==10&&k.type!==13&&(this.next(),S=this.state.startLoc,e=!1)}if(e&&this.isContextual(102)){let k=this.lookahead();k.type!==10&&k.type!==13&&(this.next(),P=!0)}let N=this.flowParseVariance();if(this.eat(0))S!=null&&this.unexpected(S),this.eat(0)?(N&&this.unexpected(N.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(I,P))):l.indexers.push(this.flowParseObjectTypeIndexer(I,P,N));else if(this.match(6)||this.match(43))S!=null&&this.unexpected(S),N&&this.unexpected(N.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(I,P));else{let k="init";if(this.isContextual(95)||this.isContextual(100)){let Z=this.lookahead();Lt(Z.type)&&(k=this.state.value,this.next())}let pe=this.flowParseObjectTypeProperty(I,P,S,N,k,i,n??!c);pe===null?(d=!0,F=this.state.lastTokStartLoc):l.properties.push(pe)}this.flowObjectTypeSemicolon(),F&&!this.match(4)&&!this.match(5)&&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(17))return this.match(8)||this.match(9)||this.match(4)||this.match(5)?(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(43)||this.match(6)?(e.method=!0,i!=null&&this.unexpected(i),a&&this.unexpected(a.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)),n==="get"||n==="set"?this.flowCheckGetterSetterParams(e):!r&&!o&&e.key.name==="constructor"&&e.value.this&&this.raise(g.ThisParamBannedInConstructor,e.value.this)):(n!=="init"&&this.unexpected(),e.method=!1,this.eat(13)&&(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,a=i.params.length+(i.rest?1:0);i.this&&this.raise(e.kind==="get"?g.GetterMayNotHaveThisParam:g.SetterMayNotHaveThisParam,i.this),a!==r&&this.raise(e.kind==="get"?p.BadGetterArity:p.BadSetterArity,e),e.kind==="set"&&i.rest&&this.raise(p.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(9)&&!this.eat(8)&&!this.match(4)&&!this.match(5)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,r){e??(e=this.state.startLoc);let i=r||this.flowParseRestrictedIdentifier(!0);for(;this.eat(12);){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(43)&&(i.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(i,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(83),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(1)&&(e.types.push(this.flowParseType()),!this.match(1));)this.expect(8);return this.expect(1),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let r=null,i=!1,a,n=this.startNode(),o=this.lookahead(),l=this.state.type===74;return o.type===10||o.type===13?(l&&!e&&this.raise(g.ThisParamMustBeFirst,n),r=this.parseIdentifier(l),this.eat(13)&&(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.startNodeAtNode(e);return r.name=null,r.optional=!1,r.typeAnnotation=e,this.finishNode(r,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let r=null,i=null;for(this.match(74)&&(i=this.flowParseFunctionTypeParam(!0),i.name=null,this.match(7)||this.expect(8));!this.match(7)&&!this.match(17);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(7)||this.expect(8);return this.eat(17)&&(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 2:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 3: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 43:{let l=this.startNode();return l.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(6),i=this.flowParseFunctionTypeParams(),l.params=i.params,l.rest=i.rest,l.this=i._this,this.expect(7),this.expect(15),l.returnType=this.flowParseType(),this.finishNode(l,"FunctionTypeAnnotation")}case 6:{let l=this.startNode();if(this.next(),!this.match(7)&&!this.match(17))if(C(this.state.type)||this.match(74)){let h=this.lookahead().type;n=h!==13&&h!==10}else n=!0;if(n){if(this.state.noAnonFunctionType=!1,a=this.flowParseType(),this.state.noAnonFunctionType=o,this.state.noAnonFunctionType||!(this.match(8)||this.match(7)&&this.lookahead().type===15))return this.expect(7),a;this.eat(8)}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(7),this.expect(15),l.returnType=this.flowParseType(),l.typeParameters=null,this.finishNode(l,"FunctionTypeAnnotation")}case 130:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 81:case 82:return r.value=this.match(81),this.next(),this.finishNode(r,"BooleanLiteralTypeAnnotation");case 49:if(this.state.value==="-"){if(this.next(),this.match(131))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",r);if(this.match(132))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",r);throw this.raise(g.UnexpectedSubtractionOperand,this.state.startLoc)}throw this.unexpected();case 131:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 132:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 84:return this.next(),this.finishNode(r,"VoidTypeAnnotation");case 80:return this.next(),this.finishNode(r,"NullLiteralTypeAnnotation");case 74:return this.next(),this.finishNode(r,"ThisTypeAnnotation");case 51:return this.next(),this.finishNode(r,"ExistsTypeAnnotation");case 83:return this.flowParseTypeofType();default:if(Ke(this.state.type)){let l=q(this.state.type);return this.next(),super.createIdentifier(r,l)}else if(C(this.state.type))return this.isContextual(125)?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(14))&&!this.canInsertSemicolon();){let a=this.startNodeAt(e),n=this.eat(14);i=i||n,this.expect(0),!n&&this.match(1)?(a.elementType=r,this.next(),r=this.finishNode(a,"ArrayTypeAnnotation")):(a.objectType=r,a.indexType=this.flowParseType(),this.expect(1),i?(a.optional=n,r=this.finishNode(a,"OptionalIndexedAccessType")):r=this.finishNode(a,"IndexedAccessType"))}return r}flowParsePrefixType(){let e=this.startNode();return this.eat(13)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(15)){let r=this.startNodeAtNode(e);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(41);let r=this.flowParseAnonFunctionWithoutParens();for(e.types=[r];this.eat(41);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?r:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(39);let r=this.flowParseIntersectionType();for(e.types=[r];this.eat(39);)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===128&&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(){let e=this.startNode(),r=this.parseIdentifierName();return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),this.createIdentifier(e,r)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}flowParseVariance(){let e=null;return this.match(49)?(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(10)){let a=this.startNode();r==="FunctionDeclaration"||r==="FunctionExpression"||r==="ArrowFunctionExpression"?[a.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0):a.typeAnnotation=this.flowParseTypeInitialiser(),e.returnType=a.typeAnnotation?this.finishNode(a,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,r,i)}parseStatementLike(e){if(this.state.strict&&this.isContextual(125)){let i=this.lookahead();if(U(i.type)){let a=this.startNode();return this.next(),this.flowParseInterface(a)}}else if(this.isContextual(122)){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(76)||C(this.state.type)||this.match(64)||this.match(70)||this.match(78))return this.flowParseDeclare(e)}else if(C(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===122||rt(e)?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return e===122||rt(e)?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.isContextual(122)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,r,i){if(!this.match(13))return e;if(i!=null){let P=this.lookaheadCharCode();if(P===44||P===61||P===58||P===41)return this.setOptionalParametersError(i),e}this.expect(13);let a=this.state.clone(),n=this.state.noArrowAt,o=this.startNodeAt(r),{consequent:l,failed:h}=this.tryParseConditionalConsequent(),c=this.getArrowLikeExpressions(l),d=c[0],m=c[1];if(h||m.length>0){let P=[...n];if(m.length>0){this.state=a,this.state.noArrowAt=P;for(let S=0;S<m.length;S++)P.push(m[S].start);({consequent:l,failed:h}=this.tryParseConditionalConsequent()),[d]=this.getArrowLikeExpressions(l)}h&&d.length>1&&this.raise(g.AmbiguousConditionalArrow,a.startLoc),h&&d.length===1&&(this.state=a,P.push(d[0].start),this.state.noArrowAt=P,{consequent:l}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=n,this.expect(10),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(10);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,[]]):nr(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(13)&&(i.optional=!0,this.resetEndLocation(e)),this.match(10)){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(126)){e.exportKind="type";let r=this.startNode();return this.next(),this.match(2)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(r)}else if(this.isContextual(127)){e.exportKind="type";let r=this.startNode();return this.next(),this.flowParseOpaqueType(r,!1)}else if(this.isContextual(125)){e.exportKind="type";let r=this.startNode();return this.next(),this.flowParseInterface(r)}else if(this.isContextual(122)){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(126)&&this.lookahead().type===51?(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){if((!r||i)&&this.isContextual(109)){e.id=null;return}super.parseClassId(e,r,i),this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,r,i){let{startLoc:a}=this.state;if(this.isContextual(121)){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(p.InvalidIdentifier,this.state.curPosition(),{identifierName:r}),this.finishToken(128,r)}getTokenFromCode(e){let r=this.input.charCodeAt(this.state.pos+1);e===123&&r===124?this.finishOp(3,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?44:43,1):this.state.inType&&e===63?r===46?this.finishOp(14,2):this.finishOp(13,1):Ys(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)}toAssignableListItem(e,r,i){let a=e[r];a.type==="TypeCastExpression"&&(e[r]=this.typeCastToParameter(a)),super.toAssignableListItem(e,r,i)}toReferencedList(e,r){var i;for(let a=0;a<e.length;a++){let n=e[a];(n==null?void 0:n.type)==="TypeCastExpression"&&!((i=n.extra)!=null&&i.parenthesized)&&(e.length>1||!r)&&this.raise(g.TypeCastInPattern,n.typeAnnotation)}return e}parseArrayLike(e,r){let i=super.parseArrayLike(e,r);return i.type==="ArrayExpression"&&this.toReferencedList(i.elements),i}isValidLVal(e,r,i,a){return e==="TypeCastExpression"||super.isValidLVal(e,r,i,a)}parseClassProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(10)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(10)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(10)&&super.isNonstaticConstructor(e)}pushClassMethod(e,r,i,a,n,o){if(r.variance&&this.unexpected(r.variance.start),delete r.variance,this.match(43)&&(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.start),delete r.variance,this.match(43)&&(r.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,r,i,a)}flowParseClassImplements(){let e=this.startNode();return e.id=this.flowParseRestrictedIdentifier(!0),this.match(43)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"ClassImplements")}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&(this.match(43)||this.match(47))&&(e.superTypeArguments=this.flowParseTypeParameterInstantiationInExpression()),this.eatContextual(109)){let r=e.implements=[];do r.push(this.flowParseClassImplements());while(this.eat(8))}}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.start),delete e.variance;let h;this.match(43)&&!o&&(h=this.flowParseTypeParameterDeclaration(),this.match(6)||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(13)&&(e.type!=="Identifier"&&this.raise(g.PatternIsOptional,e),this.isThisParam(e)&&this.raise(g.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(10)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(g.ThisParamAnnotationRequired,e),this.match(25)&&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}parseImportSpecifierLocal(e,r,i){r.local=at(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(126)){if(!e)return!0;let r=this.lookaheadCharCode();return r===123||r===42}return!e&&this.isContextual(83)}applyImportPhase(e,r,i,a){if(super.applyImportPhase(e,r,i,a),r){if(!i&&this.match(61))return;e.exportKind=i==="type"?i:"value"}else i==="type"&&this.match(51)&&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(89)&&!this.isLookaheadContextual("as")){let d=this.parseIdentifier(!0);l!==null&&!U(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&&U(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=l;else{if(r)throw this.raise(p.ImportBindingIsString,e,{importName:o.value});e.imported=o,e.importKind=null}this.eatContextual(89)?e.local=this.parseIdentifier():(h=!0,e.local=this.cloneIdentifier(e.imported))}let c=at(e);return i&&c&&this.raise(g.ImportTypeShorthandOnlyInPureImport,e),(i||c)&&this.checkReservedType(e.local.name,e.local.start,!0),h&&!i&&!c&&this.checkReservedWord(e.local.name,e.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){return this.state.type===74?this.parseIdentifier(!0):super.parseBindingAtom()}parseFunctionParams(e,r){let i=e.kind;i!=="get"&&i!=="set"&&this.match(43)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,r)}parseVarId(e,r){super.parseVarId(e,r),this.match(10)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,r){if(this.match(10)){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(10)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,r){let i=null,a;if(this.hasPlugin("jsx")&&(this.match(138)||this.match(43))){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===w.j_oTag||o===w.j_expr)&&n.pop()}if(a!=null&&a.error||this.match(43)){i=i||this.state.clone();let n,o=this.tryParse(h=>{var m;n=this.flowParseTypeParameterDeclaration();let c=this.forwardNoArrowParamsConversionAt(n,()=>{let P=super.parseMaybeAssign(e,r);return this.resetStartLocationFromNode(P,n),P});(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(10)){let r=this.tryParse(()=>{let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let a=this.startNode();return[a.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(!0),this.state.noAnonFunctionType=i,this.canInsertSemicolon()&&this.unexpected(),this.match(15)||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(10)||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(43)){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(14)&&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(6),n.arguments=this.parseCallExpressionArguments(),n.optional=!0,this.finishCallExpression(n,!0)}else if(!i&&this.shouldParseTypes()&&(this.match(43)||this.match(47))){let n=this.startNodeAt(r);n.callee=e;let o=this.tryParse(()=>(n.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(6),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(43)&&(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(5,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(p.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,r){this.raise(g.EnumBooleanMemberNotInitialized,e,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(8)||this.match(4);switch(this.state.type){case 131:{let i=this.parseNumericLiteral(this.state.value);if(r())return{type:"number",loc:i.start,value:i};break}case 130:{let i=this.parseStringLiteral(this.state.value);if(r())return{type:"string",loc:i.start,value:i};break}case 81:case 82:{let i=this.parseBooleanLiteral(this.match(81));if(r())return{type:"boolean",loc:i.start,value:i}}}return{type:"invalid",loc:e}}flowEnumMemberRaw(){let e=this.state.startLoc,r=this.parseIdentifier(!0),i=this.eat(25)?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(4);){if(this.eat(17)){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(4)||this.expect(8)}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(98))return null;if(!C(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.start,n=this.flowEnumParseExplicitType({enumName:i});this.expect(2);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(4),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=o.numberMembers,this.expect(4),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(4),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=o.defaultedMembers,this.expect(4),this.finishNode(e,"EnumSymbolBody");default:{let h=()=>(e.members=[],this.expect(4),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let c=o.booleanMembers.length,d=o.numberMembers.length,m=o.stringMembers.length,P=o.defaultedMembers.length;if(!c&&!d&&!m&&!P)return h();if(!c&&!d)return e.members=this.flowEnumStringMembers(o.stringMembers,o.defaultedMembers,{enumName:i}),this.expect(4),this.finishNode(e,"EnumStringBody");if(!d&&!m&&c>=P){for(let S of o.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(S.start,{enumName:i,memberName:S.id.name});return e.members=o.booleanMembers,this.expect(4),this.finishNode(e,"EnumBooleanBody")}else if(!c&&!m&&d>=P){for(let S of o.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(S.start,{enumName:i,memberName:S.id.name});return e.members=o.numberMembers,this.expect(4),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(43)||this.match(47))&&(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===43?(this.state.pos-=1,this.readToken_lt()):e===44&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):e}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},hr=/\r\n|[\r\n\u2028\u2029]/,ue=new RegExp(hr.source,"g");function Y(t){switch(t){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function nt(t,s,e){for(let r=s;r<e;r++)if(Y(t.charCodeAt(r)))return!0;return!1}var Ce=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ie=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function pr(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 cr={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 <>...</>?"},j=B`jsx`(cr);function z(t){return t?t.type==="JSXOpeningFragment"||t.type==="JSXClosingFragment":!1}function G(t){if(t.type==="JSXIdentifier")return t.name;if(t.type==="JSXNamespacedName")return t.namespace.name+":"+t.name.name;if(t.type==="JSXMemberExpression")return G(t.object)+"."+G(t.property);throw new Error("Node had unexpected type: "+t.type)}var ur=t=>class extends t{jsxReadToken(){let s="",e=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(j.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(138)):super.getTokenFromCode(r);return}s+=this.input.slice(e,this.state.pos),this.finishToken(137,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(j.UnexpectedToken,this.state.curPosition(),{unexpected:this.input[this.state.pos],HTMLEntity:r===125?"}":">"});default:Y(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(p.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):Y(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(130,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(136,this.input.slice(e,this.state.pos))}jsxParseIdentifier(){let s=this.startNode();return this.match(136)?s.name=this.state.value:Ke(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(10))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(12);){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 2:return s=this.startNode(),this.setContext(w.brace),this.next(),s=this.jsxParseExpressionContainer(s,w.j_oTag),s.expression.type==="JSXEmptyExpression"&&this.raise(j.AttributeIsEmpty,s),s;case 138:case 130:return this.parseExprAtom();default:throw this.raise(j.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(w.j_expr),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(s,"JSXSpreadChild")}jsxParseExpressionContainer(s,e){var r;if(this.match(4))s.expression=this.jsxParseEmptyExpression();else{let i=this.parseExpression();i.type==="SequenceExpression"&&!((r=i.extra)!=null&&r.parenthesized)&&this.raise(j.UnexpectedSequenceExpression,i.expressions[1]),s.expression=i}return this.setContext(e),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(s,"JSXExpressionContainer")}jsxParseAttribute(){if(this.match(2)){let e=this.startNode();return this.setContext(w.brace),this.next(),this.expect(17),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(w.j_oTag),this.state.canStartJSXElement=!0,this.expect(4),this.finishNode(e,"JSXSpreadAttribute")}let s=this.startNode();return s.name=this.jsxParseNamespacedName(),s.value=this.eat(25)?this.jsxParseAttributeValue():null,this.finishNode(s,"JSXAttribute")}jsxParseOpeningElementAt(s){if(this.eat(139)){let r=this.startNodeAt(s);return this.finishNode(r,"JSXOpeningFragment")}let e=this.startNodeAt(s);return e.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(e)}jsxParseOpeningElementAfterName(s){let e=[];for(;!this.match(52)&&!this.match(139);)e.push(this.jsxParseAttribute());return s.attributes=e,s.selfClosing=this.eat(52),this.expect(139),this.finishNode(s,"JSXOpeningElement")}jsxParseClosingElementAt(s){if(this.eat(139)){let r=this.startNodeAt(s);return this.finishNode(r,"JSXClosingFragment")}let e=this.startNodeAt(s);return e.name=this.jsxParseElementName(),this.expect(139),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 138:if(s=this.state.startLoc,this.next(),this.eat(52)){this.setLoc(s),a=this.jsxParseClosingElementAt(s);break e}r.push(this.jsxParseElementAt(s));break;case 137:r.push(this.parseLiteral(this.state.value,"JSXText"));break;case 2:{let n=this.startNode();this.setContext(w.brace),this.next(),this.match(17)?r.push(this.jsxParseSpreadChild(n)):r.push(this.jsxParseExpressionContainer(n,w.j_expr));break}default:this.unexpected()}z(i)&&!z(a)&&a!==null?this.raise(j.MissingClosingTagFragment,a):!z(i)&&z(a)?this.raise(j.MissingClosingTagElement,a,{openingTagName:G(i.name)}):!z(i)&&!z(a)&&G(a.name)!==G(i.name)&&this.raise(j.MissingClosingTagElement,a,{openingTagName:G(i.name)})}if(z(i)?(e.openingFragment=i,e.closingFragment=a):(e.openingElement=i,e.closingElement=a),e.children=r,this.match(43))throw this.raise(j.UnwrappedAdjacentJSXElements,this.state.startLoc);return z(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(138)?this.jsxParseElement():this.match(43)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(138),this.jsxParseElement()):super.parseExprAtom(s)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(s){let e=this.curContext();if(e===w.j_expr){this.jsxReadToken();return}if(e===w.j_oTag||e===w.j_cTag){if(R(s)){this.jsxReadWord();return}if(s===62){++this.state.pos,this.finishToken(139);return}if((s===34||s===39)&&e===w.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(138);return}super.getTokenFromCode(s)}updateContext(s){let{context:e,type:r}=this.state;if(r===52&&s===138)e.splice(-2,2,w.j_cTag),this.state.canStartJSXElement=!1;else if(r===138)e.push(w.j_oTag);else if(r===139){let i=e[e.length-1];i===w.j_oTag&&s===52||i===w.j_cTag?(e.pop(),this.state.canStartJSXElement=e[e.length-1]===w.j_expr):(this.setContext(w.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=Fs(r)}},dr=class extends Je{constructor(){super(...arguments);y(this,"tsNames",new Map)}},mr=class extends Xe{constructor(){super(...arguments);y(this,"importsStack",[])}get inTSNamespace(){let s=this.scopeStack;return s.length>=2&&s[s.length-1].flags===0&&(s[s.length-2].flags&2048)>0}createScope(s){return this.importsStack.push(new Set),new dr(s)}enter(s){s&3072&&this.importsStack.push(new Set),super.enter(s)}exit(){let s=super.exit();return s&3072&&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(p.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)>0,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)}},fr=class{constructor(){y(this,"sawUnambiguousESM",!1);y(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 jt(t,s){t.trailingComments===void 0?t.trailingComments=s:t.trailingComments.unshift(...s)}function yr(t,s){t.leadingComments===void 0?t.leadingComments=s:t.leadingComments.unshift(...s)}function le(t,s){t.innerComments===void 0?t.innerComments=s:t.innerComments.unshift(...s)}function H(t,s,e){let r=null,i=s.length;for(;r===null&&i>0;)r=s[--i];r===null||r.start>e.start?le(t,e.comments):jt(r,e.comments)}var xr=class extends fr{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 a=t.start;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&&jt(t.leadingNode,s),t.trailingNode!==null&&yr(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":H(e,e.properties,t);break;case"CallExpression":case"NewExpression":case"OptionalCallExpression":H(e,e.arguments,t);break;case"ImportExpression":H(e,[e.source,e.options??null],t);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":case"TSTypeParameterDeclaration":H(e,e.params,t);break;case"ArrayExpression":case"ArrayPattern":H(e,e.elements,t);break;case"ExportNamedDeclaration":case"ImportDeclaration":H(e,e.specifiers,t);break;case"TSEnumBody":H(e,e.members,t);break;case"TSInterfaceBody":H(e,e.body,t);break;default:le(e,s)}else le(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 _t{constructor(){y(this,"flags",2048);y(this,"startIndex");y(this,"curLine");y(this,"lineStart");y(this,"startLoc");y(this,"endLoc");y(this,"errors",[]);y(this,"noArrowAt",[]);y(this,"noArrowParamsConversionAt",[]);y(this,"labels",[]);y(this,"commentsLen",0);y(this,"commentStack",[]);y(this,"pos",0);y(this,"type",135);y(this,"value",null);y(this,"start",0);y(this,"end",0);y(this,"lastTokEndLoc",null);y(this,"lastTokStartLoc",null);y(this,"context",[w.brace]);y(this,"firstInvalidTemplateEscapePos",null);y(this,"strictErrors",new Map);y(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 L(i,a,r)}get canStartArrow(){return(this.flags&2)>0}set canStartArrow(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 inConditionalConsequent(){return(this.flags&256)>0}set inConditionalConsequent(s){s?this.flags|=256:this.flags&=-257}get inHackPipelineBody(){return(this.flags&512)>0}set inHackPipelineBody(s){s?this.flags|=512:this.flags&=-513}get seenTopicReference(){return(this.flags&1024)>0}set seenTopicReference(s){s?this.flags|=1024:this.flags&=-1025}get canStartJSXElement(){return(this.flags&2048)>0}set canStartJSXElement(s){s?this.flags|=2048:this.flags&=-2049}get containsEsc(){return(this.flags&4096)>0}set containsEsc(s){s?this.flags|=4096:this.flags&=-4097}get hasTopLevelAwait(){return(this.flags&8192)>0}set hasTopLevelAwait(s){s?this.flags|=8192:this.flags&=-8193}curPosition(){return new L(this.curLine,this.pos-this.lineStart,this.pos+this.startIndex)}clone(){let s=new _t;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.noArrowAt=this.noArrowAt.slice(),s.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),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}},gr=function(t){return t>=48&&t<=57},ot={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},de={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 lt(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 P=s.charCodeAt(e);if(Tr(t,P,s,e)){h+=s.slice(d,e);break}if(P===92){h+=s.slice(d,e);let S=br(s,e,r,i,t==="template",a);S.ch===null&&!c?c={pos:e,lineStart:r,curLine:i}:h+=S.ch,{pos:e,lineStart:r,curLine:i}=S,d=e}else P===8232||P===8233?(++e,++i,r=e):P===10||P===13?t==="template"?(h+=s.slice(d,e)+`
|
|
6
|
+
`,++e,P===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 Tr(t,s,e,r){return t==="template"?s===96||s===36&&e.charCodeAt(r+1)===123:s===(t==="double"?34:39)}function br(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}=Me(t,s,e,r,2,!1,n,a),o(h===null?null:String.fromCharCode(h))}case 117:{let h;return{code:h,pos:s}=zt(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 Me(t,s,e,r,i,a,n,o){let l=s,h;return{n:h,pos:s}=Vt(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 Vt(t,s,e,r,i,a,n,o,l,h){let c=s,d=i===16?ot.hex:ot.decBinOct,m=i===16?de.hex:i===10?de.dec:i===8?de.oct:de.bin,P=!1,S=0;for(let F=0,I=a??1/0;F<I;++F){let N=t.charCodeAt(s),k;if(N===95&&o!=="bail"){let pe=t.charCodeAt(s-1),Z=t.charCodeAt(s+1);if(o){if(Number.isNaN(Z)||!m(Z)||d.has(pe)||d.has(Z)){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:gr(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,P=!0;else break}++s,S=S*i+k}return s===c||a!=null&&s-c!==a||P?{n:null,pos:s}:{n:S,pos:s}}function zt(t,s,e,r,i,a){let n=t.charCodeAt(s),o;if(n===123){if(++s,{code:o,pos:s}=Me(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}=Me(t,s,e,r,4,!1,i,a));return{code:o,pos:s}}function te(t,s,e){return new L(e,t-s,t)}var Ar=new Set([103,109,115,105,121,117,100,118]),Sr=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 Te(t.startLoc,t.endLoc)}},me,Er=class extends xr{constructor(s,e){super();y(this,"isLookahead");y(this,"tokens",[]);y(this,"errorHandlers_readInt",{invalidDigit:(s,e,r,i)=>this.optionFlags&4096?(this.raise(p.InvalidDigit,te(s,e,r),{radix:i}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(p.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(p.UnexpectedNumericSeparator)});y(this,"errorHandlers_readCodePoint",{...this.errorHandlers_readInt,invalidEscapeSequence:this.errorBuilder(p.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(p.InvalidCodePoint)});y(this,"errorHandlers_readStringContents_string",{...this.errorHandlers_readCodePoint,strictNumericEscape:(s,e,r)=>{this.recordStrictModeErrors(p.StrictNumericEscape,te(s,e,r))},unterminated:(s,e,r)=>{throw this.raise(p.UnterminatedString,te(s-1,e,r))}});y(this,"errorHandlers_readStringContents_template",{...this.errorHandlers_readCodePoint,strictNumericEscape:this.errorBuilder(p.StrictNumericEscape),unterminated:(s,e,r)=>{throw this.raise(p.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,(!me||me.length<(this.length+1)*2)&&(me=new Uint32Array((this.length+1)*2)),this.locData=me}setLoc(s){let e=this.offsetToSourcePos(s.index);this.locData[e*2]=s.line,this.locData[e*2+1]=s.column}getLoc(s){let e=this.offsetToSourcePos(s);return new L(this.locData[e*2],this.locData[e*2+1],s)}pushToken(s){this.tokens.length=this.state.tokensLength,this.tokens.push(s),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.optionFlags&512&&this.pushToken(new Sr(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 Ce.lastIndex=s,Ce.test(this.input)?Ce.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 Ie.lastIndex=s,Ie.test(this.input)?Ie.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(135);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(p.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+s.length,ue.lastIndex=r+2;ue.test(this.input)&&ue.lastIndex<=i;)++this.state.curLine,this.state.lineStart=ue.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 Te(e,this.state.curPosition())};return this.optionFlags&512&&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(;!Y(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 Te(r,this.state.curPosition())};return this.optionFlags&512&&this.pushToken(n),n}skipSpace(){let s=this.state.pos,e=this.optionFlags&8192?[]: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(pr(r))++this.state.pos;else if(r===45&&!this.inModule&&this.optionFlags&16384){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&16384){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(p.UnexpectedDigitAfterHash,this.state.curPosition());R(e)?(++this.state.pos,this.finishToken(134,this.readWord1(e))):e===92?(++this.state.pos,this.finishToken(134,this.readWord1())):this.finishOp(23,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(17)):(++this.state.pos,this.finishToken(12))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(27,2):this.finishOp(52,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;!Y(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(24,r),!0}readToken_mult_modulo(s){let e=s===42?51:50,r=1,i=this.input.charCodeAt(this.state.pos+1);s===42&&i===42&&(r++,i=this.input.charCodeAt(this.state.pos+2),e=53),i===61&&!this.state.inType&&(r++,e=s===37?29:26),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(26,3):this.finishOp(s===124?37:38,2);return}if(s===124&&e===62){this.finishOp(35,2);return}if(e===61){this.finishOp(26,2);return}this.finishOp(s===124?39:41,1)}readToken_caret(){let s=this.input.charCodeAt(this.state.pos+1);s===61&&!this.state.inType?this.finishOp(28,2):s===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(33,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(40,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(34,2):this.finishOp(22,1)}readToken_plus_min(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===s){this.finishOp(30,2);return}e===61?this.finishOp(26,2):this.finishOp(49,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(26,3);return}this.finishOp(47,2);return}if(e===61){this.finishOp(45,2);return}this.finishOp(43,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(26,r+1);return}this.finishOp(48,r);return}if(e===61){this.finishOp(45,2);return}this.finishOp(44,1)}readToken_eq_excl(s){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(42,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(s===61&&e===62){this.state.pos+=2,this.finishToken(15);return}this.finishOp(s===61?25:31,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(26,3):this.finishOp(36,2):s===46&&!(e>=48&&e<=57)?(this.state.pos+=2,this.finishToken(14)):(++this.state.pos,this.finishToken(13))}getTokenFromCode(s){switch(s){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(6);return;case 41:++this.state.pos,this.finishToken(7);return;case 59:++this.state.pos,this.finishToken(9);return;case 44:++this.state.pos,this.finishToken(8);return;case 91:++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(1);return;case 123:++this.state.pos,this.finishToken(2);return;case 125:++this.state.pos,this.finishToken(4);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(11,2):(++this.state.pos,this.finishToken(10));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(32,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(R(s)){this.readWord(s);return}}throw this.raise(p.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(p.UnterminatedRegExp,D(s,1));let h=this.input.charCodeAt(a);if(Y(h))throw this.raise(p.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(Ar.has(h))h===118?o.includes("u")&&this.raise(p.IncompatibleRegExpUVFlags,l()):h===117&&o.includes("v")&&this.raise(p.IncompatibleRegExpUVFlags,l()),o.includes(c)&&this.raise(p.DuplicateRegExpFlags,l());else if(K(h)||h===92)this.raise(p.MalformedRegExpFlags,l());else break;++a,o+=c}this.state.pos=a,this.finishToken(133,{pattern:n,flags:o})}readInt(s,e,r=!1,i=!0){let{n:a,pos:n}=Vt(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);if(a==null&&this.raise(p.InvalidDigit,D(r,2),{radix:s}),this.input.charCodeAt(this.state.pos)===110&&(++this.state.pos,i=!0),R(this.codePointAtPos(this.state.pos)))throw this.raise(p.NumberIdentifier,this.state.curPosition());if(i){let n=this.input.slice(e,this.state.pos).replace(/[_n]/g,"");this.finishToken(132,n);return}this.finishToken(131,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(p.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(p.StrictOctalLiteral,r),!this.state.strict){let m=d.indexOf("_");m>0&&this.raise(p.ZeroDigitNumericSeparator,D(r,m))}n=o&&!/[89]/.test(d)}let l=this.input.charCodeAt(this.state.pos);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(p.InvalidOrMissingExponent,r),i=!0,l=this.input.charCodeAt(this.state.pos));let h=X(0,this.input.slice(e,this.state.pos),"_","");if(l===110&&((i||o)&&this.raise(p.InvalidBigIntLiteral,r),++this.state.pos,a=!0),R(this.codePointAtPos(this.state.pos)))throw this.raise(p.NumberIdentifier,this.state.curPosition());if(a){this.finishToken(132,h);return}let c=n?parseInt(h,8):parseFloat(h);this.finishToken(131,c)}readCodePoint(s){let{code:e,pos:r}=zt(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}=lt(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(130,e)}readTemplateContinuation(){this.match(4)||this.unexpected(null,4),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let s=this.input[this.state.pos],{str:e,firstInvalidLoc:r,pos:i,curLine:a,lineStart:n}=lt("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 L(r.curLine,r.pos-r.lineStart,this.sourceToOffsetPos(r.pos))),this.input.codePointAt(i)===96?this.finishToken(20,r?null:s+e+"`"):(this.state.pos++,this.finishToken(21,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?R:K;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(p.MissingUnicodeEscape,this.state.curPosition()),i=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);l!==null&&(o(l)||this.raise(p.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=je.get(e);r!==void 0?this.finishToken(r,q(r)):this.finishToken(128,e)}checkKeywordEscapes(){let{type:s}=this.state;Ke(s)&&this.state.containsEsc&&this.raise(p.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:q(s)})}raise(s,e,r={}){let i=e instanceof L?e:typeof e=="number"?this.getLoc(e):this.optionFlags&256?e.loc.start:this.getLoc(e.start),a=e instanceof L?i.index:typeof e=="number"?e:e.start,n=s(i,a,r);if(!(this.optionFlags&4096))throw n;return this.isLookahead||this.state.errors.push(n),n}raiseOverwrite(s,e,r={}){let i=e instanceof L?e:this.optionFlags&256?e.loc.start:this.getLoc(e.start),a=e instanceof L?i.index:e.start,n=this.state.errors;for(let o=n.length-1;o>=0;o--){let l=n[o];if(l.pos===a)return n[o]=s(i,a,r);if(l.pos<a)break}return this.raise(s,i,r)}updateContext(s){}unexpected(s,e){throw this.raise(p.UnexpectedToken,s??this.state.startLoc,{expected:e?q(e):null})}expectPlugin(s,e){if(this.hasPlugin(s))return!0;throw this.raise(p.MissingPlugin,e??this.state.startLoc,{missingPlugin:[s]})}expectOnePlugin(s){if(!s.some(e=>this.hasPlugin(e)))throw this.raise(p.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:s})}errorBuilder(s){return(e,r,i)=>{this.raise(s,te(e,r,i))}}},Cr=class{constructor(){y(this,"privateNames",new Set);y(this,"loneAccessors",new Map);y(this,"undefinedPrivateNames",new Map)}},Ir=class{constructor(t){y(this,"parser");y(this,"stack",[]);this.parser=t}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Cr)}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(p.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(p.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(p.InvalidPrivateFieldResolution,s,{identifierName:t})}},be=class{constructor(t=0){this.type=t}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Ht=class extends be{constructor(s){super(s);y(this,"declarationErrors",new Map)}recordDeclarationError(s,e){this.declarationErrors.set(e,s)}clearDeclarationError(s){this.declarationErrors.delete(s)}iterateErrors(s){this.declarationErrors.forEach(s)}},wr=class{constructor(t){y(this,"parser");y(this,"stack",[new be]);this.parser=t}enter(t){this.stack.push(t)}exit(){this.stack.pop()}recordParameterInitializerError(t,s){let{stack:e}=this,r=e.length-1,i=e[r];for(;!i.isCertainlyParameterDeclaration();){if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(t,s);else return;i=e[--r]}this.parser.raise(t,s)}recordArrowParameterBindingError(t,s){let{stack:e}=this,r=e[e.length-1],i=s.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(p.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),a=t[--i]})}};function Nr(){return new be(3)}function kr(){return new Ht(1)}function vr(){return new Ht(2)}function $t(){return new be}var Lr=class{constructor(){y(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}get inFSharpPipelineDirectBody(){return(this.currentFlags()&16)===0}};function xe(t,s){return(t?2:0)|(s?1:0)}var Mr=class extends Er{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(135)||this.match(4)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return nt(this.input,this.offsetToSourcePos(this.state.lastTokEndLoc.index),this.state.start)}hasFollowingLineBreak(){return nt(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(9)||this.canInsertSemicolon()}semicolon(t=!0){(t?this.isLineTerminator():this.eat(9))||this.raise(p.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(p.InvalidCoverInitializedName,e),r!=null&&this.raise(p.DuplicateProto,r),i!=null&&this.raise(p.UnexpectedPrivateField,i),a!=null&&this.unexpected(a),n!=null&&this.raise(p.InvalidCoverDiscardElement,n)}isLiteralPropertyName(){return Lt(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 Lr;let o=this.classScope;this.classScope=new Ir(this);let l=this.expressionScope;return this.expressionScope=new wr(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)}},Pe=class{constructor(){y(this,"shorthandAssignLoc",null);y(this,"doubleProtoLoc",null);y(this,"privateKeyLoc",null);y(this,"optionalParametersLoc",null);y(this,"voidPatternLoc",null)}},ie=class{constructor(t,s,e,r){y(this,"type","");this.start=e,this.end=0,r!==void 0&&(this.loc=new Te(r)),t&128&&(this.range=[e,0]),r!==void 0&&s&&(this.loc.filename=s)}},ht=ie.prototype,Dr=class extends Mr{createPosition(t){return t}startNode(){let{startLoc:t}=this.state;return this.setLoc(t),this.startNodeAt(t)}startNodeAt(t){let{optionFlags:s,filename:e}=this;return s&256?new ie(s,e,t.index,this.createPosition(t)):new ie(s,e,t.index)}startNodeAtNode(t){let{optionFlags:s,filename:e}=this;return s&256?new ie(s,e,t.start,t.loc.start):new ie(s,e,t.start)}finishNode(t,s){return this.finishNodeAt(t,s,this.state.lastTokEndLoc)}finishNodeAt(t,s,e){t.type=s,t.end=e.index;let{optionFlags:r}=this;return r&256&&(t.loc.end=this.createPosition(e)),r&128&&(t.range[1]=e.index),r&8192&&this.processComment(t),t}finishNodeAtNode(t,s,e){t.type=s,t.end=e.end;let{optionFlags:r}=this;return r&256&&(t.loc.end=e.loc.end),r&128&&(t.range[1]=t.end),r&8192&&this.processComment(t),t}resetStartLocation(t,s){t.start=s.index;let{optionFlags:e}=this;e&256&&(t.loc.start=this.createPosition(s)),e&128&&(t.range[0]=s.index)}resetEndLocation(t,s=this.state.lastTokEndLoc){t.end=s.index;let{optionFlags:e}=this;e&256&&(t.loc.end=this.createPosition(s)),e&128&&(t.range[1]=s.index)}resetStartLocationFromNode(t,s){t.start=s.start;let{optionFlags:e}=this;e&256&&(t.loc.start=s.loc.start),e&128&&(t.range[0]=s.start)}resetEndLocationFromNode(t,s){t.end=s.end;let{optionFlags:e}=this;e&256&&(t.loc.end=s.loc.end),e&128&&(t.range[1]=s.end)}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(ht);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(ht);return o.type=s,o.start=e,o.end=r,o.loc=i,o.range=a,o.extra=n,o.value=t.value,o}},De=t=>t.type==="ParenthesizedExpression"?De(t.expression):t,Or=class extends Dr{toAssignable(t,s=!1){var r,i,a;let e;switch((t.type==="ParenthesizedExpression"||(r=t.extra)!=null&&r.parenthesized)&&(e=De(t),s?e.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(p.InvalidParenthesizedAssignment,t):e.type!=="CallExpression"&&e.type!=="MemberExpression"&&!this.isOptionalMemberExpression(e)&&this.raise(p.InvalidParenthesizedAssignment,t):this.raise(p.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(p.RestTrailingComma,t.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:n,value:o}=t;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.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(p.MissingEqInAssignment,this.optionFlags&256?t.left.loc.end:t.left),this.castNodeTo(t,"AssignmentPattern"),delete t.operator,t.left.type==="VoidPattern"&&this.raise(p.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"?p.PatternHasAccessor:p.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(p.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(p.RestTrailingComma,a):s&&this.raise(p.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}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(p.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(1,93,1),this.finishNode(t,"ArrayPattern")}case 2:return this.parseObjectLike(4,!0);case 84: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(8),r&&this.match(8))i.push(null);else{if(this.eat(t))break;if(this.match(17)){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(22)&&this.hasPlugin("decorators")&&this.raise(p.UnsupportedParameterDecorator,this.state.startLoc);this.match(22);)n.push(this.parseDecorator());i.push(this.parseBindingElement(e,n))}}return i}parseBindingRestProperty(t){return this.next(),this.hasPlugin("discardBinding")&&this.match(84)?(t.argument=this.parseVoidPattern(null),this.raise(p.UnexpectedVoidPattern,t.argument)):t.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(t,"RestElement")}parseBindingProperty(){let{type:t,startLoc:s}=this.state;if(t===17)return this.parseBindingRestProperty(this.startNode());let e=this.startNode();return t===134?(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{startLoc:e}=this.state,r=this.parseMaybeDefault();return t&2&&this.parseFunctionParamType(r),s.length&&(r.decorators=s,this.resetStartLocationFromNode(r,s[0])),this.parseMaybeDefault(e,r)}parseFunctionParamType(t){return t}parseMaybeDefault(t,s){if(t??(t=this.state.startLoc),s=s??this.parseBindingAtom(),!this.eat(25))return s;let e=this.startNodeAt(t);return s.type==="VoidPattern"&&this.raise(p.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&16384)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.start),s.type!=="AssignmentExpression"&&this.raise(p.InvalidLhsOptionalChaining,t,{ancestor:s})),e!==64&&this.raise(p.InvalidPropertyBindingPattern,t);return}if(o==="Identifier"){this.checkIdentifier(t,e,i);let{name:I}=t;r&&(r.has(I)?this.raise(p.ParamDupe,t):r.add(I));return}else o==="VoidPattern"&&s.type==="CatchClause"&&this.raise(p.VoidPatternCatchClauseParam,t);let h=De(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 I=e===64?p.InvalidLhs:p.InvalidLhsBinding;this.raise(I,t,{ancestor:s});return}let d,m;typeof c=="string"?(d=c,m=o==="ParenthesizedExpression"):[d,m]=c;let P=o==="ArrayPattern"||o==="ObjectPattern"?{type:o}:s,S=t[d];if(Array.isArray(S))for(let I of S)I&&this.checkLVal(I,P,e,r,i,m,!0);else S&&this.checkLVal(S,P,e,r,i,m,n)}checkIdentifier(t,s,e=!1){this.state.strict&&(e?Rt(t.name,this.inModule):Ut(t.name))&&(s===64?this.raise(p.StrictEvalArguments,t,{referenceName:t.name}):this.raise(p.StrictEvalArgumentsBinding,t,{bindingName:t.name})),s&8192&&t.name==="let"&&this.raise(p.LetInLexicalBinding,t),s&64||this.declareNameFromIdentifier(t,s)}declareNameFromIdentifier(t,s){this.scope.declareName(t.name,s,t.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(p.InvalidRestAssignmentPattern,t)}}checkCommaAfterRest(t){return this.match(8)?(this.raise(this.lookaheadCharCode()===t?p.RestTrailingComma:p.ElementAfterRest,this.state.startLoc),!0):!1}},Fr=class extends Or{checkProto(t,s,e){if(t.type==="SpreadElement"||this.isObjectMethod(t)||t.computed||t.shorthand)return s;let r=t.key;return(r.type==="Identifier"?r.name:r.value)==="__proto__"?(s&&(e?e.doubleProtoLoc===null&&(e.doubleProtoLoc=this.getLoc(r.start)):this.raise(p.DuplicateProto,r)),!0):s}shouldExitDescending(t){var s;return t.type==="ArrowFunctionExpression"&&!((s=t.extra)!=null&&s.parenthesized)}getExpression(){if(this.enterInitialScopes(),this.nextToken(),this.match(135))throw this.raise(p.ParseExpressionEmptyInput,this.state.startLoc);let t=this.parseExpression();if(!this.match(135))throw this.raise(p.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&512&&(t.tokens=qt(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(8)){let r=this.startNodeAt(s);for(r.expressions=[e];this.eat(8);)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(104);if(r&&this.prodParam.hasYield){this.next();let n=this.parseYield(e);return s&&(n=s.call(this,n,e)),n}let i;t?i=!1:(t=new Pe,i=!0),this.state.canStartArrow=!0;let a=this.parseMaybeConditional(t);if(s&&(a=s.call(this,a,e)),Bs(this.state.type)){let n=this.startNodeAt(e),o=this.state.value;if(n.operator=o,this.match(25)){this.toAssignable(a,!0),n.left=a;let l=e.index;t.doubleProtoLoc!=null&&t.doubleProtoLoc.index>=l&&(t.doubleProtoLoc=null),t.shorthandAssignLoc!=null&&t.shorthandAssignLoc.index>=l&&(t.shorthandAssignLoc=null),t.privateKeyLoc!=null&&t.privateKeyLoc.index>=l&&(this.checkDestructuringPrivate(t),t.privateKeyLoc=null),t.voidPatternLoc!=null&&t.voidPatternLoc.index>=l&&(t.voidPatternLoc=null)}else n.left=a;return this.next(),n.right=this.parseMaybeAssign(),this.checkLVal(a,this.finishNode(n,"AssignmentExpression"),void 0,void 0,void 0,void 0,o==="||="||o==="&&="||o==="??="),n}else i&&this.checkExpressionErrors(t,!0);if(r){let{type:n}=this.state;if((this.hasPlugin("v8intrinsic")?re(n):re(n)&&!this.match(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(p.YieldNotInGeneratorFunction,e),this.parseYield(e)}return a}parseMaybeConditional(t){let s=this.state.startLoc,e=this.parseExprOps(t);return this.shouldExitDescending(e)?e:this.parseConditional(e,s,t)}parseConditional(t,s,e){if(this.eat(13)){let r=this.startNodeAt(s);return r.test=t,r.consequent=this.parseMaybeAssignAllowIn(),this.expect(10),r.alternate=this.parseMaybeAssign(),this.finishNode(r,"ConditionalExpression")}return t}parseMaybeUnaryOrPrivate(t){return this.match(134)?this.parsePrivateName():this.parseMaybeUnary(t)}parseExprOps(t){let s=this.state.startLoc,e=this.parseMaybeUnaryOrPrivate(t);return this.shouldExitDescending(e)?e:(this.state.canStartArrow=!1,this.parseExprOp(e,s,-1))}parseExprOp(t,s,e){if(this.isPrivateName(t)){let i=this.getPrivateNameSV(t);(e>=ye(54)||!this.prodParam.hasIn||!this.match(54))&&this.raise(p.PrivateInExpectedIn,s,{identifierName:i}),this.classScope.usePrivateName(i,s)}let r=this.state.type;if(it(r)&&(this.prodParam.hasIn||!this.match(54))){let i=ye(r);if(i>e){if(r===35&&(this.expectPlugin("pipelineOperator"),this.prodParam.inFSharpPipelineDirectBody))return t;let a=this.startNodeAt(s);a.left=t,a.operator=this.state.value;let n=r===37||r===38,o=r===36;o&&(i=ye(38)),this.next(),a.right=this.parseExprOpRightExpr(r,i);let l=this.finishNode(a,n||o?"LogicalExpression":"BinaryExpression"),h=this.state.type;if(o&&(h===37||h===38)||n&&h===36)throw this.raise(p.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(l,s,e)}}return t}parseExprOpRightExpr(t,s){switch(t){case 35:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"fsharp":return this.parseFSharpPipelineBody(s)}default:return this.parseExprOpBaseRightExpr(t,s)}}parseExprOpBaseRightExpr(t,s){let e=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,zs(t)?s-1:s)}parseHackPipeBody(){var e;let{startLoc:t}=this.state,s=this.parseMaybeAssign();return Cs.has(s.type)&&!((e=s.extra)!=null&&e.parenthesized)&&this.raise(p.PipeUnparenthesizedBody,t,{type:s.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(p.PipeTopicUnused,t),s}checkExponentialAfterUnary(t){this.match(53)&&this.raise(p.UnexpectedTokenUnaryExponentiation,t.argument)}parseMaybeUnary(t,s){let e=this.state.startLoc,r=this.isContextual(92);if(r&&this.recordAwaitIfAllowed()){this.next();let o=this.parseAwait(e);return s||this.checkExponentialAfterUnary(o),o}let i=this.match(30),a=this.startNode();if(js(this.state.type)){a.operator=this.state.value,a.prefix=!0,this.state.canStartArrow=!1,this.match(68)&&this.expectPlugin("throwExpressions");let o=this.match(85);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(p.StrictDelete,a):this.hasPropertyAsPrivateName(l)&&this.raise(p.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(50))&&!this.isAmbiguousPrefixOrIdentifier())return this.raiseOverwrite(p.AwaitNotInAsyncContext,e),this.parseAwait(e)}return n}parseUpdate(t,s,e){if(s){let a=this.finishNode(t,"UpdateExpression");return this.checkLVal(a.argument,a),a}let r=this.state.startLoc,i=this.parseExprSubscripts(e);if(this.checkExpressionErrors(e,!1))return i;for(;Rs(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;this.setLoc(s);let e=this.parseExprAtom(t);return this.shouldExitDescending(e)?e:this.parseSubscripts(e,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===11)return this.parseBind(t,s,r);if(ve(i))return this.parseTaggedTemplateExpression(t,s,r);let a=!1;if(i===14){if(e&&(this.raise(p.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return this.stopParseSubscript(t,r);r.optionalChainMember=a=!0,this.next()}if(!e&&this.match(6))return this.parseCoverCallAndAsyncArrowHead(t,s,r,a);{let n=this.eat(0);return n||a||this.eat(12)?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(1)):this.match(134)?(t.type==="Super"&&this.raise(p.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){let r=this.startNodeAt(s);r.object=t,this.next();let i=this.match(79),a=this.parseNoCallExpr();if(a.type==="Super"||i&&a.type==="ImportExpression"||a.type==="Import")throw this.raise(p.UnsupportedBindRHS,a);return r.callee=a,e.stop=!0,this.parseSubscripts(this.finishNode(r,"BindExpression"),s,!1)}parseCoverCallAndAsyncArrowHead(t,s,e,r){let i=null;this.next();let a=this.startNodeAt(s);a.callee=t;let{maybeAsyncArrow:n,optionalChainMember:o}=e;n&&(this.expressionScope.enter(vr()),i=new Pe),o&&(a.optional=r),r?a.arguments=this.parseCallExpressionArguments():a.arguments=this.parseCallExpressionArguments(t.type!=="Super",a,i);let l=this.finishCallExpression(a,o);return n&&this.shouldParseAsyncArrow()&&!r?(e.stop=!0,this.checkDestructuringPrivate(i),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),l=this.parseAsyncArrowFromCallExpression(this.startNodeAt(s),l)):(n&&(this.checkExpressionErrors(i,!0),this.expressionScope.exit()),this.toReferencedList(a.arguments)),l}parseTaggedTemplateExpression(t,s,e){let r=this.startNodeAt(s);return r.tag=t,r.quasi=this.parseTemplate(!0),e.optionalChainMember&&this.raise(p.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.state.canStartArrow}finishCallExpression(t,s){if(t.callee.type==="Import")if(t.arguments.length===0||t.arguments.length>2)this.raise(p.ImportCallArity,t);else for(let e of t.arguments)e.type==="SpreadElement"&&this.raise(p.ImportCallSpreadArgument,e);return this.finishNode(t,s?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(t,s,e){let r=[],i=!0;for(;!this.eat(7);){if(i)i=!1;else if(this.expect(8),this.match(7)){s&&this.addTrailingCommaExtraToNode(s),this.next();break}r.push(this.parseExprListItem(7,!1,e,t))}return r}shouldParseAsyncArrow(){return this.match(15)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(t,s){var e;return this.resetPreviousNodeTrailingComments(s),this.expect(15),this.parseArrowExpression(t,s.arguments,!0,(e=s.extra)==null?void 0:e.trailingCommaLoc),s.innerComments&&le(t,s.innerComments),s.callee.trailingComments&&le(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 75:return this.parseSuper();case 79:return s=this.startNode(),this.next(),this.match(12)?this.parseImportMetaPropertyOrPhaseCall(s):this.match(6)?this.optionFlags&1024?this.parseImportCall(s):this.finishNode(s,"Import"):(this.raise(p.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(s,"Import"));case 74:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case 86:return this.parseDo(this.startNode(),!1);case 52:case 27:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 131:return this.parseNumericLiteral(this.state.value);case 132:return this.parseBigIntLiteral(this.state.value);case 130:return this.parseStringLiteral(this.state.value);case 80:return this.parseNullLiteral();case 81:return this.parseBooleanLiteral(!0);case 82:return this.parseBooleanLiteral(!1);case 6:return this.parseParenAndDistinguishExpression(this.state.canStartArrow);case 0:return this.parseArrayLike(1,t);case 2:return this.parseObjectLike(4,!1,t);case 64:return this.parseFunctionOrFunctionSent();case 22:e=this.parseDecorators();case 76:return this.parseClass(this.maybeTakeDecorators(e,this.startNode()),!1);case 73:return this.parseNewOrNewTarget();case 21:case 20:return this.parseTemplate(!1);case 11:{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(p.UnsupportedBind,i)}case 134:return this.raise(p.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 29:return this.parseTopicReferenceThenEqualsSign(50,"%");case 28:return this.parseTopicReferenceThenEqualsSign(40,"^");case 33:case 34:return this.parseTopicReference("hack");case 40:case 50:case 23:{let i=this.getPluginOption("pipelineOperator","proposal");if(i)return this.parseTopicReference(i);throw this.unexpected()}case 43:{let i=this.input.codePointAt(this.nextTokenStart());throw R(i)||i===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected()}default:if(C(r)){if(this.isContextual(123)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let{canStartArrow:i,containsEsc:a}=this.state,n=this.parseIdentifier();if(!a&&n.name==="async"&&!this.canInsertSemicolon()){let{type:o}=this.state;if(o===64)return this.resetPreviousNodeTrailingComments(n),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(n));if(C(o))return i&&this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(n)):n;if(o===86)return this.resetPreviousNodeTrailingComments(n),this.parseDo(this.startNodeAtNode(n),!0)}return i&&this.match(15)&&!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(p.PipeTopicUnbound,s),this.registerTopicReference(),this.finishNode(t,"TopicReference");throw this.raise(p.PipeTopicUnconfiguredToken,s,{token:q(r)})}testTopicReferenceConfiguration(t,s,e){if(t==="hack")return this.hasPlugin(["pipelineOperator",{topicToken:q(e)}]);throw this.raise(p.PipeTopicRequiresHackPipes,s)}parseAsyncArrowUnaryFunction(t){this.prodParam.enter(xe(!0,this.prodParam.hasYield));let s=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(p.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(15),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(6)&&!this.scope.allowDirectSuper?this.raise(p.SuperNotAllowed,t):this.scope.allowSuper||this.raise(p.UnexpectedSuper,t),!this.match(6)&&!this.match(0)&&!this.match(12)&&this.raise(p.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(12)){let s=this.createIdentifier(this.startNodeAtNode(t),"function");return this.next(),this.match(99)?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(p.UnsupportedMetaProperty,t.property,{target:s.name,onlyValidPropertyName:e}),this.finishNode(t,"MetaProperty")}parseImportMetaPropertyOrPhaseCall(t){if(this.next(),this.isContextual(101)||this.isContextual(93)){let s=this.isContextual(101);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(97)&&(this.inModule||this.raise(p.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")}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(kr());let r=this.state.startLoc,i=[],a=new Pe,n=!0,o,l;for(;!this.match(7);){if(n)n=!1;else if(this.expect(8,a.optionalParametersLoc===null?null:a.optionalParametersLoc),this.match(7)){l=this.state.startLoc;break}if(this.match(17)){let d=this.state.startLoc;if(o=this.state.startLoc,i.push(this.parseParenItem(this.parseRestBinding(),d)),!this.checkCommaAfterRest(41))break}else i.push(this.parseMaybeAssignAllowInOrVoidPattern(7,a,this.parseParenItem))}let h=this.state.lastTokEndLoc;this.expect(7);let c=this.startNodeAt(s);return t&&this.shouldParseArrow(i)&&(c=this.parseArrow(c))?(this.checkDestructuringPrivate(a),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(c,i,!1),c):(this.expressionScope.exit(),i.length||this.unexpected(this.state.lastTokStartLoc),l&&this.unexpected(l),o&&this.unexpected(o),this.checkExpressionErrors(a,!0),this.toReferencedList(i,!0),i.length>1?(e=this.startNodeAt(r),e.expressions=i,this.finishNode(e,"SequenceExpression"),this.resetEndLocation(e,h)):e=i[0],this.wrapParenthesis(s,e))}wrapParenthesis(t,s){if(!(this.optionFlags&2048))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(15))return t}parseParenItem(t,s){return t}parseNewOrNewTarget(){let t=this.startNode();if(this.next(),this.match(12)){let s=this.createIdentifier(this.startNodeAtNode(t),"new");this.next();let e=this.parseMetaProperty(t,s,"target");return this.scope.allowNewTarget||this.raise(p.UnexpectedNewTarget,e),e}return this.parseNew(t)}parseNew(t){if(this.parseNewCallee(t),this.eat(6)){let s=this.parseExprList(7);this.toReferencedList(s),t.arguments=s}else t.arguments=[];return this.finishNode(t,"NewExpression")}parseNewCallee(t){let s=this.match(79),e=this.parseNoCallExpr();t.callee=e,s&&e.type==="ImportExpression"&&this.raise(p.ImportCallNotNewExpression,e,e),e.type==="Import"&&this.raise(p.ImportCallNotNewExpression,e),e.type==="Super"&&this.raise(p.SuperCallNotNewExpression,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(p.InvalidEscapeSequenceTemplate,D(this.state.firstInvalidTemplateEscapePos,1)));let o=this.match(20),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){let r=!1,i=!0,a=this.startNode();for(a.properties=[],this.next();!this.match(t);){if(i)i=!1;else if(this.expect(8),this.match(t)){this.addTrailingCommaExtraToNode(a);break}let o;s?o=this.parseBindingProperty():(o=this.parsePropertyDefinition(e),r=this.checkProto(o,r,e)),a.properties.push(o)}this.next();let n=s?"ObjectPattern":"ObjectExpression";return this.finishNode(a,n)}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(51))}parsePropertyDefinition(t){let s=[];if(this.match(22))for(this.hasPlugin("decorators")&&this.raise(p.UnsupportedPropertyDecorator,this.state.startLoc);this.match(22);)s.push(this.parseDecorator());let e=this.startNode(),r=!1,i=!1,a;if(this.match(17))return s.length&&this.unexpected(),this.parseSpread();s.length&&(e.decorators=s),e.method=!1,t&&(a=this.state.startLoc);let n=this.eat(51);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(51),this.parsePropertyName(e)),(h==="get"||h==="set")&&(i=!0,this.resetPreviousNodeTrailingComments(l),e.kind=h,this.match(51)&&(n=!0,this.raise(p.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"?p.BadGetterArity:p.BadSetterArity,t),t.kind==="set"&&((r=e[e.length-1])==null?void 0:r.type)==="RestElement"&&this.raise(p.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(6))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(10))return t.value=e?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowInOrVoidPattern(4,r),this.finishObjectProperty(t);if(!t.computed&&t.key.type==="Identifier"){if(this.checkReservedWord(t.key.name,t.key.start,!0,!1),e)t.value=this.parseMaybeDefault(s,this.cloneIdentifier(t.key));else if(this.match(25)){let i=this.state.startLoc;r!=null?r.shorthandAssignLoc===null&&(r.shorthandAssignLoc=i):this.raise(p.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(1);else{let{type:e,value:r}=this.state,i;if(U(e))i=this.parseIdentifier(!0);else switch(e){case 131:i=this.parseNumericLiteral(r);break;case 130:i=this.parseStringLiteral(r);break;case 132:i=this.parseBigIntLiteral(r);break;case 134:{let a=this.state.startLoc;s!=null?s.privateKeyLoc===null&&(s.privateKeyLoc=a):this.raise(p.UnexpectedPrivateField,a),i=this.parsePrivateName();break}default:this.unexpected()}t.key=i,e!==134&&(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(xe(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){let e=this.startNode();return this.next(),e.elements=this.parseExprList(t,!0,s,e),this.finishNode(e,"ArrayExpression")}parseArrowExpression(t,s,e,r){this.scope.enter(518);let i=xe(e,!1);return this.match(2)||(i|=this.prodParam.currentFlags()&24),this.prodParam.enter(i),this.initFunction(t,e),s&&this.setArrowFunctionParameters(t,s,r),this.parseFunctionBody(t,!0),this.prodParam.exit(),this.scope.exit(),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(2);if(this.expressionScope.enter($t()),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(p.IllegalLanguageModeDirective,(t.kind==="method"||t.kind==="constructor")&&t.key?this.optionFlags&256?t.key.loc.end:t.key: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(8),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(8))s||this.raise(p.UnexpectedToken,this.state.curPosition(),{unexpected:","}),i=null;else if(this.match(17)){let a=this.state.startLoc;i=this.parseParenItem(this.parseSpread(e),a)}else if(this.match(13)){this.expectPlugin("partialApplication"),r||this.raise(p.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,this.optionFlags&256&&(t.loc.identifierName=s),this.finishNode(t,"Identifier")}createIdentifierAt(t,s,e){return t.name=s,this.optionFlags&256&&(t.loc.identifierName=s),this.finishNodeAt(t,"Identifier",e)}parseIdentifierName(t){let s,{start:e,type:r}=this.state;U(r)?s=this.state.value:this.unexpected();let i=Os(r);return t?i&&this.replaceToken(128):this.checkReservedWord(s,this.sourceToOffsetPos(e),i,!1),this.next(),s}checkReservedWord(t,s,e,r){if(!(t.length>10||!Zs(t))){if(e&&Gs(t)){this.raise(p.UnexpectedKeyword,s,{keyword:t});return}if((this.state.strict?r?Rt:Bt:Ft)(t,this.inModule)){this.raise(p.UnexpectedReservedWord,s,{reservedWord:t});return}else if(t==="yield"){if(this.prodParam.hasYield){this.raise(p.YieldBindingIdentifier,s);return}}else if(t==="await"){if(this.prodParam.hasAwait){this.raise(p.AwaitBindingIdentifier,s);return}if(this.scope.inStaticBlock){this.raise(p.AwaitBindingIdentifierInStaticBlock,s);return}this.expressionScope.recordAsyncArrowParametersError(s)}else if(t==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(p.ArgumentsInClass,s);return}}}recordAwaitIfAllowed(){let t=this.prodParam.hasAwait;return t&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),t}parseAwait(t,s){let e=t.index;this.setLoc(t);let r=this.startNodeAt(t);return this.expressionScope.recordParameterInitializerError(p.AwaitExpressionFormalParameter,e),this.eat(51)&&this.raise(p.ObsoleteAwaitStar,t),!this.scope.inFunction&&!(this.optionFlags&1)&&(this.isAmbiguousPrefixOrIdentifier()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),s||(r.argument=this.parseMaybeUnary(null,!0)),this.finishNode(r,"AwaitExpression")}isAmbiguousPrefixOrIdentifier(){if(this.hasPrecedingLineBreak())return!0;let{type:t}=this.state;return t===49||t===6||t===0||ve(t)||t===98&&!this.state.containsEsc||t===133||t===52||this.hasPlugin("v8intrinsic")&&t===50}parseYield(t){this.setLoc(t);let s=this.startNodeAt(t);this.expressionScope.recordParameterInitializerError(p.YieldInParameter,t.index);let e=!1,r=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(51),this.state.type){case 9:case 135:case 4:case 7:case 1:case 5:case 10:case 8:if(!e)break;default:r=this.parseMaybeAssign()}return s.delegate=e,s.argument=r,this.finishNode(s,"YieldExpression")}parseImportCall(t){this.next();let s=this.parseCallExpressionArguments();if(s.length===0||s.length>2)this.raise(p.ImportCallArity,t,t);else for(let e of s)e.type==="SpreadElement"&&this.raise(p.ImportCallSpreadArgument,e,t);return t.source=s[0],t.options=s[1]??null,this.finishNode(t,"ImportExpression")}withTopicBindingContext(t){let s=this.state.inHackPipelineBody;this.state.inHackPipelineBody=!0;let e=this.state.seenTopicReference;this.state.seenTopicReference=!1;try{return t()}finally{this.state.inHackPipelineBody=s,this.state.seenTopicReference=e}}allowInAnd(t){let s=this.prodParam.currentFlags();if(24&~s){this.prodParam.enter(s|8|16);try{return t()}finally{this.prodParam.exit()}}return t()}disallowInAnd(t){let s=this.prodParam.currentFlags(),e=8&s,r=16&~s;if(e||r){this.prodParam.enter(s&-9|16);try{return t()}finally{this.prodParam.exit()}}return t()}registerTopicReference(){this.state.seenTopicReference=!0}topicReferenceIsAllowedInCurrentContext(){return this.state.inHackPipelineBody}topicReferenceWasUsedInCurrentContext(){return this.state.seenTopicReference}parseFSharpPipelineBody(t){let s=this.state.startLoc;this.prodParam.enter(this.prodParam.currentFlags()&-17);let e;if(this.isContextual(92)&&this.recordAwaitIfAllowed()){this.next(),e=this.parseAwait(s,!0);let r=this.state.type;it(r)&&r!==35&&(this.prodParam.hasIn||r!==54)&&this.raise(p.PipelineUnparenthesized,s)}else this.state.canStartArrow=!0,e=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),s,t);return this.prodParam.exit(),e}parseModuleExpression(){this.expectPlugin("moduleBlocks");let t=this.startNode();this.next(),this.match(2)||this.unexpected(null,2);let s=this.startNodeAt(this.state.endLoc);this.next();let e=this.initializeScopes(!0);this.enterInitialScopes();try{t.body=this.parseProgram(s,4,"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(84)){let r=this.lookaheadCharCode();if(r===44||r===(t===1?93:t===4?125:41)||r===61)return this.parseMaybeDefault(this.state.startLoc,this.parseVoidPattern(s))}return this.parseMaybeAssignAllowIn(s,e)}parsePropertyNamePrefixOperator(t){}},we={kind:1},Br={kind:2},Ur=/[\uD800-\uDFFF]/u,Ne=/in(?:stanceof)?/y;function qt(t){for(let s=0;s<t.length;s++){let e=t[s],{type:r}=e;typeof r=="number"&&(e.type=Mt(r))}return t}var Rr=class extends Fr{parseTopLevel(t,s){return t.program=this.parseProgram(s,135,this.options.sourceType==="module"?"module":"script"),t.comments=this.comments,this.optionFlags&512&&(t.tokens=qt(this.tokens)),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(p.ModuleExportUndefined,a,{localName:i});this.addExtra(t,"topLevelAwait",this.state.hasTopLevelAwait)}let r;return s===135?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(24))return null;let t=this.startNode();return t.value=this.state.value,this.next(),this.finishNode(t,"InterpreterDirective")}isLet(){return this.isContextual(96)?this.hasFollowingBindingAtom():!1}isUsing(){return this.isContextual(103)?this.nextTokenIsIdentifierOnSameLine():!1}isForUsing(){if(!this.isContextual(103))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(92))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(R(t)){if(Ne.lastIndex=s,Ne.test(this.input)){let e=this.codePointAtPos(Ne.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(22)&&(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 56:return this.parseBreakContinueStatement(r,!0);case 59:return this.parseBreakContinueStatement(r,!1);case 60:return this.parseDebuggerStatement(r);case 86:return this.parseDoWhileStatement(r);case 87:return this.parseForStatement(r);case 64:if(this.lookaheadCharCode()===46)break;return a||this.raise(this.state.strict?p.StrictFunction:this.options.annexB?p.SloppyFunctionAnnexB:p.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(r,!1,!i&&a);case 76:return i||this.unexpected(),this.parseClass(this.maybeTakeDecorators(s,r),!0);case 65:return this.parseIfStatement(r);case 66:return this.parseReturnStatement(r);case 67:return this.parseSwitchStatement(r);case 68:return this.parseThrowStatement(r);case 69:return this.parseTryStatement(r);case 92:if(this.isAwaitUsing())return this.allowsUsing()?i?this.recordAwaitIfAllowed()||this.raise(p.AwaitUsingNotInAsyncContext,r):this.raise(p.UnexpectedLexicalDeclaration,r):this.raise(p.UnexpectedUsingDeclaration,r),this.next(),this.parseVarStatement(r,"await using");break;case 103:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.allowsUsing()?i||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc):this.raise(p.UnexpectedUsingDeclaration,this.state.startLoc),this.parseVarStatement(r,"using");case 96:{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 71:i||this.raise(p.UnexpectedLexicalDeclaration,this.state.startLoc);case 70:{let h=this.state.value;return this.parseVarStatement(r,h)}case 88:return this.parseWhileStatement(r);case 72:return this.parseWithStatement(r);case 2:return this.parseBlock();case 9:return this.parseEmptyStatement(r);case 79:{let h=this.lookaheadCharCode();if(h===40||h===46)break}case 78:{!(this.optionFlags&8)&&!n&&this.raise(p.UnexpectedImportExport,this.state.startLoc),this.next();let h;return e===79?h=this.parseImport(r):h=this.parseExport(r,s),this.assertModuleNodeAllowed(h),h}default:if(this.isAsyncFunction())return i||this.raise(p.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(r,!0,!i&&a)}let o=this.state.value,l=this.parseExpression();return C(e)&&l.type==="Identifier"&&this.eat(10)?this.parseLabeledStatement(r,o,l,t):this.parseExpressionStatement(r,l,s)}assertModuleNodeAllowed(t){!(this.optionFlags&8)&&!this.inModule&&this.raise(p.ImportOutsideModule,t)}maybeTakeDecorators(t,s,e){var r;return t&&((r=s.decorators)!=null&&r.length?(this.raise(p.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(76)}parseDecorators(t){let s=[];do s.push(this.parseDecorator());while(this.match(22));if(this.match(78))t||this.unexpected();else if(!this.canHaveLeadingDecorator())throw this.raise(p.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(6)){let r=this.state.startLoc;this.next(),e=this.parseExpression(),this.expect(7),e=this.wrapParenthesis(r,e);let i=this.state.startLoc;t.expression=this.parseMaybeDecoratorArguments(e,r),t.expression!==e&&this.raise(p.DecoratorArgumentsOutsideParentheses,i)}else{for(e=this.parseIdentifier(!1);this.eat(12);){let r=this.startNodeAt(s);r.object=e,this.match(134)?(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 this.state.canStartArrow=!1,t.expression=this.parseExprSubscripts();return this.finishNode(t,"Decorator")}parseMaybeDecoratorArguments(t,s){if(this.eat(6)){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(p.IllegalBreakContinue,t,{type:r})}}parseDebuggerStatement(t){return this.next(),this.semicolon(),this.finishNode(t,"DebuggerStatement")}parseHeaderExpression(){this.expect(6);let t=this.parseExpression();return this.expect(7),t}parseDoWhileStatement(t){return this.next(),this.state.labels.push(we),t.body=this.parseStatement(),this.state.labels.pop(),this.expect(88),t.test=this.parseHeaderExpression(),this.eat(9),this.finishNode(t,"DoWhileStatement")}parseForStatement(t){this.next(),this.state.labels.push(we);let s=null;if(this.isContextual(92)&&this.recordAwaitIfAllowed()&&(s=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(6),this.match(9))return s!==null&&this.unexpected(s),this.parseFor(t,null);let e=this.isContextual(96);{let o=this.isAwaitUsing(),l=o||this.isForUsing(),h=e&&this.hasFollowingBindingAtom()||l;if(this.match(70)||this.match(71)||h){let c=this.startNode(),d;o?(d="await using",this.recordAwaitIfAllowed()||this.raise(p.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):d=this.state.value,this.next(),this.parseVar(c,!0,d);let m=this.finishNode(c,"VariableDeclaration"),P=this.match(54);return P&&l&&this.raise(p.ForInUsing,m),(P||this.isContextual(98))&&m.declarations.length===1?this.parseForIn(t,m,s):(s!==null&&this.unexpected(s),this.parseFor(t,m))}}let r=this.isContextual(91),i=new Pe,a=this.parseExpression(!0,i),n=this.isContextual(98);if(n&&(e&&this.raise(p.ForOfLet,a),s===null&&r&&a.type==="Identifier"&&this.raise(p.ForOfAsync,a)),n||this.match(54)){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(62)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(t,"IfStatement")}parseReturnStatement(t){return this.prodParam.hasReturn||this.raise(p.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(2),this.state.labels.push(Br),this.scope.enter(256);let e;for(let r;!this.match(4);)if(this.match(57)||this.match(61)){let i=this.match(57);e&&this.finishNode(e,"SwitchCase"),s.push(e=this.startNode()),e.consequent=[],this.next(),i?e.test=this.parseExpression():(r&&this.raise(p.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),r=!0,e.test=null),this.expect(10)}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(p.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(58)){let s=this.startNode();this.next(),this.match(6)?(this.expect(6),s.param=this.parseCatchClauseParam(),this.expect(7)):(s.param=null,this.scope.enter(0)),s.body=this.parseBlock(!1,!1),this.scope.exit(),t.handler=this.finishNode(s,"CatchClause")}return t.finalizer=this.eat(63)?this.parseBlock():null,!t.handler&&!t.finalizer&&this.raise(p.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(we),t.body=this.parseStatement(),this.state.labels.pop(),this.finishNode(t,"WhileStatement")}parseWithStatement(t){return this.state.strict&&this.raise(p.StrictWith,this.state.startLoc),this.next(),t.object=this.parseHeaderExpression(),t.body=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(p.LabelRedeclaration,e,{labelName:s});let i=Us(this.state.type)?1:this.match(67)?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(2),s&&this.scope.enter(0),this.parseBlockBody(r,t,!1,4,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(9)?null:this.parseExpression(),this.semicolon(!1),t.update=this.match(7)?null:this.parseExpression(),this.expect(7),t.body=this.parseStatement(),this.scope.exit(),this.state.labels.pop(),this.finishNode(t,"ForStatement")}parseForIn(t,s,e){let r=this.match(54);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(p.ForInOfLoopInitializer,s,{type:r?"ForInStatement":"ForOfStatement"}),s.type==="AssignmentPattern"&&this.raise(p.InvalidLhs,s,{ancestor:{type:"ForStatement"}}),t.left=s,t.right=r?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(7),t.body=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(25)?s?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,a.init===null&&!r&&(a.id.type!=="Identifier"&&!(s&&(this.match(54)||this.isContextual(98)))?this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(e==="const"||e==="using"||e==="await using")&&!(this.match(54)||this.isContextual(98))&&this.raise(p.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:e})),i.push(this.finishNode(a,"VariableDeclarator")),!this.eat(8))break}return t}parseVarId(t,s){let e=this.parseBindingAtom();s==="using"||s==="await using"?(e.type==="ArrayPattern"||e.type==="ObjectPattern")&&this.raise(p.UsingDeclarationHasBindingPattern,e):e.type==="VoidPattern"&&this.raise(p.UnexpectedVoidPattern,e),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);return this.initFunction(t,a),this.match(51)&&(e&&this.raise(p.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),t.generator=!0),r&&(t.id=this.parseFunctionId(i)),this.scope.enter(514),this.prodParam.enter(xe(a,t.generator)),r||(t.id=this.parseFunctionId()),this.parseFunctionParams(t,!1),this.parseFunctionBodyAndFinish(t,r?"FunctionDeclaration":"FunctionExpression"),this.prodParam.exit(),this.scope.exit(),r&&!e&&this.registerFunctionStatementId(t),t}parseFunctionId(t){return t||C(this.state.type)?this.parseIdentifier():null}parseFunctionParams(t,s){this.expect(6),this.expressionScope.enter(Nr()),t.params=this.parseBindingList(7,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.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(25)||this.match(9)||this.match(4)}isClassMethod(){return this.match(6)}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();for(i.body=[],this.expect(2);!this.match(4);){if(this.eat(9)){if(r.length>0)throw this.raise(p.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(22)){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)}if(this.state.strict=s,this.next(),r.length)throw this.raise(p.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(102);if(r){if(this.parseClassMemberFromModifier(t,s))return;if(this.eat(2)){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(51)){h.kind="method";let I=this.match(134);if(this.parseClassElementName(h),this.parsePostMemberNameModifiers(h),I){this.pushClassPrivateMethod(t,a,!0,!1);return}this.isNonstaticConstructor(i)&&this.raise(p.ConstructorIsGenerator,i.key),this.pushClassMethod(t,i,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&C(this.state.type),m=this.parseClassElementName(s),P=d?m.name:null,S=this.isPrivateName(m),F=this.state.startLoc;if(this.parsePostMemberNameModifiers(c),this.isClassMethod()){if(h.kind="method",S){this.pushClassPrivateMethod(t,a,!1,!1);return}let I=this.isNonstaticConstructor(i),N=!1;I&&(i.kind="constructor",i.decorators&&i.decorators.length>0&&this.raise(p.DecoratorConstructor,s),e.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(p.DuplicateConstructor,m),I&&this.hasPlugin("typescript")&&s.override&&this.raise(p.OverrideOnConstructor,m),e.hadConstructor=!0,N=e.hadSuperClass),this.pushClassMethod(t,i,!1,!1,I,N)}else if(this.isClassProperty())S?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n);else if(P==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(m);let I=this.eat(51);c.optional&&this.unexpected(F),h.kind="method";let N=this.match(134);this.parseClassElementName(h),this.parsePostMemberNameModifiers(c),N?this.pushClassPrivateMethod(t,a,I,!0):(this.isNonstaticConstructor(i)&&this.raise(p.ConstructorIsAsync,i.key),this.pushClassMethod(t,i,I,!0,!1,!1))}else if((P==="get"||P==="set")&&!(this.match(51)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(m),h.kind=P;let I=this.match(134);this.parseClassElementName(i),I?this.pushClassPrivateMethod(t,a,!1,!1):(this.isNonstaticConstructor(i)&&this.raise(p.ConstructorIsAccessor,i.key),this.pushClassMethod(t,i,!1,!1,!1,!1)),this.checkGetterSetterParams(i)}else if(P==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(m);let I=this.match(134);this.parseClassElementName(n),this.pushClassAccessorProperty(t,l,I)}else this.isLineTerminator()?S?this.pushClassPrivateProperty(t,o):this.pushClassProperty(t,n):this.unexpected()}parseClassElementName(t){let{type:s,value:e}=this.state;if((s===128||s===130)&&t.static&&e==="prototype"&&this.raise(p.StaticPrototype,this.state.startLoc),s===134){e==="constructor"&&this.raise(p.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,4),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(p.DecoratorStaticBlock,s)}pushClassProperty(t,s){!s.computed&&this.nameIsConstructor(s.key)&&this.raise(p.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.start)}pushClassAccessorProperty(t,s,e){!e&&!s.computed&&this.nameIsConstructor(s.key)&&this.raise(p.ConstructorClassField,s.key);let r=this.parseClassAccessorProperty(s);t.body.push(r),e&&this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),0,r.key.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.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($t()),this.prodParam.enter(0),t.value=this.eat(25)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(t,s,e,r=8331){if(C(this.state.type))t.id=this.parseIdentifier(),s&&this.declareNameFromIdentifier(t.id,r);else if(e||!s)t.id=null;else throw this.raise(p.MissingClassName,this.state.startLoc)}parseClassSuper(t){this.eat(77)?(this.state.canStartArrow=!1,t.superClass=this.parseExprSubscripts()):t.superClass=null}parseExport(t,s){var d;let e=this.parseMaybeImportPhase(t,!0),r=this.maybeParseExportDefaultSpecifier(t,e),i=!r||this.eat(8),a=i&&this.eatExportStar(t),n=a&&this.maybeParseExportNamespaceSpecifier(t),o=i&&(!n||this.eat(8)),l=r||a;if(a&&!n){if(r&&this.unexpected(),s)throw this.raise(p.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,2),n&&o&&this.unexpected(null,94);let c;if(l||h){if(c=!1,s)throw this.raise(p.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(p.UnsupportedDecoratorExport,t);return this.sawUnambiguousESM=!0,this.finishNode(m,"ExportNamedDeclaration")}if(this.eat(61)){let m=t,P=this.parseExportDefaultExpression();if(m.declaration=P,P.type==="ClassDeclaration")this.maybeTakeDecorators(s,P,m);else if(s)throw this.raise(p.UnsupportedDecoratorExport,t);return this.checkExport(m,!0,!0),this.sawUnambiguousESM=!0,this.finishNode(m,"ExportDefaultDeclaration")}throw this.unexpected(null,2)}eatExportStar(t){return this.eat(51)}maybeParseExportDefaultSpecifier(t,s){if(s||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",s==null?void 0:s.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(89)){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(2)){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(91))return!1;let t=this.nextTokenInLineStart();return this.isUnparsedContextual(t,"function")}parseExportDefaultExpression(){let t=this.startNode();if(this.match(64))return this.next(),this.parseFunction(t,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(t,13);if(this.match(76))return this.parseClass(t,!0,!0);if(this.match(22))return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(71)||this.match(70)||this.isLet()||this.isUsing()||this.isAwaitUsing())throw this.raise(p.UnsupportedDefaultExport,this.state.startLoc);let s=this.parseMaybeAssignAllowIn();return this.semicolon(),s}parseExportDeclaration(t){return this.match(76)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:t}=this.state;if(C(t)){if(t===91&&!this.state.containsEsc||t===96)return!1;if((t===126||t===125)&&!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(61))return!1;let s=this.nextTokenStart(),e=this.isUnparsedContextual(s,"from");if(this.input.charCodeAt(s)===44||C(this.state.type)&&e)return!0;if(this.match(61)&&e){let r=this.input.charCodeAt(this.nextTokenStartSince(s+4));return r===34||r===39}return!1}parseExportFrom(t,s){this.eatContextual(94)?(t.source=this.parseImportSource(),this.checkExport(t),this.maybeParseImportAttributes(t)):s&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:t}=this.state;return t===22&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?!0:this.isUsing()?(this.raise(p.UsingDeclarationExport,this.state.startLoc),!0):this.isAwaitUsing()?(this.raise(p.UsingDeclarationExport,this.state.startLoc),!0):t===70||t===71||t===64||t===76||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(p.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(p.ExportBindingIsString,n,{localName:h.value,exportName:l}):(this.checkReservedWord(h.name,h.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(p.DuplicateDefaultExport,t):this.raise(p.DuplicateExport,t,{exportName:s})),this.exportedIdentifiers.add(s)}parseExportSpecifiers(t){let s=[],e=!0;for(this.expect(2);!this.eat(4);){if(e)e=!1;else if(this.expect(8),this.eat(4))break;let r=this.isContextual(126),i=this.match(130),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(89)?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(130)){let t=this.parseStringLiteral(this.state.value),s=Ur.exec(t.value);return s&&this.raise(p.ModuleExportNameHasLoneSurrogate,t,{surrogateCharCode:s[0].charCodeAt(0)}),t}return this.parseIdentifier(!0)}checkImportPhase(t){let{specifiers:s}=t,e=s.length===1?s[0].type:null;t.phase==="source"?e!=="ImportDefaultSpecifier"&&this.raise(p.SourcePhaseImportRequiresDefault,s[0]):t.phase==="defer"&&e!=="ImportNamespaceSpecifier"&&this.raise(p.DeferImportRequiresNamespace,s[0])}isPotentialImportPhase(t){return t?!1:this.isContextual(101)||this.isContextual(93)}applyImportPhase(t,s,e,r){s||(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(U(i)?i!==94||this.lookaheadCharCode()===102:i!==8)?(this.applyImportPhase(t,s,r,e.start),null):(this.applyImportPhase(t,s,null),this.createIdentifier(e,r))}isPrecedingIdImportPhase(t){let{type:s}=this.state;return C(s)?s!==94||this.lookaheadCharCode()===102:s!==8}parseImport(t){return this.match(130)?this.parseImportSourceAndAttributes(t):this.parseImportSpecifiersAndAfter(t,this.parseMaybeImportPhase(t,!1))}parseImportSpecifiersAndAfter(t,s){t.specifiers=[];let e=!this.maybeParseDefaultImportSpecifier(t,s)||this.eat(8),r=e&&this.maybeParseStarImportSpecifier(t);return e&&!r&&this.parseNamedImportSpecifiers(t),this.expectContextual(94),this.parseImportSourceAndAttributes(t)}parseImportSourceAndAttributes(t){return t.specifiers??(t.specifiers=[]),t.source=this.parseImportSource(),this.maybeParseImportAttributes(t),this.checkImportPhase(t),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(t,"ImportDeclaration")}parseImportSource(){return this.match(130)||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(2);let t=[],s=new Set;do{if(this.match(4))break;let e=this.startNode(),r=this.state.value;if(s.has(r)&&this.raise(p.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:r}),s.add(r),this.match(130)?e.key=this.parseStringLiteral(r):e.key=this.parseIdentifier(!0),this.expect(10),!this.match(130))throw this.raise(p.ModuleAttributeInvalidValue,this.state.startLoc);e.value=this.parseStringLiteral(this.state.value),t.push(this.finishNode(e,"ImportAttribute"))}while(this.eat(8));return this.expect(4),t}maybeParseImportAttributes(t){let s;if(this.match(72)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),s=this.parseImportAttributes()}else 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(U(this.state.type))return this.parseImportSpecifierLocal(t,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(t){if(this.match(51)){let s=this.startNode();return this.next(),this.expectContextual(89),this.parseImportSpecifierLocal(t,s,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(t){let s=!0;for(this.expect(2);!this.eat(4);){if(s)s=!1;else{if(this.eat(10))throw this.raise(p.DestructureNamedImport,this.state.startLoc);if(this.expect(8),this.eat(4))break}let e=this.startNode(),r=this.match(130),i=this.isContextual(126);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(89))t.local=this.parseIdentifier();else{let{imported:a}=t;if(s)throw this.raise(p.ImportBindingIsString,t,{importName:a.value});this.checkReservedWord(a.name,t.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"}},ke=/in(?:stanceof)?|as|satisfies/y;function jr(t){if(t==null)throw new Error(`Unexpected ${t} value.`);return t}function pt(t){if(!t)throw new Error("Assert fail")}var _r={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.",DecoratorAbstractMethod:({kind:t})=>`Decorators can't be used with ${t.startsWith("a")?"an":"a"} ${t}.`,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.",ExportAssignmentInTSNamespace:"An export assignment cannot be used in a namespace.",ExportInTSNamespace:"Export declarations are not permitted in a namespace.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportInTSNamespace:"Import declarations in a namespace cannot reference a module.",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.",InlineModuleDeclarationMustUseString:"`module ... {}` declarations must have a string name. Use `namespace ... {}` instead.",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.",NamespaceExportInTSNamespace:"Global module exports may only appear at top level.",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.",UnexpectedParameterInitializer:"A parameter initializer is only allowed in a function or constructor implementation.",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.",UnexpectedTypeDeclaration:t=>`'${t}' declarations can only be declared inside a block.`,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.`},f=B`typescript`(_r);function Vr(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 ct(t){return t==="private"||t==="public"||t==="protected"}function zr(t){return t==="in"||t==="out"}function Oe(t){var s;if((s=t.extra)!=null&&s.parenthesized)return!1;switch(t.type){case"Identifier":return!0;case"MemberExpression":return!t.computed&&Oe(t.object);case"TSInstantiationExpression":return Oe(t.expression);default:return!1}}var Hr=t=>class extends t{constructor(){super(...arguments);y(this,"tsParseInOutModifiers",this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:f.InvalidModifierOnTypeParameter}));y(this,"tsParseConstModifier",this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:f.InvalidModifierOnTypeParameterPositions}));y(this,"tsParseInOutConstModifiers",this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:f.InvalidModifierOnTypeParameter}))}getScopeHandler(){return mr}tsIsIdentifier(){return C(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(2)||this.match(51)||this.match(17)||this.match(134)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(102)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,r,i){if(!C(this.state.type)&&this.state.type!==54&&this.state.type!==71)return;let a=this.state.value;if(e.includes(a)){if(i&&this.match(102)||r&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return a}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:r,stopOnStartOfClassStaticBlock:i,errorTemplate:a=f.InvalidModifierOnTypeMember},n){let o=(h,c,d,m)=>{c===d&&n[m]&&this.raise(f.InvalidModifiersOrder,h,{orderedModifiers:[d,m]})},l=(h,c,d,m)=>{(n[d]&&c===m||n[m]&&c===d)&&this.raise(f.IncompatibleModifiers,h,{modifiers:[d,m]})};for(;;){let{startLoc:h}=this.state,c=this.tsParseModifier(e.concat(r??[]),i,n.static);if(!c)break;ct(c)?n.accessibility?this.raise(f.DuplicateAccessibilityModifier,h,{modifier:c}):(o(h,c,c,"override"),o(h,c,c,"static"),o(h,c,c,"readonly"),n.accessibility=c):zr(c)?(n[c]&&this.raise(f.DuplicateModifier,h,{modifier:c}),n[c]=!0,o(h,c,"in","out")):(Re(n,c)?this.raise(f.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(4);case"HeritageClauseElement":return this.match(2);case"TupleElementTypes":return this.match(1);case"TypeParametersOrArguments":return this.match(44)}}tsParseList(e,r){let i=[];for(;!this.tsIsListTerminator(e);)i.push(r());return i}tsParseDelimitedList(e,r,i){return jr(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(8)){o=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;i&&this.expect(8);return}return a&&(a.value=o),n}tsParseBracketedList(e,r,i,a,n){a||(i?this.expect(0):this.expect(43));let o=this.tsParseDelimitedList(e,r,n);return i?this.expect(1):this.expect(44),o}tsParseImportType(){let e=this.startNode();return this.expect(79),this.expect(6),this.match(130)?e.source=this.parseStringLiteral(this.state.value):(this.raise(f.UnsupportedImportTypeArgument,this.state.startLoc),e.source=this.tsParseNonConditionalType()),this.eat(8)?e.options=this.tsParseImportTypeOptions():e.options=null,this.expect(7),this.eat(12)&&(e.qualifier=this.tsParseEntityName(3)),this.match(43)&&(e.typeArguments=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseImportTypeOptions(){let e=this.startNode();this.expect(2);let r=this.startNode();return this.isContextual(72)?(r.method=!1,r.key=this.parseIdentifier(!0),r.computed=!1,r.shorthand=!1):this.unexpected(null,72),this.expect(10),r.value=this.tsParseImportTypeWithPropertyValue(),e.properties=[this.finishObjectProperty(r)],this.eat(8),this.expect(4),this.finishNode(e,"ObjectExpression")}tsParseImportTypeWithPropertyValue(){let e=this.startNode(),r=[];for(this.expect(2);!this.match(4);){let i=this.state.type;C(i)||i===130?r.push(super.parsePropertyDefinition(null)):this.unexpected(),this.eat(8)}return e.properties=r,this.next(),this.finishNode(e,"ObjectExpression")}tsParseEntityName(e){let r;if(e&1&&this.match(74))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(12);){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(43)&&(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(83),this.match(79)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(1),!this.hasPrecedingLineBreak()&&this.match(43)&&(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(77),r.default=this.tsEatThenParseType(25),this.finishNode(r,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(43))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let r=this.startNode();this.match(43)||this.match(138)?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(f.EmptyTypeParameters,r),i.value!==-1&&this.addExtra(r,"trailingComma",i.value),this.finishNode(r,"TSTypeParameterDeclaration")}tsFillSignature(e,r){let i=e===15,a="params",n="returnType";r.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(6),r[a]=this.tsParseBindingListForSignature(),i?r[n]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(r[n]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(7,41,2);for(let r of e){let{type:i}=r;(i==="AssignmentPattern"||i==="TSParameterProperty")&&this.raise(f.UnsupportedSignatureParameterKind,r,{type:i})}return e}tsParseTypeMemberSemicolon(){!this.eat(8)&&!this.isLineTerminator()&&this.expect(9)}tsParseSignatureMember(e,r){return this.tsFillSignature(10,r),this.tsParseTypeMemberSemicolon(),this.finishNode(r,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),C(this.state.type)?(this.next(),this.match(10)):!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(1),e.parameters=[r];let i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,r){if(this.eat(13)&&(e.optional=!0),this.match(6)||this.match(43)){r&&this.raise(f.ReadonlyForMethodSignature,e);let i=e;if(i.kind&&this.match(43)&&this.raise(f.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(10,i),this.tsParseTypeMemberSemicolon(),i.kind==="get")i.params.length>0&&(this.raise(p.BadGetterArity,this.state.curPosition()),this.isThisParam(i.params[0])&&this.raise(f.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(i.kind==="set"){if(i.params.length!==1)this.raise(p.BadSetterArity,this.state.curPosition());else{let a=i.params[0];this.isThisParam(a)&&this.raise(f.AccessorCannotDeclareThisParameter,this.state.curPosition()),a.type==="Identifier"&&a.optional&&this.raise(f.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),a.type==="RestElement"&&this.raise(f.SetAccessorCannotHaveRestParameter,this.state.curPosition())}i.returnType&&this.raise(f.SetAccessorCannotHaveReturnType,i.returnType)}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(6)||this.match(43))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(73)){let i=this.startNode();return this.next(),this.match(6)||this.match(43)?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(6)&&!this.match(43)&&this.unexpected(null,6)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(2);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(4),e}tsIsStartOfMappedType(){return this.next(),this.eat(49)?this.isContextual(118):(this.isContextual(118)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(54)))}tsParseMappedType(){let e=this.startNode();return this.expect(2),this.match(49)?(e.readonly=this.state.value,this.next(),this.expectContextual(118)):this.eatContextual(118)&&(e.readonly=!0),this.expect(0),e.key=this.tsParseTypeParameterName(),e.constraint=this.tsExpectThenParseType(54),e.nameType=this.eatContextual(89)?this.tsParseType():null,this.expect(1),this.match(49)?(e.optional=this.state.value,this.next(),this.expect(13)):this.eat(13)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(4),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(f.OptionalTypeBeforeRequired,i),r||(r=a==="TSNamedTupleMember"&&i.optional||a==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let e=this.state.startLoc,r=this.eat(17),{startLoc:i}=this.state,a,n,o,l,h=U(this.state.type)?this.lookaheadCharCode():null;if(h===58)a=!0,o=!1,n=this.parseIdentifier(!0),this.expect(10),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(13),this.expect(10),l=this.tsParseType()):(a=!1,l=d,this.expect(13))}else l=this.tsParseType(),o=this.eat(13),a=this.eat(10);if(a){let c;n?(c=this.startNodeAt(i),c.optional=o,c.label=n,c.elementType=l,this.eat(13)&&(c.optional=!0,this.raise(f.TupleOptionalAfterType,this.state.lastTokStartLoc))):(c=this.startNodeAt(i),c.optional=o,this.raise(f.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(6),e.typeAnnotation=this.tsParseType(),this.expect(7),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(15,i)),this.finishNode(i,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 131:case 132:case 130:case 81:case 82: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(112)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 130:case 131:case 132:case 81:case 82:return this.tsParseLiteralTypeNode();case 49:if(this.state.value==="-"){let e=this.startNode(),r=this.lookahead();return r.type!==131&&r.type!==132&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 74:return this.tsParseThisTypeOrThisTypePredicate();case 83:return this.tsParseTypeQuery();case 79:return this.tsParseImportType();case 2:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 6:if(!(this.optionFlags&2048)){let e=this.state.startLoc;this.next();let r=this.tsParseType();return this.expect(7),this.addExtra(r,"parenthesized",!0),this.addExtra(r,"parenStart",e.index),r}return this.tsParseParenthesizedType();case 21:case 20:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(C(e)||e===84||e===80){let r=e===84?"TSVoidKeyword":e===80?"TSNullKeyword":Vr(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(1)){let i=this.startNodeAt(e);i.elementType=r,this.expect(1),r=this.finishNode(i,"TSArrayType")}else{let i=this.startNodeAt(e);i.objectType=r,i.indexType=this.tsParseType(),this.expect(1),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(f.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(111);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(77)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(13))return e}}tsParseTypeOperatorOrHigher(){return _s(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(111)?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),41)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),39)}tsIsStartOfFunctionType(){return this.match(43)?!0:this.match(6)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(C(this.state.type)||this.match(74))return this.next(),!0;if(this.match(2)){let{errors:e}=this.state,r=e.length;try{return this.parseObjectLike(4,!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(1,93,1),e.length===r}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(7)||this.match(17)||this.tsSkipParameterStart()&&(this.match(10)||this.match(8)||this.match(13)||this.match(25)||this.match(7)&&(this.next(),this.match(15))))}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(74)){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(10))return this.tsParseTypeOrTypePredicateAnnotation(10)}tsTryParseTypeAnnotation(){if(this.match(10))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(10)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(112)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==105)return!1;let e=this.state.containsEsc;return this.next(),!C(this.state.type)&&!this.match(74)?!1:(e&&this.raise(p.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,r=this.startNode()){return this.tsInType(()=>{e&&this.expect(10),r.typeAnnotation=this.tsParseType()}),this.finishNode(r,"TSTypeAnnotation")}tsParseType(){pt(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(77))return e;let r=this.startNodeAtNode(e);return r.checkType=e,r.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(13),r.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(10),r.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(r,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(120)&&this.isLookaheadContextual("new")}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(73)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(f.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?this.tsParseTypeReference():this.tsParseType())),this.expect(44),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let r=this.state.startLoc,i=this.tsParseDelimitedList("HeritageClauseElement",()=>{let a=(this.state.canStartArrow=!1,super.parseExprSubscripts());Oe(a)||this.raise(f.InvalidHeritageClauseType,a.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(43)||this.match(47))&&(o.typeArguments=this.tsParseTypeArgumentsInExpression()),this.finishNode(o,n)});return i.length||this.raise(f.EmptyHeritageClauseType,r,{token:e}),i}tsParseInterfaceDeclaration(e,r={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(125),r.declare&&(e.declare=!0),C(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(f.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(77)&&(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(25),this.isContextual(110)&&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()!==w.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(130)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(25)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,r={}){return r.const&&(e.const=!0),r.declare&&(e.declare=!0),this.expectContextual(122),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(2),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(4),this.finishNode(e,"TSEnumBody")}tsParseModuleBlock(e){let r=this.startNode();return e||this.scope.enter(0),this.expect(2),super.parseBlockOrModuleBlockBody(r.body=[],void 0,!0,4),e||this.scope.exit(),this.finishNode(r,"TSModuleBlock")}tsParseNamespaceDeclaration(e){return e.id=this.tsParseEntityName(0),e.id.type==="Identifier"&&this.checkIdentifier(e.id,1024),this.scope.enter(2048),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(!1),this.prodParam.exit(),this.scope.exit(),this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){let r=this.isContextual(108);return r?(e.kind="global",e.id=this.parseIdentifier()):(e.kind="module",e.id=super.parseStringLiteral(this.state.value)),this.match(2)?(r||this.scope.enter(1024),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(r),this.prodParam.exit(),r||this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,r){e.id=r||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(25);let i=this.tsParseModuleReference();return e.importKind==="type"&&i.type!=="TSExternalModuleReference"&&this.raise(f.ImportAliasHasImportType,i),e.moduleReference=i,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(115)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(0)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(115),this.expect(6),this.match(130)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(7),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 64:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 76:return e.declare=!0,this.parseClass(e,!0,!1);case 122:return this.tsParseEnumDeclaration(e,{declare:!0});case 108:return this.tsParseAmbientExternalModuleDeclaration(e);case 96:if(this.state.containsEsc)return;case 71:case 70:return!this.match(71)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,this.state.value,!0)):(this.expect(71),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 103:if(this.isUsing())return this.raise(f.InvalidModifierOnUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.parseVarStatement(e,"using",!0);break;case 92:if(this.isAwaitUsing())return this.raise(f.InvalidModifierOnAwaitUsingDeclaration,this.state.startLoc,"declare"),e.declare=!0,this.next(),this.parseVarStatement(e,"await using",!0);break;case 125:{let i=this.tsParseInterfaceDeclaration(e,{declare:!0});if(i)return i}default:if(C(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 120:if(this.tsCheckLineTerminator(i)&&(this.match(76)||C(this.state.type)))return this.tsParseAbstractDeclaration(e,a);break;case 123:if(this.tsCheckLineTerminator(i))return this.tsParseAmbientExternalModuleDeclaration(e);break;case 124:if(this.tsCheckLineTerminator(i)&&C(this.state.type))return e.kind="namespace",this.tsParseNamespaceDeclaration(e);break;case 126:if(this.tsCheckLineTerminator(i)&&C(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(43))return;let r=this.tsTryParseAndCatch(()=>{let i=this.startNodeAt(e);return i.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(i),i.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(15),i});if(r)return super.parseArrowExpression(r,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===43)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInTopLevelContext(()=>(this.expect(43),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(f.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===w.brace&&this.reScan_lt_gt(),this.expect(44),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return Vs(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseBindingElement(e,r){let i=r.length?null: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(f.UnexpectedParameterModifier,i||r[0]);let h=this.state.startLoc,c=this.parseMaybeDefault(h);e&2&&this.parseFunctionParamType(c);let d=this.parseMaybeDefault(h,c);if(n||l||o){let m=i?this.startNodeAt(i):this.startNodeAtNode(r[0]);return r.length?m.decorators=r:this.setLoc(i),n&&(m.accessibility=n),l&&(m.readonly=l),o&&(m.override=o),d.type!=="Identifier"&&d.type!=="AssignmentPattern"&&this.raise(f.UnsupportedParameterPropertyKind,i||r[0]),m.parameter=d,this.finishNode(m,"TSParameterProperty")}return r.length&&(c.decorators=r),d}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(f.PatternIsOptional,r)}setArrowFunctionParameters(e,r,i){super.setArrowFunctionParameters(e,r,i),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,r,i=!1){this.match(10)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(10));let a=r==="FunctionDeclaration"?"TSDeclareFunction":r==="ClassMethod"||r==="ClassPrivateMethod"?"TSDeclareMethod":void 0;if(a&&!this.match(2)&&this.isLineTerminator()){if(a==="TSDeclareMethod"&&e.kind==="constructor")for(let n of e.params)n.type==="TSParameterProperty"?this.raise(f.UnexpectedParameterModifier,n):n.type==="AssignmentPattern"&&this.raise(f.UnexpectedParameterInitializer,n);else for(let n of e.params)n.type==="AssignmentPattern"&&this.raise(f.UnexpectedParameterInitializer,n);return this.finishNode(e,a)}return a&&this.state.isAmbientContext&&(this.raise(f.DeclareFunctionHasImplementation,this.state.startLoc),a==="TSDeclareFunction"&&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(f.UnexpectedTypeAnnotation,r.typeAnnotation)})}toReferencedList(e,r){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,r){let i=super.parseArrayLike(e,r);return i.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(i.elements),i}parseSubscript(e,r,i,a){if(!this.hasPrecedingLineBreak()&&this.match(31)){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(14)&&this.lookaheadCharCode()===60){if(i)return a.stop=!0,e;a.optionalChainMember=n=!0,this.next()}if(this.match(43)||this.match(47)){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(6)){o=this.state.curPosition();return}if(ve(this.state.type)){let m=super.parseTaggedTemplateExpression(e,r,a);return m.typeArguments=h,m}if(!i&&this.eat(6)){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===44||c===48||c!==6&&c!==89&&c!==116&&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,6),l)return l.type==="TSInstantiationExpression"&&((this.match(12)||this.match(14)&&this.lookaheadCharCode()!==40)&&this.raise(f.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),!this.match(12)&&!this.match(14)&&(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(ye(54)>i&&!this.hasPrecedingLineBreak()&&(this.isContextual(89)||(a=this.isContextual(116)))){let n=this.startNodeAt(r);n.expression=e,n.typeAnnotation=this.tsInType(()=>(this.next(),this.match(71)?(a&&this.raise(p.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType()));let o=this.finishNode(n,a?"TSSatisfiesExpression":"TSAsExpression");return this.reScan_lt_gt(),this.parseExprOp(o,r,i)}return super.parseExprOp(e,r,i)}checkReservedWord(e,r,i,a){this.state.isAmbientContext||super.checkReservedWord(e,r,i,a)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(126)){let r=this.lookaheadCharCode();return e?r===123||r===42:r!==61}return!e&&this.isContextual(83)}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(130))return e.importKind="value",this.scope.inTSNamespace&&this.raise(f.ImportInTSNamespace,e),super.parseImport(e);let r;if(C(this.state.type)&&this.lookaheadCharCode()===61){e.importKind="value";let i=this.tsParseImportEqualsDeclaration(e);return this.scope.inTSNamespace&&i.moduleReference.type==="TSExternalModuleReference"&&this.raise(f.ImportInTSNamespace,e),i}else if(this.isContextual(126)){let i=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.scope.inTSNamespace&&this.raise(f.ImportInTSNamespace,e),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(f.TypeImportCannotSpecifyDefaultAndNamed,r):this.scope.inTSNamespace&&this.raise(f.ImportInTSNamespace,r),r}parseExport(e,r){if(this.match(79)){let i=this.startNode();this.next();let a=null;this.isContextual(126)&&this.isPotentialImportPhase(!1)?a=this.parseMaybeImportPhase(i,!1):i.importKind="value";let n=this.tsParseImportEqualsDeclaration(i,a);return e.attributes=[],e.declaration=n,e.exportKind="value",e.source=null,e.specifiers=[],this.finishNode(e,"ExportNamedDeclaration")}else if(this.eat(25)){let i=e;return i.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.scope.inTSNamespace&&this.raise(f.ExportAssignmentInTSNamespace,i),this.finishNode(i,"TSExportAssignment")}else if(this.eatContextual(89)){let i=e;return this.expectContextual(124),i.id=this.parseIdentifier(),this.checkIdentifier(i.id,8201),this.semicolon(),this.scope.inTSNamespace&&this.raise(f.NamespaceExportInTSNamespace,i),this.finishNode(i,"TSNamespaceExportDeclaration")}else{let i=super.parseExport(e,r);return this.scope.inTSNamespace&&(i.type!=="ExportNamedDeclaration"||i.source||!i.declaration&&!this.state.isAmbientContext)&&this.raise(f.ExportInTSNamespace,i),i}}isAbstractClass(){return this.isContextual(120)&&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(125)){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(f.UsingDeclarationInAmbientContext,e,r),n;for(let{id:o,init:l}of n.declarations)l&&(r==="var"||r==="let"||o.typeAnnotation?this.raise(f.InitializerNotAllowedInAmbientContext,l):qr(l,this.hasPlugin("estree"))||this.raise(f.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l));return n}parseStatementContent(e,r){let i=!!(e&2);if(!this.state.containsEsc)switch(this.state.type){case 71:{if(this.isLookaheadContextual("enum")){let a=this.startNode();return this.next(),this.tsParseEnumDeclaration(a,{const:!0})}break}case 120:case 121:{if(this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()){let a=this.state.type,n=this.startNode();this.next();let o=a===121?this.tsTryParseDeclare(n):this.tsParseAbstractDeclaration(n,r);return o?(a===121&&(o.declare=!0),o):(n.expression=this.createIdentifier(this.startNodeAtNode(n),a===121?"declare":"abstract"),this.semicolon(!1),this.finishNode(n,"ExpressionStatement"))}break}case 122:return this.tsParseEnumDeclaration(this.startNode());case 108:{if(this.lookaheadCharCode()===123){let a=this.startNode();return this.tsParseAmbientExternalModuleDeclaration(a)}break}case 125:{let a=this.tsParseInterfaceDeclaration(this.startNode());if(a)return i||this.raise(f.UnexpectedTypeDeclaration,a,"interface"),a;break}case 123:{if(this.nextTokenIsStringLiteralOnSameLine()){let a=this.startNode();return this.next(),this.tsParseDeclaration(a,123,!1,r)}else if(this.nextTokenIsIdentifierOnSameLine()){this.raise(f.InlineModuleDeclarationMustUseString,this.state.startLoc);let a=this.startNode();return this.next(),this.tsParseDeclaration(a,124,!1,r)}break}case 124:{if(this.nextTokenIsIdentifierOnSameLine()){let a=this.startNode();return this.next(),this.tsParseDeclaration(a,124,!1,r)}break}case 126:{if(this.nextTokenIsIdentifierOnSameLine()){let a=this.startNode();return i||this.raise(f.UnexpectedTypeDeclaration,a,"type"),this.next(),this.tsParseTypeAliasDeclaration(a)}break}}return super.parseStatementContent(e,r)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,r){return r.some(i=>ct(i)?e.accessibility===i:!!e[i])}tsIsStartOfStaticBlocks(){return this.isContextual(102)&&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:f.InvalidModifierOnTypeParameterPositions},r);let n=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(r,a)&&this.raise(f.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,r)):this.parseClassMemberWithIsStatic(e,r,i,!!r.static)};r.declare?this.tsInAmbientContext(n):n(),r.decorators&&r.decorators.length>0&&!this.hasPlugin("decorators-legacy")&&(r.type==="TSAbstractMethodDefinition"||r.type==="TSDeclareMethod"?this.raise(f.DecoratorAbstractMethod,r,{kind:"abstract method"}):(r.type==="ClassProperty"&&r.abstract||r.type==="ClassProperty"&&r.declare||r.type==="TSAbstractPropertyDefinition"||r.type==="PropertyDefinition"&&r.declare)&&this.raise(f.DecoratorAbstractMethod,r,{kind:r.declare?"declare field":"abstract field"}))}parseClassMemberWithIsStatic(e,r,i,a){let n=this.tsTryParseIndexSignature(r);if(n){e.body.push(n),r.abstract&&this.raise(f.IndexSignatureHasAbstract,r),r.accessibility&&this.raise(f.IndexSignatureHasAccessibility,r,{modifier:r.accessibility}),r.declare&&this.raise(f.IndexSignatureHasDeclare,r),r.override&&this.raise(f.IndexSignatureHasOverride,r);return}!this.state.inAbstractClass&&r.abstract&&this.raise(f.NonAbstractClassHasAbstractMethod,r),r.override&&(i.hadSuperClass||this.raise(f.OverrideNotInSubClass,r)),super.parseClassMemberWithIsStatic(e,r,i,a)}parsePostMemberNameModifiers(e){this.eat(13)&&(e.optional=!0),e.readonly&&this.match(6)&&this.raise(f.ClassMethodHasReadonly,e),e.declare&&this.match(6)&&this.raise(f.ClassMethodHasDeclare,e)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,r,i){if(!this.match(13))return e;if(i!=null){let o=this.lookaheadCharCode();if(o===44||o===61||o===58||o===41)return this.setOptionalParametersError(i),e}this.next();let a=this.startNodeAt(r);a.test=e;let n=this.state.inConditionalConsequent;return this.state.inConditionalConsequent=!0,a.consequent=this.parseMaybeAssignAllowIn(),this.state.inConditionalConsequent=n,this.expect(10),a.alternate=this.parseMaybeAssign(),this.finishNode(a,"ConditionalExpression")}parseParenItem(e,r){let i=super.parseParenItem(e,r);if(this.eat(13)&&(i.optional=!0,this.resetEndLocation(e)),this.match(10)){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(121))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let r=this.state.startLoc,i=this.eatContextual(121);if(i&&(this.isContextual(121)||!this.shouldParseExportDeclaration()))throw this.raise(f.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let a=C(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(109)){e.id=null;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(31)?e.definite=!0:this.eat(13)&&(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(25)&&this.raise(f.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(25)){let{key:r}=e;this.raise(f.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(f.PrivateElementHasAbstract,e),e.accessibility&&this.raise(f.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(f.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,r,i,a,n,o){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&n&&this.raise(f.ConstructorHasTypeParameters,l);let{declare:h=!1,kind:c}=r;h&&(c==="get"||c==="set")&&this.raise(f.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){if(super.parseClassSuper(e),e.superClass)if(e.superClass.type==="TSInstantiationExpression"){let r=e.superClass,i=r.expression;this.takeSurroundingComments(i,i.start,i.end);let a=r.typeArguments;this.takeSurroundingComments(a,a.start,a.end),e.superClass=i,e.superTypeArguments=a}else(this.match(43)||this.match(47))&&(e.superTypeArguments=this.tsParseTypeArgumentsInExpression());this.eatContextual(109)&&(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(31)&&(e.definite=!0);let i=this.tsTryParseTypeAnnotation();i&&(e.id.typeAnnotation=i,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,r){return this.match(10)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,r)}parseMaybeAssign(e,r){let i,a,n;if(this.hasPlugin("jsx")&&(this.match(138)||this.match(43))){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===w.j_oTag||c===w.j_expr)&&h.pop()}if(!(a!=null&&a.error)&&!this.match(43))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 P=c.typeParameters.params[0];P.constraint||this.raise(f.SingleTypeParameterWithoutTrailingComma,this.optionFlags&256?D(P.loc.end,1):P,{typeParameterName:P.name.name})}return c},i);if(!l.error&&!l.aborted)return o&&this.reportReservedArrowTypeParam(o),l.node;if(!a&&(pt(!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(f.ReservedArrowTypeParam,e)}parseMaybeUnary(e,r){return!this.hasPlugin("jsx")&&this.match(43)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,r)}parseArrow(e){if(this.match(10)){let r=this.tryParse(i=>{let a=this.tsParseTypeOrTypePredicateAnnotation(10);return(this.canInsertSemicolon()||!this.match(15))&&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(13)&&(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(f.UnexpectedTypeCastInParameter,e):this.raise(f.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===74?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e,r){if(this.match(43)||this.match(47)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(6)){let a=super.parseMaybeDecoratorArguments(e,r);return a.typeArguments=i,a}this.unexpected(null,6)}return super.parseMaybeDecoratorArguments(e,r)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(8)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(43)||super.isClassMethod()}isClassProperty(){return this.match(31)||this.match(10)||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(f.TypeAnnotationAfterAssign,i.typeAnnotation),i}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(44,1);return}if(e===60){this.finishOp(43,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===43?(this.state.pos-=1,this.readToken_lt()):e===44&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===47?(this.state.pos-=2,this.finishOp(43,1),43):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.resetEndLocationFromNode(e.expression,e.typeAnnotation),e.expression}shouldParseArrow(e){return this.match(10)?e.every(r=>this.isAssignable(r,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(10)?!this.state.inConditionalConsequent:super.shouldParseAsyncArrow()}parseParenAndDistinguishExpression(e){let r=this.state.inConditionalConsequent;this.state.inConditionalConsequent=!1;let i=super.parseParenAndDistinguishExpression(e);return this.state.inConditionalConsequent=r,i}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(43)||this.match(47)){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(76))return e.abstract=!0,this.maybeTakeDecorators(r,this.parseClass(e,!0,!1));if(this.isContextual(125))return this.hasFollowingLineBreak()?null:(e.abstract=!0,this.raise(f.NonClassMethodPropertyHasAbstractModifier,e),this.tsParseInterfaceDeclaration(e));throw this.unexpected(null,76)}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(f.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.start;if(this.isContextual(89)){let P=this.parseIdentifier();if(this.isContextual(89)){let S=this.parseIdentifier();U(this.state.type)?(h=!0,o=P,l=r?this.parseIdentifier():this.parseModuleExportName(),c=!1):(l=S,c=!1)}else U(this.state.type)?(c=!1,l=r?this.parseIdentifier():this.parseModuleExportName()):(h=!0,o=P)}else U(this.state.type)&&(h=!0,r?(o=this.parseIdentifier(!0),this.isContextual(89)||this.checkReservedWord(o.name,o.start,!0,!0)):o=this.parseModuleExportName());h&&i&&this.raise(r?f.TypeModifierIsUsedInTypeImports:f.TypeModifierIsUsedInTypeExports,d),e[a]=o,e[n]=l;let m=r?"importKind":"exportKind";e[m]=h?"type":"value",c&&this.eatContextual(89)&&(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(R(e)){if(ke.lastIndex=r,ke.test(this.input)){let i=this.codePointAtPos(ke.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)}nextTokenIsStringLiteralOnSameLine(){let e=this.nextTokenInLineStart(),r=this.codePointAtPos(e);return r===34||r===39}};function $r(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:Wt(t.object)}function qr(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!!(Kt(t,s)||Kr(t,s)||e==="TemplateLiteral"&&t.expressions.length===0||$r(t))}function Kt(t,s){return s?t.type==="Literal"&&(typeof t.value=="number"||"bigint"in t):t.type==="NumericLiteral"||t.type==="BigIntLiteral"}function Kr(t,s){if(t.type==="UnaryExpression"){let{operator:e,argument:r}=t;if(e==="-"&&Kt(r,s))return!0}return!1}function Wt(t){return t.type==="Identifier"?!0:t.type!=="MemberExpression"||t.computed?!1:Wt(t.object)}var Wr={ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."},ut=B`placeholders`(Wr),Jr=t=>class extends t{parsePlaceholder(s){if(this.match(129)){let e=this.startNode();return this.next(),this.assertNoSpace(),e.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(129),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(129,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){var r;((r=s.label)==null?void 0:r.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(10)){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(77)||this.match(129)||this.match(2))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(94)&&!this.match(8))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(61)){let s=this.nextTokenStart();if(this.isUnparsedContextual(s,"from")&&this.input.startsWith(q(129),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(94)&&!this.match(8))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(8)&&(this.maybeParseStarImportSpecifier(s)||this.parseNamedImportSpecifiers(s)),this.expectContextual(94),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)}},Xr=t=>class extends t{parseV8Intrinsic(){if(this.match(50)){let s=this.state.startLoc,e=this.startNode();if(this.next(),C(this.state.type)){let r=this.parseIdentifierName(),i=this.createIdentifier(e,r);if(this.castNodeTo(i,"V8IntrinsicIdentifier"),this.match(6))return i}this.unexpected(s)}}parseExprAtom(s){return this.parseV8Intrinsic()||super.parseExprAtom(s)}},dt=["fsharp","hack"],mt=["^^","@@","^","%","#"];function Gr(t){if(t.has("decorators")&&t.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");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(!dt.includes(s)){let e=dt.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(!mt.includes(e)){let r=mt.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.");if(t.has("deprecatedImportAssert")?console.warn("`deprecatedImportAssert` has been removed in Babel 8, please use import attributes instead."):t.has("importAttributes")&&t.get("importAttributes").deprecatedAssertSyntax&&console.warn("The 'importAttributes' plugin has been removed in Babel 8. Please migrate any usage of `assert`-style attributes to `with`."),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 Jt={estree:Ls,jsx:ur,flow:lr,typescript:Hr,v8intrinsic:Xr,placeholders:Jr},Yr=Object.keys(Jt),Xt=class extends Rr{constructor(t,s,e){let r=vs(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.locations===!0&&(i|=256),r.tokens&&(i|=512),r.createImportExpressions&&(i|=1024),r.createParenthesizedExpressions&&(i|=2048),r.errorRecovery&&(i|=4096),r.attachComment&&(i|=8192),r.annexB&&(i|=16384),this.optionFlags=i}getScopeHandler(){return Xe}parse(){this.enterInitialScopes();let t=this.startNode(),s=this.startNode();this.nextToken(),t.errors=[];let e=this.parseTopLevel(t,s);return e.errors=this.state.errors,e.comments.length=this.state.commentsLen,e}};function Gt(t,s){if((s==null?void 0:s.sourceType)==="unambiguous"){s={...s};try{s.sourceType="module";let e=ae(s,t),r=e.parse();if(e.sawUnambiguousESM)return r;if(e.ambiguousScriptDifferentAst)try{return s.sourceType="script",ae(s,t).parse()}catch{}else r.program.sourceType="script";return r}catch(e){try{return s.sourceType="script",ae(s,t).parse()}catch{}throw e}}else return ae(s,t).parse()}function Yt(t,s){let e=ae(s,t);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function Qr(t){let s={};for(let e of Object.keys(t))s[e]=Mt(t[e]);return s}Qr(Ds);function ae(t,s){let e=Xt,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||{})}Gr(r),e=Zr(r)}return new e(t,s,r)}var ft=new Map;function Zr(t){let s=[];for(let i of Yr)t.has(i)&&s.push(i);let e=s.join("|"),r=ft.get(e);if(!r){r=Xt;for(let i of s)r=Jt[i](r);ft.set(e,r)}return r}function Qt(t){return(s,e,r)=>{if(e===!1)return!1;let i=!!(r!=null&&r.backwards),{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 ei=Qt(" "),ti=Qt(/[^\n\r]/);function si(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 ri=si,yt=t=>t===`
|
|
9
|
+
`||t==="\r"||t==="\u2028"||t==="\u2029";function ii(t,s,e){if(s===!1)return!1;let r=!!(e!=null&&e.backwards),i=t.charAt(s);if(r){if(t.charAt(s-1)==="\r"&&i===`
|
|
10
|
+
`)return s-2;if(yt(i))return s-1}else{if(i==="\r"&&t.charAt(s+1)===`
|
|
11
|
+
`)return s+2;if(yt(i))return s+1}return s}var ai=ii;function ni(t,s){return s===!1?!1:t.charAt(s)==="/"&&t.charAt(s+1)==="/"?ti(t,s):s}var oi=ni;function li(t,s){let e=null,r=s;for(;r!==e;)e=r,r=ei(t,r),r=ri(t,r),r=oi(t,r),r=ai(t,r);return r}var hi=li;function pi(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 ci(t){if(!t.startsWith("#!"))return"";let s=t.indexOf(`
|
|
12
|
+
`);return s===-1?t:t.slice(0,s)}var Zt=ci,ui=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}},di=Ue("findLast",function(){if(Array.isArray(this))return ui}),mi=di,es=Symbol.for("comments");function fi(t){return this[t<0?this.length+t:t]}var yi=Ue("at",function(){if(Array.isArray(this)||typeof this=="string")return fi}),xi=yi;function Ae(t){let s=new Set(t);return e=>s.has(e==null?void 0:e.type)}function Ge(t){var s;return((s=t.range)==null?void 0:s[1])??t.end}function O(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(O(e),s):s}var Pi=5,gi=8,Ti=8,xt=t=>s=>s.label?M(s.label):O(s)+t,bi=t=>t.__contentEnd??Ge(t),ts=["ExpressionStatement","Directive","ImportDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExportAllDeclaration","ReturnStatement","ThrowStatement","DoWhileStatement"],Ai=new Map([["BreakStatement",xt(Pi)],["ContinueStatement",xt(gi)],["DebuggerStatement",t=>O(t)+Ti],["VariableDeclaration",t=>M(xi(0,t.declarations,-1))],...ts.map(t=>[t,bi])]),Si=Ae(ts);function M(t){var e;let{type:s}=t;return s==="IfStatement"?M(t.alternate??t.consequent):s==="ForInStatement"||s==="ForOfStatement"||s==="ForStatement"||s==="LabeledStatement"||s==="WithStatement"||s==="WhileStatement"?M(t.body):((e=Ai.get(s))==null?void 0:e(t))??Ge(t)}var Ye=Ae(["Block","CommentBlock","MultiLine"]),Ei=Ae(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]);function Qe(t,s,e){if(!t.has(s)){let r=e(s);t.set(s,r)}return t.get(s)}var Ci=new WeakMap;function Ii(t){return Qe(Ci,t,s=>Ye(s)&&s.value[0]==="*"&&/@(?:type|satisfies)\b/.test(s.value))}function wi(t){return X(0,t,/[^\n]/g," ")}var Ni=wi;function ki(t,s){for(let e of s){let r=O(e),i=M(e);t=t.slice(0,r)+Ni(t.slice(r,i))+t.slice(i)}return t}var vi=new WeakMap;function Li(t){let s=t[es];return Qe(vi,s,e=>ki(t.originalText,e))}function Mi(t){if(!Ye(t))return[];if(!t.value.includes(`
|
|
13
|
+
`))return[];let s=[];for(let e of`*${t.value}*`.split(`
|
|
14
|
+
`)){if(e=e.trimStart(),!e.startsWith("*"))return[];s.push(e)}return s}var ss=new WeakMap;function Di(t){return Qe(ss,t,Mi)}function Oi(t){ss.delete(t)}function Pt(t){return Di(t).length>0}function Fi(t){if(t.length<2)return;let s;for(let e=t.length-1;e>=0;e--){let r=t[e];if(s&&M(r)===O(s)&&Pt(r)&&Pt(s)&&(t.splice(e+1,1),r.value+="*//*"+s.value,r.range=[O(r),M(s)],Oi(r)),!Ei(r)&&!Ye(r))throw new TypeError(`Unknown comment type: "${r.type}".`);s=r}}function Bi(t){return t!==null&&typeof t=="object"}var Ui=Bi,se=null;function oe(t){if(se!==null&&typeof se.property){let s=se;return se=oe.prototype=null,s}return se=oe.prototype=t??Object.create(null),new oe}var Ri=10;for(let t=0;t<=Ri;t++)oe();function ji(t){return oe(t)}function _i(t,s="type"){ji(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 Vi=_i,u=[["elements"],["left","right"],["value"],["directives","body"],["label"],["callee","typeArguments","arguments"],["test","consequent","alternate"],["body","test"],["expression"],["left","right","body"],["id","typeParameters","params","predicate","returnType","body"],["object","property"],["properties"],["decorators","key","typeParameters","params","returnType","body"],["decorators","key","value"],["argument"],["expressions"],["id","init"],["body"],["decorators","id","typeParameters","superClass","superTypeArguments","mixins","implements","body"],["declaration","specifiers","source","attributes"],["local"],["exported"],["decorators","variance","key","typeAnnotation","value"],["id"],["key","value"],["elementType"],["id","typeParameters"],["id","typeParameters","extends","body"],["id","body"],["typeAnnotation"],["id","typeParameters","right"],["name","typeAnnotation"],["types"],["qualification","id"],["elementTypes"],["expression","typeAnnotation"],["params"],["members"],["objectType","indexType"],["decorators","key","typeAnnotation","value"],["id","typeParameters","params","returnType","body"],["key","typeParameters","params","returnType"],["typeParameters","params","returnType"],["parameterName","typeAnnotation"],["checkType","extendsType","trueType","falseType"],["typeParameter"],["literal"],["expression","typeArguments"],["decorators","key","typeAnnotation"],["argument","cases"],["pattern","body","guard"],["properties","rest"],["node"]],zi={ArrayExpression:u[0],AssignmentExpression:u[1],BinaryExpression:u[1],InterpreterDirective:[],Directive:u[2],DirectiveLiteral:[],BlockStatement:u[3],BreakStatement:u[4],CallExpression:u[5],CatchClause:["param","body"],ConditionalExpression:u[6],ContinueStatement:u[4],DebuggerStatement:[],DoWhileStatement:u[7],EmptyStatement:[],ExpressionStatement:u[8],File:["program"],ForInStatement:u[9],ForStatement:["init","test","update","body"],FunctionDeclaration:u[10],FunctionExpression:u[10],Identifier:["typeAnnotation","decorators"],IfStatement:u[6],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:u[1],MemberExpression:u[11],NewExpression:u[5],Program:u[3],ObjectExpression:u[12],ObjectMethod:u[13],ObjectProperty:u[14],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:u[15],SequenceExpression:u[16],ParenthesizedExpression:u[8],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:u[15],TryStatement:["block","handler","finalizer"],UnaryExpression:u[15],UpdateExpression:u[15],VariableDeclaration:["declarations"],VariableDeclarator:u[17],WhileStatement:u[7],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:u[18],ClassExpression:u[19],ClassDeclaration:u[19],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:u[20],ExportSpecifier:["local","exported"],ForOfStatement:u[9],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:u[21],ImportNamespaceSpecifier:u[21],ImportSpecifier:["imported","local"],MetaProperty:["meta","property"],ClassMethod:u[13],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:u[15],Super:[],TaggedTemplateExpression:["tag","typeArguments","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:u[15],AwaitExpression:u[15],ImportExpression:["source","options"],BigIntLiteral:[],ExportNamespaceSpecifier:u[22],OptionalMemberExpression:u[11],OptionalCallExpression:u[5],ClassProperty:u[23],ClassPrivateProperty:u[23],ClassPrivateMethod:u[13],PrivateName:u[24],StaticBlock:u[18],ImportAttribute:u[25],AnyTypeAnnotation:[],ArrayTypeAnnotation:u[26],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:u[27],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:u[28],DeclareModule:u[29],DeclareModuleExports:u[30],DeclareTypeAlias:u[31],DeclareOpaqueType:["id","typeParameters","supertype","lowerBound","upperBound"],DeclareVariable:["id","declarations"],DeclareExportDeclaration:u[20],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:u[2],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:u[32],GenericTypeAnnotation:u[27],InferredPredicate:[],InterfaceExtends:u[27],InterfaceDeclaration:u[28],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:u[33],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:u[30],NumberLiteralTypeAnnotation:[],BigIntLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:u[2],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:u[15],OpaqueType:["id","typeParameters","supertype","impltype","lowerBound","upperBound"],QualifiedTypeIdentifier:u[34],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:u[35],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:u[31],TypeAnnotation:u[30],TypeCastExpression:u[36],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:u[37],TypeParameterInstantiation:u[37],UnionTypeAnnotation:u[33],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:u[29],EnumBooleanBody:u[38],EnumNumberBody:u[38],EnumStringBody:u[38],EnumSymbolBody:u[38],EnumBooleanMember:u[17],EnumNumberMember:u[17],EnumStringMember:u[17],EnumDefaultedMember:u[24],IndexedAccessType:u[39],OptionalIndexedAccessType:u[39],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:u[8],JSXSpreadChild:u[8],JSXIdentifier:[],JSXMemberExpression:u[11],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeArguments","attributes"],JSXSpreadAttribute:u[15],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ClassAccessorProperty:u[40],Decorator:u[8],DoExpression:u[18],ExportDefaultSpecifier:u[22],ModuleExpression:u[18],TopicReference:[],VoidPattern:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:u[41],TSDeclareMethod:u[42],TSQualifiedName:u[1],TSCallSignatureDeclaration:u[43],TSConstructSignatureDeclaration:u[43],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:u[42],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:u[43],TSConstructorType:u[43],TSTypeReference:["typeName","typeArguments"],TSTypePredicate:u[44],TSTypeQuery:["exprName","typeArguments"],TSTypeLiteral:u[38],TSArrayType:u[26],TSTupleType:u[35],TSOptionalType:u[30],TSRestType:u[30],TSNamedTupleMember:["label","elementType"],TSUnionType:u[33],TSIntersectionType:u[33],TSConditionalType:u[45],TSInferType:u[46],TSParenthesizedType:u[30],TSTypeOperator:u[30],TSIndexedAccessType:u[39],TSMappedType:["key","constraint","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:u[47],TSClassImplements:u[48],TSInterfaceHeritage:u[48],TSInterfaceDeclaration:u[28],TSInterfaceBody:u[18],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:u[48],TSAsExpression:u[36],TSSatisfiesExpression:u[36],TSTypeAssertion:u[36],TSEnumBody:u[38],TSEnumDeclaration:u[29],TSEnumMember:["id","initializer"],TSModuleDeclaration:u[29],TSModuleBlock:u[18],TSImportType:["source","options","qualifier","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:u[8],TSNonNullExpression:u[8],TSExportAssignment:u[8],TSNamespaceExportDeclaration:u[24],TSTypeAnnotation:u[30],TSTypeParameterInstantiation:u[37],TSTypeParameterDeclaration:u[37],TSTypeParameter:["name","constraint","default"],ChainExpression:u[8],Literal:[],MethodDefinition:u[14],PrivateIdentifier:[],Property:u[25],PropertyDefinition:u[23],AccessorProperty:u[40],TSAbstractAccessorProperty:u[49],TSAbstractKeyword:[],TSAbstractMethodDefinition:u[25],TSAbstractPropertyDefinition:u[49],TSAsyncKeyword:[],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:u[8],AsExpression:u[36],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:u[32],ConditionalTypeAnnotation:u[45],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:u[29],DeclareHook:u[24],DeclareNamespace:u[29],EnumBigIntBody:u[38],EnumBigIntMember:u[17],EnumBody:u[38],HookDeclaration:u[41],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:u[46],KeyofTypeAnnotation:u[15],MatchArrayPattern:["elements","rest"],MatchAsPattern:["pattern","target"],MatchBindingPattern:u[24],MatchExpression:u[50],MatchExpressionCase:u[51],MatchIdentifierPattern:u[24],MatchInstanceObjectPattern:u[52],MatchInstancePattern:["targetConstructor","properties"],MatchLiteralPattern:u[47],MatchMemberPattern:["base","property"],MatchObjectPattern:u[52],MatchObjectPatternProperty:["key","pattern"],MatchOrPattern:["patterns"],MatchRestPattern:u[15],MatchStatement:u[50],MatchStatementCase:u[51],MatchUnaryPattern:u[15],MatchWildcardPattern:[],NeverTypeAnnotation:[],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:u[34],RecordDeclaration:["id","typeParameters","implements","body"],RecordDeclarationBody:u[0],RecordDeclarationImplements:["id","typeArguments"],RecordDeclarationProperty:["key","typeAnnotation","defaultValue"],RecordDeclarationStaticProperty:["key","typeAnnotation","value"],RecordExpression:["recordConstructor","typeArguments","properties"],RecordExpressionProperties:u[12],SatisfiesExpression:u[36],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:u[30],TypePredicate:u[44],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],NGChainedExpression:u[16],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:u[18],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:u[25],NGRoot:u[53],JsExpressionRoot:u[53],JsonRoot:u[53],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:u[30],TSJSDocNonNullableType:u[30]},Hi=Vi(zi),$i=Hi;function ge(t,s){if(!Ui(t))return t;if(Array.isArray(t)){for(let r=0;r<t.length;r++)t[r]=ge(t[r],s);return t}if(s.onEnter){let r=s.onEnter(t)??t;if(r!==t)return ge(r,s);t=r}let e=$i(t);for(let r=0;r<e.length;r++)t[e[r]]=ge(t[e[r]],s);return s.onLeave&&(t=s.onLeave(t)||t),t}var qi=ge;Ae(["RegExpLiteral","BigIntLiteral","NumericLiteral","StringLiteral","DirectiveLiteral","Literal","JSXText","TemplateElement","StringLiteralTypeAnnotation","NumberLiteralTypeAnnotation","BigIntLiteralTypeAnnotation"]);function Ki(t,s){let{text:e,astType:r}=s,i=r==="oxc-ts",{comments:a}=t;Fi(a);let n=t.type==="File"?t.program:t;n.interpreter&&(a.unshift(n.interpreter),delete n.interpreter),t.hashbang&&(i&&a.unshift(t.hashbang),delete t.hashbang),t.type==="Program"&&(t.range=[0,e.length]);let o;return t=qi(t,{onEnter(l){switch(Wi(l,a,e),l.type){case"ParenthesizedExpression":{let{expression:h}=l,c=O(l);if(h.type==="TypeCastExpression")return h.range=[c,M(l)],h;let d=!1;if(!i){if(!o){o=[];for(let P of a)Ii(P)&&o.push(M(P))}let m=mi(0,o,P=>P<=c);d=m&&e.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(r==="flow"||r==="hermes"||r==="espree"||r==="typescript"||i){let h=O(l)+1,c=M(l)-(l.tail?1:2);l.range=[h,c]}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"TupleTypeAnnotation":l.types&&!l.elementTypes&&(l.elementTypes=l.types);break;case"ImportDeclaration":r==="hermes"&&l.assertions&&!l.attributes&&(l.attributes=l.assertions,delete l.assertions);break}},onLeave(l){switch(l.type){case"LogicalExpression":if(rs(l))return Fe(l);break}}}),t}function rs(t){return t.type==="LogicalExpression"&&t.right.type==="LogicalExpression"&&t.operator===t.right.operator}function Fe(t){return rs(t)?Fe({type:"LogicalExpression",operator:t.operator,left:Fe({type:"LogicalExpression",operator:t.operator,left:t.left,right:t.right.left,range:[O(t.left),M(t.right.left)]}),right:t.right.right,range:[O(t),M(t)]}):t}function Wi(t,s,e){if(!Si(t))return;let r=Ge(t);if(e[r-1]!==";")return;let i=Li({[es]:s,originalText:e});r-=1;let a=i.slice(O(t),r),n=a.trimEnd();t.__contentEnd=r-(a.length-n.length)}var Ji=Ki;function Xi(t,s){let e=new SyntaxError(t+" ("+s.loc.start.line+":"+s.loc.start.column+")");return Object.assign(e,s)}var is=Xi,gt="Unexpected parseExpression() input: ";function Gi(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(gt)&&(s=s.slice(gt.length)),is(s,{loc:{start:{line:i,column:a+1}},cause:n})}var as=Gi,Yi=/\*\/$/,Qi=/^\/\*\*?/,Zi=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,ea=/(^|\s+)\/\/([^\n\r]*)/g,Tt=/^(\r?\n)+/,ta=/(?:^|\r?\n) *(@[^\n\r]*?) *\r?\n *(?![^\n\r@]*\/\/[^]*)([^\s@][^\n\r@]+?) *\r?\n/g,bt=/(?:^|\r?\n) *@(\S+) *([^\n\r]*)/g,sa=/(\r?\n|^) *\* ?/g,ra=[];function ia(t){let s=t.match(Zi);return s?s[0].trimStart():""}function aa(t){t=X(0,t.replace(Qi,"").replace(Yi,""),sa,"$1");let s="";for(;s!==t;)s=t,t=X(0,t,ta,`
|
|
15
|
+
$1 $2
|
|
16
|
+
`);t=t.replace(Tt,"").trimEnd();let e=Object.create(null),r=X(0,t,bt,"").replace(Tt,"").trimEnd(),i;for(;i=bt.exec(t);){let a=X(0,i[2],ea,"");if(typeof e[i[1]]=="string"||Array.isArray(e[i[1]])){let n=e[i[1]];e[i[1]]=[...ra,...Array.isArray(n)?n:[n],a]}else e[i[1]]=a}return{comments:r,pragmas:e}}var na=["noformat","noprettier"],oa=["format","prettier"];function ns(t){let s=Zt(t);s&&(t=t.slice(s.length+1));let e=ia(t),{pragmas:r,comments:i}=aa(e);return{shebang:s,text:t,pragmas:r,comments:i}}function la(t){let{pragmas:s}=ns(t);return oa.some(e=>Re(s,e))}function ha(t){let{pragmas:s}=ns(t);return na.some(e=>Re(s,e))}function pa(t){return t=typeof t=="function"?{parse:t}:t,{astFormat:"estree",hasPragma:la,hasIgnorePragma:ha,locStart:O,locEnd:M,...t}}var he=pa,Ze="module",os="commonjs";function ca(t){if(typeof t=="string"){if(t=t.toLowerCase(),/\.(?:mjs|mts)$/i.test(t))return Ze;if(/\.(?:cjs|cts)$/i.test(t))return os}}function ua(t){let{type:s="JsExpressionRoot",expression:e,comments:r=(e==null?void 0:e.comments)??[],text:i,rootMarker:a}=t,n={type:s,comments:r,range:[0,i.length],rootMarker:a};return e&&(delete e.comments,n.node=e),n}var ls=ua,Q=t=>he(xa(t)),da={sourceType:Ze,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,attachComment:!1,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions",["partialApplication",{version:"2018-07"}],"decorators","moduleBlocks","asyncDoExpressions","destructuringPrivate","decoratorAutoAccessors","sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}],["discardBinding",{syntaxType:"void"}]],tokens:!1,ranges:!1},At="v8intrinsic",St=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"fsharp"}]],_=(t,s=da)=>({...s,plugins:[...s.plugins,...t]}),ma=/@(?:no)?flow\b/;function fa(t,s){if(s!=null&&s.endsWith(".js.flow"))return!0;let e=Zt(t);e&&(t=t.slice(e.length));let r=hi(t,0);return r!==!1&&(t=t.slice(0,r)),ma.test(t)}function ya(t,s,e){let r=t(s,e),i=r.errors.find(a=>!ga.has(a.reasonCode));if(i)throw i;return r}function xa({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")&&fa(e,i))return r.parser="babel-flow",ps.parse(e,r);let a=s,n=r.__babelSourceType??ca(i);n&&n!==Ze&&(a=a.map(c=>({...c,sourceType:n,...n===os?{allowReturnOutsideFunction:void 0,allowNewTargetOutsideFunction:void 0}:void 0})));let o=/%[A-Z]/.test(e);e.includes("|>")?a=(o?[...St,At]:St).flatMap(c=>a.map(d=>_([c],d))):o&&(a=a.map(c=>_([At],c)));let l=t?Yt:Gt,h;try{h=pi(a.map(c=>()=>ya(l,e,c)))}catch({errors:[c]}){throw as(c)}return t&&(h=ls({expression:h,text:e,rootMarker:r.rootMarker})),Ji(h,{text:e})}}var Pa=["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","ForInOfLoopInitializer","ParamDupe","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","PatternIsOptional","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport","DeclarationMissingInitializer","DecoratorAbstractMethod"],ga=new Set(Pa),hs=[_(["jsx"])],Et=Q({optionsCombinations:hs}),Ct=Q({optionsCombinations:[_(["jsx","typescript"]),_(["typescript"])]}),It=Q({isExpression:!0,optionsCombinations:[_(["jsx"])]}),wt=Q({isExpression:!0,optionsCombinations:[_(["typescript"])]}),ps=Q({optionsCombinations:[_(["jsx",["flow",{all:!0}],"flowComments"])]}),Ta=Q({optionsCombinations:hs.map(t=>_(["estree"],t))}),cs={};Be(cs,{json:()=>Sa,"json-stringify":()=>Ia,json5:()=>Ea,jsonc:()=>Ca});function ba(t){return Array.isArray(t)&&t.length>0}var us=ba,ds={tokens:!1,ranges:!1,attachComment:!1,createParenthesizedExpressions:!0};function Aa(t){let s=Gt(t,ds),{program:e}=s;if(e.body.length===0&&e.directives.length===0&&!e.interpreter)return{comments:s.comments}}function Se(t,s={}){let{allowComments:e=!0,allowEmpty:r=!1}=s,i,a;try{i=Yt(t,ds),a=i.comments}catch(n){if(r&&n.code==="BABEL_PARSER_SYNTAX_ERROR"&&n.reasonCode==="ParseExpressionEmptyInput")try{({comments:a}=Aa(t))}catch{}if(!a)throw as(n)}if(!e&&us(a))throw $(a[0],"Comment");return(!r||i)&&J(i),i=ls({type:"JsonRoot",expression:i,comments:a,text:t}),i}function $(t,s){let[e,r]=[t.loc.start,t.loc.end].map(({line:i,column:a})=>({line:i,column:a+1}));return is(`${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 $(t.key,"Computed key");if(t.shorthand)throw $(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 $(t,`Operator '${t.operator}'`);if(e.type==="NumericLiteral"||e.type==="Identifier"&&(e.name==="Infinity"||e.name==="NaN"))return;throw $(e,`Operator '${s}' before '${e.type}'`)}case"Identifier":if(t.name!=="Infinity"&&t.name!=="NaN"&&t.name!=="undefined")throw $(t,`Identifier '${t.name}'`);return;case"TemplateLiteral":if(us(t.expressions))throw $(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 $(t,`'${t.type}'`)}}var Sa=he({parse:t=>Se(t),hasPragma:()=>!0,hasIgnorePragma:()=>!1}),Ea=he(t=>Se(t)),Ca=he(t=>Se(t,{allowEmpty:!0})),Ia=he({parse:t=>Se(t,{allowComments:!1}),astFormat:"estree-json"}),ms={...kt,...cs};exports.default=Nt;exports.parsers=ms;
|