@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/README.md +4 -1
- package/dist/astWorker.js +1 -1
- package/dist/graph-it.js +305 -273
- package/dist/indexerWorker.js +1 -1
- package/dist/mcpServer.mjs +89 -64
- package/dist/mcpWorker.js +189 -164
- package/dist/wasm/tree-sitter.wasm +0 -0
- package/docs/CLI.md +2 -0
- package/docs/README.md +1 -0
- package/package.json +21 -19
package/dist/indexerWorker.js
CHANGED
|
@@ -430,7 +430,7 @@ Project '${f.projectName}' (${dk[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: ${nE(t)}`);return}this.writeMessage(t)}writeMessage(t){let r=VSe(t,this.logger,this.byteLength,this.host.newLine);this.host.write(r)}event(t,r){this.send(jSe(r,t))}doOutput(t,r,i,a,l,c){let f={seq:0,type:"response",command:r,request_seq:i,success:a,performanceData:l&&_ze(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:b,...y}=t;f.body=y,p=b}else f.body=t;else f.body=t;p&&(f.metadata=p)}else L.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=ize(r,t)?ld: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=L.checkDefined(r.getScriptInfo(t)),p=Ws()-l,b={file:t,diagnostics:i.map(y=>oze(t,r,y)),spans:c?.map(y=>$h(y,f))};this.event(b,a),this.addDiagnosticsPerformanceData(t,a,p)}catch(f){this.logError(f,a)}}updateErrorCheck(t,r,i,a=!0){if(r.length===0)return;L.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,y)},b=(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()})}},y=()=>{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(i_(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",()=>b(C,N))});t.immediate("semanticCheck",()=>b(C,N))}};r.length>f&&this.changeSeq===l&&t.delay("checkOne",i,y)}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=>CW(f,!1))}convertToDiagnosticsWithLinePositionFromDiagnosticFile(t){return t.map(r=>({message:Hh(r.messageText,this.host.newLine),start:r.start,length:r.length,category:Bx(r),code:r.code,source:r.source,startLocation:r.file&&EN(fa(r.file,r.start)),endLocation:r.file&&EN(fa(r.file,r.start+r.length)),reportsUnnecessary:r.reportsUnnecessary,reportsDeprecated:r.reportsDeprecated,relatedInformation:vn(r.relatedInformation,SY)}))}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:Hh(i.messageText,this.host.newLine),start:i.start,length:i.length,category:Bx(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,SY)}))}getDiagnosticsWorker(t,r,i,a){let{project:l,file:c}=this.getFileAndProject(t);if(r&&ize(l,c))return ld;let f=l.getScriptInfoForNormalizedPath(c),p=i(l,c);return a?this.convertToDiagnosticsWithLinePosition(p,f):p.map(b=>oze(c,l,b))}getDefinition(t,r){let{file:i,project:a}=this.getFileAndProject(t),l=this.getPositionInFile(t,i),c=this.mapDefinitionInfoLocations(a.getLanguageService().getDefinitionAtPosition(i,l)||ld,a);return r?this.mapDefinitionInfo(c,a):c.map(BZ.mapToOriginalLocation)}mapDefinitionInfoLocations(t,r){return t.map(i=>{let a=pze(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=L.checkDefined(a.getScriptInfo(i)),f=a.getLanguageService().getDefinitionAndBoundSpan(i,l);if(!f||!f.definitions)return{definitions:ld,textSpan:void 0};let p=this.mapDefinitionInfoLocations(f.definitions,a),{textSpan:b}=f;return r?{definitions:this.mapDefinitionInfo(p,a),textSpan:$h(b,c)}:{definitions:p.map(BZ.mapToOriginalLocation),textSpan:b}}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||ld,a).slice();if(this.projectService.serverMode===0&&(!gt(f,C=>ws(C.fileName)!==i&&!C.isAmbient)||gt(f,C=>!!C.failedAliasResolution))){let C=E9(W=>W.textSpan.start,wq(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 j=S(W,a.getLanguageService().getProgram(),k.getProgram());if(gt(j)){for(let V of j)C.add(V);continue}}C.add(W)}else{let W=f.filter(j=>ws(j.fileName)!==i&&j.isAmbient);for(let j of gt(W)?W:y()){let V=b(j.fileName,i,N);if(!V)continue;let K=this.projectService.getOrCreateScriptInfoNotOpenedByClient(V,N.currentDirectory,N.directoryStructureHost,!1);if(!K)continue;N.containsScriptInfo(K)||(N.addRoot(K),N.updateGraph());let q=k.getProgram(),ee=L.checkDefined(q.getSourceFile(V));for(let ie of I(j.name,ee,q))C.add(ie)}}f=Co(C.values())}return f=f.filter(C=>!C.isAmbient&&!C.failedAliasResolution),this.mapDefinitionInfo(f,a);function b(C,N,k){var O,W,j;let V=T3(C);if(V&&C.lastIndexOf(dy)===V.topLevelNodeModulesIndex){let K=C.substring(0,V.packageRootIndex),q=(O=a.getModuleResolutionCache())==null?void 0:O.getPackageJsonInfoCache(),ee=a.getCompilationSettings(),ie=hL(bo(K,a.getCurrentDirectory()),_L(q,a,ee));if(!ie)return;let Y=rK(ie,{moduleResolution:2},a,a.getModuleResolutionCache()),Te=C.substring(V.topLevelPackageNameIndex+1,V.packageRootIndex),de=gL(YO(Te)),Q=a.toPath(C);if(Y&>(Y,ye=>a.toPath(ye)===Q))return(W=k.resolutionCache.resolveSingleModuleNameWithoutWatching(de,N).resolvedModule)==null?void 0:W.resolvedFileName;{let ye=C.substring(V.packageRootIndex+1),he=`${de}/${Gu(ye)}`;return(j=k.resolutionCache.resolveSingleModuleNameWithoutWatching(he,N).resolvedModule)==null?void 0:j.resolvedFileName}}}function y(){let C=a.getLanguageService(),N=C.getProgram(),k=Ap(N.getSourceFile(i),l);return(gs(k)||Ke(k))&&el(k.parent)&&Jce(k,O=>{var W;if(O===k)return;let j=(W=C.getDefinitionAtPosition(i,O.getStart(),!0,!1))==null?void 0:W.filter(V=>ws(V.fileName)!==i&&V.isAmbient).map(V=>({fileName:V.fileName,name:hm(k)}));if(gt(j))return j})||ld}function S(C,N,k){var O;let W=k.getSourceFile(C.fileName);if(!W)return;let j=Ap(N.getSourceFile(i),l),V=N.getTypeChecker().getSymbolAtLocation(j),K=V&&fl(V,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=nl.Core.getTopMostDeclarationNamesInFile(C,N);return Gi(O,W=>{let j=k.getTypeChecker().getSymbolAtLocation(W),V=fM(W);if(j&&V)return yN.createDefinitionInfo(V,k.getTypeChecker(),j,V,!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=>CW(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?(L.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,Wl(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)||ld,i);return this.mapDefinitionInfo(l,i)}mapImplementationLocations(t,r){return t.map(i=>{let a=pze(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)||ld,a);return r?c.map(({fileName:f,textSpan:p,contextSpan:b})=>this.toFileSpanWithContext(f,p,b,a)):c.map(BZ.mapToOriginalLocation)}getSyntacticDiagnosticsSync(t){let{configFile:r}=this.getConfigFileAndProject(t);return r?ld: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?ld: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 uyt(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 b=a.getScriptInfo(f);return{file:f,highlightSpans:p.map(({textSpan:y,kind:S,contextSpan:I})=>({...HSe(y,I,b),kind:S}))}}):c:ld}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:b,span:y,file:S})=>{if(y){L.assertIsDefined(S,"Target file should be defined together with its span.");let I=this.projectService.getScriptInfo(S);return{text:b,span:{start:I.positionToLineOffset(y.start),end:I.positionToLineOffset(y.start+y.length),file:S}}}else return{text:b}})}})}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(y=>y.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}})),b=c.mapCode(l,t.mapping.contents,p,i,a);return this.mapTextChangesToCodeEdits(b)}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 i_(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?ld:(this.projectService.logErrorForScriptInfoNotFound(t.file),iv.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),iv.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 iv.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),L.checkDefined(this.projectService.getScriptInfo(i)));if(!p.canRename)return r?{info:p,locs:[]}:[];let b=oyt(l,c,{fileName:t.file,pos:a},!!t.findInStrings,!!t.findInComments,f,this.host.useCaseSensitiveFileNames);return r?{info:p,locs:this.toSpanGroups(b)}:b}mapRenameInfo(t,r){if(t.canRename){let{canRename:i,fileToRename:a,displayName:l,fullDisplayName:c,kind:f,kindModifiers:p,triggerSpan:b}=t;return{canRename:i,fileToRename:a,displayName:l,fullDisplayName:c,kind:f,kindModifiers:p,triggerSpan:$h(b,r)}}else return t}toSpanGroups(t){let r=new Map;for(let{fileName:i,textSpan:a,contextSpan:l,originalContextSpan:c,originalTextSpan:f,originalFileName:p,...b}of t){let y=r.get(i);y||r.set(i,y={file:i,locs:[]});let S=L.checkDefined(this.projectService.getScriptInfo(i));y.locs.push({...HSe(a,l,S),...b})}return Co(r.values())}getReferences(t,r){let i=ws(t.file),a=this.getProjects(t),l=this.getPositionInFile(t,i),c=ayt(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),b=p.getScriptInfoForNormalizedPath(i),y=p.getLanguageService().getQuickInfoAtPosition(i,l),S=y?QF(y.displayParts):"",I=y&&y.textSpan,C=I?b.positionToLineOffset(I.start).offset:0,N=I?b.getSnapshot().getText(I.start,Wl(I)):"";return{refs:aa(c,O=>O.references.map(W=>gze(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=USe(i,this.getDefaultProject(t),c,c,cze,y=>(this.logger.info(`Finding references to file ${a} in project ${y.getProjectName()}`),y.getLanguageService().getFileReferences(a))),p;if(No(f))p=f;else{p=[];let y=TY(this.host.useCaseSensitiveFileNames);f.forEach(S=>{for(let I of S)y.has(I)||(p.push(I),y.add(I))})}return r?{refs:p.map(y=>gze(this.projectService,y,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:$h(f.textSpan,c),hintSpan:$h(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?TN(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 b=QF(f.displayParts);return{kind:f.kind,kindModifiers:f.kindModifiers,start:l.positionToLineOffset(f.textSpan.start),end:l.positionToLineOffset(Wl(f.textSpan)),displayString:b,documentation:p?this.mapDisplayParts(f.documentation,a):QF(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?TN(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?TN(t.options):this.getFormatOptions(r);return i.getFormattingEditsForDocument(r,a)}getFormattingEditsAfterKeystrokeFull(t){let{file:r,languageService:i}=this.getFileAndLanguageServiceForSyntacticOperation(t),a=t.options?TN(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||nyt(f,l))){let{lineText:p,absolutePosition:b}=a.textStorage.getAbsolutePositionAndLineText(t.line);if(p&&p.search("\\S")<0){let y=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(y!==S){let N=b+I;f.push({span:gc(b,N),newText:jc.getIndentationString(y,c)})}}}if(f)return f.map(p=>({start:a.positionToLineOffset(p.span.start),end:a.positionToLineOffset(Wl(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,{...DSe(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||"",b=Gi(f.entries,S=>{if(f.isMemberCompletion||fo(S.name.toLowerCase(),p.toLowerCase())){let I=S.replacementSpan?$h(S.replacementSpan,l):void 0;return{...S,replacementSpan:I,hasAction:S.hasAction||void 0,symbol:void 0}}});return r==="completions"?(f.metadata&&(b.metadata=f.metadata),b):{...f,optionalReplacementSpan:f.optionalReplacementSpan&&$h(f.optionalReplacementSpan,l),entries:b}}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,b=Gi(t.entryNames,y=>{let{name:S,source:I,data:C}=typeof y=="string"?{name:y,source:void 0,data:void 0}:y;return a.getLanguageService().getCompletionEntryDetails(i,c,S,f,I,this.getPreferences(i),C?ya(C,hyt):void 0)});return r?p?b:b.map(y=>({...y,tags:this.mapJSDocTagInfo(y.tags,a,!1)})):b.map(y=>({...y,codeActions:vn(y.codeActions,S=>this.mapCodeAction(S)),documentation:this.mapDisplayParts(y.documentation,a),tags:this.mapJSDocTagInfo(y.tags,a,p)}))}getCompileOnSaveAffectedFileList(t){let r=this.getProjects(t,!0,!0),i=this.projectService.getScriptInfo(t.file);return i?iyt(i,a=>this.projectService.getScriptInfoForPath(a),r,(a,l)=>{if(!a.compileOnSaveEnabled||!a.languageServiceEnabled||a.isOrphan())return;let c=a.getCompilationSettings();if(!(c.noEmit||Ed(l.fileName)&&!tyt(c)))return{projectFileName:a.getProjectName(),fileNames:a.getCompileOnSaveAffectedFileList(l),projectUsesOutFile:!!c.outFile}}):ld}emitFile(t){let{file:r,project:i}=this.getFileAndProject(t);if(i||iv.ThrowNoProject(),!i.languageServiceEnabled)return t.richResponse?{emitSkipped:!0,diagnostics:[]}:!1;let a=i.getScriptInfo(r),{emitSkipped:l,diagnostics:c}=i.emitFile(a,(f,p,b)=>this.host.writeFile(f,p,b));return t.richResponse?{emitSkipped:l,diagnostics:t.includeLinePosition?this.convertToDiagnosticsWithLinePositionFromDiagnosticFile(c):c.map(f=>CW(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 b=f.applicableSpan;return{...f,applicableSpan:{start:l.positionToLineOffset(b.start),end:l.positionToLineOffset(b.start+b.length)},items:this.mapSignatureHelpItems(f.items,a,p)}}else return p||!f?f:{...f,items:f.items.map(b=>({...b,tags:this.mapJSDocTagInfo(b.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);L.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=>$h(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=>$h(i,r)),nameSpan:t.nameSpan&&$h(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(Wl(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){L.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=>b(I));else{let I=this.getProjects(t);lze(I,void 0,C=>b(C))}return f;function b(I){let C=I.getLanguageService().getNavigateToItems(i,a,void 0,I.isNonTsProject(),c.excludeLibrarySymbolsInNavTo),N=fn(C,k=>y(k)&&!EY(uk(k),I));N.length&&f.push({project:I,navigateToItems:N})}function y(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 zX();if(t.file){let{file:i,project:a}=this.getFileAndProject(t);return a.getLanguageService().getSupportedCodeFixes(i)}let r=this.getProject(t.projectFileName);return r||iv.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),L.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:EN({line:f.range.start.line,character:f.range.start.offset}),end:EN({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:b}=c,y;if(f!==void 0&&p!==void 0){let S=a.getScriptInfoForNormalizedPath(ws(f));y=KSe(gI(S.getSnapshot()),f,p,b)}return{renameLocation:y,renameFilename:f,edits:this.mapTextChangesToCodeEdits(b),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(ck(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){L.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(b=>{let y=b.getLanguageService().getEditsForFileRename(i,a,l,c),S=[];for(let I of y)f.has(I.fileName)||(p.push(I),S.push(I.fileName));for(let I of S)f.add(I)}),r?p.map(b=>this.mapTextChangeToCodeEdit(b)):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(b){let y=b instanceof Error?b:new Error(b),S=a.getLanguageService(),I=[...S.getSyntacticDiagnostics(i),...S.getSemanticDiagnostics(i),...S.getSuggestionDiagnostics(i)].filter(N=>Vw(c,f-c,N.start,N.length)).map(N=>N.code),C=t.errorCodes.find(N=>!I.includes(N));throw C!==void 0&&(y.message+=`
|
|
432
432
|
Additional information: BADCLIENT: Bad error code, ${C} not found in range ${c}..${f} (found: ${I.join(", ")})`),y}return r?p.map(b=>this.mapCodeFixAction(b)):p}getCombinedCodeFix({scope:t,fixId:r},i){L.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 tD(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),L.fail("Expected isNewFile for (only) new files. "+JSON.stringify({isNewFile:!!t.isNewFile,hasScriptInfo:!!r}))),r?{fileName:t.fileName,textChanges:t.textChanges.map(i=>dyt(i,r))}:fyt(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=>$h(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=[],b=[],y=[],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):Ed(k)?y.push(k):b.push(k);let N=[...f,...p,...b,...y].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=L.checkDefined(this.projectService.getScriptInfo(a));return vn(i,f=>{let p=this.getPosition(f,c),b=l.getSmartSelectionRange(a,p);return r?this.mapSelectionRange(b,c):b})}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(b=>this.convertTextChangeToCodeEdit(b,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(b=>this.convertTextChangeToCodeEdit(b,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(b=>this.convertTextChangeToCodeEdit(b,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(b=>this.convertTextChangeToCodeEdit(b,p))}return f}mapSelectionRange(t,r){let i={textSpan:$h(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),iv.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:$h(t.span,r),selectionSpan:$h(t.selectionSpan,r)}}toProtocolCallHierarchyIncomingCall(t){let r=this.getScriptInfoFromProjectService(t.from.file);return{from:this.toProtocolCallHierarchyItem(t.from),fromSpans:t.fromSpans.map(i=>$h(i,r))}}toProtocolCallHierarchyOutgoingCall(t,r){return{to:this.toProtocolCallHierarchyItem(t.to),fromSpans:t.fromSpans.map(i=>$h(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&&$q(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:Hb(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){L.assert(this.currentRequestId===void 0),this.currentRequestId=t,this.cancellationToken.setRequest(t)}resetCurrentRequest(t){L.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:${nE(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 b,y=this.performanceData;this.logger.hasLevel(2)&&(b=this.hrtime(),this.logger.hasLevel(3)&&this.logger.info(`request:${wL(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=eyt(this.hrtime(b)).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 RR){(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=y}}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 _ze(e){let t=e.diagnosticsDuration&&Co(e.diagnosticsDuration,([r,i])=>({...i,file:r}));return{...e,diagnosticsDuration:t}}function $h(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Wl(e))}}function HSe(e,t,r){let i=$h(e,r),a=t&&$h(t,r);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}function dyt(e,t){return{start:hze(t,e.span.start),end:hze(t,Wl(e.span)),newText:e.newText}}function hze(e,t){return WSe(e)?pyt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function uyt(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 pyt(e){return{line:e.line+1,offset:e.character+1}}function fyt(e){L.assert(e.textChanges.length===1);let t=rs(e.textChanges);return L.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 KSe(e,t,r,i){let a=myt(e,t,i),{line:l,character:c}=WC(lD(a),r);return{line:l+1,offset:c+1}}function myt(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 gze(e,{fileName:t,textSpan:r,contextSpan:i,isWriteAccess:a,isDefinition:l},{disableLineTextInReferences:c}){let f=L.checkDefined(e.getScriptInfo(t)),p=HSe(r,i,f),b=c?void 0:_yt(f,p);return{file:t,...p,lineText:b,isWriteAccess:a,isDefinition:l}}function _yt(e,t){let r=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(r.start,Wl(r)).replace(/\r|\n/g,"")}function hyt(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 xN=4,JSe=(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))(JSe||{}),gyt=class{constructor(){this.goSubtree=!0,this.lineIndex=new PW,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new AN,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=PW.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 i7(i[S]);let b=this.startPath.length-2;for(;b>=0;){let S=this.startPath[b];f=S.insertAt(p,f),b--,p=S}let y=f.length;for(;y>0;){let S=new AN;S.add(this.lineIndex.root),f=S.insertAt(this.lineIndex.root,f),y=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 i7(""):new AN}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)}},yyt=class{constructor(e,t,r){this.pos=e,this.deleteLen=t,this.insertedText=r}getTextChangeRange(){return jw(Jd(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},xY=class F1{constructor(){this.changes=[],this.versions=new Array(F1.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%F1.maxVersions}currentVersionToIndex(){return this.currentVersion%F1.maxVersions}edit(t,r,i){this.changes.push(new yyt(t,r,i)),(this.changes.length>F1.changeNumberThreshold||r>F1.changeLengthThreshold||i&&i.length>F1.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 yze(this.currentVersion+1,this,r,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=F1.maxVersions&&(this.minVersion=this.currentVersion-F1.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 Jd(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 Nse(i)}else return;else return N6}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let r=new F1,i=new yze(0,r,new PW);r.versions[r.currentVersion]=i;let a=PW.linesFromText(t);return i.index.load(a.lines),r}};xY.changeNumberThreshold=8,xY.changeLengthThreshold=256,xY.maxVersions=8;var AY=xY,yze=class AUe{constructor(t,r,i,a=ld){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 AUe&&this.cache===t.cache)return this.version<=t.version?N6:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},PW=class Gxe{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 i7(t[i]);this.root=Gxe.buildTreeFromBottom(r)}else this.root=new AN}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 L.assert(r===0),i!==void 0?(this.load(Gxe.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 gyt,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:b}=this.positionToColumnAndLineText(f);p===0&&(r+=b.length,i=i?i+b:b)}if(this.root.walk(t,r,l),l.insertLines(i,c),this.checkEdits){let f=l.lineIndex.getText(0,l.lineIndex.getLength());L.assert(a===f,"buffer edit mismatch")}return l.lineIndex}}static buildTreeFromBottom(t){if(t.length<xN)return new AN(t);let r=new Array(Math.ceil(t.length/xN)),i=0;for(let a=0;a<r.length;a++){let l=Math.min(i+xN,t.length);r[a]=new AN(t.slice(i,l)),i=l}return this.buildTreeFromBottom(r)}static linesFromText(t){let r=lD(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}}},AN=class Vxe{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=L.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 Vxe;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 L.assert(r!==-1),r}insertAt(t,r){let i=this.findChildIndex(t),a=this.children.length,l=r.length;if(a<xN&&i===a-1&&l===1)return this.add(r[0]),this.updateCounts(),[];{let c=this.splitAfter(i),f=0;for(i++;i<xN&&f<l;)this.children[i]=r[f],i++,f++;let p=[],b=0;if(f<l){b=Math.ceil((l-f)/xN),p=new Array(b);let y=0;for(let I=0;I<b;I++)p[I]=new Vxe;let S=p[0];for(;f<l;)S.add(r[f]),f++,S.children.length===xN&&(y++,S=p[y]);for(let I=p.length-1;I>=0;I--)p[I].children.length===0&&p.pop()}c&&p.push(c),this.updateCounts();for(let y=0;y<b;y++)p[y].updateCounts();return p}}add(t){this.children.push(t),L.assert(this.children.length<=xN)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},i7=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}},vze=class DUe{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=Iw(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var r;return RS.validatePackageName(t)!==RS.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=eSe(t,r,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${nE(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:${nE(t)}`),t.kind){case XJ:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case Ez:{let a=(r=this.packageInstalledPromise)==null?void 0:r.get(t.id);L.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 a_e:{let a={message:t.message};this.event(a,"typesInstallerInitializationFailed");break}case $J:{let a={eventId:t.eventId,packages:t.packagesToInstall};this.event(a,"beginInstallTypes");break}case YJ:{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 Tz:{this.projectService.updateTypingsForProject(t);break}case Sz:{for(this.activeRequestCount>0?this.activeRequestCount--:L.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 xF: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:${nE(t)}`),this.installer.send(t)},DUe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};vze.requestDelayMillis=100;var bze=vze,Sze={};R(Sze,{ActionInvalidate:()=>Tz,ActionPackageInstalled:()=>Ez,ActionSet:()=>Sz,ActionWatchTypingLocations:()=>xF,Arguments:()=>QJ,AutoImportProviderProject:()=>SSe,AuxiliaryProject:()=>vSe,CharRangeSection:()=>JSe,CloseFileWatcherEvent:()=>fY,CommandNames:()=>aze,ConfigFileDiagEvent:()=>lY,ConfiguredProject:()=>TSe,ConfiguredProjectLoadKind:()=>CSe,CreateDirectoryWatcherEvent:()=>pY,CreateFileWatcherEvent:()=>uY,Errors:()=>iv,EventBeginInstallTypes:()=>$J,EventEndInstallTypes:()=>YJ,EventInitializationFailed:()=>a_e,EventTypesRegistry:()=>XJ,ExternalProject:()=>nY,GcTimer:()=>sSe,InferredProject:()=>ySe,LargeFileReferencedEvent:()=>sY,LineIndex:()=>PW,LineLeaf:()=>i7,LineNode:()=>AN,LogLevel:()=>Qbe,Msg:()=>Zbe,OpenFileInfoTelemetryEvent:()=>ESe,Project:()=>RI,ProjectInfoTelemetryEvent:()=>dY,ProjectKind:()=>dk,ProjectLanguageServiceStateEvent:()=>cY,ProjectLoadingFinishEvent:()=>aY,ProjectLoadingStartEvent:()=>oY,ProjectService:()=>FSe,ProjectsUpdatedInBackgroundEvent:()=>t7,ScriptInfo:()=>uSe,ScriptVersionCache:()=>AY,Session:()=>mze,TextStorage:()=>dSe,ThrottledOperations:()=>aSe,TypingsInstallerAdapter:()=>bze,allFilesAreJsOrDts:()=>_Se,allRootFilesAreJsOrDts:()=>mSe,asNormalizedPath:()=>MBe,convertCompilerOptions:()=>n7,convertFormatOptions:()=>TN,convertScriptKindName:()=>_Y,convertTypeAcquisition:()=>ASe,convertUserPreferences:()=>DSe,convertWatchOptions:()=>IW,countEachFileTypes:()=>EW,createInstallTypingsRequest:()=>eSe,createModuleSpecifierCache:()=>zSe,createNormalizedPathMap:()=>LBe,createPackageJsonCache:()=>GSe,createSortedArray:()=>oSe,emptyArray:()=>ld,findArgument:()=>LLe,formatDiagnosticToProtocol:()=>CW,formatMessage:()=>VSe,getBaseConfigFileName:()=>tY,getDetailWatchInfo:()=>vY,getLocationInNewDocument:()=>KSe,hasArgument:()=>MLe,hasNoTypeScriptSource:()=>hSe,indent:()=>wL,isBackgroundProject:()=>AW,isConfigFile:()=>WSe,isConfiguredProject:()=>ab,isDynamicFileName:()=>ck,isExternalProject:()=>xW,isInferredProject:()=>SN,isInferredProjectName:()=>tSe,isProjectDeferredClose:()=>DW,makeAutoImportProviderProjectName:()=>rSe,makeAuxiliaryProjectName:()=>iSe,makeInferredProjectName:()=>nSe,maxFileSize:()=>iY,maxProgramSizeForNonTsFiles:()=>rY,normalizedPathToPath:()=>bN,nowString:()=>kLe,nullCancellationToken:()=>rze,nullTypingsInstaller:()=>r7,protocol:()=>lSe,scriptInfoIsContainedByBackgroundProject:()=>pSe,scriptInfoIsContainedByDeferredClosedProject:()=>fSe,stringifyIndented:()=>nE,toEvent:()=>jSe,toNormalizedPath:()=>ws,tryConvertScriptKindName:()=>mY,typingsInstaller:()=>Ybe,updateProjectIfDirty:()=>i_}),typeof console<"u"&&(L.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 vUe},set exports(h){vUe=h,typeof zZ<"u"&&zZ.exports&&(zZ.exports=h)}})});var PUe=zm(ow=>{"use strict";Object.defineProperty(ow,"__esModule",{value:!0});ow.range=ow.balanced=void 0;var CPt=(h,o,d)=>{let g=h instanceof RegExp?CUe(h,d):h,E=o instanceof RegExp?CUe(o,d):o,R=g!==null&&E!=null&&(0,ow.range)(g,E,d);return R&&{start:R[0],end:R[1],pre:d.slice(0,R[0]),body:d.slice(R[0]+g.length,R[1]),post:d.slice(R[1]+E.length)}};ow.balanced=CPt;var CUe=(h,o)=>{let d=o.match(h);return d?d[0]:null},PPt=(h,o,d)=>{let g,E,R,G,le,Re=d.indexOf(h),nt=d.indexOf(o,Re+1),at=Re;if(Re>=0&&nt>0){if(h===o)return[Re,nt];for(g=[],R=d.length;at>=0&&!le;){if(at===Re)g.push(at),Re=d.indexOf(h,at+1);else if(g.length===1){let dt=g.pop();dt!==void 0&&(le=[dt,nt])}else E=g.pop(),E!==void 0&&E<R&&(R=E,G=nt),nt=d.indexOf(o,at+1);at=Re<nt&&Re>=0?Re:nt}g.length&&G!==void 0&&(le=[R,G])}return le};ow.range=PPt});var OUe=zm(O8=>{"use strict";Object.defineProperty(O8,"__esModule",{value:!0});O8.EXPANSION_MAX=void 0;O8.expand=VPt;var NUe=PUe(),RUe="\0SLASH"+Math.random()+"\0",MUe="\0OPEN"+Math.random()+"\0",Uxe="\0CLOSE"+Math.random()+"\0",LUe="\0COMMA"+Math.random()+"\0",kUe="\0PERIOD"+Math.random()+"\0",NPt=new RegExp(RUe,"g"),RPt=new RegExp(MUe,"g"),MPt=new RegExp(Uxe,"g"),LPt=new RegExp(LUe,"g"),kPt=new RegExp(kUe,"g"),wPt=/\\\\/g,OPt=/\\{/g,FPt=/\\}/g,WPt=/\\,/g,BPt=/\\\./g;O8.EXPANSION_MAX=1e5;function jxe(h){return isNaN(h)?h.charCodeAt(0):parseInt(h,10)}function zPt(h){return h.replace(wPt,RUe).replace(OPt,MUe).replace(FPt,Uxe).replace(WPt,LUe).replace(BPt,kUe)}function GPt(h){return h.replace(NPt,"\\").replace(RPt,"{").replace(MPt,"}").replace(LPt,",").replace(kPt,".")}function wUe(h){if(!h)return[""];let o=[],d=(0,NUe.balanced)("{","}",h);if(!d)return h.split(",");let{pre:g,body:E,post:R}=d,G=g.split(",");G[G.length-1]+="{"+E+"}";let le=wUe(R);return R.length&&(G[G.length-1]+=le.shift(),G.push.apply(G,le)),o.push.apply(o,G),o}function VPt(h,o={}){if(!h)return[];let{max:d=O8.EXPANSION_MAX}=o;return h.slice(0,2)==="{}"&&(h="\\{\\}"+h.slice(2)),k5(zPt(h),d,!0).map(GPt)}function jPt(h){return"{"+h+"}"}function UPt(h){return/^-?0\d/.test(h)}function HPt(h,o){return h<=o}function KPt(h,o){return h>=o}function k5(h,o,d){let g=[],E=(0,NUe.balanced)("{","}",h);if(!E)return[h];let R=E.pre,G=E.post.length?k5(E.post,o,!1):[""];if(/\$$/.test(E.pre))for(let le=0;le<G.length&&le<o;le++){let Re=R+"{"+E.body+"}"+G[le];g.push(Re)}else{let le=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(E.body),Re=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(E.body),nt=le||Re,at=E.body.indexOf(",")>=0;if(!nt&&!at)return E.post.match(/,(?!,).*\}/)?(h=E.pre+"{"+E.body+Uxe+E.post,k5(h,o,!0)):[h];let dt;if(nt)dt=E.body.split(/\.\./);else if(dt=wUe(E.body),dt.length===1&&dt[0]!==void 0&&(dt=k5(dt[0],o,!1).map(jPt),dt.length===1))return G.map(gn=>E.pre+dt[0]+gn);let xe;if(nt&&dt[0]!==void 0&&dt[1]!==void 0){let gn=jxe(dt[0]),pt=jxe(dt[1]),ut=Math.max(dt[0].length,dt[1].length),yi=dt.length===3&&dt[2]!==void 0?Math.max(Math.abs(jxe(dt[2])),1):1,wi=HPt;pt<gn&&(yi*=-1,wi=KPt);let qa=dt.some(UPt);xe=[];for(let bl=gn;wi(bl,pt);bl+=yi){let Sa;if(Re)Sa=String.fromCharCode(bl),Sa==="\\"&&(Sa="");else if(Sa=String(bl),qa){let Lr=ut-Sa.length;if(Lr>0){let In=new Array(Lr+1).join("0");bl<0?Sa="-"+In+Sa.slice(1):Sa=In+Sa}}xe.push(Sa)}}else{xe=[];for(let gn=0;gn<dt.length;gn++)xe.push.apply(xe,k5(dt[gn],o,!1))}for(let gn=0;gn<xe.length;gn++)for(let pt=0;pt<G.length&&g.length<o;pt++){let ut=R+xe[gn]+G[pt];(!d||nt||ut)&&g.push(ut)}}return g}});var FUe=zm(GZ=>{"use strict";Object.defineProperty(GZ,"__esModule",{value:!0});GZ.assertValidPattern=void 0;var JPt=1024*64,qPt=h=>{if(typeof h!="string")throw new TypeError("invalid pattern");if(h.length>JPt)throw new TypeError("pattern is too long")};GZ.assertValidPattern=qPt});var BUe=zm(VZ=>{"use strict";Object.defineProperty(VZ,"__esModule",{value:!0});VZ.parseClass=void 0;var XPt={"[: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]},w5=h=>h.replace(/[[\]\\-]/g,"\\$&"),$Pt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),WUe=h=>h.join(""),YPt=(h,o)=>{let d=o;if(h.charAt(d)!=="[")throw new Error("not in a brace expression");let g=[],E=[],R=d+1,G=!1,le=!1,Re=!1,nt=!1,at=d,dt="";e:for(;R<h.length;){let ut=h.charAt(R);if((ut==="!"||ut==="^")&&R===d+1){nt=!0,R++;continue}if(ut==="]"&&G&&!Re){at=R+1;break}if(G=!0,ut==="\\"&&!Re){Re=!0,R++;continue}if(ut==="["&&!Re){for(let[yi,[wi,eo,qa]]of Object.entries(XPt))if(h.startsWith(yi,R)){if(dt)return["$.",!1,h.length-d,!0];R+=yi.length,qa?E.push(wi):g.push(wi),le=le||eo;continue e}}if(Re=!1,dt){ut>dt?g.push(w5(dt)+"-"+w5(ut)):ut===dt&&g.push(w5(ut)),dt="",R++;continue}if(h.startsWith("-]",R+1)){g.push(w5(ut+"-")),R+=2;continue}if(h.startsWith("-",R+1)){dt=ut,R+=2;continue}g.push(w5(ut)),R++}if(at<R)return["",!1,0,!1];if(!g.length&&!E.length)return["$.",!1,h.length-d,!0];if(E.length===0&&g.length===1&&/^\\?.$/.test(g[0])&&!nt){let ut=g[0].length===2?g[0].slice(-1):g[0];return[$Pt(ut),!1,at-d,!1]}let xe="["+(nt?"^":"")+WUe(g)+"]",gn="["+(nt?"":"^")+WUe(E)+"]";return[g.length&&E.length?"("+xe+"|"+gn+")":g.length?xe:gn,le,at-d,!0]};VZ.parseClass=YPt});var UZ=zm(jZ=>{"use strict";Object.defineProperty(jZ,"__esModule",{value:!0});jZ.unescape=void 0;var QPt=(h,{windowsPathsNoEscape:o=!1,magicalBraces:d=!0}={})=>d?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");jZ.unescape=QPt});var Jxe=zm(qZ=>{"use strict";var wb;Object.defineProperty(qZ,"__esModule",{value:!0});qZ.AST=void 0;var ZPt=BUe(),HZ=UZ(),eNt=new Set(["!","?","+","*","@"]),Hxe=h=>eNt.has(h),zUe=h=>Hxe(h.type),tNt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),nNt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),rNt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),GUe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),iNt="(?!(?:^|/)\\.\\.?(?:$|/))",KZ="(?!\\.)",oNt=new Set(["[","."]),aNt=new Set(["..","."]),sNt=new Set("().*{}+?[]^$\\!"),lNt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Kxe="[^/]",VUe=Kxe+"*?",jUe=Kxe+"+?",cNt=0,JZ=class{type;#e;#t;#n=!1;#r=[];#i;#o;#a;#s=!1;#c;#m;#_=!1;id=++cNt;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,d,g={}){this.type=o,o&&(this.#t=!0),this.#i=d,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?g: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 d=o,g=d.#i;for(;g;){for(let E=d.#o+1;!g.type&&E<g.#r.length;E++)for(let R of o.#r){if(typeof R=="string")throw new Error("string part in extglob AST??");R.copyIn(g.#r[E])}d=g,g=d.#i}}return this}push(...o){for(let d of o)if(d!==""){if(typeof d!="string"&&!(d instanceof wb&&d.#i===this))throw new Error("invalid part: "+d);this.#r.push(d)}}toJSON(){let o=this.type===null?this.#r.slice().map(d=>typeof d=="string"?d:d.toJSON()):[this.type,...this.#r.map(d=>d.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 d=0;d<this.#o;d++){let g=o.#r[d];if(!(g instanceof wb&&g.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 d=new wb(this.type,o);for(let g of this.#r)d.copyIn(g);return d}static#S(o,d,g,E,R){let G=E.maxExtglobRecursion??2,le=!1,Re=!1,nt=-1,at=!1;if(d.type===null){let ut=g,yi="";for(;ut<o.length;){let wi=o.charAt(ut++);if(le||wi==="\\"){le=!le,yi+=wi;continue}if(Re){ut===nt+1?(wi==="^"||wi==="!")&&(at=!0):wi==="]"&&!(ut===nt+2&&at)&&(Re=!1),yi+=wi;continue}else if(wi==="["){Re=!0,nt=ut,at=!1,yi+=wi;continue}if(!E.noext&&Hxe(wi)&&o.charAt(ut)==="("&&R<=G){d.push(yi),yi="";let qa=new wb(wi,d);ut=wb.#S(o,qa,ut,E,R+1),d.push(qa);continue}yi+=wi}return d.push(yi),ut}let dt=g+1,xe=new wb(null,d),gn=[],pt="";for(;dt<o.length;){let ut=o.charAt(dt++);if(le||ut==="\\"){le=!le,pt+=ut;continue}if(Re){dt===nt+1?(ut==="^"||ut==="!")&&(at=!0):ut==="]"&&!(dt===nt+2&&at)&&(Re=!1),pt+=ut;continue}else if(ut==="["){Re=!0,nt=dt,at=!1,pt+=ut;continue}if(!E.noext&&Hxe(ut)&&o.charAt(dt)==="("&&(R<=G||d&&d.#u(ut))){let wi=d&&d.#u(ut)?0:1;xe.push(pt),pt="";let eo=new wb(ut,xe);xe.push(eo),dt=wb.#S(o,eo,dt,E,R+wi);continue}if(ut==="|"){xe.push(pt),pt="",gn.push(xe),xe=new wb(null,d);continue}if(ut===")")return pt===""&&d.#r.length===0&&(d.#_=!0),xe.push(pt),pt="",d.push(...gn,xe),dt;pt+=ut}return d.type=null,d.#t=void 0,d.#r=[o.substring(g-1)],dt}#g(o){return this.#y(o,nNt)}#y(o,d=tNt){if(!o||typeof o!="object"||o.type!==null||o.#r.length!==1||this.type===null)return!1;let g=o.#r[0];return!g||typeof g!="object"||g.type===null?!1:this.#u(g.type,d)}#u(o,d=rNt){return!!d.get(this.type)?.includes(o)}#p(o,d){let g=o.#r[0],E=new wb(null,g,this.options);E.#r.push(""),g.push(E),this.#h(o,d)}#h(o,d){let g=o.#r[0];this.#r.splice(d,1,...g.#r);for(let E of g.#r)typeof E=="object"&&(E.#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 d=o.#r[0];return!d||typeof d!="object"||d.type===null?!1:this.#T(d.type)}#v(o){let d=GUe.get(this.type),g=o.#r[0],E=d?.get(g.type);if(!E)return!1;this.#r=g.#r;for(let R of this.#r)typeof R=="object"&&(R.#i=this);this.type=E,this.#m=void 0,this.#_=!1}static fromGlob(o,d={}){let g=new wb(null,void 0,d);return wb.#S(o,g,0,d,0),g}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let o=this.toString(),[d,g,E,R]=this.toRegExpSource();if(!(E||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&o.toUpperCase()!==o.toLowerCase()))return g;let le=(this.#c.nocase?"i":"")+(R?"u":"");return Object.assign(new RegExp(`^${d}$`,le),{_src:d,_glob:o})}get options(){return this.#c}toRegExpSource(o){let d=o??!!this.#c.dot;if(this.#e===this&&(this.#l(),this.#E()),!zUe(this)){let Re=this.isStart()&&this.isEnd()&&!this.#r.some(gn=>typeof gn!="string"),nt=this.#r.map(gn=>{let[pt,ut,yi,wi]=typeof gn=="string"?wb.#x(gn,this.#t,Re):gn.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&&aNt.has(this.#r[0]))){let pt=oNt,ut=d&&pt.has(nt.charAt(0))||nt.startsWith("\\.")&&pt.has(nt.charAt(2))||nt.startsWith("\\.\\.")&&pt.has(nt.charAt(4)),yi=!d&&!o&&pt.has(nt.charAt(0));at=ut?iNt:yi?KZ:""}let dt="";return this.isEnd()&&this.#e.#s&&this.#i?.type==="!"&&(dt="(?:$|\\/)"),[at+nt+dt,(0,HZ.unescape)(nt),this.#t=!!this.#t,this.#n]}let g=this.type==="*"||this.type==="+",E=this.type==="!"?"(?:(?!(?:":"(?:",R=this.#d(d);if(this.isStart()&&this.isEnd()&&!R&&this.type!=="!"){let Re=this.toString(),nt=this;return nt.#r=[Re],nt.type=null,nt.#t=void 0,[Re,(0,HZ.unescape)(this.toString()),!1,!1]}let G=!g||o||d||!KZ?"":this.#d(!0);G===R&&(G=""),G&&(R=`(?:${R})(?:${G})*?`);let le="";if(this.type==="!"&&this.#_)le=(this.isStart()&&!d?KZ:"")+jUe;else{let Re=this.type==="!"?"))"+(this.isStart()&&!d&&!o?KZ:"")+VUe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&G?")":this.type==="*"&&G?")?":`)${this.type}`;le=E+R+Re}return[le,(0,HZ.unescape)(R),this.#t=!!this.#t,this.#n]}#l(){if(zUe(this)){let o=0,d=!1;do{d=!0;for(let g=0;g<this.#r.length;g++){let E=this.#r[g];typeof E=="object"&&(E.#l(),this.#y(E)?(d=!1,this.#h(E,g)):this.#g(E)?(d=!1,this.#p(E,g)):this.#f(E)&&(d=!1,this.#v(E)))}}while(!d&&++o<10)}else for(let o of this.#r)typeof o=="object"&&o.#l();this.#m=void 0}#d(o){return this.#r.map(d=>{if(typeof d=="string")throw new Error("string type in extglob ast??");let[g,E,R,G]=d.toRegExpSource(o);return this.#n=this.#n||G,g}).filter(d=>!(this.isStart()&&this.isEnd())||!!d).join("|")}static#x(o,d,g=!1){let E=!1,R="",G=!1,le=!1;for(let Re=0;Re<o.length;Re++){let nt=o.charAt(Re);if(E){E=!1,R+=(sNt.has(nt)?"\\":"")+nt;continue}if(nt==="*"){if(le)continue;le=!0,R+=g&&/^[*]+$/.test(o)?jUe:VUe,d=!0;continue}else le=!1;if(nt==="\\"){Re===o.length-1?R+="\\\\":E=!0;continue}if(nt==="["){let[at,dt,xe,gn]=(0,ZPt.parseClass)(o,Re);if(xe){R+=at,G=G||dt,Re+=xe-1,d=d||gn;continue}}if(nt==="?"){R+=Kxe,d=!0;continue}R+=lNt(nt)}return[R,(0,HZ.unescape)(o),!!d,G]}};qZ.AST=JZ;wb=JZ});var qxe=zm(XZ=>{"use strict";Object.defineProperty(XZ,"__esModule",{value:!0});XZ.escape=void 0;var dNt=(h,{windowsPathsNoEscape:o=!1,magicalBraces:d=!1}={})=>d?o?h.replace(/[?*()[\]{}]/g,"[$&]"):h.replace(/[?*()[\]\\{}]/g,"\\$&"):o?h.replace(/[?*()[\]]/g,"[$&]"):h.replace(/[?*()[\]\\]/g,"\\$&");XZ.escape=dNt});var $Ue=zm(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 uNt=OUe(),$Z=FUe(),KUe=Jxe(),pNt=qxe(),fNt=UZ(),mNt=(h,o,d={})=>((0,$Z.assertValidPattern)(o),!d.nocomment&&o.charAt(0)==="#"?!1:new aw(o,d).match(h));ms.minimatch=mNt;var _Nt=/^\*+([^+@!?\*\[\(]*)$/,hNt=h=>o=>!o.startsWith(".")&&o.endsWith(h),gNt=h=>o=>o.endsWith(h),yNt=h=>(h=h.toLowerCase(),o=>!o.startsWith(".")&&o.toLowerCase().endsWith(h)),vNt=h=>(h=h.toLowerCase(),o=>o.toLowerCase().endsWith(h)),bNt=/^\*+\.\*+$/,SNt=h=>!h.startsWith(".")&&h.includes("."),TNt=h=>h!=="."&&h!==".."&&h.includes("."),ENt=/^\.\*+$/,xNt=h=>h!=="."&&h!==".."&&h.startsWith("."),ANt=/^\*+$/,DNt=h=>h.length!==0&&!h.startsWith("."),INt=h=>h.length!==0&&h!=="."&&h!=="..",CNt=/^\?+([^+@!?\*\[\(]*)?$/,PNt=([h,o=""])=>{let d=JUe([h]);return o?(o=o.toLowerCase(),g=>d(g)&&g.toLowerCase().endsWith(o)):d},NNt=([h,o=""])=>{let d=qUe([h]);return o?(o=o.toLowerCase(),g=>d(g)&&g.toLowerCase().endsWith(o)):d},RNt=([h,o=""])=>{let d=qUe([h]);return o?g=>d(g)&&g.endsWith(o):d},MNt=([h,o=""])=>{let d=JUe([h]);return o?g=>d(g)&&g.endsWith(o):d},JUe=([h])=>{let o=h.length;return d=>d.length===o&&!d.startsWith(".")},qUe=([h])=>{let o=h.length;return d=>d.length===o&&d!=="."&&d!==".."},XUe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",UUe={win32:{sep:"\\"},posix:{sep:"/"}};ms.sep=XUe==="win32"?UUe.win32.sep:UUe.posix.sep;ms.minimatch.sep=ms.sep;ms.GLOBSTAR=Symbol("globstar **");ms.minimatch.GLOBSTAR=ms.GLOBSTAR;var LNt="[^/]",kNt=LNt+"*?",wNt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ONt="(?:(?!(?:\\/|^)\\.).)*?",FNt=(h,o={})=>d=>(0,ms.minimatch)(d,h,o);ms.filter=FNt;ms.minimatch.filter=ms.filter;var QE=(h,o={})=>Object.assign({},h,o),WNt=h=>{if(!h||typeof h!="object"||!Object.keys(h).length)return ms.minimatch;let o=ms.minimatch;return Object.assign((g,E,R={})=>o(g,E,QE(h,R)),{Minimatch:class extends o.Minimatch{constructor(E,R={}){super(E,QE(h,R))}static defaults(E){return o.defaults(QE(h,E)).Minimatch}},AST:class extends o.AST{constructor(E,R,G={}){super(E,R,QE(h,G))}static fromGlob(E,R={}){return o.AST.fromGlob(E,QE(h,R))}},unescape:(g,E={})=>o.unescape(g,QE(h,E)),escape:(g,E={})=>o.escape(g,QE(h,E)),filter:(g,E={})=>o.filter(g,QE(h,E)),defaults:g=>o.defaults(QE(h,g)),makeRe:(g,E={})=>o.makeRe(g,QE(h,E)),braceExpand:(g,E={})=>o.braceExpand(g,QE(h,E)),match:(g,E,R={})=>o.match(g,E,QE(h,R)),sep:o.sep,GLOBSTAR:ms.GLOBSTAR})};ms.defaults=WNt;ms.minimatch.defaults=ms.defaults;var BNt=(h,o={})=>((0,$Z.assertValidPattern)(h),o.nobrace||!/\{(?:(?!\{).)*\}/.test(h)?[h]:(0,uNt.expand)(h,{max:o.braceExpandMax}));ms.braceExpand=BNt;ms.minimatch.braceExpand=ms.braceExpand;var zNt=(h,o={})=>new aw(h,o).makeRe();ms.makeRe=zNt;ms.minimatch.makeRe=ms.makeRe;var GNt=(h,o,d={})=>{let g=new aw(o,d);return h=h.filter(E=>g.match(E)),g.options.nonull&&!h.length&&h.push(o),h};ms.match=GNt;ms.minimatch.match=ms.match;var HUe=/[?*]|[+@!]\(.*?\)|\[|\]/,VNt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),aw=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(o,d={}){(0,$Z.assertValidPattern)(o),d=d||{},this.options=d,this.maxGlobstarRecursion=d.maxGlobstarRecursion??200,this.pattern=o,this.platform=d.platform||XUe,this.isWindows=this.platform==="win32";let g="allowWindowsEscape";this.windowsPathsNoEscape=!!d.windowsPathsNoEscape||d[g]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!d.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!d.nonegate,this.comment=!1,this.empty=!1,this.partial=!!d.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=d.windowsNoMagicRoot!==void 0?d.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 d of o)if(typeof d!="string")return!0;return!1}debug(...o){}make(){let o=this.pattern,d=this.options;if(!d.nocomment&&o.charAt(0)==="#"){this.comment=!0;return}if(!o){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],d.debug&&(this.debug=(...R)=>console.error(...R)),this.debug(this.pattern,this.globSet);let g=this.globSet.map(R=>this.slashSplit(R));this.globParts=this.preprocess(g),this.debug(this.pattern,this.globParts);let E=this.globParts.map((R,G,le)=>{if(this.isWindows&&this.windowsNoMagicRoot){let Re=R[0]===""&&R[1]===""&&(R[2]==="?"||!HUe.test(R[2]))&&!HUe.test(R[3]),nt=/^[a-z]:/i.test(R[0]);if(Re)return[...R.slice(0,4),...R.slice(4).map(at=>this.parse(at))];if(nt)return[R[0],...R.slice(1).map(at=>this.parse(at))]}return R.map(Re=>this.parse(Re))});if(this.debug(this.pattern,E),this.set=E.filter(R=>R.indexOf(!1)===-1),this.isWindows)for(let R=0;R<this.set.length;R++){let G=this.set[R];G[0]===""&&G[1]===""&&this.globParts[R][2]==="?"&&typeof G[3]=="string"&&/^[a-z]:$/i.test(G[3])&&(G[2]="?")}this.debug(this.pattern,this.set)}preprocess(o){if(this.options.noglobstar)for(let g=0;g<o.length;g++)for(let E=0;E<o[g].length;E++)o[g][E]==="**"&&(o[g][E]="*");let{optimizationLevel:d=1}=this.options;return d>=2?(o=this.firstPhasePreProcess(o),o=this.secondPhasePreProcess(o)):d>=1?o=this.levelOneOptimize(o):o=this.adjascentGlobstarOptimize(o),o}adjascentGlobstarOptimize(o){return o.map(d=>{let g=-1;for(;(g=d.indexOf("**",g+1))!==-1;){let E=g;for(;d[E+1]==="**";)E++;E!==g&&d.splice(g,E-g)}return d})}levelOneOptimize(o){return o.map(d=>(d=d.reduce((g,E)=>{let R=g[g.length-1];return E==="**"&&R==="**"?g:E===".."&&R&&R!==".."&&R!=="."&&R!=="**"?(g.pop(),g):(g.push(E),g)},[]),d.length===0?[""]:d))}levelTwoFileOptimize(o){Array.isArray(o)||(o=this.slashSplit(o));let d=!1;do{if(d=!1,!this.preserveMultipleSlashes){for(let E=1;E<o.length-1;E++){let R=o[E];E===1&&R===""&&o[0]===""||(R==="."||R==="")&&(d=!0,o.splice(E,1),E--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(d=!0,o.pop())}let g=0;for(;(g=o.indexOf("..",g+1))!==-1;){let E=o[g-1];E&&E!=="."&&E!==".."&&E!=="**"&&(d=!0,o.splice(g-1,2),g-=2)}}while(d);return o.length===0?[""]:o}firstPhasePreProcess(o){let d=!1;do{d=!1;for(let g of o){let E=-1;for(;(E=g.indexOf("**",E+1))!==-1;){let G=E;for(;g[G+1]==="**";)G++;G>E&&g.splice(E+1,G-E);let le=g[E+1],Re=g[E+2],nt=g[E+3];if(le!==".."||!Re||Re==="."||Re===".."||!nt||nt==="."||nt==="..")continue;d=!0,g.splice(E,1);let at=g.slice(0);at[E]="**",o.push(at),E--}if(!this.preserveMultipleSlashes){for(let G=1;G<g.length-1;G++){let le=g[G];G===1&&le===""&&g[0]===""||(le==="."||le==="")&&(d=!0,g.splice(G,1),G--)}g[0]==="."&&g.length===2&&(g[1]==="."||g[1]==="")&&(d=!0,g.pop())}let R=0;for(;(R=g.indexOf("..",R+1))!==-1;){let G=g[R-1];if(G&&G!=="."&&G!==".."&&G!=="**"){d=!0;let Re=R===1&&g[R+1]==="**"?["."]:[];g.splice(R-1,2,...Re),g.length===0&&g.push(""),R-=2}}}}while(d);return o}secondPhasePreProcess(o){for(let d=0;d<o.length-1;d++)for(let g=d+1;g<o.length;g++){let E=this.partsMatch(o[d],o[g],!this.preserveMultipleSlashes);if(E){o[d]=[],o[g]=E;break}}return o.filter(d=>d.length)}partsMatch(o,d,g=!1){let E=0,R=0,G=[],le="";for(;E<o.length&&R<d.length;)if(o[E]===d[R])G.push(le==="b"?d[R]:o[E]),E++,R++;else if(g&&o[E]==="**"&&d[R]===o[E+1])G.push(o[E]),E++;else if(g&&d[R]==="**"&&o[E]===d[R+1])G.push(d[R]),R++;else if(o[E]==="*"&&d[R]&&(this.options.dot||!d[R].startsWith("."))&&d[R]!=="**"){if(le==="b")return!1;le="a",G.push(o[E]),E++,R++}else if(d[R]==="*"&&o[E]&&(this.options.dot||!o[E].startsWith("."))&&o[E]!=="**"){if(le==="a")return!1;le="b",G.push(d[R]),E++,R++}else return!1;return o.length===d.length&&G}parseNegate(){if(this.nonegate)return;let o=this.pattern,d=!1,g=0;for(let E=0;E<o.length&&o.charAt(E)==="!";E++)d=!d,g++;g&&(this.pattern=o.slice(g)),this.negate=d}matchOne(o,d,g=!1){let E=0,R=0;if(this.isWindows){let le=typeof o[0]=="string"&&/^[a-z]:$/i.test(o[0]),Re=!le&&o[0]===""&&o[1]===""&&o[2]==="?"&&/^[a-z]:$/i.test(o[3]),nt=typeof d[0]=="string"&&/^[a-z]:$/i.test(d[0]),at=!nt&&d[0]===""&&d[1]===""&&d[2]==="?"&&typeof d[3]=="string"&&/^[a-z]:$/i.test(d[3]),dt=Re?3:le?0:void 0,xe=at?3:nt?0:void 0;if(typeof dt=="number"&&typeof xe=="number"){let[gn,pt]=[o[dt],d[xe]];gn.toLowerCase()===pt.toLowerCase()&&(d[xe]=gn,R=xe,E=dt)}}let{optimizationLevel:G=1}=this.options;return G>=2&&(o=this.levelTwoFileOptimize(o)),d.includes(ms.GLOBSTAR)?this.#e(o,d,g,E,R):this.#n(o,d,g,E,R)}#e(o,d,g,E,R){let G=d.indexOf(ms.GLOBSTAR,R),le=d.lastIndexOf(ms.GLOBSTAR),[Re,nt,at]=g?[d.slice(R,G),d.slice(G+1),[]]:[d.slice(R,G),d.slice(G+1,le),d.slice(le+1)];if(Re.length){let eo=o.slice(E,E+Re.length);if(!this.#n(eo,Re,g,0,0))return!1;E+=Re.length,R+=Re.length}let dt=0;if(at.length){if(at.length+E>o.length)return!1;let eo=o.length-at.length;if(this.#n(o,at,g,eo,0))dt=at.length;else{if(o[o.length-1]!==""||E+at.length===o.length||(eo--,!this.#n(o,at,g,eo,0)))return!1;dt=at.length+1}}if(!nt.length){let eo=!!dt;for(let qa=E;qa<o.length-dt;qa++){let bl=String(o[qa]);if(eo=!0,bl==="."||bl===".."||!this.options.dot&&bl.startsWith("."))return!1}return g||eo}let xe=[[[],0]],gn=xe[0],pt=0,ut=[0];for(let eo of nt)eo===ms.GLOBSTAR?(ut.push(pt),gn=[[],0],xe.push(gn)):(gn[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,E,0,g,0,!!dt)}#t(o,d,g,E,R,G,le){let Re=d[E];if(!Re){for(let dt=g;dt<o.length;dt++){le=!0;let xe=o[dt];if(xe==="."||xe===".."||!this.options.dot&&xe.startsWith("."))return!1}return le}let[nt,at]=Re;for(;g<=at;){if(this.#n(o.slice(0,g+nt.length),nt,R,g,0)&&G<this.maxGlobstarRecursion){let gn=this.#t(o,d,g+nt.length,E+1,R,G+1,le);if(gn!==!1)return gn}let xe=o[g];if(xe==="."||xe===".."||!this.options.dot&&xe.startsWith("."))return!1;g++}return R||null}#n(o,d,g,E,R){let G,le,Re,nt;for(G=E,le=R,nt=o.length,Re=d.length;G<nt&&le<Re;G++,le++){this.debug("matchOne loop");let at=d[le],dt=o[G];if(this.debug(d,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(G===nt&&le===Re)return!0;if(G===nt)return g;if(le===Re)return G===nt-1&&o[G]==="";throw new Error("wtf?")}braceExpand(){return(0,ms.braceExpand)(this.pattern,this.options)}parse(o){(0,$Z.assertValidPattern)(o);let d=this.options;if(o==="**")return ms.GLOBSTAR;if(o==="")return"";let g,E=null;(g=o.match(ANt))?E=d.dot?INt:DNt:(g=o.match(_Nt))?E=(d.nocase?d.dot?vNt:yNt:d.dot?gNt:hNt)(g[1]):(g=o.match(CNt))?E=(d.nocase?d.dot?NNt:PNt:d.dot?RNt:MNt)(g):(g=o.match(bNt))?E=d.dot?TNt:SNt:(g=o.match(ENt))&&(E=xNt);let R=KUe.AST.fromGlob(o,this.options).toMMPattern();return E&&typeof R=="object"&&Reflect.defineProperty(R,"test",{value:E}),R}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let o=this.set;if(!o.length)return this.regexp=!1,this.regexp;let d=this.options,g=d.noglobstar?kNt:d.dot?wNt:ONt,E=new Set(d.nocase?["i"]:[]),R=o.map(Re=>{let nt=Re.map(dt=>{if(dt instanceof RegExp)for(let xe of dt.flags.split(""))E.add(xe);return typeof dt=="string"?VNt(dt):dt===ms.GLOBSTAR?ms.GLOBSTAR:dt._src});nt.forEach((dt,xe)=>{let gn=nt[xe+1],pt=nt[xe-1];dt!==ms.GLOBSTAR||pt===ms.GLOBSTAR||(pt===void 0?gn!==void 0&&gn!==ms.GLOBSTAR?nt[xe+1]="(?:\\/|"+g+"\\/)?"+gn:nt[xe]=g:gn===void 0?nt[xe-1]=pt+"(?:\\/|\\/"+g+")?":gn!==ms.GLOBSTAR&&(nt[xe-1]=pt+"(?:\\/|\\/"+g+"\\/)"+gn,nt[xe+1]=ms.GLOBSTAR))});let at=nt.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("|"),[G,le]=o.length>1?["(?:",")"]:["",""];R="^"+G+R+le+"$",this.partial&&(R="^(?:\\/|"+G+R.slice(1,-1)+le+")$"),this.negate&&(R="^(?!"+R+").+$");try{this.regexp=new RegExp(R,[...E].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,d=this.partial){if(this.debug("match",o,this.pattern),this.comment)return!1;if(this.empty)return o==="";if(o==="/"&&d)return!0;let g=this.options;this.isWindows&&(o=o.split("\\").join("/"));let E=this.slashSplit(o);this.debug(this.pattern,"split",E);let R=this.set;this.debug(this.pattern,"set",R);let G=E[E.length-1];if(!G)for(let le=E.length-2;!G&&le>=0;le--)G=E[le];for(let le=0;le<R.length;le++){let Re=R[le],nt=E;if(g.matchBase&&Re.length===1&&(nt=[G]),this.matchOne(nt,Re,d))return g.flipNegate?!0:!this.negate}return g.flipNegate?!1:this.negate}static defaults(o){return ms.minimatch.defaults(o).Minimatch}};ms.Minimatch=aw;var jNt=Jxe();Object.defineProperty(ms,"AST",{enumerable:!0,get:function(){return jNt.AST}});var UNt=qxe();Object.defineProperty(ms,"escape",{enumerable:!0,get:function(){return UNt.escape}});var HNt=UZ();Object.defineProperty(ms,"unescape",{enumerable:!0,get:function(){return HNt.unescape}});ms.minimatch.AST=KUe.AST;ms.minimatch.Minimatch=aw;ms.minimatch.escape=pNt.escape;ms.minimatch.unescape=fNt.unescape});var ZUe=zm((rFt,QUe)=>{"use strict";function W1(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function YUe(h,o){for(var d="",g=0,E=-1,R=0,G,le=0;le<=h.length;++le){if(le<h.length)G=h.charCodeAt(le);else{if(G===47)break;G=47}if(G===47){if(!(E===le-1||R===1))if(E!==le-1&&R===2){if(d.length<2||g!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var Re=d.lastIndexOf("/");if(Re!==d.length-1){Re===-1?(d="",g=0):(d=d.slice(0,Re),g=d.length-1-d.lastIndexOf("/")),E=le,R=0;continue}}else if(d.length===2||d.length===1){d="",g=0,E=le,R=0;continue}}o&&(d.length>0?d+="/..":d="..",g=2)}else d.length>0?d+="/"+h.slice(E+1,le):d=h.slice(E+1,le),g=le-E-1;E=le,R=0}else G===46&&R!==-1?++R:R=-1}return d}function KNt(h,o){var d=o.dir||o.root,g=o.base||(o.name||"")+(o.ext||"");return d?d===o.root?d+g:d+h+g:g}var F8={resolve:function(){for(var o="",d=!1,g,E=arguments.length-1;E>=-1&&!d;E--){var R;E>=0?R=arguments[E]:(g===void 0&&(g=process.cwd()),R=g),W1(R),R.length!==0&&(o=R+"/"+o,d=R.charCodeAt(0)===47)}return o=YUe(o,!d),d?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(W1(o),o.length===0)return".";var d=o.charCodeAt(0)===47,g=o.charCodeAt(o.length-1)===47;return o=YUe(o,!d),o.length===0&&!d&&(o="."),o.length>0&&g&&(o+="/"),d?"/"+o:o},isAbsolute:function(o){return W1(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,d=0;d<arguments.length;++d){var g=arguments[d];W1(g),g.length>0&&(o===void 0?o=g:o+="/"+g)}return o===void 0?".":F8.normalize(o)},relative:function(o,d){if(W1(o),W1(d),o===d||(o=F8.resolve(o),d=F8.resolve(d),o===d))return"";for(var g=1;g<o.length&&o.charCodeAt(g)===47;++g);for(var E=o.length,R=E-g,G=1;G<d.length&&d.charCodeAt(G)===47;++G);for(var le=d.length,Re=le-G,nt=R<Re?R:Re,at=-1,dt=0;dt<=nt;++dt){if(dt===nt){if(Re>nt){if(d.charCodeAt(G+dt)===47)return d.slice(G+dt+1);if(dt===0)return d.slice(G+dt)}else R>nt&&(o.charCodeAt(g+dt)===47?at=dt:dt===0&&(at=0));break}var xe=o.charCodeAt(g+dt),gn=d.charCodeAt(G+dt);if(xe!==gn)break;xe===47&&(at=dt)}var pt="";for(dt=g+at+1;dt<=E;++dt)(dt===E||o.charCodeAt(dt)===47)&&(pt.length===0?pt+="..":pt+="/..");return pt.length>0?pt+d.slice(G+at):(G+=at,d.charCodeAt(G)===47&&++G,d.slice(G))},_makeLong:function(o){return o},dirname:function(o){if(W1(o),o.length===0)return".";for(var d=o.charCodeAt(0),g=d===47,E=-1,R=!0,G=o.length-1;G>=1;--G)if(d=o.charCodeAt(G),d===47){if(!R){E=G;break}}else R=!1;return E===-1?g?"/":".":g&&E===1?"//":o.slice(0,E)},basename:function(o,d){if(d!==void 0&&typeof d!="string")throw new TypeError('"ext" argument must be a string');W1(o);var g=0,E=-1,R=!0,G;if(d!==void 0&&d.length>0&&d.length<=o.length){if(d.length===o.length&&d===o)return"";var le=d.length-1,Re=-1;for(G=o.length-1;G>=0;--G){var nt=o.charCodeAt(G);if(nt===47){if(!R){g=G+1;break}}else Re===-1&&(R=!1,Re=G+1),le>=0&&(nt===d.charCodeAt(le)?--le===-1&&(E=G):(le=-1,E=Re))}return g===E?E=Re:E===-1&&(E=o.length),o.slice(g,E)}else{for(G=o.length-1;G>=0;--G)if(o.charCodeAt(G)===47){if(!R){g=G+1;break}}else E===-1&&(R=!1,E=G+1);return E===-1?"":o.slice(g,E)}},extname:function(o){W1(o);for(var d=-1,g=0,E=-1,R=!0,G=0,le=o.length-1;le>=0;--le){var Re=o.charCodeAt(le);if(Re===47){if(!R){g=le+1;break}continue}E===-1&&(R=!1,E=le+1),Re===46?d===-1?d=le:G!==1&&(G=1):d!==-1&&(G=-1)}return d===-1||E===-1||G===0||G===1&&d===E-1&&d===g+1?"":o.slice(d,E)},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 KNt("/",o)},parse:function(o){W1(o);var d={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return d;var g=o.charCodeAt(0),E=g===47,R;E?(d.root="/",R=1):R=0;for(var G=-1,le=0,Re=-1,nt=!0,at=o.length-1,dt=0;at>=R;--at){if(g=o.charCodeAt(at),g===47){if(!nt){le=at+1;break}continue}Re===-1&&(nt=!1,Re=at+1),g===46?G===-1?G=at:dt!==1&&(dt=1):G!==-1&&(dt=-1)}return G===-1||Re===-1||dt===0||dt===1&&G===Re-1&&G===le+1?Re!==-1&&(le===0&&E?d.base=d.name=o.slice(1,Re):d.base=d.name=o.slice(le,Re)):(le===0&&E?(d.name=o.slice(1,G),d.base=o.slice(1,Re)):(d.name=o.slice(le,G),d.base=o.slice(le,Re)),d.ext=o.slice(G,Re)),le>0?d.dir=o.slice(0,le-1):E&&(d.dir="/"),d},sep:"/",delimiter:":",win32:null,posix:null};F8.posix=F8;QUe.exports=F8});var O5=zm((iFt,iHe)=>{"use strict";var eHe="[^\\\\/]",JNt="(?=.)",tHe="[^/]",Xxe="(?:\\/|$)",nHe="(?:^|\\/)",$xe=`\\.{1,2}${Xxe}`,qNt="(?!\\.)",XNt=`(?!${nHe}${$xe})`,$Nt=`(?!\\.{0,1}${Xxe})`,YNt=`(?!${$xe})`,QNt="[^.\\/]",ZNt=`${tHe}*?`,eRt="/",rHe={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:JNt,QMARK:tHe,END_ANCHOR:Xxe,DOTS_SLASH:$xe,NO_DOT:qNt,NO_DOTS:XNt,NO_DOT_SLASH:$Nt,NO_DOTS_SLASH:YNt,QMARK_NO_DOT:QNt,STAR:ZNt,START_ANCHOR:nHe,SEP:eRt},tRt={...rHe,SLASH_LITERAL:"[\\\\/]",QMARK:eHe,STAR:`${eHe}*?`,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:"\\"},nRt={__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"};iHe.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:nRt,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?tRt:rHe}}});var F5=zm(Ob=>{"use strict";var{REGEX_BACKSLASH:rRt,REGEX_REMOVE_BACKSLASH:iRt,REGEX_SPECIAL_CHARS:oRt,REGEX_SPECIAL_CHARS_GLOBAL:aRt}=O5();Ob.isObject=h=>h!==null&&typeof h=="object"&&!Array.isArray(h);Ob.hasRegexChars=h=>oRt.test(h);Ob.isRegexChar=h=>h.length===1&&Ob.hasRegexChars(h);Ob.escapeRegex=h=>h.replace(aRt,"\\$1");Ob.toPosixSlashes=h=>h.replace(rRt,"/");Ob.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};Ob.removeBackslashes=h=>h.replace(iRt,o=>o==="\\"?"":o);Ob.escapeLast=(h,o,d)=>{let g=h.lastIndexOf(o,d);return g===-1?h:h[g-1]==="\\"?Ob.escapeLast(h,o,g-1):`${h.slice(0,g)}\\${h.slice(g)}`};Ob.removePrefix=(h,o={})=>{let d=h;return d.startsWith("./")&&(d=d.slice(2),o.prefix="./"),d};Ob.wrapOutput=(h,o={},d={})=>{let g=d.contains?"":"^",E=d.contains?"":"$",R=`${g}(?:${h})${E}`;return o.negated===!0&&(R=`(?:^(?!${R}).*$)`),R};Ob.basename=(h,{windows:o}={})=>{let d=h.split(o?/[\\/]/:"/"),g=d[d.length-1];return g===""?d[d.length-2]:g}});var pHe=zm((aFt,uHe)=>{"use strict";var oHe=F5(),{CHAR_ASTERISK:Yxe,CHAR_AT:sRt,CHAR_BACKWARD_SLASH:W5,CHAR_COMMA:lRt,CHAR_DOT:Qxe,CHAR_EXCLAMATION_MARK:Zxe,CHAR_FORWARD_SLASH:dHe,CHAR_LEFT_CURLY_BRACE:eAe,CHAR_LEFT_PARENTHESES:tAe,CHAR_LEFT_SQUARE_BRACKET:cRt,CHAR_PLUS:dRt,CHAR_QUESTION_MARK:aHe,CHAR_RIGHT_CURLY_BRACE:uRt,CHAR_RIGHT_PARENTHESES:sHe,CHAR_RIGHT_SQUARE_BRACKET:pRt}=O5(),lHe=h=>h===dHe||h===W5,cHe=h=>{h.isPrefix!==!0&&(h.depth=h.isGlobstar?1/0:1)},fRt=(h,o)=>{let d=o||{},g=h.length-1,E=d.parts===!0||d.scanToEnd===!0,R=[],G=[],le=[],Re=h,nt=-1,at=0,dt=0,xe=!1,gn=!1,pt=!1,ut=!1,yi=!1,wi=!1,eo=!1,qa=!1,bl=!1,Sa=!1,Lr=0,In,Ii,_i={value:"",depth:0,isGlob:!1},Fr=()=>nt>=g,bi=()=>Re.charCodeAt(nt+1),fd=()=>(In=Ii,Re.charCodeAt(++nt));for(;nt<g;){Ii=fd();let vn;if(Ii===W5){eo=_i.backslashes=!0,Ii=fd(),Ii===eAe&&(wi=!0);continue}if(wi===!0||Ii===eAe){for(Lr++;Fr()!==!0&&(Ii=fd());){if(Ii===W5){eo=_i.backslashes=!0,fd();continue}if(Ii===eAe){Lr++;continue}if(wi!==!0&&Ii===Qxe&&(Ii=fd())===Qxe){if(xe=_i.isBrace=!0,pt=_i.isGlob=!0,Sa=!0,E===!0)continue;break}if(wi!==!0&&Ii===lRt){if(xe=_i.isBrace=!0,pt=_i.isGlob=!0,Sa=!0,E===!0)continue;break}if(Ii===uRt&&(Lr--,Lr===0)){wi=!1,xe=_i.isBrace=!0,Sa=!0;break}}if(E===!0)continue;break}if(Ii===dHe){if(R.push(nt),G.push(_i),_i={value:"",depth:0,isGlob:!1},Sa===!0)continue;if(In===Qxe&&nt===at+1){at+=2;continue}dt=nt+1;continue}if(d.noext!==!0&&(Ii===dRt||Ii===sRt||Ii===Yxe||Ii===aHe||Ii===Zxe)===!0&&bi()===tAe){if(pt=_i.isGlob=!0,ut=_i.isExtglob=!0,Sa=!0,Ii===Zxe&&nt===at&&(bl=!0),E===!0){for(;Fr()!==!0&&(Ii=fd());){if(Ii===W5){eo=_i.backslashes=!0,Ii=fd();continue}if(Ii===sHe){pt=_i.isGlob=!0,Sa=!0;break}}continue}break}if(Ii===Yxe){if(In===Yxe&&(yi=_i.isGlobstar=!0),pt=_i.isGlob=!0,Sa=!0,E===!0)continue;break}if(Ii===aHe){if(pt=_i.isGlob=!0,Sa=!0,E===!0)continue;break}if(Ii===cRt){for(;Fr()!==!0&&(vn=fd());){if(vn===W5){eo=_i.backslashes=!0,fd();continue}if(vn===pRt){gn=_i.isBracket=!0,pt=_i.isGlob=!0,Sa=!0;break}}if(E===!0)continue;break}if(d.nonegate!==!0&&Ii===Zxe&&nt===at){qa=_i.negated=!0,at++;continue}if(d.noparen!==!0&&Ii===tAe){if(pt=_i.isGlob=!0,E===!0){for(;Fr()!==!0&&(Ii=fd());){if(Ii===tAe){eo=_i.backslashes=!0,Ii=fd();continue}if(Ii===sHe){Sa=!0;break}}continue}break}if(pt===!0){if(Sa=!0,E===!0)continue;break}}d.noext===!0&&(ut=!1,pt=!1);let Rc=Re,fn="",Ai="";at>0&&(fn=Re.slice(0,at),Re=Re.slice(at),dt-=at),Rc&&pt===!0&&dt>0?(Rc=Re.slice(0,dt),Ai=Re.slice(dt)):pt===!0?(Rc="",Ai=Re):Rc=Re,Rc&&Rc!==""&&Rc!=="/"&&Rc!==Re&&lHe(Rc.charCodeAt(Rc.length-1))&&(Rc=Rc.slice(0,-1)),d.unescape===!0&&(Ai&&(Ai=oHe.removeBackslashes(Ai)),Rc&&eo===!0&&(Rc=oHe.removeBackslashes(Rc)));let qc={prefix:fn,input:h,start:at,base:Rc,glob:Ai,isBrace:xe,isBracket:gn,isGlob:pt,isExtglob:ut,isGlobstar:yi,negated:qa,negatedExtglob:bl};if(d.tokens===!0&&(qc.maxDepth=0,lHe(Ii)||G.push(_i),qc.tokens=G),d.parts===!0||d.tokens===!0){let vn;for(let vd=0;vd<R.length;vd++){let Qs=vn?vn+1:at,Xc=R[vd],aa=h.slice(Qs,Xc);d.tokens&&(vd===0&&at!==0?(G[vd].isPrefix=!0,G[vd].value=fn):G[vd].value=aa,cHe(G[vd]),qc.maxDepth+=G[vd].depth),(vd!==0||aa!=="")&&le.push(aa),vn=Xc}if(vn&&vn+1<h.length){let vd=h.slice(vn+1);le.push(vd),d.tokens&&(G[G.length-1].value=vd,cHe(G[G.length-1]),qc.maxDepth+=G[G.length-1].depth)}qc.slashes=R,qc.parts=le}return qc};uHe.exports=fRt});var gHe=zm((sFt,hHe)=>{"use strict";var B5=O5(),fT=F5(),{MAX_LENGTH:YZ,POSIX_REGEX_SOURCE:mRt,REGEX_NON_SPECIAL_CHARS:_Rt,REGEX_SPECIAL_CHARS_BACKREF:hRt,REPLACEMENTS:fHe}=B5,gRt=(h,o)=>{if(typeof o.expandRange=="function")return o.expandRange(...h,o);h.sort();let d=`[${h.join("-")}]`;try{new RegExp(d)}catch{return h.map(E=>fT.escapeRegex(E)).join("..")}return d},W8=(h,o)=>`Missing ${h}: "${o}" - use "\\\\${o}" to match literal characters`,mHe=h=>{let o=[],d=0,g=0,E=0,R="",G=!1;for(let le of h){if(G===!0){R+=le,G=!1;continue}if(le==="\\"){R+=le,G=!0;continue}if(le==='"'){E=E===1?0:1,R+=le;continue}if(E===0){if(le==="[")d++;else if(le==="]"&&d>0)d--;else if(d===0){if(le==="(")g++;else if(le===")"&&g>0)g--;else if(le==="|"&&g===0){o.push(R),R="";continue}}}R+=le}return o.push(R),o},yRt=h=>{let o=!1;for(let d of h){if(o===!0){o=!1;continue}if(d==="\\"){o=!0;continue}if(/[?*+@!()[\]{}]/.test(d))return!1}return!0},_He=h=>{let o=h.trim(),d=!0;for(;d===!0;)d=!1,/^@\([^\\()[\]{}|]+\)$/.test(o)&&(o=o.slice(2,-1),d=!0);if(yRt(o))return o.replace(/\\(.)/g,"$1")},vRt=h=>{let o=h.map(_He).filter(Boolean);for(let d=0;d<o.length;d++)for(let g=d+1;g<o.length;g++){let E=o[d],R=o[g],G=E[0];if(!(!G||E!==G.repeat(E.length)||R!==G.repeat(R.length))&&(E===R||E.startsWith(R)||R.startsWith(E)))return!0}return!1},nAe=(h,o=!0)=>{if(h[0]!=="+"&&h[0]!=="*"||h[1]!=="(")return;let d=0,g=0,E=0,R=!1;for(let G=1;G<h.length;G++){let le=h[G];if(R===!0){R=!1;continue}if(le==="\\"){R=!0;continue}if(le==='"'){E=E===1?0:1;continue}if(E!==1){if(le==="["){d++;continue}if(le==="]"&&d>0){d--;continue}if(!(d>0)){if(le==="("){g++;continue}if(le===")"&&(g--,g===0))return o===!0&&G!==h.length-1?void 0:{type:h[0],body:h.slice(2,G),end:G}}}}},bRt=h=>{let o=0,d=[];for(;o<h.length;){let E=nAe(h.slice(o),!1);if(!E||E.type!=="*")return;let R=mHe(E.body).map(le=>le.trim());if(R.length!==1)return;let G=_He(R[0]);if(!G||G.length!==1)return;d.push(G),o+=E.end+1}return d.length<1?void 0:`${d.length===1?fT.escapeRegex(d[0]):`[${d.map(E=>fT.escapeRegex(E)).join("")}]`}*`},SRt=h=>{let o=0,d=h.trim(),g=nAe(d);for(;g;)o++,d=g.body.trim(),g=nAe(d);return o},TRt=(h,o)=>{if(o.maxExtglobRecursion===!1)return{risky:!1};let d=typeof o.maxExtglobRecursion=="number"?o.maxExtglobRecursion:B5.DEFAULT_MAX_EXTGLOB_RECURSION,g=mHe(h).map(E=>E.trim());if(g.length>1&&(g.some(E=>E==="")||g.some(E=>/^[*?]+$/.test(E))||vRt(g)))return{risky:!0};for(let E of g){let R=bRt(E);if(R)return{risky:!0,safeOutput:R};if(SRt(E)>d)return{risky:!0}}return{risky:!1}},rAe=(h,o)=>{if(typeof h!="string")throw new TypeError("Expected a string");h=fHe[h]||h;let d={...o},g=typeof d.maxLength=="number"?Math.min(YZ,d.maxLength):YZ,E=h.length;if(E>g)throw new SyntaxError(`Input length: ${E}, exceeds maximum allowed length: ${g}`);let R={type:"bos",value:"",output:d.prepend||""},G=[R],le=d.capture?"":"?:",Re=B5.globChars(d.windows),nt=B5.extglobChars(Re),{DOT_LITERAL:at,PLUS_LITERAL:dt,SLASH_LITERAL:xe,ONE_CHAR:gn,DOTS_SLASH:pt,NO_DOT:ut,NO_DOT_SLASH:yi,NO_DOTS_SLASH:wi,QMARK:eo,QMARK_NO_DOT:qa,STAR:bl,START_ANCHOR:Sa}=Re,Lr=Uo=>`(${le}(?:(?!${Sa}${Uo.dot?pt:at}).)*?)`,In=d.dot?"":ut,Ii=d.dot?eo:qa,_i=d.bash===!0?Lr(d):bl;d.capture&&(_i=`(${_i})`),typeof d.noext=="boolean"&&(d.noextglob=d.noext);let Fr={input:h,index:-1,start:0,dot:d.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:G};h=fT.removePrefix(h,Fr),E=h.length;let bi=[],fd=[],Rc=[],fn=R,Ai,qc=()=>Fr.index===E-1,vn=Fr.peek=(Uo=1)=>h[Fr.index+Uo],vd=Fr.advance=()=>h[++Fr.index]||"",Qs=()=>h.slice(Fr.index+1),Xc=(Uo="",lc=0)=>{Fr.consumed+=Uo,Fr.index+=lc},aa=Uo=>{Fr.output+=Uo.output!=null?Uo.output:Uo.value,Xc(Uo.value)},yT=()=>{let Uo=1;for(;vn()==="!"&&(vn(2)!=="("||vn(3)==="?");)vd(),Fr.start++,Uo++;return Uo%2===0?!1:(Fr.negated=!0,Fr.start++,!0)},vT=Uo=>{Fr[Uo]++,Rc.push(Uo)},ky=Uo=>{Fr[Uo]--,Rc.pop()},wl=Uo=>{if(fn.type==="globstar"){let lc=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"&&!lc&&!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,G.push(Uo),fn=Uo},Gi=(Uo,lc)=>{let Ko={...nt[lc],conditions:1,inner:""};Ko.prev=fn,Ko.parens=Fr.parens,Ko.output=Fr.output,Ko.startIndex=Fr.index,Ko.tokensIndex=G.length;let Ol=(d.capture?"(":"")+Ko.open;vT("parens"),wl({type:Uo,value:lc,output:Fr.output?"":gn}),wl({type:"paren",extglob:!0,value:vd(),output:Ol}),bi.push(Ko)},Sh=Uo=>{let lc=h.slice(Uo.startIndex,Fr.index+1),Ko=h.slice(Uo.startIndex+2,Fr.index),Ol=TRt(Ko,d);if((Uo.type==="plus"||Uo.type==="star")&&Ol.risky){let bd=Ol.safeOutput?(Uo.output?"":gn)+(d.capture?`(${Ol.safeOutput})`:Ol.safeOutput):void 0,Wi=G[Uo.tokensIndex];Wi.type="text",Wi.value=lc,Wi.output=bd||fT.escapeRegex(lc);for(let zb=Uo.tokensIndex+1;zb<G.length;zb++)G[zb].value="",G[zb].output="",delete G[zb].suffix;Fr.output=Uo.output+Wi.output,Fr.backtrack=!0,wl({type:"paren",extglob:!0,value:Ai,output:""}),ky("parens");return}let Hd=Uo.close+(d.capture?")":""),gt;if(Uo.type==="negate"){let bd=_i;if(Uo.inner&&Uo.inner.length>1&&Uo.inner.includes("/")&&(bd=Lr(d)),(bd!==_i||qc()||/^\)+$/.test(Qs()))&&(Hd=Uo.close=`)$))${bd}`),Uo.inner.includes("*")&&(gt=Qs())&&/^\.[^\\/.]+$/.test(gt)){let Wi=rAe(gt,{...o,fastpaths:!1}).output;Hd=Uo.close=`)${Wi})${bd})`}Uo.prev.type==="bos"&&(Fr.negatedExtglob=!0)}wl({type:"paren",extglob:!0,value:Ai,output:Hd}),ky("parens")};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(h)){let Uo=!1,lc=h.replace(hRt,(Ko,Ol,Hd,gt,bd,Wi)=>gt==="\\"?(Uo=!0,Ko):gt==="?"?Ol?Ol+gt+(bd?eo.repeat(bd.length):""):Wi===0?Ii+(bd?eo.repeat(bd.length):""):eo.repeat(Hd.length):gt==="."?at.repeat(Hd.length):gt==="*"?Ol?Ol+gt+(bd?_i:""):_i:Ol?Ko:`\\${Ko}`);return Uo===!0&&(d.unescape===!0?lc=lc.replace(/\\/g,""):lc=lc.replace(/\\+/g,Ko=>Ko.length%2===0?"\\\\":Ko?"\\":"")),lc===h&&d.contains===!0?(Fr.output=h,Fr):(Fr.output=fT.wrapOutput(lc,Fr,o),Fr)}for(;!qc();){if(Ai=vd(),Ai==="\0")continue;if(Ai==="\\"){let Ko=vn();if(Ko==="/"&&d.bash!==!0||Ko==="."||Ko===";")continue;if(!Ko){Ai+="\\",wl({type:"text",value:Ai});continue}let Ol=/^\\+/.exec(Qs()),Hd=0;if(Ol&&Ol[0].length>2&&(Hd=Ol[0].length,Fr.index+=Hd,Hd%2!==0&&(Ai+="\\")),d.unescape===!0?Ai=vd():Ai+=vd(),Fr.brackets===0){wl({type:"text",value:Ai});continue}}if(Fr.brackets>0&&(Ai!=="]"||fn.value==="["||fn.value==="[^")){if(d.posix!==!1&&Ai===":"){let Ko=fn.value.slice(1);if(Ko.includes("[")&&(fn.posix=!0,Ko.includes(":"))){let Ol=fn.value.lastIndexOf("["),Hd=fn.value.slice(0,Ol),gt=fn.value.slice(Ol+2),bd=mRt[gt];if(bd){fn.value=Hd+bd,Fr.backtrack=!0,vd(),!R.output&&G.indexOf(fn)===1&&(R.output=gn);continue}}}(Ai==="["&&vn()!==":"||Ai==="-"&&vn()==="]")&&(Ai=`\\${Ai}`),Ai==="]"&&(fn.value==="["||fn.value==="[^")&&(Ai=`\\${Ai}`),d.posix===!0&&Ai==="!"&&fn.value==="["&&(Ai="^"),fn.value+=Ai,aa({value:Ai});continue}if(Fr.quotes===1&&Ai!=='"'){Ai=fT.escapeRegex(Ai),fn.value+=Ai,aa({value:Ai});continue}if(Ai==='"'){Fr.quotes=Fr.quotes===1?0:1,d.keepQuotes===!0&&wl({type:"text",value:Ai});continue}if(Ai==="("){vT("parens"),wl({type:"paren",value:Ai});continue}if(Ai===")"){if(Fr.parens===0&&d.strictBrackets===!0)throw new SyntaxError(W8("opening","("));let Ko=bi[bi.length-1];if(Ko&&Fr.parens===Ko.parens+1){Sh(bi.pop());continue}wl({type:"paren",value:Ai,output:Fr.parens?")":"\\)"}),ky("parens");continue}if(Ai==="["){if(d.nobracket===!0||!Qs().includes("]")){if(d.nobracket!==!0&&d.strictBrackets===!0)throw new SyntaxError(W8("closing","]"));Ai=`\\${Ai}`}else vT("brackets");wl({type:"bracket",value:Ai});continue}if(Ai==="]"){if(d.nobracket===!0||fn&&fn.type==="bracket"&&fn.value.length===1){wl({type:"text",value:Ai,output:`\\${Ai}`});continue}if(Fr.brackets===0){if(d.strictBrackets===!0)throw new SyntaxError(W8("opening","["));wl({type:"text",value:Ai,output:`\\${Ai}`});continue}ky("brackets");let Ko=fn.value.slice(1);if(fn.posix!==!0&&Ko[0]==="^"&&!Ko.includes("/")&&(Ai=`/${Ai}`),fn.value+=Ai,aa({value:Ai}),d.literalBrackets===!1||fT.hasRegexChars(Ko))continue;let Ol=fT.escapeRegex(fn.value);if(Fr.output=Fr.output.slice(0,-fn.value.length),d.literalBrackets===!0){Fr.output+=Ol,fn.value=Ol;continue}fn.value=`(${le}${Ol}|${fn.value})`,Fr.output+=fn.value;continue}if(Ai==="{"&&d.nobrace!==!0){vT("braces");let Ko={type:"brace",value:Ai,output:"(",outputIndex:Fr.output.length,tokensIndex:Fr.tokens.length};fd.push(Ko),wl(Ko);continue}if(Ai==="}"){let Ko=fd[fd.length-1];if(d.nobrace===!0||!Ko){wl({type:"text",value:Ai,output:Ai});continue}let Ol=")";if(Ko.dots===!0){let Hd=G.slice(),gt=[];for(let bd=Hd.length-1;bd>=0&&(G.pop(),Hd[bd].type!=="brace");bd--)Hd[bd].type!=="dots"&>.unshift(Hd[bd].value);Ol=gRt(gt,d),Fr.backtrack=!0}if(Ko.comma!==!0&&Ko.dots!==!0){let Hd=Fr.output.slice(0,Ko.outputIndex),gt=Fr.tokens.slice(Ko.tokensIndex);Ko.value=Ko.output="\\{",Ai=Ol="\\}",Fr.output=Hd;for(let bd of gt)Fr.output+=bd.output||bd.value}wl({type:"brace",value:Ai,output:Ol}),ky("braces"),fd.pop();continue}if(Ai==="|"){bi.length>0&&bi[bi.length-1].conditions++,wl({type:"text",value:Ai});continue}if(Ai===","){let Ko=Ai,Ol=fd[fd.length-1];Ol&&Rc[Rc.length-1]==="braces"&&(Ol.comma=!0,Ko="|"),wl({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="",G.pop(),fn=R;continue}wl({type:"slash",value:Ai,output:xe});continue}if(Ai==="."){if(Fr.braces>0&&fn.type==="dot"){fn.value==="."&&(fn.output=at);let Ko=fd[fd.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"){wl({type:"text",value:Ai,output:at});continue}wl({type:"dot",value:Ai,output:at});continue}if(Ai==="?"){if(!(fn&&fn.value==="(")&&d.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){Gi("qmark",Ai);continue}if(fn&&fn.type==="paren"){let Ol=vn(),Hd=Ai;(fn.value==="("&&!/[!=<:]/.test(Ol)||Ol==="<"&&!/<([!=]|\w+>)/.test(Qs()))&&(Hd=`\\${Ai}`),wl({type:"text",value:Ai,output:Hd});continue}if(d.dot!==!0&&(fn.type==="slash"||fn.type==="bos")){wl({type:"qmark",value:Ai,output:qa});continue}wl({type:"qmark",value:Ai,output:eo});continue}if(Ai==="!"){if(d.noextglob!==!0&&vn()==="("&&(vn(2)!=="?"||!/[!=<:]/.test(vn(3)))){Gi("negate",Ai);continue}if(d.nonegate!==!0&&Fr.index===0){yT();continue}}if(Ai==="+"){if(d.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){Gi("plus",Ai);continue}if(fn&&fn.value==="("||d.regex===!1){wl({type:"plus",value:Ai,output:dt});continue}if(fn&&(fn.type==="bracket"||fn.type==="paren"||fn.type==="brace")||Fr.parens>0){wl({type:"plus",value:Ai});continue}wl({type:"plus",value:dt});continue}if(Ai==="@"){if(d.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){wl({type:"at",extglob:!0,value:Ai,output:""});continue}wl({type:"text",value:Ai});continue}if(Ai!=="*"){(Ai==="$"||Ai==="^")&&(Ai=`\\${Ai}`);let Ko=_Rt.exec(Qs());Ko&&(Ai+=Ko[0],Fr.index+=Ko[0].length),wl({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,Xc(Ai);continue}let Uo=Qs();if(d.noextglob!==!0&&/^\([^?]/.test(Uo)){Gi("star",Ai);continue}if(fn.type==="star"){if(d.noglobstar===!0){Xc(Ai);continue}let Ko=fn.prev,Ol=Ko.prev,Hd=Ko.type==="slash"||Ko.type==="bos",gt=Ol&&(Ol.type==="star"||Ol.type==="globstar");if(d.bash===!0&&(!Hd||Uo[0]&&Uo[0]!=="/")){wl({type:"star",value:Ai,output:""});continue}let bd=Fr.braces>0&&(Ko.type==="comma"||Ko.type==="brace"),Wi=bi.length&&(Ko.type==="pipe"||Ko.type==="paren");if(!Hd&&Ko.type!=="paren"&&!bd&&!Wi){wl({type:"star",value:Ai,output:""});continue}for(;Uo.slice(0,3)==="/**";){let zb=h[Fr.index+4];if(zb&&zb!=="/")break;Uo=Uo.slice(3),Xc("/**",3)}if(Ko.type==="bos"&&qc()){fn.type="globstar",fn.value+=Ai,fn.output=Lr(d),Fr.output=fn.output,Fr.globstar=!0,Xc(Ai);continue}if(Ko.type==="slash"&&Ko.prev.type!=="bos"&&!gt&&qc()){Fr.output=Fr.output.slice(0,-(Ko.output+fn.output).length),Ko.output=`(?:${Ko.output}`,fn.type="globstar",fn.output=Lr(d)+(d.strictSlashes?")":"|$)"),fn.value+=Ai,Fr.globstar=!0,Fr.output+=Ko.output+fn.output,Xc(Ai);continue}if(Ko.type==="slash"&&Ko.prev.type!=="bos"&&Uo[0]==="/"){let zb=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(d)}${xe}|${xe}${zb})`,fn.value+=Ai,Fr.output+=Ko.output+fn.output,Fr.globstar=!0,Xc(Ai+vd()),wl({type:"slash",value:"/",output:""});continue}if(Ko.type==="bos"&&Uo[0]==="/"){fn.type="globstar",fn.value+=Ai,fn.output=`(?:^|${xe}|${Lr(d)}${xe})`,Fr.output=fn.output,Fr.globstar=!0,Xc(Ai+vd()),wl({type:"slash",value:"/",output:""});continue}Fr.output=Fr.output.slice(0,-fn.output.length),fn.type="globstar",fn.output=Lr(d),fn.value+=Ai,Fr.output+=fn.output,Fr.globstar=!0,Xc(Ai);continue}let lc={type:"star",value:Ai,output:_i};if(d.bash===!0){lc.output=".*?",(fn.type==="bos"||fn.type==="slash")&&(lc.output=In+lc.output),wl(lc);continue}if(fn&&(fn.type==="bracket"||fn.type==="paren")&&d.regex===!0){lc.output=Ai,wl(lc);continue}(Fr.index===Fr.start||fn.type==="slash"||fn.type==="dot")&&(fn.type==="dot"?(Fr.output+=yi,fn.output+=yi):d.dot===!0?(Fr.output+=wi,fn.output+=wi):(Fr.output+=In,fn.output+=In),vn()!=="*"&&(Fr.output+=gn,fn.output+=gn)),wl(lc)}for(;Fr.brackets>0;){if(d.strictBrackets===!0)throw new SyntaxError(W8("closing","]"));Fr.output=fT.escapeLast(Fr.output,"["),ky("brackets")}for(;Fr.parens>0;){if(d.strictBrackets===!0)throw new SyntaxError(W8("closing",")"));Fr.output=fT.escapeLast(Fr.output,"("),ky("parens")}for(;Fr.braces>0;){if(d.strictBrackets===!0)throw new SyntaxError(W8("closing","}"));Fr.output=fT.escapeLast(Fr.output,"{"),ky("braces")}if(d.strictSlashes!==!0&&(fn.type==="star"||fn.type==="bracket")&&wl({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};rAe.fastpaths=(h,o)=>{let d={...o},g=typeof d.maxLength=="number"?Math.min(YZ,d.maxLength):YZ,E=h.length;if(E>g)throw new SyntaxError(`Input length: ${E}, exceeds maximum allowed length: ${g}`);h=fHe[h]||h;let{DOT_LITERAL:R,SLASH_LITERAL:G,ONE_CHAR:le,DOTS_SLASH:Re,NO_DOT:nt,NO_DOTS:at,NO_DOTS_SLASH:dt,STAR:xe,START_ANCHOR:gn}=B5.globChars(d.windows),pt=d.dot?at:nt,ut=d.dot?dt:nt,yi=d.capture?"":"?:",wi={negated:!1,prefix:""},eo=d.bash===!0?".*?":xe;d.capture&&(eo=`(${eo})`);let qa=In=>In.noglobstar===!0?eo:`(${yi}(?:(?!${gn}${In.dot?Re:R}).)*?)`,bl=In=>{switch(In){case"*":return`${pt}${le}${eo}`;case".*":return`${R}${le}${eo}`;case"*.*":return`${pt}${eo}${R}${le}${eo}`;case"*/*":return`${pt}${eo}${G}${le}${ut}${eo}`;case"**":return pt+qa(d);case"**/*":return`(?:${pt}${qa(d)}${G})?${ut}${le}${eo}`;case"**/*.*":return`(?:${pt}${qa(d)}${G})?${ut}${eo}${R}${le}${eo}`;case"**/.*":return`(?:${pt}${qa(d)}${G})?${R}${le}${eo}`;default:{let Ii=/^(.*?)\.(\w+)$/.exec(In);if(!Ii)return;let _i=bl(Ii[1]);return _i?_i+R+Ii[2]:void 0}}},Sa=fT.removePrefix(h,wi),Lr=bl(Sa);return Lr&&d.strictSlashes!==!0&&(Lr+=`${G}?`),Lr};hHe.exports=rAe});var bHe=zm((lFt,vHe)=>{"use strict";var ERt=pHe(),iAe=gHe(),yHe=F5(),xRt=O5(),ARt=h=>h&&typeof h=="object"&&!Array.isArray(h),m_=(h,o,d=!1)=>{if(Array.isArray(h)){let at=h.map(xe=>m_(xe,o,d));return xe=>{for(let gn of at){let pt=gn(xe);if(pt)return pt}return!1}}let g=ARt(h)&&h.tokens&&h.input;if(h===""||typeof h!="string"&&!g)throw new TypeError("Expected pattern to be a non-empty string");let E=o||{},R=E.windows,G=g?m_.compileRe(h,o):m_.makeRe(h,o,!1,!0),le=G.state;delete G.state;let Re=()=>!1;if(E.ignore){let at={...o,ignore:null,onMatch:null,onResult:null};Re=m_(E.ignore,at,d)}let nt=(at,dt=!1)=>{let{isMatch:xe,match:gn,output:pt}=m_.test(at,G,o,{glob:h,posix:R}),ut={glob:h,state:le,regex:G,posix:R,input:at,output:pt,match:gn,isMatch:xe};return typeof E.onResult=="function"&&E.onResult(ut),xe===!1?(ut.isMatch=!1,dt?ut:!1):Re(at)?(typeof E.onIgnore=="function"&&E.onIgnore(ut),ut.isMatch=!1,dt?ut:!1):(typeof E.onMatch=="function"&&E.onMatch(ut),dt?ut:!0)};return d&&(nt.state=le),nt};m_.test=(h,o,d,{glob:g,posix:E}={})=>{if(typeof h!="string")throw new TypeError("Expected input to be a string");if(h==="")return{isMatch:!1,output:""};let R=d||{},G=R.format||(E?yHe.toPosixSlashes:null),le=h===g,Re=le&&G?G(h):h;return le===!1&&(Re=G?G(h):h,le=Re===g),(le===!1||R.capture===!0)&&(R.matchBase===!0||R.basename===!0?le=m_.matchBase(h,o,d,E):le=o.exec(Re)),{isMatch:!!le,match:le,output:Re}};m_.matchBase=(h,o,d)=>(o instanceof RegExp?o:m_.makeRe(o,d)).test(yHe.basename(h));m_.isMatch=(h,o,d)=>m_(o,d)(h);m_.parse=(h,o)=>Array.isArray(h)?h.map(d=>m_.parse(d,o)):iAe(h,{...o,fastpaths:!1});m_.scan=(h,o)=>ERt(h,o);m_.compileRe=(h,o,d=!1,g=!1)=>{if(d===!0)return h.output;let E=o||{},R=E.contains?"":"^",G=E.contains?"":"$",le=`${R}(?:${h.output})${G}`;h&&h.negated===!0&&(le=`^(?!${le}).*$`);let Re=m_.toRegex(le,o);return g===!0&&(Re.state=h),Re};m_.makeRe=(h,o={},d=!1,g=!1)=>{if(!h||typeof h!="string")throw new TypeError("Expected a non-empty string");let E={negated:!1,fastpaths:!0};return o.fastpaths!==!1&&(h[0]==="."||h[0]==="*")&&(E.output=iAe.fastpaths(h,o)),E.output||(E=iAe(h,o)),m_.compileRe(E,o,d,g)};m_.toRegex=(h,o)=>{try{let d=o||{};return new RegExp(h,d.flags||(d.nocase?"i":""))}catch(d){if(o&&o.debug===!0)throw d;return/$^/}};m_.constants=xRt;vHe.exports=m_});var oAe=zm((cFt,EHe)=>{"use strict";var SHe=bHe(),DRt=F5();function THe(h,o,d=!1){return o&&(o.windows===null||o.windows===void 0)&&(o={...o,windows:DRt.isWindows()}),SHe(h,o,d)}Object.assign(THe,SHe);EHe.exports=THe});var wHe=zm(kHe=>{var IRt=Object.create,AHe=Object.defineProperty,CRt=Object.getOwnPropertyDescriptor,PRt=Object.getOwnPropertyNames,NRt=Object.getPrototypeOf,RRt=Object.prototype.hasOwnProperty,MRt=(h,o,d,g)=>{if(o&&typeof o=="object"||typeof o=="function")for(var E=PRt(o),R=0,G=E.length,le;R<G;R++)le=E[R],!RRt.call(h,le)&&le!==d&&AHe(h,le,{get:(Re=>o[Re]).bind(null,le),enumerable:!(g=CRt(o,le))||g.enumerable});return h},DHe=(h,o,d)=>(d=h!=null?IRt(NRt(h)):{},MRt(o||!h||!h.__esModule?AHe(d,"default",{value:h,enumerable:!0}):d,h)),TC=DHe(require("path")),LRt=DHe(require("fs"));function kRt(h){let o=(0,TC.normalize)(h);return o.length>1&&o[o.length-1]===TC.sep&&(o=o.substring(0,o.length-1)),o}var wRt=/[\\/]/g;function IHe(h,o){return h.replace(wRt,o)}var ORt=/^[a-z]:[\\/]$/i;function FRt(h){return h==="/"||ORt.test(h)}function aAe(h,o){let{resolvePaths:d,normalizePath:g,pathSeparator:E}=o,R=process.platform==="win32"&&h.includes("/")||h.startsWith(".");if(d&&(h=(0,TC.resolve)(h)),(g||R)&&(h=kRt(h)),h===".")return"";let G=h[h.length-1]!==E;return IHe(G?h+E:h,E)}function CHe(h,o){return o+h}function WRt(h,o){return function(d,g){return g.startsWith(h)?g.slice(h.length)+d:IHe((0,TC.relative)(h,g),o.pathSeparator)+o.pathSeparator+d}}function BRt(h){return h}function zRt(h,o,d){return o+h+d}function GRt(h,o){let{relativePaths:d,includeBasePath:g}=o;return d&&h?WRt(h,o):g?CHe:BRt}function VRt(h){return function(o,d){d.push(o.substring(h.length)||".")}}function jRt(h){return function(o,d,g){let E=o.substring(h.length)||".";g.every(R=>R(E,!0))&&d.push(E)}}var URt=(h,o)=>{o.push(h||".")},HRt=(h,o,d)=>{let g=h||".";d.every(E=>E(g,!0))&&o.push(g)},KRt=()=>{};function JRt(h,o){let{includeDirs:d,filters:g,relativePaths:E}=o;return d?E?g&&g.length?jRt(h):VRt(h):g&&g.length?HRt:URt:KRt}var qRt=(h,o,d,g)=>{g.every(E=>E(h,!1))&&d.files++},XRt=(h,o,d,g)=>{g.every(E=>E(h,!1))&&o.push(h)},$Rt=(h,o,d,g)=>{d.files++},YRt=(h,o)=>{o.push(h)},QRt=()=>{};function ZRt(h){let{excludeFiles:o,filters:d,onlyCounts:g}=h;return o?QRt:d&&d.length?g?qRt:XRt:g?$Rt:YRt}var eMt=h=>h,tMt=()=>[""].slice(0,0);function nMt(h){return h.group?tMt:eMt}var rMt=(h,o,d)=>{h.push({directory:o,files:d,dir:o})},iMt=()=>{};function oMt(h){return h.group?rMt:iMt}var aMt=function(h,o,d){let{queue:g,fs:E,options:{suppressErrors:R}}=o;g.enqueue(),E.realpath(h,(G,le)=>{if(G)return g.dequeue(R?null:G,o);E.stat(le,(Re,nt)=>{if(Re)return g.dequeue(R?null:Re,o);if(nt.isDirectory()&&PHe(h,le,o))return g.dequeue(null,o);d(nt,le),g.dequeue(null,o)})})},sMt=function(h,o,d){let{queue:g,fs:E,options:{suppressErrors:R}}=o;g.enqueue();try{let G=E.realpathSync(h),le=E.statSync(G);if(le.isDirectory()&&PHe(h,G,o))return;d(le,G)}catch(G){if(!R)throw G}};function lMt(h,o){return!h.resolveSymlinks||h.excludeSymlinks?null:o?sMt:aMt}function PHe(h,o,d){if(d.options.useRealPaths)return cMt(o,d);let g=(0,TC.dirname)(h),E=1;for(;g!==d.root&&E<2;){let R=d.symlinks.get(g);!!R&&(R===o||R.startsWith(o)||o.startsWith(R))?E++:g=(0,TC.dirname)(g)}return d.symlinks.set(h,o),E>1}function cMt(h,o){return o.visited.includes(h+o.options.pathSeparator)}var dMt=h=>h.counts,uMt=h=>h.groups,pMt=h=>h.paths,fMt=h=>h.paths.slice(0,h.options.maxFiles),mMt=(h,o,d)=>(QZ(o,d,h.counts,h.options.suppressErrors),null),_Mt=(h,o,d)=>(QZ(o,d,h.paths,h.options.suppressErrors),null),hMt=(h,o,d)=>(QZ(o,d,h.paths.slice(0,h.options.maxFiles),h.options.suppressErrors),null),gMt=(h,o,d)=>(QZ(o,d,h.groups,h.options.suppressErrors),null);function QZ(h,o,d,g){o(h&&!g?h:null,d)}function yMt(h,o){let{onlyCounts:d,group:g,maxFiles:E}=h;return d?o?dMt:mMt:g?o?uMt:gMt:E?o?fMt:hMt:o?pMt:_Mt}var NHe={withFileTypes:!0},vMt=(h,o,d,g,E)=>{if(h.queue.enqueue(),g<0)return h.queue.dequeue(null,h);let{fs:R}=h;h.visited.push(o),h.counts.directories++,R.readdir(o||".",NHe,(G,le=[])=>{E(le,d,g),h.queue.dequeue(h.options.suppressErrors?null:G,h)})},bMt=(h,o,d,g,E)=>{let{fs:R}=h;if(g<0)return;h.visited.push(o),h.counts.directories++;let G=[];try{G=R.readdirSync(o||".",NHe)}catch(le){if(!h.options.suppressErrors)throw le}E(G,d,g)};function SMt(h){return h?bMt:vMt}var TMt=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))}},EMt=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}},xMt=class{aborted=!1;abort(){this.aborted=!0}},RHe=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(h,o,d){this.isSynchronous=!d,this.callbackInvoker=yMt(o,this.isSynchronous),this.root=aAe(h,o),this.state={root:FRt(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new EMt,options:o,queue:new TMt((g,E)=>this.callbackInvoker(E,g,d)),symlinks:new Map,visited:[""].slice(0,0),controller:new xMt,fs:o.fs||LRt},this.joinPath=GRt(this.root,o),this.pushDirectory=JRt(this.root,o),this.pushFile=ZRt(o),this.getArray=nMt(o),this.groupFiles=oMt(o),this.resolveSymlink=lMt(o,this.isSynchronous),this.walkDirectory=SMt(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,d)=>{let{paths:g,options:{filters:E,resolveSymlinks:R,excludeSymlinks:G,exclude:le,maxFiles:Re,signal:nt,useRealPaths:at,pathSeparator:dt},controller:xe}=this.state;if(xe.aborted||nt&&nt.aborted||Re&&g.length>Re)return;let gn=this.getArray(this.state.paths);for(let pt=0;pt<h.length;++pt){let ut=h[pt];if(ut.isFile()||ut.isSymbolicLink()&&!R&&!G){let yi=this.joinPath(ut.name,o);this.pushFile(yi,gn,this.state.counts,E)}else if(ut.isDirectory()){let yi=zRt(ut.name,o,this.state.options.pathSeparator);if(le&&le(ut.name,yi))continue;this.pushDirectory(yi,g,E),this.walkDirectory(this.state,yi,yi,d-1,this.walk)}else if(this.resolveSymlink&&ut.isSymbolicLink()){let yi=CHe(ut.name,o);this.resolveSymlink(yi,this.state,(wi,eo)=>{if(wi.isDirectory()){if(eo=aAe(eo,this.state.options),le&&le(ut.name,at?eo:yi+dt))return;this.walkDirectory(this.state,eo,at?eo:yi+dt,d-1,this.walk)}else{eo=at?eo:yi;let qa=(0,TC.basename)(eo),bl=aAe((0,TC.dirname)(eo),this.state.options);eo=this.joinPath(qa,bl),this.pushFile(eo,gn,this.state.counts,E)}})}}this.groupFiles(this.state.groups,o,gn)}};function AMt(h,o){return new Promise((d,g)=>{MHe(h,o,(E,R)=>{if(E)return g(E);d(R)})})}function MHe(h,o,d){new RHe(h,o,d).start()}function DMt(h,o){return new RHe(h,o).start()}var xHe=class{constructor(h,o){this.root=h,this.options=o}withPromise(){return AMt(this.root,this.options)}withCallback(h){MHe(this.root,this.options,h)}sync(){return DMt(this.root,this.options)}},LHe=null;try{require.resolve("picomatch"),LHe=oAe()}catch{}var IMt=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:TC.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 xHe(h||".",this.options)}withGlobFunction(h){return this.globFunction=h,this}crawlWithOptions(h,o){return this.options={...this.options,...o},new xHe(h||".",this.options)}glob(...h){return this.globFunction?this.globWithOptions(h):this.globWithOptions(h,{dot:!0})}globWithOptions(h,...o){let d=this.globFunction||LHe;if(!d)throw new Error("Please specify a glob function to use glob matching.");var g=this.globCache[h.join("\0")];return g||(g=d(h,...o),this.globCache[h.join("\0")]=g),this.options.filters.push(E=>g(E)),this}};kHe.fdir=IMt});var JHe=zm(lw=>{Object.defineProperty(lw,Symbol.toStringTag,{value:"Module"});var CMt=Object.create,FHe=Object.defineProperty,PMt=Object.getOwnPropertyDescriptor,NMt=Object.getOwnPropertyNames,RMt=Object.getPrototypeOf,MMt=Object.prototype.hasOwnProperty,LMt=(h,o,d,g)=>{if(o&&typeof o=="object"||typeof o=="function")for(var E=NMt(o),R=0,G=E.length,le;R<G;R++)le=E[R],!MMt.call(h,le)&&le!==d&&FHe(h,le,{get:(Re=>o[Re]).bind(null,le),enumerable:!(g=PMt(o,le))||g.enumerable});return h},kMt=(h,o,d)=>(d=h!=null?CMt(RMt(h)):{},LMt(o||!h||!h.__esModule?FHe(d,"default",{value:h,enumerable:!0}):d,h)),B8=require("fs"),EC=require("path"),wMt=require("url"),OMt=wHe(),sw=oAe();sw=kMt(sw);var FMt=Array.isArray,WHe=/\\/g,lAe=process.platform==="win32",WMt=/^(\/?\.\.)+$/;function BMt(h,o={}){let d=h.length,g=Array(d),E=Array(d),R,G;for(R=0;R<d;R++){let le=BHe(h[R]);g[R]=le;let Re=le.length,nt=Array(Re);for(G=0;G<Re;G++)nt[G]=(0,sw.default)(le[G],o);E[R]=nt}return le=>{let Re=le.split("/");if(Re[0]===".."&&WMt.test(le))return!0;for(R=0;R<d;R++){let nt=g[R],at=E[R],dt=Re.length,xe=Math.min(dt,nt.length);for(G=0;G<xe;){let gn=nt[G];if(gn.includes("/"))return!0;if(!at[G](Re[G]))break;if(!o.noglobstar&&gn==="**")return!0;G++}if(G===dt)return!0}return!1}}var zMt=/^[A-Z]:\/$/i,GMt=lAe?h=>zMt.test(h):h=>h==="/";function OHe(h,o,d){if(h===o||o.startsWith(`${h}/`)){if(d){let E=h.length+ +!GMt(h);return(R,G)=>R.slice(E,G?-1:void 0)||"."}let g=o.slice(h.length+1);return g?(E,R)=>{if(E===".")return g;let G=`${g}/${E}`;return R?G.slice(0,-1):G}:(E,R)=>R&&E!=="."?E.slice(0,-1):E}return d?g=>EC.posix.relative(h,g)||".":g=>EC.posix.relative(h,`${o}/${g}`)||"."}function VMt(h,o){if(o.startsWith(`${h}/`)){let d=o.slice(h.length+1);return g=>`${d}/${g}`}return d=>{let g=EC.posix.relative(h,`${o}/${d}`);return d[d.length-1]==="/"&&g!==""?`${g}/`:g||"."}}var jMt={parts:!0};function BHe(h){var o;let d=sw.default.scan(h,jMt);return!((o=d.parts)===null||o===void 0)&&o.length?d.parts:[h]}var UMt=/\\(?![()[\]{}!+@])/g;function HMt(h){return zHe(h)}function KMt(h){return GHe(h).replace(UMt,"/")}var JMt=lAe?KMt:HMt,qMt=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,XMt=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,zHe=h=>h.replace(qMt,"\\$&"),GHe=h=>h.replace(XMt,"\\$&"),VHe=lAe?GHe:zHe;function jHe(h,o){if(o?.caseSensitiveMatch===!1)return!0;let d=sw.default.scan(h);return d.isGlob||d.negated}function z5(...h){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...h)}function UHe(h){return typeof h=="string"?[h]:h??[]}var $Mt=/^(\/?\.\.)+/,YMt=/\\(?=[()[\]{}!*+?@|])/g;function sAe(h,o,d,g){var E;let R=o.cwd,G=h;h[h.length-1]==="/"&&(G=h.slice(0,-1)),G[G.length-1]!=="*"&&o.expandDirectories&&(G+="/**");let le=VHe(R);G=(0,EC.isAbsolute)(G.replace(YMt,""))?EC.posix.relative(le,G):EC.posix.normalize(G);let Re=(E=$Mt.exec(G))===null||E===void 0?void 0:E[0],nt=BHe(G);if(Re){let dt=(Re.length+1)/3,xe=0,gn=le.split("/");for(;xe<dt&&nt[xe+dt]===gn[gn.length+xe-dt];)G=G.slice(0,(dt-xe-1)*3)+G.slice((dt-xe)*3+nt[xe+dt].length+1)||".",xe++;let pt=EC.posix.join(R,Re.slice(xe*3));pt[0]!=="."&&d.root.length>pt.length&&(d.root=pt,d.depthOffset=-dt+xe)}if(!g&&d.depthOffset>=0){var at;(at=d.commonPath)!==null&&at!==void 0||(d.commonPath=nt);let dt=[],xe=Math.min(d.commonPath.length,nt.length);for(let gn=0;gn<xe;gn++){let pt=nt[gn];if(pt==="**"&&!nt[gn+1]){dt.pop();break}if(gn===nt.length-1||pt!==d.commonPath[gn]||jHe(pt))break;dt.push(pt)}d.depthOffset=dt.length,d.commonPath=dt,d.root=dt.length>0?EC.posix.join(R,...dt):R}return G}function QMt(h,o,d){let g=[],E=[];for(let R of h.ignore)R&&(R[0]!=="!"||R[1]==="(")&&E.push(sAe(R,h,d,!0));for(let R of o)R&&(R[0]!=="!"||R[1]==="("?g.push(sAe(R,h,d,!1)):(R[1]!=="!"||R[2]==="(")&&E.push(sAe(R.slice(1),h,d,!0)));return{match:g,ignore:E}}function ZMt(h,o){let d=h.cwd,g={root:d,depthOffset:0},E=QMt(h,o,g);h.debug&&z5("internal processing patterns:",E);let{absolute:R,caseSensitiveMatch:G,debug:le,dot:Re,followSymbolicLinks:nt,onlyDirectories:at}=h,dt=g.root.replace(WHe,""),xe={dot:Re,nobrace:h.braceExpansion===!1,nocase:!G,noextglob:h.extglob===!1,noglobstar:h.globstar===!1,posix:!0},gn=(0,sw.default)(E.match,xe),pt=(0,sw.default)(E.ignore,xe),ut=BMt(E.match,xe),yi=OHe(d,dt,R),wi=R?yi:OHe(d,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-g.depthOffset));let bl=new OMt.fdir({filters:[le?(Sa,Lr)=>{let In=yi(Sa,Lr),Ii=gn(In)&&!pt(In);return Ii&&z5(`matched ${In}`),Ii}:(Sa,Lr)=>{let In=yi(Sa,Lr);return gn(In)&&!pt(In)}],exclude:le?(Sa,Lr)=>{let In=eo(Sa,Lr);return z5(`${In?"skipped":"crawling"} ${Lr}`),In}:eo,fs:h.fs,pathSeparator:"/",relativePaths:!R,resolvePaths:R,includeBasePath:R,resolveSymlinks:nt,excludeSymlinks:!nt,excludeFiles:at,includeDirs:at||!h.onlyFiles,maxDepth:qa,signal:h.signal}).crawl(dt);return h.debug&&z5("internal properties:",{...g,root:dt}),[bl,d!==dt&&!R&&VMt(d,dt)]}function HHe(h,o){if(o)for(let d=h.length-1;d>=0;d--)h[d]=o(h[d]);return h}var eLt={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function tLt(h){let o={...eLt,...h};return o.cwd=(o.cwd instanceof URL?(0,wMt.fileURLToPath)(o.cwd):(0,EC.resolve)(o.cwd)).replace(WHe,"/"),o.ignore=UHe(o.ignore),o.fs&&(o.fs={readdir:o.fs.readdir||B8.readdir,readdirSync:o.fs.readdirSync||B8.readdirSync,realpath:o.fs.realpath||B8.realpath,realpathSync:o.fs.realpathSync||B8.realpathSync,stat:o.fs.stat||B8.stat,statSync:o.fs.statSync||B8.statSync}),o.debug&&z5("globbing with options:",o),o}function KHe(h,o={}){var d;if(h&&o?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let g=FMt(h)||typeof h=="string",E=UHe((d=g?h:h.patterns)!==null&&d!==void 0?d:"**/*"),R=tLt(g?o:h);return E.length>0?ZMt(R,E):[]}async function nLt(h,o){let[d,g]=KHe(h,o);return d?HHe(await d.withPromise(),g):[]}function rLt(h,o){let[d,g]=KHe(h,o);return d?HHe(d.sync(),g):[]}lw.convertPathToPattern=JMt;lw.escapePath=VHe;lw.glob=nLt;lw.globSync=rLt;lw.isDynamicPattern=jHe});var lKe=zm(Zo=>{"use strict";var Rv=IUe(),iLt=$Ue(),oLt=ZUe(),aLt=require("node:fs"),sLt=require("node:fs/promises"),lLt=require("node:os"),cLt=require("node:path"),qHe=JHe();function dLt(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}function G8(h){if(h&&typeof h=="object"&&"default"in h)return h;var o=Object.create(null);return h&&Object.keys(h).forEach(function(d){if(d!=="default"){var g=Object.getOwnPropertyDescriptor(h,d);Object.defineProperty(o,d,g.get?g:{enumerable:!0,get:function(){return h[d]}})}}),o.default=h,Object.freeze(o)}var mT=G8(Rv),QHe=G8(iLt),cAe=dLt(oLt),Nv=G8(aLt),uLt=G8(sLt),pLt=G8(lLt),ZZ=G8(cLt),eee=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,d){let g=this.get(o);return g==null&&(g=d(),this.set(o,g)),g}has(o){return this.#e.has(o)}get(o){return this.#e.get(o)}set(o,d){this.#e.set(o,d)}replaceKey(o,d){if(!this.#e.has(o))throw new Error("Key not found.");let g=this.#e.get(o);this.#e.delete(o),this.#e.set(d,g)}removeByKey(o){this.#e.delete(o)}clear(){this.#e.clear()}},tee=class{#e;#t;constructor(o,d){this.#e=o,this.#t=d}compareTo(o){return this.#e.compareTo(this.#t,o)}},nee=class h{static instance=new h;compareTo(o,d){let g=o.localeCompare(d,"en-us-u-kf-upper");return g<0?-1:g===0?0:1}},ree=class{#e;#t;constructor(o,d){this.#t=o,this.#e=d}compareTo(o,d){return this.#e.compareTo(this.#t(o),this.#t(d))}},iee=class{#e;#t;constructor(o,d){this.#t=o,this.#e=d}compareTo(o){return this.#e.compareTo(this.#t(o))}},ZE=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((d,g)=>o.indexOf(d)===g)}static removeFirst(o,d){let g=o.indexOf(d);return g===-1?!1:(o.splice(g,1),!0)}static removeAll(o,d){let g=[];for(let E=o.length-1;E>=0;E--)d(o[E])&&(g.push(o[E]),o.splice(E,1));return g}static*toIterator(o){for(let d of o)yield d}static sortByProperty(o,d){return o.sort((g,E)=>d(g)<=d(E)?-1:1),o}static groupBy(o,d){let g=[],E={};for(let R of o){let G=d(R).toString();E[G]==null&&(E[G]=[],g.push(E[G])),E[G].push(R)}return g}static binaryInsertWithOverwrite(o,d,g){let E=o.length-1,R=0;for(;R<=E;){let G=Math.floor((E+R)/2);g.compareTo(d,o[G])<0?E=G-1:R=G+1}o[E]!=null&&g.compareTo(d,o[E])===0?o[E]=d:o.splice(E+1,0,d)}static binarySearch(o,d){let g=o.length-1,E=0;for(;E<=g;){let R=Math.floor((g+E)/2),G=d.compareTo(o[R]);if(G===0)return R;G<0?g=R-1:E=R+1}return-1}static containsSubArray(o,d){let g=0;for(let E of o)if(d[g]===E){if(g++,g===d.length)return!0}else g=0;return!1}};function ZHe(h){return o(h);function o(E){let R=Object.create(E.constructor.prototype);for(let G of Object.keys(E))R[G]=g(E[G]);return R}function d(E){return E.map(g)}function g(E){return E instanceof Array?d(E):typeof E=="object"?E===null?E:o(E):E}}var oee=class{#e=[];subscribe(o){this.#t(o)===-1&&this.#e.push(o)}unsubscribe(o){let d=this.#t(o);d>=0&&this.#e.splice(d,1)}fire(o){for(let d of this.#e)d(o)}#t(o){return this.#e.indexOf(o)}},pAe=class{static find(o,d){for(let g of o)if(d(g))return g}};function fAe(h,o){return o??h}var mAe=class h{constructor(){}static clone(o){if(o==null)return;if(o instanceof Array)return d(o);return Object.assign({},o);function d(g){return g.map(E=>h.clone(E))}}};function eKe(h,o,d,g,E,R,G,le,Re,nt){return mT.matchFiles.apply(this,arguments)}function tKe(h,o,d,g,E){return mT.getFileMatcherPatterns.apply(this,arguments)}function fLt(h){return mT.getEmitModuleResolutionKind.apply(this,arguments)}function nKe(h){return mLt()[h]}var z8;function mLt(){if(z8!=null)return z8;z8={};for(let h of Object.keys(mT.SyntaxKind).filter(o=>isNaN(parseInt(o,10)))){let o=mT.SyntaxKind[h];z8[o]==null&&(z8[o]=h)}return z8}Zo.errors=void 0;(function(h){class o extends Error{constructor(Ii,_i){let Fr=_i&&_Lt(_i),bi=Fr?`${Ii}
|
|
433
|
+
`+C.stack)}finally{this.performanceData=y}}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 _ze(e){let t=e.diagnosticsDuration&&Co(e.diagnosticsDuration,([r,i])=>({...i,file:r}));return{...e,diagnosticsDuration:t}}function $h(e,t){return{start:t.positionToLineOffset(e.start),end:t.positionToLineOffset(Wl(e))}}function HSe(e,t,r){let i=$h(e,r),a=t&&$h(t,r);return a?{...i,contextStart:a.start,contextEnd:a.end}:i}function dyt(e,t){return{start:hze(t,e.span.start),end:hze(t,Wl(e.span)),newText:e.newText}}function hze(e,t){return WSe(e)?pyt(e.getLineAndCharacterOfPosition(t)):e.positionToLineOffset(t)}function uyt(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 pyt(e){return{line:e.line+1,offset:e.character+1}}function fyt(e){L.assert(e.textChanges.length===1);let t=rs(e.textChanges);return L.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 KSe(e,t,r,i){let a=myt(e,t,i),{line:l,character:c}=WC(lD(a),r);return{line:l+1,offset:c+1}}function myt(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 gze(e,{fileName:t,textSpan:r,contextSpan:i,isWriteAccess:a,isDefinition:l},{disableLineTextInReferences:c}){let f=L.checkDefined(e.getScriptInfo(t)),p=HSe(r,i,f),b=c?void 0:_yt(f,p);return{file:t,...p,lineText:b,isWriteAccess:a,isDefinition:l}}function _yt(e,t){let r=e.lineToTextSpan(t.start.line-1);return e.getSnapshot().getText(r.start,Wl(r)).replace(/\r|\n/g,"")}function hyt(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 xN=4,JSe=(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))(JSe||{}),gyt=class{constructor(){this.goSubtree=!0,this.lineIndex=new PW,this.endBranch=[],this.state=2,this.initialText="",this.trailingText="",this.lineIndex.root=new AN,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=PW.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 i7(i[S]);let b=this.startPath.length-2;for(;b>=0;){let S=this.startPath[b];f=S.insertAt(p,f),b--,p=S}let y=f.length;for(;y>0;){let S=new AN;S.add(this.lineIndex.root),f=S.insertAt(this.lineIndex.root,f),y=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 i7(""):new AN}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)}},yyt=class{constructor(e,t,r){this.pos=e,this.deleteLen=t,this.insertedText=r}getTextChangeRange(){return jw(Jd(this.pos,this.deleteLen),this.insertedText?this.insertedText.length:0)}},xY=class F1{constructor(){this.changes=[],this.versions=new Array(F1.maxVersions),this.minVersion=0,this.currentVersion=0}versionToIndex(t){if(!(t<this.minVersion||t>this.currentVersion))return t%F1.maxVersions}currentVersionToIndex(){return this.currentVersion%F1.maxVersions}edit(t,r,i){this.changes.push(new yyt(t,r,i)),(this.changes.length>F1.changeNumberThreshold||r>F1.changeLengthThreshold||i&&i.length>F1.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 yze(this.currentVersion+1,this,r,this.changes),this.currentVersion=t.version,this.versions[this.currentVersionToIndex()]=t,this.changes=[],this.currentVersion-this.minVersion>=F1.maxVersions&&(this.minVersion=this.currentVersion-F1.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 Jd(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 Nse(i)}else return;else return N6}getLineCount(){return this._getSnapshot().index.getLineCount()}static fromString(t){let r=new F1,i=new yze(0,r,new PW);r.versions[r.currentVersion]=i;let a=PW.linesFromText(t);return i.index.load(a.lines),r}};xY.changeNumberThreshold=8,xY.changeLengthThreshold=256,xY.maxVersions=8;var AY=xY,yze=class AUe{constructor(t,r,i,a=ld){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 AUe&&this.cache===t.cache)return this.version<=t.version?N6:this.cache.getTextChangesBetweenVersions(t.version,this.version)}},PW=class Gxe{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 i7(t[i]);this.root=Gxe.buildTreeFromBottom(r)}else this.root=new AN}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 L.assert(r===0),i!==void 0?(this.load(Gxe.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 gyt,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:b}=this.positionToColumnAndLineText(f);p===0&&(r+=b.length,i=i?i+b:b)}if(this.root.walk(t,r,l),l.insertLines(i,c),this.checkEdits){let f=l.lineIndex.getText(0,l.lineIndex.getLength());L.assert(a===f,"buffer edit mismatch")}return l.lineIndex}}static buildTreeFromBottom(t){if(t.length<xN)return new AN(t);let r=new Array(Math.ceil(t.length/xN)),i=0;for(let a=0;a<r.length;a++){let l=Math.min(i+xN,t.length);r[a]=new AN(t.slice(i,l)),i=l}return this.buildTreeFromBottom(r)}static linesFromText(t){let r=lD(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}}},AN=class Vxe{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=L.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 Vxe;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 L.assert(r!==-1),r}insertAt(t,r){let i=this.findChildIndex(t),a=this.children.length,l=r.length;if(a<xN&&i===a-1&&l===1)return this.add(r[0]),this.updateCounts(),[];{let c=this.splitAfter(i),f=0;for(i++;i<xN&&f<l;)this.children[i]=r[f],i++,f++;let p=[],b=0;if(f<l){b=Math.ceil((l-f)/xN),p=new Array(b);let y=0;for(let I=0;I<b;I++)p[I]=new Vxe;let S=p[0];for(;f<l;)S.add(r[f]),f++,S.children.length===xN&&(y++,S=p[y]);for(let I=p.length-1;I>=0;I--)p[I].children.length===0&&p.pop()}c&&p.push(c),this.updateCounts();for(let y=0;y<b;y++)p[y].updateCounts();return p}}add(t){this.children.push(t),L.assert(this.children.length<=xN)}charCount(){return this.totalChars}lineCount(){return this.totalLines}},i7=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}},vze=class DUe{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=Iw(),this.requestMap=new Map,this.requestedRegistry=!1,this.packageInstallId=0}isKnownTypesPackageName(t){var r;return RS.validatePackageName(t)!==RS.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=eSe(t,r,i);this.logger.hasLevel(3)&&this.logger.info(`TIAdapter:: Scheduling throttled operation:${nE(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:${nE(t)}`),t.kind){case XJ:this.typesRegistryCache=new Map(Object.entries(t.typesRegistry));break;case Ez:{let a=(r=this.packageInstalledPromise)==null?void 0:r.get(t.id);L.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 a_e:{let a={message:t.message};this.event(a,"typesInstallerInitializationFailed");break}case $J:{let a={eventId:t.eventId,packages:t.packagesToInstall};this.event(a,"beginInstallTypes");break}case YJ:{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 Tz:{this.projectService.updateTypingsForProject(t);break}case Sz:{for(this.activeRequestCount>0?this.activeRequestCount--:L.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 xF: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:${nE(t)}`),this.installer.send(t)},DUe.requestDelayMillis,`${t.projectName}::${t.kind}`)}};vze.requestDelayMillis=100;var bze=vze,Sze={};R(Sze,{ActionInvalidate:()=>Tz,ActionPackageInstalled:()=>Ez,ActionSet:()=>Sz,ActionWatchTypingLocations:()=>xF,Arguments:()=>QJ,AutoImportProviderProject:()=>SSe,AuxiliaryProject:()=>vSe,CharRangeSection:()=>JSe,CloseFileWatcherEvent:()=>fY,CommandNames:()=>aze,ConfigFileDiagEvent:()=>lY,ConfiguredProject:()=>TSe,ConfiguredProjectLoadKind:()=>CSe,CreateDirectoryWatcherEvent:()=>pY,CreateFileWatcherEvent:()=>uY,Errors:()=>iv,EventBeginInstallTypes:()=>$J,EventEndInstallTypes:()=>YJ,EventInitializationFailed:()=>a_e,EventTypesRegistry:()=>XJ,ExternalProject:()=>nY,GcTimer:()=>sSe,InferredProject:()=>ySe,LargeFileReferencedEvent:()=>sY,LineIndex:()=>PW,LineLeaf:()=>i7,LineNode:()=>AN,LogLevel:()=>Qbe,Msg:()=>Zbe,OpenFileInfoTelemetryEvent:()=>ESe,Project:()=>RI,ProjectInfoTelemetryEvent:()=>dY,ProjectKind:()=>dk,ProjectLanguageServiceStateEvent:()=>cY,ProjectLoadingFinishEvent:()=>aY,ProjectLoadingStartEvent:()=>oY,ProjectService:()=>FSe,ProjectsUpdatedInBackgroundEvent:()=>t7,ScriptInfo:()=>uSe,ScriptVersionCache:()=>AY,Session:()=>mze,TextStorage:()=>dSe,ThrottledOperations:()=>aSe,TypingsInstallerAdapter:()=>bze,allFilesAreJsOrDts:()=>_Se,allRootFilesAreJsOrDts:()=>mSe,asNormalizedPath:()=>MBe,convertCompilerOptions:()=>n7,convertFormatOptions:()=>TN,convertScriptKindName:()=>_Y,convertTypeAcquisition:()=>ASe,convertUserPreferences:()=>DSe,convertWatchOptions:()=>IW,countEachFileTypes:()=>EW,createInstallTypingsRequest:()=>eSe,createModuleSpecifierCache:()=>zSe,createNormalizedPathMap:()=>LBe,createPackageJsonCache:()=>GSe,createSortedArray:()=>oSe,emptyArray:()=>ld,findArgument:()=>LLe,formatDiagnosticToProtocol:()=>CW,formatMessage:()=>VSe,getBaseConfigFileName:()=>tY,getDetailWatchInfo:()=>vY,getLocationInNewDocument:()=>KSe,hasArgument:()=>MLe,hasNoTypeScriptSource:()=>hSe,indent:()=>wL,isBackgroundProject:()=>AW,isConfigFile:()=>WSe,isConfiguredProject:()=>ab,isDynamicFileName:()=>ck,isExternalProject:()=>xW,isInferredProject:()=>SN,isInferredProjectName:()=>tSe,isProjectDeferredClose:()=>DW,makeAutoImportProviderProjectName:()=>rSe,makeAuxiliaryProjectName:()=>iSe,makeInferredProjectName:()=>nSe,maxFileSize:()=>iY,maxProgramSizeForNonTsFiles:()=>rY,normalizedPathToPath:()=>bN,nowString:()=>kLe,nullCancellationToken:()=>rze,nullTypingsInstaller:()=>r7,protocol:()=>lSe,scriptInfoIsContainedByBackgroundProject:()=>pSe,scriptInfoIsContainedByDeferredClosedProject:()=>fSe,stringifyIndented:()=>nE,toEvent:()=>jSe,toNormalizedPath:()=>ws,tryConvertScriptKindName:()=>mY,typingsInstaller:()=>Ybe,updateProjectIfDirty:()=>i_}),typeof console<"u"&&(L.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 vUe},set exports(h){vUe=h,typeof zZ<"u"&&zZ.exports&&(zZ.exports=h)}})});var PUe=zm(ow=>{"use strict";Object.defineProperty(ow,"__esModule",{value:!0});ow.range=ow.balanced=void 0;var CPt=(h,o,d)=>{let g=h instanceof RegExp?CUe(h,d):h,E=o instanceof RegExp?CUe(o,d):o,R=g!==null&&E!=null&&(0,ow.range)(g,E,d);return R&&{start:R[0],end:R[1],pre:d.slice(0,R[0]),body:d.slice(R[0]+g.length,R[1]),post:d.slice(R[1]+E.length)}};ow.balanced=CPt;var CUe=(h,o)=>{let d=o.match(h);return d?d[0]:null},PPt=(h,o,d)=>{let g,E,R,G,le,Re=d.indexOf(h),nt=d.indexOf(o,Re+1),at=Re;if(Re>=0&&nt>0){if(h===o)return[Re,nt];for(g=[],R=d.length;at>=0&&!le;){if(at===Re)g.push(at),Re=d.indexOf(h,at+1);else if(g.length===1){let dt=g.pop();dt!==void 0&&(le=[dt,nt])}else E=g.pop(),E!==void 0&&E<R&&(R=E,G=nt),nt=d.indexOf(o,at+1);at=Re<nt&&Re>=0?Re:nt}g.length&&G!==void 0&&(le=[R,G])}return le};ow.range=PPt});var OUe=zm(O8=>{"use strict";Object.defineProperty(O8,"__esModule",{value:!0});O8.EXPANSION_MAX=void 0;O8.expand=VPt;var NUe=PUe(),RUe="\0SLASH"+Math.random()+"\0",MUe="\0OPEN"+Math.random()+"\0",Uxe="\0CLOSE"+Math.random()+"\0",LUe="\0COMMA"+Math.random()+"\0",kUe="\0PERIOD"+Math.random()+"\0",NPt=new RegExp(RUe,"g"),RPt=new RegExp(MUe,"g"),MPt=new RegExp(Uxe,"g"),LPt=new RegExp(LUe,"g"),kPt=new RegExp(kUe,"g"),wPt=/\\\\/g,OPt=/\\{/g,FPt=/\\}/g,WPt=/\\,/g,BPt=/\\\./g;O8.EXPANSION_MAX=1e5;function jxe(h){return isNaN(h)?h.charCodeAt(0):parseInt(h,10)}function zPt(h){return h.replace(wPt,RUe).replace(OPt,MUe).replace(FPt,Uxe).replace(WPt,LUe).replace(BPt,kUe)}function GPt(h){return h.replace(NPt,"\\").replace(RPt,"{").replace(MPt,"}").replace(LPt,",").replace(kPt,".")}function wUe(h){if(!h)return[""];let o=[],d=(0,NUe.balanced)("{","}",h);if(!d)return h.split(",");let{pre:g,body:E,post:R}=d,G=g.split(",");G[G.length-1]+="{"+E+"}";let le=wUe(R);return R.length&&(G[G.length-1]+=le.shift(),G.push.apply(G,le)),o.push.apply(o,G),o}function VPt(h,o={}){if(!h)return[];let{max:d=O8.EXPANSION_MAX}=o;return h.slice(0,2)==="{}"&&(h="\\{\\}"+h.slice(2)),k5(zPt(h),d,!0).map(GPt)}function jPt(h){return"{"+h+"}"}function UPt(h){return/^-?0\d/.test(h)}function HPt(h,o){return h<=o}function KPt(h,o){return h>=o}function k5(h,o,d){let g=[],E=(0,NUe.balanced)("{","}",h);if(!E)return[h];let R=E.pre,G=E.post.length?k5(E.post,o,!1):[""];if(/\$$/.test(E.pre))for(let le=0;le<G.length&&le<o;le++){let Re=R+"{"+E.body+"}"+G[le];g.push(Re)}else{let le=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(E.body),Re=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(E.body),nt=le||Re,at=E.body.indexOf(",")>=0;if(!nt&&!at)return E.post.match(/,(?!,).*\}/)?(h=E.pre+"{"+E.body+Uxe+E.post,k5(h,o,!0)):[h];let dt;if(nt)dt=E.body.split(/\.\./);else if(dt=wUe(E.body),dt.length===1&&dt[0]!==void 0&&(dt=k5(dt[0],o,!1).map(jPt),dt.length===1))return G.map(gn=>E.pre+dt[0]+gn);let xe;if(nt&&dt[0]!==void 0&&dt[1]!==void 0){let gn=jxe(dt[0]),pt=jxe(dt[1]),ut=Math.max(dt[0].length,dt[1].length),yi=dt.length===3&&dt[2]!==void 0?Math.max(Math.abs(jxe(dt[2])),1):1,wi=HPt;pt<gn&&(yi*=-1,wi=KPt);let qa=dt.some(UPt);xe=[];for(let bl=gn;wi(bl,pt)&&xe.length<o;bl+=yi){let Sa;if(Re)Sa=String.fromCharCode(bl),Sa==="\\"&&(Sa="");else if(Sa=String(bl),qa){let Lr=ut-Sa.length;if(Lr>0){let In=new Array(Lr+1).join("0");bl<0?Sa="-"+In+Sa.slice(1):Sa=In+Sa}}xe.push(Sa)}}else{xe=[];for(let gn=0;gn<dt.length;gn++)xe.push.apply(xe,k5(dt[gn],o,!1))}for(let gn=0;gn<xe.length;gn++)for(let pt=0;pt<G.length&&g.length<o;pt++){let ut=R+xe[gn]+G[pt];(!d||nt||ut)&&g.push(ut)}}return g}});var FUe=zm(GZ=>{"use strict";Object.defineProperty(GZ,"__esModule",{value:!0});GZ.assertValidPattern=void 0;var JPt=1024*64,qPt=h=>{if(typeof h!="string")throw new TypeError("invalid pattern");if(h.length>JPt)throw new TypeError("pattern is too long")};GZ.assertValidPattern=qPt});var BUe=zm(VZ=>{"use strict";Object.defineProperty(VZ,"__esModule",{value:!0});VZ.parseClass=void 0;var XPt={"[: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]},w5=h=>h.replace(/[[\]\\-]/g,"\\$&"),$Pt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),WUe=h=>h.join(""),YPt=(h,o)=>{let d=o;if(h.charAt(d)!=="[")throw new Error("not in a brace expression");let g=[],E=[],R=d+1,G=!1,le=!1,Re=!1,nt=!1,at=d,dt="";e:for(;R<h.length;){let ut=h.charAt(R);if((ut==="!"||ut==="^")&&R===d+1){nt=!0,R++;continue}if(ut==="]"&&G&&!Re){at=R+1;break}if(G=!0,ut==="\\"&&!Re){Re=!0,R++;continue}if(ut==="["&&!Re){for(let[yi,[wi,eo,qa]]of Object.entries(XPt))if(h.startsWith(yi,R)){if(dt)return["$.",!1,h.length-d,!0];R+=yi.length,qa?E.push(wi):g.push(wi),le=le||eo;continue e}}if(Re=!1,dt){ut>dt?g.push(w5(dt)+"-"+w5(ut)):ut===dt&&g.push(w5(ut)),dt="",R++;continue}if(h.startsWith("-]",R+1)){g.push(w5(ut+"-")),R+=2;continue}if(h.startsWith("-",R+1)){dt=ut,R+=2;continue}g.push(w5(ut)),R++}if(at<R)return["",!1,0,!1];if(!g.length&&!E.length)return["$.",!1,h.length-d,!0];if(E.length===0&&g.length===1&&/^\\?.$/.test(g[0])&&!nt){let ut=g[0].length===2?g[0].slice(-1):g[0];return[$Pt(ut),!1,at-d,!1]}let xe="["+(nt?"^":"")+WUe(g)+"]",gn="["+(nt?"":"^")+WUe(E)+"]";return[g.length&&E.length?"("+xe+"|"+gn+")":g.length?xe:gn,le,at-d,!0]};VZ.parseClass=YPt});var UZ=zm(jZ=>{"use strict";Object.defineProperty(jZ,"__esModule",{value:!0});jZ.unescape=void 0;var QPt=(h,{windowsPathsNoEscape:o=!1,magicalBraces:d=!0}={})=>d?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");jZ.unescape=QPt});var Jxe=zm(qZ=>{"use strict";var wb;Object.defineProperty(qZ,"__esModule",{value:!0});qZ.AST=void 0;var ZPt=BUe(),HZ=UZ(),eNt=new Set(["!","?","+","*","@"]),Hxe=h=>eNt.has(h),zUe=h=>Hxe(h.type),tNt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),nNt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),rNt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),GUe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),iNt="(?!(?:^|/)\\.\\.?(?:$|/))",KZ="(?!\\.)",oNt=new Set(["[","."]),aNt=new Set(["..","."]),sNt=new Set("().*{}+?[]^$\\!"),lNt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Kxe="[^/]",VUe=Kxe+"*?",jUe=Kxe+"+?",cNt=0,JZ=class{type;#e;#t;#n=!1;#r=[];#i;#o;#a;#s=!1;#c;#m;#_=!1;id=++cNt;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,d,g={}){this.type=o,o&&(this.#t=!0),this.#i=d,this.#e=this.#i?this.#i.#e:this,this.#c=this.#e===this?g: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 d=o,g=d.#i;for(;g;){for(let E=d.#o+1;!g.type&&E<g.#r.length;E++)for(let R of o.#r){if(typeof R=="string")throw new Error("string part in extglob AST??");R.copyIn(g.#r[E])}d=g,g=d.#i}}return this}push(...o){for(let d of o)if(d!==""){if(typeof d!="string"&&!(d instanceof wb&&d.#i===this))throw new Error("invalid part: "+d);this.#r.push(d)}}toJSON(){let o=this.type===null?this.#r.slice().map(d=>typeof d=="string"?d:d.toJSON()):[this.type,...this.#r.map(d=>d.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 d=0;d<this.#o;d++){let g=o.#r[d];if(!(g instanceof wb&&g.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 d=new wb(this.type,o);for(let g of this.#r)d.copyIn(g);return d}static#S(o,d,g,E,R){let G=E.maxExtglobRecursion??2,le=!1,Re=!1,nt=-1,at=!1;if(d.type===null){let ut=g,yi="";for(;ut<o.length;){let wi=o.charAt(ut++);if(le||wi==="\\"){le=!le,yi+=wi;continue}if(Re){ut===nt+1?(wi==="^"||wi==="!")&&(at=!0):wi==="]"&&!(ut===nt+2&&at)&&(Re=!1),yi+=wi;continue}else if(wi==="["){Re=!0,nt=ut,at=!1,yi+=wi;continue}if(!E.noext&&Hxe(wi)&&o.charAt(ut)==="("&&R<=G){d.push(yi),yi="";let qa=new wb(wi,d);ut=wb.#S(o,qa,ut,E,R+1),d.push(qa);continue}yi+=wi}return d.push(yi),ut}let dt=g+1,xe=new wb(null,d),gn=[],pt="";for(;dt<o.length;){let ut=o.charAt(dt++);if(le||ut==="\\"){le=!le,pt+=ut;continue}if(Re){dt===nt+1?(ut==="^"||ut==="!")&&(at=!0):ut==="]"&&!(dt===nt+2&&at)&&(Re=!1),pt+=ut;continue}else if(ut==="["){Re=!0,nt=dt,at=!1,pt+=ut;continue}if(!E.noext&&Hxe(ut)&&o.charAt(dt)==="("&&(R<=G||d&&d.#u(ut))){let wi=d&&d.#u(ut)?0:1;xe.push(pt),pt="";let eo=new wb(ut,xe);xe.push(eo),dt=wb.#S(o,eo,dt,E,R+wi);continue}if(ut==="|"){xe.push(pt),pt="",gn.push(xe),xe=new wb(null,d);continue}if(ut===")")return pt===""&&d.#r.length===0&&(d.#_=!0),xe.push(pt),pt="",d.push(...gn,xe),dt;pt+=ut}return d.type=null,d.#t=void 0,d.#r=[o.substring(g-1)],dt}#g(o){return this.#y(o,nNt)}#y(o,d=tNt){if(!o||typeof o!="object"||o.type!==null||o.#r.length!==1||this.type===null)return!1;let g=o.#r[0];return!g||typeof g!="object"||g.type===null?!1:this.#u(g.type,d)}#u(o,d=rNt){return!!d.get(this.type)?.includes(o)}#p(o,d){let g=o.#r[0],E=new wb(null,g,this.options);E.#r.push(""),g.push(E),this.#h(o,d)}#h(o,d){let g=o.#r[0];this.#r.splice(d,1,...g.#r);for(let E of g.#r)typeof E=="object"&&(E.#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 d=o.#r[0];return!d||typeof d!="object"||d.type===null?!1:this.#T(d.type)}#v(o){let d=GUe.get(this.type),g=o.#r[0],E=d?.get(g.type);if(!E)return!1;this.#r=g.#r;for(let R of this.#r)typeof R=="object"&&(R.#i=this);this.type=E,this.#m=void 0,this.#_=!1}static fromGlob(o,d={}){let g=new wb(null,void 0,d);return wb.#S(o,g,0,d,0),g}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let o=this.toString(),[d,g,E,R]=this.toRegExpSource();if(!(E||this.#t||this.#c.nocase&&!this.#c.nocaseMagicOnly&&o.toUpperCase()!==o.toLowerCase()))return g;let le=(this.#c.nocase?"i":"")+(R?"u":"");return Object.assign(new RegExp(`^${d}$`,le),{_src:d,_glob:o})}get options(){return this.#c}toRegExpSource(o){let d=o??!!this.#c.dot;if(this.#e===this&&(this.#l(),this.#E()),!zUe(this)){let Re=this.isStart()&&this.isEnd()&&!this.#r.some(gn=>typeof gn!="string"),nt=this.#r.map(gn=>{let[pt,ut,yi,wi]=typeof gn=="string"?wb.#x(gn,this.#t,Re):gn.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&&aNt.has(this.#r[0]))){let pt=oNt,ut=d&&pt.has(nt.charAt(0))||nt.startsWith("\\.")&&pt.has(nt.charAt(2))||nt.startsWith("\\.\\.")&&pt.has(nt.charAt(4)),yi=!d&&!o&&pt.has(nt.charAt(0));at=ut?iNt:yi?KZ:""}let dt="";return this.isEnd()&&this.#e.#s&&this.#i?.type==="!"&&(dt="(?:$|\\/)"),[at+nt+dt,(0,HZ.unescape)(nt),this.#t=!!this.#t,this.#n]}let g=this.type==="*"||this.type==="+",E=this.type==="!"?"(?:(?!(?:":"(?:",R=this.#d(d);if(this.isStart()&&this.isEnd()&&!R&&this.type!=="!"){let Re=this.toString(),nt=this;return nt.#r=[Re],nt.type=null,nt.#t=void 0,[Re,(0,HZ.unescape)(this.toString()),!1,!1]}let G=!g||o||d||!KZ?"":this.#d(!0);G===R&&(G=""),G&&(R=`(?:${R})(?:${G})*?`);let le="";if(this.type==="!"&&this.#_)le=(this.isStart()&&!d?KZ:"")+jUe;else{let Re=this.type==="!"?"))"+(this.isStart()&&!d&&!o?KZ:"")+VUe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&G?")":this.type==="*"&&G?")?":`)${this.type}`;le=E+R+Re}return[le,(0,HZ.unescape)(R),this.#t=!!this.#t,this.#n]}#l(){if(zUe(this)){let o=0,d=!1;do{d=!0;for(let g=0;g<this.#r.length;g++){let E=this.#r[g];typeof E=="object"&&(E.#l(),this.#y(E)?(d=!1,this.#h(E,g)):this.#g(E)?(d=!1,this.#p(E,g)):this.#f(E)&&(d=!1,this.#v(E)))}}while(!d&&++o<10)}else for(let o of this.#r)typeof o=="object"&&o.#l();this.#m=void 0}#d(o){return this.#r.map(d=>{if(typeof d=="string")throw new Error("string type in extglob ast??");let[g,E,R,G]=d.toRegExpSource(o);return this.#n=this.#n||G,g}).filter(d=>!(this.isStart()&&this.isEnd())||!!d).join("|")}static#x(o,d,g=!1){let E=!1,R="",G=!1,le=!1;for(let Re=0;Re<o.length;Re++){let nt=o.charAt(Re);if(E){E=!1,R+=(sNt.has(nt)?"\\":"")+nt;continue}if(nt==="*"){if(le)continue;le=!0,R+=g&&/^[*]+$/.test(o)?jUe:VUe,d=!0;continue}else le=!1;if(nt==="\\"){Re===o.length-1?R+="\\\\":E=!0;continue}if(nt==="["){let[at,dt,xe,gn]=(0,ZPt.parseClass)(o,Re);if(xe){R+=at,G=G||dt,Re+=xe-1,d=d||gn;continue}}if(nt==="?"){R+=Kxe,d=!0;continue}R+=lNt(nt)}return[R,(0,HZ.unescape)(o),!!d,G]}};qZ.AST=JZ;wb=JZ});var qxe=zm(XZ=>{"use strict";Object.defineProperty(XZ,"__esModule",{value:!0});XZ.escape=void 0;var dNt=(h,{windowsPathsNoEscape:o=!1,magicalBraces:d=!1}={})=>d?o?h.replace(/[?*()[\]{}]/g,"[$&]"):h.replace(/[?*()[\]\\{}]/g,"\\$&"):o?h.replace(/[?*()[\]]/g,"[$&]"):h.replace(/[?*()[\]\\]/g,"\\$&");XZ.escape=dNt});var $Ue=zm(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 uNt=OUe(),$Z=FUe(),KUe=Jxe(),pNt=qxe(),fNt=UZ(),mNt=(h,o,d={})=>((0,$Z.assertValidPattern)(o),!d.nocomment&&o.charAt(0)==="#"?!1:new aw(o,d).match(h));ms.minimatch=mNt;var _Nt=/^\*+([^+@!?\*\[\(]*)$/,hNt=h=>o=>!o.startsWith(".")&&o.endsWith(h),gNt=h=>o=>o.endsWith(h),yNt=h=>(h=h.toLowerCase(),o=>!o.startsWith(".")&&o.toLowerCase().endsWith(h)),vNt=h=>(h=h.toLowerCase(),o=>o.toLowerCase().endsWith(h)),bNt=/^\*+\.\*+$/,SNt=h=>!h.startsWith(".")&&h.includes("."),TNt=h=>h!=="."&&h!==".."&&h.includes("."),ENt=/^\.\*+$/,xNt=h=>h!=="."&&h!==".."&&h.startsWith("."),ANt=/^\*+$/,DNt=h=>h.length!==0&&!h.startsWith("."),INt=h=>h.length!==0&&h!=="."&&h!=="..",CNt=/^\?+([^+@!?\*\[\(]*)?$/,PNt=([h,o=""])=>{let d=JUe([h]);return o?(o=o.toLowerCase(),g=>d(g)&&g.toLowerCase().endsWith(o)):d},NNt=([h,o=""])=>{let d=qUe([h]);return o?(o=o.toLowerCase(),g=>d(g)&&g.toLowerCase().endsWith(o)):d},RNt=([h,o=""])=>{let d=qUe([h]);return o?g=>d(g)&&g.endsWith(o):d},MNt=([h,o=""])=>{let d=JUe([h]);return o?g=>d(g)&&g.endsWith(o):d},JUe=([h])=>{let o=h.length;return d=>d.length===o&&!d.startsWith(".")},qUe=([h])=>{let o=h.length;return d=>d.length===o&&d!=="."&&d!==".."},XUe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",UUe={win32:{sep:"\\"},posix:{sep:"/"}};ms.sep=XUe==="win32"?UUe.win32.sep:UUe.posix.sep;ms.minimatch.sep=ms.sep;ms.GLOBSTAR=Symbol("globstar **");ms.minimatch.GLOBSTAR=ms.GLOBSTAR;var LNt="[^/]",kNt=LNt+"*?",wNt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",ONt="(?:(?!(?:\\/|^)\\.).)*?",FNt=(h,o={})=>d=>(0,ms.minimatch)(d,h,o);ms.filter=FNt;ms.minimatch.filter=ms.filter;var QE=(h,o={})=>Object.assign({},h,o),WNt=h=>{if(!h||typeof h!="object"||!Object.keys(h).length)return ms.minimatch;let o=ms.minimatch;return Object.assign((g,E,R={})=>o(g,E,QE(h,R)),{Minimatch:class extends o.Minimatch{constructor(E,R={}){super(E,QE(h,R))}static defaults(E){return o.defaults(QE(h,E)).Minimatch}},AST:class extends o.AST{constructor(E,R,G={}){super(E,R,QE(h,G))}static fromGlob(E,R={}){return o.AST.fromGlob(E,QE(h,R))}},unescape:(g,E={})=>o.unescape(g,QE(h,E)),escape:(g,E={})=>o.escape(g,QE(h,E)),filter:(g,E={})=>o.filter(g,QE(h,E)),defaults:g=>o.defaults(QE(h,g)),makeRe:(g,E={})=>o.makeRe(g,QE(h,E)),braceExpand:(g,E={})=>o.braceExpand(g,QE(h,E)),match:(g,E,R={})=>o.match(g,E,QE(h,R)),sep:o.sep,GLOBSTAR:ms.GLOBSTAR})};ms.defaults=WNt;ms.minimatch.defaults=ms.defaults;var BNt=(h,o={})=>((0,$Z.assertValidPattern)(h),o.nobrace||!/\{(?:(?!\{).)*\}/.test(h)?[h]:(0,uNt.expand)(h,{max:o.braceExpandMax}));ms.braceExpand=BNt;ms.minimatch.braceExpand=ms.braceExpand;var zNt=(h,o={})=>new aw(h,o).makeRe();ms.makeRe=zNt;ms.minimatch.makeRe=ms.makeRe;var GNt=(h,o,d={})=>{let g=new aw(o,d);return h=h.filter(E=>g.match(E)),g.options.nonull&&!h.length&&h.push(o),h};ms.match=GNt;ms.minimatch.match=ms.match;var HUe=/[?*]|[+@!]\(.*?\)|\[|\]/,VNt=h=>h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),aw=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(o,d={}){(0,$Z.assertValidPattern)(o),d=d||{},this.options=d,this.maxGlobstarRecursion=d.maxGlobstarRecursion??200,this.pattern=o,this.platform=d.platform||XUe,this.isWindows=this.platform==="win32";let g="allowWindowsEscape";this.windowsPathsNoEscape=!!d.windowsPathsNoEscape||d[g]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!d.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!d.nonegate,this.comment=!1,this.empty=!1,this.partial=!!d.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=d.windowsNoMagicRoot!==void 0?d.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 d of o)if(typeof d!="string")return!0;return!1}debug(...o){}make(){let o=this.pattern,d=this.options;if(!d.nocomment&&o.charAt(0)==="#"){this.comment=!0;return}if(!o){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],d.debug&&(this.debug=(...R)=>console.error(...R)),this.debug(this.pattern,this.globSet);let g=this.globSet.map(R=>this.slashSplit(R));this.globParts=this.preprocess(g),this.debug(this.pattern,this.globParts);let E=this.globParts.map((R,G,le)=>{if(this.isWindows&&this.windowsNoMagicRoot){let Re=R[0]===""&&R[1]===""&&(R[2]==="?"||!HUe.test(R[2]))&&!HUe.test(R[3]),nt=/^[a-z]:/i.test(R[0]);if(Re)return[...R.slice(0,4),...R.slice(4).map(at=>this.parse(at))];if(nt)return[R[0],...R.slice(1).map(at=>this.parse(at))]}return R.map(Re=>this.parse(Re))});if(this.debug(this.pattern,E),this.set=E.filter(R=>R.indexOf(!1)===-1),this.isWindows)for(let R=0;R<this.set.length;R++){let G=this.set[R];G[0]===""&&G[1]===""&&this.globParts[R][2]==="?"&&typeof G[3]=="string"&&/^[a-z]:$/i.test(G[3])&&(G[2]="?")}this.debug(this.pattern,this.set)}preprocess(o){if(this.options.noglobstar)for(let g=0;g<o.length;g++)for(let E=0;E<o[g].length;E++)o[g][E]==="**"&&(o[g][E]="*");let{optimizationLevel:d=1}=this.options;return d>=2?(o=this.firstPhasePreProcess(o),o=this.secondPhasePreProcess(o)):d>=1?o=this.levelOneOptimize(o):o=this.adjascentGlobstarOptimize(o),o}adjascentGlobstarOptimize(o){return o.map(d=>{let g=-1;for(;(g=d.indexOf("**",g+1))!==-1;){let E=g;for(;d[E+1]==="**";)E++;E!==g&&d.splice(g,E-g)}return d})}levelOneOptimize(o){return o.map(d=>(d=d.reduce((g,E)=>{let R=g[g.length-1];return E==="**"&&R==="**"?g:E===".."&&R&&R!==".."&&R!=="."&&R!=="**"?(g.pop(),g):(g.push(E),g)},[]),d.length===0?[""]:d))}levelTwoFileOptimize(o){Array.isArray(o)||(o=this.slashSplit(o));let d=!1;do{if(d=!1,!this.preserveMultipleSlashes){for(let E=1;E<o.length-1;E++){let R=o[E];E===1&&R===""&&o[0]===""||(R==="."||R==="")&&(d=!0,o.splice(E,1),E--)}o[0]==="."&&o.length===2&&(o[1]==="."||o[1]==="")&&(d=!0,o.pop())}let g=0;for(;(g=o.indexOf("..",g+1))!==-1;){let E=o[g-1];E&&E!=="."&&E!==".."&&E!=="**"&&(d=!0,o.splice(g-1,2),g-=2)}}while(d);return o.length===0?[""]:o}firstPhasePreProcess(o){let d=!1;do{d=!1;for(let g of o){let E=-1;for(;(E=g.indexOf("**",E+1))!==-1;){let G=E;for(;g[G+1]==="**";)G++;G>E&&g.splice(E+1,G-E);let le=g[E+1],Re=g[E+2],nt=g[E+3];if(le!==".."||!Re||Re==="."||Re===".."||!nt||nt==="."||nt==="..")continue;d=!0,g.splice(E,1);let at=g.slice(0);at[E]="**",o.push(at),E--}if(!this.preserveMultipleSlashes){for(let G=1;G<g.length-1;G++){let le=g[G];G===1&&le===""&&g[0]===""||(le==="."||le==="")&&(d=!0,g.splice(G,1),G--)}g[0]==="."&&g.length===2&&(g[1]==="."||g[1]==="")&&(d=!0,g.pop())}let R=0;for(;(R=g.indexOf("..",R+1))!==-1;){let G=g[R-1];if(G&&G!=="."&&G!==".."&&G!=="**"){d=!0;let Re=R===1&&g[R+1]==="**"?["."]:[];g.splice(R-1,2,...Re),g.length===0&&g.push(""),R-=2}}}}while(d);return o}secondPhasePreProcess(o){for(let d=0;d<o.length-1;d++)for(let g=d+1;g<o.length;g++){let E=this.partsMatch(o[d],o[g],!this.preserveMultipleSlashes);if(E){o[d]=[],o[g]=E;break}}return o.filter(d=>d.length)}partsMatch(o,d,g=!1){let E=0,R=0,G=[],le="";for(;E<o.length&&R<d.length;)if(o[E]===d[R])G.push(le==="b"?d[R]:o[E]),E++,R++;else if(g&&o[E]==="**"&&d[R]===o[E+1])G.push(o[E]),E++;else if(g&&d[R]==="**"&&o[E]===d[R+1])G.push(d[R]),R++;else if(o[E]==="*"&&d[R]&&(this.options.dot||!d[R].startsWith("."))&&d[R]!=="**"){if(le==="b")return!1;le="a",G.push(o[E]),E++,R++}else if(d[R]==="*"&&o[E]&&(this.options.dot||!o[E].startsWith("."))&&o[E]!=="**"){if(le==="a")return!1;le="b",G.push(d[R]),E++,R++}else return!1;return o.length===d.length&&G}parseNegate(){if(this.nonegate)return;let o=this.pattern,d=!1,g=0;for(let E=0;E<o.length&&o.charAt(E)==="!";E++)d=!d,g++;g&&(this.pattern=o.slice(g)),this.negate=d}matchOne(o,d,g=!1){let E=0,R=0;if(this.isWindows){let le=typeof o[0]=="string"&&/^[a-z]:$/i.test(o[0]),Re=!le&&o[0]===""&&o[1]===""&&o[2]==="?"&&/^[a-z]:$/i.test(o[3]),nt=typeof d[0]=="string"&&/^[a-z]:$/i.test(d[0]),at=!nt&&d[0]===""&&d[1]===""&&d[2]==="?"&&typeof d[3]=="string"&&/^[a-z]:$/i.test(d[3]),dt=Re?3:le?0:void 0,xe=at?3:nt?0:void 0;if(typeof dt=="number"&&typeof xe=="number"){let[gn,pt]=[o[dt],d[xe]];gn.toLowerCase()===pt.toLowerCase()&&(d[xe]=gn,R=xe,E=dt)}}let{optimizationLevel:G=1}=this.options;return G>=2&&(o=this.levelTwoFileOptimize(o)),d.includes(ms.GLOBSTAR)?this.#e(o,d,g,E,R):this.#n(o,d,g,E,R)}#e(o,d,g,E,R){let G=d.indexOf(ms.GLOBSTAR,R),le=d.lastIndexOf(ms.GLOBSTAR),[Re,nt,at]=g?[d.slice(R,G),d.slice(G+1),[]]:[d.slice(R,G),d.slice(G+1,le),d.slice(le+1)];if(Re.length){let eo=o.slice(E,E+Re.length);if(!this.#n(eo,Re,g,0,0))return!1;E+=Re.length,R+=Re.length}let dt=0;if(at.length){if(at.length+E>o.length)return!1;let eo=o.length-at.length;if(this.#n(o,at,g,eo,0))dt=at.length;else{if(o[o.length-1]!==""||E+at.length===o.length||(eo--,!this.#n(o,at,g,eo,0)))return!1;dt=at.length+1}}if(!nt.length){let eo=!!dt;for(let qa=E;qa<o.length-dt;qa++){let bl=String(o[qa]);if(eo=!0,bl==="."||bl===".."||!this.options.dot&&bl.startsWith("."))return!1}return g||eo}let xe=[[[],0]],gn=xe[0],pt=0,ut=[0];for(let eo of nt)eo===ms.GLOBSTAR?(ut.push(pt),gn=[[],0],xe.push(gn)):(gn[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,E,0,g,0,!!dt)}#t(o,d,g,E,R,G,le){let Re=d[E];if(!Re){for(let dt=g;dt<o.length;dt++){le=!0;let xe=o[dt];if(xe==="."||xe===".."||!this.options.dot&&xe.startsWith("."))return!1}return le}let[nt,at]=Re;for(;g<=at;){if(this.#n(o.slice(0,g+nt.length),nt,R,g,0)&&G<this.maxGlobstarRecursion){let gn=this.#t(o,d,g+nt.length,E+1,R,G+1,le);if(gn!==!1)return gn}let xe=o[g];if(xe==="."||xe===".."||!this.options.dot&&xe.startsWith("."))return!1;g++}return R||null}#n(o,d,g,E,R){let G,le,Re,nt;for(G=E,le=R,nt=o.length,Re=d.length;G<nt&&le<Re;G++,le++){this.debug("matchOne loop");let at=d[le],dt=o[G];if(this.debug(d,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(G===nt&&le===Re)return!0;if(G===nt)return g;if(le===Re)return G===nt-1&&o[G]==="";throw new Error("wtf?")}braceExpand(){return(0,ms.braceExpand)(this.pattern,this.options)}parse(o){(0,$Z.assertValidPattern)(o);let d=this.options;if(o==="**")return ms.GLOBSTAR;if(o==="")return"";let g,E=null;(g=o.match(ANt))?E=d.dot?INt:DNt:(g=o.match(_Nt))?E=(d.nocase?d.dot?vNt:yNt:d.dot?gNt:hNt)(g[1]):(g=o.match(CNt))?E=(d.nocase?d.dot?NNt:PNt:d.dot?RNt:MNt)(g):(g=o.match(bNt))?E=d.dot?TNt:SNt:(g=o.match(ENt))&&(E=xNt);let R=KUe.AST.fromGlob(o,this.options).toMMPattern();return E&&typeof R=="object"&&Reflect.defineProperty(R,"test",{value:E}),R}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let o=this.set;if(!o.length)return this.regexp=!1,this.regexp;let d=this.options,g=d.noglobstar?kNt:d.dot?wNt:ONt,E=new Set(d.nocase?["i"]:[]),R=o.map(Re=>{let nt=Re.map(dt=>{if(dt instanceof RegExp)for(let xe of dt.flags.split(""))E.add(xe);return typeof dt=="string"?VNt(dt):dt===ms.GLOBSTAR?ms.GLOBSTAR:dt._src});nt.forEach((dt,xe)=>{let gn=nt[xe+1],pt=nt[xe-1];dt!==ms.GLOBSTAR||pt===ms.GLOBSTAR||(pt===void 0?gn!==void 0&&gn!==ms.GLOBSTAR?nt[xe+1]="(?:\\/|"+g+"\\/)?"+gn:nt[xe]=g:gn===void 0?nt[xe-1]=pt+"(?:\\/|\\/"+g+")?":gn!==ms.GLOBSTAR&&(nt[xe-1]=pt+"(?:\\/|\\/"+g+"\\/)"+gn,nt[xe+1]=ms.GLOBSTAR))});let at=nt.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("|"),[G,le]=o.length>1?["(?:",")"]:["",""];R="^"+G+R+le+"$",this.partial&&(R="^(?:\\/|"+G+R.slice(1,-1)+le+")$"),this.negate&&(R="^(?!"+R+").+$");try{this.regexp=new RegExp(R,[...E].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,d=this.partial){if(this.debug("match",o,this.pattern),this.comment)return!1;if(this.empty)return o==="";if(o==="/"&&d)return!0;let g=this.options;this.isWindows&&(o=o.split("\\").join("/"));let E=this.slashSplit(o);this.debug(this.pattern,"split",E);let R=this.set;this.debug(this.pattern,"set",R);let G=E[E.length-1];if(!G)for(let le=E.length-2;!G&&le>=0;le--)G=E[le];for(let le=0;le<R.length;le++){let Re=R[le],nt=E;if(g.matchBase&&Re.length===1&&(nt=[G]),this.matchOne(nt,Re,d))return g.flipNegate?!0:!this.negate}return g.flipNegate?!1:this.negate}static defaults(o){return ms.minimatch.defaults(o).Minimatch}};ms.Minimatch=aw;var jNt=Jxe();Object.defineProperty(ms,"AST",{enumerable:!0,get:function(){return jNt.AST}});var UNt=qxe();Object.defineProperty(ms,"escape",{enumerable:!0,get:function(){return UNt.escape}});var HNt=UZ();Object.defineProperty(ms,"unescape",{enumerable:!0,get:function(){return HNt.unescape}});ms.minimatch.AST=KUe.AST;ms.minimatch.Minimatch=aw;ms.minimatch.escape=pNt.escape;ms.minimatch.unescape=fNt.unescape});var ZUe=zm((rFt,QUe)=>{"use strict";function W1(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function YUe(h,o){for(var d="",g=0,E=-1,R=0,G,le=0;le<=h.length;++le){if(le<h.length)G=h.charCodeAt(le);else{if(G===47)break;G=47}if(G===47){if(!(E===le-1||R===1))if(E!==le-1&&R===2){if(d.length<2||g!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var Re=d.lastIndexOf("/");if(Re!==d.length-1){Re===-1?(d="",g=0):(d=d.slice(0,Re),g=d.length-1-d.lastIndexOf("/")),E=le,R=0;continue}}else if(d.length===2||d.length===1){d="",g=0,E=le,R=0;continue}}o&&(d.length>0?d+="/..":d="..",g=2)}else d.length>0?d+="/"+h.slice(E+1,le):d=h.slice(E+1,le),g=le-E-1;E=le,R=0}else G===46&&R!==-1?++R:R=-1}return d}function KNt(h,o){var d=o.dir||o.root,g=o.base||(o.name||"")+(o.ext||"");return d?d===o.root?d+g:d+h+g:g}var F8={resolve:function(){for(var o="",d=!1,g,E=arguments.length-1;E>=-1&&!d;E--){var R;E>=0?R=arguments[E]:(g===void 0&&(g=process.cwd()),R=g),W1(R),R.length!==0&&(o=R+"/"+o,d=R.charCodeAt(0)===47)}return o=YUe(o,!d),d?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(o){if(W1(o),o.length===0)return".";var d=o.charCodeAt(0)===47,g=o.charCodeAt(o.length-1)===47;return o=YUe(o,!d),o.length===0&&!d&&(o="."),o.length>0&&g&&(o+="/"),d?"/"+o:o},isAbsolute:function(o){return W1(o),o.length>0&&o.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var o,d=0;d<arguments.length;++d){var g=arguments[d];W1(g),g.length>0&&(o===void 0?o=g:o+="/"+g)}return o===void 0?".":F8.normalize(o)},relative:function(o,d){if(W1(o),W1(d),o===d||(o=F8.resolve(o),d=F8.resolve(d),o===d))return"";for(var g=1;g<o.length&&o.charCodeAt(g)===47;++g);for(var E=o.length,R=E-g,G=1;G<d.length&&d.charCodeAt(G)===47;++G);for(var le=d.length,Re=le-G,nt=R<Re?R:Re,at=-1,dt=0;dt<=nt;++dt){if(dt===nt){if(Re>nt){if(d.charCodeAt(G+dt)===47)return d.slice(G+dt+1);if(dt===0)return d.slice(G+dt)}else R>nt&&(o.charCodeAt(g+dt)===47?at=dt:dt===0&&(at=0));break}var xe=o.charCodeAt(g+dt),gn=d.charCodeAt(G+dt);if(xe!==gn)break;xe===47&&(at=dt)}var pt="";for(dt=g+at+1;dt<=E;++dt)(dt===E||o.charCodeAt(dt)===47)&&(pt.length===0?pt+="..":pt+="/..");return pt.length>0?pt+d.slice(G+at):(G+=at,d.charCodeAt(G)===47&&++G,d.slice(G))},_makeLong:function(o){return o},dirname:function(o){if(W1(o),o.length===0)return".";for(var d=o.charCodeAt(0),g=d===47,E=-1,R=!0,G=o.length-1;G>=1;--G)if(d=o.charCodeAt(G),d===47){if(!R){E=G;break}}else R=!1;return E===-1?g?"/":".":g&&E===1?"//":o.slice(0,E)},basename:function(o,d){if(d!==void 0&&typeof d!="string")throw new TypeError('"ext" argument must be a string');W1(o);var g=0,E=-1,R=!0,G;if(d!==void 0&&d.length>0&&d.length<=o.length){if(d.length===o.length&&d===o)return"";var le=d.length-1,Re=-1;for(G=o.length-1;G>=0;--G){var nt=o.charCodeAt(G);if(nt===47){if(!R){g=G+1;break}}else Re===-1&&(R=!1,Re=G+1),le>=0&&(nt===d.charCodeAt(le)?--le===-1&&(E=G):(le=-1,E=Re))}return g===E?E=Re:E===-1&&(E=o.length),o.slice(g,E)}else{for(G=o.length-1;G>=0;--G)if(o.charCodeAt(G)===47){if(!R){g=G+1;break}}else E===-1&&(R=!1,E=G+1);return E===-1?"":o.slice(g,E)}},extname:function(o){W1(o);for(var d=-1,g=0,E=-1,R=!0,G=0,le=o.length-1;le>=0;--le){var Re=o.charCodeAt(le);if(Re===47){if(!R){g=le+1;break}continue}E===-1&&(R=!1,E=le+1),Re===46?d===-1?d=le:G!==1&&(G=1):d!==-1&&(G=-1)}return d===-1||E===-1||G===0||G===1&&d===E-1&&d===g+1?"":o.slice(d,E)},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 KNt("/",o)},parse:function(o){W1(o);var d={root:"",dir:"",base:"",ext:"",name:""};if(o.length===0)return d;var g=o.charCodeAt(0),E=g===47,R;E?(d.root="/",R=1):R=0;for(var G=-1,le=0,Re=-1,nt=!0,at=o.length-1,dt=0;at>=R;--at){if(g=o.charCodeAt(at),g===47){if(!nt){le=at+1;break}continue}Re===-1&&(nt=!1,Re=at+1),g===46?G===-1?G=at:dt!==1&&(dt=1):G!==-1&&(dt=-1)}return G===-1||Re===-1||dt===0||dt===1&&G===Re-1&&G===le+1?Re!==-1&&(le===0&&E?d.base=d.name=o.slice(1,Re):d.base=d.name=o.slice(le,Re)):(le===0&&E?(d.name=o.slice(1,G),d.base=o.slice(1,Re)):(d.name=o.slice(le,G),d.base=o.slice(le,Re)),d.ext=o.slice(G,Re)),le>0?d.dir=o.slice(0,le-1):E&&(d.dir="/"),d},sep:"/",delimiter:":",win32:null,posix:null};F8.posix=F8;QUe.exports=F8});var O5=zm((iFt,iHe)=>{"use strict";var eHe="[^\\\\/]",JNt="(?=.)",tHe="[^/]",Xxe="(?:\\/|$)",nHe="(?:^|\\/)",$xe=`\\.{1,2}${Xxe}`,qNt="(?!\\.)",XNt=`(?!${nHe}${$xe})`,$Nt=`(?!\\.{0,1}${Xxe})`,YNt=`(?!${$xe})`,QNt="[^.\\/]",ZNt=`${tHe}*?`,eRt="/",rHe={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:JNt,QMARK:tHe,END_ANCHOR:Xxe,DOTS_SLASH:$xe,NO_DOT:qNt,NO_DOTS:XNt,NO_DOT_SLASH:$Nt,NO_DOTS_SLASH:YNt,QMARK_NO_DOT:QNt,STAR:ZNt,START_ANCHOR:nHe,SEP:eRt},tRt={...rHe,SLASH_LITERAL:"[\\\\/]",QMARK:eHe,STAR:`${eHe}*?`,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:"\\"},nRt={__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"};iHe.exports={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:nRt,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?tRt:rHe}}});var F5=zm(Ob=>{"use strict";var{REGEX_BACKSLASH:rRt,REGEX_REMOVE_BACKSLASH:iRt,REGEX_SPECIAL_CHARS:oRt,REGEX_SPECIAL_CHARS_GLOBAL:aRt}=O5();Ob.isObject=h=>h!==null&&typeof h=="object"&&!Array.isArray(h);Ob.hasRegexChars=h=>oRt.test(h);Ob.isRegexChar=h=>h.length===1&&Ob.hasRegexChars(h);Ob.escapeRegex=h=>h.replace(aRt,"\\$1");Ob.toPosixSlashes=h=>h.replace(rRt,"/");Ob.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};Ob.removeBackslashes=h=>h.replace(iRt,o=>o==="\\"?"":o);Ob.escapeLast=(h,o,d)=>{let g=h.lastIndexOf(o,d);return g===-1?h:h[g-1]==="\\"?Ob.escapeLast(h,o,g-1):`${h.slice(0,g)}\\${h.slice(g)}`};Ob.removePrefix=(h,o={})=>{let d=h;return d.startsWith("./")&&(d=d.slice(2),o.prefix="./"),d};Ob.wrapOutput=(h,o={},d={})=>{let g=d.contains?"":"^",E=d.contains?"":"$",R=`${g}(?:${h})${E}`;return o.negated===!0&&(R=`(?:^(?!${R}).*$)`),R};Ob.basename=(h,{windows:o}={})=>{let d=h.split(o?/[\\/]/:"/"),g=d[d.length-1];return g===""?d[d.length-2]:g}});var pHe=zm((aFt,uHe)=>{"use strict";var oHe=F5(),{CHAR_ASTERISK:Yxe,CHAR_AT:sRt,CHAR_BACKWARD_SLASH:W5,CHAR_COMMA:lRt,CHAR_DOT:Qxe,CHAR_EXCLAMATION_MARK:Zxe,CHAR_FORWARD_SLASH:dHe,CHAR_LEFT_CURLY_BRACE:eAe,CHAR_LEFT_PARENTHESES:tAe,CHAR_LEFT_SQUARE_BRACKET:cRt,CHAR_PLUS:dRt,CHAR_QUESTION_MARK:aHe,CHAR_RIGHT_CURLY_BRACE:uRt,CHAR_RIGHT_PARENTHESES:sHe,CHAR_RIGHT_SQUARE_BRACKET:pRt}=O5(),lHe=h=>h===dHe||h===W5,cHe=h=>{h.isPrefix!==!0&&(h.depth=h.isGlobstar?1/0:1)},fRt=(h,o)=>{let d=o||{},g=h.length-1,E=d.parts===!0||d.scanToEnd===!0,R=[],G=[],le=[],Re=h,nt=-1,at=0,dt=0,xe=!1,gn=!1,pt=!1,ut=!1,yi=!1,wi=!1,eo=!1,qa=!1,bl=!1,Sa=!1,Lr=0,In,Ii,_i={value:"",depth:0,isGlob:!1},Fr=()=>nt>=g,bi=()=>Re.charCodeAt(nt+1),fd=()=>(In=Ii,Re.charCodeAt(++nt));for(;nt<g;){Ii=fd();let vn;if(Ii===W5){eo=_i.backslashes=!0,Ii=fd(),Ii===eAe&&(wi=!0);continue}if(wi===!0||Ii===eAe){for(Lr++;Fr()!==!0&&(Ii=fd());){if(Ii===W5){eo=_i.backslashes=!0,fd();continue}if(Ii===eAe){Lr++;continue}if(wi!==!0&&Ii===Qxe&&(Ii=fd())===Qxe){if(xe=_i.isBrace=!0,pt=_i.isGlob=!0,Sa=!0,E===!0)continue;break}if(wi!==!0&&Ii===lRt){if(xe=_i.isBrace=!0,pt=_i.isGlob=!0,Sa=!0,E===!0)continue;break}if(Ii===uRt&&(Lr--,Lr===0)){wi=!1,xe=_i.isBrace=!0,Sa=!0;break}}if(E===!0)continue;break}if(Ii===dHe){if(R.push(nt),G.push(_i),_i={value:"",depth:0,isGlob:!1},Sa===!0)continue;if(In===Qxe&&nt===at+1){at+=2;continue}dt=nt+1;continue}if(d.noext!==!0&&(Ii===dRt||Ii===sRt||Ii===Yxe||Ii===aHe||Ii===Zxe)===!0&&bi()===tAe){if(pt=_i.isGlob=!0,ut=_i.isExtglob=!0,Sa=!0,Ii===Zxe&&nt===at&&(bl=!0),E===!0){for(;Fr()!==!0&&(Ii=fd());){if(Ii===W5){eo=_i.backslashes=!0,Ii=fd();continue}if(Ii===sHe){pt=_i.isGlob=!0,Sa=!0;break}}continue}break}if(Ii===Yxe){if(In===Yxe&&(yi=_i.isGlobstar=!0),pt=_i.isGlob=!0,Sa=!0,E===!0)continue;break}if(Ii===aHe){if(pt=_i.isGlob=!0,Sa=!0,E===!0)continue;break}if(Ii===cRt){for(;Fr()!==!0&&(vn=fd());){if(vn===W5){eo=_i.backslashes=!0,fd();continue}if(vn===pRt){gn=_i.isBracket=!0,pt=_i.isGlob=!0,Sa=!0;break}}if(E===!0)continue;break}if(d.nonegate!==!0&&Ii===Zxe&&nt===at){qa=_i.negated=!0,at++;continue}if(d.noparen!==!0&&Ii===tAe){if(pt=_i.isGlob=!0,E===!0){for(;Fr()!==!0&&(Ii=fd());){if(Ii===tAe){eo=_i.backslashes=!0,Ii=fd();continue}if(Ii===sHe){Sa=!0;break}}continue}break}if(pt===!0){if(Sa=!0,E===!0)continue;break}}d.noext===!0&&(ut=!1,pt=!1);let Rc=Re,fn="",Ai="";at>0&&(fn=Re.slice(0,at),Re=Re.slice(at),dt-=at),Rc&&pt===!0&&dt>0?(Rc=Re.slice(0,dt),Ai=Re.slice(dt)):pt===!0?(Rc="",Ai=Re):Rc=Re,Rc&&Rc!==""&&Rc!=="/"&&Rc!==Re&&lHe(Rc.charCodeAt(Rc.length-1))&&(Rc=Rc.slice(0,-1)),d.unescape===!0&&(Ai&&(Ai=oHe.removeBackslashes(Ai)),Rc&&eo===!0&&(Rc=oHe.removeBackslashes(Rc)));let qc={prefix:fn,input:h,start:at,base:Rc,glob:Ai,isBrace:xe,isBracket:gn,isGlob:pt,isExtglob:ut,isGlobstar:yi,negated:qa,negatedExtglob:bl};if(d.tokens===!0&&(qc.maxDepth=0,lHe(Ii)||G.push(_i),qc.tokens=G),d.parts===!0||d.tokens===!0){let vn;for(let vd=0;vd<R.length;vd++){let Qs=vn?vn+1:at,Xc=R[vd],aa=h.slice(Qs,Xc);d.tokens&&(vd===0&&at!==0?(G[vd].isPrefix=!0,G[vd].value=fn):G[vd].value=aa,cHe(G[vd]),qc.maxDepth+=G[vd].depth),(vd!==0||aa!=="")&&le.push(aa),vn=Xc}if(vn&&vn+1<h.length){let vd=h.slice(vn+1);le.push(vd),d.tokens&&(G[G.length-1].value=vd,cHe(G[G.length-1]),qc.maxDepth+=G[G.length-1].depth)}qc.slashes=R,qc.parts=le}return qc};uHe.exports=fRt});var gHe=zm((sFt,hHe)=>{"use strict";var B5=O5(),fT=F5(),{MAX_LENGTH:YZ,POSIX_REGEX_SOURCE:mRt,REGEX_NON_SPECIAL_CHARS:_Rt,REGEX_SPECIAL_CHARS_BACKREF:hRt,REPLACEMENTS:fHe}=B5,gRt=(h,o)=>{if(typeof o.expandRange=="function")return o.expandRange(...h,o);h.sort();let d=`[${h.join("-")}]`;try{new RegExp(d)}catch{return h.map(E=>fT.escapeRegex(E)).join("..")}return d},W8=(h,o)=>`Missing ${h}: "${o}" - use "\\\\${o}" to match literal characters`,mHe=h=>{let o=[],d=0,g=0,E=0,R="",G=!1;for(let le of h){if(G===!0){R+=le,G=!1;continue}if(le==="\\"){R+=le,G=!0;continue}if(le==='"'){E=E===1?0:1,R+=le;continue}if(E===0){if(le==="[")d++;else if(le==="]"&&d>0)d--;else if(d===0){if(le==="(")g++;else if(le===")"&&g>0)g--;else if(le==="|"&&g===0){o.push(R),R="";continue}}}R+=le}return o.push(R),o},yRt=h=>{let o=!1;for(let d of h){if(o===!0){o=!1;continue}if(d==="\\"){o=!0;continue}if(/[?*+@!()[\]{}]/.test(d))return!1}return!0},_He=h=>{let o=h.trim(),d=!0;for(;d===!0;)d=!1,/^@\([^\\()[\]{}|]+\)$/.test(o)&&(o=o.slice(2,-1),d=!0);if(yRt(o))return o.replace(/\\(.)/g,"$1")},vRt=h=>{let o=h.map(_He).filter(Boolean);for(let d=0;d<o.length;d++)for(let g=d+1;g<o.length;g++){let E=o[d],R=o[g],G=E[0];if(!(!G||E!==G.repeat(E.length)||R!==G.repeat(R.length))&&(E===R||E.startsWith(R)||R.startsWith(E)))return!0}return!1},nAe=(h,o=!0)=>{if(h[0]!=="+"&&h[0]!=="*"||h[1]!=="(")return;let d=0,g=0,E=0,R=!1;for(let G=1;G<h.length;G++){let le=h[G];if(R===!0){R=!1;continue}if(le==="\\"){R=!0;continue}if(le==='"'){E=E===1?0:1;continue}if(E!==1){if(le==="["){d++;continue}if(le==="]"&&d>0){d--;continue}if(!(d>0)){if(le==="("){g++;continue}if(le===")"&&(g--,g===0))return o===!0&&G!==h.length-1?void 0:{type:h[0],body:h.slice(2,G),end:G}}}}},bRt=h=>{let o=0,d=[];for(;o<h.length;){let E=nAe(h.slice(o),!1);if(!E||E.type!=="*")return;let R=mHe(E.body).map(le=>le.trim());if(R.length!==1)return;let G=_He(R[0]);if(!G||G.length!==1)return;d.push(G),o+=E.end+1}return d.length<1?void 0:`${d.length===1?fT.escapeRegex(d[0]):`[${d.map(E=>fT.escapeRegex(E)).join("")}]`}*`},SRt=h=>{let o=0,d=h.trim(),g=nAe(d);for(;g;)o++,d=g.body.trim(),g=nAe(d);return o},TRt=(h,o)=>{if(o.maxExtglobRecursion===!1)return{risky:!1};let d=typeof o.maxExtglobRecursion=="number"?o.maxExtglobRecursion:B5.DEFAULT_MAX_EXTGLOB_RECURSION,g=mHe(h).map(E=>E.trim());if(g.length>1&&(g.some(E=>E==="")||g.some(E=>/^[*?]+$/.test(E))||vRt(g)))return{risky:!0};for(let E of g){let R=bRt(E);if(R)return{risky:!0,safeOutput:R};if(SRt(E)>d)return{risky:!0}}return{risky:!1}},rAe=(h,o)=>{if(typeof h!="string")throw new TypeError("Expected a string");h=fHe[h]||h;let d={...o},g=typeof d.maxLength=="number"?Math.min(YZ,d.maxLength):YZ,E=h.length;if(E>g)throw new SyntaxError(`Input length: ${E}, exceeds maximum allowed length: ${g}`);let R={type:"bos",value:"",output:d.prepend||""},G=[R],le=d.capture?"":"?:",Re=B5.globChars(d.windows),nt=B5.extglobChars(Re),{DOT_LITERAL:at,PLUS_LITERAL:dt,SLASH_LITERAL:xe,ONE_CHAR:gn,DOTS_SLASH:pt,NO_DOT:ut,NO_DOT_SLASH:yi,NO_DOTS_SLASH:wi,QMARK:eo,QMARK_NO_DOT:qa,STAR:bl,START_ANCHOR:Sa}=Re,Lr=Uo=>`(${le}(?:(?!${Sa}${Uo.dot?pt:at}).)*?)`,In=d.dot?"":ut,Ii=d.dot?eo:qa,_i=d.bash===!0?Lr(d):bl;d.capture&&(_i=`(${_i})`),typeof d.noext=="boolean"&&(d.noextglob=d.noext);let Fr={input:h,index:-1,start:0,dot:d.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:G};h=fT.removePrefix(h,Fr),E=h.length;let bi=[],fd=[],Rc=[],fn=R,Ai,qc=()=>Fr.index===E-1,vn=Fr.peek=(Uo=1)=>h[Fr.index+Uo],vd=Fr.advance=()=>h[++Fr.index]||"",Qs=()=>h.slice(Fr.index+1),Xc=(Uo="",lc=0)=>{Fr.consumed+=Uo,Fr.index+=lc},aa=Uo=>{Fr.output+=Uo.output!=null?Uo.output:Uo.value,Xc(Uo.value)},yT=()=>{let Uo=1;for(;vn()==="!"&&(vn(2)!=="("||vn(3)==="?");)vd(),Fr.start++,Uo++;return Uo%2===0?!1:(Fr.negated=!0,Fr.start++,!0)},vT=Uo=>{Fr[Uo]++,Rc.push(Uo)},ky=Uo=>{Fr[Uo]--,Rc.pop()},wl=Uo=>{if(fn.type==="globstar"){let lc=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"&&!lc&&!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,G.push(Uo),fn=Uo},Gi=(Uo,lc)=>{let Ko={...nt[lc],conditions:1,inner:""};Ko.prev=fn,Ko.parens=Fr.parens,Ko.output=Fr.output,Ko.startIndex=Fr.index,Ko.tokensIndex=G.length;let Ol=(d.capture?"(":"")+Ko.open;vT("parens"),wl({type:Uo,value:lc,output:Fr.output?"":gn}),wl({type:"paren",extglob:!0,value:vd(),output:Ol}),bi.push(Ko)},Sh=Uo=>{let lc=h.slice(Uo.startIndex,Fr.index+1),Ko=h.slice(Uo.startIndex+2,Fr.index),Ol=TRt(Ko,d);if((Uo.type==="plus"||Uo.type==="star")&&Ol.risky){let bd=Ol.safeOutput?(Uo.output?"":gn)+(d.capture?`(${Ol.safeOutput})`:Ol.safeOutput):void 0,Wi=G[Uo.tokensIndex];Wi.type="text",Wi.value=lc,Wi.output=bd||fT.escapeRegex(lc);for(let zb=Uo.tokensIndex+1;zb<G.length;zb++)G[zb].value="",G[zb].output="",delete G[zb].suffix;Fr.output=Uo.output+Wi.output,Fr.backtrack=!0,wl({type:"paren",extglob:!0,value:Ai,output:""}),ky("parens");return}let Hd=Uo.close+(d.capture?")":""),gt;if(Uo.type==="negate"){let bd=_i;if(Uo.inner&&Uo.inner.length>1&&Uo.inner.includes("/")&&(bd=Lr(d)),(bd!==_i||qc()||/^\)+$/.test(Qs()))&&(Hd=Uo.close=`)$))${bd}`),Uo.inner.includes("*")&&(gt=Qs())&&/^\.[^\\/.]+$/.test(gt)){let Wi=rAe(gt,{...o,fastpaths:!1}).output;Hd=Uo.close=`)${Wi})${bd})`}Uo.prev.type==="bos"&&(Fr.negatedExtglob=!0)}wl({type:"paren",extglob:!0,value:Ai,output:Hd}),ky("parens")};if(d.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(h)){let Uo=!1,lc=h.replace(hRt,(Ko,Ol,Hd,gt,bd,Wi)=>gt==="\\"?(Uo=!0,Ko):gt==="?"?Ol?Ol+gt+(bd?eo.repeat(bd.length):""):Wi===0?Ii+(bd?eo.repeat(bd.length):""):eo.repeat(Hd.length):gt==="."?at.repeat(Hd.length):gt==="*"?Ol?Ol+gt+(bd?_i:""):_i:Ol?Ko:`\\${Ko}`);return Uo===!0&&(d.unescape===!0?lc=lc.replace(/\\/g,""):lc=lc.replace(/\\+/g,Ko=>Ko.length%2===0?"\\\\":Ko?"\\":"")),lc===h&&d.contains===!0?(Fr.output=h,Fr):(Fr.output=fT.wrapOutput(lc,Fr,o),Fr)}for(;!qc();){if(Ai=vd(),Ai==="\0")continue;if(Ai==="\\"){let Ko=vn();if(Ko==="/"&&d.bash!==!0||Ko==="."||Ko===";")continue;if(!Ko){Ai+="\\",wl({type:"text",value:Ai});continue}let Ol=/^\\+/.exec(Qs()),Hd=0;if(Ol&&Ol[0].length>2&&(Hd=Ol[0].length,Fr.index+=Hd,Hd%2!==0&&(Ai+="\\")),d.unescape===!0?Ai=vd():Ai+=vd(),Fr.brackets===0){wl({type:"text",value:Ai});continue}}if(Fr.brackets>0&&(Ai!=="]"||fn.value==="["||fn.value==="[^")){if(d.posix!==!1&&Ai===":"){let Ko=fn.value.slice(1);if(Ko.includes("[")&&(fn.posix=!0,Ko.includes(":"))){let Ol=fn.value.lastIndexOf("["),Hd=fn.value.slice(0,Ol),gt=fn.value.slice(Ol+2),bd=mRt[gt];if(bd){fn.value=Hd+bd,Fr.backtrack=!0,vd(),!R.output&&G.indexOf(fn)===1&&(R.output=gn);continue}}}(Ai==="["&&vn()!==":"||Ai==="-"&&vn()==="]")&&(Ai=`\\${Ai}`),Ai==="]"&&(fn.value==="["||fn.value==="[^")&&(Ai=`\\${Ai}`),d.posix===!0&&Ai==="!"&&fn.value==="["&&(Ai="^"),fn.value+=Ai,aa({value:Ai});continue}if(Fr.quotes===1&&Ai!=='"'){Ai=fT.escapeRegex(Ai),fn.value+=Ai,aa({value:Ai});continue}if(Ai==='"'){Fr.quotes=Fr.quotes===1?0:1,d.keepQuotes===!0&&wl({type:"text",value:Ai});continue}if(Ai==="("){vT("parens"),wl({type:"paren",value:Ai});continue}if(Ai===")"){if(Fr.parens===0&&d.strictBrackets===!0)throw new SyntaxError(W8("opening","("));let Ko=bi[bi.length-1];if(Ko&&Fr.parens===Ko.parens+1){Sh(bi.pop());continue}wl({type:"paren",value:Ai,output:Fr.parens?")":"\\)"}),ky("parens");continue}if(Ai==="["){if(d.nobracket===!0||!Qs().includes("]")){if(d.nobracket!==!0&&d.strictBrackets===!0)throw new SyntaxError(W8("closing","]"));Ai=`\\${Ai}`}else vT("brackets");wl({type:"bracket",value:Ai});continue}if(Ai==="]"){if(d.nobracket===!0||fn&&fn.type==="bracket"&&fn.value.length===1){wl({type:"text",value:Ai,output:`\\${Ai}`});continue}if(Fr.brackets===0){if(d.strictBrackets===!0)throw new SyntaxError(W8("opening","["));wl({type:"text",value:Ai,output:`\\${Ai}`});continue}ky("brackets");let Ko=fn.value.slice(1);if(fn.posix!==!0&&Ko[0]==="^"&&!Ko.includes("/")&&(Ai=`/${Ai}`),fn.value+=Ai,aa({value:Ai}),d.literalBrackets===!1||fT.hasRegexChars(Ko))continue;let Ol=fT.escapeRegex(fn.value);if(Fr.output=Fr.output.slice(0,-fn.value.length),d.literalBrackets===!0){Fr.output+=Ol,fn.value=Ol;continue}fn.value=`(${le}${Ol}|${fn.value})`,Fr.output+=fn.value;continue}if(Ai==="{"&&d.nobrace!==!0){vT("braces");let Ko={type:"brace",value:Ai,output:"(",outputIndex:Fr.output.length,tokensIndex:Fr.tokens.length};fd.push(Ko),wl(Ko);continue}if(Ai==="}"){let Ko=fd[fd.length-1];if(d.nobrace===!0||!Ko){wl({type:"text",value:Ai,output:Ai});continue}let Ol=")";if(Ko.dots===!0){let Hd=G.slice(),gt=[];for(let bd=Hd.length-1;bd>=0&&(G.pop(),Hd[bd].type!=="brace");bd--)Hd[bd].type!=="dots"&>.unshift(Hd[bd].value);Ol=gRt(gt,d),Fr.backtrack=!0}if(Ko.comma!==!0&&Ko.dots!==!0){let Hd=Fr.output.slice(0,Ko.outputIndex),gt=Fr.tokens.slice(Ko.tokensIndex);Ko.value=Ko.output="\\{",Ai=Ol="\\}",Fr.output=Hd;for(let bd of gt)Fr.output+=bd.output||bd.value}wl({type:"brace",value:Ai,output:Ol}),ky("braces"),fd.pop();continue}if(Ai==="|"){bi.length>0&&bi[bi.length-1].conditions++,wl({type:"text",value:Ai});continue}if(Ai===","){let Ko=Ai,Ol=fd[fd.length-1];Ol&&Rc[Rc.length-1]==="braces"&&(Ol.comma=!0,Ko="|"),wl({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="",G.pop(),fn=R;continue}wl({type:"slash",value:Ai,output:xe});continue}if(Ai==="."){if(Fr.braces>0&&fn.type==="dot"){fn.value==="."&&(fn.output=at);let Ko=fd[fd.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"){wl({type:"text",value:Ai,output:at});continue}wl({type:"dot",value:Ai,output:at});continue}if(Ai==="?"){if(!(fn&&fn.value==="(")&&d.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){Gi("qmark",Ai);continue}if(fn&&fn.type==="paren"){let Ol=vn(),Hd=Ai;(fn.value==="("&&!/[!=<:]/.test(Ol)||Ol==="<"&&!/<([!=]|\w+>)/.test(Qs()))&&(Hd=`\\${Ai}`),wl({type:"text",value:Ai,output:Hd});continue}if(d.dot!==!0&&(fn.type==="slash"||fn.type==="bos")){wl({type:"qmark",value:Ai,output:qa});continue}wl({type:"qmark",value:Ai,output:eo});continue}if(Ai==="!"){if(d.noextglob!==!0&&vn()==="("&&(vn(2)!=="?"||!/[!=<:]/.test(vn(3)))){Gi("negate",Ai);continue}if(d.nonegate!==!0&&Fr.index===0){yT();continue}}if(Ai==="+"){if(d.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){Gi("plus",Ai);continue}if(fn&&fn.value==="("||d.regex===!1){wl({type:"plus",value:Ai,output:dt});continue}if(fn&&(fn.type==="bracket"||fn.type==="paren"||fn.type==="brace")||Fr.parens>0){wl({type:"plus",value:Ai});continue}wl({type:"plus",value:dt});continue}if(Ai==="@"){if(d.noextglob!==!0&&vn()==="("&&vn(2)!=="?"){wl({type:"at",extglob:!0,value:Ai,output:""});continue}wl({type:"text",value:Ai});continue}if(Ai!=="*"){(Ai==="$"||Ai==="^")&&(Ai=`\\${Ai}`);let Ko=_Rt.exec(Qs());Ko&&(Ai+=Ko[0],Fr.index+=Ko[0].length),wl({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,Xc(Ai);continue}let Uo=Qs();if(d.noextglob!==!0&&/^\([^?]/.test(Uo)){Gi("star",Ai);continue}if(fn.type==="star"){if(d.noglobstar===!0){Xc(Ai);continue}let Ko=fn.prev,Ol=Ko.prev,Hd=Ko.type==="slash"||Ko.type==="bos",gt=Ol&&(Ol.type==="star"||Ol.type==="globstar");if(d.bash===!0&&(!Hd||Uo[0]&&Uo[0]!=="/")){wl({type:"star",value:Ai,output:""});continue}let bd=Fr.braces>0&&(Ko.type==="comma"||Ko.type==="brace"),Wi=bi.length&&(Ko.type==="pipe"||Ko.type==="paren");if(!Hd&&Ko.type!=="paren"&&!bd&&!Wi){wl({type:"star",value:Ai,output:""});continue}for(;Uo.slice(0,3)==="/**";){let zb=h[Fr.index+4];if(zb&&zb!=="/")break;Uo=Uo.slice(3),Xc("/**",3)}if(Ko.type==="bos"&&qc()){fn.type="globstar",fn.value+=Ai,fn.output=Lr(d),Fr.output=fn.output,Fr.globstar=!0,Xc(Ai);continue}if(Ko.type==="slash"&&Ko.prev.type!=="bos"&&!gt&&qc()){Fr.output=Fr.output.slice(0,-(Ko.output+fn.output).length),Ko.output=`(?:${Ko.output}`,fn.type="globstar",fn.output=Lr(d)+(d.strictSlashes?")":"|$)"),fn.value+=Ai,Fr.globstar=!0,Fr.output+=Ko.output+fn.output,Xc(Ai);continue}if(Ko.type==="slash"&&Ko.prev.type!=="bos"&&Uo[0]==="/"){let zb=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(d)}${xe}|${xe}${zb})`,fn.value+=Ai,Fr.output+=Ko.output+fn.output,Fr.globstar=!0,Xc(Ai+vd()),wl({type:"slash",value:"/",output:""});continue}if(Ko.type==="bos"&&Uo[0]==="/"){fn.type="globstar",fn.value+=Ai,fn.output=`(?:^|${xe}|${Lr(d)}${xe})`,Fr.output=fn.output,Fr.globstar=!0,Xc(Ai+vd()),wl({type:"slash",value:"/",output:""});continue}Fr.output=Fr.output.slice(0,-fn.output.length),fn.type="globstar",fn.output=Lr(d),fn.value+=Ai,Fr.output+=fn.output,Fr.globstar=!0,Xc(Ai);continue}let lc={type:"star",value:Ai,output:_i};if(d.bash===!0){lc.output=".*?",(fn.type==="bos"||fn.type==="slash")&&(lc.output=In+lc.output),wl(lc);continue}if(fn&&(fn.type==="bracket"||fn.type==="paren")&&d.regex===!0){lc.output=Ai,wl(lc);continue}(Fr.index===Fr.start||fn.type==="slash"||fn.type==="dot")&&(fn.type==="dot"?(Fr.output+=yi,fn.output+=yi):d.dot===!0?(Fr.output+=wi,fn.output+=wi):(Fr.output+=In,fn.output+=In),vn()!=="*"&&(Fr.output+=gn,fn.output+=gn)),wl(lc)}for(;Fr.brackets>0;){if(d.strictBrackets===!0)throw new SyntaxError(W8("closing","]"));Fr.output=fT.escapeLast(Fr.output,"["),ky("brackets")}for(;Fr.parens>0;){if(d.strictBrackets===!0)throw new SyntaxError(W8("closing",")"));Fr.output=fT.escapeLast(Fr.output,"("),ky("parens")}for(;Fr.braces>0;){if(d.strictBrackets===!0)throw new SyntaxError(W8("closing","}"));Fr.output=fT.escapeLast(Fr.output,"{"),ky("braces")}if(d.strictSlashes!==!0&&(fn.type==="star"||fn.type==="bracket")&&wl({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};rAe.fastpaths=(h,o)=>{let d={...o},g=typeof d.maxLength=="number"?Math.min(YZ,d.maxLength):YZ,E=h.length;if(E>g)throw new SyntaxError(`Input length: ${E}, exceeds maximum allowed length: ${g}`);h=fHe[h]||h;let{DOT_LITERAL:R,SLASH_LITERAL:G,ONE_CHAR:le,DOTS_SLASH:Re,NO_DOT:nt,NO_DOTS:at,NO_DOTS_SLASH:dt,STAR:xe,START_ANCHOR:gn}=B5.globChars(d.windows),pt=d.dot?at:nt,ut=d.dot?dt:nt,yi=d.capture?"":"?:",wi={negated:!1,prefix:""},eo=d.bash===!0?".*?":xe;d.capture&&(eo=`(${eo})`);let qa=In=>In.noglobstar===!0?eo:`(${yi}(?:(?!${gn}${In.dot?Re:R}).)*?)`,bl=In=>{switch(In){case"*":return`${pt}${le}${eo}`;case".*":return`${R}${le}${eo}`;case"*.*":return`${pt}${eo}${R}${le}${eo}`;case"*/*":return`${pt}${eo}${G}${le}${ut}${eo}`;case"**":return pt+qa(d);case"**/*":return`(?:${pt}${qa(d)}${G})?${ut}${le}${eo}`;case"**/*.*":return`(?:${pt}${qa(d)}${G})?${ut}${eo}${R}${le}${eo}`;case"**/.*":return`(?:${pt}${qa(d)}${G})?${R}${le}${eo}`;default:{let Ii=/^(.*?)\.(\w+)$/.exec(In);if(!Ii)return;let _i=bl(Ii[1]);return _i?_i+R+Ii[2]:void 0}}},Sa=fT.removePrefix(h,wi),Lr=bl(Sa);return Lr&&d.strictSlashes!==!0&&(Lr+=`${G}?`),Lr};hHe.exports=rAe});var bHe=zm((lFt,vHe)=>{"use strict";var ERt=pHe(),iAe=gHe(),yHe=F5(),xRt=O5(),ARt=h=>h&&typeof h=="object"&&!Array.isArray(h),m_=(h,o,d=!1)=>{if(Array.isArray(h)){let at=h.map(xe=>m_(xe,o,d));return xe=>{for(let gn of at){let pt=gn(xe);if(pt)return pt}return!1}}let g=ARt(h)&&h.tokens&&h.input;if(h===""||typeof h!="string"&&!g)throw new TypeError("Expected pattern to be a non-empty string");let E=o||{},R=E.windows,G=g?m_.compileRe(h,o):m_.makeRe(h,o,!1,!0),le=G.state;delete G.state;let Re=()=>!1;if(E.ignore){let at={...o,ignore:null,onMatch:null,onResult:null};Re=m_(E.ignore,at,d)}let nt=(at,dt=!1)=>{let{isMatch:xe,match:gn,output:pt}=m_.test(at,G,o,{glob:h,posix:R}),ut={glob:h,state:le,regex:G,posix:R,input:at,output:pt,match:gn,isMatch:xe};return typeof E.onResult=="function"&&E.onResult(ut),xe===!1?(ut.isMatch=!1,dt?ut:!1):Re(at)?(typeof E.onIgnore=="function"&&E.onIgnore(ut),ut.isMatch=!1,dt?ut:!1):(typeof E.onMatch=="function"&&E.onMatch(ut),dt?ut:!0)};return d&&(nt.state=le),nt};m_.test=(h,o,d,{glob:g,posix:E}={})=>{if(typeof h!="string")throw new TypeError("Expected input to be a string");if(h==="")return{isMatch:!1,output:""};let R=d||{},G=R.format||(E?yHe.toPosixSlashes:null),le=h===g,Re=le&&G?G(h):h;return le===!1&&(Re=G?G(h):h,le=Re===g),(le===!1||R.capture===!0)&&(R.matchBase===!0||R.basename===!0?le=m_.matchBase(h,o,d,E):le=o.exec(Re)),{isMatch:!!le,match:le,output:Re}};m_.matchBase=(h,o,d)=>(o instanceof RegExp?o:m_.makeRe(o,d)).test(yHe.basename(h));m_.isMatch=(h,o,d)=>m_(o,d)(h);m_.parse=(h,o)=>Array.isArray(h)?h.map(d=>m_.parse(d,o)):iAe(h,{...o,fastpaths:!1});m_.scan=(h,o)=>ERt(h,o);m_.compileRe=(h,o,d=!1,g=!1)=>{if(d===!0)return h.output;let E=o||{},R=E.contains?"":"^",G=E.contains?"":"$",le=`${R}(?:${h.output})${G}`;h&&h.negated===!0&&(le=`^(?!${le}).*$`);let Re=m_.toRegex(le,o);return g===!0&&(Re.state=h),Re};m_.makeRe=(h,o={},d=!1,g=!1)=>{if(!h||typeof h!="string")throw new TypeError("Expected a non-empty string");let E={negated:!1,fastpaths:!0};return o.fastpaths!==!1&&(h[0]==="."||h[0]==="*")&&(E.output=iAe.fastpaths(h,o)),E.output||(E=iAe(h,o)),m_.compileRe(E,o,d,g)};m_.toRegex=(h,o)=>{try{let d=o||{};return new RegExp(h,d.flags||(d.nocase?"i":""))}catch(d){if(o&&o.debug===!0)throw d;return/$^/}};m_.constants=xRt;vHe.exports=m_});var oAe=zm((cFt,EHe)=>{"use strict";var SHe=bHe(),DRt=F5();function THe(h,o,d=!1){return o&&(o.windows===null||o.windows===void 0)&&(o={...o,windows:DRt.isWindows()}),SHe(h,o,d)}Object.assign(THe,SHe);EHe.exports=THe});var wHe=zm(kHe=>{var IRt=Object.create,AHe=Object.defineProperty,CRt=Object.getOwnPropertyDescriptor,PRt=Object.getOwnPropertyNames,NRt=Object.getPrototypeOf,RRt=Object.prototype.hasOwnProperty,MRt=(h,o,d,g)=>{if(o&&typeof o=="object"||typeof o=="function")for(var E=PRt(o),R=0,G=E.length,le;R<G;R++)le=E[R],!RRt.call(h,le)&&le!==d&&AHe(h,le,{get:(Re=>o[Re]).bind(null,le),enumerable:!(g=CRt(o,le))||g.enumerable});return h},DHe=(h,o,d)=>(d=h!=null?IRt(NRt(h)):{},MRt(o||!h||!h.__esModule?AHe(d,"default",{value:h,enumerable:!0}):d,h)),TC=DHe(require("path")),LRt=DHe(require("fs"));function kRt(h){let o=(0,TC.normalize)(h);return o.length>1&&o[o.length-1]===TC.sep&&(o=o.substring(0,o.length-1)),o}var wRt=/[\\/]/g;function IHe(h,o){return h.replace(wRt,o)}var ORt=/^[a-z]:[\\/]$/i;function FRt(h){return h==="/"||ORt.test(h)}function aAe(h,o){let{resolvePaths:d,normalizePath:g,pathSeparator:E}=o,R=process.platform==="win32"&&h.includes("/")||h.startsWith(".");if(d&&(h=(0,TC.resolve)(h)),(g||R)&&(h=kRt(h)),h===".")return"";let G=h[h.length-1]!==E;return IHe(G?h+E:h,E)}function CHe(h,o){return o+h}function WRt(h,o){return function(d,g){return g.startsWith(h)?g.slice(h.length)+d:IHe((0,TC.relative)(h,g),o.pathSeparator)+o.pathSeparator+d}}function BRt(h){return h}function zRt(h,o,d){return o+h+d}function GRt(h,o){let{relativePaths:d,includeBasePath:g}=o;return d&&h?WRt(h,o):g?CHe:BRt}function VRt(h){return function(o,d){d.push(o.substring(h.length)||".")}}function jRt(h){return function(o,d,g){let E=o.substring(h.length)||".";g.every(R=>R(E,!0))&&d.push(E)}}var URt=(h,o)=>{o.push(h||".")},HRt=(h,o,d)=>{let g=h||".";d.every(E=>E(g,!0))&&o.push(g)},KRt=()=>{};function JRt(h,o){let{includeDirs:d,filters:g,relativePaths:E}=o;return d?E?g&&g.length?jRt(h):VRt(h):g&&g.length?HRt:URt:KRt}var qRt=(h,o,d,g)=>{g.every(E=>E(h,!1))&&d.files++},XRt=(h,o,d,g)=>{g.every(E=>E(h,!1))&&o.push(h)},$Rt=(h,o,d,g)=>{d.files++},YRt=(h,o)=>{o.push(h)},QRt=()=>{};function ZRt(h){let{excludeFiles:o,filters:d,onlyCounts:g}=h;return o?QRt:d&&d.length?g?qRt:XRt:g?$Rt:YRt}var eMt=h=>h,tMt=()=>[""].slice(0,0);function nMt(h){return h.group?tMt:eMt}var rMt=(h,o,d)=>{h.push({directory:o,files:d,dir:o})},iMt=()=>{};function oMt(h){return h.group?rMt:iMt}var aMt=function(h,o,d){let{queue:g,fs:E,options:{suppressErrors:R}}=o;g.enqueue(),E.realpath(h,(G,le)=>{if(G)return g.dequeue(R?null:G,o);E.stat(le,(Re,nt)=>{if(Re)return g.dequeue(R?null:Re,o);if(nt.isDirectory()&&PHe(h,le,o))return g.dequeue(null,o);d(nt,le),g.dequeue(null,o)})})},sMt=function(h,o,d){let{queue:g,fs:E,options:{suppressErrors:R}}=o;g.enqueue();try{let G=E.realpathSync(h),le=E.statSync(G);if(le.isDirectory()&&PHe(h,G,o))return;d(le,G)}catch(G){if(!R)throw G}};function lMt(h,o){return!h.resolveSymlinks||h.excludeSymlinks?null:o?sMt:aMt}function PHe(h,o,d){if(d.options.useRealPaths)return cMt(o,d);let g=(0,TC.dirname)(h),E=1;for(;g!==d.root&&E<2;){let R=d.symlinks.get(g);!!R&&(R===o||R.startsWith(o)||o.startsWith(R))?E++:g=(0,TC.dirname)(g)}return d.symlinks.set(h,o),E>1}function cMt(h,o){return o.visited.includes(h+o.options.pathSeparator)}var dMt=h=>h.counts,uMt=h=>h.groups,pMt=h=>h.paths,fMt=h=>h.paths.slice(0,h.options.maxFiles),mMt=(h,o,d)=>(QZ(o,d,h.counts,h.options.suppressErrors),null),_Mt=(h,o,d)=>(QZ(o,d,h.paths,h.options.suppressErrors),null),hMt=(h,o,d)=>(QZ(o,d,h.paths.slice(0,h.options.maxFiles),h.options.suppressErrors),null),gMt=(h,o,d)=>(QZ(o,d,h.groups,h.options.suppressErrors),null);function QZ(h,o,d,g){o(h&&!g?h:null,d)}function yMt(h,o){let{onlyCounts:d,group:g,maxFiles:E}=h;return d?o?dMt:mMt:g?o?uMt:gMt:E?o?fMt:hMt:o?pMt:_Mt}var NHe={withFileTypes:!0},vMt=(h,o,d,g,E)=>{if(h.queue.enqueue(),g<0)return h.queue.dequeue(null,h);let{fs:R}=h;h.visited.push(o),h.counts.directories++,R.readdir(o||".",NHe,(G,le=[])=>{E(le,d,g),h.queue.dequeue(h.options.suppressErrors?null:G,h)})},bMt=(h,o,d,g,E)=>{let{fs:R}=h;if(g<0)return;h.visited.push(o),h.counts.directories++;let G=[];try{G=R.readdirSync(o||".",NHe)}catch(le){if(!h.options.suppressErrors)throw le}E(G,d,g)};function SMt(h){return h?bMt:vMt}var TMt=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))}},EMt=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}},xMt=class{aborted=!1;abort(){this.aborted=!0}},RHe=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(h,o,d){this.isSynchronous=!d,this.callbackInvoker=yMt(o,this.isSynchronous),this.root=aAe(h,o),this.state={root:FRt(this.root)?this.root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new EMt,options:o,queue:new TMt((g,E)=>this.callbackInvoker(E,g,d)),symlinks:new Map,visited:[""].slice(0,0),controller:new xMt,fs:o.fs||LRt},this.joinPath=GRt(this.root,o),this.pushDirectory=JRt(this.root,o),this.pushFile=ZRt(o),this.getArray=nMt(o),this.groupFiles=oMt(o),this.resolveSymlink=lMt(o,this.isSynchronous),this.walkDirectory=SMt(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,d)=>{let{paths:g,options:{filters:E,resolveSymlinks:R,excludeSymlinks:G,exclude:le,maxFiles:Re,signal:nt,useRealPaths:at,pathSeparator:dt},controller:xe}=this.state;if(xe.aborted||nt&&nt.aborted||Re&&g.length>Re)return;let gn=this.getArray(this.state.paths);for(let pt=0;pt<h.length;++pt){let ut=h[pt];if(ut.isFile()||ut.isSymbolicLink()&&!R&&!G){let yi=this.joinPath(ut.name,o);this.pushFile(yi,gn,this.state.counts,E)}else if(ut.isDirectory()){let yi=zRt(ut.name,o,this.state.options.pathSeparator);if(le&&le(ut.name,yi))continue;this.pushDirectory(yi,g,E),this.walkDirectory(this.state,yi,yi,d-1,this.walk)}else if(this.resolveSymlink&&ut.isSymbolicLink()){let yi=CHe(ut.name,o);this.resolveSymlink(yi,this.state,(wi,eo)=>{if(wi.isDirectory()){if(eo=aAe(eo,this.state.options),le&&le(ut.name,at?eo:yi+dt))return;this.walkDirectory(this.state,eo,at?eo:yi+dt,d-1,this.walk)}else{eo=at?eo:yi;let qa=(0,TC.basename)(eo),bl=aAe((0,TC.dirname)(eo),this.state.options);eo=this.joinPath(qa,bl),this.pushFile(eo,gn,this.state.counts,E)}})}}this.groupFiles(this.state.groups,o,gn)}};function AMt(h,o){return new Promise((d,g)=>{MHe(h,o,(E,R)=>{if(E)return g(E);d(R)})})}function MHe(h,o,d){new RHe(h,o,d).start()}function DMt(h,o){return new RHe(h,o).start()}var xHe=class{constructor(h,o){this.root=h,this.options=o}withPromise(){return AMt(this.root,this.options)}withCallback(h){MHe(this.root,this.options,h)}sync(){return DMt(this.root,this.options)}},LHe=null;try{require.resolve("picomatch"),LHe=oAe()}catch{}var IMt=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:TC.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 xHe(h||".",this.options)}withGlobFunction(h){return this.globFunction=h,this}crawlWithOptions(h,o){return this.options={...this.options,...o},new xHe(h||".",this.options)}glob(...h){return this.globFunction?this.globWithOptions(h):this.globWithOptions(h,{dot:!0})}globWithOptions(h,...o){let d=this.globFunction||LHe;if(!d)throw new Error("Please specify a glob function to use glob matching.");var g=this.globCache[h.join("\0")];return g||(g=d(h,...o),this.globCache[h.join("\0")]=g),this.options.filters.push(E=>g(E)),this}};kHe.fdir=IMt});var JHe=zm(lw=>{Object.defineProperty(lw,Symbol.toStringTag,{value:"Module"});var CMt=Object.create,FHe=Object.defineProperty,PMt=Object.getOwnPropertyDescriptor,NMt=Object.getOwnPropertyNames,RMt=Object.getPrototypeOf,MMt=Object.prototype.hasOwnProperty,LMt=(h,o,d,g)=>{if(o&&typeof o=="object"||typeof o=="function")for(var E=NMt(o),R=0,G=E.length,le;R<G;R++)le=E[R],!MMt.call(h,le)&&le!==d&&FHe(h,le,{get:(Re=>o[Re]).bind(null,le),enumerable:!(g=PMt(o,le))||g.enumerable});return h},kMt=(h,o,d)=>(d=h!=null?CMt(RMt(h)):{},LMt(o||!h||!h.__esModule?FHe(d,"default",{value:h,enumerable:!0}):d,h)),B8=require("fs"),EC=require("path"),wMt=require("url"),OMt=wHe(),sw=oAe();sw=kMt(sw);var FMt=Array.isArray,WHe=/\\/g,lAe=process.platform==="win32",WMt=/^(\/?\.\.)+$/;function BMt(h,o={}){let d=h.length,g=Array(d),E=Array(d),R,G;for(R=0;R<d;R++){let le=BHe(h[R]);g[R]=le;let Re=le.length,nt=Array(Re);for(G=0;G<Re;G++)nt[G]=(0,sw.default)(le[G],o);E[R]=nt}return le=>{let Re=le.split("/");if(Re[0]===".."&&WMt.test(le))return!0;for(R=0;R<d;R++){let nt=g[R],at=E[R],dt=Re.length,xe=Math.min(dt,nt.length);for(G=0;G<xe;){let gn=nt[G];if(gn.includes("/"))return!0;if(!at[G](Re[G]))break;if(!o.noglobstar&&gn==="**")return!0;G++}if(G===dt)return!0}return!1}}var zMt=/^[A-Z]:\/$/i,GMt=lAe?h=>zMt.test(h):h=>h==="/";function OHe(h,o,d){if(h===o||o.startsWith(`${h}/`)){if(d){let E=h.length+ +!GMt(h);return(R,G)=>R.slice(E,G?-1:void 0)||"."}let g=o.slice(h.length+1);return g?(E,R)=>{if(E===".")return g;let G=`${g}/${E}`;return R?G.slice(0,-1):G}:(E,R)=>R&&E!=="."?E.slice(0,-1):E}return d?g=>EC.posix.relative(h,g)||".":g=>EC.posix.relative(h,`${o}/${g}`)||"."}function VMt(h,o){if(o.startsWith(`${h}/`)){let d=o.slice(h.length+1);return g=>`${d}/${g}`}return d=>{let g=EC.posix.relative(h,`${o}/${d}`);return d[d.length-1]==="/"&&g!==""?`${g}/`:g||"."}}var jMt={parts:!0};function BHe(h){var o;let d=sw.default.scan(h,jMt);return!((o=d.parts)===null||o===void 0)&&o.length?d.parts:[h]}var UMt=/\\(?![()[\]{}!+@])/g;function HMt(h){return zHe(h)}function KMt(h){return GHe(h).replace(UMt,"/")}var JMt=lAe?KMt:HMt,qMt=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,XMt=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,zHe=h=>h.replace(qMt,"\\$&"),GHe=h=>h.replace(XMt,"\\$&"),VHe=lAe?GHe:zHe;function jHe(h,o){if(o?.caseSensitiveMatch===!1)return!0;let d=sw.default.scan(h);return d.isGlob||d.negated}function z5(...h){console.log(`[tinyglobby ${new Date().toLocaleTimeString("es")}]`,...h)}function UHe(h){return typeof h=="string"?[h]:h??[]}var $Mt=/^(\/?\.\.)+/,YMt=/\\(?=[()[\]{}!*+?@|])/g;function sAe(h,o,d,g){var E;let R=o.cwd,G=h;h[h.length-1]==="/"&&(G=h.slice(0,-1)),G[G.length-1]!=="*"&&o.expandDirectories&&(G+="/**");let le=VHe(R);G=(0,EC.isAbsolute)(G.replace(YMt,""))?EC.posix.relative(le,G):EC.posix.normalize(G);let Re=(E=$Mt.exec(G))===null||E===void 0?void 0:E[0],nt=BHe(G);if(Re){let dt=(Re.length+1)/3,xe=0,gn=le.split("/");for(;xe<dt&&nt[xe+dt]===gn[gn.length+xe-dt];)G=G.slice(0,(dt-xe-1)*3)+G.slice((dt-xe)*3+nt[xe+dt].length+1)||".",xe++;let pt=EC.posix.join(R,Re.slice(xe*3));pt[0]!=="."&&d.root.length>pt.length&&(d.root=pt,d.depthOffset=-dt+xe)}if(!g&&d.depthOffset>=0){var at;(at=d.commonPath)!==null&&at!==void 0||(d.commonPath=nt);let dt=[],xe=Math.min(d.commonPath.length,nt.length);for(let gn=0;gn<xe;gn++){let pt=nt[gn];if(pt==="**"&&!nt[gn+1]){dt.pop();break}if(gn===nt.length-1||pt!==d.commonPath[gn]||jHe(pt))break;dt.push(pt)}d.depthOffset=dt.length,d.commonPath=dt,d.root=dt.length>0?EC.posix.join(R,...dt):R}return G}function QMt(h,o,d){let g=[],E=[];for(let R of h.ignore)R&&(R[0]!=="!"||R[1]==="(")&&E.push(sAe(R,h,d,!0));for(let R of o)R&&(R[0]!=="!"||R[1]==="("?g.push(sAe(R,h,d,!1)):(R[1]!=="!"||R[2]==="(")&&E.push(sAe(R.slice(1),h,d,!0)));return{match:g,ignore:E}}function ZMt(h,o){let d=h.cwd,g={root:d,depthOffset:0},E=QMt(h,o,g);h.debug&&z5("internal processing patterns:",E);let{absolute:R,caseSensitiveMatch:G,debug:le,dot:Re,followSymbolicLinks:nt,onlyDirectories:at}=h,dt=g.root.replace(WHe,""),xe={dot:Re,nobrace:h.braceExpansion===!1,nocase:!G,noextglob:h.extglob===!1,noglobstar:h.globstar===!1,posix:!0},gn=(0,sw.default)(E.match,xe),pt=(0,sw.default)(E.ignore,xe),ut=BMt(E.match,xe),yi=OHe(d,dt,R),wi=R?yi:OHe(d,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-g.depthOffset));let bl=new OMt.fdir({filters:[le?(Sa,Lr)=>{let In=yi(Sa,Lr),Ii=gn(In)&&!pt(In);return Ii&&z5(`matched ${In}`),Ii}:(Sa,Lr)=>{let In=yi(Sa,Lr);return gn(In)&&!pt(In)}],exclude:le?(Sa,Lr)=>{let In=eo(Sa,Lr);return z5(`${In?"skipped":"crawling"} ${Lr}`),In}:eo,fs:h.fs,pathSeparator:"/",relativePaths:!R,resolvePaths:R,includeBasePath:R,resolveSymlinks:nt,excludeSymlinks:!nt,excludeFiles:at,includeDirs:at||!h.onlyFiles,maxDepth:qa,signal:h.signal}).crawl(dt);return h.debug&&z5("internal properties:",{...g,root:dt}),[bl,d!==dt&&!R&&VMt(d,dt)]}function HHe(h,o){if(o)for(let d=h.length-1;d>=0;d--)h[d]=o(h[d]);return h}var eLt={caseSensitiveMatch:!0,cwd:process.cwd(),debug:!!process.env.TINYGLOBBY_DEBUG,expandDirectories:!0,followSymbolicLinks:!0,onlyFiles:!0};function tLt(h){let o={...eLt,...h};return o.cwd=(o.cwd instanceof URL?(0,wMt.fileURLToPath)(o.cwd):(0,EC.resolve)(o.cwd)).replace(WHe,"/"),o.ignore=UHe(o.ignore),o.fs&&(o.fs={readdir:o.fs.readdir||B8.readdir,readdirSync:o.fs.readdirSync||B8.readdirSync,realpath:o.fs.realpath||B8.realpath,realpathSync:o.fs.realpathSync||B8.realpathSync,stat:o.fs.stat||B8.stat,statSync:o.fs.statSync||B8.statSync}),o.debug&&z5("globbing with options:",o),o}function KHe(h,o={}){var d;if(h&&o?.patterns)throw new Error("Cannot pass patterns as both an argument and an option");let g=FMt(h)||typeof h=="string",E=UHe((d=g?h:h.patterns)!==null&&d!==void 0?d:"**/*"),R=tLt(g?o:h);return E.length>0?ZMt(R,E):[]}async function nLt(h,o){let[d,g]=KHe(h,o);return d?HHe(await d.withPromise(),g):[]}function rLt(h,o){let[d,g]=KHe(h,o);return d?HHe(d.sync(),g):[]}lw.convertPathToPattern=JMt;lw.escapePath=VHe;lw.glob=nLt;lw.globSync=rLt;lw.isDynamicPattern=jHe});var lKe=zm(Zo=>{"use strict";var Rv=IUe(),iLt=$Ue(),oLt=ZUe(),aLt=require("node:fs"),sLt=require("node:fs/promises"),lLt=require("node:os"),cLt=require("node:path"),qHe=JHe();function dLt(h){return h&&typeof h=="object"&&"default"in h?h:{default:h}}function G8(h){if(h&&typeof h=="object"&&"default"in h)return h;var o=Object.create(null);return h&&Object.keys(h).forEach(function(d){if(d!=="default"){var g=Object.getOwnPropertyDescriptor(h,d);Object.defineProperty(o,d,g.get?g:{enumerable:!0,get:function(){return h[d]}})}}),o.default=h,Object.freeze(o)}var mT=G8(Rv),QHe=G8(iLt),cAe=dLt(oLt),Nv=G8(aLt),uLt=G8(sLt),pLt=G8(lLt),ZZ=G8(cLt),eee=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,d){let g=this.get(o);return g==null&&(g=d(),this.set(o,g)),g}has(o){return this.#e.has(o)}get(o){return this.#e.get(o)}set(o,d){this.#e.set(o,d)}replaceKey(o,d){if(!this.#e.has(o))throw new Error("Key not found.");let g=this.#e.get(o);this.#e.delete(o),this.#e.set(d,g)}removeByKey(o){this.#e.delete(o)}clear(){this.#e.clear()}},tee=class{#e;#t;constructor(o,d){this.#e=o,this.#t=d}compareTo(o){return this.#e.compareTo(this.#t,o)}},nee=class h{static instance=new h;compareTo(o,d){let g=o.localeCompare(d,"en-us-u-kf-upper");return g<0?-1:g===0?0:1}},ree=class{#e;#t;constructor(o,d){this.#t=o,this.#e=d}compareTo(o,d){return this.#e.compareTo(this.#t(o),this.#t(d))}},iee=class{#e;#t;constructor(o,d){this.#t=o,this.#e=d}compareTo(o){return this.#e.compareTo(this.#t(o))}},ZE=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((d,g)=>o.indexOf(d)===g)}static removeFirst(o,d){let g=o.indexOf(d);return g===-1?!1:(o.splice(g,1),!0)}static removeAll(o,d){let g=[];for(let E=o.length-1;E>=0;E--)d(o[E])&&(g.push(o[E]),o.splice(E,1));return g}static*toIterator(o){for(let d of o)yield d}static sortByProperty(o,d){return o.sort((g,E)=>d(g)<=d(E)?-1:1),o}static groupBy(o,d){let g=[],E={};for(let R of o){let G=d(R).toString();E[G]==null&&(E[G]=[],g.push(E[G])),E[G].push(R)}return g}static binaryInsertWithOverwrite(o,d,g){let E=o.length-1,R=0;for(;R<=E;){let G=Math.floor((E+R)/2);g.compareTo(d,o[G])<0?E=G-1:R=G+1}o[E]!=null&&g.compareTo(d,o[E])===0?o[E]=d:o.splice(E+1,0,d)}static binarySearch(o,d){let g=o.length-1,E=0;for(;E<=g;){let R=Math.floor((g+E)/2),G=d.compareTo(o[R]);if(G===0)return R;G<0?g=R-1:E=R+1}return-1}static containsSubArray(o,d){let g=0;for(let E of o)if(d[g]===E){if(g++,g===d.length)return!0}else g=0;return!1}};function ZHe(h){return o(h);function o(E){let R=Object.create(E.constructor.prototype);for(let G of Object.keys(E))R[G]=g(E[G]);return R}function d(E){return E.map(g)}function g(E){return E instanceof Array?d(E):typeof E=="object"?E===null?E:o(E):E}}var oee=class{#e=[];subscribe(o){this.#t(o)===-1&&this.#e.push(o)}unsubscribe(o){let d=this.#t(o);d>=0&&this.#e.splice(d,1)}fire(o){for(let d of this.#e)d(o)}#t(o){return this.#e.indexOf(o)}},pAe=class{static find(o,d){for(let g of o)if(d(g))return g}};function fAe(h,o){return o??h}var mAe=class h{constructor(){}static clone(o){if(o==null)return;if(o instanceof Array)return d(o);return Object.assign({},o);function d(g){return g.map(E=>h.clone(E))}}};function eKe(h,o,d,g,E,R,G,le,Re,nt){return mT.matchFiles.apply(this,arguments)}function tKe(h,o,d,g,E){return mT.getFileMatcherPatterns.apply(this,arguments)}function fLt(h){return mT.getEmitModuleResolutionKind.apply(this,arguments)}function nKe(h){return mLt()[h]}var z8;function mLt(){if(z8!=null)return z8;z8={};for(let h of Object.keys(mT.SyntaxKind).filter(o=>isNaN(parseInt(o,10)))){let o=mT.SyntaxKind[h];z8[o]==null&&(z8[o]=h)}return z8}Zo.errors=void 0;(function(h){class o extends Error{constructor(Ii,_i){let Fr=_i&&_Lt(_i),bi=Fr?`${Ii}
|
|
434
434
|
|
|
435
435
|
${Fr}`:Ii;super(bi),this.message=bi}}h.BaseError=o;class d extends o{constructor(Ii,_i,Fr){super(`Argument Error (${Ii}): ${_i}`,Fr)}}h.ArgumentError=d;class g extends d{constructor(Ii,_i){super(Ii,"Cannot be null or whitespace.",_i)}}h.ArgumentNullOrWhitespaceError=g;class E extends d{constructor(Ii,_i,Fr,bi){super(Ii,`Range is ${Fr[0]} to ${Fr[1]}, but ${_i} was provided.`,bi)}}h.ArgumentOutOfRangeError=E;class R extends d{constructor(Ii,_i,Fr,bi){super(Ii,`Expected type '${_i}', but was '${Fr}'.`,bi)}}h.ArgumentTypeError=R;class G extends o{path;constructor(Ii,_i="Path"){super(`${_i} not found: ${Ii}`),this.path=Ii}code="ENOENT"}h.PathNotFoundError=G;class le extends G{constructor(Ii){super(Ii,"Directory")}}h.DirectoryNotFoundError=le;class Re extends G{constructor(Ii){super(Ii,"File")}}h.FileNotFoundError=Re;class nt extends o{constructor(Ii,_i){super(Ii,_i)}}h.InvalidOperationError=nt;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 R(_i,Ii,typeof In)}h.throwIfNotType=xe;function gn(In,Ii){if(typeof In!="string")throw new R(Ii,"string",typeof In)}h.throwIfNotString=gn;function pt(In,Ii){if(gn(In,Ii),In.trim().length===0)throw new g(Ii)}h.throwIfWhitespaceOrNotString=pt;function ut(In,Ii,_i){if(In<Ii[0]||In>Ii[1])throw new E(_i,In,Ii)}h.throwIfOutOfRange=ut;function yi(In,Ii,_i){if(In[0]>In[1])throw new d(_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 '${nKe(In)}'.`,Ii)}h.throwNotImplementedForSyntaxKindError=wi;function eo(In,Ii){if(In<0)throw new d(Ii,"Expected a non-negative value.")}h.throwIfNegative=eo;function qa(In,Ii,_i){if(In==null)throw new nt(typeof Ii=="string"?Ii:Ii(),_i);return In}h.throwIfNullOrUndefined=qa;function bl(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=bl;function Sa(In,Ii,_i){if(In!==Ii)throw new nt(`Expected ${In} to equal ${Ii}. ${_i}`)}h.throwIfNotEqual=Sa;function Lr(In,Ii){if(In===!0)throw new nt(Ii)}h.throwIfTrue=Lr})(Zo.errors||(Zo.errors={}));function _Lt(h){let o=hLt(h);if(o)return`${o.filePath}:${o.loc.line}:${o.loc.character}
|
|
436
436
|
> ${o.loc.line} | ${o.lineText}`}function hLt(h){if(!gLt(h))return;let o=h.getSourceFile(),d=o.getFullText(),g=h.getStart(),E=d.lastIndexOf(`
|