@magic5644/graph-it-live 1.9.2 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/astWorker.js CHANGED
@@ -430,7 +430,7 @@ Project '${f.projectName}' (${ZL[f.projectKind]}) ${l}
430
430
  `,l++};this.projectService.externalProjects.forEach(c),this.projectService.configuredProjects.forEach(c),this.projectService.inferredProjects.forEach(c)}}this.logger.msg(a,"Err")}send(t){if(t.type==="event"&&!this.canUseEvents){this.logger.hasLevel(3)&&this.logger.info(`Session does not support events: ignored event: ${qT(t)}`);return}this.writeMessage(t)}writeMessage(t){let r=ESe(t,this.logger,this.byteLength,this.host.newLine);this.host.write(r)}event(t,r){this.send(xSe(r,t))}doOutput(t,r,i,a,l,c){let f={seq:0,type:"response",command:r,request_seq:i,success:a,performanceData:l&&JBe(l)};if(a){let p;if(No(t))f.body=t,p=t.metadata,delete t.metadata;else if(typeof t=="object")if(t.metadata){let{metadata:v,...g}=t;f.body=g,p=v}else f.body=t;else f.body=t;p&&(f.metadata=p)}else M.assert(t===void 0);c&&(f.message=c),this.send(f)}semanticCheck(t,r){var i,a;let l=Ws();(i=Ar)==null||i.push(Ar.Phase.Session,"semanticCheck",{file:t,configFilePath:r.canonicalConfigFilePath});let c=OBe(r,t)?ad:r.getLanguageService().getSemanticDiagnostics(t).filter(f=>!!f.file);this.sendDiagnosticsEvent(t,r,c,"semanticDiag",l),(a=Ar)==null||a.pop()}syntacticCheck(t,r){var i,a;let l=Ws();(i=Ar)==null||i.push(Ar.Phase.Session,"syntacticCheck",{file:t,configFilePath:r.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,r,r.getLanguageService().getSyntacticDiagnostics(t),"syntaxDiag",l),(a=Ar)==null||a.pop()}suggestionCheck(t,r){var i,a;let l=Ws();(i=Ar)==null||i.push(Ar.Phase.Session,"suggestionCheck",{file:t,configFilePath:r.canonicalConfigFilePath}),this.sendDiagnosticsEvent(t,r,r.getLanguageService().getSuggestionDiagnostics(t),"suggestionDiag",l),(a=Ar)==null||a.pop()}regionSemanticCheck(t,r,i){var a,l,c;let f=Ws();(a=Ar)==null||a.push(Ar.Phase.Session,"regionSemanticCheck",{file:t,configFilePath:r.canonicalConfigFilePath});let p;if(!this.shouldDoRegionCheck(t)||!(p=r.getLanguageService().getRegionSemanticDiagnostics(t,i))){(l=Ar)==null||l.pop();return}this.sendDiagnosticsEvent(t,r,p.diagnostics,"regionSemanticDiag",f,p.spans),(c=Ar)==null||c.pop()}shouldDoRegionCheck(t){var r;let i=(r=this.projectService.getScriptInfoForNormalizedPath(t))==null?void 0:r.textStorage.getLineInfo().getLineCount();return!!(i&&i>=this.regionDiagLineCountThreshold)}sendDiagnosticsEvent(t,r,i,a,l,c){try{let f=M.checkDefined(r.getScriptInfo(t)),p=Ws()-l,v={file:t,diagnostics:i.map(g=>FBe(t,r,g)),spans:c?.map(g=>jh(g,f))};this.event(v,a),this.addDiagnosticsPerformanceData(t,a,p)}catch(f){this.logError(f,a)}}updateErrorCheck(t,r,i,a=!0){if(r.length===0)return;M.assert(!this.suppressDiagnosticEvents);let l=this.changeSeq,c=Math.min(i,200),f=0,p=()=>{if(f++,r.length>f)return t.delay("checkOne",c,g)},v=(S,I)=>{if(this.semanticCheck(S,I),this.changeSeq===l){if(this.getPreferences(S).disableSuggestions)return p();t.immediate("suggestionCheck",()=>{this.suggestionCheck(S,I),p()})}},g=()=>{if(this.changeSeq!==l)return;let S,I=r[f];if(Go(I)?I=this.toPendingErrorCheck(I):"ranges"in I&&(S=I.ranges,I=this.toPendingErrorCheck(I.file)),!I)return p();let{fileName:C,project:N}=I;if(Zm(N),!!N.containsFile(C,a)&&(this.syntacticCheck(C,N),this.changeSeq===l)){if(N.projectService.serverMode!==0)return p();if(S)return t.immediate("regionSemanticCheck",()=>{let k=this.projectService.getScriptInfoForNormalizedPath(C);k&&this.regionSemanticCheck(C,N,S.map(O=>this.getRange({file:C,...O},k))),this.changeSeq===l&&t.immediate("semanticCheck",()=>v(C,N))});t.immediate("semanticCheck",()=>v(C,N))}};r.length>f&&this.changeSeq===l&&t.delay("checkOne",i,g)}cleanProjects(t,r){if(r){this.logger.info(`cleaning ${t}`);for(let i of r)i.getLanguageService(!1).cleanupSemanticCache(),i.cleanupProgram()}}cleanup(){this.cleanProjects("inferred projects",this.projectService.inferredProjects),this.cleanProjects("configured projects",Co(this.projectService.configuredProjects.values())),this.cleanProjects("external projects",this.projectService.externalProjects),this.host.gc&&(this.logger.info("host.gc()"),this.host.gc())}getEncodedSyntacticClassifications(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t);return i.getEncodedSyntacticClassifications(r,t)}getEncodedSemanticClassifications(t){let{file:r,project:i}=this.getFileAndProject(t),a=t.format==="2020"?"2020":"original";return i.getLanguageService().getEncodedSemanticClassifications(r,t,a)}getProject(t){return t===void 0?void 0:this.projectService.findProject(t)}getConfigFileAndProject(t){let r=this.getProject(t.projectFileName),i=ws(t.file);return{configFile:r&&r.hasConfigFile(i)?i:void 0,project:r}}getConfigFileDiagnostics(t,r,i){let a=r.getAllProjectErrors(),l=r.getLanguageService().getCompilerOptionsDiagnostics(),c=fn(Wi(a,l),f=>!!f.file&&f.file.fileName===t);return i?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):vn(c,f=>vW(f,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(t){return t.map(r=>({message:Wh(r.messageText,this.host.newLine),start:r.start,length:r.length,category:Rx(r),code:r.code,source:r.source,startLocation:r.file&&pN(fa(r.file,r.start)),endLocation:r.file&&pN(fa(r.file,r.start+r.length)),reportsUnnecessary:r.reportsUnnecessary,reportsDeprecated:r.reportsDeprecated,relatedInformation:vn(r.relatedInformation,uY)}))}getCompilerOptionsDiagnostics(t){let r=this.getProject(t.projectFileName);return this.convertToDiagnosticsWithLinePosition(fn(r.getLanguageService().getCompilerOptionsDiagnostics(),i=>!i.file),void 0)}convertToDiagnosticsWithLinePosition(t,r){return t.map(i=>({message:Wh(i.messageText,this.host.newLine),start:i.start,length:i.length,category:Rx(i),code:i.code,source:i.source,startLocation:r&&r.positionToLineOffset(i.start),endLocation:r&&r.positionToLineOffset(i.start+i.length),reportsUnnecessary:i.reportsUnnecessary,reportsDeprecated:i.reportsDeprecated,relatedInformation:vn(i.relatedInformation,uY)}))}getDiagnosticsWorker(t,r,i,a){let{project:l,file:c}=this.getFileAndProject(t);if(r&&OBe(l,c))return ad;let f=l.getScriptInfoForNormalizedPath(c),p=i(l,c);return a?this.convertToDiagnosticsWithLinePosition(p,f):p.map(v=>FBe(c,l,v))}getDefinition(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=this.getPositionInFile(t,i),c=this.mapDefinitionInfoLocations(a.getLanguageService().getDefinitionAtPosition(i,l)||ad,a);return r?this.mapDefinitionInfo(c,a):c.map(AZ.mapToOriginalLocation)}mapDefinitionInfoLocations(t,r){return t.map(i=>{let a=UBe(i,r);return a?{...a,containerKind:i.containerKind,containerName:i.containerName,kind:i.kind,name:i.name,failedAliasResolution:i.failedAliasResolution,...i.unverified&&{unverified:i.unverified}}:i})}getDefinitionAndBoundSpan(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=this.getPositionInFile(t,i),c=M.checkDefined(a.getScriptInfo(i)),f=a.getLanguageService().getDefinitionAndBoundSpan(i,l);if(!f||!f.definitions)return{definitions:ad,textSpan:void 0};let p=this.mapDefinitionInfoLocations(f.definitions,a),{textSpan:v}=f;return r?{definitions:this.mapDefinitionInfo(p,a),textSpan:jh(v,c)}:{definitions:p.map(AZ.mapToOriginalLocation),textSpan:v}}findSourceDefinition(t){var r;let{file:i,project:a}=this.getFileAndProject(t),l=this.getPositionInFile(t,i),c=a.getLanguageService().getDefinitionAtPosition(i,l),f=this.mapDefinitionInfoLocations(c||ad,a).slice();if(this.projectService.serverMode===0&&(!gt(f,C=>ws(C.fileName)!==i&&!C.isAmbient)||gt(f,C=>!!C.failedAliasResolution))){let C=f9(W=>W.textSpan.start,Aq(this.host.useCaseSensitiveFileNames));f?.forEach(W=>C.add(W));let N=a.getNoDtsResolutionProject(i),k=N.getLanguageService(),O=(r=k.getDefinitionAtPosition(i,l,!0,!1))==null?void 0:r.filter(W=>ws(W.fileName)!==i);if(gt(O))for(let W of O){if(W.unverified){let V=S(W,a.getLanguageService().getProgram(),k.getProgram());if(gt(V)){for(let G of V)C.add(G);continue}}C.add(W)}else{let W=f.filter(V=>ws(V.fileName)!==i&&V.isAmbient);for(let V of gt(W)?W:g()){let G=v(V.fileName,i,N);if(!G)continue;let K=this.projectService.getOrCreateScriptInfoNotOpenedByClient(G,N.currentDirectory,N.directoryStructureHost,!1);if(!K)continue;N.containsScriptInfo(K)||(N.addRoot(K),N.updateGraph());let q=k.getProgram(),ee=M.checkDefined(q.getSourceFile(G));for(let ie of I(V.name,ee,q))C.add(ie)}}f=Co(C.values())}return f=f.filter(C=>!C.isAmbient&&!C.failedAliasResolution),this.mapDefinitionInfo(f,a);function v(C,N,k){var O,W,V;let G=p3(C);if(G&&C.lastIndexOf(ry)===G.topLevelNodeModulesIndex){let K=C.substring(0,G.packageRootIndex),q=(O=a.getModuleResolutionCache())==null?void 0:O.getPackageJsonInfoCache(),ee=a.getCompilationSettings(),ie=oL(bo(K,a.getCurrentDirectory()),iL(q,a,ee));if(!ie)return;let Y=JH(ie,{moduleResolution:2},a,a.getModuleResolutionCache()),Te=C.substring(G.topLevelPackageNameIndex+1,G.packageRootIndex),ce=aL(VO(Te)),Q=a.toPath(C);if(Y&&gt(Y,ye=>a.toPath(ye)===Q))return(W=k.resolutionCache.resolveSingleModuleNameWithoutWatching(ce,N).resolvedModule)==null?void 0:W.resolvedFileName;{let ye=C.substring(G.packageRootIndex+1),he=`${ce}/${Bu(ye)}`;return(V=k.resolutionCache.resolveSingleModuleNameWithoutWatching(he,N).resolvedModule)==null?void 0:V.resolvedFileName}}}function g(){let C=a.getLanguageService(),N=C.getProgram(),k=Ep(N.getSourceFile(i),l);return(gs(k)||Ke(k))&&Zs(k.parent)&&Cce(k,O=>{var W;if(O===k)return;let V=(W=C.getDefinitionAtPosition(i,O.getStart(),!0,!1))==null?void 0:W.filter(G=>ws(G.fileName)!==i&&G.isAmbient).map(G=>({fileName:G.fileName,name:pm(k)}));if(gt(V))return V})||ad}function S(C,N,k){var O;let W=k.getSourceFile(C.fileName);if(!W)return;let V=Ep(N.getSourceFile(i),l),G=N.getTypeChecker().getSymbolAtLocation(V),K=G&&ul(G,277);if(!K)return;let q=((O=K.propertyName)==null?void 0:O.text)||K.name.text;return I(q,W,k)}function I(C,N,k){let O=tl.Core.getTopMostDeclarationNamesInFile(C,N);return Gi(O,W=>{let V=k.getTypeChecker().getSymbolAtLocation(W),G=nM(W);if(V&&G)return sN.createDefinitionInfo(G,k.getTypeChecker(),V,G,!0)})}}getEmitOutput(t){let{file:r,project:i}=this.getFileAndProject(t);if(!i.shouldEmitFile(i.getScriptInfo(r)))return{emitSkipped:!0,outputFiles:[],diagnostics:[]};let a=i.getLanguageService().getEmitOutput(r);return t.richResponse?{...a,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(a.diagnostics):a.diagnostics.map(l=>vW(l,!0))}:a}mapJSDocTagInfo(t,r,i){return t?t.map(a=>{var l;return{...a,text:i?this.mapDisplayParts(a.text,r):(l=a.text)==null?void 0:l.map(c=>c.text).join("")}}):[]}mapDisplayParts(t,r){return t?t.map(i=>i.kind!=="linkName"?i:{...i,target:this.toFileSpan(i.target.fileName,i.target.textSpan,r)}):[]}mapSignatureHelpItems(t,r,i){return t.map(a=>({...a,documentation:this.mapDisplayParts(a.documentation,r),parameters:a.parameters.map(l=>({...l,documentation:this.mapDisplayParts(l.documentation,r)})),tags:this.mapJSDocTagInfo(a.tags,r,i)}))}mapDefinitionInfo(t,r){return t.map(i=>({...this.toFileSpanWithContext(i.fileName,i.textSpan,i.contextSpan,r),...i.unverified&&{unverified:i.unverified}}))}static mapToOriginalLocation(t){return t.originalFileName?(M.assert(t.originalTextSpan!==void 0,"originalTextSpan should be present if originalFileName is"),{...t,fileName:t.originalFileName,textSpan:t.originalTextSpan,targetFileName:t.fileName,targetTextSpan:t.textSpan,contextSpan:t.originalContextSpan,targetContextSpan:t.contextSpan}):t}toFileSpan(t,r,i){let a=i.getLanguageService(),l=a.toLineColumnOffset(t,r.start),c=a.toLineColumnOffset(t,Ol(r));return{file:t,start:{line:l.line+1,offset:l.character+1},end:{line:c.line+1,offset:c.character+1}}}toFileSpanWithContext(t,r,i,a){let l=this.toFileSpan(t,r,a),c=i&&this.toFileSpan(t,i,a);return c?{...l,contextStart:c.start,contextEnd:c.end}:l}getTypeDefinition(t){let{file:r,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,r),l=this.mapDefinitionInfoLocations(i.getLanguageService().getTypeDefinitionAtPosition(r,a)||ad,i);return this.mapDefinitionInfo(l,i)}mapImplementationLocations(t,r){return t.map(i=>{let a=UBe(i,r);return a?{...a,kind:i.kind,displayParts:i.displayParts}:i})}getImplementation(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=this.getPositionInFile(t,i),c=this.mapImplementationLocations(a.getLanguageService().getImplementationAtPosition(i,l)||ad,a);return r?c.map(({fileName:f,textSpan:p,contextSpan:v})=>this.toFileSpanWithContext(f,p,v,a)):c.map(AZ.mapToOriginalLocation)}getSyntacticDiagnosticsSync(t){let{configFile:r}=this.getConfigFileAndProject(t);return r?ad:this.getDiagnosticsWorker(t,!1,(i,a)=>i.getLanguageService().getSyntacticDiagnostics(a),!!t.includeLinePosition)}getSemanticDiagnosticsSync(t){let{configFile:r,project:i}=this.getConfigFileAndProject(t);return r?this.getConfigFileDiagnostics(r,i,!!t.includeLinePosition):this.getDiagnosticsWorker(t,!0,(a,l)=>a.getLanguageService().getSemanticDiagnostics(l).filter(c=>!!c.file),!!t.includeLinePosition)}getSuggestionDiagnosticsSync(t){let{configFile:r}=this.getConfigFileAndProject(t);return r?ad:this.getDiagnosticsWorker(t,!0,(i,a)=>i.getLanguageService().getSuggestionDiagnostics(a),!!t.includeLinePosition)}getJsxClosingTag(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,r),l=i.getJsxClosingTagAtPosition(r,a);return l===void 0?void 0:{newText:l.newText,caretOffset:0}}getLinkedEditingRange(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,r),l=i.getLinkedEditingRangeAtPosition(r,a),c=this.projectService.getScriptInfoForNormalizedPath(r);if(!(c===void 0||l===void 0))return Bgt(l,c)}getDocumentHighlights(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=this.getPositionInFile(t,i),c=a.getLanguageService().getDocumentHighlights(i,l,t.filesToSearch);return c?r?c.map(({fileName:f,highlightSpans:p})=>{let v=a.getScriptInfo(f);return{file:f,highlightSpans:p.map(({textSpan:g,kind:S,contextSpan:I})=>({...DSe(g,I,v),kind:S}))}}):c:ad}provideInlayHints(t){let{file:r,project:i}=this.getFileAndProject(t),a=this.projectService.getScriptInfoForNormalizedPath(r);return i.getLanguageService().provideInlayHints(r,t,this.getPreferences(r)).map(c=>{let{position:f,displayParts:p}=c;return{...c,position:a.positionToLineOffset(f),displayParts:p?.map(({text:v,span:g,file:S})=>{if(g){M.assertIsDefined(S,"Target file should be defined together with its span.");let I=this.projectService.getScriptInfo(S);return{text:v,span:{start:I.positionToLineOffset(g.start),end:I.positionToLineOffset(g.start+g.length),file:S}}}else return{text:v}})}})}mapCode(t){var r;let i=this.getHostFormatOptions(),a=this.getHostPreferences(),{file:l,languageService:c}=this.getFileAndLanguageServiceForSyntacticOperation(t),f=this.projectService.getScriptInfoForNormalizedPath(l),p=(r=t.mapping.focusLocations)==null?void 0:r.map(g=>g.map(S=>{let I=f.lineOffsetToPosition(S.start.line,S.start.offset),C=f.lineOffsetToPosition(S.end.line,S.end.offset);return{start:I,length:C-I}})),v=c.mapCode(l,t.mapping.contents,p,i,a);return this.mapTextChangesToCodeEdits(v)}getCopilotRelatedInfo(){return{relatedFiles:[]}}setCompilerOptionsForInferredProjects(t){this.projectService.setCompilerOptionsForInferredProjects(t.options,t.projectRootPath)}getProjectInfo(t){return this.getProjectInfoWorker(t.file,t.projectFileName,t.needFileNameList,t.needDefaultConfiguredProjectInfo,!1)}getProjectInfoWorker(t,r,i,a,l){let{project:c}=this.getFileAndProjectWorker(t,r);return Zm(c),{configFileName:c.getProjectName(),languageServiceDisabled:!c.languageServiceEnabled,fileNames:i?c.getFileNames(!1,l):void 0,configuredProjectInfo:a?this.getDefaultConfiguredProjectInfo(t):void 0}}getDefaultConfiguredProjectInfo(t){var r;let i=this.projectService.getScriptInfo(t);if(!i)return;let a=this.projectService.findDefaultConfiguredProjectWorker(i,3);if(!a)return;let l,c;return a.seenProjects.forEach((f,p)=>{p!==a.defaultProject&&(f!==3?(l??(l=[])).push(ws(p.getConfigFilePath())):(c??(c=[])).push(ws(p.getConfigFilePath())))}),(r=a.seenConfigs)==null||r.forEach(f=>(l??(l=[])).push(f)),{notMatchedByConfig:l,notInProject:c,defaultProject:a.defaultProject&&ws(a.defaultProject.getConfigFilePath())}}getRenameInfo(t){let{file:r,project:i}=this.getFileAndProject(t),a=this.getPositionInFile(t,r),l=this.getPreferences(r);return i.getLanguageService().getRenameInfo(r,a,l)}getProjects(t,r,i){let a,l;if(t.projectFileName){let c=this.getProject(t.projectFileName);c&&(a=[c])}else{let c=r?this.projectService.getScriptInfoEnsuringProjectsUptoDate(t.file):this.projectService.getScriptInfo(t.file);if(c)r||this.projectService.ensureDefaultProjectForFile(c);else return i?ad:(this.projectService.logErrorForScriptInfoNotFound(t.file),Yy.ThrowNoProject());a=c.containingProjects,l=this.projectService.getSymlinkedProjects(c)}return a=fn(a,c=>c.languageServiceEnabled&&!c.isOrphan()),!i&&(!a||!a.length)&&!l?(this.projectService.logErrorForScriptInfoNotFound(t.file??t.projectFileName),Yy.ThrowNoProject()):l?{projects:a,symLinkedProjects:l}:a}getDefaultProject(t){if(t.projectFileName){let i=this.getProject(t.projectFileName);if(i)return i;if(!t.file)return Yy.ThrowNoProject()}return this.projectService.getScriptInfo(t.file).getDefaultProject()}getRenameLocations(t,r){let i=ws(t.file),a=this.getPositionInFile(t,i),l=this.getProjects(t),c=this.getDefaultProject(t),f=this.getPreferences(i),p=this.mapRenameInfo(c.getLanguageService().getRenameInfo(i,a,f),M.checkDefined(this.projectService.getScriptInfo(i)));if(!p.canRename)return r?{info:p,locs:[]}:[];let v=Lgt(l,c,{fileName:t.file,pos:a},!!t.findInStrings,!!t.findInComments,f,this.host.useCaseSensitiveFileNames);return r?{info:p,locs:this.toSpanGroups(v)}:v}mapRenameInfo(t,r){if(t.canRename){let{canRename:i,fileToRename:a,displayName:l,fullDisplayName:c,kind:f,kindModifiers:p,triggerSpan:v}=t;return{canRename:i,fileToRename:a,displayName:l,fullDisplayName:c,kind:f,kindModifiers:p,triggerSpan:jh(v,r)}}else return t}toSpanGroups(t){let r=new Map;for(let{fileName:i,textSpan:a,contextSpan:l,originalContextSpan:c,originalTextSpan:f,originalFileName:p,...v}of t){let g=r.get(i);g||r.set(i,g={file:i,locs:[]});let S=M.checkDefined(this.projectService.getScriptInfo(i));g.locs.push({...DSe(a,l,S),...v})}return Co(r.values())}getReferences(t,r){let i=ws(t.file),a=this.getProjects(t),l=this.getPositionInFile(t,i),c=kgt(a,this.getDefaultProject(t),{fileName:t.file,pos:l},this.host.useCaseSensitiveFileNames,this.logger);if(!r)return c;let f=this.getPreferences(i),p=this.getDefaultProject(t),v=p.getScriptInfoForNormalizedPath(i),g=p.getLanguageService().getQuickInfoAtPosition(i,l),S=g?jF(g.displayParts):"",I=g&&g.textSpan,C=I?v.positionToLineOffset(I.start).offset:0,N=I?v.getSnapshot().getText(I.start,Ol(I)):"";return{refs:aa(c,O=>O.references.map(W=>XBe(this.projectService,W,f))),symbolName:N,symbolStartOffset:C,symbolDisplayString:S}}getFileReferences(t,r){let i=this.getProjects(t),a=ws(t.file),l=this.getPreferences(a),c={fileName:a,pos:0},f=ASe(i,this.getDefaultProject(t),c,c,GBe,g=>(this.logger.info(`Finding references to file ${a} in project ${g.getProjectName()}`),g.getLanguageService().getFileReferences(a))),p;if(No(f))p=f;else{p=[];let g=pY(this.host.useCaseSensitiveFileNames);f.forEach(S=>{for(let I of S)g.has(I)||(p.push(I),g.add(I))})}return r?{refs:p.map(g=>XBe(this.projectService,g,l)),symbolName:`"${t.file}"`}:p}openClientFile(t,r,i,a){this.projectService.openClientFileWithNormalizedPath(t,r,i,!1,a)}getPosition(t,r){return t.position!==void 0?t.position:r.lineOffsetToPosition(t.line,t.offset)}getPositionInFile(t,r){let i=this.projectService.getScriptInfoForNormalizedPath(r);return this.getPosition(t,i)}getFileAndProject(t){return this.getFileAndProjectWorker(t.file,t.projectFileName)}getFileAndLanguageServiceForSyntacticOperation(t){let{file:r,project:i}=this.getFileAndProject(t);return{file:r,languageService:i.getLanguageService(!1)}}getFileAndProjectWorker(t,r){let i=ws(t),a=this.getProject(r)||this.projectService.ensureDefaultProjectForFile(i);return{file:i,project:a}}getOutliningSpans(t,r){let{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),l=a.getOutliningSpans(i);if(r){let c=this.projectService.getScriptInfoForNormalizedPath(i);return l.map(f=>({textSpan:jh(f.textSpan,c),hintSpan:jh(f.hintSpan,c),bannerText:f.bannerText,autoCollapse:f.autoCollapse,kind:f.kind}))}else return l}getTodoComments(t){let{file:r,project:i}=this.getFileAndProject(t);return i.getLanguageService().getTodoComments(r,t.descriptors)}getDocCommentTemplate(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,r);return i.getDocCommentTemplateAtPosition(r,a,this.getPreferences(r),this.getFormatOptions(r))}getSpanOfEnclosingComment(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.onlyMultiLine,l=this.getPositionInFile(t,r);return i.getSpanOfEnclosingComment(r,l,a)}getIndentation(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,r),l=t.options?uN(t.options):this.getFormatOptions(r),c=i.getIndentationAtPosition(r,a,l);return{position:a,indentation:c}}getBreakpointStatement(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,r);return i.getBreakpointStatementAtPosition(r,a)}getNameOrDottedNameSpan(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,r);return i.getNameOrDottedNameSpan(r,a,a)}isValidBraceCompletion(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.getPositionInFile(t,r);return i.isValidBraceCompletionAtPosition(r,a,t.openingBrace.charCodeAt(0))}getQuickInfoWorker(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPreferences(i),f=a.getLanguageService().getQuickInfoAtPosition(i,this.getPosition(t,l),c.maximumHoverLength,t.verbosityLevel);if(!f)return;let p=!!c.displayPartsForJSDoc;if(r){let v=jF(f.displayParts);return{kind:f.kind,kindModifiers:f.kindModifiers,start:l.positionToLineOffset(f.textSpan.start),end:l.positionToLineOffset(Ol(f.textSpan)),displayString:v,documentation:p?this.mapDisplayParts(f.documentation,a):jF(f.documentation),tags:this.mapJSDocTagInfo(f.tags,a,p),canIncreaseVerbosityLevel:f.canIncreaseVerbosityLevel}}else return p?f:{...f,tags:this.mapJSDocTagInfo(f.tags,a,!1)}}getFormattingEditsForRange(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.projectService.getScriptInfoForNormalizedPath(r),l=a.lineOffsetToPosition(t.line,t.offset),c=a.lineOffsetToPosition(t.endLine,t.endOffset),f=i.getFormattingEditsForRange(r,l,c,this.getFormatOptions(r));if(f)return f.map(p=>this.convertTextChangeToCodeEdit(p,a))}getFormattingEditsForRangeFull(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?uN(t.options):this.getFormatOptions(r);return i.getFormattingEditsForRange(r,t.position,t.endPosition,a)}getFormattingEditsForDocumentFull(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?uN(t.options):this.getFormatOptions(r);return i.getFormattingEditsForDocument(r,a)}getFormattingEditsAfterKeystrokeFull(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?uN(t.options):this.getFormatOptions(r);return i.getFormattingEditsAfterKeystroke(r,t.position,t.key,a)}getFormattingEditsAfterKeystroke(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=this.projectService.getScriptInfoForNormalizedPath(r),l=a.lineOffsetToPosition(t.line,t.offset),c=this.getFormatOptions(r),f=i.getFormattingEditsAfterKeystroke(r,l,t.key,c);if(t.key===`
431
431
  `&&(!f||f.length===0||Ngt(f,l))){let{lineText:p,absolutePosition:v}=a.textStorage.getAbsolutePositionAndLineText(t.line);if(p&&p.search("\\S")<0){let g=i.getIndentationAtPosition(r,l,c),S=0,I,C;for(I=0,C=p.length;I<C;I++)if(p.charAt(I)===" ")S++;else if(p.charAt(I)===" ")S+=c.tabSize;else break;if(g!==S){let N=v+I;f.push({span:_c(v,N),newText:Gc.getIndentationString(g,c)})}}}if(f)return f.map(p=>({start:a.positionToLineOffset(p.span.start),end:a.positionToLineOffset(Ol(p.span)),newText:p.newText?p.newText:""}))}getCompletions(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,l),f=a.getLanguageService().getCompletionsAtPosition(i,c,{...sSe(this.getPreferences(i)),triggerCharacter:t.triggerCharacter,triggerKind:t.triggerKind,includeExternalModuleExports:t.includeExternalModuleExports,includeInsertTextCompletions:t.includeInsertTextCompletions},a.projectService.getFormatCodeOptions(i));if(f===void 0)return;if(r==="completions-full")return f;let p=t.prefix||"",v=Gi(f.entries,S=>{if(f.isMemberCompletion||fo(S.name.toLowerCase(),p.toLowerCase())){let I=S.replacementSpan?jh(S.replacementSpan,l):void 0;return{...S,replacementSpan:I,hasAction:S.hasAction||void 0,symbol:void 0}}});return r==="completions"?(f.metadata&&(v.metadata=f.metadata),v):{...f,optionalReplacementSpan:f.optionalReplacementSpan&&jh(f.optionalReplacementSpan,l),entries:v}}getCompletionEntryDetails(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,l),f=a.projectService.getFormatCodeOptions(i),p=!!this.getPreferences(i).displayPartsForJSDoc,v=Gi(t.entryNames,g=>{let{name:S,source:I,data:C}=typeof g=="string"?{name:g,source:void 0,data:void 0}:g;return a.getLanguageService().getCompletionEntryDetails(i,c,S,f,I,this.getPreferences(i),C?ya(C,Ugt):void 0)});return r?p?v:v.map(g=>({...g,tags:this.mapJSDocTagInfo(g.tags,a,!1)})):v.map(g=>({...g,codeActions:vn(g.codeActions,S=>this.mapCodeAction(S)),documentation:this.mapDisplayParts(g.documentation,a),tags:this.mapJSDocTagInfo(g.tags,a,p)}))}getCompileOnSaveAffectedFileList(t){let r=this.getProjects(t,!0,!0),i=this.projectService.getScriptInfo(t.file);return i?Mgt(i,a=>this.projectService.getScriptInfoForPath(a),r,(a,l)=>{if(!a.compileOnSaveEnabled||!a.languageServiceEnabled||a.isOrphan())return;let c=a.getCompilationSettings();if(!(c.noEmit||Sd(l.fileName)&&!Pgt(c)))return{projectFileName:a.getProjectName(),fileNames:a.getCompileOnSaveAffectedFileList(l),projectUsesOutFile:!!c.outFile}}):ad}emitFile(t){let{file:r,project:i}=this.getFileAndProject(t);if(i||Yy.ThrowNoProject(),!i.languageServiceEnabled)return t.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;let a=i.getScriptInfo(r),{emitSkipped:l,diagnostics:c}=i.emitFile(a,(f,p,v)=>this.host.writeFile(f,p,v));return t.richResponse?{emitSkipped:l,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):c.map(f=>vW(f,!0))}:!l}getSignatureHelpItems(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,l),f=a.getLanguageService().getSignatureHelpItems(i,c,t),p=!!this.getPreferences(i).displayPartsForJSDoc;if(f&&r){let v=f.applicableSpan;return{...f,applicableSpan:{start:l.positionToLineOffset(v.start),end:l.positionToLineOffset(v.start+v.length)},items:this.mapSignatureHelpItems(f.items,a,p)}}else return p||!f?f:{...f,items:f.items.map(v=>({...v,tags:this.mapJSDocTagInfo(v.tags,a,!1)}))}}toPendingErrorCheck(t){let r=ws(t),i=this.projectService.tryGetDefaultProjectForFile(r);return i&&{fileName:r,project:i}}getDiagnostics(t,r,i){this.suppressDiagnosticEvents||i.length>0&&this.updateErrorCheck(t,i,r)}change(t){let r=this.projectService.getScriptInfo(t.file);M.assert(!!r),r.textStorage.switchToScriptVersionCache();let i=r.lineOffsetToPosition(t.line,t.offset),a=r.lineOffsetToPosition(t.endLine,t.endOffset);i>=0&&(this.changeSeq++,this.projectService.applyChangesToFile(r,Ko({span:{start:i,length:a-i},newText:t.insertString})))}reload(t){let r=ws(t.file),i=t.tmpfile===void 0?void 0:ws(t.tmpfile),a=this.projectService.getScriptInfoForNormalizedPath(r);a&&(this.changeSeq++,a.reloadFromFile(i))}saveToTmp(t,r){let i=this.projectService.getScriptInfo(t);i&&i.saveTo(r)}closeClientFile(t){if(!t)return;let r=Ta(t);this.projectService.closeClientFile(r)}mapLocationNavigationBarItems(t,r){return vn(t,i=>({text:i.text,kind:i.kind,kindModifiers:i.kindModifiers,spans:i.spans.map(a=>jh(a,r)),childItems:this.mapLocationNavigationBarItems(i.childItems,r),indent:i.indent}))}getNavigationBarItems(t,r){let{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),l=a.getNavigationBarItems(i);return l?r?this.mapLocationNavigationBarItems(l,this.projectService.getScriptInfoForNormalizedPath(i)):l:void 0}toLocationNavigationTree(t,r){return{text:t.text,kind:t.kind,kindModifiers:t.kindModifiers,spans:t.spans.map(i=>jh(i,r)),nameSpan:t.nameSpan&&jh(t.nameSpan,r),childItems:vn(t.childItems,i=>this.toLocationNavigationTree(i,r))}}getNavigationTree(t,r){let{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),l=a.getNavigationTree(i);return l?r?this.toLocationNavigationTree(l,this.projectService.getScriptInfoForNormalizedPath(i)):l:void 0}getNavigateToItems(t,r){let i=this.getFullNavigateToItems(t);return r?aa(i,({project:a,navigateToItems:l})=>l.map(c=>{let f=a.getScriptInfo(c.fileName),p={name:c.name,kind:c.kind,kindModifiers:c.kindModifiers,isCaseSensitive:c.isCaseSensitive,matchKind:c.matchKind,file:c.fileName,start:f.positionToLineOffset(c.textSpan.start),end:f.positionToLineOffset(Ol(c.textSpan))};return c.kindModifiers&&c.kindModifiers!==""&&(p.kindModifiers=c.kindModifiers),c.containerName&&c.containerName.length>0&&(p.containerName=c.containerName),c.containerKind&&c.containerKind.length>0&&(p.containerKind=c.containerKind),p})):aa(i,({navigateToItems:a})=>a)}getFullNavigateToItems(t){let{currentFileOnly:r,searchValue:i,maxResultCount:a,projectFileName:l}=t;if(r){M.assertIsDefined(t.file);let{file:I,project:C}=this.getFileAndProject(t);return[{project:C,navigateToItems:C.getLanguageService().getNavigateToItems(i,a,I)}]}let c=this.getHostPreferences(),f=[],p=new Map;if(!t.file&&!l)this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(I=>v(I));else{let I=this.getProjects(t);zBe(I,void 0,C=>v(C))}return f;function v(I){let C=I.getLanguageService().getNavigateToItems(i,a,void 0,I.isNonTsProject(),c.excludeLibrarySymbolsInNavTo),N=fn(C,k=>g(k)&&!fY(ek(k),I));N.length&&f.push({project:I,navigateToItems:N})}function g(I){let C=I.name;if(!p.has(C))return p.set(C,[I]),!0;let N=p.get(C);for(let k of N)if(S(k,I))return!1;return N.push(I),!0}function S(I,C){return I===C?!0:!I||!C?!1:I.containerKind===C.containerKind&&I.containerName===C.containerName&&I.fileName===C.fileName&&I.isCaseSensitive===C.isCaseSensitive&&I.kind===C.kind&&I.kindModifiers===C.kindModifiers&&I.matchKind===C.matchKind&&I.name===C.name&&I.textSpan.start===C.textSpan.start&&I.textSpan.length===C.textSpan.length}}getSupportedCodeFixes(t){if(!t)return NX();if(t.file){let{file:i,project:a}=this.getFileAndProject(t);return a.getLanguageService().getSupportedCodeFixes(i)}let r=this.getProject(t.projectFileName);return r||Yy.ThrowNoProject(),r.getLanguageService().getSupportedCodeFixes()}isLocation(t){return t.line!==void 0}extractPositionOrRange(t,r){let i,a;return this.isLocation(t)?i=l(t):a=this.getRange(t,r),M.checkDefined(i===void 0?a:i);function l(c){return c.position!==void 0?c.position:r.lineOffsetToPosition(c.line,c.offset)}}getRange(t,r){let{startPosition:i,endPosition:a}=this.getStartAndEndPosition(t,r);return{pos:i,end:a}}getApplicableRefactors(t){let{file:r,project:i}=this.getFileAndProject(t),a=i.getScriptInfoForNormalizedPath(r);return i.getLanguageService().getApplicableRefactors(r,this.extractPositionOrRange(t,a),this.getPreferences(r),t.triggerReason,t.kind,t.includeInteractiveActions).map(c=>({...c,actions:c.actions.map(f=>({...f,range:f.range?{start:pN({line:f.range.start.line,character:f.range.start.offset}),end:pN({line:f.range.end.line,character:f.range.end.offset})}:void 0}))}))}getEditsForRefactor(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=a.getScriptInfoForNormalizedPath(i),c=a.getLanguageService().getEditsForRefactor(i,this.getFormatOptions(i),this.extractPositionOrRange(t,l),t.refactor,t.action,this.getPreferences(i),t.interactiveRefactorArguments);if(c===void 0)return{edits:[]};if(r){let{renameFilename:f,renameLocation:p,edits:v}=c,g;if(f!==void 0&&p!==void 0){let S=a.getScriptInfoForNormalizedPath(ws(f));g=ISe(lI(S.getSnapshot()),f,p,v)}return{renameLocation:g,renameFilename:f,edits:this.mapTextChangesToCodeEdits(v),notApplicableReason:c.notApplicableReason}}return c}getMoveToRefactoringFileSuggestions(t){let{file:r,project:i}=this.getFileAndProject(t),a=i.getScriptInfoForNormalizedPath(r);return i.getLanguageService().getMoveToRefactoringFileSuggestions(r,this.extractPositionOrRange(t,a),this.getPreferences(r))}preparePasteEdits(t){let{file:r,project:i}=this.getFileAndProject(t);return i.getLanguageService().preparePasteEditsForFile(r,t.copiedTextSpan.map(a=>this.getRange({file:r,startLine:a.start.line,startOffset:a.start.offset,endLine:a.end.line,endOffset:a.end.offset},this.projectService.getScriptInfoForNormalizedPath(r))))}getPasteEdits(t){let{file:r,project:i}=this.getFileAndProject(t);if(QL(r))return;let a=t.copiedFrom?{file:t.copiedFrom.file,range:t.copiedFrom.spans.map(c=>this.getRange({file:t.copiedFrom.file,startLine:c.start.line,startOffset:c.start.offset,endLine:c.end.line,endOffset:c.end.offset},i.getScriptInfoForNormalizedPath(ws(t.copiedFrom.file))))}:void 0,l=i.getLanguageService().getPasteEdits({targetFile:r,pastedText:t.pastedText,pasteLocations:t.pasteLocations.map(c=>this.getRange({file:r,startLine:c.start.line,startOffset:c.start.offset,endLine:c.end.line,endOffset:c.end.offset},i.getScriptInfoForNormalizedPath(r))),copiedFrom:a,preferences:this.getPreferences(r)},this.getFormatOptions(r));return l&&this.mapPasteEditsAction(l)}organizeImports(t,r){M.assert(t.scope.type==="file");let{file:i,project:a}=this.getFileAndProject(t.scope.args),l=a.getLanguageService().organizeImports({fileName:i,mode:t.mode??(t.skipDestructiveCodeActions?"SortAndCombine":void 0),type:"file"},this.getFormatOptions(i),this.getPreferences(i));return r?this.mapTextChangesToCodeEdits(l):l}getEditsForFileRename(t,r){let i=ws(t.oldFilePath),a=ws(t.newFilePath),l=this.getHostFormatOptions(),c=this.getHostPreferences(),f=new Set,p=[];return this.projectService.loadAncestorProjectTree(),this.projectService.forEachEnabledProject(v=>{let g=v.getLanguageService().getEditsForFileRename(i,a,l,c),S=[];for(let I of g)f.has(I.fileName)||(p.push(I),S.push(I.fileName));for(let I of S)f.add(I)}),r?p.map(v=>this.mapTextChangeToCodeEdit(v)):p}getCodeFixes(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=a.getScriptInfoForNormalizedPath(i),{startPosition:c,endPosition:f}=this.getStartAndEndPosition(t,l),p;try{p=a.getLanguageService().getCodeFixesAtPosition(i,c,f,t.errorCodes,this.getFormatOptions(i),this.getPreferences(i))}catch(v){let g=v instanceof Error?v:new Error(v),S=a.getLanguageService(),I=[...S.getSyntacticDiagnostics(i),...S.getSemanticDiagnostics(i),...S.getSuggestionDiagnostics(i)].filter(N=>Lw(c,f-c,N.start,N.length)).map(N=>N.code),C=t.errorCodes.find(N=>!I.includes(N));throw C!==void 0&&(g.message+=`
432
432
  Additional information: BADCLIENT: Bad error code, ${C} not found in range ${c}..${f} (found: ${I.join(", ")})`),g}return r?p.map(v=>this.mapCodeFixAction(v)):p}getCombinedCodeFix({scope:t,fixId:r},i){M.assert(t.type==="file");let{file:a,project:l}=this.getFileAndProject(t.args),c=l.getLanguageService().getCombinedCodeFix({type:"file",fileName:a},r,this.getFormatOptions(a),this.getPreferences(a));return i?{changes:this.mapTextChangesToCodeEdits(c.changes),commands:c.commands}:c}applyCodeActionCommand(t){let r=t.command;for(let i of K1(r)){let{file:a,project:l}=this.getFileAndProject(i);l.getLanguageService().applyCodeActionCommand(i,this.getFormatOptions(a)).then(c=>{},c=>{})}return{}}getStartAndEndPosition(t,r){let i,a;return t.startPosition!==void 0?i=t.startPosition:(i=r.lineOffsetToPosition(t.startLine,t.startOffset),t.startPosition=i),t.endPosition!==void 0?a=t.endPosition:(a=r.lineOffsetToPosition(t.endLine,t.endOffset),t.endPosition=a),{startPosition:i,endPosition:a}}mapCodeAction({description:t,changes:r,commands:i}){return{description:t,changes:this.mapTextChangesToCodeEdits(r),commands:i}}mapCodeFixAction({fixName:t,description:r,changes:i,commands:a,fixId:l,fixAllDescription:c}){return{fixName:t,description:r,changes:this.mapTextChangesToCodeEdits(i),commands:a,fixId:l,fixAllDescription:c}}mapPasteEditsAction({edits:t,fixId:r}){return{edits:this.mapTextChangesToCodeEdits(t),fixId:r}}mapTextChangesToCodeEdits(t){return t.map(r=>this.mapTextChangeToCodeEdit(r))}mapTextChangeToCodeEdit(t){let r=this.projectService.getScriptInfoOrConfig(t.fileName);return!!t.isNewFile==!!r&&(r||this.projectService.logErrorForScriptInfoNotFound(t.fileName),M.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!r}))),r?{fileName:t.fileName,textChanges:t.textChanges.map(i=>Wgt(i,r))}:Ggt(t)}convertTextChangeToCodeEdit(t,r){return{start:r.positionToLineOffset(t.span.start),end:r.positionToLineOffset(t.span.start+t.span.length),newText:t.newText?t.newText:""}}getBraceMatching(t,r){let{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),l=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getPosition(t,l),f=a.getBraceMatchingAtPosition(i,c);return f?r?f.map(p=>jh(p,l)):f:void 0}getDiagnosticsForProject(t,r,i){if(this.suppressDiagnosticEvents)return;let{fileNames:a,languageServiceDisabled:l}=this.getProjectInfoWorker(i,void 0,!0,void 0,!0);if(l)return;let c=a.filter(k=>!k.includes("lib.d.ts"));if(c.length===0)return;let f=[],p=[],v=[],g=[],S=ws(i),I=this.projectService.ensureDefaultProjectForFile(S);for(let k of c)this.getCanonicalFileName(k)===this.getCanonicalFileName(i)?f.push(k):this.projectService.getScriptInfo(k).isScriptOpen()?p.push(k):Sd(k)?g.push(k):v.push(k);let N=[...f,...p,...v,...g].map(k=>({fileName:k,project:I}));this.updateErrorCheck(t,N,r,!1)}configurePlugin(t){this.projectService.configurePlugin(t)}getSmartSelectionRange(t,r){let{locations:i}=t,{file:a,languageService:l}=this.getFileAndLanguageServiceForSyntacticOperation(t),c=M.checkDefined(this.projectService.getScriptInfo(a));return vn(i,f=>{let p=this.getPosition(f,c),v=l.getSmartSelectionRange(a,p);return r?this.mapSelectionRange(v,c):v})}toggleLineComment(t,r){let{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),l=this.projectService.getScriptInfo(i),c=this.getRange(t,l),f=a.toggleLineComment(i,c);if(r){let p=this.projectService.getScriptInfoForNormalizedPath(i);return f.map(v=>this.convertTextChangeToCodeEdit(v,p))}return f}toggleMultilineComment(t,r){let{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),l=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,l),f=a.toggleMultilineComment(i,c);if(r){let p=this.projectService.getScriptInfoForNormalizedPath(i);return f.map(v=>this.convertTextChangeToCodeEdit(v,p))}return f}commentSelection(t,r){let{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),l=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,l),f=a.commentSelection(i,c);if(r){let p=this.projectService.getScriptInfoForNormalizedPath(i);return f.map(v=>this.convertTextChangeToCodeEdit(v,p))}return f}uncommentSelection(t,r){let{file:i,languageService:a}=this.getFileAndLanguageServiceForSyntacticOperation(t),l=this.projectService.getScriptInfoForNormalizedPath(i),c=this.getRange(t,l),f=a.uncommentSelection(i,c);if(r){let p=this.projectService.getScriptInfoForNormalizedPath(i);return f.map(v=>this.convertTextChangeToCodeEdit(v,p))}return f}mapSelectionRange(t,r){let i={textSpan:jh(t.textSpan,r)};return t.parent&&(i.parent=this.mapSelectionRange(t.parent,r)),i}getScriptInfoFromProjectService(t){let r=ws(t),i=this.projectService.getScriptInfoForNormalizedPath(r);return i||(this.projectService.logErrorForScriptInfoNotFound(r),Yy.ThrowNoProject())}toProtocolCallHierarchyItem(t){let r=this.getScriptInfoFromProjectService(t.file);return{name:t.name,kind:t.kind,kindModifiers:t.kindModifiers,file:t.file,containerName:t.containerName,span:jh(t.span,r),selectionSpan:jh(t.selectionSpan,r)}}toProtocolCallHierarchyIncomingCall(t){let r=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(i=>jh(i,r))}}toProtocolCallHierarchyOutgoingCall(t,r){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(i=>jh(i,r))}}prepareCallHierarchy(t){let{file:r,project:i}=this.getFileAndProject(t),a=this.projectService.getScriptInfoForNormalizedPath(r);if(a){let l=this.getPosition(t,a),c=i.getLanguageService().prepareCallHierarchy(r,l);return c&&zq(c,f=>this.toProtocolCallHierarchyItem(f))}}provideCallHierarchyIncomingCalls(t){let{file:r,project:i}=this.getFileAndProject(t),a=this.getScriptInfoFromProjectService(r);return i.getLanguageService().provideCallHierarchyIncomingCalls(r,this.getPosition(t,a)).map(c=>this.toProtocolCallHierarchyIncomingCall(c))}provideCallHierarchyOutgoingCalls(t){let{file:r,project:i}=this.getFileAndProject(t),a=this.getScriptInfoFromProjectService(r);return i.getLanguageService().provideCallHierarchyOutgoingCalls(r,this.getPosition(t,a)).map(c=>this.toProtocolCallHierarchyOutgoingCall(c,a))}getCanonicalFileName(t){let r=this.host.useCaseSensitiveFileNames?t:Fb(t);return Ta(r)}exit(){}notRequired(t){return t&&this.doOutput(void 0,t.command,t.seq,!0,this.performanceData),{responseRequired:!1,performanceData:this.performanceData}}requiredResponse(t){return{response:t,responseRequired:!0,performanceData:this.performanceData}}addProtocolHandler(t,r){if(this.handlers.has(t))throw new Error(`Protocol handler already exists for command "${t}"`);this.handlers.set(t,r)}setCurrentRequest(t){M.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){M.assert(this.currentRequestId===t),this.currentRequestId=void 0,this.cancellationToken.resetRequest(t)}executeWithRequestId(t,r,i){let a=this.performanceData;try{return this.performanceData=i,this.setCurrentRequest(t),r()}finally{this.resetCurrentRequest(t),this.performanceData=a}}executeCommand(t){let r=this.handlers.get(t.command);if(r){let i=this.executeWithRequestId(t.seq,()=>r(t),void 0);return this.projectService.enableRequestedPlugins(),i}else return this.logger.msg(`Unrecognized JSON command:${qT(t)}`,"Err"),this.doOutput(void 0,"unknown",t.seq,!1,void 0,`Unrecognized JSON command: ${t.command}`),{responseRequired:!1}}onMessage(t){var r,i,a,l,c,f,p;this.gcTimer.scheduleCollect();let v,g=this.performanceData;this.logger.hasLevel(2)&&(v=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${xL(this.toStringMessage(t))}`));let S,I;try{S=this.parseMessage(t),I=S.arguments&&S.arguments.file?S.arguments:void 0,(r=Ar)==null||r.instant(Ar.Phase.Session,"request",{seq:S.seq,command:S.command}),(i=Ar)==null||i.push(Ar.Phase.Session,"executeCommand",{seq:S.seq,command:S.command},!0);let{response:C,responseRequired:N,performanceData:k}=this.executeCommand(S);if((a=Ar)==null||a.pop(),this.logger.hasLevel(2)){let O=Cgt(this.hrtime(v)).toFixed(4);N?this.logger.perftrc(`${S.seq}::${S.command}: elapsed time (in milliseconds) ${O}`):this.logger.perftrc(`${S.seq}::${S.command}: async elapsed time (in milliseconds) ${O}`)}(l=Ar)==null||l.instant(Ar.Phase.Session,"response",{seq:S.seq,command:S.command,success:!!C}),C?this.doOutput(C,S.command,S.seq,!0,k):N&&this.doOutput(void 0,S.command,S.seq,!1,k,"No content available.")}catch(C){if((c=Ar)==null||c.popAll(),C instanceof bR){(f=Ar)==null||f.instant(Ar.Phase.Session,"commandCanceled",{seq:S?.seq,command:S?.command}),this.doOutput({canceled:!0},S.command,S.seq,!0,this.performanceData);return}this.logErrorWorker(C,this.toStringMessage(t),I),(p=Ar)==null||p.instant(Ar.Phase.Session,"commandError",{seq:S?.seq,command:S?.command,message:C.message}),this.doOutput(void 0,S?S.command:"unknown",S?S.seq:0,!1,this.performanceData,"Error processing request. "+C.message+`
433
- `+C.stack)}finally{this.performanceData=g}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function JBe(e){let t=e.diagnosticsDuration&&Co(e.diagnosticsDuration,([r,i])=>({...i,file:r}));return{...e,diagnosticsDuration:t}}function jh(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Ol(e))}}function DSe(e,t,r){let i=jh(e,r),a=t&&jh(t,r);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}function Wgt(e,t){return{start:qBe(t,e.span.start),end:qBe(t,Ol(e.span)),newText:e.newText}}function qBe(e,t){return vSe(e)?zgt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function Bgt(e,t){let r=e.ranges.map(i=>({start:t.positionToLineOffset(i.start),end:t.positionToLineOffset(i.start+i.length)}));return e.wordPattern?{ranges:r,wordPattern:e.wordPattern}:{ranges:r}}function zgt(e){return{line:e.line+1,offset:e.character+1}}function Ggt(e){M.assert(e.textChanges.length===1);let t=rs(e.textChanges);return M.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function ISe(e,t,r,i){let a=Vgt(e,t,i),{line:l,character:c}=IC(Z1(a),r);return{line:l+1,offset:c+1}}function Vgt(e,t,r){for(let{fileName:i,textChanges:a}of r)if(i===t)for(let l=a.length-1;l>=0;l--){let{newText:c,span:{start:f,length:p}}=a[l];e=e.slice(0,f)+c+e.slice(f+p)}return e}function XBe(e,{fileName:t,textSpan:r,contextSpan:i,isWriteAccess:a,isDefinition:l},{disableLineTextInReferences:c}){let f=M.checkDefined(e.getScriptInfo(t)),p=DSe(r,i,f),v=c?void 0:jgt(f,p);return{file:t,...p,lineText:v,isWriteAccess:a,isDefinition:l}}function jgt(e,t){let r=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(r.start,Ol(r)).replace(/\r|\n/g,"")}function Ugt(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var fN=4,CSe=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(CSe||{}),Hgt=class{constructor(){this.goSubtree=!0,this.lineIndex=new bW,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new mN,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;let i=bW.linesFromText(e).lines;i.length>1&&i[i.length-1]===""&&i.pop();let a,l;for(let f=this.endBranch.length-1;f>=0;f--)this.endBranch[f].updateCounts(),this.endBranch[f].charCount()===0&&(l=this.endBranch[f],f>0?a=this.endBranch[f-1]:a=this.branchNode);l&&a.remove(l);let c=this.startPath[this.startPath.length-1];if(i.length>0)if(c.text=i[0],i.length>1){let f=new Array(i.length-1),p=c;for(let S=1;S<i.length;S++)f[S-1]=new qG(i[S]);let v=this.startPath.length-2;for(;v>=0;){let S=this.startPath[v];f=S.insertAt(p,f),v--,p=S}let g=f.length;for(;g>0;){let S=new mN;S.add(this.lineIndex.root),f=S.insertAt(this.lineIndex.root,f),g=f.length,this.lineIndex.root=S}this.lineIndex.root.updateCounts()}else for(let f=this.startPath.length-2;f>=0;f--)this.startPath[f].updateCounts();else{this.startPath[this.startPath.length-2].remove(c);for(let p=this.startPath.length-2;p>=0;p--)this.startPath[p].updateCounts()}return this.lineIndex}post(e,t,r){r===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,r,i,a){let l=this.stack[this.stack.length-1];this.state===2&&a===1&&(this.state=1,this.branchNode=l,this.lineCollectionAtBranch=r);let c;function f(p){return p.isLeaf()?new qG(""):new mN}switch(a){case 0:this.goSubtree=!1,this.state!==4&&l.add(r);break;case 1:this.state===4?this.goSubtree=!1:(c=f(r),l.add(c),this.startPath.push(c));break;case 2:this.state!==4?(c=f(r),l.add(c),this.startPath.push(c)):r.isLeaf()||(c=f(r),l.add(c),this.endBranch.push(c));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:r.isLeaf()||(c=f(r),l.add(c),this.endBranch.push(c));break;case 5:this.goSubtree=!1,this.state!==1&&l.add(r);break}this.goSubtree&&this.stack.push(c)}leaf(e,t,r){this.state===1?this.initialText=r.text.substring(0,e):this.state===2?(this.initialText=r.text.substring(0,e),this.trailingText=r.text.substring(e+t)):this.trailingText=r.text.substring(e+t)}},Kgt=class{constructor(e,t,r){this.pos=e,this.deleteLen=t,this.insertedText=r}getTextChangeRange(){return kw(Hd(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},mY=class P1{constructor(){this.changes=[],this.versions=new Array(P1.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%P1.maxVersions}currentVersionToIndex(){return this.currentVersion%P1.maxVersions}edit(t,r,i){this.changes.push(new Kgt(t,r,i)),(this.changes.length>P1.changeNumberThreshold||r>P1.changeLengthThreshold||i&&i.length>P1.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let r=t.index;for(let i of this.changes)r=r.edit(i.pos,i.deleteLen,i.insertedText);t=new $Be(this.currentVersion+1,this,r,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=P1.maxVersions&&(this.minVersion=this.currentVersion-P1.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,r){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(r-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){let r=this._getSnapshot().index,{lineText:i,absolutePosition:a}=r.lineNumberToInfo(t+1),l=i!==void 0?i.length:r.absolutePositionOfStartOfLine(t+2)-a;return Hd(a,l)}getTextChangesBetweenVersions(t,r){if(t<r)if(t>=this.minVersion){let i=[];for(let a=t+1;a<=r;a++){let l=this.versions[this.versionToIndex(a)];for(let c of l.changesSincePreviousVersion)i.push(c.getTextChangeRange())}return use(i)}else return;else return b6}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let r=new P1,i=new $Be(0,r,new bW);r.versions[r.currentVersion]=i;let a=bW.linesFromText(t);return i.index.load(a.lines),r}};mY.changeNumberThreshold=8,mY.changeLengthThreshold=256,mY.maxVersions=8;var _Y=mY,$Be=class tUe{constructor(t,r,i,a=ad){this.version=t,this.cache=r,this.index=i,this.changesSincePreviousVersion=a}getText(t,r){return this.index.getText(t,r-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof tUe&&this.cache===t.cache)return this.version<=t.version?b6:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},bW=class Txe{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){let{oneBasedLine:r,zeroBasedColumn:i}=this.root.charOffsetToLineInfo(1,t);return{line:r,offset:i+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){let r=this.getLineCount();if(t<=r){let{position:i,leaf:a}=this.root.lineNumberToInfo(t,0);return{absolutePosition:i,lineText:a&&a.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){let r=[];for(let i=0;i<t.length;i++)r[i]=new qG(t[i]);this.root=Txe.buildTreeFromBottom(r)}else this.root=new mN}walk(t,r,i){this.root.walk(t,r,i)}getText(t,r){let i="";return r>0&&t<this.root.charCount()&&this.walk(t,r,{goSubtree:!0,done:!1,leaf:(a,l,c)=>{i=i.concat(c.text.substring(a,a+l))}}),i}getLength(){return this.root.charCount()}every(t,r,i){i||(i=this.root.charCount());let a={goSubtree:!0,done:!1,leaf(l,c,f){t(f,l,c)||(this.done=!0)}};return this.walk(r,i-r,a),!a.done}edit(t,r,i){if(this.root.charCount()===0)return M.assert(r===0),i!==void 0?(this.load(Txe.linesFromText(i).lines),this):void 0;{let a;if(this.checkEdits){let f=this.getText(0,this.root.charCount());a=f.slice(0,t)+i+f.slice(t+r)}let l=new Hgt,c=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;let f=this.getText(t,1);i?i=f+i:i=f,r=0,c=!0}else if(r>0){let f=t+r,{zeroBasedColumn:p,lineText:v}=this.positionToColumnAndLineText(f);p===0&&(r+=v.length,i=i?i+v:v)}if(this.root.walk(t,r,l),l.insertLines(i,c),this.checkEdits){let f=l.lineIndex.getText(0,l.lineIndex.getLength());M.assert(a===f,"buffer edit mismatch")}return l.lineIndex}}static buildTreeFromBottom(t){if(t.length<fN)return new mN(t);let r=new Array(Math.ceil(t.length/fN)),i=0;for(let a=0;a<r.length;a++){let l=Math.min(i+fN,t.length);r[a]=new mN(t.slice(i,l)),i=l}return this.buildTreeFromBottom(r)}static linesFromText(t){let r=Z1(t);if(r.length===0)return{lines:[],lineMap:r};let i=new Array(r.length),a=r.length-1;for(let c=0;c<a;c++)i[c]=t.substring(r[c],r[c+1]);let l=t.substring(r[a]);return l.length>0?i[a]=l:i.pop(),{lines:i,lineMap:r}}},mN=class Exe{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,r,i,a,l){return i.pre&&i.pre(t,r,this.children[a],this,l),i.goSubtree?(this.children[a].walk(t,r,i),i.post&&i.post(t,r,this.children[a],this,l)):i.goSubtree=!0,i.done}skipChild(t,r,i,a,l){a.pre&&!a.done&&(a.pre(t,r,this.children[i],this,l),a.goSubtree=!0)}walk(t,r,i){if(this.children.length===0)return;let a=0,l=this.children[a].charCount(),c=t;for(;c>=l;)this.skipChild(c,r,a,i,0),c-=l,a++,l=this.children[a].charCount();if(c+r<=l){if(this.execWalk(c,r,i,a,2))return}else{if(this.execWalk(c,l-c,i,a,1))return;let f=r-(l-c);for(a++,l=this.children[a].charCount();f>l;){if(this.execWalk(0,l,i,a,3))return;f-=l,a++,l=this.children[a].charCount()}if(f>0&&this.execWalk(0,f,i,a,4))return}if(i.pre){let f=this.children.length;if(a<f-1)for(let p=a+1;p<f;p++)this.skipChild(0,0,p,i,5)}}charOffsetToLineInfo(t,r){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:r,lineText:void 0};for(let l of this.children){if(l.charCount()>r)return l.isLeaf()?{oneBasedLine:t,zeroBasedColumn:r,lineText:l.text}:l.charOffsetToLineInfo(t,r);r-=l.charCount(),t+=l.lineCount()}let i=this.lineCount();if(i===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let a=M.checkDefined(this.lineNumberToInfo(i,0).leaf);return{oneBasedLine:i,zeroBasedColumn:a.charCount(),lineText:void 0}}lineNumberToInfo(t,r){for(let i of this.children){let a=i.lineCount();if(a>=t)return i.isLeaf()?{position:r,leaf:i}:i.lineNumberToInfo(t,r);t-=a,r+=i.charCount()}return{position:r,leaf:void 0}}splitAfter(t){let r,i=this.children.length;t++;let a=t;if(t<i){for(r=new Exe;t<i;)r.add(this.children[t]),t++;r.updateCounts()}return this.children.length=a,r}remove(t){let r=this.findChildIndex(t),i=this.children.length;if(r<i-1)for(let a=r;a<i-1;a++)this.children[a]=this.children[a+1];this.children.pop()}findChildIndex(t){let r=this.children.indexOf(t);return M.assert(r!==-1),r}insertAt(t,r){let i=this.findChildIndex(t),a=this.children.length,l=r.length;if(a<fN&&i===a-1&&l===1)return this.add(r[0]),this.updateCounts(),[];{let c=this.splitAfter(i),f=0;for(i++;i<fN&&f<l;)this.children[i]=r[f],i++,f++;let p=[],v=0;if(f<l){v=Math.ceil((l-f)/fN),p=new Array(v);let g=0;for(let I=0;I<v;I++)p[I]=new Exe;let S=p[0];for(;f<l;)S.add(r[f]),f++,S.children.length===fN&&(g++,S=p[g]);for(let I=p.length-1;I>=0;I--)p[I].children.length===0&&p.pop()}c&&p.push(c),this.updateCounts();for(let g=0;g<v;g++)p[g].updateCounts();return p}}add(t){this.children.push(t),M.assert(this.children.length<=fN)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},qG=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,r){r.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},YBe=class nUe{constructor(t,r,i,a,l,c){this.telemetryEnabled=t,this.logger=r,this.host=i,this.globalTypingsCacheLocation=a,this.event=l,this.maxActiveRequestCount=c,this.activeRequestCount=0,this.requestQueue=yw(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var r;return ES.validatePackageName(t)!==ES.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((r=this.typesRegistryCache)!=null&&r.has(t)))}installPackage(t){this.packageInstallId++;let r={kind:"installPackage",...t,id:this.packageInstallId},i=new Promise((a,l)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:a,reject:l})});return this.installer.send(r),i}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,r,i){let a=wbe(t,r,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${qT(a)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(a):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${a.projectName}`),this.requestQueue.enqueue(a),this.requestMap.set(a.projectName,a))}handleMessage(t){var r,i;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${qT(t)}`),t.kind){case BJ:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case fz:{let a=(r=this.packageInstalledPromise)==null?void 0:r.get(t.id);M.assertIsDefined(a,"Should find the promise for package install"),(i=this.packageInstalledPromise)==null||i.delete(t.id),t.success?a.resolve({successMessage:t.message}):a.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case Gme:{let a={message:t.message};this.event(a,"typesInstallerInitializationFailed");break}case zJ:{let a={eventId:t.eventId,packages:t.packagesToInstall};this.event(a,"beginInstallTypes");break}case GJ:{if(this.telemetryEnabled){let c={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(c,"telemetry")}let a={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(a,"endInstallTypes");break}case pz:{this.projectService.updateTypingsForProject(t);break}case uz:{for(this.activeRequestCount>0?this.activeRequestCount--:M.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){let a=this.requestQueue.dequeue();if(this.requestMap.get(a.projectName)===a){this.requestMap.delete(a.projectName),this.scheduleRequest(a);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${a.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case _F:this.projectService.watchTypingLocations(t);break;default:}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${qT(t)}`),this.installer.send(t)},nUe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};YBe.requestDelayMillis=100;var QBe=YBe,ZBe={};L(ZBe,{ActionInvalidate:()=>pz,ActionPackageInstalled:()=>fz,ActionSet:()=>uz,ActionWatchTypingLocations:()=>_F,Arguments:()=>VJ,AutoImportProviderProject:()=>nSe,AuxiliaryProject:()=>eSe,CharRangeSection:()=>CSe,CloseFileWatcherEvent:()=>rY,CommandNames:()=>WBe,ConfigFileDiagEvent:()=>Q$,ConfiguredProject:()=>rSe,ConfiguredProjectLoadKind:()=>cSe,CreateDirectoryWatcherEvent:()=>nY,CreateFileWatcherEvent:()=>tY,Errors:()=>Yy,EventBeginInstallTypes:()=>zJ,EventEndInstallTypes:()=>GJ,EventInitializationFailed:()=>Gme,EventTypesRegistry:()=>BJ,ExternalProject:()=>K$,GcTimer:()=>Vbe,InferredProject:()=>Zbe,LargeFileReferencedEvent:()=>Y$,LineIndex:()=>bW,LineLeaf:()=>qG,LineNode:()=>mN,LogLevel:()=>Lbe,Msg:()=>kbe,OpenFileInfoTelemetryEvent:()=>iSe,Project:()=>TI,ProjectInfoTelemetryEvent:()=>eY,ProjectKind:()=>ZL,ProjectLanguageServiceStateEvent:()=>Z$,ProjectLoadingFinishEvent:()=>$$,ProjectLoadingStartEvent:()=>X$,ProjectService:()=>ySe,ProjectsUpdatedInBackgroundEvent:()=>HG,ScriptInfo:()=>Kbe,ScriptVersionCache:()=>_Y,Session:()=>KBe,TextStorage:()=>Hbe,ThrottledOperations:()=>Gbe,TypingsInstallerAdapter:()=>QBe,allFilesAreJsOrDts:()=>$be,allRootFilesAreJsOrDts:()=>Xbe,asNormalizedPath:()=>dBe,convertCompilerOptions:()=>KG,convertFormatOptions:()=>uN,convertScriptKindName:()=>oY,convertTypeAcquisition:()=>aSe,convertUserPreferences:()=>sSe,convertWatchOptions:()=>yW,countEachFileTypes:()=>mW,createInstallTypingsRequest:()=>wbe,createModuleSpecifierCache:()=>SSe,createNormalizedPathMap:()=>uBe,createPackageJsonCache:()=>TSe,createSortedArray:()=>zbe,emptyArray:()=>ad,findArgument:()=>uLe,formatDiagnosticToProtocol:()=>vW,formatMessage:()=>ESe,getBaseConfigFileName:()=>H$,getDetailWatchInfo:()=>cY,getLocationInNewDocument:()=>ISe,hasArgument:()=>dLe,hasNoTypeScriptSource:()=>Ybe,indent:()=>xL,isBackgroundProject:()=>hW,isConfigFile:()=>vSe,isConfiguredProject:()=>Qv,isDynamicFileName:()=>QL,isExternalProject:()=>_W,isInferredProject:()=>dN,isInferredProjectName:()=>Obe,isProjectDeferredClose:()=>gW,makeAutoImportProviderProjectName:()=>Wbe,makeAuxiliaryProjectName:()=>Bbe,makeInferredProjectName:()=>Fbe,maxFileSize:()=>q$,maxProgramSizeForNonTsFiles:()=>J$,normalizedPathToPath:()=>cN,nowString:()=>pLe,nullCancellationToken:()=>wBe,nullTypingsInstaller:()=>JG,protocol:()=>jbe,scriptInfoIsContainedByBackgroundProject:()=>Jbe,scriptInfoIsContainedByDeferredClosedProject:()=>qbe,stringifyIndented:()=>qT,toEvent:()=>xSe,toNormalizedPath:()=>ws,tryConvertScriptKindName:()=>iY,typingsInstaller:()=>Mbe,updateProjectIfDirty:()=>Zm}),typeof console<"u"&&(M.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return Xje},set exports(h){Xje=h,typeof DZ<"u"&&DZ.exports&&(DZ.exports=h)}})});var oUe=Om(Jk=>{"use strict";Object.defineProperty(Jk,"__esModule",{value:!0});Jk.range=Jk.balanced=void 0;var KCt=(h,o,u)=>{let b=h instanceof RegExp?iUe(h,u):h,x=o instanceof RegExp?iUe(o,u):o,L=b!==null&&x!=null&&(0,Jk.range)(b,x,u);return L&&{start:L[0],end:L[1],pre:u.slice(0,L[0]),body:u.slice(L[0]+b.length,L[1]),post:u.slice(L[1]+x.length)}};Jk.balanced=KCt;var iUe=(h,o)=>{let u=o.match(h);return u?u[0]:null},JCt=(h,o,u)=>{let b,x,L,j,me,Oe=u.indexOf(h),tt=u.indexOf(o,Oe+1),at=Oe;if(Oe>=0&&tt>0){if(h===o)return[Oe,tt];for(b=[],L=u.length;at>=0&&!me;){if(at===Oe)b.push(at),Oe=u.indexOf(h,at+1);else if(b.length===1){let dt=b.pop();dt!==void 0&&(me=[dt,tt])}else x=b.pop(),x!==void 0&&x<L&&(L=x,j=tt),tt=u.indexOf(o,at+1);at=Oe<tt&&Oe>=0?Oe:tt}b.length&&j!==void 0&&(me=[L,j])}return me};Jk.range=JCt});var pUe=Om(D8=>{"use strict";Object.defineProperty(D8,"__esModule",{value:!0});D8.EXPANSION_MAX=void 0;D8.expand=aPt;var aUe=oUe(),sUe="\0SLASH"+Math.random()+"\0",lUe="\0OPEN"+Math.random()+"\0",Axe="\0CLOSE"+Math.random()+"\0",cUe="\0COMMA"+Math.random()+"\0",dUe="\0PERIOD"+Math.random()+"\0",qCt=new RegExp(sUe,"g"),XCt=new RegExp(lUe,"g"),$Ct=new RegExp(Axe,"g"),YCt=new RegExp(cUe,"g"),QCt=new RegExp(dUe,"g"),ZCt=/\\\\/g,ePt=/\\{/g,tPt=/\\}/g,nPt=/\\,/g,rPt=/\\\./g;D8.EXPANSION_MAX=1e5;function xxe(h){return isNaN(h)?h.charCodeAt(0):parseInt(h,10)}function iPt(h){return h.replace(ZCt,sUe).replace(ePt,lUe).replace(tPt,Axe).replace(nPt,cUe).replace(rPt,dUe)}function oPt(h){return h.replace(qCt,"\\").replace(XCt,"{").replace($Ct,"}").replace(YCt,",").replace(QCt,".")}function uUe(h){if(!h)return[""];let o=[],u=(0,aUe.balanced)("{","}",h);if(!u)return h.split(",");let{pre:b,body:x,post:L}=u,j=b.split(",");j[j.length-1]+="{"+x+"}";let me=uUe(L);return L.length&&(j[j.length-1]+=me.shift(),j.push.apply(j,me)),o.push.apply(o,j),o}function aPt(h,o={}){if(!h)return[];let{max:u=D8.EXPANSION_MAX}=o;return h.slice(0,2)==="{}"&&(h="\\{\\}"+h.slice(2)),x5(iPt(h),u,!0).map(oPt)}function sPt(h){return"{"+h+"}"}function lPt(h){return/^-?0\d/.test(h)}function cPt(h,o){return h<=o}function dPt(h,o){return h>=o}function x5(h,o,u){let b=[],x=(0,aUe.balanced)("{","}",h);if(!x)return[h];let L=x.pre,j=x.post.length?x5(x.post,o,!1):[""];if(/\$$/.test(x.pre))for(let me=0;me<j.length&&me<o;me++){let Oe=L+"{"+x.body+"}"+j[me];b.push(Oe)}else{let me=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(x.body),Oe=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(x.body),tt=me||Oe,at=x.body.indexOf(",")>=0;if(!tt&&!at)return x.post.match(/,(?!,).*\}/)?(h=x.pre+"{"+x.body+Axe+x.post,x5(h,o,!0)):[h];let dt;if(tt)dt=x.body.split(/\.\./);else if(dt=uUe(x.body),dt.length===1&&dt[0]!==void 0&&(dt=x5(dt[0],o,!1).map(sPt),dt.length===1))return j.map(yn=>x.pre+dt[0]+yn);let xe;if(tt&&dt[0]!==void 0&&dt[1]!==void 0){let yn=xxe(dt[0]),pt=xxe(dt[1]),ut=Math.max(dt[0].length,dt[1].length),yi=dt.length===3&&dt[2]!==void 0?Math.max(Math.abs(xxe(dt[2])),1):1,wi=cPt;pt<yn&&(yi*=-1,wi=dPt);let qa=dt.some(lPt);xe=[];for(let yl=yn;wi(yl,pt);yl+=yi){let Sa;if(Oe)Sa=String.fromCharCode(yl),Sa==="\\"&&(Sa="");else if(Sa=String(yl),qa){let Lr=ut-Sa.length;if(Lr>0){let In=new Array(Lr+1).join("0");yl<0?Sa="-"+In+Sa.slice(1):Sa=In+Sa}}xe.push(Sa)}}else{xe=[];for(let yn=0;yn<dt.length;yn++)xe.push.apply(xe,x5(dt[yn],o,!1))}for(let yn=0;yn<xe.length;yn++)for(let pt=0;pt<j.length&&b.length<o;pt++){let ut=L+xe[yn]+j[pt];(!u||tt||ut)&&b.push(ut)}}return b}});var fUe=Om(IZ=>{"use strict";Object.defineProperty(IZ,"__esModule",{value:!0});IZ.assertValidPattern=void 0;var uPt=1024*64,pPt=h=>{if(typeof h!="string")throw new TypeError("invalid pattern");if(h.length>uPt)throw new TypeError("pattern is too long")};IZ.assertValidPattern=pPt});var _Ue=Om(CZ=>{"use strict";Object.defineProperty(CZ,"__esModule",{value:!0});CZ.parseClass=void 0;var fPt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},A5=h=>h.replace(/[[\]\\-]/g,"\\$&"),mPt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mUe=h=>h.join(""),_Pt=(h,o)=>{let u=o;if(h.charAt(u)!=="[")throw new Error("not in a brace expression");let b=[],x=[],L=u+1,j=!1,me=!1,Oe=!1,tt=!1,at=u,dt="";e:for(;L<h.length;){let ut=h.charAt(L);if((ut==="!"||ut==="^")&&L===u+1){tt=!0,L++;continue}if(ut==="]"&&j&&!Oe){at=L+1;break}if(j=!0,ut==="\\"&&!Oe){Oe=!0,L++;continue}if(ut==="["&&!Oe){for(let[yi,[wi,eo,qa]]of Object.entries(fPt))if(h.startsWith(yi,L)){if(dt)return["$.",!1,h.length-u,!0];L+=yi.length,qa?x.push(wi):b.push(wi),me=me||eo;continue e}}if(Oe=!1,dt){ut>dt?b.push(A5(dt)+"-"+A5(ut)):ut===dt&&b.push(A5(ut)),dt="",L++;continue}if(h.startsWith("-]",L+1)){b.push(A5(ut+"-")),L+=2;continue}if(h.startsWith("-",L+1)){dt=ut,L+=2;continue}b.push(A5(ut)),L++}if(at<L)return["",!1,0,!1];if(!b.length&&!x.length)return["$.",!1,h.length-u,!0];if(x.length===0&&b.length===1&&/^\\?.$/.test(b[0])&&!tt){let ut=b[0].length===2?b[0].slice(-1):b[0];return[mPt(ut),!1,at-u,!1]}let xe="["+(tt?"^":"")+mUe(b)+"]",yn="["+(tt?"":"^")+mUe(x)+"]";return[b.length&&x.length?"("+xe+"|"+yn+")":b.length?xe:yn,me,at-u,!0]};CZ.parseClass=_Pt});var NZ=Om(PZ=>{"use strict";Object.defineProperty(PZ,"__esModule",{value:!0});PZ.unescape=void 0;var hPt=(h,{windowsPathsNoEscape:o=!1,magicalBraces:u=!0}={})=>u?o?h.replace(/\[([^\/\\])\]/g,"$1"):h.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):o?h.replace(/\[([^\/\\{}])\]/g,"$1"):h.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");PZ.unescape=hPt});var Cxe=Om(kZ=>{"use strict";var Ib;Object.defineProperty(kZ,"__esModule",{value:!0});kZ.AST=void 0;var gPt=_Ue(),RZ=NZ(),yPt=new Set(["!","?","+","*","@"]),Dxe=h=>yPt.has(h),hUe=h=>Dxe(h.type),vPt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),bPt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),SPt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),gUe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),TPt="(?!(?:^|/)\\.\\.?(?:$|/))",MZ="(?!\\.)",EPt=new Set(["[","."]),xPt=new Set(["..","."]),APt=new Set("().*{}+?[]^$\\!"),DPt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ixe="[^/]",yUe=Ixe+"*?",vUe=Ixe+"+?",IPt=0,LZ=class{type;#e;#t;#n=!1;#r=[];#i;#o;#a;#s=!1;#c;#m;#_=!1;id=++IPt;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(o,u,b={}){this.type=o,o&&(this.#t=!0),this.#i=u,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?b:this.#e.#c,this.#a=this.#e===this?[]:this.#e.#a,o==="!"&&!this.#e.#s&&this.#a.push(this),this.#o=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let o of this.#r)if(typeof o!="string"&&(o.type||o.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#m!==void 0?this.#m:this.type?this.#m=this.type+"("+this.#r.map(o=>String(o)).join("|")+")":this.#m=this.#r.map(o=>String(o)).join("")}#E(){if(this!==this.#e)throw new Error("should only call on root");if(this.#s)return this;this.toString(),this.#s=!0;let o;for(;o=this.#a.pop();){if(o.type!=="!")continue;let u=o,b=u.#i;for(;b;){for(let x=u.#o+1;!b.type&&x<b.#r.length;x++)for(let L of o.#r){if(typeof L=="string")throw new Error("string part in extglob AST??");L.copyIn(b.#r[x])}u=b,b=u.#i}}return this}push(...o){for(let u of o)if(u!==""){if(typeof u!="string"&&!(u instanceof Ib&&u.#i===this))throw new Error("invalid part: "+u);this.#r.push(u)}}toJSON(){let o=this.type===null?this.#r.slice().map(u=>typeof u=="string"?u:u.toJSON()):[this.type,...this.#r.map(u=>u.toJSON())];return this.isStart()&&!this.type&&o.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type==="!")&&o.push({}),o}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#o===0)return!0;let o=this.#i;for(let u=0;u<this.#o;u++){let b=o.#r[u];if(!(b instanceof Ib&&b.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let o=this.#i?this.#i.#r.length:0;return this.#o===o-1}copyIn(o){typeof o=="string"?this.push(o):this.push(o.clone(this))}clone(o){let u=new Ib(this.type,o);for(let b of this.#r)u.copyIn(b);return u}static#S(o,u,b,x,L){let j=x.maxExtglobRecursion??2,me=!1,Oe=!1,tt=-1,at=!1;if(u.type===null){let ut=b,yi="";for(;ut<o.length;){let wi=o.charAt(ut++);if(me||wi==="\\"){me=!me,yi+=wi;continue}if(Oe){ut===tt+1?(wi==="^"||wi==="!")&&(at=!0):wi==="]"&&!(ut===tt+2&&at)&&(Oe=!1),yi+=wi;continue}else if(wi==="["){Oe=!0,tt=ut,at=!1,yi+=wi;continue}if(!x.noext&&Dxe(wi)&&o.charAt(ut)==="("&&L<=j){u.push(yi),yi="";let qa=new Ib(wi,u);ut=Ib.#S(o,qa,ut,x,L+1),u.push(qa);continue}yi+=wi}return u.push(yi),ut}let dt=b+1,xe=new Ib(null,u),yn=[],pt="";for(;dt<o.length;){let ut=o.charAt(dt++);if(me||ut==="\\"){me=!me,pt+=ut;continue}if(Oe){dt===tt+1?(ut==="^"||ut==="!")&&(at=!0):ut==="]"&&!(dt===tt+2&&at)&&(Oe=!1),pt+=ut;continue}else if(ut==="["){Oe=!0,tt=dt,at=!1,pt+=ut;continue}if(!x.noext&&Dxe(ut)&&o.charAt(dt)==="("&&(L<=j||u&&u.#u(ut))){let wi=u&&u.#u(ut)?0:1;xe.push(pt),pt="";let eo=new Ib(ut,xe);xe.push(eo),dt=Ib.#S(o,eo,dt,x,L+wi);continue}if(ut==="|"){xe.push(pt),pt="",yn.push(xe),xe=new Ib(null,u);continue}if(ut===")")return pt===""&&u.#r.length===0&&(u.#_=!0),xe.push(pt),pt="",u.push(...yn,xe),dt;pt+=ut}return u.type=null,u.#t=void 0,u.#r=[o.substring(b-1)],dt}#g(o){return this.#y(o,bPt)}#y(o,u=vPt){if(!o||typeof o!="object"||o.type!==null||o.#r.length!==1||this.type===null)return!1;let b=o.#r[0];return!b||typeof b!="object"||b.type===null?!1:this.#u(b.type,u)}#u(o,u=SPt){return!!u.get(this.type)?.includes(o)}#p(o,u){let b=o.#r[0],x=new Ib(null,b,this.options);x.#r.push(""),b.push(x),this.#h(o,u)}#h(o,u){let b=o.#r[0];this.#r.splice(u,1,...b.#r);for(let x of b.#r)typeof x=="object"&&(x.#i=this);this.#m=void 0}#T(o){return!!gUe.get(this.type)?.has(o)}#f(o){if(!o||typeof o!="object"||o.type!==null||o.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let u=o.#r[0];return!u||typeof u!="object"||u.type===null?!1:this.#T(u.type)}#v(o){let u=gUe.get(this.type),b=o.#r[0],x=u?.get(b.type);if(!x)return!1;this.#r=b.#r;for(let L of this.#r)typeof L=="object"&&(L.#i=this);this.type=x,this.#m=void 0,this.#_=!1}static fromGlob(o,u={}){let b=new Ib(null,void 0,u);return Ib.#S(o,b,0,u,0),b}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let o=this.toString(),[u,b,x,L]=this.toRegExpSource();if(!(x||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&o.toUpperCase()!==o.toLowerCase()))return b;let me=(this.#c.nocase?"i":"")+(L?"u":"");return Object.assign(new RegExp(`^${u}$`,me),{_src:u,_glob:o})}get options(){return this.#c}toRegExpSource(o){let u=o??!!this.#c.dot;if(this.#e===this&&(this.#l(),this.#E()),!hUe(this)){let Oe=this.isStart()&&this.isEnd()&&!this.#r.some(yn=>typeof yn!="string"),tt=this.#r.map(yn=>{let[pt,ut,yi,wi]=typeof yn=="string"?Ib.#x(yn,this.#t,Oe):yn.toRegExpSource(o);return this.#t=this.#t||yi,this.#n=this.#n||wi,pt}).join(""),at="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&xPt.has(this.#r[0]))){let pt=EPt,ut=u&&pt.has(tt.charAt(0))||tt.startsWith("\\.")&&pt.has(tt.charAt(2))||tt.startsWith("\\.\\.")&&pt.has(tt.charAt(4)),yi=!u&&!o&&pt.has(tt.charAt(0));at=ut?TPt:yi?MZ:""}let dt="";return this.isEnd()&&this.#e.#s&&this.#i?.type==="!"&&(dt="(?:$|\\/)"),[at+tt+dt,(0,RZ.unescape)(tt),this.#t=!!this.#t,this.#n]}let b=this.type==="*"||this.type==="+",x=this.type==="!"?"(?:(?!(?:":"(?:",L=this.#d(u);if(this.isStart()&&this.isEnd()&&!L&&this.type!=="!"){let Oe=this.toString(),tt=this;return tt.#r=[Oe],tt.type=null,tt.#t=void 0,[Oe,(0,RZ.unescape)(this.toString()),!1,!1]}let j=!b||o||u||!MZ?"":this.#d(!0);j===L&&(j=""),j&&(L=`(?:${L})(?:${j})*?`);let me="";if(this.type==="!"&&this.#_)me=(this.isStart()&&!u?MZ:"")+vUe;else{let Oe=this.type==="!"?"))"+(this.isStart()&&!u&&!o?MZ:"")+yUe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&j?")":this.type==="*"&&j?")?":`)${this.type}`;me=x+L+Oe}return[me,(0,RZ.unescape)(L),this.#t=!!this.#t,this.#n]}#l(){if(hUe(this)){let o=0,u=!1;do{u=!0;for(let b=0;b<this.#r.length;b++){let x=this.#r[b];typeof x=="object"&&(x.#l(),this.#y(x)?(u=!1,this.#h(x,b)):this.#g(x)?(u=!1,this.#p(x,b)):this.#f(x)&&(u=!1,this.#v(x)))}}while(!u&&++o<10)}else for(let o of this.#r)typeof o=="object"&&o.#l();this.#m=void 0}#d(o){return this.#r.map(u=>{if(typeof u=="string")throw new Error("string type in extglob ast??");let[b,x,L,j]=u.toRegExpSource(o);return this.#n=this.#n||j,b}).filter(u=>!(this.isStart()&&this.isEnd())||!!u).join("|")}static#x(o,u,b=!1){let x=!1,L="",j=!1,me=!1;for(let Oe=0;Oe<o.length;Oe++){let tt=o.charAt(Oe);if(x){x=!1,L+=(APt.has(tt)?"\\":"")+tt;continue}if(tt==="*"){if(me)continue;me=!0,L+=b&&/^[*]+$/.test(o)?vUe:yUe,u=!0;continue}else me=!1;if(tt==="\\"){Oe===o.length-1?L+="\\\\":x=!0;continue}if(tt==="["){let[at,dt,xe,yn]=(0,gPt.parseClass)(o,Oe);if(xe){L+=at,j=j||dt,Oe+=xe-1,u=u||yn;continue}}if(tt==="?"){L+=Ixe,u=!0;continue}L+=DPt(tt)}return[L,(0,RZ.unescape)(o),!!u,j]}};kZ.AST=LZ;Ib=LZ});var Pxe=Om(wZ=>{"use strict";Object.defineProperty(wZ,"__esModule",{value:!0});wZ.escape=void 0;var CPt=(h,{windowsPathsNoEscape:o=!1,magicalBraces:u=!1}={})=>u?o?h.replace(/[?*()[\]{}]/g,"[$&]"):h.replace(/[?*()[\]\\{}]/g,"\\$&"):o?h.replace(/[?*()[\]]/g,"[$&]"):h.replace(/[?*()[\]\\]/g,"\\$&");wZ.escape=CPt});var DUe=Om(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.unescape=ms.escape=ms.AST=ms.Minimatch=ms.match=ms.makeRe=ms.braceExpand=ms.defaults=ms.filter=ms.GLOBSTAR=ms.sep=ms.minimatch=void 0;var PPt=pUe(),OZ=fUe(),TUe=Cxe(),NPt=Pxe(),RPt=NZ(),MPt=(h,o,u={})=>((0,OZ.assertValidPattern)(o),!u.nocomment&&o.charAt(0)==="#"?!1:new qk(o,u).match(h));ms.minimatch=MPt;var LPt=/^\*+([^+@!?\*\[\(]*)$/,kPt=h=>o=>!o.startsWith(".")&&o.endsWith(h),wPt=h=>o=>o.endsWith(h),OPt=h=>(h=h.toLowerCase(),o=>!o.startsWith(".")&&o.toLowerCase().endsWith(h)),FPt=h=>(h=h.toLowerCase(),o=>o.toLowerCase().endsWith(h)),WPt=/^\*+\.\*+$/,BPt=h=>!h.startsWith(".")&&h.includes("."),zPt=h=>h!=="."&&h!==".."&&h.includes("."),GPt=/^\.\*+$/,VPt=h=>h!=="."&&h!==".."&&h.startsWith("."),jPt=/^\*+$/,UPt=h=>h.length!==0&&!h.startsWith("."),HPt=h=>h.length!==0&&h!=="."&&h!=="..",KPt=/^\?+([^+@!?\*\[\(]*)?$/,JPt=([h,o=""])=>{let u=EUe([h]);return o?(o=o.toLowerCase(),b=>u(b)&&b.toLowerCase().endsWith(o)):u},qPt=([h,o=""])=>{let u=xUe([h]);return o?(o=o.toLowerCase(),b=>u(b)&&b.toLowerCase().endsWith(o)):u},XPt=([h,o=""])=>{let u=xUe([h]);return o?b=>u(b)&&b.endsWith(o):u},$Pt=([h,o=""])=>{let u=EUe([h]);return o?b=>u(b)&&b.endsWith(o):u},EUe=([h])=>{let o=h.length;return u=>u.length===o&&!u.startsWith(".")},xUe=([h])=>{let o=h.length;return u=>u.length===o&&u!=="."&&u!==".."},AUe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",bUe={win32:{sep:"\\"},posix:{sep:"/"}};ms.sep=AUe==="win32"?bUe.win32.sep:bUe.posix.sep;ms.minimatch.sep=ms.sep;ms.GLOBSTAR=Symbol("globstar **");ms.minimatch.GLOBSTAR=ms.GLOBSTAR;var YPt="[^/]",QPt=YPt+"*?",ZPt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",eNt="(?:(?!(?:\\/|^)\\.).)*?",tNt=(h,o={})=>u=>(0,ms.minimatch)(u,h,o);ms.filter=tNt;ms.minimatch.filter=ms.filter;var UE=(h,o={})=>Object.assign({},h,o),nNt=h=>{if(!h||typeof h!="object"||!Object.keys(h).length)return ms.minimatch;let o=ms.minimatch;return Object.assign((b,x,L={})=>o(b,x,UE(h,L)),{Minimatch:class extends o.Minimatch{constructor(x,L={}){super(x,UE(h,L))}static defaults(x){return o.defaults(UE(h,x)).Minimatch}},AST:class extends o.AST{constructor(x,L,j={}){super(x,L,UE(h,j))}static fromGlob(x,L={}){return o.AST.fromGlob(x,UE(h,L))}},unescape:(b,x={})=>o.unescape(b,UE(h,x)),escape:(b,x={})=>o.escape(b,UE(h,x)),filter:(b,x={})=>o.filter(b,UE(h,x)),defaults:b=>o.defaults(UE(h,b)),makeRe:(b,x={})=>o.makeRe(b,UE(h,x)),braceExpand:(b,x={})=>o.braceExpand(b,UE(h,x)),match:(b,x,L={})=>o.match(b,x,UE(h,L)),sep:o.sep,GLOBSTAR:ms.GLOBSTAR})};ms.defaults=nNt;ms.minimatch.defaults=ms.defaults;var rNt=(h,o={})=>((0,OZ.assertValidPattern)(h),o.nobrace||!/\{(?:(?!\{).)*\}/.test(h)?[h]:(0,PPt.expand)(h,{max:o.braceExpandMax}));ms.braceExpand=rNt;ms.minimatch.braceExpand=ms.braceExpand;var iNt=(h,o={})=>new qk(h,o).makeRe();ms.makeRe=iNt;ms.minimatch.makeRe=ms.makeRe;var oNt=(h,o,u={})=>{let b=new qk(o,u);return h=h.filter(x=>b.match(x)),b.options.nonull&&!h.length&&h.push(o),h};ms.match=oNt;ms.minimatch.match=ms.match;var SUe=/[?*]|[+@!]\(.*?\)|\[|\]/,aNt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),qk=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(o,u={}){(0,OZ.assertValidPattern)(o),u=u||{},this.options=u,this.maxGlobstarRecursion=u.maxGlobstarRecursion??200,this.pattern=o,this.platform=u.platform||AUe,this.isWindows=this.platform==="win32";let b="allowWindowsEscape";this.windowsPathsNoEscape=!!u.windowsPathsNoEscape||u[b]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!u.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!u.nonegate,this.comment=!1,this.empty=!1,this.partial=!!u.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=u.windowsNoMagicRoot!==void 0?u.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let o of this.set)for(let u of o)if(typeof u!="string")return!0;return!1}debug(...o){}make(){let o=this.pattern,u=this.options;if(!u.nocomment&&o.charAt(0)==="#"){this.comment=!0;return}if(!o){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],u.debug&&(this.debug=(...L)=>console.error(...L)),this.debug(this.pattern,this.globSet);let b=this.globSet.map(L=>this.slashSplit(L));this.globParts=this.preprocess(b),this.debug(this.pattern,this.globParts);let x=this.globParts.map((L,j,me)=>{if(this.isWindows&&this.windowsNoMagicRoot){let Oe=L[0]===""&&L[1]===""&&(L[2]==="?"||!SUe.test(L[2]))&&!SUe.test(L[3]),tt=/^[a-z]:/i.test(L[0]);if(Oe)return[...L.slice(0,4),...L.slice(4).map(at=>this.parse(at))];if(tt)return[L[0],...L.slice(1).map(at=>this.parse(at))]}return L.map(Oe=>this.parse(Oe))});if(this.debug(this.pattern,x),this.set=x.filter(L=>L.indexOf(!1)===-1),this.isWindows)for(let L=0;L<this.set.length;L++){let j=this.set[L];j[0]===""&&j[1]===""&&this.globParts[L][2]==="?"&&typeof j[3]=="string"&&/^[a-z]:$/i.test(j[3])&&(j[2]="?")}this.debug(this.pattern,this.set)}preprocess(o){if(this.options.noglobstar)for(let b=0;b<o.length;b++)for(let x=0;x<o[b].length;x++)o[b][x]==="**"&&(o[b][x]="*");let{optimizationLevel:u=1}=this.options;return u>=2?(o=this.firstPhasePreProcess(o),o=this.secondPhasePreProcess(o)):u>=1?o=this.levelOneOptimize(o):o=this.adjascentGlobstarOptimize(o),o}adjascentGlobstarOptimize(o){return o.map(u=>{let b=-1;for(;(b=u.indexOf("**",b+1))!==-1;){let x=b;for(;u[x+1]==="**";)x++;x!==b&&u.splice(b,x-b)}return u})}levelOneOptimize(o){return o.map(u=>(u=u.reduce((b,x)=>{let L=b[b.length-1];return x==="**"&&L==="**"?b:x===".."&&L&&L!==".."&&L!=="."&&L!=="**"?(b.pop(),b):(b.push(x),b)},[]),u.length===0?[""]:u))}levelTwoFileOptimize(o){Array.isArray(o)||(o=this.slashSplit(o));let u=!1;do{if(u=!1,!this.preserveMultipleSlashes){for(let x=1;x<o.length-1;x++){let L=o[x];x===1&&L===""&&o[0]===""||(L==="."||L==="")&&(u=!0,o.splice(x,1),x--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(u=!0,o.pop())}let b=0;for(;(b=o.indexOf("..",b+1))!==-1;){let x=o[b-1];x&&x!=="."&&x!==".."&&x!=="**"&&(u=!0,o.splice(b-1,2),b-=2)}}while(u);return o.length===0?[""]:o}firstPhasePreProcess(o){let u=!1;do{u=!1;for(let b of o){let x=-1;for(;(x=b.indexOf("**",x+1))!==-1;){let j=x;for(;b[j+1]==="**";)j++;j>x&&b.splice(x+1,j-x);let me=b[x+1],Oe=b[x+2],tt=b[x+3];if(me!==".."||!Oe||Oe==="."||Oe===".."||!tt||tt==="."||tt==="..")continue;u=!0,b.splice(x,1);let at=b.slice(0);at[x]="**",o.push(at),x--}if(!this.preserveMultipleSlashes){for(let j=1;j<b.length-1;j++){let me=b[j];j===1&&me===""&&b[0]===""||(me==="."||me==="")&&(u=!0,b.splice(j,1),j--)}b[0]==="."&&b.length===2&&(b[1]==="."||b[1]==="")&&(u=!0,b.pop())}let L=0;for(;(L=b.indexOf("..",L+1))!==-1;){let j=b[L-1];if(j&&j!=="."&&j!==".."&&j!=="**"){u=!0;let Oe=L===1&&b[L+1]==="**"?["."]:[];b.splice(L-1,2,...Oe),b.length===0&&b.push(""),L-=2}}}}while(u);return o}secondPhasePreProcess(o){for(let u=0;u<o.length-1;u++)for(let b=u+1;b<o.length;b++){let x=this.partsMatch(o[u],o[b],!this.preserveMultipleSlashes);if(x){o[u]=[],o[b]=x;break}}return o.filter(u=>u.length)}partsMatch(o,u,b=!1){let x=0,L=0,j=[],me="";for(;x<o.length&&L<u.length;)if(o[x]===u[L])j.push(me==="b"?u[L]:o[x]),x++,L++;else if(b&&o[x]==="**"&&u[L]===o[x+1])j.push(o[x]),x++;else if(b&&u[L]==="**"&&o[x]===u[L+1])j.push(u[L]),L++;else if(o[x]==="*"&&u[L]&&(this.options.dot||!u[L].startsWith("."))&&u[L]!=="**"){if(me==="b")return!1;me="a",j.push(o[x]),x++,L++}else if(u[L]==="*"&&o[x]&&(this.options.dot||!o[x].startsWith("."))&&o[x]!=="**"){if(me==="a")return!1;me="b",j.push(u[L]),x++,L++}else return!1;return o.length===u.length&&j}parseNegate(){if(this.nonegate)return;let o=this.pattern,u=!1,b=0;for(let x=0;x<o.length&&o.charAt(x)==="!";x++)u=!u,b++;b&&(this.pattern=o.slice(b)),this.negate=u}matchOne(o,u,b=!1){let x=0,L=0;if(this.isWindows){let me=typeof o[0]=="string"&&/^[a-z]:$/i.test(o[0]),Oe=!me&&o[0]===""&&o[1]===""&&o[2]==="?"&&/^[a-z]:$/i.test(o[3]),tt=typeof u[0]=="string"&&/^[a-z]:$/i.test(u[0]),at=!tt&&u[0]===""&&u[1]===""&&u[2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3]),dt=Oe?3:me?0:void 0,xe=at?3:tt?0:void 0;if(typeof dt=="number"&&typeof xe=="number"){let[yn,pt]=[o[dt],u[xe]];yn.toLowerCase()===pt.toLowerCase()&&(u[xe]=yn,L=xe,x=dt)}}let{optimizationLevel:j=1}=this.options;return j>=2&&(o=this.levelTwoFileOptimize(o)),u.includes(ms.GLOBSTAR)?this.#e(o,u,b,x,L):this.#n(o,u,b,x,L)}#e(o,u,b,x,L){let j=u.indexOf(ms.GLOBSTAR,L),me=u.lastIndexOf(ms.GLOBSTAR),[Oe,tt,at]=b?[u.slice(L,j),u.slice(j+1),[]]:[u.slice(L,j),u.slice(j+1,me),u.slice(me+1)];if(Oe.length){let eo=o.slice(x,x+Oe.length);if(!this.#n(eo,Oe,b,0,0))return!1;x+=Oe.length,L+=Oe.length}let dt=0;if(at.length){if(at.length+x>o.length)return!1;let eo=o.length-at.length;if(this.#n(o,at,b,eo,0))dt=at.length;else{if(o[o.length-1]!==""||x+at.length===o.length||(eo--,!this.#n(o,at,b,eo,0)))return!1;dt=at.length+1}}if(!tt.length){let eo=!!dt;for(let qa=x;qa<o.length-dt;qa++){let yl=String(o[qa]);if(eo=!0,yl==="."||yl===".."||!this.options.dot&&yl.startsWith("."))return!1}return b||eo}let xe=[[[],0]],yn=xe[0],pt=0,ut=[0];for(let eo of tt)eo===ms.GLOBSTAR?(ut.push(pt),yn=[[],0],xe.push(yn)):(yn[0].push(eo),pt++);let yi=xe.length-1,wi=o.length-dt;for(let eo of xe)eo[1]=wi-(ut[yi--]+eo[0].length);return!!this.#t(o,xe,x,0,b,0,!!dt)}#t(o,u,b,x,L,j,me){let Oe=u[x];if(!Oe){for(let dt=b;dt<o.length;dt++){me=!0;let xe=o[dt];if(xe==="."||xe===".."||!this.options.dot&&xe.startsWith("."))return!1}return me}let[tt,at]=Oe;for(;b<=at;){if(this.#n(o.slice(0,b+tt.length),tt,L,b,0)&&j<this.maxGlobstarRecursion){let yn=this.#t(o,u,b+tt.length,x+1,L,j+1,me);if(yn!==!1)return yn}let xe=o[b];if(xe==="."||xe===".."||!this.options.dot&&xe.startsWith("."))return!1;b++}return L||null}#n(o,u,b,x,L){let j,me,Oe,tt;for(j=x,me=L,tt=o.length,Oe=u.length;j<tt&&me<Oe;j++,me++){this.debug("matchOne loop");let at=u[me],dt=o[j];if(this.debug(u,at,dt),at===!1||at===ms.GLOBSTAR)return!1;let xe;if(typeof at=="string"?(xe=dt===at,this.debug("string match",at,dt,xe)):(xe=at.test(dt),this.debug("pattern match",at,dt,xe)),!xe)return!1}if(j===tt&&me===Oe)return!0;if(j===tt)return b;if(me===Oe)return j===tt-1&&o[j]==="";throw new Error("wtf?")}braceExpand(){return(0,ms.braceExpand)(this.pattern,this.options)}parse(o){(0,OZ.assertValidPattern)(o);let u=this.options;if(o==="**")return ms.GLOBSTAR;if(o==="")return"";let b,x=null;(b=o.match(jPt))?x=u.dot?HPt:UPt:(b=o.match(LPt))?x=(u.nocase?u.dot?FPt:OPt:u.dot?wPt:kPt)(b[1]):(b=o.match(KPt))?x=(u.nocase?u.dot?qPt:JPt:u.dot?XPt:$Pt)(b):(b=o.match(WPt))?x=u.dot?zPt:BPt:(b=o.match(GPt))&&(x=VPt);let L=TUe.AST.fromGlob(o,this.options).toMMPattern();return x&&typeof L=="object"&&Reflect.defineProperty(L,"test",{value:x}),L}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let o=this.set;if(!o.length)return this.regexp=!1,this.regexp;let u=this.options,b=u.noglobstar?QPt:u.dot?ZPt:eNt,x=new Set(u.nocase?["i"]:[]),L=o.map(Oe=>{let tt=Oe.map(dt=>{if(dt instanceof RegExp)for(let xe of dt.flags.split(""))x.add(xe);return typeof dt=="string"?aNt(dt):dt===ms.GLOBSTAR?ms.GLOBSTAR:dt._src});tt.forEach((dt,xe)=>{let yn=tt[xe+1],pt=tt[xe-1];dt!==ms.GLOBSTAR||pt===ms.GLOBSTAR||(pt===void 0?yn!==void 0&&yn!==ms.GLOBSTAR?tt[xe+1]="(?:\\/|"+b+"\\/)?"+yn:tt[xe]=b:yn===void 0?tt[xe-1]=pt+"(?:\\/|\\/"+b+")?":yn!==ms.GLOBSTAR&&(tt[xe-1]=pt+"(?:\\/|\\/"+b+"\\/)"+yn,tt[xe+1]=ms.GLOBSTAR))});let at=tt.filter(dt=>dt!==ms.GLOBSTAR);if(this.partial&&at.length>=1){let dt=[];for(let xe=1;xe<=at.length;xe++)dt.push(at.slice(0,xe).join("/"));return"(?:"+dt.join("|")+")"}return at.join("/")}).join("|"),[j,me]=o.length>1?["(?:",")"]:["",""];L="^"+j+L+me+"$",this.partial&&(L="^(?:\\/|"+j+L.slice(1,-1)+me+")$"),this.negate&&(L="^(?!"+L+").+$");try{this.regexp=new RegExp(L,[...x].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(o){return this.preserveMultipleSlashes?o.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(o)?["",...o.split(/\/+/)]:o.split(/\/+/)}match(o,u=this.partial){if(this.debug("match",o,this.pattern),this.comment)return!1;if(this.empty)return o==="";if(o==="/"&&u)return!0;let b=this.options;this.isWindows&&(o=o.split("\\").join("/"));let x=this.slashSplit(o);this.debug(this.pattern,"split",x);let L=this.set;this.debug(this.pattern,"set",L);let j=x[x.length-1];if(!j)for(let me=x.length-2;!j&&me>=0;me--)j=x[me];for(let me=0;me<L.length;me++){let Oe=L[me],tt=x;if(b.matchBase&&Oe.length===1&&(tt=[j]),this.matchOne(tt,Oe,u))return b.flipNegate?!0:!this.negate}return b.flipNegate?!1:this.negate}static defaults(o){return ms.minimatch.defaults(o).Minimatch}};ms.Minimatch=qk;var sNt=Cxe();Object.defineProperty(ms,"AST",{enumerable:!0,get:function(){return sNt.AST}});var lNt=Pxe();Object.defineProperty(ms,"escape",{enumerable:!0,get:function(){return lNt.escape}});var cNt=NZ();Object.defineProperty(ms,"unescape",{enumerable:!0,get:function(){return cNt.unescape}});ms.minimatch.AST=TUe.AST;ms.minimatch.Minimatch=qk;ms.minimatch.escape=NPt.escape;ms.minimatch.unescape=RPt.unescape});var PUe=Om((oOt,CUe)=>{"use strict";function N1(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function IUe(h,o){for(var u="",b=0,x=-1,L=0,j,me=0;me<=h.length;++me){if(me<h.length)j=h.charCodeAt(me);else{if(j===47)break;j=47}if(j===47){if(!(x===me-1||L===1))if(x!==me-1&&L===2){if(u.length<2||b!==2||u.charCodeAt(u.length-1)!==46||u.charCodeAt(u.length-2)!==46){if(u.length>2){var Oe=u.lastIndexOf("/");if(Oe!==u.length-1){Oe===-1?(u="",b=0):(u=u.slice(0,Oe),b=u.length-1-u.lastIndexOf("/")),x=me,L=0;continue}}else if(u.length===2||u.length===1){u="",b=0,x=me,L=0;continue}}o&&(u.length>0?u+="/..":u="..",b=2)}else u.length>0?u+="/"+h.slice(x+1,me):u=h.slice(x+1,me),b=me-x-1;x=me,L=0}else j===46&&L!==-1?++L:L=-1}return u}function dNt(h,o){var u=o.dir||o.root,b=o.base||(o.name||"")+(o.ext||"");return u?u===o.root?u+b:u+h+b:b}var I8={resolve:function(){for(var o="",u=!1,b,x=arguments.length-1;x>=-1&&!u;x--){var L;x>=0?L=arguments[x]:(b===void 0&&(b=process.cwd()),L=b),N1(L),L.length!==0&&(o=L+"/"+o,u=L.charCodeAt(0)===47)}return o=IUe(o,!u),u?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(N1(o),o.length===0)return".";var u=o.charCodeAt(0)===47,b=o.charCodeAt(o.length-1)===47;return o=IUe(o,!u),o.length===0&&!u&&(o="."),o.length>0&&b&&(o+="/"),u?"/"+o:o},isAbsolute:function(o){return N1(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,u=0;u<arguments.length;++u){var b=arguments[u];N1(b),b.length>0&&(o===void 0?o=b:o+="/"+b)}return o===void 0?".":I8.normalize(o)},relative:function(o,u){if(N1(o),N1(u),o===u||(o=I8.resolve(o),u=I8.resolve(u),o===u))return"";for(var b=1;b<o.length&&o.charCodeAt(b)===47;++b);for(var x=o.length,L=x-b,j=1;j<u.length&&u.charCodeAt(j)===47;++j);for(var me=u.length,Oe=me-j,tt=L<Oe?L:Oe,at=-1,dt=0;dt<=tt;++dt){if(dt===tt){if(Oe>tt){if(u.charCodeAt(j+dt)===47)return u.slice(j+dt+1);if(dt===0)return u.slice(j+dt)}else L>tt&&(o.charCodeAt(b+dt)===47?at=dt:dt===0&&(at=0));break}var xe=o.charCodeAt(b+dt),yn=u.charCodeAt(j+dt);if(xe!==yn)break;xe===47&&(at=dt)}var pt="";for(dt=b+at+1;dt<=x;++dt)(dt===x||o.charCodeAt(dt)===47)&&(pt.length===0?pt+="..":pt+="/..");return pt.length>0?pt+u.slice(j+at):(j+=at,u.charCodeAt(j)===47&&++j,u.slice(j))},_makeLong:function(o){return o},dirname:function(o){if(N1(o),o.length===0)return".";for(var u=o.charCodeAt(0),b=u===47,x=-1,L=!0,j=o.length-1;j>=1;--j)if(u=o.charCodeAt(j),u===47){if(!L){x=j;break}}else L=!1;return x===-1?b?"/":".":b&&x===1?"//":o.slice(0,x)},basename:function(o,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');N1(o);var b=0,x=-1,L=!0,j;if(u!==void 0&&u.length>0&&u.length<=o.length){if(u.length===o.length&&u===o)return"";var me=u.length-1,Oe=-1;for(j=o.length-1;j>=0;--j){var tt=o.charCodeAt(j);if(tt===47){if(!L){b=j+1;break}}else Oe===-1&&(L=!1,Oe=j+1),me>=0&&(tt===u.charCodeAt(me)?--me===-1&&(x=j):(me=-1,x=Oe))}return b===x?x=Oe:x===-1&&(x=o.length),o.slice(b,x)}else{for(j=o.length-1;j>=0;--j)if(o.charCodeAt(j)===47){if(!L){b=j+1;break}}else x===-1&&(L=!1,x=j+1);return x===-1?"":o.slice(b,x)}},extname:function(o){N1(o);for(var u=-1,b=0,x=-1,L=!0,j=0,me=o.length-1;me>=0;--me){var Oe=o.charCodeAt(me);if(Oe===47){if(!L){b=me+1;break}continue}x===-1&&(L=!1,x=me+1),Oe===46?u===-1?u=me:j!==1&&(j=1):u!==-1&&(j=-1)}return u===-1||x===-1||j===0||j===1&&u===x-1&&u===b+1?"":o.slice(u,x)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return dNt("/",o)},parse:function(o){N1(o);var u={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return u;var b=o.charCodeAt(0),x=b===47,L;x?(u.root="/",L=1):L=0;for(var j=-1,me=0,Oe=-1,tt=!0,at=o.length-1,dt=0;at>=L;--at){if(b=o.charCodeAt(at),b===47){if(!tt){me=at+1;break}continue}Oe===-1&&(tt=!1,Oe=at+1),b===46?j===-1?j=at:dt!==1&&(dt=1):j!==-1&&(dt=-1)}return j===-1||Oe===-1||dt===0||dt===1&&j===Oe-1&&j===me+1?Oe!==-1&&(me===0&&x?u.base=u.name=o.slice(1,Oe):u.base=u.name=o.slice(me,Oe)):(me===0&&x?(u.name=o.slice(1,j),u.base=o.slice(1,Oe)):(u.name=o.slice(me,j),u.base=o.slice(me,Oe)),u.ext=o.slice(j,Oe)),me>0?u.dir=o.slice(0,me-1):x&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};I8.posix=I8;CUe.exports=I8});var D5=Om((aOt,kUe)=>{"use strict";var NUe="[^\\\\/]",uNt="(?=.)",RUe="[^/]",Nxe="(?:\\/|$)",MUe="(?:^|\\/)",Rxe=`\\.{1,2}${Nxe}`,pNt="(?!\\.)",fNt=`(?!${MUe}${Rxe})`,mNt=`(?!\\.{0,1}${Nxe})`,_Nt=`(?!${Rxe})`,hNt="[^.\\/]",gNt=`${RUe}*?`,yNt="/",LUe={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:uNt,QMARK:RUe,END_ANCHOR:Nxe,DOTS_SLASH:Rxe,NO_DOT:pNt,NO_DOTS:fNt,NO_DOT_SLASH:mNt,NO_DOTS_SLASH:_Nt,QMARK_NO_DOT:hNt,STAR:gNt,START_ANCHOR:MUe,SEP:yNt},vNt={...LUe,SLASH_LITERAL:"[\\\\/]",QMARK:NUe,STAR:`${NUe}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},bNt={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};kUe.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:bNt,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(h){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${h.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(h){return h===!0?vNt:LUe}}});var I5=Om(Cb=>{"use strict";var{REGEX_BACKSLASH:SNt,REGEX_REMOVE_BACKSLASH:TNt,REGEX_SPECIAL_CHARS:ENt,REGEX_SPECIAL_CHARS_GLOBAL:xNt}=D5();Cb.isObject=h=>h!==null&&typeof h=="object"&&!Array.isArray(h);Cb.hasRegexChars=h=>ENt.test(h);Cb.isRegexChar=h=>h.length===1&&Cb.hasRegexChars(h);Cb.escapeRegex=h=>h.replace(xNt,"\\$1");Cb.toPosixSlashes=h=>h.replace(SNt,"/");Cb.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let h=navigator.platform.toLowerCase();return h==="win32"||h==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Cb.removeBackslashes=h=>h.replace(TNt,o=>o==="\\"?"":o);Cb.escapeLast=(h,o,u)=>{let b=h.lastIndexOf(o,u);return b===-1?h:h[b-1]==="\\"?Cb.escapeLast(h,o,b-1):`${h.slice(0,b)}\\${h.slice(b)}`};Cb.removePrefix=(h,o={})=>{let u=h;return u.startsWith("./")&&(u=u.slice(2),o.prefix="./"),u};Cb.wrapOutput=(h,o={},u={})=>{let b=u.contains?"":"^",x=u.contains?"":"$",L=`${b}(?:${h})${x}`;return o.negated===!0&&(L=`(?:^(?!${L}).*$)`),L};Cb.basename=(h,{windows:o}={})=>{let u=h.split(o?/[\\/]/:"/"),b=u[u.length-1];return b===""?u[u.length-2]:b}});var VUe=Om((lOt,GUe)=>{"use strict";var wUe=I5(),{CHAR_ASTERISK:Mxe,CHAR_AT:ANt,CHAR_BACKWARD_SLASH:C5,CHAR_COMMA:DNt,CHAR_DOT:Lxe,CHAR_EXCLAMATION_MARK:kxe,CHAR_FORWARD_SLASH:zUe,CHAR_LEFT_CURLY_BRACE:wxe,CHAR_LEFT_PARENTHESES:Oxe,CHAR_LEFT_SQUARE_BRACKET:INt,CHAR_PLUS:CNt,CHAR_QUESTION_MARK:OUe,CHAR_RIGHT_CURLY_BRACE:PNt,CHAR_RIGHT_PARENTHESES:FUe,CHAR_RIGHT_SQUARE_BRACKET:NNt}=D5(),WUe=h=>h===zUe||h===C5,BUe=h=>{h.isPrefix!==!0&&(h.depth=h.isGlobstar?1/0:1)},RNt=(h,o)=>{let u=o||{},b=h.length-1,x=u.parts===!0||u.scanToEnd===!0,L=[],j=[],me=[],Oe=h,tt=-1,at=0,dt=0,xe=!1,yn=!1,pt=!1,ut=!1,yi=!1,wi=!1,eo=!1,qa=!1,yl=!1,Sa=!1,Lr=0,In,Ii,_i={value:"",depth:0,isGlob:!1},Fr=()=>tt>=b,bi=()=>Oe.charCodeAt(tt+1),ud=()=>(In=Ii,Oe.charCodeAt(++tt));for(;tt<b;){Ii=ud();let vn;if(Ii===C5){eo=_i.backslashes=!0,Ii=ud(),Ii===wxe&&(wi=!0);continue}if(wi===!0||Ii===wxe){for(Lr++;Fr()!==!0&&(Ii=ud());){if(Ii===C5){eo=_i.backslashes=!0,ud();continue}if(Ii===wxe){Lr++;continue}if(wi!==!0&&Ii===Lxe&&(Ii=ud())===Lxe){if(xe=_i.isBrace=!0,pt=_i.isGlob=!0,Sa=!0,x===!0)continue;break}if(wi!==!0&&Ii===DNt){if(xe=_i.isBrace=!0,pt=_i.isGlob=!0,Sa=!0,x===!0)continue;break}if(Ii===PNt&&(Lr--,Lr===0)){wi=!1,xe=_i.isBrace=!0,Sa=!0;break}}if(x===!0)continue;break}if(Ii===zUe){if(L.push(tt),j.push(_i),_i={value:"",depth:0,isGlob:!1},Sa===!0)continue;if(In===Lxe&&tt===at+1){at+=2;continue}dt=tt+1;continue}if(u.noext!==!0&&(Ii===CNt||Ii===ANt||Ii===Mxe||Ii===OUe||Ii===kxe)===!0&&bi()===Oxe){if(pt=_i.isGlob=!0,ut=_i.isExtglob=!0,Sa=!0,Ii===kxe&&tt===at&&(yl=!0),x===!0){for(;Fr()!==!0&&(Ii=ud());){if(Ii===C5){eo=_i.backslashes=!0,Ii=ud();continue}if(Ii===FUe){pt=_i.isGlob=!0,Sa=!0;break}}continue}break}if(Ii===Mxe){if(In===Mxe&&(yi=_i.isGlobstar=!0),pt=_i.isGlob=!0,Sa=!0,x===!0)continue;break}if(Ii===OUe){if(pt=_i.isGlob=!0,Sa=!0,x===!0)continue;break}if(Ii===INt){for(;Fr()!==!0&&(vn=ud());){if(vn===C5){eo=_i.backslashes=!0,ud();continue}if(vn===NNt){yn=_i.isBracket=!0,pt=_i.isGlob=!0,Sa=!0;break}}if(x===!0)continue;break}if(u.nonegate!==!0&&Ii===kxe&&tt===at){qa=_i.negated=!0,at++;continue}if(u.noparen!==!0&&Ii===Oxe){if(pt=_i.isGlob=!0,x===!0){for(;Fr()!==!0&&(Ii=ud());){if(Ii===Oxe){eo=_i.backslashes=!0,Ii=ud();continue}if(Ii===FUe){Sa=!0;break}}continue}break}if(pt===!0){if(Sa=!0,x===!0)continue;break}}u.noext===!0&&(ut=!1,pt=!1);let Pc=Oe,fn="",Ai="";at>0&&(fn=Oe.slice(0,at),Oe=Oe.slice(at),dt-=at),Pc&&pt===!0&&dt>0?(Pc=Oe.slice(0,dt),Ai=Oe.slice(dt)):pt===!0?(Pc="",Ai=Oe):Pc=Oe,Pc&&Pc!==""&&Pc!=="/"&&Pc!==Oe&&WUe(Pc.charCodeAt(Pc.length-1))&&(Pc=Pc.slice(0,-1)),u.unescape===!0&&(Ai&&(Ai=wUe.removeBackslashes(Ai)),Pc&&eo===!0&&(Pc=wUe.removeBackslashes(Pc)));let Kc={prefix:fn,input:h,start:at,base:Pc,glob:Ai,isBrace:xe,isBracket:yn,isGlob:pt,isExtglob:ut,isGlobstar:yi,negated:qa,negatedExtglob:yl};if(u.tokens===!0&&(Kc.maxDepth=0,WUe(Ii)||j.push(_i),Kc.tokens=j),u.parts===!0||u.tokens===!0){let vn;for(let gd=0;gd<L.length;gd++){let Ys=vn?vn+1:at,Jc=L[gd],aa=h.slice(Ys,Jc);u.tokens&&(gd===0&&at!==0?(j[gd].isPrefix=!0,j[gd].value=fn):j[gd].value=aa,BUe(j[gd]),Kc.maxDepth+=j[gd].depth),(gd!==0||aa!=="")&&me.push(aa),vn=Jc}if(vn&&vn+1<h.length){let gd=h.slice(vn+1);me.push(gd),u.tokens&&(j[j.length-1].value=gd,BUe(j[j.length-1]),Kc.maxDepth+=j[j.length-1].depth)}Kc.slashes=L,Kc.parts=me}return Kc};GUe.exports=RNt});var JUe=Om((cOt,KUe)=>{"use strict";var P5=D5(),oT=I5(),{MAX_LENGTH:FZ,POSIX_REGEX_SOURCE:MNt,REGEX_NON_SPECIAL_CHARS:LNt,REGEX_SPECIAL_CHARS_BACKREF:kNt,REPLACEMENTS:jUe}=P5,wNt=(h,o)=>{if(typeof o.expandRange=="function")return o.expandRange(...h,o);h.sort();let u=`[${h.join("-")}]`;try{new RegExp(u)}catch{return h.map(x=>oT.escapeRegex(x)).join("..")}return u},C8=(h,o)=>`Missing ${h}: "${o}" - use "\\\\${o}" to match literal characters`,UUe=h=>{let o=[],u=0,b=0,x=0,L="",j=!1;for(let me of h){if(j===!0){L+=me,j=!1;continue}if(me==="\\"){L+=me,j=!0;continue}if(me==='"'){x=x===1?0:1,L+=me;continue}if(x===0){if(me==="[")u++;else if(me==="]"&&u>0)u--;else if(u===0){if(me==="(")b++;else if(me===")"&&b>0)b--;else if(me==="|"&&b===0){o.push(L),L="";continue}}}L+=me}return o.push(L),o},ONt=h=>{let o=!1;for(let u of h){if(o===!0){o=!1;continue}if(u==="\\"){o=!0;continue}if(/[?*+@!()[\]{}]/.test(u))return!1}return!0},HUe=h=>{let o=h.trim(),u=!0;for(;u===!0;)u=!1,/^@\([^\\()[\]{}|]+\)$/.test(o)&&(o=o.slice(2,-1),u=!0);if(ONt(o))return o.replace(/\\(.)/g,"$1")},FNt=h=>{let o=h.map(HUe).filter(Boolean);for(let u=0;u<o.length;u++)for(let b=u+1;b<o.length;b++){let x=o[u],L=o[b],j=x[0];if(!(!j||x!==j.repeat(x.length)||L!==j.repeat(L.length))&&(x===L||x.startsWith(L)||L.startsWith(x)))return!0}return!1},Fxe=(h,o=!0)=>{if(h[0]!=="+"&&h[0]!=="*"||h[1]!=="(")return;let u=0,b=0,x=0,L=!1;for(let j=1;j<h.length;j++){let me=h[j];if(L===!0){L=!1;continue}if(me==="\\"){L=!0;continue}if(me==='"'){x=x===1?0:1;continue}if(x!==1){if(me==="["){u++;continue}if(me==="]"&&u>0){u--;continue}if(!(u>0)){if(me==="("){b++;continue}if(me===")"&&(b--,b===0))return o===!0&&j!==h.length-1?void 0:{type:h[0],body:h.slice(2,j),end:j}}}}},WNt=h=>{let o=0,u=[];for(;o<h.length;){let x=Fxe(h.slice(o),!1);if(!x||x.type!=="*")return;let L=UUe(x.body).map(me=>me.trim());if(L.length!==1)return;let j=HUe(L[0]);if(!j||j.length!==1)return;u.push(j),o+=x.end+1}return u.length<1?void 0:`${u.length===1?oT.escapeRegex(u[0]):`[${u.map(x=>oT.escapeRegex(x)).join("")}]`}*`},BNt=h=>{let o=0,u=h.trim(),b=Fxe(u);for(;b;)o++,u=b.body.trim(),b=Fxe(u);return o},zNt=(h,o)=>{if(o.maxExtglobRecursion===!1)return{risky:!1};let u=typeof o.maxExtglobRecursion=="number"?o.maxExtglobRecursion:P5.DEFAULT_MAX_EXTGLOB_RECURSION,b=UUe(h).map(x=>x.trim());if(b.length>1&&(b.some(x=>x==="")||b.some(x=>/^[*?]+$/.test(x))||FNt(b)))return{risky:!0};for(let x of b){let L=WNt(x);if(L)return{risky:!0,safeOutput:L};if(BNt(x)>u)return{risky:!0}}return{risky:!1}},Wxe=(h,o)=>{if(typeof h!="string")throw new TypeError("Expected a string");h=jUe[h]||h;let u={...o},b=typeof u.maxLength=="number"?Math.min(FZ,u.maxLength):FZ,x=h.length;if(x>b)throw new SyntaxError(`Input length: ${x}, exceeds maximum allowed length: ${b}`);let L={type:"bos",value:"",output:u.prepend||""},j=[L],me=u.capture?"":"?:",Oe=P5.globChars(u.windows),tt=P5.extglobChars(Oe),{DOT_LITERAL:at,PLUS_LITERAL:dt,SLASH_LITERAL:xe,ONE_CHAR:yn,DOTS_SLASH:pt,NO_DOT:ut,NO_DOT_SLASH:yi,NO_DOTS_SLASH:wi,QMARK:eo,QMARK_NO_DOT:qa,STAR:yl,START_ANCHOR:Sa}=Oe,Lr=Uo=>`(${me}(?:(?!${Sa}${Uo.dot?pt:at}).)*?)`,In=u.dot?"":ut,Ii=u.dot?eo:qa,_i=u.bash===!0?Lr(u):yl;u.capture&&(_i=`(${_i})`),typeof u.noext=="boolean"&&(u.noextglob=u.noext);let Fr={input:h,index:-1,start:0,dot:u.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:j};h=oT.removePrefix(h,Fr),x=h.length;let bi=[],ud=[],Pc=[],fn=L,Ai,Kc=()=>Fr.index===x-1,vn=Fr.peek=(Uo=1)=>h[Fr.index+Uo],gd=Fr.advance=()=>h[++Fr.index]||"",Ys=()=>h.slice(Fr.index+1),Jc=(Uo="",ac=0)=>{Fr.consumed+=Uo,Fr.index+=ac},aa=Uo=>{Fr.output+=Uo.output!=null?Uo.output:Uo.value,Jc(Uo.value)},dT=()=>{let Uo=1;for(;vn()==="!"&&(vn(2)!=="("||vn(3)==="?");)gd(),Fr.start++,Uo++;return Uo%2===0?!1:(Fr.negated=!0,Fr.start++,!0)},uT=Uo=>{Fr[Uo]++,Pc.push(Uo)},Iy=Uo=>{Fr[Uo]--,Pc.pop()},Ll=Uo=>{if(fn.type==="globstar"){let ac=Fr.braces>0&&(Uo.type==="comma"||Uo.type==="brace"),Ko=Uo.extglob===!0||bi.length&&(Uo.type==="pipe"||Uo.type==="paren");Uo.type!=="slash"&&Uo.type!=="paren"&&!ac&&!Ko&&(Fr.output=Fr.output.slice(0,-fn.output.length),fn.type="star",fn.value="*",fn.output=_i,Fr.output+=fn.output)}if(bi.length&&Uo.type!=="paren"&&(bi[bi.length-1].inner+=Uo.value),(Uo.value||Uo.output)&&aa(Uo),fn&&fn.type==="text"&&Uo.type==="text"){fn.output=(fn.output||fn.value)+Uo.value,fn.value+=Uo.value;return}Uo.prev=fn,j.push(Uo),fn=Uo},Gi=(Uo,ac)=>{let Ko={...tt[ac],conditions:1,inner:""};Ko.prev=fn,Ko.parens=Fr.parens,Ko.output=Fr.output,Ko.startIndex=Fr.index,Ko.tokensIndex=j.length;let kl=(u.capture?"(":"")+Ko.open;uT("parens"),Ll({type:Uo,value:ac,output:Fr.output?"":yn}),Ll({type:"paren",extglob:!0,value:gd(),output:kl}),bi.push(Ko)},mh=Uo=>{let ac=h.slice(Uo.startIndex,Fr.index+1),Ko=h.slice(Uo.startIndex+2,Fr.index),kl=zNt(Ko,u);if((Uo.type==="plus"||Uo.type==="star")&&kl.risky){let yd=kl.safeOutput?(Uo.output?"":yn)+(u.capture?`(${kl.safeOutput})`:kl.safeOutput):void 0,Wi=j[Uo.tokensIndex];Wi.type="text",Wi.value=ac,Wi.output=yd||oT.escapeRegex(ac);for(let Mb=Uo.tokensIndex+1;Mb<j.length;Mb++)j[Mb].value="",j[Mb].output="",delete j[Mb].suffix;Fr.output=Uo.output+Wi.output,Fr.backtrack=!0,Ll({type:"paren",extglob:!0,value:Ai,output:""}),Iy("parens");return}let jd=Uo.close+(u.capture?")":""),gt;if(Uo.type==="negate"){let yd=_i;if(Uo.inner&&Uo.inner.length>1&&Uo.inner.includes("/")&&(yd=Lr(u)),(yd!==_i||Kc()||/^\)+$/.test(Ys()))&&(jd=Uo.close=`)$))${yd}`),Uo.inner.includes("*")&&(gt=Ys())&&/^\.[^\\/.]+$/.test(gt)){let Wi=Wxe(gt,{...o,fastpaths:!1}).output;jd=Uo.close=`)${Wi})${yd})`}Uo.prev.type==="bos"&&(Fr.negatedExtglob=!0)}Ll({type:"paren",extglob:!0,value:Ai,output:jd}),Iy("parens")};if(u.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(h)){let Uo=!1,ac=h.replace(kNt,(Ko,kl,jd,gt,yd,Wi)=>gt==="\\"?(Uo=!0,Ko):gt==="?"?kl?kl+gt+(yd?eo.repeat(yd.length):""):Wi===0?Ii+(yd?eo.repeat(yd.length):""):eo.repeat(jd.length):gt==="."?at.repeat(jd.length):gt==="*"?kl?kl+gt+(yd?_i:""):_i:kl?Ko:`\\${Ko}`);return Uo===!0&&(u.unescape===!0?ac=ac.replace(/\\/g,""):ac=ac.replace(/\\+/g,Ko=>Ko.length%2===0?"\\\\":Ko?"\\":"")),ac===h&&u.contains===!0?(Fr.output=h,Fr):(Fr.output=oT.wrapOutput(ac,Fr,o),Fr)}for(;!Kc();){if(Ai=gd(),Ai==="\0")continue;if(Ai==="\\"){let Ko=vn();if(Ko==="/"&&u.bash!==!0||Ko==="."||Ko===";")continue;if(!Ko){Ai+="\\",Ll({type:"text",value:Ai});continue}let kl=/^\\+/.exec(Ys()),jd=0;if(kl&&kl[0].length>2&&(jd=kl[0].length,Fr.index+=jd,jd%2!==0&&(Ai+="\\")),u.unescape===!0?Ai=gd():Ai+=gd(),Fr.brackets===0){Ll({type:"text",value:Ai});continue}}if(Fr.brackets>0&&(Ai!=="]"||fn.value==="["||fn.value==="[^")){if(u.posix!==!1&&Ai===":"){let Ko=fn.value.slice(1);if(Ko.includes("[")&&(fn.posix=!0,Ko.includes(":"))){let kl=fn.value.lastIndexOf("["),jd=fn.value.slice(0,kl),gt=fn.value.slice(kl+2),yd=MNt[gt];if(yd){fn.value=jd+yd,Fr.backtrack=!0,gd(),!L.output&&j.indexOf(fn)===1&&(L.output=yn);continue}}}(Ai==="["&&vn()!==":"||Ai==="-"&&vn()==="]")&&(Ai=`\\${Ai}`),Ai==="]"&&(fn.value==="["||fn.value==="[^")&&(Ai=`\\${Ai}`),u.posix===!0&&Ai==="!"&&fn.value==="["&&(Ai="^"),fn.value+=Ai,aa({value:Ai});continue}if(Fr.quotes===1&&Ai!=='"'){Ai=oT.escapeRegex(Ai),fn.value+=Ai,aa({value:Ai});continue}if(Ai==='"'){Fr.quotes=Fr.quotes===1?0:1,u.keepQuotes===!0&&Ll({type:"text",value:Ai});continue}if(Ai==="("){uT("parens"),Ll({type:"paren",value:Ai});continue}if(Ai===")"){if(Fr.parens===0&&u.strictBrackets===!0)throw new SyntaxError(C8("opening","("));let Ko=bi[bi.length-1];if(Ko&&Fr.parens===Ko.parens+1){mh(bi.pop());continue}Ll({type:"paren",value:Ai,output:Fr.parens?")":"\\)"}),Iy("parens");continue}if(Ai==="["){if(u.nobracket===!0||!Ys().includes("]")){if(u.nobracket!==!0&&u.strictBrackets===!0)throw new SyntaxError(C8("closing","]"));Ai=`\\${Ai}`}else uT("brackets");Ll({type:"bracket",value:Ai});continue}if(Ai==="]"){if(u.nobracket===!0||fn&&fn.type==="bracket"&&fn.value.length===1){Ll({type:"text",value:Ai,output:`\\${Ai}`});continue}if(Fr.brackets===0){if(u.strictBrackets===!0)throw new SyntaxError(C8("opening","["));Ll({type:"text",value:Ai,output:`\\${Ai}`});continue}Iy("brackets");let Ko=fn.value.slice(1);if(fn.posix!==!0&&Ko[0]==="^"&&!Ko.includes("/")&&(Ai=`/${Ai}`),fn.value+=Ai,aa({value:Ai}),u.literalBrackets===!1||oT.hasRegexChars(Ko))continue;let kl=oT.escapeRegex(fn.value);if(Fr.output=Fr.output.slice(0,-fn.value.length),u.literalBrackets===!0){Fr.output+=kl,fn.value=kl;continue}fn.value=`(${me}${kl}|${fn.value})`,Fr.output+=fn.value;continue}if(Ai==="{"&&u.nobrace!==!0){uT("braces");let Ko={type:"brace",value:Ai,output:"(",outputIndex:Fr.output.length,tokensIndex:Fr.tokens.length};ud.push(Ko),Ll(Ko);continue}if(Ai==="}"){let Ko=ud[ud.length-1];if(u.nobrace===!0||!Ko){Ll({type:"text",value:Ai,output:Ai});continue}let kl=")";if(Ko.dots===!0){let jd=j.slice(),gt=[];for(let yd=jd.length-1;yd>=0&&(j.pop(),jd[yd].type!=="brace");yd--)jd[yd].type!=="dots"&&gt.unshift(jd[yd].value);kl=wNt(gt,u),Fr.backtrack=!0}if(Ko.comma!==!0&&Ko.dots!==!0){let jd=Fr.output.slice(0,Ko.outputIndex),gt=Fr.tokens.slice(Ko.tokensIndex);Ko.value=Ko.output="\\{",Ai=kl="\\}",Fr.output=jd;for(let yd of gt)Fr.output+=yd.output||yd.value}Ll({type:"brace",value:Ai,output:kl}),Iy("braces"),ud.pop();continue}if(Ai==="|"){bi.length>0&&bi[bi.length-1].conditions++,Ll({type:"text",value:Ai});continue}if(Ai===","){let Ko=Ai,kl=ud[ud.length-1];kl&&Pc[Pc.length-1]==="braces"&&(kl.comma=!0,Ko="|"),Ll({type:"comma",value:Ai,output:Ko});continue}if(Ai==="/"){if(fn.type==="dot"&&Fr.index===Fr.start+1){Fr.start=Fr.index+1,Fr.consumed="",Fr.output="",j.pop(),fn=L;continue}Ll({type:"slash",value:Ai,output:xe});continue}if(Ai==="."){if(Fr.braces>0&&fn.type==="dot"){fn.value==="."&&(fn.output=at);let Ko=ud[ud.length-1];fn.type="dots",fn.output+=Ai,fn.value+=Ai,Ko.dots=!0;continue}if(Fr.braces+Fr.parens===0&&fn.type!=="bos"&&fn.type!=="slash"){Ll({type:"text",value:Ai,output:at});continue}Ll({type:"dot",value:Ai,output:at});continue}if(Ai==="?"){if(!(fn&&fn.value==="(")&&u.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){Gi("qmark",Ai);continue}if(fn&&fn.type==="paren"){let kl=vn(),jd=Ai;(fn.value==="("&&!/[!=<:]/.test(kl)||kl==="<"&&!/<([!=]|\w+>)/.test(Ys()))&&(jd=`\\${Ai}`),Ll({type:"text",value:Ai,output:jd});continue}if(u.dot!==!0&&(fn.type==="slash"||fn.type==="bos")){Ll({type:"qmark",value:Ai,output:qa});continue}Ll({type:"qmark",value:Ai,output:eo});continue}if(Ai==="!"){if(u.noextglob!==!0&&vn()==="("&&(vn(2)!=="?"||!/[!=<:]/.test(vn(3)))){Gi("negate",Ai);continue}if(u.nonegate!==!0&&Fr.index===0){dT();continue}}if(Ai==="+"){if(u.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){Gi("plus",Ai);continue}if(fn&&fn.value==="("||u.regex===!1){Ll({type:"plus",value:Ai,output:dt});continue}if(fn&&(fn.type==="bracket"||fn.type==="paren"||fn.type==="brace")||Fr.parens>0){Ll({type:"plus",value:Ai});continue}Ll({type:"plus",value:dt});continue}if(Ai==="@"){if(u.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){Ll({type:"at",extglob:!0,value:Ai,output:""});continue}Ll({type:"text",value:Ai});continue}if(Ai!=="*"){(Ai==="$"||Ai==="^")&&(Ai=`\\${Ai}`);let Ko=LNt.exec(Ys());Ko&&(Ai+=Ko[0],Fr.index+=Ko[0].length),Ll({type:"text",value:Ai});continue}if(fn&&(fn.type==="globstar"||fn.star===!0)){fn.type="star",fn.star=!0,fn.value+=Ai,fn.output=_i,Fr.backtrack=!0,Fr.globstar=!0,Jc(Ai);continue}let Uo=Ys();if(u.noextglob!==!0&&/^\([^?]/.test(Uo)){Gi("star",Ai);continue}if(fn.type==="star"){if(u.noglobstar===!0){Jc(Ai);continue}let Ko=fn.prev,kl=Ko.prev,jd=Ko.type==="slash"||Ko.type==="bos",gt=kl&&(kl.type==="star"||kl.type==="globstar");if(u.bash===!0&&(!jd||Uo[0]&&Uo[0]!=="/")){Ll({type:"star",value:Ai,output:""});continue}let yd=Fr.braces>0&&(Ko.type==="comma"||Ko.type==="brace"),Wi=bi.length&&(Ko.type==="pipe"||Ko.type==="paren");if(!jd&&Ko.type!=="paren"&&!yd&&!Wi){Ll({type:"star",value:Ai,output:""});continue}for(;Uo.slice(0,3)==="/**";){let Mb=h[Fr.index+4];if(Mb&&Mb!=="/")break;Uo=Uo.slice(3),Jc("/**",3)}if(Ko.type==="bos"&&Kc()){fn.type="globstar",fn.value+=Ai,fn.output=Lr(u),Fr.output=fn.output,Fr.globstar=!0,Jc(Ai);continue}if(Ko.type==="slash"&&Ko.prev.type!=="bos"&&!gt&&Kc()){Fr.output=Fr.output.slice(0,-(Ko.output+fn.output).length),Ko.output=`(?:${Ko.output}`,fn.type="globstar",fn.output=Lr(u)+(u.strictSlashes?")":"|$)"),fn.value+=Ai,Fr.globstar=!0,Fr.output+=Ko.output+fn.output,Jc(Ai);continue}if(Ko.type==="slash"&&Ko.prev.type!=="bos"&&Uo[0]==="/"){let Mb=Uo[1]!==void 0?"|$":"";Fr.output=Fr.output.slice(0,-(Ko.output+fn.output).length),Ko.output=`(?:${Ko.output}`,fn.type="globstar",fn.output=`${Lr(u)}${xe}|${xe}${Mb})`,fn.value+=Ai,Fr.output+=Ko.output+fn.output,Fr.globstar=!0,Jc(Ai+gd()),Ll({type:"slash",value:"/",output:""});continue}if(Ko.type==="bos"&&Uo[0]==="/"){fn.type="globstar",fn.value+=Ai,fn.output=`(?:^|${xe}|${Lr(u)}${xe})`,Fr.output=fn.output,Fr.globstar=!0,Jc(Ai+gd()),Ll({type:"slash",value:"/",output:""});continue}Fr.output=Fr.output.slice(0,-fn.output.length),fn.type="globstar",fn.output=Lr(u),fn.value+=Ai,Fr.output+=fn.output,Fr.globstar=!0,Jc(Ai);continue}let ac={type:"star",value:Ai,output:_i};if(u.bash===!0){ac.output=".*?",(fn.type==="bos"||fn.type==="slash")&&(ac.output=In+ac.output),Ll(ac);continue}if(fn&&(fn.type==="bracket"||fn.type==="paren")&&u.regex===!0){ac.output=Ai,Ll(ac);continue}(Fr.index===Fr.start||fn.type==="slash"||fn.type==="dot")&&(fn.type==="dot"?(Fr.output+=yi,fn.output+=yi):u.dot===!0?(Fr.output+=wi,fn.output+=wi):(Fr.output+=In,fn.output+=In),vn()!=="*"&&(Fr.output+=yn,fn.output+=yn)),Ll(ac)}for(;Fr.brackets>0;){if(u.strictBrackets===!0)throw new SyntaxError(C8("closing","]"));Fr.output=oT.escapeLast(Fr.output,"["),Iy("brackets")}for(;Fr.parens>0;){if(u.strictBrackets===!0)throw new SyntaxError(C8("closing",")"));Fr.output=oT.escapeLast(Fr.output,"("),Iy("parens")}for(;Fr.braces>0;){if(u.strictBrackets===!0)throw new SyntaxError(C8("closing","}"));Fr.output=oT.escapeLast(Fr.output,"{"),Iy("braces")}if(u.strictSlashes!==!0&&(fn.type==="star"||fn.type==="bracket")&&Ll({type:"maybe_slash",value:"",output:`${xe}?`}),Fr.backtrack===!0){Fr.output="";for(let Uo of Fr.tokens)Fr.output+=Uo.output!=null?Uo.output:Uo.value,Uo.suffix&&(Fr.output+=Uo.suffix)}return Fr};Wxe.fastpaths=(h,o)=>{let u={...o},b=typeof u.maxLength=="number"?Math.min(FZ,u.maxLength):FZ,x=h.length;if(x>b)throw new SyntaxError(`Input length: ${x}, exceeds maximum allowed length: ${b}`);h=jUe[h]||h;let{DOT_LITERAL:L,SLASH_LITERAL:j,ONE_CHAR:me,DOTS_SLASH:Oe,NO_DOT:tt,NO_DOTS:at,NO_DOTS_SLASH:dt,STAR:xe,START_ANCHOR:yn}=P5.globChars(u.windows),pt=u.dot?at:tt,ut=u.dot?dt:tt,yi=u.capture?"":"?:",wi={negated:!1,prefix:""},eo=u.bash===!0?".*?":xe;u.capture&&(eo=`(${eo})`);let qa=In=>In.noglobstar===!0?eo:`(${yi}(?:(?!${yn}${In.dot?Oe:L}).)*?)`,yl=In=>{switch(In){case"*":return`${pt}${me}${eo}`;case".*":return`${L}${me}${eo}`;case"*.*":return`${pt}${eo}${L}${me}${eo}`;case"*/*":return`${pt}${eo}${j}${me}${ut}${eo}`;case"**":return pt+qa(u);case"**/*":return`(?:${pt}${qa(u)}${j})?${ut}${me}${eo}`;case"**/*.*":return`(?:${pt}${qa(u)}${j})?${ut}${eo}${L}${me}${eo}`;case"**/.*":return`(?:${pt}${qa(u)}${j})?${L}${me}${eo}`;default:{let Ii=/^(.*?)\.(\w+)$/.exec(In);if(!Ii)return;let _i=yl(Ii[1]);return _i?_i+L+Ii[2]:void 0}}},Sa=oT.removePrefix(h,wi),Lr=yl(Sa);return Lr&&u.strictSlashes!==!0&&(Lr+=`${j}?`),Lr};KUe.exports=Wxe});var $Ue=Om((dOt,XUe)=>{"use strict";var GNt=VUe(),Bxe=JUe(),qUe=I5(),VNt=D5(),jNt=h=>h&&typeof h=="object"&&!Array.isArray(h),c_=(h,o,u=!1)=>{if(Array.isArray(h)){let at=h.map(xe=>c_(xe,o,u));return xe=>{for(let yn of at){let pt=yn(xe);if(pt)return pt}return!1}}let b=jNt(h)&&h.tokens&&h.input;if(h===""||typeof h!="string"&&!b)throw new TypeError("Expected pattern to be a non-empty string");let x=o||{},L=x.windows,j=b?c_.compileRe(h,o):c_.makeRe(h,o,!1,!0),me=j.state;delete j.state;let Oe=()=>!1;if(x.ignore){let at={...o,ignore:null,onMatch:null,onResult:null};Oe=c_(x.ignore,at,u)}let tt=(at,dt=!1)=>{let{isMatch:xe,match:yn,output:pt}=c_.test(at,j,o,{glob:h,posix:L}),ut={glob:h,state:me,regex:j,posix:L,input:at,output:pt,match:yn,isMatch:xe};return typeof x.onResult=="function"&&x.onResult(ut),xe===!1?(ut.isMatch=!1,dt?ut:!1):Oe(at)?(typeof x.onIgnore=="function"&&x.onIgnore(ut),ut.isMatch=!1,dt?ut:!1):(typeof x.onMatch=="function"&&x.onMatch(ut),dt?ut:!0)};return u&&(tt.state=me),tt};c_.test=(h,o,u,{glob:b,posix:x}={})=>{if(typeof h!="string")throw new TypeError("Expected input to be a string");if(h==="")return{isMatch:!1,output:""};let L=u||{},j=L.format||(x?qUe.toPosixSlashes:null),me=h===b,Oe=me&&j?j(h):h;return me===!1&&(Oe=j?j(h):h,me=Oe===b),(me===!1||L.capture===!0)&&(L.matchBase===!0||L.basename===!0?me=c_.matchBase(h,o,u,x):me=o.exec(Oe)),{isMatch:!!me,match:me,output:Oe}};c_.matchBase=(h,o,u)=>(o instanceof RegExp?o:c_.makeRe(o,u)).test(qUe.basename(h));c_.isMatch=(h,o,u)=>c_(o,u)(h);c_.parse=(h,o)=>Array.isArray(h)?h.map(u=>c_.parse(u,o)):Bxe(h,{...o,fastpaths:!1});c_.scan=(h,o)=>GNt(h,o);c_.compileRe=(h,o,u=!1,b=!1)=>{if(u===!0)return h.output;let x=o||{},L=x.contains?"":"^",j=x.contains?"":"$",me=`${L}(?:${h.output})${j}`;h&&h.negated===!0&&(me=`^(?!${me}).*$`);let Oe=c_.toRegex(me,o);return b===!0&&(Oe.state=h),Oe};c_.makeRe=(h,o={},u=!1,b=!1)=>{if(!h||typeof h!="string")throw new TypeError("Expected a non-empty string");let x={negated:!1,fastpaths:!0};return o.fastpaths!==!1&&(h[0]==="."||h[0]==="*")&&(x.output=Bxe.fastpaths(h,o)),x.output||(x=Bxe(h,o)),c_.compileRe(x,o,u,b)};c_.toRegex=(h,o)=>{try{let u=o||{};return new RegExp(h,u.flags||(u.nocase?"i":""))}catch(u){if(o&&o.debug===!0)throw u;return/$^/}};c_.constants=VNt;XUe.exports=c_});var zxe=Om((uOt,ZUe)=>{"use strict";var YUe=$Ue(),UNt=I5();function QUe(h,o,u=!1){return o&&(o.windows===null||o.windows===void 0)&&(o={...o,windows:UNt.isWindows()}),YUe(h,o,u)}Object.assign(QUe,YUe);ZUe.exports=QUe});var uHe=Om(dHe=>{var HNt=Object.create,tHe=Object.defineProperty,KNt=Object.getOwnPropertyDescriptor,JNt=Object.getOwnPropertyNames,qNt=Object.getPrototypeOf,XNt=Object.prototype.hasOwnProperty,$Nt=(h,o,u,b)=>{if(o&&typeof o=="object"||typeof o=="function")for(var x=JNt(o),L=0,j=x.length,me;L<j;L++)me=x[L],!XNt.call(h,me)&&me!==u&&tHe(h,me,{get:(Oe=>o[Oe]).bind(null,me),enumerable:!(b=KNt(o,me))||b.enumerable});return h},nHe=(h,o,u)=>(u=h!=null?HNt(qNt(h)):{},$Nt(o||!h||!h.__esModule?tHe(u,"default",{value:h,enumerable:!0}):u,h)),fC=nHe(require("path")),YNt=nHe(require("fs"));function QNt(h){let o=(0,fC.normalize)(h);return o.length>1&&o[o.length-1]===fC.sep&&(o=o.substring(0,o.length-1)),o}var ZNt=/[\\/]/g;function rHe(h,o){return h.replace(ZNt,o)}var eRt=/^[a-z]:[\\/]$/i;function tRt(h){return h==="/"||eRt.test(h)}function Gxe(h,o){let{resolvePaths:u,normalizePath:b,pathSeparator:x}=o,L=process.platform==="win32"&&h.includes("/")||h.startsWith(".");if(u&&(h=(0,fC.resolve)(h)),(b||L)&&(h=QNt(h)),h===".")return"";let j=h[h.length-1]!==x;return rHe(j?h+x:h,x)}function iHe(h,o){return o+h}function nRt(h,o){return function(u,b){return b.startsWith(h)?b.slice(h.length)+u:rHe((0,fC.relative)(h,b),o.pathSeparator)+o.pathSeparator+u}}function rRt(h){return h}function iRt(h,o,u){return o+h+u}function oRt(h,o){let{relativePaths:u,includeBasePath:b}=o;return u&&h?nRt(h,o):b?iHe:rRt}function aRt(h){return function(o,u){u.push(o.substring(h.length)||".")}}function sRt(h){return function(o,u,b){let x=o.substring(h.length)||".";b.every(L=>L(x,!0))&&u.push(x)}}var lRt=(h,o)=>{o.push(h||".")},cRt=(h,o,u)=>{let b=h||".";u.every(x=>x(b,!0))&&o.push(b)},dRt=()=>{};function uRt(h,o){let{includeDirs:u,filters:b,relativePaths:x}=o;return u?x?b&&b.length?sRt(h):aRt(h):b&&b.length?cRt:lRt:dRt}var pRt=(h,o,u,b)=>{b.every(x=>x(h,!1))&&u.files++},fRt=(h,o,u,b)=>{b.every(x=>x(h,!1))&&o.push(h)},mRt=(h,o,u,b)=>{u.files++},_Rt=(h,o)=>{o.push(h)},hRt=()=>{};function gRt(h){let{excludeFiles:o,filters:u,onlyCounts:b}=h;return o?hRt:u&&u.length?b?pRt:fRt:b?mRt:_Rt}var yRt=h=>h,vRt=()=>[""].slice(0,0);function bRt(h){return h.group?vRt:yRt}var SRt=(h,o,u)=>{h.push({directory:o,files:u,dir:o})},TRt=()=>{};function ERt(h){return h.group?SRt:TRt}var xRt=function(h,o,u){let{queue:b,fs:x,options:{suppressErrors:L}}=o;b.enqueue(),x.realpath(h,(j,me)=>{if(j)return b.dequeue(L?null:j,o);x.stat(me,(Oe,tt)=>{if(Oe)return b.dequeue(L?null:Oe,o);if(tt.isDirectory()&&oHe(h,me,o))return b.dequeue(null,o);u(tt,me),b.dequeue(null,o)})})},ARt=function(h,o,u){let{queue:b,fs:x,options:{suppressErrors:L}}=o;b.enqueue();try{let j=x.realpathSync(h),me=x.statSync(j);if(me.isDirectory()&&oHe(h,j,o))return;u(me,j)}catch(j){if(!L)throw j}};function DRt(h,o){return!h.resolveSymlinks||h.excludeSymlinks?null:o?ARt:xRt}function oHe(h,o,u){if(u.options.useRealPaths)return IRt(o,u);let b=(0,fC.dirname)(h),x=1;for(;b!==u.root&&x<2;){let L=u.symlinks.get(b);!!L&&(L===o||L.startsWith(o)||o.startsWith(L))?x++:b=(0,fC.dirname)(b)}return u.symlinks.set(h,o),x>1}function IRt(h,o){return o.visited.includes(h+o.options.pathSeparator)}var CRt=h=>h.counts,PRt=h=>h.groups,NRt=h=>h.paths,RRt=h=>h.paths.slice(0,h.options.maxFiles),MRt=(h,o,u)=>(WZ(o,u,h.counts,h.options.suppressErrors),null),LRt=(h,o,u)=>(WZ(o,u,h.paths,h.options.suppressErrors),null),kRt=(h,o,u)=>(WZ(o,u,h.paths.slice(0,h.options.maxFiles),h.options.suppressErrors),null),wRt=(h,o,u)=>(WZ(o,u,h.groups,h.options.suppressErrors),null);function WZ(h,o,u,b){o(h&&!b?h:null,u)}function ORt(h,o){let{onlyCounts:u,group:b,maxFiles:x}=h;return u?o?CRt:MRt:b?o?PRt:wRt:x?o?RRt:kRt:o?NRt:LRt}var aHe={withFileTypes:!0},FRt=(h,o,u,b,x)=>{if(h.queue.enqueue(),b<0)return h.queue.dequeue(null,h);let{fs:L}=h;h.visited.push(o),h.counts.directories++,L.readdir(o||".",aHe,(j,me=[])=>{x(me,u,b),h.queue.dequeue(h.options.suppressErrors?null:j,h)})},WRt=(h,o,u,b,x)=>{let{fs:L}=h;if(b<0)return;h.visited.push(o),h.counts.directories++;let j=[];try{j=L.readdirSync(o||".",aHe)}catch(me){if(!h.options.suppressErrors)throw me}x(j,u,b)};function BRt(h){return h?WRt:FRt}var zRt=class{count=0;constructor(h){this.onQueueEmpty=h}enqueue(){return this.count++,this.count}dequeue(h,o){this.onQueueEmpty&&(--this.count<=0||h)&&(this.onQueueEmpty(h,o),h&&(o.controller.abort(),this.onQueueEmpty=void 0))}},GRt=class{_files=0;_directories=0;set files(h){this._files=h}get files(){return this._files}set directories(h){this._directories=h}get directories(){return this._directories}get dirs(){return this._directories}},VRt=class{aborted=!1;abort(){this.aborted=!0}},sHe=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(h,o,u){this.isSynchronous=!u,this.callbackInvoker=ORt(o,this.isSynchronous),this.root=Gxe(h,o),this.state={root:tRt(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new GRt,options:o,queue:new zRt((b,x)=>this.callbackInvoker(x,b,u)),symlinks:new Map,visited:[""].slice(0,0),controller:new VRt,fs:o.fs||YNt},this.joinPath=oRt(this.root,o),this.pushDirectory=uRt(this.root,o),this.pushFile=gRt(o),this.getArray=bRt(o),this.groupFiles=ERt(o),this.resolveSymlink=DRt(o,this.isSynchronous),this.walkDirectory=BRt(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(h,o,u)=>{let{paths:b,options:{filters:x,resolveSymlinks:L,excludeSymlinks:j,exclude:me,maxFiles:Oe,signal:tt,useRealPaths:at,pathSeparator:dt},controller:xe}=this.state;if(xe.aborted||tt&&tt.aborted||Oe&&b.length>Oe)return;let yn=this.getArray(this.state.paths);for(let pt=0;pt<h.length;++pt){let ut=h[pt];if(ut.isFile()||ut.isSymbolicLink()&&!L&&!j){let yi=this.joinPath(ut.name,o);this.pushFile(yi,yn,this.state.counts,x)}else if(ut.isDirectory()){let yi=iRt(ut.name,o,this.state.options.pathSeparator);if(me&&me(ut.name,yi))continue;this.pushDirectory(yi,b,x),this.walkDirectory(this.state,yi,yi,u-1,this.walk)}else if(this.resolveSymlink&&ut.isSymbolicLink()){let yi=iHe(ut.name,o);this.resolveSymlink(yi,this.state,(wi,eo)=>{if(wi.isDirectory()){if(eo=Gxe(eo,this.state.options),me&&me(ut.name,at?eo:yi+dt))return;this.walkDirectory(this.state,eo,at?eo:yi+dt,u-1,this.walk)}else{eo=at?eo:yi;let qa=(0,fC.basename)(eo),yl=Gxe((0,fC.dirname)(eo),this.state.options);eo=this.joinPath(qa,yl),this.pushFile(eo,yn,this.state.counts,x)}})}}this.groupFiles(this.state.groups,o,yn)}};function jRt(h,o){return new Promise((u,b)=>{lHe(h,o,(x,L)=>{if(x)return b(x);u(L)})})}function lHe(h,o,u){new sHe(h,o,u).start()}function URt(h,o){return new sHe(h,o).start()}var eHe=class{constructor(h,o){this.root=h,this.options=o}withPromise(){return jRt(this.root,this.options)}withCallback(h){lHe(this.root,this.options,h)}sync(){return URt(this.root,this.options)}},cHe=null;try{require.resolve("picomatch"),cHe=zxe()}catch{}var HRt=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:fC.sep,filters:[]};globFunction;constructor(h){this.options={...this.options,...h},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(h){return this.options.pathSeparator=h,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(h){return this.options.maxDepth=h,this}withMaxFiles(h){return this.options.maxFiles=h,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:h=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=h,this.withFullPaths()}withAbortSignal(h){return this.options.signal=h,this}normalize(){return this.options.normalizePath=!0,this}filter(h){return this.options.filters.push(h),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(h){return this.options.exclude=h,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(h){return new eHe(h||".",this.options)}withGlobFunction(h){return this.globFunction=h,this}crawlWithOptions(h,o){return this.options={...this.options,...o},new eHe(h||".",this.options)}glob(...h){return this.globFunction?this.globWithOptions(h):this.globWithOptions(h,{dot:!0})}globWithOptions(h,...o){let u=this.globFunction||cHe;if(!u)throw new Error("Please specify a glob function to use glob matching.");var b=this.globCache[h.join("\0")];return b||(b=u(h,...o),this.globCache[h.join("\0")]=b),this.options.filters.push(x=>b(x)),this}};dHe.fdir=HRt});var EHe=Om($k=>{Object.defineProperty($k,Symbol.toStringTag,{value:"Module"});var KRt=Object.create,fHe=Object.defineProperty,JRt=Object.getOwnPropertyDescriptor,qRt=Object.getOwnPropertyNames,XRt=Object.getPrototypeOf,$Rt=Object.prototype.hasOwnProperty,YRt=(h,o,u,b)=>{if(o&&typeof o=="object"||typeof o=="function")for(var x=qRt(o),L=0,j=x.length,me;L<j;L++)me=x[L],!$Rt.call(h,me)&&me!==u&&fHe(h,me,{get:(Oe=>o[Oe]).bind(null,me),enumerable:!(b=JRt(o,me))||b.enumerable});return h},QRt=(h,o,u)=>(u=h!=null?KRt(XRt(h)):{},YRt(o||!h||!h.__esModule?fHe(u,"default",{value:h,enumerable:!0}):u,h)),P8=require("fs"),mC=require("path"),ZRt=require("url"),eMt=uHe(),Xk=zxe();Xk=QRt(Xk);var tMt=Array.isArray,mHe=/\\/g,jxe=process.platform==="win32",nMt=/^(\/?\.\.)+$/;function rMt(h,o={}){let u=h.length,b=Array(u),x=Array(u),L,j;for(L=0;L<u;L++){let me=_He(h[L]);b[L]=me;let Oe=me.length,tt=Array(Oe);for(j=0;j<Oe;j++)tt[j]=(0,Xk.default)(me[j],o);x[L]=tt}return me=>{let Oe=me.split("/");if(Oe[0]===".."&&nMt.test(me))return!0;for(L=0;L<u;L++){let tt=b[L],at=x[L],dt=Oe.length,xe=Math.min(dt,tt.length);for(j=0;j<xe;){let yn=tt[j];if(yn.includes("/"))return!0;if(!at[j](Oe[j]))break;if(!o.noglobstar&&yn==="**")return!0;j++}if(j===dt)return!0}return!1}}var iMt=/^[A-Z]:\/$/i,oMt=jxe?h=>iMt.test(h):h=>h==="/";function pHe(h,o,u){if(h===o||o.startsWith(`${h}/`)){if(u){let x=h.length+ +!oMt(h);return(L,j)=>L.slice(x,j?-1:void 0)||"."}let b=o.slice(h.length+1);return b?(x,L)=>{if(x===".")return b;let j=`${b}/${x}`;return L?j.slice(0,-1):j}:(x,L)=>L&&x!=="."?x.slice(0,-1):x}return u?b=>mC.posix.relative(h,b)||".":b=>mC.posix.relative(h,`${o}/${b}`)||"."}function aMt(h,o){if(o.startsWith(`${h}/`)){let u=o.slice(h.length+1);return b=>`${u}/${b}`}return u=>{let b=mC.posix.relative(h,`${o}/${u}`);return u[u.length-1]==="/"&&b!==""?`${b}/`:b||"."}}var sMt={parts:!0};function _He(h){var o;let u=Xk.default.scan(h,sMt);return!((o=u.parts)===null||o===void 0)&&o.length?u.parts:[h]}var lMt=/\\(?![()[\]{}!+@])/g;function cMt(h){return hHe(h)}function dMt(h){return gHe(h).replace(lMt,"/")}var uMt=jxe?dMt:cMt,pMt=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,fMt=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,hHe=h=>h.replace(pMt,"\\$&"),gHe=h=>h.replace(fMt,"\\$&"),yHe=jxe?gHe:hHe;function vHe(h,o){if(o?.caseSensitiveMatch===!1)return!0;let u=Xk.default.scan(h);return u.isGlob||u.negated}function N5(...h){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...h)}function bHe(h){return typeof h=="string"?[h]:h??[]}var mMt=/^(\/?\.\.)+/,_Mt=/\\(?=[()[\]{}!*+?@|])/g;function Vxe(h,o,u,b){var x;let L=o.cwd,j=h;h[h.length-1]==="/"&&(j=h.slice(0,-1)),j[j.length-1]!=="*"&&o.expandDirectories&&(j+="/**");let me=yHe(L);j=(0,mC.isAbsolute)(j.replace(_Mt,""))?mC.posix.relative(me,j):mC.posix.normalize(j);let Oe=(x=mMt.exec(j))===null||x===void 0?void 0:x[0],tt=_He(j);if(Oe){let dt=(Oe.length+1)/3,xe=0,yn=me.split("/");for(;xe<dt&&tt[xe+dt]===yn[yn.length+xe-dt];)j=j.slice(0,(dt-xe-1)*3)+j.slice((dt-xe)*3+tt[xe+dt].length+1)||".",xe++;let pt=mC.posix.join(L,Oe.slice(xe*3));pt[0]!=="."&&u.root.length>pt.length&&(u.root=pt,u.depthOffset=-dt+xe)}if(!b&&u.depthOffset>=0){var at;(at=u.commonPath)!==null&&at!==void 0||(u.commonPath=tt);let dt=[],xe=Math.min(u.commonPath.length,tt.length);for(let yn=0;yn<xe;yn++){let pt=tt[yn];if(pt==="**"&&!tt[yn+1]){dt.pop();break}if(yn===tt.length-1||pt!==u.commonPath[yn]||vHe(pt))break;dt.push(pt)}u.depthOffset=dt.length,u.commonPath=dt,u.root=dt.length>0?mC.posix.join(L,...dt):L}return j}function hMt(h,o,u){let b=[],x=[];for(let L of h.ignore)L&&(L[0]!=="!"||L[1]==="(")&&x.push(Vxe(L,h,u,!0));for(let L of o)L&&(L[0]!=="!"||L[1]==="("?b.push(Vxe(L,h,u,!1)):(L[1]!=="!"||L[2]==="(")&&x.push(Vxe(L.slice(1),h,u,!0)));return{match:b,ignore:x}}function gMt(h,o){let u=h.cwd,b={root:u,depthOffset:0},x=hMt(h,o,b);h.debug&&N5("internal processing patterns:",x);let{absolute:L,caseSensitiveMatch:j,debug:me,dot:Oe,followSymbolicLinks:tt,onlyDirectories:at}=h,dt=b.root.replace(mHe,""),xe={dot:Oe,nobrace:h.braceExpansion===!1,nocase:!j,noextglob:h.extglob===!1,noglobstar:h.globstar===!1,posix:!0},yn=(0,Xk.default)(x.match,xe),pt=(0,Xk.default)(x.ignore,xe),ut=rMt(x.match,xe),yi=pHe(u,dt,L),wi=L?yi:pHe(u,dt,!0),eo=(Sa,Lr)=>{let In=wi(Lr,!0);return In!=="."&&!ut(In)||pt(In)},qa;h.deep!==void 0&&(qa=Math.round(h.deep-b.depthOffset));let yl=new eMt.fdir({filters:[me?(Sa,Lr)=>{let In=yi(Sa,Lr),Ii=yn(In)&&!pt(In);return Ii&&N5(`matched ${In}`),Ii}:(Sa,Lr)=>{let In=yi(Sa,Lr);return yn(In)&&!pt(In)}],exclude:me?(Sa,Lr)=>{let In=eo(Sa,Lr);return N5(`${In?"skipped":"crawling"} ${Lr}`),In}:eo,fs:h.fs,pathSeparator:"/",relativePaths:!L,resolvePaths:L,includeBasePath:L,resolveSymlinks:tt,excludeSymlinks:!tt,excludeFiles:at,includeDirs:at||!h.onlyFiles,maxDepth:qa,signal:h.signal}).crawl(dt);return h.debug&&N5("internal properties:",{...b,root:dt}),[yl,u!==dt&&!L&&aMt(u,dt)]}function SHe(h,o){if(o)for(let u=h.length-1;u>=0;u--)h[u]=o(h[u]);return h}var yMt={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function vMt(h){let o={...yMt,...h};return o.cwd=(o.cwd instanceof URL?(0,ZRt.fileURLToPath)(o.cwd):(0,mC.resolve)(o.cwd)).replace(mHe,"/"),o.ignore=bHe(o.ignore),o.fs&&(o.fs={readdir:o.fs.readdir||P8.readdir,readdirSync:o.fs.readdirSync||P8.readdirSync,realpath:o.fs.realpath||P8.realpath,realpathSync:o.fs.realpathSync||P8.realpathSync,stat:o.fs.stat||P8.stat,statSync:o.fs.statSync||P8.statSync}),o.debug&&N5("globbing with options:",o),o}function THe(h,o={}){var u;if(h&&o?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let b=tMt(h)||typeof h=="string",x=bHe((u=b?h:h.patterns)!==null&&u!==void 0?u:"**/*"),L=vMt(b?o:h);return x.length>0?gMt(L,x):[]}async function bMt(h,o){let[u,b]=THe(h,o);return u?SHe(await u.withPromise(),b):[]}function SMt(h,o){let[u,b]=THe(h,o);return u?SHe(u.sync(),b):[]}$k.convertPathToPattern=uMt;$k.escapePath=yHe;$k.glob=bMt;$k.globSync=SMt;$k.isDynamicPattern=vHe});var WHe=Om(Zo=>{"use strict";var xv=rUe(),TMt=DUe(),EMt=PUe(),xMt=require("node:fs"),AMt=require("node:fs/promises"),DMt=require("node:os"),IMt=require("node:path"),xHe=EHe();function CMt(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}function R8(h){if(h&&typeof h=="object"&&"default"in h)return h;var o=Object.create(null);return h&&Object.keys(h).forEach(function(u){if(u!=="default"){var b=Object.getOwnPropertyDescriptor(h,u);Object.defineProperty(o,u,b.get?b:{enumerable:!0,get:function(){return h[u]}})}}),o.default=h,Object.freeze(o)}var aT=R8(xv),CHe=R8(TMt),Uxe=CMt(EMt),Ev=R8(xMt),PMt=R8(AMt),NMt=R8(DMt),BZ=R8(IMt),zZ=class{#e=new Map;getSize(){return this.#e.size}getValues(){return this.#e.values()}getValuesAsArray(){return Array.from(this.getValues())}getKeys(){return this.#e.keys()}getEntries(){return this.#e.entries()}getOrCreate(o,u){let b=this.get(o);return b==null&&(b=u(),this.set(o,b)),b}has(o){return this.#e.has(o)}get(o){return this.#e.get(o)}set(o,u){this.#e.set(o,u)}replaceKey(o,u){if(!this.#e.has(o))throw new Error("Key not found.");let b=this.#e.get(o);this.#e.delete(o),this.#e.set(u,b)}removeByKey(o){this.#e.delete(o)}clear(){this.#e.clear()}},GZ=class{#e;#t;constructor(o,u){this.#e=o,this.#t=u}compareTo(o){return this.#e.compareTo(this.#t,o)}},VZ=class h{static instance=new h;compareTo(o,u){let b=o.localeCompare(u,"en-us-u-kf-upper");return b<0?-1:b===0?0:1}},jZ=class{#e;#t;constructor(o,u){this.#t=o,this.#e=u}compareTo(o,u){return this.#e.compareTo(this.#t(o),this.#t(u))}},UZ=class{#e;#t;constructor(o,u){this.#t=o,this.#e=u}compareTo(o){return this.#e.compareTo(this.#t(o))}},HE=class{constructor(){}static isReadonlyArray(o){return o instanceof Array}static isNullOrEmpty(o){return!(o instanceof Array)||o.length===0}static getUniqueItems(o){return o.filter((u,b)=>o.indexOf(u)===b)}static removeFirst(o,u){let b=o.indexOf(u);return b===-1?!1:(o.splice(b,1),!0)}static removeAll(o,u){let b=[];for(let x=o.length-1;x>=0;x--)u(o[x])&&(b.push(o[x]),o.splice(x,1));return b}static*toIterator(o){for(let u of o)yield u}static sortByProperty(o,u){return o.sort((b,x)=>u(b)<=u(x)?-1:1),o}static groupBy(o,u){let b=[],x={};for(let L of o){let j=u(L).toString();x[j]==null&&(x[j]=[],b.push(x[j])),x[j].push(L)}return b}static binaryInsertWithOverwrite(o,u,b){let x=o.length-1,L=0;for(;L<=x;){let j=Math.floor((x+L)/2);b.compareTo(u,o[j])<0?x=j-1:L=j+1}o[x]!=null&&b.compareTo(u,o[x])===0?o[x]=u:o.splice(x+1,0,u)}static binarySearch(o,u){let b=o.length-1,x=0;for(;x<=b;){let L=Math.floor((b+x)/2),j=u.compareTo(o[L]);if(j===0)return L;j<0?b=L-1:x=L+1}return-1}static containsSubArray(o,u){let b=0;for(let x of o)if(u[b]===x){if(b++,b===u.length)return!0}else b=0;return!1}};function PHe(h){return o(h);function o(x){let L=Object.create(x.constructor.prototype);for(let j of Object.keys(x))L[j]=b(x[j]);return L}function u(x){return x.map(b)}function b(x){return x instanceof Array?u(x):typeof x=="object"?x===null?x:o(x):x}}var HZ=class{#e=[];subscribe(o){this.#t(o)===-1&&this.#e.push(o)}unsubscribe(o){let u=this.#t(o);u>=0&&this.#e.splice(u,1)}fire(o){for(let u of this.#e)u(o)}#t(o){return this.#e.indexOf(o)}},Jxe=class{static find(o,u){for(let b of o)if(u(b))return b}};function qxe(h,o){return o??h}var Xxe=class h{constructor(){}static clone(o){if(o==null)return;if(o instanceof Array)return u(o);return Object.assign({},o);function u(b){return b.map(x=>h.clone(x))}}};function NHe(h,o,u,b,x,L,j,me,Oe,tt){return aT.matchFiles.apply(this,arguments)}function RHe(h,o,u,b,x){return aT.getFileMatcherPatterns.apply(this,arguments)}function RMt(h){return aT.getEmitModuleResolutionKind.apply(this,arguments)}function MHe(h){return MMt()[h]}var N8;function MMt(){if(N8!=null)return N8;N8={};for(let h of Object.keys(aT.SyntaxKind).filter(o=>isNaN(parseInt(o,10)))){let o=aT.SyntaxKind[h];N8[o]==null&&(N8[o]=h)}return N8}Zo.errors=void 0;(function(h){class o extends Error{constructor(Ii,_i){let Fr=_i&&LMt(_i),bi=Fr?`${Ii}
433
+ `+C.stack)}finally{this.performanceData=g}}parseMessage(t){return JSON.parse(t)}toStringMessage(t){return t}getFormatOptions(t){return this.projectService.getFormatCodeOptions(t)}getPreferences(t){return this.projectService.getPreferences(t)}getHostFormatOptions(){return this.projectService.getHostFormatCodeOptions()}getHostPreferences(){return this.projectService.getHostPreferences()}};function JBe(e){let t=e.diagnosticsDuration&&Co(e.diagnosticsDuration,([r,i])=>({...i,file:r}));return{...e,diagnosticsDuration:t}}function jh(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Ol(e))}}function DSe(e,t,r){let i=jh(e,r),a=t&&jh(t,r);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}function Wgt(e,t){return{start:qBe(t,e.span.start),end:qBe(t,Ol(e.span)),newText:e.newText}}function qBe(e,t){return vSe(e)?zgt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function Bgt(e,t){let r=e.ranges.map(i=>({start:t.positionToLineOffset(i.start),end:t.positionToLineOffset(i.start+i.length)}));return e.wordPattern?{ranges:r,wordPattern:e.wordPattern}:{ranges:r}}function zgt(e){return{line:e.line+1,offset:e.character+1}}function Ggt(e){M.assert(e.textChanges.length===1);let t=rs(e.textChanges);return M.assert(t.span.start===0&&t.span.length===0),{fileName:e.fileName,textChanges:[{start:{line:0,offset:0},end:{line:0,offset:0},newText:t.newText}]}}function ISe(e,t,r,i){let a=Vgt(e,t,i),{line:l,character:c}=IC(Z1(a),r);return{line:l+1,offset:c+1}}function Vgt(e,t,r){for(let{fileName:i,textChanges:a}of r)if(i===t)for(let l=a.length-1;l>=0;l--){let{newText:c,span:{start:f,length:p}}=a[l];e=e.slice(0,f)+c+e.slice(f+p)}return e}function XBe(e,{fileName:t,textSpan:r,contextSpan:i,isWriteAccess:a,isDefinition:l},{disableLineTextInReferences:c}){let f=M.checkDefined(e.getScriptInfo(t)),p=DSe(r,i,f),v=c?void 0:jgt(f,p);return{file:t,...p,lineText:v,isWriteAccess:a,isDefinition:l}}function jgt(e,t){let r=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(r.start,Ol(r)).replace(/\r|\n/g,"")}function Ugt(e){return e===void 0||e&&typeof e=="object"&&typeof e.exportName=="string"&&(e.fileName===void 0||typeof e.fileName=="string")&&(e.ambientModuleName===void 0||typeof e.ambientModuleName=="string"&&(e.isPackageJsonImport===void 0||typeof e.isPackageJsonImport=="boolean"))}var fN=4,CSe=(e=>(e[e.PreStart=0]="PreStart",e[e.Start=1]="Start",e[e.Entire=2]="Entire",e[e.Mid=3]="Mid",e[e.End=4]="End",e[e.PostEnd=5]="PostEnd",e))(CSe||{}),Hgt=class{constructor(){this.goSubtree=!0,this.lineIndex=new bW,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new mN,this.startPath=[this.lineIndex.root],this.stack=[this.lineIndex.root]}get done(){return!1}insertLines(e,t){t&&(this.trailingText=""),e?e=this.initialText+e+this.trailingText:e=this.initialText+this.trailingText;let i=bW.linesFromText(e).lines;i.length>1&&i[i.length-1]===""&&i.pop();let a,l;for(let f=this.endBranch.length-1;f>=0;f--)this.endBranch[f].updateCounts(),this.endBranch[f].charCount()===0&&(l=this.endBranch[f],f>0?a=this.endBranch[f-1]:a=this.branchNode);l&&a.remove(l);let c=this.startPath[this.startPath.length-1];if(i.length>0)if(c.text=i[0],i.length>1){let f=new Array(i.length-1),p=c;for(let S=1;S<i.length;S++)f[S-1]=new qG(i[S]);let v=this.startPath.length-2;for(;v>=0;){let S=this.startPath[v];f=S.insertAt(p,f),v--,p=S}let g=f.length;for(;g>0;){let S=new mN;S.add(this.lineIndex.root),f=S.insertAt(this.lineIndex.root,f),g=f.length,this.lineIndex.root=S}this.lineIndex.root.updateCounts()}else for(let f=this.startPath.length-2;f>=0;f--)this.startPath[f].updateCounts();else{this.startPath[this.startPath.length-2].remove(c);for(let p=this.startPath.length-2;p>=0;p--)this.startPath[p].updateCounts()}return this.lineIndex}post(e,t,r){r===this.lineCollectionAtBranch&&(this.state=4),this.stack.pop()}pre(e,t,r,i,a){let l=this.stack[this.stack.length-1];this.state===2&&a===1&&(this.state=1,this.branchNode=l,this.lineCollectionAtBranch=r);let c;function f(p){return p.isLeaf()?new qG(""):new mN}switch(a){case 0:this.goSubtree=!1,this.state!==4&&l.add(r);break;case 1:this.state===4?this.goSubtree=!1:(c=f(r),l.add(c),this.startPath.push(c));break;case 2:this.state!==4?(c=f(r),l.add(c),this.startPath.push(c)):r.isLeaf()||(c=f(r),l.add(c),this.endBranch.push(c));break;case 3:this.goSubtree=!1;break;case 4:this.state!==4?this.goSubtree=!1:r.isLeaf()||(c=f(r),l.add(c),this.endBranch.push(c));break;case 5:this.goSubtree=!1,this.state!==1&&l.add(r);break}this.goSubtree&&this.stack.push(c)}leaf(e,t,r){this.state===1?this.initialText=r.text.substring(0,e):this.state===2?(this.initialText=r.text.substring(0,e),this.trailingText=r.text.substring(e+t)):this.trailingText=r.text.substring(e+t)}},Kgt=class{constructor(e,t,r){this.pos=e,this.deleteLen=t,this.insertedText=r}getTextChangeRange(){return kw(Hd(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},mY=class P1{constructor(){this.changes=[],this.versions=new Array(P1.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%P1.maxVersions}currentVersionToIndex(){return this.currentVersion%P1.maxVersions}edit(t,r,i){this.changes.push(new Kgt(t,r,i)),(this.changes.length>P1.changeNumberThreshold||r>P1.changeLengthThreshold||i&&i.length>P1.changeLengthThreshold)&&this.getSnapshot()}getSnapshot(){return this._getSnapshot()}_getSnapshot(){let t=this.versions[this.currentVersionToIndex()];if(this.changes.length>0){let r=t.index;for(let i of this.changes)r=r.edit(i.pos,i.deleteLen,i.insertedText);t=new $Be(this.currentVersion+1,this,r,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=P1.maxVersions&&(this.minVersion=this.currentVersion-P1.maxVersions+1)}return t}getSnapshotVersion(){return this._getSnapshot().version}getAbsolutePositionAndLineText(t){return this._getSnapshot().index.lineNumberToInfo(t)}lineOffsetToPosition(t,r){return this._getSnapshot().index.absolutePositionOfStartOfLine(t)+(r-1)}positionToLineOffset(t){return this._getSnapshot().index.positionToLineOffset(t)}lineToTextSpan(t){let r=this._getSnapshot().index,{lineText:i,absolutePosition:a}=r.lineNumberToInfo(t+1),l=i!==void 0?i.length:r.absolutePositionOfStartOfLine(t+2)-a;return Hd(a,l)}getTextChangesBetweenVersions(t,r){if(t<r)if(t>=this.minVersion){let i=[];for(let a=t+1;a<=r;a++){let l=this.versions[this.versionToIndex(a)];for(let c of l.changesSincePreviousVersion)i.push(c.getTextChangeRange())}return use(i)}else return;else return b6}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let r=new P1,i=new $Be(0,r,new bW);r.versions[r.currentVersion]=i;let a=bW.linesFromText(t);return i.index.load(a.lines),r}};mY.changeNumberThreshold=8,mY.changeLengthThreshold=256,mY.maxVersions=8;var _Y=mY,$Be=class tUe{constructor(t,r,i,a=ad){this.version=t,this.cache=r,this.index=i,this.changesSincePreviousVersion=a}getText(t,r){return this.index.getText(t,r-t)}getLength(){return this.index.getLength()}getChangeRange(t){if(t instanceof tUe&&this.cache===t.cache)return this.version<=t.version?b6:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},bW=class Txe{constructor(){this.checkEdits=!1}absolutePositionOfStartOfLine(t){return this.lineNumberToInfo(t).absolutePosition}positionToLineOffset(t){let{oneBasedLine:r,zeroBasedColumn:i}=this.root.charOffsetToLineInfo(1,t);return{line:r,offset:i+1}}positionToColumnAndLineText(t){return this.root.charOffsetToLineInfo(1,t)}getLineCount(){return this.root.lineCount()}lineNumberToInfo(t){let r=this.getLineCount();if(t<=r){let{position:i,leaf:a}=this.root.lineNumberToInfo(t,0);return{absolutePosition:i,lineText:a&&a.text}}else return{absolutePosition:this.root.charCount(),lineText:void 0}}load(t){if(t.length>0){let r=[];for(let i=0;i<t.length;i++)r[i]=new qG(t[i]);this.root=Txe.buildTreeFromBottom(r)}else this.root=new mN}walk(t,r,i){this.root.walk(t,r,i)}getText(t,r){let i="";return r>0&&t<this.root.charCount()&&this.walk(t,r,{goSubtree:!0,done:!1,leaf:(a,l,c)=>{i=i.concat(c.text.substring(a,a+l))}}),i}getLength(){return this.root.charCount()}every(t,r,i){i||(i=this.root.charCount());let a={goSubtree:!0,done:!1,leaf(l,c,f){t(f,l,c)||(this.done=!0)}};return this.walk(r,i-r,a),!a.done}edit(t,r,i){if(this.root.charCount()===0)return M.assert(r===0),i!==void 0?(this.load(Txe.linesFromText(i).lines),this):void 0;{let a;if(this.checkEdits){let f=this.getText(0,this.root.charCount());a=f.slice(0,t)+i+f.slice(t+r)}let l=new Hgt,c=!1;if(t>=this.root.charCount()){t=this.root.charCount()-1;let f=this.getText(t,1);i?i=f+i:i=f,r=0,c=!0}else if(r>0){let f=t+r,{zeroBasedColumn:p,lineText:v}=this.positionToColumnAndLineText(f);p===0&&(r+=v.length,i=i?i+v:v)}if(this.root.walk(t,r,l),l.insertLines(i,c),this.checkEdits){let f=l.lineIndex.getText(0,l.lineIndex.getLength());M.assert(a===f,"buffer edit mismatch")}return l.lineIndex}}static buildTreeFromBottom(t){if(t.length<fN)return new mN(t);let r=new Array(Math.ceil(t.length/fN)),i=0;for(let a=0;a<r.length;a++){let l=Math.min(i+fN,t.length);r[a]=new mN(t.slice(i,l)),i=l}return this.buildTreeFromBottom(r)}static linesFromText(t){let r=Z1(t);if(r.length===0)return{lines:[],lineMap:r};let i=new Array(r.length),a=r.length-1;for(let c=0;c<a;c++)i[c]=t.substring(r[c],r[c+1]);let l=t.substring(r[a]);return l.length>0?i[a]=l:i.pop(),{lines:i,lineMap:r}}},mN=class Exe{constructor(t=[]){this.children=t,this.totalChars=0,this.totalLines=0,t.length&&this.updateCounts()}isLeaf(){return!1}updateCounts(){this.totalChars=0,this.totalLines=0;for(let t of this.children)this.totalChars+=t.charCount(),this.totalLines+=t.lineCount()}execWalk(t,r,i,a,l){return i.pre&&i.pre(t,r,this.children[a],this,l),i.goSubtree?(this.children[a].walk(t,r,i),i.post&&i.post(t,r,this.children[a],this,l)):i.goSubtree=!0,i.done}skipChild(t,r,i,a,l){a.pre&&!a.done&&(a.pre(t,r,this.children[i],this,l),a.goSubtree=!0)}walk(t,r,i){if(this.children.length===0)return;let a=0,l=this.children[a].charCount(),c=t;for(;c>=l;)this.skipChild(c,r,a,i,0),c-=l,a++,l=this.children[a].charCount();if(c+r<=l){if(this.execWalk(c,r,i,a,2))return}else{if(this.execWalk(c,l-c,i,a,1))return;let f=r-(l-c);for(a++,l=this.children[a].charCount();f>l;){if(this.execWalk(0,l,i,a,3))return;f-=l,a++,l=this.children[a].charCount()}if(f>0&&this.execWalk(0,f,i,a,4))return}if(i.pre){let f=this.children.length;if(a<f-1)for(let p=a+1;p<f;p++)this.skipChild(0,0,p,i,5)}}charOffsetToLineInfo(t,r){if(this.children.length===0)return{oneBasedLine:t,zeroBasedColumn:r,lineText:void 0};for(let l of this.children){if(l.charCount()>r)return l.isLeaf()?{oneBasedLine:t,zeroBasedColumn:r,lineText:l.text}:l.charOffsetToLineInfo(t,r);r-=l.charCount(),t+=l.lineCount()}let i=this.lineCount();if(i===0)return{oneBasedLine:1,zeroBasedColumn:0,lineText:void 0};let a=M.checkDefined(this.lineNumberToInfo(i,0).leaf);return{oneBasedLine:i,zeroBasedColumn:a.charCount(),lineText:void 0}}lineNumberToInfo(t,r){for(let i of this.children){let a=i.lineCount();if(a>=t)return i.isLeaf()?{position:r,leaf:i}:i.lineNumberToInfo(t,r);t-=a,r+=i.charCount()}return{position:r,leaf:void 0}}splitAfter(t){let r,i=this.children.length;t++;let a=t;if(t<i){for(r=new Exe;t<i;)r.add(this.children[t]),t++;r.updateCounts()}return this.children.length=a,r}remove(t){let r=this.findChildIndex(t),i=this.children.length;if(r<i-1)for(let a=r;a<i-1;a++)this.children[a]=this.children[a+1];this.children.pop()}findChildIndex(t){let r=this.children.indexOf(t);return M.assert(r!==-1),r}insertAt(t,r){let i=this.findChildIndex(t),a=this.children.length,l=r.length;if(a<fN&&i===a-1&&l===1)return this.add(r[0]),this.updateCounts(),[];{let c=this.splitAfter(i),f=0;for(i++;i<fN&&f<l;)this.children[i]=r[f],i++,f++;let p=[],v=0;if(f<l){v=Math.ceil((l-f)/fN),p=new Array(v);let g=0;for(let I=0;I<v;I++)p[I]=new Exe;let S=p[0];for(;f<l;)S.add(r[f]),f++,S.children.length===fN&&(g++,S=p[g]);for(let I=p.length-1;I>=0;I--)p[I].children.length===0&&p.pop()}c&&p.push(c),this.updateCounts();for(let g=0;g<v;g++)p[g].updateCounts();return p}}add(t){this.children.push(t),M.assert(this.children.length<=fN)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},qG=class{constructor(e){this.text=e}isLeaf(){return!0}walk(e,t,r){r.leaf(e,t,this)}charCount(){return this.text.length}lineCount(){return 1}},YBe=class nUe{constructor(t,r,i,a,l,c){this.telemetryEnabled=t,this.logger=r,this.host=i,this.globalTypingsCacheLocation=a,this.event=l,this.maxActiveRequestCount=c,this.activeRequestCount=0,this.requestQueue=yw(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var r;return ES.validatePackageName(t)!==ES.NameValidationResult.Ok?!1:(this.requestedRegistry||(this.requestedRegistry=!0,this.installer.send({kind:"typesRegistry"})),!!((r=this.typesRegistryCache)!=null&&r.has(t)))}installPackage(t){this.packageInstallId++;let r={kind:"installPackage",...t,id:this.packageInstallId},i=new Promise((a,l)=>{(this.packageInstalledPromise??(this.packageInstalledPromise=new Map)).set(this.packageInstallId,{resolve:a,reject:l})});return this.installer.send(r),i}attach(t){this.projectService=t,this.installer=this.createInstallerProcess()}onProjectClosed(t){this.installer.send({projectName:t.getProjectName(),kind:"closeProject"})}enqueueInstallTypingsRequest(t,r,i){let a=wbe(t,r,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${qT(a)}`),this.activeRequestCount<this.maxActiveRequestCount?this.scheduleRequest(a):(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Deferring request for: ${a.projectName}`),this.requestQueue.enqueue(a),this.requestMap.set(a.projectName,a))}handleMessage(t){var r,i;switch(this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Received response:${qT(t)}`),t.kind){case BJ:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case fz:{let a=(r=this.packageInstalledPromise)==null?void 0:r.get(t.id);M.assertIsDefined(a,"Should find the promise for package install"),(i=this.packageInstalledPromise)==null||i.delete(t.id),t.success?a.resolve({successMessage:t.message}):a.reject(t.message),this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case Gme:{let a={message:t.message};this.event(a,"typesInstallerInitializationFailed");break}case zJ:{let a={eventId:t.eventId,packages:t.packagesToInstall};this.event(a,"beginInstallTypes");break}case GJ:{if(this.telemetryEnabled){let c={telemetryEventName:"typingsInstalled",payload:{installedPackages:t.packagesToInstall.join(","),installSuccess:t.installSuccess,typingsInstallerVersion:t.typingsInstallerVersion}};this.event(c,"telemetry")}let a={eventId:t.eventId,packages:t.packagesToInstall,success:t.installSuccess};this.event(a,"endInstallTypes");break}case pz:{this.projectService.updateTypingsForProject(t);break}case uz:{for(this.activeRequestCount>0?this.activeRequestCount--:M.fail("TIAdapter:: Received too many responses");!this.requestQueue.isEmpty();){let a=this.requestQueue.dequeue();if(this.requestMap.get(a.projectName)===a){this.requestMap.delete(a.projectName),this.scheduleRequest(a);break}this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Skipping defunct request for: ${a.projectName}`)}this.projectService.updateTypingsForProject(t),this.event(t,"setTypings");break}case _F:this.projectService.watchTypingLocations(t);break;default:}}scheduleRequest(t){this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling request for: ${t.projectName}`),this.activeRequestCount++,this.host.setTimeout(()=>{this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Sending request:${qT(t)}`),this.installer.send(t)},nUe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};YBe.requestDelayMillis=100;var QBe=YBe,ZBe={};L(ZBe,{ActionInvalidate:()=>pz,ActionPackageInstalled:()=>fz,ActionSet:()=>uz,ActionWatchTypingLocations:()=>_F,Arguments:()=>VJ,AutoImportProviderProject:()=>nSe,AuxiliaryProject:()=>eSe,CharRangeSection:()=>CSe,CloseFileWatcherEvent:()=>rY,CommandNames:()=>WBe,ConfigFileDiagEvent:()=>Q$,ConfiguredProject:()=>rSe,ConfiguredProjectLoadKind:()=>cSe,CreateDirectoryWatcherEvent:()=>nY,CreateFileWatcherEvent:()=>tY,Errors:()=>Yy,EventBeginInstallTypes:()=>zJ,EventEndInstallTypes:()=>GJ,EventInitializationFailed:()=>Gme,EventTypesRegistry:()=>BJ,ExternalProject:()=>K$,GcTimer:()=>Vbe,InferredProject:()=>Zbe,LargeFileReferencedEvent:()=>Y$,LineIndex:()=>bW,LineLeaf:()=>qG,LineNode:()=>mN,LogLevel:()=>Lbe,Msg:()=>kbe,OpenFileInfoTelemetryEvent:()=>iSe,Project:()=>TI,ProjectInfoTelemetryEvent:()=>eY,ProjectKind:()=>ZL,ProjectLanguageServiceStateEvent:()=>Z$,ProjectLoadingFinishEvent:()=>$$,ProjectLoadingStartEvent:()=>X$,ProjectService:()=>ySe,ProjectsUpdatedInBackgroundEvent:()=>HG,ScriptInfo:()=>Kbe,ScriptVersionCache:()=>_Y,Session:()=>KBe,TextStorage:()=>Hbe,ThrottledOperations:()=>Gbe,TypingsInstallerAdapter:()=>QBe,allFilesAreJsOrDts:()=>$be,allRootFilesAreJsOrDts:()=>Xbe,asNormalizedPath:()=>dBe,convertCompilerOptions:()=>KG,convertFormatOptions:()=>uN,convertScriptKindName:()=>oY,convertTypeAcquisition:()=>aSe,convertUserPreferences:()=>sSe,convertWatchOptions:()=>yW,countEachFileTypes:()=>mW,createInstallTypingsRequest:()=>wbe,createModuleSpecifierCache:()=>SSe,createNormalizedPathMap:()=>uBe,createPackageJsonCache:()=>TSe,createSortedArray:()=>zbe,emptyArray:()=>ad,findArgument:()=>uLe,formatDiagnosticToProtocol:()=>vW,formatMessage:()=>ESe,getBaseConfigFileName:()=>H$,getDetailWatchInfo:()=>cY,getLocationInNewDocument:()=>ISe,hasArgument:()=>dLe,hasNoTypeScriptSource:()=>Ybe,indent:()=>xL,isBackgroundProject:()=>hW,isConfigFile:()=>vSe,isConfiguredProject:()=>Qv,isDynamicFileName:()=>QL,isExternalProject:()=>_W,isInferredProject:()=>dN,isInferredProjectName:()=>Obe,isProjectDeferredClose:()=>gW,makeAutoImportProviderProjectName:()=>Wbe,makeAuxiliaryProjectName:()=>Bbe,makeInferredProjectName:()=>Fbe,maxFileSize:()=>q$,maxProgramSizeForNonTsFiles:()=>J$,normalizedPathToPath:()=>cN,nowString:()=>pLe,nullCancellationToken:()=>wBe,nullTypingsInstaller:()=>JG,protocol:()=>jbe,scriptInfoIsContainedByBackgroundProject:()=>Jbe,scriptInfoIsContainedByDeferredClosedProject:()=>qbe,stringifyIndented:()=>qT,toEvent:()=>xSe,toNormalizedPath:()=>ws,tryConvertScriptKindName:()=>iY,typingsInstaller:()=>Mbe,updateProjectIfDirty:()=>Zm}),typeof console<"u"&&(M.loggingHost={log(e,t){switch(e){case 1:return console.error(t);case 2:return console.warn(t);case 3:return console.log(t);case 4:return console.log(t)}}})})({get exports(){return Xje},set exports(h){Xje=h,typeof DZ<"u"&&DZ.exports&&(DZ.exports=h)}})});var oUe=Om(Jk=>{"use strict";Object.defineProperty(Jk,"__esModule",{value:!0});Jk.range=Jk.balanced=void 0;var KCt=(h,o,u)=>{let b=h instanceof RegExp?iUe(h,u):h,x=o instanceof RegExp?iUe(o,u):o,L=b!==null&&x!=null&&(0,Jk.range)(b,x,u);return L&&{start:L[0],end:L[1],pre:u.slice(0,L[0]),body:u.slice(L[0]+b.length,L[1]),post:u.slice(L[1]+x.length)}};Jk.balanced=KCt;var iUe=(h,o)=>{let u=o.match(h);return u?u[0]:null},JCt=(h,o,u)=>{let b,x,L,j,me,Oe=u.indexOf(h),tt=u.indexOf(o,Oe+1),at=Oe;if(Oe>=0&&tt>0){if(h===o)return[Oe,tt];for(b=[],L=u.length;at>=0&&!me;){if(at===Oe)b.push(at),Oe=u.indexOf(h,at+1);else if(b.length===1){let dt=b.pop();dt!==void 0&&(me=[dt,tt])}else x=b.pop(),x!==void 0&&x<L&&(L=x,j=tt),tt=u.indexOf(o,at+1);at=Oe<tt&&Oe>=0?Oe:tt}b.length&&j!==void 0&&(me=[L,j])}return me};Jk.range=JCt});var pUe=Om(D8=>{"use strict";Object.defineProperty(D8,"__esModule",{value:!0});D8.EXPANSION_MAX=void 0;D8.expand=aPt;var aUe=oUe(),sUe="\0SLASH"+Math.random()+"\0",lUe="\0OPEN"+Math.random()+"\0",Axe="\0CLOSE"+Math.random()+"\0",cUe="\0COMMA"+Math.random()+"\0",dUe="\0PERIOD"+Math.random()+"\0",qCt=new RegExp(sUe,"g"),XCt=new RegExp(lUe,"g"),$Ct=new RegExp(Axe,"g"),YCt=new RegExp(cUe,"g"),QCt=new RegExp(dUe,"g"),ZCt=/\\\\/g,ePt=/\\{/g,tPt=/\\}/g,nPt=/\\,/g,rPt=/\\\./g;D8.EXPANSION_MAX=1e5;function xxe(h){return isNaN(h)?h.charCodeAt(0):parseInt(h,10)}function iPt(h){return h.replace(ZCt,sUe).replace(ePt,lUe).replace(tPt,Axe).replace(nPt,cUe).replace(rPt,dUe)}function oPt(h){return h.replace(qCt,"\\").replace(XCt,"{").replace($Ct,"}").replace(YCt,",").replace(QCt,".")}function uUe(h){if(!h)return[""];let o=[],u=(0,aUe.balanced)("{","}",h);if(!u)return h.split(",");let{pre:b,body:x,post:L}=u,j=b.split(",");j[j.length-1]+="{"+x+"}";let me=uUe(L);return L.length&&(j[j.length-1]+=me.shift(),j.push.apply(j,me)),o.push.apply(o,j),o}function aPt(h,o={}){if(!h)return[];let{max:u=D8.EXPANSION_MAX}=o;return h.slice(0,2)==="{}"&&(h="\\{\\}"+h.slice(2)),x5(iPt(h),u,!0).map(oPt)}function sPt(h){return"{"+h+"}"}function lPt(h){return/^-?0\d/.test(h)}function cPt(h,o){return h<=o}function dPt(h,o){return h>=o}function x5(h,o,u){let b=[],x=(0,aUe.balanced)("{","}",h);if(!x)return[h];let L=x.pre,j=x.post.length?x5(x.post,o,!1):[""];if(/\$$/.test(x.pre))for(let me=0;me<j.length&&me<o;me++){let Oe=L+"{"+x.body+"}"+j[me];b.push(Oe)}else{let me=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(x.body),Oe=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(x.body),tt=me||Oe,at=x.body.indexOf(",")>=0;if(!tt&&!at)return x.post.match(/,(?!,).*\}/)?(h=x.pre+"{"+x.body+Axe+x.post,x5(h,o,!0)):[h];let dt;if(tt)dt=x.body.split(/\.\./);else if(dt=uUe(x.body),dt.length===1&&dt[0]!==void 0&&(dt=x5(dt[0],o,!1).map(sPt),dt.length===1))return j.map(yn=>x.pre+dt[0]+yn);let xe;if(tt&&dt[0]!==void 0&&dt[1]!==void 0){let yn=xxe(dt[0]),pt=xxe(dt[1]),ut=Math.max(dt[0].length,dt[1].length),yi=dt.length===3&&dt[2]!==void 0?Math.max(Math.abs(xxe(dt[2])),1):1,wi=cPt;pt<yn&&(yi*=-1,wi=dPt);let qa=dt.some(lPt);xe=[];for(let yl=yn;wi(yl,pt)&&xe.length<o;yl+=yi){let Sa;if(Oe)Sa=String.fromCharCode(yl),Sa==="\\"&&(Sa="");else if(Sa=String(yl),qa){let Lr=ut-Sa.length;if(Lr>0){let In=new Array(Lr+1).join("0");yl<0?Sa="-"+In+Sa.slice(1):Sa=In+Sa}}xe.push(Sa)}}else{xe=[];for(let yn=0;yn<dt.length;yn++)xe.push.apply(xe,x5(dt[yn],o,!1))}for(let yn=0;yn<xe.length;yn++)for(let pt=0;pt<j.length&&b.length<o;pt++){let ut=L+xe[yn]+j[pt];(!u||tt||ut)&&b.push(ut)}}return b}});var fUe=Om(IZ=>{"use strict";Object.defineProperty(IZ,"__esModule",{value:!0});IZ.assertValidPattern=void 0;var uPt=1024*64,pPt=h=>{if(typeof h!="string")throw new TypeError("invalid pattern");if(h.length>uPt)throw new TypeError("pattern is too long")};IZ.assertValidPattern=pPt});var _Ue=Om(CZ=>{"use strict";Object.defineProperty(CZ,"__esModule",{value:!0});CZ.parseClass=void 0;var fPt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},A5=h=>h.replace(/[[\]\\-]/g,"\\$&"),mPt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),mUe=h=>h.join(""),_Pt=(h,o)=>{let u=o;if(h.charAt(u)!=="[")throw new Error("not in a brace expression");let b=[],x=[],L=u+1,j=!1,me=!1,Oe=!1,tt=!1,at=u,dt="";e:for(;L<h.length;){let ut=h.charAt(L);if((ut==="!"||ut==="^")&&L===u+1){tt=!0,L++;continue}if(ut==="]"&&j&&!Oe){at=L+1;break}if(j=!0,ut==="\\"&&!Oe){Oe=!0,L++;continue}if(ut==="["&&!Oe){for(let[yi,[wi,eo,qa]]of Object.entries(fPt))if(h.startsWith(yi,L)){if(dt)return["$.",!1,h.length-u,!0];L+=yi.length,qa?x.push(wi):b.push(wi),me=me||eo;continue e}}if(Oe=!1,dt){ut>dt?b.push(A5(dt)+"-"+A5(ut)):ut===dt&&b.push(A5(ut)),dt="",L++;continue}if(h.startsWith("-]",L+1)){b.push(A5(ut+"-")),L+=2;continue}if(h.startsWith("-",L+1)){dt=ut,L+=2;continue}b.push(A5(ut)),L++}if(at<L)return["",!1,0,!1];if(!b.length&&!x.length)return["$.",!1,h.length-u,!0];if(x.length===0&&b.length===1&&/^\\?.$/.test(b[0])&&!tt){let ut=b[0].length===2?b[0].slice(-1):b[0];return[mPt(ut),!1,at-u,!1]}let xe="["+(tt?"^":"")+mUe(b)+"]",yn="["+(tt?"":"^")+mUe(x)+"]";return[b.length&&x.length?"("+xe+"|"+yn+")":b.length?xe:yn,me,at-u,!0]};CZ.parseClass=_Pt});var NZ=Om(PZ=>{"use strict";Object.defineProperty(PZ,"__esModule",{value:!0});PZ.unescape=void 0;var hPt=(h,{windowsPathsNoEscape:o=!1,magicalBraces:u=!0}={})=>u?o?h.replace(/\[([^\/\\])\]/g,"$1"):h.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):o?h.replace(/\[([^\/\\{}])\]/g,"$1"):h.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");PZ.unescape=hPt});var Cxe=Om(kZ=>{"use strict";var Ib;Object.defineProperty(kZ,"__esModule",{value:!0});kZ.AST=void 0;var gPt=_Ue(),RZ=NZ(),yPt=new Set(["!","?","+","*","@"]),Dxe=h=>yPt.has(h),hUe=h=>Dxe(h.type),vPt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),bPt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),SPt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),gUe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),TPt="(?!(?:^|/)\\.\\.?(?:$|/))",MZ="(?!\\.)",EPt=new Set(["[","."]),xPt=new Set(["..","."]),APt=new Set("().*{}+?[]^$\\!"),DPt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ixe="[^/]",yUe=Ixe+"*?",vUe=Ixe+"+?",IPt=0,LZ=class{type;#e;#t;#n=!1;#r=[];#i;#o;#a;#s=!1;#c;#m;#_=!1;id=++IPt;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#e.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#r.length,parts:this.#r}}constructor(o,u,b={}){this.type=o,o&&(this.#t=!0),this.#i=u,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?b:this.#e.#c,this.#a=this.#e===this?[]:this.#e.#a,o==="!"&&!this.#e.#s&&this.#a.push(this),this.#o=this.#i?this.#i.#r.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let o of this.#r)if(typeof o!="string"&&(o.type||o.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#m!==void 0?this.#m:this.type?this.#m=this.type+"("+this.#r.map(o=>String(o)).join("|")+")":this.#m=this.#r.map(o=>String(o)).join("")}#E(){if(this!==this.#e)throw new Error("should only call on root");if(this.#s)return this;this.toString(),this.#s=!0;let o;for(;o=this.#a.pop();){if(o.type!=="!")continue;let u=o,b=u.#i;for(;b;){for(let x=u.#o+1;!b.type&&x<b.#r.length;x++)for(let L of o.#r){if(typeof L=="string")throw new Error("string part in extglob AST??");L.copyIn(b.#r[x])}u=b,b=u.#i}}return this}push(...o){for(let u of o)if(u!==""){if(typeof u!="string"&&!(u instanceof Ib&&u.#i===this))throw new Error("invalid part: "+u);this.#r.push(u)}}toJSON(){let o=this.type===null?this.#r.slice().map(u=>typeof u=="string"?u:u.toJSON()):[this.type,...this.#r.map(u=>u.toJSON())];return this.isStart()&&!this.type&&o.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#s&&this.#i?.type==="!")&&o.push({}),o}isStart(){if(this.#e===this)return!0;if(!this.#i?.isStart())return!1;if(this.#o===0)return!0;let o=this.#i;for(let u=0;u<this.#o;u++){let b=o.#r[u];if(!(b instanceof Ib&&b.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let o=this.#i?this.#i.#r.length:0;return this.#o===o-1}copyIn(o){typeof o=="string"?this.push(o):this.push(o.clone(this))}clone(o){let u=new Ib(this.type,o);for(let b of this.#r)u.copyIn(b);return u}static#S(o,u,b,x,L){let j=x.maxExtglobRecursion??2,me=!1,Oe=!1,tt=-1,at=!1;if(u.type===null){let ut=b,yi="";for(;ut<o.length;){let wi=o.charAt(ut++);if(me||wi==="\\"){me=!me,yi+=wi;continue}if(Oe){ut===tt+1?(wi==="^"||wi==="!")&&(at=!0):wi==="]"&&!(ut===tt+2&&at)&&(Oe=!1),yi+=wi;continue}else if(wi==="["){Oe=!0,tt=ut,at=!1,yi+=wi;continue}if(!x.noext&&Dxe(wi)&&o.charAt(ut)==="("&&L<=j){u.push(yi),yi="";let qa=new Ib(wi,u);ut=Ib.#S(o,qa,ut,x,L+1),u.push(qa);continue}yi+=wi}return u.push(yi),ut}let dt=b+1,xe=new Ib(null,u),yn=[],pt="";for(;dt<o.length;){let ut=o.charAt(dt++);if(me||ut==="\\"){me=!me,pt+=ut;continue}if(Oe){dt===tt+1?(ut==="^"||ut==="!")&&(at=!0):ut==="]"&&!(dt===tt+2&&at)&&(Oe=!1),pt+=ut;continue}else if(ut==="["){Oe=!0,tt=dt,at=!1,pt+=ut;continue}if(!x.noext&&Dxe(ut)&&o.charAt(dt)==="("&&(L<=j||u&&u.#u(ut))){let wi=u&&u.#u(ut)?0:1;xe.push(pt),pt="";let eo=new Ib(ut,xe);xe.push(eo),dt=Ib.#S(o,eo,dt,x,L+wi);continue}if(ut==="|"){xe.push(pt),pt="",yn.push(xe),xe=new Ib(null,u);continue}if(ut===")")return pt===""&&u.#r.length===0&&(u.#_=!0),xe.push(pt),pt="",u.push(...yn,xe),dt;pt+=ut}return u.type=null,u.#t=void 0,u.#r=[o.substring(b-1)],dt}#g(o){return this.#y(o,bPt)}#y(o,u=vPt){if(!o||typeof o!="object"||o.type!==null||o.#r.length!==1||this.type===null)return!1;let b=o.#r[0];return!b||typeof b!="object"||b.type===null?!1:this.#u(b.type,u)}#u(o,u=SPt){return!!u.get(this.type)?.includes(o)}#p(o,u){let b=o.#r[0],x=new Ib(null,b,this.options);x.#r.push(""),b.push(x),this.#h(o,u)}#h(o,u){let b=o.#r[0];this.#r.splice(u,1,...b.#r);for(let x of b.#r)typeof x=="object"&&(x.#i=this);this.#m=void 0}#T(o){return!!gUe.get(this.type)?.has(o)}#f(o){if(!o||typeof o!="object"||o.type!==null||o.#r.length!==1||this.type===null||this.#r.length!==1)return!1;let u=o.#r[0];return!u||typeof u!="object"||u.type===null?!1:this.#T(u.type)}#v(o){let u=gUe.get(this.type),b=o.#r[0],x=u?.get(b.type);if(!x)return!1;this.#r=b.#r;for(let L of this.#r)typeof L=="object"&&(L.#i=this);this.type=x,this.#m=void 0,this.#_=!1}static fromGlob(o,u={}){let b=new Ib(null,void 0,u);return Ib.#S(o,b,0,u,0),b}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let o=this.toString(),[u,b,x,L]=this.toRegExpSource();if(!(x||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&o.toUpperCase()!==o.toLowerCase()))return b;let me=(this.#c.nocase?"i":"")+(L?"u":"");return Object.assign(new RegExp(`^${u}$`,me),{_src:u,_glob:o})}get options(){return this.#c}toRegExpSource(o){let u=o??!!this.#c.dot;if(this.#e===this&&(this.#l(),this.#E()),!hUe(this)){let Oe=this.isStart()&&this.isEnd()&&!this.#r.some(yn=>typeof yn!="string"),tt=this.#r.map(yn=>{let[pt,ut,yi,wi]=typeof yn=="string"?Ib.#x(yn,this.#t,Oe):yn.toRegExpSource(o);return this.#t=this.#t||yi,this.#n=this.#n||wi,pt}).join(""),at="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&xPt.has(this.#r[0]))){let pt=EPt,ut=u&&pt.has(tt.charAt(0))||tt.startsWith("\\.")&&pt.has(tt.charAt(2))||tt.startsWith("\\.\\.")&&pt.has(tt.charAt(4)),yi=!u&&!o&&pt.has(tt.charAt(0));at=ut?TPt:yi?MZ:""}let dt="";return this.isEnd()&&this.#e.#s&&this.#i?.type==="!"&&(dt="(?:$|\\/)"),[at+tt+dt,(0,RZ.unescape)(tt),this.#t=!!this.#t,this.#n]}let b=this.type==="*"||this.type==="+",x=this.type==="!"?"(?:(?!(?:":"(?:",L=this.#d(u);if(this.isStart()&&this.isEnd()&&!L&&this.type!=="!"){let Oe=this.toString(),tt=this;return tt.#r=[Oe],tt.type=null,tt.#t=void 0,[Oe,(0,RZ.unescape)(this.toString()),!1,!1]}let j=!b||o||u||!MZ?"":this.#d(!0);j===L&&(j=""),j&&(L=`(?:${L})(?:${j})*?`);let me="";if(this.type==="!"&&this.#_)me=(this.isStart()&&!u?MZ:"")+vUe;else{let Oe=this.type==="!"?"))"+(this.isStart()&&!u&&!o?MZ:"")+yUe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&j?")":this.type==="*"&&j?")?":`)${this.type}`;me=x+L+Oe}return[me,(0,RZ.unescape)(L),this.#t=!!this.#t,this.#n]}#l(){if(hUe(this)){let o=0,u=!1;do{u=!0;for(let b=0;b<this.#r.length;b++){let x=this.#r[b];typeof x=="object"&&(x.#l(),this.#y(x)?(u=!1,this.#h(x,b)):this.#g(x)?(u=!1,this.#p(x,b)):this.#f(x)&&(u=!1,this.#v(x)))}}while(!u&&++o<10)}else for(let o of this.#r)typeof o=="object"&&o.#l();this.#m=void 0}#d(o){return this.#r.map(u=>{if(typeof u=="string")throw new Error("string type in extglob ast??");let[b,x,L,j]=u.toRegExpSource(o);return this.#n=this.#n||j,b}).filter(u=>!(this.isStart()&&this.isEnd())||!!u).join("|")}static#x(o,u,b=!1){let x=!1,L="",j=!1,me=!1;for(let Oe=0;Oe<o.length;Oe++){let tt=o.charAt(Oe);if(x){x=!1,L+=(APt.has(tt)?"\\":"")+tt;continue}if(tt==="*"){if(me)continue;me=!0,L+=b&&/^[*]+$/.test(o)?vUe:yUe,u=!0;continue}else me=!1;if(tt==="\\"){Oe===o.length-1?L+="\\\\":x=!0;continue}if(tt==="["){let[at,dt,xe,yn]=(0,gPt.parseClass)(o,Oe);if(xe){L+=at,j=j||dt,Oe+=xe-1,u=u||yn;continue}}if(tt==="?"){L+=Ixe,u=!0;continue}L+=DPt(tt)}return[L,(0,RZ.unescape)(o),!!u,j]}};kZ.AST=LZ;Ib=LZ});var Pxe=Om(wZ=>{"use strict";Object.defineProperty(wZ,"__esModule",{value:!0});wZ.escape=void 0;var CPt=(h,{windowsPathsNoEscape:o=!1,magicalBraces:u=!1}={})=>u?o?h.replace(/[?*()[\]{}]/g,"[$&]"):h.replace(/[?*()[\]\\{}]/g,"\\$&"):o?h.replace(/[?*()[\]]/g,"[$&]"):h.replace(/[?*()[\]\\]/g,"\\$&");wZ.escape=CPt});var DUe=Om(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.unescape=ms.escape=ms.AST=ms.Minimatch=ms.match=ms.makeRe=ms.braceExpand=ms.defaults=ms.filter=ms.GLOBSTAR=ms.sep=ms.minimatch=void 0;var PPt=pUe(),OZ=fUe(),TUe=Cxe(),NPt=Pxe(),RPt=NZ(),MPt=(h,o,u={})=>((0,OZ.assertValidPattern)(o),!u.nocomment&&o.charAt(0)==="#"?!1:new qk(o,u).match(h));ms.minimatch=MPt;var LPt=/^\*+([^+@!?\*\[\(]*)$/,kPt=h=>o=>!o.startsWith(".")&&o.endsWith(h),wPt=h=>o=>o.endsWith(h),OPt=h=>(h=h.toLowerCase(),o=>!o.startsWith(".")&&o.toLowerCase().endsWith(h)),FPt=h=>(h=h.toLowerCase(),o=>o.toLowerCase().endsWith(h)),WPt=/^\*+\.\*+$/,BPt=h=>!h.startsWith(".")&&h.includes("."),zPt=h=>h!=="."&&h!==".."&&h.includes("."),GPt=/^\.\*+$/,VPt=h=>h!=="."&&h!==".."&&h.startsWith("."),jPt=/^\*+$/,UPt=h=>h.length!==0&&!h.startsWith("."),HPt=h=>h.length!==0&&h!=="."&&h!=="..",KPt=/^\?+([^+@!?\*\[\(]*)?$/,JPt=([h,o=""])=>{let u=EUe([h]);return o?(o=o.toLowerCase(),b=>u(b)&&b.toLowerCase().endsWith(o)):u},qPt=([h,o=""])=>{let u=xUe([h]);return o?(o=o.toLowerCase(),b=>u(b)&&b.toLowerCase().endsWith(o)):u},XPt=([h,o=""])=>{let u=xUe([h]);return o?b=>u(b)&&b.endsWith(o):u},$Pt=([h,o=""])=>{let u=EUe([h]);return o?b=>u(b)&&b.endsWith(o):u},EUe=([h])=>{let o=h.length;return u=>u.length===o&&!u.startsWith(".")},xUe=([h])=>{let o=h.length;return u=>u.length===o&&u!=="."&&u!==".."},AUe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",bUe={win32:{sep:"\\"},posix:{sep:"/"}};ms.sep=AUe==="win32"?bUe.win32.sep:bUe.posix.sep;ms.minimatch.sep=ms.sep;ms.GLOBSTAR=Symbol("globstar **");ms.minimatch.GLOBSTAR=ms.GLOBSTAR;var YPt="[^/]",QPt=YPt+"*?",ZPt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",eNt="(?:(?!(?:\\/|^)\\.).)*?",tNt=(h,o={})=>u=>(0,ms.minimatch)(u,h,o);ms.filter=tNt;ms.minimatch.filter=ms.filter;var UE=(h,o={})=>Object.assign({},h,o),nNt=h=>{if(!h||typeof h!="object"||!Object.keys(h).length)return ms.minimatch;let o=ms.minimatch;return Object.assign((b,x,L={})=>o(b,x,UE(h,L)),{Minimatch:class extends o.Minimatch{constructor(x,L={}){super(x,UE(h,L))}static defaults(x){return o.defaults(UE(h,x)).Minimatch}},AST:class extends o.AST{constructor(x,L,j={}){super(x,L,UE(h,j))}static fromGlob(x,L={}){return o.AST.fromGlob(x,UE(h,L))}},unescape:(b,x={})=>o.unescape(b,UE(h,x)),escape:(b,x={})=>o.escape(b,UE(h,x)),filter:(b,x={})=>o.filter(b,UE(h,x)),defaults:b=>o.defaults(UE(h,b)),makeRe:(b,x={})=>o.makeRe(b,UE(h,x)),braceExpand:(b,x={})=>o.braceExpand(b,UE(h,x)),match:(b,x,L={})=>o.match(b,x,UE(h,L)),sep:o.sep,GLOBSTAR:ms.GLOBSTAR})};ms.defaults=nNt;ms.minimatch.defaults=ms.defaults;var rNt=(h,o={})=>((0,OZ.assertValidPattern)(h),o.nobrace||!/\{(?:(?!\{).)*\}/.test(h)?[h]:(0,PPt.expand)(h,{max:o.braceExpandMax}));ms.braceExpand=rNt;ms.minimatch.braceExpand=ms.braceExpand;var iNt=(h,o={})=>new qk(h,o).makeRe();ms.makeRe=iNt;ms.minimatch.makeRe=ms.makeRe;var oNt=(h,o,u={})=>{let b=new qk(o,u);return h=h.filter(x=>b.match(x)),b.options.nonull&&!h.length&&h.push(o),h};ms.match=oNt;ms.minimatch.match=ms.match;var SUe=/[?*]|[+@!]\(.*?\)|\[|\]/,aNt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),qk=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(o,u={}){(0,OZ.assertValidPattern)(o),u=u||{},this.options=u,this.maxGlobstarRecursion=u.maxGlobstarRecursion??200,this.pattern=o,this.platform=u.platform||AUe,this.isWindows=this.platform==="win32";let b="allowWindowsEscape";this.windowsPathsNoEscape=!!u.windowsPathsNoEscape||u[b]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!u.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!u.nonegate,this.comment=!1,this.empty=!1,this.partial=!!u.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=u.windowsNoMagicRoot!==void 0?u.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let o of this.set)for(let u of o)if(typeof u!="string")return!0;return!1}debug(...o){}make(){let o=this.pattern,u=this.options;if(!u.nocomment&&o.charAt(0)==="#"){this.comment=!0;return}if(!o){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],u.debug&&(this.debug=(...L)=>console.error(...L)),this.debug(this.pattern,this.globSet);let b=this.globSet.map(L=>this.slashSplit(L));this.globParts=this.preprocess(b),this.debug(this.pattern,this.globParts);let x=this.globParts.map((L,j,me)=>{if(this.isWindows&&this.windowsNoMagicRoot){let Oe=L[0]===""&&L[1]===""&&(L[2]==="?"||!SUe.test(L[2]))&&!SUe.test(L[3]),tt=/^[a-z]:/i.test(L[0]);if(Oe)return[...L.slice(0,4),...L.slice(4).map(at=>this.parse(at))];if(tt)return[L[0],...L.slice(1).map(at=>this.parse(at))]}return L.map(Oe=>this.parse(Oe))});if(this.debug(this.pattern,x),this.set=x.filter(L=>L.indexOf(!1)===-1),this.isWindows)for(let L=0;L<this.set.length;L++){let j=this.set[L];j[0]===""&&j[1]===""&&this.globParts[L][2]==="?"&&typeof j[3]=="string"&&/^[a-z]:$/i.test(j[3])&&(j[2]="?")}this.debug(this.pattern,this.set)}preprocess(o){if(this.options.noglobstar)for(let b=0;b<o.length;b++)for(let x=0;x<o[b].length;x++)o[b][x]==="**"&&(o[b][x]="*");let{optimizationLevel:u=1}=this.options;return u>=2?(o=this.firstPhasePreProcess(o),o=this.secondPhasePreProcess(o)):u>=1?o=this.levelOneOptimize(o):o=this.adjascentGlobstarOptimize(o),o}adjascentGlobstarOptimize(o){return o.map(u=>{let b=-1;for(;(b=u.indexOf("**",b+1))!==-1;){let x=b;for(;u[x+1]==="**";)x++;x!==b&&u.splice(b,x-b)}return u})}levelOneOptimize(o){return o.map(u=>(u=u.reduce((b,x)=>{let L=b[b.length-1];return x==="**"&&L==="**"?b:x===".."&&L&&L!==".."&&L!=="."&&L!=="**"?(b.pop(),b):(b.push(x),b)},[]),u.length===0?[""]:u))}levelTwoFileOptimize(o){Array.isArray(o)||(o=this.slashSplit(o));let u=!1;do{if(u=!1,!this.preserveMultipleSlashes){for(let x=1;x<o.length-1;x++){let L=o[x];x===1&&L===""&&o[0]===""||(L==="."||L==="")&&(u=!0,o.splice(x,1),x--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(u=!0,o.pop())}let b=0;for(;(b=o.indexOf("..",b+1))!==-1;){let x=o[b-1];x&&x!=="."&&x!==".."&&x!=="**"&&(u=!0,o.splice(b-1,2),b-=2)}}while(u);return o.length===0?[""]:o}firstPhasePreProcess(o){let u=!1;do{u=!1;for(let b of o){let x=-1;for(;(x=b.indexOf("**",x+1))!==-1;){let j=x;for(;b[j+1]==="**";)j++;j>x&&b.splice(x+1,j-x);let me=b[x+1],Oe=b[x+2],tt=b[x+3];if(me!==".."||!Oe||Oe==="."||Oe===".."||!tt||tt==="."||tt==="..")continue;u=!0,b.splice(x,1);let at=b.slice(0);at[x]="**",o.push(at),x--}if(!this.preserveMultipleSlashes){for(let j=1;j<b.length-1;j++){let me=b[j];j===1&&me===""&&b[0]===""||(me==="."||me==="")&&(u=!0,b.splice(j,1),j--)}b[0]==="."&&b.length===2&&(b[1]==="."||b[1]==="")&&(u=!0,b.pop())}let L=0;for(;(L=b.indexOf("..",L+1))!==-1;){let j=b[L-1];if(j&&j!=="."&&j!==".."&&j!=="**"){u=!0;let Oe=L===1&&b[L+1]==="**"?["."]:[];b.splice(L-1,2,...Oe),b.length===0&&b.push(""),L-=2}}}}while(u);return o}secondPhasePreProcess(o){for(let u=0;u<o.length-1;u++)for(let b=u+1;b<o.length;b++){let x=this.partsMatch(o[u],o[b],!this.preserveMultipleSlashes);if(x){o[u]=[],o[b]=x;break}}return o.filter(u=>u.length)}partsMatch(o,u,b=!1){let x=0,L=0,j=[],me="";for(;x<o.length&&L<u.length;)if(o[x]===u[L])j.push(me==="b"?u[L]:o[x]),x++,L++;else if(b&&o[x]==="**"&&u[L]===o[x+1])j.push(o[x]),x++;else if(b&&u[L]==="**"&&o[x]===u[L+1])j.push(u[L]),L++;else if(o[x]==="*"&&u[L]&&(this.options.dot||!u[L].startsWith("."))&&u[L]!=="**"){if(me==="b")return!1;me="a",j.push(o[x]),x++,L++}else if(u[L]==="*"&&o[x]&&(this.options.dot||!o[x].startsWith("."))&&o[x]!=="**"){if(me==="a")return!1;me="b",j.push(u[L]),x++,L++}else return!1;return o.length===u.length&&j}parseNegate(){if(this.nonegate)return;let o=this.pattern,u=!1,b=0;for(let x=0;x<o.length&&o.charAt(x)==="!";x++)u=!u,b++;b&&(this.pattern=o.slice(b)),this.negate=u}matchOne(o,u,b=!1){let x=0,L=0;if(this.isWindows){let me=typeof o[0]=="string"&&/^[a-z]:$/i.test(o[0]),Oe=!me&&o[0]===""&&o[1]===""&&o[2]==="?"&&/^[a-z]:$/i.test(o[3]),tt=typeof u[0]=="string"&&/^[a-z]:$/i.test(u[0]),at=!tt&&u[0]===""&&u[1]===""&&u[2]==="?"&&typeof u[3]=="string"&&/^[a-z]:$/i.test(u[3]),dt=Oe?3:me?0:void 0,xe=at?3:tt?0:void 0;if(typeof dt=="number"&&typeof xe=="number"){let[yn,pt]=[o[dt],u[xe]];yn.toLowerCase()===pt.toLowerCase()&&(u[xe]=yn,L=xe,x=dt)}}let{optimizationLevel:j=1}=this.options;return j>=2&&(o=this.levelTwoFileOptimize(o)),u.includes(ms.GLOBSTAR)?this.#e(o,u,b,x,L):this.#n(o,u,b,x,L)}#e(o,u,b,x,L){let j=u.indexOf(ms.GLOBSTAR,L),me=u.lastIndexOf(ms.GLOBSTAR),[Oe,tt,at]=b?[u.slice(L,j),u.slice(j+1),[]]:[u.slice(L,j),u.slice(j+1,me),u.slice(me+1)];if(Oe.length){let eo=o.slice(x,x+Oe.length);if(!this.#n(eo,Oe,b,0,0))return!1;x+=Oe.length,L+=Oe.length}let dt=0;if(at.length){if(at.length+x>o.length)return!1;let eo=o.length-at.length;if(this.#n(o,at,b,eo,0))dt=at.length;else{if(o[o.length-1]!==""||x+at.length===o.length||(eo--,!this.#n(o,at,b,eo,0)))return!1;dt=at.length+1}}if(!tt.length){let eo=!!dt;for(let qa=x;qa<o.length-dt;qa++){let yl=String(o[qa]);if(eo=!0,yl==="."||yl===".."||!this.options.dot&&yl.startsWith("."))return!1}return b||eo}let xe=[[[],0]],yn=xe[0],pt=0,ut=[0];for(let eo of tt)eo===ms.GLOBSTAR?(ut.push(pt),yn=[[],0],xe.push(yn)):(yn[0].push(eo),pt++);let yi=xe.length-1,wi=o.length-dt;for(let eo of xe)eo[1]=wi-(ut[yi--]+eo[0].length);return!!this.#t(o,xe,x,0,b,0,!!dt)}#t(o,u,b,x,L,j,me){let Oe=u[x];if(!Oe){for(let dt=b;dt<o.length;dt++){me=!0;let xe=o[dt];if(xe==="."||xe===".."||!this.options.dot&&xe.startsWith("."))return!1}return me}let[tt,at]=Oe;for(;b<=at;){if(this.#n(o.slice(0,b+tt.length),tt,L,b,0)&&j<this.maxGlobstarRecursion){let yn=this.#t(o,u,b+tt.length,x+1,L,j+1,me);if(yn!==!1)return yn}let xe=o[b];if(xe==="."||xe===".."||!this.options.dot&&xe.startsWith("."))return!1;b++}return L||null}#n(o,u,b,x,L){let j,me,Oe,tt;for(j=x,me=L,tt=o.length,Oe=u.length;j<tt&&me<Oe;j++,me++){this.debug("matchOne loop");let at=u[me],dt=o[j];if(this.debug(u,at,dt),at===!1||at===ms.GLOBSTAR)return!1;let xe;if(typeof at=="string"?(xe=dt===at,this.debug("string match",at,dt,xe)):(xe=at.test(dt),this.debug("pattern match",at,dt,xe)),!xe)return!1}if(j===tt&&me===Oe)return!0;if(j===tt)return b;if(me===Oe)return j===tt-1&&o[j]==="";throw new Error("wtf?")}braceExpand(){return(0,ms.braceExpand)(this.pattern,this.options)}parse(o){(0,OZ.assertValidPattern)(o);let u=this.options;if(o==="**")return ms.GLOBSTAR;if(o==="")return"";let b,x=null;(b=o.match(jPt))?x=u.dot?HPt:UPt:(b=o.match(LPt))?x=(u.nocase?u.dot?FPt:OPt:u.dot?wPt:kPt)(b[1]):(b=o.match(KPt))?x=(u.nocase?u.dot?qPt:JPt:u.dot?XPt:$Pt)(b):(b=o.match(WPt))?x=u.dot?zPt:BPt:(b=o.match(GPt))&&(x=VPt);let L=TUe.AST.fromGlob(o,this.options).toMMPattern();return x&&typeof L=="object"&&Reflect.defineProperty(L,"test",{value:x}),L}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let o=this.set;if(!o.length)return this.regexp=!1,this.regexp;let u=this.options,b=u.noglobstar?QPt:u.dot?ZPt:eNt,x=new Set(u.nocase?["i"]:[]),L=o.map(Oe=>{let tt=Oe.map(dt=>{if(dt instanceof RegExp)for(let xe of dt.flags.split(""))x.add(xe);return typeof dt=="string"?aNt(dt):dt===ms.GLOBSTAR?ms.GLOBSTAR:dt._src});tt.forEach((dt,xe)=>{let yn=tt[xe+1],pt=tt[xe-1];dt!==ms.GLOBSTAR||pt===ms.GLOBSTAR||(pt===void 0?yn!==void 0&&yn!==ms.GLOBSTAR?tt[xe+1]="(?:\\/|"+b+"\\/)?"+yn:tt[xe]=b:yn===void 0?tt[xe-1]=pt+"(?:\\/|\\/"+b+")?":yn!==ms.GLOBSTAR&&(tt[xe-1]=pt+"(?:\\/|\\/"+b+"\\/)"+yn,tt[xe+1]=ms.GLOBSTAR))});let at=tt.filter(dt=>dt!==ms.GLOBSTAR);if(this.partial&&at.length>=1){let dt=[];for(let xe=1;xe<=at.length;xe++)dt.push(at.slice(0,xe).join("/"));return"(?:"+dt.join("|")+")"}return at.join("/")}).join("|"),[j,me]=o.length>1?["(?:",")"]:["",""];L="^"+j+L+me+"$",this.partial&&(L="^(?:\\/|"+j+L.slice(1,-1)+me+")$"),this.negate&&(L="^(?!"+L+").+$");try{this.regexp=new RegExp(L,[...x].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(o){return this.preserveMultipleSlashes?o.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(o)?["",...o.split(/\/+/)]:o.split(/\/+/)}match(o,u=this.partial){if(this.debug("match",o,this.pattern),this.comment)return!1;if(this.empty)return o==="";if(o==="/"&&u)return!0;let b=this.options;this.isWindows&&(o=o.split("\\").join("/"));let x=this.slashSplit(o);this.debug(this.pattern,"split",x);let L=this.set;this.debug(this.pattern,"set",L);let j=x[x.length-1];if(!j)for(let me=x.length-2;!j&&me>=0;me--)j=x[me];for(let me=0;me<L.length;me++){let Oe=L[me],tt=x;if(b.matchBase&&Oe.length===1&&(tt=[j]),this.matchOne(tt,Oe,u))return b.flipNegate?!0:!this.negate}return b.flipNegate?!1:this.negate}static defaults(o){return ms.minimatch.defaults(o).Minimatch}};ms.Minimatch=qk;var sNt=Cxe();Object.defineProperty(ms,"AST",{enumerable:!0,get:function(){return sNt.AST}});var lNt=Pxe();Object.defineProperty(ms,"escape",{enumerable:!0,get:function(){return lNt.escape}});var cNt=NZ();Object.defineProperty(ms,"unescape",{enumerable:!0,get:function(){return cNt.unescape}});ms.minimatch.AST=TUe.AST;ms.minimatch.Minimatch=qk;ms.minimatch.escape=NPt.escape;ms.minimatch.unescape=RPt.unescape});var PUe=Om((oOt,CUe)=>{"use strict";function N1(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function IUe(h,o){for(var u="",b=0,x=-1,L=0,j,me=0;me<=h.length;++me){if(me<h.length)j=h.charCodeAt(me);else{if(j===47)break;j=47}if(j===47){if(!(x===me-1||L===1))if(x!==me-1&&L===2){if(u.length<2||b!==2||u.charCodeAt(u.length-1)!==46||u.charCodeAt(u.length-2)!==46){if(u.length>2){var Oe=u.lastIndexOf("/");if(Oe!==u.length-1){Oe===-1?(u="",b=0):(u=u.slice(0,Oe),b=u.length-1-u.lastIndexOf("/")),x=me,L=0;continue}}else if(u.length===2||u.length===1){u="",b=0,x=me,L=0;continue}}o&&(u.length>0?u+="/..":u="..",b=2)}else u.length>0?u+="/"+h.slice(x+1,me):u=h.slice(x+1,me),b=me-x-1;x=me,L=0}else j===46&&L!==-1?++L:L=-1}return u}function dNt(h,o){var u=o.dir||o.root,b=o.base||(o.name||"")+(o.ext||"");return u?u===o.root?u+b:u+h+b:b}var I8={resolve:function(){for(var o="",u=!1,b,x=arguments.length-1;x>=-1&&!u;x--){var L;x>=0?L=arguments[x]:(b===void 0&&(b=process.cwd()),L=b),N1(L),L.length!==0&&(o=L+"/"+o,u=L.charCodeAt(0)===47)}return o=IUe(o,!u),u?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(N1(o),o.length===0)return".";var u=o.charCodeAt(0)===47,b=o.charCodeAt(o.length-1)===47;return o=IUe(o,!u),o.length===0&&!u&&(o="."),o.length>0&&b&&(o+="/"),u?"/"+o:o},isAbsolute:function(o){return N1(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,u=0;u<arguments.length;++u){var b=arguments[u];N1(b),b.length>0&&(o===void 0?o=b:o+="/"+b)}return o===void 0?".":I8.normalize(o)},relative:function(o,u){if(N1(o),N1(u),o===u||(o=I8.resolve(o),u=I8.resolve(u),o===u))return"";for(var b=1;b<o.length&&o.charCodeAt(b)===47;++b);for(var x=o.length,L=x-b,j=1;j<u.length&&u.charCodeAt(j)===47;++j);for(var me=u.length,Oe=me-j,tt=L<Oe?L:Oe,at=-1,dt=0;dt<=tt;++dt){if(dt===tt){if(Oe>tt){if(u.charCodeAt(j+dt)===47)return u.slice(j+dt+1);if(dt===0)return u.slice(j+dt)}else L>tt&&(o.charCodeAt(b+dt)===47?at=dt:dt===0&&(at=0));break}var xe=o.charCodeAt(b+dt),yn=u.charCodeAt(j+dt);if(xe!==yn)break;xe===47&&(at=dt)}var pt="";for(dt=b+at+1;dt<=x;++dt)(dt===x||o.charCodeAt(dt)===47)&&(pt.length===0?pt+="..":pt+="/..");return pt.length>0?pt+u.slice(j+at):(j+=at,u.charCodeAt(j)===47&&++j,u.slice(j))},_makeLong:function(o){return o},dirname:function(o){if(N1(o),o.length===0)return".";for(var u=o.charCodeAt(0),b=u===47,x=-1,L=!0,j=o.length-1;j>=1;--j)if(u=o.charCodeAt(j),u===47){if(!L){x=j;break}}else L=!1;return x===-1?b?"/":".":b&&x===1?"//":o.slice(0,x)},basename:function(o,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');N1(o);var b=0,x=-1,L=!0,j;if(u!==void 0&&u.length>0&&u.length<=o.length){if(u.length===o.length&&u===o)return"";var me=u.length-1,Oe=-1;for(j=o.length-1;j>=0;--j){var tt=o.charCodeAt(j);if(tt===47){if(!L){b=j+1;break}}else Oe===-1&&(L=!1,Oe=j+1),me>=0&&(tt===u.charCodeAt(me)?--me===-1&&(x=j):(me=-1,x=Oe))}return b===x?x=Oe:x===-1&&(x=o.length),o.slice(b,x)}else{for(j=o.length-1;j>=0;--j)if(o.charCodeAt(j)===47){if(!L){b=j+1;break}}else x===-1&&(L=!1,x=j+1);return x===-1?"":o.slice(b,x)}},extname:function(o){N1(o);for(var u=-1,b=0,x=-1,L=!0,j=0,me=o.length-1;me>=0;--me){var Oe=o.charCodeAt(me);if(Oe===47){if(!L){b=me+1;break}continue}x===-1&&(L=!1,x=me+1),Oe===46?u===-1?u=me:j!==1&&(j=1):u!==-1&&(j=-1)}return u===-1||x===-1||j===0||j===1&&u===x-1&&u===b+1?"":o.slice(u,x)},format:function(o){if(o===null||typeof o!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof o);return dNt("/",o)},parse:function(o){N1(o);var u={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return u;var b=o.charCodeAt(0),x=b===47,L;x?(u.root="/",L=1):L=0;for(var j=-1,me=0,Oe=-1,tt=!0,at=o.length-1,dt=0;at>=L;--at){if(b=o.charCodeAt(at),b===47){if(!tt){me=at+1;break}continue}Oe===-1&&(tt=!1,Oe=at+1),b===46?j===-1?j=at:dt!==1&&(dt=1):j!==-1&&(dt=-1)}return j===-1||Oe===-1||dt===0||dt===1&&j===Oe-1&&j===me+1?Oe!==-1&&(me===0&&x?u.base=u.name=o.slice(1,Oe):u.base=u.name=o.slice(me,Oe)):(me===0&&x?(u.name=o.slice(1,j),u.base=o.slice(1,Oe)):(u.name=o.slice(me,j),u.base=o.slice(me,Oe)),u.ext=o.slice(j,Oe)),me>0?u.dir=o.slice(0,me-1):x&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};I8.posix=I8;CUe.exports=I8});var D5=Om((aOt,kUe)=>{"use strict";var NUe="[^\\\\/]",uNt="(?=.)",RUe="[^/]",Nxe="(?:\\/|$)",MUe="(?:^|\\/)",Rxe=`\\.{1,2}${Nxe}`,pNt="(?!\\.)",fNt=`(?!${MUe}${Rxe})`,mNt=`(?!\\.{0,1}${Nxe})`,_Nt=`(?!${Rxe})`,hNt="[^.\\/]",gNt=`${RUe}*?`,yNt="/",LUe={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:uNt,QMARK:RUe,END_ANCHOR:Nxe,DOTS_SLASH:Rxe,NO_DOT:pNt,NO_DOTS:fNt,NO_DOT_SLASH:mNt,NO_DOTS_SLASH:_Nt,QMARK_NO_DOT:hNt,STAR:gNt,START_ANCHOR:MUe,SEP:yNt},vNt={...LUe,SLASH_LITERAL:"[\\\\/]",QMARK:NUe,STAR:`${NUe}*?`,DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},bNt={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};kUe.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:bNt,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(h){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${h.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(h){return h===!0?vNt:LUe}}});var I5=Om(Cb=>{"use strict";var{REGEX_BACKSLASH:SNt,REGEX_REMOVE_BACKSLASH:TNt,REGEX_SPECIAL_CHARS:ENt,REGEX_SPECIAL_CHARS_GLOBAL:xNt}=D5();Cb.isObject=h=>h!==null&&typeof h=="object"&&!Array.isArray(h);Cb.hasRegexChars=h=>ENt.test(h);Cb.isRegexChar=h=>h.length===1&&Cb.hasRegexChars(h);Cb.escapeRegex=h=>h.replace(xNt,"\\$1");Cb.toPosixSlashes=h=>h.replace(SNt,"/");Cb.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let h=navigator.platform.toLowerCase();return h==="win32"||h==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};Cb.removeBackslashes=h=>h.replace(TNt,o=>o==="\\"?"":o);Cb.escapeLast=(h,o,u)=>{let b=h.lastIndexOf(o,u);return b===-1?h:h[b-1]==="\\"?Cb.escapeLast(h,o,b-1):`${h.slice(0,b)}\\${h.slice(b)}`};Cb.removePrefix=(h,o={})=>{let u=h;return u.startsWith("./")&&(u=u.slice(2),o.prefix="./"),u};Cb.wrapOutput=(h,o={},u={})=>{let b=u.contains?"":"^",x=u.contains?"":"$",L=`${b}(?:${h})${x}`;return o.negated===!0&&(L=`(?:^(?!${L}).*$)`),L};Cb.basename=(h,{windows:o}={})=>{let u=h.split(o?/[\\/]/:"/"),b=u[u.length-1];return b===""?u[u.length-2]:b}});var VUe=Om((lOt,GUe)=>{"use strict";var wUe=I5(),{CHAR_ASTERISK:Mxe,CHAR_AT:ANt,CHAR_BACKWARD_SLASH:C5,CHAR_COMMA:DNt,CHAR_DOT:Lxe,CHAR_EXCLAMATION_MARK:kxe,CHAR_FORWARD_SLASH:zUe,CHAR_LEFT_CURLY_BRACE:wxe,CHAR_LEFT_PARENTHESES:Oxe,CHAR_LEFT_SQUARE_BRACKET:INt,CHAR_PLUS:CNt,CHAR_QUESTION_MARK:OUe,CHAR_RIGHT_CURLY_BRACE:PNt,CHAR_RIGHT_PARENTHESES:FUe,CHAR_RIGHT_SQUARE_BRACKET:NNt}=D5(),WUe=h=>h===zUe||h===C5,BUe=h=>{h.isPrefix!==!0&&(h.depth=h.isGlobstar?1/0:1)},RNt=(h,o)=>{let u=o||{},b=h.length-1,x=u.parts===!0||u.scanToEnd===!0,L=[],j=[],me=[],Oe=h,tt=-1,at=0,dt=0,xe=!1,yn=!1,pt=!1,ut=!1,yi=!1,wi=!1,eo=!1,qa=!1,yl=!1,Sa=!1,Lr=0,In,Ii,_i={value:"",depth:0,isGlob:!1},Fr=()=>tt>=b,bi=()=>Oe.charCodeAt(tt+1),ud=()=>(In=Ii,Oe.charCodeAt(++tt));for(;tt<b;){Ii=ud();let vn;if(Ii===C5){eo=_i.backslashes=!0,Ii=ud(),Ii===wxe&&(wi=!0);continue}if(wi===!0||Ii===wxe){for(Lr++;Fr()!==!0&&(Ii=ud());){if(Ii===C5){eo=_i.backslashes=!0,ud();continue}if(Ii===wxe){Lr++;continue}if(wi!==!0&&Ii===Lxe&&(Ii=ud())===Lxe){if(xe=_i.isBrace=!0,pt=_i.isGlob=!0,Sa=!0,x===!0)continue;break}if(wi!==!0&&Ii===DNt){if(xe=_i.isBrace=!0,pt=_i.isGlob=!0,Sa=!0,x===!0)continue;break}if(Ii===PNt&&(Lr--,Lr===0)){wi=!1,xe=_i.isBrace=!0,Sa=!0;break}}if(x===!0)continue;break}if(Ii===zUe){if(L.push(tt),j.push(_i),_i={value:"",depth:0,isGlob:!1},Sa===!0)continue;if(In===Lxe&&tt===at+1){at+=2;continue}dt=tt+1;continue}if(u.noext!==!0&&(Ii===CNt||Ii===ANt||Ii===Mxe||Ii===OUe||Ii===kxe)===!0&&bi()===Oxe){if(pt=_i.isGlob=!0,ut=_i.isExtglob=!0,Sa=!0,Ii===kxe&&tt===at&&(yl=!0),x===!0){for(;Fr()!==!0&&(Ii=ud());){if(Ii===C5){eo=_i.backslashes=!0,Ii=ud();continue}if(Ii===FUe){pt=_i.isGlob=!0,Sa=!0;break}}continue}break}if(Ii===Mxe){if(In===Mxe&&(yi=_i.isGlobstar=!0),pt=_i.isGlob=!0,Sa=!0,x===!0)continue;break}if(Ii===OUe){if(pt=_i.isGlob=!0,Sa=!0,x===!0)continue;break}if(Ii===INt){for(;Fr()!==!0&&(vn=ud());){if(vn===C5){eo=_i.backslashes=!0,ud();continue}if(vn===NNt){yn=_i.isBracket=!0,pt=_i.isGlob=!0,Sa=!0;break}}if(x===!0)continue;break}if(u.nonegate!==!0&&Ii===kxe&&tt===at){qa=_i.negated=!0,at++;continue}if(u.noparen!==!0&&Ii===Oxe){if(pt=_i.isGlob=!0,x===!0){for(;Fr()!==!0&&(Ii=ud());){if(Ii===Oxe){eo=_i.backslashes=!0,Ii=ud();continue}if(Ii===FUe){Sa=!0;break}}continue}break}if(pt===!0){if(Sa=!0,x===!0)continue;break}}u.noext===!0&&(ut=!1,pt=!1);let Pc=Oe,fn="",Ai="";at>0&&(fn=Oe.slice(0,at),Oe=Oe.slice(at),dt-=at),Pc&&pt===!0&&dt>0?(Pc=Oe.slice(0,dt),Ai=Oe.slice(dt)):pt===!0?(Pc="",Ai=Oe):Pc=Oe,Pc&&Pc!==""&&Pc!=="/"&&Pc!==Oe&&WUe(Pc.charCodeAt(Pc.length-1))&&(Pc=Pc.slice(0,-1)),u.unescape===!0&&(Ai&&(Ai=wUe.removeBackslashes(Ai)),Pc&&eo===!0&&(Pc=wUe.removeBackslashes(Pc)));let Kc={prefix:fn,input:h,start:at,base:Pc,glob:Ai,isBrace:xe,isBracket:yn,isGlob:pt,isExtglob:ut,isGlobstar:yi,negated:qa,negatedExtglob:yl};if(u.tokens===!0&&(Kc.maxDepth=0,WUe(Ii)||j.push(_i),Kc.tokens=j),u.parts===!0||u.tokens===!0){let vn;for(let gd=0;gd<L.length;gd++){let Ys=vn?vn+1:at,Jc=L[gd],aa=h.slice(Ys,Jc);u.tokens&&(gd===0&&at!==0?(j[gd].isPrefix=!0,j[gd].value=fn):j[gd].value=aa,BUe(j[gd]),Kc.maxDepth+=j[gd].depth),(gd!==0||aa!=="")&&me.push(aa),vn=Jc}if(vn&&vn+1<h.length){let gd=h.slice(vn+1);me.push(gd),u.tokens&&(j[j.length-1].value=gd,BUe(j[j.length-1]),Kc.maxDepth+=j[j.length-1].depth)}Kc.slashes=L,Kc.parts=me}return Kc};GUe.exports=RNt});var JUe=Om((cOt,KUe)=>{"use strict";var P5=D5(),oT=I5(),{MAX_LENGTH:FZ,POSIX_REGEX_SOURCE:MNt,REGEX_NON_SPECIAL_CHARS:LNt,REGEX_SPECIAL_CHARS_BACKREF:kNt,REPLACEMENTS:jUe}=P5,wNt=(h,o)=>{if(typeof o.expandRange=="function")return o.expandRange(...h,o);h.sort();let u=`[${h.join("-")}]`;try{new RegExp(u)}catch{return h.map(x=>oT.escapeRegex(x)).join("..")}return u},C8=(h,o)=>`Missing ${h}: "${o}" - use "\\\\${o}" to match literal characters`,UUe=h=>{let o=[],u=0,b=0,x=0,L="",j=!1;for(let me of h){if(j===!0){L+=me,j=!1;continue}if(me==="\\"){L+=me,j=!0;continue}if(me==='"'){x=x===1?0:1,L+=me;continue}if(x===0){if(me==="[")u++;else if(me==="]"&&u>0)u--;else if(u===0){if(me==="(")b++;else if(me===")"&&b>0)b--;else if(me==="|"&&b===0){o.push(L),L="";continue}}}L+=me}return o.push(L),o},ONt=h=>{let o=!1;for(let u of h){if(o===!0){o=!1;continue}if(u==="\\"){o=!0;continue}if(/[?*+@!()[\]{}]/.test(u))return!1}return!0},HUe=h=>{let o=h.trim(),u=!0;for(;u===!0;)u=!1,/^@\([^\\()[\]{}|]+\)$/.test(o)&&(o=o.slice(2,-1),u=!0);if(ONt(o))return o.replace(/\\(.)/g,"$1")},FNt=h=>{let o=h.map(HUe).filter(Boolean);for(let u=0;u<o.length;u++)for(let b=u+1;b<o.length;b++){let x=o[u],L=o[b],j=x[0];if(!(!j||x!==j.repeat(x.length)||L!==j.repeat(L.length))&&(x===L||x.startsWith(L)||L.startsWith(x)))return!0}return!1},Fxe=(h,o=!0)=>{if(h[0]!=="+"&&h[0]!=="*"||h[1]!=="(")return;let u=0,b=0,x=0,L=!1;for(let j=1;j<h.length;j++){let me=h[j];if(L===!0){L=!1;continue}if(me==="\\"){L=!0;continue}if(me==='"'){x=x===1?0:1;continue}if(x!==1){if(me==="["){u++;continue}if(me==="]"&&u>0){u--;continue}if(!(u>0)){if(me==="("){b++;continue}if(me===")"&&(b--,b===0))return o===!0&&j!==h.length-1?void 0:{type:h[0],body:h.slice(2,j),end:j}}}}},WNt=h=>{let o=0,u=[];for(;o<h.length;){let x=Fxe(h.slice(o),!1);if(!x||x.type!=="*")return;let L=UUe(x.body).map(me=>me.trim());if(L.length!==1)return;let j=HUe(L[0]);if(!j||j.length!==1)return;u.push(j),o+=x.end+1}return u.length<1?void 0:`${u.length===1?oT.escapeRegex(u[0]):`[${u.map(x=>oT.escapeRegex(x)).join("")}]`}*`},BNt=h=>{let o=0,u=h.trim(),b=Fxe(u);for(;b;)o++,u=b.body.trim(),b=Fxe(u);return o},zNt=(h,o)=>{if(o.maxExtglobRecursion===!1)return{risky:!1};let u=typeof o.maxExtglobRecursion=="number"?o.maxExtglobRecursion:P5.DEFAULT_MAX_EXTGLOB_RECURSION,b=UUe(h).map(x=>x.trim());if(b.length>1&&(b.some(x=>x==="")||b.some(x=>/^[*?]+$/.test(x))||FNt(b)))return{risky:!0};for(let x of b){let L=WNt(x);if(L)return{risky:!0,safeOutput:L};if(BNt(x)>u)return{risky:!0}}return{risky:!1}},Wxe=(h,o)=>{if(typeof h!="string")throw new TypeError("Expected a string");h=jUe[h]||h;let u={...o},b=typeof u.maxLength=="number"?Math.min(FZ,u.maxLength):FZ,x=h.length;if(x>b)throw new SyntaxError(`Input length: ${x}, exceeds maximum allowed length: ${b}`);let L={type:"bos",value:"",output:u.prepend||""},j=[L],me=u.capture?"":"?:",Oe=P5.globChars(u.windows),tt=P5.extglobChars(Oe),{DOT_LITERAL:at,PLUS_LITERAL:dt,SLASH_LITERAL:xe,ONE_CHAR:yn,DOTS_SLASH:pt,NO_DOT:ut,NO_DOT_SLASH:yi,NO_DOTS_SLASH:wi,QMARK:eo,QMARK_NO_DOT:qa,STAR:yl,START_ANCHOR:Sa}=Oe,Lr=Uo=>`(${me}(?:(?!${Sa}${Uo.dot?pt:at}).)*?)`,In=u.dot?"":ut,Ii=u.dot?eo:qa,_i=u.bash===!0?Lr(u):yl;u.capture&&(_i=`(${_i})`),typeof u.noext=="boolean"&&(u.noextglob=u.noext);let Fr={input:h,index:-1,start:0,dot:u.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:j};h=oT.removePrefix(h,Fr),x=h.length;let bi=[],ud=[],Pc=[],fn=L,Ai,Kc=()=>Fr.index===x-1,vn=Fr.peek=(Uo=1)=>h[Fr.index+Uo],gd=Fr.advance=()=>h[++Fr.index]||"",Ys=()=>h.slice(Fr.index+1),Jc=(Uo="",ac=0)=>{Fr.consumed+=Uo,Fr.index+=ac},aa=Uo=>{Fr.output+=Uo.output!=null?Uo.output:Uo.value,Jc(Uo.value)},dT=()=>{let Uo=1;for(;vn()==="!"&&(vn(2)!=="("||vn(3)==="?");)gd(),Fr.start++,Uo++;return Uo%2===0?!1:(Fr.negated=!0,Fr.start++,!0)},uT=Uo=>{Fr[Uo]++,Pc.push(Uo)},Iy=Uo=>{Fr[Uo]--,Pc.pop()},Ll=Uo=>{if(fn.type==="globstar"){let ac=Fr.braces>0&&(Uo.type==="comma"||Uo.type==="brace"),Ko=Uo.extglob===!0||bi.length&&(Uo.type==="pipe"||Uo.type==="paren");Uo.type!=="slash"&&Uo.type!=="paren"&&!ac&&!Ko&&(Fr.output=Fr.output.slice(0,-fn.output.length),fn.type="star",fn.value="*",fn.output=_i,Fr.output+=fn.output)}if(bi.length&&Uo.type!=="paren"&&(bi[bi.length-1].inner+=Uo.value),(Uo.value||Uo.output)&&aa(Uo),fn&&fn.type==="text"&&Uo.type==="text"){fn.output=(fn.output||fn.value)+Uo.value,fn.value+=Uo.value;return}Uo.prev=fn,j.push(Uo),fn=Uo},Gi=(Uo,ac)=>{let Ko={...tt[ac],conditions:1,inner:""};Ko.prev=fn,Ko.parens=Fr.parens,Ko.output=Fr.output,Ko.startIndex=Fr.index,Ko.tokensIndex=j.length;let kl=(u.capture?"(":"")+Ko.open;uT("parens"),Ll({type:Uo,value:ac,output:Fr.output?"":yn}),Ll({type:"paren",extglob:!0,value:gd(),output:kl}),bi.push(Ko)},mh=Uo=>{let ac=h.slice(Uo.startIndex,Fr.index+1),Ko=h.slice(Uo.startIndex+2,Fr.index),kl=zNt(Ko,u);if((Uo.type==="plus"||Uo.type==="star")&&kl.risky){let yd=kl.safeOutput?(Uo.output?"":yn)+(u.capture?`(${kl.safeOutput})`:kl.safeOutput):void 0,Wi=j[Uo.tokensIndex];Wi.type="text",Wi.value=ac,Wi.output=yd||oT.escapeRegex(ac);for(let Mb=Uo.tokensIndex+1;Mb<j.length;Mb++)j[Mb].value="",j[Mb].output="",delete j[Mb].suffix;Fr.output=Uo.output+Wi.output,Fr.backtrack=!0,Ll({type:"paren",extglob:!0,value:Ai,output:""}),Iy("parens");return}let jd=Uo.close+(u.capture?")":""),gt;if(Uo.type==="negate"){let yd=_i;if(Uo.inner&&Uo.inner.length>1&&Uo.inner.includes("/")&&(yd=Lr(u)),(yd!==_i||Kc()||/^\)+$/.test(Ys()))&&(jd=Uo.close=`)$))${yd}`),Uo.inner.includes("*")&&(gt=Ys())&&/^\.[^\\/.]+$/.test(gt)){let Wi=Wxe(gt,{...o,fastpaths:!1}).output;jd=Uo.close=`)${Wi})${yd})`}Uo.prev.type==="bos"&&(Fr.negatedExtglob=!0)}Ll({type:"paren",extglob:!0,value:Ai,output:jd}),Iy("parens")};if(u.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(h)){let Uo=!1,ac=h.replace(kNt,(Ko,kl,jd,gt,yd,Wi)=>gt==="\\"?(Uo=!0,Ko):gt==="?"?kl?kl+gt+(yd?eo.repeat(yd.length):""):Wi===0?Ii+(yd?eo.repeat(yd.length):""):eo.repeat(jd.length):gt==="."?at.repeat(jd.length):gt==="*"?kl?kl+gt+(yd?_i:""):_i:kl?Ko:`\\${Ko}`);return Uo===!0&&(u.unescape===!0?ac=ac.replace(/\\/g,""):ac=ac.replace(/\\+/g,Ko=>Ko.length%2===0?"\\\\":Ko?"\\":"")),ac===h&&u.contains===!0?(Fr.output=h,Fr):(Fr.output=oT.wrapOutput(ac,Fr,o),Fr)}for(;!Kc();){if(Ai=gd(),Ai==="\0")continue;if(Ai==="\\"){let Ko=vn();if(Ko==="/"&&u.bash!==!0||Ko==="."||Ko===";")continue;if(!Ko){Ai+="\\",Ll({type:"text",value:Ai});continue}let kl=/^\\+/.exec(Ys()),jd=0;if(kl&&kl[0].length>2&&(jd=kl[0].length,Fr.index+=jd,jd%2!==0&&(Ai+="\\")),u.unescape===!0?Ai=gd():Ai+=gd(),Fr.brackets===0){Ll({type:"text",value:Ai});continue}}if(Fr.brackets>0&&(Ai!=="]"||fn.value==="["||fn.value==="[^")){if(u.posix!==!1&&Ai===":"){let Ko=fn.value.slice(1);if(Ko.includes("[")&&(fn.posix=!0,Ko.includes(":"))){let kl=fn.value.lastIndexOf("["),jd=fn.value.slice(0,kl),gt=fn.value.slice(kl+2),yd=MNt[gt];if(yd){fn.value=jd+yd,Fr.backtrack=!0,gd(),!L.output&&j.indexOf(fn)===1&&(L.output=yn);continue}}}(Ai==="["&&vn()!==":"||Ai==="-"&&vn()==="]")&&(Ai=`\\${Ai}`),Ai==="]"&&(fn.value==="["||fn.value==="[^")&&(Ai=`\\${Ai}`),u.posix===!0&&Ai==="!"&&fn.value==="["&&(Ai="^"),fn.value+=Ai,aa({value:Ai});continue}if(Fr.quotes===1&&Ai!=='"'){Ai=oT.escapeRegex(Ai),fn.value+=Ai,aa({value:Ai});continue}if(Ai==='"'){Fr.quotes=Fr.quotes===1?0:1,u.keepQuotes===!0&&Ll({type:"text",value:Ai});continue}if(Ai==="("){uT("parens"),Ll({type:"paren",value:Ai});continue}if(Ai===")"){if(Fr.parens===0&&u.strictBrackets===!0)throw new SyntaxError(C8("opening","("));let Ko=bi[bi.length-1];if(Ko&&Fr.parens===Ko.parens+1){mh(bi.pop());continue}Ll({type:"paren",value:Ai,output:Fr.parens?")":"\\)"}),Iy("parens");continue}if(Ai==="["){if(u.nobracket===!0||!Ys().includes("]")){if(u.nobracket!==!0&&u.strictBrackets===!0)throw new SyntaxError(C8("closing","]"));Ai=`\\${Ai}`}else uT("brackets");Ll({type:"bracket",value:Ai});continue}if(Ai==="]"){if(u.nobracket===!0||fn&&fn.type==="bracket"&&fn.value.length===1){Ll({type:"text",value:Ai,output:`\\${Ai}`});continue}if(Fr.brackets===0){if(u.strictBrackets===!0)throw new SyntaxError(C8("opening","["));Ll({type:"text",value:Ai,output:`\\${Ai}`});continue}Iy("brackets");let Ko=fn.value.slice(1);if(fn.posix!==!0&&Ko[0]==="^"&&!Ko.includes("/")&&(Ai=`/${Ai}`),fn.value+=Ai,aa({value:Ai}),u.literalBrackets===!1||oT.hasRegexChars(Ko))continue;let kl=oT.escapeRegex(fn.value);if(Fr.output=Fr.output.slice(0,-fn.value.length),u.literalBrackets===!0){Fr.output+=kl,fn.value=kl;continue}fn.value=`(${me}${kl}|${fn.value})`,Fr.output+=fn.value;continue}if(Ai==="{"&&u.nobrace!==!0){uT("braces");let Ko={type:"brace",value:Ai,output:"(",outputIndex:Fr.output.length,tokensIndex:Fr.tokens.length};ud.push(Ko),Ll(Ko);continue}if(Ai==="}"){let Ko=ud[ud.length-1];if(u.nobrace===!0||!Ko){Ll({type:"text",value:Ai,output:Ai});continue}let kl=")";if(Ko.dots===!0){let jd=j.slice(),gt=[];for(let yd=jd.length-1;yd>=0&&(j.pop(),jd[yd].type!=="brace");yd--)jd[yd].type!=="dots"&&gt.unshift(jd[yd].value);kl=wNt(gt,u),Fr.backtrack=!0}if(Ko.comma!==!0&&Ko.dots!==!0){let jd=Fr.output.slice(0,Ko.outputIndex),gt=Fr.tokens.slice(Ko.tokensIndex);Ko.value=Ko.output="\\{",Ai=kl="\\}",Fr.output=jd;for(let yd of gt)Fr.output+=yd.output||yd.value}Ll({type:"brace",value:Ai,output:kl}),Iy("braces"),ud.pop();continue}if(Ai==="|"){bi.length>0&&bi[bi.length-1].conditions++,Ll({type:"text",value:Ai});continue}if(Ai===","){let Ko=Ai,kl=ud[ud.length-1];kl&&Pc[Pc.length-1]==="braces"&&(kl.comma=!0,Ko="|"),Ll({type:"comma",value:Ai,output:Ko});continue}if(Ai==="/"){if(fn.type==="dot"&&Fr.index===Fr.start+1){Fr.start=Fr.index+1,Fr.consumed="",Fr.output="",j.pop(),fn=L;continue}Ll({type:"slash",value:Ai,output:xe});continue}if(Ai==="."){if(Fr.braces>0&&fn.type==="dot"){fn.value==="."&&(fn.output=at);let Ko=ud[ud.length-1];fn.type="dots",fn.output+=Ai,fn.value+=Ai,Ko.dots=!0;continue}if(Fr.braces+Fr.parens===0&&fn.type!=="bos"&&fn.type!=="slash"){Ll({type:"text",value:Ai,output:at});continue}Ll({type:"dot",value:Ai,output:at});continue}if(Ai==="?"){if(!(fn&&fn.value==="(")&&u.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){Gi("qmark",Ai);continue}if(fn&&fn.type==="paren"){let kl=vn(),jd=Ai;(fn.value==="("&&!/[!=<:]/.test(kl)||kl==="<"&&!/<([!=]|\w+>)/.test(Ys()))&&(jd=`\\${Ai}`),Ll({type:"text",value:Ai,output:jd});continue}if(u.dot!==!0&&(fn.type==="slash"||fn.type==="bos")){Ll({type:"qmark",value:Ai,output:qa});continue}Ll({type:"qmark",value:Ai,output:eo});continue}if(Ai==="!"){if(u.noextglob!==!0&&vn()==="("&&(vn(2)!=="?"||!/[!=<:]/.test(vn(3)))){Gi("negate",Ai);continue}if(u.nonegate!==!0&&Fr.index===0){dT();continue}}if(Ai==="+"){if(u.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){Gi("plus",Ai);continue}if(fn&&fn.value==="("||u.regex===!1){Ll({type:"plus",value:Ai,output:dt});continue}if(fn&&(fn.type==="bracket"||fn.type==="paren"||fn.type==="brace")||Fr.parens>0){Ll({type:"plus",value:Ai});continue}Ll({type:"plus",value:dt});continue}if(Ai==="@"){if(u.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){Ll({type:"at",extglob:!0,value:Ai,output:""});continue}Ll({type:"text",value:Ai});continue}if(Ai!=="*"){(Ai==="$"||Ai==="^")&&(Ai=`\\${Ai}`);let Ko=LNt.exec(Ys());Ko&&(Ai+=Ko[0],Fr.index+=Ko[0].length),Ll({type:"text",value:Ai});continue}if(fn&&(fn.type==="globstar"||fn.star===!0)){fn.type="star",fn.star=!0,fn.value+=Ai,fn.output=_i,Fr.backtrack=!0,Fr.globstar=!0,Jc(Ai);continue}let Uo=Ys();if(u.noextglob!==!0&&/^\([^?]/.test(Uo)){Gi("star",Ai);continue}if(fn.type==="star"){if(u.noglobstar===!0){Jc(Ai);continue}let Ko=fn.prev,kl=Ko.prev,jd=Ko.type==="slash"||Ko.type==="bos",gt=kl&&(kl.type==="star"||kl.type==="globstar");if(u.bash===!0&&(!jd||Uo[0]&&Uo[0]!=="/")){Ll({type:"star",value:Ai,output:""});continue}let yd=Fr.braces>0&&(Ko.type==="comma"||Ko.type==="brace"),Wi=bi.length&&(Ko.type==="pipe"||Ko.type==="paren");if(!jd&&Ko.type!=="paren"&&!yd&&!Wi){Ll({type:"star",value:Ai,output:""});continue}for(;Uo.slice(0,3)==="/**";){let Mb=h[Fr.index+4];if(Mb&&Mb!=="/")break;Uo=Uo.slice(3),Jc("/**",3)}if(Ko.type==="bos"&&Kc()){fn.type="globstar",fn.value+=Ai,fn.output=Lr(u),Fr.output=fn.output,Fr.globstar=!0,Jc(Ai);continue}if(Ko.type==="slash"&&Ko.prev.type!=="bos"&&!gt&&Kc()){Fr.output=Fr.output.slice(0,-(Ko.output+fn.output).length),Ko.output=`(?:${Ko.output}`,fn.type="globstar",fn.output=Lr(u)+(u.strictSlashes?")":"|$)"),fn.value+=Ai,Fr.globstar=!0,Fr.output+=Ko.output+fn.output,Jc(Ai);continue}if(Ko.type==="slash"&&Ko.prev.type!=="bos"&&Uo[0]==="/"){let Mb=Uo[1]!==void 0?"|$":"";Fr.output=Fr.output.slice(0,-(Ko.output+fn.output).length),Ko.output=`(?:${Ko.output}`,fn.type="globstar",fn.output=`${Lr(u)}${xe}|${xe}${Mb})`,fn.value+=Ai,Fr.output+=Ko.output+fn.output,Fr.globstar=!0,Jc(Ai+gd()),Ll({type:"slash",value:"/",output:""});continue}if(Ko.type==="bos"&&Uo[0]==="/"){fn.type="globstar",fn.value+=Ai,fn.output=`(?:^|${xe}|${Lr(u)}${xe})`,Fr.output=fn.output,Fr.globstar=!0,Jc(Ai+gd()),Ll({type:"slash",value:"/",output:""});continue}Fr.output=Fr.output.slice(0,-fn.output.length),fn.type="globstar",fn.output=Lr(u),fn.value+=Ai,Fr.output+=fn.output,Fr.globstar=!0,Jc(Ai);continue}let ac={type:"star",value:Ai,output:_i};if(u.bash===!0){ac.output=".*?",(fn.type==="bos"||fn.type==="slash")&&(ac.output=In+ac.output),Ll(ac);continue}if(fn&&(fn.type==="bracket"||fn.type==="paren")&&u.regex===!0){ac.output=Ai,Ll(ac);continue}(Fr.index===Fr.start||fn.type==="slash"||fn.type==="dot")&&(fn.type==="dot"?(Fr.output+=yi,fn.output+=yi):u.dot===!0?(Fr.output+=wi,fn.output+=wi):(Fr.output+=In,fn.output+=In),vn()!=="*"&&(Fr.output+=yn,fn.output+=yn)),Ll(ac)}for(;Fr.brackets>0;){if(u.strictBrackets===!0)throw new SyntaxError(C8("closing","]"));Fr.output=oT.escapeLast(Fr.output,"["),Iy("brackets")}for(;Fr.parens>0;){if(u.strictBrackets===!0)throw new SyntaxError(C8("closing",")"));Fr.output=oT.escapeLast(Fr.output,"("),Iy("parens")}for(;Fr.braces>0;){if(u.strictBrackets===!0)throw new SyntaxError(C8("closing","}"));Fr.output=oT.escapeLast(Fr.output,"{"),Iy("braces")}if(u.strictSlashes!==!0&&(fn.type==="star"||fn.type==="bracket")&&Ll({type:"maybe_slash",value:"",output:`${xe}?`}),Fr.backtrack===!0){Fr.output="";for(let Uo of Fr.tokens)Fr.output+=Uo.output!=null?Uo.output:Uo.value,Uo.suffix&&(Fr.output+=Uo.suffix)}return Fr};Wxe.fastpaths=(h,o)=>{let u={...o},b=typeof u.maxLength=="number"?Math.min(FZ,u.maxLength):FZ,x=h.length;if(x>b)throw new SyntaxError(`Input length: ${x}, exceeds maximum allowed length: ${b}`);h=jUe[h]||h;let{DOT_LITERAL:L,SLASH_LITERAL:j,ONE_CHAR:me,DOTS_SLASH:Oe,NO_DOT:tt,NO_DOTS:at,NO_DOTS_SLASH:dt,STAR:xe,START_ANCHOR:yn}=P5.globChars(u.windows),pt=u.dot?at:tt,ut=u.dot?dt:tt,yi=u.capture?"":"?:",wi={negated:!1,prefix:""},eo=u.bash===!0?".*?":xe;u.capture&&(eo=`(${eo})`);let qa=In=>In.noglobstar===!0?eo:`(${yi}(?:(?!${yn}${In.dot?Oe:L}).)*?)`,yl=In=>{switch(In){case"*":return`${pt}${me}${eo}`;case".*":return`${L}${me}${eo}`;case"*.*":return`${pt}${eo}${L}${me}${eo}`;case"*/*":return`${pt}${eo}${j}${me}${ut}${eo}`;case"**":return pt+qa(u);case"**/*":return`(?:${pt}${qa(u)}${j})?${ut}${me}${eo}`;case"**/*.*":return`(?:${pt}${qa(u)}${j})?${ut}${eo}${L}${me}${eo}`;case"**/.*":return`(?:${pt}${qa(u)}${j})?${L}${me}${eo}`;default:{let Ii=/^(.*?)\.(\w+)$/.exec(In);if(!Ii)return;let _i=yl(Ii[1]);return _i?_i+L+Ii[2]:void 0}}},Sa=oT.removePrefix(h,wi),Lr=yl(Sa);return Lr&&u.strictSlashes!==!0&&(Lr+=`${j}?`),Lr};KUe.exports=Wxe});var $Ue=Om((dOt,XUe)=>{"use strict";var GNt=VUe(),Bxe=JUe(),qUe=I5(),VNt=D5(),jNt=h=>h&&typeof h=="object"&&!Array.isArray(h),c_=(h,o,u=!1)=>{if(Array.isArray(h)){let at=h.map(xe=>c_(xe,o,u));return xe=>{for(let yn of at){let pt=yn(xe);if(pt)return pt}return!1}}let b=jNt(h)&&h.tokens&&h.input;if(h===""||typeof h!="string"&&!b)throw new TypeError("Expected pattern to be a non-empty string");let x=o||{},L=x.windows,j=b?c_.compileRe(h,o):c_.makeRe(h,o,!1,!0),me=j.state;delete j.state;let Oe=()=>!1;if(x.ignore){let at={...o,ignore:null,onMatch:null,onResult:null};Oe=c_(x.ignore,at,u)}let tt=(at,dt=!1)=>{let{isMatch:xe,match:yn,output:pt}=c_.test(at,j,o,{glob:h,posix:L}),ut={glob:h,state:me,regex:j,posix:L,input:at,output:pt,match:yn,isMatch:xe};return typeof x.onResult=="function"&&x.onResult(ut),xe===!1?(ut.isMatch=!1,dt?ut:!1):Oe(at)?(typeof x.onIgnore=="function"&&x.onIgnore(ut),ut.isMatch=!1,dt?ut:!1):(typeof x.onMatch=="function"&&x.onMatch(ut),dt?ut:!0)};return u&&(tt.state=me),tt};c_.test=(h,o,u,{glob:b,posix:x}={})=>{if(typeof h!="string")throw new TypeError("Expected input to be a string");if(h==="")return{isMatch:!1,output:""};let L=u||{},j=L.format||(x?qUe.toPosixSlashes:null),me=h===b,Oe=me&&j?j(h):h;return me===!1&&(Oe=j?j(h):h,me=Oe===b),(me===!1||L.capture===!0)&&(L.matchBase===!0||L.basename===!0?me=c_.matchBase(h,o,u,x):me=o.exec(Oe)),{isMatch:!!me,match:me,output:Oe}};c_.matchBase=(h,o,u)=>(o instanceof RegExp?o:c_.makeRe(o,u)).test(qUe.basename(h));c_.isMatch=(h,o,u)=>c_(o,u)(h);c_.parse=(h,o)=>Array.isArray(h)?h.map(u=>c_.parse(u,o)):Bxe(h,{...o,fastpaths:!1});c_.scan=(h,o)=>GNt(h,o);c_.compileRe=(h,o,u=!1,b=!1)=>{if(u===!0)return h.output;let x=o||{},L=x.contains?"":"^",j=x.contains?"":"$",me=`${L}(?:${h.output})${j}`;h&&h.negated===!0&&(me=`^(?!${me}).*$`);let Oe=c_.toRegex(me,o);return b===!0&&(Oe.state=h),Oe};c_.makeRe=(h,o={},u=!1,b=!1)=>{if(!h||typeof h!="string")throw new TypeError("Expected a non-empty string");let x={negated:!1,fastpaths:!0};return o.fastpaths!==!1&&(h[0]==="."||h[0]==="*")&&(x.output=Bxe.fastpaths(h,o)),x.output||(x=Bxe(h,o)),c_.compileRe(x,o,u,b)};c_.toRegex=(h,o)=>{try{let u=o||{};return new RegExp(h,u.flags||(u.nocase?"i":""))}catch(u){if(o&&o.debug===!0)throw u;return/$^/}};c_.constants=VNt;XUe.exports=c_});var zxe=Om((uOt,ZUe)=>{"use strict";var YUe=$Ue(),UNt=I5();function QUe(h,o,u=!1){return o&&(o.windows===null||o.windows===void 0)&&(o={...o,windows:UNt.isWindows()}),YUe(h,o,u)}Object.assign(QUe,YUe);ZUe.exports=QUe});var uHe=Om(dHe=>{var HNt=Object.create,tHe=Object.defineProperty,KNt=Object.getOwnPropertyDescriptor,JNt=Object.getOwnPropertyNames,qNt=Object.getPrototypeOf,XNt=Object.prototype.hasOwnProperty,$Nt=(h,o,u,b)=>{if(o&&typeof o=="object"||typeof o=="function")for(var x=JNt(o),L=0,j=x.length,me;L<j;L++)me=x[L],!XNt.call(h,me)&&me!==u&&tHe(h,me,{get:(Oe=>o[Oe]).bind(null,me),enumerable:!(b=KNt(o,me))||b.enumerable});return h},nHe=(h,o,u)=>(u=h!=null?HNt(qNt(h)):{},$Nt(o||!h||!h.__esModule?tHe(u,"default",{value:h,enumerable:!0}):u,h)),fC=nHe(require("path")),YNt=nHe(require("fs"));function QNt(h){let o=(0,fC.normalize)(h);return o.length>1&&o[o.length-1]===fC.sep&&(o=o.substring(0,o.length-1)),o}var ZNt=/[\\/]/g;function rHe(h,o){return h.replace(ZNt,o)}var eRt=/^[a-z]:[\\/]$/i;function tRt(h){return h==="/"||eRt.test(h)}function Gxe(h,o){let{resolvePaths:u,normalizePath:b,pathSeparator:x}=o,L=process.platform==="win32"&&h.includes("/")||h.startsWith(".");if(u&&(h=(0,fC.resolve)(h)),(b||L)&&(h=QNt(h)),h===".")return"";let j=h[h.length-1]!==x;return rHe(j?h+x:h,x)}function iHe(h,o){return o+h}function nRt(h,o){return function(u,b){return b.startsWith(h)?b.slice(h.length)+u:rHe((0,fC.relative)(h,b),o.pathSeparator)+o.pathSeparator+u}}function rRt(h){return h}function iRt(h,o,u){return o+h+u}function oRt(h,o){let{relativePaths:u,includeBasePath:b}=o;return u&&h?nRt(h,o):b?iHe:rRt}function aRt(h){return function(o,u){u.push(o.substring(h.length)||".")}}function sRt(h){return function(o,u,b){let x=o.substring(h.length)||".";b.every(L=>L(x,!0))&&u.push(x)}}var lRt=(h,o)=>{o.push(h||".")},cRt=(h,o,u)=>{let b=h||".";u.every(x=>x(b,!0))&&o.push(b)},dRt=()=>{};function uRt(h,o){let{includeDirs:u,filters:b,relativePaths:x}=o;return u?x?b&&b.length?sRt(h):aRt(h):b&&b.length?cRt:lRt:dRt}var pRt=(h,o,u,b)=>{b.every(x=>x(h,!1))&&u.files++},fRt=(h,o,u,b)=>{b.every(x=>x(h,!1))&&o.push(h)},mRt=(h,o,u,b)=>{u.files++},_Rt=(h,o)=>{o.push(h)},hRt=()=>{};function gRt(h){let{excludeFiles:o,filters:u,onlyCounts:b}=h;return o?hRt:u&&u.length?b?pRt:fRt:b?mRt:_Rt}var yRt=h=>h,vRt=()=>[""].slice(0,0);function bRt(h){return h.group?vRt:yRt}var SRt=(h,o,u)=>{h.push({directory:o,files:u,dir:o})},TRt=()=>{};function ERt(h){return h.group?SRt:TRt}var xRt=function(h,o,u){let{queue:b,fs:x,options:{suppressErrors:L}}=o;b.enqueue(),x.realpath(h,(j,me)=>{if(j)return b.dequeue(L?null:j,o);x.stat(me,(Oe,tt)=>{if(Oe)return b.dequeue(L?null:Oe,o);if(tt.isDirectory()&&oHe(h,me,o))return b.dequeue(null,o);u(tt,me),b.dequeue(null,o)})})},ARt=function(h,o,u){let{queue:b,fs:x,options:{suppressErrors:L}}=o;b.enqueue();try{let j=x.realpathSync(h),me=x.statSync(j);if(me.isDirectory()&&oHe(h,j,o))return;u(me,j)}catch(j){if(!L)throw j}};function DRt(h,o){return!h.resolveSymlinks||h.excludeSymlinks?null:o?ARt:xRt}function oHe(h,o,u){if(u.options.useRealPaths)return IRt(o,u);let b=(0,fC.dirname)(h),x=1;for(;b!==u.root&&x<2;){let L=u.symlinks.get(b);!!L&&(L===o||L.startsWith(o)||o.startsWith(L))?x++:b=(0,fC.dirname)(b)}return u.symlinks.set(h,o),x>1}function IRt(h,o){return o.visited.includes(h+o.options.pathSeparator)}var CRt=h=>h.counts,PRt=h=>h.groups,NRt=h=>h.paths,RRt=h=>h.paths.slice(0,h.options.maxFiles),MRt=(h,o,u)=>(WZ(o,u,h.counts,h.options.suppressErrors),null),LRt=(h,o,u)=>(WZ(o,u,h.paths,h.options.suppressErrors),null),kRt=(h,o,u)=>(WZ(o,u,h.paths.slice(0,h.options.maxFiles),h.options.suppressErrors),null),wRt=(h,o,u)=>(WZ(o,u,h.groups,h.options.suppressErrors),null);function WZ(h,o,u,b){o(h&&!b?h:null,u)}function ORt(h,o){let{onlyCounts:u,group:b,maxFiles:x}=h;return u?o?CRt:MRt:b?o?PRt:wRt:x?o?RRt:kRt:o?NRt:LRt}var aHe={withFileTypes:!0},FRt=(h,o,u,b,x)=>{if(h.queue.enqueue(),b<0)return h.queue.dequeue(null,h);let{fs:L}=h;h.visited.push(o),h.counts.directories++,L.readdir(o||".",aHe,(j,me=[])=>{x(me,u,b),h.queue.dequeue(h.options.suppressErrors?null:j,h)})},WRt=(h,o,u,b,x)=>{let{fs:L}=h;if(b<0)return;h.visited.push(o),h.counts.directories++;let j=[];try{j=L.readdirSync(o||".",aHe)}catch(me){if(!h.options.suppressErrors)throw me}x(j,u,b)};function BRt(h){return h?WRt:FRt}var zRt=class{count=0;constructor(h){this.onQueueEmpty=h}enqueue(){return this.count++,this.count}dequeue(h,o){this.onQueueEmpty&&(--this.count<=0||h)&&(this.onQueueEmpty(h,o),h&&(o.controller.abort(),this.onQueueEmpty=void 0))}},GRt=class{_files=0;_directories=0;set files(h){this._files=h}get files(){return this._files}set directories(h){this._directories=h}get directories(){return this._directories}get dirs(){return this._directories}},VRt=class{aborted=!1;abort(){this.aborted=!0}},sHe=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(h,o,u){this.isSynchronous=!u,this.callbackInvoker=ORt(o,this.isSynchronous),this.root=Gxe(h,o),this.state={root:tRt(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new GRt,options:o,queue:new zRt((b,x)=>this.callbackInvoker(x,b,u)),symlinks:new Map,visited:[""].slice(0,0),controller:new VRt,fs:o.fs||YNt},this.joinPath=oRt(this.root,o),this.pushDirectory=uRt(this.root,o),this.pushFile=gRt(o),this.getArray=bRt(o),this.groupFiles=ERt(o),this.resolveSymlink=DRt(o,this.isSynchronous),this.walkDirectory=BRt(this.isSynchronous)}start(){return this.pushDirectory(this.root,this.state.paths,this.state.options.filters),this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(h,o,u)=>{let{paths:b,options:{filters:x,resolveSymlinks:L,excludeSymlinks:j,exclude:me,maxFiles:Oe,signal:tt,useRealPaths:at,pathSeparator:dt},controller:xe}=this.state;if(xe.aborted||tt&&tt.aborted||Oe&&b.length>Oe)return;let yn=this.getArray(this.state.paths);for(let pt=0;pt<h.length;++pt){let ut=h[pt];if(ut.isFile()||ut.isSymbolicLink()&&!L&&!j){let yi=this.joinPath(ut.name,o);this.pushFile(yi,yn,this.state.counts,x)}else if(ut.isDirectory()){let yi=iRt(ut.name,o,this.state.options.pathSeparator);if(me&&me(ut.name,yi))continue;this.pushDirectory(yi,b,x),this.walkDirectory(this.state,yi,yi,u-1,this.walk)}else if(this.resolveSymlink&&ut.isSymbolicLink()){let yi=iHe(ut.name,o);this.resolveSymlink(yi,this.state,(wi,eo)=>{if(wi.isDirectory()){if(eo=Gxe(eo,this.state.options),me&&me(ut.name,at?eo:yi+dt))return;this.walkDirectory(this.state,eo,at?eo:yi+dt,u-1,this.walk)}else{eo=at?eo:yi;let qa=(0,fC.basename)(eo),yl=Gxe((0,fC.dirname)(eo),this.state.options);eo=this.joinPath(qa,yl),this.pushFile(eo,yn,this.state.counts,x)}})}}this.groupFiles(this.state.groups,o,yn)}};function jRt(h,o){return new Promise((u,b)=>{lHe(h,o,(x,L)=>{if(x)return b(x);u(L)})})}function lHe(h,o,u){new sHe(h,o,u).start()}function URt(h,o){return new sHe(h,o).start()}var eHe=class{constructor(h,o){this.root=h,this.options=o}withPromise(){return jRt(this.root,this.options)}withCallback(h){lHe(this.root,this.options,h)}sync(){return URt(this.root,this.options)}},cHe=null;try{require.resolve("picomatch"),cHe=zxe()}catch{}var HRt=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:fC.sep,filters:[]};globFunction;constructor(h){this.options={...this.options,...h},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(h){return this.options.pathSeparator=h,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(h){return this.options.maxDepth=h,this}withMaxFiles(h){return this.options.maxFiles=h,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:h=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=h,this.withFullPaths()}withAbortSignal(h){return this.options.signal=h,this}normalize(){return this.options.normalizePath=!0,this}filter(h){return this.options.filters.push(h),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(h){return this.options.exclude=h,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(h){return new eHe(h||".",this.options)}withGlobFunction(h){return this.globFunction=h,this}crawlWithOptions(h,o){return this.options={...this.options,...o},new eHe(h||".",this.options)}glob(...h){return this.globFunction?this.globWithOptions(h):this.globWithOptions(h,{dot:!0})}globWithOptions(h,...o){let u=this.globFunction||cHe;if(!u)throw new Error("Please specify a glob function to use glob matching.");var b=this.globCache[h.join("\0")];return b||(b=u(h,...o),this.globCache[h.join("\0")]=b),this.options.filters.push(x=>b(x)),this}};dHe.fdir=HRt});var EHe=Om($k=>{Object.defineProperty($k,Symbol.toStringTag,{value:"Module"});var KRt=Object.create,fHe=Object.defineProperty,JRt=Object.getOwnPropertyDescriptor,qRt=Object.getOwnPropertyNames,XRt=Object.getPrototypeOf,$Rt=Object.prototype.hasOwnProperty,YRt=(h,o,u,b)=>{if(o&&typeof o=="object"||typeof o=="function")for(var x=qRt(o),L=0,j=x.length,me;L<j;L++)me=x[L],!$Rt.call(h,me)&&me!==u&&fHe(h,me,{get:(Oe=>o[Oe]).bind(null,me),enumerable:!(b=JRt(o,me))||b.enumerable});return h},QRt=(h,o,u)=>(u=h!=null?KRt(XRt(h)):{},YRt(o||!h||!h.__esModule?fHe(u,"default",{value:h,enumerable:!0}):u,h)),P8=require("fs"),mC=require("path"),ZRt=require("url"),eMt=uHe(),Xk=zxe();Xk=QRt(Xk);var tMt=Array.isArray,mHe=/\\/g,jxe=process.platform==="win32",nMt=/^(\/?\.\.)+$/;function rMt(h,o={}){let u=h.length,b=Array(u),x=Array(u),L,j;for(L=0;L<u;L++){let me=_He(h[L]);b[L]=me;let Oe=me.length,tt=Array(Oe);for(j=0;j<Oe;j++)tt[j]=(0,Xk.default)(me[j],o);x[L]=tt}return me=>{let Oe=me.split("/");if(Oe[0]===".."&&nMt.test(me))return!0;for(L=0;L<u;L++){let tt=b[L],at=x[L],dt=Oe.length,xe=Math.min(dt,tt.length);for(j=0;j<xe;){let yn=tt[j];if(yn.includes("/"))return!0;if(!at[j](Oe[j]))break;if(!o.noglobstar&&yn==="**")return!0;j++}if(j===dt)return!0}return!1}}var iMt=/^[A-Z]:\/$/i,oMt=jxe?h=>iMt.test(h):h=>h==="/";function pHe(h,o,u){if(h===o||o.startsWith(`${h}/`)){if(u){let x=h.length+ +!oMt(h);return(L,j)=>L.slice(x,j?-1:void 0)||"."}let b=o.slice(h.length+1);return b?(x,L)=>{if(x===".")return b;let j=`${b}/${x}`;return L?j.slice(0,-1):j}:(x,L)=>L&&x!=="."?x.slice(0,-1):x}return u?b=>mC.posix.relative(h,b)||".":b=>mC.posix.relative(h,`${o}/${b}`)||"."}function aMt(h,o){if(o.startsWith(`${h}/`)){let u=o.slice(h.length+1);return b=>`${u}/${b}`}return u=>{let b=mC.posix.relative(h,`${o}/${u}`);return u[u.length-1]==="/"&&b!==""?`${b}/`:b||"."}}var sMt={parts:!0};function _He(h){var o;let u=Xk.default.scan(h,sMt);return!((o=u.parts)===null||o===void 0)&&o.length?u.parts:[h]}var lMt=/\\(?![()[\]{}!+@])/g;function cMt(h){return hHe(h)}function dMt(h){return gHe(h).replace(lMt,"/")}var uMt=jxe?dMt:cMt,pMt=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,fMt=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,hHe=h=>h.replace(pMt,"\\$&"),gHe=h=>h.replace(fMt,"\\$&"),yHe=jxe?gHe:hHe;function vHe(h,o){if(o?.caseSensitiveMatch===!1)return!0;let u=Xk.default.scan(h);return u.isGlob||u.negated}function N5(...h){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...h)}function bHe(h){return typeof h=="string"?[h]:h??[]}var mMt=/^(\/?\.\.)+/,_Mt=/\\(?=[()[\]{}!*+?@|])/g;function Vxe(h,o,u,b){var x;let L=o.cwd,j=h;h[h.length-1]==="/"&&(j=h.slice(0,-1)),j[j.length-1]!=="*"&&o.expandDirectories&&(j+="/**");let me=yHe(L);j=(0,mC.isAbsolute)(j.replace(_Mt,""))?mC.posix.relative(me,j):mC.posix.normalize(j);let Oe=(x=mMt.exec(j))===null||x===void 0?void 0:x[0],tt=_He(j);if(Oe){let dt=(Oe.length+1)/3,xe=0,yn=me.split("/");for(;xe<dt&&tt[xe+dt]===yn[yn.length+xe-dt];)j=j.slice(0,(dt-xe-1)*3)+j.slice((dt-xe)*3+tt[xe+dt].length+1)||".",xe++;let pt=mC.posix.join(L,Oe.slice(xe*3));pt[0]!=="."&&u.root.length>pt.length&&(u.root=pt,u.depthOffset=-dt+xe)}if(!b&&u.depthOffset>=0){var at;(at=u.commonPath)!==null&&at!==void 0||(u.commonPath=tt);let dt=[],xe=Math.min(u.commonPath.length,tt.length);for(let yn=0;yn<xe;yn++){let pt=tt[yn];if(pt==="**"&&!tt[yn+1]){dt.pop();break}if(yn===tt.length-1||pt!==u.commonPath[yn]||vHe(pt))break;dt.push(pt)}u.depthOffset=dt.length,u.commonPath=dt,u.root=dt.length>0?mC.posix.join(L,...dt):L}return j}function hMt(h,o,u){let b=[],x=[];for(let L of h.ignore)L&&(L[0]!=="!"||L[1]==="(")&&x.push(Vxe(L,h,u,!0));for(let L of o)L&&(L[0]!=="!"||L[1]==="("?b.push(Vxe(L,h,u,!1)):(L[1]!=="!"||L[2]==="(")&&x.push(Vxe(L.slice(1),h,u,!0)));return{match:b,ignore:x}}function gMt(h,o){let u=h.cwd,b={root:u,depthOffset:0},x=hMt(h,o,b);h.debug&&N5("internal processing patterns:",x);let{absolute:L,caseSensitiveMatch:j,debug:me,dot:Oe,followSymbolicLinks:tt,onlyDirectories:at}=h,dt=b.root.replace(mHe,""),xe={dot:Oe,nobrace:h.braceExpansion===!1,nocase:!j,noextglob:h.extglob===!1,noglobstar:h.globstar===!1,posix:!0},yn=(0,Xk.default)(x.match,xe),pt=(0,Xk.default)(x.ignore,xe),ut=rMt(x.match,xe),yi=pHe(u,dt,L),wi=L?yi:pHe(u,dt,!0),eo=(Sa,Lr)=>{let In=wi(Lr,!0);return In!=="."&&!ut(In)||pt(In)},qa;h.deep!==void 0&&(qa=Math.round(h.deep-b.depthOffset));let yl=new eMt.fdir({filters:[me?(Sa,Lr)=>{let In=yi(Sa,Lr),Ii=yn(In)&&!pt(In);return Ii&&N5(`matched ${In}`),Ii}:(Sa,Lr)=>{let In=yi(Sa,Lr);return yn(In)&&!pt(In)}],exclude:me?(Sa,Lr)=>{let In=eo(Sa,Lr);return N5(`${In?"skipped":"crawling"} ${Lr}`),In}:eo,fs:h.fs,pathSeparator:"/",relativePaths:!L,resolvePaths:L,includeBasePath:L,resolveSymlinks:tt,excludeSymlinks:!tt,excludeFiles:at,includeDirs:at||!h.onlyFiles,maxDepth:qa,signal:h.signal}).crawl(dt);return h.debug&&N5("internal properties:",{...b,root:dt}),[yl,u!==dt&&!L&&aMt(u,dt)]}function SHe(h,o){if(o)for(let u=h.length-1;u>=0;u--)h[u]=o(h[u]);return h}var yMt={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function vMt(h){let o={...yMt,...h};return o.cwd=(o.cwd instanceof URL?(0,ZRt.fileURLToPath)(o.cwd):(0,mC.resolve)(o.cwd)).replace(mHe,"/"),o.ignore=bHe(o.ignore),o.fs&&(o.fs={readdir:o.fs.readdir||P8.readdir,readdirSync:o.fs.readdirSync||P8.readdirSync,realpath:o.fs.realpath||P8.realpath,realpathSync:o.fs.realpathSync||P8.realpathSync,stat:o.fs.stat||P8.stat,statSync:o.fs.statSync||P8.statSync}),o.debug&&N5("globbing with options:",o),o}function THe(h,o={}){var u;if(h&&o?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let b=tMt(h)||typeof h=="string",x=bHe((u=b?h:h.patterns)!==null&&u!==void 0?u:"**/*"),L=vMt(b?o:h);return x.length>0?gMt(L,x):[]}async function bMt(h,o){let[u,b]=THe(h,o);return u?SHe(await u.withPromise(),b):[]}function SMt(h,o){let[u,b]=THe(h,o);return u?SHe(u.sync(),b):[]}$k.convertPathToPattern=uMt;$k.escapePath=yHe;$k.glob=bMt;$k.globSync=SMt;$k.isDynamicPattern=vHe});var WHe=Om(Zo=>{"use strict";var xv=rUe(),TMt=DUe(),EMt=PUe(),xMt=require("node:fs"),AMt=require("node:fs/promises"),DMt=require("node:os"),IMt=require("node:path"),xHe=EHe();function CMt(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}function R8(h){if(h&&typeof h=="object"&&"default"in h)return h;var o=Object.create(null);return h&&Object.keys(h).forEach(function(u){if(u!=="default"){var b=Object.getOwnPropertyDescriptor(h,u);Object.defineProperty(o,u,b.get?b:{enumerable:!0,get:function(){return h[u]}})}}),o.default=h,Object.freeze(o)}var aT=R8(xv),CHe=R8(TMt),Uxe=CMt(EMt),Ev=R8(xMt),PMt=R8(AMt),NMt=R8(DMt),BZ=R8(IMt),zZ=class{#e=new Map;getSize(){return this.#e.size}getValues(){return this.#e.values()}getValuesAsArray(){return Array.from(this.getValues())}getKeys(){return this.#e.keys()}getEntries(){return this.#e.entries()}getOrCreate(o,u){let b=this.get(o);return b==null&&(b=u(),this.set(o,b)),b}has(o){return this.#e.has(o)}get(o){return this.#e.get(o)}set(o,u){this.#e.set(o,u)}replaceKey(o,u){if(!this.#e.has(o))throw new Error("Key not found.");let b=this.#e.get(o);this.#e.delete(o),this.#e.set(u,b)}removeByKey(o){this.#e.delete(o)}clear(){this.#e.clear()}},GZ=class{#e;#t;constructor(o,u){this.#e=o,this.#t=u}compareTo(o){return this.#e.compareTo(this.#t,o)}},VZ=class h{static instance=new h;compareTo(o,u){let b=o.localeCompare(u,"en-us-u-kf-upper");return b<0?-1:b===0?0:1}},jZ=class{#e;#t;constructor(o,u){this.#t=o,this.#e=u}compareTo(o,u){return this.#e.compareTo(this.#t(o),this.#t(u))}},UZ=class{#e;#t;constructor(o,u){this.#t=o,this.#e=u}compareTo(o){return this.#e.compareTo(this.#t(o))}},HE=class{constructor(){}static isReadonlyArray(o){return o instanceof Array}static isNullOrEmpty(o){return!(o instanceof Array)||o.length===0}static getUniqueItems(o){return o.filter((u,b)=>o.indexOf(u)===b)}static removeFirst(o,u){let b=o.indexOf(u);return b===-1?!1:(o.splice(b,1),!0)}static removeAll(o,u){let b=[];for(let x=o.length-1;x>=0;x--)u(o[x])&&(b.push(o[x]),o.splice(x,1));return b}static*toIterator(o){for(let u of o)yield u}static sortByProperty(o,u){return o.sort((b,x)=>u(b)<=u(x)?-1:1),o}static groupBy(o,u){let b=[],x={};for(let L of o){let j=u(L).toString();x[j]==null&&(x[j]=[],b.push(x[j])),x[j].push(L)}return b}static binaryInsertWithOverwrite(o,u,b){let x=o.length-1,L=0;for(;L<=x;){let j=Math.floor((x+L)/2);b.compareTo(u,o[j])<0?x=j-1:L=j+1}o[x]!=null&&b.compareTo(u,o[x])===0?o[x]=u:o.splice(x+1,0,u)}static binarySearch(o,u){let b=o.length-1,x=0;for(;x<=b;){let L=Math.floor((b+x)/2),j=u.compareTo(o[L]);if(j===0)return L;j<0?b=L-1:x=L+1}return-1}static containsSubArray(o,u){let b=0;for(let x of o)if(u[b]===x){if(b++,b===u.length)return!0}else b=0;return!1}};function PHe(h){return o(h);function o(x){let L=Object.create(x.constructor.prototype);for(let j of Object.keys(x))L[j]=b(x[j]);return L}function u(x){return x.map(b)}function b(x){return x instanceof Array?u(x):typeof x=="object"?x===null?x:o(x):x}}var HZ=class{#e=[];subscribe(o){this.#t(o)===-1&&this.#e.push(o)}unsubscribe(o){let u=this.#t(o);u>=0&&this.#e.splice(u,1)}fire(o){for(let u of this.#e)u(o)}#t(o){return this.#e.indexOf(o)}},Jxe=class{static find(o,u){for(let b of o)if(u(b))return b}};function qxe(h,o){return o??h}var Xxe=class h{constructor(){}static clone(o){if(o==null)return;if(o instanceof Array)return u(o);return Object.assign({},o);function u(b){return b.map(x=>h.clone(x))}}};function NHe(h,o,u,b,x,L,j,me,Oe,tt){return aT.matchFiles.apply(this,arguments)}function RHe(h,o,u,b,x){return aT.getFileMatcherPatterns.apply(this,arguments)}function RMt(h){return aT.getEmitModuleResolutionKind.apply(this,arguments)}function MHe(h){return MMt()[h]}var N8;function MMt(){if(N8!=null)return N8;N8={};for(let h of Object.keys(aT.SyntaxKind).filter(o=>isNaN(parseInt(o,10)))){let o=aT.SyntaxKind[h];N8[o]==null&&(N8[o]=h)}return N8}Zo.errors=void 0;(function(h){class o extends Error{constructor(Ii,_i){let Fr=_i&&LMt(_i),bi=Fr?`${Ii}
434
434
 
435
435
  ${Fr}`:Ii;super(bi),this.message=bi}}h.BaseError=o;class u extends o{constructor(Ii,_i,Fr){super(`Argument Error (${Ii}): ${_i}`,Fr)}}h.ArgumentError=u;class b extends u{constructor(Ii,_i){super(Ii,"Cannot be null or whitespace.",_i)}}h.ArgumentNullOrWhitespaceError=b;class x extends u{constructor(Ii,_i,Fr,bi){super(Ii,`Range is ${Fr[0]} to ${Fr[1]}, but ${_i} was provided.`,bi)}}h.ArgumentOutOfRangeError=x;class L extends u{constructor(Ii,_i,Fr,bi){super(Ii,`Expected type '${_i}', but was '${Fr}'.`,bi)}}h.ArgumentTypeError=L;class j extends o{path;constructor(Ii,_i="Path"){super(`${_i} not found: ${Ii}`),this.path=Ii}code="ENOENT"}h.PathNotFoundError=j;class me extends j{constructor(Ii){super(Ii,"Directory")}}h.DirectoryNotFoundError=me;class Oe extends j{constructor(Ii){super(Ii,"File")}}h.FileNotFoundError=Oe;class tt extends o{constructor(Ii,_i){super(Ii,_i)}}h.InvalidOperationError=tt;class at extends o{constructor(Ii="Not implemented.",_i){super(Ii,_i)}}h.NotImplementedError=at;class dt extends o{constructor(Ii){super(Ii)}}h.NotSupportedError=dt;function xe(In,Ii,_i){if(typeof In!==Ii)throw new L(_i,Ii,typeof In)}h.throwIfNotType=xe;function yn(In,Ii){if(typeof In!="string")throw new L(Ii,"string",typeof In)}h.throwIfNotString=yn;function pt(In,Ii){if(yn(In,Ii),In.trim().length===0)throw new b(Ii)}h.throwIfWhitespaceOrNotString=pt;function ut(In,Ii,_i){if(In<Ii[0]||In>Ii[1])throw new x(_i,In,Ii)}h.throwIfOutOfRange=ut;function yi(In,Ii,_i){if(In[0]>In[1])throw new u(_i,`The start of a range must not be greater than the end: [${In[0]}, ${In[1]}]`);ut(In[0],Ii,_i),ut(In[1],Ii,_i)}h.throwIfRangeOutOfRange=yi;function wi(In,Ii){throw new at(`Not implemented feature for syntax kind '${MHe(In)}'.`,Ii)}h.throwNotImplementedForSyntaxKindError=wi;function eo(In,Ii){if(In<0)throw new u(Ii,"Expected a non-negative value.")}h.throwIfNegative=eo;function qa(In,Ii,_i){if(In==null)throw new tt(typeof Ii=="string"?Ii:Ii(),_i);return In}h.throwIfNullOrUndefined=qa;function yl(In,Ii){let _i=In;if(_i!=null&&typeof _i.kind=="number")return wi(_i.kind,Ii);throw new at(`Not implemented value: ${JSON.stringify(In)}`,Ii)}h.throwNotImplementedForNeverValueError=yl;function Sa(In,Ii,_i){if(In!==Ii)throw new tt(`Expected ${In} to equal ${Ii}. ${_i}`)}h.throwIfNotEqual=Sa;function Lr(In,Ii){if(In===!0)throw new tt(Ii)}h.throwIfTrue=Lr})(Zo.errors||(Zo.errors={}));function LMt(h){let o=kMt(h);if(o)return`${o.filePath}:${o.loc.line}:${o.loc.character}
436
436
  > ${o.loc.line} | ${o.lineText}`}function kMt(h){if(!wMt(h))return;let o=h.getSourceFile(),u=o.getFullText(),b=h.getStart(),x=u.lastIndexOf(`