prettier 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -1
  3. data/node_modules/prettier/LICENSE +53 -124
  4. data/node_modules/prettier/doc.js +5 -5
  5. data/node_modules/prettier/index.cjs +1 -1
  6. data/node_modules/prettier/index.d.ts +5 -7
  7. data/node_modules/prettier/index.mjs +7854 -7334
  8. data/node_modules/prettier/internal/cli.mjs +18 -19
  9. data/node_modules/prettier/package.json +1 -2
  10. data/node_modules/prettier/plugins/acorn.js +1 -1
  11. data/node_modules/prettier/plugins/acorn.mjs +1 -1
  12. data/node_modules/prettier/plugins/angular.js +1 -2
  13. data/node_modules/prettier/plugins/angular.mjs +1 -2
  14. data/node_modules/prettier/plugins/babel.js +1 -1
  15. data/node_modules/prettier/plugins/babel.mjs +1 -1
  16. data/node_modules/prettier/plugins/estree.js +26 -26
  17. data/node_modules/prettier/plugins/estree.mjs +26 -26
  18. data/node_modules/prettier/plugins/flow.js +17 -17
  19. data/node_modules/prettier/plugins/flow.mjs +16 -16
  20. data/node_modules/prettier/plugins/glimmer.js +20 -20
  21. data/node_modules/prettier/plugins/glimmer.mjs +20 -20
  22. data/node_modules/prettier/plugins/markdown.js +40 -40
  23. data/node_modules/prettier/plugins/markdown.mjs +40 -40
  24. data/node_modules/prettier/plugins/meriyah.js +5 -5
  25. data/node_modules/prettier/plugins/meriyah.mjs +5 -5
  26. data/node_modules/prettier/plugins/postcss.js +1 -1
  27. data/node_modules/prettier/plugins/postcss.mjs +1 -1
  28. data/node_modules/prettier/plugins/typescript.js +20 -20
  29. data/node_modules/prettier/plugins/typescript.mjs +20 -20
  30. data/node_modules/prettier/standalone.d.ts +1 -1
  31. data/node_modules/prettier/standalone.js +15 -18
  32. data/node_modules/prettier/standalone.mjs +16 -19
  33. data/package.json +1 -1
  34. data/src/plugin.js +7 -4
  35. metadata +2 -3
  36. data/node_modules/prettier/internal/internal.mjs +0 -712
@@ -13,4 +13,4 @@ var Ws=Object.create;var Ve=Object.defineProperty;var Js=Object.getOwnPropertyDe
13
13
  `||i==="\r"||i==="\u2028"||i==="\u2029")return t-1}else{if(i==="\r"&&a.charAt(t+1)===`
14
14
  `)return t+2;if(i===`
15
15
  `||i==="\r"||i==="\u2028"||i==="\u2029")return t+1}return t}var fs=wr;function Re(a){return(t,e,s)=>{let i=!!(s!=null&&s.backwards);if(e===!1)return!1;let{length:r}=t,n=e;for(;n>=0&&n<r;){let o=t.charAt(n);if(a instanceof RegExp){if(!a.test(o))return n}else if(!a.includes(o))return n;i?n--:n++}return n===-1||n===r?n:!1}}var Ta=Re(/\s/),ds=Re(" "),ba=Re(",; "),ms=Re(/[^\n\r]/);function Cr(a,t){return t===!1?!1:a.charAt(t)==="/"&&a.charAt(t+1)==="/"?ms(a,t):t}var ys=Cr;function Er(a,t){let e=null,s=t;for(;s!==e;)e=s,s=ds(a,s),s=us(a,s),s=ys(a,s),s=fs(a,s);return s}var xs=Er;var re=qe(ws(),1);function Br(a){let t=Be(a);t&&(a=a.slice(t.length+1));let e=(0,re.extract)(a),{pragmas:s,comments:i}=(0,re.parseWithComments)(e);return{shebang:t,text:a,pragmas:s,comments:i}}function Cs(a){let{pragmas:t}=Br(a);return Object.prototype.hasOwnProperty.call(t,"prettier")||Object.prototype.hasOwnProperty.call(t,"format")}function Rr(a){return Array.isArray(a)&&a.length>0}var Y=Rr;function D(a){var s;let t=a.range?a.range[0]:a.start,e=((s=a.declaration)==null?void 0:s.decorators)??a.decorators;return Y(e)?Math.min(D(e[0]),t):t}function B(a){return a.range?a.range[1]:a.end}function _r(a){return a=typeof a=="function"?{parse:a}:a,{astFormat:"estree",hasPragma:Cs,locStart:D,locEnd:B,...a}}var ae=_r;function Ur(a,t){let e=new SyntaxError(a+" ("+t.loc.start.line+":"+t.loc.start.column+")");return Object.assign(e,t)}var _e=Ur;function jr(a){let{message:t,loc:{line:e,column:s}}=a,i=` (${e}:${s})`;return t.endsWith(i)&&(t=t.slice(0,-i.length)),_e(t,{loc:{start:{line:e,column:s+1}},cause:a})}var Te=jr;var $r=(a,t,e)=>{if(!(a&&t==null))return Array.isArray(t)||typeof t=="string"?t[e<0?t.length+e:e]:t.at(e)},Et=$r;function Vr(a){return a=new Set(a),t=>a.has(t==null?void 0:t.type)}var Es=Vr;var qr=Es(["Block","CommentBlock","MultiLine"]),be=qr;function zr(a){return be(a)&&a.value[0]==="*"&&/@(?:type|satisfies)\b/.test(a.value)}var Is=zr;function Kr(a){let t=`*${a.value}*`.split(`
16
- `);return t.length>1&&t.every(e=>e.trimStart()[0]==="*")}var It=Kr;var Ae=null;function Se(a){if(Ae!==null&&typeof Ae.property){let t=Ae;return Ae=Se.prototype=null,t}return Ae=Se.prototype=a??Object.create(null),new Se}var Hr=10;for(let a=0;a<=Hr;a++)Se();function Nt(a){return Se(a)}function Wr(a,t="type"){Nt(a);function e(s){let i=s[t],r=a[i];if(!Array.isArray(r))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:s});return r}return e}var Ns=Wr;var ks={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"],ImportExpression:["source","options","attributes"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],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","typeArguments"],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"],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"],AsExpression:["expression","typeAnnotation"],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"],TypeOperator:["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:[],AsConstExpression:["expression"],SatisfiesExpression:["expression","typeAnnotation"]};var Jr=Ns(ks),vs=Jr;function kt(a,t){if(!(a!==null&&typeof a=="object"))return a;if(Array.isArray(a)){for(let s=0;s<a.length;s++)a[s]=kt(a[s],t);return a}let e=vs(a);for(let s=0;s<e.length;s++)a[e[s]]=kt(a[e[s]],t);return t(a)||a}var Ue=kt;function Xr(a,t){let{parser:e,text:s}=t;if(a.type==="File"&&a.program.interpreter){let{program:{interpreter:r},comments:n}=a;delete a.program.interpreter,n.unshift(r)}if(e==="babel"){let r=new Set;a=Ue(a,n=>{var o;(o=n.leadingComments)!=null&&o.some(Is)&&r.add(D(n))}),a=Ue(a,n=>{if(n.type==="ParenthesizedExpression"){let{expression:o}=n;if(o.type==="TypeCastExpression")return o.range=n.range,o;let h=D(n);if(!r.has(h))return o.extra={...o.extra,parenthesized:!0},o}})}if(a=Ue(a,r=>{switch(r.type){case"LogicalExpression":if(Ls(r))return vt(r);break;case"VariableDeclaration":{let n=Et(!1,r.declarations,-1);n!=null&&n.init&&i(r,n);break}case"TSParenthesizedType":return r.typeAnnotation;case"TSTypeParameter":if(typeof r.name=="string"){let n=D(r);r.name={type:"Identifier",name:r.name,range:[n,n+r.name.length]}}break;case"TopicReference":a.extra={...a.extra,__isUsingHackPipeline:!0};break;case"ExportAllDeclaration":{let{exported:n}=r;if(e==="meriyah"&&(n==null?void 0:n.type)==="Identifier"){let o=s.slice(D(n),B(n));(o.startsWith('"')||o.startsWith("'"))&&(r.exported={...r.exported,type:"Literal",value:r.exported.name,raw:o})}break}case"TSUnionType":case"TSIntersectionType":if(r.types.length===1)return r.types[0];break}}),Y(a.comments)){let r=Et(!1,a.comments,-1);for(let n=a.comments.length-2;n>=0;n--){let o=a.comments[n];B(o)===D(r)&&be(o)&&be(r)&&It(o)&&It(r)&&(a.comments.splice(n+1,1),o.value+="*//*"+r.value,o.range=[D(o),B(r)]),r=o}}return a.type==="Program"&&(a.range=[0,s.length]),a;function i(r,n){s[B(n)]!==";"&&(r.range=[D(r),B(n)])}}function Ls(a){return a.type==="LogicalExpression"&&a.right.type==="LogicalExpression"&&a.operator===a.right.operator}function vt(a){return Ls(a)?vt({type:"LogicalExpression",operator:a.operator,left:vt({type:"LogicalExpression",operator:a.operator,left:a.left,right:a.right.left,range:[D(a.left),B(a.right.left)]}),right:a.right.right,range:[D(a),B(a)]}):a}var Ds=Xr;function Gr(a){let{filepath:t}=a;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs"))return"script";if(t.endsWith(".mjs"))return"module"}}var Ms=Gr;function Yr(a,t){let{type:e="JsExpressionRoot",rootMarker:s,text:i}=t,{tokens:r,comments:n}=a;return delete a.tokens,delete a.comments,{tokens:r,comments:n,type:e,node:a,range:[0,i.length],rootMarker:s}}var je=Yr;var ne=a=>ae(ia(a)),Qr={sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","decimal","moduleBlocks","asyncDoExpressions","regexpUnicodeSets","destructuringPrivate","decoratorAutoAccessors","importReflection","explicitResourceManagement",["importAttributes",{deprecatedAssertSyntax:!0}],"sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}]],tokens:!0,ranges:!0},Zr=["recordAndTuple",{syntaxType:"hash"}],Os="v8intrinsic",Fs=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"minimal"}],["pipelineOperator",{proposal:"fsharp"}]],R=(a,t=Qr)=>({...t,plugins:[...t.plugins,...a]}),ea=/@(?:no)?flow\b/;function ta(a,t){var i;if((i=t.filepath)!=null&&i.endsWith(".js.flow"))return!0;let e=Be(a);e&&(a=a.slice(e.length));let s=xs(a,0);return s!==!1&&(a=a.slice(0,s)),ea.test(a)}function sa(a,t,e){let s=a(t,e),i=s.errors.find(r=>!ra.has(r.reasonCode));if(i)throw i;return s}function ia({isExpression:a=!1,optionsCombinations:t}){return(e,s={})=>{if((s.parser==="babel"||s.parser==="__babel_estree")&&ta(e,s))return s.parser="babel-flow",$s.parse(e,s);let i=t;(s.__babelSourceType??Ms(s))==="script"&&(i=i.map(l=>({...l,sourceType:"script"}))),/#[[{]/.test(e)&&(i=i.map(l=>R([Zr],l)));let n=/%[A-Z]/.test(e);e.includes("|>")?i=(n?[...Fs,Os]:Fs).flatMap(c=>i.map(u=>R([c],u))):n&&(i=i.map(l=>R([Os],l)));let o=a?$e.parseExpression:$e.parse,h;try{h=ps(i.map(l=>()=>sa(o,e,l)))}catch({errors:[l]}){throw Te(l)}return a&&(h=je(h,{text:e,rootMarker:s.rootMarker})),Ds(h,{parser:"babel",text:e})}}var ra=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","MixedLabeledAndUnlabeledElements","DuplicateAccessibilityModifier","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","LineTerminatorBeforeArrow","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","DeclareFunctionHasImplementation","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport"]),js=[R(["jsx"])],Bs=ne({optionsCombinations:js}),Rs=ne({optionsCombinations:[R(["jsx","typescript"]),R(["typescript"])]}),_s=ne({isExpression:!0,optionsCombinations:[R(["jsx"])]}),Us=ne({isExpression:!0,optionsCombinations:[R(["typescript"])]}),$s=ne({optionsCombinations:[R(["jsx",["flow",{all:!0,enums:!0}],"flowComments"])]}),aa=ne({optionsCombinations:js.map(a=>R(["estree"],a))}),Vs={babel:Bs,"babel-flow":$s,"babel-ts":Rs,__js_expression:_s,__ts_expression:Us,__vue_expression:_s,__vue_ts_expression:Us,__vue_event_binding:Bs,__vue_ts_event_binding:Rs,__babel_estree:aa};var zs=qe(Ct(),1);function Ks(a={}){let{allowComments:t=!0}=a;return function(s){let i;try{i=(0,zs.parseExpression)(s,{tokens:!0,ranges:!0,attachComment:!1})}catch(r){throw(r==null?void 0:r.reasonCode)==="MissingPlugin"||(r==null?void 0:r.reasonCode)==="MissingOneOfPlugins"?Te({message:"Unexpected token",loc:r.loc}):Te(r)}if(!t&&Y(i.comments))throw W(i.comments[0],"Comment");return oe(i),je(i,{type:"JsonRoot",text:s})}}function W(a,t){let[e,s]=[a.loc.start,a.loc.end].map(({line:i,column:r})=>({line:i,column:r+1}));return _e(`${t} is not allowed in JSON.`,{loc:{start:e,end:s}})}function oe(a){switch(a.type){case"ArrayExpression":for(let t of a.elements)t!==null&&oe(t);return;case"ObjectExpression":for(let t of a.properties)oe(t);return;case"ObjectProperty":if(a.computed)throw W(a.key,"Computed key");if(a.shorthand)throw W(a.key,"Shorthand property");a.key.type!=="Identifier"&&oe(a.key),oe(a.value);return;case"UnaryExpression":{let{operator:t,argument:e}=a;if(t!=="+"&&t!=="-")throw W(a,`Operator '${a.operator}'`);if(e.type==="NumericLiteral"||e.type==="Identifier"&&(e.name==="Infinity"||e.name==="NaN"))return;throw W(e,`Operator '${t}' before '${e.type}'`)}case"Identifier":if(a.name!=="Infinity"&&a.name!=="NaN"&&a.name!=="undefined")throw W(a,`Identifier '${a.name}'`);return;case"TemplateLiteral":if(Y(a.expressions))throw W(a.expressions[0],"'TemplateLiteral' with expression");for(let t of a.quasis)oe(t);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw W(a,`'${a.type}'`)}}var qs=Ks(),na={json:ae({parse:qs,hasPragma(){return!0}}),json5:ae(qs),"json-stringify":ae({parse:Ks({allowComments:!1}),astFormat:"estree-json"})},Hs=na;var oa={...Vs,...Hs};var _n=Lt;export{_n as default,oa as parsers};
16
+ `);return t.length>1&&t.every(e=>e.trimStart()[0]==="*")}var It=Kr;var Ae=null;function Se(a){if(Ae!==null&&typeof Ae.property){let t=Ae;return Ae=Se.prototype=null,t}return Ae=Se.prototype=a??Object.create(null),new Se}var Hr=10;for(let a=0;a<=Hr;a++)Se();function Nt(a){return Se(a)}function Wr(a,t="type"){Nt(a);function e(s){let i=s[t],r=a[i];if(!Array.isArray(r))throw Object.assign(new Error(`Missing visitor keys for '${i}'.`),{node:s});return r}return e}var Ns=Wr;var ks={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],ImportExpression:["source","options","attributes"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],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","typeArguments"],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"],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"],AsExpression:["expression","typeAnnotation"],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"],TypeOperator:["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:[],AsConstExpression:["expression"],SatisfiesExpression:["expression","typeAnnotation"]};var Jr=Ns(ks),vs=Jr;function kt(a,t){if(!(a!==null&&typeof a=="object"))return a;if(Array.isArray(a)){for(let s=0;s<a.length;s++)a[s]=kt(a[s],t);return a}let e=vs(a);for(let s=0;s<e.length;s++)a[e[s]]=kt(a[e[s]],t);return t(a)||a}var Ue=kt;function Xr(a,t){let{parser:e,text:s}=t;if(a.type==="File"&&a.program.interpreter){let{program:{interpreter:i},comments:r}=a;delete a.program.interpreter,r.unshift(i)}if(e==="babel"){let i=new Set;a=Ue(a,r=>{var n;(n=r.leadingComments)!=null&&n.some(Is)&&i.add(D(r))}),a=Ue(a,r=>{if(r.type==="ParenthesizedExpression"){let{expression:n}=r;if(n.type==="TypeCastExpression")return n.range=[...r.range],n;let o=D(r);if(!i.has(o))return n.extra={...n.extra,parenthesized:!0},n}})}if(a=Ue(a,i=>{var r;switch(i.type){case"LogicalExpression":if(Ls(i))return vt(i);break;case"VariableDeclaration":{let n=Et(!1,i.declarations,-1);n!=null&&n.init&&s[B(n)]!==";"&&(i.range=[D(i),B(n)]);break}case"TSParenthesizedType":return i.typeAnnotation;case"TSTypeParameter":if(typeof i.name=="string"){let n=D(i);i.name={type:"Identifier",name:i.name,range:[n,n+i.name.length]}}break;case"TopicReference":a.extra={...a.extra,__isUsingHackPipeline:!0};break;case"ExportAllDeclaration":if(e==="meriyah"&&((r=i.exported)==null?void 0:r.type)==="Identifier"){let{exported:n}=i,o=s.slice(D(n),B(n));(o.startsWith('"')||o.startsWith("'"))&&(i.exported={...i.exported,type:"Literal",value:i.exported.name,raw:o})}break;case"TSUnionType":case"TSIntersectionType":if(i.types.length===1)return i.types[0];break}}),Y(a.comments)){let i=Et(!1,a.comments,-1);for(let r=a.comments.length-2;r>=0;r--){let n=a.comments[r];B(n)===D(i)&&be(n)&&be(i)&&It(n)&&It(i)&&(a.comments.splice(r+1,1),n.value+="*//*"+i.value,n.range=[D(n),B(i)]),i=n}}return a.type==="Program"&&(a.range=[0,s.length]),a}function Ls(a){return a.type==="LogicalExpression"&&a.right.type==="LogicalExpression"&&a.operator===a.right.operator}function vt(a){return Ls(a)?vt({type:"LogicalExpression",operator:a.operator,left:vt({type:"LogicalExpression",operator:a.operator,left:a.left,right:a.right.left,range:[D(a.left),B(a.right.left)]}),right:a.right.right,range:[D(a),B(a)]}):a}var Ds=Xr;function Gr(a){let{filepath:t}=a;if(t){if(t=t.toLowerCase(),t.endsWith(".cjs"))return"script";if(t.endsWith(".mjs"))return"module"}}var Ms=Gr;function Yr(a,t){let{type:e="JsExpressionRoot",rootMarker:s,text:i}=t,{tokens:r,comments:n}=a;return delete a.tokens,delete a.comments,{tokens:r,comments:n,type:e,node:a,range:[0,i.length],rootMarker:s}}var je=Yr;var ne=a=>ae(ia(a)),Qr={sourceType:"module",allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,allowNewTargetOutsideFunction:!0,allowSuperOutsideMethod:!0,allowUndeclaredExports:!0,errorRecovery:!0,createParenthesizedExpressions:!0,createImportExpressions:!0,plugins:["doExpressions","exportDefaultFrom","functionBind","functionSent","throwExpressions","partialApplication","decorators","decimal","moduleBlocks","asyncDoExpressions","regexpUnicodeSets","destructuringPrivate","decoratorAutoAccessors","importReflection","explicitResourceManagement",["importAttributes",{deprecatedAssertSyntax:!0}],"sourcePhaseImports","deferredImportEvaluation",["optionalChainingAssign",{version:"2023-07"}]],tokens:!0,ranges:!0},Zr=["recordAndTuple",{syntaxType:"hash"}],Os="v8intrinsic",Fs=[["pipelineOperator",{proposal:"hack",topicToken:"%"}],["pipelineOperator",{proposal:"minimal"}],["pipelineOperator",{proposal:"fsharp"}]],R=(a,t=Qr)=>({...t,plugins:[...t.plugins,...a]}),ea=/@(?:no)?flow\b/;function ta(a,t){var i;if((i=t.filepath)!=null&&i.endsWith(".js.flow"))return!0;let e=Be(a);e&&(a=a.slice(e.length));let s=xs(a,0);return s!==!1&&(a=a.slice(0,s)),ea.test(a)}function sa(a,t,e){let s=a(t,e),i=s.errors.find(r=>!ra.has(r.reasonCode));if(i)throw i;return s}function ia({isExpression:a=!1,optionsCombinations:t}){return(e,s={})=>{if((s.parser==="babel"||s.parser==="__babel_estree")&&ta(e,s))return s.parser="babel-flow",$s.parse(e,s);let i=t;(s.__babelSourceType??Ms(s))==="script"&&(i=i.map(l=>({...l,sourceType:"script"}))),/#[[{]/.test(e)&&(i=i.map(l=>R([Zr],l)));let n=/%[A-Z]/.test(e);e.includes("|>")?i=(n?[...Fs,Os]:Fs).flatMap(c=>i.map(u=>R([c],u))):n&&(i=i.map(l=>R([Os],l)));let o=a?$e.parseExpression:$e.parse,h;try{h=ps(i.map(l=>()=>sa(o,e,l)))}catch({errors:[l]}){throw Te(l)}return a&&(h=je(h,{text:e,rootMarker:s.rootMarker})),Ds(h,{parser:"babel",text:e})}}var ra=new Set(["StrictNumericEscape","StrictWith","StrictOctalLiteral","StrictDelete","StrictEvalArguments","StrictEvalArgumentsBinding","StrictFunction","EmptyTypeArguments","EmptyTypeParameters","ConstructorHasTypeParameters","UnsupportedParameterPropertyKind","MixedLabeledAndUnlabeledElements","DuplicateAccessibilityModifier","DecoratorExportClass","ParamDupe","InvalidDecimal","RestTrailingComma","UnsupportedParameterDecorator","UnterminatedJsxContent","UnexpectedReservedWord","ModuleAttributesWithDuplicateKeys","LineTerminatorBeforeArrow","InvalidEscapeSequenceTemplate","NonAbstractClassHasAbstractMethod","OptionalTypeBeforeRequired","PatternIsOptional","OptionalBindingPattern","DeclareClassFieldHasInitializer","TypeImportCannotSpecifyDefaultAndNamed","DeclareFunctionHasImplementation","ConstructorClassField","VarRedeclaration","InvalidPrivateFieldResolution","DuplicateExport"]),js=[R(["jsx"])],Bs=ne({optionsCombinations:js}),Rs=ne({optionsCombinations:[R(["jsx","typescript"]),R(["typescript"])]}),_s=ne({isExpression:!0,optionsCombinations:[R(["jsx"])]}),Us=ne({isExpression:!0,optionsCombinations:[R(["typescript"])]}),$s=ne({optionsCombinations:[R(["jsx",["flow",{all:!0,enums:!0}],"flowComments"])]}),aa=ne({optionsCombinations:js.map(a=>R(["estree"],a))}),Vs={babel:Bs,"babel-flow":$s,"babel-ts":Rs,__js_expression:_s,__ts_expression:Us,__vue_expression:_s,__vue_ts_expression:Us,__vue_event_binding:Bs,__vue_ts_event_binding:Rs,__babel_estree:aa};var zs=qe(Ct(),1);function Ks(a={}){let{allowComments:t=!0}=a;return function(s){let i;try{i=(0,zs.parseExpression)(s,{tokens:!0,ranges:!0,attachComment:!1})}catch(r){throw(r==null?void 0:r.reasonCode)==="MissingPlugin"||(r==null?void 0:r.reasonCode)==="MissingOneOfPlugins"?Te({message:"Unexpected token",loc:r.loc}):Te(r)}if(!t&&Y(i.comments))throw W(i.comments[0],"Comment");return oe(i),je(i,{type:"JsonRoot",text:s})}}function W(a,t){let[e,s]=[a.loc.start,a.loc.end].map(({line:i,column:r})=>({line:i,column:r+1}));return _e(`${t} is not allowed in JSON.`,{loc:{start:e,end:s}})}function oe(a){switch(a.type){case"ArrayExpression":for(let t of a.elements)t!==null&&oe(t);return;case"ObjectExpression":for(let t of a.properties)oe(t);return;case"ObjectProperty":if(a.computed)throw W(a.key,"Computed key");if(a.shorthand)throw W(a.key,"Shorthand property");a.key.type!=="Identifier"&&oe(a.key),oe(a.value);return;case"UnaryExpression":{let{operator:t,argument:e}=a;if(t!=="+"&&t!=="-")throw W(a,`Operator '${a.operator}'`);if(e.type==="NumericLiteral"||e.type==="Identifier"&&(e.name==="Infinity"||e.name==="NaN"))return;throw W(e,`Operator '${t}' before '${e.type}'`)}case"Identifier":if(a.name!=="Infinity"&&a.name!=="NaN"&&a.name!=="undefined")throw W(a,`Identifier '${a.name}'`);return;case"TemplateLiteral":if(Y(a.expressions))throw W(a.expressions[0],"'TemplateLiteral' with expression");for(let t of a.quasis)oe(t);return;case"NullLiteral":case"BooleanLiteral":case"NumericLiteral":case"StringLiteral":case"TemplateElement":return;default:throw W(a,`'${a.type}'`)}}var qs=Ks(),na={json:ae({parse:qs,hasPragma(){return!0}}),json5:ae(qs),"json-stringify":ae({parse:Ks({allowComments:!1}),astFormat:"estree-json"})},Hs=na;var oa={...Vs,...Hs};var _n=Lt;export{_n as default,oa as parsers};