UNPKG

prettier

Version:

Prettier is an opinionated code formatter

5 lines 212 kB
(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.estree=e()}})(function(){"use strict";var Eo=Object.defineProperty;var zp=Object.getOwnPropertyDescriptor;var Zp=Object.getOwnPropertyNames;var ec=Object.prototype.hasOwnProperty;var Co=(e,t)=>{for(var r in t)Eo(e,r,{get:t[r],enumerable:!0})},tc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Zp(t))!ec.call(e,o)&&o!==r&&Eo(e,o,{get:()=>t[o],enumerable:!(n=zp(t,o))||n.enumerable});return e};var rc=e=>tc(Eo({},"__esModule",{value:!0}),e);var yy={};Co(yy,{languages:()=>Dy,options:()=>Xp,printers:()=>fy});var Mi=[{name:"JavaScript",type:"programming",aceMode:"javascript",extensions:[".js","._js",".bones",".cjs",".es",".es6",".gs",".jake",".javascript",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".start.frag",".end.frag",".wxs"],filenames:["Jakefile","start.frag","end.frag"],tmScope:"source.js",aliases:["js","node"],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",interpreters:["bun","chakra","d8","deno","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell","zx"],parsers:["babel","acorn","espree","meriyah","babel-flow","babel-ts","flow","typescript"],vscodeLanguageIds:["javascript","mongo"],linguistLanguageId:183},{name:"Flow",type:"programming",aceMode:"javascript",extensions:[".js.flow"],filenames:[],tmScope:"source.js",aliases:[],codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",interpreters:["bun","chakra","d8","deno","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell"],parsers:["flow","babel-flow"],vscodeLanguageIds:["javascript"],linguistLanguageId:183},{name:"JSX",type:"programming",aceMode:"javascript",extensions:[".jsx"],filenames:void 0,tmScope:"source.js.jsx",aliases:void 0,codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",interpreters:void 0,parsers:["babel","babel-flow","babel-ts","flow","typescript","espree","meriyah"],vscodeLanguageIds:["javascriptreact"],group:"JavaScript",linguistLanguageId:183},{name:"TypeScript",type:"programming",aceMode:"typescript",extensions:[".ts",".cts",".mts"],tmScope:"source.ts",aliases:["ts"],codemirrorMode:"javascript",codemirrorMimeType:"application/typescript",interpreters:["bun","deno","ts-node","tsx"],parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescript"],linguistLanguageId:378},{name:"TSX",type:"programming",aceMode:"tsx",extensions:[".tsx"],tmScope:"source.tsx",aliases:["typescriptreact"],codemirrorMode:"jsx",codemirrorMimeType:"text/typescript-jsx",group:"TypeScript",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescriptreact"],linguistLanguageId:94901924}];var Bi={};Co(Bi,{estree:()=>Si});function nc(e){return Array.isArray(e)&&e.length>0}var j=nc;var oc=()=>{},ve=oc;function B(e){let t=new Set(e);return r=>t.has(r?.type)}var Qt=(e,t)=>(r,n,...o)=>r|1&&n==null?void 0:(t.call(n)??n[e]).apply(n,o);function ic(e){return this[e<0?this.length+e:e]}var sc=Qt("at",function(){if(Array.isArray(this)||typeof this=="string")return ic}),L=sc;function Z(e,t,r){if(!e.has(t)){let n=r(t);e.set(t,n)}return e.get(t)}function uc(e){let t=[];return e.this&&t.push(e.this),t.push(...e.params),e.rest&&t.push(e.rest),t}var ac=new WeakMap;function ee(e){return Z(ac,e,uc)}function _i(e,t){let{node:r}=e,n=0,o=()=>t(e,n++);r.this&&e.call(o,"this"),e.each(o,"params"),r.rest&&e.call(o,"rest")}function Ni(e){if(e.rest)return!0;let t=ee(e);return L(0,t,-1)?.type==="RestElement"}var ji=e=>e?.type==="TSAsExpression"&&e.typeAnnotation.type==="TSTypeReference"&&e.typeAnnotation.typeName.type==="Identifier"&&e.typeAnnotation.typeName.name==="const";function zt({node:e,parent:t}){return e?.type!=="EmptyStatement"?!1:t.type==="IfStatement"?t.consequent===e||t.alternate===e:t.type==="DoWhileStatement"||t.type==="ForInStatement"||t.type==="ForOfStatement"||t.type==="ForStatement"||t.type==="LabeledStatement"||t.type==="WithStatement"||t.type==="WhileStatement"?t.body===e:!1}function Ke(e){return e.method&&e.kind==="init"||e.kind==="get"||e.kind==="set"}var xo=e=>Number.isSafeInteger(e)&&e>=0;function It(e){return e.range?.[1]??e.end}function b(e){let t=e.range?.[0]??e.start,r=(e.declaration?.decorators??e.decorators)?.[0];return r?Math.min(b(r),t):t}var pc=5,cc=8,lc=8,vi=e=>t=>t.label?S(t.label):b(t)+e,mc=e=>e.__contentEnd??It(e),Ri=["ExpressionStatement","Directive","ImportDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExportAllDeclaration","ReturnStatement","ThrowStatement","DoWhileStatement"],fc=new Map([["BreakStatement",vi(pc)],["ContinueStatement",vi(cc)],["DebuggerStatement",e=>b(e)+lc],["VariableDeclaration",e=>S(L(0,e.declarations,-1))],...Ri.map(e=>[e,mc])]),Wi=B(Ri),Pr=e=>{if(Wi(e)&&e.__contentEnd)return!0;let{type:t}=e;return t==="BreakStatement"||t==="ContinueStatement"||t==="DebuggerStatement"||t==="VariableDeclaration"?!0:t==="IfStatement"?Pr(e.alternate??e.consequent):t==="ForInStatement"||t==="ForOfStatement"||t==="ForStatement"||t==="LabeledStatement"||t==="WithStatement"||t==="WhileStatement"?Pr(e.body):!1};function S(e){let{type:t}=e;return t==="IfStatement"?S(e.alternate??e.consequent):t==="ForInStatement"||t==="ForOfStatement"||t==="ForStatement"||t==="LabeledStatement"||t==="WithStatement"||t==="WhileStatement"?S(e.body):fc.get(t)?.(e)??It(e)}function kt(e,t){let r=b(e);return xo(r)&&r===b(t)}function Dc(e,t){let r=S(e);return xo(r)&&r===S(t)}function Ao(e,t){return kt(e,t)&&Dc(e,t)}function ye(e){return e.extra?.raw??e.raw}function Ji(e){return e.type==="BigIntLiteral"||e.type==="Literal"&&!!e.bigint}function Gi(e){return e.type==="BooleanLiteral"||e.type==="Literal"&&typeof e.value=="boolean"}function Ee(e){return e.type==="NumericLiteral"||e.type==="Literal"&&typeof e.value=="number"}function Xr(e){return e.type==="RegExpLiteral"||e.type==="Literal"&&!!e.regex}function q(e){return e?.type==="StringLiteral"||e?.type==="Literal"&&typeof e.value=="string"}var de=B(["TSAsExpression","TSSatisfiesExpression","AsExpression","AsConstExpression","SatisfiesExpression"]),Ui=B(["SatisfiesExpression","TSSatisfiesExpression"]),pe=B(["TSUnionType","UnionTypeAnnotation"]),At=B(["TSIntersectionType","IntersectionTypeAnnotation"]),Zt=B(["TupleTypeAnnotation","TSTupleType"]),$e=B(["TSConditionalType","ConditionalTypeAnnotation"]),Vr=B(["TSTypeAliasDeclaration","TypeAlias"]),ut=B(["ReturnStatement","ThrowStatement"]),qi=B(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),Y=B(["ArrayExpression"]),ie=B(["ObjectExpression"]),er=B(["Literal","BooleanLiteral","BigIntLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),Ue=B(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),wt=B(["FunctionExpression","ArrowFunctionExpression"]),H=B(["JSXElement","JSXFragment"]),Be=B(["BinaryExpression","LogicalExpression","NGPipeExpression"]),M=B(["CallExpression","OptionalCallExpression"]),N=B(["MemberExpression","OptionalMemberExpression"]),Tt=B(["CallExpression","OptionalCallExpression","NewExpression"]),Dt=B(["CallExpression","OptionalCallExpression","NewExpression","ImportExpression"]),Re=B(["ChainExpression","TSNonNullExpression"]),Yi=B(["TSArrayType","ArrayTypeAnnotation"]),Hi=B(["TSTypeParameterInstantiation","TypeParameterInstantiation"]);function Ir(e){if(e.type!=="ImportSpecifier"&&e.type!=="ExportSpecifier")return!1;let{local:t,[e.type==="ImportSpecifier"?"imported":"exported"]:r}=e;return t.type!==r.type||!Ao(t,r)?!1:q(t)?t.value===r.value&&ye(t)===ye(r):t.type==="Identifier"?t.name===r.name:!1}var yc=B(["File","TemplateElement","TSEmptyBodyFunctionExpression","ChainExpression"]),Ec=(e,[t])=>t?.type==="ComponentParameter"&&t.shorthand&&t.name===e&&t.local!==t.name||t?.type==="MatchObjectPatternProperty"&&t.shorthand&&t.key===e||t?.type==="ObjectProperty"&&t.shorthand&&t.key===e&&t.value!==t.key||t?.type==="Property"&&t.shorthand&&t.key===e&&!Ke(t)&&t.value!==t.key||t?.type==="ImportSpecifier"&&Ir(t)&&t.imported===e&&t.imported!==t.local||t?.type==="ExportSpecifier"&&Ir(t)&&t.local===e&&t.local!==t.exported,dc=(e,[t])=>!!(e.type==="FunctionExpression"&&t.type==="MethodDefinition"&&t.value===e&&ee(e).length===0&&!e.returnType&&!j(e.typeParameters)&&e.body),Xi=(e,[t])=>t?.typeAnnotation===e&&ji(t),Cc=(e,[t,...r])=>Xi(e,[t])||t?.typeName===e&&Xi(t,r);function Fc(e,t){return yc(e)||Ec(e,t)||dc(e,t)?!1:e.type==="EmptyStatement"?zt({node:e,parent:t[0]}):!(Cc(e,t)||e.type==="TSTypeAnnotation"&&t[0].type==="TSPropertySignature")}var Vi=Fc;function xc(e){let t=e.type||e.kind||"(unknown type)",r=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function To(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=xc(e)}function K(e,t){t.leading=!0,t.trailing=!1,To(e,t)}function be(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),To(e,t)}function X(e,t){t.leading=!1,t.trailing=!0,To(e,t)}function Kr(e){return(t,r,n)=>{if(r===!1)return!1;let o=!!n?.backwards,{length:i}=t,s=r;for(;s>=0&&s<i;){let u=t.charAt(s);if(e instanceof RegExp){if(!e.test(u))return s}else if(!e.includes(u))return s;o?s--:s++}return s===-1||s===i?s:!1}}var DE=Kr(/\s/),at=Kr(" "),Ki=Kr(",; "),$i=Kr(/[^\n\r]/);function Ac(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t}var tr=Ac;var Qi=e=>e===` `||e==="\r"||e==="\u2028"||e==="\u2029";function Tc(e,t,r){if(t===!1)return!1;let n=!!r?.backwards,o=e.charAt(t);if(n){if(e.charAt(t-1)==="\r"&&o===` `)return t-2;if(Qi(o))return t-1}else{if(o==="\r"&&e.charAt(t+1)===` `)return t+2;if(Qi(o))return t+1}return t}var pt=Tc;function gc(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?$i(e,t):t}var rr=gc;function hc(e,t){let r=null,n=t;for(;n!==r;)r=n,n=at(e,n),n=tr(e,n),n=rr(e,n),n=pt(e,n);return n}var Wt=hc;function Sc(e,t){let r=Wt(e,t);return r===!1?"":e.charAt(r)}var Qe=Sc;function Bc(e,t,r={}){let n=at(e,r.backwards?t-1:t,r),o=pt(e,n,r);return n!==o}var J=Bc;function bc(e,t,r){for(let n=t;n<r;++n)if(e.charAt(n)===` `)return!0;return!1}var te=bc;var Pc=new WeakMap;function Ic(e){let t;return e.type==="ImportExpression"||e.type==="TSImportType"?(t=[e.source],e.options&&t.push(e.options)):e.type==="TSExternalModuleReference"?t=[e.expression]:t=e.arguments,t}function se(e){return Z(Pc,e,Ic)}function kr(e,t){let{node:r}=e;r.type==="ImportExpression"||r.type==="TSImportType"?(e.call(()=>t(e,0),"source"),r.options&&e.call(()=>t(e,1),"options")):r.type==="TSExternalModuleReference"?e.call(()=>t(e,0),"expression"):e.each(t,"arguments")}function go(e,t){if(e.type==="ImportExpression"||e.type==="TSImportType"){if(t===0||t===(e.options?-2:-1))return["source"];if(e.options&&(t===1||t===-1))return["options"];throw new RangeError("Invalid argument index")}if(e.type==="TSExternalModuleReference"){if(t===0||t===-1)return["expression"]}else if(t<0&&(t=e.arguments.length+t),t>=0&&t<e.arguments.length)return["arguments",t];throw new RangeError("Invalid argument index")}var zi=Symbol.for("comments");var kc=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},wc=Qt("replaceAll",function(){if(typeof this=="string")return kc}),V=wc;function Lc(e){return V(0,e,/[^\n]/g," ")}var Zi=Lc;function Oc(e,t){for(let r of t){let n=b(r),o=S(r);e=e.slice(0,n)+Zi(e.slice(n,o))+e.slice(o)}return e}var Mc=new WeakMap;function ce(e){let t=e[zi];return Z(Mc,t,r=>Oc(e.originalText,r))}function es(e,t){let r=S(e)-1;if(t.originalText[r]===")")return r}function _c(e,t){if(es(e,t)===void 0)return;let n=ce(t),o=S(e.typeArguments??e.callee),i=n.indexOf("(",o);if(i!==-1)return i}function ts(e,t,r){let n=es(e,r);if(n===void 0||S(t)>n)return!1;let o=_c(e,r);return o===void 0?!1:b(t)>o}var le=B(["Block","CommentBlock","MultiLine"]),qe=B(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]);function We(e){return e?.type==="ObjectProperty"||e?.type==="Property"&&!Ke(e)}function yt(e){return e.value.trim()==="prettier-ignore"&&!e.unignore}var Nc=new WeakMap;function nr(e){return Z(Nc,e,t=>le(t)&&t.value[0]==="*"&&/@(?:type|satisfies)\b/.test(t.value))}function $r({comment:e,enclosingNode:t,followingNode:r,options:n}){if((t?.type==="ForInStatement"||t?.type==="ForOfStatement"||t?.type==="ForStatement")&&r&&r===t.body){let o=ce(n).lastIndexOf(")",b(r));if(b(e)>o)return K(r,e),!0}return!1}var ho=(e,t)=>le(e)&&!te(t,b(e),S(e)),wr=(e,t)=>qe(e)||ho(e,t);function Qr(e,t){e.type==="BlockStatement"?or(e,t):K(e,t)}function or(e,t){let r=(e.body||e.properties).find(({type:n})=>n!=="EmptyStatement");r?K(r,t):be(e,t)}function zr({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:o,options:i}){return r?.type!=="IfStatement"||!n?!1:Qe(o,S(e))===")"?(X(t,e),!0):n===r.consequent?(K(n,e),!0):t===r.consequent&&n===r.alternate?jc({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:o,options:i}):!1}function jc({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:o,options:i}){let s=ce(i).indexOf("else",S(r.consequent));return b(e)>=s?(K(n,e),!0):!(t.type==="BlockStatement")&&wr(e,o)&&!te(o,S(t),b(e))?(X(t,e),!0):(be(r,e),!0)}function Zr({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:o}){return(r?.type==="WhileStatement"||r?.type==="WithStatement")&&n?Qe(o,S(e))===")"?(X(t,e),!0):r.body===n?(K(n,e),!0):!1:!1}function So(e,{comment:t,text:r,options:n}){if(pe(e)&&ho(t,r)&&!yt(t)){let i=ce(n).slice(S(t),b(e));return/^[ \t]*$/.test(i)}return!1}function Bo(e,t){return K(So(e,t)?e.types[0]:e,t.comment),!0}function vc(e){return[bo,fs,is,ps,Gc,zr,Zr,os,ss,$r,Kc,$c,Po,ls,zc,us,cs,Uc,il,Io,ko,ys].some(t=>t(e))}function Rc(e){return[bo,Jc,ps,is,ls,zr,Zr,os,ss,$r,cs,Vc,Qc,Po,ms,nl,ol,sl,Io,pl,Ds,ul,ko].some(t=>t(e))}function Wc(e){return[bo,fs,zr,Zr,$r,us,Po,ms,Io,Hc,Yc,tl,Ds,ko,ys].some(t=>t(e))}function Jc({comment:e,followingNode:t}){return t&&nr(e)?(K(t,e),!0):!1}function os({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return r?.type!=="TryStatement"&&r?.type!=="CatchClause"||!n?!1:r.type==="CatchClause"&&t?(X(t,e),!0):n.type==="BlockStatement"?(or(n,e),!0):n.type==="TryStatement"?(Qr(n.finalizer,e),!0):n.type==="CatchClause"?(Qr(n.body,e),!0):!1}function Gc({comment:e,enclosingNode:t,followingNode:r}){return N(t)&&r?.type==="Identifier"?(K(t,e),!0):!1}function Uc({comment:e,enclosingNode:t,followingNode:r,options:n}){return!n.experimentalTernaries||!(t?.type==="ConditionalExpression"||$e(t))?!1:r?.type==="ConditionalExpression"||$e(r)?(be(t,e),!0):!1}function is({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:o,options:i}){let s=t&&!te(o,S(t),b(e));return(!t||!s)&&(r?.type==="ConditionalExpression"||$e(r))&&n?i.experimentalTernaries&&r.alternate===n&&!(le(e)&&!te(i.originalText,b(e),S(e)))?(be(r,e),!0):(K(n,e),!0):!1}var qc=B(["ClassDeclaration","ClassExpression","DeclareClass","DeclareInterface","InterfaceDeclaration","TSInterfaceDeclaration"]);function ss({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){if(qc(r)){let{decorators:o}=r;if(j(o)&&n?.type!=="Decorator")return X(L(0,o,-1),e),!0;if(r.body&&n===r.body)return or(r.body,e),!0;if(n){let{superClass:i}=r;if(i&&n===i&&t&&(t===r.id||t===r.typeParameters))return X(t,e),!0;for(let s of["implements","extends","mixins"])if(r[s]&&n===r[s][0])return t&&(t===r.id||t===r.typeParameters||t===i)?X(t,e):be(r,e,s),!0}}return!1}var rs=B(["ClassMethod","ClassProperty","PropertyDefinition","TSAbstractPropertyDefinition","TSAbstractMethodDefinition","TSDeclareMethod","MethodDefinition","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty","TSParameterProperty"]);function us({placement:e,comment:t,precedingNode:r,enclosingNode:n,followingNode:o,text:i}){return n&&r&&Qe(i,S(t))==="("&&(n.type==="Property"||n.type==="TSDeclareMethod"||n.type==="TSAbstractMethodDefinition")&&r.type==="Identifier"&&n.key===r&&Qe(i,S(r))!==":"?(X(r,t),!0):rs(n)&&!o&&e==="remaining"?(X(Qe(i,S(t))==="("?r:n,t),!0):r?.type==="Decorator"&&rs(n)&&(qe(t)||e==="ownLine")?(X(r,t),!0):!1}var as=B(["FunctionDeclaration","FunctionExpression","ClassMethod","MethodDefinition","ObjectMethod"]);function Yc({comment:e,precedingNode:t,enclosingNode:r,text:n}){return Qe(n,S(e))!=="("?!1:t&&as(r)?(X(t,e),!0):!1}function Hc({comment:e,enclosingNode:t,text:r}){if(t?.type!=="ArrowFunctionExpression")return!1;let n=Wt(r,S(e));return n!==!1&&r.slice(n,n+2)==="=>"?(be(t,e,"commentBeforeArrow"),!0):!1}function ns(e,t,r){let n=b(t),o=S(e);if(n>=o)return!1;let i=S(t),s=b(e);if(i<=s)return!1;let u=ce(r);return u.slice(0,b(t)).trimEnd().endsWith("(")&&u.slice(S(t)).trimStart().startsWith(")")}var Xc=B(["ComponentDeclaration","DeclareComponent","ComponentTypeAnnotation"]);function bo({comment:e,enclosingNode:t,options:r}){if(!t)return!1;if(Dt(t)&&se(t).length===0&&ns(t,e,r))return be(t,e),!0;let n=Es(t)||Xc(t)||t.type==="HookTypeAnnotation"?t:t.type==="MethodDefinition"||t.type==="TSAbstractMethodDefinition"||t.type==="Property"&&Ke(t)?t.value:void 0;return n&&ee(n).length===0&&ns(n,e,r)?(be(n,e),!0):!1}function ps({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:o}){return t?.type==="FunctionTypeParam"&&r?.type==="FunctionTypeAnnotation"&&n?.type!=="FunctionTypeParam"?(X(t,e),!0):t?.type==="ComponentTypeParameter"&&(r?.type==="DeclareComponent"||r?.type==="ComponentTypeAnnotation")&&n?.type!=="ComponentTypeParameter"?(X(t,e),!0):(t?.type==="Identifier"||t?.type==="AssignmentPattern"||t?.type==="ObjectPattern"||t?.type==="ArrayPattern"||t?.type==="RestElement"||t?.type==="TSParameterProperty")&&(Es(r)||(r?.type==="TSAbstractMethodDefinition"||r?.type==="MethodDefinition")&&r.value.type==="TSEmptyBodyFunctionExpression")&&Qe(o,S(e))===")"?(X(t,e),!0):(t?.type==="ComponentParameter"||t?.type==="RestElement")&&(r?.type==="ComponentDeclaration"||r?.type==="DeclareComponent")&&Qe(o,S(e))===")"?(X(t,e),!0):!le(e)&&n?.type==="BlockStatement"&&as(r)&&(r.type==="MethodDefinition"?r.value.body:r.body)===n&&Wt(o,S(e))===b(n)?(or(n,e),!0):!1}function cs({comment:e,enclosingNode:t}){return t?.type==="LabeledStatement"?(K(t,e),!0):!1}function Vc({comment:e,precedingNode:t,enclosingNode:r,options:n}){return Tt(r)&&r.callee===t&&r.arguments.length>0&&ts(r,e,n)?(K(r.arguments[0],e),!0):!1}function Kc({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return pe(r)?(yt(e)&&(n.prettierIgnore=!0,e.unignore=!0),t?(X(t,e),!0):!1):(pe(n)&&yt(e)&&(n.types[0].prettierIgnore=!0,e.unignore=!0),!1)}function $c({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return r&&r.type==="MatchOrPattern"?(yt(e)&&(n.prettierIgnore=!0,e.unignore=!0),t?(X(t,e),!0):!1):(n&&n.type==="MatchOrPattern"&&yt(e)&&(n.types[0].prettierIgnore=!0,e.unignore=!0),!1)}function Qc({comment:e,enclosingNode:t}){return We(t)?(K(t,e),!0):!1}function Po({comment:e,enclosingNode:t,ast:r,isLastComment:n}){return r?.body?.length===0?(n?be(r,e):K(r,e),!0):t?.type==="Program"&&t.body.length===0&&!j(t.directives)?(n?be(t,e):K(t,e),!0):!1}function ls({comment:e,precedingNode:t,enclosingNode:r,text:n}){if(r?.type==="ImportSpecifier"||r?.type==="ExportSpecifier")return K(r,e),!0;let o=t?.type==="ImportSpecifier"&&r?.type==="ImportDeclaration",i=t?.type==="ExportSpecifier"&&r?.type==="ExportNamedDeclaration";return(o||i)&&J(n,S(e))?(X(t,e),!0):!1}function zc({comment:e,enclosingNode:t}){return t?.type==="AssignmentPattern"?(K(t,e),!0):!1}var Zc=B(["VariableDeclarator","AssignmentExpression","TypeAlias","TSTypeAliasDeclaration"]),el=B(["ObjectExpression","ArrayExpression","TemplateLiteral","TaggedTemplateExpression","ObjectTypeAnnotation","TSTypeLiteral"]);function ms(e){let{comment:t,enclosingNode:r,followingNode:n,options:o,placement:i}=e;if(Zc(r)&&n&&i==="endOfLine"&&(el(n)||le(t)))return Bo(n,e);if(Vr(r)&&n){let s=r.id,u=ce(o).indexOf("=",S(s));if(b(t)>=u)return Bo(n,e)}return!1}function tl({comment:e,enclosingNode:t,precedingNode:r,followingNode:n,text:o}){return!n&&(t?.type==="TSMethodSignature"||t?.type==="TSDeclareFunction"||t?.type==="TSAbstractMethodDefinition")&&(!r||r!==t.returnType)&&Qe(o,S(e))===";"?(X(t,e),!0):!1}function fs({comment:e,enclosingNode:t,followingNode:r}){if(yt(e)&&t?.type==="TSMappedType"&&r===t.key)return t.prettierIgnore=!0,e.unignore=!0,!0}function rl(e,t,r){let n=ce(r).indexOf("[",b(e));return S(t)<n}function Io({comment:e,enclosingNode:t,options:r}){if(t?.type==="TSMappedType"&&rl(t,e,r))return be(t,e),!0}function nl({comment:e,enclosingNode:t,followingNode:r}){return!t||t.type!=="SwitchCase"||t.test||!r||r!==t.consequent[0]?!1:(r.type==="BlockStatement"&&qe(e)?or(r,e):be(t,e),!0)}function ol({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return pe(t)&&(Yi(r)&&!n||At(r)||pe(r))?(X(L(0,t.types,-1),e),!0):!1}function il({comment:e,enclosingNode:t,precedingNode:r,followingNode:n}){if((t?.type==="ObjectPattern"||t?.type==="ArrayPattern")&&n?.type==="TSTypeAnnotation")return r?X(r,e):be(t,e),!0}function sl({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:o}){return!n&&r?.type==="UnaryExpression"&&(t?.type==="LogicalExpression"||t?.type==="BinaryExpression")&&te(o,b(r.argument),b(t.right))&&wr(e,o)&&!te(o,b(t.right),b(e))?(X(t.right,e),!0):!1}function ul({enclosingNode:e,followingNode:t,comment:r}){if(e&&(e.type==="TSPropertySignature"||e.type==="ObjectTypeProperty")&&(pe(t)||At(t)))return K(t,r),!0}function ko({enclosingNode:e,precedingNode:t,followingNode:r,comment:n,text:o}){if(de(e)&&t===e.expression&&!wr(n,o))return r?K(r,n):X(e,n),!0}function al(e,t,r){let n=ce(r).lastIndexOf("=>",b(t.body));return S(e)<n}function pl({comment:e,enclosingNode:t,followingNode:r,precedingNode:n,options:o}){return t?.type!=="ArrowFunctionExpression"||!r||!n||al(e,t,o)?!1:(Qr(r,e),!0)}function Ds({comment:e,enclosingNode:t,precedingNode:r,followingNode:n}){if(!n&&t&&r){if(t.type==="ExpressionStatement"&&t.expression===r)return X(t,e),!0;let o=r.type==="SequenceExpression",i=r.type==="AssignmentExpression";if((o||i)&&(t.type==="ArrowFunctionExpression"&&t.body===r||t.type==="VariableDeclarator"&&t.init===r||t.type==="ReturnStatement"&&t.argument===r||t.type==="AssignmentExpression"&&t.right===r))return X(o?L(0,r.expressions,-1):r.right,e),!0}return!1}function ys(e){let{followingNode:t,comment:r}=e;return So(t,e)?(K(t.types[0],r),!0):!1}var Es=B(["ArrowFunctionExpression","FunctionExpression","FunctionDeclaration","ObjectMethod","ClassMethod","TSDeclareFunction","TSCallSignatureDeclaration","TSConstructSignatureDeclaration","TSMethodSignature","TSConstructorType","TSFunctionType","TSDeclareMethod","HookDeclaration"]),cl={endOfLine:Rc,ownLine:vc,remaining:Wc},ds=cl;function ll(e,{parser:t}){if(t==="flow"||t==="hermes"||t==="babel-flow")return e=V(0,e,/[\s(]/g,""),e===""||e==="/*"||e==="/*::"}var Cs=ll;var T={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},Fs=(e,t)=>{if(typeof e=="function"&&(t=e,e=0),e||t)return(r,n,o)=>!(e&T.Leading&&!r.leading||e&T.Trailing&&!r.trailing||e&T.Dangling&&(r.leading||r.trailing)||e&T.Block&&!le(r)||e&T.Line&&!qe(r)||e&T.First&&n!==0||e&T.Last&&n!==o.length-1||e&T.PrettierIgnore&&!yt(r)||t&&!t(r))};function C(e,t,r){if(!j(e?.comments))return!1;let n=Fs(t,r);return n?e.comments.some(n):!0}function oe(e,t,r){if(!Array.isArray(e?.comments))return[];let n=Fs(t,r);return n?e.comments.filter(n):e.comments}function Lt(e){return e?.prettierIgnore||C(e,T.PrettierIgnore)}function en(e){let{node:t}=e;return(t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression")&&(e.key==="callee"&&M(e.parent)||e.key==="tag"&&e.parent.type==="TaggedTemplateExpression")}var ml=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((e,t)=>e.map(r=>[r,t])));function ir(e){return ml.get(e)}var xs={"==":!0,"!=":!0,"===":!0,"!==":!0},tn={"*":!0,"/":!0,"%":!0},rn={">>":!0,">>>":!0,"<<":!0};function Lr(e,t){return!(ir(t)!==ir(e)||e==="**"||xs[e]&&xs[t]||t==="%"&&tn[e]||e==="%"&&tn[t]||t!==e&&tn[t]&&tn[e]||rn[e]&&rn[t])}function As(e){return!!rn[e]||e==="|"||e==="^"||e==="&"}function Ts(e){return e.type==="LogicalExpression"&&e.operator==="??"}function Ce(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return Ce(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return Ce(e.object,t);case"TaggedTemplateExpression":return e.tag.type==="FunctionExpression"?!1:Ce(e.tag,t);case"CallExpression":case"OptionalCallExpression":return e.callee.type==="FunctionExpression"?!1:Ce(e.callee,t);case"ConditionalExpression":return Ce(e.test,t);case"UpdateExpression":return!e.prefix&&Ce(e.argument,t);case"BindExpression":return e.object&&Ce(e.object,t);case"SequenceExpression":return Ce(e.expressions[0],t);case"ChainExpression":case"TSNonNullExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return Ce(e.expression,t);default:return t(e)}}function fl(e){let{key:t,parent:r}=e;return t==="expression"&&r.type==="TSNonNullExpression"||t==="object"&&r.type==="MemberExpression"&&!r.optional||t==="callee"&&r.type==="CallExpression"&&!r.optional||t==="callee"&&r.type==="NewExpression"||t==="tag"&&r.type==="TaggedTemplateExpression"}var gs=e=>e.extra?.parenthesized,Dl=B(["OptionalCallExpression","OptionalMemberExpression"]);function yl(e){let{node:t}=e,r=t;for(;r.type==="TSNonNullExpression";)if(r=r.expression,gs(r))return!1;return Dl(r)?gs(t)?!0:!(e.key==="expression"&&e.parent.type==="TSNonNullExpression"):!1}function hs(e){return(e.node.type==="ChainExpression"||yl(e))&&fl(e)}function Ss(e){let{node:t}=e;if(t.type!=="Identifier")return!1;if(t.extra?.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/.test(t.name))return!0;let{key:r,parent:n}=e;if(r==="left"&&(t.name==="async"&&!n.await||t.name==="let")&&n.type==="ForOfStatement")return!0;if(t.name==="let"){let o=e.findAncestor(i=>i.type==="ForOfStatement"||i.type==="ForInStatement")?.left;if(o&&Ce(o,i=>i===t))return!0}if(r==="object"&&t.name==="let"&&n.type==="MemberExpression"&&n.computed&&!n.optional){let o=e.findAncestor(s=>s.type==="ExpressionStatement"||s.type==="ForStatement"||s.type==="ForInStatement"),i=o?o.type==="ExpressionStatement"?o.expression:o.type==="ForStatement"?o.init:o.left:void 0;if(i&&Ce(i,s=>s===t))return!0}if(r==="expression")switch(t.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"component":case"hook":case"type":{let o=e.findAncestor(i=>!de(i));if(o!==n&&o.type==="ExpressionStatement")return!0}}return!1}function El(e){return e!==null&&typeof e=="object"}var nn=El;function*dl(e,t){let{getVisitorKeys:r,filter:n=()=>!0}=t,o=i=>nn(i)&&n(i);for(let i of r(e)){let s=e[i];if(Array.isArray(s))for(let u of s)o(u)&&(yield u);else o(s)&&(yield s)}}function*Cl(e,t){let r=[e];for(let n=0;n<r.length;n++){let o=r[n];for(let i of dl(o,t))yield i,r.push(i)}}function Bs(e,{getVisitorKeys:t,predicate:r}){for(let n of Cl(e,{getVisitorKeys:t}))if(r(n))return!0;return!1}var Or=null;function Mr(e){if(Or!==null&&typeof Or.property){let t=Or;return Or=Mr.prototype=null,t}return Or=Mr.prototype=e??Object.create(null),new Mr}var Fl=10;for(let e=0;e<=Fl;e++)Mr();function wo(e){return Mr(e)}function xl(e,t="type"){wo(e);function r(n){let o=n[t],i=e[o];if(!Array.isArray(i))throw Object.assign(new Error(`Missing visitor keys for '${o}'.`),{node:n});return i}return r}var on=xl;var l=[["elements"],["left","right"],["value"],["directives","body"],["label"],["callee","typeArguments","arguments"],["test","consequent","alternate"],["body","test"],["expression"],["left","right","body"],["id","typeParameters","params","predicate","returnType","body"],["object","property"],["properties"],["decorators","key","typeParameters","params","returnType","body"],["decorators","key","value"],["argument"],["expressions"],["id","init"],["body"],["decorators","id","typeParameters","superClass","superTypeArguments","mixins","implements","body"],["declaration","specifiers","source","attributes"],["local"],["exported"],["decorators","variance","key","typeAnnotation","value"],["id"],["key","value"],["elementType"],["id","typeParameters"],["id","typeParameters","extends","body"],["id","body"],["typeAnnotation"],["id","typeParameters","right"],["name","typeAnnotation"],["types"],["qualification","id"],["elementTypes"],["expression","typeAnnotation"],["params"],["members"],["objectType","indexType"],["decorators","key","typeAnnotation","value"],["id","typeParameters","params","returnType","body"],["key","typeParameters","params","returnType"],["typeParameters","params","returnType"],["parameterName","typeAnnotation"],["checkType","extendsType","trueType","falseType"],["typeParameter"],["literal"],["expression","typeArguments"],["decorators","key","typeAnnotation"],["argument","cases"],["pattern","body","guard"],["properties","rest"],["node"]],bs={ArrayExpression:l[0],AssignmentExpression:l[1],BinaryExpression:l[1],InterpreterDirective:[],Directive:l[2],DirectiveLiteral:[],BlockStatement:l[3],BreakStatement:l[4],CallExpression:l[5],CatchClause:["param","body"],ConditionalExpression:l[6],ContinueStatement:l[4],DebuggerStatement:[],DoWhileStatement:l[7],EmptyStatement:[],ExpressionStatement:l[8],File:["program"],ForInStatement:l[9],ForStatement:["init","test","update","body"],FunctionDeclaration:l[10],FunctionExpression:l[10],Identifier:["typeAnnotation","decorators"],IfStatement:l[6],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:l[1],MemberExpression:l[11],NewExpression:l[5],Program:l[3],ObjectExpression:l[12],ObjectMethod:l[13],ObjectProperty:l[14],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:l[15],SequenceExpression:l[16],ParenthesizedExpression:l[8],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:l[15],TryStatement:["block","handler","finalizer"],UnaryExpression:l[15],UpdateExpression:l[15],VariableDeclaration:["declarations"],VariableDeclarator:l[17],WhileStatement:l[7],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["typeParameters","params","predicate","returnType","body"],ClassBody:l[18],ClassExpression:l[19],ClassDeclaration:l[19],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:l[20],ExportSpecifier:["local","exported"],ForOfStatement:l[9],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:l[21],ImportNamespaceSpecifier:l[21],ImportSpecifier:["imported","local"],MetaProperty:["meta","property"],ClassMethod:l[13],ObjectPattern:["decorators","properties","typeAnnotation"],SpreadElement:l[15],Super:[],TaggedTemplateExpression:["tag","typeArguments","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:l[15],AwaitExpression:l[15],ImportExpression:["source","options"],BigIntLiteral:[],ExportNamespaceSpecifier:l[22],OptionalMemberExpression:l[11],OptionalCallExpression:l[5],ClassProperty:l[23],ClassPrivateProperty:l[23],ClassPrivateMethod:l[13],PrivateName:l[24],StaticBlock:l[18],ImportAttribute:l[25],AnyTypeAnnotation:[],ArrayTypeAnnotation:l[26],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:l[27],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:l[28],DeclareModule:l[29],DeclareModuleExports:l[30],DeclareTypeAlias:l[31],DeclareOpaqueType:["id","typeParameters","supertype","lowerBound","upperBound"],DeclareVariable:["id","declarations"],DeclareExportDeclaration:l[20],DeclareExportAllDeclaration:["source","attributes"],DeclaredPredicate:l[2],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","this","params","rest","returnType"],FunctionTypeParam:l[32],GenericTypeAnnotation:l[27],InferredPredicate:[],InterfaceExtends:l[27],InterfaceDeclaration:l[28],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:l[33],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:l[30],NumberLiteralTypeAnnotation:[],BigIntLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value"],ObjectTypeCallProperty:l[2],ObjectTypeIndexer:["variance","id","key","value"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:l[15],OpaqueType:["id","typeParameters","supertype","impltype","lowerBound","upperBound"],QualifiedTypeIdentifier:l[34],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:l[35],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:l[31],TypeAnnotation:l[30],TypeCastExpression:l[36],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:l[37],TypeParameterInstantiation:l[37],UnionTypeAnnotation:l[33],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:l[29],EnumBooleanBody:l[38],EnumNumberBody:l[38],EnumStringBody:l[38],EnumSymbolBody:l[38],EnumBooleanMember:l[17],EnumNumberMember:l[17],EnumStringMember:l[17],EnumDefaultedMember:l[24],IndexedAccessType:l[39],OptionalIndexedAccessType:l[39],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:l[8],JSXSpreadChild:l[8],JSXIdentifier:[],JSXMemberExpression:l[11],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","typeArguments","attributes"],JSXSpreadAttribute:l[15],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ClassAccessorProperty:l[40],Decorator:l[8],DoExpression:l[18],ExportDefaultSpecifier:l[22],ModuleExpression:l[18],TopicReference:[],VoidPattern:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:l[41],TSDeclareMethod:l[42],TSQualifiedName:l[1],TSCallSignatureDeclaration:l[43],TSConstructSignatureDeclaration:l[43],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:l[42],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:l[43],TSConstructorType:l[43],TSTypeReference:["typeName","typeArguments"],TSTypePredicate:l[44],TSTypeQuery:["exprName","typeArguments"],TSTypeLiteral:l[38],TSArrayType:l[26],TSTupleType:l[35],TSOptionalType:l[30],TSRestType:l[30],TSNamedTupleMember:["label","elementType"],TSUnionType:l[33],TSIntersectionType:l[33],TSConditionalType:l[45],TSInferType:l[46],TSParenthesizedType:l[30],TSTypeOperator:l[30],TSIndexedAccessType:l[39],TSMappedType:["key","constraint","nameType","typeAnnotation"],TSTemplateLiteralType:["quasis","types"],TSLiteralType:l[47],TSClassImplements:l[48],TSInterfaceHeritage:l[48],TSInterfaceDeclaration:l[28],TSInterfaceBody:l[18],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:l[48],TSAsExpression:l[36],TSSatisfiesExpression:l[36],TSTypeAssertion:l[36],TSEnumBody:l[38],TSEnumDeclaration:l[29],TSEnumMember:["id","initializer"],TSModuleDeclaration:l[29],TSModuleBlock:l[18],TSImportType:["source","options","qualifier","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:l[8],TSNonNullExpression:l[8],TSExportAssignment:l[8],TSNamespaceExportDeclaration:l[24],TSTypeAnnotation:l[30],TSTypeParameterInstantiation:l[37],TSTypeParameterDeclaration:l[37],TSTypeParameter:["name","constraint","default"],ChainExpression:l[8],Literal:[],MethodDefinition:l[14],PrivateIdentifier:[],Property:l[25],PropertyDefinition:l[23],AccessorProperty:l[40],TSAbstractAccessorProperty:l[49],TSAbstractKeyword:[],TSAbstractMethodDefinition:l[25],TSAbstractPropertyDefinition:l[49],TSAsyncKeyword:[],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],AsConstExpression:l[8],AsExpression:l[36],BigIntTypeAnnotation:[],ComponentDeclaration:["id","params","body","typeParameters","rendersType"],ComponentParameter:["name","local"],ComponentTypeAnnotation:["params","rest","typeParameters","rendersType"],ComponentTypeParameter:l[32],ConditionalTypeAnnotation:l[45],DeclareComponent:["id","params","rest","typeParameters","rendersType"],DeclareEnum:l[29],DeclareHook:l[24],DeclareNamespace:l[29],EnumBigIntBody:l[38],EnumBigIntMember:l[17],EnumBody:l[38],HookDeclaration:l[41],HookTypeAnnotation:["params","returnType","rest","typeParameters"],InferTypeAnnotation:l[46],KeyofTypeAnnotation:l[15],MatchArrayPattern:["elements","rest"],MatchAsPattern:["pattern","target"],MatchBindingPattern:l[24],MatchExpression:l[50],MatchExpressionCase:l[51],MatchIdentifierPattern:l[24],MatchInstanceObjectPattern:l[52],MatchInstancePattern:["targetConstructor","properties"],MatchLiteralPattern:l[47],MatchMemberPattern:["base","property"],MatchObjectPattern:l[52],MatchObjectPatternProperty:["key","pattern"],MatchOrPattern:["patterns"],MatchRestPattern:l[15],MatchStatement:l[50],MatchStatementCase:l[51],MatchUnaryPattern:l[15],MatchWildcardPattern:[],NeverTypeAnnotation:[],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:l[34],RecordDeclaration:["id","typeParameters","implements","body"],RecordDeclarationBody:l[0],RecordDeclarationImplements:["id","typeArguments"],RecordDeclarationProperty:["key","typeAnnotation","defaultValue"],RecordDeclarationStaticProperty:["key","typeAnnotation","value"],RecordExpression:["recordConstructor","typeArguments","properties"],RecordExpressionProperties:l[12],SatisfiesExpression:l[36],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:l[30],TypePredicate:l[44],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],NGChainedExpression:l[16],NGEmptyExpression:[],NGPipeExpression:["left","right","arguments"],NGMicrosyntax:l[18],NGMicrosyntaxAs:["key","alias"],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKey:[],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:l[25],NGRoot:l[53],JsExpressionRoot:l[53],JsonRoot:l[53],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:l[30],TSJSDocNonNullableType:l[30]};var Al=on(bs),sn=Al;function _r(e,t){return t(e)||Bs(e,{getVisitorKeys:sn,predicate:t})}function sr(e){return e.type==="AssignmentExpression"||e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="NGPipeExpression"||e.type==="ConditionalExpression"||M(e)||N(e)||e.type==="SequenceExpression"||e.type==="TaggedTemplateExpression"||e.type==="BindExpression"||e.type==="UpdateExpression"&&!e.prefix||de(e)||Re(e)}function Ps(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function un(e){if(e.expressions)return["expressions",0];if(e.left)return["left"];if(e.test)return["test"];if(e.object)return["object"];if(e.callee)return["callee"];if(e.tag)return["tag"];if(e.argument)return["argument"];if(e.expression)return["expression"];throw new Error("Unexpected node has no left side.")}function Le(e,t){return H(t)?Lt(t):C(t,T.Leading,r=>J(e,S(r)))}function Tl(e,t){if(Le(t.originalText,e)||C(e,T.Leading,r=>te(t.originalText,b(r),S(r)))&&!H(e))return!0;if(sr(e)){let r=e,n;for(;n=Ps(r);)if(r=n,Le(t.originalText,r))return!0}return!1}var gl=new WeakMap;function an(e,t){return Z(gl,e,r=>Tl(r,t))}function Pe(e){for(;Re(e);)e=e.expression;return e}function Is(e,t,r){let{node:n,key:o,parent:i}=e;switch(i.type){case"ReturnStatement":case"ThrowStatement":if(hl(e,t))return!1;break;case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if(o==="superClass"){let s=Pe(n);if(s.type==="ArrowFunctionExpression"||s.type==="AssignmentExpression"||s.type==="AwaitExpression"||s.type==="BinaryExpression"||s.type==="ConditionalExpression"||s.type==="LogicalExpression"||s.type==="NewExpression"||s.type==="ObjectExpression"||s.type==="SequenceExpression"||s.type==="TaggedTemplateExpression"||s.type==="UnaryExpression"||s.type==="UpdateExpression"||s.type==="YieldExpression"||s.type==="ClassExpression"&&j(s.decorators))return!0}break;case"ExportDefaultDeclaration":if(ks(e,t,r))return!0;break;case"Decorator":if(o==="expression"&&!Sl(n))return!0;break;case"TypeAnnotation":if(e.match(void 0,void 0,(s,u)=>u==="returnType"&&s.type==="ArrowFunctionExpression")&&!(n.type==="NullableTypeAnnotation"&&e.call(()=>r(e,t),"typeAnnotation"))&&Bl(n))return!0;break;case"VariableDeclarator":if(o==="init"&&e.match(void 0,void 0,(s,u)=>u==="declarations"&&s.type==="VariableDeclaration",(s,u)=>u==="left"&&s.type==="ForInStatement"))return!0;break;case"TSInstantiationExpression":if(o==="expression"&&(n.type==="AwaitExpression"||n.type==="YieldExpression"))return!0;break}}function hl(e,t){let{key:r,parent:n}=e;if(!(r==="argument"&&ut(n)))return!1;let{node:o}=e;return!!((o.type==="SequenceExpression"||o.type==="AssignmentExpression")&&an(o,t))}function ks(e,t,r){let{node:n,parent:o}=e;return n.type==="FunctionExpression"||n.type==="ClassExpression"?o.type==="ExportDefaultDeclaration"||!r(e,t):!sr(n)||o.type!=="ExportDefaultDeclaration"&&r(e,t)?!1:e.call(()=>ks(e,t,r),...un(n))}function Sl(e){return e.type==="ChainExpression"&&(e=e.expression),Lo(e)||M(e)&&!e.optional&&Lo(e.callee)}function Lo(e){return e.type==="Identifier"?!0:N(e)?!e.computed&&!e.optional&&e.property.type==="Identifier"&&Lo(e.object):!1}function Bl(e){return _r(e,t=>t.type==="ObjectTypeAnnotation"&&_r(t,r=>r.type==="FunctionTypeAnnotation"))}function ws(e,t){if(e.isRoot)return!1;let{node:r,key:n,parent:o}=e;if(t.__isInHtmlInterpolation&&!t.bracketSpacing&&Il(r)&&Nr(e))return!0;if(bl(r))return!1;if(r.type==="Identifier")return Ss(e);if(r.type==="ObjectExpression"||r.type==="FunctionExpression"||r.type==="ClassExpression"||r.type==="DoExpression"){let s=e.findAncestor(u=>u.type==="ExpressionStatement")?.expression;if(s&&Ce(s,u=>u===r))return!0}if(r.type==="ObjectExpression"){let s=e.findAncestor(u=>u.type==="ArrowFunctionExpression")?.body;if(s&&s.type!=="SequenceExpression"&&s.type!=="AssignmentExpression"&&Ce(s,u=>u===r))return!0}let i=Is(e,t,ws);if(typeof i=="boolean")return i;switch(r.type){case"UpdateExpression":if(o.type==="UnaryExpression")return r.prefix&&(r.operator==="++"&&o.operator==="+"||r.operator==="--"&&o.operator==="-");case"UnaryExpression":switch(o.type){case"UnaryExpression":return r.operator===o.operator&&(r.operator==="+"||r.operator==="-");case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TaggedTemplateExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"BinaryExpression":return n==="left"&&r.type==="UnaryExpression"&&(o.operator==="in"||o.operator==="instanceof")?!0:n==="left"&&o.operator==="**";case"TSNonNullExpression":return!0;default:return!1}case"BinaryExpression":if(o.type==="UpdateExpression"||r.operator==="in"&&Pl(e))return!0;if(r.operator==="|>"&&r.extra?.parenthesized){let s=e.grandparent;if(s.type==="BinaryExpression"&&s.operator==="|>")return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(o.type){case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return!de(r);case"ConditionalExpression":return de(r)||Ts(r);case"CallExpression":case"NewExpression":case"OptionalCallExpression":return n==="callee";case"ClassExpression":case"ClassDeclaration":return n==="superClass";case"TSTypeAssertion":case"TaggedTemplateExpression":case"JSXSpreadAttribute":case"SpreadElement":case"BindExpression":case"AwaitExpression":case"TSNonNullExpression":case"UpdateExpression":return!0;case"UnaryExpression":if(!C(r))return!0;break;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"AssignmentExpression":case"AssignmentPattern":return n==="left"&&(r.type==="TSTypeAssertion"||de(r));case"LogicalExpression":if(r.type==="LogicalExpression")return o.operator!==r.operator;case"BinaryExpression":{let{operator:s,type:u}=r;if(!s&&u!=="TSTypeAssertion")return!0;let a=ir(s),c=o.operator,m=ir(c);return!!(m>a||n==="right"&&m===a||m===a&&!Lr(c,s)||m<a&&s==="%"&&(c==="+"||c==="-")||As(c))}default:return!1}break;case"SequenceExpression":return o.type!=="ForStatement";case"YieldExpression":if(o.type==="AwaitExpression"||o.type==="TSTypeAssertion")return!0;case"AwaitExpression":switch(o.type){case"TaggedTemplateExpression":case"UnaryExpression":case"LogicalExpression":case"SpreadElement":case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"ConditionalExpression":return n==="test";case"BinaryExpression":return!(!r.argument&&o.operator==="|>");default:return!1}case"TSFunctionType":if(e.match(s=>s.type==="TSFunctionType",(s,u)=>u==="typeAnnotation"&&s.type==="TSTypeAnnotation",(s,u)=>u==="returnType"&&s.type==="ArrowFunctionExpression"))return!0;case"TSConditionalType":case"TSConstructorType":case"ConditionalTypeAnnotation":if(n==="extendsType"&&$e(r)&&o.type===r.type||n==="constraint"&&r.type==="TSConditionalType"&&o.type==="TSTypeParameter"||n==="typeAnnotation"&&r.type==="ConditionalTypeAnnotation"&&o.type==="TypeAnnotation"&&e.grandparent.type==="TypeParameter"&&e.grandparent.bound===o&&e.grandparent.usesExtendsBound||n==="checkType"&&$e(o))return!0;if(n==="extendsType"&&o.type==="TSConditionalType"){let{typeAnnotation:s}=r.returnType||r.typeAnnotation;if(s.type==="TSTypePredicate"&&s.typeAnnotation&&(s=s.typeAnnotation.typeAnnotation),s.type==="TSInferType"&&s.typeParameter.constraint)return!0}case"TSUnionType":case"TSIntersectionType":if(pe(o)||At(o))return!0;case"TSInferType":if(r.type==="TSInferType"){if(o.type==="TSRestType")return!1;if(n==="types"&&(o.type==="TSUnionType"||o.type==="TSIntersectionType")&&r.typeParameter.type==="TSTypeParameter"&&r.typeParameter.constraint)return!0}case"TSTypeOperator":return o.type==="TSArrayType"||o.type==="TSOptionalType"||o.type==="TSRestType"||n==="objectType"&&o.type==="TSIndexedAccessType"||o.type==="TSTypeOperator"||o.type==="TSTypeAnnotation"&&e.grandparent.type.startsWith("TSJSDoc");case"TSTypeQuery":return n==="objectType"&&o.type==="TSIndexedAccessType"||n==="elementType"&&o.type==="TSArrayType";case"TypeOperator":return o.type==="ArrayTypeAnnotation"||o.type==="NullableTypeAnnotation"||n==="objectType"&&(o.type==="IndexedAccessType"||o.type==="OptionalIndexedAccessType")||o.type==="TypeOperator";case"TypeofTypeAnnotation":case"KeyofTypeAnnotation":return n==="objectType"&&(o.type==="IndexedAccessType"||o.type==="OptionalIndexedAccessType")||n==="elementType"&&o.type==="ArrayTypeAnnotation";case"ArrayTypeAnnotation":return o.type==="NullableTypeAnnotation";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return o.type==="TypeOperator"||o.type==="KeyofTypeAnnotation"||o.type==="ArrayTypeAnnotation"||o.type==="NullableTypeAnnotation"||o.type==="IntersectionTypeAnnotation"||o.type==="UnionTypeAnnotation"||n==="objectType"&&(o.type==="IndexedAccessType"||o.type==="OptionalIndexedAccessType");case"InferTypeAnnotation":case"NullableTypeAnnotation":if(o.type==="ArrayTypeAnnotation"||n==="objectType"&&(o.type==="IndexedAccessType"||o.type==="OptionalIndexedAccessType"))return!0;break;case"ComponentTypeAnnotation":case"FunctionTypeAnnotation":{if(r.type==="ComponentTypeAnnotation"&&(r.rendersType===null||r.rendersType===void 0))return!1;if(e.match(void 0,(u,a)=>a==="typeAnnotation"&&u.type==="TypeAnnotation",(u,a)=>a==="returnType"&&u.type==="ArrowFunctionExpression")||e.match(void 0,(u,a)=>a==="typeAnnotation"&&u.type==="NullableTypeAnnotation",(u,a)=>a==="typeAnnotation"&&u.type==="TypeAnnotation",(u,a)=>a==="returnType"&&u.type==="ArrowFunctionExpression")||e.match(void 0,(u,a)=>a==="typeAnnotation"&&u.type==="TypePredicate",(u,a)=>a==="typeAnnotation"&&u.type==="TypeAnnotation",(u,a)=>a==="returnType"&&u.type==="ArrowFunctionExpression"))return!0;let s=o.type==="NullableTypeAnnotation"?e.grandparent:o;return s.type==="UnionTypeAnnotation"||s.type==="IntersectionTypeAnnotation"||s.type==="ArrayTypeAnnotation"||n==="objectType"&&(s.type==="IndexedAccessType"||s.type==="OptionalIndexedAccessType")||n==="checkType"&&o.type==="ConditionalTypeAnnotation"||n==="extendsType"&&o.type==="ConditionalTypeAnnotation