){return c1(u,e,0)}function a0(u,e){let n=new SyntaxError(u+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(n,e)}var ae=a0;function m0(u){let e=[];for(let n of u)try{return n()}catch(i){e.push(i)}throw Object.assign(new Error("All combinations failed"),{errors:e})}var me=m0;var C2=Je(be(),1);function E0(u){if(!u.startsWith("#!"))return"";let e=u.indexOf(`
`);return e===-1?u:u.slice(0,e)}var Ce=E0;function w0(u){let e=Ce(u);e&&(u=u.slice(e.length+1));let n=(0,C2.extract)(u),{pragmas:i,comments:t}=(0,C2.parseWithComments)(n);return{shebang:e,text:u,pragmas:i,comments:t}}function Pe(u){let{pragmas:e}=w0(u);return Object.prototype.hasOwnProperty.call(e,"prettier")||Object.prototype.hasOwnProperty.call(e,"format")}function S0(u){return Array.isArray(u)&&u.length>0}var _2=S0;function $(u){var i;let e=u.range?u.range[0]:u.start,n=((i=u.declaration)==null?void 0:i.decorators)??u.decorators;return _2(n)?Math.min($(n[0]),e):e}function p(u){return u.range?u.range[1]:u.end}function B0(u){return u=typeof u=="function"?{parse:u}:u,{astFormat:"estree",hasPragma:Pe,locStart:$,locEnd:p,...u}}var Ee=B0;var v0=(u,e,n)=>{if(!(u&&e==null))return Array.isArray(e)||typeof e=="string"?e[n<0?e.length+n:n]:e.at(n)},ku=v0;function T0(u){return u=new Set(u),e=>u.has(e==null?void 0:e.type)}var we=T0;var F0=we(["Block","CommentBlock","MultiLine"]),T2=F0;function q0(u){return T2(u)&&u.value[0]==="*"&&/@(?:type|satisfies)\b/.test(u.value)}var Se=q0;function L0(u){let e=`*${u.value}*`.split(`
`);return e.length>1&&e.every(n=>n.trimStart()[0]==="*")}var hu=L0;var F2=null;function q2(u){if(F2!==null&&typeof F2.property){let e=F2;return F2=q2.prototype=null,e}return F2=q2.prototype=u??Object.create(null),new q2}var I0=10;for(let u=0;u<=I0;u++)q2();function Du(u){return q2(u)}function N0(u,e="type"){Du(u);function n(i){let t=i[e],o=u[t];if(!Array.isArray(o))throw Object.assign(new Error(`Missing visitor keys for '${t}'.`),{node:i});return o}return n}var Be=N0;var ve={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ExportAllDeclaration:["source","attributes","assertions","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes","assertions"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes","assertions"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],ClassPrivateProperty:["key","value","decorators","typeAnnotation","variance"],ClassPrivateMethod:["key","params","body","decorators","returnType","typeParameters"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source"],DeclareExportAllDeclaration:["source"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","params","rest","returnType","this"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value","optional","static","method"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value","variance"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["id","qualification"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes","typeArguments","typeParameters"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],DecimalLiteral:[],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","typeAnnotation","nameType"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],ImportExpression:["source","attributes"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],TSTemplateLiteralType:["quasis","types"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareEnum:["id","body"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[]};var V0=Be(ve),Te=V0;function Au(u,e){if(!(u!==null&&typeof u=="object"))return u;if(Array.isArray(u)){for(let i=0;i<u.length;i++)u[i]=Au(u[i],e);return u}let n=Te(u);for(let i=0;i<n.length;i++)u[n[i]]=Au(u[n[i]],e);return e(u)||u}var Y2=Au;function R0(u,e){let{parser:n,text:i}=e;if(u.type==="File"&&u.program.interpreter){let{program:{interpreter:o},comments:l}=u;delete u.program.interpreter,l.unshift(o)}if(n==="babel"){let o=new Set;u=Y2(u,l=>{var f;(f=l.leadingComments)!=null&&f.some(Se)&&o.add($(l))}),u=Y2(u,l=>{if(l.type==="ParenthesizedExpression"){let{expression:f}=l;if(f.type==="TypeCastExpression")return f.range=l.range,f;let c=$(l);if(!o.has(c))return f.extra={...f.extra,parenthesized:!0},f}})}if(u=Y2(u,o=>{switch(o.type){case"LogicalExpression":if(Fe(o))return bu(o);break;case"VariableDeclaration":{let l=ku(!1,o.declarations,-1);l!=null&&l.init&&t(o,l);break}case"TSParenthesizedType":return o.typeAnnotation;case"TSTypeParameter":if(typeof o.name=="string"){let l=$(o);o.name={type:"Identifier",name:o.name,range:[l,l+o.name.length]}}break;case"TopicReference":u.extra={...u.extra,__isUsingHackPipeline:!0};break;case"ExportAllDeclaration":{let{exported:l}=o;if(n==="meriyah"&&(l==null?void 0:l.type)==="Identifier"){let f=i.slice($(l),p(l));(f.startsWith('"')||f.startsWith("'"))&&(o.exported={...o.exported,type:"Literal",value:o.exported.name,raw:f})}break}case"TSUnionType":case"TSIntersectionType":if(o.types.length===1)return o.types[0];break}}),_2(u.comments)){let o=ku(!1,u.comments,-1);for(let l=u.comments.length-2;l>=0;l--){let f=u.comments[l];p(f)===$(o)&&T2(f)&&T2(o)&&hu(f)&&hu(o)&&(u.comments.splice(l+1,1),f.value+="*//*"+o.value,f.range=[$(f),p(o)]),o=f}}return u.type==="Program"&&(u.range=[0,i.length]),u;function t(o,l){i[p(l)]!==";"&&(o.range=[$(o),p(l)])}}function Fe(u){return u.type==="LogicalExpression"&&u.right.type==="LogicalExpression"&&u.operator===u.right.operator}function bu(u){return Fe(u)?bu({type:"LogicalExpression",operator:u.operator,left:bu({type:"LogicalExpression",operator:u.operator,left:u.left,right:u.right.left,range:[$(u.left),p(u.right.left)]}),right:u.right.right,range:[$(u),p(u)]}):u}var qe=R0;function O0(u){let{filepath:e}=u;if(e){if(e=e.toLowerCase(),e.endsWith(".cjs"))return"script";if(e.endsWith(".mjs"))return"module"}}var Le=O0;var U0={next:!0,ranges:!0,webcompat:!0,loc:!0,raw:!0,directives:!0,globalReturn:!0,impliedStrict:!1,preserveParens:!1,lexical:!1,identifierPattern:!1,jsx:!0,specDeviation:!0,uniqueKeyInPattern:!1};function M0(u,e){let n=[],i=[],t=se(u,{...U0,module:e==="module",onComment:n,onToken:i});return t.comments=n,t.tokens=i,t}function J0(u){var o;let{message:e,line:n,column:i}=u,t=(o=e.match(/^\[(?<line>\d+):(?<column>\d+)]: (?<message>.*)$/))==null?void 0:o.groups;return t&&(e=t.message,typeof n!="number"&&(n=Number(t.line),i=Number(t.column))),typeof n!="number"?u:ae(e,{loc:{start:{line:n,column:i}},cause:u})}function j0(u,e={}){let n=Le(e),i=(n?[n]:["module","script"]).map(o=>()=>M0(u,o)),t;try{t=me(i)}catch({errors:[o]}){throw J0(o)}return qe(t,{parser:"meriyah",text:u})}var X0=Ee(j0);var jn=Pu;export{jn as default,Cu as parsers};
