,\n startLoc: Position | undefined | null,\n isGenerator: boolean,\n isAsync: boolean,\n isPattern: boolean,\n isAccessor: boolean,\n refExpressionErrors?: ExpressionErrors | null,\n ): T {\n if ((prop as any).variance) {\n this.unexpected((prop as any).variance.loc.start);\n }\n delete (prop as any).variance;\n\n let typeParameters;\n\n // method shorthand\n if (this.match(tt.lt) && !isAccessor) {\n typeParameters = this.flowParseTypeParameterDeclaration();\n if (!this.match(tt.parenL)) this.unexpected();\n }\n\n const result = super.parseObjPropValue(\n prop,\n startLoc,\n isGenerator,\n isAsync,\n isPattern,\n isAccessor,\n refExpressionErrors,\n );\n\n // add typeParameters if we found them\n if (typeParameters) {\n // @ts-expect-error: refine typings\n (result.value || result).typeParameters = typeParameters;\n }\n return result;\n }\n\n parseFunctionParamType(param: N.Pattern): N.Pattern {\n if (this.eat(tt.question)) {\n if (param.type !== \"Identifier\") {\n this.raise(FlowErrors.PatternIsOptional, param);\n }\n if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamMayNotBeOptional, param);\n }\n\n (param as any as N.Identifier).optional = true;\n }\n if (this.match(tt.colon)) {\n param.typeAnnotation = this.flowParseTypeAnnotation();\n } else if (this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamAnnotationRequired, param);\n }\n\n if (this.match(tt.eq) && this.isThisParam(param)) {\n this.raise(FlowErrors.ThisParamNoDefault, param);\n }\n\n this.resetEndLocation(param);\n return param;\n }\n\n parseMaybeDefault(\n startLoc?: Position | null,\n left?: P | null,\n ): P | N.AssignmentPattern {\n const node = super.parseMaybeDefault(startLoc, left);\n\n if (\n node.type === \"AssignmentPattern\" &&\n node.typeAnnotation &&\n node.right.start < node.typeAnnotation.start\n ) {\n this.raise(FlowErrors.TypeBeforeInitializer, node.typeAnnotation);\n }\n\n return node;\n }\n\n checkImportReflection(node: Undone) {\n super.checkImportReflection(node);\n if (node.module && node.importKind !== \"value\") {\n this.raise(\n FlowErrors.ImportReflectionHasImportType,\n node.specifiers[0].loc.start,\n );\n }\n }\n\n parseImportSpecifierLocal<\n T extends\n | N.ImportSpecifier\n | N.ImportDefaultSpecifier\n | N.ImportNamespaceSpecifier,\n >(node: N.ImportDeclaration, specifier: Undone, type: T[\"type\"]): void {\n specifier.local = hasTypeImportKind(node)\n ? this.flowParseRestrictedIdentifier(\n /* liberal */ true,\n /* declaration */ true,\n )\n : this.parseIdentifier();\n\n node.specifiers.push(this.finishImportSpecifier(specifier, type));\n }\n\n isPotentialImportPhase(isExport: boolean): boolean {\n if (super.isPotentialImportPhase(isExport)) return true;\n if (this.isContextual(tt._type)) {\n if (!isExport) return true;\n const ch = this.lookaheadCharCode();\n return ch === charCodes.leftCurlyBrace || ch === charCodes.asterisk;\n }\n return !isExport && this.isContextual(tt._typeof);\n }\n\n applyImportPhase(\n node: Undone,\n isExport: boolean,\n phase: string | null,\n loc?: Position,\n ): void {\n super.applyImportPhase(node, isExport, phase, loc);\n if (isExport) {\n if (!phase && this.match(tt._default)) {\n // TODO: Align with our TS AST and always add .exportKind\n return;\n }\n (node as N.ExportNamedDeclaration).exportKind =\n phase === \"type\" ? phase : \"value\";\n } else {\n if (phase === \"type\" && this.match(tt.star)) this.unexpected();\n (node as N.ImportDeclaration).importKind =\n phase === \"type\" || phase === \"typeof\" ? phase : \"value\";\n }\n }\n\n // parse import-type/typeof shorthand\n parseImportSpecifier(\n specifier: any,\n importedIsString: boolean,\n isInTypeOnlyImport: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n isMaybeTypeOnly: boolean,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n bindingType: BindingFlag | undefined,\n ): N.ImportSpecifier {\n const firstIdent = specifier.imported;\n\n let specifierTypeKind = null;\n if (firstIdent.type === \"Identifier\") {\n if (firstIdent.name === \"type\") {\n specifierTypeKind = \"type\";\n } else if (firstIdent.name === \"typeof\") {\n specifierTypeKind = \"typeof\";\n }\n }\n\n let isBinding = false;\n if (this.isContextual(tt._as) && !this.isLookaheadContextual(\"as\")) {\n const as_ident = this.parseIdentifier(true);\n if (\n specifierTypeKind !== null &&\n !tokenIsKeywordOrIdentifier(this.state.type)\n ) {\n // `import {type as ,` or `import {type as }`\n specifier.imported = as_ident;\n specifier.importKind = specifierTypeKind;\n specifier.local = this.cloneIdentifier(as_ident);\n } else {\n // `import {type as foo`\n specifier.imported = firstIdent;\n specifier.importKind = null;\n specifier.local = this.parseIdentifier();\n }\n } else {\n if (\n specifierTypeKind !== null &&\n tokenIsKeywordOrIdentifier(this.state.type)\n ) {\n // `import {type foo`\n specifier.imported = this.parseIdentifier(true);\n specifier.importKind = specifierTypeKind;\n } else {\n if (importedIsString) {\n /*:: invariant(firstIdent instanceof N.StringLiteral) */\n throw this.raise(Errors.ImportBindingIsString, specifier, {\n importName: firstIdent.value,\n });\n }\n /*:: invariant(firstIdent instanceof N.Node) */\n specifier.imported = firstIdent;\n specifier.importKind = null;\n }\n\n if (this.eatContextual(tt._as)) {\n specifier.local = this.parseIdentifier();\n } else {\n isBinding = true;\n specifier.local = this.cloneIdentifier(specifier.imported);\n }\n }\n\n const specifierIsTypeImport = hasTypeImportKind(specifier);\n\n if (isInTypeOnlyImport && specifierIsTypeImport) {\n this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);\n }\n\n if (isInTypeOnlyImport || specifierIsTypeImport) {\n this.checkReservedType(\n specifier.local.name,\n specifier.local.loc.start,\n /* declaration */ true,\n );\n }\n\n if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) {\n this.checkReservedWord(\n specifier.local.name,\n specifier.loc.start,\n true,\n true,\n );\n }\n\n return this.finishImportSpecifier(specifier, \"ImportSpecifier\");\n }\n\n parseBindingAtom(): N.Pattern {\n switch (this.state.type) {\n case tt._this:\n // \"this\" may be the name of a parameter, so allow it.\n return this.parseIdentifier(/* liberal */ true);\n default:\n return super.parseBindingAtom();\n }\n }\n\n // parse function type parameters - function foo() {}\n parseFunctionParams(\n node: Undone,\n isConstructor: boolean,\n ): void {\n // @ts-expect-error kind may not index node\n const kind = node.kind;\n if (kind !== \"get\" && kind !== \"set\" && this.match(tt.lt)) {\n node.typeParameters = this.flowParseTypeParameterDeclaration();\n }\n super.parseFunctionParams(node, isConstructor);\n }\n\n // parse flow type annotations on variable declarator heads - let foo: string = bar\n parseVarId(\n decl: N.VariableDeclarator,\n kind: \"var\" | \"let\" | \"const\" | \"using\" | \"await using\",\n ): void {\n super.parseVarId(decl, kind);\n if (this.match(tt.colon)) {\n decl.id.typeAnnotation = this.flowParseTypeAnnotation();\n this.resetEndLocation(decl.id); // set end position to end of type\n }\n }\n\n // parse the return type of an async arrow function - let foo = (async (): number => {});\n parseAsyncArrowFromCallExpression(\n node: N.ArrowFunctionExpression,\n call: N.CallExpression,\n ): N.ArrowFunctionExpression {\n if (this.match(tt.colon)) {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n node.returnType = this.flowParseTypeAnnotation();\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n }\n\n return super.parseAsyncArrowFromCallExpression(node, call);\n }\n\n // todo description\n shouldParseAsyncArrow(): boolean {\n return this.match(tt.colon) || super.shouldParseAsyncArrow();\n }\n\n // We need to support type parameter declarations for arrow functions. This\n // is tricky. There are three situations we need to handle\n //\n // 1. This is either JSX or an arrow function. We'll try JSX first. If that\n // fails, we'll try an arrow function. If that fails, we'll throw the JSX\n // error.\n // 2. This is an arrow function. We'll parse the type parameter declaration,\n // parse the rest, make sure the rest is an arrow function, and go from\n // there\n // 3. This is neither. Just call the super method\n parseMaybeAssign(\n refExpressionErrors?: ExpressionErrors | null,\n afterLeftParse?: Function,\n ): N.Expression {\n let state = null;\n\n let jsx;\n\n if (\n this.hasPlugin(\"jsx\") &&\n (this.match(tt.jsxTagStart) || this.match(tt.lt))\n ) {\n state = this.state.clone();\n\n jsx = this.tryParse(\n () => super.parseMaybeAssign(refExpressionErrors, afterLeftParse),\n state,\n );\n\n /*:: invariant(!jsx.aborted) */\n /*:: invariant(jsx.node != null) */\n if (!jsx.error) return jsx.node;\n\n // Remove `tc.j_expr` and `tc.j_oTag` from context added\n // by parsing `jsxTagStart` to stop the JSX plugin from\n // messing with the tokens\n const { context } = this.state;\n const currentContext = context[context.length - 1];\n if (currentContext === tc.j_oTag || currentContext === tc.j_expr) {\n context.pop();\n }\n }\n\n if (jsx?.error || this.match(tt.lt)) {\n state = state || this.state.clone();\n\n let typeParameters: N.TypeParameterDeclaration;\n\n const arrow = this.tryParse((abort: () => never) => {\n typeParameters = this.flowParseTypeParameterDeclaration();\n\n const arrowExpression = this.forwardNoArrowParamsConversionAt(\n typeParameters,\n () => {\n const result = super.parseMaybeAssign(\n refExpressionErrors,\n afterLeftParse,\n );\n\n this.resetStartLocationFromNode(result, typeParameters);\n\n return result;\n },\n );\n\n // (() => {});\n // (() => {}: any);\n if (arrowExpression.extra?.parenthesized) abort();\n\n // The above can return a TypeCastExpression when the arrow\n // expression is not wrapped in parens. See also `this.parseParenItem`.\n // (() => {}: any);\n const expr = this.maybeUnwrapTypeCastExpression(arrowExpression);\n\n if (expr.type !== \"ArrowFunctionExpression\") abort();\n\n expr.typeParameters = typeParameters;\n this.resetStartLocationFromNode(expr, typeParameters);\n\n return arrowExpression;\n }, state);\n\n let arrowExpression:\n | N.ArrowFunctionExpression\n | N.TypeCastExpression\n | undefined\n | null = null;\n\n if (\n arrow.node &&\n this.maybeUnwrapTypeCastExpression(arrow.node).type ===\n \"ArrowFunctionExpression\"\n ) {\n if (!arrow.error && !arrow.aborted) {\n // async () => {}\n // @ts-expect-error: refine tryParse typings\n if (arrow.node.async) {\n /*:: invariant(typeParameters) */\n this.raise(\n FlowErrors.UnexpectedTypeParameterBeforeAsyncArrowFunction,\n typeParameters,\n );\n }\n return arrow.node;\n }\n\n // @ts-expect-error: refine typings\n arrowExpression = arrow.node;\n }\n\n // If we are here, both JSX and Flow parsing attempts failed.\n // Give the precedence to the JSX error, except if JSX had an\n // unrecoverable error while Flow didn't.\n // If the error is recoverable, we can only re-report it if there is\n // a node we can return.\n\n if (jsx?.node) {\n /*:: invariant(jsx.failState) */\n this.state = jsx.failState;\n return jsx.node;\n }\n\n if (arrowExpression) {\n /*:: invariant(arrow.failState) */\n this.state = arrow.failState;\n return arrowExpression;\n }\n\n if (jsx?.thrown) throw jsx.error;\n if (arrow.thrown) throw arrow.error;\n\n /*:: invariant(typeParameters) */\n throw this.raise(\n FlowErrors.UnexpectedTokenAfterTypeParameter,\n typeParameters,\n );\n }\n\n return super.parseMaybeAssign(refExpressionErrors, afterLeftParse);\n }\n\n // handle return types for arrow functions\n parseArrow(\n node: Undone,\n ): Undone | undefined | null {\n if (this.match(tt.colon)) {\n // @ts-expect-error todo(flow->ts)\n const result = this.tryParse(() => {\n const oldNoAnonFunctionType = this.state.noAnonFunctionType;\n this.state.noAnonFunctionType = true;\n\n const typeNode = this.startNode();\n\n [\n typeNode.typeAnnotation,\n // @ts-expect-error (destructuring not supported yet)\n node.predicate,\n ] = this.flowParseTypeAndPredicateInitialiser();\n\n this.state.noAnonFunctionType = oldNoAnonFunctionType;\n\n if (this.canInsertSemicolon()) this.unexpected();\n if (!this.match(tt.arrow)) this.unexpected();\n\n return typeNode;\n });\n\n if (result.thrown) return null;\n /*:: invariant(result.node) */\n\n if (result.error) this.state = result.failState;\n\n // assign after it is clear it is an arrow\n // @ts-expect-error todo(flow->ts)\n node.returnType = result.node.typeAnnotation\n ? this.finishNode(result.node, \"TypeAnnotation\")\n : null;\n }\n\n return super.parseArrow(node);\n }\n\n shouldParseArrow(params: Array): boolean {\n return this.match(tt.colon) || super.shouldParseArrow(params);\n }\n\n setArrowFunctionParameters(\n node: Undone,\n params:\n | Array\n | Array,\n ): void {\n if (\n this.state.noArrowParamsConversionAt.includes(\n this.offsetToSourcePos(node.start),\n )\n ) {\n node.params = params as N.ArrowFunctionExpression[\"params\"];\n } else {\n super.setArrowFunctionParameters(node, params);\n }\n }\n\n checkParams(\n node: N.Function,\n allowDuplicates: boolean,\n isArrowFunction?: boolean | null,\n strictModeChanged: boolean = true,\n ): void {\n if (\n isArrowFunction &&\n this.state.noArrowParamsConversionAt.includes(\n this.offsetToSourcePos(node.start),\n )\n ) {\n return;\n }\n\n // ensure the `this` param is first, if it exists\n for (let i = 0; i < node.params.length; i++) {\n if (this.isThisParam(node.params[i]) && i > 0) {\n this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]);\n }\n }\n\n super.checkParams(\n node,\n allowDuplicates,\n isArrowFunction,\n strictModeChanged,\n );\n }\n\n parseParenAndDistinguishExpression(canBeArrow: boolean): N.Expression {\n return super.parseParenAndDistinguishExpression(\n canBeArrow &&\n !this.state.noArrowAt.includes(\n this.sourceToOffsetPos(this.state.start),\n ),\n );\n }\n\n parseSubscripts(\n base: N.Expression,\n startLoc: Position,\n noCalls?: boolean | null,\n ): N.Expression {\n if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.state.noArrowAt.includes(startLoc.index)\n ) {\n this.next();\n\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.arguments = super.parseCallExpressionArguments();\n base = this.finishNode(node, \"CallExpression\");\n } else if (\n base.type === \"Identifier\" &&\n base.name === \"async\" &&\n this.match(tt.lt)\n ) {\n const state = this.state.clone();\n const arrow = this.tryParse(\n abort => this.parseAsyncArrowWithTypeParameters(startLoc) || abort(),\n state,\n );\n\n /*:: invariant(arrow.node != null) */\n // @ts-expect-error: refine tryParse typings\n if (!arrow.error && !arrow.aborted) return arrow.node;\n\n const result = this.tryParse(\n () => super.parseSubscripts(base, startLoc, noCalls),\n state,\n );\n\n if (result.node && !result.error) return result.node;\n\n if (arrow.node) {\n this.state = arrow.failState;\n // @ts-expect-error: refine tryParse typings\n return arrow.node;\n }\n\n if (result.node) {\n this.state = result.failState;\n return result.node;\n }\n\n throw arrow.error || result.error;\n }\n\n return super.parseSubscripts(base, startLoc, noCalls);\n }\n\n parseSubscript(\n base: N.Expression,\n\n startLoc: Position,\n noCalls: boolean | undefined | null,\n subscriptState: N.ParseSubscriptState,\n ): N.Expression {\n if (this.match(tt.questionDot) && this.isLookaheadToken_lt()) {\n subscriptState.optionalChainMember = true;\n if (noCalls) {\n subscriptState.stop = true;\n return base;\n }\n this.next();\n const node = this.startNodeAt(startLoc);\n node.callee = base;\n node.typeArguments =\n this.flowParseTypeParameterInstantiationInExpression();\n this.expect(tt.parenL);\n node.arguments = this.parseCallExpressionArguments();\n node.optional = true;\n return this.finishCallExpression(node, /* optional */ true);\n } else if (\n !noCalls &&\n this.shouldParseTypes() &&\n (this.match(tt.lt) ||\n // also handles `new C<`\n this.match(tt.bitShiftL))\n ) {\n const node = this.startNodeAt<\n N.OptionalCallExpression | N.CallExpression\n >(startLoc);\n node.callee = base;\n\n const result = this.tryParse(() => {\n node.typeArguments =\n this.flowParseTypeParameterInstantiationCallOrNew();\n this.expect(tt.parenL);\n node.arguments = super.parseCallExpressionArguments();\n if (subscriptState.optionalChainMember) {\n (node as Undone).optional = false;\n }\n return this.finishCallExpression(\n node,\n subscriptState.optionalChainMember,\n );\n });\n\n if (result.node) {\n if (result.error) this.state = result.failState;\n return result.node;\n }\n }\n\n return super.parseSubscript(\n base,\n\n startLoc,\n noCalls,\n subscriptState,\n );\n }\n\n parseNewCallee(node: N.NewExpression): void {\n super.parseNewCallee(node);\n\n let targs = null;\n if (this.shouldParseTypes() && this.match(tt.lt)) {\n targs = this.tryParse(() =>\n this.flowParseTypeParameterInstantiationCallOrNew(),\n ).node;\n }\n node.typeArguments = targs;\n }\n\n parseAsyncArrowWithTypeParameters(\n startLoc: Position,\n ): N.ArrowFunctionExpression | undefined | null {\n const node = this.startNodeAt(startLoc);\n this.parseFunctionParams(node, false);\n if (!this.parseArrow(node)) return;\n return super.parseArrowExpression(\n node,\n /* params */ undefined,\n /* isAsync */ true,\n );\n }\n\n readToken_mult_modulo(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.asterisk &&\n next === charCodes.slash &&\n this.state.hasFlowComment\n ) {\n this.state.hasFlowComment = false;\n this.state.pos += 2;\n this.nextToken();\n return;\n }\n\n super.readToken_mult_modulo(code);\n }\n\n readToken_pipe_amp(code: number): void {\n const next = this.input.charCodeAt(this.state.pos + 1);\n if (\n code === charCodes.verticalBar &&\n next === charCodes.rightCurlyBrace\n ) {\n // '|}'\n this.finishOp(tt.braceBarR, 2);\n return;\n }\n\n super.readToken_pipe_amp(code);\n }\n\n parseTopLevel(file: N.File, program: N.Program): N.File {\n const fileNode = super.parseTopLevel(file, program);\n if (this.state.hasFlowComment) {\n this.raise(\n FlowErrors.UnterminatedFlowComment,\n this.state.curPosition(),\n );\n }\n return fileNode;\n }\n\n skipBlockComment(): N.CommentBlock | undefined {\n if (this.hasPlugin(\"flowComments\") && this.skipFlowComment()) {\n if (this.state.hasFlowComment) {\n throw this.raise(FlowErrors.NestedFlowComment, this.state.startLoc);\n }\n this.hasFlowCommentCompletion();\n const commentSkip = this.skipFlowComment();\n if (commentSkip) {\n this.state.pos += commentSkip;\n this.state.hasFlowComment = true;\n }\n return;\n }\n\n return super.skipBlockComment(this.state.hasFlowComment ? \"*-/\" : \"*/\");\n }\n\n skipFlowComment(): number | false {\n const { pos } = this.state;\n let shiftToFirstNonWhiteSpace = 2;\n while (\n [charCodes.space, charCodes.tab].includes(\n // @ts-expect-error testing whether a number is included\n this.input.charCodeAt(pos + shiftToFirstNonWhiteSpace),\n )\n ) {\n shiftToFirstNonWhiteSpace++;\n }\n\n const ch2 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos);\n const ch3 = this.input.charCodeAt(shiftToFirstNonWhiteSpace + pos + 1);\n\n if (ch2 === charCodes.colon && ch3 === charCodes.colon) {\n return shiftToFirstNonWhiteSpace + 2; // check for /*::\n }\n if (\n this.input.slice(\n shiftToFirstNonWhiteSpace + pos,\n shiftToFirstNonWhiteSpace + pos + 12,\n ) === \"flow-include\"\n ) {\n return shiftToFirstNonWhiteSpace + 12; // check for /*flow-include\n }\n if (ch2 === charCodes.colon && ch3 !== charCodes.colon) {\n return shiftToFirstNonWhiteSpace; // check for /*:, advance up to :\n }\n return false;\n }\n\n hasFlowCommentCompletion(): void {\n const end = this.input.indexOf(\"*/\", this.state.pos);\n if (end === -1) {\n throw this.raise(Errors.UnterminatedComment, this.state.curPosition());\n }\n }\n\n // Flow enum parsing\n\n flowEnumErrorBooleanMemberNotInitialized(\n loc: Position,\n {\n enumName,\n memberName,\n }: {\n enumName: string;\n memberName: string;\n },\n ): void {\n this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, {\n memberName,\n enumName,\n });\n }\n\n flowEnumErrorInvalidMemberInitializer(\n loc: Position,\n enumContext: EnumContext,\n ) {\n return this.raise(\n !enumContext.explicitType\n ? FlowErrors.EnumInvalidMemberInitializerUnknownType\n : enumContext.explicitType === \"symbol\"\n ? FlowErrors.EnumInvalidMemberInitializerSymbolType\n : FlowErrors.EnumInvalidMemberInitializerPrimaryType,\n loc,\n enumContext,\n );\n }\n\n flowEnumErrorNumberMemberNotInitialized(\n loc: Position,\n details: {\n enumName: string;\n memberName: string;\n },\n ): void {\n this.raise(FlowErrors.EnumNumberMemberNotInitialized, loc, details);\n }\n\n flowEnumErrorStringMemberInconsistentlyInitialized(\n node: N.Node,\n details: {\n enumName: string;\n },\n ): void {\n this.raise(\n FlowErrors.EnumStringMemberInconsistentlyInitialized,\n node,\n details,\n );\n }\n\n flowEnumMemberInit(): EnumMemberInit {\n const startLoc = this.state.startLoc;\n const endOfInit = () => this.match(tt.comma) || this.match(tt.braceR);\n switch (this.state.type) {\n case tt.num: {\n const literal = this.parseNumericLiteral(this.state.value);\n if (endOfInit()) {\n return { type: \"number\", loc: literal.loc.start, value: literal };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n case tt.string: {\n const literal = this.parseStringLiteral(this.state.value);\n if (endOfInit()) {\n return { type: \"string\", loc: literal.loc.start, value: literal };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n case tt._true:\n case tt._false: {\n const literal = this.parseBooleanLiteral(this.match(tt._true));\n if (endOfInit()) {\n return {\n type: \"boolean\",\n loc: literal.loc.start,\n value: literal,\n };\n }\n return { type: \"invalid\", loc: startLoc };\n }\n default:\n return { type: \"invalid\", loc: startLoc };\n }\n }\n\n flowEnumMemberRaw(): {\n id: N.Identifier;\n init: EnumMemberInit;\n } {\n const loc = this.state.startLoc;\n const id = this.parseIdentifier(true);\n const init = this.eat(tt.eq)\n ? this.flowEnumMemberInit()\n : { type: \"none\" as const, loc };\n return { id, init };\n }\n\n flowEnumCheckExplicitTypeMismatch(\n loc: Position,\n context: EnumContext,\n expectedType: EnumExplicitType,\n ): void {\n const { explicitType } = context;\n if (explicitType === null) {\n return;\n }\n if (explicitType !== expectedType) {\n this.flowEnumErrorInvalidMemberInitializer(loc, context);\n }\n }\n\n flowEnumMembers({\n enumName,\n explicitType,\n }: {\n enumName: string;\n explicitType: EnumExplicitType;\n }): {\n members: {\n booleanMembers: Extract<\n N.FlowEnumMember,\n { type: \"EnumBooleanMember\" }\n >[];\n numberMembers: Extract<\n N.FlowEnumMember,\n { type: \"EnumNumberMember\" }\n >[];\n stringMembers: Extract<\n N.FlowEnumMember,\n { type: \"EnumStringMember\" }\n >[];\n defaultedMembers: Extract<\n N.FlowEnumMember,\n { type: \"EnumDefaultedMember\" }\n >[];\n };\n hasUnknownMembers: boolean;\n } {\n const seenNames = new Set();\n const members = {\n // @ts-expect-error: migrate to Babel types\n booleanMembers: [],\n // @ts-expect-error: migrate to Babel types\n numberMembers: [],\n // @ts-expect-error: migrate to Babel types\n stringMembers: [],\n // @ts-expect-error: migrate to Babel types\n defaultedMembers: [],\n };\n let hasUnknownMembers = false;\n while (!this.match(tt.braceR)) {\n if (this.eat(tt.ellipsis)) {\n hasUnknownMembers = true;\n break;\n }\n const memberNode = this.startNode();\n const { id, init } = this.flowEnumMemberRaw();\n const memberName = id.name;\n if (memberName === \"\") {\n continue;\n }\n if (/^[a-z]/.test(memberName)) {\n this.raise(FlowErrors.EnumInvalidMemberName, id, {\n memberName,\n suggestion: memberName[0].toUpperCase() + memberName.slice(1),\n enumName,\n });\n }\n if (seenNames.has(memberName)) {\n this.raise(FlowErrors.EnumDuplicateMemberName, id, {\n memberName,\n enumName,\n });\n }\n seenNames.add(memberName);\n const context = { enumName, explicitType, memberName };\n memberNode.id = id;\n switch (init.type) {\n case \"boolean\": {\n this.flowEnumCheckExplicitTypeMismatch(\n init.loc,\n context,\n \"boolean\",\n );\n memberNode.init = init.value;\n members.booleanMembers.push(\n this.finishNode(memberNode, \"EnumBooleanMember\"),\n );\n break;\n }\n case \"number\": {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"number\");\n memberNode.init = init.value;\n members.numberMembers.push(\n this.finishNode(memberNode, \"EnumNumberMember\"),\n );\n break;\n }\n case \"string\": {\n this.flowEnumCheckExplicitTypeMismatch(init.loc, context, \"string\");\n memberNode.init = init.value;\n members.stringMembers.push(\n this.finishNode(memberNode, \"EnumStringMember\"),\n );\n break;\n }\n case \"invalid\": {\n throw this.flowEnumErrorInvalidMemberInitializer(init.loc, context);\n }\n case \"none\": {\n switch (explicitType) {\n case \"boolean\":\n this.flowEnumErrorBooleanMemberNotInitialized(\n init.loc,\n context,\n );\n break;\n case \"number\":\n this.flowEnumErrorNumberMemberNotInitialized(init.loc, context);\n break;\n default:\n members.defaultedMembers.push(\n this.finishNode(memberNode, \"EnumDefaultedMember\"),\n );\n }\n }\n }\n\n if (!this.match(tt.braceR)) {\n this.expect(tt.comma);\n }\n }\n return { members, hasUnknownMembers };\n }\n\n flowEnumStringMembers(\n initializedMembers: Array,\n defaultedMembers: Array,\n {\n enumName,\n }: {\n enumName: string;\n },\n ): Array {\n if (initializedMembers.length === 0) {\n return defaultedMembers;\n } else if (defaultedMembers.length === 0) {\n return initializedMembers;\n } else if (defaultedMembers.length > initializedMembers.length) {\n for (const member of initializedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitialized(member, {\n enumName,\n });\n }\n return defaultedMembers;\n } else {\n for (const member of defaultedMembers) {\n this.flowEnumErrorStringMemberInconsistentlyInitialized(member, {\n enumName,\n });\n }\n return initializedMembers;\n }\n }\n\n flowEnumParseExplicitType({\n enumName,\n }: {\n enumName: string;\n }): EnumExplicitType {\n if (!this.eatContextual(tt._of)) return null;\n\n if (!tokenIsIdentifier(this.state.type)) {\n throw this.raise(\n FlowErrors.EnumInvalidExplicitTypeUnknownSupplied,\n this.state.startLoc,\n {\n enumName,\n },\n );\n }\n\n const { value } = this.state;\n this.next();\n\n if (\n value !== \"boolean\" &&\n value !== \"number\" &&\n value !== \"string\" &&\n value !== \"symbol\"\n ) {\n this.raise(FlowErrors.EnumInvalidExplicitType, this.state.startLoc, {\n enumName,\n invalidEnumType: value,\n });\n }\n\n return value;\n }\n\n flowEnumBody(node: Undone, id: N.Identifier): N.Node {\n const enumName = id.name;\n const nameLoc = id.loc.start;\n const explicitType = this.flowEnumParseExplicitType({ enumName });\n this.expect(tt.braceL);\n const { members, hasUnknownMembers } = this.flowEnumMembers({\n enumName,\n explicitType,\n });\n node.hasUnknownMembers = hasUnknownMembers;\n\n switch (explicitType) {\n case \"boolean\":\n node.explicitType = true;\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n case \"number\":\n node.explicitType = true;\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n case \"string\":\n node.explicitType = true;\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n case \"symbol\":\n node.members = members.defaultedMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumSymbolBody\");\n default: {\n // `explicitType` is `null`\n const empty = () => {\n node.members = [];\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n };\n node.explicitType = false;\n\n const boolsLen = members.booleanMembers.length;\n const numsLen = members.numberMembers.length;\n const strsLen = members.stringMembers.length;\n const defaultedLen = members.defaultedMembers.length;\n\n if (!boolsLen && !numsLen && !strsLen && !defaultedLen) {\n return empty();\n } else if (!boolsLen && !numsLen) {\n node.members = this.flowEnumStringMembers(\n members.stringMembers,\n members.defaultedMembers,\n { enumName },\n );\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumStringBody\");\n } else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorBooleanMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.booleanMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumBooleanBody\");\n } else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {\n for (const member of members.defaultedMembers) {\n this.flowEnumErrorNumberMemberNotInitialized(member.loc.start, {\n enumName,\n memberName: member.id.name,\n });\n }\n node.members = members.numberMembers;\n this.expect(tt.braceR);\n return this.finishNode(node, \"EnumNumberBody\");\n } else {\n this.raise(FlowErrors.EnumInconsistentMemberValues, nameLoc, {\n enumName,\n });\n return empty();\n }\n }\n }\n }\n\n flowParseEnumDeclaration(\n node: Undone,\n ): N.FlowEnumDeclaration {\n const id = this.parseIdentifier();\n node.id = id;\n node.body = this.flowEnumBody(this.startNode(), id);\n return this.finishNode(node, \"EnumDeclaration\");\n }\n\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement {\n if (this.shouldParseTypes()) {\n if (this.match(tt.lt) || this.match(tt.bitShiftL)) {\n node.typeArguments =\n this.flowParseTypeParameterInstantiationInExpression();\n }\n }\n\n return super.jsxParseOpeningElementAfterName(node);\n }\n\n // check if the next token is a tt.lt\n isLookaheadToken_lt(): boolean {\n const next = this.nextTokenStart();\n if (this.input.charCodeAt(next) === charCodes.lessThan) {\n const afterNext = this.input.charCodeAt(next + 1);\n return (\n afterNext !== charCodes.lessThan && afterNext !== charCodes.equalsTo\n );\n }\n return false;\n }\n\n // used after we have finished parsing types\n reScan_lt_gt() {\n const { type } = this.state;\n if (type === tt.lt) {\n this.state.pos -= 1;\n this.readToken_lt();\n } else if (type === tt.gt) {\n this.state.pos -= 1;\n this.readToken_gt();\n }\n }\n\n reScan_lt() {\n const { type } = this.state;\n if (type === tt.bitShiftL) {\n this.state.pos -= 2;\n this.finishOp(tt.lt, 1);\n return tt.lt;\n }\n return type;\n }\n\n maybeUnwrapTypeCastExpression(node: N.Node) {\n return node.type === \"TypeCastExpression\" ? node.expression : node;\n }\n };\n","const entities: {\n __proto__: null;\n [name: string]: string;\n} = {\n __proto__: null,\n quot: \"\\u0022\",\n amp: \"&\",\n apos: \"\\u0027\",\n lt: \"<\",\n gt: \">\",\n nbsp: \"\\u00A0\",\n iexcl: \"\\u00A1\",\n cent: \"\\u00A2\",\n pound: \"\\u00A3\",\n curren: \"\\u00A4\",\n yen: \"\\u00A5\",\n brvbar: \"\\u00A6\",\n sect: \"\\u00A7\",\n uml: \"\\u00A8\",\n copy: \"\\u00A9\",\n ordf: \"\\u00AA\",\n laquo: \"\\u00AB\",\n not: \"\\u00AC\",\n shy: \"\\u00AD\",\n reg: \"\\u00AE\",\n macr: \"\\u00AF\",\n deg: \"\\u00B0\",\n plusmn: \"\\u00B1\",\n sup2: \"\\u00B2\",\n sup3: \"\\u00B3\",\n acute: \"\\u00B4\",\n micro: \"\\u00B5\",\n para: \"\\u00B6\",\n middot: \"\\u00B7\",\n cedil: \"\\u00B8\",\n sup1: \"\\u00B9\",\n ordm: \"\\u00BA\",\n raquo: \"\\u00BB\",\n frac14: \"\\u00BC\",\n frac12: \"\\u00BD\",\n frac34: \"\\u00BE\",\n iquest: \"\\u00BF\",\n Agrave: \"\\u00C0\",\n Aacute: \"\\u00C1\",\n Acirc: \"\\u00C2\",\n Atilde: \"\\u00C3\",\n Auml: \"\\u00C4\",\n Aring: \"\\u00C5\",\n AElig: \"\\u00C6\",\n Ccedil: \"\\u00C7\",\n Egrave: \"\\u00C8\",\n Eacute: \"\\u00C9\",\n Ecirc: \"\\u00CA\",\n Euml: \"\\u00CB\",\n Igrave: \"\\u00CC\",\n Iacute: \"\\u00CD\",\n Icirc: \"\\u00CE\",\n Iuml: \"\\u00CF\",\n ETH: \"\\u00D0\",\n Ntilde: \"\\u00D1\",\n Ograve: \"\\u00D2\",\n Oacute: \"\\u00D3\",\n Ocirc: \"\\u00D4\",\n Otilde: \"\\u00D5\",\n Ouml: \"\\u00D6\",\n times: \"\\u00D7\",\n Oslash: \"\\u00D8\",\n Ugrave: \"\\u00D9\",\n Uacute: \"\\u00DA\",\n Ucirc: \"\\u00DB\",\n Uuml: \"\\u00DC\",\n Yacute: \"\\u00DD\",\n THORN: \"\\u00DE\",\n szlig: \"\\u00DF\",\n agrave: \"\\u00E0\",\n aacute: \"\\u00E1\",\n acirc: \"\\u00E2\",\n atilde: \"\\u00E3\",\n auml: \"\\u00E4\",\n aring: \"\\u00E5\",\n aelig: \"\\u00E6\",\n ccedil: \"\\u00E7\",\n egrave: \"\\u00E8\",\n eacute: \"\\u00E9\",\n ecirc: \"\\u00EA\",\n euml: \"\\u00EB\",\n igrave: \"\\u00EC\",\n iacute: \"\\u00ED\",\n icirc: \"\\u00EE\",\n iuml: \"\\u00EF\",\n eth: \"\\u00F0\",\n ntilde: \"\\u00F1\",\n ograve: \"\\u00F2\",\n oacute: \"\\u00F3\",\n ocirc: \"\\u00F4\",\n otilde: \"\\u00F5\",\n ouml: \"\\u00F6\",\n divide: \"\\u00F7\",\n oslash: \"\\u00F8\",\n ugrave: \"\\u00F9\",\n uacute: \"\\u00FA\",\n ucirc: \"\\u00FB\",\n uuml: \"\\u00FC\",\n yacute: \"\\u00FD\",\n thorn: \"\\u00FE\",\n yuml: \"\\u00FF\",\n OElig: \"\\u0152\",\n oelig: \"\\u0153\",\n Scaron: \"\\u0160\",\n scaron: \"\\u0161\",\n Yuml: \"\\u0178\",\n fnof: \"\\u0192\",\n circ: \"\\u02C6\",\n tilde: \"\\u02DC\",\n Alpha: \"\\u0391\",\n Beta: \"\\u0392\",\n Gamma: \"\\u0393\",\n Delta: \"\\u0394\",\n Epsilon: \"\\u0395\",\n Zeta: \"\\u0396\",\n Eta: \"\\u0397\",\n Theta: \"\\u0398\",\n Iota: \"\\u0399\",\n Kappa: \"\\u039A\",\n Lambda: \"\\u039B\",\n Mu: \"\\u039C\",\n Nu: \"\\u039D\",\n Xi: \"\\u039E\",\n Omicron: \"\\u039F\",\n Pi: \"\\u03A0\",\n Rho: \"\\u03A1\",\n Sigma: \"\\u03A3\",\n Tau: \"\\u03A4\",\n Upsilon: \"\\u03A5\",\n Phi: \"\\u03A6\",\n Chi: \"\\u03A7\",\n Psi: \"\\u03A8\",\n Omega: \"\\u03A9\",\n alpha: \"\\u03B1\",\n beta: \"\\u03B2\",\n gamma: \"\\u03B3\",\n delta: \"\\u03B4\",\n epsilon: \"\\u03B5\",\n zeta: \"\\u03B6\",\n eta: \"\\u03B7\",\n theta: \"\\u03B8\",\n iota: \"\\u03B9\",\n kappa: \"\\u03BA\",\n lambda: \"\\u03BB\",\n mu: \"\\u03BC\",\n nu: \"\\u03BD\",\n xi: \"\\u03BE\",\n omicron: \"\\u03BF\",\n pi: \"\\u03C0\",\n rho: \"\\u03C1\",\n sigmaf: \"\\u03C2\",\n sigma: \"\\u03C3\",\n tau: \"\\u03C4\",\n upsilon: \"\\u03C5\",\n phi: \"\\u03C6\",\n chi: \"\\u03C7\",\n psi: \"\\u03C8\",\n omega: \"\\u03C9\",\n thetasym: \"\\u03D1\",\n upsih: \"\\u03D2\",\n piv: \"\\u03D6\",\n ensp: \"\\u2002\",\n emsp: \"\\u2003\",\n thinsp: \"\\u2009\",\n zwnj: \"\\u200C\",\n zwj: \"\\u200D\",\n lrm: \"\\u200E\",\n rlm: \"\\u200F\",\n ndash: \"\\u2013\",\n mdash: \"\\u2014\",\n lsquo: \"\\u2018\",\n rsquo: \"\\u2019\",\n sbquo: \"\\u201A\",\n ldquo: \"\\u201C\",\n rdquo: \"\\u201D\",\n bdquo: \"\\u201E\",\n dagger: \"\\u2020\",\n Dagger: \"\\u2021\",\n bull: \"\\u2022\",\n hellip: \"\\u2026\",\n permil: \"\\u2030\",\n prime: \"\\u2032\",\n Prime: \"\\u2033\",\n lsaquo: \"\\u2039\",\n rsaquo: \"\\u203A\",\n oline: \"\\u203E\",\n frasl: \"\\u2044\",\n euro: \"\\u20AC\",\n image: \"\\u2111\",\n weierp: \"\\u2118\",\n real: \"\\u211C\",\n trade: \"\\u2122\",\n alefsym: \"\\u2135\",\n larr: \"\\u2190\",\n uarr: \"\\u2191\",\n rarr: \"\\u2192\",\n darr: \"\\u2193\",\n harr: \"\\u2194\",\n crarr: \"\\u21B5\",\n lArr: \"\\u21D0\",\n uArr: \"\\u21D1\",\n rArr: \"\\u21D2\",\n dArr: \"\\u21D3\",\n hArr: \"\\u21D4\",\n forall: \"\\u2200\",\n part: \"\\u2202\",\n exist: \"\\u2203\",\n empty: \"\\u2205\",\n nabla: \"\\u2207\",\n isin: \"\\u2208\",\n notin: \"\\u2209\",\n ni: \"\\u220B\",\n prod: \"\\u220F\",\n sum: \"\\u2211\",\n minus: \"\\u2212\",\n lowast: \"\\u2217\",\n radic: \"\\u221A\",\n prop: \"\\u221D\",\n infin: \"\\u221E\",\n ang: \"\\u2220\",\n and: \"\\u2227\",\n or: \"\\u2228\",\n cap: \"\\u2229\",\n cup: \"\\u222A\",\n int: \"\\u222B\",\n there4: \"\\u2234\",\n sim: \"\\u223C\",\n cong: \"\\u2245\",\n asymp: \"\\u2248\",\n ne: \"\\u2260\",\n equiv: \"\\u2261\",\n le: \"\\u2264\",\n ge: \"\\u2265\",\n sub: \"\\u2282\",\n sup: \"\\u2283\",\n nsub: \"\\u2284\",\n sube: \"\\u2286\",\n supe: \"\\u2287\",\n oplus: \"\\u2295\",\n otimes: \"\\u2297\",\n perp: \"\\u22A5\",\n sdot: \"\\u22C5\",\n lceil: \"\\u2308\",\n rceil: \"\\u2309\",\n lfloor: \"\\u230A\",\n rfloor: \"\\u230B\",\n lang: \"\\u2329\",\n rang: \"\\u232A\",\n loz: \"\\u25CA\",\n spades: \"\\u2660\",\n clubs: \"\\u2663\",\n hearts: \"\\u2665\",\n diams: \"\\u2666\",\n} as const;\nexport default entities;\n","import * as charCodes from \"charcodes\";\n\n// Matches a whole line break (where CRLF is considered a single\n// line break). Used to count lines.\nexport const lineBreak = /\\r\\n|[\\r\\n\\u2028\\u2029]/;\nexport const lineBreakG = new RegExp(lineBreak.source, \"g\");\n\n// https://tc39.github.io/ecma262/#sec-line-terminators\nexport function isNewLine(code: number): boolean {\n switch (code) {\n case charCodes.lineFeed:\n case charCodes.carriageReturn:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return true;\n\n default:\n return false;\n }\n}\n\nexport function hasNewLine(input: string, start: number, end: number): boolean {\n for (let i = start; i < end; i++) {\n if (isNewLine(input.charCodeAt(i))) {\n return true;\n }\n }\n return false;\n}\n\nexport const skipWhiteSpace = /(?:\\s|\\/\\/.*|\\/\\*[^]*?\\*\\/)*/g;\n\nexport const skipWhiteSpaceInLine =\n /(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*/g;\n\n// https://tc39.github.io/ecma262/#sec-white-space\nexport function isWhitespace(code: number): boolean {\n switch (code) {\n case 0x0009: // CHARACTER TABULATION\n case 0x000b: // LINE TABULATION\n case 0x000c: // FORM FEED\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.oghamSpaceMark:\n case 0x2000: // EN QUAD\n case 0x2001: // EM QUAD\n case 0x2002: // EN SPACE\n case 0x2003: // EM SPACE\n case 0x2004: // THREE-PER-EM SPACE\n case 0x2005: // FOUR-PER-EM SPACE\n case 0x2006: // SIX-PER-EM SPACE\n case 0x2007: // FIGURE SPACE\n case 0x2008: // PUNCTUATION SPACE\n case 0x2009: // THIN SPACE\n case 0x200a: // HAIR SPACE\n case 0x202f: // NARROW NO-BREAK SPACE\n case 0x205f: // MEDIUM MATHEMATICAL SPACE\n case 0x3000: // IDEOGRAPHIC SPACE\n case 0xfeff: // ZERO WIDTH NO-BREAK SPACE\n return true;\n\n default:\n return false;\n }\n}\n","import * as charCodes from \"charcodes\";\n\nimport XHTMLEntities from \"./xhtml.ts\";\nimport type Parser from \"../../parser/index.ts\";\nimport type { ExpressionErrors } from \"../../parser/util.ts\";\nimport {\n tokenComesBeforeExpression,\n tokenIsKeyword,\n tokenLabelName,\n type TokenType,\n tt,\n} from \"../../tokenizer/types.ts\";\nimport type { TokContext } from \"../../tokenizer/context.ts\";\nimport { types as tc } from \"../../tokenizer/context.ts\";\nimport type * as N from \"../../types.ts\";\nimport { isIdentifierChar, isIdentifierStart } from \"../../util/identifier.ts\";\nimport type { Position } from \"../../util/location.ts\";\nimport { isNewLine } from \"../../util/whitespace.ts\";\nimport { Errors, ParseErrorEnum } from \"../../parse-error.ts\";\nimport type { Undone } from \"../../parser/node.ts\";\n\n/* eslint sort-keys: \"error\" */\nconst JsxErrors = ParseErrorEnum`jsx`({\n AttributeIsEmpty:\n \"JSX attributes must only be assigned a non-empty expression.\",\n MissingClosingTagElement: ({ openingTagName }: { openingTagName: string }) =>\n `Expected corresponding JSX closing tag for <${openingTagName}>.`,\n MissingClosingTagFragment: \"Expected corresponding JSX closing tag for <>.\",\n UnexpectedSequenceExpression:\n \"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?\",\n // FIXME: Unify with Errors.UnexpectedToken\n UnexpectedToken: ({\n unexpected,\n HTMLEntity,\n }: {\n unexpected: string;\n HTMLEntity: string;\n }) =>\n `Unexpected token \\`${unexpected}\\`. Did you mean \\`${HTMLEntity}\\` or \\`{'${unexpected}'}\\`?`,\n UnsupportedJsxValue:\n \"JSX value should be either an expression or a quoted JSX text.\",\n UnterminatedJsxContent: \"Unterminated JSX contents.\",\n UnwrappedAdjacentJSXElements:\n \"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...>?\",\n});\n\n/* eslint-disable sort-keys */\n\nfunction isFragment(object?: N.JSXTag | null): object is N.JSXFragmentTag {\n return object\n ? object.type === \"JSXOpeningFragment\" ||\n object.type === \"JSXClosingFragment\"\n : false;\n}\n\n// Transforms JSX element name to string.\n\nfunction getQualifiedJSXName(\n object: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression,\n): string {\n if (object.type === \"JSXIdentifier\") {\n return object.name;\n }\n\n if (object.type === \"JSXNamespacedName\") {\n return object.namespace.name + \":\" + object.name.name;\n }\n\n if (object.type === \"JSXMemberExpression\") {\n return (\n getQualifiedJSXName(object.object) +\n \".\" +\n getQualifiedJSXName(object.property)\n );\n }\n\n // istanbul ignore next\n // @ts-expect-error - object is 'never'\n throw new Error(\"Node had unexpected type: \" + object.type);\n}\n\nexport interface IJSXParserMixin {\n jsxParseOpeningElementAfterName(\n node: N.JSXOpeningElement,\n ): N.JSXOpeningElement;\n}\n\nexport type ClassWithMixin<\n T extends new (...args: any) => any,\n M extends object,\n> = T extends new (...args: infer P) => infer I\n ? new (...args: P) => I & M\n : never;\n\nexport default (superClass: typeof Parser) =>\n class JSXParserMixin extends superClass implements Parser, IJSXParserMixin {\n // Reads inline JSX contents token.\n\n jsxReadToken(): void {\n let out = \"\";\n let chunkStart = this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(\n JsxErrors.UnterminatedJsxContent,\n this.state.startLoc,\n );\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n\n switch (ch) {\n case charCodes.lessThan:\n case charCodes.leftCurlyBrace:\n if (this.state.pos === this.state.start) {\n if (ch === charCodes.lessThan && this.state.canStartJSXElement) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagStart);\n } else {\n super.getTokenFromCode(ch);\n }\n return;\n }\n out += this.input.slice(chunkStart, this.state.pos);\n this.finishToken(tt.jsxText, out);\n return;\n\n case charCodes.ampersand:\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n break;\n\n case charCodes.greaterThan:\n case charCodes.rightCurlyBrace:\n if (process.env.BABEL_8_BREAKING) {\n this.raise(JsxErrors.UnexpectedToken, this.state.curPosition(), {\n unexpected: this.input[this.state.pos],\n HTMLEntity:\n ch === charCodes.rightCurlyBrace ? \"}\" : \">\",\n });\n }\n /* falls through */\n\n default:\n if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(true);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n }\n }\n\n jsxReadNewLine(normalizeCRLF: boolean): string {\n const ch = this.input.charCodeAt(this.state.pos);\n let out;\n ++this.state.pos;\n if (\n ch === charCodes.carriageReturn &&\n this.input.charCodeAt(this.state.pos) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n out = normalizeCRLF ? \"\\n\" : \"\\r\\n\";\n } else {\n out = String.fromCharCode(ch);\n }\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n\n return out;\n }\n\n jsxReadString(quote: number): void {\n let out = \"\";\n let chunkStart = ++this.state.pos;\n for (;;) {\n if (this.state.pos >= this.length) {\n throw this.raise(Errors.UnterminatedString, this.state.startLoc);\n }\n\n const ch = this.input.charCodeAt(this.state.pos);\n if (ch === quote) break;\n if (ch === charCodes.ampersand) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadEntity();\n chunkStart = this.state.pos;\n } else if (isNewLine(ch)) {\n out += this.input.slice(chunkStart, this.state.pos);\n out += this.jsxReadNewLine(false);\n chunkStart = this.state.pos;\n } else {\n ++this.state.pos;\n }\n }\n out += this.input.slice(chunkStart, this.state.pos++);\n this.finishToken(tt.string, out);\n }\n\n jsxReadEntity(): string {\n const startPos = ++this.state.pos;\n if (this.codePointAtPos(this.state.pos) === charCodes.numberSign) {\n ++this.state.pos;\n\n let radix = 10;\n if (this.codePointAtPos(this.state.pos) === charCodes.lowercaseX) {\n radix = 16;\n ++this.state.pos;\n }\n\n const codePoint = this.readInt(\n radix,\n /* len */ undefined,\n /* forceLen */ false,\n /* allowNumSeparator */ \"bail\",\n );\n if (\n codePoint !== null &&\n this.codePointAtPos(this.state.pos) === charCodes.semicolon\n ) {\n ++this.state.pos;\n return String.fromCodePoint(codePoint);\n }\n } else {\n let count = 0;\n let semi = false;\n while (\n count++ < 10 &&\n this.state.pos < this.length &&\n !(semi = this.codePointAtPos(this.state.pos) === charCodes.semicolon)\n ) {\n ++this.state.pos;\n }\n\n if (semi) {\n const desc = this.input.slice(startPos, this.state.pos);\n const entity = XHTMLEntities[desc];\n ++this.state.pos;\n\n if (entity) {\n return entity;\n }\n }\n }\n\n // Not a valid entity\n this.state.pos = startPos;\n return \"&\";\n }\n\n // Read a JSX identifier (valid tag or attribute name).\n //\n // Optimized version since JSX identifiers can\"t contain\n // escape characters and so can be read as single slice.\n // Also assumes that first character was already checked\n // by isIdentifierStart in readToken.\n\n jsxReadWord(): void {\n let ch;\n const start = this.state.pos;\n do {\n ch = this.input.charCodeAt(++this.state.pos);\n } while (isIdentifierChar(ch) || ch === charCodes.dash);\n this.finishToken(tt.jsxName, this.input.slice(start, this.state.pos));\n }\n\n // Parse next token as JSX identifier\n\n jsxParseIdentifier(): N.JSXIdentifier {\n const node = this.startNode();\n if (this.match(tt.jsxName)) {\n node.name = this.state.value;\n } else if (tokenIsKeyword(this.state.type)) {\n node.name = tokenLabelName(this.state.type);\n } else {\n this.unexpected();\n }\n this.next();\n return this.finishNode(node, \"JSXIdentifier\");\n }\n\n // Parse namespaced identifier.\n\n jsxParseNamespacedName(): N.JSXNamespacedName | N.JSXIdentifier {\n const startLoc = this.state.startLoc;\n const name = this.jsxParseIdentifier();\n if (!this.eat(tt.colon)) return name;\n\n const node = this.startNodeAt(startLoc);\n node.namespace = name;\n node.name = this.jsxParseIdentifier();\n return this.finishNode(node, \"JSXNamespacedName\");\n }\n\n // Parses element name in any form - namespaced, member\n // or single identifier.\n\n jsxParseElementName():\n | N.JSXIdentifier\n | N.JSXNamespacedName\n | N.JSXMemberExpression {\n const startLoc = this.state.startLoc;\n let node: N.JSXIdentifier | N.JSXNamespacedName | N.JSXMemberExpression =\n this.jsxParseNamespacedName();\n if (node.type === \"JSXNamespacedName\") {\n return node;\n }\n while (this.eat(tt.dot)) {\n const newNode = this.startNodeAt(startLoc);\n newNode.object = node;\n newNode.property = this.jsxParseIdentifier();\n node = this.finishNode(newNode, \"JSXMemberExpression\");\n }\n return node;\n }\n\n // Parses any type of JSX attribute value.\n\n jsxParseAttributeValue():\n | N.JSXExpressionContainer\n | N.JSXElement\n | N.StringLiteral {\n let node;\n switch (this.state.type) {\n case tt.braceL:\n node = this.startNode();\n this.setContext(tc.brace);\n this.next();\n node = this.jsxParseExpressionContainer(node, tc.j_oTag);\n if (node.expression.type === \"JSXEmptyExpression\") {\n this.raise(JsxErrors.AttributeIsEmpty, node);\n }\n return node;\n\n case tt.jsxTagStart:\n case tt.string:\n return this.parseExprAtom() as N.JSXElement | N.StringLiteral;\n\n default:\n throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);\n }\n }\n\n // JSXEmptyExpression is unique type since it doesn't actually parse anything,\n // and so it should start at the end of last read token (left brace) and finish\n // at the beginning of the next one (right brace).\n\n jsxParseEmptyExpression(): N.JSXEmptyExpression {\n const node = this.startNodeAt(this.state.lastTokEndLoc);\n return this.finishNodeAt(node, \"JSXEmptyExpression\", this.state.startLoc);\n }\n\n // Parse JSX spread child\n\n jsxParseSpreadChild(node: Undone): N.JSXSpreadChild {\n this.next(); // ellipsis\n node.expression = this.parseExpression();\n this.setContext(tc.j_expr);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXSpreadChild\");\n }\n\n // Parses JSX expression enclosed into curly brackets.\n\n jsxParseExpressionContainer(\n node: Undone,\n previousContext: TokContext,\n ): N.JSXExpressionContainer {\n if (this.match(tt.braceR)) {\n node.expression = this.jsxParseEmptyExpression();\n } else {\n const expression = this.parseExpression();\n\n if (process.env.BABEL_8_BREAKING) {\n if (\n expression.type === \"SequenceExpression\" &&\n !expression.extra?.parenthesized\n ) {\n this.raise(\n JsxErrors.UnexpectedSequenceExpression,\n expression.expressions[1],\n );\n }\n }\n\n node.expression = expression;\n }\n this.setContext(previousContext);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n\n return this.finishNode(node, \"JSXExpressionContainer\");\n }\n\n // Parses following JSX attribute name-value pair.\n\n jsxParseAttribute(): N.JSXAttribute | N.JSXSpreadAttribute {\n const node = this.startNode();\n if (this.match(tt.braceL)) {\n this.setContext(tc.brace);\n this.next();\n this.expect(tt.ellipsis);\n node.argument = this.parseMaybeAssignAllowIn();\n this.setContext(tc.j_oTag);\n this.state.canStartJSXElement = true;\n this.expect(tt.braceR);\n return this.finishNode(node, \"JSXSpreadAttribute\");\n }\n node.name = this.jsxParseNamespacedName();\n node.value = this.eat(tt.eq) ? this.jsxParseAttributeValue() : null;\n return this.finishNode(node, \"JSXAttribute\");\n }\n\n // Parses JSX opening tag starting after \"<\".\n\n jsxParseOpeningElementAt(\n startLoc: Position,\n ): N.JSXOpeningElement | N.JSXOpeningFragment {\n const node = this.startNodeAt(\n startLoc,\n );\n if (this.eat(tt.jsxTagEnd)) {\n return this.finishNode(node, \"JSXOpeningFragment\");\n }\n node.name = this.jsxParseElementName();\n return this.jsxParseOpeningElementAfterName(\n node as Undone,\n );\n }\n\n jsxParseOpeningElementAfterName(\n node: Undone,\n ): N.JSXOpeningElement {\n const attributes: (N.JSXAttribute | N.JSXSpreadAttribute)[] = [];\n while (!this.match(tt.slash) && !this.match(tt.jsxTagEnd)) {\n attributes.push(this.jsxParseAttribute());\n }\n node.attributes = attributes;\n node.selfClosing = this.eat(tt.slash);\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXOpeningElement\");\n }\n\n // Parses JSX closing tag starting after \"\".\n\n jsxParseClosingElementAt(\n startLoc: Position,\n ): N.JSXClosingElement | N.JSXClosingFragment {\n const node = this.startNodeAt(\n startLoc,\n );\n if (this.eat(tt.jsxTagEnd)) {\n return this.finishNode(node, \"JSXClosingFragment\");\n }\n node.name = this.jsxParseElementName();\n this.expect(tt.jsxTagEnd);\n return this.finishNode(node, \"JSXClosingElement\");\n }\n\n // Parses entire JSX element, including it\"s opening tag\n // (starting after \"<\"), attributes, contents and closing tag.\n\n jsxParseElementAt(startLoc: Position): N.JSXElement | N.JSXFragment {\n const node = this.startNodeAt(startLoc);\n const children = [];\n const openingElement = this.jsxParseOpeningElementAt(startLoc);\n let closingElement = null;\n\n if (!openingElement.selfClosing) {\n contents: for (;;) {\n switch (this.state.type) {\n case tt.jsxTagStart:\n startLoc = this.state.startLoc;\n this.next();\n if (this.eat(tt.slash)) {\n closingElement = this.jsxParseClosingElementAt(startLoc);\n break contents;\n }\n children.push(this.jsxParseElementAt(startLoc));\n break;\n\n case tt.jsxText:\n children.push(this.parseLiteral(this.state.value, \"JSXText\"));\n break;\n\n case tt.braceL: {\n const node = this.startNode<\n N.JSXSpreadChild | N.JSXExpressionContainer\n >();\n this.setContext(tc.brace);\n this.next();\n if (this.match(tt.ellipsis)) {\n children.push(this.jsxParseSpreadChild(node));\n } else {\n children.push(\n this.jsxParseExpressionContainer(node, tc.j_expr),\n );\n }\n\n break;\n }\n // istanbul ignore next - should never happen\n default:\n this.unexpected();\n }\n }\n\n if (\n isFragment(openingElement) &&\n !isFragment(closingElement) &&\n closingElement !== null\n ) {\n this.raise(JsxErrors.MissingClosingTagFragment, closingElement);\n } else if (!isFragment(openingElement) && isFragment(closingElement)) {\n this.raise(JsxErrors.MissingClosingTagElement, closingElement, {\n openingTagName: getQualifiedJSXName(openingElement.name),\n });\n } else if (!isFragment(openingElement) && !isFragment(closingElement)) {\n if (\n getQualifiedJSXName(closingElement.name) !==\n getQualifiedJSXName(openingElement.name)\n ) {\n this.raise(JsxErrors.MissingClosingTagElement, closingElement, {\n openingTagName: getQualifiedJSXName(openingElement.name),\n });\n }\n }\n }\n\n if (isFragment(openingElement)) {\n node.openingFragment = openingElement;\n node.closingFragment = closingElement;\n } else {\n node.openingElement = openingElement;\n node.closingElement = closingElement;\n }\n node.children = children;\n if (this.match(tt.lt)) {\n throw this.raise(\n JsxErrors.UnwrappedAdjacentJSXElements,\n this.state.startLoc,\n );\n }\n\n return isFragment(openingElement)\n ? this.finishNode(node, \"JSXFragment\")\n : this.finishNode(node, \"JSXElement\");\n }\n\n // Parses entire JSX element from current position.\n\n jsxParseElement(): N.JSXElement | N.JSXFragment {\n const startLoc = this.state.startLoc;\n this.next();\n return this.jsxParseElementAt(startLoc);\n }\n\n setContext(newContext: TokContext) {\n const { context } = this.state;\n context[context.length - 1] = newContext;\n }\n\n // ==================================\n // Overrides\n // ==================================\n\n parseExprAtom(refExpressionErrors?: ExpressionErrors | null): N.Expression {\n if (this.match(tt.jsxTagStart)) {\n return this.jsxParseElement();\n } else if (\n this.match(tt.lt) &&\n this.input.charCodeAt(this.state.pos) !== charCodes.exclamationMark\n ) {\n // In case we encounter an lt token here it will always be the start of\n // jsx as the lt sign is not allowed in places that expect an expression\n this.replaceToken(tt.jsxTagStart);\n return this.jsxParseElement();\n } else {\n return super.parseExprAtom(refExpressionErrors);\n }\n }\n\n skipSpace() {\n const curContext = this.curContext();\n if (!curContext.preserveSpace) super.skipSpace();\n }\n\n getTokenFromCode(code: number): void {\n const context = this.curContext();\n\n if (context === tc.j_expr) {\n this.jsxReadToken();\n return;\n }\n\n if (context === tc.j_oTag || context === tc.j_cTag) {\n if (isIdentifierStart(code)) {\n this.jsxReadWord();\n return;\n }\n\n if (code === charCodes.greaterThan) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagEnd);\n return;\n }\n\n if (\n (code === charCodes.quotationMark || code === charCodes.apostrophe) &&\n context === tc.j_oTag\n ) {\n this.jsxReadString(code);\n return;\n }\n }\n\n if (\n code === charCodes.lessThan &&\n this.state.canStartJSXElement &&\n this.input.charCodeAt(this.state.pos + 1) !== charCodes.exclamationMark\n ) {\n ++this.state.pos;\n this.finishToken(tt.jsxTagStart);\n return;\n }\n\n super.getTokenFromCode(code);\n }\n\n updateContext(prevType: TokenType): void {\n const { context, type } = this.state;\n if (type === tt.slash && prevType === tt.jsxTagStart) {\n // do not consider JSX expr -> JSX open tag -> ... anymore\n // reconsider as closing tag context\n context.splice(-2, 2, tc.j_cTag);\n this.state.canStartJSXElement = false;\n } else if (type === tt.jsxTagStart) {\n // start opening tag context\n context.push(tc.j_oTag);\n } else if (type === tt.jsxTagEnd) {\n const out = context[context.length - 1];\n if ((out === tc.j_oTag && prevType === tt.slash) || out === tc.j_cTag) {\n context.pop();\n this.state.canStartJSXElement =\n context[context.length - 1] === tc.j_expr;\n } else {\n this.setContext(tc.j_expr);\n this.state.canStartJSXElement = true;\n }\n } else {\n this.state.canStartJSXElement = tokenComesBeforeExpression(type);\n }\n }\n };\n","import type { Position } from \"../../util/location.ts\";\nimport ScopeHandler, { NameType, Scope } from \"../../util/scope.ts\";\nimport { BindingFlag, ScopeFlag } from \"../../util/scopeflags.ts\";\nimport type * as N from \"../../types.ts\";\nimport { Errors } from \"../../parse-error.ts\";\n\nconst enum TsNameType {\n Types = 1 << 0,\n // enums (which are also in .types)\n Enums = 1 << 1,\n // const enums (which are also in .enums and .types)\n ConstEnums = 1 << 2,\n // classes (which are also in .lexical) and interface (which are also in .types)\n Classes = 1 << 3,\n // namespaces and ambient functions (or classes) are too difficult to track,\n // especially without type analysis.\n // We need to track them anyway, to avoid \"X is not defined\" errors\n // when exporting them.\n ExportOnlyBindings = 1 << 4,\n}\n\nclass TypeScriptScope extends Scope {\n tsNames: Map = new Map();\n}\n\n// See https://github.com/babel/babel/pull/9766#discussion_r268920730 for an\n// explanation of how typescript handles scope.\n\nexport default class TypeScriptScopeHandler extends ScopeHandler {\n importsStack: Set[] = [];\n\n createScope(flags: ScopeFlag): TypeScriptScope {\n this.importsStack.push(new Set()); // Always keep the top-level scope for export checks.\n\n return new TypeScriptScope(flags);\n }\n\n enter(flags: ScopeFlag): void {\n if (flags === ScopeFlag.TS_MODULE) {\n this.importsStack.push(new Set());\n }\n\n super.enter(flags);\n }\n\n exit() {\n const flags = super.exit();\n\n if (flags === ScopeFlag.TS_MODULE) {\n this.importsStack.pop();\n }\n\n return flags;\n }\n\n hasImport(name: string, allowShadow?: boolean) {\n const len = this.importsStack.length;\n if (this.importsStack[len - 1].has(name)) {\n return true;\n }\n if (!allowShadow && len > 1) {\n for (let i = 0; i < len - 1; i++) {\n if (this.importsStack[i].has(name)) return true;\n }\n }\n return false;\n }\n\n declareName(name: string, bindingType: BindingFlag, loc: Position) {\n if (bindingType & BindingFlag.FLAG_TS_IMPORT) {\n if (this.hasImport(name, true)) {\n this.parser.raise(Errors.VarRedeclaration, loc, {\n identifierName: name,\n });\n }\n this.importsStack[this.importsStack.length - 1].add(name);\n return;\n }\n\n const scope = this.currentScope();\n let type = scope.tsNames.get(name) || 0;\n\n if (bindingType & BindingFlag.FLAG_TS_EXPORT_ONLY) {\n this.maybeExportDefined(scope, name);\n scope.tsNames.set(name, type | TsNameType.ExportOnlyBindings);\n return;\n }\n\n super.declareName(name, bindingType, loc);\n\n if (bindingType & BindingFlag.KIND_TYPE) {\n if (!(bindingType & BindingFlag.KIND_VALUE)) {\n // \"Value\" bindings have already been registered by the superclass.\n this.checkRedeclarationInScope(scope, name, bindingType, loc);\n this.maybeExportDefined(scope, name);\n }\n type = type | TsNameType.Types;\n }\n if (bindingType & BindingFlag.FLAG_TS_ENUM) {\n type = type | TsNameType.Enums;\n }\n if (bindingType & BindingFlag.FLAG_TS_CONST_ENUM) {\n type = type | TsNameType.ConstEnums;\n }\n if (bindingType & BindingFlag.FLAG_CLASS) {\n type = type | TsNameType.Classes;\n }\n if (type) scope.tsNames.set(name, type);\n }\n\n isRedeclaredInScope(\n scope: TypeScriptScope,\n name: string,\n bindingType: BindingFlag,\n ): boolean {\n const type = scope.tsNames.get(name);\n if ((type & TsNameType.Enums) > 0) {\n if (bindingType & BindingFlag.FLAG_TS_ENUM) {\n // Enums can be merged with other enums if they are both\n // const or both non-const.\n const isConst = !!(bindingType & BindingFlag.FLAG_TS_CONST_ENUM);\n const wasConst = (type & TsNameType.ConstEnums) > 0;\n return isConst !== wasConst;\n }\n return true;\n }\n if (\n bindingType & BindingFlag.FLAG_CLASS &&\n (type & TsNameType.Classes) > 0\n ) {\n if (scope.names.get(name) & NameType.Lexical) {\n // Classes can be merged with interfaces\n return !!(bindingType & BindingFlag.KIND_VALUE);\n } else {\n // Interface can be merged with other classes or interfaces\n return false;\n }\n }\n if (bindingType & BindingFlag.KIND_TYPE && (type & TsNameType.Types) > 0) {\n return true;\n }\n\n return super.isRedeclaredInScope(scope, name, bindingType);\n }\n\n checkLocalExport(id: N.Identifier) {\n const { name } = id;\n\n if (this.hasImport(name)) return;\n\n const len = this.scopeStack.length;\n for (let i = len - 1; i >= 0; i--) {\n const scope = this.scopeStack[i];\n const type = scope.tsNames.get(name);\n if (\n (type & TsNameType.Types) > 0 ||\n (type & TsNameType.ExportOnlyBindings) > 0\n ) {\n return;\n }\n }\n\n super.checkLocalExport(id);\n }\n}\n","// ProductionParameterHandler is a stack fashioned production parameter tracker\n// https://tc39.es/ecma262/#sec-grammar-notation\n// The tracked parameters are defined above.\n//\n// Whenever [+Await]/[+Yield] appears in the right-hand sides of a production,\n// we must enter a new tracking stack. For example when parsing\n//\n// AsyncFunctionDeclaration [Yield, Await]:\n// async [no LineTerminator here] function BindingIdentifier[?Yield, ?Await]\n// ( FormalParameters[~Yield, +Await] ) { AsyncFunctionBody }\n//\n// we must follow such process:\n//\n// 1. parse async keyword\n// 2. parse function keyword\n// 3. parse bindingIdentifier <= inherit current parameters: [?Await]\n// 4. enter new stack with (PARAM_AWAIT)\n// 5. parse formal parameters <= must have [Await] parameter [+Await]\n// 6. parse function body\n// 7. exit current stack\n\nexport const enum ParamKind {\n // Initial Parameter flags\n PARAM = 0b0000,\n // track [Yield] production parameter\n PARAM_YIELD = 0b0001,\n // track [Await] production parameter\n PARAM_AWAIT = 0b0010,\n // track [Return] production parameter\n PARAM_RETURN = 0b0100,\n // track [In] production parameter\n PARAM_IN = 0b1000,\n}\n\n// todo(flow->ts) - check if more granular type can be used,\n// type below is not good because things like PARAM_AWAIT|PARAM_YIELD are not included\n// export type ParamKind =\n// | typeof PARAM\n// | typeof PARAM_AWAIT\n// | typeof PARAM_IN\n// | typeof PARAM_RETURN\n// | typeof PARAM_YIELD;\n\nexport default class ProductionParameterHandler {\n stacks: Array = [];\n enter(flags: ParamKind) {\n this.stacks.push(flags);\n }\n\n exit() {\n this.stacks.pop();\n }\n\n currentFlags(): ParamKind {\n return this.stacks[this.stacks.length - 1];\n }\n\n get hasAwait(): boolean {\n return (this.currentFlags() & ParamKind.PARAM_AWAIT) > 0;\n }\n\n get hasYield(): boolean {\n return (this.currentFlags() & ParamKind.PARAM_YIELD) > 0;\n }\n\n get hasReturn(): boolean {\n return (this.currentFlags() & ParamKind.PARAM_RETURN) > 0;\n }\n\n get hasIn(): boolean {\n return (this.currentFlags() & ParamKind.PARAM_IN) > 0;\n }\n}\n\nexport function functionFlags(\n isAsync: boolean,\n isGenerator: boolean,\n): ParamKind {\n return (\n (isAsync ? ParamKind.PARAM_AWAIT : 0) |\n (isGenerator ? ParamKind.PARAM_YIELD : 0)\n );\n}\n","import type { OptionFlags, Options } from \"../options.ts\";\nimport type State from \"../tokenizer/state.ts\";\nimport type { PluginsMap } from \"./index.ts\";\nimport type ScopeHandler from \"../util/scope.ts\";\nimport type ExpressionScopeHandler from \"../util/expression-scope.ts\";\nimport type ClassScopeHandler from \"../util/class-scope.ts\";\nimport type ProductionParameterHandler from \"../util/production-parameter.ts\";\nimport type {\n ParserPluginWithOptions,\n PluginConfig,\n PluginOptions,\n} from \"../typings.ts\";\nimport type * as N from \"../types.ts\";\n\nexport default class BaseParser {\n // Properties set by constructor in index.js\n declare options: Options;\n declare optionFlags: OptionFlags;\n declare inModule: boolean;\n declare scope: ScopeHandler;\n declare classScope: ClassScopeHandler;\n declare prodParam: ProductionParameterHandler;\n declare expressionScope: ExpressionScopeHandler;\n declare plugins: PluginsMap;\n declare filename: string | undefined | null;\n declare startIndex: number;\n // Names of exports store. `default` is stored as a name for both\n // `export default foo;` and `export { foo as default };`.\n declare exportedIdentifiers: Set;\n sawUnambiguousESM: boolean = false;\n ambiguousScriptDifferentAst: boolean = false;\n\n // Initialized by Tokenizer\n declare state: State;\n // input and length are not in state as they are constant and we do\n // not want to ever copy them, which happens if state gets cloned\n declare input: string;\n declare length: number;\n // Comment store for Program.comments\n declare comments: Array;\n\n sourceToOffsetPos(sourcePos: number) {\n return sourcePos + this.startIndex;\n }\n\n offsetToSourcePos(offsetPos: number) {\n return offsetPos - this.startIndex;\n }\n\n // This method accepts either a string (plugin name) or an array pair\n // (plugin name and options object). If an options object is given,\n // then each value is non-recursively checked for identity with that\n // plugin’s actual option value.\n hasPlugin(pluginConfig: PluginConfig): boolean {\n if (typeof pluginConfig === \"string\") {\n return this.plugins.has(pluginConfig);\n } else {\n const [pluginName, pluginOptions] = pluginConfig;\n if (!this.hasPlugin(pluginName)) {\n return false;\n }\n const actualOptions = this.plugins.get(pluginName);\n for (const key of Object.keys(\n pluginOptions,\n ) as (keyof typeof pluginOptions)[]) {\n if (actualOptions?.[key] !== pluginOptions[key]) {\n return false;\n }\n }\n return true;\n }\n }\n\n getPluginOption<\n PluginName extends ParserPluginWithOptions[0],\n OptionName extends keyof PluginOptions,\n >(plugin: PluginName, name: OptionName) {\n return (this.plugins.get(plugin) as null | PluginOptions)?.[\n name\n ];\n }\n}\n","/*:: declare var invariant; */\n\nimport BaseParser from \"./base.ts\";\nimport type { Comment, Node } from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport type { Undone } from \"./node.ts\";\n\n/**\n * A whitespace token containing comments\n */\nexport type CommentWhitespace = {\n /**\n * the start of the whitespace token.\n */\n start: number;\n /**\n * the end of the whitespace token.\n */\n end: number;\n /**\n * the containing comments\n */\n comments: Array;\n /**\n * the immediately preceding AST node of the whitespace token\n */\n leadingNode: Node | null;\n /**\n * the immediately following AST node of the whitespace token\n */\n trailingNode: Node | null;\n /**\n * the innermost AST node containing the whitespace with minimal size (|end - start|)\n */\n containingNode: Node | null;\n};\n\n/**\n * Merge comments with node's trailingComments or assign comments to be\n * trailingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setTrailingComments(node: Undone, comments: Array) {\n if (node.trailingComments === undefined) {\n node.trailingComments = comments;\n } else {\n node.trailingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's leadingComments or assign comments to be\n * leadingComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nfunction setLeadingComments(node: Undone, comments: Array) {\n if (node.leadingComments === undefined) {\n node.leadingComments = comments;\n } else {\n node.leadingComments.unshift(...comments);\n }\n}\n\n/**\n * Merge comments with node's innerComments or assign comments to be\n * innerComments. New comments will be placed before old comments\n * because the commentStack is enumerated reversely.\n */\nexport function setInnerComments(\n node: Undone,\n comments?: Array,\n) {\n if (node.innerComments === undefined) {\n node.innerComments = comments;\n } else {\n node.innerComments.unshift(...comments);\n }\n}\n\n/**\n * Given node and elements array, if elements has non-null element,\n * merge comments to its trailingComments, otherwise merge comments\n * to node's innerComments\n */\nfunction adjustInnerComments(\n node: Undone,\n elements: Array,\n commentWS: CommentWhitespace,\n) {\n let lastElement = null;\n let i = elements.length;\n while (lastElement === null && i > 0) {\n lastElement = elements[--i];\n }\n if (lastElement === null || lastElement.start > commentWS.start) {\n setInnerComments(node, commentWS.comments);\n } else {\n setTrailingComments(lastElement, commentWS.comments);\n }\n}\n\nexport default class CommentsParser extends BaseParser {\n addComment(comment: Comment): void {\n if (this.filename) comment.loc.filename = this.filename;\n const { commentsLen } = this.state;\n if (this.comments.length !== commentsLen) {\n this.comments.length = commentsLen;\n }\n this.comments.push(comment);\n this.state.commentsLen++;\n }\n\n /**\n * Given a newly created AST node _n_, attach _n_ to a comment whitespace _w_ if applicable\n * {@see {@link CommentWhitespace}}\n */\n processComment(node: Node): void {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n const lastCommentWS = commentStack[i];\n\n if (lastCommentWS.start === node.end) {\n lastCommentWS.leadingNode = node;\n i--;\n }\n\n const { start: nodeStart } = node;\n // invariant: for all 0 <= j <= i, let c = commentStack[j], c must satisfy c.end < node.end\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n if (commentEnd > nodeStart) {\n // by definition of commentWhiteSpace, this implies commentWS.start > nodeStart\n // so node can be a containingNode candidate. At this time we can finalize the comment\n // whitespace, because\n // 1) its leadingNode or trailingNode, if exists, will not change\n // 2) its containingNode have been assigned and will not change because it is the\n // innermost minimal-sized AST node\n commentWS.containingNode = node;\n this.finalizeComment(commentWS);\n commentStack.splice(i, 1);\n } else {\n if (commentEnd === nodeStart) {\n commentWS.trailingNode = node;\n }\n // stop the loop when commentEnd <= nodeStart\n break;\n }\n }\n }\n\n /**\n * Assign the comments of comment whitespaces to related AST nodes.\n * Also adjust innerComments following trailing comma.\n */\n finalizeComment(commentWS: CommentWhitespace) {\n const { comments } = commentWS;\n if (commentWS.leadingNode !== null || commentWS.trailingNode !== null) {\n if (commentWS.leadingNode !== null) {\n setTrailingComments(commentWS.leadingNode, comments);\n }\n if (commentWS.trailingNode !== null) {\n setLeadingComments(commentWS.trailingNode, comments);\n }\n } else {\n /*:: invariant(commentWS.containingNode !== null) */\n const { containingNode: node, start: commentStart } = commentWS;\n if (\n this.input.charCodeAt(this.offsetToSourcePos(commentStart) - 1) ===\n charCodes.comma\n ) {\n // If a commentWhitespace follows a comma and the containingNode allows\n // list structures with trailing comma, merge it to the trailingComment\n // of the last non-null list element\n switch (node.type) {\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n case \"RecordExpression\":\n adjustInnerComments(node, node.properties, commentWS);\n break;\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n adjustInnerComments(node, node.arguments, commentWS);\n break;\n case \"ImportExpression\":\n adjustInnerComments(\n node,\n [node.source, node.options ?? null],\n commentWS,\n );\n break;\n case \"FunctionDeclaration\":\n case \"FunctionExpression\":\n case \"ArrowFunctionExpression\":\n case \"ObjectMethod\":\n case \"ClassMethod\":\n case \"ClassPrivateMethod\":\n adjustInnerComments(node, node.params, commentWS);\n break;\n case \"ArrayExpression\":\n case \"ArrayPattern\":\n case \"TupleExpression\":\n adjustInnerComments(node, node.elements, commentWS);\n break;\n case \"ExportNamedDeclaration\":\n case \"ImportDeclaration\":\n adjustInnerComments(node, node.specifiers, commentWS);\n break;\n case \"TSEnumDeclaration\":\n if (!process.env.BABEL_8_BREAKING) {\n adjustInnerComments(node, node.members, commentWS);\n } else {\n setInnerComments(node, comments);\n }\n break;\n case \"TSEnumBody\":\n adjustInnerComments(node, node.members, commentWS);\n break;\n default: {\n setInnerComments(node, comments);\n }\n }\n } else {\n setInnerComments(node, comments);\n }\n }\n }\n\n /**\n * Drains remaining commentStack and applies finalizeComment\n * to each comment whitespace. Used only in parseExpression\n * where the top level AST node is _not_ Program\n * {@see {@link CommentsParser#finalizeComment}}\n */\n finalizeRemainingComments() {\n const { commentStack } = this.state;\n for (let i = commentStack.length - 1; i >= 0; i--) {\n this.finalizeComment(commentStack[i]);\n }\n this.state.commentStack = [];\n }\n\n /* eslint-disable no-irregular-whitespace */\n /**\n * Reset previous node trailing comments. Used in object / class\n * property parsing. We parse `async`, `static`, `set` and `get`\n * as an identifier but may reinterpret it into an async/static/accessor\n * method later. In this case the identifier is not part of the AST and we\n * should sync the knowledge to commentStacks\n *\n * For example, when parsing\n * ```\n * async /* 1 */ function f() {}\n * ```\n * the comment whitespace `/* 1 */` has leading node Identifier(async). When\n * we see the function token, we create a Function node and mark `/* 1 */` as\n * inner comments. So `/* 1 */` should be detached from the Identifier node.\n *\n * @param node the last finished AST node _before_ current token\n */\n /* eslint-enable no-irregular-whitespace */\n resetPreviousNodeTrailingComments(node: Node) {\n const { commentStack } = this.state;\n const { length } = commentStack;\n if (length === 0) return;\n const commentWS = commentStack[length - 1];\n if (commentWS.leadingNode === node) {\n commentWS.leadingNode = null;\n }\n }\n\n /**\n * Attach a node to the comment whitespaces right before/after\n * the given range.\n *\n * This is used to properly attach comments around parenthesized\n * expressions as leading/trailing comments of the inner expression.\n */\n takeSurroundingComments(node: Node, start: number, end: number) {\n const { commentStack } = this.state;\n const commentStackLength = commentStack.length;\n if (commentStackLength === 0) return;\n let i = commentStackLength - 1;\n\n for (; i >= 0; i--) {\n const commentWS = commentStack[i];\n const commentEnd = commentWS.end;\n const commentStart = commentWS.start;\n\n if (commentStart === end) {\n commentWS.leadingNode = node;\n } else if (commentEnd === start) {\n commentWS.trailingNode = node;\n } else if (commentEnd < start) {\n break;\n }\n }\n }\n}\n","import type { Options } from \"../options.ts\";\nimport type { CommentWhitespace } from \"../parser/comments\";\nimport { Position } from \"../util/location.ts\";\n\nimport { types as ct, type TokContext } from \"./context.ts\";\nimport { tt, type TokenType } from \"./types.ts\";\nimport type { Errors } from \"../parse-error.ts\";\nimport type { ParseError } from \"../parse-error.ts\";\n\nexport type DeferredStrictError =\n | typeof Errors.StrictNumericEscape\n | typeof Errors.StrictOctalLiteral;\n\ntype TopicContextState = {\n // When a topic binding has been currently established,\n // then this is 1. Otherwise, it is 0. This is forwards compatible\n // with a future plugin for multiple lexical topics.\n maxNumOfResolvableTopics: number;\n // When a topic binding has been currently established, and if that binding\n // has been used as a topic reference `#`, then this is 0. Otherwise, it is\n // `null`. This is forwards compatible with a future plugin for multiple\n // lexical topics.\n maxTopicIndex: null | 0;\n};\n\nexport const enum LoopLabelKind {\n Loop = 1,\n Switch = 2,\n}\n\ndeclare const bit: import(\"../../../../scripts/babel-plugin-bit-decorator/types.d.ts\").BitDecorator;\n\nexport default class State {\n @bit.storage flags: number;\n\n @bit accessor strict = false;\n\n startIndex: number;\n curLine: number;\n lineStart: number;\n\n // And, if locations are used, the {line, column} object\n // corresponding to those offsets\n startLoc: Position;\n endLoc: Position;\n\n init({\n strictMode,\n sourceType,\n startIndex,\n startLine,\n startColumn,\n }: Options): void {\n this.strict =\n strictMode === false\n ? false\n : strictMode === true\n ? true\n : sourceType === \"module\";\n\n this.startIndex = startIndex;\n this.curLine = startLine;\n this.lineStart = -startColumn;\n this.startLoc = this.endLoc = new Position(\n startLine,\n startColumn,\n startIndex,\n );\n }\n\n errors: ParseError[] = [];\n\n // Used to signify the start of a potential arrow function\n potentialArrowAt: number = -1;\n\n // Used to signify the start of an expression which looks like a\n // typed arrow function, but it isn't\n // e.g. a ? (b) : c => d\n // ^\n noArrowAt: number[] = [];\n\n // Used to signify the start of an expression whose params, if it looks like\n // an arrow function, shouldn't be converted to assignable nodes.\n // This is used to defer the validation of typed arrow functions inside\n // conditional expressions.\n // e.g. a ? (b) : c => d\n // ^\n noArrowParamsConversionAt: number[] = [];\n\n // Flags to track\n @bit accessor maybeInArrowParameters = false;\n @bit accessor inType = false;\n @bit accessor noAnonFunctionType = false;\n @bit accessor hasFlowComment = false;\n @bit accessor isAmbientContext = false;\n @bit accessor inAbstractClass = false;\n @bit accessor inDisallowConditionalTypesContext = false;\n\n // For the Hack-style pipelines plugin\n topicContext: TopicContextState = {\n maxNumOfResolvableTopics: 0,\n maxTopicIndex: null,\n };\n\n // For the F#-style pipelines plugin\n @bit accessor soloAwait = false;\n @bit accessor inFSharpPipelineDirectBody = false;\n\n // Labels in scope.\n labels: Array<{\n kind: LoopLabelKind;\n name?: string | null;\n statementStart?: number;\n }> = [];\n\n commentsLen = 0;\n // Comment attachment store\n commentStack: Array = [];\n\n // The current position of the tokenizer in the input.\n pos: number = 0;\n\n // Properties of the current token:\n // Its type\n type: TokenType = tt.eof;\n\n // For tokens that include more information than their type, the value\n value: any = null;\n\n // Its start and end offset\n start: number = 0;\n end: number = 0;\n\n // Position information for the previous token\n // this is initialized when generating the second token.\n lastTokEndLoc: Position = null;\n // this is initialized when generating the second token.\n lastTokStartLoc: Position = null;\n\n // The context stack is used to track whether the apostrophe \"`\" starts\n // or ends a string template\n context: Array = [ct.brace];\n\n // Used to track whether a JSX element is allowed to form\n @bit accessor canStartJSXElement = true;\n\n // Used to signal to callers of `readWord1` whether the word\n // contained any escape sequences. This is needed because words with\n // escape sequences must not be interpreted as keywords.\n @bit accessor containsEsc = false;\n\n // Used to track invalid escape sequences in template literals,\n // that must be reported if the template is not tagged.\n firstInvalidTemplateEscapePos: null | Position = null;\n\n @bit accessor hasTopLevelAwait = false;\n\n // This property is used to track the following errors\n // - StrictNumericEscape\n // - StrictOctalLiteral\n //\n // in a literal that occurs prior to/immediately after a \"use strict\" directive.\n\n // todo(JLHwung): set strictErrors to null and avoid recording string errors\n // after a non-directive is parsed\n strictErrors: Map = new Map();\n\n // Tokens length in token store\n tokensLength: number = 0;\n\n /**\n * When we add a new property, we must manually update the `clone` method\n * @see State#clone\n */\n\n curPosition(): Position {\n return new Position(\n this.curLine,\n this.pos - this.lineStart,\n this.pos + this.startIndex,\n );\n }\n\n clone(): State {\n const state = new State();\n state.flags = this.flags;\n state.startIndex = this.startIndex;\n state.curLine = this.curLine;\n state.lineStart = this.lineStart;\n state.startLoc = this.startLoc;\n state.endLoc = this.endLoc;\n state.errors = this.errors.slice();\n state.potentialArrowAt = this.potentialArrowAt;\n state.noArrowAt = this.noArrowAt.slice();\n state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();\n state.topicContext = this.topicContext;\n state.labels = this.labels.slice();\n state.commentsLen = this.commentsLen;\n state.commentStack = this.commentStack.slice();\n state.pos = this.pos;\n state.type = this.type;\n state.value = this.value;\n state.start = this.start;\n state.end = this.end;\n state.lastTokEndLoc = this.lastTokEndLoc;\n state.lastTokStartLoc = this.lastTokStartLoc;\n state.context = this.context.slice();\n state.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos;\n state.strictErrors = this.strictErrors;\n state.tokensLength = this.tokensLength;\n\n return state;\n }\n}\n\nexport type LookaheadState = {\n pos: number;\n value: any;\n type: TokenType;\n start: number;\n end: number;\n context: TokContext[];\n startLoc: Position;\n lastTokEndLoc: Position;\n curLine: number;\n lineStart: number;\n curPosition: State[\"curPosition\"];\n /* Used only in readToken_mult_modulo */\n inType: boolean;\n // These boolean properties are not initialized in createLookaheadState()\n // instead they will only be set by the tokenizer\n containsEsc?: boolean;\n};\n","// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\n\n// The following character codes are forbidden from being\n// an immediate sibling of NumericLiteralSeparator _\nconst forbiddenNumericSeparatorSiblings = {\n decBinOct: new Set([\n charCodes.dot,\n charCodes.uppercaseB,\n charCodes.uppercaseE,\n charCodes.uppercaseO,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseB,\n charCodes.lowercaseE,\n charCodes.lowercaseO,\n ]),\n hex: new Set([\n charCodes.dot,\n charCodes.uppercaseX,\n charCodes.underscore, // multiple separators are not allowed\n charCodes.lowercaseX,\n ]),\n};\n\nconst isAllowedNumericSeparatorSibling = {\n // 0 - 1\n bin: (ch: number) => ch === charCodes.digit0 || ch === charCodes.digit1,\n\n // 0 - 7\n oct: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit7,\n\n // 0 - 9\n dec: (ch: number) => ch >= charCodes.digit0 && ch <= charCodes.digit9,\n\n // 0 - 9, A - F, a - f,\n hex: (ch: number) =>\n (ch >= charCodes.digit0 && ch <= charCodes.digit9) ||\n (ch >= charCodes.uppercaseA && ch <= charCodes.uppercaseF) ||\n (ch >= charCodes.lowercaseA && ch <= charCodes.lowercaseF),\n};\n\nexport type StringContentsErrorHandlers = EscapedCharErrorHandlers & {\n unterminated(\n initialPos: number,\n initialLineStart: number,\n initialCurLine: number,\n ): void;\n};\n\nexport function readStringContents(\n type: \"single\" | \"double\" | \"template\",\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n errors: StringContentsErrorHandlers,\n) {\n const initialPos = pos;\n const initialLineStart = lineStart;\n const initialCurLine = curLine;\n\n let out = \"\";\n let firstInvalidLoc = null;\n let chunkStart = pos;\n const { length } = input;\n for (;;) {\n if (pos >= length) {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n out += input.slice(chunkStart, pos);\n break;\n }\n const ch = input.charCodeAt(pos);\n if (isStringEnd(type, ch, input, pos)) {\n out += input.slice(chunkStart, pos);\n break;\n }\n if (ch === charCodes.backslash) {\n out += input.slice(chunkStart, pos);\n const res = readEscapedChar(\n input,\n pos,\n lineStart,\n curLine,\n type === \"template\",\n errors,\n );\n if (res.ch === null && !firstInvalidLoc) {\n firstInvalidLoc = { pos, lineStart, curLine };\n } else {\n out += res.ch;\n }\n ({ pos, lineStart, curLine } = res);\n chunkStart = pos;\n } else if (\n ch === charCodes.lineSeparator ||\n ch === charCodes.paragraphSeparator\n ) {\n ++pos;\n ++curLine;\n lineStart = pos;\n } else if (ch === charCodes.lineFeed || ch === charCodes.carriageReturn) {\n if (type === \"template\") {\n out += input.slice(chunkStart, pos) + \"\\n\";\n ++pos;\n if (\n ch === charCodes.carriageReturn &&\n input.charCodeAt(pos) === charCodes.lineFeed\n ) {\n ++pos;\n }\n ++curLine;\n chunkStart = lineStart = pos;\n } else {\n errors.unterminated(initialPos, initialLineStart, initialCurLine);\n }\n } else {\n ++pos;\n }\n }\n return process.env.BABEL_8_BREAKING\n ? { pos, str: out, firstInvalidLoc, lineStart, curLine }\n : {\n pos,\n str: out,\n firstInvalidLoc,\n lineStart,\n curLine,\n containsInvalid: !!firstInvalidLoc,\n };\n}\n\nfunction isStringEnd(\n type: \"single\" | \"double\" | \"template\",\n ch: number,\n input: string,\n pos: number,\n) {\n if (type === \"template\") {\n return (\n ch === charCodes.graveAccent ||\n (ch === charCodes.dollarSign &&\n input.charCodeAt(pos + 1) === charCodes.leftCurlyBrace)\n );\n }\n return (\n ch === (type === \"double\" ? charCodes.quotationMark : charCodes.apostrophe)\n );\n}\n\ntype EscapedCharErrorHandlers = HexCharErrorHandlers &\n CodePointErrorHandlers & {\n strictNumericEscape(pos: number, lineStart: number, curLine: number): void;\n };\n\nfunction readEscapedChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n inTemplate: boolean,\n errors: EscapedCharErrorHandlers,\n) {\n const throwOnInvalid = !inTemplate;\n pos++; // skip '\\'\n\n const res = (ch: string | null) => ({ pos, ch, lineStart, curLine });\n\n const ch = input.charCodeAt(pos++);\n switch (ch) {\n case charCodes.lowercaseN:\n return res(\"\\n\");\n case charCodes.lowercaseR:\n return res(\"\\r\");\n case charCodes.lowercaseX: {\n let code;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 2,\n false,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCharCode(code));\n }\n case charCodes.lowercaseU: {\n let code;\n ({ code, pos } = readCodePoint(\n input,\n pos,\n lineStart,\n curLine,\n throwOnInvalid,\n errors,\n ));\n return res(code === null ? null : String.fromCodePoint(code));\n }\n case charCodes.lowercaseT:\n return res(\"\\t\");\n case charCodes.lowercaseB:\n return res(\"\\b\");\n case charCodes.lowercaseV:\n return res(\"\\u000b\");\n case charCodes.lowercaseF:\n return res(\"\\f\");\n case charCodes.carriageReturn:\n if (input.charCodeAt(pos) === charCodes.lineFeed) {\n ++pos;\n }\n // fall through\n case charCodes.lineFeed:\n lineStart = pos;\n ++curLine;\n // fall through\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n return res(\"\");\n case charCodes.digit8:\n case charCodes.digit9:\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(pos - 1, lineStart, curLine);\n }\n // fall through\n default:\n if (ch >= charCodes.digit0 && ch <= charCodes.digit7) {\n const startPos = pos - 1;\n const match = /^[0-7]+/.exec(input.slice(startPos, pos + 2));\n\n let octalStr = match[0];\n\n let octal = parseInt(octalStr, 8);\n if (octal > 255) {\n octalStr = octalStr.slice(0, -1);\n octal = parseInt(octalStr, 8);\n }\n pos += octalStr.length - 1;\n const next = input.charCodeAt(pos);\n if (\n octalStr !== \"0\" ||\n next === charCodes.digit8 ||\n next === charCodes.digit9\n ) {\n if (inTemplate) {\n return res(null);\n } else {\n errors.strictNumericEscape(startPos, lineStart, curLine);\n }\n }\n\n return res(String.fromCharCode(octal));\n }\n\n return res(String.fromCharCode(ch));\n }\n}\n\ntype HexCharErrorHandlers = IntErrorHandlers & {\n invalidEscapeSequence(pos: number, lineStart: number, curLine: number): void;\n};\n\n// Used to read character escape sequences ('\\x', '\\u').\nfunction readHexChar(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n len: number,\n forceLen: boolean,\n throwOnInvalid: boolean,\n errors: HexCharErrorHandlers,\n) {\n const initialPos = pos;\n let n;\n ({ n, pos } = readInt(\n input,\n pos,\n lineStart,\n curLine,\n 16,\n len,\n forceLen,\n false,\n errors,\n /* bailOnError */ !throwOnInvalid,\n ));\n if (n === null) {\n if (throwOnInvalid) {\n errors.invalidEscapeSequence(initialPos, lineStart, curLine);\n } else {\n pos = initialPos - 1;\n }\n }\n return { code: n, pos };\n}\n\nexport type IntErrorHandlers = {\n numericSeparatorInEscapeSequence(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n unexpectedNumericSeparator(\n pos: number,\n lineStart: number,\n curLine: number,\n ): void;\n // It can return \"true\" to indicate that the error was handled\n // and the int parsing should continue.\n invalidDigit(\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n ): boolean;\n};\n\nexport function readInt(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n radix: number,\n len: number | undefined,\n forceLen: boolean,\n allowNumSeparator: boolean | \"bail\",\n errors: IntErrorHandlers,\n bailOnError: boolean,\n) {\n const start = pos;\n const forbiddenSiblings =\n radix === 16\n ? forbiddenNumericSeparatorSiblings.hex\n : forbiddenNumericSeparatorSiblings.decBinOct;\n const isAllowedSibling =\n radix === 16\n ? isAllowedNumericSeparatorSibling.hex\n : radix === 10\n ? isAllowedNumericSeparatorSibling.dec\n : radix === 8\n ? isAllowedNumericSeparatorSibling.oct\n : isAllowedNumericSeparatorSibling.bin;\n\n let invalid = false;\n let total = 0;\n\n for (let i = 0, e = len == null ? Infinity : len; i < e; ++i) {\n const code = input.charCodeAt(pos);\n let val;\n\n if (code === charCodes.underscore && allowNumSeparator !== \"bail\") {\n const prev = input.charCodeAt(pos - 1);\n const next = input.charCodeAt(pos + 1);\n\n if (!allowNumSeparator) {\n if (bailOnError) return { n: null, pos };\n errors.numericSeparatorInEscapeSequence(pos, lineStart, curLine);\n } else if (\n Number.isNaN(next) ||\n !isAllowedSibling(next) ||\n forbiddenSiblings.has(prev) ||\n forbiddenSiblings.has(next)\n ) {\n if (bailOnError) return { n: null, pos };\n errors.unexpectedNumericSeparator(pos, lineStart, curLine);\n }\n\n // Ignore this _ character\n ++pos;\n continue;\n }\n\n if (code >= charCodes.lowercaseA) {\n val = code - charCodes.lowercaseA + charCodes.lineFeed;\n } else if (code >= charCodes.uppercaseA) {\n val = code - charCodes.uppercaseA + charCodes.lineFeed;\n } else if (charCodes.isDigit(code)) {\n val = code - charCodes.digit0; // 0-9\n } else {\n val = Infinity;\n }\n if (val >= radix) {\n // If we found a digit which is too big, errors.invalidDigit can return true to avoid\n // breaking the loop (this is used for error recovery).\n if (val <= 9 && bailOnError) {\n return { n: null, pos };\n } else if (\n val <= 9 &&\n errors.invalidDigit(pos, lineStart, curLine, radix)\n ) {\n val = 0;\n } else if (forceLen) {\n val = 0;\n invalid = true;\n } else {\n break;\n }\n }\n ++pos;\n total = total * radix + val;\n }\n if (pos === start || (len != null && pos - start !== len) || invalid) {\n return { n: null, pos };\n }\n\n return { n: total, pos };\n}\n\nexport type CodePointErrorHandlers = HexCharErrorHandlers & {\n invalidCodePoint(pos: number, lineStart: number, curLine: number): void;\n};\n\nexport function readCodePoint(\n input: string,\n pos: number,\n lineStart: number,\n curLine: number,\n throwOnInvalid: boolean,\n errors: CodePointErrorHandlers,\n) {\n const ch = input.charCodeAt(pos);\n let code;\n\n if (ch === charCodes.leftCurlyBrace) {\n ++pos;\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n input.indexOf(\"}\", pos) - pos,\n true,\n throwOnInvalid,\n errors,\n ));\n ++pos;\n if (code !== null && code > 0x10ffff) {\n if (throwOnInvalid) {\n errors.invalidCodePoint(pos, lineStart, curLine);\n } else {\n return { code: null, pos };\n }\n }\n } else {\n ({ code, pos } = readHexChar(\n input,\n pos,\n lineStart,\n curLine,\n 4,\n false,\n throwOnInvalid,\n errors,\n ));\n }\n return { code, pos };\n}\n","/*:: declare var invariant; */\n\nimport { OptionFlags, type Options } from \"../options.ts\";\nimport {\n Position,\n SourceLocation,\n createPositionWithColumnOffset,\n} from \"../util/location.ts\";\nimport CommentsParser, { type CommentWhitespace } from \"../parser/comments.ts\";\nimport type * as N from \"../types.ts\";\nimport * as charCodes from \"charcodes\";\nimport { isIdentifierStart, isIdentifierChar } from \"../util/identifier.ts\";\nimport {\n tokenIsKeyword,\n tokenLabelName,\n tt,\n keywords as keywordTypes,\n type TokenType,\n} from \"./types.ts\";\nimport type { TokContext } from \"./context.ts\";\nimport {\n Errors,\n type ParseError,\n type ParseErrorConstructor,\n} from \"../parse-error.ts\";\nimport {\n lineBreakG,\n isNewLine,\n isWhitespace,\n skipWhiteSpace,\n skipWhiteSpaceInLine,\n} from \"../util/whitespace.ts\";\nimport State from \"./state.ts\";\nimport type { LookaheadState, DeferredStrictError } from \"./state.ts\";\nimport type { Undone } from \"../parser/node.ts\";\nimport type { Node } from \"../types.ts\";\n\nimport {\n readInt,\n readCodePoint,\n readStringContents,\n type IntErrorHandlers,\n type CodePointErrorHandlers,\n type StringContentsErrorHandlers,\n} from \"@babel/helper-string-parser\";\n\nimport type { Plugin } from \"../typings.ts\";\n\nfunction buildPosition(pos: number, lineStart: number, curLine: number) {\n return new Position(curLine, pos - lineStart, pos);\n}\n\nconst VALID_REGEX_FLAGS = new Set([\n charCodes.lowercaseG,\n charCodes.lowercaseM,\n charCodes.lowercaseS,\n charCodes.lowercaseI,\n charCodes.lowercaseY,\n charCodes.lowercaseU,\n charCodes.lowercaseD,\n charCodes.lowercaseV,\n]);\n\n// Object type used to represent tokens. Note that normally, tokens\n// simply exist as properties on the parser object. This is only\n// used for the onToken callback and the external tokenizer.\n\nexport class Token {\n constructor(state: State) {\n const startIndex = state.startIndex || 0;\n this.type = state.type;\n this.value = state.value;\n this.start = startIndex + state.start;\n this.end = startIndex + state.end;\n this.loc = new SourceLocation(state.startLoc, state.endLoc);\n }\n\n declare type: TokenType;\n declare value: any;\n declare start: number;\n declare end: number;\n declare loc: SourceLocation;\n}\n\n// ## Tokenizer\n\nexport default abstract class Tokenizer extends CommentsParser {\n isLookahead: boolean;\n\n // Token store.\n tokens: Array = [];\n\n constructor(options: Options, input: string) {\n super();\n this.state = new State();\n this.state.init(options);\n this.input = input;\n this.length = input.length;\n this.comments = [];\n this.isLookahead = false;\n }\n\n pushToken(token: Token | N.Comment) {\n // Pop out invalid tokens trapped by try-catch parsing.\n // Those parsing branches are mainly created by typescript and flow plugins.\n this.tokens.length = this.state.tokensLength;\n this.tokens.push(token);\n ++this.state.tokensLength;\n }\n\n // Move to the next token\n\n next(): void {\n this.checkKeywordEscapes();\n if (this.optionFlags & OptionFlags.Tokens) {\n this.pushToken(new Token(this.state));\n }\n\n this.state.lastTokEndLoc = this.state.endLoc;\n this.state.lastTokStartLoc = this.state.startLoc;\n this.nextToken();\n }\n\n eat(type: TokenType): boolean {\n if (this.match(type)) {\n this.next();\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Whether current token matches given type\n */\n match(type: TokenType): boolean {\n return this.state.type === type;\n }\n\n /**\n * Create a LookaheadState from current parser state\n */\n createLookaheadState(state: State): LookaheadState {\n return {\n pos: state.pos,\n value: null,\n type: state.type,\n start: state.start,\n end: state.end,\n context: [this.curContext()],\n inType: state.inType,\n startLoc: state.startLoc,\n lastTokEndLoc: state.lastTokEndLoc,\n curLine: state.curLine,\n lineStart: state.lineStart,\n curPosition: state.curPosition,\n };\n }\n\n /**\n * lookahead peeks the next token, skipping changes to token context and\n * comment stack. For performance it returns a limited LookaheadState\n * instead of full parser state.\n *\n * The { column, line } Loc info is not included in lookahead since such usage\n * is rare. Although it may return other location properties e.g. `curLine` and\n * `lineStart`, these properties are not listed in the LookaheadState interface\n * and thus the returned value is _NOT_ reliable.\n *\n * The tokenizer should make best efforts to avoid using any parser state\n * other than those defined in LookaheadState\n */\n lookahead(): LookaheadState {\n const old = this.state;\n // @ts-expect-error For performance we use a simplified tokenizer state structure\n this.state = this.createLookaheadState(old);\n\n this.isLookahead = true;\n this.nextToken();\n this.isLookahead = false;\n\n const curr = this.state;\n this.state = old;\n return curr;\n }\n\n nextTokenStart(): number {\n return this.nextTokenStartSince(this.state.pos);\n }\n\n nextTokenStartSince(pos: number): number {\n skipWhiteSpace.lastIndex = pos;\n return skipWhiteSpace.test(this.input) ? skipWhiteSpace.lastIndex : pos;\n }\n\n lookaheadCharCode(): number {\n return this.lookaheadCharCodeSince(this.state.pos);\n }\n\n lookaheadCharCodeSince(pos: number): number {\n return this.input.charCodeAt(this.nextTokenStartSince(pos));\n }\n\n /**\n * Similar to nextToken, but it will stop at line break when it is seen before the next token\n *\n * @returns {number} position of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n nextTokenInLineStart(): number {\n return this.nextTokenInLineStartSince(this.state.pos);\n }\n\n nextTokenInLineStartSince(pos: number): number {\n skipWhiteSpaceInLine.lastIndex = pos;\n return skipWhiteSpaceInLine.test(this.input)\n ? skipWhiteSpaceInLine.lastIndex\n : pos;\n }\n\n /**\n * Similar to lookaheadCharCode, but it will return the char code of line break if it is\n * seen before the next token\n *\n * @returns {number} char code of the next token start or line break, whichever is seen first.\n * @memberof Tokenizer\n */\n lookaheadInLineCharCode(): number {\n return this.input.charCodeAt(this.nextTokenInLineStart());\n }\n\n codePointAtPos(pos: number): number {\n // The implementation is based on\n // https://source.chromium.org/chromium/chromium/src/+/master:v8/src/builtins/builtins-string-gen.cc;l=1455;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3;bpv=0;bpt=1\n // We reimplement `codePointAt` because `codePointAt` is a V8 builtin which is not inlined by TurboFan (as of M91)\n // since `input` is mostly ASCII, an inlined `charCodeAt` wins here\n let cp = this.input.charCodeAt(pos);\n if ((cp & 0xfc00) === 0xd800 && ++pos < this.input.length) {\n const trail = this.input.charCodeAt(pos);\n if ((trail & 0xfc00) === 0xdc00) {\n cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);\n }\n }\n return cp;\n }\n\n // Toggle strict mode. Re-reads the next number or string to please\n // pedantic tests (`\"use strict\"; 010;` should fail).\n\n setStrict(strict: boolean): void {\n this.state.strict = strict;\n if (strict) {\n // Throw an error for any string decimal escape found before/immediately\n // after a \"use strict\" directive. Strict mode will be set at parse\n // time for any literals that occur after the next node of the strict\n // directive.\n this.state.strictErrors.forEach(([toParseError, at]) =>\n this.raise(toParseError, at),\n );\n this.state.strictErrors.clear();\n }\n }\n\n curContext(): TokContext {\n return this.state.context[this.state.context.length - 1];\n }\n\n // Read a single token, updating the parser object's token-related properties.\n nextToken(): void {\n this.skipSpace();\n this.state.start = this.state.pos;\n if (!this.isLookahead) this.state.startLoc = this.state.curPosition();\n if (this.state.pos >= this.length) {\n this.finishToken(tt.eof);\n return;\n }\n\n this.getTokenFromCode(this.codePointAtPos(this.state.pos));\n }\n\n // Skips a block comment, whose end is marked by commentEnd.\n // *-/ is used by the Flow plugin, when parsing block comments nested\n // inside Flow comments.\n skipBlockComment(commentEnd: \"*/\" | \"*-/\"): N.CommentBlock | undefined {\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n const start = this.state.pos;\n const end = this.input.indexOf(commentEnd, start + 2);\n if (end === -1) {\n // We have to call this again here because startLoc may not be set...\n // This seems to be for performance reasons:\n // https://github.com/babel/babel/commit/acf2a10899f696a8aaf34df78bf9725b5ea7f2da\n throw this.raise(Errors.UnterminatedComment, this.state.curPosition());\n }\n\n this.state.pos = end + commentEnd.length;\n lineBreakG.lastIndex = start + 2;\n while (lineBreakG.test(this.input) && lineBreakG.lastIndex <= end) {\n ++this.state.curLine;\n this.state.lineStart = lineBreakG.lastIndex;\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n /*:: invariant(startLoc) */\n\n const comment: N.CommentBlock = {\n type: \"CommentBlock\",\n value: this.input.slice(start + 2, end),\n start: this.sourceToOffsetPos(start),\n end: this.sourceToOffsetPos(end + commentEnd.length),\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.optionFlags & OptionFlags.Tokens) this.pushToken(comment);\n return comment;\n }\n\n skipLineComment(startSkip: number): N.CommentLine | undefined {\n const start = this.state.pos;\n let startLoc;\n if (!this.isLookahead) startLoc = this.state.curPosition();\n let ch = this.input.charCodeAt((this.state.pos += startSkip));\n if (this.state.pos < this.length) {\n while (!isNewLine(ch) && ++this.state.pos < this.length) {\n ch = this.input.charCodeAt(this.state.pos);\n }\n }\n\n // If we are doing a lookahead right now we need to advance the position (above code)\n // but we do not want to push the comment to the state.\n if (this.isLookahead) return;\n\n const end = this.state.pos;\n const value = this.input.slice(start + startSkip, end);\n\n const comment: N.CommentLine = {\n type: \"CommentLine\",\n value,\n start: this.sourceToOffsetPos(start),\n end: this.sourceToOffsetPos(end),\n loc: new SourceLocation(startLoc, this.state.curPosition()),\n };\n if (this.optionFlags & OptionFlags.Tokens) this.pushToken(comment);\n return comment;\n }\n\n // Called at the start of the parse and after every token. Skips\n // whitespace and comments, and.\n\n skipSpace(): void {\n const spaceStart = this.state.pos;\n const comments: N.Comment[] =\n this.optionFlags & OptionFlags.AttachComment ? [] : null;\n loop: while (this.state.pos < this.length) {\n const ch = this.input.charCodeAt(this.state.pos);\n switch (ch) {\n case charCodes.space:\n case charCodes.nonBreakingSpace:\n case charCodes.tab:\n ++this.state.pos;\n break;\n case charCodes.carriageReturn:\n if (\n this.input.charCodeAt(this.state.pos + 1) === charCodes.lineFeed\n ) {\n ++this.state.pos;\n }\n // fall through\n case charCodes.lineFeed:\n case charCodes.lineSeparator:\n case charCodes.paragraphSeparator:\n ++this.state.pos;\n ++this.state.curLine;\n this.state.lineStart = this.state.pos;\n break;\n\n case charCodes.slash:\n switch (this.input.charCodeAt(this.state.pos + 1)) {\n case charCodes.asterisk: {\n const comment = this.skipBlockComment(\"*/\");\n if (comment !== undefined) {\n this.addComment(comment);\n comments?.push(comment);\n }\n break;\n }\n\n case charCodes.slash: {\n const comment = this.skipLineComment(2);\n if (comment !== undefined) {\n this.addComment(comment);\n comments?.push(comment);\n }\n break;\n }\n\n default:\n break loop;\n }\n break;\n\n default:\n if (isWhitespace(ch)) {\n ++this.state.pos;\n } else if (\n ch === charCodes.dash &&\n !this.inModule &&\n this.optionFlags & OptionFlags.AnnexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.dash &&\n this.input.charCodeAt(pos + 2) === charCodes.greaterThan &&\n (spaceStart === 0 || this.state.lineStart > spaceStart)\n ) {\n // A `-->` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n comments?.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.optionFlags & OptionFlags.AnnexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // `` line comment\n const comment = this.skipLineComment(3);\n if (comment !== undefined) {\n this.addComment(comment);\n if (this.options.attachComment) comments.push(comment);\n }\n } else {\n break loop;\n }\n } else if (\n ch === charCodes.lessThan &&\n !this.inModule &&\n this.options.annexB\n ) {\n const pos = this.state.pos;\n if (\n this.input.charCodeAt(pos + 1) === charCodes.exclamationMark &&\n this.input.charCodeAt(pos + 2) === charCodes.dash &&\n this.input.charCodeAt(pos + 3) === charCodes.dash\n ) {\n // ``"])
]);
@@ -99,7 +93,10 @@ function processIfBranch(branch, context, disableNestedFragments = false) {
return processChildrenAsStatement(branch, context, needFragmentWrapper);
}
-const ssrTransformFor = compilerDom.createStructuralDirectiveTransform("for", compilerDom.processFor);
+const ssrTransformFor = compilerDom.createStructuralDirectiveTransform(
+ "for",
+ compilerDom.processFor
+);
function ssrProcessFor(node, context, disableNestedFragments = false) {
const needFragmentWrapper = !disableNestedFragments && (node.children.length !== 1 || node.children[0].type !== 1);
const renderLoop = compilerDom.createFunctionExpression(
@@ -140,20 +137,14 @@ const ssrTransformSlotOutlet = (node, context) => {
args.push(`"${context.scopeId}-s"`);
}
let method = SSR_RENDER_SLOT;
- let parent = context.parent;
- if (parent) {
- const children = parent.children;
- if (parent.type === 10) {
- parent = context.grandParent;
- }
- let componentType;
- if (parent.type === 1 && parent.tagType === 1 && ((componentType = compilerDom.resolveComponentType(parent, context, true)) === compilerDom.TRANSITION || componentType === compilerDom.TRANSITION_GROUP) && children.filter((c) => c.type === 1).length === 1) {
- method = SSR_RENDER_SLOT_INNER;
- if (!(context.scopeId && context.slotted !== false)) {
- args.push("null");
- }
- args.push("true");
+ const parent = context.parent;
+ let componentType;
+ if (parent && parent.type === 1 && parent.tagType === 1 && ((componentType = compilerDom.resolveComponentType(parent, context, true)) === compilerDom.TRANSITION || componentType === compilerDom.TRANSITION_GROUP) && parent.children.filter((c) => c.type === 1).length === 1) {
+ method = SSR_RENDER_SLOT_INNER;
+ if (!(context.scopeId && context.slotted !== false)) {
+ args.push("null");
}
+ args.push("true");
}
node.ssrCodegenNode = compilerDom.createCallExpression(context.helper(method), args);
}
@@ -362,28 +353,6 @@ const ssrTransformElement = (node, context) => {
])
];
}
- } else if (directives.length && !node.children.length) {
- const vText = compilerDom.findDir(node, "text");
- if (!vText) {
- const tempId = `_temp${context.temps++}`;
- propsExp.arguments = [
- compilerDom.createAssignmentExpression(
- compilerDom.createSimpleExpression(tempId, false),
- mergedProps
- )
- ];
- rawChildrenMap.set(
- node,
- compilerDom.createConditionalExpression(
- compilerDom.createSimpleExpression(`"textContent" in ${tempId}`, false),
- compilerDom.createCallExpression(context.helper(SSR_INTERPOLATE), [
- compilerDom.createSimpleExpression(`${tempId}.textContent`, false)
- ]),
- compilerDom.createSimpleExpression(`${tempId}.innerHTML ?? ''`, false),
- false
- )
- );
- }
}
if (needTagForRuntime) {
propsExp.arguments.push(`"${node.tag}"`);
@@ -401,10 +370,7 @@ const ssrTransformElement = (node, context) => {
}
if (prop.type === 7) {
if (prop.name === "html" && prop.exp) {
- rawChildrenMap.set(
- node,
- compilerDom.createCompoundExpression([`(`, prop.exp, `) ?? ''`])
- );
+ rawChildrenMap.set(node, prop.exp);
} else if (prop.name === "text" && prop.exp) {
node.children = [compilerDom.createInterpolation(prop.exp, prop.loc)];
} else if (prop.name === "slot") {
@@ -651,13 +617,6 @@ function ssrProcessTransitionGroup(node, context) {
* be patched using the same key map) so we need to account for that here
* by disabling nested fragment wrappers from being generated.
*/
- true,
- /**
- * TransitionGroup filters out comment children at runtime and thus
- * doesn't expect comments to be present during hydration. We need to
- * account for that by disabling the empty comment that is otherwise
- * rendered for a falsy v-if that has no v-else specified. (#6715)
- */
true
);
context.pushStringPart(``);
@@ -672,11 +631,11 @@ function ssrProcessTransitionGroup(node, context) {
context.pushStringPart(` ${scopeId}`);
}
context.pushStringPart(`>`);
- processChildren(node, context, false, true, true);
+ processChildren(node, context, false, true);
context.pushStringPart(`${tag.value.content}>`);
}
} else {
- processChildren(node, context, true, true, true);
+ processChildren(node, context, true, true);
}
}
@@ -994,7 +953,7 @@ function createChildContext(parent, withSlotScopeId = parent.withSlotScopeId) {
withSlotScopeId
);
}
-function processChildren(parent, context, asFragment = false, disableNestedFragments = false, disableComment = false) {
+function processChildren(parent, context, asFragment = false, disableNestedFragments = false) {
if (asFragment) {
context.pushStringPart(``);
}
@@ -1030,9 +989,7 @@ function processChildren(parent, context, asFragment = false, disableNestedFragm
context.pushStringPart(shared.escapeHtml(child.content));
break;
case 3:
- if (!disableComment) {
- context.pushStringPart(``);
- }
+ context.pushStringPart(``);
break;
case 5:
context.pushStringPart(
@@ -1042,7 +999,7 @@ function processChildren(parent, context, asFragment = false, disableNestedFragm
);
break;
case 9:
- ssrProcessIf(child, context, disableNestedFragments, disableComment);
+ ssrProcessIf(child, context, disableNestedFragments);
break;
case 11:
ssrProcessFor(child, context, disableNestedFragments);
@@ -1086,17 +1043,6 @@ const ssrTransformModel = (dir, node, context) => {
);
}
}
- const processSelectChildren = (children) => {
- children.forEach((child) => {
- if (child.type === 1) {
- processOption(child);
- } else if (child.type === 11) {
- processSelectChildren(child.children);
- } else if (child.type === 9) {
- child.branches.forEach((b) => processSelectChildren(b.children));
- }
- });
- };
function processOption(plainNode) {
if (plainNode.tag === "option") {
if (plainNode.props.findIndex((p) => p.name === "selected") === -1) {
@@ -1123,7 +1069,9 @@ const ssrTransformModel = (dir, node, context) => {
);
}
} else if (plainNode.tag === "optgroup") {
- processSelectChildren(plainNode.children);
+ plainNode.children.forEach(
+ (option) => processOption(option)
+ );
}
}
if (node.tagType === 0) {
@@ -1208,7 +1156,11 @@ const ssrTransformModel = (dir, node, context) => {
checkDuplicatedValue();
node.children = [compilerDom.createInterpolation(model, model.loc)];
} else if (node.tag === "select") {
- processSelectChildren(node.children);
+ node.children.forEach((child) => {
+ if (child.type === 1) {
+ processOption(child);
+ }
+ });
} else {
context.onError(
compilerDom.createDOMCompilerError(
@@ -1276,7 +1228,8 @@ const ssrInjectFallthroughAttrs = (node, context) => {
let hasEncounteredIf = false;
for (const c of filterChild(parent)) {
if (c.type === 9 || c.type === 1 && compilerDom.findDir(c, "if")) {
- if (hasEncounteredIf) return;
+ if (hasEncounteredIf)
+ return;
hasEncounteredIf = true;
} else if (
// node before v-if
diff --git a/node_modules/@vue/compiler-ssr/package.json b/node_modules/@vue/compiler-ssr/package.json
index 9dd16f76..b0beb63b 100644
--- a/node_modules/@vue/compiler-ssr/package.json
+++ b/node_modules/@vue/compiler-ssr/package.json
@@ -1,6 +1,6 @@
{
"name": "@vue/compiler-ssr",
- "version": "3.5.18",
+ "version": "3.4.21",
"description": "@vue/compiler-ssr",
"main": "dist/compiler-ssr.cjs.js",
"types": "dist/compiler-ssr.d.ts",
@@ -28,7 +28,7 @@
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-ssr#readme",
"dependencies": {
- "@vue/compiler-dom": "3.5.18",
- "@vue/shared": "3.5.18"
+ "@vue/shared": "3.4.21",
+ "@vue/compiler-dom": "3.4.21"
}
}
\ No newline at end of file
diff --git a/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js b/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js
index 275ad57b..a1799813 100644
--- a/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js
+++ b/node_modules/@vue/server-renderer/dist/server-renderer.cjs.js
@@ -1,5 +1,5 @@
/**
-* @vue/server-renderer v3.5.18
+* @vue/server-renderer v3.5.22
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
@@ -443,7 +443,7 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
(v) => v
);
}
-const classifyRE = /(?:^|[-_])(\w)/g;
+const classifyRE = /(?:^|[-_])\w/g;
const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
function getComponentName(Component, includeInferred = true) {
return shared.isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
diff --git a/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js b/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js
index 0f880b40..1b6cde29 100644
--- a/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js
+++ b/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js
@@ -1,5 +1,5 @@
/**
-* @vue/server-renderer v3.5.18
+* @vue/server-renderer v3.5.22
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
diff --git a/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.js b/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.js
index f6e9881d..e10ab080 100644
--- a/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.js
+++ b/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.js
@@ -1,9 +1,8 @@
/**
-* @vue/server-renderer v3.5.18
+* @vue/server-renderer v3.5.22
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
-/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function makeMap(str) {
const map = /* @__PURE__ */ Object.create(null);
@@ -55,15 +54,15 @@ const isBuiltInDirective = /* @__PURE__ */ makeMap(
);
const cacheStringFunction = (fn) => {
const cache = /* @__PURE__ */ Object.create(null);
- return (str) => {
+ return ((str) => {
const hit = cache[str];
return hit || (cache[str] = fn(str));
- };
+ });
};
-const camelizeRE = /-(\w)/g;
+const camelizeRE = /-\w/g;
const camelize = cacheStringFunction(
(str) => {
- return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
+ return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
}
);
const hyphenateRE = /\B([A-Z])/g;
@@ -1085,7 +1084,7 @@ const arrayInstrumentations = {
join(separator) {
return reactiveReadArray(this).join(separator);
},
- // keys() iterator only reads `length`, no optimisation required
+ // keys() iterator only reads `length`, no optimization required
lastIndexOf(...args) {
return searchProxy(this, "lastIndexOf", args);
},
@@ -1137,7 +1136,7 @@ function iterator(self, method, wrapValue) {
iter._next = iter.next;
iter.next = () => {
const result = iter._next();
- if (result.value) {
+ if (!result.done) {
result.value = wrapValue(result.value);
}
return result;
@@ -1264,7 +1263,8 @@ class BaseReactiveHandler {
return res;
}
if (isRef(res)) {
- return targetIsArray && isIntegerKey(key) ? res : res.value;
+ const value = targetIsArray && isIntegerKey(key) ? res : res.value;
+ return isReadonly2 && isObject(value) ? readonly(value) : value;
}
if (isObject(res)) {
return isReadonly2 ? readonly(res) : reactive(res);
@@ -1286,7 +1286,13 @@ class MutableReactiveHandler extends BaseReactiveHandler {
}
if (!isArray(target) && isRef(oldValue) && !isRef(value)) {
if (isOldValueReadonly) {
- return false;
+ {
+ warn$2(
+ `Set operation on key "${String(key)}" failed: target is readonly.`,
+ target[key]
+ );
+ }
+ return true;
} else {
oldValue.value = value;
return true;
@@ -1431,7 +1437,7 @@ function createInstrumentations(readonly, shallow) {
get size() {
const target = this["__v_raw"];
!readonly && track(toRaw(target), "iterate", ITERATE_KEY);
- return Reflect.get(target, "size", target);
+ return target.size;
},
has(key) {
const target = this["__v_raw"];
@@ -1984,11 +1990,11 @@ function traverse(value, depth = Infinity, seen) {
if (depth <= 0 || !isObject(value) || value["__v_skip"]) {
return value;
}
- seen = seen || /* @__PURE__ */ new Set();
- if (seen.has(value)) {
+ seen = seen || /* @__PURE__ */ new Map();
+ if ((seen.get(value) || 0) >= depth) {
return value;
}
- seen.add(value);
+ seen.set(value, depth);
depth--;
if (isRef(value)) {
traverse(value.value, depth, seen);
@@ -2456,7 +2462,9 @@ function rerender(id, newRender) {
}
instance.renderCache = [];
isHmrUpdating = true;
- instance.update();
+ if (!(instance.job.flags & 8)) {
+ instance.update();
+ }
isHmrUpdating = false;
});
}
@@ -2486,10 +2494,12 @@ function reload(id, newComp) {
dirtyInstances.delete(instance);
} else if (instance.parent) {
queueJob(() => {
- isHmrUpdating = true;
- instance.parent.update();
- isHmrUpdating = false;
- dirtyInstances.delete(instance);
+ if (!(instance.job.flags & 8)) {
+ isHmrUpdating = true;
+ instance.parent.update();
+ isHmrUpdating = false;
+ dirtyInstances.delete(instance);
+ }
});
} else if (instance.appContext.reload) {
instance.appContext.reload();
@@ -2593,7 +2603,6 @@ const devtoolsComponentRemoved = (component) => {
_devtoolsComponentRemoved(component);
}
};
-/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function createDevtoolsComponentHook(hook) {
return (component) => {
@@ -2691,6 +2700,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
const TeleportEndKey = Symbol("_vte");
const isTeleport = (type) => type.__isTeleport;
+const leaveCbKey = Symbol("_leaveCb");
function setTransitionHooks(vnode, hooks) {
if (vnode.shapeFlag & 6 && vnode.component) {
vnode.transition = hooks;
@@ -2709,6 +2719,7 @@ function markAsyncBoundary(instance) {
const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
+const pendingSetRefMap = /* @__PURE__ */ new WeakMap();
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
if (isArray(rawRef)) {
rawRef.forEach(
@@ -2741,7 +2752,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
const setupState = owner.setupState;
const rawSetupState = toRaw(setupState);
- const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
+ const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => {
{
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
warn$1(
@@ -2754,14 +2765,22 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
}
return hasOwn(rawSetupState, key);
};
+ const canSetRef = (ref2) => {
+ return !knownTemplateRefs.has(ref2);
+ };
if (oldRef != null && oldRef !== ref) {
+ invalidatePendingSetRef(oldRawRef);
if (isString(oldRef)) {
refs[oldRef] = null;
if (canSetSetupRef(oldRef)) {
setupState[oldRef] = null;
}
} else if (isRef(oldRef)) {
- oldRef.value = null;
+ if (canSetRef(oldRef)) {
+ oldRef.value = null;
+ }
+ const oldRawRefAtom = oldRawRef;
+ if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
}
}
if (isFunction(ref)) {
@@ -2772,7 +2791,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
if (_isString || _isRef) {
const doSet = () => {
if (rawRef.f) {
- const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : canSetRef(ref) || !rawRef.k ? ref.value : refs[rawRef.k];
if (isUnmount) {
isArray(existing) && remove(existing, refValue);
} else {
@@ -2783,8 +2802,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
setupState[ref] = refs[ref];
}
} else {
- ref.value = [refValue];
- if (rawRef.k) refs[rawRef.k] = ref.value;
+ const newVal = [refValue];
+ if (canSetRef(ref)) {
+ ref.value = newVal;
+ }
+ if (rawRef.k) refs[rawRef.k] = newVal;
}
} else if (!existing.includes(refValue)) {
existing.push(refValue);
@@ -2796,16 +2818,24 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
setupState[ref] = value;
}
} else if (_isRef) {
- ref.value = value;
+ if (canSetRef(ref)) {
+ ref.value = value;
+ }
if (rawRef.k) refs[rawRef.k] = value;
} else {
warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
}
};
if (value) {
- doSet.id = -1;
- queuePostRenderEffect(doSet, parentSuspense);
+ const job = () => {
+ doSet();
+ pendingSetRefMap.delete(rawRef);
+ };
+ job.id = -1;
+ pendingSetRefMap.set(rawRef, job);
+ queuePostRenderEffect(job, parentSuspense);
} else {
+ invalidatePendingSetRef(rawRef);
doSet();
}
} else {
@@ -2813,6 +2843,13 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
}
}
}
+function invalidatePendingSetRef(rawRef) {
+ const pendingSetRef = pendingSetRefMap.get(rawRef);
+ if (pendingSetRef) {
+ pendingSetRef.flags |= 8;
+ pendingSetRefMap.delete(rawRef);
+ }
+}
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
@@ -3066,10 +3103,10 @@ const PublicInstanceProxyHandlers = {
return true;
},
has({
- _: { data, setupState, accessCache, ctx, appContext, propsOptions }
+ _: { data, setupState, accessCache, ctx, appContext, propsOptions, type }
}, key) {
- let normalizedProps;
- return !!accessCache[key] || data !== EMPTY_OBJ && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key);
+ let normalizedProps, cssModules;
+ return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn(normalizedProps, key) || hasOwn(ctx, key) || hasOwn(publicPropertiesMap, key) || hasOwn(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]);
},
defineProperty(target, key, descriptor) {
if (descriptor.get != null) {
@@ -4211,7 +4248,7 @@ function isBoolean(...args) {
return args.some((elem) => elem.toLowerCase() === "boolean");
}
-const isInternalKey = (key) => key === "_" || key === "__" || key === "_ctx" || key === "$stable";
+const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable";
const normalizeSlotValue = (value) => isArray(value) ? value.map(normalizeVNode$1) : [normalizeVNode$1(value)];
const normalizeSlot = (key, rawSlot, ctx) => {
if (rawSlot._n) {
@@ -4265,8 +4302,6 @@ const assignSlots = (slots, children, optimized) => {
const initSlots = (instance, children, optimized) => {
const slots = instance.slots = createInternalObject();
if (instance.vnode.shapeFlag & 32) {
- const cacheIndexes = children.__;
- if (cacheIndexes) def(slots, "__", cacheIndexes, true);
const type = children._;
if (type) {
assignSlots(slots, children, optimized);
@@ -4327,12 +4362,10 @@ function endMeasure(instance, type) {
if (instance.appContext.config.performance && isSupported()) {
const startTag = `vue-${type}-${instance.uid}`;
const endTag = startTag + `:end`;
+ const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`;
perf.mark(endTag);
- perf.measure(
- `<${formatComponentName(instance, instance.type)}> ${type}`,
- startTag,
- endTag
- );
+ perf.measure(measureName, startTag, endTag);
+ perf.clearMeasures(measureName);
perf.clearMarks(startTag);
perf.clearMarks(endTag);
}
@@ -5489,6 +5522,12 @@ function baseCreateRenderer(options, createHydrationFns) {
}
};
const performLeave = () => {
+ if (el._isLeaving) {
+ el[leaveCbKey](
+ true
+ /* cancelled */
+ );
+ }
leave(el, () => {
remove2();
afterLeave && afterLeave();
@@ -5634,27 +5673,12 @@ function baseCreateRenderer(options, createHydrationFns) {
if (instance.type.__hmrId) {
unregisterHMR(instance);
}
- const {
- bum,
- scope,
- job,
- subTree,
- um,
- m,
- a,
- parent,
- slots: { __: slotCacheKeys }
- } = instance;
+ const { bum, scope, job, subTree, um, m, a } = instance;
invalidateMount(m);
invalidateMount(a);
if (bum) {
invokeArrayFns(bum);
}
- if (parent && isArray(slotCacheKeys)) {
- slotCacheKeys.forEach((v) => {
- parent.renderCache[v] = void 0;
- });
- }
scope.stop();
if (job) {
job.flags |= 8;
@@ -5666,12 +5690,6 @@ function baseCreateRenderer(options, createHydrationFns) {
queuePostRenderEffect(() => {
instance.isUnmounted = true;
}, parentSuspense);
- if (parentSuspense && parentSuspense.pendingBranch && !parentSuspense.isUnmounted && instance.asyncDep && !instance.asyncResolved && instance.suspenseId === parentSuspense.pendingId) {
- parentSuspense.deps--;
- if (parentSuspense.deps === 0) {
- parentSuspense.resolve();
- }
- }
{
devtoolsComponentRemoved(instance);
}
@@ -5766,7 +5784,8 @@ function traverseStaticChildren(n1, n2, shallow = false) {
if (!shallow && c2.patchFlag !== -2)
traverseStaticChildren(c1, c2);
}
- if (c2.type === Text) {
+ if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes
+ c2.patchFlag !== -1) {
c2.el = c1.el;
}
if (c2.type === Comment && !c2.el) {
@@ -6046,8 +6065,9 @@ function emit(instance, event, ...rawArgs) {
);
}
}
+const mixinEmitsCache = /* @__PURE__ */ new WeakMap();
function normalizeEmitsOptions(comp, appContext, asMixin = false) {
- const cache = appContext.emitsCache;
+ const cache = asMixin ? mixinEmitsCache : appContext.emitsCache;
const cached = cache.get(comp);
if (cached !== void 0) {
return cached;
@@ -7083,7 +7103,7 @@ function getComponentPublicInstance(instance) {
return instance.proxy;
}
}
-const classifyRE = /(?:^|[-_])(\w)/g;
+const classifyRE = /(?:^|[-_])\w/g;
const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
function getComponentName(Component, includeInferred = true) {
return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
@@ -7125,7 +7145,7 @@ const computed = (getterOrOptions, debugOptions) => {
return c;
};
-const version = "3.5.18";
+const version = "3.5.22";
const warn = warn$1 ;
const _ssrUtils = {
createComponentInstance: createComponentInstance$1,
@@ -7243,7 +7263,7 @@ const vShowHidden = Symbol("_vsh");
const CSS_VAR_TEXT = Symbol("CSS_VAR_TEXT" );
-const displayRE = /(^|;)\s*display\s*:/;
+const displayRE = /(?:^|;)\s*display\s*:/;
function patchStyle(el, prev, next) {
const style = el.style;
const isCssString = isString(next);
@@ -7598,7 +7618,7 @@ let renderer;
function ensureRenderer() {
return renderer || (renderer = createRenderer(rendererOptions));
}
-const createApp = (...args) => {
+const createApp = ((...args) => {
const app = ensureRenderer().createApp(...args);
{
injectNativeTagCheck(app);
@@ -7623,7 +7643,7 @@ const createApp = (...args) => {
return proxy;
};
return app;
-};
+});
function resolveRootNamespace(container) {
if (container instanceof SVGElement) {
return "svg";
diff --git a/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js b/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js
index 31b0b181..a9b86e92 100644
--- a/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js
+++ b/node_modules/@vue/server-renderer/dist/server-renderer.esm-browser.prod.js
@@ -1,5 +1,5 @@
/**
-* @vue/server-renderer v3.5.18
+* @vue/server-renderer v3.5.22
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
-**/let e,t,n,l,r,i,s,o,a,u;function c(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return e=>e in t}let f={},p=[],d=()=>{},h=()=>!1,g=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||97>e.charCodeAt(2)),m=e=>e.startsWith("onUpdate:"),_=Object.assign,y=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},b=Object.prototype.hasOwnProperty,x=(e,t)=>b.call(e,t),S=Array.isArray,w=e=>"[object Map]"===A(e),k=e=>"[object Set]"===A(e),C=e=>"[object Date]"===A(e),T=e=>"function"==typeof e,O=e=>"string"==typeof e,R=e=>"symbol"==typeof e,P=e=>null!==e&&"object"==typeof e,E=e=>(P(e)||T(e))&&T(e.then)&&T(e.catch),M=Object.prototype.toString,A=e=>M.call(e),$=e=>"[object Object]"===A(e),j=e=>O(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,D=c(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),I=e=>{let t=Object.create(null);return n=>t[n]||(t[n]=e(n))},N=/-(\w)/g,F=I(e=>e.replace(N,(e,t)=>t?t.toUpperCase():"")),L=/\B([A-Z])/g,V=I(e=>e.replace(L,"-$1").toLowerCase()),W=I(e=>e.charAt(0).toUpperCase()+e.slice(1)),U=I(e=>e?`on${W(e)}`:""),B=(e,t)=>!Object.is(e,t),H=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:l,value:n})},G=e=>{let t=parseFloat(e);return isNaN(t)?e:t},z=()=>e||(e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function K(e){if(S(e)){let t={};for(let n=0;n{if(e){let n=e.split(Z);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}(l):K(l);if(r)for(let e in r)t[e]=r[e]}return t}if(O(e)||P(e))return e}let J=/;(?![^(]*\))/g,Z=/:([^]+)/,X=/\/\*[^]*?\*\//g;function Q(e){let t="";if(O(e))t=e;else if(S(e))for(let n=0;n/="'\u0009\u000a\u000c\u0020]/,es={},eo={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"};function ea(e){if(null==e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t}let eu=/["'&<>]/;function ec(e){let t,n,l=""+e,r=eu.exec(l);if(!r)return l;let i="",s=0;for(n=r.index;n||--!>|ep(e,t))}let eh=e=>!!(e&&!0===e.__v_isRef),ev=e=>O(e)?e:null==e?"":S(e)||P(e)&&(e.toString===M||!T(e.toString))?eh(e)?ev(e.value):JSON.stringify(e,eg,2):String(e),eg=(e,t)=>{if(eh(t))return eg(e,t.value);if(w(t))return{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],l)=>(e[em(t,l)+" =>"]=n,e),{})};if(k(t))return{[`Set(${t.size})`]:[...t.values()].map(e=>em(e))};if(R(t))return em(t);if(P(t)&&!S(t)&&!$(t))return String(t);return t},em=(e,t="")=>{var n;return R(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};class e_{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=t,!e&&t&&(this.index=(t.scopes||(t.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){let e,t;if(this._isPaused=!0,this.scopes)for(e=0,t=this.scopes.length;e0&&0==--this._on&&(t=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){let t,n;for(t=0,this._active=!1,n=this.effects.length;t0)){if(r){let e=r;for(r=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}for(;l;){let t=l;for(l=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,1&t.flags)try{t.trigger()}catch(t){e||(e=t)}t=n}}if(e)throw e}}function ek(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function eC(e){let t,n=e.depsTail,l=n;for(;l;){let e=l.prevDep;-1===l.version?(l===n&&(n=e),eR(l),function(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}(l)):t=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=e}e.deps=t,e.depsTail=n}function eT(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(eO(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function eO(e){if(4&e.flags&&!(16&e.flags)||(e.flags&=-17,e.globalVersion===ej)||(e.globalVersion=ej,!e.isSSR&&128&e.flags&&(!e.deps&&!e._dirty||!eT(e))))return;e.flags|=2;let t=e.dep,l=n,r=eP;n=e,eP=!0;try{ek(e);let n=e.fn(e._value);(0===t.version||B(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{n=l,eP=r,eC(e),e.flags&=-3}}function eR(e,t=!1){let{dep:n,prevSub:l,nextSub:r}=e;if(l&&(l.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=l,e.nextSub=void 0),n.subs===e&&(n.subs=l,!l&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)eR(e,!0)}t||--n.sc||!n.map||n.map.delete(n.key)}let eP=!0,eE=[];function eM(){eE.push(eP),eP=!1}function eA(){let e=eE.pop();eP=void 0===e||e}function e$(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=n;n=void 0;try{t()}finally{n=e}}}let ej=0;class eD{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class eI{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!n||!eP||n===this.computed)return;let t=this.activeLink;if(void 0===t||t.sub!==n)t=this.activeLink=new eD(n,this),n.deps?(t.prevDep=n.depsTail,n.depsTail.nextDep=t,n.depsTail=t):n.deps=n.depsTail=t,function e(t){if(t.dep.sc++,4&t.sub.flags){let n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let t=n.deps;t;t=t.nextDep)e(t)}let l=t.dep.subs;l!==t&&(t.prevSub=l,l&&(l.nextSub=t)),t.dep.subs=t}}(t);else if(-1===t.version&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=n.depsTail,t.nextDep=void 0,n.depsTail.nextDep=t,n.depsTail=t,n.deps===t&&(n.deps=e)}return t}trigger(e){this.version++,ej++,this.notify(e)}notify(e){ex++;try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ew()}}}let eN=new WeakMap,eF=Symbol(""),eL=Symbol(""),eV=Symbol("");function eW(e,t,l){if(eP&&n){let t=eN.get(e);t||eN.set(e,t=new Map);let n=t.get(l);n||(t.set(l,n=new eI),n.map=t,n.key=l),n.track()}}function eU(e,t,n,l,r,i){let s=eN.get(e);if(!s)return void ej++;let o=e=>{e&&e.trigger()};if(ex++,"clear"===t)s.forEach(o);else{let r=S(e),i=r&&j(n);if(r&&"length"===n){let e=Number(l);s.forEach((t,n)=>{("length"===n||n===eV||!R(n)&&n>=e)&&o(t)})}else switch((void 0!==n||s.has(void 0))&&o(s.get(n)),i&&o(s.get(eV)),t){case"add":r?i&&o(s.get("length")):(o(s.get(eF)),w(e)&&o(s.get(eL)));break;case"delete":!r&&(o(s.get(eF)),w(e)&&o(s.get(eL)));break;case"set":w(e)&&o(s.get(eF))}}ew()}function eB(e){let t=th(e);return t===e?t:(eW(t,"iterate",eV),tp(e)?t:t.map(tv))}function eH(e){return eW(e=th(e),"iterate",eV),e}let eq={__proto__:null,[Symbol.iterator](){return eG(this,Symbol.iterator,tv)},concat(...e){return eB(this).concat(...e.map(e=>S(e)?eB(e):e))},entries(){return eG(this,"entries",e=>(e[1]=tv(e[1]),e))},every(e,t){return eK(this,"every",e,t,void 0,arguments)},filter(e,t){return eK(this,"filter",e,t,e=>e.map(tv),arguments)},find(e,t){return eK(this,"find",e,t,tv,arguments)},findIndex(e,t){return eK(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return eK(this,"findLast",e,t,tv,arguments)},findLastIndex(e,t){return eK(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return eK(this,"forEach",e,t,void 0,arguments)},includes(...e){return eZ(this,"includes",e)},indexOf(...e){return eZ(this,"indexOf",e)},join(e){return eB(this).join(e)},lastIndexOf(...e){return eZ(this,"lastIndexOf",e)},map(e,t){return eK(this,"map",e,t,void 0,arguments)},pop(){return eX(this,"pop")},push(...e){return eX(this,"push",e)},reduce(e,...t){return eJ(this,"reduce",e,t)},reduceRight(e,...t){return eJ(this,"reduceRight",e,t)},shift(){return eX(this,"shift")},some(e,t){return eK(this,"some",e,t,void 0,arguments)},splice(...e){return eX(this,"splice",e)},toReversed(){return eB(this).toReversed()},toSorted(e){return eB(this).toSorted(e)},toSpliced(...e){return eB(this).toSpliced(...e)},unshift(...e){return eX(this,"unshift",e)},values(){return eG(this,"values",tv)}};function eG(e,t,n){let l=eH(e),r=l[t]();return l===e||tp(e)||(r._next=r.next,r.next=()=>{let e=r._next();return e.value&&(e.value=n(e.value)),e}),r}let ez=Array.prototype;function eK(e,t,n,l,r,i){let s=eH(e),o=s!==e&&!tp(e),a=s[t];if(a!==ez[t]){let t=a.apply(e,i);return o?tv(t):t}let u=n;s!==e&&(o?u=function(t,l){return n.call(this,tv(t),l,e)}:n.length>2&&(u=function(t,l){return n.call(this,t,l,e)}));let c=a.call(s,u,l);return o&&r?r(c):c}function eJ(e,t,n,l){let r=eH(e),i=n;return r!==e&&(tp(e)?n.length>3&&(i=function(t,l,r){return n.call(this,t,l,r,e)}):i=function(t,l,r){return n.call(this,t,tv(l),r,e)}),r[t](i,...l)}function eZ(e,t,n){let l=th(e);eW(l,"iterate",eV);let r=l[t](...n);return(-1===r||!1===r)&&td(n[0])?(n[0]=th(n[0]),l[t](...n)):r}function eX(e,t,n=[]){eM(),ex++;let l=th(e)[t].apply(e,n);return ew(),eA(),l}let eQ=c("__proto__,__v_isRef,__isVue"),eY=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(R));function e0(e){R(e)||(e=String(e));let t=th(this);return eW(t,"has",e),t.hasOwnProperty(e)}class e1{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if("__v_skip"===t)return e.__v_skip;let l=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!l;if("__v_isReadonly"===t)return l;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(l?r?ts:ti:r?tr:tl).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let i=S(e);if(!l){let e;if(i&&(e=eq[t]))return e;if("hasOwnProperty"===t)return e0}let s=Reflect.get(e,t,tm(e)?e:n);return(R(t)?eY.has(t):eQ(t))||(l||eW(e,"get",t),r)?s:tm(s)?i&&j(t)?s:s.value:P(s)?l?ta(s):to(s):s}}class e2 extends e1{constructor(e=!1){super(!1,e)}set(e,t,n,l){let r=e[t];if(!this._isShallow){let t=tf(r);if(tp(n)||tf(n)||(r=th(r),n=th(n)),!S(e)&&tm(r)&&!tm(n))if(t)return!1;else return r.value=n,!0}let i=S(e)&&j(t)?Number(t)e,e5=e=>Reflect.getPrototypeOf(e);function e9(e){return function(){return"delete"!==e&&("clear"===e?void 0:this)}}function e7(e,t){let n=function(e,t){let n={get(n){let l=this.__v_raw,r=th(l),i=th(n);e||(B(n,i)&&eW(r,"get",n),eW(r,"get",i));let{has:s}=e5(r),o=t?e3:e?tg:tv;return s.call(r,n)?o(l.get(n)):s.call(r,i)?o(l.get(i)):void(l!==r&&l.get(n))},get size(){let t=this.__v_raw;return e||eW(th(t),"iterate",eF),Reflect.get(t,"size",t)},has(t){let n=this.__v_raw,l=th(n),r=th(t);return e||(B(t,r)&&eW(l,"has",t),eW(l,"has",r)),t===r?n.has(t):n.has(t)||n.has(r)},forEach(n,l){let r=this,i=r.__v_raw,s=th(i),o=t?e3:e?tg:tv;return e||eW(s,"iterate",eF),i.forEach((e,t)=>n.call(l,o(e),o(t),r))}};return _(n,e?{add:e9("add"),set:e9("set"),delete:e9("delete"),clear:e9("clear")}:{add(e){t||tp(e)||tf(e)||(e=th(e));let n=th(this);return e5(n).has.call(n,e)||(n.add(e),eU(n,"add",e,e)),this},set(e,n){t||tp(n)||tf(n)||(n=th(n));let l=th(this),{has:r,get:i}=e5(l),s=r.call(l,e);s||(e=th(e),s=r.call(l,e));let o=i.call(l,e);return l.set(e,n),s?B(n,o)&&eU(l,"set",e,n):eU(l,"add",e,n),this},delete(e){let t=th(this),{has:n,get:l}=e5(t),r=n.call(t,e);r||(e=th(e),r=n.call(t,e)),l&&l.call(t,e);let i=t.delete(e);return r&&eU(t,"delete",e,void 0),i},clear(){let e=th(this),t=0!==e.size,n=e.clear();return t&&eU(e,"clear",void 0,void 0),n}}),["keys","values","entries",Symbol.iterator].forEach(l=>{n[l]=function(...n){let r=this.__v_raw,i=th(r),s=w(i),o="entries"===l||l===Symbol.iterator&&s,a=r[l](...n),u=t?e3:e?tg:tv;return e||eW(i,"iterate","keys"===l&&s?eL:eF),{next(){let{value:e,done:t}=a.next();return t?{value:e,done:t}:{value:o?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}),n}(e,t);return(t,l,r)=>"__v_isReactive"===l?!e:"__v_isReadonly"===l?e:"__v_raw"===l?t:Reflect.get(x(n,l)&&l in t?n:t,l,r)}let te={get:e7(!1,!1)},tt={get:e7(!1,!0)},tn={get:e7(!0,!1)},tl=new WeakMap,tr=new WeakMap,ti=new WeakMap,ts=new WeakMap;function to(e){return tf(e)?e:tu(e,!1,e6,te,tl)}function ta(e){return tu(e,!0,e8,tn,ti)}function tu(e,t,n,l,r){var i;if(!P(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;let s=(i=e).__v_skip||!Object.isExtensible(i)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}(A(i).slice(8,-1));if(0===s)return e;let o=r.get(e);if(o)return o;let a=new Proxy(e,2===s?l:n);return r.set(e,a),a}function tc(e){return tf(e)?tc(e.__v_raw):!!(e&&e.__v_isReactive)}function tf(e){return!!(e&&e.__v_isReadonly)}function tp(e){return!!(e&&e.__v_isShallow)}function td(e){return!!e&&!!e.__v_raw}function th(e){let t=e&&e.__v_raw;return t?th(t):e}let tv=e=>P(e)?to(e):e,tg=e=>P(e)?ta(e):e;function tm(e){return!!e&&!0===e.__v_isRef}let t_={get:(e,t,n)=>{var l;return"__v_raw"===t?e:tm(l=Reflect.get(e,t,n))?l.value:l},set:(e,t,n,l)=>{let r=e[t];return tm(r)&&!tm(n)?(r.value=n,!0):Reflect.set(e,t,n,l)}};function ty(e){return tc(e)?e:new Proxy(e,t_)}class tb{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new eI(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ej-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(8&this.flags)&&n!==this)return eS(this,!0),!0}get value(){let e=this.dep.track();return eO(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}let tx={},tS=new WeakMap;function tw(e,t=1/0,n){if(t<=0||!P(e)||e.__v_skip||(n=n||new Set).has(e))return e;if(n.add(e),t--,tm(e))tw(e.value,t,n);else if(S(e))for(let l=0;l{tw(e,t,n)});else if($(e)){for(let l in e)tw(e[l],t,n);for(let l of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,l)&&tw(e[l],t,n)}return e}function tk(e,t,n,l){try{return l?e(...l):e()}catch(e){tT(e,t,n)}}function tC(e,t,n,l){if(T(e)){let r=tk(e,t,n,l);return r&&E(r)&&r.catch(e=>{tT(e,t,n)}),r}if(S(e)){let r=[];for(let i=0;i=tL(n)?tO.push(e):tO.splice(function(e){let t=tR+1,n=tO.length;for(;t>>1,r=tO[l],i=tL(r);itL(e)-tL(t));if(tP.length=0,tE)return void tE.push(...e);for(tM=0,tE=e;tMnull==e.id?2&e.flags?-1:1/0:e.id,tV=null,tW=null;function tU(e){let t=tV;return tV=e,tW=e&&e.type.__scopeId||null,t}function tB(e,t,n,l){let r=e.dirs,i=t&&t.dirs;for(let s=0;stz(e,t&&(S(t)?t[i]:t),n,l,r));if(tK(l)&&!r){512&l.shapeFlag&&l.type.__asyncResolved&&l.component.subTree.component&&tz(e,t,n,l.component.subTree);return}let i=4&l.shapeFlag?lh(l.component):l.el,s=r?null:i,{i:o,r:a}=e,u=t&&t.r,c=o.refs===f?o.refs={}:o.refs,p=o.setupState,d=th(p),h=p===f?()=>!1:e=>x(d,e);if(null!=u&&u!==a&&(O(u)?(c[u]=null,h(u)&&(p[u]=null)):tm(u)&&(u.value=null)),T(a))tk(a,o,12,[s,c]);else{let t=O(a),l=tm(a);if(t||l){let o=()=>{if(e.f){let n=t?h(a)?p[a]:c[a]:a.value;r?S(n)&&y(n,i):S(n)?n.includes(i)||n.push(i):t?(c[a]=[i],h(a)&&(p[a]=c[a])):(a.value=[i],e.k&&(c[e.k]=a.value))}else t?(c[a]=s,h(a)&&(p[a]=s)):l&&(a.value=s,e.k&&(c[e.k]=s))};s?(o.id=-1,nj(o,n)):o()}}}let tK=e=>!!e.type.__asyncLoader,tJ=e=>e.type.__isKeepAlive;function tZ(e,t){tQ(e,"a",t)}function tX(e,t){tQ(e,"da",t)}function tQ(e,t,n=lr){let l=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(tY(t,l,n),n){let e=n.parent;for(;e&&e.parent;)tJ(e.parent.vnode)&&function(e,t,n,l){let r=tY(t,e,l,!0);t3(()=>{y(l[t],r)},n)}(l,t,n,e),e=e.parent}}function tY(e,t,n=lr,l=!1){if(n){let r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...l)=>{eM();let r=ls(n),i=tC(t,n,e,l);return r(),eA(),i});return l?r.unshift(i):r.push(i),i}}let t0=e=>(t,n=lr)=>{lu&&"sp"!==e||tY(e,(...e)=>t(...e),n)},t1=t0("bm"),t2=t0("m"),t6=t0("bu"),t8=t0("u"),t4=t0("bum"),t3=t0("um"),t5=t0("sp"),t9=t0("rtg"),t7=t0("rtc");function ne(e,t=lr){tY("ec",e,t)}let nt=Symbol.for("v-ndc"),nn=e=>e?la(e)?lh(e):nn(e.parent):null,nl=_(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>nn(e.parent),$root:e=>nn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>nu(e),$forceUpdate:e=>e.f||(e.f=()=>{tD(e.update)}),$nextTick:e=>e.n||(e.n=tj.bind(e.proxy)),$watch:e=>nV.bind(e)}),nr=(e,t)=>e!==f&&!e.__isScriptSetup&&x(e,t),ni={get({_:e},t){let n,l,r;if("__v_skip"===t)return!0;let{ctx:i,setupState:s,data:o,props:a,accessCache:u,type:c,appContext:p}=e;if("$"!==t[0]){let l=u[t];if(void 0!==l)switch(l){case 1:return s[t];case 2:return o[t];case 4:return i[t];case 3:return a[t]}else{if(nr(s,t))return u[t]=1,s[t];if(o!==f&&x(o,t))return u[t]=2,o[t];if((n=e.propsOptions[0])&&x(n,t))return u[t]=3,a[t];if(i!==f&&x(i,t))return u[t]=4,i[t];no&&(u[t]=0)}}let d=nl[t];return d?("$attrs"===t&&eW(e.attrs,"get",""),d(e)):(l=c.__cssModules)&&(l=l[t])?l:i!==f&&x(i,t)?(u[t]=4,i[t]):x(r=p.config.globalProperties,t)?r[t]:void 0},set({_:e},t,n){let{data:l,setupState:r,ctx:i}=e;return nr(r,t)?(r[t]=n,!0):l!==f&&x(l,t)?(l[t]=n,!0):!x(e.props,t)&&!("$"===t[0]&&t.slice(1)in e)&&(i[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:l,appContext:r,propsOptions:i}},s){let o;return!!n[s]||e!==f&&x(e,s)||nr(t,s)||(o=i[0])&&x(o,s)||x(l,s)||x(nl,s)||x(r.config.globalProperties,s)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:x(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ns(e){return S(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}let no=!0;function na(e,t,n){tC(S(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function nu(e){let t,n=e.type,{mixins:l,extends:r}=n,{mixins:i,optionsCache:s,config:{optionMergeStrategies:o}}=e.appContext,a=s.get(n);return a?t=a:i.length||l||r?(t={},i.length&&i.forEach(e=>nc(t,e,o,!0)),nc(t,n,o)):t=n,P(n)&&s.set(n,t),t}function nc(e,t,n,l=!1){let{mixins:r,extends:i}=t;for(let s in i&&nc(e,i,n,!0),r&&r.forEach(t=>nc(e,t,n,!0)),t)if(l&&"expose"===s);else{let l=nf[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}let nf={data:np,props:ng,emits:ng,methods:nv,computed:nv,beforeCreate:nh,created:nh,beforeMount:nh,mounted:nh,beforeUpdate:nh,updated:nh,beforeDestroy:nh,beforeUnmount:nh,destroyed:nh,unmounted:nh,activated:nh,deactivated:nh,errorCaptured:nh,serverPrefetch:nh,components:nv,directives:nv,watch:function(e,t){if(!e)return t;if(!t)return e;let n=_(Object.create(null),e);for(let l in t)n[l]=nh(e[l],t[l]);return n},provide:np,inject:function(e,t){return nv(nd(e),nd(t))}};function np(e,t){return t?e?function(){return _(T(e)?e.call(this,this):e,T(t)?t.call(this,this):t)}:t:e}function nd(e){if(S(e)){let t={};for(let n=0;n1)return n&&T(t)?t.call(l&&l.proxy):t}}let nx={},nS=()=>Object.create(nx),nw=e=>Object.getPrototypeOf(e)===nx;function nk(e,t,n,l){let r,[i,s]=e.propsOptions,o=!1;if(t)for(let a in t){let u;if(D(a))continue;let c=t[a];i&&x(i,u=F(a))?s&&s.includes(u)?(r||(r={}))[u]=c:n[u]=c:nB(e.emitsOptions,a)||a in l&&c===l[a]||(l[a]=c,o=!0)}if(s){let t=th(n),l=r||f;for(let r=0;r"_"===e||"__"===e||"_ctx"===e||"$stable"===e,nP=e=>S(e)?e.map(n3):[n3(e)],nE=(e,t,n)=>{if(t._n)return t;let l=function(e,t=tV,n){if(!t||e._n)return e;let l=(...n)=>{let r;l._d&&nY(-1);let i=tU(t);try{r=e(...n)}finally{tU(i),l._d&&nY(1)}return r};return l._n=!0,l._c=!0,l._d=!0,l}((...e)=>nP(t(...e)),n);return l._c=!1,l},nM=(e,t,n)=>{let l=e._ctx;for(let n in e){if(nR(n))continue;let r=e[n];if(T(r))t[n]=nE(n,r,l);else if(null!=r){let e=nP(r);t[n]=()=>e}}},nA=(e,t)=>{let n=nP(t);e.slots.default=()=>n},n$=(e,t,n)=>{for(let l in t)(n||!nR(l))&&(e[l]=t[l])},nj=function(e,t){if(t&&t.pendingBranch)S(e)?t.effects.push(...e):t.effects.push(e);else S(e)?tP.push(...e):tE&&-1===e.id?tE.splice(tM+1,0,e):1&e.flags||(tP.push(e),e.flags|=1),tI()};function nD({type:e,props:t},n){return"svg"===n&&"foreignObject"===e||"mathml"===n&&"annotation-xml"===e&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function nI({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function nN(e){if(e)for(let t=0;t{};return e.stop=d,e.resume=d,e.pause=d,e}}let h=lr;c.call=(e,t,n)=>tC(e,h,t,n);let g=!1;"post"===o?c.scheduler=e=>{nj(e,h&&h.suspense)}:"sync"!==o&&(g=!0,c.scheduler=(e,t)=>{t?e():tD(e)}),c.augmentJob=e=>{n&&(e.flags|=4),g&&(e.flags|=2,h&&(e.id=h.uid,e.i=h))};let m=function(e,n,l=f){let r,i,s,o,{immediate:u,deep:c,once:p,scheduler:h,augmentJob:g,call:m}=l,_=e=>c?e:tp(e)||!1===c||0===c?tw(e,1):tw(e),b=!1,x=!1;if(tm(e)?(i=()=>e.value,b=tp(e)):tc(e)?(i=()=>_(e),b=!0):S(e)?(x=!0,b=e.some(e=>tc(e)||tp(e)),i=()=>e.map(e=>tm(e)?e.value:tc(e)?_(e):T(e)?m?m(e,2):e():void 0)):i=T(e)?n?m?()=>m(e,2):e:()=>{if(s){eM();try{s()}finally{eA()}}let t=a;a=r;try{return m?m(e,3,[o]):e(o)}finally{a=t}}:d,n&&c){let e=i,t=!0===c?1/0:c;i=()=>tw(e(),t)}let w=t,k=()=>{r.stop(),w&&w.active&&y(w.effects,r)};if(p&&n){let e=n;n=(...t)=>{e(...t),k()}}let C=x?Array(e.length).fill(tx):tx,O=e=>{if(1&r.flags&&(r.dirty||e))if(n){let e=r.run();if(c||b||(x?e.some((e,t)=>B(e,C[t])):B(e,C))){s&&s();let t=a;a=r;try{let t=[e,C===tx?void 0:x&&C[0]===tx?[]:C,o];C=e,m?m(n,3,t):n(...t)}finally{a=t}}}else r.run()};return g&&g(O),(r=new eb(i)).scheduler=h?()=>h(O,!1):O,o=e=>(function(e,t=!1,n=a){if(n){let t=tS.get(n);t||tS.set(n,t=[]),t.push(e)}})(e,!1,r),s=r.onStop=()=>{let e=tS.get(r);if(e){if(m)m(e,4);else for(let t of e)t();tS.delete(r)}},n?u?O(!0):C=r.run():h?h(O.bind(null,!0),!0):r.run(),k.pause=r.pause.bind(r),k.resume=r.resume.bind(r),k.stop=k,k}(e,n,c);return lu&&(r?r.push(m):p&&m()),m}function nV(e,t,n){let l,r=this.proxy,i=O(e)?e.includes(".")?nW(r,e):()=>r[e]:e.bind(r,r);T(t)?l=t:(l=t.handler,n=t);let s=ls(this),o=nL(i,l.bind(r),n);return s(),o}function nW(e,t){let n=t.split(".");return()=>{let t=e;for(let e=0;eO(e)?e.trim():e)),a.number&&(s=n.map(G)));let u=i[l=U(t)]||i[l=U(F(t))];!u&&o&&(u=i[l=U(V(t))]),u&&tC(u,e,6,s);let c=i[l+"Once"];if(c){if(e.emitted){if(e.emitted[l])return}else e.emitted={};e.emitted[l]=!0,tC(c,e,6,s)}}function nB(e,t){return!!e&&!!g(t)&&(x(e,(t=t.slice(2).replace(/Once$/,""))[0].toLowerCase()+t.slice(1))||x(e,V(t))||x(e,t))}function nH(e){let t,n,{type:l,vnode:r,proxy:i,withProxy:s,propsOptions:[o],slots:a,attrs:u,emit:c,render:f,renderCache:p,props:d,data:h,setupState:g,ctx:_,inheritAttrs:y}=e,b=tU(e);try{if(4&r.shapeFlag){let e=s||i;t=n3(f.call(e,e,p,d,g,h,_)),n=u}else t=n3(l.length>1?l(d,{attrs:u,slots:a,emit:c}):l(d,null)),n=l.props?u:nq(u)}catch(n){tT(n,e,1),t=n8(nZ)}let x=t;if(n&&!1!==y){let e=Object.keys(n),{shapeFlag:t}=x;e.length&&7&t&&(o&&e.some(m)&&(n=nG(n,o)),x=n4(x,n,!1,!0))}return r.dirs&&((x=n4(x,null,!1,!0)).dirs=x.dirs?x.dirs.concat(r.dirs):r.dirs),r.transition&&tq(x,r.transition),t=x,tU(b),t}let nq=e=>{let t;for(let n in e)("class"===n||"style"===n||g(n))&&((t||(t={}))[n]=e[n]);return t},nG=(e,t)=>{let n={};for(let l in e)m(l)&&l.slice(9)in t||(n[l]=e[l]);return n};function nz(e,t,n){let l=Object.keys(t);if(l.length!==Object.keys(e).length)return!0;for(let r=0;rnull!=e?e:null,n6=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?O(e)||tm(e)||T(e)?{i:tV,r:e,k:t,f:!!n}:e:null),n8=function(e,t=null,n=null,l=0,r=null,i=!1){var s,o;if(e&&e!==nt||(e=nZ),n0(e)){let l=n4(e,t,!0);return n&&n9(l,n),nQ>0,l.patchFlag=-2,l}if(T(s=e)&&"__vccOpts"in s&&(e=e.__vccOpts),t){let{class:e,style:n}=t=(o=t)?td(o)||nw(o)?_({},o):o:null;e&&!O(e)&&(t.class=Q(e)),P(n)&&(td(n)&&!S(n)&&(n=_({},n)),t.style=K(n))}let a=O(e)?1:e.__isSuspense?128:e.__isTeleport?64:P(e)?4:2*!!T(e);return function(e,t=null,n=null,l=0,r=null,i=+(e!==nK),s=!1,o=!1){let a={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&n2(t),ref:t&&n6(t),scopeId:tW,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:l,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:tV};return o?(n9(a,n),128&i&&e.normalize(a)):n&&(a.shapeFlag|=O(n)?8:16),nQ>0,a}(e,t,n,l,r,a,i,!0)};function n4(e,t,n=!1,l=!1){let{props:r,ref:i,patchFlag:s,children:o,transition:a}=e,u=t?n7(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&n2(u),ref:t&&t.ref?n&&i?S(i)?i.concat(n6(t)):[i,n6(t)]:n6(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:o,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==nK?-1===s?16:16|s:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:a,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&n4(e.ssContent),ssFallback:e.ssFallback&&n4(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return a&&l&&tq(c,a.clone(c)),c}function n3(e){return null==e||"boolean"==typeof e?n8(nZ):S(e)?n8(nK,null,e.slice()):n0(e)?n5(e):n8(nJ,null,String(e))}function n5(e){return null===e.el&&-1!==e.patchFlag||e.memo?e:n4(e)}function n9(e,t){let n=0,{shapeFlag:l}=e;if(null==t)t=null;else if(S(t))n=16;else if("object"==typeof t)if(65&l){let n=t.default;n&&(n._c&&(n._d=!1),n9(e,n()),n._c&&(n._d=!0));return}else{n=32;let l=t._;l||nw(t)?3===l&&tV&&(1===tV.slots._?t._=1:(t._=2,e.patchFlag|=1024)):t._ctx=tV}else T(t)?(t={default:t,_ctx:tV},n=32):(t=String(t),64&l?(n=16,t=[function(e=" ",t=0){return n8(nJ,null,e,t)}(t)]):n=8);e.children=t,e.shapeFlag|=n}function n7(...e){let t={};for(let n=0;n{u=!0;let[l,r]=e(t,n,!0);_(o,l),r&&a.push(...r)};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}if(!s&&!u)return P(t)&&r.set(t,p),p;if(S(s))for(let e=0;e{let l=e(t,n,!0);l&&(a=!0,_(o,l))};!l&&n.mixins.length&&n.mixins.forEach(r),t.extends&&r(t.extends),t.mixins&&t.mixins.forEach(r)}return s||a?(S(s)?s.forEach(e=>o[e]=null):_(o,s),P(t)&&r.set(t,o),o):(P(t)&&r.set(t,null),null)}(l,r),emit:null,emitted:null,propsDefaults:f,inheritAttrs:l.inheritAttrs,ctx:f,data:f,props:f,attrs:f,slots:f,refs:f,setupState:f,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=t?t.root:i,i.emit=nU.bind(null,i),e.ce&&e.ce(i),i}let lr=null,li=()=>lr||tV;{let e=z(),t=(t,n)=>{let l;return(l=e[t])||(l=e[t]=[]),l.push(n),e=>{l.length>1?l.forEach(t=>t(e)):l[0](e)}};i=t("__VUE_INSTANCE_SETTERS__",e=>lr=e),s=t("__VUE_SSR_SETTERS__",e=>lu=e)}let ls=e=>{let t=lr;return i(e),e.scope.on(),()=>{e.scope.off(),i(t)}},lo=()=>{lr&&lr.scope.off(),i(null)};function la(e){return 4&e.vnode.shapeFlag}let lu=!1;function lc(e,t=!1,n=!1){t&&s(t);let{props:l,children:r}=e.vnode,i=la(e);!function(e,t,n,l=!1){let r={},i=nS();for(let n in e.propsDefaults=Object.create(null),nk(e,t,r,i),e.propsOptions[0])n in r||(r[n]=void 0);n?e.props=l?r:tu(r,!1,e4,tt,tr):e.type.props?e.props=r:e.props=i,e.attrs=i}(e,l,i,t),((e,t,n)=>{let l=e.slots=nS();if(32&e.vnode.shapeFlag){let e=t.__;e&&q(l,"__",e,!0);let r=t._;r?(n$(l,t,n),n&&q(l,"_",r,!0)):nM(t,l)}else t&&nA(e,t)})(e,r,n||t);let o=i?function(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ni);let{setup:l}=n;if(l){var r;eM();let n=e.setupContext=l.length>1?{attrs:new Proxy((r=e).attrs,ld),slots:r.slots,emit:r.emit,expose:e=>{r.exposed=e||{}}}:null,i=ls(e),s=tk(l,e,0,[e.props,n]),o=E(s);if(eA(),i(),(o||e.sp)&&!tK(e)&&tG(e),o){if(s.then(lo,lo),t)return s.then(t=>{lf(e,t)}).catch(t=>{tT(t,e,0)});e.asyncDep=s}else lf(e,s)}else lp(e)}(e,t):void 0;return t&&s(!1),o}function lf(e,t,n){T(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:P(t)&&(e.setupState=ty(t)),lp(e)}function lp(e,t,n){let l=e.type;e.render||(e.render=l.render||d);{let t=ls(e);eM();try{!function(e){let t=nu(e),n=e.proxy,l=e.ctx;no=!1,t.beforeCreate&&na(t.beforeCreate,e,"bc");let{data:r,computed:i,methods:s,watch:o,provide:a,inject:u,created:c,beforeMount:f,mounted:p,beforeUpdate:h,updated:g,activated:m,deactivated:_,beforeDestroy:y,beforeUnmount:b,destroyed:x,unmounted:w,render:k,renderTracked:C,renderTriggered:R,errorCaptured:E,serverPrefetch:M,expose:A,inheritAttrs:$,components:j,directives:D,filters:I}=t;if(u&&function(e,t,n=d){for(let n in S(e)&&(e=nd(e)),e){let l,r=e[n];tm(l=P(r)?"default"in r?nb(r.from||n,r.default,!0):nb(r.from||n):nb(r))?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:e=>l.value=e}):t[n]=l}}(u,l,null),s)for(let e in s){let t=s[e];T(t)&&(l[e]=t.bind(n))}if(r){let t=r.call(n,n);P(t)&&(e.data=to(t))}if(no=!0,i)for(let e in i){let t=i[e],r=T(t)?t.bind(n,n):T(t.get)?t.get.bind(n,n):d,s=lv({get:r,set:!T(t)&&T(t.set)?t.set.bind(n):d});Object.defineProperty(l,e,{enumerable:!0,configurable:!0,get:()=>s.value,set:e=>s.value=e})}if(o)for(let e in o)!function e(t,n,l,r){var i,s,o,a,u,c,f;let p=r.includes(".")?nW(l,r):()=>l[r];if(O(t)){let e=n[t];T(e)&&(i=p,s=e,nL(i,s,void 0))}else if(T(t)){o=p,a=t.bind(l),nL(o,a,void 0)}else if(P(t))if(S(t))t.forEach(t=>e(t,n,l,r));else{let e=T(t.handler)?t.handler.bind(l):n[t.handler];T(e)&&(u=p,c=e,f=t,nL(u,c,f))}}(o[e],l,n,e);if(a){let e=T(a)?a.call(n):a;Reflect.ownKeys(e).forEach(t=>{var n=t,l=e[t];if(lr){let e=lr.provides,t=lr.parent&&lr.parent.provides;t===e&&(e=lr.provides=Object.create(t)),e[n]=l}})}function N(e,t){S(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(c&&na(c,e,"c"),N(t1,f),N(t2,p),N(t6,h),N(t8,g),N(tZ,m),N(tX,_),N(ne,E),N(t7,C),N(t9,R),N(t4,b),N(t3,w),N(t5,M),S(A))if(A.length){let t=e.exposed||(e.exposed={});A.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||(e.exposed={});k&&e.render===d&&(e.render=k),null!=$&&(e.inheritAttrs=$),j&&(e.components=j),D&&(e.directives=D),M&&tG(e)}(e)}finally{eA(),t()}}}let ld={get:(e,t)=>(eW(e,"get",""),e[t])};function lh(e){var t;return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ty((!x(t=e.exposed,"__v_skip")&&Object.isExtensible(t)&&q(t,"__v_skip",!0),t)),{get:(t,n)=>n in t?t[n]:n in nl?nl[n](e):void 0,has:(e,t)=>t in e||t in nl})):e.proxy}let lv=(e,t)=>(function(e,t,n=!1){let l,r;return T(e)?l=e:(l=e.get,r=e.set),new tb(l,r,n)})(e,0,lu),lg={createComponentInstance:ll,setupComponent:lc,renderComponentRoot:nH,setCurrentRenderingInstance:tU,isVNode:n0,normalizeVNode:n3,getComponentPublicInstance:lh,ensureValidVNode:function e(t){return t.some(t=>!n0(t)||t.type!==nZ&&(t.type!==nK||!!e(t.children)))?t:null},pushWarningContext:function(e){},popWarningContext:function(){}},lm="undefined"!=typeof window&&window.trustedTypes;if(lm)try{u=lm.createPolicy("vue",{createHTML:e=>e})}catch(e){}let l_=u?e=>u.createHTML(e):e=>e,ly="undefined"!=typeof document?document:null,lb=ly&&ly.createElement("template"),lx=Symbol("_vtc"),lS=Symbol("_vod"),lw=Symbol("_vsh"),lk=Symbol(""),lC=/(^|;)\s*display\s*:/,lT=/\s*!important$/;function lO(e,t,n){if(S(n))n.forEach(n=>lO(e,t,n));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{let l=function(e,t){let n=lP[t];if(n)return n;let l=F(t);if("filter"!==l&&l in e)return lP[t]=l;l=W(l);for(let n=0;n111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&123>e.charCodeAt(2),lF=_({patchProp:(e,t,n,l,r,i)=>{let s="svg"===r;if("class"===t){var o=l;let t=e[lx];t&&(o=(o?[o,...t]:[...t]).join(" ")),null==o?e.removeAttribute("class"):s?e.setAttribute("class",o):e.className=o}else"style"===t?function(e,t,n){let l=e.style,r=O(n),i=!1;if(n&&!r){if(t)if(O(t))for(let e of t.split(";")){let t=e.slice(0,e.indexOf(":")).trim();null==n[t]&&lO(l,t,"")}else for(let e in t)null==n[e]&&lO(l,e,"");for(let e in n)"display"===e&&(i=!0),lO(l,e,n[e])}else if(r){if(t!==n){let e=l[lk];e&&(n+=";"+e),l.cssText=n,i=lC.test(n)}}else t&&e.removeAttribute("style");lS in e&&(e[lS]=i?l.display:"",e[lw]&&(l.display="none"))}(e,n,l):g(t)?m(t)||function(e,t,n,l,r=null){let i=e[l$]||(e[l$]={}),s=i[t];if(l&&s)s.value=l;else{let[n,o]=function(e){let t;if(lj.test(e)){let n;for(t={};n=e.match(lj);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[":"===e[2]?e.slice(3):V(e.slice(2)),t]}(t);if(l){let s=i[t]=function(e,t){let n=e=>{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();tC(function(e,t){if(!S(t))return t;{let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}}(e,n.value),t,5,[e])};return n.value=e,n.attached=lD||(lI.then(()=>lD=0),lD=Date.now()),n}(l,r);e.addEventListener(n,s,o)}else s&&(e.removeEventListener(n,s,o),i[t]=void 0)}}(e,t,0,l,i):("."===t[0]?(t=t.slice(1),0):"^"===t[0]?(t=t.slice(1),1):!function(e,t,n,l){if(l)return!!("innerHTML"===t||"textContent"===t||t in e&&lN(t)&&T(n));if("spellcheck"===t||"draggable"===t||"translate"===t||"autocorrect"===t||"form"===t||"list"===t&&"INPUT"===e.tagName||"type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){let t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return!(lN(t)&&O(n))&&t in e}(e,t,l,s))?e._isVueCE&&(/[A-Z]/.test(t)||!O(l))?lA(e,F(t),l,i,t):("true-value"===t?e._trueValue=l:"false-value"===t&&(e._falseValue=l),lM(e,t,l,s)):(lA(e,t,l),e.tagName.includes("-")||"value"!==t&&"checked"!==t&&"selected"!==t||lM(e,t,l,s,i,"value"!==t))}},{insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,l)=>{let r="svg"===t?ly.createElementNS("http://www.w3.org/2000/svg",e):"mathml"===t?ly.createElementNS("http://www.w3.org/1998/Math/MathML",e):n?ly.createElement(e,{is:n}):ly.createElement(e);return"select"===e&&l&&null!=l.multiple&&r.setAttribute("multiple",l.multiple),r},createText:e=>ly.createTextNode(e),createComment:e=>ly.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ly.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,l,r,i){let s=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{lb.innerHTML=l_("svg"===l?``:"mathml"===l?``:e);let r=lb.content;if("svg"===l||"mathml"===l){let e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}}),lL=(...e)=>{let t=(o||(o=function(e,t){let n;z().__VUE__=!0;let{insert:l,remove:r,patchProp:i,createElement:s,createText:o,createComment:a,setText:u,setElementText:c,parentNode:h,nextSibling:g,setScopeId:m=d,insertStaticContent:y}=e,b=(e,t,n,l=null,r=null,i=null,s,o=null,a=!!t.dynamicChildren)=>{if(e===t)return;e&&!n1(e,t)&&(l=et(e),Z(e,r,i,!0),e=null),-2===t.patchFlag&&(a=!1,t.dynamicChildren=null);let{type:u,ref:c,shapeFlag:f}=t;switch(u){case nJ:w(e,t,n,l);break;case nZ:k(e,t,n,l);break;case nX:null==e&&C(t,n,l,s);break;case nK:I(e,t,n,l,r,i,s,o,a);break;default:1&f?O(e,t,n,l,r,i,s,o,a):6&f?N(e,t,n,l,r,i,s,o,a):64&f?u.process(e,t,n,l,r,i,s,o,a,er):128&f&&u.process(e,t,n,l,r,i,s,o,a,er)}null!=c&&r?tz(c,e&&e.ref,i,t||e,!t):null==c&&e&&null!=e.ref&&tz(e.ref,null,i,e,!0)},w=(e,t,n,r)=>{if(null==e)l(t.el=o(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&u(n,t.children)}},k=(e,t,n,r)=>{null==e?l(t.el=a(t.children||""),n,r):t.el=e.el},C=(e,t,n,l)=>{[e.el,e.anchor]=y(e.children,t,n,l,e.el,e.anchor)},O=(e,t,n,l,r,i,s,o,a)=>{"svg"===t.type?s="svg":"math"===t.type&&(s="mathml"),null==e?R(t,n,l,r,i,s,o,a):A(e,t,r,i,s,o,a)},R=(e,t,n,r,o,a,u,f)=>{var p,d;let h,g,{props:m,shapeFlag:_,transition:y,dirs:b}=e;if(h=e.el=s(e.type,a,m&&m.is,m),8&_?c(h,e.children):16&_&&M(e.children,h,null,r,o,nD(e,a),u,f),b&&tB(e,null,r,"created"),E(h,e,e.scopeId,u,r),m){for(let e in m)"value"===e||D(e)||i(h,e,null,m[e],a,r);"value"in m&&i(h,"value",null,m.value,a),(g=m.onVnodeBeforeMount)&&le(g,r,e)}b&&tB(e,null,r,"beforeMount");let x=(p=o,d=y,(!p||p&&!p.pendingBranch)&&d&&!d.persisted);x&&y.beforeEnter(h),l(h,t,n),((g=m&&m.onVnodeMounted)||x||b)&&nj(()=>{g&&le(g,r,e),x&&y.enter(h),b&&tB(e,null,r,"mounted")},o)},E=(e,t,n,l,r)=>{if(n&&m(e,n),l)for(let t=0;t{for(let u=a;u{let a,u=t.el=e.el,{patchFlag:p,dynamicChildren:d,dirs:h}=t;p|=16&e.patchFlag;let g=e.props||f,m=t.props||f;if(n&&nI(n,!1),(a=m.onVnodeBeforeUpdate)&&le(a,n,t,e),h&&tB(t,e,n,"beforeUpdate"),n&&nI(n,!0),(g.innerHTML&&null==m.innerHTML||g.textContent&&null==m.textContent)&&c(u,""),d?$(e.dynamicChildren,d,u,n,l,nD(t,r),s):o||q(e,t,u,null,n,l,nD(t,r),s,!1),p>0){if(16&p)j(u,g,m,n,r);else if(2&p&&g.class!==m.class&&i(u,"class",null,m.class,r),4&p&&i(u,"style",g.style,m.style,r),8&p){let e=t.dynamicProps;for(let t=0;t{a&&le(a,n,t,e),h&&tB(t,e,n,"updated")},l)},$=(e,t,n,l,r,i,s)=>{for(let o=0;o{if(t!==n){if(t!==f)for(let s in t)D(s)||s in n||i(e,s,t[s],null,r,l);for(let s in n){if(D(s))continue;let o=n[s],a=t[s];o!==a&&"value"!==s&&i(e,s,a,o,r,l)}"value"in n&&i(e,"value",t.value,n.value,r)}},I=(e,t,n,r,i,s,a,u,c)=>{let f=t.el=e?e.el:o(""),p=t.anchor=e?e.anchor:o(""),{patchFlag:d,dynamicChildren:h,slotScopeIds:g}=t;g&&(u=u?u.concat(g):g),null==e?(l(f,n,r),l(p,n,r),M(t.children||[],n,p,i,s,a,u,c)):d>0&&64&d&&h&&e.dynamicChildren?($(e.dynamicChildren,h,n,i,s,a,u),(null!=t.key||i&&t===i.subTree)&&function e(t,n,l=!1){let r=t.children,i=n.children;if(S(r)&&S(i))for(let t=0;t{t.slotScopeIds=o,null==e?512&t.shapeFlag?r.ctx.activate(t,n,l,s,a):L(t,n,l,r,i,s,a):W(e,t,a)},L=(e,t,n,l,r,i,s)=>{let o=e.component=ll(e,l,r);if(tJ(e)&&(o.ctx.renderer=er),lc(o,!1,s),o.asyncDep){if(r&&r.registerDep(o,U,s),!e.el){let l=o.subTree=n8(nZ);k(null,l,t,n),e.placeholder=l.el}}else U(o,e,t,n,r,i,s)},W=(e,t,n)=>{let l=t.component=e.component;if(function(e,t,n){let{props:l,children:r,component:i}=e,{props:s,children:o,patchFlag:a}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!n||!(a>=0))return(!!r||!!o)&&(!o||!o.$stable)||l!==s&&(l?!s||nz(l,s,u):!!s);if(1024&a)return!0;if(16&a)return l?nz(l,s,u):!!s;if(8&a){let e=t.dynamicProps;for(let t=0;t{let o=()=>{if(e.isMounted){let t,{next:n,bu:l,u:a,parent:u,vnode:c}=e;{let t=function e(t){let n=t.subTree.component;if(n)if(n.asyncDep&&!n.asyncResolved)return n;else return e(n)}(e);if(t){n&&(n.el=c.el,B(e,n,s)),t.asyncDep.then(()=>{e.isUnmounted||o()});return}}let f=n;nI(e,!1),n?(n.el=c.el,B(e,n,s)):n=c,l&&H(l),(t=n.props&&n.props.onVnodeBeforeUpdate)&&le(t,u,n,c),nI(e,!0);let p=nH(e),d=e.subTree;e.subTree=p,b(d,p,h(d.el),et(d),e,r,i),n.el=p.el,null===f&&function({vnode:e,parent:t},n){for(;t;){let l=t.subTree;if(l.suspense&&l.suspense.activeBranch===e&&(l.el=e.el),l===e)(e=t.vnode).el=n,t=t.parent;else break}}(e,p.el),a&&nj(a,r),(t=n.props&&n.props.onVnodeUpdated)&&nj(()=>le(t,u,n,c),r)}else{let s,{el:o,props:a}=t,{bm:u,m:c,parent:f,root:p,type:d}=e,h=tK(t);nI(e,!1),u&&H(u),!h&&(s=a&&a.onVnodeBeforeMount)&&le(s,f,t),nI(e,!0);{p.ce&&!1!==p.ce._def.shadowRoot&&p.ce._injectChildStyle(d);let s=e.subTree=nH(e);b(null,s,n,l,e,r,i),t.el=s.el}if(c&&nj(c,r),!h&&(s=a&&a.onVnodeMounted)){let e=t;nj(()=>le(s,f,e),r)}(256&t.shapeFlag||f&&tK(f.vnode)&&256&f.vnode.shapeFlag)&&e.a&&nj(e.a,r),e.isMounted=!0,t=n=l=null}};e.scope.on();let a=e.effect=new eb(o);e.scope.off();let u=e.update=a.run.bind(a),c=e.job=a.runIfDirty.bind(a);c.i=e,c.id=e.uid,a.scheduler=()=>tD(c),nI(e,!0),u()},B=(e,t,n)=>{t.component=e;let l=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,l){let{props:r,attrs:i,vnode:{patchFlag:s}}=e,o=th(r),[a]=e.propsOptions,u=!1;if((l||s>0)&&!(16&s)){if(8&s){let n=e.vnode.dynamicProps;for(let l=0;l{let{vnode:l,slots:r}=e,i=!0,s=f;if(32&l.shapeFlag){let e=t._;e?n&&1===e?i=!1:n$(r,t,n):(i=!t.$stable,nM(t,r)),s=t}else t&&(nA(e,t),s={default:1});if(i)for(let e in r)nR(e)||null!=s[e]||delete r[e]})(e,t.children,n),eM(),tN(e),eA()},q=(e,t,n,l,r,i,s,o,a=!1)=>{let u=e&&e.children,f=e?e.shapeFlag:0,p=t.children,{patchFlag:d,shapeFlag:h}=t;if(d>0){if(128&d)return void K(u,p,n,l,r,i,s,o,a);else if(256&d)return void G(u,p,n,l,r,i,s,o,a)}8&h?(16&f&&ee(u,r,i),p!==u&&c(n,p)):16&f?16&h?K(u,p,n,l,r,i,s,o,a):ee(u,r,i,!0):(8&f&&c(n,""),16&h&&M(p,n,l,r,i,s,o,a))},G=(e,t,n,l,r,i,s,o,a)=>{let u;e=e||p,t=t||p;let c=e.length,f=t.length,d=Math.min(c,f);for(u=0;uf?ee(e,r,i,!0,!1,d):M(t,n,l,r,i,s,o,a,d)},K=(e,t,n,l,r,i,s,o,a)=>{let u=0,c=t.length,f=e.length-1,d=c-1;for(;u<=f&&u<=d;){let l=e[u],c=t[u]=a?n5(t[u]):n3(t[u]);if(n1(l,c))b(l,c,n,null,r,i,s,o,a);else break;u++}for(;u<=f&&u<=d;){let l=e[f],u=t[d]=a?n5(t[d]):n3(t[d]);if(n1(l,u))b(l,u,n,null,r,i,s,o,a);else break;f--,d--}if(u>f){if(u<=d){let e=d+1,f=ed)for(;u<=f;)Z(e[u],r,i,!0),u++;else{let h,g=u,m=u,_=new Map;for(u=m;u<=d;u++){let e=t[u]=a?n5(t[u]):n3(t[u]);null!=e.key&&_.set(e.key,u)}let y=0,x=d-m+1,S=!1,w=0,k=Array(x);for(u=0;u=x){Z(c,r,i,!0);continue}if(null!=c.key)l=_.get(c.key);else for(h=m;h<=d;h++)if(0===k[h-m]&&n1(c,t[h])){l=h;break}void 0===l?Z(c,r,i,!0):(k[l-m]=u+1,l>=w?w=l:S=!0,b(c,t[l],n,null,r,i,s,o,a),y++)}let C=S?function(e){let t,n,l,r,i,s=e.slice(),o=[0],a=e.length;for(t=0;t