MCPcopy Create free account
hub / github.com/ResearAI/DeepScientist / hue

Function hue

src/ui/public/monaco/vs/assets/ts.worker.js:428–428  ·  view source on GitHub ↗
(e,t,r,i,o,s)

Source from the content-addressed store, hash-verified

426`)}
427 `,kind:3,pos:-1,end:-1,hasTrailingNewLine:!0,hasLeadingNewline:!0}])}return A}}function FRe(e){switch(e.kind){case 174:case 175:case 180:case 177:case 181:case 263:return!0}return!1}function zRe(e,t,r){const i=Fi(e,t),o=Dn(i,FRe);if(!o||Ms(o)&&o.body&&ZD(o.body,t))return;const s=r.getTypeChecker(),l=o.symbol;if(!l)return;const u=l.declarations;if(et(u)<=1||!Vn(u,E=>Wn(E)===e)||!FRe(u[0]))return;const d=u[0].kind;if(!Vn(u,E=>E.kind===d))return;const _=u;if(yt(_,E=>!!E.typeParameters||yt(E.parameters,A=>!!A.modifiers||!He(A.name))))return;const h=Ui(_,E=>s.getSignatureFromDeclaration(E));if(et(h)!==et(u))return;const g=s.getReturnTypeOfSignature(h[0]);if(Vn(h,E=>s.getReturnTypeOfSignature(E)===g))return _}var Nde="Add or remove braces in an arrow function",BRe=Ho(f.Add_or_remove_braces_in_an_arrow_function),YJ={name:"Add braces to arrow function",description:Ho(f.Add_braces_to_arrow_function),kind:"refactor.rewrite.arrow.braces.add"},Q7={name:"Remove braces from arrow function",description:Ho(f.Remove_braces_from_arrow_function),kind:"refactor.rewrite.arrow.braces.remove"};Dg(Nde,{kinds:[Q7.kind],getEditsForAction:hYe,getAvailableActions:mYe});function mYe(e){const{file:t,startPosition:r,triggerReason:i}=e,o=GRe(t,r,i==="invoked");return o?gy(o)?e.preferences.provideRefactorNotApplicableReason?[{name:Nde,description:BRe,actions:[{...YJ,notApplicableReason:o.error},{...Q7,notApplicableReason:o.error}]}]:ae:[{name:Nde,description:BRe,actions:[o.addBraces?YJ:Q7]}]:ae}function hYe(e,t){const{file:r,startPosition:i}=e,o=GRe(r,i);C.assert(o&&!gy(o),"Expected applicable refactor info");const{expression:s,returnStatement:l,func:u}=o;let d;if(t===YJ.name){const h=L.createReturnStatement(s);d=L.createBlock([h],!0),oC(s,h,r,3,!0)}else if(t===Q7.name&&l){const h=s||L.createVoidZero();d=D7(h)?L.createParenthesizedExpression(h):h,CO(l,d,r,3,!1),oC(l,d,r,3,!1),kP(l,d,r,3,!1)}else C.fail("invalid action");return{renameFilename:void 0,renameLocation:void 0,edits:Rr.ChangeTracker.with(e,h=>{h.replaceNode(r,u.body,d)})}}function GRe(e,t,r=!0,i){const o=Fi(e,t),s=df(o);if(!s)return{error:Ho(f.Could_not_find_a_containing_arrow_function)};if(!Xs(s))return{error:Ho(f.Containing_function_is_not_an_arrow_function)};if(!(!tp(s,o)||tp(s.body,o)&&!r)){if(h0(YJ.kind,i)&&St(s.body))return{func:s,addBraces:!0,expression:s.body};if(h0(Q7.kind,i)&&ea(s.body)&&s.body.statements.length===1){const l=$a(s.body.statements);if(tf(l)){const u=l.expression&&Wa(uD(l.expression,!1))?L.createParenthesizedExpression(l.expression):l.expression;return{func:s,addBraces:!1,expression:u,returnStatement:l}}}}}var _Ye={},VRe="Convert arrow function or function expression",gYe=Ho(f.Convert_arrow_function_or_function_expression),Z7={name:"Convert to anonymous function",description:Ho(f.Convert_to_anonymous_function),kind:"refactor.rewrite.function.anonymous"},ez={name:"Convert to named function",description:Ho(f.Convert_to_named_function),kind:"refactor.rewrite.function.named"},tz={name:"Convert to arrow function",description:Ho(f.Convert_to_arrow_function),kind:"refactor.rewrite.function.arrow"};Dg(VRe,{kinds:[Z7.kind,ez.kind,tz.kind],getEditsForAction:vYe,getAvailableActions:yYe});function yYe(e){const{file:t,startPosition:r,program:i,kind:o}=e,s=URe(t,r,i);if(!s)return ae;const{selectedVariableDeclaration:l,func:u}=s,d=[],_=[];if(h0(ez.kind,o)){const h=l||Xs(u)&&yi(u.parent)?void 0:Ho(f.Could_not_convert_to_named_function);h?_.push({...ez,notApplicableReason:h}):d.push(ez)}if(h0(Z7.kind,o)){const h=!l&&Xs(u)?void 0:Ho(f.Could_not_convert_to_anonymous_function);h?_.push({...Z7,notApplicableReason:h}):d.push(Z7)}if(h0(tz.kind,o)){const h=Us(u)?void 0:Ho(f.Could_not_convert_to_arrow_function);h?_.push({...tz,notApplicableReason:h}):d.push(tz)}return[{name:VRe,description:gYe,actions:d.length===0&&e.preferences.provideRefactorNotApplicableReason?_:d}]}function vYe(e,t){const{file:r,startPosition:i,program:o}=e,s=URe(r,i,o);if(!s)return;const{func:l}=s,u=[];switch(t){case Z7.name:u.push(...EYe(e,l));break;case ez.name:const d=SYe(l);if(!d)return;u.push(...AYe(e,l,d));break;case tz.name:if(!Us(l))return;u.push(...IYe(e,l));break;default:return C.fail("invalid action")}return{renameFilename:void 0,renameLocation:void 0,edits:u}}function jRe(e){let t=!1;return e.forEachChild(function r(i){if(QD(i)){t=!0;return}!ui(i)&&!Zl(i)&&!Us(i)&&Jo(i,r)}),t}function URe(e,t,r){const i=Fi(e,t),o=r.getTypeChecker(),s=TYe(e,o,i.parent);if(s&&!jRe(s.body)&&!o.containsArgumentsReference(s))return{selectedVariableDeclaration:!0,func:s};const l=df(i);if(l&&(Us(l)||Xs(l))&&!tp(l.body,i)&&!jRe(l.body)&&!o.containsArgumentsReference(l))return Us(l)&&qRe(e,o,l)?void 0:{selectedVariableDeclaration:!1,func:l}}function bYe(e){return yi(e)||_d(e)&&e.declarations.length===1}function TYe(e,t,r){if(!bYe(r))return;const o=(yi(r)?r:$a(r.declarations)).initializer;if(o&&(Xs(o)||Us(o)&&!qRe(e,t,o)))return o}function HRe(e){if(St(e)){const t=L.createReturnStatement(e),r=e.getSourceFile();return vt(t,e),Op(t),CO(e,t,r,void 0,!0),L.createBlock([t],!0)}else return e}function SYe(e){const t=e.parent;if(!yi(t)||!qN(t))return;const r=t.parent,i=r.parent;if(!(!_d(r)||!ac(i)||!He(t.name)))return{variableDeclaration:t,variableDeclarationList:r,statement:i,name:t.name}}function EYe(e,t){const{file:r}=e,i=HRe(t.body),o=L.createFunctionExpression(t.modifiers,t.asteriskToken,void 0,t.typeParameters,t.parameters,t.type,i);return Rr.ChangeTracker.with(e,s=>s.replaceNode(r,t,o))}function AYe(e,t,r){const{file:i}=e,o=HRe(t.body),{variableDeclaration:s,variableDeclarationList:l,statement:u,name:d}=r;aj(u);const _=PT(s)&32|Gd(t),h=L.createModifiersFromModifierFlags(_),g=L.createFunctionDeclaration(et(h)?h:void 0,t.asteriskToken,d,t.typeParameters,t.parameters,t.type,o);return l.declarations.length===1?Rr.ChangeTracker.with(e,E=>E.replaceNode(i,u,g)):Rr.ChangeTracker.with(e,E=>{E.delete(i,s),E.insertNodeAfter(i,u,g)})}function IYe(e,t){const{file:r}=e,o=t.body.statements[0];let s;xYe(t.body,o)?(s=o.expression,Op(s),z1(o,s)):s=t.body;const l=L.createArrowFunction(t.modifiers,t.typeParameters,t.parameters,t.type,L.createToken(39),s);return Rr.ChangeTracker.with(e,u=>u.replaceNode(r,t,l))}function xYe(e,t){return e.statements.length===1&&tf(t)&&!!t.expression}function qRe(e,t,r){return!!r.name&&Ys.Core.isSymbolReferencedInFile(r.name,t,e)}var RYe={},$J="Convert parameters to destructured object",DYe=1,JRe=Ho(f.Convert_parameters_to_destructured_object),KRe={name:$J,description:JRe,kind:"refactor.rewrite.parameters.toDestructured"};Dg($J,{kinds:[KRe.kind],getEditsForAction:NYe,getAvailableActions:CYe});function CYe(e){const{file:t,startPosition:r}=e;return Pu(t)||!$Re(t,r,e.program.getTypeChecker())?ae:[{name:$J,description:JRe,actions:[KRe]}]}function NYe(e,t){C.assert(t===$J,"Unexpected action name");const{file:r,startPosition:i,program:o,cancellationToken:s,host:l}=e,u=$Re(r,i,o.getTypeChecker());if(!u||!s)return;const d=PYe(u,o,s);return d.valid?{renameFilename:void 0,renameLocation:void 0,edits:Rr.ChangeTracker.with(e,h=>MYe(r,o,l,h,u,d))}:{edits:[]}}function MYe(e,t,r,i,o,s){const l=s.signature,u=Vt(tDe(o,t,r),h=>_s(h));if(l){const h=Vt(tDe(l,t,r),g=>_s(g));_(l,h)}_(o,u);const d=fN(s.functionCalls,(h,g)=>js(h.pos,g.pos));for(const h of d)if(h.arguments&&h.arguments.length){const g=_s(VYe(o,h.arguments),!0);i.replaceNodeRange(Wn(h),$a(h.arguments),Ba(h.arguments),g,{leadingTriviaOption:Rr.LeadingTriviaOption.IncludeAll,trailingTriviaOption:Rr.TrailingTriviaOption.Include})}function _(h,g){i.replaceNodeRangeWithNodes(e,$a(h.parameters),Ba(h.parameters),g,{joiner:", ",indentation:0,leadingTriviaOption:Rr.LeadingTriviaOption.IncludeAll,trailingTriviaOption:Rr.TrailingTriviaOption.Include})}}function PYe(e,t,r){const i=UYe(e),o=Ml(e)?jYe(e):[],s=cS([...i,...o],nb),l=t.getTypeChecker(),u=Ki(s,g=>Ys.getReferenceEntriesForNode(-1,g,t,t.getSourceFiles(),r)),d=_(u);return Vn(d.declarations,g=>jn(s,g))||(d.valid=!1),d;function _(g){const E={accessExpressions:[],typeUsages:[]},A={functionCalls:[],declarations:[],classReferences:E,valid:!0},R=Vt(i,h),N=Vt(o,h),P=Ml(e),k=Vt(i,W=>Mde(W,l));for(const W of g){if(W.kind===Ys.EntryKind.Span){A.valid=!1;continue}if(jn(k,h(W.node))){if(OYe(W.node.parent)){A.signature=W.node.parent;continue}const G=YRe(W);if(G){A.functionCalls.push(G);continue}}const O=Mde(W.node,l);if(O&&jn(k,O)){const G=Pde(W);if(G){A.declarations.push(G);continue}}if(jn(R,h(W.node))||IP(W.node)){if(XRe(W))continue;const j=Pde(W);if(j){A.declarations.push(j);continue}const J=YRe(W);if(J){A.functionCalls.push(J);continue}}if(P&&jn(N,h(W.node))){if(XRe(W))continue;const j=Pde(W);if(j){A.declarations.push(j);continue}const J=LYe(W);if(J){E.accessExpressions.push(J);continue}if(Dc(e.parent)){const Z=kYe(W);if(Z){E.typeUsages.push(Z);continue}}}A.valid=!1}return A}function h(g){const E=l.getSymbolAtLocation(g);return E&&lJ(E,l)}}function Mde(e,t){const r=jO(e);if(r){const i=t.getContextualTypeForObjectLiteralElement(r),o=i?.getSymbol();if(o&&!(Wl(o)&6))return o}}function XRe(e){const t=e.node;if(Eu(t.parent)||Vm(t.parent)||Fc(t.parent)||Ig(t.parent)||ou(t.parent)||ll(t.parent))return t}function Pde(e){if(rd(e.node.parent))return e.node}function YRe(e){if(e.node.parent){const t=e.node,r=t.parent;switch(r.kind){case 214:case 215:const i=ni(r,Gh);if(i&&i.expression===t)return i;break;case 212:const o=ni(r,qr);if(o&&o.parent&&o.name===t){const l=ni(o.parent,Gh);if(l&&l.expression===o)return l}break;case 213:const s=ni(r,Ws);if(s&&s.parent&&s.argumentExpression===t){const l=ni(s.parent,Gh);if(l&&l.expression===s)return l}break}}}function LYe(e){if(e.node.parent){const t=e.node,r=t.parent;switch(r.kind){case 212:const i=ni(r,qr);if(i&&i.expression===t)return i;break;case 213:const o=ni(r,Ws);if(o&&o.expression===t)return o;break}}}function kYe(e){const t=e.node;if(W1(t)===2||A6(t.parent))return t}function $Re(e,t,r){const i=eC(e,t),o=rne(i);if(!wYe(i)&&o&&WYe(o,r)&&tp(o,i)&&!(o.body&&tp(o.body,i)))return o}function wYe(e){const t=Dn(e,GR);if(t){const r=Dn(t,i=>!GR(i));return!!r&&Ms(r)}return!1}function OYe(e){return Gm(e)&&(gd(e.parent)||wu(e.parent))}function WYe(e,t){var r;if(!FYe(e.parameters,t))return!1;switch(e.kind){case 263:return QRe(e)&&nz(e,t);case 175:if(Wa(e.parent)){const i=Mde(e.name,t);return((r=i?.declarations)==null?void 0:r.length)===1&&nz(e,t)}return nz(e,t);case 177:return Dc(e.parent)?QRe(e.parent)&&nz(e,t):ZRe(e.parent.parent)&&nz(e,t);case 219:case 220:return ZRe(e.parent)}return!1}function nz(e,t){return!!e.body&&!t.isImplementationOfOverload(e)}function QRe(e){return e.name?!0:!!nC(e,90)}function FYe(e,t){return BYe(e)>=DYe&&Vn(e,r=>zYe(r,t))}function zYe(e,t){if(C_(e)){const r=t.getTypeAtLocation(e);if(!t.isArrayType(r)&&!t.isTupleType(r))return!1}return!e.modifiers&&He(e.name)}function ZRe(e){return yi(e)&&JR(e)&&He(e.name)&&!e.type}function Lde(e){return e.length>0&&QD(e[0].name)}function BYe(e){return Lde(e)?e.length-1:e.length}function eDe(e){return Lde(e)&&(e=L.createNodeArray(e.slice(1),e.hasTrailingComma)),e}function GYe(e,t){return He(t)&&zf(t)===e?L.createShorthandPropertyAssignment(e):L.createPropertyAssignment(e,t)}function VYe(e,t){const r=eDe(e.parameters),i=C_(Ba(r)),o=i?t.slice(0,r.length-1):t,s=Vt(o,(u,d)=>{const _=QJ(r[d]),h=GYe(_,u);return Op(h.name),Cc(h)&&Op(h.initializer),z1(u,h),h});if(i&&t.length>=r.length){const u=t.slice(r.length-1),d=L.createPropertyAssignment(QJ(Ba(r)),L.createArrayLiteralExpression(u));s.push(d)}return L.createObjectLiteralExpression(s,!1)}function tDe(e,t,r){const i=t.getTypeChecker(),o=eDe(e.parameters),s=Vt(o,h),l=L.createObjectBindingPattern(s),u=g(o);let d;Vn(o,R)&&(d=L.createObjectLiteralExpression());const _=L.createParameterDeclaration(void 0,void 0,l,void 0,u,d);if(Lde(e.parameters)){const N=e.parameters[0],P=L.createParameterDeclaration(void 0,void 0,N.name,void 0,N.type);return Op(P.name),z1(N.name,P.name),N.type&&(Op(P.type),z1(N.type,P.type)),L.createNodeArray([P,_])}return L.createNodeArray([_]);function h(N){const P=L.createBindingElement(void 0,void 0,QJ(N),C_(N)&&R(N)?L.createArrayLiteralExpression():N.initializer);return Op(P),N.initializer&&P.initializer&&z1(N.initializer,P.initializer),P}function g(N){const P=Vt(N,E);return Qh(L.createTypeLiteralNode(P),1)}function E(N){let P=N.type;!P&&(N.initializer||C_(N))&&(P=A(N));const k=L.createPropertySignature(void 0,QJ(N),R(N)?L.createToken(58):N.questionToken,P);return Op(k),z1(N.name,k.name),N.type&&k.type&&z1(N.type,k.type),k}function A(N){const P=i.getTypeAtLocation(N);return OP(P,N,t,r)}function R(N){if(C_(N)){const P=i.getTypeAtLocation(N);return!i.isTupleType(P)}return i.isOptionalParameter(N)}}function QJ(e){return zf(e.name)}function jYe(e){switch(e.parent.kind){case 264:const t=e.parent;return t.name?[t.name]:[C.checkDefined(nC(t,90),"Nameless class declaration should be a default export")];case 232:const i=e.parent,o=e.parent.parent,s=i.name;return s?[s,o.name]:[o.name]}}function UYe(e){switch(e.kind){case 263:return e.name?[e.name]:[C.checkDefined(nC(e,90),"Nameless function declaration should be a default export")];case 175:return[e.name];case 177:const r=C.checkDefined(Es(e,137,e.getSourceFile()),"Constructor declaration should have constructor keyword");return e.parent.kind===232?[e.parent.parent.name,r]:[r];case 220:return[e.parent.name];case 219:return e.name?[e.name,e.parent.name]:[e.parent.name];default:return C.assertNever(e,`Unexpected function declaration kind ${e.kind}`)}}var HYe={},kde="Convert to template string",wde=Ho(f.Convert_to_template_string),Ode={name:kde,description:wde,kind:"refactor.rewrite.string"};Dg(kde,{kinds:[Ode.kind],getEditsForAction:JYe,getAvailableActions:qYe});function qYe(e){const{file:t,startPosition:r}=e,i=nDe(t,r),o=Wde(i),s=ka(o),l={name:kde,description:wde,actions:[]};return s&&e.triggerReason!=="invoked"?ae:P_(o)&&(s||Nr(o)&&Fde(o).isValidConcatenation)?(l.actions.push(Ode),[l]):e.preferences.provideRefactorNotApplicableReason?(l.actions.push({...Ode,notApplicableReason:Ho(f.Can_only_convert_string_concatenations_and_string_literals)}),[l]):ae}function nDe(e,t){const r=Fi(e,t),i=Wde(r);return!Fde(i).isValidConcatenation&&Ou(i.parent)&&Nr(i.parent.parent)?i.parent.parent:r}function JYe(e,t){const{file:r,startPosition:i}=e,o=nDe(r,i);switch(t){case wde:return{edits:KYe(e,o)};default:return C.fail("invalid action")}}function KYe(e,t){const r=Wde(t),i=e.file,o=ZYe(Fde(r),i),s=sb(i.text,r.end);if(s){const l=s[s.length-1],u={pos:s[0].pos,end:l.end};return Rr.ChangeTracker.with(e,d=>{d.deleteRange(i,u),d.replaceNode(i,r,o)})}else return Rr.ChangeTracker.with(e,l=>l.replaceNode(i,r,o))}function XYe(e){return!(e.operatorToken.kind===64||e.operatorToken.kind===65)}function Wde(e){return Dn(e.parent,r=>{switch(r.kind){case 212:case 213:return!1;case 229:case 227:return!(Nr(r.parent)&&XYe(r.parent));default:return"quit"}})||e}function Fde(e){const t=l=>{if(!Nr(l))return{nodes:[l],operators:[],validOperators:!0,hasString:ka(l)||g1(l)};const{nodes:u,operators:d,hasString:_,validOperators:h}=t(l.left);if(!(_||ka(l.right)||b4(l.right)))return{nodes:[l],operators:[],hasString:!1,validOperators:!0};const g=l.operatorToken.kind===40,E=h&&g;return u.push(l.right),d.push(l.operatorToken),{nodes:u,operators:d,hasString:!0,validOperators:E}},{nodes:r,operators:i,validOperators:o,hasString:s}=t(e);return{nodes:r,operators:i,isValidConcatenation:o&&s}}var YYe=(e,t)=>(r,i)=>{r<e.length&&kP(e[r],i,t,3,!1)},$Ye=(e,t,r)=>(i,o)=>{for(;i.length>0;){const s=i.shift();kP(e[s],o,t,3,!1),r(s,o)}};function QYe(e){return e.replace(/\\.|[$`]/g,t=>t[0]==="\\"?t:"\\"+t)}function rDe(e){const t=GI(e)||hj(e)?-2:-1;return Al(e).slice(1,t)}function iDe(e,t){const r=[];let i="",o="";for(;e<t.length;){const s=t[e];if(ds(s))i+=s.text,o+=QYe(Al(s).slice(1,-1)),r.push(e),e++;else if(b4(s)){i+=s.head.text,o+=rDe(s.head);break}else break}return[e,i,o,r]}function ZYe({nodes:e,operators:t},r){const i=YYe(t,r),o=$Ye(e,r,i),[s,l,u,d]=iDe(0,e);if(s===e.length){const g=L.createNoSubstitutionTemplateLiteral(l,u);return o(d,g),g}const _=[],h=L.createTemplateHead(l,u);o(d,h);for(let g=s;g<e.length;g++){const E=e$e(e[g]);i(g,E);const[A,R,N,P]=iDe(g+1,e);g=A-1;const k=g===e.length-1;if(b4(E)){const W=Vt(E.templateSpans,(O,G)=>{oDe(O);const j=G===E.templateSpans.length-1,J=O.literal.text+(j?R:""),Z=rDe(O.literal)+(j?N:"");return L.createTemplateSpan(O.expression,k&&j?L.createTemplateTail(J,Z):L.createTemplateMiddle(J,Z))});_.push(...W)}else{const W=k?L.createTemplateTail(R,N):L.createTemplateMiddle(R,N);o(P,W),_.push(L.createTemplateSpan(E,W))}}return L.createTemplateExpression(h,_)}function oDe(e){const t=e.getSourceFile();kP(e,e.expression,t,3,!1),CO(e.expression,e.expression,t,3,!1)}function e$e(e){return Ou(e)&&(oDe(e),e=e.expression),e}var t$e={},ZJ="Convert to optional chain expression",zde=Ho(f.Convert_to_optional_chain_expression),Bde={name:ZJ,description:zde,kind:"refactor.rewrite.expression.optionalChain"};Dg(ZJ,{kinds:[Bde.kind],getEditsForAction:r$e,getAvailableActions:n$e});function n$e(e){const t=aDe(e,e.triggerReason==="invoked");return t?gy(t)?e.preferences.provideRefactorNotApplicableReason?[{name:ZJ,description:zde,actions:[{...Bde,notApplicableReason:t.error}]}]:ae:[{name:ZJ,description:zde,actions:[Bde]}]:ae}function r$e(e,t){const r=aDe(e);return C.assert(r&&!gy(r),"Expected applicable refactor info"),{edits:Rr.ChangeTracker.with(e,o=>u$e(e.file,e.program.getTypeChecker(),o,r)),renameFilename:void 0,renameLocation:void 0}}function eK(e){return Nr(e)||T1(e)}function i$e(e){return od(e)||tf(e)||ac(e)}function tK(e){return eK(e)||i$e(e)}function aDe(e,t=!0){const{file:r,program:i}=e,o=mx(e),s=o.length===0;if(s&&!t)return;const l=Fi(r,o.start),u=RP(r,o.start+o.length),d=ic(l.pos,u&&u.end>=l.pos?u.getEnd():l.getEnd()),_=s?c$e(l):l$e(l,d),h=_&&tK(_)?d$e(_):void 0;if(!h)return{error:Ho(f.Could_not_find_convertible_access_expression)};const g=i.getTypeChecker();return T1(h)?o$e(h,g):a$e(h)}function o$e(e,t){const r=e.condition,i=Vde(e.whenTrue);if(!i||t.isNullableType(t.getTypeAtLocation(i)))return{error:Ho(f.Could_not_find_convertible_access_expression)};if((qr(r)||He(r))&&Gde(r,i.expression))return{finalExpression:i,occurrences:[r],expression:e};if(Nr(r)){const o=sDe(i.expression,r);return o?{finalExpression:i,occurrences:o,expression:e}:{error:Ho(f.Could_not_find_matching_access_expressions)}}}function a$e(e){if(e.operatorToken.kind!==56)return{error:Ho(f.Can_only_convert_logical_AND_access_chains)};const t=Vde(e.right);if(!t)return{error:Ho(f.Could_not_find_convertible_access_expression)};const r=sDe(t.expression,e.left);return r?{finalExpression:t,occurrences:r,expression:e}:{error:Ho(f.Could_not_find_matching_access_expressions)}}function sDe(e,t){const r=[];for(;Nr(t)&&t.operatorToken.kind===56;){const o=Gde(us(e),us(t.right));if(!o)break;r.push(o),e=o,t=t.left}const i=Gde(e,t);return i&&r.push(i),r.length>0?r:void 0}function Gde(e,t){if(!(!He(t)&&!qr(t)&&!Ws(t)))return s$e(e,t)?t:void 0}function s$e(e,t){for(;(Zo(e)||qr(e)||Ws(e))&&BO(e)!==BO(t);)e=e.expression;for(;qr(e)&&qr(t)||Ws(e)&&Ws(t);){if(BO(e)!==BO(t))return!1;e=e.expression,t=t.expression}return He(e)&&He(t)&&e.getText()===t.getText()}function BO(e){if(He(e)||uf(e))return e.getText();if(qr(e))return BO(e.name);if(Ws(e))return BO(e.argumentExpression)}function l$e(e,t){for(;e.parent;){if(tK(e)&&t.length!==0&&e.end>=t.start+t.length)return e;e=e.parent}}function c$e(e){for(;e.parent;){if(tK(e)&&!tK(e.parent))return e;e=e.parent}}function d$e(e){if(eK(e))return e;if(ac(e)){const t=TI(e),r=t?.initializer;return r&&eK(r)?r:void 0}return e.expression&&eK(e.expression)?e.expression:void 0}function Vde(e){if(e=us(e),Nr(e))return Vde(e.left);if((qr(e)||Ws(e)||Zo(e))&&!tu(e))return e}function lDe(e,t,r){if(qr(t)||Ws(t)||Zo(t)){const i=lDe(e,t.expression,r),o=r.length>0?r[r.length-1]:void 0,s=o?.getText()===t.expression.getText();if(s&&r.pop(),Zo(t))return s?L.createCallChain(i,L.createToken(29),t.typeArguments,t.arguments):L.createCallChain(i,t.questionDotToken,t.typeArguments,t.arguments);if(qr(t))return s?L.createPropertyAccessChain(i,L.createToken(29),t.name):L.createPropertyAccessChain(i,t.questionDotToken,t.name);if(Ws(t))return s?L.createElementAccessChain(i,L.createToken(29),t.argumentExpression):L.createElementAccessChain(i,t.questionDotToken,t.argumentExpression)}return t}function u$e(e,t,r,i,o){const{finalExpression:s,occurrences:l,expression:u}=i,d=l[l.length-1],_=lDe(t,s,l);_&&(qr(_)||Ws(_)||Zo(_))&&(Nr(u)?r.replaceNodeRange(e,d,s,_):T1(u)&&r.replaceNode(e,u,L.createBinaryExpression(_,L.createToken(61),u.whenFalse)))}var cDe={};x(cDe,{Messages:()=>Md,RangeFacts:()=>pDe,getRangeToExtract:()=>jde,getRefactorActionsToExtractSymbol:()=>dDe,getRefactorEditsToExtractSymbol:()=>uDe});var BP="Extract Symbol",GP={name:"Extract Constant",description:Ho(f.Extract_constant),kind:"refactor.extract.constant"},VP={name:"Extract Function",description:Ho(f.Extract_function),kind:"refactor.extract.function"};Dg(BP,{kinds:[GP.kind,VP.kind],getEditsForAction:uDe,getAvailableActions:dDe});function dDe(e){const t=e.kind,r=jde(e.file,mx(e),e.triggerReason==="invoked"),i=r.targetRange;if(i===void 0){if(!r.errors||r.errors.length===0||!e.preferences.provideRefactorNotApplicableReason)return ae;const N=[];return h0(VP.kind,t)&&N.push({name:BP,description:VP.description,actions:[{...VP,notApplicableReason:R(r.errors)}]}),h0(GP.kind,t)&&N.push({name:BP,description:GP.description,actions:[{...GP,notApplicableReason:R(r.errors)}]}),N}const{affectedTextRange:o,extractions:s}=g$e(i,e);if(s===void 0)return ae;const l=[],u=new Map;let d;const _=[],h=new Map;let g,E=0;for(const{functionExtraction:N,constantExtraction:P}of s){if(h0(VP.kind,t)){const k=N.description;N.errors.length===0?u.has(k)||(u.set(k,!0),l.push({description:k,name:`function_scope_${E}`,kind:VP.kind,range:{start:{line:ca(e.file,o.pos).line,offset:ca(e.file,o.pos).character},end:{line:ca(e.file,o.end).line,offset:ca(e.file,o.end).character}}})):d||(d={description:k,name:`function_scope_${E}`,notApplicableReason:R(N.errors),kind:VP.kind})}if(h0(GP.kind,t)){const k=P.description;P.errors.length===0?h.has(k)||(h.set(k,!0),_.push({description:k,name:`constant_scope_${E}`,kind:GP.kind,range:{start:{line:ca(e.file,o.pos).line,offset:ca(e.file,o.pos).character},end:{line:ca(e.file,o.end).line,offset:ca(e.file,o.end).character}}})):g||(g={description:k,name:`constant_scope_${E}`,notApplicableReason:R(P.errors),kind:GP.kind})}E++}const A=[];return l.length?A.push({name:BP,description:Ho(f.Extract_function),actions:l}):e.preferences.provideRefactorNotApplicableReason&&d&&A.push({name:BP,description:Ho(f.Extract_function),actions:[d]}),_.length?A.push({name:BP,description:Ho(f.Extract_constant),actions:_}):e.preferences.provideRefactorNotApplicableReason&&g&&A.push({name:BP,description:Ho(f.Extract_constant),actions:[g]}),A.length?A:ae;function R(N){let P=N[0].messageText;return typeof P!="string"&&(P=P.messageText),P}}function uDe(e,t){const i=jde(e.file,mx(e)).targetRange,o=/^function_scope_(\d+)$/.exec(t);if(o){const l=+o[1];return C.assert(isFinite(l),"Expected to parse a finite number from the function scope index"),h$e(i,e,l)}const s=/^constant_scope_(\d+)$/.exec(t);if(s){const l=+s[1];return C.assert(isFinite(l),"Expected to parse a finite number from the constant scope index"),_$e(i,e,l)}C.fail("Unrecognized action name")}var Md;(e=>{function t(r){return{message:r,code:0,category:3,key:r}}e.cannotExtractRange=t("Cannot extract range."),e.cannotExtractImport=t("Cannot extract import statement."),e.cannotExtractSuper=t("Cannot extract super call."),e.cannotExtractJSDoc=t("Cannot extract JSDoc."),e.cannotExtractEmpty=t("Cannot extract empty range."),e.expressionExpected=t("expression expected."),e.uselessConstantType=t("No reason to extract constant of type."),e.statementOrExpressionExpected=t("Statement or expression expected."),e.cannotExtractRangeContainingConditionalBreakOrContinueStatements=t("Cannot extract range containing conditional break or continue statements."),e.cannotExtractRangeContainingConditionalReturnStatement=t("Cannot extract range containing conditional return statement."),e.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange=t("Cannot extract range containing labeled break or continue with target outside of the range."),e.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators=t("Cannot extract range containing writes to references located outside of the target range in generators."),e.typeWillNotBeVisibleInTheNewScope=t("Type will not visible in the new scope."),e.functionWillNotBeVisibleInTheNewScope=t("Function will not visible in the new scope."),e.cannotExtractIdentifier=t("Select more than a single identifier."),e.cannotExtractExportedEntity=t("Cannot extract exported declaration"),e.cannotWriteInExpression=t("Cannot write back side-effects when extracting an expression"),e.cannotExtractReadonlyPropertyInitializerOutsideConstructor=t("Cannot move initialization of read-only class property outside of the constructor"),e.cannotExtractAmbientBlock=t("Cannot extract code from ambient contexts"),e.cannotAccessVariablesFromNestedScopes=t("Cannot access variables from nested scopes"),e.cannotExtractToJSClass=t("Cannot extract constant to a class scope in JS"),e.cannotExtractToExpressionArrowFunction=t("Cannot extract constant to an arrow function without a block"),e.cannotExtractFunctionsContainingThisToMethod=t("Cannot extract functions containing this to method")})(Md||(Md={}));var pDe=(e=>(e[e.None=0]="None",e[e.HasReturn=1]="HasReturn",e[e.IsGenerator=2]="IsGenerator",e[e.IsAsyncFunction=4]="IsAsyncFunction",e[e.UsesThis=8]="UsesThis",e[e.UsesThisInFunction=16]="UsesThisInFunction",e[e.InStaticRegion=32]="InStaticRegion",e))(pDe||{});function jde(e,t,r=!0){const{length:i}=t;if(i===0&&!r)return{errors:[Oc(e,t.start,i,Md.cannotExtractEmpty)]};const o=i===0&&r,s=Ble(e,t.start),l=RP(e,Dl(t)),u=s&&l&&r?p$e(s,l,e):t,d=o?W$e(s):xO(s,e,u),_=o?d:xO(l,e,u);let h=0,g;if(!d||!_)return{errors:[Oc(e,t.start,i,Md.cannotExtractRange)]};if(d.flags&16777216)return{errors:[Oc(e,t.start,i,Md.cannotExtractJSDoc)]};if(d.parent!==_.parent)return{errors:[Oc(e,t.start,i,Md.cannotExtractRange)]};if(d!==_){if(!hx(d.parent))return{errors:[Oc(e,t.start,i,Md.cannotExtractRange)]};const W=[];for(const O of d.parent.statements){if(O===d||W.length){const G=k(O);if(G)return{errors:G};W.push(O)}if(O===_)break}return W.length?{targetRange:{range:W,facts:h,thisNode:g}}:{errors:[Oc(e,t.start,i,Md.cannotExtractRange)]}}if(tf(d)&&!d.expression)return{errors:[Oc(e,t.start,i,Md.cannotExtractRange)]};const E=R(d),A=N(E)||k(E);if(A)return{errors:A};return{targetRange:{range:f$e(E),facts:h,thisNode:g}};function R(W){if(tf(W)){if(W.expression)return W.expression}else if(ac(W)||_d(W)){const O=ac(W)?W.declarationList.declarations:W.declarations;let G=0,j;for(const J of O)J.initializer&&(G++,j=J.initializer);if(G===1)return j}else if(yi(W)&&W.initializer)return W.initializer;return W}function N(W){if(He(od(W)?W.expression:W))return[Ar(W,Md.cannotExtractIdentifier)]}function P(W,O){let G=W;for(;G!==O;){if(G.kind===173){ua(G)&&(h|=32);break}else if(G.kind===170){df(G).kind===177&&(h|=32);break}else G.kind===175&&ua(G)&&(h|=32);G=G.parent}}function k(W){let O;if((ye=>{ye[ye.None=0]="None",ye[ye.Break=1]="Break",ye[ye.Continue=2]="Continue",ye[ye.Return=4]="Return"})(O||(O={})),C.assert(W.pos<=W.end,"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (1)"),C.assert(!dh(W.pos),"This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809 (2)"),!Vi(W)&&!(P_(W)&&fDe(W))&&!Kde(W))return[Ar(W,Md.statementOrExpressionExpected)];if(W.flags&33554432)return[Ar(W,Md.cannotExtractAmbientBlock)];const G=hd(W);G&&P(W,G);let j,J=4,Z;if(q(W),h&8){const ye=vu(W,!1,!1);(ye.kind===263||ye.kind===175&&ye.parent.kind===211||ye.kind===219)&&(h|=16)}return j;function q(ye){if(j)return!0;if(rd(ye)){const K=ye.kind===261?ye.parent.parent:ye;if(di(K,32))return(j||(j=[])).push(Ar(ye,Md.cannotExtractExportedEntity)),!0}switch(ye.kind){case 273:return(j||(j=[])).push(Ar(ye,Md.cannotExtractImport)),!0;case 278:return(j||(j=[])).push(Ar(ye,Md.cannotExtractExportedEntity)),!0;case 108:if(ye.parent.kind===214){const K=hd(ye);if(K===void 0||K.pos<t.start||K.end>=t.start+t.length)return(j||(j=[])).push(Ar(ye,Md.cannotExtractSuper)),!0}else h|=8,g=ye;break;case 220:Jo(ye,function K(pe){if(QD(pe))h|=8,g=ye;else{if(ui(pe)||Yo(pe)&&!Xs(pe))return!1;Jo(pe,K)}});case 264:case 263:Yi(ye.parent)&&ye.parent.externalModuleIndicator===void 0&&(j||(j=[])).push(Ar(ye,Md.functionWillNotBeVisibleInTheNewScope));case 232:case 219:case 175:case 177:case 178:case 179:return!1}const ie=J;switch(ye.kind){case 246:J&=-5;break;case 259:J=0;break;case 242:ye.parent&&ye.parent.kind===259&&ye.parent.finallyBlock===ye&&(J=4);break;case 298:case 297:J|=1;break;default:mb(ye,!1)&&(J|=3);break}switch(ye.kind){case 198:case 110:h|=8,g=ye;break;case 257:{const K=ye.label;(Z||(Z=[])).push(K.escapedText),Jo(ye,q),Z.pop();break}case 253:case 252:{const K=ye.label;K?jn(Z,K.escapedText)||(j||(j=[])).push(Ar(ye,Md.cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange)):J&(ye.kind===253?1:2)||(j||(j=[])).push(Ar(ye,Md.cannotExtractRangeContainingConditionalBreakOrContinueStatements));break}case 224:h|=4;break;case 230:h|=2;break;case 254:J&4?h|=1:(j||(j=[])).push(Ar(ye,Md.cannotExtractRangeContainingConditionalReturnStatement));break;default:Jo(ye,q);break}J=ie}}}function p$e(e,t,r){const i=e.getStart(r);let o=t.getEnd();return r.text.charCodeAt(o)===59&&o++,{start:i,length:o-i}}function f$e(e){if(Vi(e))return[e];if(P_(e))return od(e.parent)?[e.parent]:e;if(Kde(e))return e}function Ude(e){return Xs(e)?nG(e.body):Ms(e)||Yi(e)||t_(e)||ui(e)}function m$e(e){let t=yv(e.range)?$a(e.range):e.range;if(e.facts&8&&!(e.facts&16)){const i=hd(t);if(i){const o=Dn(t,Ms);return o?[o,i]:[i]}}const r=[];for(;;)if(t=t.parent,t.kind===170&&(t=Dn(t,i=>Ms(i)).parent),Ude(t)&&(r.push(t),t.kind===308))return r}function h$e(e,t,r){const{scopes:i,readsAndWrites:{target:o,usagesPerScope:s,functionErrorsPerScope:l,exposedVariableDeclarations:u}}=Hde(e,t);return C.assert(!l[r].length,"The extraction went missing? How?"),t.cancellationToken.throwIfCancellationRequested(),E$e(o,i[r],s[r],u,e,t)}function _$e(e,t,r){const{scopes:i,readsAndWrites:{target:o,usagesPerScope:s,constantErrorsPerScope:l,exposedVariableDeclarations:u}}=Hde(e,t);C.assert(!l[r].length,"The extraction went missing? How?"),C.assert(u.length===0,"Extract constant accepted a range containing a variable declaration?"),t.cancellationToken.throwIfCancellationRequested();const d=St(o)?o:o.statements[0].expression;return A$e(d,i[r],s[r],e.facts,t)}function g$e(e,t){const{scopes:r,affectedTextRange:i,readsAndWrites:{functionErrorsPerScope:o,constantErrorsPerScope:s}}=Hde(e,t),l=r.map((u,d)=>{const _=y$e(u),h=v$e(u),g=Ms(u)?b$e(u):ui(u)?T$e(u):S$e(u);let E,A;return g===1?(E=bg(Ho(f.Extract_to_0_in_1_scope),[_,"global"]),A=bg(Ho(f.Extract_to_0_in_1_scope),[h,"global"])):g===0?(E=bg(Ho(f.Extract_to_0_in_1_scope),[_,"module"]),A=bg(Ho(f.Extract_to_0_in_1_scope),[h,"module"])):(E=bg(Ho(f.Extract_to_0_in_1),[_,g]),A=bg(Ho(f.Extract_to_0_in_1),[h,g])),d===0&&!ui(u)&&(A=bg(Ho(f.Extract_to_0_in_enclosing_scope),[h])),{functionExtraction:{description:E,errors:o[d]},constantExtraction:{description:A,errors:s[d]}}});return{affectedTextRange:i,extractions:l}}function Hde(e,t){const{file:r}=t,i=m$e(e),o=w$e(e,r),s=O$e(e,i,o,r,t.program.getTypeChecker(),t.cancellationToken);return{scopes:i,affectedTextRange:o,readsAndWrites:s}}function y$e(e){return Ms(e)?"inner function":ui(e)?"method":"function"}function v$e(e){return ui(e)?"readonly field":"constant"}function b$e(e){switch(e.kind){case 177:return"constructor";case 219:case 263:return e.name?`function '${e.name.text}'`:uJ;case 220:return"arrow function";case 175:return`method '${e.name.getText()}'`;case 178:return`'get ${e.name.getText()}'`;case 179:return`'set ${e.name.getText()}'`;default:C.assertNever(e,`Unexpected scope kind ${e.kind}`)}}function T$e(e){return e.kind===264?e.name?`class '${e.name.text}'`:"anonymous class declaration":e.name?`class expression '${e.name.text}'`:"anonymous class expression"}function S$e(e){return e.kind===269?`namespace '${e.parent.name.getText()}'`:e.externalModuleIndicator?0:1}function E$e(e,t,{usages:r,typeParameterUsages:i,substitutions:o},s,l,u){const d=u.program.getTypeChecker(),_=Ga(u.program.getCompilerOptions()),h=cu.createImportAdder(u.file,u.program,u.preferences,u.host),g=t.getSourceFile(),E=B1(ui(t)?"newMethod":"newFunction",g),A=Ir(t),R=L.createIdentifier(E);let N;const P=[],k=[];let W;r.forEach((re,be)=>{let Ne;if(!A){let lt=d.getTypeOfSymbolAtLocation(re.symbol,re.node);lt=d.getBaseTypeOfLiteralType(lt),Ne=cu.typeToAutoImportableTypeNode(d,h,lt,t,_,1,8)}const Be=L.createParameterDeclaration(void 0,void 0,be,void 0,Ne);P.push(Be),re.usage===2&&(W||(W=[])).push(re),k.push(L.createIdentifier(be))});const O=Co(i.values(),re=>({type:re,declaration:x$e(re,u.startPosition)}));O.sort(R$e);const G=O.length===0?void 0:Ui(O,({declaration:re})=>re),j=G!==void 0?G.map(re=>L.createTypeReferenceNode(re.name,void 0)):void 0;if(St(e)&&!A){const re=d.getContextualType(e);N=d.typeToTypeNode(re,t,1,8)}const{body:J,returnValueProperty:Z}=C$e(e,s,W,o,!!(l.facts&1));Op(J);let q;const ye=!!(l.facts&16);if(ui(t)){const re=A?[]:[L.createModifier(123)];l.facts&32&&re.push(L.createModifier(126)),l.facts&4&&re.push(L.createModifier(134)),q=L.createMethodDeclaration(re.length?re:void 0,l.facts&2?L.createToken(42):void 0,R,void 0,G,P,N,J)}else ye&&P.unshift(L.createParameterDeclaration(void 0,void 0,"this",void 0,d.typeToTypeNode(d.getTypeAtLocation(l.thisNode),t,1,8),void 0)),q=L.createFunctionDeclaration(l.facts&4?[L.createToken(134)]:void 0,l.facts&2?L.createToken(42):void 0,R,G,P,N,J);const ie=Rr.ChangeTracker.fromContext(u),K=(yv(l.range)?Ba(l.range):l.range).end,pe=P$e(K,t);pe?ie.insertNodeBefore(u.file,pe,q,!0):ie.insertNodeAtEndOfScope(u.file,t,q),h.writeFixes(ie);const de=[],fe=D$e(t,l,E);ye&&k.unshift(L.createIdentifier("this"));let ve=L.createCallExpression(ye?L.createPropertyAccessExpression(fe,"call"):fe,j,k);if(l.facts&2&&(ve=L.createYieldExpression(L.createToken(42),ve)),l.facts&4&&(ve=L.createAwaitExpression(ve)),Jde(e)&&(ve=L.createJsxExpression(void 0,ve)),s.length&&!W)if(C.assert(!Z,"Expected no returnValueProperty"),C.assert(!(l.facts&1),"Expected RangeFacts.HasReturn flag to be unset"),s.length===1){const re=s[0];de.push(L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(_s(re.name),void 0,_s(re.type),ve)],re.parent.flags)))}else{const re=[],be=[];let Ne=s[0].parent.flags,Be=!1;for(const ce of s){re.push(L.createBindingElement(void 0,void 0,_s(ce.name)));const Re=d.typeToTypeNode(d.getBaseTypeOfLiteralType(d.getTypeAtLocation(ce)),t,1,8);be.push(L.createPropertySignature(void 0,ce.symbol.name,void 0,Re)),Be=Be||ce.type!==void 0,Ne=Ne&ce.parent.flags}const lt=Be?L.createTypeLiteralNode(be):void 0;lt&&Cr(lt,1),de.push(L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(L.createObjectBindingPattern(re),void 0,lt,ve)],Ne)))}else if(s.length||W){if(s.length)for(const be of s){let Ne=be.parent.flags;Ne&2&&(Ne=Ne&-3|1),de.push(L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(be.symbol.name,void 0,Se(be.type))],Ne)))}Z&&de.push(L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(Z,void 0,Se(N))],1)));const re=qde(s,W);Z&&re.unshift(L.createShorthandPropertyAssignment(Z)),re.length===1?(C.assert(!Z,"Shouldn't have returnValueProperty here"),de.push(L.createExpressionStatement(L.createAssignment(re[0].name,ve))),l.facts&1&&de.push(L.createReturnStatement())):(de.push(L.createExpressionStatement(L.createAssignment(L.createObjectLiteralExpression(re),ve))),Z&&de.push(L.createReturnStatement(L.createIdentifier(Z))))}else l.facts&1?de.push(L.createReturnStatement(ve)):yv(l.range)?de.push(L.createExpressionStatement(ve)):de.push(ve);yv(l.range)?ie.replaceNodeRangeWithNodes(u.file,$a(l.range),Ba(l.range),de):ie.replaceNodeWithNodes(u.file,l.range,de);const xe=ie.getChanges(),Ce=(yv(l.range)?$a(l.range):l.range).getSourceFile().fileName,Je=DO(xe,Ce,E,!1);return{renameFilename:Ce,renameLocation:Je,edits:xe};function Se(re){if(re===void 0)return;const be=_s(re);let Ne=be;for(;v1(Ne);)Ne=Ne.type;return dv(Ne)&&hn(Ne.types,Be=>Be.kind===157)?be:L.createUnionTypeNode([be,L.createKeywordTypeNode(157)])}}function A$e(e,t,{substitutions:r},i,o){const s=o.program.getTypeChecker(),l=t.getSourceFile(),u=Ede(e,t,s,l),d=Ir(t);let _=d||!s.isContextSensitive(e)?void 0:s.typeToTypeNode(s.getContextualType(e),t,1,8),h=N$e(us(e),r);({variableType:_,initializer:h}=N(_,h)),Op(h);const g=Rr.ChangeTracker.fromContext(o);if(ui(t)){C.assert(!d,"Cannot extract to a JS class");const P=[];P.push(L.createModifier(123)),i&32&&P.push(L.createModifier(126)),P.push(L.createModifier(148));const k=L.createPropertyDeclaration(P,u,void 0,_,h);let W=L.createPropertyAccessExpression(i&32?L.createIdentifier(t.name.getText()):L.createThis(),L.createIdentifier(u));Jde(e)&&(W=L.createJsxExpression(void 0,W));const O=e.pos,G=L$e(O,t);g.insertNodeBefore(o.file,G,k,!0),g.replaceNode(o.file,e,W)}else{const P=L.createVariableDeclaration(u,void 0,_,h),k=I$e(e,t);if(k){g.insertNodeBefore(o.file,k,P);const W=L.createIdentifier(u);g.replaceNode(o.file,e,W)}else if(e.parent.kind===245&&t===Dn(e,Ude)){const W=L.createVariableStatement(void 0,L.createVariableDeclarationList([P],2));g.replaceNode(o.file,e.parent,W)}else{const W=L.createVariableStatement(void 0,L.createVariableDeclarationList([P],2)),O=k$e(e,t);if(O.pos===0?g.insertNodeAtTopOfFile(o.file,W,!1):g.insertNodeBefore(o.file,O,W,!1),e.parent.kind===245)g.delete(o.file,e.parent);else{let G=L.createIdentifier(u);Jde(e)&&(G=L.createJsxExpression(void 0,G)),g.replaceNode(o.file,e,G)}}}const E=g.getChanges(),A=e.getSourceFile().fileName,R=DO(E,A,u,!0);return{renameFilename:A,renameLocation:R,edits:E};function N(P,k){if(P===void 0)return{variableType:P,initializer:k};if(!Us(k)&&!Xs(k)||k.typeParameters)return{variableType:P,initializer:k};const W=s.getTypeAtLocation(e),O=og(s.getSignaturesOfType(W,0));if(!O)return{variableType:P,initializer:k};if(O.getTypeParameters())return{variableType:P,initializer:k};const G=[];let j=!1;for(const J of k.parameters)if(J.type)G.push(J);else{const Z=s.getTypeAtLocation(J);Z===s.getAnyType()&&(j=!0),G.push(L.updateParameterDeclaration(J,J.modifiers,J.dotDotDotToken,J.name,J.questionToken,J.type||s.typeToTypeNode(Z,t,1,8),J.initializer))}if(j)return{variableType:P,initializer:k};if(P=void 0,Xs(k))k=L.updateArrowFunction(k,Tm(e)?mS(e):void 0,k.typeParameters,G,k.type||s.typeToTypeNode(O.getReturnType(),t,1,8),k.equalsGreaterThanToken,k.body);else{if(O&&O.thisParameter){const J=Ac(G);if(!J||He(J.name)&&J.name.escapedText!=="this"){const Z=s.getTypeOfSymbolAtLocation(O.thisParameter,e);G.splice(0,0,L.createParameterDeclaration(void 0,void 0,"this",void 0,s.typeToTypeNode(Z,t,1,8)))}}k=L.updateFunctionExpression(k,Tm(e)?mS(e):void 0,k.asteriskToken,k.name,k.typeParameters,G,k.type||s.typeToTypeNode(O.getReturnType(),t,1),k.body)}return{variableType:P,initializer:k}}}function I$e(e,t){let r;for(;e!==void 0&&e!==t;){if(yi(e)&&e.initializer===r&&_d(e.parent)&&e.parent.declarations.length>1)return e;r=e,e=e.parent}}function x$e(e,t){let r;const i=e.symbol;if(i&&i.declarations)for(const o of i.declarations)(r===void 0||o.pos<r.pos)&&o.pos<t&&(r=o);return r}function R$e({type:e,declaration:t},{type:r,declaration:i}){return QQ(t,i,"pos",js)||Wd(e.symbol?e.symbol.getName():"",r.symbol?r.symbol.getName():"")||js(e.id,r.id)}function D$e(e,t,r){const i=L.createIdentifier(r);if(ui(e)){const o=t.facts&32?L.createIdentifier(e.name.text):L.createThis();return L.createPropertyAccessExpression(o,i)}else return i}function C$e(e,t,r,i,o){const s=r!==void 0||t.length>0;if(ea(e)&&!s&&i.size===0)return{body:L.createBlock(e.statements,!0),returnValueProperty:void 0};let l,u=!1;const d=L.createNodeArray(ea(e)?e.statements.slice(0):[Vi(e)?e:L.createReturnStatement(us(e))]);if(s||i.size){const h=Xn(d,_,Vi).slice();if(s&&!o&&Vi(e)){const g=qde(t,r);g.length===1?h.push(L.createReturnStatement(g[0].name)):h.push(L.createReturnStatement(L.createObjectLiteralExpression(g)))}return{body:L.createBlock(h,!0),returnValueProperty:l}}else return{body:L.createBlock(d,!0),returnValueProperty:void 0};function _(h){if(!u&&tf(h)&&s){const g=qde(t,r);return h.expression&&(l||(l="__return"),g.unshift(L.createPropertyAssignment(l,st(h.expression,_,St)))),g.length===1?L.createReturnStatement(g[0].name):L.createReturnStatement(L.createObjectLiteralExpression(g))}else{const g=u;u=u||Ms(h)||ui(h);const E=i.get(ls(h).toString()),A=E?_s(E):kn(h,_,void 0);return u=g,A}}}function N$e(e,t){return t.size?r(e):e;function r(i){const o=t.get(ls(i).toString());return o?_s(o):kn(i,r,void 0)}}function M$e(e){if(Ms(e)){const t=e.body;if(ea(t))return t.statements}else{if(t_(e)||Yi(e))return e.statements;if(ui(e))return e.members}return ae}function P$e(e,t){return hn(M$e(t),r=>r.pos>=e&&Ms(r)&&!Ml(r))}function L$e(e,t){const r=t.members;C.assert(r.length>0,"Found no members");let i,o=!0;for(const s of r){if(s.pos>e)return i||r[0];if(o&&!Po(s)){if(i!==void 0)return s;o=!1}i=s}return i===void 0?C.fail():i}function k$e(e,t){C.assert(!ui(t));let r;for(let i=e;i!==t;i=i.parent)Ude(i)&&(r=i);for(let i=(r||e).parent;;i=i.parent){if(hx(i)){let o;for(const s of i.statements){if(s.pos>e.pos)break;o=s}return!o&&xD(i)?(C.assert(UM(i.parent.parent),"Grandparent isn't a switch statement"),i.parent.parent):C.checkDefined(o,"prevStatement failed to get set")}C.assert(i!==t,"Didn't encounter a block-like before encountering scope")}}function qde(e,t){const r=Vt(e,o=>L.createShorthandPropertyAssignment(o.symbol.name)),i=Vt(t,o=>L.createShorthandPropertyAssignment(o.symbol.name));return r===void 0?i:i===void 0?r:r.concat(i)}function yv(e){return Mo(e)}function w$e(e,t){return yv(e.range)?{pos:$a(e.range).getStart(t),end:Ba(e.range).getEnd()}:e.range}function O$e(e,t,r,i,o,s){const l=new Map,u=[],d=[],_=[],h=[],g=[],E=new Map,A=[];let R;const N=yv(e.range)?e.range.length===1&&od(e.range[0])?e.range[0].expression:void 0:e.range;let P;if(N===void 0){const de=e.range,fe=$a(de).getStart(),ve=Ba(de).end;P=Oc(i,fe,ve-fe,Md.expressionExpected)}else o.getTypeAtLocation(N).flags&147456&&(P=Ar(N,Md.uselessConstantType));for(const de of t){u.push({usages:new Map,typeParameterUsages:new Map,substitutions:new Map}),d.push(new Map),_.push([]);const fe=[];P&&fe.push(P),ui(de)&&Ir(de)&&fe.push(Ar(de,Md.cannotExtractToJSClass)),Xs(de)&&!ea(de.body)&&fe.push(Ar(de,Md.cannotExtractToExpressionArrowFunction)),h.push(fe)}const k=new Map,W=yv(e.range)?L.createBlock(e.range):e.range,O=yv(e.range)?$a(e.range):e.range,G=j(O);if(Z(W),G&&!yv(e.range)&&!i_(e.range)){const de=o.getContextualType(e.range);J(de)}if(l.size>0){const de=new Map;let fe=0;for(let ve=O;ve!==void 0&&fe<t.length;ve=ve.parent)if(ve===t[fe]&&(de.forEach((xe,X)=>{u[fe].typeParameterUsages.set(X,xe)}),fe++),EG(ve))for(const xe of cb(ve)){const X=o.getTypeAtLocation(xe);l.has(X.id.toString())&&de.set(X.id.toString(),X)}C.assert(fe===t.length,"Should have iterated all scopes")}if(g.length){const de=SG(t[0],t[0].parent)?t[0]:sh(t[0]);Jo(de,ie)}for(let de=0;de<t.length;de++){const fe=u[de];if(de>0&&(fe.usages.size>0||fe.typeParameterUsages.size>0)){const X=yv(e.range)?e.range[0]:e.range;h[de].push(Ar(X,Md.cannotAccessVariablesFromNestedScopes))}e.facts&16&&ui(t[de])&&_[de].push(Ar(e.thisNode,Md.cannotExtractFunctionsContainingThisToMethod));let ve=!1,xe;if(u[de].usages.forEach(X=>{X.usage===2&&(ve=!0,X.symbol.flags&106500&&X.symbol.valueDeclaration&&wp(X.symbol.valueDeclaration,8)&&(xe=X.symbol.valueDeclaration))}),C.assert(yv(e.range)||A.length===0,"No variable declarations expected if something was extracted"),ve&&!yv(e.range)){const X=Ar(e.range,Md.cannotWriteInExpression);_[de].push(X),h[de].push(X)}else if(xe&&de>0){const X=Ar(xe,Md.cannotExtractReadonlyPropertyInitializerOutsideConstructor);_[de].push(X),h[de].push(X)}else if(R){const X=Ar(R,Md.cannotExtractExportedEntity);_[de].push(X),h[de].push(X)}}return{target:W,usagesPerScope:u,functionErrorsPerScope:_,constantErrorsPerScope:h,exposedVariableDeclarations:A};function j(de){return!!Dn(de,fe=>EG(fe)&&cb(fe).length!==0)}function J(de){const fe=o.getSymbolWalker(()=>(s.throwIfCancellationRequested(),!0)),{visitedTypes:ve}=fe.walkType(de);for(const xe of ve)xe.isTypeParameter()&&l.set(xe.id.toString(),xe)}function Z(de,fe=1){if(G){const ve=o.getTypeAtLocation(de);J(ve)}if(rd(de)&&de.symbol&&g.push(de),id(de))Z(de.left,2),Z(de.right);else if(ute(de))Z(de.operand,2);else if(qr(de)||Ws(de))Jo(de,Z);else if(He(de)){if(!de.parent||ku(de.parent)&&de!==de.parent.left||qr(de.parent)&&de!==de.parent.expression)return;q(de,fe,Hh(de))}else Jo(de,Z)}function q(de,fe,ve){const xe=ye(de,fe,ve);if(xe)for(let X=0;X<t.length;X++){const Ce=d[X].get(xe);Ce&&u[X].substitutions.set(ls(de).toString(),Ce)}}function ye(de,fe,ve){const xe=K(de);if(!xe)return;const X=Ta(xe).toString(),Ce=k.get(X);if(Ce&&Ce>=fe)return X;if(k.set(X,fe),Ce){for(const re of u)re.usages.get(de.text)&&re.usages.set(de.text,{usage:fe,symbol:xe,node:de});return X}const Je=xe.getDeclarations(),Se=Je&&hn(Je,re=>re.getSourceFile()===i);if(Se&&!vO(r,Se.getStart(),Se.end)){if(e.facts&2&&fe===2){const re=Ar(de,Md.cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators);for(const be of _)be.push(re);for(const be of h)be.push(re)}for(let re=0;re<t.length;re++){const be=t[re];if(o.resolveName(xe.name,be,xe.flags,!1)!==xe&&!d[re].has(X)){const Be=pe(xe.exportSymbol||xe,be,ve);if(Be)d[re].set(X,Be);else if(ve){if(!(xe.flags&262144)){const lt=Ar(de,Md.typeWillNotBeVisibleInTheNewScope);_[re].push(lt),h[re].push(lt)}}else u[re].usages.set(de.text,{usage:fe,symbol:xe,node:de})}}return X}}function ie(de){if(de===e.range||yv(e.range)&&e.range.includes(de))return;const fe=He(de)?K(de):o.getSymbolAtLocation(de);if(fe){const ve=hn(g,xe=>xe.symbol===fe);if(ve)if(yi(ve)){const xe=ve.symbol.id.toString();E.has(xe)||(A.push(ve),E.set(xe,!0))}else R=R||ve}Jo(de,ie)}function K(de){return de.parent&&Ud(de.parent)&&de.parent.name===de?o.getShorthandAssignmentValueSymbol(de.parent):o.getSymbolAtLocation(de)}function pe(de,fe,ve){if(!de)return;const xe=de.getDeclarations();if(xe&&xe.some(Ce=>Ce.parent===fe))return L.createIdentifier(de.name);const X=pe(de.parent,fe,ve);if(X!==void 0)return ve?L.createQualifiedName(X,L.createIdentifier(de.name)):L.createPropertyAccessExpression(X,de.name)}}function W$e(e){return Dn(e,t=>t.parent&&fDe(t)&&!Nr(t.parent))}function fDe(e){const{parent:t}=e;switch(t.kind){case 307:return!1}switch(e.kind){case 11:return t.kind!==273&&t.kind!==277;case 231:case 207:case 209:return!1;case 80:return t.kind!==209&&t.kind!==277&&t.kind!==282}return!0}function Jde(e){return Kde(e)||(r_(e)||I1(e)||e0(e))&&(r_(e.parent)||e0(e.parent))}function Kde(e){return ka(e)&&e.parent&&i_(e.parent)}var F$e={},nK="Generate 'get' and 'set' accessors",Xde=Ho(f.Generate_get_and_set_accessors),Yde={name:nK,description:Xde,kind:"refactor.rewrite.property.generateAccessors"};Dg(nK,{kinds:[Yde.kind],getEditsForAction:function(t,r){if(!t.endPosition)return;const i=cu.getAccessorConvertiblePropertyAtPosition(t.file,t.program,t.startPosition,t.endPosition);C.assert(i&&!gy(i),"Expected applicable refactor info");const o=cu.generateAccessorFromProperty(t.file,t.program,t.startPosition,t.endPosition,t,r);if(!o)return;const s=t.file.fileName,l=i.renameAccessor?i.accessorName:i.fieldName,d=(He(l)?0:-1)+DO(o,s,l.text,to(i.declaration));return{renameFilename:s,renameLocation:d,edits:o}},getAvailableActions(e){if(!e.endPosition)return ae;const t=cu.getAccessorConvertiblePropertyAtPosition(e.file,e.program,e.startPosition,e.endPosition,e.triggerReason==="invoked");return t?gy(t)?e.preferences.provideRefactorNotApplicableReason?[{name:nK,description:Xde,actions:[{...Yde,notApplicableReason:t.error}]}]:ae:[{name:nK,description:Xde,actions:[Yde]}]:ae}});var z$e={},rK="Infer function return type",$de=Ho(f.Infer_function_return_type),iK={name:rK,description:$de,kind:"refactor.rewrite.function.returnType"};Dg(rK,{kinds:[iK.kind],getEditsForAction:B$e,getAvailableActions:G$e});function B$e(e){const t=mDe(e);if(t&&!gy(t))return{renameFilename:void 0,renameLocation:void 0,edits:Rr.ChangeTracker.with(e,i=>V$e(e.file,i,t.declaration,t.returnTypeNode))}}function G$e(e){const t=mDe(e);return t?gy(t)?e.preferences.provideRefactorNotApplicableReason?[{name:rK,description:$de,actions:[{...iK,notApplicableReason:t.error}]}]:ae:[{name:rK,description:$de,actions:[iK]}]:ae}function V$e(e,t,r,i){const o=Es(r,22,e),s=Xs(r)&&o===void 0,l=s?$a(r.parameters):o;l&&(s&&(t.insertNodeBefore(e,l,L.createToken(21)),t.insertNodeAfter(e,l,L.createToken(22))),t.insertNodeAt(e,l.end,i,{prefix:": "}))}function mDe(e){if(Ir(e.file)||!h0(iK.kind,e.kind))return;const t=ip(e.file,e.startPosition),r=Dn(t,l=>ea(l)||l.parent&&Xs(l.parent)&&(l.kind===39||l.parent.body===l)?"quit":j$e(l));if(!r||!r.body||r.type)return{error:Ho(f.Return_type_must_be_inferred_from_a_function)};const i=e.program.getTypeChecker();let o;if(i.isImplementationOfOverload(r)){const l=i.getTypeAtLocation(r).getCallSignatures();l.length>1&&(o=i.getUnionType(Ui(l,u=>u.getReturnType())))}if(!o){const l=i.getSignatureFromDeclaration(r);if(l){const u=i.getTypePredicateOfSignature(l);if(u&&u.type){const d=i.typePredicateToTypePredicateNode(u,r,1,8);if(d)return{declaration:r,returnTypeNode:d}}else o=i.getReturnTypeOfSignature(l)}}if(!o)return{error:Ho(f.Could_not_determine_function_return_type)};const s=i.typeToTypeNode(o,r,1,8);if(s)return{declaration:r,returnTypeNode:s}}function j$e(e){switch(e.kind){case 263:case 219:case 220:case 175:return!0;default:return!1}}var hDe=(e=>(e[e.typeOffset=8]="typeOffset",e[e.modifierMask=255]="modifierMask",e))(hDe||{}),_De=(e=>(e[e.class=0]="class",e[e.enum=1]="enum",e[e.interface=2]="interface",e[e.namespace=3]="namespace",e[e.typeParameter=4]="typeParameter",e[e.type=5]="type",e[e.parameter=6]="parameter",e[e.variable=7]="variable",e[e.enumMember=8]="enumMember",e[e.property=9]="property",e[e.function=10]="function",e[e.member=11]="member",e))(_De||{}),gDe=(e=>(e[e.declaration=0]="declaration",e[e.static=1]="static",e[e.async=2]="async",e[e.readonly=3]="readonly",e[e.defaultLibrary=4]="defaultLibrary",e[e.local=5]="local",e))(gDe||{});function yDe(e,t,r,i){const o=Qde(e,t,r,i);C.assert(o.spans.length%3===0);const s=o.spans,l=[];for(let u=0;u<s.length;u+=3)l.push({textSpan:Id(s[u],s[u+1]),classificationType:s[u+2]});return l}function Qde(e,t,r,i){return{spans:U$e(e,r,i,t),endOfLineState:0}}function U$e(e,t,r,i){const o=[];return e&&t&&H$e(e,t,r,(l,u,d)=>{o.push(l.getStart(t),l.getWidth(t),(u+1<<8)+d)},i),o}function H$e(e,t,r,i,o){const s=e.getTypeChecker();let l=!1;function u(d){switch(d.kind){case 268:case 264:case 265:case 263:case 232:case 219:case 220:o.throwIfCancellationRequested()}if(!d||!M2(r,d.pos,d.getFullWidth())||d.getFullWidth()===0)return;const _=l;if((r_(d)||I1(d))&&(l=!0),ID(d)&&(l=!1),He(d)&&!l&&!X$e(d)&&!NM(d.escapedText)){let h=s.getSymbolAtLocation(d);if(h){h.flags&2097152&&(h=s.getAliasedSymbol(h));let g=q$e(h,W1(d));if(g!==void 0){let E=0;d.parent&&(Ha(d.parent)||TDe.get(d.parent.kind)===g)&&d.parent.name===d&&(E=1),g===6&&bDe(d)&&(g=9),g=J$e(s,d,g);const A=h.valueDeclaration;if(A){const R=PT(A),N=ty(A);R&256&&(E|=2),R&1024&&(E|=4),g!==0&&g!==2&&(R&8||N&2||h.getFlags()&8)&&(E|=8),(g===7||g===10)&&K$e(A,t)&&(E|=32),e.isSourceFileDefaultLibrary(A.getSourceFile())&&(E|=16)}else h.declarations&&h.declarations.some(R=>e.isSourceFileDefaultLibrary(R.getSourceFile()))&&(E|=16);i(d,g,E)}}}Jo(d,u),l=_}u(t)}function q$e(e,t){const r=e.getFlags();if(r&32)return 0;if(r&384)return 1;if(r&524288)return 5;if(r&64){if(t&2)return 2}else if(r&262144)return 4;let i=e.valueDeclaration||e.declarations&&e.declarations[0];return i&&Ha(i)&&(i=vDe(i)),i&&TDe.get(i.kind)}function J$e(e,t,r){if(r===7||r===9||r===6){const i=e.getTypeAtLocation(t);if(i){const o=s=>s(i)||i.isUnion()&&i.types.some(s);if(r!==6&&o(s=>s.getConstructSignatures().length>0))return 0;if(o(s=>s.getCallSignatures().length>0)&&!o(s=>s.getProperties().length>0)||Y$e(t))return r===9?11:10}}return r}function K$e(e,t){return Ha(e)&&(e=vDe(e)),yi(e)?(!Yi(e.parent.parent.parent)||US(e.parent))&&e.getSourceFile()===t:Zl(e)?!Yi(e.parent)&&e.getSourceFile()===t:!1}function vDe(e){for(;;)if(Ha(e.parent.parent))e=e.parent.parent;else return e.parent.parent}function X$e(e){const t=e.parent;return t&&(Vm(t)||Eu(t)||Ig(t))}function Y$e(e){for(;bDe(e);)e=e.parent;return Zo(e.parent)&&e.parent.expression===e}function bDe(e){return ku(e.parent)&&e.parent.right===e||qr(e.parent)&&e.parent.name===e}var TDe=new Map([[261,7],[170,6],[173,9],[268,3],[267,1],[307,8],[264,0],[175,11],[263,10],[219,10],[174,11],[178,9],[179,9],[172,9],[265,2],[266,5],[169,4],[304,9],[305,9]]),SDe="0.8";function EDe(e,t,r,i){const o=gF(e)?new Zde(e,t,r):e===80?new IDe(80,t,r):e===81?new xDe(81,t,r):new ADe(e,t,r);return o.parent=i,o.flags=i.flags&101441536,o}var Zde=class{constructor(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.modifierFlagsCache=0,this.transformFlags=0,this.parent=void 0,this.original=void 0,this.emitNode=void 0}assertHasRealPosition(e){C.assert(!dh(this.pos)&&!dh(this.end),e||"Node must have a real position for this operation")}getSourceFile(){return Wn(this)}getStart(e,t){return this.assertHasRealPosition(),gb(this,e,t)}getFullStart(){return this.assertHasRealPosition(),this.pos}getEnd(){return this.assertHasRealPosition(),this.end}getWidth(e){return this.assertHasRealPosition(),this.getEnd()-this.getStart(e)}getFullWidth(){return this.assertHasRealPosition(),this.end-this.pos}getLeadingTriviaWidth(e){return this.assertHasRealPosition(),this.getStart(e)-this.pos}getFullText(e){return this.assertHasRealPosition(),(e||this.getSourceFile()).text.substring(this.pos,this.end)}getText(e){return this.assertHasRealPosition(),e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())}getChildCount(e){return this.getChildren(e).length}getChildAt(e,t){return this.getChildren(t)[e]}getChildren(e=Wn(this)){return this.assertHasRealPosition("Node without a real position cannot be scanned and thus has no token nodes - use forEachChild and collect the result if that's fine"),Lj(this,e)??Fie(this,e,$$e(this,e))}getFirstToken(e){this.assertHasRealPosition();const t=this.getChildren(e);if(!t.length)return;const r=hn(t,i=>i.kind<310||i.kind>352);return r.kind<167?r:r.getFirstToken(e)}getLastToken(e){this.assertHasRealPosition();const t=this.getChildren(e),r=Zs(t);if(r)return r.kind<167?r:r.getLastToken(e)}forEachChild(e,t){return Jo(this,e,t)}};function $$e(e,t){const r=[];if(IF(e))return e.forEachChild(l=>{r.push(l)}),r;yd.setText((t||e.getSourceFile()).text);let i=e.pos;const o=l=>{rz(r,i,l.pos,e),r.push(l),i=l.end},s=l=>{rz(r,i,l.pos,e),r.push(Q$e(l,e)),i=l.end};return Ye(e.jsDoc,o),i=e.pos,e.forEachChild(o,s),rz(r,i,e.end,e),yd.setText(void 0),r}function rz(e,t,r,i){for(yd.resetTokenState(t);t<r;){const o=yd.scan(),s=yd.getTokenEnd();if(s<=r){if(o===80){if(Ore(i))continue;C.fail(`Did not expect ${C.formatSyntaxKind(i.kind)} to have an Identifier in its trivia`)}e.push(EDe(o,t,s,i))}if(t=s,o===1)break}}function Q$e(e,t){const r=EDe(353,e.pos,e.end,t),i=[];let o=e.pos;for(const s of e)rz(i,o,s.pos,t),i.push(s),o=s.end;return rz(i,o,e.end,t),r._children=i,r}var eue=class{constructor(e,t,r){this.pos=t,this.end=r,this.kind=e,this.id=0,this.flags=0,this.transformFlags=0,this.parent=void 0,this.emitNode=void 0}getSourceFile(){return Wn(this)}getStart(e,t){return gb(this,e,t)}getFullStart(){return this.pos}getEnd(){return this.end}getWidth(e){return this.getEnd()-this.getStart(e)}getFullWidth(){return this.end-this.pos}getLeadingTriviaWidth(e){return this.getStart(e)-this.pos}getFullText(e){return(e||this.getSourceFile()).text.substring(this.pos,this.end)}getText(e){return e||(e=this.getSourceFile()),e.text.substring(this.getStart(e),this.getEnd())}getChildCount(){return this.getChildren().length}getChildAt(e){return this.getChildren()[e]}getChildren(){return this.kind===1&&this.jsDoc||ae}getFirstToken(){}getLastToken(){}forEachChild(){}},Z$e=class{constructor(e,t){this.flags=e,this.escapedName=t,this.declarations=void 0,this.valueDeclaration=void 0,this.id=0,this.mergeId=0,this.parent=void 0,this.members=void 0,this.exports=void 0,this.exportSymbol=void 0,this.constEnumOnlyModule=void 0,this.isReferenced=void 0,this.lastAssignmentPos=void 0,this.links=void 0}getFlags(){return this.flags}get name(){return wl(this)}getEscapedName(){return this.escapedName}getName(){return this.name}getDeclarations(){return this.declarations}getDocumentationComment(e){if(!this.documentationComment)if(this.documentationComment=ae,!this.declarations&&pg(this)&&this.links.target&&pg(this.links.target)&&this.links.target.links.tupleLabelDeclaration){const t=this.links.target.links.tupleLabelDeclaration;this.documentationComment=iz([t],e)}else this.documentationComment=iz(this.declarations,e);return this.documentationComment}getContextualDocumentationComment(e,t){if(e){if(ug(e)&&(this.contextualGetAccessorDocumentationComment||(this.contextualGetAccessorDocumentationComment=ae,this.contextualGetAccessorDocumentationComment=iz(Un(this.declarations,ug),t)),et(this.contextualGetAccessorDocumentationComment)))return this.contextualGetAccessorDocumentationComment;if(Vh(e)&&(this.contextualSetAccessorDocumentationComment||(this.contextualSetAccessorDocumentationComment=ae,this.contextualSetAccessorDocumentationComment=iz(Un(this.declarations,Vh),t)),et(this.contextualSetAccessorDocumentationComment)))return this.contextualSetAccessorDocumentationComment}return this.getDocumentationComment(t)}getJsDocTags(e){return this.tags===void 0&&(this.tags=ae,this.tags=oK(this.declarations,e)),this.tags}getContextualJsDocTags(e,t){if(e){if(ug(e)&&(this.contextualGetAccessorTags||(this.contextualGetAccessorTags=ae,this.contextualGetAccessorTags=oK(Un(this.declarations,ug),t)),et(this.contextualGetAccessorTags)))return this.contextualGetAccessorTags;if(Vh(e)&&(this.contextualSetAccessorTags||(this.contextualSetAccessorTags=ae,this.contextualSetAccessorTags=oK(Un(this.declarations,Vh),t)),et(this.contextualSetAccessorTags)))return this.contextualSetAccessorTags}return this.getJsDocTags(t)}},ADe=class extends eue{constructor(e,t,r){super(e,t,r)}},IDe=class extends eue{constructor(e,t,r){super(e,t,r)}get text(){return Kr(this)}},xDe=class extends eue{constructor(e,t,r){super(e,t,r)}get text(){return Kr(this)}},eQe=class{constructor(e,t){this.flags=t,this.checker=e}getFlags(){return this.flags}getSymbol(){return this.symbol}getProperties(){return this.checker.getPropertiesOfType(this)}getProperty(e){return this.checker.getPropertyOfType(this,e)}getApparentProperties(){return this.checker.getAugmentedPropertiesOfType(this)}getCallSignatures(){return this.checker.getSignaturesOfType(this,0)}getConstructSignatures(){return this.checker.getSignaturesOfType(this,1)}getStringIndexType(){return this.checker.getIndexTypeOfType(this,0)}getNumberIndexType(){return this.checker.getIndexTypeOfType(this,1)}getBaseTypes(){return this.isClassOrInterface()?this.checker.getBaseTypes(this):void 0}isNullableType(){return this.checker.isNullableType(this)}getNonNullableType(){return this.checker.getNonNullableType(this)}getNonOptionalType(){return this.checker.getNonOptionalType(this)}getConstraint(){return this.checker.getBaseConstraintOfType(this)}getDefault(){return this.checker.getDefaultFromTypeParameter(this)}isUnion(){return!!(this.flags&1048576)}isIntersection(){return!!(this.flags&2097152)}isUnionOrIntersection(){return!!(this.flags&3145728)}isLiteral(){return!!(this.flags&2432)}isStringLiteral(){return!!(this.flags&128)}isNumberLiteral(){return!!(this.flags&256)}isTypeParameter(){return!!(this.flags&262144)}isClassOrInterface(){return!!(Hr(this)&3)}isClass(){return!!(Hr(this)&1)}isIndexType(){return!!(this.flags&4194304)}get typeArguments(){if(Hr(this)&4)return this.checker.getTypeArguments(this)}},tQe=class{constructor(e,t){this.flags=t,this.checker=e}getDeclaration(){return this.declaration}getTypeParameters(){return this.typeParameters}getParameters(){return this.parameters}getReturnType(){return this.checker.getReturnTypeOfSignature(this)}getTypeParameterAtPosition(e){const t=this.checker.getParameterType(this,e);if(t.isIndexType()&&MM(t.type)){const r=t.type.getConstraint();if(r)return this.checker.getIndexType(r)}return t}getDocumentationComment(){return this.documentationComment||(this.documentationComment=iz(eI(this.declaration),this.checker))}getJsDocTags(){return this.jsDocTags||(this.jsDocTags=oK(eI(this.declaration),this.checker))}};function RDe(e){return kT(e).some(t=>t.tagName.text==="inheritDoc"||t.tagName.text==="inheritdoc")}function oK(e,t){if(!e)return ae;let r=y0.getJsDocTagsFromDeclarations(e,t);if(t&&(r.length===0||e.some(RDe))){const i=new Set;for(const o of e){const s=DDe(t,o,l=>{var u;if(!i.has(l))return i.add(l),o.kind===178||o.kind===179?l.getContextualJsDocTags(o,t):((u=l.declarations)==null?void 0:u.length)===1?l.getJsDocTags(t):void 0});s&&(r=[...s,...r])}}return r}function iz(e,t){if(!e)return ae;let r=y0.getJsDocCommentsFromDeclarations(e,t);if(t&&(r.length===0||e.some(RDe))){const i=new Set;for(const o of e){const s=DDe(t,o,l=>{if(!i.has(l))return i.add(l),o.kind===178||o.kind===179?l.getContextualDocumentationComment(o,t):l.getDocumentationComment(t)});s&&(r=r.length===0?s.slice():s.concat(iC(),r))}}return r}function DDe(e,t,r){var i;const o=((i=t.parent)==null?void 0:i.kind)===177?t.parent.parent:t.parent;if(!o)return;const s=wc(t);return Hn(rM(o),l=>{const u=e.getTypeAtLocation(l),d=s&&u.symbol?e.getTypeOfSymbol(u.symbol):u,_=e.getPropertyOfType(d,t.symbol.name);return _?r(_):void 0})}var nQe=class extends Zde{constructor(e,t,r){super(e,t,r)}update(e,t){return Kj(this,e,t)}getLineAndCharacterOfPosition(e){return ca(this,e)}getLineStarts(){return ag(this)}getPositionOfLineAndCharacter(e,t,r){return aF(ag(this),e,t,this.text,r)}getLineEndOfPosition(e){const{line:t}=this.getLineAndCharacterOfPosition(e),r=this.getLineStarts();let i;t+1>=r.length&&(i=this.getEnd()),i||(i=r[t+1]-1);const o=this.getFullText();return o[i]===`
428`&&o[i-1]==="\r"?i-1:i}getNamedDeclarations(){return this.namedDeclarations||(this.namedDeclarations=this.computeNamedDeclarations()),this.namedDeclarations}computeNamedDeclarations(){const e=cm();return this.forEachChild(o),e;function t(s){const l=i(s);l&&e.add(l,s)}function r(s){let l=e.get(s);return l||e.set(s,l=[]),l}function i(s){const l=cF(s);return l&&(va(l)&&qr(l.expression)?l.expression.name.text:vc(l)?AO(l):void 0)}function o(s){switch(s.kind){case 263:case 219:case 175:case 174:const l=s,u=i(l);if(u){const h=r(u),g=Zs(h);g&&l.parent===g.parent&&l.symbol===g.symbol?l.body&&!g.body&&(h[h.length-1]=l):h.push(l)}Jo(s,o);break;case 264:case 232:case 265:case 266:case 267:case 268:case 272:case 282:case 277:case 274:case 275:case 178:case 179:case 188:t(s),Jo(s,o);break;case 170:if(!di(s,31))break;case 261:case 209:{const h=s;if(Qo(h.name)){Jo(h.name,o);break}h.initializer&&o(h.initializer)}case 307:case 173:case 172:t(s);break;case 279:const d=s;d.exportClause&&(Jf(d.exportClause)?Ye(d.exportClause.elements,o):o(d.exportClause.name));break;case 273:const _=s.importClause;_&&(_.name&&t(_.name),_.namedBindings&&(_.namedBindings.kind===275?t(_.namedBindings):Ye(_.namedBindings.elements,o)));break;case 227:oc(s)!==0&&t(s);default:Jo(s,o)}}}},rQe=class{constructor(e,t,r){this.fileName=e,this.text=t,this.skipTrivia=r||(i=>i)}getLineAndCharacterOfPosition(e){return ca(this,e)}};function iQe(){return{getNodeConstructor:()=>Zde,getTokenConstructor:()=>ADe,getIdentifierConstructor:()=>IDe,getPrivateIdentifierConstructor:()=>xDe,getSourceFileConstructor:()=>nQe,getSymbolConstructor:()=>Z$e,getTypeConstructor:()=>eQe,getSignatureConstructor:()=>tQe,getSourceMapSourceConstructor:()=>rQe}}function GO(e){let t=!0;for(const i in e)if(Rs(e,i)&&!CDe(i)){t=!1;break}if(t)return e;const r={};for(const i in e)if(Rs(e,i)){const o=CDe(i)?i:i.charAt(0).toLowerCase()+i.substr(1);r[o]=e[i]}return r}function CDe(e){return!e.length||e.charAt(0)===e.charAt(0).toLowerCase()}function VO(e){return e?Vt(e,t=>t.text).join(""):""}function oz(){return{target:1,jsx:1}}function aK(){return cu.getSupportedErrorCodes()}var oQe=class{constructor(e){this.host=e}getCurrentSourceFile(e){var t,r,i,o,s,l,u,d;const _=this.host.getScriptSnapshot(e);if(!_)throw new Error("Could not find file: '"+e+"'.");const h=sJ(e,this.host),g=this.host.getScriptVersion(e);let E;if(this.currentFileName!==e){const A={languageVersion:99,impliedNodeFormat:iO(ks(e,this.host.getCurrentDirectory(),((i=(r=(t=this.host).getCompilerHost)==null?void 0:r.call(t))==null?void 0:i.getCanonicalFileName)||ay(this.host)),(d=(u=(l=(s=(o=this.host).getCompilerHost)==null?void 0:s.call(o))==null?void 0:l.getModuleResolutionCache)==null?void 0:u.call(l))==null?void 0:d.getPackageJsonInfoCache(),this.host,this.host.getCompilationSettings()),setExternalModuleIndicator:Uk(this.host.getCompilationSettings()),jsDocParsingMode:0};E=az(e,_,A,g,!0,h)}else if(this.currentFileVersion!==g){const A=_.getChangeRange(this.currentFileScriptSnapshot);E=sK(this.currentSourceFile,_,g,A)}return E&&(this.currentFileVersion=g,this.currentFileName=e,this.currentFileScriptSnapshot=_,this.currentSourceFile=E),this.currentSourceFile}};function NDe(e,t,r){e.version=r,e.scriptSnapshot=t}function az(e,t,r,i,o,s){const l=tx(e,fx(t),r,o,s);return NDe(l,t,i),l}function sK(e,t,r,i,o){if(i&&r!==e.version){let l;const u=i.span.start!==0?e.text.substr(0,i.span.start):"",d=Dl(i.span)!==e.text.length?e.text.substr(Dl(i.span)):"";if(i.newLength===0)l=u&&d?u+d:u||d;else{const h=t.getText(i.span.start,i.span.start+i.newLength);l=u&&d?u+h+d:u?u+h:h+d}const _=Kj(e,l,i,o);return NDe(_,t,r),_.nameTable=void 0,e!==_&&e.scriptSnapshot&&(e.scriptSnapshot.dispose&&e.scriptSnapshot.dispose(),e.scriptSnapshot=void 0),_}const s={languageVersion:e.languageVersion,impliedNodeFormat:e.impliedNodeFormat,setExternalModuleIndicator:e.setExternalModuleIndicator,jsDocParsingMode:e.jsDocParsingMode};return az(e.fileName,t,s,r,!0,e.scriptKind)}var aQe={isCancellationRequested:Qg,throwIfCancellationRequested:gs},sQe=class{constructor(e){this.cancellationToken=e}isCancellationRequested(){return this.cancellationToken.isCancellationRequested()}throwIfCancellationRequested(){var e;if(this.isCancellationRequested())throw(e=xr)==null||e.instant(xr.Phase.Session,"cancellationThrown",{kind:"CancellationTokenObject"}),new TN}},tue=class{constructor(e,t=20){this.hostCancellationToken=e,this.throttleWaitMilliseconds=t,this.lastCancellationCheckTime=0}isCancellationRequested(){const e=Ls();return Math.abs(e-this.lastCancellationCheckTime)>=this.throttleWaitMilliseconds?(this.lastCancellationCheckTime=e,this.hostCancellationToken.isCancellationRequested()):!1}throwIfCancellationRequested(){var e;if(this.isCancellationRequested())throw(e=xr)==null||e.instant(xr.Phase.Session,"cancellationThrown",{kind:"ThrottledCancellationToken"}),new TN}},MDe=["getSemanticDiagnostics","getSuggestionDiagnostics","getCompilerOptionsDiagnostics","getSemanticClassifications","getEncodedSemanticClassifications","getCodeFixesAtPosition","getCombinedCodeFix","applyCodeActionCommand","organizeImports","getEditsForFileRename","getEmitOutput","getApplicableRefactors","getEditsForRefactor","prepareCallHierarchy","provideCallHierarchyIncomingCalls","provideCallHierarchyOutgoingCalls","provideInlayHints","getSupportedCodeFixes","getPasteEdits"],lQe=[...MDe,"getCompletionsAtPosition","getCompletionEntryDetails","getCompletionEntrySymbol","getSignatureHelpItems","getQuickInfoAtPosition","getDefinitionAtPosition","getDefinitionAndBoundSpan","getImplementationAtPosition","getTypeDefinitionAtPosition","getReferencesAtPosition","findReferences","getDocumentHighlights","getNavigateToItems","getRenameInfo","findRenameLocations","getApplicableRefactors","preparePasteEditsForFile"];function nue(e,t=xce(e.useCaseSensitiveFileNames&&e.useCaseSensitiveFileNames(),e.getCurrentDirectory(),e.jsDocParsingMode),r){var i;let o;r===void 0?o=0:typeof r=="boolean"?o=r?2:0:o=r;const s=new oQe(e);let l,u,d=0;const _=e.getCancellationToken?new sQe(e.getCancellationToken()):aQe,h=e.getCurrentDirectory();ore((i=e.getLocalizedDiagnosticMessages)==null?void 0:i.bind(e));function g(ft){e.log&&e.log(ft)}const E=d1(e),A=Fd(E),R=Bce({useCaseSensitiveFileNames:()=>E,getCurrentDirectory:()=>h,getProgram:W,fileExists:ia(e,e.fileExists),readFile:ia(e,e.readFile),getDocumentPositionMapper:ia(e,e.getDocumentPositionMapper),getSourceFileLike:ia(e,e.getSourceFileLike),log:g});function N(ft){const Mt=l.getSourceFile(ft);if(!Mt){const jt=new Error(`Could not find source file: '${ft}'.`);throw jt.ProgramFiles=l.getSourceFiles().map(Qt=>Qt.fileName),jt}return Mt}function P(){e.updateFromProject&&!e.updateFromProjectInProgress?e.updateFromProject():k()}function k(){var ft,Mt,jt;if(C.assert(o!==2),e.getProjectVersion){const Lo=e.getProjectVersion();if(Lo){if(u===Lo&&!((ft=e.hasChangedAutomaticTypeDirectiveNames)!=null&&ft.call(e)))return;u=Lo}}const Qt=e.getTypeRootsVersion?e.getTypeRootsVersion():0;d!==Qt&&(g("TypeRoots version has changed; provide new program"),l=void 0,d=Qt);const In=e.getScriptFileNames().slice(),yn=e.getCompilationSettings()||oz(),wt=e.hasInvalidatedResolutions||Qg,En=ia(e,e.hasInvalidatedLibResolutions)||Qg,xn=ia(e,e.hasChangedAutomaticTypeDirectiveNames),Ln=(Mt=e.getProjectReferences)==null?void 0:Mt.call(e);let ln,Ii={getSourceFile:ec,getSourceFileByPath:bf,getCancellationToken:()=>_,getCanonicalFileName:A,useCaseSensitiveFileNames:()=>E,getNewLine:()=>iv(yn),getDefaultLibFileName:Lo=>e.getDefaultLibFileName(Lo),writeFile:gs,getCurrentDirectory:()=>h,fileExists:Lo=>e.fileExists(Lo),readFile:Lo=>e.readFile&&e.readFile(Lo),getSymlinkCache:ia(e,e.getSymlinkCache),realpath:ia(e,e.realpath),directoryExists:Lo=>ch(Lo,e),getDirectories:Lo=>e.getDirectories?e.getDirectories(Lo):[],readDirectory:(Lo,fa,is,qa,Zt)=>(C.checkDefined(e.readDirectory,"'LanguageServiceHost.readDirectory' must be implemented to correctly process 'projectReferences'"),e.readDirectory(Lo,fa,is,qa,Zt)),onReleaseOldSourceFile:Ra,onReleaseParsedCommandLine:Tc,hasInvalidatedResolutions:wt,hasInvalidatedLibResolutions:En,hasChangedAutomaticTypeDirectiveNames:xn,trace:ia(e,e.trace),resolveModuleNames:ia(e,e.resolveModuleNames),getModuleResolutionCache:ia(e,e.getModuleResolutionCache),createHash:ia(e,e.createHash),resolveTypeReferenceDirectives:ia(e,e.resolveTypeReferenceDirectives),resolveModuleNameLiterals:ia(e,e.resolveModuleNameLiterals),resolveTypeReferenceDirectiveReferences:ia(e,e.resolveTypeReferenceDirectiveReferences),resolveLibrary:ia(e,e.resolveLibrary),useSourceOfProjectReferenceRedirect:ia(e,e.useSourceOfProjectReferenceRedirect),getParsedCommandLine:co,jsDocParsingMode:e.jsDocParsingMode,getGlobalTypingsCacheLocation:ia(e,e.getGlobalTypingsCacheLocation)};const ra=Ii.getSourceFile,{getSourceFileWithCache:sa}=yP(Ii,Lo=>ks(Lo,h,A),(...Lo)=>ra.call(Ii,...Lo));Ii.getSourceFile=sa,(jt=e.setCompilerHost)==null||jt.call(e,Ii);const zo={useCaseSensitiveFileNames:E,fileExists:Lo=>Ii.fileExists(Lo),readFile:Lo=>Ii.readFile(Lo),directoryExists:Lo=>Ii.directoryExists(Lo),getDirectories:Lo=>Ii.getDirectories(Lo),realpath:Ii.realpath,readDirectory:(...Lo)=>Ii.readDirectory(...Lo),trace:Ii.trace,getCurrentDirectory:Ii.getCurrentDirectory,onUnRecoverableConfigFileDiagnostic:gs},Bl=t.getKeyForCompilationSettings(yn);let xl=new Set;if(AH(l,In,yn,(Lo,fa)=>e.getScriptVersion(fa),Lo=>Ii.fileExists(Lo),wt,En,xn,co,Ln)){Ii=void 0,ln=void 0,xl=void 0;return}l=oO({rootNames:In,options:yn,host:Ii,oldProgram:l,projectReferences:Ln}),Ii=void 0,ln=void 0,xl=void 0,R.clearCache(),l.getTypeChecker();return;function co(Lo){const fa=ks(Lo,h,A),is=ln?.get(fa);if(is!==void 0)return is||void 0;const qa=e.getParsedCommandLine?e.getParsedCommandLine(Lo):Go(Lo);return(ln||(ln=new Map)).set(fa,qa||!1),qa}function Go(Lo){const fa=ec(Lo,100);if(fa)return fa.path=ks(Lo,h,A),fa.resolvedPath=fa.path,fa.originalFileName=fa.fileName,Ow(fa,zo,To(ci(Lo),h),void 0,To(Lo,h))}function Tc(Lo,fa,is){var qa;e.getParsedCommandLine?(qa=e.onReleaseParsedCommandLine)==null||qa.call(e,Lo,fa,is):fa&&$s(fa.sourceFile,is)}function $s(Lo,fa){const is=t.getKeyForCompilationSettings(fa);t.releaseDocumentWithKey(Lo.resolvedPath,is,Lo.scriptKind,Lo.impliedNodeFormat)}function Ra(Lo,fa,is,qa){var Zt;$s(Lo,fa),(Zt=e.onReleaseOldSourceFile)==null||Zt.call(e,Lo,fa,is,qa)}function ec(Lo,fa,is,qa){return bf(Lo,ks(Lo,h,A),fa,is,qa)}function bf(Lo,fa,is,qa,Zt){C.assert(Ii,"getOrCreateSourceFileByPath called after typical CompilerHost lifetime, check the callstack something with a reference to an old host.");const As=e.getScriptSnapshot(Lo);if(!As)return;const Hl=sJ(Lo,e),sc=e.getScriptVersion(Lo);if(!Zt){const vd=l&&l.getSourceFileByPath(fa);if(vd){if(Hl===vd.scriptKind||xl.has(vd.resolvedPath))return t.updateDocumentWithKey(Lo,fa,e,Bl,As,sc,Hl,is);t.releaseDocumentWithKey(vd.resolvedPath,t.getKeyForCompilationSettings(l.getCompilerOptions()),vd.scriptKind,vd.impliedNodeFormat),xl.add(vd.resolvedPath)}}return t.acquireDocumentWithKey(Lo,fa,e,Bl,As,sc,Hl,is)}}function W(){if(o===2){C.assert(l===void 0);return}return P(),l}function O(){var ft;return(ft=e.getPackageJsonAutoImportProvider)==null?void 0:ft.call(e)}function G(ft,Mt){const jt=l.getTypeChecker(),Qt=In();if(!Qt)return!1;for(const wt of ft)for(const En of wt.references){const xn=yn(En);if(C.assertIsDefined(xn),Mt.has(En)||Ys.isDeclarationOfSymbol(xn,Qt)){Mt.add(En),En.isDefinition=!0;const Ln=x7(En,R,ia(e,e.fileExists));Ln&&Mt.add(Ln)}else En.isDefinition=!1}return!0;function In(){for(const wt of ft)for(const En of wt.references){if(Mt.has(En)){const Ln=yn(En);return C.assertIsDefined(Ln),jt.getSymbolAtLocation(Ln)}const xn=x7(En,R,ia(e,e.fileExists));if(xn&&Mt.has(xn)){const Ln=yn(xn);if(Ln)return jt.getSymbolAtLocation(Ln)}}}function yn(wt){const En=l.getSourceFile(wt.fileName);if(!En)return;const xn=ip(En,wt.textSpan.start);return Ys.Core.getAdjustedNode(xn,{use:Ys.FindReferencesUse.References})}}function j(){if(l){const ft=t.getKeyForCompilationSettings(l.getCompilerOptions());Ye(l.getSourceFiles(),Mt=>t.releaseDocumentWithKey(Mt.resolvedPath,ft,Mt.scriptKind,Mt.impliedNodeFormat)),l=void 0}}function J(){j(),e=void 0}function Z(ft){return P(),l.getSyntacticDiagnostics(N(ft),_).slice()}function q(ft){P();const Mt=N(ft),jt=l.getSemanticDiagnostics(Mt,_);if(!_p(l.getCompilerOptions()))return jt.slice();const Qt=l.getDeclarationDiagnostics(Mt,_);return[...jt,...Qt]}function ye(ft,Mt){P();const jt=N(ft),Qt=l.getCompilerOptions();if(mD(jt,Qt,l)||!xM(jt,Qt)||l.getCachedSemanticDiagnostics(jt))return;const In=ie(jt,Mt);if(!In)return;const yn=O9(In.map(En=>ic(En.getFullStart(),En.getEnd())));return{diagnostics:l.getSemanticDiagnostics(jt,_,In).slice(),spans:yn}}function ie(ft,Mt){const jt=[],Qt=O9(Mt.map(In=>_v(In)));for(const In of Qt){const yn=K(ft,In);if(!yn)return;jt.push(...yn)}if(jt.length)return jt}function K(ft,Mt){if(w9(Mt,ft))return;const jt=RP(ft,Dl(Mt))||ft,Qt=Dn(jt,yn=>Mee(yn,Mt)),In=[];if(pe(Mt,Qt,In),ft.end===Mt.start+Mt.length&&In.push(ft.endOfFileToken),!yt(In,Yi))return In}function pe(ft,Mt,jt){return de(Mt,ft)?w9(ft,Mt)?(fe(Mt,jt),!0):hx(Mt)?ve(ft,Mt,jt):ui(Mt)?xe(ft,Mt,jt):(fe(Mt,jt),!0):!1}function de(ft,Mt){const jt=Mt.start+Mt.length;return ft.pos<jt&&ft.end>Mt.start}function fe(ft,Mt){for(;ft.parent&&!Bre(ft);)ft=ft.parent;Mt.push(ft)}function ve(ft,Mt,jt){const Qt=[];return Mt.statements.filter(yn=>pe(ft,yn,Qt)).length===Mt.statements.length?(fe(Mt,jt),!0):(jt.push(...Qt),!1)}function xe(ft,Mt,jt){var Qt,In,yn;const wt=Ln=>wee(Ln,ft);if((Qt=Mt.modifiers)!=null&&Qt.some(wt)||Mt.name&&wt(Mt.name)||(In=Mt.typeParameters)!=null&&In.some(wt)||(yn=Mt.heritageClauses)!=null&&yn.some(wt))return fe(Mt,jt),!0;const En=[];return Mt.members.filter(Ln=>pe(ft,Ln,En)).length===Mt.members.length?(fe(Mt,jt),!0):(jt.push(...En),!1)}function X(ft){return P(),LJ(N(ft),l,_)}function Ce(){return P(),[...l.getOptionsDiagnostics(_),...l.getGlobalDiagnostics(_)]}function Je(ft,Mt,jt=Sm,Qt){const In={...jt,includeCompletionsForModuleExports:jt.includeCompletionsForModuleExports||jt.includeExternalModuleExports,includeCompletionsWithInsertText:jt.includeCompletionsWithInsertText||jt.includeInsertTextCompletions};return P(),Ex.getCompletionsAtPosition(e,l,g,N(ft),Mt,In,jt.triggerCharacter,jt.triggerKind,_,Qt&&Nc.getFormatContext(Qt,e),jt.includeSymbol)}function Se(ft,Mt,jt,Qt,In,yn=Sm,wt){return P(),Ex.getCompletionEntryDetails(l,g,N(ft),Mt,{name:jt,source:In,data:wt},e,Qt&&Nc.getFormatContext(Qt,e),yn,_)}function re(ft,Mt,jt,Qt,In=Sm){return P(),Ex.getCompletionEntrySymbol(l,g,N(ft),Mt,{name:jt,source:Qt},e,In)}function be(ft,Mt,jt,Qt){P();const In=N(ft),yn=ip(In,Mt);if(yn===In)return;const wt=l.getTypeChecker(),En=lt(yn),xn=pQe(En,wt);if(!xn||wt.isUnknownSymbol(xn)){const zo=ce(In,En,Mt)?wt.getTypeAtLocation(En):void 0;return zo&&{kind:"",kindModifiers:"",textSpan:zu(En,In),displayParts:wt.runWithCancellationToken(_,Bl=>RO(Bl,zo,F1(En),void 0,Qt)),documentation:zo.symbol?zo.symbol.getDocumentationComment(wt):void 0,tags:zo.symbol?zo.symbol.getJsDocTags(wt):void 0}}const{symbolKind:Ln,displayParts:ln,documentation:Ii,tags:ra,canIncreaseVerbosityLevel:sa}=wt.runWithCancellationToken(_,zo=>vv.getSymbolDisplayPartsDocumentationAndSymbolKind(zo,xn,In,F1(En),En,void 0,void 0,jt??Ate,Qt));return{kind:Ln,kindModifiers:vv.getSymbolModifiers(wt,xn),textSpan:zu(En,In),displayParts:ln,documentation:Ii,tags:ra,canIncreaseVerbosityLevel:sa}}function Ne(ft,Mt){return P(),yX.preparePasteEdits(N(ft),Mt,l.getTypeChecker())}function Be(ft,Mt){return P(),vX.pasteEditsProvider(N(ft.targetFile),ft.pastedText,ft.pasteLocations,ft.copiedFrom?{file:N(ft.copiedFrom.file),range:ft.copiedFrom.range}:void 0,e,ft.preferences,Nc.getFormatContext(Mt,e),_)}function lt(ft){return GS(ft.parent)&&ft.pos===ft.parent.pos?ft.parent.expression:bD(ft.parent)&&ft.pos===ft.parent.pos||KR(ft.parent)&&ft.parent.name===ft||fh(ft.parent)?ft.parent:ft}function ce(ft,Mt,jt){switch(Mt.kind){case 80:return Mt.flags&16777216&&!Ir(Mt)&&(Mt.parent.kind===172&&Mt.parent.name===Mt||Dn(Mt,Qt=>Qt.kind===170))?!1:!Rq(Mt)&&!Dq(Mt)&&!Om(Mt.parent);case 212:case 167:return!mv(ft,jt);case 110:case 198:case 108:case 203:return!0;case 237:return KR(Mt);default:return!1}}function Re(ft,Mt,jt,Qt){return P(),fC.getDefinitionAtPosition(l,N(ft),Mt,jt,Qt)}function _e(ft,Mt){return P(),fC.getDefinitionAndBoundSpan(l,N(ft),Mt)}function je(ft,Mt){return P(),fC.getTypeDefinitionAtPosition(l.getTypeChecker(),N(ft),Mt)}function Ge(ft,Mt){return P(),Ys.getImplementationsAtPosition(l,_,l.getSourceFiles(),N(ft),Mt)}function We(ft,Mt,jt){const Qt=ya(ft);C.assert(jt.some(wt=>ya(wt)===Qt)),P();const In=Ui(jt,wt=>l.getSourceFile(wt)),yn=N(ft);return U7.getDocumentHighlights(l,_,yn,Mt,In)}function at(ft,Mt,jt,Qt,In){P();const yn=N(ft),wt=m7(ip(yn,Mt));if(Rz.nodeIsEligibleForRename(wt))if(He(wt)&&(ph(wt.parent)||VS(wt.parent))&&oD(wt.escapedText)){const{openingElement:En,closingElement:xn}=wt.parent.parent;return[En,xn].map(Ln=>{const ln=zu(Ln.tagName,yn);return{fileName:yn.fileName,textSpan:ln,...Ys.toContextSpan(ln,yn,Ln.parent)}})}else{const En=Gp(yn,In??Sm),xn=typeof In=="boolean"?In:In?.providePrefixAndSuffixTextForRename;return cn(wt,Mt,{findInStrings:jt,findInComments:Qt,providePrefixAndSuffixTextForRename:xn,use:Ys.FindReferencesUse.Rename},(Ln,ln,Ii)=>Ys.toRenameLocation(Ln,ln,Ii,xn||!1,En))}}function Wt(ft,Mt){return P(),cn(ip(N(ft),Mt),Mt,{use:Ys.FindReferencesUse.References},Ys.toReferenceEntry)}function cn(ft,Mt,jt,Qt){P();const In=jt&&jt.use===Ys.FindReferencesUse.Rename?l.getSourceFiles().filter(yn=>!l.isSourceFileDefaultLibrary(yn)):l.getSourceFiles();return Ys.findReferenceOrRenameEntries(l,_,In,ft,Mt,jt,Qt)}function gn(ft,Mt){return P(),Ys.findReferencedSymbols(l,_,l.getSourceFiles(),N(ft),Mt)}function Kn(ft){return P(),Ys.Core.getReferencesForFileName(ft,l,l.getSourceFiles()).map(Ys.toReferenceEntry)}function _t(ft,Mt,jt,Qt=!1,In=!1){P();const yn=jt?[N(jt)]:l.getSourceFiles();return jxe(yn,l.getTypeChecker(),_,ft,Mt,Qt,In)}function en(ft,Mt,jt){P();const Qt=N(ft),In=e.getCustomTransformers&&e.getCustomTransformers();return vse(l,Qt,!!Mt,_,In,jt)}function ir(ft,Mt,{triggerReason:jt}=Sm){P();const Qt=N(ft);return iW.getSignatureHelpItems(l,Qt,Mt,jt,_)}function Di(ft){return s.getCurrentSourceFile(ft)}function lo(ft,Mt,jt){const Qt=s.getCurrentSourceFile(ft),In=ip(Qt,Mt);if(In===Qt)return;switch(In.kind){case 212:case 167:case 11:case 97:case 112:case 106:case 108:case 110:case 198:case 80:break;default:return}let yn=In;for(;;)if($D(yn)||Ole(yn))yn=yn.parent;else if(Nq(yn))if(yn.parent.parent.kind===268&&yn.parent.parent.body===yn.parent)yn=yn.parent.parent.name;else break;else break;return ic(yn.getStart(),In.getEnd())}function zt(ft,Mt){const jt=s.getCurrentSourceFile(ft);return cK.spanInSourceFileAtLocation(jt,Mt)}function Zr(ft){return Jxe(s.getCurrentSourceFile(ft),_)}function Ai(ft){return Kxe(s.getCurrentSourceFile(ft),_)}function Ni(ft,Mt,jt){return P(),(jt||"original")==="2020"?yDe(l,_,N(ft),Mt):Ace(l.getTypeChecker(),_,N(ft),l.getClassifiableNames(),Mt)}function Pr(ft,Mt,jt){return P(),(jt||"original")==="original"?IJ(l.getTypeChecker(),_,N(ft),l.getClassifiableNames(),Mt):Qde(l,_,N(ft),Mt)}function Ci(ft,Mt){return Ice(_,s.getCurrentSourceFile(ft),Mt)}function $e(ft,Mt){return xJ(_,s.getCurrentSourceFile(ft),Mt)}function At(ft){const Mt=s.getCurrentSourceFile(ft);return rX.collectElements(Mt,_)}const mn=new Map(Object.entries({19:20,21:22,23:24,32:30}));mn.forEach((ft,Mt)=>mn.set(ft.toString(),Number(Mt)));function dr(ft,Mt){const jt=s.getCurrentSourceFile(ft),Qt=eC(jt,Mt),In=Qt.getStart(jt)===Mt?mn.get(Qt.kind.toString()):void 0,yn=In&&Es(Qt.parent,In,jt);return yn?[zu(Qt,jt),zu(yn,jt)].sort((wt,En)=>wt.start-En.start):ae}function ri(ft,Mt,jt){let Qt=Ls();const In=GO(jt),yn=s.getCurrentSourceFile(ft);g("getIndentationAtPosition: getCurrentSourceFile: "+(Ls()-Qt)),Qt=Ls();const wt=Nc.SmartIndenter.getIndentation(Mt,yn,In);return g("getIndentationAtPosition: computeIndentation : "+(Ls()-Qt)),wt}function ai(ft,Mt,jt,Qt){const In=s.getCurrentSourceFile(ft);return Nc.formatSelection(Mt,jt,In,Nc.getFormatContext(GO(Qt),e))}function qi(ft,Mt){return Nc.formatDocument(s.getCurrentSourceFile(ft),Nc.getFormatContext(GO(Mt),e))}function $o(ft,Mt,jt,Qt){const In=s.getCurrentSourceFile(ft),yn=Nc.getFormatContext(GO(Qt),e);if(!mv(In,Mt))switch(jt){case"{":return Nc.formatOnOpeningCurly(Mt,In,yn);case"}":return Nc.formatOnClosingCurly(Mt,In,yn);case";":return Nc.formatOnSemicolon(Mt,In,yn);case`
429`:return Nc.formatOnEnter(Mt,In,yn)}return[]}function Ia(ft,Mt,jt,Qt,In,yn=Sm){P();const wt=N(ft),En=ic(Mt,jt),xn=Nc.getFormatContext(In,e);return Ki(cS(Qt,nb,js),Ln=>(_.throwIfCancellationRequested(),cu.getFixes({errorCode:Ln,sourceFile:wt,span:En,program:l,host:e,cancellationToken:_,formatContext:xn,preferences:yn})))}function Mn(ft,Mt,jt,Qt=Sm){P(),C.assert(ft.type==="file");const In=N(ft.fileName),yn=Nc.getFormatContext(jt,e);return cu.getAllFixes({fixId:Mt,sourceFile:In,program:l,host:e,cancellationToken:_,formatContext:yn,preferences:Qt})}function Uo(ft,Mt,jt=Sm){P(),C.assert(ft.type==="file");const Qt=N(ft.fileName);if(fI(Qt))return ae;const In=Nc.getFormatContext(Mt,e),yn=ft.mode??(ft.skipDestructiveCodeActions?"SortAndCombine":"All");return v0.organizeImports(Qt,In,e,l,jt,yn)}function ot(ft,Mt,jt,Qt=Sm){return Dce(W(),ft,Mt,e,Nc.getFormatContext(jt,e),Qt,R)}function Ft(ft,Mt){const jt=typeof ft=="string"?Mt:ft;return Mo(jt)?Promise.all(jt.map(Qt=>le(Qt))):le(jt)}function le(ft){const Mt=jt=>ks(jt,h,A);return C.assertEqual(ft.type,"install package"),e.installPackage?e.installPackage({fileName:Mt(ft.file),packageName:ft.packageName}):Promise.reject("Host does not implement `installPackage`")}function ht(ft,Mt,jt,Qt){const In=Qt?Nc.getFormatContext(Qt,e).options:void 0;return y0.getDocCommentTemplateAtPosition(_y(e,In),s.getCurrentSourceFile(ft),Mt,jt)}function ne(ft,Mt,jt){if(jt===60)return!1;const Qt=s.getCurrentSourceFile(ft);if(px(Qt,Mt))return!1;if(jle(Qt,Mt))return jt===123;if(Oq(Qt,Mt))return!1;switch(jt){case 39:case 34:case 96:return!mv(Qt,Mt)}return!0}function Fe(ft,Mt){const jt=s.getCurrentSourceFile(ft),Qt=Bc(Mt,jt);if(!Qt)return;const In=Qt.kind===32&&ph(Qt.parent)?Qt.parent.parent:BI(Qt)&&r_(Qt.parent)?Qt.parent:void 0;if(In&&Ot(In))return{newText:`</${In.openingElement.tagName.getText(jt)}>`};const yn=Qt.kind===32&&jm(Qt.parent)?Qt.parent.parent:BI(Qt)&&e0(Qt.parent)?Qt.parent:void 0;if(yn&&nt(yn))return{newText:"</>"}}function it(ft,Mt){const jt=s.getCurrentSourceFile(ft),Qt=Bc(Mt,jt);if(!Qt||Qt.parent.kind===308)return;const In="[a-zA-Z0-9:\\-\\._$]*";if(e0(Qt.parent.parent)){const yn=Qt.parent.parent.openingFragment,wt=Qt.parent.parent.closingFragment;if(fI(yn)||fI(wt))return;const En=yn.getStart(jt)+1,xn=wt.getStart(jt)+2;return Mt!==En&&Mt!==xn?void 0:{ranges:[{start:En,length:0},{start:xn,length:0}],wordPattern:In}}else{const yn=Dn(Qt.parent,sa=>!!(ph(sa)||VS(sa)));if(!yn)return;C.assert(ph(yn)||VS(yn),"tag should be opening or closing element");const wt=yn.parent.openingElement,En=yn.parent.closingElement,xn=wt.tagName.getStart(jt),Ln=wt.tagName.end,ln=En.tagName.getStart(jt),Ii=En.tagName.end;return xn===wt.getStart(jt)||ln===En.getStart(jt)||Ln===wt.getEnd()||Ii===En.getEnd()||!(xn<=Mt&&Mt<=Ln||ln<=Mt&&Mt<=Ii)||wt.tagName.getText(jt)!==En.tagName.getText(jt)?void 0:{ranges:[{start:xn,length:Ln-xn},{start:ln,length:Ii-ln}],wordPattern:In}}}function dt(ft,Mt){return{lineStarts:ft.getLineStarts(),firstLine:ft.getLineAndCharacterOfPosition(Mt.pos).line,lastLine:ft.getLineAndCharacterOfPosition(Mt.end).line}}function Lt(ft,Mt,jt){const Qt=s.getCurrentSourceFile(ft),In=[],{lineStarts:yn,firstLine:wt,lastLine:En}=dt(Qt,Mt);let xn=jt||!1,Ln=Number.MAX_VALUE;const ln=new Map,Ii=new RegExp(/\S/),ra=_7(Qt,yn[wt]),sa=ra?"{/*":"//";for(let zo=wt;zo<=En;zo++){const Bl=Qt.text.substring(yn[zo],Qt.getLineEndOfPosition(yn[zo])),xl=Ii.exec(Bl);xl&&(Ln=Math.min(Ln,xl.index),ln.set(zo.toString(),xl.index),Bl.substr(xl.index,sa.length)!==sa&&(xn=jt===void 0||jt))}for(let zo=wt;zo<=En;zo++){if(wt!==En&&yn[zo]===Mt.end)continue;const Bl=ln.get(zo.toString());Bl!==void 0&&(ra?In.push(...Ue(ft,{pos:yn[zo]+Ln,end:Qt.getLineEndOfPosition(yn[zo])},xn,ra)):xn?In.push({newText:sa,span:{length:0,start:yn[zo]+Ln}}):Qt.text.substr(yn[zo]+Bl,sa.length)===sa&&In.push({newText:"",span:{length:sa.length,start:yn[zo]+Bl}}))}return In}function Ue(ft,Mt,jt,Qt){var In;const yn=s.getCurrentSourceFile(ft),wt=[],{text:En}=yn;let xn=!1,Ln=jt||!1;const ln=[];let{pos:Ii}=Mt;const ra=Qt!==void 0?Qt:_7(yn,Ii),sa=ra?"{/*":"/*",zo=ra?"*/}":"*/",Bl=ra?"\\{\\/\\*":"\\/\\*",xl=ra?"\\*\\/\\}":"\\*\\/";for(;Ii<=Mt.end;){const Ps=En.substr(Ii,sa.length)===sa?sa.length:0,co=mv(yn,Ii+Ps);if(co)ra&&(co.pos--,co.end++),ln.push(co.pos),co.kind===3&&ln.push(co.end),xn=!0,Ii=co.end+1;else{const Go=En.substring(Ii,Mt.end).search(`(${Bl})|(${xl})`);Ln=jt!==void 0?jt:Ln||!ece(En,Ii,Go===-1?Mt.end:Ii+Go),Ii=Go===-1?Mt.end+1:Ii+Go+zo.length}}if(Ln||!xn){((In=mv(yn,Mt.pos))==null?void 0:In.kind)!==2&&$v(ln,Mt.pos,js),$v(ln,Mt.end,js);const Ps=ln[0];En.substr(Ps,sa.length)!==sa&&wt.push({newText:sa,span:{length:0,start:Ps}});for(let co=1;co<ln.length-1;co++)En.substr(ln[co]-zo.length,zo.length)!==zo&&wt.push({newText:zo,span:{length:0,start:ln[co]}}),En.substr(ln[co],sa.length)!==sa&&wt.push({newText:sa,span:{length:0,start:ln[co]}});wt.length%2!==0&&wt.push({newText:zo,span:{length:0,start:ln[ln.length-1]}})}else for(const Ps of ln){const co=Ps-zo.length>0?Ps-zo.length:0,Go=En.substr(co,zo.length)===zo?zo.length:0;wt.push({newText:"",span:{length:sa.length,start:Ps-Go}})}return wt}function Rt(ft,Mt){const jt=s.getCurrentSourceFile(ft),{firstLine:Qt,lastLine:In}=dt(jt,Mt);return Qt===In&&Mt.pos!==Mt.end?Ue(ft,Mt,!0):Lt(ft,Mt,!0)}function It(ft,Mt){const jt=s.getCurrentSourceFile(ft),Qt=[],{pos:In}=Mt;let{end:yn}=Mt;In===yn&&(yn+=_7(jt,In)?2:1);for(let wt=In;wt<=yn;wt++){const En=mv(jt,wt);if(En){switch(En.kind){case 2:Qt.push(...Lt(ft,{end:En.end,pos:En.pos+1},!1));break;case 3:Qt.push(...Ue(ft,{end:En.end,pos:En.pos+1},!1))}wt=En.end+1}}return Qt}function Ot({openingElement:ft,closingElement:Mt,parent:jt}){return!a0(ft.tagName,Mt.tagName)||r_(jt)&&a0(ft.tagName,jt.openingElement.tagName)&&Ot(jt)}function nt({closingFragment:ft,parent:Mt}){return!!(ft.flags&262144)||e0(Mt)&&nt(Mt)}function Kt(ft,Mt,jt){const Qt=s.getCurrentSourceFile(ft),In=Nc.getRangeOfEnclosingComment(Qt,Mt);return In&&(!jt||In.kind===3)?_v(In):void 0}function Tr(ft,Mt){P();const jt=N(ft);_.throwIfCancellationRequested();const Qt=jt.text,In=[];if(Mt.length>0&&!xn(jt.fileName)){const Ln=wt();let ln;for(;ln=Ln.exec(Qt);){_.throwIfCancellationRequested();const Ii=3;C.assert(ln.length===Mt.length+Ii);const ra=ln[1],sa=ln.index+ra.length;if(!mv(jt,sa))continue;let zo;for(let xl=0;xl<Mt.length;xl++)ln[xl+Ii]&&(zo=Mt[xl]);if(zo===void 0)return C.fail();if(En(Qt.charCodeAt(sa+zo.text.length)))continue;const Bl=ln[2];In.push({descriptor:zo,message:Bl,position:sa})}}return In;function yn(Ln){return Ln.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function wt(){const Ln=/(?:\/{2,}\s*)/.source,ln=/(?:\/\*+\s*)/.source,ra="("+/(?:^(?:\s|\*)*)/.source+"|"+Ln+"|"+ln+")",sa="(?:"+Vt(Mt,co=>"("+yn(co.text)+")").join("|")+")",zo=/(?:$|\*\/)/.source,Bl=/(?:.*?)/.source,xl="("+sa+Bl+")",Ps=ra+xl+zo;return new RegExp(Ps,"gim")}function En(Ln){return Ln>=97&&Ln<=122||Ln>=65&&Ln<=90||Ln>=48&&Ln<=57}function xn(Ln){return Ln.includes("/node_modules/")}}function Oe(ft,Mt,jt){return P(),Rz.getRenameInfo(l,N(ft),Mt,jt||{})}function Nt(ft,Mt,jt,Qt,In,yn){const[wt,En]=typeof Mt=="number"?[Mt,void 0]:[Mt.pos,Mt.end];return{file:ft,startPosition:wt,endPosition:En,program:W(),host:e,formatContext:Nc.getFormatContext(Qt,e),cancellationToken:_,preferences:jt,triggerReason:In,kind:yn}}function he(ft,Mt,jt){return{file:ft,program:W(),host:e,span:Mt,preferences:jt,cancellationToken:_}}function B(ft,Mt){return aX.getSmartSelectionRange(Mt,s.getCurrentSourceFile(ft))}function Ae(ft,Mt,jt=Sm,Qt,In,yn){P();const wt=N(ft);return gx.getApplicableRefactors(Nt(wt,Mt,jt,Sm,Qt,In),yn)}function te(ft,Mt,jt=Sm){P();const Qt=N(ft),In=C.checkDefined(l.getSourceFiles()),yn=AM(ft),wt=zO(Nt(Qt,Mt,jt,Sm)),En=yde(wt?.all),xn=Ui(In,Ln=>{const ln=AM(Ln.fileName);return!l?.isSourceFileFromExternalLibrary(Qt)&&!(Qt===N(Ln.fileName)||yn===".ts"&&ln===".d.ts"||yn===".d.ts"&&po(Ic(Ln.fileName),"lib.")&&ln===".d.ts")&&(yn===ln||(yn===".tsx"&&ln===".ts"||yn===".jsx"&&ln===".js")&&!En)?Ln.fileName:void 0});return{newFileName:gde(Qt,l,e,wt),files:xn}}function xt(ft,Mt,jt,Qt,In,yn=Sm,wt){P();const En=N(ft);return gx.getEditsForRefactor(Nt(En,jt,yn,Mt),Qt,In,wt)}function Xt(ft,Mt){return Mt===0?{line:0,character:0}:R.toLineColumnOffset(ft,Mt)}function Pe(ft,Mt){P();const jt=yx.resolveCallHierarchyDeclaration(l,ip(N(ft),Mt));return jt&&_J(jt,Qt=>yx.createCallHierarchyItem(l,Qt))}function gt(ft,Mt){P();const jt=N(ft),Qt=gJ(yx.resolveCallHierarchyDeclaration(l,Mt===0?jt:ip(jt,Mt)));return Qt?yx.getIncomingCalls(l,Qt,_):[]}function Bt(ft,Mt){P();const jt=N(ft),Qt=gJ(yx.resolveCallHierarchyDeclaration(l,Mt===0?jt:ip(jt,Mt)));return Qt?yx.getOutgoingCalls(l,Qt):[]}function gr(ft,Mt,jt=Sm){P();const Qt=N(ft);return eX.provideInlayHints(he(Qt,Mt,jt))}function tr(ft,Mt,jt,Qt,In){return tX.mapCode(s.getCurrentSourceFile(ft),Mt,jt,e,Nc.getFormatContext(Qt,e),In)}const Jn={dispose:J,cleanupSemanticCache:j,getSyntacticDiagnostics:Z,getSemanticDiagnostics:q,getRegionSemanticDiagnostics:ye,getSuggestionDiagnostics:X,getCompilerOptionsDiagnostics:Ce,getSyntacticClassifications:Ci,getSemanticClassifications:Ni,getEncodedSyntacticClassifications:$e,getEncodedSemanticClassifications:Pr,getCompletionsAtPosition:Je,getCompletionEntryDetails:Se,getCompletionEntrySymbol:re,getSignatureHelpItems:ir,getQuickInfoAtPosition:be,getDefinitionAtPosition:Re,getDefinitionAndBoundSpan:_e,getImplementationAtPosition:Ge,getTypeDefinitionAtPosition:je,getReferencesAtPosition:Wt,findReferences:gn,getFileReferences:Kn,getDocumentHighlights:We,getNameOrDottedNameSpan:lo,getBreakpointStatementAtPosition:zt,getNavigateToItems:_t,getRenameInfo:Oe,getSmartSelectionRange:B,findRenameLocations:at,getNavigationBarItems:Zr,getNavigationTree:Ai,getOutliningSpans:At,getTodoComments:Tr,getBraceMatchingAtPosition:dr,getIndentationAtPosition:ri,getFormattingEditsForRange:ai,getFormattingEditsForDocument:qi,getFormattingEditsAfterKeystroke:$o,getDocCommentTemplateAtPosition:ht,isValidBraceCompletionAtPosition:ne,getJsxClosingTagAtPosition:Fe,getLinkedEditingRangeAtPosition:it,getSpanOfEnclosingComment:Kt,getCodeFixesAtPosition:Ia,getCombinedCodeFix:Mn,applyCodeActionCommand:Ft,organizeImports:Uo,getEditsForFileRename:ot,getEmitOutput:en,getNonBoundSourceFile:Di,getProgram:W,getCurrentProgram:()=>l,getAutoImportProvider:O,updateIsDefinitionOfReferencedSymbols:G,getApplicableRefactors:Ae,getEditsForRefactor:xt,getMoveToRefactoringFileSuggestions:te,toLineColumnOffset:Xt,getSourceMapper:()=>R,clearSourceMapperCache:()=>R.clearCache(),prepareCallHierarchy:Pe,provideCallHierarchyIncomingCalls:gt,provideCallHierarchyOutgoingCalls:Bt,toggleLineComment:Lt,toggleMultilineComment:Ue,commentSelection:Rt,uncommentSelection:It,provideInlayHints:gr,getSupportedCodeFixes:aK,preparePasteEditsForFile:Ne,getPasteEdits:Be,mapCode:tr};switch(o){case 0:break;case 1:MDe.forEach(ft=>Jn[ft]=()=>{throw new Error(`LanguageService Operation: ${ft} not allowed in LanguageServiceMode.PartialSemantic`)});break;case 2:lQe.forEach(ft=>Jn[ft]=()=>{throw new Error(`LanguageService Operation: ${ft} not allowed in LanguageServiceMode.Syntactic`)});break;default:C.assertNever(o)}return Jn}function lK(e){return e.nameTable||cQe(e),e.nameTable}function cQe(e){const t=e.nameTable=new Map;e.forEachChild(function r(i){if(He(i)&&!Dq(i)&&i.escapedText||uf(i)&&dQe(i)){const o=aM(i);t.set(o,t.get(o)===void 0?i.pos:-1)}else if(eo(i)){const o=i.escapedText;t.set(o,t.get(o)===void 0?i.pos:-1)}if(Jo(i,r),ef(i))for(const o of i.jsDoc)Jo(o,r)})}function dQe(e){return L_(e)||e.parent.kind===284||fQe(e)||xk(e)}function jO(e){const t=uQe(e);return t&&(Wa(t.parent)||jS(t.parent))?t:void 0}function uQe(e){switch(e.kind){case 11:case 15:case 9:if(e.parent.kind===168)return iG(e.parent.parent)?e.parent.parent:void 0;case 80:case 296:return iG(e.parent)&&(e.parent.parent.kind===211||e.parent.parent.kind===293)&&e.parent.name===e?e.parent:void 0}}function pQe(e,t){const r=jO(e);if(r){const i=t.getContextualType(r.parent),o=i&&sz(r,t,i,!1);if(o&&o.length===1)return $a(o)}return t.getSymbolAtLocation(e)}function sz(e,t,r,i){const o=AO(e.name);if(!o)return ae;if(!r.isUnion()){const u=r.getProperty(o);return u?[u]:ae}const s=Wa(e.parent)||jS(e.parent)?Un(r.types,u=>!t.isTypeInvalidDueToUnionDiscriminant(u,e.parent)):r.types,l=Ui(s,u=>u.getProperty(o));if(i&&(l.length===0||l.length===r.types.length)){const u=r.getProperty(o);if(u)return[u]}return!s.length&&!l.length?Ui(r.types,u=>u.getProperty(o)):cS(l,nb)}function fQe(e){return e&&e.parent&&e.parent.kind===213&&e.parent.argumentExpression===e}function rue(e){if(jc)return Qr(ci(ya(jc.getExecutingFilePath())),C2(e));throw new Error("getDefaultLibFilePath is only supported when consumed as a node module. ")}rre(iQe());function PDe(e,t,r){const i=[];r=WJ(r,i);const o=Mo(e)?e:[e],s=$w(void 0,void 0,L,r,o,t,!0);return s.diagnostics=so(s.diagnostics,i),s}var cK={};x(cK,{spanInSourceFileAtLocation:()=>mQe});function mQe(e,t){if(e.isDeclarationFile)return;let r=Fi(e,t);const i=e.getLineAndCharacterOfPosition(t).line;if(e.getLineAndCharacterOfPosition(r.getStart(e)).line>i){const g=Bc(r.pos,e);if(!g||e.getLineAndCharacterOfPosition(g.getEnd()).line!==i)return;r=g}if(r.flags&33554432)return;return h(r);function o(g,E){const A=qS(g)?ga(g.modifiers,Wc):void 0,R=A?La(e.text,A.end):g.getStart(e);return ic(R,(E||g).getEnd())}function s(g,E){return o(g,eE(E,E.parent,e))}function l(g,E){return g&&i===e.getLineAndCharacterOfPosition(g.getStart(e)).line?h(g):h(E)}function u(g,E,A){if(g){const R=g.indexOf(E);if(R>=0){let N=R,P=R+1;for(;N>0&&A(g[N-1]);)N--;for(;P<g.length&&A(g[P]);)P++;return ic(La(e.text,g[N].pos),g[P-1].end)}}return o(E)}function d(g){return h(Bc(g.pos,e))}function _(g){return h(eE(g,g.parent,e))}function h(g){if(g){const{parent:X}=g;switch(g.kind){case 244:return A(g.declarationList.declarations[0]);case 261:case 173:case 172:return A(g);case 170:return N(g);case 263:case 175:case 174:case 178:case 179:case 177:case 219:case 220:return k(g);case 242:if(SS(g))return W(g);case 269:return O(g);case 300:return O(g.block);case 245:return o(g.expression);case 254:return o(g.getChildAt(0),g.expression);case 248:return s(g,g.expression);case 247:return h(g.statement);case 260:return o(g.getChildAt(0));case 246:return s(g,g.expression);case 257:return h(g.statement);case 253:case 252:return o(g.getChildAt(0),g.label);case 249:return j(g);case 250:return s(g,g.expression);case 251:return G(g);case 256:return s(g,g.expression);case 297:case 298:return h(g.statements[0]);case 259:return O(g.tryBlock);case 258:return o(g,g.expression);case 278:return o(g,g.expression);case 272:return o(g,g.moduleReference);case 273:return o(g,g.moduleSpecifier);case 279:return o(g,g.moduleSpecifier);case 268:if(my(g)!==1)return;case 264:case 267:case 307:case 209:return o(g);case 255:return h(g.statement);case 171:return u(X.modifiers,g,Wc);case 207:case 208:return J(g);case 265:case 266:return;case 27:case 1:return l(Bc(g.pos,e));case 28:return d(g);case 19:return q(g);case 20:return ye(g);case 24:return ie(g);case 21:return K(g);case 22:return pe(g);case 59:return de(g);case 32:case 30:return fe(g);case 117:return ve(g);case 93:case 85:case 98:return _(g);case 165:return xe(g);default:if(hv(g))return Z(g);if((g.kind===80||g.kind===231||g.kind===304||g.kind===305)&&hv(X))return o(g);if(g.kind===227){const{left:Ce,operatorToken:Je}=g;if(hv(Ce))return Z(Ce);if(Je.kind===64&&hv(g.parent))return o(g);if(Je.kind===28)return h(Ce)}if(P_(g))switch(X.kind){case 247:return d(g);case 171:return h(g.parent);case 249:case 251:return o(g);case 227:if(g.parent.operatorToken.kind===28)return o(g);break;case 220:if(g.parent.body===g)return o(g);break}switch(g.parent.kind){case 304:if(g.parent.name===g&&!hv(g.parent.parent))return h(g.parent.initializer);break;case 217:if(g.parent.type===g)return _(g.parent.type);break;case 261:case 170:{const{initializer:Ce,type:Je}=g.parent;if(Ce===g||Je===g||sy(g.kind))return d(g);break}case 227:{const{left:Ce}=g.parent;if(hv(Ce)&&g!==Ce)return d(g);break}default:if(Yo(g.parent)&&g.parent.type===g)return d(g)}return h(g.parent)}}function E(X){return _d(X.parent)&&X.parent.declarations[0]===X?o(Bc(X.pos,e,X.parent),X):o(X)}function A(X){if(X.parent.parent.kind===250)return h(X.parent.parent);const Ce=X.parent;if(Qo(X.name))return J(X.name);if(ZE(X)&&X.initializer||di(X,32)||Ce.parent.kind===251)return E(X);if(_d(X.parent)&&X.parent.declarations[0]!==X)return h(Bc(X.pos,e,X.parent))}function R(X){return!!X.initializer||X.dotDotDotToken!==void 0||di(X,3)}function N(X){if(Qo(X.name))return J(X.name);if(R(X))return o(X);{const Ce=X.parent,Je=Ce.parameters.indexOf(X);return C.assert(Je!==-1),Je!==0?N(Ce.parameters[Je-1]):h(Ce.body)}}function P(X){return di(X,32)||X.parent.kind===264&&X.kind!==177}function k(X){if(X.body)return P(X)?o(X):h(X.body)}function W(X){const Ce=X.statements.length?X.statements[0]:X.getLastToken();return P(X.parent)?l(X.parent,Ce):h(Ce)}function O(X){switch(X.parent.kind){case 268:if(my(X.parent)!==1)return;case 248:case 246:case 250:return l(X.parent,X.statements[0]);case 249:case 251:return l(Bc(X.pos,e,X.parent),X.statements[0])}return h(X.statements[0])}function G(X){if(X.initializer.kind===262){const Ce=X.initializer;if(Ce.declarations.length>0)return h(Ce.declarations[0])}else return h(X.initializer)}function j(X){if(X.initializer)return G(X);if(X.condition)return o(X.condition);if(X.incrementor)return o(X.incrementor)}function J(X){const Ce=Ye(X.elements,Je=>Je.kind!==233?Je:void 0);return Ce?h(Ce):X.parent.kind===209?o(X.parent):E(X.parent)}function Z(X){C.assert(X.kind!==208&&X.kind!==207);const Ce=X.kind===210?X.elements:X.properties,Je=Ye(Ce,Se=>Se.kind!==233?Se:void 0);return Je?h(Je):o(X.parent.kind===227?X.parent:X)}function q(X){switch(X.parent.kind){case 267:const Ce=X.parent;return l(Bc(X.pos,e,X.parent),Ce.members.length?Ce.members[0]:Ce.getLastToken(e));case 264:const Je=X.parent;return l(Bc(X.pos,e,X.parent),Je.members.length?Je.members[0]:Je.getLastToken(e));case 270:return l(X.parent.parent,X.parent.clauses[0])}return h(X.parent)}function ye(X){switch(X.parent.kind){case 269:if(my(X.parent.parent)!==1)return;case 267:case 264:return o(X);case 242:if(SS(X.parent))return o(X);case 300:return h(Zs(X.parent.statements));case 270:const Ce=X.parent,Je=Zs(Ce.clauses);return Je?h(Zs(Je.statements)):void 0;case 207:const Se=X.parent;return h(Zs(Se.elements)||Se);default:if(hv(X.parent)){const re=X.parent;return o(Zs(re.properties)||re)}return h(X.parent)}}function ie(X){switch(X.parent.kind){case 208:const Ce=X.parent;return o(Zs(Ce.elements)||Ce);default:if(hv(X.parent)){const Je=X.parent;return o(Zs(Je.elements)||Je)}return h(X.parent)}}function K(X){return X.parent.kind===247||X.parent.kind===214||X.parent.kind===215?d(X):X.parent.kind===218?_(X):h(X.parent)}function pe(X){switch(X.parent.kind){case 219:case 263:case 220:case 175:case 174:case 178:case 179:case 177:case 248:case 247:case 249:case 251:case 214:case 215:case 218:return d(X);default:return h(X.parent)}}function de(X){return Yo(X.parent)||X.parent.kind===304||X.parent.kind===170?d(X):h(X.parent)}function fe(X){return X.parent.kind===217?_(X):h(X.parent)}function ve(X){return X.parent.kind===247?s(X,X.parent.expression):h(X.parent)}function xe(X){return X.parent.kind===251?_(X):h(X.parent)}}}var yx={};x(yx,{createCallHierarchyItem:()=>iue,getIncomingCalls:()=>SQe,getOutgoingCalls:()=>PQe,resolveCallHierarchyDeclaration:()=>BDe});function hQe(e){return(Us(e)||dc(e))&&nd(e)}function LDe(e){return Po(e)||yi(e)}function UO(e){return(Us(e)||Xs(e)||dc(e))&&LDe(e.parent)&&e===e.parent.initializer&&He(e.parent.name)&&(!!(ty(e.parent)&2)||Po(e.parent))}function kDe(e){return Yi(e)||uc(e)||Zl(e)||Us(e)||Dc(e)||dc(e)||Ql(e)||Nl(e)||Gm(e)||Hf(e)||gp(e)}function dC(e){return Yi(e)||uc(e)&&He(e.name)||Zl(e)||Dc(e)||Ql(e)||Nl(e)||Gm(e)||Hf(e)||gp(e)||hQe(e)||UO(e)}function wDe(e){return Yi(e)?e:nd(e)?e.name:UO(e)?e.parent.name:C.checkDefined(e.modifiers&&hn(e.modifiers,ODe))}function ODe(e){return e.kind===90}function WDe(e,t){const r=wDe(t);return r&&e.getSymbolAtLocation(r)}function _Qe(e,t){if(Yi(t))return{text:t.fileName,pos:0,end:0};if((Zl(t)||Dc(t))&&!nd(t)){const o=t.modifiers&&hn(t.modifiers,ODe);if(o)return{text:"default",pos:o.getStart(),end:o.getEnd()}}if(Ql(t)){const o=t.getSourceFile(),s=La(o.text,Yh(t).pos),l=s+6,u=e.getTypeChecker(),d=u.getSymbolAtLocation(t.parent);return{text:`${d?`${u.symbolToString(d,t.parent)} `:""}static {}`,pos:s,end:l}}const r=UO(t)?t.parent.name:C.checkDefined(Oo(t),"Expected call hierarchy item to have a name");let i=He(r)?Kr(r):uf(r)?r.text:va(r)&&uf(r.expression)?r.expression.text:void 0;if(i===void 0){const o=e.getTypeChecker(),s=o.getSymbolAtLocation(r);s&&(i=o.symbolToString(s,t))}if(i===void 0){const o=dH();i=jR(s=>o.writeNode(4,t,t.getSourceFile(),s))}return{text:i,pos:r.getStart(),end:r.getEnd()}}function gQe(e){var t,r,i,o;if(UO(e))return Po(e.parent)&&ui(e.parent.parent)?dc(e.parent.parent)?(t=dF(e.parent.parent))==null?void 0:t.getText():(r=e.parent.parent.name)==null?void 0:r.getText():t_(e.parent.parent.parent.parent)&&He(e.parent.parent.parent.parent.parent.name)?e.parent.parent.parent.parent.parent.name.getText():void 0;switch(e.kind){case 178:case 179:case 175:return e.parent.kind===211?(i=dF(e.parent))==null?void 0:i.getText():(o=Oo(e.parent))==null?void 0:o.getText();case 263:case 264:case 268:if(t_(e.parent)&&He(e.parent.parent.name))return e.parent.parent.name.getText()}}function FDe(e,t){if(t.body)return t;if(Ml(t))return yg(t.parent);if(Zl(t)||Nl(t)){const r=WDe(e,t);return r&&r.valueDeclaration&&Ms(r.valueDeclaration)&&r.valueDeclaration.body?r.valueDeclaration:void 0}return t}function zDe(e,t){const r=WDe(e,t);let i;if(r&&r.declarations){const o=z8(r.declarations),s=Vt(r.declarations,d=>({file:d.getSourceFile().fileName,pos:d.pos}));o.sort((d,_)=>Wd(s[d].file,s[_].file)||s[d].pos-s[_].pos);const l=Vt(o,d=>r.declarations[d]);let u;for(const d of l)dC(d)&&((!u||u.parent!==d.parent||u.end!==d.pos)&&(i=Bn(i,d)),u=d)}return i}function dK(e,t){return Ql(t)?t:Ms(t)?FDe(e,t)??zDe(e,t)??t:zDe(e,t)??t}function BDe(e,t){const r=e.getTypeChecker();let i=!1;for(;;){if(dC(t))return dK(r,t);if(kDe(t)){const o=Dn(t,dC);return o&&dK(r,o)}if(L_(t)){if(dC(t.parent))return dK(r,t.parent);if(kDe(t.parent)){const o=Dn(t.parent,dC);return o&&dK(r,o)}return LDe(t.parent)&&t.parent.initializer&&UO(t.parent.initializer)?t.parent.initializer:void 0}if(Ml(t))return dC(t.parent)?t.parent:void 0;if(t.kind===126&&Ql(t.parent)){t=t.parent;continue}if(yi(t)&&t.initializer&&UO(t.initializer))return t.initializer;if(!i){let o=r.getSymbolAtLocation(t);if(o&&(o.flags&2097152&&(o=r.getAliasedSymbol(o)),o.valueDeclaration)){i=!0,t=o.valueDeclaration;continue}}return}}function iue(e,t){const r=t.getSourceFile(),i=_Qe(e,t),o=gQe(t),s=ZS(t),l=DP(t),u=ic(La(r.text,t.getFullStart(),!1,!0),t.getEnd()),d=ic(i.pos,i.end);return{file:r.fileName,kind:s,kindModifiers:l,name:i.text,containerName:o,span:u,selectionSpan:d}}function yQe(e){return e!==void 0}function vQe(e){if(e.kind===Ys.EntryKind.Node){const{node:t}=e;if(Aq(t,!0,!0)||Lle(t,!0,!0)||kle(t,!0,!0)||wle(t,!0,!0)||$D(t)||Cq(t)){const r=t.getSourceFile();return{declaration:Dn(t,dC)||r,range:Uq(t,r)}}}}function GDe(e){return ls(e.declaration)}function bQe(e,t){return{from:e,fromSpans:t}}function TQe(e,t){return bQe(iue(e,t[0].declaration),Vt(t,r=>_v(r.range)))}function SQe(e,t,r){if(Yi(t)||uc(t)||Ql(t))return[];const i=wDe(t),o=Un(Ys.findReferenceOrRenameEntries(e,r,e.getSourceFiles(),i,0,{use:Ys.FindReferencesUse.References},vQe),yQe);return o?IR(o,GDe,s=>TQe(e,s)):[]}function EQe(e,t){function r(o){const s=XT(o)?o.tag:ru(o)?o.tagName:Ks(o)||Ql(o)?o:o.expression,l=BDe(e,s);if(l){const u=Uq(s,o.getSourceFile());if(Mo(l))for(const d of l)t.push({declaration:d,range:u});else t.push({declaration:l,range:u})}}function i(o){if(o&&!(o.flags&33554432)){if(dC(o)){if(ui(o))for(const s of o.members)s.name&&va(s.name)&&i(s.name.expression);return}switch(o.kind){case 80:case 272:case 273:case 279:case 265:case 266:return;case 176:r(o);return;case 217:case 235:i(o.expression);return;case 261:case 170:i(o.name),i(o.initializer);return;case 214:r(o),i(o.expression),Ye(o.arguments,i);return;case 215:r(o),i(o.expression),Ye(o.arguments,i);return;case 216:r(o),i(o.tag),i(o.template);return;case 287:case 286:r(o),i(o.tagName),i(o.attributes);return;case 171:r(o),i(o.expression);return;case 212:case 213:r(o),Jo(o,i);break;case 239:i(o.expression);return}Hh(o)||Jo(o,i)}}return i}function AQe(e,t){Ye(e.statements,t)}function IQe(e,t){!di(e,128)&&e.body&&t_(e.body)&&Ye(e.body.statements,t)}function xQe(e,t,r){const i=FDe(e,t);i&&(Ye(i.parameters,r),r(i.body))}function RQe(e,t){t(e.body)}function DQe(e,t){Ye(e.modifiers,t);const r=RS(e);r&&t(r.expression);for(const i of e.members)Tm(i)&&Ye(i.modifiers,t),Po(i)?t(i.initializer):Ml(i)&&i.body?(Ye(i.parameters,t),t(i.body)):Ql(i)&&t(i)}function CQe(e,t){const r=[],i=EQe(e,r);switch(t.kind){case 308:AQe(t,i);break;case 268:IQe(t,i);break;case 263:case 219:case 220:case 175:case 178:case 179:xQe(e.getTypeChecker(),t,i);break;case 264:case 232:DQe(t,i);break;case 176:RQe(t,i);break;default:C.assertNever(t)}return r}function NQe(e,t){return{to:e,fromSpans:t}}function MQe(e,t){return NQe(iue(e,t[0].declaration),Vt(t,r=>_v(r.range)))}function PQe(e,t){return t.flags&33554432||Gm(t)?[]:IR(CQe(e,t),GDe,r=>MQe(e,r))}var oue={};x(oue,{v2020:()=>VDe});var VDe={};x(VDe,{TokenEncodingConsts:()=>hDe,TokenModifier:()=>gDe,TokenType:()=>_De,getEncodedSemanticClassifications:()=>Qde,getSemanticClassifications:()=>yDe});var cu={};x(cu,{PreserveOptionalFlags:()=>nLe,addNewNodeForMemberSymbol:()=>rLe,codeFixAll:()=>Ss,createCodeFixAction:()=>oa,createCodeFixActionMaybeFixAll:()=>lue,createCodeFixActionWithoutFixAll:()=>yh,createCombinedCodeActions:()=>vx,createFileTextChanges:()=>jDe,createImportAdder:()=>aE,createImportSpecifierResolver:()=>GZe,createMissingMemberNodes:()=>Cpe,createSignatureDeclarationFromCallExpression:()=>Npe,createSignatureDeclarationFromSignature:()=>OK,createStubbedBody:()=>mz,eachDiagnostic:()=>bx,findAncestorMatchingSpan:()=>Wpe,generateAccessorFromProperty:()=>uLe,getAccessorConvertiblePropertyAtPosition:()=>mLe,getAllFixes:()=>OQe,getFixes:()=>wQe,getImportCompletionAction:()=>VZe,getImportKind:()=>TK,getJSDocTypedefNodes:()=>zZe,getNoopSymbolTrackerWithResolver:()=>pC,getPromoteTypeOnlyCompletionAction:()=>jZe,getSupportedErrorCodes:()=>LQe,importFixName:()=>uNe,importSymbols:()=>G1,parameterShouldGetTypeFromJSDoc:()=>bCe,registerCodeFix:()=>Sa,setJsonCompilerOptionValue:()=>wpe,setJsonCompilerOptionValues:()=>kpe,tryGetAutoImportableReferenceFromTypeNode:()=>sE,typeNodeToAutoImportableTypeNode:()=>Mpe,typePredicateToAutoImportableTypeNode:()=>aLe,typeToAutoImportableTypeNode:()=>WK,typeToMinimizedReferenceType:()=>oLe});var aue=cm(),sue=new Map;function yh(e,t,r){return cue(e,tE(r),t,void 0,void 0)}function oa(e,t,r,i,o,s){return cue(e,tE(r),t,i,tE(o),s)}function lue(e,t,r,i,o,s){return cue(e,tE(r),t,i,o&&tE(o),s)}function cue(e,t,r,i,o,s){return{fixName:e,description:t,changes:r,fixId:i,fixAllDescription:o,commands:s?[s]:void 0}}function Sa(e){for(const t of e.errorCodes)due=void 0,aue.add(String(t),e);if(e.fixIds)for(const t of e.fixIds)C.assert(!sue.has(t)),sue.set(t,e)}var due;function LQe(){return due??(due=Co(aue.keys()))}function kQe(e,t){const{errorCodes:r}=e;let i=0;for(const s of t)if(jn(r,s.code)&&i++,i>1)break;const o=i<2;return({fixId:s,fixAllDescription:l,...u})=>o?u:{...u,fixId:s,fixAllDescription:l}}function wQe(e){const t=UDe(e),r=aue.get(String(e.errorCode));return Ki(r,i=>Vt(i.getCodeActions(e),kQe(i,t)))}function OQe(e){return sue.get(ma(e.fixId,Bo)).getAllCodeActions(e)}function vx(e,t){return{changes:e,commands:t}}function jDe(e,t){return{fileName:e,textChanges:t}}function Ss(e,t,r){const i=[],o=Rr.ChangeTracker.with(e,s=>bx(e,t,l=>r(s,l,i)));return vx(o,i.length===0?void 0:i)}function bx(e,t,r){for(const i of UDe(e))jn(t,i.code)&&r(i)}function UDe({program:e,sourceFile:t,cancellationToken:r}){const i=[...e.getSemanticDiagnostics(t,r),...e.getSyntacticDiagnostics(t,r),...LJ(t,e,r)];return _p(e.getCompilerOptions())&&i.push(...e.getDeclarationDiagnostics(t,r)),i}var uue="addConvertToUnknownForNonOverlappingTypes",HDe=[f.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first.code];Sa({errorCodes:HDe,getCodeActions:function(t){const r=JDe(t.sourceFile,t.span.start);if(r===void 0)return;const i=Rr.ChangeTracker.with(t,o=>qDe(o,t.sourceFile,r));return[oa(uue,i,f.Add_unknown_conversion_for_non_overlapping_types,uue,f.Add_unknown_to_all_conversions_of_non_overlapping_types)]},fixIds:[uue],getAllCodeActions:e=>Ss(e,HDe,(t,r)=>{const i=JDe(r.file,r.start);i&&qDe(t,r.file,i)})});function qDe(e,t,r){const i=SD(r)?L.createAsExpression(r.expression,L.createKeywordTypeNode(159)):L.createTypeAssertion(L.createKeywordTypeNode(159),r.expression);e.replaceNode(t,r.expression,i)}function JDe(e,t){if(!Ir(e))return Dn(Fi(e,t),r=>SD(r)||v4(r))}Sa({errorCodes:[f.await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,f.await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code,f.for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module.code],getCodeActions:function(t){const{sourceFile:r}=t,i=Rr.ChangeTracker.with(t,o=>{const s=L.createExportDeclaration(void 0,!1,L.createNamedExports([]),void 0);o.insertNodeAtEndOfScope(r,r,s)});return[yh("addEmptyExportDeclaration",i,f.Add_export_to_make_this_file_into_a_module)]}});var pue="addMissingAsync",KDe=[f.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,f.Type_0_is_not_assignable_to_type_1.code,f.Type_0_is_not_comparable_to_type_1.code];Sa({fixIds:[pue],errorCodes:KDe,getCodeActions:function(t){const{sourceFile:r,errorCode:i,cancellationToken:o,program:s,span:l}=t,u=hn(s.getTypeChecker().getDiagnostics(r,o),FQe(l,i)),d=u&&u.relatedInformation&&hn(u.relatedInformation,g=>g.code===f.Did_you_mean_to_mark_this_function_as_async.code),_=YDe(r,d);return _?[XDe(t,_,g=>Rr.ChangeTracker.with(t,g))]:void 0},getAllCodeActions:e=>{const{sourceFile:t}=e,r=new Set;return Ss(e,KDe,(i,o)=>{const s=o.relatedInformation&&hn(o.relatedInformation,d=>d.code===f.Did_you_mean_to_mark_this_function_as_async.code),l=YDe(t,s);return l?XDe(e,l,d=>(d(i),[]),r):void 0})}});function XDe(e,t,r,i){const o=r(s=>WQe(s,e.sourceFile,t,i));return oa(pue,o,f.Add_async_modifier_to_containing_function,pue,f.Add_all_missing_async_modifiers)}function WQe(e,t,r,i){if(i&&i.has(ls(r)))return;i?.add(ls(r));const o=L.replaceModifiers(_s(r,!0),L.createNodeArray(L.createModifiersFromModifierFlags(nv(r)|1024)));e.replaceNode(t,r,o)}function YDe(e,t){if(!t)return;const r=Fi(e,t.start);return Dn(r,o=>o.getStart(e)<t.start||o.getEnd()>Dl(t)?"quit":(Xs(o)||Nl(o)||Us(o)||Zl(o))&&rC(t,zu(o,e)))}function FQe(e,t){return({start:r,length:i,relatedInformation:o,code:s})=>eb(r)&&eb(i)&&rC({start:r,length:i},e)&&s===t&&!!o&&yt(o,l=>l.code===f.Did_you_mean_to_mark_this_function_as_async.code)}var fue="addMissingAwait",$De=f.Property_0_does_not_exist_on_type_1.code,QDe=[f.This_expression_is_not_callable.code,f.This_expression_is_not_constructable.code],mue=[f.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,f.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,f.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,f.Operator_0_cannot_be_applied_to_type_1.code,f.Operator_0_cannot_be_applied_to_types_1_and_2.code,f.This_comparison_appears_to_be_unintentional_because_the_types_0_and_1_have_no_overlap.code,f.This_condition_will_always_return_true_since_this_0_is_always_defined.code,f.Type_0_is_not_an_array_type.code,f.Type_0_is_not_an_array_type_or_a_string_type.code,f.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher.code,f.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,f.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,f.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,f.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,f.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,$De,...QDe];Sa({fixIds:[fue],errorCodes:mue,getCodeActions:function(t){const{sourceFile:r,errorCode:i,span:o,cancellationToken:s,program:l}=t,u=ZDe(r,i,o,s,l);if(!u)return;const d=t.program.getTypeChecker(),_=h=>Rr.ChangeTracker.with(t,h);return m2([eCe(t,u,i,d,_),tCe(t,u,i,d,_)])},getAllCodeActions:e=>{const{sourceFile:t,program:r,cancellationToken:i}=e,o=e.program.getTypeChecker(),s=new Set;return Ss(e,mue,(l,u)=>{const d=ZDe(t,u.code,u,i,r);if(!d)return;const _=h=>(h(l),[]);return eCe(e,d,u.code,o,_,s)||tCe(e,d,u.code,o,_,s)})}});function ZDe(e,t,r,i,o){const s=hJ(e,r);return s&&zQe(e,t,r,i,o)&&nCe(s)?s:void 0}function eCe(e,t,r,i,o,s){const{sourceFile:l,program:u,cancellationToken:d}=e,_=BQe(t,l,d,u,i);if(_){const h=o(g=>{Ye(_.initializers,({expression:E})=>hue(g,r,l,i,E,s)),s&&_.needsSecondPassForFixAll&&hue(g,r,l,i,t,s)});return yh("addMissingAwaitToInitializer",h,_.initializers.length===1?[f.Add_await_to_initializer_for_0,_.initializers[0].declarationSymbol.name]:f.Add_await_to_initializers)}}function tCe(e,t,r,i,o,s){const l=o(u=>hue(u,r,e.sourceFile,i,t,s));return oa(fue,l,f.Add_await,fue,f.Fix_all_expressions_possibly_missing_await)}function zQe(e,t,r,i,o){const l=o.getTypeChecker().getDiagnostics(e,i);return yt(l,({start:u,length:d,relatedInformation:_,code:h})=>eb(u)&&eb(d)&&rC({start:u,length:d},r)&&h===t&&!!_&&yt(_,g=>g.code===f.Did_you_forget_to_use_await.code))}function BQe(e,t,r,i,o){const s=GQe(e,o);if(!s)return;let l=s.isCompleteFix,u;for(const d of s.identifiers){const _=o.getSymbolAtLocation(d);if(!_)continue;const h=ni(_.valueDeclaration,yi),g=h&&ni(h.name,He),E=VT(h,244);if(!h||!E||h.type||!h.initializer||E.getSourceFile()!==t||di(E,32)||!g||!nCe(h.initializer)){l=!1;continue}const A=i.getSemanticDiagnostics(t,r);if(Ys.Core.eachSymbolReferenceInFile(g,o,t,N=>d!==N&&!VQe(N,A,t,o))){l=!1;continue}(u||(u=[])).push({expression:h.initializer,declarationSymbol:_})}return u&&{initializers:u,needsSecondPassForFixAll:!l}}function GQe(e,t){if(qr(e.parent)&&He(e.parent.expression))return{identifiers:[e.parent.expression],isCompleteFix:!0};if(He(e))return{identifiers:[e],isCompleteFix:!0};if(Nr(e)){let r,i=!0;for(const o of[e.left,e.right]){const s=t.getTypeAtLocation(o);if(t.getPromisedTypeOfPromise(s)){if(!He(o)){i=!1;continue}(r||(r=[])).push(o)}}return r&&{identifiers:r,isCompleteFix:i}}}function VQe(e,t,r,i){const o=qr(e.parent)?e.parent.name:Nr(e.parent)?e.parent:e,s=hn(t,l=>l.start===o.getStart(r)&&l.start+l.length===o.getEnd());return s&&jn(mue,s.code)||i.getTypeAtLocation(o).flags&1}function nCe(e){return e.flags&65536||!!Dn(e,t=>t.parent&&Xs(t.parent)&&t.parent.body===t||ea(t)&&(t.parent.kind===263||t.parent.kind===219||t.parent.kind===220||t.parent.kind===175))}function hue(e,t,r,i,o,s){if(gw(o.parent)&&!o.parent.awaitModifier){const l=i.getTypeAtLocation(o),u=i.getAnyAsyncIterableType();if(u&&i.isTypeAssignableTo(l,u)){const d=o.parent;e.replaceNode(r,d,L.updateForOfStatement(d,L.createToken(135),d.initializer,d.expression,d.statement));return}}if(Nr(o))for(const l of[o.left,o.right]){if(s&&He(l)){const _=i.getSymbolAtLocation(l);if(_&&s.has(Ta(_)))continue}const u=i.getTypeAtLocation(l),d=i.getPromisedTypeOfPromise(u)?L.createAwaitExpression(l):l;e.replaceNode(r,l,d)}else if(t===$De&&qr(o.parent)){if(s&&He(o.parent.expression)){const l=i.getSymbolAtLocation(o.parent.expression);if(l&&s.has(Ta(l)))return}e.replaceNode(r,o.parent.expression,L.createParenthesizedExpression(L.createAwaitExpression(o.parent.expression))),rCe(e,o.parent.expression,r)}else if(jn(QDe,t)&&Gh(o.parent)){if(s&&He(o)){const l=i.getSymbolAtLocation(o);if(l&&s.has(Ta(l)))return}e.replaceNode(r,o,L.createParenthesizedExpression(L.createAwaitExpression(o))),rCe(e,o,r)}else{if(s&&yi(o.parent)&&He(o.parent.name)){const l=i.getSymbolAtLocation(o.parent.name);if(l&&!rh(s,Ta(l)))return}e.replaceNode(r,o,L.createAwaitExpression(o))}}function rCe(e,t,r){const i=Bc(t.pos,r);i&&M7(i.end,i.parent,r)&&e.insertText(r,t.getStart(r),";")}var _ue="addMissingConst",iCe=[f.Cannot_find_name_0.code,f.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code];Sa({errorCodes:iCe,getCodeActions:function(t){const r=Rr.ChangeTracker.with(t,i=>oCe(i,t.sourceFile,t.span.start,t.program));if(r.length>0)return[oa(_ue,r,f.Add_const_to_unresolved_variable,_ue,f.Add_const_to_all_unresolved_variables)]},fixIds:[_ue],getAllCodeActions:e=>{const t=new Set;return Ss(e,iCe,(r,i)=>oCe(r,i.file,i.start,e.program,t))}});function oCe(e,t,r,i,o){const s=Fi(t,r),l=Dn(s,_=>QE(_.parent)?_.parent.initializer===_:jQe(_)?!1:"quit");if(l)return uK(e,l,t,o);const u=s.parent;if(Nr(u)&&u.operatorToken.kind===64&&od(u.parent))return uK(e,s,t,o);if(Cd(u)){const _=i.getTypeChecker();return Vn(u.elements,h=>UQe(h,_))?uK(e,u,t,o):void 0}const d=Dn(s,_=>od(_.parent)?!0:HQe(_)?!1:"quit");if(d){const _=i.getTypeChecker();return aCe(d,_)?uK(e,d,t,o):void 0}}function uK(e,t,r,i){(!i||rh(i,t))&&e.insertModifierBefore(r,87,t)}function jQe(e){switch(e.kind){case 80:case 210:case 211:case 304:case 305:return!0;default:return!1}}function UQe(e,t){const r=He(e)?e:id(e,!0)&&He(e.left)?e.left:void 0;return!!r&&!t.getSymbolAtLocation(r)}function HQe(e){switch(e.kind){case 80:case 227:case 28:return!0;default:return!1}}function aCe(e,t){return Nr(e)?e.operatorToken.kind===28?Vn([e.left,e.right],r=>aCe(r,t)):e.operatorToken.kind===64&&He(e.left)&&!t.getSymbolAtLocation(e.left):!1}var gue="addMissingDeclareProperty",sCe=[f.Property_0_will_overwrite_the_base_property_in_1_If_this_is_intentional_add_an_initializer_Otherwise_add_a_declare_modifier_or_remove_the_redundant_declaration.code];Sa({errorCodes:sCe,getCodeActions:function(t){const r=Rr.ChangeTracker.with(t,i=>lCe(i,t.sourceFile,t.span.start));if(r.length>0)return[oa(gue,r,f.Prefix_with_declare,gue,f.Prefix_all_incorrect_property_declarations_with_declare)]},fixIds:[gue],getAllCodeActions:e=>{const t=new Set;return Ss(e,sCe,(r,i)=>lCe(r,i.file,i.start,t))}});function lCe(e,t,r,i){const o=Fi(t,r);if(!He(o))return;const s=o.parent;s.kind===173&&(!i||rh(i,s))&&e.insertModifierBefore(t,138,s)}var yue="addMissingInvocationForDecorator",cCe=[f._0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0.code];Sa({errorCodes:cCe,getCodeActions:function(t){const r=Rr.ChangeTracker.with(t,i=>dCe(i,t.sourceFile,t.span.start));return[oa(yue,r,f.Call_decorator_expression,yue,f.Add_to_all_uncalled_decorators)]},fixIds:[yue],getAllCodeActions:e=>Ss(e,cCe,(t,r)=>dCe(t,r.file,r.start))});function dCe(e,t,r){const i=Fi(t,r),o=Dn(i,Wc);C.assert(!!o,"Expected position to be owned by a decorator.");const s=L.createCallExpression(o.expression,void 0,void 0);e.replaceNode(t,o.expression,s)}var vue="addMissingResolutionModeImportAttribute",uCe=[f.Type_only_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute.code,f.Type_import_of_an_ECMAScript_module_from_a_CommonJS_module_must_have_a_resolution_mode_attribute.code];Sa({errorCodes:uCe,getCodeActions:function(t){const r=Rr.ChangeTracker.with(t,i=>pCe(i,t.sourceFile,t.span.start,t.program,t.host,t.preferences));return[oa(vue,r,f.Add_resolution_mode_import_attribute,vue,f.Add_resolution_mode_import_attribute_to_all_type_only_imports_that_need_it)]},fixIds:[vue],getAllCodeActions:e=>Ss(e,uCe,(t,r)=>pCe(t,r.file,r.start,e.program,e.host,e.preferences))});function pCe(e,t,r,i,o,s){var l,u,d;const _=Fi(t,r),h=Dn(_,Rp(vl,e_));C.assert(!!h,"Expected position to be owned by an ImportDeclaration or ImportType.");const g=Gp(t,s)===0,E=gI(h),A=!E||((l=M1(E.text,t.fileName,i.getCompilerOptions(),o,i.getModuleResolutionCache(),void 0,99).resolvedModule)==null?void 0:l.resolvedFileName)===((d=(u=i.getResolvedModuleFromModuleSpecifier(E,t))==null?void 0:u.resolvedModule)==null?void 0:d.resolvedFileName),R=h.attributes?L.updateImportAttributes(h.attributes,L.createNodeArray([...h.attributes.elements,L.createImportAttribute(L.createStringLiteral("resolution-mode",g),L.createStringLiteral(A?"import":"require",g))],h.attributes.elements.hasTrailingComma),h.attributes.multiLine):L.createImportAttributes(L.createNodeArray([L.createImportAttribute(L.createStringLiteral("resolution-mode",g),L.createStringLiteral(A?"import":"require",g))]));h.kind===273?e.replaceNode(t,h,L.updateImportDeclaration(h,h.modifiers,h.importClause,h.moduleSpecifier,R)):e.replaceNode(t,h,L.updateImportTypeNode(h,h.argument,R,h.qualifier,h.typeArguments))}var bue="addNameToNamelessParameter",fCe=[f.Parameter_has_a_name_but_no_type_Did_you_mean_0_Colon_1.code];Sa({errorCodes:fCe,getCodeActions:function(t){const r=Rr.ChangeTracker.with(t,i=>mCe(i,t.sourceFile,t.span.start));return[oa(bue,r,f.Add_parameter_name,bue,f.Add_names_to_all_parameters_without_names)]},fixIds:[bue],getAllCodeActions:e=>Ss(e,fCe,(t,r)=>mCe(t,r.file,r.start))});function mCe(e,t,r){const i=Fi(t,r),o=i.parent;if(!to(o))return C.fail("Tried to add a parameter name to a non-parameter: "+C.formatSyntaxKind(i.kind));const s=o.parent.parameters.indexOf(o);C.assert(!o.type,"Tried to add a parameter name to a parameter that already had one."),C.assert(s>-1,"Parameter not found in parent parameter list.");let l=o.name.getEnd(),u=L.createTypeReferenceNode(o.name,void 0),d=hCe(t,o);for(;d;)u=L.createArrayTypeNode(u),l=d.getEnd(),d=hCe(t,d);const _=L.createParameterDeclaration(o.modifiers,o.dotDotDotToken,"arg"+s,o.questionToken,o.dotDotDotToken&&!hw(u)?L.createArrayTypeNode(u):u,o.initializer);e.replaceRange(t,Bf(o.getStart(t),l),_)}function hCe(e,t){const r=eE(t.name,t.parent,e);if(r&&r.kind===23&&pv(r.parent)&&to(r.parent.parent))return r.parent.parent}var _Ce="addOptionalPropertyUndefined",qQe=[f.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_type_of_the_target.code,f.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,f.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code];Sa({errorCodes:qQe,getCodeActions(e){const t=e.program.getTypeChecker(),r=JQe(e.sourceFile,e.span,t);if(!r.length)return;const i=Rr.ChangeTracker.with(e,o=>XQe(o,r));return[yh(_Ce,i,f.Add_undefined_to_optional_property_type)]},fixIds:[_Ce]});function JQe(e,t,r){var i,o;const s=gCe(hJ(e,t),r);if(!s)return ae;const{source:l,target:u}=s,d=KQe(l,u,r)?r.getTypeAtLocation(u.expression):r.getTypeAtLocation(u);return(o=(i=d.symbol)==null?void 0:i.declarations)!=null&&o.some(_=>Wn(_).fileName.match(/\.d\.ts$/))?ae:r.getExactOptionalProperties(d)}function KQe(e,t,r){return qr(t)&&!!r.getExactOptionalProperties(r.getTypeAtLocation(t.expression)).length&&r.getTypeAtLocation(e)===r.getUndefinedType()}function gCe(e,t){var r;if(e){if(Nr(e.parent)&&e.parent.operatorToken.kind===64)return{source:e.parent.right,target:e.parent.left};if(yi(e.parent)&&e.parent.initializer)return{source:e.parent.initializer,target:e.parent.name};if(Zo(e.parent)){const i=t.getSymbolAtLocation(e.parent.expression);if(!i?.valueDeclaration||!aI(i.valueDeclaration.kind)||!St(e))return;const o=e.parent.arguments.indexOf(e);if(o===-1)return;const s=i.valueDeclaration.parameters[o].name;if(He(s))return{source:e,target:s}}else if(Cc(e.parent)&&He(e.parent.name)||Ud(e.parent)){const i=gCe(e.parent.parent,t);if(!i)return;const o=t.getPropertyOfType(t.getTypeAtLocation(i.target),e.parent.name.text),s=(r=o?.declarations)==null?void 0:r[0];return s?{source:Cc(e.parent)?e.parent.initializer:e.parent.name,target:s}:void 0}}else return}function XQe(e,t){for(const r of t){const i=r.valueDeclaration;if(i&&(Su(i)||Po(i))&&i.type){const o=L.createUnionTypeNode([...i.type.kind===193?i.type.types:[i.type],L.createTypeReferenceNode("undefined")]);e.replaceNode(i.getSourceFile(),i.type,o)}}}var Tue="annotateWithTypeFromJSDoc",yCe=[f.JSDoc_types_may_be_moved_to_TypeScript_types.code];Sa({errorCodes:yCe,getCodeActions(e){const t=vCe(e.sourceFile,e.span.start);if(!t)return;const r=Rr.ChangeTracker.with(e,i=>SCe(i,e.sourceFile,t));return[oa(Tue,r,f.Annotate_with_type_from_JSDoc,Tue,f.Annotate_everything_with_types_from_JSDoc)]},fixIds:[Tue],getAllCodeActions:e=>Ss(e,yCe,(t,r)=>{const i=vCe(r.file,r.start);i&&SCe(t,r.file,i)})});function vCe(e,t){const r=Fi(e,t);return ni(to(r.parent)?r.parent.parent:r.parent,bCe)}function bCe(e){return YQe(e)&&TCe(e)}function TCe(e){return Ms(e)?e.parameters.some(TCe)||!e.type&&!!w2(e):!e.type&&!!$y(e)}function SCe(e,t,r){if(Ms(r)&&(w2(r)||r.parameters.some(i=>!!$y(i)))){if(!r.typeParameters){const o=T6(r);o.length&&e.insertTypeParameters(t,r,o)}const i=Xs(r)&&!Es(r,21,t);i&&e.insertNodeBefore(t,$a(r.parameters),L.createToken(21));for(const o of r.parameters)if(!o.type){const s=$y(o);s&&e.tryInsertTypeAnnotation(t,o,st(s,oE,Ri))}if(i&&e.insertNodeAfter(t,Ba(r.parameters),L.createToken(22)),!r.type){const o=w2(r);o&&e.tryInsertTypeAnnotation(t,r,st(o,oE,Ri))}}else{const i=C.checkDefined($y(r),"A JSDocType for this declaration should exist");C.assert(!r.type,"The JSDocType decl should have a type"),e.tryInsertTypeAnnotation(t,r,st(i,oE,Ri))}}function YQe(e){return Ms(e)||e.kind===261||e.kind===172||e.kind===173}function oE(e){switch(e.kind){case 313:case 314:return L.createTypeReferenceNode("any",ae);case 317:return QQe(e);case 316:return oE(e.type);case 315:return ZQe(e);case 319:return eZe(e);case 318:return tZe(e);case 184:return rZe(e);case 323:return $Qe(e);default:const t=kn(e,oE,void 0);return Cr(t,1),t}}function $Qe(e){const t=L.createTypeLiteralNode(Vt(e.jsDocPropertyTags,r=>L.createPropertySignature(void 0,He(r.name)?r.name:r.name.right,rw(r)?L.createToken(58):void 0,r.typeExpression&&st(r.typeExpression.type,oE,Ri)||L.createKeywordTypeNode(133))));return Cr(t,1),t}function QQe(e){return L.createUnionTypeNode([st(e.type,oE,Ri),L.createTypeReferenceNode("undefined",ae)])}function ZQe(e){return L.createUnionTypeNode([st(e.type,oE,Ri),L.createTypeReferenceNode("null",ae)])}function eZe(e){return L.createArrayTypeNode(st(e.type,oE,Ri))}function tZe(e){return L.createFunctionTypeNode(ae,e.parameters.map(nZe),e.type??L.createKeywordTypeNode(133))}function nZe(e){const t=e.parent.parameters.indexOf(e),r=e.type.kind===319&&t===e.parent.parameters.length-1,i=e.name||(r?"rest":"arg"+t),o=r?L.createToken(26):e.dotDotDotToken;return L.createParameterDeclaration(e.modifiers,o,i,e.questionToken,st(e.type,oE,Ri),e.initializer)}function rZe(e){let t=e.typeName,r=e.typeArguments;if(He(e.typeName)){if(n6(e))return iZe(e);let i=e.typeName.text;switch(e.typeName.text){case"String":case"Boolean":case"Object":case"Number":i=i.toLowerCase();break;case"array":case"date":case"promise":i=i[0].toUpperCase()+i.slice(1);break}t=L.createIdentifier(i),(i==="Array"||i==="Promise")&&!e.typeArguments?r=L.createNodeArray([L.createTypeReferenceNode("any",ae)]):r=Xn(e.typeArguments,oE,Ri)}return L.createTypeReferenceNode(t,r)}function iZe(e){const t=L.createParameterDeclaration(void 0,void 0,e.typeArguments[0].kind===150?"n":"s",void 0,L.createTypeReferenceNode(e.typeArguments[0].kind===150?"number":"string",[]),void 0),r=L.createTypeLiteralNode([L.createIndexSignature(void 0,[t],e.typeArguments[1])]);return Cr(r,1),r}var Sue="convertFunctionToEs6Class",ECe=[f.This_constructor_function_may_be_converted_to_a_class_declaration.code];Sa({errorCodes:ECe,getCodeActions(e){const t=Rr.ChangeTracker.with(e,r=>ACe(r,e.sourceFile,e.span.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions()));return[oa(Sue,t,f.Convert_function_to_an_ES2015_class,Sue,f.Convert_all_constructor_functions_to_classes)]},fixIds:[Sue],getAllCodeActions:e=>Ss(e,ECe,(t,r)=>ACe(t,r.file,r.start,e.program.getTypeChecker(),e.preferences,e.program.getCompilerOptions()))});function ACe(e,t,r,i,o,s){const l=i.getSymbolAtLocation(Fi(t,r));if(!l||!l.valueDeclaration||!(l.flags&19))return;const u=l.valueDeclaration;if(Zl(u)||Us(u))e.replaceNode(t,u,h(u));else if(yi(u)){const g=_(u);if(!g)return;const E=u.parent.parent;_d(u.parent)&&u.parent.declarations.length>1?(e.delete(t,u),e.insertNodeAfter(t,E,g)):e.replaceNode(t,E,g)}function d(g){const E=[];return g.exports&&g.exports.forEach(N=>{if(N.name==="prototype"&&N.declarations){const P=N.declarations[0];if(N.declarations.length===1&&qr(P)&&Nr(P.parent)&&P.parent.operatorToken.kind===64&&Wa(P.parent.right)){const k=P.parent.right;R(k.symbol,void 0,E)}}else R(N,[L.createToken(126)],E)}),g.members&&g.members.forEach((N,P)=>{var k,W,O,G;if(P==="constructor"&&N.valueDeclaration){const j=(G=(O=(W=(k=g.exports)==null?void 0:k.get("prototype"))==null?void 0:W.declarations)==null?void 0:O[0])==null?void 0:G.parent;j&&Nr(j)&&Wa(j.right)&&yt(j.right.properties,fK)||e.delete(t,N.valueDeclaration.parent);return}R(N,void 0,E)}),E;function A(N,P){return Ks(N)?qr(N)&&fK(N)?!0:Yo(P):Vn(N.properties,k=>!!(Nl(k)||W2(k)||Cc(k)&&Us(k.initializer)&&k.name||fK(k)))}function R(N,P,k){if(!(N.flags&8192)&&!(N.flags&4096))return;const W=N.valueDeclaration,O=W.parent,G=O.right;if(!A(W,G)||yt(k,ye=>{const ie=Oo(ye);return!!(ie&&He(ie)&&Kr(ie)===wl(N))}))return;const j=O.parent&&O.parent.kind===245?O.parent:O;if(e.delete(t,j),!G){k.push(L.createPropertyDeclaration(P,N.name,void 0,void 0,void 0));return}if(Ks(W)&&(Us(G)||Xs(G))){const ye=Gp(t,o),ie=oZe(W,s,ye);ie&&J(k,G,ie);return}else if(Wa(G)){Ye(G.properties,ye=>{(Nl(ye)||W2(ye))&&k.push(ye),Cc(ye)&&Us(ye.initializer)&&J(k,ye.initializer,ye.name),fK(ye)});return}else{if(Pu(t)||!qr(W))return;const ye=L.createPropertyDeclaration(P,W.name,void 0,void 0,G);oC(O.parent,ye,t),k.push(ye);return}function J(ye,ie,K){return Us(ie)?Z(ye,ie,K):q(ye,ie,K)}function Z(ye,ie,K){const pe=so(P,pK(ie,134)),de=L.createMethodDeclaration(pe,void 0,K,void 0,void 0,ie.parameters,void 0,ie.body);oC(O,de,t),ye.push(de)}function q(ye,ie,K){const pe=ie.body;let de;pe.kind===242?de=pe:de=L.createBlock([L.createReturnStatement(pe)]);const fe=so(P,pK(ie,134)),ve=L.createMethodDeclaration(fe,void 0,K,void 0,void 0,ie.parameters,void 0,de);oC(O,ve,t),ye.push(ve)}}}function _(g){const E=g.initializer;if(!E||!Us(E)||!He(g.name))return;const A=d(g.symbol);E.body&&A.unshift(L.createConstructorDeclaration(void 0,E.parameters,E.body));const R=pK(g.parent.parent,95);return L.createClassDeclaration(R,g.name,void 0,void 0,A)}function h(g){const E=d(l);g.body&&E.unshift(L.createConstructorDeclaration(void 0,g.parameters,g.body));const A=pK(g,95);return L.createClassDeclaration(A,g.name,void 0,void 0,E)}}function pK(e,t){return Tm(e)?Un(e.modifiers,r=>r.kind===t):void 0}function fK(e){return e.name?!!(He(e.name)&&e.name.text==="constructor"):!1}function oZe(e,t,r){if(qr(e))return e.name;const i=e.argumentExpression;if(np(i))return i;if(ds(i))return fp(i.text,Ga(t))?L.createIdentifier(i.text):g1(i)?L.createStringLiteral(i.text,r===0):i}var Eue="convertToAsyncFunction",ICe=[f.This_may_be_converted_to_an_async_function.code],mK=!0;Sa({errorCodes:ICe,getCodeActions(e){mK=!0;const t=Rr.ChangeTracker.with(e,r=>xCe(r,e.sourceFile,e.span.start,e.program.getTypeChecker()));return mK?[oa(Eue,t,f.Convert_to_async_function,Eue,f.Convert_all_to_async_functions)]:[]},fixIds:[Eue],getAllCodeActions:e=>Ss(e,ICe,(t,r)=>xCe(t,r.file,r.start,e.program.getTypeChecker()))});function xCe(e,t,r,i){const o=Fi(t,r);let s;if(He(o)&&yi(o.parent)&&o.parent.initializer&&Ms(o.parent.initializer)?s=o.parent.initializer:s=ni(df(Fi(t,r)),OJ),!s)return;const l=new Map,u=Ir(s),d=sZe(s,i),_=lZe(s,i,l);if(!kJ(_,i))return;const h=_.body&&ea(_.body)?aZe(_.body,i):ae,g={checker:i,synthNamesMap:l,setOfExpressionsToReturn:d,isInJSFile:u};if(!h.length)return;const E=La(t.text,Yh(s).pos);e.insertModifierAt(t,E,134,{suffix:" "});for(const A of h)if(Jo(A,function R(N){if(Zo(N)){const P=uC(N,N,g,!1);if(Tx())return!0;e.replaceNodeWithNodes(t,A,P)}else if(!Yo(N)&&(Jo(N,R),Tx()))return!0}),Tx())return}function aZe(e,t){const r=[];return vb(e,i=>{H7(i,t)&&r.push(i)}),r}function sZe(e,t){if(!e.body)return new Set;const r=new Set;return Jo(e.body,function i(o){HO(o,t,"then")?(r.add(ls(o)),Ye(o.arguments,i)):HO(o,t,"catch")||HO(o,t,"finally")?(r.add(ls(o)),Jo(o,i)):DCe(o,t)?r.add(ls(o)):Jo(o,i)}),r}function HO(e,t,r){if(!Zo(e))return!1;const o=_O(e,r)&&t.getTypeAtLocation(e);return!!(o&&t.getPromisedTypeOfPromise(o))}function RCe(e,t){return(Hr(e)&4)!==0&&e.target===t}function hK(e,t,r){if(e.expression.name.escapedText==="finally")return;const i=r.getTypeAtLocation(e.expression.expression);if(RCe(i,r.getPromiseType())||RCe(i,r.getPromiseLikeType()))if(e.expression.name.escapedText==="then"){if(t===Qv(e.arguments,0))return Qv(e.typeArguments,0);if(t===Qv(e.arguments,1))return Qv(e.typeArguments,1)}else return Qv(e.typeArguments,0)}function DCe(e,t){return St(e)?!!t.getPromisedTypeOfPromise(t.getTypeAtLocation(e)):!1}function lZe(e,t,r){const i=new Map,o=cm();return Jo(e,function s(l){if(!He(l)){Jo(l,s);return}const u=t.getSymbolAtLocation(l);if(u){const d=t.getTypeAtLocation(l),_=kCe(d,t),h=Ta(u).toString();if(_&&!to(l.parent)&&!Ms(l.parent)&&!r.has(h)){const g=Ac(_.parameters),E=g?.valueDeclaration&&to(g.valueDeclaration)&&ni(g.valueDeclaration.name,He)||L.createUniqueName("result",16),A=CCe(E,o);r.set(h,A),o.add(E.text,u)}else if(l.parent&&(to(l.parent)||yi(l.parent)||Ha(l.parent))){const g=l.text,E=o.get(g);if(E&&E.some(A=>A!==u)){const A=CCe(l,o);i.set(h,A.identifier),r.set(h,A),o.add(g,u)}else{const A=_s(l);r.set(h,jP(A)),o.add(g,u)}}}}),aw(e,!0,s=>{if(Ha(s)&&He(s.name)&&ff(s.parent)){const l=t.getSymbolAtLocation(s.name),u=l&&i.get(String(Ta(l)));if(u&&u.text!==(s.name||s.propertyName).getText())return L.createBindingElement(s.dotDotDotToken,s.propertyName||s.name,u,s.initializer)}else if(He(s)){const l=t.getSymbolAtLocation(s),u=l&&i.get(String(Ta(l)));if(u)return L.createIdentifier(u.text)}})}function CCe(e,t){const r=(t.get(e.text)||ae).length,i=r===0?e:L.createIdentifier(e.text+"_"+r);return jP(i)}function Tx(){return!mK}function _0(){return mK=!1,ae}function uC(e,t,r,i,o){if(HO(t,r.checker,"then"))return uZe(t,Qv(t.arguments,0),Qv(t.arguments,1),r,i,o);if(HO(t,r.checker,"catch"))return PCe(t,Qv(t.arguments,0),r,i,o);if(HO(t,r.checker,"finally"))return dZe(t,Qv(t.arguments,0),r,i,o);if(qr(t))return uC(e,t.expression,r,i,o);const s=r.checker.getTypeAtLocation(t);return s&&r.checker.getPromisedTypeOfPromise(s)?(C.assertNode(yl(t).parent,qr),pZe(e,t,r,i,o)):_0()}function _K({checker:e},t){if(t.kind===106)return!0;if(He(t)&&!pl(t)&&Kr(t)==="undefined"){const r=e.getSymbolAtLocation(t);return!r||e.isUndefinedSymbol(r)}return!1}function cZe(e){const t=L.createUniqueName(e.identifier.text,16);return jP(t)}function NCe(e,t,r){let i;return r&&!JO(e,t)&&(qO(r)?(i=r,t.synthNamesMap.forEach((o,s)=>{if(o.identifier.text===r.identifier.text){const l=cZe(r);t.synthNamesMap.set(s,l)}})):i=jP(L.createUniqueName("result",16),r.types),Rue(i)),i}function MCe(e,t,r,i,o){const s=[];let l;if(i&&!JO(e,t)){l=_s(Rue(i));const u=i.types,d=t.checker.getUnionType(u,2),_=t.isInJSFile?void 0:t.checker.typeToTypeNode(d,void 0,void 0),h=[L.createVariableDeclaration(l,void 0,_)],g=L.createVariableStatement(void 0,L.createVariableDeclarationList(h,1));s.push(g)}return s.push(r),o&&l&&hZe(o)&&s.push(L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(_s(FCe(o)),void 0,void 0,l)],2))),s}function dZe(e,t,r,i,o){if(!t||_K(r,t))return uC(e,e.expression.expression,r,i,o);const s=NCe(e,r,o),l=uC(e,e.expression.expression,r,!0,s);if(Tx())return _0();const u=Iue(t,i,void 0,void 0,e,r);if(Tx())return _0();const d=L.createBlock(l),_=L.createBlock(u),h=L.createTryStatement(d,void 0,_);return MCe(e,r,h,s,o)}function PCe(e,t,r,i,o){if(!t||_K(r,t))return uC(e,e.expression.expression,r,i,o);const s=OCe(t,r),l=NCe(e,r,o),u=uC(e,e.expression.expression,r,!0,l);if(Tx())return _0();const d=Iue(t,i,l,s,e,r);if(Tx())return _0();const _=L.createBlock(u),h=L.createCatchClause(s&&_s(lz(s)),L.createBlock(d)),g=L.createTryStatement(_,h,void 0);return MCe(e,r,g,l,o)}function uZe(e,t,r,i,o,s){if(!t||_K(i,t))return PCe(e,r,i,o,s);if(r&&!_K(i,r))return _0();const l=OCe(t,i),u=uC(e.expression.expression,e.expression.expression,i,!0,l);if(Tx())return _0();const d=Iue(t,o,s,l,e,i);return Tx()?_0():so(u,d)}function pZe(e,t,r,i,o){if(JO(e,r)){let s=_s(t);return i&&(s=L.createAwaitExpression(s)),[L.createReturnStatement(s)]}return gK(o,L.createAwaitExpression(t),void 0)}function gK(e,t,r){return!e||WCe(e)?[L.createExpressionStatement(t)]:qO(e)&&e.hasBeenDeclared?[L.createExpressionStatement(L.createAssignment(_s(xue(e)),t))]:[L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(_s(lz(e)),void 0,r,t)],2))]}function Aue(e,t){if(t&&e){const r=L.createUniqueName("result",16);return[...gK(jP(r),e,t),L.createReturnStatement(r)]}return[L.createReturnStatement(e)]}function Iue(e,t,r,i,o,s){var l;switch(e.kind){case 106:break;case 212:case 80:if(!i)break;const u=L.createCallExpression(_s(e),void 0,qO(i)?[xue(i)]:[]);if(JO(o,s))return Aue(u,hK(o,e,s.checker));const d=s.checker.getTypeAtLocation(e),_=s.checker.getSignaturesOfType(d,0);if(!_.length)return _0();const h=_[0].getReturnType(),g=gK(r,L.createAwaitExpression(u),hK(o,e,s.checker));return r&&r.types.push(s.checker.getAwaitedType(h)||h),g;case 219:case 220:{const E=e.body,A=(l=kCe(s.checker.getTypeAtLocation(e),s.checker))==null?void 0:l.getReturnType();if(ea(E)){let R=[],N=!1;for(const P of E.statements)if(tf(P))if(N=!0,H7(P,s.checker))R=R.concat(wCe(s,P,t,r));else{const k=A&&P.expression?LCe(s.checker,A,P.expression):P.expression;R.push(...Aue(k,hK(o,e,s.checker)))}else{if(t&&vb(P,dS))return _0();R.push(P)}return JO(o,s)?R.map(P=>_s(P)):fZe(R,r,s,N)}else{const R=wJ(E,s.checker)?wCe(s,L.createReturnStatement(E),t,r):ae;if(R.length>0)return R;if(A){const N=LCe(s.checker,A,E);if(JO(o,s))return Aue(N,hK(o,e,s.checker));{const P=gK(r,N,void 0);return r&&r.types.push(s.checker.getAwaitedType(A)||A),P}}else return _0()}}default:return _0()}return ae}function LCe(e,t,r){const i=_s(r);return e.getPromisedTypeOfPromise(t)?L.createAwaitExpression(i):i}function kCe(e,t){const r=t.getSignaturesOfType(e,0);return Zs(r)}function fZe(e,t,r,i){const o=[];for(const s of e)if(tf(s)){if(s.expression){const l=DCe(s.expression,r.checker)?L.createAwaitExpression(s.expression):s.expression;t===void 0?o.push(L.createExpressionStatement(l)):qO(t)&&t.hasBeenDeclared?o.push(L.createExpressionStatement(L.createAssignment(xue(t),l))):o.push(L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(lz(t),void 0,void 0,l)],2)))}}else o.push(_s(s));return!i&&t!==void 0&&o.push(L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(lz(t),void 0,void 0,L.createIdentifier("undefined"))],2))),o}function wCe(e,t,r,i){let o=[];return Jo(t,function s(l){if(Zo(l)){const u=uC(l,l,e,r,i);if(o=o.concat(u),o.length>0)return}else Yo(l)||Jo(l,s)}),o}function OCe(e,t){const r=[];let i;if(Ms(e)){if(e.parameters.length>0){const d=e.parameters[0].name;i=o(d)}}else He(e)?i=s(e):qr(e)&&He(e.name)&&(i=s(e.name));if(!i||"identifier"in i&&i.identifier.text==="undefined")return;return i;function o(d){if(He(d))return s(d);const _=Ki(d.elements,h=>Jc(h)?[]:[o(h.name)]);return mZe(d,_)}function s(d){const _=u(d),h=l(_);return h&&t.synthNamesMap.get(Ta(h).toString())||jP(d,r)}function l(d){var _;return((_=ni(d,ah))==null?void 0:_.symbol)??t.checker.getSymbolAtLocation(d)}function u(d){return d.original?d.original:d}}function WCe(e){return e?qO(e)?!e.identifier.text:Vn(e.elements,WCe):!0}function jP(e,t=[]){return{kind:0,identifier:e,types:t,hasBeenDeclared:!1,hasBeenReferenced:!1}}function mZe(e,t=ae,r=[]){return{kind:1,bindingPattern:e,elements:t,types:r}}function xue(e){return e.hasBeenReferenced=!0,e.identifier}function lz(e){return qO(e)?Rue(e):FCe(e)}function FCe(e){for(const t of e.elements)lz(t);return e.bindingPattern}function Rue(e){return e.hasBeenDeclared=!0,e.identifier}function qO(e){return e.kind===0}function hZe(e){return e.kind===1}function JO(e,t){return!!e.original&&t.setOfExpressionsToReturn.has(ls(e.original))}Sa({errorCodes:[f.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module.code],getCodeActions(e){const{sourceFile:t,program:r,preferences:i}=e,o=Rr.ChangeTracker.with(e,s=>{if(gZe(t,r.getTypeChecker(),s,Ga(r.getCompilerOptions()),Gp(t,i)))for(const u of r.getSourceFiles())_Ze(u,t,r,s,Gp(u,i))});return[yh("convertToEsModule",o,f.Convert_to_ES_module)]}});function _Ze(e,t,r,i,o){var s;for(const l of e.imports){const u=(s=r.getResolvedModuleFromModuleSpecifier(l,e))==null?void 0:s.resolvedModule;if(!u||u.resolvedFileName!==t.fileName)continue;const d=eM(l);switch(d.kind){case 272:i.replaceNode(e,d,Vb(d.name,void 0,l,o));break;case 214:Zu(d,!1)&&i.replaceNode(e,d,L.createPropertyAccessExpression(_s(d),"default"));break}}}function gZe(e,t,r,i,o){const s={original:NZe(e),additional:new Set},l=yZe(e,t,s);vZe(e,l,r);let u=!1,d;for(const _ of Un(e.statements,ac)){const h=BCe(e,_,r,t,s,i,o);h&&NF(h,d??(d=new Map))}for(const _ of Un(e.statements,h=>!ac(h))){const h=bZe(e,_,t,r,s,i,l,d,o);u=u||h}return d?.forEach((_,h)=>{r.replaceNode(e,h,_)}),u}function yZe(e,t,r){const i=new Map;return zCe(e,o=>{const{text:s}=o.name;!i.has(s)&&(qG(o.name)||t.resolveName(s,o,111551,!0))&&i.set(s,yK(`_${s}`,r))}),i}function vZe(e,t,r){zCe(e,(i,o)=>{if(o)return;const{text:s}=i.name;r.replaceNode(e,i,L.createIdentifier(t.get(s)||s))})}function zCe(e,t){e.forEachChild(function r(i){if(qr(i)&&JS(e,i.expression)&&He(i.name)){const{parent:o}=i;t(i,Nr(o)&&o.left===i&&o.operatorToken.kind===64)}i.forEachChild(r)})}function bZe(e,t,r,i,o,s,l,u,d){switch(t.kind){case 244:return BCe(e,t,i,r,o,s,d),!1;case 245:{const{expression:_}=t;switch(_.kind){case 214:return Zu(_,!0)&&i.replaceNode(e,t,Vb(void 0,void 0,_.arguments[0],d)),!1;case 227:{const{operatorToken:h}=_;return h.kind===64&&SZe(e,r,_,i,l,u)}}}default:return!1}}function BCe(e,t,r,i,o,s,l){const{declarationList:u}=t;let d=!1;const _=Vt(u.declarations,h=>{const{name:g,initializer:E}=h;if(E){if(JS(e,E))return d=!0,UP([]);if(Zu(E,!0))return d=!0,DZe(g,E.arguments[0],i,o,s,l);if(qr(E)&&Zu(E.expression,!0))return d=!0,TZe(g,E.name.text,E.expression.arguments[0],o,l)}return UP([L.createVariableStatement(void 0,L.createVariableDeclarationList([h],u.flags))])});if(d){r.replaceNodeWithNodes(e,t,Ki(_,g=>g.newImports));let h;return Ye(_,g=>{g.useSitesToUnqualify&&NF(g.useSitesToUnqualify,h??(h=new Map))}),h}}function TZe(e,t,r,i,o){switch(e.kind){case 207:case 208:{const s=yK(t,i);return UP([UCe(s,t,r,o),vK(void 0,e,L.createIdentifier(s))])}case 80:return UP([UCe(e.text,t,r,o)]);default:return C.assertNever(e,`Convert to ES module got invalid syntax form ${e.kind}`)}}function SZe(e,t,r,i,o,s){const{left:l,right:u}=r;if(!qr(l))return!1;if(JS(e,l))if(JS(e,u))i.delete(e,r.parent);else{const d=Wa(u)?EZe(u,s):Zu(u,!0)?IZe(u.arguments[0],t):void 0;return d?(i.replaceNodeWithNodes(e,r.parent,d[0]),d[1]):(i.replaceRangeWithText(e,Bf(l.getStart(e),u.pos),"export default"),!0)}else JS(e,l.expression)&&AZe(e,r,i,o);return!1}function EZe(e,t){const r=DT(e.properties,i=>{switch(i.kind){case 178:case 179:case 305:case 306:return;case 304:return He(i.name)?RZe(i.name.text,i.initializer,t):void 0;case 175:return He(i.name)?jCe(i.name.text,[L.createToken(95)],i,t):void 0;default:C.assertNever(i,`Convert to ES6 got invalid prop kind ${i.kind}`)}});return r&&[r,!1]}function AZe(e,t,r,i){const{text:o}=t.left.name,s=i.get(o);if(s!==void 0){const l=[vK(void 0,s,t.right),Nue([L.createExportSpecifier(!1,s,o)])];r.replaceNodeWithNodes(e,t.parent,l)}else xZe(t,e,r)}function IZe(e,t){const r=e.text,i=t.getSymbolAtLocation(e),o=i?i.exports:bt;return o.has("export=")?[[Due(r)],!0]:o.has("default")?o.size>1?[[GCe(r),Due(r)],!0]:[[Due(r)],!0]:[[GCe(r)],!1]}function GCe(e){return Nue(void 0,e)}function Due(e){return Nue([L.createExportSpecifier(!1,void 0,"default")],e)}function xZe({left:e,right:t,parent:r},i,o){const s=e.name.text;if((Us(t)||Xs(t)||dc(t))&&(!t.name||t.name.text===s)){o.replaceRange(i,{pos:e.getStart(i),end:t.getStart(i)},L.createToken(95),{suffix:" "}),t.name||o.insertName(i,t,s);const l=Es(r,27,i);l&&o.delete(i,l)}else o.replaceNodeRangeWithNodes(i,e.expression,Es(e,25,i),[L.createToken(95),L.createToken(87)],{joiner:" ",suffix:" "})}function RZe(e,t,r){const i=[L.createToken(95)];switch(t.kind){case 219:{const{name:s}=t;if(s&&s.text!==e)return o()}case 220:return jCe(e,i,t,r);case 232:return PZe(e,i,t,r);default:return o()}function o(){return vK(i,L.createIdentifier(e),Cue(t,r))}}function Cue(e,t){if(!t||!yt(Co(t.keys()),i=>tp(e,i)))return e;return Mo(e)?oj(e,!0,r):aw(e,!0,r);function r(i){if(i.kind===212){const o=t.get(i);return t.delete(i),o}}}function DZe(e,t,r,i,o,s){switch(e.kind){case 207:{const l=DT(e.elements,u=>u.dotDotDotToken||u.initializer||u.propertyName&&!He(u.propertyName)||!He(u.name)?void 0:HCe(u.propertyName&&u.propertyName.text,u.name.text));if(l)return UP([Vb(void 0,l,t,s)])}case 208:{const l=yK(LO(t.text,o),i);return UP([Vb(L.createIdentifier(l),void 0,t,s),vK(void 0,_s(e),L.createIdentifier(l))])}case 80:return CZe(e,t,r,i,s);default:return C.assertNever(e,`Convert to ES module got invalid name kind ${e.kind}`)}}function CZe(e,t,r,i,o){const s=r.getSymbolAtLocation(e),l=new Map;let u=!1,d;for(const h of i.original.get(e.text)){if(r.getSymbolAtLocation(h)!==s||h===e)continue;const{parent:g}=h;if(qr(g)){const{name:{text:E}}=g;if(E==="default"){u=!0;const A=h.getText();(d??(d=new Map)).set(g,L.createIdentifier(A))}else{C.assert(g.expression===h,"Didn't expect expression === use");let A=l.get(E);A===void 0&&(A=yK(E,i),l.set(E,A)),(d??(d=new Map)).set(g,L.createIdentifier(A))}}else u=!0}const _=l.size===0?void 0:Co(za(l.entries(),([h,g])=>L.createImportSpecifier(!1,h===g?void 0:L.createIdentifier(h),L.createIdentifier(g))));return _||(u=!0),UP([Vb(u?_s(e):void 0,_,t,o)],d)}function yK(e,t){for(;t.original.has(e)||t.additional.has(e);)e=`_${e}`;return t.additional.add(e),e}function NZe(e){const t=cm();return VCe(e,r=>t.add(r.text,r)),t}function VCe(e,t){He(e)&&MZe(e)&&t(e),e.forEachChild(r=>VCe(r,t))}function MZe(e){const{parent:t}=e;switch(t.kind){case 212:return t.name!==e;case 209:return t.propertyName!==e;case 277:return t.propertyName!==e;default:return!0}}function jCe(e,t,r,i){return L.createFunctionDeclaration(so(t,WS(r.modifiers)),_s(r.asteriskToken),e,WS(r.typeParameters),WS(r.parameters),_s(r.type),L.converters.convertToFunctionBlock(Cue(r.body,i)))}function PZe(e,t,r,i){return L.createClassDeclaration(so(t,WS(r.modifiers)),e,WS(r.typeParameters),WS(r.heritageClauses),Cue(r.members,i))}function UCe(e,t,r,i){return t==="default"?Vb(L.createIdentifier(e),void 0,r,i):Vb(void 0,[HCe(t,e)],r,i)}function HCe(e,t){return L.createImportSpecifier(!1,e!==void 0&&e!==t?L.createIdentifier(e):void 0,L.createIdentifier(t))}function vK(e,t,r){return L.createVariableStatement(e,L.createVariableDeclarationList([L.createVariableDeclaration(t,void 0,void 0,r)],2))}function Nue(e,t){return L.createExportDeclaration(void 0,!1,e&&L.createNamedExports(e),t===void 0?void 0:L.createStringLiteral(t))}function UP(e,t){return{newImports:e,useSitesToUnqualify:t}}var Mue="correctQualifiedNameToIndexedAccessType",qCe=[f.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1.code];Sa({errorCodes:qCe,getCodeActions(e){const t=JCe(e.sourceFile,e.span.start);if(!t)return;const r=Rr.ChangeTracker.with(e,o=>KCe(o,e.sourceFile,t)),i=`${t.left.text}["${t.right.text}"]`;return[oa(Mue,r,[f.Rewrite_as_the_indexed_access_type_0,i],Mue,f.Rewrite_all_as_indexed_access_types)]},fixIds:[Mue],getAllCodeActions:e=>Ss(e,qCe,(t,r)=>{const i=JCe(r.file,r.start);i&&KCe(t,r.file,i)})});function JCe(e,t){const r=Dn(Fi(e,t),ku);return C.assert(!!r,"Expected position to be owned by a qualified name."),He(r.left)?r:void 0}function KCe(e,t,r){const i=r.right.text,o=L.createIndexedAccessTypeNode(L.createTypeReferenceNode(r.left,void 0),L.createLiteralTypeNode(L.createStringLiteral(i)));e.replaceNode(t,r,o)}var Pue=[f.Re_exporting_a_type_when_0_is_enabled_requires_using_export_type.code],Lue="convertToTypeOnlyExport";Sa({errorCodes:Pue,getCodeActions:function(t){const r=Rr.ChangeTracker.with(t,i=>YCe(i,XCe(t.span,t.sourceFile),t));if(r.length)return[oa(Lue,r,f.Convert_to_type_only_export,Lue,f.Convert_all_re_exported_types_to_type_only_exports)]},fixIds:[Lue],getAllCodeActions:function(t){const r=new Set;return Ss(t,Pue,(i,o)=>{const s=XCe(o,t.sourceFile);s&&gm(r,ls(s.parent.parent))&&YCe(i,s,t)})}});function XCe(e,t){return ni(Fi(t,e.start).parent,ou)}function YCe(e,t,r){if(!t)return;const i=t.parent,o=i.parent,s=LZe(t,r);if(s.length===i.elements.length)e.insertModifierBefore(r.sourceFile,156,i);else{const l=L.updateExportDeclaration(o,o.modifiers,!1,L.updateNamedExports(i,Un(i.elements,d=>!jn(s,d))),o.moduleSpecifier,void 0),u=L.createExportDeclaration(void 0,!0,L.createNamedExports(s),o.moduleSpecifier,void 0);e.replaceNode(r.sourceFile,o,l,{leadingTriviaOption:Rr.LeadingTriviaOption.IncludeAll,trailingTriviaOption:Rr.TrailingTriviaOption.Exclude}),e.insertNodeAfter(r.sourceFile,o,u)}}function LZe(e,t){const r=e.parent;if(r.elements.length===1)return r.elements;const i=yce(zu(r),t.program.getSemanticDiagnostics(t.sourceFile,t.cancellationToken));return Un(r.elements,o=>{var s;return o===e||((s=gce(o,i))==null?void 0:s.code)===Pue[0]})}var $Ce=[f._0_is_a_type_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code,f._0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_verbatimModuleSyntax_is_enabled.code],bK="convertToTypeOnlyImport";Sa({errorCodes:$Ce,getCodeActions:function(t){var r;const i=QCe(t.sourceFile,t.span.start);if(i){const o=Rr.ChangeTracker.with(t,u=>cz(u,t.sourceFile,i)),s=i.kind===277&&vl(i.parent.parent.parent)&&ZCe(i,t.sourceFile,t.program)?Rr.ChangeTracker.with(t,u=>cz(u,t.sourceFile,i.parent.parent.parent)):void 0,l=oa(bK,o,i.kind===277?[f.Use_type_0,((r=i.propertyName)==null?void 0:r.text)??i.name.text]:f.Use_import_type,bK,f.Fix_all_with_type_only_imports);return yt(s)?[yh(bK,s,f.Use_import_type),l]:[l]}},fixIds:[bK],getAllCodeActions:function(t){const r=new Set;return Ss(t,$Ce,(i,o)=>{const s=QCe(o.file,o.start);s?.kind===273&&!r.has(s)?(cz(i,o.file,s),r.add(s)):s?.kind===277&&vl(s.parent.parent.parent)&&!r.has(s.parent.parent.parent)&&ZCe(s,o.file,t.program)?(cz(i,o.file,s.parent.parent.parent),r.add(s.parent.parent.parent)):s?.kind===277&&cz(i,o.file,s)})}});function QCe(e,t){const{parent:r}=Fi(e,t);return Eu(r)||vl(r)&&r.importClause?r:void 0}function ZCe(e,t,r){if(e.parent.parent.name)return!1;const i=e.parent.elements.filter(s=>!s.isTypeOnly);if(i.length===1)return!0;const o=r.getTypeChecker();for(const s of i)if(Ys.Core.eachSymbolReferenceInFile(s.name,o,t,u=>{const d=o.getSymbolAtLocation(u);return!!d&&o.symbolIsValue(d)||!HT(u)}))return!1;return!0}function cz(e,t,r){var i;if(Eu(r))e.replaceNode(t,r,L.updateImportSpecifier(r,!0,r.propertyName,r.name));else{const o=r.importClause;if(o.name&&o.namedBindings)e.replaceNodeWithNodes(t,r,[L.createImportDeclaration(WS(r.modifiers,!0),L.createImportClause(156,_s(o.name,!0),void 0),_s(r.moduleSpecifier,!0),_s(r.attributes,!0)),L.createImportDeclaration(WS(r.modifiers,!0),L.createImportClause(156,void 0,_s(o.namedBindings,!0)),_s(r.moduleSpecifier,!0),_s(r.attributes,!0))]);else{const s=((i=o.namedBindings)==null?void 0:i.kind)===276?L.updateNamedImports(o.namedBindings,Zi(o.namedBindings.elements,u=>L.updateImportSpecifier(u,!1,u.propertyName,u.name))):o.namedBindings,l=L.updateImportDeclaration(r,r.modifiers,L.updateImportClause(o,156,o.name,s),r.moduleSpecifier,r.attributes);e.replaceNode(t,r,l)}}}var kue="convertTypedefToType",eNe=[f.JSDoc_typedef_may_be_converted_to_TypeScript_type.code];Sa({fixIds:[kue],errorCodes:eNe,getCodeActions(e){const t=_y(e.host,e.formatContext.options),r=Fi(e.sourceFile,e.span.start);if(!r)return;const i=Rr.ChangeTracker.with(e,o=>tNe(o,r,e.sourceFile,t));if(i.length>0)return[oa(kue,i,f.Convert_typedef_to_TypeScript_type,kue,f.Convert_all_typedef_to_TypeScript_types)]},getAllCodeActions:e=>Ss(e,eNe,(t,r)=>{const i=_y(e.host,e.formatContext.options),o=Fi(r.file,r.start);o&&tNe(t,o,r.file,i,!0)})});function tNe(e,t,r,i,o=!1){if(!R1(t))return;const s=wZe(t);if(!s)return;const l=t.parent,{leftSibling:u,rightSibling:d}=kZe(t);let _=l.getStart(),h="";!u&&l.comment&&(_=nNe(l,l.getStart(),t.getStart()),h=`${i} */${i}`),u&&(o&&R1(u)?(_=t.getStart(),h=""):(_=nNe(l,u.getStart(),t.getStart()),h=`${i} */${i}`));let g=l.getEnd(),E="";d&&(o&&R1(d)?(g=d.getStart(),E=`${i}${i}`):(g=d.getStart(),E=`${i}/**${i} * `)),e.replaceRange(r,{pos:_,end:g},s,{prefix:h,suffix:E})}function kZe(e){const t=e.parent,r=t.getChildCount()-1,i=t.getChildren().findIndex(l=>l.getStart()===e.getStart()&&l.getEnd()===e.getEnd()),o=i>0?t.getChildAt(i-1):void 0,s=i<r?t.getChildAt(i+1):void 0;return{leftSibling:o,rightSibling:s}}function nNe(e,t,r){const i=e.getText().substring(t-e.getStart(),r-e.getStart());for(let o=i.length;o>0;o--)if(!/[*/\s]/.test(i.substring(o-1,o)))return t+o;return r}function wZe(e){var t;const{typeExpression:r}=e;if(!r)return;const i=(t=e.name)==null?void 0:t.getText();if(i){if(r.kind===323)return OZe(i,r);if(r.kind===310)return WZe(i,r)}}function OZe(e,t){const r=rNe(t);if(yt(r))return L.createInterfaceDeclaration(void 0,e,void 0,void 0,r)}function WZe(e,t){const r=_s(t.type);if(r)return L.createTypeAliasDeclaration(void 0,L.createIdentifier(e),void 0,r)}function rNe(e){const t=e.jsDocPropertyTags;return yt(t)?Ui(t,i=>{var o;const s=FZe(i),l=(o=i.typeExpression)==null?void 0:o.type,u=i.isBracketed;let d;if(l&&x1(l)){const _=rNe(l);d=L.createTypeLiteralNode(_)}else l&&(d=_s(l));if(d&&s){const _=u?L.createToken(58):void 0;return L.createPropertySignature(void 0,s,_,d)}}):void 0}function FZe(e){return e.name.kind===80?e.name.text:e.name.right.text}function zZe(e){return ef(e)?Ki(e.jsDoc,t=>{var r;return(r=t.tags)==null?void 0:r.filter(i=>R1(i))}):[]}var wue="convertLiteralTypeToMappedType",iNe=[f._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Did_you_mean_to_use_1_in_0.code];Sa({errorCodes:iNe,getCodeActions:function(t){const{sourceFile:r,span:i}=t,o=oNe(r,i.start);if(!o)return;const{name:s,constraint:l}=o,u=Rr.ChangeTracker.with(t,d=>aNe(d,r,o));return[oa(wue,u,[f.Convert_0_to_1_in_0,l,s],wue,f.Convert_all_type_literals_to_mapped_type)]},fixIds:[wue],getAllCodeActions:e=>Ss(e,iNe,(t,r)=>{const i=oNe(r.file,r.start);i&&aNe(t,r.file,i)})});function oNe(e,t){const r=Fi(e,t);if(He(r)){const i=ma(r.parent.parent,Su),o=r.getText(e);return{container:ma(i.parent,wu),typeNode:i.type,constraint:o,name:o==="K"?"P":"K"}}}function aNe(e,t,{container:r,typeNode:i,constraint:o,name:s}){e.replaceNode(t,r,L.createMappedTypeNode(void 0,L.createTypeParameterDeclaration(void 0,s,L.createTypeReferenceNode(o)),void 0,void 0,i,void 0))}var sNe=[f.Class_0_incorrectly_implements_interface_1.code,f.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass.code],Oue="fixClassIncorrectlyImplementsInterface";Sa({errorCodes:sNe,getCodeActions(e){const{sourceFile:t,span:r}=e,i=lNe(t,r.start);return Ui(nD(i),o=>{const s=Rr.ChangeTracker.with(e,l=>dNe(e,o,t,i,l,e.preferences));return s.length===0?void 0:oa(Oue,s,[f.Implement_interface_0,o.getText(t)],Oue,f.Implement_all_unimplemented_interfaces)})},fixIds:[Oue],getAllCodeActions(e){const t=new Set;return Ss(e,sNe,(r,i)=>{const o=lNe(i.file,i.start);if(gm(t,ls(o)))for(const s of nD(o))dNe(e,s,i.file,o,r,e.preferences)})}});function lNe(e,t){return C.checkDefined(hd(Fi(e,t)),"There should be a containing class")}function cNe(e){return!e.valueDeclaration||!(Gd(e.valueDeclaration)&2)}function dNe(e,t,r,i,o,s){const l=e.program.getTypeChecker(),u=BZe(i,l),d=l.getTypeAtLocation(t),h=l.getPropertiesOfType(d).filter(j8(cNe,P=>!u.has(P.escapedName))),g=l.getTypeAtLocation(i),E=hn(i.members,P=>Ml(P));g.getNumberIndexType()||R(d,1),g.getStringIndexType()||R(d,0);const A=aE(r,e.program,s,e.host);Cpe(i,h,r,e,s,A,P=>N(r,i,P)),A.writeFixes(o);function R(P,k){const W=l.getIndexInfoOfType(P,k);W&&N(r,i,l.indexInfoToIndexSignatureDeclaration(W,i,void 0,void 0,pC(e)))}function N(P,k,W){E?o.insertNodeAfter(P,E,W):o.insertMemberAtStart(P,k,W)}}function BZe(e,t){const r=lh(e);if(!r)return da();const i=t.getTypeAtLocation(r),o=t.getPropertiesOfType(i);return da(o.filter(cNe))}var uNe="import",pNe="fixMissingImport",fNe=[f.Cannot_find_name_0.code,f.Cannot_find_name_0_Did_you_mean_1.code,f.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,f.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,f.Cannot_find_namespace_0.code,f._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code,f._0_only_refers_to_a_type_but_is_being_used_as_a_value_here.code,f.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer.code,f._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code,f.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery.code,f.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_1_or_later.code,f.Cannot_find_name_0_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_include_dom.code,f.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha_and_then_add_jest_or_mocha_to_the_types_field_in_your_tsconfig.code,f.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code,f.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_jQuery_Try_npm_i_save_dev_types_Slashjquery_and_then_add_jquery_to_the_types_field_in_your_tsconfig.code,f.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_a_test_runner_Try_npm_i_save_dev_types_Slashjest_or_npm_i_save_dev_types_Slashmocha.code,f.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode.code,f.Cannot_find_name_0_Do_you_need_to_install_type_definitions_for_node_Try_npm_i_save_dev_types_Slashnode_and_then_add_node_to_the_types_field_in_your_tsconfig.code,f.Cannot_find_namespace_0_Did_you_mean_1.code,f.Cannot_extend_an_interface_0_Did_you_mean_implements.code,f.This_JSX_tag_requires_0_to_be_in_scope_but_it_could_not_be_found.code];Sa({errorCodes:fNe,getCodeActions(e){const{errorCode:t,preferences:r,sourceFile:i,span:o,program:s}=e,l=vNe(e,t,o.start,!0);if(l)return l.map(({fix:u,symbolName:d,errorIdentifierText:_})=>zue(e,i,d,u,d!==_,s,r))},fixIds:[pNe],getAllCodeActions:e=>{const{sourceFile:t,program:r,preferences:i,host:o,cancellationToken:s}=e,l=mNe(t,r,!0,i,o,s);return bx(e,fNe,u=>l.addImportFromDiagnostic(u,e)),vx(Rr.ChangeTracker.with(e,l.writeFixes))}});function aE(e,t,r,i,o){return mNe(e,t,!1,r,i,o)}function mNe(e,t,r,i,o,s){const l=t.getCompilerOptions(),u=[],d=[],_=new Map,h=new Set,g=new Set,E=new Map;return{addImportFromDiagnostic:N,addImportFromExportedSymbol:P,addImportForModuleSymbol:k,writeFixes:j,hasFixes:Z,addImportForUnresolvedIdentifier:R,addImportForNonExistentExport:W,removeExistingImport:O,addVerbatimImport:A};function A(q){g.add(q)}function R(q,ye,ie){const K=$Ze(q,ye,ie);!K||!K.length||G($a(K))}function N(q,ye){const ie=vNe(ye,q.code,q.start,r);!ie||!ie.length||G($a(ie))}function P(q,ye,ie){var K,pe;const de=C.checkDefined(q.parent,"Expected exported symbol to have module symbol as parent"),fe=O7(q,Ga(l)),ve=t.getTypeChecker(),xe=ve.getMergedSymbol(xd(q,ve)),X=_Ne(e,xe,fe,de,!1,t,o,i,s);if(!X){C.assert((K=i.autoImportFileExcludePatterns)==null?void 0:K.length);return}const Ce=KO(e,t);let Je=Wue(e,X,t,void 0,!!ye,Ce,o,i);if(Je){const Se=((pe=ni(ie?.name,He))==null?void 0:pe.text)??fe;let re,be;ie&&FR(ie)&&(Je.kind===3||Je.kind===2)&&Je.addAsTypeOnly===1&&(re=2),q.name!==Se&&(be=q.name),Je={...Je,...re===void 0?{}:{addAsTypeOnly:re},...be===void 0?{}:{propertyName:be}},G({fix:Je,symbolName:Se??fe})}}function k(q,ye,ie){var K,pe,de;const fe=t.getTypeChecker(),ve=fe.getAliasedSymbol(q);C.assert(ve.flags&1536,"Expected symbol to be a module");const xe=p0(t,o),X=hy.getModuleSpecifiersWithCacheInfo(ve,fe,l,e,xe,i,void 0,!0),Ce=KO(e,t);let Je=uz(ye,!0,void 0,q.flags,t.getTypeChecker(),l);Je=Je===1&&FR(ie)?2:1;const Se=vl(ie)?s1(ie)?1:2:Eu(ie)?0:Vm(ie)&&ie.name?1:2,re=[{symbol:q,moduleSymbol:ve,moduleFileName:(de=(pe=(K=ve.declarations)==null?void 0:K[0])==null?void 0:pe.getSourceFile())==null?void 0:de.fileName,exportKind:4,targetFlags:q.flags,isFromPackageJson:!1}],be=Wue(e,re,t,void 0,!!ye,Ce,o,i);let Ne;be&&Se!==2&&be.kind!==0&&be.kind!==1?Ne={...be,addAsTypeOnly:Je,importKind:Se}:Ne={kind:3,moduleSpecifierKind:be!==void 0?be.moduleSpecifierKind:X.kind,moduleSpecifier:be!==void 0?be.moduleSpecifier:$a(X.moduleSpecifiers),importKind:Se,addAsTypeOnly:Je,useRequire:Ce},G({fix:Ne,symbolName:q.name})}function W(q,ye,ie,K,pe){const de=t.getSourceFile(ye),fe=KO(e,t);if(de&&de.symbol){const{fixes:ve}=dz([{exportKind:ie,isFromPackageJson:!1,moduleFileName:ye,moduleSymbol:de.symbol,targetFlags:K}],void 0,pe,fe,t,e,o,i);ve.length&&G({fix:ve[0],symbolName:q})}else{const ve=G7(ye,99,t,o),xe=hy.getLocalModuleSpecifierBetweenFileNames(e,ye,l,p0(t,o),i),X=TK(ve,ie,t),Ce=uz(pe,!0,void 0,K,t.getTypeChecker(),l);G({fix:{kind:3,moduleSpecifierKind:"relative",moduleSpecifier:xe,importKind:X,addAsTypeOnly:Ce,useRequire:fe},symbolName:q})}}function O(q){q.kind===274&&C.assertIsDefined(q.name,"ImportClause should have a name if it's being removed"),h.add(q)}function G(q){var ye,ie,K;const{fix:pe,symbolName:de}=q;switch(pe.kind){case 0:u.push(pe);break;case 1:d.push(pe);break;case 2:{const{importClauseOrBindingPattern:X,importKind:Ce,addAsTypeOnly:Je,propertyName:Se}=pe;let re=_.get(X);if(re||_.set(X,re={importClauseOrBindingPattern:X,defaultImport:void 0,namedImports:new Map}),Ce===0){const be=(ye=re?.namedImports.get(de))==null?void 0:ye.addAsTypeOnly;re.namedImports.set(de,{addAsTypeOnly:fe(be,Je),propertyName:Se})}else C.assert(re.defaultImport===void 0||re.defaultImport.name===de,"(Add to Existing) Default import should be missing or match symbolName"),re.defaultImport={name:de,addAsTypeOnly:fe((ie=re.defaultImport)==null?void 0:ie.addAsTypeOnly,Je)};break}case 3:{const{moduleSpecifier:X,importKind:Ce,useRequire:Je,addAsTypeOnly:Se,propertyName:re}=pe,be=ve(X,Ce,Je,Se);switch(C.assert(be.useRequire===Je,"(Add new) Tried to add an `import` and a `require` for the same module"),Ce){case 1:C.assert(be.defaultImport===void 0||be.defaultImport.name===de,"(Add new) Default import should be missing or match symbolName"),be.defaultImport={name:de,addAsTypeOnly:fe((K=be.defaultImport)==null?void 0:K.addAsTypeOnly,Se)};break;case 0:const Ne=(be.namedImports||(be.namedImports=new Map)).get(de);be.namedImports.set(de,[fe(Ne,Se),re]);break;case 3:if(l.verbatimModuleSyntax){const Be=(be.namedImports||(be.namedImports=new Map)).get(de);be.namedImports.set(de,[fe(Be,Se),re])}else C.assert(be.namespaceLikeImport===void 0||be.namespaceLikeImport.name===de,"Namespacelike import shoudl be missing or match symbolName"),be.namespaceLikeImport={importKind:Ce,name:de,addAsTypeOnly:Se};break;case 2:C.assert(be.namespaceLikeImport===void 0||be.namespaceLikeImport.name===de,"Namespacelike import shoudl be missing or match symbolName"),be.namespaceLikeImport={importKind:Ce,name:de,addAsTypeOnly:Se};break}break}case 4:break;default:C.assertNever(pe,`fix wasn't never - got kind ${pe.kind}`)}function fe(X,Ce){return Math.max(X??0,Ce)}function ve(X,Ce,Je,Se){const re=xe(X,!0),be=xe(X,!1),Ne=E.get(re),Be=E.get(be),lt={defaultImport:void 0,namedImports:void 0,namespaceLikeImport:void 0,useRequire:Je};return Ce===1&&Se===2?Ne||(E.set(re,lt),lt):Se===1&&(Ne||Be)?Ne||Be:Be||(E.set(be,lt),lt)}function xe(X,Ce){return`${Ce?1:0}|${X}`}}function j(q,ye){var ie,K;let pe;e.imports!==void 0&&e.imports.length===0&&ye!==void 0?pe=ye:pe=Gp(e,i);for(const ve of u)Bue(q,e,ve);for(const ve of d)DNe(q,e,ve,pe);let de;if(h.size){C.assert(_g(e),"Cannot remove imports from a future source file");const ve=new Set(Ui([...h],Se=>Dn(Se,vl))),xe=new Set(Ui([...h],Se=>Dn(Se,pk))),X=[...ve].filter(Se=>{var re,be,Ne;return!_.has(Se.importClause)&&(!((re=Se.importClause)!=null&&re.name)||h.has(Se.importClause))&&(!ni((be=Se.importClause)==null?void 0:be.namedBindings,Ig)||h.has(Se.importClause.namedBindings))&&(!ni((Ne=Se.importClause)==null?void 0:Ne.namedBindings,n_)||Vn(Se.importClause.namedBindings.elements,Be=>h.has(Be)))}),Ce=[...xe].filter(Se=>(Se.name.kind!==207||!_.has(Se.name))&&(Se.name.kind!==207||Vn(Se.name.elements,re=>h.has(re)))),Je=[...ve].filter(Se=>{var re,be;return((re=Se.importClause)==null?void 0:re.namedBindings)&&X.indexOf(Se)===-1&&!((be=_.get(Se.importClause))!=null&&be.namedImports)&&(Se.importClause.namedBindings.kind===275||Vn(Se.importClause.namedBindings.elements,Ne=>h.has(Ne)))});for(const Se of[...X,...Ce])q.delete(e,Se);for(const Se of Je)q.replaceNode(e,Se.importClause,L.updateImportClause(Se.importClause,Se.importClause.phaseModifier,Se.importClause.name,void 0));for(const Se of h){const re=Dn(Se,vl);re&&X.indexOf(re)===-1&&Je.indexOf(re)===-1?Se.kind===274?q.delete(e,Se.name):(C.assert(Se.kind===277,"NamespaceImport should have been handled earlier"),(ie=_.get(re.importClause))!=null&&ie.namedImports?(de??(de=new Set)).add(Se):q.delete(e,Se)):Se.kind===209?(K=_.get(Se.parent))!=null&&K.namedImports?(de??(de=new Set)).add(Se):q.delete(e,Se):Se.kind===272&&q.delete(e,Se)}}_.forEach(({importClauseOrBindingPattern:ve,defaultImport:xe,namedImports:X})=>{RNe(q,e,ve,xe,Co(X.entries(),([Ce,{addAsTypeOnly:Je,propertyName:Se}])=>({addAsTypeOnly:Je,propertyName:Se,name:Ce})),de,i)});let fe;E.forEach(({useRequire:ve,defaultImport:xe,namedImports:X,namespaceLikeImport:Ce},Je)=>{const Se=Je.slice(2),be=(ve?MNe:NNe)(Se,pe,xe,X&&Co(X.entries(),([Ne,[Be,lt]])=>({addAsTypeOnly:Be,propertyName:lt,name:Ne})),Ce,l,i);fe=XA(fe,be)}),fe=XA(fe,J()),fe&&Qq(q,e,fe,!0,i)}function J(){if(!g.size)return;const q=new Set(Ui([...g],ie=>Dn(ie,vl))),ye=new Set(Ui([...g],ie=>Dn(ie,fk)));return[...Ui([...g],ie=>ie.kind===272?_s(ie,!0):void 0),...[...q].map(ie=>{var K;return g.has(ie)?_s(ie,!0):_s(L.updateImportDeclaration(ie,ie.modifiers,ie.importClause&&L.updateImportClause(ie.importClause,ie.importClause.phaseModifier,g.has(ie.importClause)?ie.importClause.name:void 0,g.has(ie.importClause.namedBindings)?ie.importClause.namedBindings:(K=ni(ie.importClause.namedBindings,n_))!=null&&K.elements.some(pe=>g.has(pe))?L.updateNamedImports(ie.importClause.namedBindings,ie.importClause.namedBindings.elements.filter(pe=>g.has(pe))):void 0),ie.moduleSpecifier,ie.attributes),!0)}),...[...ye].map(ie=>g.has(ie)?_s(ie,!0):_s(L.updateVariableStatement(ie,ie.modifiers,L.updateVariableDeclarationList(ie.declarationList,Ui(ie.declarationList.declarations,K=>g.has(K)?K:L.updateVariableDeclaration(K,K.name.kind===207?L.updateObjectBindingPattern(K.name,K.name.elements.filter(pe=>g.has(pe))):K.name,K.exclamationToken,K.type,K.initializer)))),!0))]}function Z(){return u.length>0||d.length>0||_.size>0||E.size>0||g.size>0||h.size>0}}function GZe(e,t,r,i){const o=aC(e,i,r),s=gNe(e,t);return{getModuleSpecifierForBestExportInfo:l};function l(u,d,_,h){const{fixes:g,computedWithoutCacheCount:E}=dz(u,d,_,!1,t,e,r,i,s,h),A=TNe(g,e,t,o,r,i);return A&&{...A,computedWithoutCacheCount:E}}}function VZe(e,t,r,i,o,s,l,u,d,_,h,g){let E;r?(E=wO(i,l,u,h,g).get(i.path,r),C.assertIsDefined(E,"Some exportInfo should match the specified exportMapKey")):(E=x9(_m(t.name))?[UZe(e,o,t,u,l)]:_Ne(i,e,o,t,s,u,l,h,g),C.assertIsDefined(E,"Some exportInfo should match the specified symbol / moduleSymbol"));const A=KO(i,u),R=HT(Fi(i,_)),N=C.checkDefined(Wue(i,E,u,_,R,A,l,h));return{moduleSpecifier:N.moduleSpecifier,codeAction:hNe(zue({host:l,formatContext:d,preferences:h},i,o,N,!1,u,h))}}function jZe(e,t,r,i,o,s){const l=r.getCompilerOptions(),u=BB(Fue(e,r.getTypeChecker(),t,l)),d=INe(e,t,u,r),_=u!==t.text;return d&&hNe(zue({host:i,formatContext:o,preferences:s},e,u,d,_,r,s))}function Wue(e,t,r,i,o,s,l,u){const d=aC(e,u,l);return TNe(dz(t,i,o,s,r,e,l,u).fixes,e,r,d,l,u)}function hNe({description:e,changes:t,commands:r}){return{description:e,changes:t,commands:r}}function _Ne(e,t,r,i,o,s,l,u,d){const _=yNe(s,l),h=u.autoImportFileExcludePatterns&&Ece(l,u),g=s.getTypeChecker().getMergedSymbol(i),E=h&&g.declarations&&al(g,308),A=E&&h(E);return wO(e,l,s,u,d).search(e.path,o,R=>R===r,R=>{const N=_(R[0].isFromPackageJson);if(N.getMergedSymbol(xd(R[0].symbol,N))===t&&(A||R.some(P=>N.getMergedSymbol(P.moduleSymbol)===i||P.symbol.parent===i)))return R})}function UZe(e,t,r,i,o){var s,l;const u=_(i.getTypeChecker(),!1);if(u)return u;const d=(l=(s=o.getPackageJsonAutoImportProvider)==null?void 0:s.call(o))==null?void 0:l.getTypeChecker();return C.checkDefined(d&&_(d,!0),"Could not find symbol in specified module for code actions");function _(h,g){const E=V7(r,h);if(E&&xd(E.symbol,h)===e)return{symbol:E.symbol,moduleSymbol:r,moduleFileName:void 0,exportKind:E.exportKind,targetFlags:xd(e,h).flags,isFromPackageJson:g};const A=h.tryGetMemberInModuleExportsAndProperties(t,r);if(A&&xd(A,h)===e)return{symbol:A,moduleSymbol:r,moduleFileName:void 0,exportKind:0,targetFlags:xd(e,h).flags,isFromPackageJson:g}}}function dz(e,t,r,i,o,s,l,u,d=_g(s)?gNe(s,o):void 0,_){const h=o.getTypeChecker(),g=d?Ki(e,d.getImportsForExportInfo):ae,E=t!==void 0&&HZe(g,t),A=JZe(g,r,h,o.getCompilerOptions());if(A)return{computedWithoutCacheCount:0,fixes:[...E?[E]:ae,A]};const{fixes:R,computedWithoutCacheCount:N=0}=XZe(e,g,o,s,t,r,i,l,u,_);return{computedWithoutCacheCount:N,fixes:[...E?[E]:ae,...R]}}function HZe(e,t){return Hn(e,({declaration:r,importKind:i})=>{var o;if(i!==0)return;const s=qZe(r),l=s&&((o=gI(r))==null?void 0:o.text);if(l)return{kind:0,namespacePrefix:s,usagePosition:t,moduleSpecifierKind:void 0,moduleSpecifier:l}})}function qZe(e){var t,r,i;switch(e.kind){case 261:return(t=ni(e.name,He))==null?void 0:t.text;case 272:return e.name.text;case 352:case 273:return(i=ni((r=e.importClause)==null?void 0:r.namedBindings,Ig))==null?void 0:i.name.text;default:return C.assertNever(e)}}function uz(e,t,r,i,o,s){return e?r&&s.verbatimModuleSyntax&&(!(i&111551)||o.getTypeOnlyAliasDeclaration(r))?2:1:4}function JZe(e,t,r,i){let o;for(const l of e){const u=s(l);if(!u)continue;const d=FR(u.importClauseOrBindingPattern);if(u.addAsTypeOnly!==4&&d||u.addAsTypeOnly===4&&!d)return u;o??(o=u)}return o;function s({declaration:l,importKind:u,symbol:d,targetFlags:_}){if(u===3||u===2||l.kind===272)return;if(l.kind===261)return(u===0||u===1)&&l.name.kind===207?{kind:2,importClauseOrBindingPattern:l.name,importKind:u,moduleSpecifierKind:void 0,moduleSpecifier:l.initializer.arguments[0].text,addAsTypeOnly:4}:void 0;const{importClause:h}=l;if(!h||!ds(l.moduleSpecifier))return;const{name:g,namedBindings:E}=h;if(h.isTypeOnly&&!(u===0&&E))return;const A=uz(t,!1,d,_,r,i);if(!(u===1&&(g||A===2&&E))&&!(u===0&&E?.kind===275))return{kind:2,importClauseOrBindingPattern:h,importKind:u,moduleSpecifierKind:void 0,moduleSpecifier:l.moduleSpecifier.text,addAsTypeOnly:A}}}function gNe(e,t){const r=t.getTypeChecker();let i;for(const o of e.imports){const s=eM(o);if(pk(s.parent)){const l=r.resolveExternalModuleName(o);l&&(i||(i=cm())).add(Ta(l),s.parent)}else if(s.kind===273||s.kind===272||s.kind===352){const l=r.getSymbolAtLocation(o);l&&(i||(i=cm())).add(Ta(l),s)}}return{getImportsForExportInfo:({moduleSymbol:o,exportKind:s,targetFlags:l,symbol:u})=>{const d=i?.get(Ta(o));if(!d||Pu(e)&&!(l&111551)&&!Vn(d,o_))return ae;const _=TK(e,s,t);return d.map(h=>({declaration:h,importKind:_,symbol:u,targetFlags:l}))}}}function KO(e,t){if(!Tg(e.fileName))return!1;if(e.commonJsModuleIndicator&&!e.externalModuleIndicator)return!0;if(e.externalModuleIndicator&&!e.commonJsModuleIndicator)return!1;const r=t.getCompilerOptions();if(r.configFile)return bu(r)<5;if(Vue(e,t)===1)return!0;if(Vue(e,t)===99)return!1;for(const i of t.getSourceFiles())if(!(i===e||!Pu(i)||t.isSourceFileFromExternalLibrary(i))){if(i.commonJsModuleIndicator&&!i.externalModuleIndicator)return!0;if(i.externalModuleIndicator&&!i.commonJsModuleIndicator)return!1}return!0}function yNe(e,t){return Fh(r=>r?t.getPackageJsonAutoImportProvider().getTypeChecker():e.getTypeChecker())}function KZe(e,t,r,i,o,s,l,u,d){const _=Tg(t.fileName),h=e.getCompilerOptions(),g=p0(e,l),E=yNe(e,l),A=iu(h),R=S7(A),N=d?W=>hy.tryGetModuleSpecifiersFromCache(W.moduleSymbol,t,g,u):(W,O)=>hy.getModuleSpecifiersWithCacheInfo(W.moduleSymbol,O,h,t,g,u,void 0,!0);let P=0;const k=Ki(s,(W,O)=>{const G=E(W.isFromPackageJson),{computedWithoutCache:j,moduleSpecifiers:J,kind:Z}=N(W,G)??{},q=!!(W.targetFlags&111551),ye=uz(i,!0,W.symbol,W.targetFlags,G,h);return P+=j?1:0,Ui(J,ie=>{if(R&&Wb(ie))return;if(!q&&_&&r!==void 0)return{kind:1,moduleSpecifierKind:Z,moduleSpecifier:ie,usagePosition:r,exportInfo:W,isReExport:O>0};const K=TK(t,W.exportKind,e);let pe;if(r!==void 0&&K===3&&W.exportKind===0){const de=G.resolveExternalModuleSymbol(W.moduleSymbol);let fe;de!==W.moduleSymbol&&(fe=j7(de,G,Ga(h),Vs)),fe||(fe=PO(W.moduleSymbol,Ga(h),!1)),pe={namespacePrefix:fe,usagePosition:r}}return{kind:3,moduleSpecifierKind:Z,moduleSpecifier:ie,importKind:K,useRequire:o,addAsTypeOnly:ye,exportInfo:W,isReExport:O>0,qualification:pe}})});return{computedWithoutCacheCount:P,fixes:k}}function XZe(e,t,r,i,o,s,l,u,d,_){const h=Hn(t,g=>YZe(g,s,l,r.getTypeChecker(),r.getCompilerOptions()));return h?{fixes:[h]}:KZe(r,i,o,s,l,e,u,d,_)}function YZe({declaration:e,importKind:t,symbol:r,targetFlags:i},o,s,l,u){var d;const _=(d=gI(e))==null?void 0:d.text;if(_){const h=s?4:uz(o,!0,r,i,l,u);return{kind:3,moduleSpecifierKind:void 0,moduleSpecifier:_,importKind:t,addAsTypeOnly:h,useRequire:s}}}function vNe(e,t,r,i){const o=Fi(e.sourceFile,r);let s;if(t===f._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code)s=tet(e,o);else if(He(o))if(t===f._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type.code){const u=BB(Fue(e.sourceFile,e.program.getTypeChecker(),o,e.program.getCompilerOptions())),d=INe(e.sourceFile,o,u,e.program);return d&&[{fix:d,symbolName:u,errorIdentifierText:o.text}]}else s=ANe(e,o,i);else return;const l=aC(e.sourceFile,e.preferences,e.host);return s&&bNe(s,e.sourceFile,e.program,l,e.host,e.preferences)}function bNe(e,t,r,i,o,s){const l=u=>ks(u,o.getCurrentDirectory(),ay(o));return xp(e,(u,d)=>NT(!!u.isJsxNamespaceFix,!!d.isJsxNamespaceFix)||js(u.fix.kind,d.fix.kind)||SNe(u.fix,d.fix,t,r,s,i.allowsImportingSpecifier,l))}function $Ze(e,t,r){const i=ANe(e,t,r),o=aC(e.sourceFile,e.preferences,e.host);return i&&bNe(i,e.sourceFile,e.program,o,e.host,e.preferences)}function TNe(e,t,r,i,o,s){if(yt(e))return e[0].kind===0||e[0].kind===2?e[0]:e.reduce((l,u)=>SNe(u,l,t,r,s,i.allowsImportingSpecifier,d=>ks(d,o.getCurrentDirectory(),ay(o)))===-1?u:l)}function SNe(e,t,r,i,o,s,l){return e.kind!==0&&t.kind!==0?NT(t.moduleSpecifierKind!=="node_modules"||s(t.moduleSpecifier),e.moduleSpecifierKind!=="node_modules"||s(e.moduleSpecifier))||QZe(e,t,o)||eet(e.moduleSpecifier,t.moduleSpecifier,r,i)||NT(ENe(e,r.path,l),ENe(t,r.path,l))||Qk(e.moduleSpecifier,t.moduleSpecifier):0}function QZe(e,t,r){return r.importModuleSpecifierPreference==="non-relative"||r.importModuleSpecifierPreference==="project-relative"?NT(e.moduleSpecifierKind==="relative",t.moduleSpecifierKind==="relative"):0}function ENe(e,t,r){var i;if(e.isReExport&&((i=e.exportInfo)!=null&&i.moduleFileName)&&ZZe(e.exportInfo.moduleFileName)){const o=r(ci(e.exportInfo.moduleFileName));return po(t,o)}return!1}function ZZe(e){return Ic(e,[".js",".jsx",".d.ts",".ts",".tsx"],!0)==="index"}function eet(e,t,r,i){return po(e,"node:")&&!po(t,"node:")?F7(r,i)?-1:1:po(t,"node:")&&!po(e,"node:")?F7(r,i)?1:-1:0}function tet({sourceFile:e,program:t,host:r,preferences:i},o){const s=t.getTypeChecker(),l=net(o,s);if(!l)return;const u=s.getAliasedSymbol(l),d=l.name,_=[{symbol:l,moduleSymbol:u,moduleFileName:void 0,exportKind:3,targetFlags:u.flags,isFromPackageJson:!1}],h=KO(e,t);return dz(_,void 0,!1,h,t,e,r,i).fixes.map(E=>{var A;return{fix:E,symbolName:d,errorIdentifierText:(A=ni(o,He))==null?void 0:A.text}})}function net(e,t){const r=He(e)?t.getSymbolAtLocation(e):void 0;if(N6(r))return r;const{parent:i}=e;if(ru(i)&&i.tagName===e||jm(i)){const o=t.resolveName(t.getJsxNamespace(i),ru(i)?e:i,111551,!1);if(N6(o))return o}}function TK(e,t,r,i){if(r.getCompilerOptions().verbatimModuleSyntax&&det(e,r)===1)return 3;switch(t){case 0:return 0;case 1:return 1;case 2:return aet(e,r.getCompilerOptions(),!!i);case 3:return ret(e,r,!!i);case 4:return 2;default:return C.assertNever(t)}}function ret(e,t,r){if(PI(t.getCompilerOptions()))return 1;const i=bu(t.getCompilerOptions());switch(i){case 2:case 1:case 3:return Tg(e.fileName)&&(e.externalModuleIndicator||r)?2:3;case 4:case 5:case 6:case 7:case 99:case 0:case 200:return 2;case 100:case 101:case 102:case 199:return Vue(e,t)===99?2:3;default:return C.assertNever(i,`Unexpected moduleKind ${i}`)}}function ANe({sourceFile:e,program:t,cancellationToken:r,host:i,preferences:o},s,l){const u=t.getTypeChecker(),d=t.getCompilerOptions();return Ki(Fue(e,u,s,d),_=>{if(_==="default")return;const h=HT(s),g=KO(e,t),E=oet(_,$R(s),W1(s),r,e,t,l,i,o);return Co(lf(E.values(),A=>dz(A,s.getStart(e),h,g,t,e,i,o).fixes),A=>({fix:A,symbolName:_,errorIdentifierText:s.text,isJsxNamespaceFix:_!==s.text}))})}function INe(e,t,r,i){const o=i.getTypeChecker(),s=o.resolveName(r,t,111551,!0);if(!s)return;const l=o.getTypeOnlyAliasDeclaration(s);if(!(!l||Wn(l)!==e))return{kind:4,typeOnlyAliasDeclaration:l}}function Fue(e,t,r,i){const o=r.parent;if((ru(o)||VS(o))&&o.tagName===r&&bJ(i.jsx)){const s=t.getJsxNamespace(e);if(iet(s,r,t))return!oD(r.text)&&!t.resolveName(r.text,r,111551,!1)?[r.text,s]:[s]}return[r.text]}function iet(e,t,r){if(oD(t.text))return!0;const i=r.resolveName(e,t,111551,!0);return!i||yt(i.declarations,Qy)&&!(i.flags&111551)}function oet(e,t,r,i,o,s,l,u,d){var _;const h=cm(),g=aC(o,d,u),E=(_=u.getModuleSpecifierCache)==null?void 0:_.call(u),A=Fh(N=>p0(N?u.getPackageJsonAutoImportProvider():s,u));function R(N,P,k,W,O,G){const j=A(G);if(EJ(O,o,P,N,d,g,j,E)){const J=O.getTypeChecker();h.add(cce(k,J).toString(),{symbol:k,moduleSymbol:N,moduleFileName:P?.fileName,exportKind:W,targetFlags:xd(k,J).flags,isFromPackageJson:G})}}return AJ(s,u,d,l,(N,P,k,W)=>{const O=k.getTypeChecker();i.throwIfCancellationRequested();const G=k.getCompilerOptions(),j=V7(N,O);j&&LNe(O.getSymbolFlags(j.symbol),r)&&j7(j.symbol,O,Ga(G),(Z,q)=>(t?q??Z:Z)===e)&&R(N,P,j.symbol,j.exportKind,k,W);const J=O.tryGetMemberInModuleExportsAndProperties(e,N);J&&LNe(O.getSymbolFlags(J),r)&&R(N,P,J,0,k,W)}),h}function aet(e,t,r){const i=PI(t),o=Tg(e.fileName);if(!o&&bu(t)>=5)return i?1:2;if(o)return e.externalModuleIndicator||r?i?1:2:3;for(const s of e.statements??ae)if(Fc(s)&&!Ol(s.moduleReference))return 3;return i?1:3}function zue(e,t,r,i,o,s,l){let u;const d=Rr.ChangeTracker.with(e,_=>{u=set(_,t,r,i,o,s,l)});return oa(uNe,d,u,pNe,f.Add_all_missing_imports)}function set(e,t,r,i,o,s,l){const u=Gp(t,l);switch(i.kind){case 0:return Bue(e,t,i),[f.Change_0_to_1,r,`${i.namespacePrefix}.${r}`];case 1:return DNe(e,t,i,u),[f.Change_0_to_1,r,CNe(i.moduleSpecifier,u)+r];case 2:{const{importClauseOrBindingPattern:d,importKind:_,addAsTypeOnly:h,moduleSpecifier:g}=i;RNe(e,t,d,_===1?{name:r,addAsTypeOnly:h}:void 0,_===0?[{name:r,addAsTypeOnly:h}]:ae,void 0,l);const E=_m(g);return o?[f.Import_0_from_1,r,E]:[f.Update_import_from_0,E]}case 3:{const{importKind:d,moduleSpecifier:_,addAsTypeOnly:h,useRequire:g,qualification:E}=i,A=g?MNe:NNe,R=d===1?{name:r,addAsTypeOnly:h}:void 0,N=d===0?[{name:r,addAsTypeOnly:h}]:void 0,P=d===2||d===3?{importKind:d,name:E?.namespacePrefix||r,addAsTypeOnly:h}:void 0;return Qq(e,t,A(_,u,R,N,P,s.getCompilerOptions(),l),!0,l),E&&Bue(e,t,E),o?[f.Import_0_from_1,r,_]:[f.Add_import_from_0,_]}case 4:{const{typeOnlyAliasDeclaration:d}=i,_=cet(e,d,s,t,l);return _.kind===277?[f.Remove_type_from_import_of_0_from_1,r,xNe(_.parent.parent)]:[f.Remove_type_from_import_declaration_from_0,xNe(_)]}default:return C.assertNever(i,`Unexpected fix kind ${i.kind}`)}}function xNe(e){var t,r;return e.kind===272?((r=ni((t=ni(e.moduleReference,uy))==null?void 0:t.expression,ds))==null?void 0:r.text)||e.moduleReference.getText():ma(e.parent.moduleSpecifier,ka).text}function cet(e,t,r,i,o){const s=r.getCompilerOptions(),l=s.verbatimModuleSyntax;switch(t.kind){case 277:if(t.isTypeOnly){if(t.parent.elements.length>1){const d=L.updateImportSpecifier(t,!1,t.propertyName,t.name),{specifierComparer:_}=v0.getNamedImportSpecifierComparerWithDetection(t.parent.parent.parent,o,i),h=v0.getImportSpecifierInsertionIndex(t.parent.elements,d,_);if(h!==t.parent.elements.indexOf(t))return e.delete(i,t),e.insertImportSpecifierAtIndex(i,d,t.parent,h),t}return e.deleteRange(i,{pos:gb(t.getFirstToken()),end:gb(t.propertyName??t.name)}),t}else return C.assert(t.parent.parent.isTypeOnly),u(t.parent.parent),t.parent.parent;case 274:return u(t),t;case 275:return u(t.parent),t.parent;case 272:return e.deleteRange(i,t.getChildAt(1)),t;default:C.failBadSyntaxKind(t)}function u(d){var _;if(e.delete(i,Zq(d,i)),!s.allowImportingTsExtensions){const h=gI(d.parent),g=h&&((_=r.getResolvedModuleFromModuleSpecifier(h,i))==null?void 0:_.resolvedModule);if(g?.resolvedUsingTsExtension){const E=E2(h.text,Zw(h.text,s));e.replaceNode(i,h,L.createStringLiteral(E))}}if(l){const h=ni(d.namedBindings,n_);if(h&&h.elements.length>1){v0.getNamedImportSpecifierComparerWithDetection(d.parent,o,i).isSorted!==!1&&t.kind===277&&h.elements.indexOf(t)!==0&&(e.delete(i,t),e.insertImportSpecifierAtIndex(i,t,h,0));for(const E of h.elements)E!==t&&!E.isTypeOnly&&e.insertModifierBefore(i,156,E)}}}}function RNe(e,t,r,i,o,s,l){var u;if(r.kind===207){if(s&&r.elements.some(g=>s.has(g))){e.replaceNode(t,r,L.createObjectBindingPattern([...r.elements.filter(g=>!s.has(g)),...i?[L.createBindingElement(void 0,"default",i.name)]:ae,...o.map(g=>L.createBindingElement(void 0,g.propertyName,g.name))]));return}i&&h(r,i.name,"default");for(const g of o)h(r,g.name,g.propertyName);return}const d=r.isTypeOnly&&yt([i,...o],g=>g?.addAsTypeOnly===4),_=r.namedBindings&&((u=ni(r.namedBindings,n_))==null?void 0:u.elements);if(i&&(C.assert(!r.name,"Cannot add a default import to an import clause that already has one"),e.insertNodeAt(t,r.getStart(t),L.createIdentifier(i.name),{suffix:", "})),o.length){const{specifierComparer:g,isSorted:E}=v0.getNamedImportSpecifierComparerWithDetection(r.parent,l,t),A=xp(o.map(R=>L.createImportSpecifier((!r.isTypeOnly||d)&&SK(R,l),R.propertyName===void 0?void 0:L.createIdentifier(R.propertyName),L.createIdentifier(R.name))),g);if(s)e.replaceNode(t,r.namedBindings,L.updateNamedImports(r.namedBindings,xp([..._.filter(R=>!s.has(R)),...A],g)));else if(_?.length&&E!==!1){const R=d&&_?L.updateNamedImports(r.namedBindings,Zi(_,N=>L.updateImportSpecifier(N,!0,N.propertyName,N.name))).elements:_;for(const N of A){const P=v0.getImportSpecifierInsertionIndex(R,N,g);e.insertImportSpecifierAtIndex(t,N,r.namedBindings,P)}}else if(_?.length)for(const R of A)e.insertNodeInListAfter(t,Ba(_),R,_);else if(A.length){const R=L.createNamedImports(A);r.namedBindings?e.replaceNode(t,r.namedBindings,R):e.insertNodeAfter(t,C.checkDefined(r.name,"Import clause must have either named imports or a default import"),R)}}if(d&&(e.delete(t,Zq(r,t)),_))for(const g of _)e.insertModifierBefore(t,156,g);function h(g,E,A){const R=L.createBindingElement(void 0,A,E);g.elements.length?e.insertNodeInListAfter(t,Ba(g.elements),R):e.replaceNode(t,g,L.createObjectBindingPattern([R]))}}function Bue(e,t,{namespacePrefix:r,usagePosition:i}){e.insertText(t,i,r+".")}function DNe(e,t,{moduleSpecifier:r,usagePosition:i},o){e.insertText(t,i,CNe(r,o))}function CNe(e,t){const r=Yq(t);return`import(${r}${e}${r}).`}function Gue({addAsTypeOnly:e}){return e===2}function SK(e,t){return Gue(e)||!!t.preferTypeOnlyAutoImports&&e.addAsTypeOnly!==4}function NNe(e,t,r,i,o,s,l){const u=NP(e,t);let d;if(r!==void 0||i?.length){const _=(!r||Gue(r))&&Vn(i,Gue)||(s.verbatimModuleSyntax||l.preferTypeOnlyAutoImports)&&r?.addAsTypeOnly!==4&&!yt(i,h=>h.addAsTypeOnly===4);d=XA(d,Vb(r&&L.createIdentifier(r.name),i?.map(h=>L.createImportSpecifier(!_&&SK(h,l),h.propertyName===void 0?void 0:L.createIdentifier(h.propertyName),L.createIdentifier(h.name))),e,t,_))}if(o){const _=o.importKind===3?L.createImportEqualsDeclaration(void 0,SK(o,l),L.createIdentifier(o.name),L.createExternalModuleReference(u)):L.createImportDeclaration(void 0,L.createImportClause(SK(o,l)?156:void 0,void 0,L.createNamespaceImport(L.createIdentifier(o.name))),u,void 0);d=XA(d,_)}return C.checkDefined(d)}function MNe(e,t,r,i,o){const s=NP(e,t);let l;if(r||i?.length){const u=i?.map(({name:_,propertyName:h})=>L.createBindingElement(void 0,h,_))||[];r&&u.unshift(L.createBindingElement(void 0,"default",r.name));const d=PNe(L.createObjectBindingPattern(u),s);l=XA(l,d)}if(o){const u=PNe(o.name,s);l=XA(l,u)}return C.checkDefined(l)}function PNe(e,t){return L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(typeof e=="string"?L.createIdentifier(e):e,void 0,void 0,L.createCallExpression(L.createIdentifier("require"),void 0,[t]))],2))}function LNe(e,t){return t===7?!0:t&1?!!(e&111551):t&2?!!(e&788968):t&4?!!(e&1920):!1}function Vue(e,t){return _g(e)?t.getImpliedNodeFormatForEmit(e):O1(e,t.getCompilerOptions())}function det(e,t){return _g(e)?t.getEmitModuleFormatOfFile(e):TP(e,t.getCompilerOptions())}var jue="addMissingConstraint",kNe=[f.Type_0_is_not_comparable_to_type_1.code,f.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,f.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,f.Type_0_is_not_assignable_to_type_1.code,f.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties.code,f.Property_0_is_incompatible_with_index_signature.code,f.Property_0_in_type_1_is_not_assignable_to_type_2.code,f.Type_0_does_not_satisfy_the_constraint_1.code];Sa({errorCodes:kNe,getCodeActions(e){const{sourceFile:t,span:r,program:i,preferences:o,host:s}=e,l=wNe(i,t,r);if(l===void 0)return;const u=Rr.ChangeTracker.with(e,d=>ONe(d,i,o,s,t,l));return[oa(jue,u,f.Add_extends_constraint,jue,f.Add_extends_constraint_to_all_type_parameters)]},fixIds:[jue],getAllCodeActions:e=>{const{program:t,preferences:r,host:i}=e,o=new Set;return vx(Rr.ChangeTracker.with(e,s=>{bx(e,kNe,l=>{const u=wNe(t,l.file,Id(l.start,l.length));if(u&&gm(o,ls(u.declaration)))return ONe(s,t,r,i,l.file,u)})}))}});function wNe(e,t,r){const i=hn(e.getSemanticDiagnostics(t),l=>l.start===r.start&&l.length===r.length);if(i===void 0||i.relatedInformation===void 0)return;const o=hn(i.relatedInformation,l=>l.code===f.This_type_parameter_might_need_an_extends_0_constraint.code);if(o===void 0||o.file===void 0||o.start===void 0||o.length===void 0)return;let s=Wpe(o.file,Id(o.start,o.length));if(s!==void 0&&(He(s)&&sl(s.parent)&&(s=s.parent),sl(s))){if(b1(s.parent))return;const l=Fi(t,r.start),u=e.getTypeChecker();return{constraint:pet(u,l)||uet(o.messageText),declaration:s,token:l}}}function ONe(e,t,r,i,o,s){const{declaration:l,constraint:u}=s,d=t.getTypeChecker();if(Bo(u))e.insertText(o,l.name.end,` extends ${u}`);else{const _=Ga(t.getCompilerOptions()),h=pC({program:t,host:i}),g=aE(o,t,r,i),E=WK(d,g,u,void 0,_,void 0,void 0,h);E&&(e.replaceNode(o,l,L.updateTypeParameterDeclaration(l,void 0,l.name,E,l.default)),g.writeFixes(e))}}function uet(e){const[,t]=a_(e,`
430`,0).match(/`extends (.*)`/)||[];return t}function pet(e,t){return Ri(t.parent)?e.getTypeArgumentConstraint(t.parent):(St(t)?e.getContextualType(t):void 0)||e.getTypeAtLocation(t)}var WNe="fixOverrideModifier",XO="fixAddOverrideModifier",pz="fixRemoveOverrideModifier",FNe=[f.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code,f.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code,f.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code,f.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code,f.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code,f.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,f.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code,f.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code,f.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code],zNe={[f.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:f.Add_override_modifier,fixId:XO,fixAllDescriptions:f.Add_all_missing_override_modifiers},[f.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:f.Add_override_modifier,fixId:XO,fixAllDescriptions:f.Add_all_missing_override_modifiers},[f.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code]:{descriptions:f.Remove_override_modifier,fixId:pz,fixAllDescriptions:f.Remove_all_unnecessary_override_modifiers},[f.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code]:{descriptions:f.Remove_override_modifier,fixId:pz,fixAllDescriptions:f.Remove_override_modifier},[f.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code]:{descriptions:f.Add_override_modifier,fixId:XO,fixAllDescriptions:f.Add_all_missing_override_modifiers},[f.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code]:{descriptions:f.Add_override_modifier,fixId:XO,fixAllDescriptions:f.Add_all_missing_override_modifiers},[f.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code]:{descriptions:f.Add_override_modifier,fixId:XO,fixAllDescriptions:f.Remove_all_unnecessary_override_modifiers},[f.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code]:{descriptions:f.Remove_override_modifier,fixId:pz,fixAllDescriptions:f.Remove_all_unnecessary_override_modifiers},[f.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code]:{descriptions:f.Remove_override_modifier,fixId:pz,fixAllDescriptions:f.Remove_all_unnecessary_override_modifiers}};Sa({errorCodes:FNe,getCodeActions:function(t){const{errorCode:r,span:i}=t,o=zNe[r];if(!o)return ae;const{descriptions:s,fixId:l,fixAllDescriptions:u}=o,d=Rr.ChangeTracker.with(t,_=>BNe(_,t,r,i.start));return[lue(WNe,d,s,l,u)]},fixIds:[WNe,XO,pz],getAllCodeActions:e=>Ss(e,FNe,(t,r)=>{const{code:i,start:o}=r,s=zNe[i];!s||s.fixId!==e.fixId||BNe(t,e,i,o)})});function BNe(e,t,r,i){switch(r){case f.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0.code:case f.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:case f.This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0.code:case f.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0.code:case f.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0.code:return fet(e,t.sourceFile,i);case f.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0.code:case f.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0.code:case f.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class.code:case f.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class.code:return met(e,t.sourceFile,i);default:C.fail("Unexpected error code: "+r)}}function fet(e,t,r){const i=VNe(t,r);if(Pu(t)){e.addJSDocTags(t,i,[L.createJSDocOverrideTag(L.createIdentifier("override"))]);return}const o=i.modifiers||ae,s=hn(o,jI),l=hn(o,vie),u=hn(o,g=>Bq(g.kind)),d=ga(o,Wc),_=l?l.end:s?s.end:u?u.end:d?La(t.text,d.end):i.getStart(t),h=u||s||l?{prefix:" "}:{suffix:" "};e.insertModifierAt(t,_,164,h)}function met(e,t,r){const i=VNe(t,r);if(Pu(t)){e.filterJSDocTags(t,i,U8(I4));return}const o=hn(i.modifiers,bie);C.assertIsDefined(o),e.deleteModifier(t,o)}function GNe(e){switch(e.kind){case 177:case 173:case 175:case 178:case 179:return!0;case 170:return Np(e,e.parent);default:return!1}}function VNe(e,t){const r=Fi(e,t),i=Dn(r,o=>ui(o)?"quit":GNe(o));return C.assert(i&&GNe(i)),i}var Uue="fixNoPropertyAccessFromIndexSignature",jNe=[f.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0.code];Sa({errorCodes:jNe,fixIds:[Uue],getCodeActions(e){const{sourceFile:t,span:r,preferences:i}=e,o=HNe(t,r.start),s=Rr.ChangeTracker.with(e,l=>UNe(l,e.sourceFile,o,i));return[oa(Uue,s,[f.Use_element_access_for_0,o.name.text],Uue,f.Use_element_access_for_all_undeclared_properties)]},getAllCodeActions:e=>Ss(e,jNe,(t,r)=>UNe(t,r.file,HNe(r.file,r.start),e.preferences))});function UNe(e,t,r,i){const o=Gp(t,i),s=L.createStringLiteral(r.name.text,o===0);e.replaceNode(t,r,mF(r)?L.createElementAccessChain(r.expression,r.questionDotToken,s):L.createElementAccessExpression(r.expression,s))}function HNe(e,t){return ma(Fi(e,t).parent,qr)}var Hue="fixImplicitThis",qNe=[f.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];Sa({errorCodes:qNe,getCodeActions:function(t){const{sourceFile:r,program:i,span:o}=t;let s;const l=Rr.ChangeTracker.with(t,u=>{s=JNe(u,r,o.start,i.getTypeChecker())});return s?[oa(Hue,l,s,Hue,f.Fix_all_implicit_this_errors)]:ae},fixIds:[Hue],getAllCodeActions:e=>Ss(e,qNe,(t,r)=>{JNe(t,r.file,r.start,e.program.getTypeChecker())})});function JNe(e,t,r,i){const o=Fi(t,r);if(!QD(o))return;const s=vu(o,!1,!1);if(!(!Zl(s)&&!Us(s))&&!Yi(vu(s,!1,!1))){const l=C.checkDefined(Es(s,100,t)),{name:u}=s,d=C.checkDefined(s.body);return Us(s)?u&&Ys.Core.isSymbolReferencedInFile(u,i,t,d)?void 0:(e.delete(t,l),u&&e.delete(t,u),e.insertText(t,d.pos," =>"),[f.Convert_function_expression_0_to_arrow_function,u?u.text:uJ]):(e.replaceNode(t,l,L.createToken(87)),e.insertText(t,u.end," = "),e.insertText(t,d.pos," =>"),[f.Convert_function_declaration_0_to_arrow_function,u.text])}}var que="fixImportNonExportedMember",KNe=[f.Module_0_declares_1_locally_but_it_is_not_exported.code];Sa({errorCodes:KNe,fixIds:[que],getCodeActions(e){const{sourceFile:t,span:r,program:i}=e,o=XNe(t,r.start,i);if(o===void 0)return;const s=Rr.ChangeTracker.with(e,l=>het(l,i,o));return[oa(que,s,[f.Export_0_from_module_1,o.exportName.node.text,o.moduleSpecifier],que,f.Export_all_referenced_locals)]},getAllCodeActions(e){const{program:t}=e;return vx(Rr.ChangeTracker.with(e,r=>{const i=new Map;bx(e,KNe,o=>{const s=XNe(o.file,o.start,t);if(s===void 0)return;const{exportName:l,node:u,moduleSourceFile:d}=s;if(EK(d,l.isTypeOnly)===void 0&&nw(u))r.insertExportModifier(d,u);else{const _=i.get(d)||{typeOnlyExports:[],exports:[]};l.isTypeOnly?_.typeOnlyExports.push(l):_.exports.push(l),i.set(d,_)}}),i.forEach((o,s)=>{const l=EK(s,!0);l&&l.isTypeOnly?(Jue(r,t,s,o.typeOnlyExports,l),Jue(r,t,s,o.exports,EK(s,!1))):Jue(r,t,s,[...o.exports,...o.typeOnlyExports],l)})}))}});function XNe(e,t,r){var i,o;const s=Fi(e,t);if(He(s)){const l=Dn(s,vl);if(l===void 0)return;const u=ka(l.moduleSpecifier)?l.moduleSpecifier:void 0;if(u===void 0)return;const d=(i=r.getResolvedModuleFromModuleSpecifier(u,e))==null?void 0:i.resolvedModule;if(d===void 0)return;const _=r.getSourceFile(d.resolvedFileName);if(_===void 0||sC(r,_))return;const h=_.symbol,g=(o=ni(h.valueDeclaration,D_))==null?void 0:o.locals;if(g===void 0)return;const E=g.get(s.escapedText);if(E===void 0)return;const A=_et(E);return A===void 0?void 0:{exportName:{node:s,isTypeOnly:kI(A)},node:A,moduleSourceFile:_,moduleSpecifier:u.text}}}function het(e,t,{exportName:r,node:i,moduleSourceFile:o}){const s=EK(o,r.isTypeOnly);s?YNe(e,t,o,s,[r]):nw(i)?e.insertExportModifier(o,i):$Ne(e,t,o,[r])}function Jue(e,t,r,i,o){et(i)&&(o?YNe(e,t,r,o,i):$Ne(e,t,r,i))}function EK(e,t){const r=i=>pc(i)&&(t&&i.isTypeOnly||!i.isTypeOnly);return ga(e.statements,r)}function YNe(e,t,r,i,o){const s=i.exportClause&&Jf(i.exportClause)?i.exportClause.elements:L.createNodeArray([]),l=!i.isTypeOnly&&!!(ym(t.getCompilerOptions())||hn(s,u=>u.isTypeOnly));e.replaceNode(r,i,L.updateExportDeclaration(i,i.modifiers,i.isTypeOnly,L.createNamedExports(L.createNodeArray([...s,...QNe(o,l)],s.hasTrailingComma)),i.moduleSpecifier,i.attributes))}function $Ne(e,t,r,i){e.insertNodeAtEndOfScope(r,r,L.createExportDeclaration(void 0,!1,L.createNamedExports(QNe(i,ym(t.getCompilerOptions()))),void 0,void 0))}function QNe(e,t){return L.createNodeArray(Vt(e,r=>L.createExportSpecifier(t&&r.isTypeOnly,void 0,r.node)))}function _et(e){if(e.valueDeclaration===void 0)return Ac(e.declarations);const t=e.valueDeclaration,r=yi(t)?ni(t.parent.parent,ac):void 0;return r&&et(r.declarationList.declarations)===1?r:t}var Kue="fixIncorrectNamedTupleSyntax",get=[f.A_labeled_tuple_element_is_declared_as_optional_with_a_question_mark_after_the_name_and_before_the_colon_rather_than_after_the_type.code,f.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type.code];Sa({errorCodes:get,getCodeActions:function(t){const{sourceFile:r,span:i}=t,o=yet(r,i.start),s=Rr.ChangeTracker.with(t,l=>vet(l,r,o));return[oa(Kue,s,f.Move_labeled_tuple_element_modifiers_to_labels,Kue,f.Move_labeled_tuple_element_modifiers_to_labels)]},fixIds:[Kue]});function yet(e,t){const r=Fi(e,t);return Dn(r,i=>i.kind===203)}function vet(e,t,r){if(!r)return;let i=r.type,o=!1,s=!1;for(;i.kind===191||i.kind===192||i.kind===197;)i.kind===191?o=!0:i.kind===192&&(s=!0),i=i.type;const l=L.updateNamedTupleMember(r,r.dotDotDotToken||(s?L.createToken(26):void 0),r.name,r.questionToken||(o?L.createToken(58):void 0),i);l!==r&&e.replaceNode(t,r,l)}var ZNe="fixSpelling",eMe=[f.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,f.Property_0_may_not_exist_on_type_1_Did_you_mean_2.code,f.Cannot_find_name_0_Did_you_mean_1.code,f.Could_not_find_name_0_Did_you_mean_1.code,f.Cannot_find_namespace_0_Did_you_mean_1.code,f.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,f.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,f._0_has_no_exported_member_named_1_Did_you_mean_2.code,f.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,f.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,f.No_overload_matches_this_call.code,f.Type_0_is_not_assignable_to_type_1.code];Sa({errorCodes:eMe,getCodeActions(e){const{sourceFile:t,errorCode:r}=e,i=tMe(t,e.span.start,e,r);if(!i)return;const{node:o,suggestedSymbol:s}=i,l=Ga(e.host.getCompilationSettings()),u=Rr.ChangeTracker.with(e,d=>nMe(d,t,o,s,l));return[oa("spelling",u,[f.Change_spelling_to_0,wl(s)],ZNe,f.Fix_all_detected_spelling_errors)]},fixIds:[ZNe],getAllCodeActions:e=>Ss(e,eMe,(t,r)=>{const i=tMe(r.file,r.start,e,r.code),o=Ga(e.host.getCompilationSettings());i&&nMe(t,e.sourceFile,i.node,i.suggestedSymbol,o)})});function tMe(e,t,r,i){const o=Fi(e,t),s=o.parent;if((i===f.No_overload_matches_this_call.code||i===f.Type_0_is_not_assignable_to_type_1.code)&&!i_(s))return;const l=r.program.getTypeChecker();let u;if(qr(s)&&s.name===o){C.assert(dg(o),"Expected an identifier for spelling (property access)");let d=l.getTypeAtLocation(s.expression);s.flags&64&&(d=l.getNonNullableType(d)),u=l.getSuggestedSymbolForNonexistentProperty(o,d)}else if(Nr(s)&&s.operatorToken.kind===103&&s.left===o&&eo(o)){const d=l.getTypeAtLocation(s.right);u=l.getSuggestedSymbolForNonexistentProperty(o,d)}else if(ku(s)&&s.right===o){const d=l.getSymbolAtLocation(s.left);d&&d.flags&1536&&(u=l.getSuggestedSymbolForNonexistentModule(s.right,d))}else if(Eu(s)&&s.name===o){C.assertNode(o,He,"Expected an identifier for spelling (import)");const d=Dn(o,vl),_=Tet(r,d,e);_&&_.symbol&&(u=l.getSuggestedSymbolForNonexistentModule(o,_.symbol))}else if(i_(s)&&s.name===o){C.assertNode(o,He,"Expected an identifier for JSX attribute");const d=Dn(o,ru),_=l.getContextualTypeForArgumentAtIndex(d,0);u=l.getSuggestedSymbolForNonexistentJSXAttribute(o,_)}else if(S6(s)&&bc(s)&&s.name===o){const d=Dn(o,ui),_=d?lh(d):void 0,h=_?l.getTypeAtLocation(_):void 0;h&&(u=l.getSuggestedSymbolForNonexistentClassMember(Al(o),h))}else{const d=W1(o),_=Al(o);C.assert(_!==void 0,"name should be defined"),u=l.getSuggestedSymbolForNonexistentSymbol(o,_,bet(d))}return u===void 0?void 0:{node:o,suggestedSymbol:u}}function nMe(e,t,r,i,o){const s=wl(i);if(!fp(s,o)&&qr(r.parent)){const l=i.valueDeclaration;l&&nd(l)&&eo(l.name)?e.replaceNode(t,r,L.createIdentifier(s)):e.replaceNode(t,r.parent,L.createElementAccessExpression(r.parent.expression,L.createStringLiteral(s)))}else e.replaceNode(t,r,L.createIdentifier(s))}function bet(e){let t=0;return e&4&&(t|=1920),e&2&&(t|=788968),e&1&&(t|=111551),t}function Tet(e,t,r){var i;if(!t||!ds(t.moduleSpecifier))return;const o=(i=e.program.getResolvedModuleFromModuleSpecifier(t.moduleSpecifier,r))==null?void 0:i.resolvedModule;if(o)return e.program.getSourceFile(o.resolvedFileName)}var Xue="returnValueCorrect",Yue="fixAddReturnStatement",$ue="fixRemoveBracesFromArrowFunctionBody",Que="fixWrapTheBlockWithParen",rMe=[f.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code,f.Type_0_is_not_assignable_to_type_1.code,f.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code];Sa({errorCodes:rMe,fixIds:[Yue,$ue,Que],getCodeActions:function(t){const{program:r,sourceFile:i,span:{start:o},errorCode:s}=t,l=oMe(r.getTypeChecker(),i,o,s);if(l)return l.kind===0?Bn([Aet(t,l.expression,l.statement)],Xs(l.declaration)?Iet(t,l.declaration,l.expression,l.commentSource):void 0):[xet(t,l.declaration,l.expression)]},getAllCodeActions:e=>Ss(e,rMe,(t,r)=>{const i=oMe(e.program.getTypeChecker(),r.file,r.start,r.code);if(i)switch(e.fixId){case Yue:aMe(t,r.file,i.expression,i.statement);break;case $ue:if(!Xs(i.declaration))return;sMe(t,r.file,i.declaration,i.expression,i.commentSource);break;case Que:if(!Xs(i.declaration))return;lMe(t,r.file,i.declaration,i.expression);break;default:C.fail(JSON.stringify(e.fixId))}})});function iMe(e,t,r){const i=e.createSymbol(4,t.escapedText);i.links.type=e.getTypeAtLocation(r);const o=da([i]);return e.createAnonymousType(void 0,o,[],[],[])}function Zue(e,t,r,i){if(!t.body||!ea(t.body)||et(t.body.statements)!==1)return;const o=$a(t.body.statements);if(od(o)&&epe(e,t,e.getTypeAtLocation(o.expression),r,i))return{declaration:t,kind:0,expression:o.expression,statement:o,commentSource:o.expression};if(Lb(o)&&od(o.statement)){const s=L.createObjectLiteralExpression([L.createPropertyAssignment(o.label,o.statement.expression)]),l=iMe(e,o.label,o.statement.expression);if(epe(e,t,l,r,i))return Xs(t)?{declaration:t,kind:1,expression:s,statement:o,commentSource:o.statement.expression}:{declaration:t,kind:0,expression:s,statement:o,commentSource:o.statement.expression}}else if(ea(o)&&et(o.statements)===1){const s=$a(o.statements);if(Lb(s)&&od(s.statement)){const l=L.createObjectLiteralExpression([L.createPropertyAssignment(s.label,s.statement.expression)]),u=iMe(e,s.label,s.statement.expression);if(epe(e,t,u,r,i))return{declaration:t,kind:0,expression:l,statement:o,commentSource:s}}}}function epe(e,t,r,i,o){if(o){const s=e.getSignatureFromDeclaration(t);if(s){di(t,1024)&&(r=e.createPromiseType(r));const l=e.createSignature(t,s.typeParameters,s.thisParameter,s.parameters,r,void 0,s.minArgumentCount,s.flags);r=e.createAnonymousType(void 0,da(),[l],[],[])}else r=e.getAnyType()}return e.isTypeAssignableTo(r,i)}function oMe(e,t,r,i){const o=Fi(t,r);if(!o.parent)return;const s=Dn(o.parent,Ms);switch(i){case f.A_function_whose_declared_type_is_neither_undefined_void_nor_any_must_return_a_value.code:return!s||!s.body||!s.type||!tp(s.type,o)?void 0:Zue(e,s,e.getTypeFromTypeNode(s.type),!1);case f.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code:if(!s||!Zo(s.parent)||!s.body)return;const l=s.parent.arguments.indexOf(s);if(l===-1)return;const u=e.getContextualTypeForArgumentAtIndex(s.parent,l);return u?Zue(e,s,u,!0):void 0;case f.Type_0_is_not_assignable_to_type_1.code:if(!L_(o)||!HN(o.parent)&&!i_(o.parent))return;const d=Eet(o.parent);return!d||!Ms(d)||!d.body?void 0:Zue(e,d,e.getTypeAtLocation(o.parent),!0)}}function Eet(e){switch(e.kind){case 261:case 170:case 209:case 173:case 304:return e.initializer;case 292:return e.initializer&&(ID(e.initializer)?e.initializer.expression:void 0);case 305:case 172:case 307:case 349:case 342:return}}function aMe(e,t,r,i){Op(r);const o=NO(t);e.replaceNode(t,i,L.createReturnStatement(r),{leadingTriviaOption:Rr.LeadingTriviaOption.Exclude,trailingTriviaOption:Rr.TrailingTriviaOption.Exclude,suffix:o?";":void 0})}function sMe(e,t,r,i,o,s){const l=D7(i)?L.createParenthesizedExpression(i):i;Op(o),z1(o,l),e.replaceNode(t,r.body,l)}function lMe(e,t,r,i){e.replaceNode(t,r.body,L.createParenthesizedExpression(i))}function Aet(e,t,r){const i=Rr.ChangeTracker.with(e,o=>aMe(o,e.sourceFile,t,r));return oa(Xue,i,f.Add_a_return_statement,Yue,f.Add_all_missing_return_statement)}function Iet(e,t,r,i){const o=Rr.ChangeTracker.with(e,s=>sMe(s,e.sourceFile,t,r,i));return oa(Xue,o,f.Remove_braces_from_arrow_function_body,$ue,f.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues)}function xet(e,t,r){const i=Rr.ChangeTracker.with(e,o=>lMe(o,e.sourceFile,t,r));return oa(Xue,i,f.Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal,Que,f.Wrap_all_object_literal_with_parentheses)}var g0="fixMissingMember",AK="fixMissingProperties",IK="fixMissingAttributes",xK="fixMissingFunctionDeclaration",cMe=[f.Property_0_does_not_exist_on_type_1.code,f.Property_0_does_not_exist_on_type_1_Did_you_mean_2.code,f.Property_0_is_missing_in_type_1_but_required_in_type_2.code,f.Type_0_is_missing_the_following_properties_from_type_1_Colon_2.code,f.Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more.code,f.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,f.Cannot_find_name_0.code,f.Type_0_does_not_satisfy_the_expected_type_1.code];Sa({errorCodes:cMe,getCodeActions(e){const t=e.program.getTypeChecker(),r=dMe(e.sourceFile,e.span.start,e.errorCode,t,e.program);if(r){if(r.kind===3){const i=Rr.ChangeTracker.with(e,o=>bMe(o,e,r));return[oa(AK,i,f.Add_missing_properties,AK,f.Add_all_missing_properties)]}if(r.kind===4){const i=Rr.ChangeTracker.with(e,o=>vMe(o,e,r));return[oa(IK,i,f.Add_missing_attributes,IK,f.Add_all_missing_attributes)]}if(r.kind===2||r.kind===5){const i=Rr.ChangeTracker.with(e,o=>yMe(o,e,r));return[oa(xK,i,[f.Add_missing_function_declaration_0,r.token.text],xK,f.Add_all_missing_function_declarations)]}if(r.kind===1){const i=Rr.ChangeTracker.with(e,o=>gMe(o,e.program.getTypeChecker(),r));return[oa(g0,i,[f.Add_missing_enum_member_0,r.token.text],g0,f.Add_all_missing_members)]}return so(Met(e,r),Ret(e,r))}},fixIds:[g0,xK,AK,IK],getAllCodeActions:e=>{const{program:t,fixId:r}=e,i=t.getTypeChecker(),o=new Set,s=new Map;return vx(Rr.ChangeTracker.with(e,l=>{bx(e,cMe,u=>{const d=dMe(u.file,u.start,u.code,i,e.program);if(d===void 0)return;const _=ls(d.parentDeclaration)+"#"+(d.kind===3?d.identifier||ls(d.token):d.token.text);if(gm(o,_)){if(r===xK&&(d.kind===2||d.kind===5))yMe(l,e,d);else if(r===AK&&d.kind===3)bMe(l,e,d);else if(r===IK&&d.kind===4)vMe(l,e,d);else if(d.kind===1&&gMe(l,i,d),d.kind===0){const{parentDeclaration:h,token:g}=d,E=KA(s,h,()=>[]);E.some(A=>A.token.text===g.text)||E.push(d)}}}),s.forEach((u,d)=>{const _=wu(d)?void 0:Oet(d,i);for(const h of u){if(_?.some(k=>{const W=s.get(k);return!!W&&W.some(({token:O})=>O.text===h.token.text)}))continue;const{parentDeclaration:g,declSourceFile:E,modifierFlags:A,token:R,call:N,isJSFile:P}=h;if(N&&!eo(R))_Me(e,l,N,R,A&256,g,E);else if(P&&!gd(g)&&!wu(g))uMe(l,E,g,R,!!(A&256));else{const k=fMe(i,g,R);mMe(l,E,g,R.text,k,A&256)}}})}))}});function dMe(e,t,r,i,o){var s,l;const u=Fi(e,t),d=u.parent;if(r===f.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code){if(!(u.kind===19&&Wa(d)&&Zo(d.parent)))return;const R=ho(d.parent.arguments,W=>W===d);if(R<0)return;const N=i.getResolvedSignature(d.parent);if(!(N&&N.declaration&&N.parameters[R]))return;const P=N.parameters[R].valueDeclaration;if(!(P&&to(P)&&He(P.name)))return;const k=Co(i.getUnmatchedProperties(i.getTypeAtLocation(d),i.getParameterType(N,R).getNonNullableType(),!1,!1));return et(k)?{kind:3,token:P.name,identifier:P.name.text,properties:k,parentDeclaration:d}:void 0}if(u.kind===19||ED(d)||tf(d)){const R=(ED(d)||tf(d))&&d.expression?d.expression:d;if(Wa(R)){const N=ED(d)?i.getTypeFromTypeNode(d.type):i.getContextualType(R)||i.getTypeAtLocation(R),P=Co(i.getUnmatchedProperties(i.getTypeAtLocation(d),N.getNonNullableType(),!1,!1));return et(P)?{kind:3,token:d,identifier:void 0,properties:P,parentDeclaration:R,indentation:tf(R.parent)||_w(R.parent)?0:void 0}:void 0}}if(!dg(u))return;if(He(u)&&Zy(d)&&d.initializer&&Wa(d.initializer)){const R=(s=i.getContextualType(u)||i.getTypeAtLocation(u))==null?void 0:s.getNonNullableType(),N=Co(i.getUnmatchedProperties(i.getTypeAtLocation(d.initializer),R,!1,!1));return et(N)?{kind:3,token:u,identifier:u.text,properties:N,parentDeclaration:d.initializer}:void 0}if(He(u)&&ru(u.parent)){const R=Ga(o.getCompilerOptions()),N=Let(i,R,u.parent);return et(N)?{kind:4,token:u,attributes:N,parentDeclaration:u.parent}:void 0}if(He(u)){const R=(l=i.getContextualType(u))==null?void 0:l.getNonNullableType();if(R&&Hr(R)&16){const N=Ac(i.getSignaturesOfType(R,0));return N===void 0?void 0:{kind:5,token:u,signature:N,sourceFile:e,parentDeclaration:TMe(u)}}if(Zo(d)&&d.expression===u)return{kind:2,token:u,call:d,sourceFile:e,modifierFlags:0,parentDeclaration:TMe(u)}}if(!qr(d))return;const _=qq(i.getTypeAtLocation(d.expression)),h=_.symbol;if(!h||!h.declarations)return;if(He(u)&&Zo(d.parent)){const R=hn(h.declarations,uc),N=R?.getSourceFile();if(R&&N&&!sC(o,N))return{kind:2,token:u,call:d.parent,sourceFile:N,modifierFlags:32,parentDeclaration:R};const P=hn(h.declarations,Yi);if(e.commonJsModuleIndicator)return;if(P&&!sC(o,P))return{kind:2,token:u,call:d.parent,sourceFile:P,modifierFlags:32,parentDeclaration:P}}const g=hn(h.declarations,ui);if(!g&&eo(u))return;const E=g||hn(h.declarations,R=>gd(R)||wu(R));if(E&&!sC(o,E.getSourceFile())){const R=!wu(E)&&(_.target||_)!==i.getDeclaredTypeOfSymbol(h);if(R&&(eo(u)||gd(E)))return;const N=E.getSourceFile(),P=wu(E)?0:(R?256:0)|(vJ(u.text)?2:0),k=Pu(N),W=ni(d.parent,Zo);return{kind:0,token:u,call:W,modifierFlags:P,parentDeclaration:E,declSourceFile:N,isJSFile:k}}const A=hn(h.declarations,ZT);if(A&&!(_.flags&1056)&&!eo(u)&&!sC(o,A.getSourceFile()))return{kind:1,token:u,parentDeclaration:A}}function Ret(e,t){return t.isJSFile?eI(Det(e,t)):Cet(e,t)}function Det(e,{parentDeclaration:t,declSourceFile:r,modifierFlags:i,token:o}){if(gd(t)||wu(t))return;const s=Rr.ChangeTracker.with(e,u=>uMe(u,r,t,o,!!(i&256)));if(s.length===0)return;const l=i&256?f.Initialize_static_property_0:eo(o)?f.Declare_a_private_field_named_0:f.Initialize_property_0_in_the_constructor;return oa(g0,s,[l,o.text],g0,f.Add_all_missing_members)}function uMe(e,t,r,i,o){const s=i.text;if(o){if(r.kind===232)return;const l=r.name.getText(),u=pMe(L.createIdentifier(l),s);e.insertNodeAfter(t,r,u)}else if(eo(i)){const l=L.createPropertyDeclaration(void 0,s,void 0,void 0,void 0),u=hMe(r);u?e.insertNodeAfter(t,u,l):e.insertMemberAtStart(t,r,l)}else{const l=yg(r);if(!l)return;const u=pMe(L.createThis(),s);e.insertNodeAtConstructorEnd(t,l,u)}}function pMe(e,t){return L.createExpressionStatement(L.createAssignment(L.createPropertyAccessExpression(e,t),Sx()))}function Cet(e,{parentDeclaration:t,declSourceFile:r,modifierFlags:i,token:o}){const s=o.text,l=i&256,u=fMe(e.program.getTypeChecker(),t,o),d=h=>Rr.ChangeTracker.with(e,g=>mMe(g,r,t,s,u,h)),_=[oa(g0,d(i&256),[l?f.Declare_static_property_0:f.Declare_property_0,s],g0,f.Add_all_missing_members)];return l||eo(o)||(i&2&&_.unshift(yh(g0,d(2),[f.Declare_private_property_0,s])),_.push(Net(e,r,t,o.text,u))),_}function fMe(e,t,r){let i;if(r.parent.parent.kind===227){const o=r.parent.parent,s=r.parent===o.left?o.right:o.left,l=e.getWidenedType(e.getBaseTypeOfLiteralType(e.getTypeAtLocation(s)));i=e.typeToTypeNode(l,t,1,8)}else{const o=e.getContextualType(r.parent);i=o?e.typeToTypeNode(o,void 0,1,8):void 0}return i||L.createKeywordTypeNode(133)}function mMe(e,t,r,i,o,s){const l=s?L.createNodeArray(L.createModifiersFromModifierFlags(s)):void 0,u=ui(r)?L.createPropertyDeclaration(l,i,void 0,o,void 0):L.createPropertySignature(void 0,i,void 0,o),d=hMe(r);d?e.insertNodeAfter(t,d,u):e.insertMemberAtStart(t,r,u)}function hMe(e){let t;for(const r of e.members){if(!Po(r))break;t=r}return t}function Net(e,t,r,i,o){const s=L.createKeywordTypeNode(154),l=L.createParameterDeclaration(void 0,void 0,"x",void 0,s,void 0),u=L.createIndexSignature(void 0,[l],o),d=Rr.ChangeTracker.with(e,_=>_.insertMemberAtStart(t,r,u));return yh(g0,d,[f.Add_index_signature_for_property_0,i])}function Met(e,t){const{parentDeclaration:r,declSourceFile:i,modifierFlags:o,token:s,call:l}=t;if(l===void 0)return;const u=s.text,d=h=>Rr.ChangeTracker.with(e,g=>_Me(e,g,l,s,h,r,i)),_=[oa(g0,d(o&256),[o&256?f.Declare_static_method_0:f.Declare_method_0,u],g0,f.Add_all_missing_members)];return o&2&&_.unshift(yh(g0,d(2),[f.Declare_private_method_0,u])),_}function _Me(e,t,r,i,o,s,l){const u=aE(l,e.program,e.preferences,e.host),d=ui(s)?175:174,_=Npe(d,e,u,r,i,o,s),h=ket(s,r);h?t.insertNodeAfter(l,h,_):t.insertMemberAtStart(l,s,_),u.writeFixes(t)}function gMe(e,t,{token:r,parentDeclaration:i}){const o=yt(i.members,d=>{const _=t.getTypeAtLocation(d);return!!(_&&_.flags&402653316)}),s=i.getSourceFile(),l=L.createEnumMember(r,o?L.createStringLiteral(r.text):void 0),u=Zs(i.members);u?e.insertNodeInListAfter(s,u,l,i.members):e.insertMemberAtStart(s,i,l)}function yMe(e,t,r){const i=Gp(t.sourceFile,t.preferences),o=aE(t.sourceFile,t.program,t.preferences,t.host),s=r.kind===2?Npe(263,t,o,r.call,Kr(r.token),r.modifierFlags,r.parentDeclaration):OK(263,t,i,r.signature,mz(f.Function_not_implemented.message,i),r.token,void 0,void 0,void 0,o);s===void 0&&C.fail("fixMissingFunctionDeclaration codefix got unexpected error."),tf(r.parentDeclaration)?e.insertNodeBefore(r.sourceFile,r.parentDeclaration,s,!0):e.insertNodeAtEndOfScope(r.sourceFile,r.parentDeclaration,s),o.writeFixes(e)}function vMe(e,t,r){const i=aE(t.sourceFile,t.program,t.preferences,t.host),o=Gp(t.sourceFile,t.preferences),s=t.program.getTypeChecker(),l=r.parentDeclaration.attributes,u=yt(l.properties,$I),d=Vt(r.attributes,g=>{const E=RK(t,s,i,o,s.getTypeOfSymbol(g),r.parentDeclaration),A=L.createIdentifier(g.name),R=L.createJsxAttribute(A,L.createJsxExpression(void 0,E));return ps(A,R),R}),_=L.createJsxAttributes(u?[...d,...l.properties]:[...l.properties,...d]),h={prefix:l.pos===l.end?" ":void 0};e.replaceNode(t.sourceFile,l,_,h),i.writeFixes(e)}function bMe(e,t,r){const i=aE(t.sourceFile,t.program,t.preferences,t.host),o=Gp(t.sourceFile,t.preferences),s=Ga(t.program.getCompilerOptions()),l=t.program.getTypeChecker(),u=Vt(r.properties,_=>{const h=RK(t,l,i,o,l.getTypeOfSymbol(_),r.parentDeclaration);return L.createPropertyAssignment(wet(_,s,o,l),h)}),d={leadingTriviaOption:Rr.LeadingTriviaOption.Exclude,trailingTriviaOption:Rr.TrailingTriviaOption.Exclude,indentation:r.indentation};e.replaceNode(t.sourceFile,r.parentDeclaration,L.createObjectLiteralExpression([...r.parentDeclaration.properties,...u],!0),d),i.writeFixes(e)}function RK(e,t,r,i,o,s){if(o.flags&3)return Sx();if(o.flags&134217732)return L.createStringLiteral("",i===0);if(o.flags&8)return L.createNumericLiteral(0);if(o.flags&64)return L.createBigIntLiteral("0n");if(o.flags&16)return L.createFalse();if(o.flags&1056){const l=o.symbol.exports?B8(o.symbol.exports.values()):o.symbol,u=o.symbol.parent&&o.symbol.parent.flags&256?o.symbol.parent:o.symbol,d=t.symbolToExpression(u,111551,void 0,64);return l===void 0||d===void 0?L.createNumericLiteral(0):L.createPropertyAccessExpression(d,t.symbolToString(l))}if(o.flags&256)return L.createNumericLiteral(o.value);if(o.flags&2048)return L.createBigIntLiteral(o.value);if(o.flags&128)return L.createStringLiteral(o.value,i===0);if(o.flags&512)return o===t.getFalseType()||o===t.getFalseType(!0)?L.createFalse():L.createTrue();if(o.flags&65536)return L.createNull();if(o.flags&1048576)return Hn(o.types,u=>RK(e,t,r,i,u,s))??Sx();if(t.isArrayLikeType(o))return L.createArrayLiteralExpression();if(Pet(o)){const l=Vt(t.getPropertiesOfType(o),u=>{const d=RK(e,t,r,i,t.getTypeOfSymbol(u),s);return L.createPropertyAssignment(u.name,d)});return L.createObjectLiteralExpression(l,!0)}if(Hr(o)&16){if(hn(o.symbol.declarations||ae,Rp(w_,Gm,Nl))===void 0)return Sx();const u=t.getSignaturesOfType(o,0);return u===void 0?Sx():OK(219,e,i,u[0],mz(f.Function_not_implemented.message,i),void 0,void 0,void 0,s,r)??Sx()}if(Hr(o)&1){const l=cy(o.symbol);if(l===void 0||PS(l))return Sx();const u=yg(l);return u&&et(u.parameters)?Sx():L.createNewExpression(L.createIdentifier(o.symbol.name),void 0,void 0)}return Sx()}function Sx(){return L.createIdentifier("undefined")}function Pet(e){return e.flags&524288&&(Hr(e)&128||e.symbol&&ni(og(e.symbol.declarations),wu))}function Let(e,t,r){const i=e.getContextualType(r.attributes);if(i===void 0)return ae;const o=i.getProperties();if(!et(o))return ae;const s=new Set;for(const l of r.attributes.properties)if(i_(l)&&s.add(PM(l.name)),$I(l)){const u=e.getTypeAtLocation(l.expression);for(const d of u.getProperties())s.add(d.escapedName)}return Un(o,l=>fp(l.name,t,1)&&!(l.flags&16777216||Wl(l)&48||s.has(l.escapedName)))}function ket(e,t){if(wu(e))return;const r=Dn(t,i=>Nl(i)||Ml(i));return r&&r.parent===e?r:void 0}function wet(e,t,r,i){if(pg(e)){const o=i.symbolToNode(e,111551,void 0,void 0,1);if(o&&va(o))return o}return tw(e.name,t,r===0,!1,!1)}function TMe(e){if(Dn(e,ID)){const t=Dn(e.parent,tf);if(t)return t}return Wn(e)}function Oet(e,t){const r=[];for(;e;){const i=RS(e),o=i&&t.getSymbolAtLocation(i.expression);if(!o)break;const s=o.flags&2097152?t.getAliasedSymbol(o):o,l=s.declarations&&hn(s.declarations,ui);if(!l)break;r.push(l),e=l}return r}var tpe="addMissingNewOperator",SMe=[f.Value_of_type_0_is_not_callable_Did_you_mean_to_include_new.code];Sa({errorCodes:SMe,getCodeActions(e){const{sourceFile:t,span:r}=e,i=Rr.ChangeTracker.with(e,o=>EMe(o,t,r));return[oa(tpe,i,f.Add_missing_new_operator_to_call,tpe,f.Add_missing_new_operator_to_all_calls)]},fixIds:[tpe],getAllCodeActions:e=>Ss(e,SMe,(t,r)=>EMe(t,e.sourceFile,r))});function EMe(e,t,r){const i=ma(Wet(t,r),Zo),o=L.createNewExpression(i.expression,i.typeArguments,i.arguments);e.replaceNode(t,i,o)}function Wet(e,t){let r=Fi(e,t.start);const i=Dl(t);for(;r.end<i;)r=r.parent;return r}var DK="addMissingParam",CK="addOptionalParam",AMe=[f.Expected_0_arguments_but_got_1.code];Sa({errorCodes:AMe,fixIds:[DK,CK],getCodeActions(e){const t=IMe(e.sourceFile,e.program,e.span.start);if(t===void 0)return;const{name:r,declarations:i,newParameters:o,newOptionalParameters:s}=t,l=[];return et(o)&&Bn(l,oa(DK,Rr.ChangeTracker.with(e,u=>NK(u,e.program,e.preferences,e.host,i,o)),[et(o)>1?f.Add_missing_parameters_to_0:f.Add_missing_parameter_to_0,r],DK,f.Add_all_missing_parameters)),et(s)&&Bn(l,oa(CK,Rr.ChangeTracker.with(e,u=>NK(u,e.program,e.preferences,e.host,i,s)),[et(s)>1?f.Add_optional_parameters_to_0:f.Add_optional_parameter_to_0,r],CK,f.Add_all_optional_parameters)),l},getAllCodeActions:e=>Ss(e,AMe,(t,r)=>{const i=IMe(e.sourceFile,e.program,r.start);if(i){const{declarations:o,newParameters:s,newOptionalParameters:l}=i;e.fixId===DK&&NK(t,e.program,e.preferences,e.host,o,s),e.fixId===CK&&NK(t,e.program,e.preferences,e.host,o,l)}})});function IMe(e,t,r){const i=Fi(e,r),o=Dn(i,Zo);if(o===void 0||et(o.arguments)===0)return;const s=t.getTypeChecker(),l=s.getTypeAtLocation(o.expression),u=Un(l.symbol.declarations,xMe);if(u===void 0)return;const d=Zs(u);if(d===void 0||d.body===void 0||sC(t,d.getSourceFile()))return;const _=Fet(d);if(_===void 0)return;const h=[],g=[],E=et(d.parameters),A=et(o.arguments);if(E>A)return;const R=[d,...Bet(d,u)];for(let N=0,P=0,k=0;N<A;N++){const W=o.arguments[N],O=Ks(W)?xV(W):W,G=s.getWidenedType(s.getBaseTypeOfLiteralType(s.getTypeAtLocation(W))),j=P<E?d.parameters[P]:void 0;if(j&&s.isTypeAssignableTo(G,s.getTypeAtLocation(j))){P++;continue}const J=O&&He(O)?O.text:`p${k++}`,Z=zet(s,G,d);Bn(h,{pos:N,declaration:DMe(J,Z,void 0)}),!Vet(R,P)&&Bn(g,{pos:N,declaration:DMe(J,Z,L.createToken(58))})}return{newParameters:h,newOptionalParameters:g,name:ws(_),declarations:R}}function Fet(e){const t=Oo(e);if(t)return t;if(yi(e.parent)&&He(e.parent.name)||Po(e.parent)||to(e.parent))return e.parent.name}function zet(e,t,r){return e.typeToTypeNode(e.getWidenedType(t),r,1,8)??L.createKeywordTypeNode(159)}function NK(e,t,r,i,o,s){const l=Ga(t.getCompilerOptions());Ye(o,u=>{const d=Wn(u),_=aE(d,t,r,i);et(u.parameters)?e.replaceNodeRangeWithNodes(d,$a(u.parameters),Ba(u.parameters),RMe(_,l,u,s),{joiner:", ",indentation:0,leadingTriviaOption:Rr.LeadingTriviaOption.IncludeAll,trailingTriviaOption:Rr.TrailingTriviaOption.Include}):Ye(RMe(_,l,u,s),(h,g)=>{et(u.parameters)===0&&g===0?e.insertNodeAt(d,u.parameters.end,h):e.insertNodeAtEndOfList(d,u.parameters,h)}),_.writeFixes(e)})}function xMe(e){switch(e.kind){case 263:case 219:case 175:case 220:return!0;default:return!1}}function RMe(e,t,r,i){const o=Vt(r.parameters,s=>L.createParameterDeclaration(s.modifiers,s.dotDotDotToken,s.name,s.questionToken,s.type,s.initializer));for(const{pos:s,declaration:l}of i){const u=s>0?o[s-1]:void 0;o.splice(s,0,L.updateParameterDeclaration(l,l.modifiers,l.dotDotDotToken,l.name,u&&u.questionToken?L.createToken(58):l.questionToken,jet(e,l.type,t),l.initializer))}return o}function Bet(e,t){const r=[];for(const i of t)if(Get(i)){if(et(i.parameters)===et(e.parameters)){r.push(i);continue}if(et(i.parameters)>et(e.parameters))return[]}return r}function Get(e){return xMe(e)&&e.body===void 0}function DMe(e,t,r){return L.createParameterDeclaration(void 0,void 0,e,r,t,void 0)}function Vet(e,t){return et(e)&&yt(e,r=>t<et(r.parameters)&&!!r.parameters[t]&&r.parameters[t].questionToken===void 0)}function jet(e,t,r){const i=sE(t,r);return i?(G1(e,i.symbols),i.typeNode):t}var Uet="fixCannotFindModule",npe="installTypesPackage",CMe=f.Cannot_find_module_0_or_its_corresponding_type_declarations.code,NMe=f.This_JSX_tag_requires_the_module_path_0_to_exist_but_none_could_be_found_Make_sure_you_have_types_for_the_appropriate_package_installed.code,MMe=[CMe,f.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code,NMe];Sa({errorCodes:MMe,getCodeActions:function(t){const{host:r,sourceFile:i,span:{start:o},errorCode:s}=t,l=s===NMe?Xk(t.program.getCompilerOptions(),i):LMe(i,o);if(l===void 0)return;const u=kMe(l,r,s);return u===void 0?[]:[oa(Uet,[],[f.Install_0,u],npe,f.Install_all_missing_types_packages,PMe(i.fileName,u))]},fixIds:[npe],getAllCodeActions:e=>Ss(e,MMe,(t,r,i)=>{const o=LMe(r.file,r.start);if(o!==void 0)switch(e.fixId){case npe:{const s=kMe(o,e.host,r.code);s&&i.push(PMe(r.file.fileName,s));break}default:C.fail(`Bad fixId: ${e.fixId}`)}})});function PMe(e,t){return{type:"install package",file:e,packageName:t}}function LMe(e,t){const r=ni(Fi(e,t),ka);if(!r)return;const i=r.text,{packageName:o}=o3(i);return td(o)?void 0:o}function kMe(e,t,r){var i;return r===CMe?_D.has(e)?"@types/node":void 0:(i=t.isKnownTypesPackageName)!=null&&i.call(t,e)?s3(e):void 0}var wMe=[f.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2.code,f.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2.code,f.Non_abstract_class_0_is_missing_implementations_for_the_following_members_of_1_Colon_2_and_3_more.code,f.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1.code,f.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1.code,f.Non_abstract_class_expression_is_missing_implementations_for_the_following_members_of_0_Colon_1_and_2_more.code],rpe="fixClassDoesntImplementInheritedAbstractMember";Sa({errorCodes:wMe,getCodeActions:function(t){const{sourceFile:r,span:i}=t,o=Rr.ChangeTracker.with(t,s=>WMe(OMe(r,i.start),r,t,s,t.preferences));return o.length===0?void 0:[oa(rpe,o,f.Implement_inherited_abstract_class,rpe,f.Implement_all_inherited_abstract_classes)]},fixIds:[rpe],getAllCodeActions:function(t){const r=new Set;return Ss(t,wMe,(i,o)=>{const s=OMe(o.file,o.start);gm(r,ls(s))&&WMe(s,t.sourceFile,t,i,t.preferences)})}});function OMe(e,t){const r=Fi(e,t);return ma(r.parent,ui)}function WMe(e,t,r,i,o){const s=lh(e),l=r.program.getTypeChecker(),u=l.getTypeAtLocation(s),d=l.getPropertiesOfType(u).filter(Het),_=aE(t,r.program,o,r.host);Cpe(e,d,t,r,o,_,h=>i.insertMemberAtStart(t,e,h)),_.writeFixes(i)}function Het(e){const t=nv($a(e.getDeclarations()));return!(t&2)&&!!(t&64)}var ipe="classSuperMustPrecedeThisAccess",FMe=[f.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class.code];Sa({errorCodes:FMe,getCodeActions(e){const{sourceFile:t,span:r}=e,i=BMe(t,r.start);if(!i)return;const{constructor:o,superCall:s}=i,l=Rr.ChangeTracker.with(e,u=>zMe(u,t,o,s));return[oa(ipe,l,f.Make_super_call_the_first_statement_in_the_constructor,ipe,f.Make_all_super_calls_the_first_statement_in_their_constructor)]},fixIds:[ipe],getAllCodeActions(e){const{sourceFile:t}=e,r=new Set;return Ss(e,FMe,(i,o)=>{const s=BMe(o.file,o.start);if(!s)return;const{constructor:l,superCall:u}=s;gm(r,ls(l.parent))&&zMe(i,t,l,u)})}});function zMe(e,t,r,i){e.insertNodeAtConstructorStart(t,r,i),e.delete(t,i)}function BMe(e,t){const r=Fi(e,t);if(r.kind!==110)return;const i=df(r),o=GMe(i.body);return o&&!o.expression.arguments.some(s=>qr(s)&&s.expression===r)?{constructor:i,superCall:o}:void 0}function GMe(e){return od(e)&&n1(e.expression)?e:Yo(e)?void 0:Jo(e,GMe)}var ope="constructorForDerivedNeedSuperCall",VMe=[f.Constructors_for_derived_classes_must_contain_a_super_call.code];Sa({errorCodes:VMe,getCodeActions(e){const{sourceFile:t,span:r}=e,i=jMe(t,r.start),o=Rr.ChangeTracker.with(e,s=>UMe(s,t,i));return[oa(ope,o,f.Add_missing_super_call,ope,f.Add_all_missing_super_calls)]},fixIds:[ope],getAllCodeActions:e=>Ss(e,VMe,(t,r)=>UMe(t,e.sourceFile,jMe(r.file,r.start)))});function jMe(e,t){const r=Fi(e,t);return C.assert(Ml(r.parent),"token should be at the constructor declaration"),r.parent}function UMe(e,t,r){const i=L.createExpressionStatement(L.createCallExpression(L.createSuper(),void 0,ae));e.insertNodeAtConstructorStart(t,r,i)}var HMe="fixEnableJsxFlag",qMe=[f.Cannot_use_JSX_unless_the_jsx_flag_is_provided.code];Sa({errorCodes:qMe,getCodeActions:function(t){const{configFile:r}=t.program.getCompilerOptions();if(r===void 0)return;const i=Rr.ChangeTracker.with(t,o=>JMe(o,r));return[yh(HMe,i,f.Enable_the_jsx_flag_in_your_configuration_file)]},fixIds:[HMe],getAllCodeActions:e=>Ss(e,qMe,t=>{const{configFile:r}=e.program.getCompilerOptions();r!==void 0&&JMe(t,r)})});function JMe(e,t){wpe(e,t,"jsx",L.createStringLiteral("react"))}var ape="fixNaNEquality",KMe=[f.This_condition_will_always_return_0.code];Sa({errorCodes:KMe,getCodeActions(e){const{sourceFile:t,span:r,program:i}=e,o=XMe(i,t,r);if(o===void 0)return;const{suggestion:s,expression:l,arg:u}=o,d=Rr.ChangeTracker.with(e,_=>YMe(_,t,u,l));return[oa(ape,d,[f.Use_0,s],ape,f.Use_Number_isNaN_in_all_conditions)]},fixIds:[ape],getAllCodeActions:e=>Ss(e,KMe,(t,r)=>{const i=XMe(e.program,r.file,Id(r.start,r.length));i&&YMe(t,r.file,i.arg,i.expression)})});function XMe(e,t,r){const i=hn(e.getSemanticDiagnostics(t),l=>l.start===r.start&&l.length===r.length);if(i===void 0||i.relatedInformation===void 0)return;const o=hn(i.relatedInformation,l=>l.code===f.Did_you_mean_0.code);if(o===void 0||o.file===void 0||o.start===void 0||o.length===void 0)return;const s=Wpe(o.file,Id(o.start,o.length));if(s!==void 0&&St(s)&&Nr(s.parent))return{suggestion:qet(o.messageText),expression:s.parent,arg:s}}function YMe(e,t,r,i){const o=L.createCallExpression(L.createPropertyAccessExpression(L.createIdentifier("Number"),L.createIdentifier("isNaN")),void 0,[r]),s=i.operatorToken.kind;e.replaceNode(t,i,s===38||s===36?L.createPrefixUnaryExpression(54,o):o)}function qet(e){const[,t]=a_(e,`
431`,0).match(/'(.*)'/)||[];return t}Sa({errorCodes:[f.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,f.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code,f.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_node20_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher.code],getCodeActions:function(t){const r=t.program.getCompilerOptions(),{configFile:i}=r;if(i===void 0)return;const o=[],s=bu(r);if(s>=5&&s<99){const _=Rr.ChangeTracker.with(t,h=>{wpe(h,i,"module",L.createStringLiteral("esnext"))});o.push(yh("fixModuleOption",_,[f.Set_the_module_option_in_your_configuration_file_to_0,"esnext"]))}const u=Ga(r);if(u<4||u>99){const _=Rr.ChangeTracker.with(t,h=>{if(!JN(i))return;const E=[["target",L.createStringLiteral("es2017")]];s===1&&E.push(["module",L.createStringLiteral("commonjs")]),kpe(h,i,E)});o.push(yh("fixTargetOption",_,[f.Set_the_target_option_in_your_configuration_file_to_0,"es2017"]))}return o.length?o:void 0}});var spe="fixPropertyAssignment",$Me=[f.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code];Sa({errorCodes:$Me,fixIds:[spe],getCodeActions(e){const{sourceFile:t,span:r}=e,i=ZMe(t,r.start),o=Rr.ChangeTracker.with(e,s=>QMe(s,e.sourceFile,i));return[oa(spe,o,[f.Change_0_to_1,"=",":"],spe,[f.Switch_each_misused_0_to_1,"=",":"])]},getAllCodeActions:e=>Ss(e,$Me,(t,r)=>QMe(t,r.file,ZMe(r.file,r.start)))});function QMe(e,t,r){e.replaceNode(t,r,L.createPropertyAssignment(r.name,r.objectAssignmentInitializer))}function ZMe(e,t){return ma(Fi(e,t).parent,Ud)}var lpe="extendsInterfaceBecomesImplements",ePe=[f.Cannot_extend_an_interface_0_Did_you_mean_implements.code];Sa({errorCodes:ePe,getCodeActions(e){const{sourceFile:t}=e,r=tPe(t,e.span.start);if(!r)return;const{extendsToken:i,heritageClauses:o}=r,s=Rr.ChangeTracker.with(e,l=>nPe(l,t,i,o));return[oa(lpe,s,f.Change_extends_to_implements,lpe,f.Change_all_extended_interfaces_to_implements)]},fixIds:[lpe],getAllCodeActions:e=>Ss(e,ePe,(t,r)=>{const i=tPe(r.file,r.start);i&&nPe(t,r.file,i.extendsToken,i.heritageClauses)})});function tPe(e,t){const r=Fi(e,t),i=hd(r).heritageClauses,o=i[0].getFirstToken();return o.kind===96?{extendsToken:o,heritageClauses:i}:void 0}function nPe(e,t,r,i){if(e.replaceNode(t,r,L.createToken(119)),i.length===2&&i[0].token===96&&i[1].token===119){const o=i[1].getFirstToken(),s=o.getFullStart();e.replaceRange(t,{pos:s,end:s},L.createToken(28));const l=t.text;let u=o.end;for(;u<l.length&&Bh(l.charCodeAt(u));)u++;e.deleteRange(t,{pos:o.getStart(),end:u})}}var cpe="forgottenThisPropertyAccess",rPe=f.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,iPe=[f.Cannot_find_name_0_Did_you_mean_the_instance_member_this_0.code,f.Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression.code,rPe];Sa({errorCodes:iPe,getCodeActions(e){const{sourceFile:t}=e,r=oPe(t,e.span.start,e.errorCode);if(!r)return;const i=Rr.ChangeTracker.with(e,o=>aPe(o,t,r));return[oa(cpe,i,[f.Add_0_to_unresolved_variable,r.className||"this"],cpe,f.Add_qualifier_to_all_unresolved_variables_matching_a_member_name)]},fixIds:[cpe],getAllCodeActions:e=>Ss(e,iPe,(t,r)=>{const i=oPe(r.file,r.start,r.code);i&&aPe(t,e.sourceFile,i)})});function oPe(e,t,r){const i=Fi(e,t);if(He(i)||eo(i))return{node:i,className:r===rPe?hd(i).name.text:void 0}}function aPe(e,t,{node:r,className:i}){Op(r),e.replaceNode(t,r,L.createPropertyAccessExpression(i?L.createIdentifier(i):L.createThis(),r))}var dpe="fixInvalidJsxCharacters_expression",MK="fixInvalidJsxCharacters_htmlEntity",sPe=[f.Unexpected_token_Did_you_mean_or_gt.code,f.Unexpected_token_Did_you_mean_or_rbrace.code];Sa({errorCodes:sPe,fixIds:[dpe,MK],getCodeActions(e){const{sourceFile:t,preferences:r,span:i}=e,o=Rr.ChangeTracker.with(e,l=>upe(l,r,t,i.start,!1)),s=Rr.ChangeTracker.with(e,l=>upe(l,r,t,i.start,!0));return[oa(dpe,o,f.Wrap_invalid_character_in_an_expression_container,dpe,f.Wrap_all_invalid_characters_in_an_expression_container),oa(MK,s,f.Convert_invalid_character_to_its_html_entity_code,MK,f.Convert_all_invalid_characters_to_HTML_entity_code)]},getAllCodeActions(e){return Ss(e,sPe,(t,r)=>upe(t,e.preferences,r.file,r.start,e.fixId===MK))}});var lPe={">":"&gt;","}":"&rbrace;"};function Jet(e){return Rs(lPe,e)}function upe(e,t,r,i,o){const s=r.getText()[i];if(!Jet(s))return;const l=o?lPe[s]:`{${wP(r,t,s)}}`;e.replaceRangeWithText(r,{pos:i,end:i+1},l)}var PK="deleteUnmatchedParameter",cPe="renameUnmatchedParameter",dPe=[f.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name.code];Sa({fixIds:[PK,cPe],errorCodes:dPe,getCodeActions:function(t){const{sourceFile:r,span:i}=t,o=[],s=uPe(r,i.start);if(s)return Bn(o,Ket(t,s)),Bn(o,Xet(t,s)),o},getAllCodeActions:function(t){const r=new Map;return vx(Rr.ChangeTracker.with(t,i=>{bx(t,dPe,({file:o,start:s})=>{const l=uPe(o,s);l&&r.set(l.signature,Bn(r.get(l.signature),l.jsDocParameterTag))}),r.forEach((o,s)=>{if(t.fixId===PK){const l=new Set(o);i.filterJSDocTags(s.getSourceFile(),s,u=>!l.has(u))}})}))}});function Ket(e,{name:t,jsDocHost:r,jsDocParameterTag:i}){const o=Rr.ChangeTracker.with(e,s=>s.filterJSDocTags(e.sourceFile,r,l=>l!==i));return oa(PK,o,[f.Delete_unused_param_tag_0,t.getText(e.sourceFile)],PK,f.Delete_all_unused_param_tags)}function Xet(e,{name:t,jsDocHost:r,signature:i,jsDocParameterTag:o}){if(!et(i.parameters))return;const s=e.sourceFile,l=kT(i),u=new Set;for(const g of l)mf(g)&&He(g.name)&&u.add(g.name.escapedText);const d=Hn(i.parameters,g=>He(g.name)&&!u.has(g.name.escapedText)?g.name.getText(s):void 0);if(d===void 0)return;const _=L.updateJSDocParameterTag(o,o.tagName,L.createIdentifier(d),o.isBracketed,o.typeExpression,o.isNameFirst,o.comment),h=Rr.ChangeTracker.with(e,g=>g.replaceJSDocComment(s,r,Vt(l,E=>E===o?_:E)));return yh(cPe,h,[f.Rename_param_tag_name_0_to_1,t.getText(s),d])}function uPe(e,t){const r=Fi(e,t);if(r.parent&&mf(r.parent)&&He(r.parent.name)){const i=r.parent,o=IS(i),s=BT(i);if(o&&s)return{jsDocHost:o,signature:s,name:r.parent.name,jsDocParameterTag:i}}}var ppe="fixUnreferenceableDecoratorMetadata",Yet=[f.A_type_referenced_in_a_decorated_signature_must_be_imported_with_import_type_or_a_namespace_import_when_isolatedModules_and_emitDecoratorMetadata_are_enabled.code];Sa({errorCodes:Yet,getCodeActions:e=>{const t=$et(e.sourceFile,e.program,e.span.start);if(!t)return;const r=Rr.ChangeTracker.with(e,s=>t.kind===277&&Zet(s,e.sourceFile,t,e.program)),i=Rr.ChangeTracker.with(e,s=>Qet(s,e.sourceFile,t,e.program));let o;return r.length&&(o=Bn(o,yh(ppe,r,f.Convert_named_imports_to_namespace_import))),i.length&&(o=Bn(o,yh(ppe,i,f.Use_import_type))),o},fixIds:[ppe]});function $et(e,t,r){const i=ni(Fi(e,r),He);if(!i||i.parent.kind!==184)return;const s=t.getTypeChecker().getSymbolAtLocation(i);return hn(s?.declarations||ae,Rp(Vm,Eu,Fc))}function Qet(e,t,r,i){if(r.kind===272){e.insertModifierBefore(t,156,r.name);return}const o=r.kind===274?r:r.parent.parent;if(o.name&&o.namedBindings)return;const s=i.getTypeChecker();hne(o,u=>{if(xd(u.symbol,s).flags&111551)return!0})||e.insertModifierBefore(t,156,o)}function Zet(e,t,r,i){gx.doChangeNamedToNamespaceOrDefault(t,i,e,r.parent)}var fz="unusedIdentifier",fpe="unusedIdentifier_prefix",mpe="unusedIdentifier_delete",LK="unusedIdentifier_deleteImports",hpe="unusedIdentifier_infer",pPe=[f._0_is_declared_but_its_value_is_never_read.code,f._0_is_declared_but_never_used.code,f.Property_0_is_declared_but_its_value_is_never_read.code,f.All_imports_in_import_declaration_are_unused.code,f.All_destructured_elements_are_unused.code,f.All_variables_are_unused.code,f.All_type_parameters_are_unused.code];Sa({errorCodes:pPe,getCodeActions(e){const{errorCode:t,sourceFile:r,program:i,cancellationToken:o}=e,s=i.getTypeChecker(),l=i.getSourceFiles(),u=Fi(r,e.span.start);if(bm(u))return[HP(Rr.ChangeTracker.with(e,g=>g.delete(r,u)),f.Remove_template_tag)];if(u.kind===30){const g=Rr.ChangeTracker.with(e,E=>mPe(E,r,u));return[HP(g,f.Remove_type_parameters)]}const d=hPe(u);if(d){const g=Rr.ChangeTracker.with(e,E=>E.delete(r,d));return[oa(fz,g,[f.Remove_import_from_0,ere(d)],LK,f.Delete_all_unused_imports)]}else if(_pe(u)){const g=Rr.ChangeTracker.with(e,E=>kK(r,u,E,s,l,i,o,!1));if(g.length)return[oa(fz,g,[f.Remove_unused_declaration_for_Colon_0,u.getText(r)],LK,f.Delete_all_unused_imports)]}if(ff(u.parent)||pv(u.parent)){if(to(u.parent.parent)){const g=u.parent.elements,E=[g.length>1?f.Remove_unused_declarations_for_Colon_0:f.Remove_unused_declaration_for_Colon_0,Vt(g,A=>A.getText(r)).join(", ")];return[HP(Rr.ChangeTracker.with(e,A=>ett(A,r,u.parent)),E)]}return[HP(Rr.ChangeTracker.with(e,g=>ttt(e,g,r,u.parent)),f.Remove_unused_destructuring_declaration)]}if(_Pe(r,u))return[HP(Rr.ChangeTracker.with(e,g=>gPe(g,r,u.parent)),f.Remove_variable_statement)];if(He(u)&&Zl(u.parent))return[HP(Rr.ChangeTracker.with(e,g=>TPe(g,r,u.parent)),[f.Remove_unused_declaration_for_Colon_0,u.getText(r)])];const _=[];if(u.kind===140){const g=Rr.ChangeTracker.with(e,A=>fPe(A,r,u)),E=ma(u.parent,y1).typeParameter.name.text;_.push(oa(fz,g,[f.Replace_infer_0_with_unknown,E],hpe,f.Replace_all_unused_infer_with_unknown))}else{const g=Rr.ChangeTracker.with(e,E=>kK(r,u,E,s,l,i,o,!1));if(g.length){const E=va(u.parent)?u.parent:u;_.push(HP(g,[f.Remove_unused_declaration_for_Colon_0,E.getText(r)]))}}const h=Rr.ChangeTracker.with(e,g=>yPe(g,t,r,u));return h.length&&_.push(oa(fz,h,[f.Prefix_0_with_an_underscore,u.getText(r)],fpe,f.Prefix_all_unused_declarations_with_where_possible)),_},fixIds:[fpe,mpe,LK,hpe],getAllCodeActions:e=>{const{sourceFile:t,program:r,cancellationToken:i}=e,o=r.getTypeChecker(),s=r.getSourceFiles();return Ss(e,pPe,(l,u)=>{const d=Fi(t,u.start);switch(e.fixId){case fpe:yPe(l,u.code,t,d);break;case LK:{const _=hPe(d);_?l.delete(t,_):_pe(d)&&kK(t,d,l,o,s,r,i,!0);break}case mpe:{if(d.kind===140||_pe(d))break;if(bm(d))l.delete(t,d);else if(d.kind===30)mPe(l,t,d);else if(ff(d.parent)){if(d.parent.parent.initializer)break;(!to(d.parent.parent)||vPe(d.parent.parent,o,s))&&l.delete(t,d.parent.parent)}else{if(pv(d.parent.parent)&&d.parent.parent.parent.initializer)break;_Pe(t,d)?gPe(l,t,d.parent):He(d)&&Zl(d.parent)?TPe(l,t,d.parent):kK(t,d,l,o,s,r,i,!0)}break}case hpe:d.kind===140&&fPe(l,t,d);break;default:C.fail(JSON.stringify(e.fixId))}})}});function fPe(e,t,r){e.replaceNode(t,r.parent,L.createKeywordTypeNode(159))}function HP(e,t){return oa(fz,e,t,mpe,f.Delete_all_unused_declarations)}function mPe(e,t,r){e.delete(t,C.checkDefined(ma(r.parent,AG).typeParameters,"The type parameter to delete should exist"))}function _pe(e){return e.kind===102||e.kind===80&&(e.parent.kind===277||e.parent.kind===274)}function hPe(e){return e.kind===102?ni(e.parent,vl):void 0}function _Pe(e,t){return _d(t.parent)&&$a(t.parent.getChildren(e))===t}function gPe(e,t,r){e.delete(t,r.parent.kind===244?r.parent:r)}function ett(e,t,r){Ye(r.elements,i=>e.delete(t,i))}function ttt(e,t,r,{parent:i}){if(yi(i)&&i.initializer&&gS(i.initializer))if(_d(i.parent)&&et(i.parent.declarations)>1){const o=i.parent.parent,s=o.getStart(r),l=o.end;t.delete(r,i),t.insertNodeAt(r,l,i.initializer,{prefix:_y(e.host,e.formatContext.options)+r.text.slice(R7(r.text,s-1),s),suffix:NO(r)?";":""})}else t.replaceNode(r,i.parent,i.initializer);else t.delete(r,i)}function yPe(e,t,r,i){t!==f.Property_0_is_declared_but_its_value_is_never_read.code&&(i.kind===140&&(i=ma(i.parent,y1).typeParameter.name),He(i)&&ntt(i)&&(e.replaceNode(r,i,L.createIdentifier(`_${i.text}`)),to(i.parent)&&OR(i.parent).forEach(o=>{He(o.name)&&e.replaceNode(r,o.name,L.createIdentifier(`_${o.name.text}`))})))}function ntt(e){switch(e.parent.kind){case 170:case 169:return!0;case 261:switch(e.parent.parent.parent.kind){case 251:case 250:return!0}}return!1}function kK(e,t,r,i,o,s,l,u){rtt(t,r,e,i,o,s,l,u),He(t)&&Ys.Core.eachSymbolReferenceInFile(t,i,e,d=>{qr(d.parent)&&d.parent.name===d&&(d=d.parent),!u&&stt(d)&&r.delete(e,d.parent.parent)})}function rtt(e,t,r,i,o,s,l,u){const{parent:d}=e;if(to(d))itt(t,r,d,i,o,s,l,u);else if(!(u&&He(e)&&Ys.Core.isSymbolReferencedInFile(e,i,r))){const _=Vm(d)?e:va(d)?d.parent:d;C.assert(_!==r,"should not delete whole source file"),t.delete(r,_)}}function itt(e,t,r,i,o,s,l,u=!1){if(ott(i,t,r,o,s,l,u))if(r.modifiers&&r.modifiers.length>0&&(!He(r.name)||Ys.Core.isSymbolReferencedInFile(r.name,i,t)))for(const d of r.modifiers)Aa(d)&&e.deleteModifier(t,d);else!r.initializer&&vPe(r,i,o)&&e.delete(t,r)}function vPe(e,t,r){const i=e.parent.parameters.indexOf(e);return!Ys.Core.someSignatureUsage(e.parent,r,t,(o,s)=>!s||s.arguments.length>i)}function ott(e,t,r,i,o,s,l){const{parent:u}=r;switch(u.kind){case 175:case 177:const d=u.parameters.indexOf(r),_=Nl(u)?u.name:u,h=Ys.Core.getReferencedSymbolsForNode(u.pos,_,o,i,s);if(h){for(const g of h)for(const E of g.references)if(E.kind===Ys.EntryKind.Node){const A=zM(E.node)&&Zo(E.node.parent)&&E.node.parent.arguments.length>d,R=qr(E.node.parent)&&zM(E.node.parent.expression)&&Zo(E.node.parent.parent)&&E.node.parent.parent.arguments.length>d,N=(Nl(E.node.parent)||Gm(E.node.parent))&&E.node.parent!==r.parent&&E.node.parent.parameters.length>d;if(A||R||N)return!1}}return!0;case 263:return u.name&&att(e,t,u.name)?bPe(u,r,l):!0;case 219:case 220:return bPe(u,r,l);case 179:return!1;case 178:return!0;default:return C.failBadSyntaxKind(u)}}function att(e,t,r){return!!Ys.Core.eachSymbolReferenceInFile(r,e,t,i=>He(i)&&Zo(i.parent)&&i.parent.arguments.includes(i))}function bPe(e,t,r){const i=e.parameters,o=i.indexOf(t);return C.assert(o!==-1,"The parameter should already be in the list"),r?i.slice(o+1).every(s=>He(s.name)&&!s.symbol.isReferenced):o===i.length-1}function stt(e){return(Nr(e.parent)&&e.parent.left===e||(Tj(e.parent)||YT(e.parent))&&e.parent.operand===e)&&od(e.parent.parent)}function TPe(e,t,r){const i=r.symbol.declarations;if(i)for(const o of i)e.delete(t,o)}var gpe="fixUnreachableCode",SPe=[f.Unreachable_code_detected.code];Sa({errorCodes:SPe,getCodeActions(e){if(e.program.getSyntacticDiagnostics(e.sourceFile,e.cancellationToken).length)return;const r=Rr.ChangeTracker.with(e,i=>EPe(i,e.sourceFile,e.span.start,e.span.length,e.errorCode));return[oa(gpe,r,f.Remove_unreachable_code,gpe,f.Remove_all_unreachable_code)]},fixIds:[gpe],getAllCodeActions:e=>Ss(e,SPe,(t,r)=>EPe(t,r.file,r.start,r.length,r.code))});function EPe(e,t,r,i,o){const s=Fi(t,r),l=Dn(s,Vi);if(l.getStart(t)!==s.getStart(t)){const d=JSON.stringify({statementKind:C.formatSyntaxKind(l.kind),tokenKind:C.formatSyntaxKind(s.kind),errorCode:o,start:r,length:i});C.fail("Token and statement should start at the same point. "+d)}const u=(ea(l.parent)?l.parent:l).parent;if(!ea(l.parent)||l===$a(l.parent.statements))switch(u.kind){case 246:if(u.elseStatement){if(ea(l.parent))break;e.replaceNode(t,l,L.createBlock(ae));return}case 248:case 249:e.delete(t,u);return}if(ea(l.parent)){const d=r+i,_=C.checkDefined(ltt(GV(l.parent.statements,l),h=>h.pos<d),"Some statement should be last");e.deleteNodeRange(t,l,_)}else e.delete(t,l)}function ltt(e,t){let r;for(const i of e){if(!t(i))break;r=i}return r}var ype="fixUnusedLabel",APe=[f.Unused_label.code];Sa({errorCodes:APe,getCodeActions(e){const t=Rr.ChangeTracker.with(e,r=>IPe(r,e.sourceFile,e.span.start));return[oa(ype,t,f.Remove_unused_label,ype,f.Remove_all_unused_labels)]},fixIds:[ype],getAllCodeActions:e=>Ss(e,APe,(t,r)=>IPe(t,r.file,r.start))});function IPe(e,t,r){const i=Fi(t,r),o=ma(i.parent,Lb),s=i.getStart(t),l=o.statement.getStart(t),u=Gf(s,l,t)?l:La(t.text,Es(o,59,t).end,!0);e.deleteRange(t,{pos:s,end:u})}var xPe="fixJSDocTypes_plain",vpe="fixJSDocTypes_nullable",RPe=[f.JSDoc_types_can_only_be_used_inside_documentation_comments.code,f._0_at_the_end_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code,f._0_at_the_start_of_a_type_is_not_valid_TypeScript_syntax_Did_you_mean_to_write_1.code];Sa({errorCodes:RPe,getCodeActions(e){const{sourceFile:t}=e,r=e.program.getTypeChecker(),i=CPe(t,e.span.start,r);if(!i)return;const{typeNode:o,type:s}=i,l=o.getText(t),u=[d(s,xPe,f.Change_all_jsdoc_style_types_to_TypeScript)];return o.kind===315&&u.push(d(s,vpe,f.Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types)),u;function d(_,h,g){const E=Rr.ChangeTracker.with(e,A=>DPe(A,t,o,_,r));return oa("jdocTypes",E,[f.Change_0_to_1,l,r.typeToString(_)],h,g)}},fixIds:[xPe,vpe],getAllCodeActions(e){const{fixId:t,program:r,sourceFile:i}=e,o=r.getTypeChecker();return Ss(e,RPe,(s,l)=>{const u=CPe(l.file,l.start,o);if(!u)return;const{typeNode:d,type:_}=u,h=d.kind===315&&t===vpe?o.getNullableType(_,32768):_;DPe(s,i,d,h,o)})}});function DPe(e,t,r,i,o){e.replaceNode(t,r,o.typeToTypeNode(i,r,void 0))}function CPe(e,t,r){const i=Dn(Fi(e,t),ctt),o=i&&i.type;return o&&{typeNode:o,type:dtt(r,o)}}function ctt(e){switch(e.kind){case 235:case 180:case 181:case 263:case 178:case 182:case 201:case 175:case 174:case 170:case 173:case 172:case 179:case 266:case 217:case 261:return!0;default:return!1}}function dtt(e,t){if(RD(t)){const r=e.getTypeFromTypeNode(t.type);return r===e.getNeverType()||r===e.getVoidType()?r:e.getUnionType(Bn([r,e.getUndefinedType()],t.postfix?void 0:e.getNullType()))}return e.getTypeFromTypeNode(t)}var bpe="fixMissingCallParentheses",NPe=[f.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead.code];Sa({errorCodes:NPe,fixIds:[bpe],getCodeActions(e){const{sourceFile:t,span:r}=e,i=PPe(t,r.start);if(!i)return;const o=Rr.ChangeTracker.with(e,s=>MPe(s,e.sourceFile,i));return[oa(bpe,o,f.Add_missing_call_parentheses,bpe,f.Add_all_missing_call_parentheses)]},getAllCodeActions:e=>Ss(e,NPe,(t,r)=>{const i=PPe(r.file,r.start);i&&MPe(t,r.file,i)})});function MPe(e,t,r){e.replaceNodeWithText(t,r,`${r.text}()`)}function PPe(e,t){const r=Fi(e,t);if(qr(r.parent)){let i=r.parent;for(;qr(i.parent);)i=i.parent;return i.name}if(He(r))return r}var LPe="fixMissingTypeAnnotationOnExports",Tpe="add-annotation",Spe="add-type-assertion",utt="extract-expression",kPe=[f.Function_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,f.Method_must_have_an_explicit_return_type_annotation_with_isolatedDeclarations.code,f.At_least_one_accessor_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,f.Variable_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,f.Parameter_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,f.Property_must_have_an_explicit_type_annotation_with_isolatedDeclarations.code,f.Expression_type_can_t_be_inferred_with_isolatedDeclarations.code,f.Binding_elements_can_t_be_exported_directly_with_isolatedDeclarations.code,f.Computed_property_names_on_class_or_object_literals_cannot_be_inferred_with_isolatedDeclarations.code,f.Computed_properties_must_be_number_or_string_literals_variables_or_dotted_expressions_with_isolatedDeclarations.code,f.Enum_member_initializers_must_be_computable_without_references_to_external_symbols_with_isolatedDeclarations.code,f.Extends_clause_can_t_contain_an_expression_with_isolatedDeclarations.code,f.Objects_that_contain_shorthand_properties_can_t_be_inferred_with_isolatedDeclarations.code,f.Objects_that_contain_spread_assignments_can_t_be_inferred_with_isolatedDeclarations.code,f.Arrays_with_spread_elements_can_t_inferred_with_isolatedDeclarations.code,f.Default_exports_can_t_be_inferred_with_isolatedDeclarations.code,f.Only_const_arrays_can_be_inferred_with_isolatedDeclarations.code,f.Assigning_properties_to_functions_without_declaring_them_is_not_supported_with_isolatedDeclarations_Add_an_explicit_declaration_for_the_properties_assigned_to_this_function.code,f.Declaration_emit_for_this_parameter_requires_implicitly_adding_undefined_to_its_type_This_is_not_supported_with_isolatedDeclarations.code,f.Type_containing_private_name_0_can_t_be_used_with_isolatedDeclarations.code,f.Add_satisfies_and_a_type_assertion_to_this_expression_satisfies_T_as_T_to_make_the_type_explicit.code],ptt=new Set([178,175,173,263,219,220,261,170,278,264,207,208]),wPe=531469,OPe=1;Sa({errorCodes:kPe,fixIds:[LPe],getCodeActions(e){const t=[];return qP(Tpe,t,e,0,r=>r.addTypeAnnotation(e.span)),qP(Tpe,t,e,1,r=>r.addTypeAnnotation(e.span)),qP(Tpe,t,e,2,r=>r.addTypeAnnotation(e.span)),qP(Spe,t,e,0,r=>r.addInlineAssertion(e.span)),qP(Spe,t,e,1,r=>r.addInlineAssertion(e.span)),qP(Spe,t,e,2,r=>r.addInlineAssertion(e.span)),qP(utt,t,e,0,r=>r.extractAsVariable(e.span)),t},getAllCodeActions:e=>{const t=WPe(e,0,r=>{bx(e,kPe,i=>{r.addTypeAnnotation(i)})});return vx(t.textChanges)}});function qP(e,t,r,i,o){const s=WPe(r,i,o);s.result&&s.textChanges.length&&t.push(oa(e,s.textChanges,s.result,LPe,f.Add_all_missing_type_annotations))}function WPe(e,t,r){const i={typeNode:void 0,mutatedTarget:!1},o=Rr.ChangeTracker.fromContext(e),s=e.sourceFile,l=e.program,u=l.getTypeChecker(),d=Ga(l.getCompilerOptions()),_=aE(e.sourceFile,e.program,e.preferences,e.host),h=new Set,g=new Set,E=zb({preserveSourceNewlines:!1}),A=r({addTypeAnnotation:R,addInlineAssertion:O,extractAsVariable:G});return _.writeFixes(o),{result:A,textChanges:o.getChanges()};function R(Re){e.cancellationToken.throwIfCancellationRequested();const _e=Fi(s,Re.start),je=j(_e);if(je)return Zl(je)?N(je):J(je);const Ge=lt(_e);if(Ge)return J(Ge)}function N(Re){var _e;if(g?.has(Re))return;g?.add(Re);const je=u.getTypeAtLocation(Re),Ge=u.getPropertiesOfType(je);if(!Re.name||Ge.length===0)return;const We=[];for(const cn of Ge)fp(cn.name,Ga(l.getCompilerOptions()))&&(cn.valueDeclaration&&yi(cn.valueDeclaration)||We.push(L.createVariableStatement([L.createModifier(95)],L.createVariableDeclarationList([L.createVariableDeclaration(cn.name,void 0,re(u.getTypeOfSymbol(cn),Re),void 0)]))));if(We.length===0)return;const at=[];(_e=Re.modifiers)!=null&&_e.some(cn=>cn.kind===95)&&at.push(L.createModifier(95)),at.push(L.createModifier(138));const Wt=L.createModuleDeclaration(at,Re.name,L.createModuleBlock(We),101441696);return o.insertNodeAfter(s,Re,Wt),[f.Annotate_types_of_properties_expando_function_in_a_namespace]}function P(Re){return!Ds(Re)&&!Zo(Re)&&!Wa(Re)&&!Cd(Re)}function k(Re,_e){return P(Re)&&(Re=L.createParenthesizedExpression(Re)),L.createAsExpression(Re,_e)}function W(Re,_e){return P(Re)&&(Re=L.createParenthesizedExpression(Re)),L.createAsExpression(L.createSatisfiesExpression(Re,_s(_e)),_e)}function O(Re){e.cancellationToken.throwIfCancellationRequested();const _e=Fi(s,Re.start);if(j(_e))return;const Ge=ce(_e,Re);if(!Ge||l1(Ge)||l1(Ge.parent))return;const We=St(Ge),at=Ud(Ge);if(!at&&rd(Ge)||Dn(Ge,Qo)||Dn(Ge,py)||We&&(Dn(Ge,Fp)||Dn(Ge,Ri))||qf(Ge))return;const Wt=Dn(Ge,yi),cn=Wt&&u.getTypeAtLocation(Wt);if(cn&&cn.flags&8192||!(We||at))return;const{typeNode:gn,mutatedTarget:Kn}=fe(Ge,cn);if(!(!gn||Kn))return at?o.insertNodeAt(s,Ge.end,k(_s(Ge.name),gn),{prefix:": "}):We?o.replaceNode(s,Ge,W(_s(Ge),gn)):C.assertNever(Ge),[f.Add_satisfies_and_an_inline_type_assertion_with_0,Be(gn)]}function G(Re){e.cancellationToken.throwIfCancellationRequested();const _e=Fi(s,Re.start),je=ce(_e,Re);if(!je||l1(je)||l1(je.parent)||!St(je))return;if(Cd(je))return o.replaceNode(s,je,k(je,L.createTypeReferenceNode("const"))),[f.Mark_array_literal_as_const];const We=Dn(je,Cc);if(We){if(We===je.parent&&Ds(je))return;const at=L.createUniqueName(Ede(je,s,u,s),16);let Wt=je,cn=je;if(qf(Wt)&&(Wt=zm(Wt.parent),Je(Wt.parent)?cn=Wt=Wt.parent:cn=k(Wt,L.createTypeReferenceNode("const"))),Ds(Wt))return;const gn=L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(at,void 0,void 0,cn)],2)),Kn=Dn(je,Vi);return o.insertNodeBefore(s,Kn,gn),o.replaceNode(s,Wt,L.createAsExpression(L.cloneNode(at),L.createTypeQueryNode(L.cloneNode(at)))),[f.Extract_to_variable_and_replace_with_0_as_typeof_0,Be(at)]}}function j(Re){const _e=Dn(Re,je=>Vi(je)?"quit":WI(je));if(_e&&WI(_e)){let je=_e;if(Nr(je)&&(je=je.left,!WI(je)))return;const Ge=u.getTypeAtLocation(je.expression);if(!Ge)return;const We=u.getPropertiesOfType(Ge);if(yt(We,at=>at.valueDeclaration===_e||at.valueDeclaration===_e.parent)){const at=Ge.symbol.valueDeclaration;if(at){if(Rb(at)&&yi(at.parent))return at.parent;if(Zl(at))return at}}}}function J(Re){if(!h?.has(Re))switch(h?.add(Re),Re.kind){case 170:case 173:case 261:return Ne(Re);case 220:case 219:case 263:case 175:case 178:return Z(Re,s);case 278:return q(Re);case 264:return ye(Re);case 207:case 208:return ie(Re);default:throw new Error(`Cannot find a fix for the given node ${Re.kind}`)}}function Z(Re,_e){if(Re.type)return;const{typeNode:je}=fe(Re);if(je)return o.tryInsertTypeAnnotation(_e,Re,je),[f.Add_return_type_0,Be(je)]}function q(Re){if(Re.isExportEquals)return;const{typeNode:_e}=fe(Re.expression);if(!_e)return;const je=L.createUniqueName("_default");return o.replaceNodeWithNodes(s,Re,[L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(je,void 0,_e,Re.expression)],2)),L.updateExportAssignment(Re,Re?.modifiers,je)]),[f.Extract_default_export_to_variable]}function ye(Re){var _e,je;const Ge=(_e=Re.heritageClauses)==null?void 0:_e.find(_t=>_t.token===96),We=Ge?.types[0];if(!We)return;const{typeNode:at}=fe(We.expression);if(!at)return;const Wt=L.createUniqueName(Re.name?Re.name.text+"Base":"Anonymous",16),cn=L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(Wt,void 0,at,We.expression)],2));o.insertNodeBefore(s,Re,cn);const gn=sb(s.text,We.end),Kn=((je=gn?.[gn.length-1])==null?void 0:je.end)??We.end;return o.replaceRange(s,{pos:We.getFullStart(),end:Kn},Wt,{prefix:" "}),[f.Extract_base_class_to_variable]}function ie(Re){var _e;const je=Re.parent,Ge=Re.parent.parent.parent;if(!je.initializer)return;let We;const at=[];if(He(je.initializer))We={expression:{kind:3,identifier:je.initializer}};else{const gn=L.createUniqueName("dest",16);We={expression:{kind:3,identifier:gn}},at.push(L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(gn,void 0,void 0,je.initializer)],2)))}const Wt=[];pv(Re)?K(Re,Wt,We):pe(Re,Wt,We);const cn=new Map;for(const gn of Wt){if(gn.element.propertyName&&va(gn.element.propertyName)){const _t=gn.element.propertyName.expression,en=L.getGeneratedNameForNode(_t),ir=L.createVariableDeclaration(en,void 0,void 0,_t),Di=L.createVariableDeclarationList([ir],2),lo=L.createVariableStatement(void 0,Di);at.push(lo),cn.set(_t,en)}const Kn=gn.element.name;if(pv(Kn))K(Kn,Wt,gn);else if(ff(Kn))pe(Kn,Wt,gn);else{const{typeNode:_t}=fe(Kn);let en=de(gn,cn);if(gn.element.initializer){const Di=(_e=gn.element)==null?void 0:_e.propertyName,lo=L.createUniqueName(Di&&He(Di)?Di.text:"temp",16);at.push(L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(lo,void 0,void 0,en)],2))),en=L.createConditionalExpression(L.createBinaryExpression(lo,L.createToken(37),L.createIdentifier("undefined")),L.createToken(58),gn.element.initializer,L.createToken(59),en)}const ir=di(Ge,32)?[L.createToken(95)]:void 0;at.push(L.createVariableStatement(ir,L.createVariableDeclarationList([L.createVariableDeclaration(Kn,void 0,_t,en)],2)))}}return Ge.declarationList.declarations.length>1&&at.push(L.updateVariableStatement(Ge,Ge.modifiers,L.updateVariableDeclarationList(Ge.declarationList,Ge.declarationList.declarations.filter(gn=>gn!==Re.parent)))),o.replaceNodeWithNodes(s,Ge,at),[f.Extract_binding_expressions_to_variable]}function K(Re,_e,je){for(let Ge=0;Ge<Re.elements.length;++Ge){const We=Re.elements[Ge];Jc(We)||_e.push({element:We,parent:je,expression:{kind:2,arrayIndex:Ge}})}}function pe(Re,_e,je){for(const Ge of Re.elements){let We;if(Ge.propertyName)if(va(Ge.propertyName)){_e.push({element:Ge,parent:je,expression:{kind:1,computed:Ge.propertyName.expression}});continue}else We=Ge.propertyName.text;else We=Ge.name.text;_e.push({element:Ge,parent:je,expression:{kind:0,text:We}})}}function de(Re,_e){const je=[Re];for(;Re.parent;)Re=Re.parent,je.push(Re);let Ge=je[je.length-1].expression.identifier;for(let We=je.length-2;We>=0;--We){const at=je[We].expression;at.kind===0?Ge=L.createPropertyAccessChain(Ge,void 0,L.createIdentifier(at.text)):at.kind===1?Ge=L.createElementAccessExpression(Ge,_e.get(at.computed)):at.kind===2&&(Ge=L.createElementAccessExpression(Ge,at.arrayIndex))}return Ge}function fe(Re,_e){if(t===1)return Se(Re);let je;if(l1(Re)){const at=u.getSignatureFromDeclaration(Re);if(at){const Wt=u.getTypePredicateOfSignature(at);if(Wt)return Wt.type?{typeNode:be(Wt,Dn(Re,rd)??s,We(Wt.type)),mutatedTarget:!1}:i;je=u.getReturnTypeOfSignature(at)}}else je=u.getTypeAtLocation(Re);if(!je)return i;if(t===2){_e&&(je=_e);const at=u.getWidenedLiteralType(je);if(u.isTypeAssignableTo(at,je))return i;je=at}const Ge=Dn(Re,rd)??s;return to(Re)&&u.requiresAddingImplicitUndefined(Re,Ge)&&(je=u.getUnionType([u.getUndefinedType(),je],0)),{typeNode:re(je,Ge,We(je)),mutatedTarget:!1};function We(at){return(yi(Re)||Po(Re)&&di(Re,264))&&at.flags&8192?1048576:0}}function ve(Re){return L.createTypeQueryNode(_s(Re))}function xe(Re,_e="temp"){const je=!!Dn(Re,Je);return je?Ce(Re,_e,je,Ge=>Ge.elements,qf,L.createSpreadElement,Ge=>L.createArrayLiteralExpression(Ge,!0),Ge=>L.createTupleTypeNode(Ge.map(L.createRestTypeNode))):i}function X(Re,_e="temp"){const je=!!Dn(Re,Je);return Ce(Re,_e,je,Ge=>Ge.properties,xg,L.createSpreadAssignment,Ge=>L.createObjectLiteralExpression(Ge,!0),L.createIntersectionTypeNode)}function Ce(Re,_e,je,Ge,We,at,Wt,cn){const gn=[],Kn=[];let _t;const en=Dn(Re,Vi);for(const lo of Ge(Re))We(lo)?(Di(),Ds(lo.expression)?(gn.push(ve(lo.expression)),Kn.push(lo)):ir(lo.expression)):(_t??(_t=[])).push(lo);if(Kn.length===0)return i;return Di(),o.replaceNode(s,Re,Wt(Kn)),{typeNode:cn(gn),mutatedTarget:!0};function ir(lo){const zt=L.createUniqueName(_e+"_Part"+(Kn.length+1),16),Zr=je?L.createAsExpression(lo,L.createTypeReferenceNode("const")):lo,Ai=L.createVariableStatement(void 0,L.createVariableDeclarationList([L.createVariableDeclaration(zt,void 0,void 0,Zr)],2));o.insertNodeBefore(s,en,Ai),gn.push(ve(zt)),Kn.push(at(zt))}function Di(){_t&&(ir(Wt(_t)),_t=void 0)}}function Je(Re){return yS(Re)&&Om(Re.type)}function Se(Re){if(to(Re))return i;if(Ud(Re))return{typeNode:ve(Re.name),mutatedTarget:!1};if(Ds(Re))return{typeNode:ve(Re),mutatedTarget:!1};if(Je(Re))return Se(Re.expression);if(Cd(Re)){const _e=Dn(Re,yi),je=_e&&He(_e.name)?_e.name.text:void 0;return xe(Re,je)}if(Wa(Re)){const _e=Dn(Re,yi),je=_e&&He(_e.name)?_e.name.text:void 0;return X(Re,je)}if(yi(Re)&&Re.initializer)return Se(Re.initializer);if(T1(Re)){const{typeNode:_e,mutatedTarget:je}=Se(Re.whenTrue);if(!_e)return i;const{typeNode:Ge,mutatedTarget:We}=Se(Re.whenFalse);return Ge?{typeNode:L.createUnionTypeNode([_e,Ge]),mutatedTarget:je||We}:i}return i}function re(Re,_e,je=0){let Ge=!1;const We=oLe(u,Re,_e,wPe|je,OPe,{moduleResolverHost:l,trackSymbol(){return!0},reportTruncationError(){Ge=!0}});if(!We)return;const at=Mpe(We,_,d);return Ge?L.createKeywordTypeNode(133):at}function be(Re,_e,je=0){let Ge=!1;const We=aLe(u,_,Re,_e,d,wPe|je,OPe,{moduleResolverHost:l,trackSymbol(){return!0},reportTruncationError(){Ge=!0}});return Ge?L.createKeywordTypeNode(133):We}function Ne(Re){const{typeNode:_e}=fe(Re);if(_e)return Re.type?o.replaceNode(Wn(Re),Re.type,_e):o.tryInsertTypeAnnotation(Wn(Re),Re,_e),[f.Add_annotation_of_type_0,Be(_e)]}function Be(Re){Cr(Re,1);const _e=E.printNode(4,Re,s);return _e.length>GN?_e.substring(0,GN-3)+"...":(Cr(Re,0),_e)}function lt(Re){return Dn(Re,_e=>ptt.has(_e.kind)&&(!ff(_e)&&!pv(_e)||yi(_e.parent)))}function ce(Re,_e){for(;Re&&Re.end<_e.start+_e.length;)Re=Re.parent;for(;Re.parent.pos===Re.pos&&Re.parent.end===Re.end;)Re=Re.parent;return He(Re)&&Zy(Re.parent)&&Re.parent.initializer?Re.parent.initializer:Re}}var Epe="fixAwaitInSyncFunction",FPe=[f.await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,f.await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,f.for_await_loops_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules.code,f.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function.code];Sa({errorCodes:FPe,getCodeActions(e){const{sourceFile:t,span:r}=e,i=zPe(t,r.start);if(!i)return;const o=Rr.ChangeTracker.with(e,s=>BPe(s,t,i));return[oa(Epe,o,f.Add_async_modifier_to_containing_function,Epe,f.Add_all_missing_async_modifiers)]},fixIds:[Epe],getAllCodeActions:function(t){const r=new Set;return Ss(t,FPe,(i,o)=>{const s=zPe(o.file,o.start);!s||!gm(r,ls(s.insertBefore))||BPe(i,t.sourceFile,s)})}});function ftt(e){if(e.type)return e.type;if(yi(e.parent)&&e.parent.type&&w_(e.parent.type))return e.parent.type.type}function zPe(e,t){const r=Fi(e,t),i=df(r);if(!i)return;let o;switch(i.kind){case 175:o=i.name;break;case 263:case 219:o=Es(i,100,e);break;case 220:const s=i.typeParameters?30:21;o=Es(i,s,e)||$a(i.parameters);break;default:return}return o&&{insertBefore:o,returnType:ftt(i)}}function BPe(e,t,{insertBefore:r,returnType:i}){if(i){const o=ck(i);(!o||o.kind!==80||o.text!=="Promise")&&e.replaceNode(t,i,L.createTypeReferenceNode("Promise",L.createNodeArray([i])))}e.insertModifierBefore(t,134,r)}var GPe=[f._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,f._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code],Ape="fixPropertyOverrideAccessor";Sa({errorCodes:GPe,getCodeActions(e){const t=VPe(e.sourceFile,e.span.start,e.span.length,e.errorCode,e);if(t)return[oa(Ape,t,f.Generate_get_and_set_accessors,Ape,f.Generate_get_and_set_accessors_for_all_overriding_properties)]},fixIds:[Ape],getAllCodeActions:e=>Ss(e,GPe,(t,r)=>{const i=VPe(r.file,r.start,r.length,r.code,e);if(i)for(const o of i)t.pushRaw(e.sourceFile,o)})});function VPe(e,t,r,i,o){let s,l;if(i===f._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code)s=t,l=t+r;else if(i===f._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor.code){const u=o.program.getTypeChecker(),d=Fi(e,t).parent;if(va(d))return;C.assert(fb(d),"error span of fixPropertyOverrideAccessor should only be on an accessor");const _=d.parent;C.assert(ui(_),"erroneous accessors should only be inside classes");const h=lh(_);if(!h)return;const g=us(h.expression),E=dc(g)?g.symbol:u.getSymbolAtLocation(g);if(!E)return;const A=u.getDeclaredTypeOfSymbol(E),R=u.getPropertyOfType(A,Gi(hI(d.name)));if(!R||!R.valueDeclaration)return;s=R.valueDeclaration.pos,l=R.valueDeclaration.end,e=Wn(R.valueDeclaration)}else C.fail("fixPropertyOverrideAccessor codefix got unexpected error code "+i);return uLe(e,o.program,s,l,o,f.Generate_get_and_set_accessors.message)}var Ipe="inferFromUsage",jPe=[f.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code,f.Variable_0_implicitly_has_an_1_type.code,f.Parameter_0_implicitly_has_an_1_type.code,f.Rest_parameter_0_implicitly_has_an_any_type.code,f.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code,f._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code,f.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code,f.Member_0_implicitly_has_an_1_type.code,f.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code,f.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,f.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,f.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code,f.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code,f._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code,f.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code,f.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code,f.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code];Sa({errorCodes:jPe,getCodeActions(e){const{sourceFile:t,program:r,span:{start:i},errorCode:o,cancellationToken:s,host:l,preferences:u}=e,d=Fi(t,i);let _;const h=Rr.ChangeTracker.with(e,E=>{_=UPe(E,t,d,o,r,s,dS,l,u)}),g=_&&Oo(_);return!g||h.length===0?void 0:[oa(Ipe,h,[mtt(o,d),Al(g)],Ipe,f.Infer_all_types_from_usage)]},fixIds:[Ipe],getAllCodeActions(e){const{sourceFile:t,program:r,cancellationToken:i,host:o,preferences:s}=e,l=tC();return Ss(e,jPe,(u,d)=>{UPe(u,t,Fi(d.file,d.start),d.code,r,i,l,o,s)})}});function mtt(e,t){switch(e){case f.Parameter_0_implicitly_has_an_1_type.code:case f.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return gp(df(t))?f.Infer_type_of_0_from_usage:f.Infer_parameter_types_from_usage;case f.Rest_parameter_0_implicitly_has_an_any_type.code:case f.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return f.Infer_parameter_types_from_usage;case f.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:return f.Infer_this_type_of_0_from_usage;default:return f.Infer_type_of_0_from_usage}}function htt(e){switch(e){case f.Variable_0_implicitly_has_type_1_in_some_locations_but_a_better_type_may_be_inferred_from_usage.code:return f.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code;case f.Variable_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return f.Variable_0_implicitly_has_an_1_type.code;case f.Parameter_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return f.Parameter_0_implicitly_has_an_1_type.code;case f.Rest_parameter_0_implicitly_has_an_any_type_but_a_better_type_may_be_inferred_from_usage.code:return f.Rest_parameter_0_implicitly_has_an_any_type.code;case f.Property_0_implicitly_has_type_any_but_a_better_type_for_its_get_accessor_may_be_inferred_from_usage.code:return f.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code;case f._0_implicitly_has_an_1_return_type_but_a_better_type_may_be_inferred_from_usage.code:return f._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code;case f.Property_0_implicitly_has_type_any_but_a_better_type_for_its_set_accessor_may_be_inferred_from_usage.code:return f.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code;case f.Member_0_implicitly_has_an_1_type_but_a_better_type_may_be_inferred_from_usage.code:return f.Member_0_implicitly_has_an_1_type.code}return e}function UPe(e,t,r,i,o,s,l,u,d){if(!WN(r.kind)&&r.kind!==80&&r.kind!==26&&r.kind!==110)return;const{parent:_}=r,h=aE(t,o,d,u);switch(i=htt(i),i){case f.Member_0_implicitly_has_an_1_type.code:case f.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code:if(yi(_)&&l(_)||Po(_)||Su(_))return HPe(e,h,t,_,o,u,s),h.writeFixes(e),_;if(qr(_)){const A=YO(_.name,o,s),R=OP(A,_,o,u);if(R){const N=L.createJSDocTypeTag(void 0,L.createJSDocTypeExpression(R),void 0);e.addJSDocTags(t,ma(_.parent.parent,od),[N])}return h.writeFixes(e),_}return;case f.Variable_0_implicitly_has_an_1_type.code:{const A=o.getTypeChecker().getSymbolAtLocation(r);return A&&A.valueDeclaration&&yi(A.valueDeclaration)&&l(A.valueDeclaration)?(HPe(e,h,Wn(A.valueDeclaration),A.valueDeclaration,o,u,s),h.writeFixes(e),A.valueDeclaration):void 0}}const g=df(r);if(g===void 0)return;let E;switch(i){case f.Parameter_0_implicitly_has_an_1_type.code:if(gp(g)){qPe(e,h,t,g,o,u,s),E=g;break}case f.Rest_parameter_0_implicitly_has_an_any_type.code:if(l(g)){const A=ma(_,to);_tt(e,h,t,A,g,o,u,s),E=A}break;case f.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code:case f._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code:Hf(g)&&He(g.name)&&(wK(e,h,t,g,YO(g.name,o,s),o,u),E=g);break;case f.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code:gp(g)&&(qPe(e,h,t,g,o,u,s),E=g);break;case f.this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation.code:Rr.isThisTypeAnnotatable(g)&&l(g)&&(gtt(e,t,g,o,u,s),E=g);break;default:return C.fail(String(i))}return h.writeFixes(e),E}function HPe(e,t,r,i,o,s,l){He(i.name)&&wK(e,t,r,i,YO(i.name,o,l),o,s)}function _tt(e,t,r,i,o,s,l,u){if(!He(i.name))return;const d=btt(o,r,s,u);if(C.assert(o.parameters.length===d.length,"Parameter count and inference count should match"),Ir(o))JPe(e,r,d,s,l);else{const _=Xs(o)&&!Es(o,21,r);_&&e.insertNodeBefore(r,$a(o.parameters),L.createToken(21));for(const{declaration:h,type:g}of d)h&&!h.type&&!h.initializer&&wK(e,t,r,h,g,s,l);_&&e.insertNodeAfter(r,Ba(o.parameters),L.createToken(22))}}function gtt(e,t,r,i,o,s){const l=KPe(r,t,i,s);if(!l||!l.length)return;const u=Rpe(i,l,s).thisParameter(),d=OP(u,r,i,o);d&&(Ir(r)?ytt(e,t,r,d):e.tryInsertThisTypeAnnotation(t,r,d))}function ytt(e,t,r,i){e.addJSDocTags(t,r,[L.createJSDocThisTag(void 0,L.createJSDocTypeExpression(i))])}function qPe(e,t,r,i,o,s,l){const u=Ac(i.parameters);if(u&&He(i.name)&&He(u.name)){let d=YO(i.name,o,l);d===o.getTypeChecker().getAnyType()&&(d=YO(u.name,o,l)),Ir(i)?JPe(e,r,[{declaration:u,type:d}],o,s):wK(e,t,r,u,d,o,s)}}function wK(e,t,r,i,o,s,l){const u=OP(o,i,s,l);if(u)if(Ir(r)&&i.kind!==172){const d=yi(i)?ni(i.parent.parent,ac):i;if(!d)return;const _=L.createJSDocTypeExpression(u),h=Hf(i)?L.createJSDocReturnTag(void 0,_,void 0):L.createJSDocTypeTag(void 0,_,void 0);e.addJSDocTags(r,d,[h])}else vtt(u,i,r,e,t,Ga(s.getCompilerOptions()))||e.tryInsertTypeAnnotation(r,i,u)}function vtt(e,t,r,i,o,s){const l=sE(e,s);return l&&i.tryInsertTypeAnnotation(r,t,l.typeNode)?(Ye(l.symbols,u=>o.addImportFromExportedSymbol(u,!0)),!0):!1}function JPe(e,t,r,i,o){const s=r.length&&r[0].declaration.parent;if(!s)return;const l=Ui(r,u=>{const d=u.declaration;if(d.initializer||$y(d)||!He(d.name))return;const _=u.type&&OP(u.type,d,i,o);if(_){const h=L.cloneNode(d.name);return Cr(h,7168),{name:L.cloneNode(d.name),param:d,isOptional:!!u.isOptional,typeNode:_}}});if(l.length)if(Xs(s)||Us(s)){const u=Xs(s)&&!Es(s,21,t);u&&e.insertNodeBefore(t,$a(s.parameters),L.createToken(21)),Ye(l,({typeNode:d,param:_})=>{const h=L.createJSDocTypeTag(void 0,L.createJSDocTypeExpression(d)),g=L.createJSDocComment(void 0,[h]);e.insertNodeAt(t,_.getStart(t),g,{suffix:" "})}),u&&e.insertNodeAfter(t,Ba(s.parameters),L.createToken(22))}else{const u=Vt(l,({name:d,typeNode:_,isOptional:h})=>L.createJSDocParameterTag(void 0,d,!!h,L.createJSDocTypeExpression(_),!1,void 0));e.addJSDocTags(t,s,u)}}function xpe(e,t,r){return Ui(Ys.getReferenceEntriesForNode(-1,e,t,t.getSourceFiles(),r),i=>i.kind!==Ys.EntryKind.Span?ni(i.node,He):void 0)}function YO(e,t,r){const i=xpe(e,t,r);return Rpe(t,i,r).single()}function btt(e,t,r,i){const o=KPe(e,t,r,i);return o&&Rpe(r,o,i).parameters(e)||e.parameters.map(s=>({declaration:s,type:He(s.name)?YO(s.name,r,i):r.getTypeChecker().getAnyType()}))}function KPe(e,t,r,i){let o;switch(e.kind){case 177:o=Es(e,137,t);break;case 220:case 219:const s=e.parent;o=(yi(s)||Po(s))&&He(s.name)?s.name:e.name;break;case 263:case 175:case 174:o=e.name;break}if(o)return xpe(o,r,i)}function Rpe(e,t,r){const i=e.getTypeChecker(),o={string:()=>i.getStringType(),number:()=>i.getNumberType(),Array:be=>i.createArrayType(be),Promise:be=>i.createPromiseType(be)},s=[i.getStringType(),i.getNumberType(),i.createArrayType(i.getAnyType()),i.createPromiseType(i.getAnyType())];return{single:d,parameters:_,thisParameter:h};function l(){return{isNumber:void 0,isString:void 0,isNumberOrString:void 0,candidateTypes:void 0,properties:void 0,calls:void 0,constructs:void 0,numberIndex:void 0,stringIndex:void 0,candidateThisTypes:void 0,inferredTypes:void 0}}function u(be){const Ne=new Map;for(const lt of be)lt.properties&&lt.properties.forEach((ce,Re)=>{Ne.has(Re)||Ne.set(Re,[]),Ne.get(Re).push(ce)});const Be=new Map;return Ne.forEach((lt,ce)=>{Be.set(ce,u(lt))}),{isNumber:be.some(lt=>lt.isNumber),isString:be.some(lt=>lt.isString),isNumberOrString:be.some(lt=>lt.isNumberOrString),candidateTypes:Ki(be,lt=>lt.candidateTypes),properties:Be,calls:Ki(be,lt=>lt.calls),constructs:Ki(be,lt=>lt.constructs),numberIndex:Ye(be,lt=>lt.numberIndex),stringIndex:Ye(be,lt=>lt.stringIndex),candidateThisTypes:Ki(be,lt=>lt.candidateThisTypes),inferredTypes:void 0}}function d(){return ye(g(t))}function _(be){if(t.length===0||!be.parameters)return;const Ne=l();for(const lt of t)r.throwIfCancellationRequested(),E(lt,Ne);const Be=[...Ne.constructs||[],...Ne.calls||[]];return be.parameters.map((lt,ce)=>{const Re=[],_e=C_(lt);let je=!1;for(const We of Be)if(We.argumentTypes.length<=ce)je=Ir(be),Re.push(i.getUndefinedType());else if(_e)for(let at=ce;at<We.argumentTypes.length;at++)Re.push(i.getBaseTypeOfLiteralType(We.argumentTypes[at]));else Re.push(i.getBaseTypeOfLiteralType(We.argumentTypes[ce]));if(He(lt.name)){const We=g(xpe(lt.name,e,r));Re.push(..._e?Ui(We,i.getElementTypeOfArrayType):We)}const Ge=ye(Re);return{type:_e?i.createArrayType(Ge):Ge,isOptional:je&&!_e,declaration:lt}})}function h(){const be=l();for(const Ne of t)r.throwIfCancellationRequested(),E(Ne,be);return ye(be.candidateThisTypes||ae)}function g(be){const Ne=l();for(const Be of be)r.throwIfCancellationRequested(),E(Be,Ne);return K(Ne)}function E(be,Ne){for(;fM(be);)be=be.parent;switch(be.parent.kind){case 245:R(be,Ne);break;case 226:Ne.isNumber=!0;break;case 225:N(be.parent,Ne);break;case 227:P(be,be.parent,Ne);break;case 297:case 298:k(be.parent,Ne);break;case 214:case 215:be.parent.expression===be?W(be.parent,Ne):A(be,Ne);break;case 212:O(be.parent,Ne);break;case 213:G(be.parent,be,Ne);break;case 304:case 305:j(be.parent,Ne);break;case 173:J(be.parent,Ne);break;case 261:{const{name:Be,initializer:lt}=be.parent;if(be===Be){lt&&Se(Ne,i.getTypeAtLocation(lt));break}}default:return A(be,Ne)}}function A(be,Ne){P_(be)&&Se(Ne,i.getContextualType(be))}function R(be,Ne){Se(Ne,Zo(be)?i.getVoidType():i.getAnyType())}function N(be,Ne){switch(be.operator){case 46:case 47:case 41:case 55:Ne.isNumber=!0;break;case 40:Ne.isNumberOrString=!0;break}}function P(be,Ne,Be){switch(Ne.operatorToken.kind){case 43:case 42:case 44:case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 66:case 68:case 67:case 69:case 70:case 74:case 75:case 79:case 71:case 73:case 72:case 41:case 30:case 33:case 32:case 34:const lt=i.getTypeAtLocation(Ne.left===be?Ne.right:Ne.left);lt.flags&1056?Se(Be,lt):Be.isNumber=!0;break;case 65:case 40:const ce=i.getTypeAtLocation(Ne.left===be?Ne.right:Ne.left);ce.flags&1056?Se(Be,ce):ce.flags&296?Be.isNumber=!0:ce.flags&402653316?Be.isString=!0:ce.flags&1||(Be.isNumberOrString=!0);break;case 64:case 35:case 37:case 38:case 36:case 77:case 78:case 76:Se(Be,i.getTypeAtLocation(Ne.left===be?Ne.right:Ne.left));break;case 103:be===Ne.left&&(Be.isString=!0);break;case 57:case 61:be===Ne.left&&(be.parent.parent.kind===261||id(be.parent.parent,!0))&&Se(Be,i.getTypeAtLocation(Ne.right));break}}function k(be,Ne){Se(Ne,i.getTypeAtLocation(be.parent.parent.expression))}function W(be,Ne){const Be={argumentTypes:[],return_:l()};if(be.arguments)for(const lt of be.arguments)Be.argumentTypes.push(i.getTypeAtLocation(lt));E(be,Be.return_),be.kind===214?(Ne.calls||(Ne.calls=[])).push(Be):(Ne.constructs||(Ne.constructs=[])).push(Be)}function O(be,Ne){const Be=Cl(be.name.text);Ne.properties||(Ne.properties=new Map);const lt=Ne.properties.get(Be)||l();E(be,lt),Ne.properties.set(Be,lt)}function G(be,Ne,Be){if(Ne===be.argumentExpression){Be.isNumberOrString=!0;return}else{const lt=i.getTypeAtLocation(be.argumentExpression),ce=l();E(be,ce),lt.flags&296?Be.numberIndex=ce:Be.stringIndex=ce}}function j(be,Ne){const Be=yi(be.parent.parent)?be.parent.parent:be.parent;re(Ne,i.getTypeAtLocation(Be))}function J(be,Ne){re(Ne,i.getTypeAtLocation(be.parent))}function Z(be,Ne){const Be=[];for(const lt of be)for(const{high:ce,low:Re}of Ne)ce(lt)&&(C.assert(!Re(lt),"Priority can't have both low and high"),Be.push(Re));return be.filter(lt=>Be.every(ce=>!ce(lt)))}function q(be){return ye(K(be))}function ye(be){if(!be.length)return i.getAnyType();const Ne=i.getUnionType([i.getStringType(),i.getNumberType()]);let lt=Z(be,[{high:Re=>Re===i.getStringType()||Re===i.getNumberType(),low:Re=>Re===Ne},{high:Re=>!(Re.flags&16385),low:Re=>!!(Re.flags&16385)},{high:Re=>!(Re.flags&114689)&&!(Hr(Re)&16),low:Re=>!!(Hr(Re)&16)}]);const ce=lt.filter(Re=>Hr(Re)&16);return ce.length&&(lt=lt.filter(Re=>!(Hr(Re)&16)),lt.push(ie(ce))),i.getWidenedType(i.getUnionType(lt.map(i.getBaseTypeOfLiteralType),2))}function ie(be){if(be.length===1)return be[0];const Ne=[],Be=[],lt=[],ce=[];let Re=!1,_e=!1;const je=cm();for(const at of be){for(const gn of i.getPropertiesOfType(at))je.add(gn.escapedName,gn.valueDeclaration?i.getTypeOfSymbolAtLocation(gn,gn.valueDeclaration):i.getAnyType());Ne.push(...i.getSignaturesOfType(at,0)),Be.push(...i.getSignaturesOfType(at,1));const Wt=i.getIndexInfoOfType(at,0);Wt&&(lt.push(Wt.type),Re=Re||Wt.isReadonly);const cn=i.getIndexInfoOfType(at,1);cn&&(ce.push(cn.type),_e=_e||cn.isReadonly)}const Ge=GQ(je,(at,Wt)=>{const cn=Wt.length<be.length?16777216:0,gn=i.createSymbol(4|cn,at);return gn.links.type=i.getUnionType(Wt),[at,gn]}),We=[];return lt.length&&We.push(i.createIndexInfo(i.getStringType(),i.getUnionType(lt),Re)),ce.length&&We.push(i.createIndexInfo(i.getNumberType(),i.getUnionType(ce),_e)),i.createAnonymousType(be[0].symbol,Ge,Ne,Be,We)}function K(be){var Ne,Be,lt;const ce=[];be.isNumber&&ce.push(i.getNumberType()),be.isString&&ce.push(i.getStringType()),be.isNumberOrString&&ce.push(i.getUnionType([i.getStringType(),i.getNumberType()])),be.numberIndex&&ce.push(i.createArrayType(q(be.numberIndex))),((Ne=be.properties)!=null&&Ne.size||(Be=be.constructs)!=null&&Be.length||be.stringIndex)&&ce.push(pe(be));const Re=(be.candidateTypes||[]).map(je=>i.getBaseTypeOfLiteralType(je)),_e=(lt=be.calls)!=null&&lt.length?pe(be):void 0;return _e&&Re?ce.push(i.getUnionType([_e,...Re],2)):(_e&&ce.push(_e),et(Re)&&ce.push(...Re)),ce.push(...de(be)),ce}function pe(be){const Ne=new Map;be.properties&&be.properties.forEach((Re,_e)=>{const je=i.createSymbol(4,_e);je.links.type=q(Re),Ne.set(_e,je)});const Be=be.calls?[Je(be.calls)]:[],lt=be.constructs?[Je(be.constructs)]:[],ce=be.stringIndex?[i.createIndexInfo(i.getStringType(),q(be.stringIndex),!1)]:[];return i.createAnonymousType(void 0,Ne,Be,lt,ce)}function de(be){if(!be.properties||!be.properties.size)return[];const Ne=s.filter(Be=>fe(Be,be));return 0<Ne.length&&Ne.length<3?Ne.map(Be=>ve(Be,be)):[]}function fe(be,Ne){return Ne.properties?!Hc(Ne.properties,(Be,lt)=>{const ce=i.getTypeOfPropertyOfType(be,lt);return ce?Be.calls?!i.getSignaturesOfType(ce,0).length||!i.isTypeAssignableTo(ce,Ce(Be.calls)):!i.isTypeAssignableTo(ce,q(Be)):!0}):!1}function ve(be,Ne){if(!(Hr(be)&4)||!Ne.properties)return be;const Be=be.target,lt=og(Be.typeParameters);if(!lt)return be;const ce=[];return Ne.properties.forEach((Re,_e)=>{const je=i.getTypeOfPropertyOfType(Be,_e);C.assert(!!je,"generic should have all the properties of its reference."),ce.push(...xe(je,q(Re),lt))}),o[be.symbol.escapedName](ye(ce))}function xe(be,Ne,Be){if(be===Be)return[Ne];if(be.flags&3145728)return Ki(be.types,Re=>xe(Re,Ne,Be));if(Hr(be)&4&&Hr(Ne)&4){const Re=i.getTypeArguments(be),_e=i.getTypeArguments(Ne),je=[];if(Re&&_e)for(let Ge=0;Ge<Re.length;Ge++)_e[Ge]&&je.push(...xe(Re[Ge],_e[Ge],Be));return je}const lt=i.getSignaturesOfType(be,0),ce=i.getSignaturesOfType(Ne,0);return lt.length===1&&ce.length===1?X(lt[0],ce[0],Be):[]}function X(be,Ne,Be){var lt;const ce=[];for(let je=0;je<be.parameters.length;je++){const Ge=be.parameters[je],We=Ne.parameters[je],at=be.declaration&&C_(be.declaration.parameters[je]);if(!We)break;let Wt=Ge.valueDeclaration?i.getTypeOfSymbolAtLocation(Ge,Ge.valueDeclaration):i.getAnyType();const cn=at&&i.getElementTypeOfArrayType(Wt);cn&&(Wt=cn);const gn=((lt=ni(We,pg))==null?void 0:lt.links.type)||(We.valueDeclaration?i.getTypeOfSymbolAtLocation(We,We.valueDeclaration):i.getAnyType());ce.push(...xe(Wt,gn,Be))}const Re=i.getReturnTypeOfSignature(be),_e=i.getReturnTypeOfSignature(Ne);return ce.push(...xe(Re,_e,Be)),ce}function Ce(be){return i.createAnonymousType(void 0,da(),[Je(be)],ae,ae)}function Je(be){const Ne=[],Be=Math.max(...be.map(ce=>ce.argumentTypes.length));for(let ce=0;ce<Be;ce++){const Re=i.createSymbol(1,Cl(`arg${ce}`));Re.links.type=ye(be.map(_e=>_e.argumentTypes[ce]||i.getUndefinedType())),be.some(_e=>_e.argumentTypes[ce]===void 0)&&(Re.flags|=16777216),Ne.push(Re)}const lt=q(u(be.map(ce=>ce.return_)));return i.createSignature(void 0,void 0,void 0,Ne,lt,void 0,Be,0)}function Se(be,Ne){Ne&&!(Ne.flags&1)&&!(Ne.flags&131072)&&(be.candidateTypes||(be.candidateTypes=[])).push(Ne)}function re(be,Ne){Ne&&!(Ne.flags&1)&&!(Ne.flags&131072)&&(be.candidateThisTypes||(be.candidateThisTypes=[])).push(Ne)}}var Dpe="fixReturnTypeInAsyncFunction",XPe=[f.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0.code];Sa({errorCodes:XPe,fixIds:[Dpe],getCodeActions:function(t){const{sourceFile:r,program:i,span:o}=t,s=i.getTypeChecker(),l=YPe(r,i.getTypeChecker(),o.start);if(!l)return;const{returnTypeNode:u,returnType:d,promisedTypeNode:_,promisedType:h}=l,g=Rr.ChangeTracker.with(t,E=>$Pe(E,r,u,_));return[oa(Dpe,g,[f.Replace_0_with_Promise_1,s.typeToString(d),s.typeToString(h)],Dpe,f.Fix_all_incorrect_return_type_of_an_async_functions)]},getAllCodeActions:e=>Ss(e,XPe,(t,r)=>{const i=YPe(r.file,e.program.getTypeChecker(),r.start);i&&$Pe(t,r.file,i.returnTypeNode,i.promisedTypeNode)})});function YPe(e,t,r){if(Ir(e))return;const i=Fi(e,r),o=Dn(i,Ms),s=o?.type;if(!s)return;const l=t.getTypeFromTypeNode(s),u=t.getAwaitedType(l)||t.getVoidType(),d=t.typeToTypeNode(u,s,void 0);if(d)return{returnTypeNode:s,returnType:l,promisedTypeNode:d,promisedType:u}}function $Pe(e,t,r,i){e.replaceNode(t,r,L.createTypeReferenceNode("Promise",[i]))}var QPe="disableJsDiagnostics",ZPe="disableJsDiagnostics",eLe=Ui(Object.keys(f),e=>{const t=f[e];return t.category===1?t.code:void 0});Sa({errorCodes:eLe,getCodeActions:function(t){const{sourceFile:r,program:i,span:o,host:s,formatContext:l}=t;if(!Ir(r)||!IM(r,i.getCompilerOptions()))return;const u=r.checkJsDirective?"":_y(s,l.options),d=[yh(QPe,[jDe(r.fileName,[SO(r.checkJsDirective?ic(r.checkJsDirective.pos,r.checkJsDirective.end):Id(0,0),`// @ts-nocheck${u}`)])],f.Disable_checking_for_this_file)];return Rr.isValidLocationToAddComment(r,o.start)&&d.unshift(oa(QPe,Rr.ChangeTracker.with(t,_=>tLe(_,r,o.start)),f.Ignore_this_error_message,ZPe,f.Add_ts_ignore_to_all_error_messages)),d},fixIds:[ZPe],getAllCodeActions:e=>{const t=new Set;return Ss(e,eLe,(r,i)=>{Rr.isValidLocationToAddComment(i.file,i.start)&&tLe(r,i.file,i.start,t)})}});function tLe(e,t,r,i){const{line:o}=ca(t,r);(!i||rh(i,o))&&e.insertCommentBeforeLine(t,o,r," @ts-ignore")}function Cpe(e,t,r,i,o,s,l){const u=e.symbol.members;for(const d of t)u.has(d.escapedName)||rLe(d,e,r,i,o,s,l,void 0)}function pC(e){return{trackSymbol:()=>!1,moduleResolverHost:Kq(e.program,e.host)}}var nLe=(e=>(e[e.Method=1]="Method",e[e.Property=2]="Property",e[e.All=3]="All",e))(nLe||{});function rLe(e,t,r,i,o,s,l,u,d=3,_=!1){const h=e.getDeclarations(),g=Ac(h),E=i.program.getTypeChecker(),A=Ga(i.program.getCompilerOptions()),R=g?.kind??172,N=fe(e,g),P=g?Gd(g):0;let k=P&256;k|=P&1?1:P&4?4:0,g&&Yu(g)&&(k|=512);const W=ye(),O=E.getWidenedType(E.getTypeOfSymbolAtLocation(e,t)),G=!!(e.flags&16777216),j=!!(t.flags&33554432)||_,J=Gp(r,o),Z=1|(J===0?268435456:0);switch(R){case 172:case 173:let ve=E.typeToTypeNode(O,t,Z,8,pC(i));if(s){const X=sE(ve,A);X&&(ve=X.typeNode,G1(s,X.symbols))}l(L.createPropertyDeclaration(W,g?K(N):e.getName(),G&&d&2?L.createToken(58):void 0,ve,void 0));break;case 178:case 179:{C.assertIsDefined(h);let X=E.typeToTypeNode(O,t,Z,void 0,pC(i));const Ce=MS(h,g),Je=Ce.secondAccessor?[Ce.firstAccessor,Ce.secondAccessor]:[Ce.firstAccessor];if(s){const Se=sE(X,A);Se&&(X=Se.typeNode,G1(s,Se.symbols))}for(const Se of Je)if(Hf(Se))l(L.createGetAccessorDeclaration(W,K(N),ae,de(X),pe(u,J,j)));else{C.assertNode(Se,gp,"The counterpart to a getter should be a setter");const re=uM(Se),be=re&&He(re.name)?Kr(re.name):void 0;l(L.createSetAccessorDeclaration(W,K(N),Ppe(1,[be],[de(X)],1,!1),pe(u,J,j)))}break}case 174:case 175:C.assertIsDefined(h);const xe=O.isUnion()?Ki(O.types,X=>X.getCallSignatures()):O.getCallSignatures();if(!yt(xe))break;if(h.length===1){C.assert(xe.length===1,"One declaration implies one signature");const X=xe[0];q(J,X,W,K(N),pe(u,J,j));break}for(const X of xe)X.declaration&&X.declaration.flags&33554432||q(J,X,W,K(N));if(!j)if(h.length>xe.length){const X=E.getSignatureFromDeclaration(h[h.length-1]);q(J,X,W,K(N),pe(u,J))}else C.assert(h.length===xe.length,"Declarations and signatures should match count"),l(Itt(E,i,t,xe,K(N),G&&!!(d&1),W,J,u));break}function q(ve,xe,X,Ce,Je){const Se=OK(175,i,ve,xe,Je,Ce,X,G&&!!(d&1),t,s);Se&&l(Se)}function ye(){let ve;return k&&(ve=XA(ve,L.createModifiersFromModifierFlags(k))),ie()&&(ve=Bn(ve,L.createToken(164))),ve&&L.createNodeArray(ve)}function ie(){return!!(i.program.getCompilerOptions().noImplicitOverride&&g&&PS(g))}function K(ve){return He(ve)&&ve.escapedText==="constructor"?L.createComputedPropertyName(L.createStringLiteral(Kr(ve),J===0)):_s(ve,!1)}function pe(ve,xe,X){return X?void 0:_s(ve,!1)||Lpe(xe)}function de(ve){return _s(ve,!1)}function fe(ve,xe){if(Wl(ve)&262144){const X=ve.links.nameType;if(X&&jf(X))return L.createIdentifier(Gi(Uf(X)))}return _s(Oo(xe),!1)}}function OK(e,t,r,i,o,s,l,u,d,_){const h=t.program,g=h.getTypeChecker(),E=Ga(h.getCompilerOptions()),A=Ir(d),R=524545|(r===0?268435456:0),N=g.signatureToSignatureDeclaration(i,e,d,R,8,pC(t));if(!N)return;let P=A?void 0:N.typeParameters,k=N.parameters,W=A?void 0:_s(N.type);if(_){if(P){const J=Zi(P,Z=>{let q=Z.constraint,ye=Z.default;if(q){const ie=sE(q,E);ie&&(q=ie.typeNode,G1(_,ie.symbols))}if(ye){const ie=sE(ye,E);ie&&(ye=ie.typeNode,G1(_,ie.symbols))}return L.updateTypeParameterDeclaration(Z,Z.modifiers,Z.name,q,ye)});P!==J&&(P=vt(L.createNodeArray(J,P.hasTrailingComma),P))}const j=Zi(k,J=>{let Z=A?void 0:J.type;if(Z){const q=sE(Z,E);q&&(Z=q.typeNode,G1(_,q.symbols))}return L.updateParameterDeclaration(J,J.modifiers,J.dotDotDotToken,J.name,A?void 0:J.questionToken,Z,J.initializer)});if(k!==j&&(k=vt(L.createNodeArray(j,k.hasTrailingComma),k)),W){const J=sE(W,E);J&&(W=J.typeNode,G1(_,J.symbols))}}const O=u?L.createToken(58):void 0,G=N.asteriskToken;if(Us(N))return L.updateFunctionExpression(N,l,N.asteriskToken,ni(s,He),P,k,W,o??N.body);if(Xs(N))return L.updateArrowFunction(N,l,P,k,W,N.equalsGreaterThanToken,o??N.body);if(Nl(N))return L.updateMethodDeclaration(N,l,G,s??L.createIdentifier(""),O,P,k,W,o);if(Zl(N))return L.updateFunctionDeclaration(N,l,N.asteriskToken,ni(s,He),P,k,W,o??N.body)}function Npe(e,t,r,i,o,s,l){const u=Gp(t.sourceFile,t.preferences),d=Ga(t.program.getCompilerOptions()),_=pC(t),h=t.program.getTypeChecker(),g=Ir(l),{typeArguments:E,arguments:A,parent:R}=i,N=g?void 0:h.getContextualType(i),P=Vt(A,ye=>He(ye)?ye.text:qr(ye)&&He(ye.name)?ye.name.text:void 0),k=g?[]:Vt(A,ye=>h.getTypeAtLocation(ye)),{argumentTypeNodes:W,argumentTypeParameters:O}=Ett(h,r,k,l,d,1,8,_),G=s?L.createNodeArray(L.createModifiersFromModifierFlags(s)):void 0,j=_w(R)?L.createToken(42):void 0,J=g?void 0:Ttt(h,O,E),Z=Ppe(A.length,P,W,void 0,g),q=g||N===void 0?void 0:h.typeToTypeNode(N,l,void 0,void 0,_);switch(e){case 175:return L.createMethodDeclaration(G,j,o,void 0,J,Z,q,Lpe(u));case 174:return L.createMethodSignature(G,o,void 0,J,Z,q===void 0?L.createKeywordTypeNode(159):q);case 263:return C.assert(typeof o=="string"||He(o),"Unexpected name"),L.createFunctionDeclaration(G,j,o,J,Z,q,mz(f.Function_not_implemented.message,u));default:C.fail("Unexpected kind")}}function Ttt(e,t,r){const i=new Set(t.map(s=>s[0])),o=new Map(t);if(r){const s=r.filter(u=>!t.some(d=>{var _;return e.getTypeAtLocation(u)===((_=d[1])==null?void 0:_.argumentType)})),l=i.size+s.length;for(let u=0;i.size<l;u+=1)i.add(iLe(u))}return Co(i.values(),s=>{var l;return L.createTypeParameterDeclaration(void 0,s,(l=o.get(s))==null?void 0:l.constraint)})}function iLe(e){return 84+e<=90?String.fromCharCode(84+e):`T${e}`}function WK(e,t,r,i,o,s,l,u){const d=e.typeToTypeNode(r,i,s,l,u);if(d)return Mpe(d,t,o)}function Mpe(e,t,r){const i=sE(e,r);return i&&(G1(t,i.symbols),e=i.typeNode),_s(e)}function Stt(e,t){var r;C.assert(t.typeArguments);const i=t.typeArguments,o=t.target;for(let s=0;s<i.length;s++){if(((r=o.localTypeParameters)==null?void 0:r[s].constraint)===void 0)continue;const l=i.slice(0,s);if(e.fillMissingTypeArguments(l,o.typeParameters,s,!1).every((d,_)=>d===i[_]))return s}return i.length}function oLe(e,t,r,i,o,s){let l=e.typeToTypeNode(t,r,i,o,s);if(l){if(Wp(l)){const u=t;if(u.typeArguments&&l.typeArguments){const d=Stt(e,u);if(d<l.typeArguments.length){const _=L.createNodeArray(l.typeArguments.slice(0,d));l=L.updateTypeReferenceNode(l,l.typeName,_)}}}return l}}function aLe(e,t,r,i,o,s,l,u){let d=e.typePredicateToTypePredicateNode(r,i,s,l,u);if(d?.type&&e_(d.type)){const _=sE(d.type,o);_&&(G1(t,_.symbols),d=L.updateTypePredicateNode(d,d.assertsModifier,d.parameterName,_.typeNode))}return _s(d)}function sLe(e){return e.isUnionOrIntersection()?e.types.some(sLe):e.flags&262144}function Ett(e,t,r,i,o,s,l,u){const d=[],_=new Map;for(let h=0;h<r.length;h+=1){const g=r[h];if(g.isUnionOrIntersection()&&g.types.some(sLe)){const P=iLe(h);d.push(L.createTypeReferenceNode(P)),_.set(P,void 0);continue}const E=e.getBaseTypeOfLiteralType(g),A=WK(e,t,E,i,o,s,l,u);if(!A)continue;d.push(A);const R=lLe(g),N=g.isTypeParameter()&&g.constraint&&!Att(g.constraint)?WK(e,t,g.constraint,i,o,s,l,u):void 0;R&&_.set(R,{argumentType:g,constraint:N})}return{argumentTypeNodes:d,argumentTypeParameters:Co(_.entries())}}function Att(e){return e.flags&524288&&e.objectFlags===16}function lLe(e){var t;if(e.flags&3145728)for(const r of e.types){const i=lLe(r);if(i)return i}return e.flags&262144?(t=e.getSymbol())==null?void 0:t.getName():void 0}function Ppe(e,t,r,i,o){const s=[],l=new Map;for(let u=0;u<e;u++){const d=t?.[u]||`arg${u}`,_=l.get(d);l.set(d,(_||0)+1);const h=L.createParameterDeclaration(void 0,void 0,d+(_||""),i!==void 0&&u>=i?L.createToken(58):void 0,o?void 0:r?.[u]||L.createKeywordTypeNode(159),void 0);s.push(h)}return s}function Itt(e,t,r,i,o,s,l,u,d){let _=i[0],h=i[0].minArgumentCount,g=!1;for(const N of i)h=Math.min(N.minArgumentCount,h),su(N)&&(g=!0),N.parameters.length>=_.parameters.length&&(!su(N)||su(_))&&(_=N);const E=_.parameters.length-(su(_)?1:0),A=_.parameters.map(N=>N.name),R=Ppe(E,A,void 0,h,!1);if(g){const N=L.createParameterDeclaration(void 0,L.createToken(26),A[E]||"rest",E>=h?L.createToken(58):void 0,L.createArrayTypeNode(L.createKeywordTypeNode(159)),void 0);R.push(N)}return Rtt(l,o,s,void 0,R,xtt(i,e,t,r),u,d)}function xtt(e,t,r,i){if(et(e)){const o=t.getUnionType(Vt(e,t.getReturnTypeOfSignature));return t.typeToTypeNode(o,i,1,8,pC(r))}}function Rtt(e,t,r,i,o,s,l,u){return L.createMethodDeclaration(e,void 0,t,r?L.createToken(58):void 0,i,o,s,u||Lpe(l))}function Lpe(e){return mz(f.Method_not_implemented.message,e)}function mz(e,t){return L.createBlock([L.createThrowStatement(L.createNewExpression(L.createIdentifier("Error"),void 0,[L.createStringLiteral(e,t===0)]))],!0)}function kpe(e,t,r){const i=JN(t);if(!i)return;const o=cLe(i,"compilerOptions");if(o===void 0){e.insertNodeAtObjectStart(t,i,Ope("compilerOptions",L.createObjectLiteralExpression(r.map(([l,u])=>Ope(l,u)),!0)));return}const s=o.initializer;if(Wa(s))for(const[l,u]of r){const d=cLe(s,l);d===void 0?e.insertNodeAtObjectStart(t,s,Ope(l,u)):e.replaceNode(t,d.initializer,u)}}function wpe(e,t,r,i){kpe(e,t,[[r,i]])}function Ope(e,t){return L.createPropertyAssignment(L.createStringLiteral(e),t)}function cLe(e,t){return hn(e.properties,r=>Cc(r)&&!!r.name&&ka(r.name)&&r.name.text===t)}function sE(e,t){let r;const i=st(e,o,Ri);if(r&&i)return{typeNode:i,symbols:r};function o(s){if(ry(s)&&s.qualifier){const l=Lu(s.qualifier);if(!l.symbol)return kn(s,o,void 0);const u=O7(l.symbol,t),d=u!==l.text?dLe(s.qualifier,L.createIdentifier(u)):s.qualifier;r=Bn(r,l.symbol);const _=Xn(s.typeArguments,o,Ri);return L.createTypeReferenceNode(d,_)}return kn(s,o,void 0)}}function dLe(e,t){return e.kind===80?t:L.createQualifiedName(dLe(e.left,t),e.right)}function G1(e,t){t.forEach(r=>e.addImportFromExportedSymbol(r,!0))}function Wpe(e,t){const r=Dl(t);let i=Fi(e,t.start);for(;i.end<r;)i=i.parent;return i}function uLe(e,t,r,i,o,s){const l=mLe(e,t,r,i);if(!l||gx.isRefactorErrorInfo(l))return;const u=Rr.ChangeTracker.fromContext(o),{isStatic:d,isReadonly:_,fieldName:h,accessorName:g,originalName:E,type:A,container:R,declaration:N}=l;Op(h),Op(g),Op(N),Op(R);let P,k;if(ui(R)){const O=Gd(N);if(Pu(e)){const G=L.createModifiersFromModifierFlags(O);P=G,k=G}else P=L.createModifiersFromModifierFlags(Ntt(O)),k=L.createModifiersFromModifierFlags(Mtt(O));qS(N)&&(k=so(lb(N),k))}Ott(u,e,N,A,h,k);const W=Ptt(h,g,A,P,d,R);if(Op(W),hLe(u,e,W,N,R),_){const O=yg(R);O&&Wtt(u,e,O,h.text,E)}else{const O=Ltt(h,g,A,P,d,R);Op(O),hLe(u,e,O,N,R)}return u.getChanges()}function Dtt(e){return He(e)||ka(e)}function Ctt(e){return Np(e,e.parent)||Po(e)||Cc(e)}function pLe(e,t){return He(t)?L.createIdentifier(e):L.createStringLiteral(e)}function fLe(e,t,r){const i=t?r.name:L.createThis();return He(e)?L.createPropertyAccessExpression(i,e):L.createElementAccessExpression(i,L.createStringLiteralFromNode(e))}function Ntt(e){return e&=-9,e&=-3,e&4||(e|=1),e}function Mtt(e){return e&=-2,e&=-5,e|=2,e}function mLe(e,t,r,i,o=!0){const s=Fi(e,r),l=r===i&&o,u=Dn(s.parent,Ctt),d=271;if(!u||!(d7(u.name,e,r,i)||l))return{error:Ho(f.Could_not_find_property_for_which_to_generate_accessor)};if(!Dtt(u.name))return{error:Ho(f.Name_is_not_valid)};if((Gd(u)&98303|d)!==d)return{error:Ho(f.Can_only_convert_property_with_modifier)};const _=u.name.text,h=vJ(_),g=pLe(h?_:B1(`_${_}`,e),u.name),E=pLe(h?B1(_.substring(1),e):_,u.name);return{isStatic:wc(u),isReadonly:u1(u),type:Ftt(u,t),container:u.kind===170?u.parent.parent:u.parent,originalName:u.name.text,declaration:u,fieldName:g,accessorName:E,renameAccessor:h}}function Ptt(e,t,r,i,o,s){return L.createGetAccessorDeclaration(i,t,[],r,L.createBlock([L.createReturnStatement(fLe(e,o,s))],!0))}function Ltt(e,t,r,i,o,s){return L.createSetAccessorDeclaration(i,t,[L.createParameterDeclaration(void 0,void 0,L.createIdentifier("value"),void 0,r)],L.createBlock([L.createExpressionStatement(L.createAssignment(fLe(e,o,s),L.createIdentifier("value")))],!0))}function ktt(e,t,r,i,o,s){const l=L.updatePropertyDeclaration(r,s,o,r.questionToken||r.exclamationToken,i,r.initializer);e.replaceNode(t,r,l)}function wtt(e,t,r,i){let o=L.updatePropertyAssignment(r,i,r.initializer);(o.modifiers||o.questionToken||o.exclamationToken)&&(o===r&&(o=L.cloneNode(o)),o.modifiers=void 0,o.questionToken=void 0,o.exclamationToken=void 0),e.replacePropertyAssignment(t,r,o)}function Ott(e,t,r,i,o,s){Po(r)?ktt(e,t,r,i,o,s):Cc(r)?wtt(e,t,r,o):e.replaceNode(t,r,L.updateParameterDeclaration(r,s,r.dotDotDotToken,ma(o,He),r.questionToken,r.type,r.initializer))}function hLe(e,t,r,i,o){Np(i,i.parent)?e.insertMemberAtStart(t,o,r):Cc(i)?e.insertNodeAfterComma(t,i,r):e.insertNodeAfter(t,i,r)}function Wtt(e,t,r,i,o){r.body&&r.body.forEachChild(function s(l){Ws(l)&&l.expression.kind===110&&ka(l.argumentExpression)&&l.argumentExpression.text===o&&RI(l)&&e.replaceNode(t,l.argumentExpression,L.createStringLiteral(i)),qr(l)&&l.expression.kind===110&&l.name.text===o&&RI(l)&&e.replaceNode(t,l.name,L.createIdentifier(i)),!Yo(l)&&!ui(l)&&l.forEachChild(s)})}function Ftt(e,t){const r=Lne(e);if(Po(e)&&r&&e.questionToken){const i=t.getTypeChecker(),o=i.getTypeFromTypeNode(r);if(!i.isTypeAssignableTo(i.getUndefinedType(),o)){const s=dv(r)?r.types:[r];return L.createUnionTypeNode([...s,L.createKeywordTypeNode(157)])}}return r}var _Le="invalidImportSyntax";function ztt(e,t){const r=Wn(t),i=ZR(t),o=e.program.getCompilerOptions(),s=[];return s.push(gLe(e,r,t,Vb(i.name,void 0,t.moduleSpecifier,Gp(r,e.preferences)))),bu(o)===1&&s.push(gLe(e,r,t,L.createImportEqualsDeclaration(void 0,!1,i.name,L.createExternalModuleReference(t.moduleSpecifier)))),s}function gLe(e,t,r,i){const o=Rr.ChangeTracker.with(e,s=>s.replaceNode(t,r,i));return yh(_Le,o,[f.Replace_import_with_0,o[0].textChanges[0].newText])}Sa({errorCodes:[f.This_expression_is_not_callable.code,f.This_expression_is_not_constructable.code],getCodeActions:Btt});function Btt(e){const t=e.sourceFile,r=f.This_expression_is_not_callable.code===e.errorCode?214:215,i=Dn(Fi(t,e.span.start),s=>s.kind===r);if(!i)return[];const o=i.expression;return yLe(e,o)}Sa({errorCodes:[f.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,f.Type_0_does_not_satisfy_the_constraint_1.code,f.Type_0_is_not_assignable_to_type_1.code,f.Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated.code,f.Type_predicate_0_is_not_assignable_to_1.code,f.Property_0_of_type_1_is_not_assignable_to_2_index_type_3.code,f._0_index_type_1_is_not_assignable_to_2_index_type_3.code,f.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2.code,f.Property_0_in_type_1_is_not_assignable_to_type_2.code,f.Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property.code,f.The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1.code],getCodeActions:Gtt});function Gtt(e){const t=e.sourceFile,r=Dn(Fi(t,e.span.start),i=>i.getStart()===e.span.start&&i.getEnd()===e.span.start+e.span.length);return r?yLe(e,r):[]}function yLe(e,t){const r=e.program.getTypeChecker().getTypeAtLocation(t);if(!(r.symbol&&pg(r.symbol)&&r.symbol.links.originatingImport))return[];const i=[],o=r.symbol.links.originatingImport;if(Qu(o)||Xr(i,ztt(e,o)),St(t)&&!(nd(t.parent)&&t.parent.name===t)){const s=e.sourceFile,l=Rr.ChangeTracker.with(e,u=>u.replaceNode(s,t,L.createPropertyAccessExpression(t,"default"),{}));i.push(yh(_Le,l,f.Use_synthetic_default_member))}return i}var Fpe="strictClassInitialization",zpe="addMissingPropertyDefiniteAssignmentAssertions",Bpe="addMissingPropertyUndefinedType",Gpe="addMissingPropertyInitializer",vLe=[f.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code];Sa({errorCodes:vLe,getCodeActions:function(t){const r=bLe(t.sourceFile,t.span.start);if(!r)return;const i=[];return Bn(i,jtt(t,r)),Bn(i,Vtt(t,r)),Bn(i,Utt(t,r)),i},fixIds:[zpe,Bpe,Gpe],getAllCodeActions:e=>Ss(e,vLe,(t,r)=>{const i=bLe(r.file,r.start);if(i)switch(e.fixId){case zpe:TLe(t,r.file,i.prop);break;case Bpe:SLe(t,r.file,i);break;case Gpe:const o=e.program.getTypeChecker(),s=ALe(o,i.prop);if(!s)return;ELe(t,r.file,i.prop,s);break;default:C.fail(JSON.stringify(e.fixId))}})});function bLe(e,t){const r=Fi(e,t);if(He(r)&&Po(r.parent)){const i=xc(r.parent);if(i)return{type:i,prop:r.parent,isJs:Ir(r.parent)}}}function Vtt(e,t){if(t.isJs)return;const r=Rr.ChangeTracker.with(e,i=>TLe(i,e.sourceFile,t.prop));return oa(Fpe,r,[f.Add_definite_assignment_assertion_to_property_0,t.prop.getText()],zpe,f.Add_definite_assignment_assertions_to_all_uninitialized_properties)}function TLe(e,t,r){Op(r);const i=L.updatePropertyDeclaration(r,r.modifiers,r.name,L.createToken(54),r.type,r.initializer);e.replaceNode(t,r,i)}function jtt(e,t){const r=Rr.ChangeTracker.with(e,i=>SLe(i,e.sourceFile,t));return oa(Fpe,r,[f.Add_undefined_type_to_property_0,t.prop.name.getText()],Bpe,f.Add_undefined_type_to_all_uninitialized_properties)}function SLe(e,t,r){const i=L.createKeywordTypeNode(157),o=dv(r.type)?r.type.types.concat(i):[r.type,i],s=L.createUnionTypeNode(o);r.isJs?e.addJSDocTags(t,r.prop,[L.createJSDocTypeTag(void 0,L.createJSDocTypeExpression(s))]):e.replaceNode(t,r.type,s)}function Utt(e,t){if(t.isJs)return;const r=e.program.getTypeChecker(),i=ALe(r,t.prop);if(!i)return;const o=Rr.ChangeTracker.with(e,s=>ELe(s,e.sourceFile,t.prop,i));return oa(Fpe,o,[f.Add_initializer_to_property_0,t.prop.name.getText()],Gpe,f.Add_initializers_to_all_uninitialized_properties)}function ELe(e,t,r,i){Op(r);const o=L.updatePropertyDeclaration(r,r.modifiers,r.name,r.questionToken,r.type,i);e.replaceNode(t,r,o)}function ALe(e,t){return ILe(e,e.getTypeFromTypeNode(t.type))}function ILe(e,t){if(t.flags&512)return t===e.getFalseType()||t===e.getFalseType(!0)?L.createFalse():L.createTrue();if(t.isStringLiteral())return L.createStringLiteral(t.value);if(t.isNumberLiteral())return L.createNumericLiteral(t.value);if(t.flags&2048)return L.createBigIntLiteral(t.value);if(t.isUnion())return Hn(t.types,r=>ILe(e,r));if(t.isClass()){const r=cy(t.symbol);if(!r||di(r,64))return;const i=yg(r);return i&&i.parameters.length?void 0:L.createNewExpression(L.createIdentifier(t.symbol.name),void 0,void 0)}else if(e.isArrayLikeType(t))return L.createArrayLiteralExpression()}var Vpe="requireInTs",xLe=[f.require_call_may_be_converted_to_an_import.code];Sa({errorCodes:xLe,getCodeActions(e){const t=DLe(e.sourceFile,e.program,e.span.start,e.preferences);if(!t)return;const r=Rr.ChangeTracker.with(e,i=>RLe(i,e.sourceFile,t));return[oa(Vpe,r,f.Convert_require_to_import,Vpe,f.Convert_all_require_to_import)]},fixIds:[Vpe],getAllCodeActions:e=>Ss(e,xLe,(t,r)=>{const i=DLe(r.file,e.program,r.start,e.preferences);i&&RLe(t,e.sourceFile,i)})});function RLe(e,t,r){const{allowSyntheticDefaults:i,defaultImportName:o,namedImports:s,statement:l,moduleSpecifier:u}=r;e.replaceNode(t,l,o&&!i?L.createImportEqualsDeclaration(void 0,!1,o,L.createExternalModuleReference(u)):L.createImportDeclaration(void 0,L.createImportClause(void 0,o,s),u,void 0))}function DLe(e,t,r,i){const{parent:o}=Fi(e,r);Zu(o,!0)||C.failBadSyntaxKind(o);const s=ma(o.parent,yi),l=Gp(e,i),u=ni(s.name,He),d=ff(s.name)?Htt(s.name):void 0;if(u||d){const _=$a(o.arguments);return{allowSyntheticDefaults:PI(t.getCompilerOptions()),defaultImportName:u,namedImports:d,statement:ma(s.parent.parent,ac),moduleSpecifier:g1(_)?L.createStringLiteral(_.text,l===0):_}}}function Htt(e){const t=[];for(const r of e.elements){if(!He(r.name)||r.initializer)return;t.push(L.createImportSpecifier(!1,ni(r.propertyName,He),r.name))}if(t.length)return L.createNamedImports(t)}var jpe="useDefaultImport",CLe=[f.Import_may_be_converted_to_a_default_import.code];Sa({errorCodes:CLe,getCodeActions(e){const{sourceFile:t,span:{start:r}}=e,i=NLe(t,r);if(!i)return;const o=Rr.ChangeTracker.with(e,s=>MLe(s,t,i,e.preferences));return[oa(jpe,o,f.Convert_to_default_import,jpe,f.Convert_all_to_default_imports)]},fixIds:[jpe],getAllCodeActions:e=>Ss(e,CLe,(t,r)=>{const i=NLe(r.file,r.start);i&&MLe(t,r.file,i,e.preferences)})});function NLe(e,t){const r=Fi(e,t);if(!He(r))return;const{parent:i}=r;if(Fc(i)&&uy(i.moduleReference))return{importNode:i,name:r,moduleSpecifier:i.moduleReference.expression};if(Ig(i)&&vl(i.parent.parent)){const o=i.parent.parent;return{importNode:o,name:r,moduleSpecifier:o.moduleSpecifier}}}function MLe(e,t,r,i){e.replaceNode(t,r.importNode,Vb(r.name,void 0,r.moduleSpecifier,Gp(t,i)))}var Upe="useBigintLiteral",PLe=[f.Numeric_literals_with_absolute_values_equal_to_2_53_or_greater_are_too_large_to_be_represented_accurately_as_integers.code];Sa({errorCodes:PLe,getCodeActions:function(t){const r=Rr.ChangeTracker.with(t,i=>LLe(i,t.sourceFile,t.span));if(r.length>0)return[oa(Upe,r,f.Convert_to_a_bigint_numeric_literal,Upe,f.Convert_all_to_bigint_numeric_literals)]},fixIds:[Upe],getAllCodeActions:e=>Ss(e,PLe,(t,r)=>LLe(t,r.file,r))});function LLe(e,t,r){const i=ni(Fi(t,r.start),np);if(!i)return;const o=i.getText(t)+"n";e.replaceNode(t,i,L.createBigIntLiteral(o))}var qtt="fixAddModuleReferTypeMissingTypeof",Hpe=qtt,kLe=[f.Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0.code];Sa({errorCodes:kLe,getCodeActions:function(t){const{sourceFile:r,span:i}=t,o=wLe(r,i.start),s=Rr.ChangeTracker.with(t,l=>OLe(l,r,o));return[oa(Hpe,s,f.Add_missing_typeof,Hpe,f.Add_missing_typeof)]},fixIds:[Hpe],getAllCodeActions:e=>Ss(e,kLe,(t,r)=>OLe(t,e.sourceFile,wLe(r.file,r.start)))});function wLe(e,t){const r=Fi(e,t);return C.assert(r.kind===102,"This token should be an ImportKeyword"),C.assert(r.parent.kind===206,"Token parent should be an ImportType"),r.parent}function OLe(e,t,r){const i=L.updateImportTypeNode(r,r.argument,r.attributes,r.qualifier,r.typeArguments,!0);e.replaceNode(t,r,i)}var qpe="wrapJsxInFragment",WLe=[f.JSX_expressions_must_have_one_parent_element.code];Sa({errorCodes:WLe,getCodeActions:function(t){const{sourceFile:r,span:i}=t,o=FLe(r,i.start);if(!o)return;const s=Rr.ChangeTracker.with(t,l=>zLe(l,r,o));return[oa(qpe,s,f.Wrap_in_JSX_fragment,qpe,f.Wrap_all_unparented_JSX_in_JSX_fragment)]},fixIds:[qpe],getAllCodeActions:e=>Ss(e,WLe,(t,r)=>{const i=FLe(e.sourceFile,r.start);i&&zLe(t,e.sourceFile,i)})});function FLe(e,t){let o=Fi(e,t).parent.parent;if(!(!Nr(o)&&(o=o.parent,!Nr(o)))&&Ol(o.operatorToken))return o}function zLe(e,t,r){const i=Jtt(r);i&&e.replaceNode(t,r,L.createJsxFragment(L.createJsxOpeningFragment(),i,L.createJsxJsxClosingFragment()))}function Jtt(e){const t=[];let r=e;for(;;)if(Nr(r)&&Ol(r.operatorToken)&&r.operatorToken.kind===28){if(t.push(r.left),J2(r.right))return t.push(r.right),t;if(Nr(r.right)){r=r.right;continue}else return}else return}var Jpe="wrapDecoratorInParentheses",BLe=[f.Expression_must_be_enclosed_in_parentheses_to_be_used_as_a_decorator.code];Sa({errorCodes:BLe,getCodeActions:function(t){const r=Rr.ChangeTracker.with(t,i=>GLe(i,t.sourceFile,t.span.start));return[oa(Jpe,r,f.Wrap_in_parentheses,Jpe,f.Wrap_all_invalid_decorator_expressions_in_parentheses)]},fixIds:[Jpe],getAllCodeActions:e=>Ss(e,BLe,(t,r)=>GLe(t,r.file,r.start))});function GLe(e,t,r){const i=Fi(t,r),o=Dn(i,Wc);C.assert(!!o,"Expected position to be owned by a decorator.");const s=L.createParenthesizedExpression(o.expression);e.replaceNode(t,o.expression,s)}var Kpe="fixConvertToMappedObjectType",VLe=[f.An_index_signature_parameter_type_cannot_be_a_literal_type_or_generic_type_Consider_using_a_mapped_object_type_instead.code];Sa({errorCodes:VLe,getCodeActions:function(t){const{sourceFile:r,span:i}=t,o=jLe(r,i.start);if(!o)return;const s=Rr.ChangeTracker.with(t,u=>ULe(u,r,o)),l=Kr(o.container.name);return[oa(Kpe,s,[f.Convert_0_to_mapped_object_type,l],Kpe,[f.Convert_0_to_mapped_object_type,l])]},fixIds:[Kpe],getAllCodeActions:e=>Ss(e,VLe,(t,r)=>{const i=jLe(r.file,r.start);i&&ULe(t,r.file,i)})});function jLe(e,t){const r=Fi(e,t),i=ni(r.parent.parent,Mb);if(!i)return;const o=gd(i.parent)?i.parent:ni(i.parent.parent,vm);if(o)return{indexSignature:i,container:o}}function Ktt(e,t){return L.createTypeAliasDeclaration(e.modifiers,e.name,e.typeParameters,t)}function ULe(e,t,{indexSignature:r,container:i}){const s=(gd(i)?i.members:i.type.members).filter(h=>!Mb(h)),l=$a(r.parameters),u=L.createTypeParameterDeclaration(void 0,ma(l.name,He),l.type),d=L.createMappedTypeNode(u1(r)?L.createModifier(148):void 0,u,void 0,r.questionToken,r.type,void 0),_=L.createIntersectionTypeNode([...rM(i),d,...s.length?[L.createTypeLiteralNode(s)]:ae]);e.replaceNode(t,i,Ktt(i,_))}var HLe="removeAccidentalCallParentheses",Xtt=[f.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without.code];Sa({errorCodes:Xtt,getCodeActions(e){const t=Dn(Fi(e.sourceFile,e.span.start),Zo);if(!t)return;const r=Rr.ChangeTracker.with(e,i=>{i.deleteRange(e.sourceFile,{pos:t.expression.end,end:t.end})});return[yh(HLe,r,f.Remove_parentheses)]},fixIds:[HLe]});var Xpe="removeUnnecessaryAwait",qLe=[f.await_has_no_effect_on_the_type_of_this_expression.code];Sa({errorCodes:qLe,getCodeActions:function(t){const r=Rr.ChangeTracker.with(t,i=>JLe(i,t.sourceFile,t.span));if(r.length>0)return[oa(Xpe,r,f.Remove_unnecessary_await,Xpe,f.Remove_all_unnecessary_uses_of_await)]},fixIds:[Xpe],getAllCodeActions:e=>Ss(e,qLe,(t,r)=>JLe(t,r.file,r))});function JLe(e,t,r){const i=ni(Fi(t,r.start),u=>u.kind===135),o=i&&ni(i.parent,Pb);if(!o)return;let s=o;if(Ou(o.parent)){const u=uD(o.expression,!1);if(He(u)){const d=Bc(o.parent.pos,t);d&&d.kind!==105&&(s=o.parent)}}e.replaceNode(t,s,o.expression)}var KLe=[f.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both.code],Ype="splitTypeOnlyImport";Sa({errorCodes:KLe,fixIds:[Ype],getCodeActions:function(t){const r=Rr.ChangeTracker.with(t,i=>YLe(i,XLe(t.sourceFile,t.span),t));if(r.length)return[oa(Ype,r,f.Split_into_two_separate_import_declarations,Ype,f.Split_all_invalid_type_only_imports)]},getAllCodeActions:e=>Ss(e,KLe,(t,r)=>{YLe(t,XLe(e.sourceFile,r),e)})});function XLe(e,t){return Dn(Fi(e,t.start),vl)}function YLe(e,t,r){if(!t)return;const i=C.checkDefined(t.importClause);e.replaceNode(r.sourceFile,t,L.updateImportDeclaration(t,t.modifiers,L.updateImportClause(i,i.phaseModifier,i.name,void 0),t.moduleSpecifier,t.attributes)),e.insertNodeAfter(r.sourceFile,t,L.createImportDeclaration(void 0,L.updateImportClause(i,i.phaseModifier,void 0,i.namedBindings),t.moduleSpecifier,t.attributes))}var $pe="fixConvertConstToLet",$Le=[f.Cannot_assign_to_0_because_it_is_a_constant.code];Sa({errorCodes:$Le,getCodeActions:function(t){const{sourceFile:r,span:i,program:o}=t,s=QLe(r,i.start,o);if(s===void 0)return;const l=Rr.ChangeTracker.with(t,u=>ZLe(u,r,s.token));return[lue($pe,l,f.Convert_const_to_let,$pe,f.Convert_all_const_to_let)]},getAllCodeActions:e=>{const{program:t}=e,r=new Set;return vx(Rr.ChangeTracker.with(e,i=>{bx(e,$Le,o=>{const s=QLe(o.file,o.start,t);if(s&&gm(r,Ta(s.symbol)))return ZLe(i,o.file,s.token)})}))},fixIds:[$pe]});function QLe(e,t,r){var i;const s=r.getTypeChecker().getSymbolAtLocation(Fi(e,t));if(s===void 0)return;const l=ni((i=s?.valueDeclaration)==null?void 0:i.parent,_d);if(l===void 0)return;const u=Es(l,87,e);if(u!==void 0)return{symbol:s,token:u}}function ZLe(e,t,r){e.replaceNode(t,r,L.createToken(121))}var Qpe="fixExpectedComma",Ytt=f._0_expected.code,e2e=[Ytt];Sa({errorCodes:e2e,getCodeActions(e){const{sourceFile:t}=e,r=t2e(t,e.span.start,e.errorCode);if(!r)return;const i=Rr.ChangeTracker.with(e,o=>n2e(o,t,r));return[oa(Qpe,i,[f.Change_0_to_1,";",","],Qpe,[f.Change_0_to_1,";",","])]},fixIds:[Qpe],getAllCodeActions:e=>Ss(e,e2e,(t,r)=>{const i=t2e(r.file,r.start,r.code);i&&n2e(t,e.sourceFile,i)})});function t2e(e,t,r){const i=Fi(e,t);return i.kind===27&&i.parent&&(Wa(i.parent)||Cd(i.parent))?{node:i}:void 0}function n2e(e,t,{node:r}){const i=L.createToken(28);e.replaceNode(t,r,i)}var $tt="addVoidToPromise",r2e="addVoidToPromise",i2e=[f.Expected_1_argument_but_got_0_new_Promise_needs_a_JSDoc_hint_to_produce_a_resolve_that_can_be_called_without_arguments.code,f.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise.code];Sa({errorCodes:i2e,fixIds:[r2e],getCodeActions(e){const t=Rr.ChangeTracker.with(e,r=>o2e(r,e.sourceFile,e.span,e.program));if(t.length>0)return[oa($tt,t,f.Add_void_to_Promise_resolved_without_a_value,r2e,f.Add_void_to_all_Promises_resolved_without_a_value)]},getAllCodeActions(e){return Ss(e,i2e,(t,r)=>o2e(t,r.file,r,e.program,new Set))}});function o2e(e,t,r,i,o){const s=Fi(t,r.start);if(!He(s)||!Zo(s.parent)||s.parent.expression!==s||s.parent.arguments.length!==0)return;const l=i.getTypeChecker(),u=l.getSymbolAtLocation(s),d=u?.valueDeclaration;if(!d||!to(d)||!GS(d.parent.parent)||o?.has(d))return;o?.add(d);const _=Qtt(d.parent.parent);if(yt(_)){const h=_[0],g=!dv(h)&&!v1(h)&&v1(L.createUnionTypeNode([h,L.createKeywordTypeNode(116)]).types[0]);g&&e.insertText(t,h.pos,"("),e.insertText(t,h.end,g?") | void":" | void")}else{const h=l.getResolvedSignature(s.parent),g=h?.parameters[0],E=g&&l.getTypeOfSymbolAtLocation(g,d.parent.parent);Ir(d)?(!E||E.flags&3)&&(e.insertText(t,d.parent.parent.end,")"),e.insertText(t,La(t.text,d.parent.parent.pos),"/** @type {Promise<void>} */(")):(!E||E.flags&2)&&e.insertText(t,d.parent.parent.expression.end,"<void>")}}function Qtt(e){var t;if(Ir(e)){if(Ou(e.parent)){const r=(t=LT(e.parent))==null?void 0:t.typeExpression.type;if(r&&Wp(r)&&He(r.typeName)&&Kr(r.typeName)==="Promise")return r.typeArguments}}else return e.typeArguments}var Ex={};x(Ex,{CompletionKind:()=>S2e,CompletionSource:()=>s2e,SortText:()=>Hd,StringCompletions:()=>XK,SymbolOriginInfoKind:()=>l2e,createCompletionDetails:()=>gz,createCompletionDetailsForSymbol:()=>sfe,getCompletionEntriesFromSymbols:()=>ofe,getCompletionEntryDetails:()=>Cnt,getCompletionEntrySymbol:()=>Mnt,getCompletionsAtPosition:()=>ant,getDefaultCommitCharacters:()=>V1,getPropertiesForObjectExpression:()=>qK,moduleSpecifierResolutionCacheAttemptLimit:()=>a2e,moduleSpecifierResolutionLimit:()=>Zpe});var Zpe=100,a2e=1e3,Hd={LocalDeclarationPriority:"10",LocationPriority:"11",OptionalMember:"12",MemberDeclaredBySpreadAssignment:"13",SuggestedClassMembers:"14",GlobalsOrKeywords:"15",AutoImportSuggestions:"16",ClassMemberSnippets:"17",JavascriptIdentifiers:"18",Deprecated(e){return"z"+e},ObjectLiteralProperty(e,t){return`${e}\0${t}\0`},SortBelow(e){return e+"1"}},l_=[".",",",";"],FK=[".",";"],s2e=(e=>(e.ThisProperty="ThisProperty/",e.ClassMemberSnippet="ClassMemberSnippet/",e.TypeOnlyAlias="TypeOnlyAlias/",e.ObjectLiteralMethodSnippet="ObjectLiteralMethodSnippet/",e.SwitchCases="SwitchCases/",e.ObjectLiteralMemberWithComma="ObjectLiteralMemberWithComma/",e))(s2e||{}),l2e=(e=>(e[e.ThisType=1]="ThisType",e[e.SymbolMember=2]="SymbolMember",e[e.Export=4]="Export",e[e.Promise=8]="Promise",e[e.Nullable=16]="Nullable",e[e.ResolvedExport=32]="ResolvedExport",e[e.TypeOnlyAlias=64]="TypeOnlyAlias",e[e.ObjectLiteralMethod=128]="ObjectLiteralMethod",e[e.Ignore=256]="Ignore",e[e.ComputedPropertyName=512]="ComputedPropertyName",e[e.SymbolMemberNoExport=2]="SymbolMemberNoExport",e[e.SymbolMemberExport=6]="SymbolMemberExport",e))(l2e||{});function Ztt(e){return!!(e.kind&1)}function ent(e){return!!(e.kind&2)}function hz(e){return!!(e&&e.kind&4)}function JP(e){return!!(e&&e.kind===32)}function tnt(e){return hz(e)||JP(e)||efe(e)}function nnt(e){return(hz(e)||JP(e))&&!!e.isFromPackageJson}function rnt(e){return!!(e.kind&8)}function int(e){return!!(e.kind&16)}function c2e(e){return!!(e&&e.kind&64)}function d2e(e){return!!(e&&e.kind&128)}function ont(e){return!!(e&&e.kind&256)}function efe(e){return!!(e&&e.kind&512)}function u2e(e,t,r,i,o,s,l,u,d){var _,h,g,E;const A=Ls(),R=l||Hk(i.getCompilerOptions())||((_=s.autoImportSpecifierExcludeRegexes)==null?void 0:_.length);let N=!1,P=0,k=0,W=0,O=0;const G=d({tryResolve:J,skippedAny:()=>N,resolvedAny:()=>k>0,resolvedBeyondLimit:()=>k>Zpe}),j=O?` (${(W/O*100).toFixed(1)}% hit rate)`:"";return(h=t.log)==null||h.call(t,`${e}: resolved ${k} module specifiers, plus ${P} ambient and ${W} from cache${j}`),(g=t.log)==null||g.call(t,`${e}: response is ${N?"incomplete":"complete"}`),(E=t.log)==null||E.call(t,`${e}: ${Ls()-A}`),G;function J(Z,q){if(q){const pe=r.getModuleSpecifierForBestExportInfo(Z,o,u);return pe&&P++,pe||"failed"}const ye=R||s.allowIncompleteCompletions&&k<Zpe,ie=!ye&&s.allowIncompleteCompletions&&O<a2e,K=ye||ie?r.getModuleSpecifierForBestExportInfo(Z,o,u,ie):void 0;return(!ye&&!ie||ie&&!K)&&(N=!0),k+=K?.computedWithoutCacheCount||0,W+=Z.length-(K?.computedWithoutCacheCount||0),ie&&O++,K||(R?"failed":"skipped")}}function V1(e){return e?[]:l_}function ant(e,t,r,i,o,s,l,u,d,_,h=!1){var g;const{previousToken:E}=VK(o,i);if(l&&!px(i,o,E)&&!Vnt(i,l,E,o))return;if(l===" ")return s.includeCompletionsForImportStatements&&s.includeCompletionsWithInsertText?{isGlobalCompletion:!0,isMemberCompletion:!1,isNewIdentifierLocation:!0,isIncomplete:!0,entries:[],defaultCommitCharacters:V1(!0)}:void 0;const A=t.getCompilerOptions(),R=t.getTypeChecker(),N=s.allowIncompleteCompletions?(g=e.getIncompleteCompletionsCache)==null?void 0:g.call(e):void 0;if(N&&u===3&&E&&He(E)){const W=snt(N,i,E,t,e,s,d,o);if(W)return W}else N?.clear();const P=XK.getStringLiteralCompletions(i,o,E,A,e,t,r,s,h);if(P)return P;if(E&&kN(E.parent)&&(E.kind===83||E.kind===88||E.kind===80))return Rnt(E.parent);const k=E2e(t,r,i,A,o,s,void 0,e,_,d);if(k)switch(k.kind){case 0:const W=pnt(i,e,t,A,r,k,s,_,o,h);return W?.isIncomplete&&N?.set(W),W;case 1:return tfe([...y0.getJSDocTagNameCompletions(),...f2e(i,o,R,A,s,!0)]);case 2:return tfe([...y0.getJSDocTagCompletions(),...f2e(i,o,R,A,s,!1)]);case 3:return tfe(y0.getJSDocParameterNameCompletions(k.tag));case 4:return dnt(k.keywordCompletions,k.isNewIdentifierLocation);default:return C.assertNever(k)}}function _z(e,t){var r,i;let o=v2(e.sortText,t.sortText);return o===0&&(o=v2(e.name,t.name)),o===0&&((r=e.data)!=null&&r.moduleSpecifier)&&((i=t.data)!=null&&i.moduleSpecifier)&&(o=Qk(e.data.moduleSpecifier,t.data.moduleSpecifier)),o===0?-1:o}function p2e(e){return!!e?.moduleSpecifier}function snt(e,t,r,i,o,s,l,u){const d=e.get();if(!d)return;const _=ip(t,u),h=r.text.toLowerCase(),g=wO(t,o,i,s,l),E=u2e("continuePreviousIncompleteResponse",o,cu.createImportSpecifierResolver(t,i,o,s),i,r.getStart(),s,!1,HT(r),A=>{const R=Ui(d.entries,N=>{var P;if(!N.hasAction||!N.source||!N.data||p2e(N.data))return N;if(!F2e(N.name,h))return;const{origin:k}=C.checkDefined(A2e(N.name,N.data,i,o)),W=g.get(t.path,N.data.exportMapKey),O=W&&A.tryResolve(W,!td(_m(k.moduleSymbol.name)));if(O==="skipped")return N;if(!O||O==="failed"){(P=o.log)==null||P.call(o,`Unexpected failure resolving auto import for '${N.name}' from '${N.source}'`);return}const G={...k,kind:32,moduleSpecifier:O.moduleSpecifier};return N.data=b2e(G),N.source=ife(G),N.sourceDisplay=[yf(G.moduleSpecifier)],N});return A.skippedAny()||(d.isIncomplete=void 0),R});return d.entries=E,d.flags=(d.flags||0)|4,d.optionalReplacementSpan=_2e(_),d}function tfe(e){return{isGlobalCompletion:!1,isMemberCompletion:!1,isNewIdentifierLocation:!1,entries:e,defaultCommitCharacters:V1(!1)}}function f2e(e,t,r,i,o,s){const l=Fi(e,t);if(!VR(l)&&!mh(l))return[];const u=mh(l)?l:l.parent;if(!mh(u))return[];const d=u.parent;if(!Yo(d))return[];const _=Pu(e),h=o.includeCompletionsWithSnippetText||void 0,g=Io(u.tags,E=>mf(E)&&E.getEnd()<=t);return Ui(d.parameters,E=>{if(!OR(E).length){if(He(E.name)){const A={tabstop:1},R=E.name.text;let N=$O(R,E.initializer,E.dotDotDotToken,_,!1,!1,r,i,o),P=h?$O(R,E.initializer,E.dotDotDotToken,_,!1,!0,r,i,o,A):void 0;return s&&(N=N.slice(1),P&&(P=P.slice(1))),{name:N,kind:"parameter",sortText:Hd.LocationPriority,insertText:h?P:void 0,isSnippet:h}}else if(E.parent.parameters.indexOf(E)===g){const A=`param${g}`,R=m2e(A,E.name,E.initializer,E.dotDotDotToken,_,!1,r,i,o),N=h?m2e(A,E.name,E.initializer,E.dotDotDotToken,_,!0,r,i,o):void 0;let P=R.join(iv(i)+"* "),k=N?.join(iv(i)+"* ");return s&&(P=P.slice(1),k&&(k=k.slice(1))),{name:P,kind:"parameter",sortText:Hd.LocationPriority,insertText:h?k:void 0,isSnippet:h}}}})}function m2e(e,t,r,i,o,s,l,u,d){if(!o)return[$O(e,r,i,o,!1,s,l,u,d,{tabstop:1})];return _(e,t,r,i,{tabstop:1});function _(g,E,A,R,N){if(ff(E)&&!R){const k={tabstop:N.tabstop},W=$O(g,A,R,o,!0,s,l,u,d,k);let O=[];for(const G of E.elements){const j=h(g,G,k);if(j)O.push(...j);else{O=void 0;break}}if(O)return N.tabstop=k.tabstop,[W,...O]}return[$O(g,A,R,o,!1,s,l,u,d,N)]}function h(g,E,A){if(!E.propertyName&&He(E.name)||He(E.name)){const R=E.propertyName?UN(E.propertyName):E.name.text;if(!R)return;const N=`${g}.${R}`;return[$O(N,E.initializer,E.dotDotDotToken,o,!1,s,l,u,d,A)]}else if(E.propertyName){const R=UN(E.propertyName);return R&&_(`${g}.${R}`,E.name,E.initializer,E.dotDotDotToken,A)}}}function $O(e,t,r,i,o,s,l,u,d,_){if(s&&C.assertIsDefined(_),t&&(e=lnt(e,t)),s&&(e=OS(e)),i){let h="*";if(o)C.assert(!r,"Cannot annotate a rest parameter with type 'Object'."),h="Object";else{if(t){const A=l.getTypeAtLocation(t.parent);if(!(A.flags&16385)){const R=t.getSourceFile(),P=Gp(R,d)===0?268435456:0,k=l.typeToTypeNode(A,Dn(t,Yo),P);if(k){const W=s?GK({removeComments:!0,module:u.module,moduleResolution:u.moduleResolution,target:u.target}):zb({removeComments:!0,module:u.module,moduleResolution:u.moduleResolution,target:u.target});Cr(k,1),h=W.printNode(4,k,R)}}}s&&h==="*"&&(h=`\${${_.tabstop++}:${h}}`)}const g=!o&&r?"...":"",E=s?`\${${_.tabstop++}}`:"";return`@param {${g}${h}} ${e} ${E}`}else{const h=s?`\${${_.tabstop++}}`:"";return`@param ${e} ${h}`}}function lnt(e,t){const r=t.getText().trim();return r.includes(`

Callers 2

eCeFunction · 0.70
tCeFunction · 0.70

Calls 12

gwFunction · 0.70
NrFunction · 0.70
HeFunction · 0.70
TaFunction · 0.70
qrFunction · 0.70
rCeFunction · 0.70
jnFunction · 0.70
GhFunction · 0.70
yiFunction · 0.70
rhFunction · 0.70
replaceNodeMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected